提交 7b67e43c 编写于 作者: W wpan

Merge branch 'develop' into feature/TD-2581

...@@ -144,6 +144,9 @@ keepColumnName 1 ...@@ -144,6 +144,9 @@ keepColumnName 1
# max length of an SQL # max length of an SQL
# maxSQLLength 65480 # maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting # the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000 # maxNumOfOrderedRes 100000
......
...@@ -339,6 +339,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { ...@@ -339,6 +339,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
const char* msg = (sub->cmd.command == TSDB_SQL_STABLEVGROUP)? "vgroup-list":"multi-tableMeta"; const char* msg = (sub->cmd.command == TSDB_SQL_STABLEVGROUP)? "vgroup-list":"multi-tableMeta";
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
tscError("0x%"PRIx64" get %s failed, code:%s", pSql->self, msg, tstrerror(code)); tscError("0x%"PRIx64" get %s failed, code:%s", pSql->self, msg, tstrerror(code));
if (code == TSDB_CODE_RPC_FQDN_ERROR) {
size_t sz = strlen(tscGetErrorMsgPayload(&sub->cmd));
tscAllocPayload(&pSql->cmd, (int)sz + 1);
memcpy(tscGetErrorMsgPayload(&pSql->cmd), tscGetErrorMsgPayload(&sub->cmd), sz);
}
goto _error; goto _error;
} }
......
...@@ -88,7 +88,6 @@ static uint8_t convertRelationalOperator(SStrToken *pToken); ...@@ -88,7 +88,6 @@ static uint8_t convertRelationalOperator(SStrToken *pToken);
static int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pSelNodeList, bool isSTable, bool joinQuery, bool timeWindowQuery); static int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pSelNodeList, bool isSTable, bool joinQuery, bool timeWindowQuery);
static bool validateIpAddress(const char* ip, size_t size);
static bool hasUnsupportFunctionsForSTableQuery(SSqlCmd* pCmd, SQueryInfo* pQueryInfo); static bool hasUnsupportFunctionsForSTableQuery(SSqlCmd* pCmd, SQueryInfo* pQueryInfo);
static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool twQuery); static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool twQuery);
...@@ -3225,7 +3224,6 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -3225,7 +3224,6 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
const char* msg1 = "invalid name"; const char* msg1 = "invalid name";
const char* msg2 = "pattern filter string too long"; const char* msg2 = "pattern filter string too long";
const char* msg3 = "database name too long"; const char* msg3 = "database name too long";
const char* msg4 = "invalid ip address";
const char* msg5 = "database name is empty"; const char* msg5 = "database name is empty";
const char* msg6 = "pattern string is empty"; const char* msg6 = "pattern string is empty";
...@@ -3273,17 +3271,11 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -3273,17 +3271,11 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
} }
} else if (showType == TSDB_MGMT_TABLE_VNODES) { } else if (showType == TSDB_MGMT_TABLE_VNODES) {
if (pShowInfo->prefix.type == 0) { if (pShowInfo->prefix.type == 0) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "No specified ip of dnode"); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "No specified dnode ep");
} }
// show vnodes may be ip addr of dnode in payload if (pShowInfo->prefix.type == TK_STRING) {
SStrToken* pDnodeIp = &pShowInfo->prefix; pShowInfo->prefix.n = strdequote(pShowInfo->prefix.z);
if (pDnodeIp->n >= TSDB_IPv4ADDR_LEN) { // ip addr is too long
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3);
}
if (!validateIpAddress(pDnodeIp->z, pDnodeIp->n)) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4);
} }
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -3336,16 +3328,6 @@ static int32_t setCompactVnodeInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -3336,16 +3328,6 @@ static int32_t setCompactVnodeInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
bool validateIpAddress(const char* ip, size_t size) {
char tmp[128] = {0}; // buffer to build null-terminated string
assert(size < 128);
strncpy(tmp, ip, size);
in_addr_t epAddr = taosInetAddr(tmp);
return epAddr != INADDR_NONE;
}
int32_t tscTansformFuncForSTableQuery(SQueryInfo* pQueryInfo) { int32_t tscTansformFuncForSTableQuery(SQueryInfo* pQueryInfo) {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
...@@ -4482,15 +4464,17 @@ static int32_t validateNullExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t ...@@ -4482,15 +4464,17 @@ static int32_t validateNullExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t
// check for like expression // check for like expression
static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) { static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) {
const char* msg1 = "wildcard string should be less than 20 characters"; const char* msg1 = "wildcard string should be less than %d characters";
const char* msg2 = "illegal column type for like"; const char* msg2 = "illegal column type for like";
tSqlExpr* pLeft = pExpr->pLeft; tSqlExpr* pLeft = pExpr->pLeft;
tSqlExpr* pRight = pExpr->pRight; tSqlExpr* pRight = pExpr->pRight;
if (pExpr->tokenId == TK_LIKE) { if (pExpr->tokenId == TK_LIKE) {
if (pRight->value.nLen > TSDB_PATTERN_STRING_MAX_LEN) { if (pRight->value.nLen > tsMaxWildCardsLen) {
return invalidOperationMsg(msgBuf, msg1); char tmp[64] = {0};
sprintf(tmp, msg1, tsMaxWildCardsLen);
return invalidOperationMsg(msgBuf, tmp);
} }
SSchema* pSchema = tscGetTableSchema(pTableMeta); SSchema* pSchema = tscGetTableSchema(pTableMeta);
...@@ -7838,6 +7822,8 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { ...@@ -7838,6 +7822,8 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
const char* msg6 = "from missing in subclause"; const char* msg6 = "from missing in subclause";
const char* msg7 = "time interval is required"; const char* msg7 = "time interval is required";
const char* msg8 = "the first column should be primary timestamp column"; const char* msg8 = "the first column should be primary timestamp column";
const char* msg9 = "Continuous query do not support sub query";
const char* msg10 = "illegal number of columns";
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
SQueryInfo* pQueryInfo = tscGetQueryInfo(pCmd); SQueryInfo* pQueryInfo = tscGetQueryInfo(pCmd);
...@@ -7858,7 +7844,11 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { ...@@ -7858,7 +7844,11 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
if (pFromInfo == NULL || taosArrayGetSize(pFromInfo->list) == 0) { if (pFromInfo == NULL || taosArrayGetSize(pFromInfo->list) == 0) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6);
} }
if (pFromInfo->type == SQL_NODE_FROM_SUBQUERY){
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg9);
}
SRelElementPair* p1 = taosArrayGet(pFromInfo->list, 0); SRelElementPair* p1 = taosArrayGet(pFromInfo->list, 0);
SStrToken srcToken = {.z = p1->tableName.z, .n = p1->tableName.n, .type = TK_STRING}; SStrToken srcToken = {.z = p1->tableName.z, .n = p1->tableName.n, .type = TK_STRING};
if (tscValidateName(&srcToken) != TSDB_CODE_SUCCESS) { if (tscValidateName(&srcToken) != TSDB_CODE_SUCCESS) {
...@@ -7920,7 +7910,9 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { ...@@ -7920,7 +7910,9 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
pCmd->numOfCols = pQueryInfo->fieldsInfo.numOfOutput; if (pQueryInfo->fieldsInfo.numOfOutput <= 1) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg10);
}
if (validateSqlFunctionInStreamSql(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS) { if (validateSqlFunctionInStreamSql(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
......
...@@ -501,6 +501,15 @@ static void doProcessMsgFromServer(SSchedMsg* pSchedMsg) { ...@@ -501,6 +501,15 @@ static void doProcessMsgFromServer(SSchedMsg* pSchedMsg) {
pRes->code = rpcMsg->code; pRes->code = rpcMsg->code;
} }
rpcMsg->code = (pRes->code == TSDB_CODE_SUCCESS) ? (int32_t)pRes->numOfRows : pRes->code; rpcMsg->code = (pRes->code == TSDB_CODE_SUCCESS) ? (int32_t)pRes->numOfRows : pRes->code;
if (pRes->code == TSDB_CODE_RPC_FQDN_ERROR) {
if (pEpSet) {
char buf[TSDB_FQDN_LEN + 64] = {0};
tscAllocPayload(pCmd, sizeof(buf));
sprintf(tscGetErrorMsgPayload(pCmd), "%s\"%s\"", tstrerror(pRes->code),pEpSet->fqdn[(pEpSet->inUse)%(pEpSet->numOfEps)]);
} else {
sprintf(tscGetErrorMsgPayload(pCmd), "%s", tstrerror(pRes->code));
}
}
(*pSql->fp)(pSql->param, pSql, rpcMsg->code); (*pSql->fp)(pSql->param, pSql, rpcMsg->code);
} }
......
...@@ -196,6 +196,11 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass, ...@@ -196,6 +196,11 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
if (pSql->res.code != TSDB_CODE_SUCCESS) { if (pSql->res.code != TSDB_CODE_SUCCESS) {
terrno = pSql->res.code; terrno = pSql->res.code;
if (terrno ==TSDB_CODE_RPC_FQDN_ERROR) {
printf("taos connect failed, reason: %s\n\n", taos_errstr(pSql));
} else {
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno));
}
taos_free_result(pSql); taos_free_result(pSql);
taos_close(pObj); taos_close(pObj);
return NULL; return NULL;
...@@ -643,7 +648,7 @@ char *taos_errstr(TAOS_RES *tres) { ...@@ -643,7 +648,7 @@ char *taos_errstr(TAOS_RES *tres) {
return (char*) tstrerror(terrno); return (char*) tstrerror(terrno);
} }
if (hasAdditionalErrorInfo(pSql->res.code, &pSql->cmd)) { if (hasAdditionalErrorInfo(pSql->res.code, &pSql->cmd) || pSql->res.code == TSDB_CODE_RPC_FQDN_ERROR) {
return pSql->cmd.payload; return pSql->cmd.payload;
} else { } else {
return (char*)tstrerror(pSql->res.code); return (char*)tstrerror(pSql->res.code);
......
...@@ -70,6 +70,7 @@ extern int8_t tsKeepOriginalColumnName; ...@@ -70,6 +70,7 @@ extern int8_t tsKeepOriginalColumnName;
// client // client
extern int32_t tsMaxSQLStringLen; extern int32_t tsMaxSQLStringLen;
extern int32_t tsMaxWildCardsLen;
extern int8_t tsTscEnableRecordSql; extern int8_t tsTscEnableRecordSql;
extern int32_t tsMaxNumOfOrderedResults; extern int32_t tsMaxNumOfOrderedResults;
extern int32_t tsMinSlidingTime; extern int32_t tsMinSlidingTime;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "tutil.h" #include "tutil.h"
#include "tlocale.h" #include "tlocale.h"
#include "ttimezone.h" #include "ttimezone.h"
#include "tcompare.h"
// cluster // cluster
char tsFirst[TSDB_EP_LEN] = {0}; char tsFirst[TSDB_EP_LEN] = {0};
...@@ -75,6 +76,7 @@ int32_t tsCompressMsgSize = -1; ...@@ -75,6 +76,7 @@ int32_t tsCompressMsgSize = -1;
// client // client
int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN; int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN;
int32_t tsMaxWildCardsLen = TSDB_PATTERN_STRING_MAX_LEN;
int8_t tsTscEnableRecordSql = 0; int8_t tsTscEnableRecordSql = 0;
// the maximum number of results for projection query on super table that are returned from // the maximum number of results for projection query on super table that are returned from
...@@ -984,6 +986,16 @@ static void doInitGlobalConfig(void) { ...@@ -984,6 +986,16 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_BYTE; cfg.unitType = TAOS_CFG_UTYPE_BYTE;
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
cfg.option = "maxWildCardsLength";
cfg.ptr = &tsMaxWildCardsLen;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0;
cfg.maxValue = TSDB_MAX_ALLOWED_SQL_LEN;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_BYTE;
taosInitConfigOption(cfg);
cfg.option = "maxNumOfOrderedRes"; cfg.option = "maxNumOfOrderedRes";
cfg.ptr = &tsMaxNumOfOrderedResults; cfg.ptr = &tsMaxNumOfOrderedResults;
cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.valType = TAOS_CFG_VTYPE_INT32;
...@@ -1531,6 +1543,7 @@ static void doInitGlobalConfig(void) { ...@@ -1531,6 +1543,7 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE; cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
assert(tsGlobalConfigNum <= TSDB_CFG_MAX_NUM);
#ifdef TD_TSZ #ifdef TD_TSZ
// lossy compress // lossy compress
cfg.option = "lossyColumns"; cfg.option = "lossyColumns";
......
...@@ -113,7 +113,6 @@ ...@@ -113,7 +113,6 @@
</includes> </includes>
<excludes> <excludes>
<exclude>**/AppMemoryLeakTest.java</exclude> <exclude>**/AppMemoryLeakTest.java</exclude>
<exclude>**/AuthenticationTest.java</exclude>
<exclude>**/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java</exclude> <exclude>**/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java</exclude>
<exclude>**/DatetimeBefore1970Test.java</exclude> <exclude>**/DatetimeBefore1970Test.java</exclude>
<exclude>**/FailOverTest.java</exclude> <exclude>**/FailOverTest.java</exclude>
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
*****************************************************************************/ *****************************************************************************/
package com.taosdata.jdbc; package com.taosdata.jdbc;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.sql.*; import java.sql.*;
import java.util.*; import java.util.*;
import java.util.logging.Logger; import java.util.logging.Logger;
...@@ -127,6 +129,11 @@ public class TSDBDriver extends AbstractDriver { ...@@ -127,6 +129,11 @@ public class TSDBDriver extends AbstractDriver {
return null; return null;
} }
if (!props.containsKey(TSDBDriver.PROPERTY_KEY_USER))
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_USER_IS_REQUIRED);
if (!props.containsKey(TSDBDriver.PROPERTY_KEY_PASSWORD))
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PASSWORD_IS_REQUIRED);
try { try {
TSDBJNIConnector.init((String) props.get(PROPERTY_KEY_CONFIG_DIR), (String) props.get(PROPERTY_KEY_LOCALE), TSDBJNIConnector.init((String) props.get(PROPERTY_KEY_CONFIG_DIR), (String) props.get(PROPERTY_KEY_LOCALE),
(String) props.get(PROPERTY_KEY_CHARSET), (String) props.get(PROPERTY_KEY_TIME_ZONE)); (String) props.get(PROPERTY_KEY_CHARSET), (String) props.get(PROPERTY_KEY_TIME_ZONE));
......
...@@ -33,6 +33,8 @@ public class TSDBError { ...@@ -33,6 +33,8 @@ public class TSDBError {
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_NUMERIC_VALUE_OUT_OF_RANGE, "numeric value out of range"); TSDBErrorMap.put(TSDBErrorNumbers.ERROR_NUMERIC_VALUE_OUT_OF_RANGE, "numeric value out of range");
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN_TAOS_TYPE, "unknown taos type in tdengine"); TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN_TAOS_TYPE, "unknown taos type in tdengine");
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN_TIMESTAMP_PRECISION, "unknown timestamp precision"); TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN_TIMESTAMP_PRECISION, "unknown timestamp precision");
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_USER_IS_REQUIRED, "user is required");
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_PASSWORD_IS_REQUIRED, "password is required");
TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN, "unknown error"); TSDBErrorMap.put(TSDBErrorNumbers.ERROR_UNKNOWN, "unknown error");
......
...@@ -29,6 +29,9 @@ public class TSDBErrorNumbers { ...@@ -29,6 +29,9 @@ public class TSDBErrorNumbers {
public static final int ERROR_UNKNOWN_TIMESTAMP_PRECISION = 0x2316; // unknown timestamp precision public static final int ERROR_UNKNOWN_TIMESTAMP_PRECISION = 0x2316; // unknown timestamp precision
public static final int ERROR_RESTFul_Client_Protocol_Exception = 0x2317; public static final int ERROR_RESTFul_Client_Protocol_Exception = 0x2317;
public static final int ERROR_RESTFul_Client_IOException = 0x2318; public static final int ERROR_RESTFul_Client_IOException = 0x2318;
public static final int ERROR_USER_IS_REQUIRED = 0x2319; // user is required
public static final int ERROR_PASSWORD_IS_REQUIRED = 0x231a; // password is required
public static final int ERROR_UNKNOWN = 0x2350; //unknown error public static final int ERROR_UNKNOWN = 0x2350; //unknown error
...@@ -67,6 +70,8 @@ public class TSDBErrorNumbers { ...@@ -67,6 +70,8 @@ public class TSDBErrorNumbers {
errorNumbers.add(ERROR_UNKNOWN_TAOS_TYPE); errorNumbers.add(ERROR_UNKNOWN_TAOS_TYPE);
errorNumbers.add(ERROR_UNKNOWN_TIMESTAMP_PRECISION); errorNumbers.add(ERROR_UNKNOWN_TIMESTAMP_PRECISION);
errorNumbers.add(ERROR_RESTFul_Client_IOException); errorNumbers.add(ERROR_RESTFul_Client_IOException);
errorNumbers.add(ERROR_USER_IS_REQUIRED);
errorNumbers.add(ERROR_PASSWORD_IS_REQUIRED);
errorNumbers.add(ERROR_RESTFul_Client_Protocol_Exception); errorNumbers.add(ERROR_RESTFul_Client_Protocol_Exception);
......
...@@ -36,7 +36,6 @@ public class TSDBJNIConnector { ...@@ -36,7 +36,6 @@ public class TSDBJNIConnector {
static { static {
System.loadLibrary("taos"); System.loadLibrary("taos");
System.out.println("java.library.path:" + System.getProperty("java.library.path"));
} }
public boolean isClosed() { public boolean isClosed() {
......
...@@ -7,6 +7,7 @@ import com.taosdata.jdbc.utils.HttpClientPoolUtil; ...@@ -7,6 +7,7 @@ import com.taosdata.jdbc.utils.HttpClientPoolUtil;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.sql.*; import java.sql.*;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Logger; import java.util.logging.Logger;
...@@ -40,8 +41,13 @@ public class RestfulDriver extends AbstractDriver { ...@@ -40,8 +41,13 @@ public class RestfulDriver extends AbstractDriver {
String loginUrl = "http://" + host + ":" + port + "/rest/login/" + props.getProperty(TSDBDriver.PROPERTY_KEY_USER) + "/" + props.getProperty(TSDBDriver.PROPERTY_KEY_PASSWORD) + ""; String loginUrl = "http://" + host + ":" + port + "/rest/login/" + props.getProperty(TSDBDriver.PROPERTY_KEY_USER) + "/" + props.getProperty(TSDBDriver.PROPERTY_KEY_PASSWORD) + "";
try { try {
String user = URLEncoder.encode(props.getProperty(TSDBDriver.PROPERTY_KEY_USER), "UTF-8"); if (!props.containsKey(TSDBDriver.PROPERTY_KEY_USER))
String password = URLEncoder.encode(props.getProperty(TSDBDriver.PROPERTY_KEY_PASSWORD), "UTF-8"); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_USER_IS_REQUIRED);
if (!props.containsKey(TSDBDriver.PROPERTY_KEY_PASSWORD))
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PASSWORD_IS_REQUIRED);
String user = URLEncoder.encode(props.getProperty(TSDBDriver.PROPERTY_KEY_USER), StandardCharsets.UTF_8.displayName());
String password = URLEncoder.encode(props.getProperty(TSDBDriver.PROPERTY_KEY_PASSWORD), StandardCharsets.UTF_8.displayName());
loginUrl = "http://" + props.getProperty(TSDBDriver.PROPERTY_KEY_HOST) + ":" + props.getProperty(TSDBDriver.PROPERTY_KEY_PORT) + "/rest/login/" + user + "/" + password + ""; loginUrl = "http://" + props.getProperty(TSDBDriver.PROPERTY_KEY_HOST) + ":" + props.getProperty(TSDBDriver.PROPERTY_KEY_PORT) + "/rest/login/" + user + "/" + password + "";
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -7,6 +7,7 @@ import com.taosdata.jdbc.AbstractStatement; ...@@ -7,6 +7,7 @@ import com.taosdata.jdbc.AbstractStatement;
import com.taosdata.jdbc.TSDBDriver; import com.taosdata.jdbc.TSDBDriver;
import com.taosdata.jdbc.TSDBError; import com.taosdata.jdbc.TSDBError;
import com.taosdata.jdbc.TSDBErrorNumbers; import com.taosdata.jdbc.TSDBErrorNumbers;
import com.taosdata.jdbc.enums.TimestampFormat;
import com.taosdata.jdbc.utils.HttpClientPoolUtil; import com.taosdata.jdbc.utils.HttpClientPoolUtil;
import com.taosdata.jdbc.utils.SqlSyntaxValidator; import com.taosdata.jdbc.utils.SqlSyntaxValidator;
...@@ -45,9 +46,7 @@ public class RestfulStatement extends AbstractStatement { ...@@ -45,9 +46,7 @@ public class RestfulStatement extends AbstractStatement {
if (!SqlSyntaxValidator.isValidForExecuteUpdate(sql)) if (!SqlSyntaxValidator.isValidForExecuteUpdate(sql))
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_FOR_EXECUTE_UPDATE, "not a valid sql for executeUpdate: " + sql); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_FOR_EXECUTE_UPDATE, "not a valid sql for executeUpdate: " + sql);
final String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql"; return executeOneUpdate(sql);
return executeOneUpdate(url, sql);
} }
@Override @Override
...@@ -62,34 +61,25 @@ public class RestfulStatement extends AbstractStatement { ...@@ -62,34 +61,25 @@ public class RestfulStatement extends AbstractStatement {
public boolean execute(String sql) throws SQLException { public boolean execute(String sql) throws SQLException {
if (isClosed()) if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
if (!SqlSyntaxValidator.isValidForExecute(sql))
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_FOR_EXECUTE, "not a valid sql for execute: " + sql);
//如果执行了use操作应该将当前Statement的catalog设置为新的database //如果执行了use操作应该将当前Statement的catalog设置为新的database
boolean result = true; boolean result = true;
String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql";
if (conn.getClientInfo(TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT).equals("TIMESTAMP")) {
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlt";
}
if (conn.getClientInfo(TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT).equals("UTC")) {
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlutc";
}
if (SqlSyntaxValidator.isUseSql(sql)) { if (SqlSyntaxValidator.isUseSql(sql)) {
HttpClientPoolUtil.execute(url, sql, this.conn.getToken()); HttpClientPoolUtil.execute(getUrl(), sql, this.conn.getToken());
this.database = sql.trim().replace("use", "").trim(); this.database = sql.trim().replace("use", "").trim();
this.conn.setCatalog(this.database); this.conn.setCatalog(this.database);
result = false; result = false;
} else if (SqlSyntaxValidator.isDatabaseUnspecifiedQuery(sql)) { } else if (SqlSyntaxValidator.isDatabaseUnspecifiedQuery(sql)) {
executeOneQuery(sql); executeOneQuery(sql);
} else if (SqlSyntaxValidator.isDatabaseUnspecifiedUpdate(sql)) { } else if (SqlSyntaxValidator.isDatabaseUnspecifiedUpdate(sql)) {
executeOneUpdate(url, sql); executeOneUpdate(sql);
result = false; result = false;
} else { } else {
if (SqlSyntaxValidator.isValidForExecuteQuery(sql)) { if (SqlSyntaxValidator.isValidForExecuteQuery(sql)) {
executeQuery(sql); executeOneQuery(sql);
} else { } else {
executeUpdate(sql); executeOneUpdate(sql);
result = false; result = false;
} }
} }
...@@ -97,19 +87,25 @@ public class RestfulStatement extends AbstractStatement { ...@@ -97,19 +87,25 @@ public class RestfulStatement extends AbstractStatement {
return result; return result;
} }
private ResultSet executeOneQuery(String sql) throws SQLException { private String getUrl() throws SQLException {
if (!SqlSyntaxValidator.isValidForExecuteQuery(sql)) TimestampFormat timestampFormat = TimestampFormat.valueOf(conn.getClientInfo(TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT).trim().toUpperCase());
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_FOR_EXECUTE_QUERY, "not a valid sql for executeQuery: " + sql); String url;
switch (timestampFormat) {
case TIMESTAMP:
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlt";
break;
case UTC:
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlutc";
break;
default:
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql";
}
return url;
}
private ResultSet executeOneQuery(String sql) throws SQLException {
// row data // row data
String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql"; String result = HttpClientPoolUtil.execute(getUrl(), sql, this.conn.getToken());
String timestampFormat = conn.getClientInfo(TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT);
if ("TIMESTAMP".equalsIgnoreCase(timestampFormat))
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlt";
if ("UTC".equalsIgnoreCase(timestampFormat))
url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sqlutc";
String result = HttpClientPoolUtil.execute(url, sql, this.conn.getToken());
JSONObject resultJson = JSON.parseObject(result); JSONObject resultJson = JSON.parseObject(result);
if (resultJson.getString("status").equals("error")) { if (resultJson.getString("status").equals("error")) {
throw TSDBError.createSQLException(resultJson.getInteger("code"), resultJson.getString("desc")); throw TSDBError.createSQLException(resultJson.getInteger("code"), resultJson.getString("desc"));
...@@ -119,11 +115,8 @@ public class RestfulStatement extends AbstractStatement { ...@@ -119,11 +115,8 @@ public class RestfulStatement extends AbstractStatement {
return resultSet; return resultSet;
} }
private int executeOneUpdate(String url, String sql) throws SQLException { private int executeOneUpdate(String sql) throws SQLException {
if (!SqlSyntaxValidator.isValidForExecuteUpdate(sql)) String result = HttpClientPoolUtil.execute(getUrl(), sql, this.conn.getToken());
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_FOR_EXECUTE_UPDATE, "not a valid sql for executeUpdate: " + sql);
String result = HttpClientPoolUtil.execute(url, sql, this.conn.getToken());
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getString("status").equals("error")) { if (jsonObject.getString("status").equals("error")) {
throw TSDBError.createSQLException(jsonObject.getInteger("code"), jsonObject.getString("desc")); throw TSDBError.createSQLException(jsonObject.getInteger("code"), jsonObject.getString("desc"));
...@@ -134,7 +127,7 @@ public class RestfulStatement extends AbstractStatement { ...@@ -134,7 +127,7 @@ public class RestfulStatement extends AbstractStatement {
} }
private int getAffectedRows(JSONObject jsonObject) throws SQLException { private int getAffectedRows(JSONObject jsonObject) throws SQLException {
// create ... SQLs should return 0 , and Restful result is this: // create ... SQLs should return 0 , and Restful result like this:
// {"status": "succ", "head": ["affected_rows"], "data": [[0]], "rows": 1} // {"status": "succ", "head": ["affected_rows"], "data": [[0]], "rows": 1}
JSONArray head = jsonObject.getJSONArray("head"); JSONArray head = jsonObject.getJSONArray("head");
if (head.size() != 1 || !"affected_rows".equals(head.getString(0))) if (head.size() != 1 || !"affected_rows".equals(head.getString(0)))
......
...@@ -16,8 +16,7 @@ package com.taosdata.jdbc.utils; ...@@ -16,8 +16,7 @@ package com.taosdata.jdbc.utils;
public class SqlSyntaxValidator { public class SqlSyntaxValidator {
private static final String[] SQL = {"select", "insert", "import", "create", "use", "alter", "drop", "set", "show", "describe", "reset"}; private static final String[] updateSQL = {"insert", "import", "create", "use", "alter", "drop", "set", "reset"};
private static final String[] updateSQL = {"insert", "import", "create", "use", "alter", "drop", "set"};
private static final String[] querySQL = {"select", "show", "describe"}; private static final String[] querySQL = {"select", "show", "describe"};
private static final String[] databaseUnspecifiedShow = {"databases", "dnodes", "mnodes", "variables"}; private static final String[] databaseUnspecifiedShow = {"databases", "dnodes", "mnodes", "variables"};
...@@ -38,14 +37,6 @@ public class SqlSyntaxValidator { ...@@ -38,14 +37,6 @@ public class SqlSyntaxValidator {
return false; return false;
} }
public static boolean isValidForExecute(String sql) {
for (String prefix : SQL) {
if (sql.trim().toLowerCase().startsWith(prefix))
return true;
}
return false;
}
public static boolean isDatabaseUnspecifiedQuery(String sql) { public static boolean isDatabaseUnspecifiedQuery(String sql) {
for (String databaseObj : databaseUnspecifiedShow) { for (String databaseObj : databaseUnspecifiedShow) {
if (sql.trim().toLowerCase().matches("show\\s+" + databaseObj + ".*")) if (sql.trim().toLowerCase().matches("show\\s+" + databaseObj + ".*"))
...@@ -63,9 +54,5 @@ public class SqlSyntaxValidator { ...@@ -63,9 +54,5 @@ public class SqlSyntaxValidator {
return sql.trim().toLowerCase().startsWith("use"); return sql.trim().toLowerCase().startsWith("use");
} }
public static boolean isSelectSql(String sql) {
return sql.trim().toLowerCase().startsWith("select");
}
} }
...@@ -69,6 +69,8 @@ public class SubscribeTest { ...@@ -69,6 +69,8 @@ public class SubscribeTest {
@Before @Before
public void createDatabase() throws SQLException { public void createDatabase() throws SQLException {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
package com.taosdata.jdbc.cases; package com.taosdata.jdbc.cases;
import com.taosdata.jdbc.TSDBErrorNumbers;
import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.sql.*; import java.sql.*;
...@@ -12,6 +15,47 @@ public class AuthenticationTest { ...@@ -12,6 +15,47 @@ public class AuthenticationTest {
private static final String password = "taos?data"; private static final String password = "taos?data";
private Connection conn; private Connection conn;
@Test
public void connectWithoutUserByJni() {
try {
DriverManager.getConnection("jdbc:TAOS://" + host + ":0/?");
} catch (SQLException e) {
Assert.assertEquals(TSDBErrorNumbers.ERROR_USER_IS_REQUIRED, e.getErrorCode());
Assert.assertEquals("ERROR (2319): user is required", e.getMessage());
}
}
@Test
public void connectWithoutUserByRestful() {
try {
DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/?");
} catch (SQLException e) {
Assert.assertEquals(TSDBErrorNumbers.ERROR_USER_IS_REQUIRED, e.getErrorCode());
Assert.assertEquals("ERROR (2319): user is required", e.getMessage());
}
}
@Test
public void connectWithoutPasswordByJni() {
try {
DriverManager.getConnection("jdbc:TAOS://" + host + ":0/?user=root");
} catch (SQLException e) {
Assert.assertEquals(TSDBErrorNumbers.ERROR_PASSWORD_IS_REQUIRED, e.getErrorCode());
Assert.assertEquals("ERROR (231a): password is required", e.getMessage());
}
}
@Test
public void connectWithoutPasswordByRestful() {
try {
DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/?user=root");
} catch (SQLException e) {
Assert.assertEquals(TSDBErrorNumbers.ERROR_PASSWORD_IS_REQUIRED, e.getErrorCode());
Assert.assertEquals("ERROR (231a): password is required", e.getMessage());
}
}
@Ignore
@Test @Test
public void test() { public void test() {
// change password // change password
......
...@@ -29,6 +29,8 @@ public class BatchInsertTest { ...@@ -29,6 +29,8 @@ public class BatchInsertTest {
public void before() { public void before() {
try { try {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
...@@ -21,6 +21,8 @@ public class ImportTest { ...@@ -21,6 +21,8 @@ public class ImportTest {
public static void before() { public static void before() {
try { try {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
...@@ -270,6 +270,41 @@ public class InsertSpecialCharacterJniTest { ...@@ -270,6 +270,41 @@ public class InsertSpecialCharacterJniTest {
} }
} }
@Ignore
@Test
public void testSingleQuotaEscape() throws SQLException {
final long now = System.currentTimeMillis();
final String sql = "insert into t? using ? tags(?) values(?, ?, ?) t? using " + tbname2 + " tags(?) values(?,?,?) ";
try (PreparedStatement pstmt = conn.prepareStatement(sql)) {
// t1
pstmt.setInt(1, 1);
pstmt.setString(2, tbname2);
pstmt.setString(3, special_character_str_5);
pstmt.setTimestamp(4, new Timestamp(now));
pstmt.setBytes(5, special_character_str_5.getBytes());
// t2
pstmt.setInt(7, 2);
pstmt.setString(8, special_character_str_5);
pstmt.setTimestamp(9, new Timestamp(now));
pstmt.setString(11, special_character_str_5);
int ret = pstmt.executeUpdate();
Assert.assertEquals(2, ret);
}
String query = "select * from ?.t? where ? < ? and ts >= ? and f1 is not null";
try (PreparedStatement pstmt = conn.prepareStatement(query)) {
pstmt.setString(1, dbName);
pstmt.setInt(2, 1);
pstmt.setString(3, "ts");
pstmt.setTimestamp(4, new Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(5, new Timestamp(0));
ResultSet rs = pstmt.executeQuery();
Assert.assertNotNull(rs);
}
}
@Test @Test
public void testCase10() throws SQLException { public void testCase10() throws SQLException {
final long now = System.currentTimeMillis(); final long now = System.currentTimeMillis();
...@@ -293,13 +328,12 @@ public class InsertSpecialCharacterJniTest { ...@@ -293,13 +328,12 @@ public class InsertSpecialCharacterJniTest {
Assert.assertEquals(2, ret); Assert.assertEquals(2, ret);
} }
//query t1 //query t1
String query = "select * from ?.t? where ts < ? and ts >= ? and ? is not null"; String query = "select * from ?.t? where ts < ? and ts >= ? and f1 is not null";
try (PreparedStatement pstmt = conn.prepareStatement(query)) { try (PreparedStatement pstmt = conn.prepareStatement(query)) {
pstmt.setString(1, dbName); pstmt.setString(1, dbName);
pstmt.setInt(2, 1); pstmt.setInt(2, 1);
pstmt.setTimestamp(3, new Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(4, new Timestamp(0)); pstmt.setTimestamp(4, new Timestamp(0));
pstmt.setString(5, "f1");
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
rs.next(); rs.next();
...@@ -311,12 +345,11 @@ public class InsertSpecialCharacterJniTest { ...@@ -311,12 +345,11 @@ public class InsertSpecialCharacterJniTest {
Assert.assertNull(f2); Assert.assertNull(f2);
} }
// query t2 // query t2
query = "select * from t? where ts < ? and ts >= ? and ? is not null"; query = "select * from t? where ts < ? and ts >= ? and f2 is not null";
try (PreparedStatement pstmt = conn.prepareStatement(query)) { try (PreparedStatement pstmt = conn.prepareStatement(query)) {
pstmt.setInt(1, 2); pstmt.setInt(1, 2);
pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(3, new Timestamp(0)); pstmt.setTimestamp(3, new Timestamp(0));
pstmt.setString(4, "f2");
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
rs.next(); rs.next();
......
...@@ -293,13 +293,12 @@ public class InsertSpecialCharacterRestfulTest { ...@@ -293,13 +293,12 @@ public class InsertSpecialCharacterRestfulTest {
Assert.assertEquals(2, ret); Assert.assertEquals(2, ret);
} }
//query t1 //query t1
String query = "select * from ?.t? where ts < ? and ts >= ? and ? is not null"; String query = "select * from ?.t? where ts < ? and ts >= ? and f1 is not null";
try (PreparedStatement pstmt = conn.prepareStatement(query)) { try (PreparedStatement pstmt = conn.prepareStatement(query)) {
pstmt.setString(1, dbName); pstmt.setString(1, dbName);
pstmt.setInt(2, 1); pstmt.setInt(2, 1);
pstmt.setTimestamp(3, new Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(4, new Timestamp(0)); pstmt.setTimestamp(4, new Timestamp(0));
pstmt.setString(5, "f1");
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
rs.next(); rs.next();
...@@ -311,12 +310,11 @@ public class InsertSpecialCharacterRestfulTest { ...@@ -311,12 +310,11 @@ public class InsertSpecialCharacterRestfulTest {
Assert.assertNull(f2); Assert.assertNull(f2);
} }
// query t2 // query t2
query = "select * from t? where ts < ? and ts >= ? and ? is not null"; query = "select * from t? where ts < ? and ts >= ? and f2 is not null";
try (PreparedStatement pstmt = conn.prepareStatement(query)) { try (PreparedStatement pstmt = conn.prepareStatement(query)) {
pstmt.setInt(1, 2); pstmt.setInt(1, 2);
pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(3, new Timestamp(0)); pstmt.setTimestamp(3, new Timestamp(0));
pstmt.setString(4, "f2");
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
rs.next(); rs.next();
......
...@@ -22,6 +22,8 @@ public class QueryDataTest { ...@@ -22,6 +22,8 @@ public class QueryDataTest {
public void createDatabase() { public void createDatabase() {
try { try {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
package com.taosdata.jdbc.cases; package com.taosdata.jdbc.cases;
import com.taosdata.jdbc.TSDBDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import java.sql.*; import java.sql.Connection;
import java.util.Properties; import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
public class ResetQueryCacheTest { public class ResetQueryCacheTest {
static Connection connection; @Test
static Statement statement; public void jni() throws SQLException {
static String host = "127.0.0.1"; // given
Connection connection = DriverManager.getConnection("jdbc:TAOS://127.0.0.1:0/?user=root&password=taosdata&timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8");
@Before Statement statement = connection.createStatement();
public void init() {
try { // when
Properties properties = new Properties(); boolean execute = statement.execute("reset query cache");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); // then
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); assertFalse(execute);
connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties); assertEquals(0, statement.getUpdateCount());
statement = connection.createStatement();
} catch (SQLException e) { statement.close();
return; connection.close();
}
} }
@Test @Test
public void testResetQueryCache() throws SQLException { public void restful() throws SQLException {
String resetSql = "reset query cache"; // given
statement.execute(resetSql); Connection connection = DriverManager.getConnection("jdbc:TAOS-RS://127.0.0.1:6041/?user=root&password=taosdata&timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8");
} Statement statement = connection.createStatement();
// when
boolean execute = statement.execute("reset query cache");
// then
assertFalse(execute);
assertEquals(0, statement.getUpdateCount());
@After statement.close();
public void close() { connection.close();
try {
if (statement != null)
statement.close();
if (connection != null)
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
} }
} }
\ No newline at end of file
...@@ -20,6 +20,8 @@ public class SelectTest { ...@@ -20,6 +20,8 @@ public class SelectTest {
public void createDatabaseAndTable() { public void createDatabaseAndTable() {
try { try {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
...@@ -24,6 +24,8 @@ public class StableTest { ...@@ -24,6 +24,8 @@ public class StableTest {
public static void createDatabase() { public static void createDatabase() {
try { try {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_USER, "root");
properties.setProperty(TSDBDriver.PROPERTY_KEY_PASSWORD, "taosdata");
properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
......
package com.taosdata.jdbc.utils;
import org.junit.Assert;
import org.junit.Test;
public class SqlSyntaxValidatorTest {
@Test
public void isSelectSQL() {
Assert.assertTrue(SqlSyntaxValidator.isSelectSql("select * from test.weather"));
Assert.assertTrue(SqlSyntaxValidator.isSelectSql(" select * from test.weather"));
Assert.assertTrue(SqlSyntaxValidator.isSelectSql(" select * from test.weather "));
Assert.assertFalse(SqlSyntaxValidator.isSelectSql("insert into test.weather values(now, 1.1, 2)"));
}
@Test
public void isUseSQL() {
Assert.assertTrue(SqlSyntaxValidator.isUseSql("use database test"));
}
}
\ No newline at end of file
...@@ -75,131 +75,131 @@ ...@@ -75,131 +75,131 @@
#define TK_SCORES 57 #define TK_SCORES 57
#define TK_GRANTS 58 #define TK_GRANTS 58
#define TK_VNODES 59 #define TK_VNODES 59
#define TK_IPTOKEN 60 #define TK_DOT 60
#define TK_DOT 61 #define TK_CREATE 61
#define TK_CREATE 62 #define TK_TABLE 62
#define TK_TABLE 63 #define TK_STABLE 63
#define TK_STABLE 64 #define TK_DATABASE 64
#define TK_DATABASE 65 #define TK_TABLES 65
#define TK_TABLES 66 #define TK_STABLES 66
#define TK_STABLES 67 #define TK_VGROUPS 67
#define TK_VGROUPS 68 #define TK_DROP 68
#define TK_DROP 69 #define TK_TOPIC 69
#define TK_TOPIC 70 #define TK_FUNCTION 70
#define TK_FUNCTION 71 #define TK_DNODE 71
#define TK_DNODE 72 #define TK_USER 72
#define TK_USER 73 #define TK_ACCOUNT 73
#define TK_ACCOUNT 74 #define TK_USE 74
#define TK_USE 75 #define TK_DESCRIBE 75
#define TK_DESCRIBE 76 #define TK_ALTER 76
#define TK_ALTER 77 #define TK_PASS 77
#define TK_PASS 78 #define TK_PRIVILEGE 78
#define TK_PRIVILEGE 79 #define TK_LOCAL 79
#define TK_LOCAL 80 #define TK_COMPACT 80
#define TK_COMPACT 81 #define TK_LP 81
#define TK_LP 82 #define TK_RP 82
#define TK_RP 83 #define TK_IF 83
#define TK_IF 84 #define TK_EXISTS 84
#define TK_EXISTS 85 #define TK_AS 85
#define TK_AS 86 #define TK_OUTPUTTYPE 86
#define TK_OUTPUTTYPE 87 #define TK_AGGREGATE 87
#define TK_AGGREGATE 88 #define TK_BUFSIZE 88
#define TK_BUFSIZE 89 #define TK_PPS 89
#define TK_PPS 90 #define TK_TSERIES 90
#define TK_TSERIES 91 #define TK_DBS 91
#define TK_DBS 92 #define TK_STORAGE 92
#define TK_STORAGE 93 #define TK_QTIME 93
#define TK_QTIME 94 #define TK_CONNS 94
#define TK_CONNS 95 #define TK_STATE 95
#define TK_STATE 96 #define TK_COMMA 96
#define TK_COMMA 97 #define TK_KEEP 97
#define TK_KEEP 98 #define TK_CACHE 98
#define TK_CACHE 99 #define TK_REPLICA 99
#define TK_REPLICA 100 #define TK_QUORUM 100
#define TK_QUORUM 101 #define TK_DAYS 101
#define TK_DAYS 102 #define TK_MINROWS 102
#define TK_MINROWS 103 #define TK_MAXROWS 103
#define TK_MAXROWS 104 #define TK_BLOCKS 104
#define TK_BLOCKS 105 #define TK_CTIME 105
#define TK_CTIME 106 #define TK_WAL 106
#define TK_WAL 107 #define TK_FSYNC 107
#define TK_FSYNC 108 #define TK_COMP 108
#define TK_COMP 109 #define TK_PRECISION 109
#define TK_PRECISION 110 #define TK_UPDATE 110
#define TK_UPDATE 111 #define TK_CACHELAST 111
#define TK_CACHELAST 112 #define TK_PARTITIONS 112
#define TK_PARTITIONS 113 #define TK_UNSIGNED 113
#define TK_UNSIGNED 114 #define TK_TAGS 114
#define TK_TAGS 115 #define TK_USING 115
#define TK_USING 116 #define TK_NULL 116
#define TK_NULL 117 #define TK_NOW 117
#define TK_NOW 118 #define TK_SELECT 118
#define TK_SELECT 119 #define TK_UNION 119
#define TK_UNION 120 #define TK_ALL 120
#define TK_ALL 121 #define TK_DISTINCT 121
#define TK_DISTINCT 122 #define TK_FROM 122
#define TK_FROM 123 #define TK_VARIABLE 123
#define TK_VARIABLE 124 #define TK_INTERVAL 124
#define TK_INTERVAL 125 #define TK_SESSION 125
#define TK_SESSION 126 #define TK_STATE_WINDOW 126
#define TK_STATE_WINDOW 127 #define TK_FILL 127
#define TK_FILL 128 #define TK_SLIDING 128
#define TK_SLIDING 129 #define TK_ORDER 129
#define TK_ORDER 130 #define TK_BY 130
#define TK_BY 131 #define TK_ASC 131
#define TK_ASC 132 #define TK_DESC 132
#define TK_DESC 133 #define TK_GROUP 133
#define TK_GROUP 134 #define TK_HAVING 134
#define TK_HAVING 135 #define TK_LIMIT 135
#define TK_LIMIT 136 #define TK_OFFSET 136
#define TK_OFFSET 137 #define TK_SLIMIT 137
#define TK_SLIMIT 138 #define TK_SOFFSET 138
#define TK_SOFFSET 139 #define TK_WHERE 139
#define TK_WHERE 140 #define TK_RESET 140
#define TK_RESET 141 #define TK_QUERY 141
#define TK_QUERY 142 #define TK_SYNCDB 142
#define TK_SYNCDB 143 #define TK_ADD 143
#define TK_ADD 144 #define TK_COLUMN 144
#define TK_COLUMN 145 #define TK_MODIFY 145
#define TK_MODIFY 146 #define TK_TAG 146
#define TK_TAG 147 #define TK_CHANGE 147
#define TK_CHANGE 148 #define TK_SET 148
#define TK_SET 149 #define TK_KILL 149
#define TK_KILL 150 #define TK_CONNECTION 150
#define TK_CONNECTION 151 #define TK_STREAM 151
#define TK_STREAM 152 #define TK_COLON 152
#define TK_COLON 153 #define TK_ABORT 153
#define TK_ABORT 154 #define TK_AFTER 154
#define TK_AFTER 155 #define TK_ATTACH 155
#define TK_ATTACH 156 #define TK_BEFORE 156
#define TK_BEFORE 157 #define TK_BEGIN 157
#define TK_BEGIN 158 #define TK_CASCADE 158
#define TK_CASCADE 159 #define TK_CLUSTER 159
#define TK_CLUSTER 160 #define TK_CONFLICT 160
#define TK_CONFLICT 161 #define TK_COPY 161
#define TK_COPY 162 #define TK_DEFERRED 162
#define TK_DEFERRED 163 #define TK_DELIMITERS 163
#define TK_DELIMITERS 164 #define TK_DETACH 164
#define TK_DETACH 165 #define TK_EACH 165
#define TK_EACH 166 #define TK_END 166
#define TK_END 167 #define TK_EXPLAIN 167
#define TK_EXPLAIN 168 #define TK_FAIL 168
#define TK_FAIL 169 #define TK_FOR 169
#define TK_FOR 170 #define TK_IGNORE 170
#define TK_IGNORE 171 #define TK_IMMEDIATE 171
#define TK_IMMEDIATE 172 #define TK_INITIALLY 172
#define TK_INITIALLY 173 #define TK_INSTEAD 173
#define TK_INSTEAD 174 #define TK_MATCH 174
#define TK_MATCH 175 #define TK_KEY 175
#define TK_KEY 176 #define TK_OF 176
#define TK_OF 177 #define TK_RAISE 177
#define TK_RAISE 178 #define TK_REPLACE 178
#define TK_REPLACE 179 #define TK_RESTRICT 179
#define TK_RESTRICT 180 #define TK_ROW 180
#define TK_ROW 181 #define TK_STATEMENT 181
#define TK_STATEMENT 182 #define TK_TRIGGER 182
#define TK_TRIGGER 183 #define TK_VIEW 183
#define TK_VIEW 184 #define TK_IPTOKEN 184
#define TK_SEMI 185 #define TK_SEMI 185
#define TK_NONE 186 #define TK_NONE 186
#define TK_PREV 187 #define TK_PREV 187
......
...@@ -98,7 +98,6 @@ TAOS *shellInit(SShellArguments *_args) { ...@@ -98,7 +98,6 @@ TAOS *shellInit(SShellArguments *_args) {
} }
if (con == NULL) { if (con == NULL) {
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno));
fflush(stdout); fflush(stdout);
return con; return con;
} }
......
...@@ -80,6 +80,7 @@ typedef struct SMnodeObj { ...@@ -80,6 +80,7 @@ typedef struct SMnodeObj {
int8_t updateEnd[4]; int8_t updateEnd[4];
int32_t refCount; int32_t refCount;
int8_t role; int8_t role;
int64_t roleTime;
int8_t reserved2[3]; int8_t reserved2[3];
} SMnodeObj; } SMnodeObj;
......
...@@ -1181,7 +1181,7 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC ...@@ -1181,7 +1181,7 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pShow->bytes[cols] = 4; pShow->bytes[cols] = 4;
pSchema[cols].type = TSDB_DATA_TYPE_INT; pSchema[cols].type = TSDB_DATA_TYPE_INT;
strcpy(pSchema[cols].name, "vnode"); strcpy(pSchema[cols].name, "vgId");
pSchema[cols].bytes = htons(pShow->bytes[cols]); pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++; cols++;
...@@ -1243,8 +1243,10 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo ...@@ -1243,8 +1243,10 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
cols++; cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
strcpy(pWrite, syncRole[pVgid->role]); STR_TO_VARSTR(pWrite, syncRole[pVgid->role]);
cols++; cols++;
numOfRows++;
} }
} }
......
...@@ -122,6 +122,7 @@ static int32_t mnodeMnodeActionRestored() { ...@@ -122,6 +122,7 @@ static int32_t mnodeMnodeActionRestored() {
void *pIter = mnodeGetNextMnode(NULL, &pMnode); void *pIter = mnodeGetNextMnode(NULL, &pMnode);
if (pMnode != NULL) { if (pMnode != NULL) {
pMnode->role = TAOS_SYNC_ROLE_MASTER; pMnode->role = TAOS_SYNC_ROLE_MASTER;
pMnode->roleTime = taosGetTimestampMs();
mnodeDecMnodeRef(pMnode); mnodeDecMnodeRef(pMnode);
} }
mnodeCancelGetNextMnode(pIter); mnodeCancelGetNextMnode(pIter);
...@@ -496,7 +497,13 @@ static int32_t mnodeGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC ...@@ -496,7 +497,13 @@ static int32_t mnodeGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
strcpy(pSchema[cols].name, "role"); strcpy(pSchema[cols].name, "role");
pSchema[cols].bytes = htons(pShow->bytes[cols]); pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++; cols++;
pShow->bytes[cols] = 8;
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
strcpy(pSchema[cols].name, "role_time");
pSchema[cols].bytes = htons(pShow->bytes[cols]);
cols++;
pShow->bytes[cols] = 8; pShow->bytes[cols] = 8;
pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP; pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
strcpy(pSchema[cols].name, "create_time"); strcpy(pSchema[cols].name, "create_time");
...@@ -552,6 +559,10 @@ static int32_t mnodeRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, vo ...@@ -552,6 +559,10 @@ static int32_t mnodeRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, vo
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, roles, pShow->bytes[cols]); STR_WITH_MAXSIZE_TO_VARSTR(pWrite, roles, pShow->bytes[cols]);
cols++; cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int64_t *)pWrite = pMnode->roleTime;
cols++;
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int64_t *)pWrite = pMnode->createdTime; *(int64_t *)pWrite = pMnode->createdTime;
cols++; cols++;
......
...@@ -227,6 +227,7 @@ void sdbUpdateMnodeRoles() { ...@@ -227,6 +227,7 @@ void sdbUpdateMnodeRoles() {
SMnodeObj *pMnode = mnodeGetMnode(roles.nodeId[i]); SMnodeObj *pMnode = mnodeGetMnode(roles.nodeId[i]);
if (pMnode != NULL) { if (pMnode != NULL) {
if (pMnode->role != roles.role[i]) { if (pMnode->role != roles.role[i]) {
pMnode->roleTime = taosGetTimestampMs();
bnNotify(); bnNotify();
} }
......
...@@ -72,36 +72,55 @@ int64_t user_mktime64(const unsigned int year0, const unsigned int mon0, ...@@ -72,36 +72,55 @@ int64_t user_mktime64(const unsigned int year0, const unsigned int mon0,
// ==== mktime() kernel code =================// // ==== mktime() kernel code =================//
static int64_t m_deltaUtc = 0; static int64_t m_deltaUtc = 0;
void deltaToUtcInitOnce() { void deltaToUtcInitOnce() {
struct tm tm = {0}; struct tm tm = {0};
(void)strptime("1970-01-01 00:00:00", (const char *)("%Y-%m-%d %H:%M:%S"), &tm); (void)strptime("1970-01-01 00:00:00", (const char *)("%Y-%m-%d %H:%M:%S"), &tm);
m_deltaUtc = (int64_t)mktime(&tm); m_deltaUtc = (int64_t)mktime(&tm);
//printf("====delta:%lld\n\n", seconds); //printf("====delta:%lld\n\n", seconds);
return; return;
} }
static int64_t parseFraction(char* str, char** end, int32_t timePrec); static int64_t parseFraction(char* str, char** end, int32_t timePrec);
static int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec); static int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec, char delim);
static int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec); static int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec);
static int32_t parseLocaltimeWithDst(char* timestr, int64_t* time, int32_t timePrec); static int32_t parseLocaltimeWithDst(char* timestr, int64_t* time, int32_t timePrec);
static char* forwardToTimeStringEnd(char* str);
static bool checkTzPresent(char *str, int32_t len);
static int32_t (*parseLocaltimeFp[]) (char* timestr, int64_t* time, int32_t timePrec) = { static int32_t (*parseLocaltimeFp[]) (char* timestr, int64_t* time, int32_t timePrec) = {
parseLocaltime, parseLocaltime,
parseLocaltimeWithDst parseLocaltimeWithDst
}; };
int32_t taosGetTimestampSec() { return (int32_t)time(NULL); } int32_t taosGetTimestampSec() { return (int32_t)time(NULL); }
int32_t taosParseTime(char* timestr, int64_t* time, int32_t len, int32_t timePrec, int8_t day_light) { int32_t taosParseTime(char* timestr, int64_t* time, int32_t len, int32_t timePrec, int8_t day_light) {
/* parse datatime string in with tz */ /* parse datatime string in with tz */
if (strnchr(timestr, 'T', len, false) != NULL) { if (strnchr(timestr, 'T', len, false) != NULL) {
return parseTimeWithTz(timestr, time, timePrec); return parseTimeWithTz(timestr, time, timePrec, 'T');
} else if (checkTzPresent(timestr, len)) {
return parseTimeWithTz(timestr, time, timePrec, 0);
} else { } else {
return (*parseLocaltimeFp[day_light])(timestr, time, timePrec); return (*parseLocaltimeFp[day_light])(timestr, time, timePrec);
} }
} }
bool checkTzPresent(char *str, int32_t len) {
char *seg = forwardToTimeStringEnd(str);
int32_t seg_len = len - (int32_t)(seg - str);
char *c = &seg[seg_len - 1];
for (int i = 0; i < seg_len; ++i) {
if (*c == 'Z' || *c == 'z' || *c == '+' || *c == '-') {
return true;
}
c--;
}
return false;
}
char* forwardToTimeStringEnd(char* str) { char* forwardToTimeStringEnd(char* str) {
int32_t i = 0; int32_t i = 0;
int32_t numOfSep = 0; int32_t numOfSep = 0;
...@@ -187,6 +206,13 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) { ...@@ -187,6 +206,13 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
i += 2; i += 2;
} }
//return error if there're illegal charaters after min(2 Digits)
char *minStr = &str[i];
if (minStr[1] != '\0' && minStr[2] != '\0') {
return -1;
}
int64_t minute = strnatoi(&str[i], 2); int64_t minute = strnatoi(&str[i], 2);
if (minute > 59) { if (minute > 59) {
return -1; return -1;
...@@ -213,14 +239,23 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) { ...@@ -213,14 +239,23 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
* 2013-04-12T15:52:01+0800 * 2013-04-12T15:52:01+0800
* 2013-04-12T15:52:01.123+0800 * 2013-04-12T15:52:01.123+0800
*/ */
int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) { int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec, char delim) {
int64_t factor = (timePrec == TSDB_TIME_PRECISION_MILLI) ? 1000 : int64_t factor = (timePrec == TSDB_TIME_PRECISION_MILLI) ? 1000 :
(timePrec == TSDB_TIME_PRECISION_MICRO ? 1000000 : 1000000000); (timePrec == TSDB_TIME_PRECISION_MICRO ? 1000000 : 1000000000);
int64_t tzOffset = 0; int64_t tzOffset = 0;
struct tm tm = {0}; struct tm tm = {0};
char* str = strptime(timestr, "%Y-%m-%dT%H:%M:%S", &tm);
char* str;
if (delim == 'T') {
str = strptime(timestr, "%Y-%m-%dT%H:%M:%S", &tm);
} else if (delim == 0) {
str = strptime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
} else {
str = NULL;
}
if (str == NULL) { if (str == NULL) {
return -1; return -1;
} }
...@@ -236,7 +271,7 @@ int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) { ...@@ -236,7 +271,7 @@ int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) {
int64_t fraction = 0; int64_t fraction = 0;
str = forwardToTimeStringEnd(timestr); str = forwardToTimeStringEnd(timestr);
if (str[0] == 'Z' || str[0] == 'z') { if ((str[0] == 'Z' || str[0] == 'z') && str[1] == '\0') {
/* utc time, no millisecond, return directly*/ /* utc time, no millisecond, return directly*/
*time = seconds * factor; *time = seconds * factor;
} else if (str[0] == '.') { } else if (str[0] == '.') {
...@@ -250,6 +285,8 @@ int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) { ...@@ -250,6 +285,8 @@ int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) {
char seg = str[0]; char seg = str[0];
if (seg != 'Z' && seg != 'z' && seg != '+' && seg != '-') { if (seg != 'Z' && seg != 'z' && seg != '+' && seg != '-') {
return -1; return -1;
} else if ((seg == 'Z' || seg == 'z') && str[1] != '\0') {
return -1;
} else if (seg == '+' || seg == '-') { } else if (seg == '+' || seg == '-') {
// parse the timezone // parse the timezone
if (parseTimezone(str, &tzOffset) == -1) { if (parseTimezone(str, &tzOffset) == -1) {
......
...@@ -80,7 +80,7 @@ cmd ::= SHOW SCORES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); ...@@ -80,7 +80,7 @@ cmd ::= SHOW SCORES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0);
cmd ::= SHOW GRANTS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } cmd ::= SHOW GRANTS. { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); }
cmd ::= SHOW VNODES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } cmd ::= SHOW VNODES. { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
cmd ::= SHOW VNODES IPTOKEN(X). { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &X, 0); } cmd ::= SHOW VNODES ids(X). { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &X, 0); }
%type dbPrefix {SStrToken} %type dbPrefix {SStrToken}
......
...@@ -955,6 +955,8 @@ void SqlInfoDestroy(SSqlInfo *pInfo) { ...@@ -955,6 +955,8 @@ void SqlInfoDestroy(SSqlInfo *pInfo) {
taosArrayDestroy(pInfo->pAlterInfo->pAddColumns); taosArrayDestroy(pInfo->pAlterInfo->pAddColumns);
tfree(pInfo->pAlterInfo->tagData.data); tfree(pInfo->pAlterInfo->tagData.data);
tfree(pInfo->pAlterInfo); tfree(pInfo->pAlterInfo);
} else if (pInfo->type == TSDB_SQL_COMPACT_VNODE) {
tSqlExprListDestroy(pInfo->list);
} else { } else {
if (pInfo->pMiscInfo != NULL) { if (pInfo->pMiscInfo != NULL) {
taosArrayDestroy(pInfo->pMiscInfo->a); taosArrayDestroy(pInfo->pMiscInfo->a);
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
** input grammar file: ** input grammar file:
*/ */
#include <stdio.h> #include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/ /************ Begin %include sections from the grammar ************************/
#line 23 "sql.y"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -36,6 +38,7 @@ ...@@ -36,6 +38,7 @@
#include "ttokendef.h" #include "ttokendef.h"
#include "tutil.h" #include "tutil.h"
#include "tvariant.h" #include "tvariant.h"
#line 42 "sql.c"
/**************** End of %include directives **********************************/ /**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols /* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders". This section is blank unless ** in a format understandable to "makeheaders". This section is blank unless
...@@ -76,8 +79,10 @@ ...@@ -76,8 +79,10 @@
** zero the stack is dynamically sized using realloc() ** zero the stack is dynamically sized using realloc()
** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_SDECL A static variable declaration for the %extra_argument
** ParseARG_PDECL A parameter declaration for the %extra_argument ** ParseARG_PDECL A parameter declaration for the %extra_argument
** ParseARG_PARAM Code to pass %extra_argument as a subroutine parameter
** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_STORE Code to store %extra_argument into yypParser
** ParseARG_FETCH Code to extract %extra_argument from yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser
** ParseCTX_* As ParseARG_ except for %extra_context
** YYERRORSYMBOL is the code number of the error symbol. If not ** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing. ** defined, then do no error processing.
** YYNSTATE the combined number of states. ** YYNSTATE the combined number of states.
...@@ -97,39 +102,46 @@ ...@@ -97,39 +102,46 @@
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 277 #define YYNOCODE 275
#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;
TAOS_FIELD yy31; SSessionWindowVal yy39;
int yy52; SCreateDbInfo yy42;
SLimitVal yy126; int yy43;
SWindowStateVal yy144; tSqlExpr* yy46;
SCreateTableSql* yy158; SCreatedTableInfo yy96;
SCreateDbInfo yy214; SArray* yy131;
SSessionWindowVal yy259; TAOS_FIELD yy163;
tSqlExpr* yy370; SSqlNode* yy256;
SRelationInfo* yy412; SCreateTableSql* yy272;
SCreatedTableInfo yy432; SLimitVal yy284;
SSqlNode* yy464; SCreateAcctInfo yy341;
int64_t yy501; int64_t yy459;
tVariant yy506; tVariant yy516;
SIntervalVal yy520; SIntervalVal yy530;
SArray* yy525; SWindowStateVal yy538;
SCreateAcctInfo yy547; SRelationInfo* yy544;
} YYMINORTYPE; } YYMINORTYPE;
#ifndef YYSTACKDEPTH #ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100 #define YYSTACKDEPTH 100
#endif #endif
#define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_SDECL SSqlInfo* pInfo;
#define ParseARG_PDECL ,SSqlInfo* pInfo #define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_PARAM ,pInfo
#define ParseARG_STORE yypParser->pInfo = pInfo #define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo;
#define ParseARG_STORE yypParser->pInfo=pInfo;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1 #define YYFALLBACK 1
#define YYNSTATE 362 #define YYNSTATE 362
#define YYNRULE 289 #define YYNRULE 289
#define YYNRULE_WITH_ACTION 289
#define YYNTOKEN 195 #define YYNTOKEN 195
#define YY_MAX_SHIFT 361 #define YY_MAX_SHIFT 361
#define YY_MIN_SHIFTREDUCE 567 #define YY_MIN_SHIFTREDUCE 567
...@@ -140,6 +152,7 @@ typedef union { ...@@ -140,6 +152,7 @@ typedef union {
#define YY_MIN_REDUCE 859 #define YY_MIN_REDUCE 859
#define YY_MAX_REDUCE 1147 #define YY_MAX_REDUCE 1147
/************* End control #defines *******************************************/ /************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
/* Define the yytestcase() macro to be a no-op if is not already defined /* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise. ** otherwise.
...@@ -204,249 +217,249 @@ typedef union { ...@@ -204,249 +217,249 @@ typedef union {
** yy_default[] Default action for each state. ** yy_default[] Default action for each state.
** **
*********** Begin parsing tables **********************************************/ *********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (753) #define YY_ACTTAB_COUNT (754)
static const YYACTIONTYPE yy_action[] = { static const YYACTIONTYPE yy_action[] = {
/* 0 */ 206, 618, 245, 618, 618, 97, 244, 228, 359, 619, /* 0 */ 207, 618, 246, 618, 618, 245, 360, 229, 160, 619,
/* 10 */ 1123, 619, 619, 56, 57, 152, 60, 61, 654, 1027, /* 10 */ 1123, 619, 619, 56, 57, 1036, 60, 61, 857, 361,
/* 20 */ 248, 50, 1036, 59, 317, 64, 62, 65, 63, 984, /* 20 */ 249, 50, 618, 59, 318, 64, 62, 65, 63, 984,
/* 30 */ 249, 982, 983, 55, 54, 231, 985, 53, 52, 51, /* 30 */ 619, 982, 983, 55, 54, 160, 985, 53, 52, 51,
/* 40 */ 986, 1002, 987, 988, 53, 52, 51, 568, 569, 570, /* 40 */ 986, 153, 987, 988, 356, 945, 654, 568, 569, 570,
/* 50 */ 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, /* 50 */ 571, 572, 573, 574, 575, 576, 577, 578, 579, 580,
/* 60 */ 581, 360, 206, 257, 229, 159, 206, 56, 57, 37, /* 60 */ 581, 151, 207, 230, 907, 207, 56, 57, 1027, 60,
/* 70 */ 60, 61, 1124, 174, 248, 50, 1124, 59, 317, 64, /* 70 */ 61, 189, 1124, 249, 50, 1124, 59, 318, 64, 62,
/* 80 */ 62, 65, 63, 277, 276, 29, 79, 55, 54, 1033, /* 80 */ 65, 63, 1072, 1033, 271, 79, 55, 54, 3, 190,
/* 90 */ 206, 53, 52, 51, 56, 57, 315, 60, 61, 234, /* 90 */ 53, 52, 51, 56, 57, 250, 60, 61, 702, 1027,
/* 100 */ 1124, 248, 50, 1014, 59, 317, 64, 62, 65, 63, /* 100 */ 249, 50, 29, 59, 318, 64, 62, 65, 63, 91,
/* 110 */ 358, 357, 144, 230, 55, 54, 85, 1011, 53, 52, /* 110 */ 278, 277, 37, 55, 54, 232, 94, 53, 52, 51,
/* 120 */ 51, 56, 58, 240, 60, 61, 347, 1014, 248, 50, /* 120 */ 235, 120, 114, 125, 1014, 241, 338, 337, 124, 1014,
/* 130 */ 94, 59, 317, 64, 62, 65, 63, 794, 1073, 242, /* 130 */ 130, 133, 123, 56, 58, 794, 60, 61, 127, 85,
/* 140 */ 289, 55, 54, 1014, 618, 53, 52, 51, 57, 23, /* 140 */ 249, 50, 92, 59, 318, 64, 62, 65, 63, 997,
/* 150 */ 60, 61, 619, 44, 248, 50, 1000, 59, 317, 64, /* 150 */ 998, 34, 1001, 55, 54, 207, 80, 53, 52, 51,
/* 160 */ 62, 65, 63, 997, 998, 34, 1001, 55, 54, 857, /* 160 */ 57, 1010, 60, 61, 316, 1124, 249, 50, 263, 59,
/* 170 */ 361, 53, 52, 51, 43, 313, 354, 353, 312, 311, /* 170 */ 318, 64, 62, 65, 63, 37, 44, 267, 266, 55,
/* 180 */ 310, 352, 309, 308, 307, 351, 306, 350, 349, 976, /* 180 */ 54, 348, 243, 53, 52, 51, 1014, 160, 43, 314,
/* 190 */ 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, /* 190 */ 355, 354, 313, 312, 311, 353, 310, 309, 308, 352,
/* 200 */ 974, 975, 977, 978, 60, 61, 24, 1008, 248, 50, /* 200 */ 307, 351, 350, 976, 964, 965, 966, 967, 968, 969,
/* 210 */ 257, 59, 317, 64, 62, 65, 63, 1027, 122, 1027, /* 210 */ 970, 971, 972, 973, 974, 975, 977, 978, 60, 61,
/* 220 */ 175, 55, 54, 37, 209, 53, 52, 51, 247, 809, /* 220 */ 231, 160, 249, 50, 1011, 59, 318, 64, 62, 65,
/* 230 */ 347, 215, 798, 232, 801, 270, 804, 135, 134, 214, /* 230 */ 63, 1008, 1027, 24, 258, 55, 54, 1000, 97, 53,
/* 240 */ 315, 247, 809, 322, 85, 798, 14, 801, 37, 804, /* 240 */ 52, 51, 252, 248, 809, 175, 1013, 798, 233, 801,
/* 250 */ 93, 159, 726, 241, 203, 723, 800, 724, 803, 725, /* 250 */ 210, 804, 248, 809, 1143, 917, 798, 216, 801, 292,
/* 260 */ 226, 227, 257, 16, 318, 15, 37, 238, 5, 40, /* 260 */ 804, 90, 189, 135, 134, 215, 258, 55, 54, 323,
/* 270 */ 178, 1011, 1012, 226, 227, 177, 103, 108, 99, 107, /* 270 */ 85, 53, 52, 51, 1002, 227, 228, 176, 242, 319,
/* 280 */ 96, 44, 204, 253, 254, 210, 64, 62, 65, 63, /* 280 */ 5, 40, 179, 258, 227, 228, 23, 178, 103, 108,
/* 290 */ 355, 945, 159, 302, 55, 54, 1010, 251, 53, 52, /* 290 */ 99, 107, 204, 726, 1012, 1073, 723, 290, 724, 908,
/* 300 */ 51, 1013, 78, 269, 256, 77, 120, 114, 125, 66, /* 300 */ 725, 64, 62, 65, 63, 303, 189, 44, 257, 55,
/* 310 */ 239, 702, 222, 124, 1011, 130, 133, 123, 37, 197, /* 310 */ 54, 37, 37, 53, 52, 51, 800, 253, 803, 251,
/* 320 */ 195, 193, 66, 127, 1072, 37, 192, 139, 138, 137, /* 320 */ 316, 326, 325, 66, 254, 255, 198, 196, 194, 270,
/* 330 */ 136, 799, 159, 802, 37, 43, 999, 354, 353, 337, /* 330 */ 37, 77, 66, 193, 139, 138, 137, 136, 223, 742,
/* 340 */ 336, 37, 352, 262, 810, 805, 351, 37, 350, 349, /* 340 */ 799, 43, 802, 355, 354, 37, 37, 37, 353, 53,
/* 350 */ 37, 806, 266, 265, 742, 55, 54, 810, 805, 53, /* 350 */ 52, 51, 352, 37, 351, 350, 239, 240, 810, 805,
/* 360 */ 52, 51, 326, 291, 806, 90, 1011, 727, 728, 327, /* 360 */ 1011, 1011, 272, 78, 37, 806, 122, 810, 805, 37,
/* 370 */ 37, 37, 252, 1011, 250, 807, 325, 324, 328, 258, /* 370 */ 37, 359, 358, 144, 806, 327, 38, 14, 348, 1011,
/* 380 */ 82, 255, 1011, 332, 331, 329, 150, 148, 147, 1011, /* 380 */ 82, 93, 70, 259, 739, 256, 320, 333, 332, 83,
/* 390 */ 907, 333, 83, 917, 334, 1011, 908, 188, 1011, 271, /* 390 */ 328, 329, 330, 73, 1011, 1011, 1011, 999, 334, 150,
/* 400 */ 188, 739, 92, 188, 70, 91, 1, 176, 3, 189, /* 400 */ 148, 147, 1011, 1, 177, 775, 776, 727, 728, 335,
/* 410 */ 775, 776, 758, 38, 335, 339, 80, 273, 1011, 1011, /* 410 */ 9, 96, 796, 1011, 336, 340, 758, 274, 1011, 1011,
/* 420 */ 766, 767, 73, 712, 294, 33, 154, 9, 714, 273, /* 420 */ 1083, 766, 767, 746, 71, 712, 274, 295, 714, 297,
/* 430 */ 296, 713, 796, 830, 67, 26, 246, 38, 38, 746, /* 430 */ 155, 713, 33, 74, 807, 67, 26, 830, 811, 38,
/* 440 */ 811, 319, 67, 76, 95, 67, 71, 25, 1120, 617, /* 440 */ 247, 38, 67, 95, 76, 67, 617, 16, 797, 15,
/* 450 */ 808, 132, 131, 113, 25, 112, 1119, 6, 297, 18, /* 450 */ 205, 25, 25, 113, 18, 112, 17, 731, 808, 732,
/* 460 */ 1118, 17, 74, 25, 731, 729, 732, 730, 797, 20, /* 460 */ 25, 6, 729, 211, 730, 298, 20, 119, 19, 118,
/* 470 */ 1083, 19, 119, 224, 118, 701, 22, 225, 21, 207, /* 470 */ 22, 1120, 21, 132, 131, 1119, 701, 1118, 225, 226,
/* 480 */ 208, 211, 205, 212, 213, 217, 218, 219, 216, 202, /* 480 */ 208, 209, 1135, 212, 206, 213, 214, 813, 218, 219,
/* 490 */ 1143, 1082, 1135, 236, 267, 1079, 1078, 237, 338, 151, /* 490 */ 220, 217, 203, 1082, 237, 1079, 1078, 238, 339, 47,
/* 500 */ 1035, 1046, 47, 1065, 1043, 149, 1064, 1025, 1028, 1044, /* 500 */ 1028, 268, 152, 1065, 1064, 1035, 149, 275, 1009, 279,
/* 510 */ 274, 1048, 153, 170, 158, 1009, 278, 285, 171, 1007, /* 510 */ 1046, 1043, 1044, 1048, 154, 159, 286, 171, 172, 273,
/* 520 */ 172, 233, 166, 280, 161, 757, 160, 173, 162, 922, /* 520 */ 234, 1007, 173, 162, 174, 922, 300, 301, 302, 305,
/* 530 */ 163, 299, 300, 301, 304, 305, 282, 292, 45, 290, /* 530 */ 306, 757, 1025, 45, 281, 201, 161, 283, 41, 317,
/* 540 */ 75, 200, 288, 813, 272, 41, 72, 49, 316, 164, /* 540 */ 75, 916, 293, 72, 49, 324, 164, 1142, 291, 110,
/* 550 */ 916, 323, 1142, 110, 1141, 1138, 286, 179, 330, 1134, /* 550 */ 1141, 1138, 163, 289, 180, 331, 1134, 116, 1133, 1130,
/* 560 */ 284, 116, 1133, 1130, 180, 281, 942, 42, 39, 46, /* 560 */ 287, 285, 181, 942, 42, 39, 46, 202, 282, 904,
/* 570 */ 201, 904, 279, 126, 303, 902, 128, 129, 900, 899, /* 570 */ 126, 902, 128, 129, 900, 899, 260, 280, 192, 897,
/* 580 */ 259, 191, 897, 896, 895, 894, 893, 892, 891, 194, /* 580 */ 896, 895, 894, 893, 892, 891, 195, 197, 888, 886,
/* 590 */ 196, 888, 886, 884, 882, 198, 879, 199, 48, 81, /* 590 */ 884, 882, 199, 48, 879, 200, 875, 304, 349, 81,
/* 600 */ 86, 348, 283, 1066, 121, 340, 341, 342, 343, 344, /* 600 */ 86, 284, 1066, 121, 341, 342, 343, 344, 345, 346,
/* 610 */ 223, 345, 346, 356, 855, 243, 298, 260, 261, 854, /* 610 */ 347, 357, 855, 262, 261, 854, 224, 244, 299, 264,
/* 620 */ 263, 220, 221, 264, 853, 836, 104, 921, 920, 105, /* 620 */ 265, 853, 836, 221, 222, 835, 269, 294, 104, 921,
/* 630 */ 835, 268, 273, 10, 293, 734, 275, 84, 30, 898, /* 630 */ 920, 274, 105, 10, 276, 87, 84, 898, 734, 140,
/* 640 */ 890, 183, 182, 943, 187, 181, 184, 185, 2, 140, /* 640 */ 30, 156, 141, 184, 890, 183, 943, 182, 185, 187,
/* 650 */ 186, 141, 142, 889, 4, 143, 980, 881, 87, 944, /* 650 */ 186, 142, 188, 2, 889, 759, 143, 881, 980, 165,
/* 660 */ 759, 165, 167, 168, 169, 880, 155, 157, 768, 156, /* 660 */ 880, 166, 167, 944, 168, 169, 170, 4, 990, 768,
/* 670 */ 235, 762, 88, 89, 990, 764, 287, 31, 11, 32, /* 670 */ 157, 158, 762, 88, 236, 764, 89, 288, 31, 11,
/* 680 */ 12, 13, 27, 295, 28, 96, 98, 101, 35, 100, /* 680 */ 32, 12, 13, 27, 296, 28, 96, 101, 98, 35,
/* 690 */ 632, 36, 102, 667, 665, 664, 663, 661, 660, 659, /* 690 */ 100, 632, 36, 667, 102, 665, 664, 663, 661, 660,
/* 700 */ 656, 314, 622, 106, 7, 320, 812, 321, 8, 109, /* 700 */ 659, 656, 622, 315, 106, 7, 321, 812, 322, 8,
/* 710 */ 814, 111, 68, 69, 115, 704, 703, 38, 117, 700, /* 710 */ 814, 109, 111, 68, 69, 38, 704, 703, 115, 700,
/* 720 */ 648, 646, 638, 644, 640, 642, 636, 634, 670, 669, /* 720 */ 117, 648, 646, 638, 644, 640, 642, 636, 634, 670,
/* 730 */ 668, 666, 662, 658, 657, 190, 620, 585, 583, 859, /* 730 */ 669, 668, 666, 662, 658, 657, 191, 620, 585, 859,
/* 740 */ 858, 858, 858, 858, 858, 858, 858, 858, 858, 858, /* 740 */ 858, 858, 858, 858, 858, 858, 858, 858, 858, 858,
/* 750 */ 858, 145, 146, /* 750 */ 858, 858, 145, 146,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 265, 1, 205, 1, 1, 206, 205, 198, 199, 9, /* 0 */ 264, 1, 204, 1, 1, 204, 197, 198, 197, 9,
/* 10 */ 275, 9, 9, 13, 14, 199, 16, 17, 5, 246, /* 10 */ 274, 9, 9, 13, 14, 197, 16, 17, 195, 196,
/* 20 */ 20, 21, 199, 23, 24, 25, 26, 27, 28, 222, /* 20 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 221,
/* 30 */ 205, 224, 225, 33, 34, 262, 229, 37, 38, 39, /* 30 */ 9, 223, 224, 33, 34, 197, 228, 37, 38, 39,
/* 40 */ 233, 242, 235, 236, 37, 38, 39, 45, 46, 47, /* 40 */ 232, 197, 234, 235, 219, 220, 5, 45, 46, 47,
/* 50 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, /* 50 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/* 60 */ 58, 59, 265, 199, 62, 199, 265, 13, 14, 199, /* 60 */ 58, 59, 264, 61, 203, 264, 13, 14, 245, 16,
/* 70 */ 16, 17, 275, 209, 20, 21, 275, 23, 24, 25, /* 70 */ 17, 210, 274, 20, 21, 274, 23, 24, 25, 26,
/* 80 */ 26, 27, 28, 267, 268, 82, 86, 33, 34, 266, /* 80 */ 27, 28, 271, 265, 261, 85, 33, 34, 201, 202,
/* 90 */ 265, 37, 38, 39, 13, 14, 84, 16, 17, 244, /* 90 */ 37, 38, 39, 13, 14, 204, 16, 17, 5, 245,
/* 100 */ 275, 20, 21, 248, 23, 24, 25, 26, 27, 28, /* 100 */ 20, 21, 81, 23, 24, 25, 26, 27, 28, 271,
/* 110 */ 66, 67, 68, 243, 33, 34, 82, 247, 37, 38, /* 110 */ 266, 267, 197, 33, 34, 261, 205, 37, 38, 39,
/* 120 */ 39, 13, 14, 244, 16, 17, 90, 248, 20, 21, /* 120 */ 243, 62, 63, 64, 247, 243, 33, 34, 69, 247,
/* 130 */ 206, 23, 24, 25, 26, 27, 28, 83, 272, 244, /* 130 */ 71, 72, 73, 13, 14, 82, 16, 17, 79, 81,
/* 140 */ 274, 33, 34, 248, 1, 37, 38, 39, 14, 265, /* 140 */ 20, 21, 248, 23, 24, 25, 26, 27, 28, 238,
/* 150 */ 16, 17, 9, 119, 20, 21, 0, 23, 24, 25, /* 150 */ 239, 240, 241, 33, 34, 264, 262, 37, 38, 39,
/* 160 */ 26, 27, 28, 239, 240, 241, 242, 33, 34, 196, /* 160 */ 14, 246, 16, 17, 83, 274, 20, 21, 141, 23,
/* 170 */ 197, 37, 38, 39, 98, 99, 100, 101, 102, 103, /* 170 */ 24, 25, 26, 27, 28, 197, 118, 150, 151, 33,
/* 180 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 222, /* 180 */ 34, 89, 243, 37, 38, 39, 247, 197, 97, 98,
/* 190 */ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, /* 190 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
/* 200 */ 233, 234, 235, 236, 16, 17, 44, 199, 20, 21, /* 200 */ 109, 110, 111, 221, 222, 223, 224, 225, 226, 227,
/* 210 */ 199, 23, 24, 25, 26, 27, 28, 246, 78, 246, /* 210 */ 228, 229, 230, 231, 232, 233, 234, 235, 16, 17,
/* 220 */ 209, 33, 34, 199, 62, 37, 38, 39, 1, 2, /* 220 */ 242, 197, 20, 21, 246, 23, 24, 25, 26, 27,
/* 230 */ 90, 69, 5, 262, 7, 262, 9, 75, 76, 77, /* 230 */ 28, 197, 245, 44, 197, 33, 34, 0, 205, 37,
/* 240 */ 84, 1, 2, 81, 82, 5, 82, 7, 199, 9, /* 240 */ 38, 39, 68, 1, 2, 208, 247, 5, 261, 7,
/* 250 */ 86, 199, 2, 245, 265, 5, 5, 7, 7, 9, /* 250 */ 61, 9, 1, 2, 247, 203, 5, 68, 7, 269,
/* 260 */ 33, 34, 199, 145, 37, 147, 199, 243, 63, 64, /* 260 */ 9, 271, 210, 74, 75, 76, 197, 33, 34, 80,
/* 270 */ 65, 247, 209, 33, 34, 70, 71, 72, 73, 74, /* 270 */ 81, 37, 38, 39, 241, 33, 34, 208, 244, 37,
/* 280 */ 116, 119, 265, 33, 34, 265, 25, 26, 27, 28, /* 280 */ 62, 63, 64, 197, 33, 34, 264, 69, 70, 71,
/* 290 */ 220, 221, 199, 88, 33, 34, 247, 69, 37, 38, /* 290 */ 72, 73, 264, 2, 208, 271, 5, 273, 7, 203,
/* 300 */ 39, 248, 206, 141, 69, 143, 63, 64, 65, 82, /* 300 */ 9, 25, 26, 27, 28, 87, 210, 118, 68, 33,
/* 310 */ 243, 5, 150, 70, 247, 72, 73, 74, 199, 63, /* 310 */ 34, 197, 197, 37, 38, 39, 5, 143, 7, 145,
/* 320 */ 64, 65, 82, 80, 272, 199, 70, 71, 72, 73, /* 320 */ 83, 147, 148, 81, 33, 34, 62, 63, 64, 140,
/* 330 */ 74, 5, 199, 7, 199, 98, 240, 100, 101, 33, /* 330 */ 197, 142, 81, 69, 70, 71, 72, 73, 149, 37,
/* 340 */ 34, 199, 105, 142, 117, 118, 109, 199, 111, 112, /* 340 */ 5, 97, 7, 99, 100, 197, 197, 197, 104, 37,
/* 350 */ 199, 124, 151, 152, 37, 33, 34, 117, 118, 37, /* 350 */ 38, 39, 108, 197, 110, 111, 242, 242, 116, 117,
/* 360 */ 38, 39, 243, 270, 124, 272, 247, 117, 118, 243, /* 360 */ 246, 246, 82, 205, 197, 123, 77, 116, 117, 197,
/* 370 */ 199, 199, 144, 247, 146, 124, 148, 149, 243, 144, /* 370 */ 197, 65, 66, 67, 123, 242, 96, 81, 89, 246,
/* 380 */ 83, 146, 247, 148, 149, 243, 63, 64, 65, 247, /* 380 */ 82, 85, 96, 143, 96, 145, 15, 147, 148, 82,
/* 390 */ 204, 243, 83, 204, 243, 247, 204, 211, 247, 83, /* 390 */ 242, 242, 242, 96, 246, 246, 246, 239, 242, 62,
/* 400 */ 211, 97, 249, 211, 97, 272, 207, 208, 202, 203, /* 400 */ 63, 64, 246, 206, 207, 131, 132, 116, 117, 242,
/* 410 */ 132, 133, 83, 97, 243, 243, 263, 120, 247, 247, /* 410 */ 122, 115, 1, 246, 242, 242, 82, 119, 246, 246,
/* 420 */ 83, 83, 97, 83, 83, 82, 97, 123, 83, 120, /* 420 */ 237, 82, 82, 121, 138, 82, 119, 82, 82, 82,
/* 430 */ 83, 83, 1, 83, 97, 97, 61, 97, 97, 122, /* 430 */ 96, 82, 81, 136, 123, 96, 96, 82, 82, 96,
/* 440 */ 83, 15, 97, 82, 97, 97, 139, 97, 265, 83, /* 440 */ 60, 96, 96, 96, 81, 96, 82, 144, 37, 146,
/* 450 */ 124, 78, 79, 145, 97, 147, 265, 82, 115, 145, /* 450 */ 264, 96, 96, 144, 144, 146, 146, 5, 123, 7,
/* 460 */ 265, 147, 137, 97, 5, 5, 7, 7, 37, 145, /* 460 */ 96, 81, 5, 264, 7, 114, 144, 144, 146, 146,
/* 470 */ 238, 147, 145, 265, 147, 114, 145, 265, 147, 265, /* 470 */ 144, 264, 146, 77, 78, 264, 113, 264, 264, 264,
/* 480 */ 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, /* 480 */ 264, 264, 247, 264, 264, 264, 264, 116, 264, 264,
/* 490 */ 248, 238, 248, 238, 199, 238, 238, 238, 238, 199, /* 490 */ 264, 264, 264, 237, 237, 237, 237, 237, 237, 263,
/* 500 */ 199, 199, 264, 273, 199, 61, 273, 261, 246, 199, /* 500 */ 245, 197, 197, 272, 272, 197, 60, 245, 245, 268,
/* 510 */ 246, 199, 199, 250, 199, 246, 269, 199, 199, 199, /* 510 */ 197, 197, 197, 197, 197, 197, 197, 249, 197, 199,
/* 520 */ 199, 269, 254, 269, 259, 124, 260, 199, 258, 199, /* 520 */ 268, 197, 197, 258, 197, 197, 197, 197, 197, 197,
/* 530 */ 257, 199, 199, 199, 199, 199, 269, 130, 199, 134, /* 530 */ 197, 123, 260, 197, 268, 197, 259, 268, 197, 197,
/* 540 */ 136, 199, 128, 117, 200, 199, 138, 135, 199, 256, /* 540 */ 135, 197, 129, 137, 134, 197, 256, 197, 133, 197,
/* 550 */ 199, 199, 199, 199, 199, 199, 127, 199, 199, 199, /* 550 */ 197, 197, 257, 127, 197, 197, 197, 197, 197, 197,
/* 560 */ 126, 199, 199, 199, 199, 129, 199, 199, 199, 199, /* 560 */ 126, 125, 197, 197, 197, 197, 197, 197, 128, 197,
/* 570 */ 199, 199, 125, 199, 89, 199, 199, 199, 199, 199, /* 570 */ 197, 197, 197, 197, 197, 197, 197, 124, 197, 197,
/* 580 */ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, /* 580 */ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
/* 590 */ 199, 199, 199, 199, 199, 199, 199, 199, 140, 200, /* 590 */ 197, 197, 197, 139, 197, 197, 197, 88, 112, 199,
/* 600 */ 200, 113, 200, 200, 96, 95, 51, 92, 94, 55, /* 600 */ 199, 199, 199, 95, 94, 51, 91, 93, 55, 92,
/* 610 */ 200, 93, 91, 84, 5, 200, 200, 153, 5, 5, /* 610 */ 90, 83, 5, 5, 152, 5, 199, 199, 199, 152,
/* 620 */ 153, 200, 200, 5, 5, 100, 206, 210, 210, 206, /* 620 */ 5, 5, 99, 199, 199, 98, 141, 114, 205, 209,
/* 630 */ 99, 142, 120, 82, 115, 83, 97, 121, 82, 200, /* 630 */ 209, 119, 205, 81, 96, 96, 120, 199, 82, 200,
/* 640 */ 200, 213, 217, 219, 212, 218, 216, 214, 207, 201, /* 640 */ 81, 81, 200, 212, 199, 216, 218, 217, 215, 214,
/* 650 */ 215, 201, 201, 200, 202, 201, 237, 200, 97, 221, /* 650 */ 213, 200, 211, 206, 199, 82, 200, 199, 236, 255,
/* 660 */ 83, 255, 253, 252, 251, 200, 82, 97, 83, 82, /* 660 */ 199, 254, 253, 220, 252, 251, 250, 201, 236, 82,
/* 670 */ 1, 83, 82, 82, 237, 83, 82, 97, 131, 97, /* 670 */ 81, 96, 82, 81, 1, 82, 81, 81, 96, 130,
/* 680 */ 131, 82, 82, 115, 82, 116, 78, 71, 87, 86, /* 680 */ 96, 130, 81, 81, 114, 81, 115, 70, 77, 86,
/* 690 */ 5, 87, 86, 9, 5, 5, 5, 5, 5, 5, /* 690 */ 85, 5, 86, 9, 85, 5, 5, 5, 5, 5,
/* 700 */ 5, 15, 85, 78, 82, 24, 83, 59, 82, 147, /* 700 */ 5, 5, 84, 15, 77, 81, 24, 82, 59, 81,
/* 710 */ 117, 147, 16, 16, 147, 5, 5, 97, 147, 83, /* 710 */ 116, 146, 146, 16, 16, 96, 5, 5, 146, 82,
/* 720 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 720 */ 146, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 730 */ 5, 5, 5, 5, 5, 97, 85, 61, 60, 0, /* 730 */ 5, 5, 5, 5, 5, 5, 96, 84, 60, 0,
/* 740 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 740 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 750 */ 276, 21, 21, 276, 276, 276, 276, 276, 276, 276, /* 750 */ 275, 275, 21, 21, 275, 275, 275, 275, 275, 275,
/* 760 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 760 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 770 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 770 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 780 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 780 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 790 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 790 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 800 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 800 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 810 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 810 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 820 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 820 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 830 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 830 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 840 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 840 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 850 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 850 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 860 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 860 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 870 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 870 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 880 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 880 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 890 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 890 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 900 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 900 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 910 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 910 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 920 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 920 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 930 */ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, /* 930 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
/* 940 */ 276, 276, 276, 276, 276, 276, 276, 276, /* 940 */ 275, 275, 275, 275, 275, 275, 275, 275, 275,
}; };
#define YY_SHIFT_COUNT (361) #define YY_SHIFT_COUNT (361)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (739) #define YY_SHIFT_MAX (739)
static const unsigned short int yy_shift_ofst[] = { static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 162, 76, 76, 237, 237, 12, 227, 240, 240, 3, /* 0 */ 189, 91, 91, 244, 244, 81, 242, 251, 251, 21,
/* 10 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 10 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 20 */ 143, 143, 143, 0, 2, 240, 250, 250, 250, 34, /* 20 */ 3, 3, 3, 0, 2, 251, 291, 291, 291, 58,
/* 30 */ 34, 143, 143, 143, 156, 143, 143, 143, 143, 140, /* 30 */ 58, 3, 3, 3, 237, 3, 3, 3, 3, 289,
/* 40 */ 12, 36, 36, 13, 753, 753, 753, 240, 240, 240, /* 40 */ 81, 92, 92, 41, 754, 754, 754, 251, 251, 251,
/* 50 */ 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, /* 50 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
/* 60 */ 240, 240, 240, 240, 240, 240, 240, 250, 250, 250, /* 60 */ 251, 251, 251, 251, 251, 251, 251, 291, 291, 291,
/* 70 */ 306, 306, 306, 306, 306, 306, 306, 143, 143, 143, /* 70 */ 93, 93, 93, 93, 93, 93, 93, 3, 3, 3,
/* 80 */ 317, 143, 143, 143, 34, 34, 143, 143, 143, 143, /* 80 */ 302, 3, 3, 3, 58, 58, 3, 3, 3, 3,
/* 90 */ 278, 278, 304, 34, 143, 143, 143, 143, 143, 143, /* 90 */ 274, 274, 288, 58, 3, 3, 3, 3, 3, 3,
/* 100 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 100 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 110 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 120 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 120 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 130 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 130 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 140 */ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, /* 140 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 150 */ 143, 444, 444, 444, 401, 401, 401, 401, 444, 444, /* 150 */ 3, 3, 446, 446, 446, 408, 408, 408, 408, 446,
/* 160 */ 404, 408, 407, 412, 405, 414, 429, 434, 436, 447, /* 160 */ 446, 405, 406, 413, 410, 415, 426, 434, 436, 440,
/* 170 */ 458, 444, 444, 444, 485, 485, 488, 12, 12, 444, /* 170 */ 453, 454, 446, 446, 446, 509, 509, 486, 81, 81,
/* 180 */ 444, 508, 510, 555, 515, 514, 554, 518, 521, 488, /* 180 */ 446, 446, 508, 510, 554, 515, 514, 553, 517, 520,
/* 190 */ 13, 444, 529, 529, 444, 529, 444, 529, 444, 444, /* 190 */ 486, 41, 446, 528, 528, 446, 528, 446, 528, 446,
/* 200 */ 753, 753, 54, 81, 81, 108, 81, 134, 188, 205, /* 200 */ 446, 754, 754, 53, 80, 80, 120, 80, 146, 202,
/* 210 */ 261, 261, 261, 261, 243, 256, 322, 322, 322, 322, /* 210 */ 218, 276, 276, 276, 276, 59, 264, 234, 234, 234,
/* 220 */ 228, 235, 201, 164, 7, 7, 251, 326, 44, 323, /* 220 */ 234, 174, 240, 27, 296, 312, 312, 311, 335, 306,
/* 230 */ 316, 297, 309, 329, 337, 338, 307, 325, 340, 341, /* 230 */ 337, 280, 298, 307, 334, 339, 340, 286, 297, 343,
/* 240 */ 345, 347, 348, 343, 350, 357, 431, 375, 426, 366, /* 240 */ 345, 346, 347, 349, 351, 355, 356, 411, 380, 371,
/* 250 */ 118, 308, 314, 459, 460, 324, 327, 361, 331, 373, /* 250 */ 364, 303, 309, 310, 452, 457, 322, 323, 363, 326,
/* 260 */ 609, 464, 613, 614, 467, 618, 619, 525, 531, 489, /* 260 */ 396, 607, 462, 608, 610, 467, 615, 616, 523, 527,
/* 270 */ 512, 519, 551, 516, 552, 556, 539, 561, 577, 584, /* 270 */ 485, 512, 513, 552, 516, 556, 559, 538, 539, 573,
/* 280 */ 585, 587, 588, 570, 590, 592, 591, 669, 594, 580, /* 280 */ 560, 587, 589, 590, 575, 592, 593, 595, 673, 596,
/* 290 */ 547, 582, 549, 599, 519, 600, 568, 602, 569, 608, /* 290 */ 582, 549, 584, 551, 601, 513, 602, 570, 604, 571,
/* 300 */ 601, 603, 616, 685, 604, 606, 684, 689, 690, 691, /* 300 */ 611, 603, 605, 617, 686, 606, 609, 684, 690, 691,
/* 310 */ 692, 693, 694, 695, 617, 686, 625, 622, 623, 593, /* 310 */ 692, 693, 694, 695, 696, 618, 688, 627, 624, 625,
/* 320 */ 626, 681, 648, 696, 562, 564, 620, 620, 620, 620, /* 320 */ 594, 628, 682, 649, 697, 565, 566, 619, 619, 619,
/* 330 */ 697, 567, 571, 620, 620, 620, 710, 711, 636, 620, /* 330 */ 619, 698, 572, 574, 619, 619, 619, 711, 712, 637,
/* 340 */ 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, /* 340 */ 619, 716, 717, 718, 719, 720, 721, 722, 723, 724,
/* 350 */ 725, 726, 727, 728, 729, 638, 651, 730, 731, 676, /* 350 */ 725, 726, 727, 728, 729, 730, 640, 653, 731, 732,
/* 360 */ 678, 739, /* 360 */ 678, 739,
}; };
#define YY_REDUCE_COUNT (201) #define YY_REDUCE_COUNT (202)
#define YY_REDUCE_MIN (-265) #define YY_REDUCE_MIN (-264)
#define YY_REDUCE_MAX (465) #define YY_REDUCE_MAX (466)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -27, -33, -33, -193, -193, -76, -203, -199, -175, -184, /* 0 */ -177, -18, -18, -192, -192, -89, -202, -199, -109, -156,
/* 10 */ -130, -134, 93, 24, 67, 119, 126, 135, 142, 148, /* 10 */ -22, 24, -10, 114, 115, 133, 148, 149, 150, 156,
/* 20 */ 151, 171, 172, -177, -191, -265, -145, -121, -105, -227, /* 20 */ 167, 172, 173, -182, -191, -264, -123, -118, -61, -146,
/* 30 */ -29, 52, 133, 8, -201, -136, 11, 63, 49, 186, /* 30 */ -13, -189, -162, 34, 33, 37, 69, 86, -85, -139,
/* 40 */ 96, 189, 192, 70, 153, 199, 206, -116, -11, 17, /* 40 */ 158, 52, 96, -175, -106, 197, -113, 22, 28, 186,
/* 50 */ 20, 183, 191, 195, 208, 212, 214, 215, 216, 217, /* 50 */ 199, 207, 211, 213, 214, 215, 216, 217, 219, 220,
/* 60 */ 218, 219, 220, 221, 222, 223, 224, 53, 242, 244, /* 60 */ 221, 222, 224, 225, 226, 227, 228, -1, 7, 235,
/* 70 */ 232, 253, 255, 257, 258, 259, 260, 295, 300, 301, /* 70 */ 183, 256, 257, 258, 259, 260, 261, 304, 305, 308,
/* 80 */ 238, 302, 305, 310, 262, 264, 312, 313, 315, 318, /* 80 */ 236, 313, 314, 315, 255, 262, 316, 317, 318, 319,
/* 90 */ 230, 233, 263, 269, 319, 320, 321, 328, 330, 332, /* 90 */ 231, 232, 268, 263, 321, 324, 325, 327, 328, 329,
/* 100 */ 333, 334, 335, 336, 339, 342, 346, 349, 351, 352, /* 100 */ 330, 331, 332, 333, 336, 338, 341, 342, 344, 348,
/* 110 */ 353, 354, 355, 356, 358, 359, 360, 362, 363, 364, /* 110 */ 350, 352, 353, 354, 357, 358, 359, 360, 361, 362,
/* 120 */ 365, 367, 368, 369, 370, 371, 372, 374, 376, 377, /* 120 */ 365, 366, 367, 368, 369, 370, 372, 373, 374, 375,
/* 130 */ 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, /* 130 */ 376, 377, 378, 379, 381, 382, 383, 384, 385, 386,
/* 140 */ 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, /* 140 */ 387, 388, 389, 390, 391, 392, 393, 394, 395, 397,
/* 150 */ 398, 344, 399, 400, 247, 252, 254, 267, 402, 403, /* 150 */ 398, 399, 320, 400, 401, 241, 252, 266, 269, 402,
/* 160 */ 246, 266, 265, 270, 273, 293, 406, 268, 409, 411, /* 160 */ 403, 272, 277, 265, 295, 290, 404, 407, 409, 412,
/* 170 */ 413, 410, 415, 416, 417, 418, 419, 420, 423, 421, /* 170 */ 414, 416, 417, 418, 419, 420, 421, 422, 423, 427,
/* 180 */ 422, 424, 427, 425, 428, 430, 433, 435, 432, 437, /* 180 */ 424, 425, 428, 430, 429, 431, 433, 437, 435, 441,
/* 190 */ 438, 439, 448, 450, 440, 451, 453, 454, 457, 465, /* 190 */ 432, 443, 438, 439, 442, 445, 451, 455, 456, 458,
/* 200 */ 441, 452, /* 200 */ 461, 447, 466,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 856, 979, 918, 989, 905, 915, 1126, 1126, 1126, 856, /* 0 */ 856, 979, 918, 989, 905, 915, 1126, 1126, 1126, 856,
...@@ -464,28 +477,28 @@ static const YYACTIONTYPE yy_default[] = { ...@@ -464,28 +477,28 @@ static const YYACTIONTYPE yy_default[] = {
/* 120 */ 856, 856, 856, 856, 856, 856, 903, 856, 901, 856, /* 120 */ 856, 856, 856, 856, 856, 856, 903, 856, 901, 856,
/* 130 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, /* 130 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 140 */ 856, 856, 856, 856, 887, 856, 856, 856, 856, 856, /* 140 */ 856, 856, 856, 856, 887, 856, 856, 856, 856, 856,
/* 150 */ 856, 878, 878, 878, 856, 856, 856, 856, 878, 878, /* 150 */ 856, 874, 878, 878, 878, 856, 856, 856, 856, 878,
/* 160 */ 1076, 1080, 1062, 1074, 1070, 1057, 1055, 1053, 1061, 1052, /* 160 */ 878, 1076, 1080, 1062, 1074, 1070, 1057, 1055, 1053, 1061,
/* 170 */ 1084, 878, 878, 878, 923, 923, 919, 915, 915, 878, /* 170 */ 1052, 1084, 878, 878, 878, 923, 923, 919, 915, 915,
/* 180 */ 878, 941, 939, 937, 929, 935, 931, 933, 927, 906, /* 180 */ 878, 878, 941, 939, 937, 929, 935, 931, 933, 927,
/* 190 */ 856, 878, 913, 913, 878, 913, 878, 913, 878, 878, /* 190 */ 906, 856, 878, 913, 913, 878, 913, 878, 913, 878,
/* 200 */ 963, 981, 856, 1085, 1075, 856, 1125, 1115, 1114, 856, /* 200 */ 878, 963, 981, 856, 1085, 1075, 856, 1125, 1115, 1114,
/* 210 */ 1121, 1113, 1112, 1111, 856, 856, 1107, 1110, 1109, 1108, /* 210 */ 856, 1121, 1113, 1112, 1111, 856, 856, 1107, 1110, 1109,
/* 220 */ 856, 856, 856, 856, 1117, 1116, 856, 856, 856, 856, /* 220 */ 1108, 856, 856, 856, 856, 1117, 1116, 856, 856, 856,
/* 230 */ 856, 856, 856, 856, 856, 856, 1081, 1077, 856, 856, /* 230 */ 856, 856, 856, 856, 856, 856, 856, 1081, 1077, 856,
/* 240 */ 856, 856, 856, 856, 856, 856, 856, 1087, 856, 856, /* 240 */ 856, 856, 856, 856, 856, 856, 856, 856, 1087, 856,
/* 250 */ 856, 856, 856, 856, 856, 856, 856, 991, 856, 856, /* 250 */ 856, 856, 856, 856, 856, 856, 856, 856, 991, 856,
/* 260 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, /* 260 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 270 */ 1029, 856, 856, 856, 856, 856, 1041, 1040, 856, 856, /* 270 */ 856, 1029, 856, 856, 856, 856, 856, 1041, 1040, 856,
/* 280 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 1071, /* 280 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 290 */ 856, 1063, 856, 856, 1003, 856, 856, 856, 856, 856, /* 290 */ 1071, 856, 1063, 856, 856, 1003, 856, 856, 856, 856,
/* 300 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, /* 300 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 310 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, /* 310 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 320 */ 856, 856, 856, 856, 856, 856, 1144, 1139, 1140, 1137, /* 320 */ 856, 856, 856, 856, 856, 856, 856, 1144, 1139, 1140,
/* 330 */ 856, 856, 856, 1136, 1131, 1132, 856, 856, 856, 1129, /* 330 */ 1137, 856, 856, 856, 1136, 1131, 1132, 856, 856, 856,
/* 340 */ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, /* 340 */ 1129, 856, 856, 856, 856, 856, 856, 856, 856, 856,
/* 350 */ 856, 856, 856, 856, 856, 947, 856, 885, 883, 856, /* 350 */ 856, 856, 856, 856, 856, 856, 947, 856, 885, 883,
/* 360 */ 874, 856, /* 360 */ 856, 856,
}; };
/********** End of lemon-generated parsing tables *****************************/ /********** End of lemon-generated parsing tables *****************************/
...@@ -565,7 +578,6 @@ static const YYCODETYPE yyFallback[] = { ...@@ -565,7 +578,6 @@ static const YYCODETYPE yyFallback[] = {
0, /* SCORES => nothing */ 0, /* SCORES => nothing */
0, /* GRANTS => nothing */ 0, /* GRANTS => nothing */
0, /* VNODES => nothing */ 0, /* VNODES => nothing */
1, /* IPTOKEN => ID */
0, /* DOT => nothing */ 0, /* DOT => nothing */
0, /* CREATE => nothing */ 0, /* CREATE => nothing */
0, /* TABLE => nothing */ 0, /* TABLE => nothing */
...@@ -690,6 +702,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -690,6 +702,7 @@ static const YYCODETYPE yyFallback[] = {
1, /* STATEMENT => ID */ 1, /* STATEMENT => ID */
1, /* TRIGGER => ID */ 1, /* TRIGGER => ID */
1, /* VIEW => ID */ 1, /* VIEW => ID */
1, /* IPTOKEN => ID */
1, /* SEMI => ID */ 1, /* SEMI => ID */
1, /* NONE => ID */ 1, /* NONE => ID */
1, /* PREV => ID */ 1, /* PREV => ID */
...@@ -739,6 +752,7 @@ struct yyParser { ...@@ -739,6 +752,7 @@ struct yyParser {
int yyerrcnt; /* Shifts left before out of the error */ int yyerrcnt; /* Shifts left before out of the error */
#endif #endif
ParseARG_SDECL /* A place to hold %extra_argument */ ParseARG_SDECL /* A place to hold %extra_argument */
ParseCTX_SDECL /* A place to hold %extra_context */
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */ int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */ yyStackEntry *yystack; /* The parser's stack */
...@@ -846,131 +860,131 @@ static const char *const yyTokenName[] = { ...@@ -846,131 +860,131 @@ static const char *const yyTokenName[] = {
/* 57 */ "SCORES", /* 57 */ "SCORES",
/* 58 */ "GRANTS", /* 58 */ "GRANTS",
/* 59 */ "VNODES", /* 59 */ "VNODES",
/* 60 */ "IPTOKEN", /* 60 */ "DOT",
/* 61 */ "DOT", /* 61 */ "CREATE",
/* 62 */ "CREATE", /* 62 */ "TABLE",
/* 63 */ "TABLE", /* 63 */ "STABLE",
/* 64 */ "STABLE", /* 64 */ "DATABASE",
/* 65 */ "DATABASE", /* 65 */ "TABLES",
/* 66 */ "TABLES", /* 66 */ "STABLES",
/* 67 */ "STABLES", /* 67 */ "VGROUPS",
/* 68 */ "VGROUPS", /* 68 */ "DROP",
/* 69 */ "DROP", /* 69 */ "TOPIC",
/* 70 */ "TOPIC", /* 70 */ "FUNCTION",
/* 71 */ "FUNCTION", /* 71 */ "DNODE",
/* 72 */ "DNODE", /* 72 */ "USER",
/* 73 */ "USER", /* 73 */ "ACCOUNT",
/* 74 */ "ACCOUNT", /* 74 */ "USE",
/* 75 */ "USE", /* 75 */ "DESCRIBE",
/* 76 */ "DESCRIBE", /* 76 */ "ALTER",
/* 77 */ "ALTER", /* 77 */ "PASS",
/* 78 */ "PASS", /* 78 */ "PRIVILEGE",
/* 79 */ "PRIVILEGE", /* 79 */ "LOCAL",
/* 80 */ "LOCAL", /* 80 */ "COMPACT",
/* 81 */ "COMPACT", /* 81 */ "LP",
/* 82 */ "LP", /* 82 */ "RP",
/* 83 */ "RP", /* 83 */ "IF",
/* 84 */ "IF", /* 84 */ "EXISTS",
/* 85 */ "EXISTS", /* 85 */ "AS",
/* 86 */ "AS", /* 86 */ "OUTPUTTYPE",
/* 87 */ "OUTPUTTYPE", /* 87 */ "AGGREGATE",
/* 88 */ "AGGREGATE", /* 88 */ "BUFSIZE",
/* 89 */ "BUFSIZE", /* 89 */ "PPS",
/* 90 */ "PPS", /* 90 */ "TSERIES",
/* 91 */ "TSERIES", /* 91 */ "DBS",
/* 92 */ "DBS", /* 92 */ "STORAGE",
/* 93 */ "STORAGE", /* 93 */ "QTIME",
/* 94 */ "QTIME", /* 94 */ "CONNS",
/* 95 */ "CONNS", /* 95 */ "STATE",
/* 96 */ "STATE", /* 96 */ "COMMA",
/* 97 */ "COMMA", /* 97 */ "KEEP",
/* 98 */ "KEEP", /* 98 */ "CACHE",
/* 99 */ "CACHE", /* 99 */ "REPLICA",
/* 100 */ "REPLICA", /* 100 */ "QUORUM",
/* 101 */ "QUORUM", /* 101 */ "DAYS",
/* 102 */ "DAYS", /* 102 */ "MINROWS",
/* 103 */ "MINROWS", /* 103 */ "MAXROWS",
/* 104 */ "MAXROWS", /* 104 */ "BLOCKS",
/* 105 */ "BLOCKS", /* 105 */ "CTIME",
/* 106 */ "CTIME", /* 106 */ "WAL",
/* 107 */ "WAL", /* 107 */ "FSYNC",
/* 108 */ "FSYNC", /* 108 */ "COMP",
/* 109 */ "COMP", /* 109 */ "PRECISION",
/* 110 */ "PRECISION", /* 110 */ "UPDATE",
/* 111 */ "UPDATE", /* 111 */ "CACHELAST",
/* 112 */ "CACHELAST", /* 112 */ "PARTITIONS",
/* 113 */ "PARTITIONS", /* 113 */ "UNSIGNED",
/* 114 */ "UNSIGNED", /* 114 */ "TAGS",
/* 115 */ "TAGS", /* 115 */ "USING",
/* 116 */ "USING", /* 116 */ "NULL",
/* 117 */ "NULL", /* 117 */ "NOW",
/* 118 */ "NOW", /* 118 */ "SELECT",
/* 119 */ "SELECT", /* 119 */ "UNION",
/* 120 */ "UNION", /* 120 */ "ALL",
/* 121 */ "ALL", /* 121 */ "DISTINCT",
/* 122 */ "DISTINCT", /* 122 */ "FROM",
/* 123 */ "FROM", /* 123 */ "VARIABLE",
/* 124 */ "VARIABLE", /* 124 */ "INTERVAL",
/* 125 */ "INTERVAL", /* 125 */ "SESSION",
/* 126 */ "SESSION", /* 126 */ "STATE_WINDOW",
/* 127 */ "STATE_WINDOW", /* 127 */ "FILL",
/* 128 */ "FILL", /* 128 */ "SLIDING",
/* 129 */ "SLIDING", /* 129 */ "ORDER",
/* 130 */ "ORDER", /* 130 */ "BY",
/* 131 */ "BY", /* 131 */ "ASC",
/* 132 */ "ASC", /* 132 */ "DESC",
/* 133 */ "DESC", /* 133 */ "GROUP",
/* 134 */ "GROUP", /* 134 */ "HAVING",
/* 135 */ "HAVING", /* 135 */ "LIMIT",
/* 136 */ "LIMIT", /* 136 */ "OFFSET",
/* 137 */ "OFFSET", /* 137 */ "SLIMIT",
/* 138 */ "SLIMIT", /* 138 */ "SOFFSET",
/* 139 */ "SOFFSET", /* 139 */ "WHERE",
/* 140 */ "WHERE", /* 140 */ "RESET",
/* 141 */ "RESET", /* 141 */ "QUERY",
/* 142 */ "QUERY", /* 142 */ "SYNCDB",
/* 143 */ "SYNCDB", /* 143 */ "ADD",
/* 144 */ "ADD", /* 144 */ "COLUMN",
/* 145 */ "COLUMN", /* 145 */ "MODIFY",
/* 146 */ "MODIFY", /* 146 */ "TAG",
/* 147 */ "TAG", /* 147 */ "CHANGE",
/* 148 */ "CHANGE", /* 148 */ "SET",
/* 149 */ "SET", /* 149 */ "KILL",
/* 150 */ "KILL", /* 150 */ "CONNECTION",
/* 151 */ "CONNECTION", /* 151 */ "STREAM",
/* 152 */ "STREAM", /* 152 */ "COLON",
/* 153 */ "COLON", /* 153 */ "ABORT",
/* 154 */ "ABORT", /* 154 */ "AFTER",
/* 155 */ "AFTER", /* 155 */ "ATTACH",
/* 156 */ "ATTACH", /* 156 */ "BEFORE",
/* 157 */ "BEFORE", /* 157 */ "BEGIN",
/* 158 */ "BEGIN", /* 158 */ "CASCADE",
/* 159 */ "CASCADE", /* 159 */ "CLUSTER",
/* 160 */ "CLUSTER", /* 160 */ "CONFLICT",
/* 161 */ "CONFLICT", /* 161 */ "COPY",
/* 162 */ "COPY", /* 162 */ "DEFERRED",
/* 163 */ "DEFERRED", /* 163 */ "DELIMITERS",
/* 164 */ "DELIMITERS", /* 164 */ "DETACH",
/* 165 */ "DETACH", /* 165 */ "EACH",
/* 166 */ "EACH", /* 166 */ "END",
/* 167 */ "END", /* 167 */ "EXPLAIN",
/* 168 */ "EXPLAIN", /* 168 */ "FAIL",
/* 169 */ "FAIL", /* 169 */ "FOR",
/* 170 */ "FOR", /* 170 */ "IGNORE",
/* 171 */ "IGNORE", /* 171 */ "IMMEDIATE",
/* 172 */ "IMMEDIATE", /* 172 */ "INITIALLY",
/* 173 */ "INITIALLY", /* 173 */ "INSTEAD",
/* 174 */ "INSTEAD", /* 174 */ "MATCH",
/* 175 */ "MATCH", /* 175 */ "KEY",
/* 176 */ "KEY", /* 176 */ "OF",
/* 177 */ "OF", /* 177 */ "RAISE",
/* 178 */ "RAISE", /* 178 */ "REPLACE",
/* 179 */ "REPLACE", /* 179 */ "RESTRICT",
/* 180 */ "RESTRICT", /* 180 */ "ROW",
/* 181 */ "ROW", /* 181 */ "STATEMENT",
/* 182 */ "STATEMENT", /* 182 */ "TRIGGER",
/* 183 */ "TRIGGER", /* 183 */ "VIEW",
/* 184 */ "VIEW", /* 184 */ "IPTOKEN",
/* 185 */ "SEMI", /* 185 */ "SEMI",
/* 186 */ "NONE", /* 186 */ "NONE",
/* 187 */ "PREV", /* 187 */ "PREV",
...@@ -981,87 +995,86 @@ static const char *const yyTokenName[] = { ...@@ -981,87 +995,86 @@ static const char *const yyTokenName[] = {
/* 192 */ "INSERT", /* 192 */ "INSERT",
/* 193 */ "INTO", /* 193 */ "INTO",
/* 194 */ "VALUES", /* 194 */ "VALUES",
/* 195 */ "error", /* 195 */ "program",
/* 196 */ "program", /* 196 */ "cmd",
/* 197 */ "cmd", /* 197 */ "ids",
/* 198 */ "dbPrefix", /* 198 */ "dbPrefix",
/* 199 */ "ids", /* 199 */ "cpxName",
/* 200 */ "cpxName", /* 200 */ "ifexists",
/* 201 */ "ifexists", /* 201 */ "alter_db_optr",
/* 202 */ "alter_db_optr", /* 202 */ "alter_topic_optr",
/* 203 */ "alter_topic_optr", /* 203 */ "acct_optr",
/* 204 */ "acct_optr", /* 204 */ "exprlist",
/* 205 */ "exprlist", /* 205 */ "ifnotexists",
/* 206 */ "ifnotexists", /* 206 */ "db_optr",
/* 207 */ "db_optr", /* 207 */ "topic_optr",
/* 208 */ "topic_optr", /* 208 */ "typename",
/* 209 */ "typename", /* 209 */ "bufsize",
/* 210 */ "bufsize", /* 210 */ "pps",
/* 211 */ "pps", /* 211 */ "tseries",
/* 212 */ "tseries", /* 212 */ "dbs",
/* 213 */ "dbs", /* 213 */ "streams",
/* 214 */ "streams", /* 214 */ "storage",
/* 215 */ "storage", /* 215 */ "qtime",
/* 216 */ "qtime", /* 216 */ "users",
/* 217 */ "users", /* 217 */ "conns",
/* 218 */ "conns", /* 218 */ "state",
/* 219 */ "state", /* 219 */ "intitemlist",
/* 220 */ "intitemlist", /* 220 */ "intitem",
/* 221 */ "intitem", /* 221 */ "keep",
/* 222 */ "keep", /* 222 */ "cache",
/* 223 */ "cache", /* 223 */ "replica",
/* 224 */ "replica", /* 224 */ "quorum",
/* 225 */ "quorum", /* 225 */ "days",
/* 226 */ "days", /* 226 */ "minrows",
/* 227 */ "minrows", /* 227 */ "maxrows",
/* 228 */ "maxrows", /* 228 */ "blocks",
/* 229 */ "blocks", /* 229 */ "ctime",
/* 230 */ "ctime", /* 230 */ "wal",
/* 231 */ "wal", /* 231 */ "fsync",
/* 232 */ "fsync", /* 232 */ "comp",
/* 233 */ "comp", /* 233 */ "prec",
/* 234 */ "prec", /* 234 */ "update",
/* 235 */ "update", /* 235 */ "cachelast",
/* 236 */ "cachelast", /* 236 */ "partitions",
/* 237 */ "partitions", /* 237 */ "signed",
/* 238 */ "signed", /* 238 */ "create_table_args",
/* 239 */ "create_table_args", /* 239 */ "create_stable_args",
/* 240 */ "create_stable_args", /* 240 */ "create_table_list",
/* 241 */ "create_table_list", /* 241 */ "create_from_stable",
/* 242 */ "create_from_stable", /* 242 */ "columnlist",
/* 243 */ "columnlist", /* 243 */ "tagitemlist",
/* 244 */ "tagitemlist", /* 244 */ "tagNamelist",
/* 245 */ "tagNamelist", /* 245 */ "select",
/* 246 */ "select", /* 246 */ "column",
/* 247 */ "column", /* 247 */ "tagitem",
/* 248 */ "tagitem", /* 248 */ "selcollist",
/* 249 */ "selcollist", /* 249 */ "from",
/* 250 */ "from", /* 250 */ "where_opt",
/* 251 */ "where_opt", /* 251 */ "interval_opt",
/* 252 */ "interval_opt", /* 252 */ "sliding_opt",
/* 253 */ "sliding_opt", /* 253 */ "session_option",
/* 254 */ "session_option", /* 254 */ "windowstate_option",
/* 255 */ "windowstate_option", /* 255 */ "fill_opt",
/* 256 */ "fill_opt", /* 256 */ "groupby_opt",
/* 257 */ "groupby_opt", /* 257 */ "having_opt",
/* 258 */ "having_opt", /* 258 */ "orderby_opt",
/* 259 */ "orderby_opt", /* 259 */ "slimit_opt",
/* 260 */ "slimit_opt", /* 260 */ "limit_opt",
/* 261 */ "limit_opt", /* 261 */ "union",
/* 262 */ "union", /* 262 */ "sclp",
/* 263 */ "sclp", /* 263 */ "distinct",
/* 264 */ "distinct", /* 264 */ "expr",
/* 265 */ "expr", /* 265 */ "as",
/* 266 */ "as", /* 266 */ "tablelist",
/* 267 */ "tablelist", /* 267 */ "sub",
/* 268 */ "sub", /* 268 */ "tmvar",
/* 269 */ "tmvar", /* 269 */ "sortlist",
/* 270 */ "sortlist", /* 270 */ "sortitem",
/* 271 */ "sortitem", /* 271 */ "item",
/* 272 */ "item", /* 272 */ "sortorder",
/* 273 */ "sortorder", /* 273 */ "grouplist",
/* 274 */ "grouplist", /* 274 */ "expritem",
/* 275 */ "expritem",
}; };
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
...@@ -1085,7 +1098,7 @@ static const char *const yyRuleName[] = { ...@@ -1085,7 +1098,7 @@ static const char *const yyRuleName[] = {
/* 13 */ "cmd ::= SHOW SCORES", /* 13 */ "cmd ::= SHOW SCORES",
/* 14 */ "cmd ::= SHOW GRANTS", /* 14 */ "cmd ::= SHOW GRANTS",
/* 15 */ "cmd ::= SHOW VNODES", /* 15 */ "cmd ::= SHOW VNODES",
/* 16 */ "cmd ::= SHOW VNODES IPTOKEN", /* 16 */ "cmd ::= SHOW VNODES ids",
/* 17 */ "dbPrefix ::=", /* 17 */ "dbPrefix ::=",
/* 18 */ "dbPrefix ::= ids DOT", /* 18 */ "dbPrefix ::= ids DOT",
/* 19 */ "cpxName ::=", /* 19 */ "cpxName ::=",
...@@ -1406,28 +1419,29 @@ static int yyGrowStack(yyParser *p){ ...@@ -1406,28 +1419,29 @@ static int yyGrowStack(yyParser *p){
/* Initialize a new parser that has already been allocated. /* Initialize a new parser that has already been allocated.
*/ */
void ParseInit(void *yypParser){ void ParseInit(void *yypRawParser ParseCTX_PDECL){
yyParser *pParser = (yyParser*)yypParser; yyParser *yypParser = (yyParser*)yypRawParser;
ParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
pParser->yyhwm = 0; yypParser->yyhwm = 0;
#endif #endif
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
pParser->yytos = NULL; yypParser->yytos = NULL;
pParser->yystack = NULL; yypParser->yystack = NULL;
pParser->yystksz = 0; yypParser->yystksz = 0;
if( yyGrowStack(pParser) ){ if( yyGrowStack(yypParser) ){
pParser->yystack = &pParser->yystk0; yypParser->yystack = &yypParser->yystk0;
pParser->yystksz = 1; yypParser->yystksz = 1;
} }
#endif #endif
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
pParser->yyerrcnt = -1; yypParser->yyerrcnt = -1;
#endif #endif
pParser->yytos = pParser->yystack; yypParser->yytos = yypParser->yystack;
pParser->yystack[0].stateno = 0; yypParser->yystack[0].stateno = 0;
pParser->yystack[0].major = 0; yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif #endif
} }
...@@ -1444,11 +1458,14 @@ void ParseInit(void *yypParser){ ...@@ -1444,11 +1458,14 @@ void ParseInit(void *yypParser){
** A pointer to a parser. This pointer is used in subsequent calls ** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree. ** to Parse and ParseFree.
*/ */
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
yyParser *pParser; yyParser *yypParser;
pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
if( pParser ) ParseInit(pParser); if( yypParser ){
return pParser; ParseCTX_STORE
ParseInit(yypParser ParseCTX_PARAM);
}
return (void*)yypParser;
} }
#endif /* Parse_ENGINEALWAYSONSTACK */ #endif /* Parse_ENGINEALWAYSONSTACK */
...@@ -1465,7 +1482,8 @@ static void yy_destructor( ...@@ -1465,7 +1482,8 @@ static void yy_destructor(
YYCODETYPE yymajor, /* Type code for object to destroy */ YYCODETYPE yymajor, /* Type code for object to destroy */
YYMINORTYPE *yypminor /* The object to be destroyed */ YYMINORTYPE *yypminor /* The object to be destroyed */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
switch( yymajor ){ switch( yymajor ){
/* Here is inserted the actions which take place when a /* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen ** terminal or non-terminal is destroyed. This can happen
...@@ -1478,60 +1496,76 @@ static void yy_destructor( ...@@ -1478,60 +1496,76 @@ static void yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 205: /* exprlist */ case 204: /* exprlist */
case 249: /* selcollist */ case 248: /* selcollist */
case 263: /* sclp */ case 262: /* sclp */
{ {
tSqlExprListDestroy((yypminor->yy525)); #line 750 "sql.y"
tSqlExprListDestroy((yypminor->yy131));
#line 1506 "sql.c"
} }
break; break;
case 220: /* intitemlist */ case 219: /* intitemlist */
case 222: /* keep */ case 221: /* keep */
case 243: /* columnlist */ case 242: /* columnlist */
case 244: /* tagitemlist */ case 243: /* tagitemlist */
case 245: /* tagNamelist */ case 244: /* tagNamelist */
case 256: /* fill_opt */ case 255: /* fill_opt */
case 257: /* groupby_opt */ case 256: /* groupby_opt */
case 259: /* orderby_opt */ case 258: /* orderby_opt */
case 270: /* sortlist */ case 269: /* sortlist */
case 274: /* grouplist */ case 273: /* grouplist */
{ {
taosArrayDestroy((yypminor->yy525)); #line 253 "sql.y"
taosArrayDestroy((yypminor->yy131));
#line 1522 "sql.c"
} }
break; break;
case 241: /* create_table_list */ case 240: /* create_table_list */
{ {
destroyCreateTableSql((yypminor->yy158)); #line 361 "sql.y"
destroyCreateTableSql((yypminor->yy272));
#line 1529 "sql.c"
} }
break; break;
case 246: /* select */ case 245: /* select */
{ {
destroySqlNode((yypminor->yy464)); #line 481 "sql.y"
destroySqlNode((yypminor->yy256));
#line 1536 "sql.c"
} }
break; break;
case 250: /* from */ case 249: /* from */
case 267: /* tablelist */ case 266: /* tablelist */
case 268: /* sub */ case 267: /* sub */
{ {
destroyRelationInfo((yypminor->yy412)); #line 536 "sql.y"
destroyRelationInfo((yypminor->yy544));
#line 1545 "sql.c"
} }
break; break;
case 251: /* where_opt */ case 250: /* where_opt */
case 258: /* having_opt */ case 257: /* having_opt */
case 265: /* expr */ case 264: /* expr */
case 275: /* expritem */ case 274: /* expritem */
{ {
tSqlExprDestroy((yypminor->yy370)); #line 683 "sql.y"
tSqlExprDestroy((yypminor->yy46));
#line 1555 "sql.c"
} }
break; break;
case 262: /* union */ case 261: /* union */
{ {
destroyAllSqlNode((yypminor->yy525)); #line 489 "sql.y"
destroyAllSqlNode((yypminor->yy131));
#line 1562 "sql.c"
} }
break; break;
case 271: /* sortitem */ case 270: /* sortitem */
{ {
tVariantDestroy(&(yypminor->yy506)); #line 616 "sql.y"
tVariantDestroy(&(yypminor->yy516));
#line 1569 "sql.c"
} }
break; break;
/********* End destructor definitions *****************************************/ /********* End destructor definitions *****************************************/
...@@ -1643,13 +1677,12 @@ int ParseCoverage(FILE *out){ ...@@ -1643,13 +1677,12 @@ int ParseCoverage(FILE *out){
** Find the appropriate action for a parser given the terminal ** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static unsigned int yy_find_shift_action( static YYACTIONTYPE yy_find_shift_action(
yyParser *pParser, /* The parser */ YYCODETYPE iLookAhead, /* The look-ahead token */
YYCODETYPE iLookAhead /* The look-ahead token */ YYACTIONTYPE stateno /* Current state number */
){ ){
int i; int i;
int stateno = pParser->yytos->stateno;
if( stateno>YY_MAX_SHIFT ) return stateno; if( stateno>YY_MAX_SHIFT ) return stateno;
assert( stateno <= YY_SHIFT_COUNT ); assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE) #if defined(YYCOVERAGE)
...@@ -1657,15 +1690,19 @@ static unsigned int yy_find_shift_action( ...@@ -1657,15 +1690,19 @@ static unsigned int yy_find_shift_action(
#endif #endif
do{ do{
i = yy_shift_ofst[stateno]; i = yy_shift_ofst[stateno];
assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) ); assert( i>=0 );
assert( i<=YY_ACTTAB_COUNT );
assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN ); assert( iLookAhead < YYNTOKEN );
i += iLookAhead; i += iLookAhead;
assert( i<(int)YY_NLOOKAHEAD );
if( yy_lookahead[i]!=iLookAhead ){ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK #ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */ YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
&& (iFallback = yyFallback[iLookAhead])!=0 ){ iFallback = yyFallback[iLookAhead];
if( iFallback!=0 ){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
...@@ -1680,15 +1717,8 @@ static unsigned int yy_find_shift_action( ...@@ -1680,15 +1717,8 @@ static unsigned int yy_find_shift_action(
#ifdef YYWILDCARD #ifdef YYWILDCARD
{ {
int j = i - iLookAhead + YYWILDCARD; int j = i - iLookAhead + YYWILDCARD;
if( assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
#if YY_SHIFT_MIN+YYWILDCARD<0 if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
...@@ -1702,6 +1732,7 @@ static unsigned int yy_find_shift_action( ...@@ -1702,6 +1732,7 @@ static unsigned int yy_find_shift_action(
#endif /* YYWILDCARD */ #endif /* YYWILDCARD */
return yy_default[stateno]; return yy_default[stateno];
}else{ }else{
assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
return yy_action[i]; return yy_action[i];
} }
}while(1); }while(1);
...@@ -1711,8 +1742,8 @@ static unsigned int yy_find_shift_action( ...@@ -1711,8 +1742,8 @@ static unsigned int yy_find_shift_action(
** Find the appropriate action for a parser given the non-terminal ** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static int yy_find_reduce_action( static YYACTIONTYPE yy_find_reduce_action(
int stateno, /* Current state number */ YYACTIONTYPE stateno, /* Current state number */
YYCODETYPE iLookAhead /* The look-ahead token */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
...@@ -1741,7 +1772,8 @@ static int yy_find_reduce_action( ...@@ -1741,7 +1772,8 @@ static int yy_find_reduce_action(
** The following routine is called if the stack overflows. ** The following routine is called if the stack overflows.
*/ */
static void yyStackOverflow(yyParser *yypParser){ static void yyStackOverflow(yyParser *yypParser){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
...@@ -1752,7 +1784,8 @@ static void yyStackOverflow(yyParser *yypParser){ ...@@ -1752,7 +1784,8 @@ static void yyStackOverflow(yyParser *yypParser){
** stack every overflows */ ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/ /******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/ /******** End %stack_overflow code ********************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ ParseARG_STORE /* Suppress warning about unused %extra_argument var */
ParseCTX_STORE
} }
/* /*
...@@ -1781,8 +1814,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ ...@@ -1781,8 +1814,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
*/ */
static void yy_shift( static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */ yyParser *yypParser, /* The parser to be shifted */
int yyNewState, /* The new state to shift in */ YYACTIONTYPE yyNewState, /* The new state to shift in */
int yyMajor, /* The major token to shift in */ YYCODETYPE yyMajor, /* The major token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */ ParseTOKENTYPE yyMinor /* The minor token to shift in */
){ ){
yyStackEntry *yytos; yyStackEntry *yytos;
...@@ -1812,308 +1845,598 @@ static void yy_shift( ...@@ -1812,308 +1845,598 @@ static void yy_shift(
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
} }
yytos = yypParser->yytos; yytos = yypParser->yytos;
yytos->stateno = (YYACTIONTYPE)yyNewState; yytos->stateno = yyNewState;
yytos->major = (YYCODETYPE)yyMajor; yytos->major = yyMajor;
yytos->minor.yy0 = yyMinor; yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift"); yyTraceShift(yypParser, yyNewState, "Shift");
} }
/* The following table contains information about every rule that /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** is used during the reduce. ** of that rule */
*/ static const YYCODETYPE yyRuleInfoLhs[] = {
static const struct { 195, /* (0) program ::= cmd */
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ 196, /* (1) cmd ::= SHOW DATABASES */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */ 196, /* (2) cmd ::= SHOW TOPICS */
} yyRuleInfo[] = { 196, /* (3) cmd ::= SHOW FUNCTIONS */
{ 196, -1 }, /* (0) program ::= cmd */ 196, /* (4) cmd ::= SHOW MNODES */
{ 197, -2 }, /* (1) cmd ::= SHOW DATABASES */ 196, /* (5) cmd ::= SHOW DNODES */
{ 197, -2 }, /* (2) cmd ::= SHOW TOPICS */ 196, /* (6) cmd ::= SHOW ACCOUNTS */
{ 197, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ 196, /* (7) cmd ::= SHOW USERS */
{ 197, -2 }, /* (4) cmd ::= SHOW MNODES */ 196, /* (8) cmd ::= SHOW MODULES */
{ 197, -2 }, /* (5) cmd ::= SHOW DNODES */ 196, /* (9) cmd ::= SHOW QUERIES */
{ 197, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ 196, /* (10) cmd ::= SHOW CONNECTIONS */
{ 197, -2 }, /* (7) cmd ::= SHOW USERS */ 196, /* (11) cmd ::= SHOW STREAMS */
{ 197, -2 }, /* (8) cmd ::= SHOW MODULES */ 196, /* (12) cmd ::= SHOW VARIABLES */
{ 197, -2 }, /* (9) cmd ::= SHOW QUERIES */ 196, /* (13) cmd ::= SHOW SCORES */
{ 197, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ 196, /* (14) cmd ::= SHOW GRANTS */
{ 197, -2 }, /* (11) cmd ::= SHOW STREAMS */ 196, /* (15) cmd ::= SHOW VNODES */
{ 197, -2 }, /* (12) cmd ::= SHOW VARIABLES */ 196, /* (16) cmd ::= SHOW VNODES ids */
{ 197, -2 }, /* (13) cmd ::= SHOW SCORES */ 198, /* (17) dbPrefix ::= */
{ 197, -2 }, /* (14) cmd ::= SHOW GRANTS */ 198, /* (18) dbPrefix ::= ids DOT */
{ 197, -2 }, /* (15) cmd ::= SHOW VNODES */ 199, /* (19) cpxName ::= */
{ 197, -3 }, /* (16) cmd ::= SHOW VNODES IPTOKEN */ 199, /* (20) cpxName ::= DOT ids */
{ 198, 0 }, /* (17) dbPrefix ::= */ 196, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
{ 198, -2 }, /* (18) dbPrefix ::= ids DOT */ 196, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
{ 200, 0 }, /* (19) cpxName ::= */ 196, /* (23) cmd ::= SHOW CREATE DATABASE ids */
{ 200, -2 }, /* (20) cpxName ::= DOT ids */ 196, /* (24) cmd ::= SHOW dbPrefix TABLES */
{ 197, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ 196, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 197, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ 196, /* (26) cmd ::= SHOW dbPrefix STABLES */
{ 197, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ 196, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 197, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ 196, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
{ 197, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ 196, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
{ 197, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ 196, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
{ 197, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ 196, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
{ 197, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ 196, /* (32) cmd ::= DROP DATABASE ifexists ids */
{ 197, -4 }, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ 196, /* (33) cmd ::= DROP TOPIC ifexists ids */
{ 197, -5 }, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ 196, /* (34) cmd ::= DROP FUNCTION ids */
{ 197, -5 }, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ 196, /* (35) cmd ::= DROP DNODE ids */
{ 197, -4 }, /* (32) cmd ::= DROP DATABASE ifexists ids */ 196, /* (36) cmd ::= DROP USER ids */
{ 197, -4 }, /* (33) cmd ::= DROP TOPIC ifexists ids */ 196, /* (37) cmd ::= DROP ACCOUNT ids */
{ 197, -3 }, /* (34) cmd ::= DROP FUNCTION ids */ 196, /* (38) cmd ::= USE ids */
{ 197, -3 }, /* (35) cmd ::= DROP DNODE ids */ 196, /* (39) cmd ::= DESCRIBE ids cpxName */
{ 197, -3 }, /* (36) cmd ::= DROP USER ids */ 196, /* (40) cmd ::= ALTER USER ids PASS ids */
{ 197, -3 }, /* (37) cmd ::= DROP ACCOUNT ids */ 196, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 197, -2 }, /* (38) cmd ::= USE ids */ 196, /* (42) cmd ::= ALTER DNODE ids ids */
{ 197, -3 }, /* (39) cmd ::= DESCRIBE ids cpxName */ 196, /* (43) cmd ::= ALTER DNODE ids ids ids */
{ 197, -5 }, /* (40) cmd ::= ALTER USER ids PASS ids */ 196, /* (44) cmd ::= ALTER LOCAL ids */
{ 197, -5 }, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */ 196, /* (45) cmd ::= ALTER LOCAL ids ids */
{ 197, -4 }, /* (42) cmd ::= ALTER DNODE ids ids */ 196, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 197, -5 }, /* (43) cmd ::= ALTER DNODE ids ids ids */ 196, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
{ 197, -3 }, /* (44) cmd ::= ALTER LOCAL ids */ 196, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 197, -4 }, /* (45) cmd ::= ALTER LOCAL ids ids */ 196, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 197, -4 }, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */ 196, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
{ 197, -4 }, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */ 197, /* (51) ids ::= ID */
{ 197, -4 }, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */ 197, /* (52) ids ::= STRING */
{ 197, -6 }, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ 200, /* (53) ifexists ::= IF EXISTS */
{ 197, -6 }, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */ 200, /* (54) ifexists ::= */
{ 199, -1 }, /* (51) ids ::= ID */ 205, /* (55) ifnotexists ::= IF NOT EXISTS */
{ 199, -1 }, /* (52) ids ::= STRING */ 205, /* (56) ifnotexists ::= */
{ 201, -2 }, /* (53) ifexists ::= IF EXISTS */ 196, /* (57) cmd ::= CREATE DNODE ids */
{ 201, 0 }, /* (54) ifexists ::= */ 196, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 206, -3 }, /* (55) ifnotexists ::= IF NOT EXISTS */ 196, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 206, 0 }, /* (56) ifnotexists ::= */ 196, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{ 197, -3 }, /* (57) cmd ::= CREATE DNODE ids */ 196, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ 197, -6 }, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ 196, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ 197, -5 }, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ 196, /* (63) cmd ::= CREATE USER ids PASS ids */
{ 197, -5 }, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ 209, /* (64) bufsize ::= */
{ 197, -8 }, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ 209, /* (65) bufsize ::= BUFSIZE INTEGER */
{ 197, -9 }, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ 210, /* (66) pps ::= */
{ 197, -5 }, /* (63) cmd ::= CREATE USER ids PASS ids */ 210, /* (67) pps ::= PPS INTEGER */
{ 210, 0 }, /* (64) bufsize ::= */ 211, /* (68) tseries ::= */
{ 210, -2 }, /* (65) bufsize ::= BUFSIZE INTEGER */ 211, /* (69) tseries ::= TSERIES INTEGER */
{ 211, 0 }, /* (66) pps ::= */ 212, /* (70) dbs ::= */
{ 211, -2 }, /* (67) pps ::= PPS INTEGER */ 212, /* (71) dbs ::= DBS INTEGER */
{ 212, 0 }, /* (68) tseries ::= */ 213, /* (72) streams ::= */
{ 212, -2 }, /* (69) tseries ::= TSERIES INTEGER */ 213, /* (73) streams ::= STREAMS INTEGER */
{ 213, 0 }, /* (70) dbs ::= */ 214, /* (74) storage ::= */
{ 213, -2 }, /* (71) dbs ::= DBS INTEGER */ 214, /* (75) storage ::= STORAGE INTEGER */
{ 214, 0 }, /* (72) streams ::= */ 215, /* (76) qtime ::= */
{ 214, -2 }, /* (73) streams ::= STREAMS INTEGER */ 215, /* (77) qtime ::= QTIME INTEGER */
{ 215, 0 }, /* (74) storage ::= */ 216, /* (78) users ::= */
{ 215, -2 }, /* (75) storage ::= STORAGE INTEGER */ 216, /* (79) users ::= USERS INTEGER */
{ 216, 0 }, /* (76) qtime ::= */ 217, /* (80) conns ::= */
{ 216, -2 }, /* (77) qtime ::= QTIME INTEGER */ 217, /* (81) conns ::= CONNS INTEGER */
{ 217, 0 }, /* (78) users ::= */ 218, /* (82) state ::= */
{ 217, -2 }, /* (79) users ::= USERS INTEGER */ 218, /* (83) state ::= STATE ids */
{ 218, 0 }, /* (80) conns ::= */ 203, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 218, -2 }, /* (81) conns ::= CONNS INTEGER */ 219, /* (85) intitemlist ::= intitemlist COMMA intitem */
{ 219, 0 }, /* (82) state ::= */ 219, /* (86) intitemlist ::= intitem */
{ 219, -2 }, /* (83) state ::= STATE ids */ 220, /* (87) intitem ::= INTEGER */
{ 204, -9 }, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ 221, /* (88) keep ::= KEEP intitemlist */
{ 220, -3 }, /* (85) intitemlist ::= intitemlist COMMA intitem */ 222, /* (89) cache ::= CACHE INTEGER */
{ 220, -1 }, /* (86) intitemlist ::= intitem */ 223, /* (90) replica ::= REPLICA INTEGER */
{ 221, -1 }, /* (87) intitem ::= INTEGER */ 224, /* (91) quorum ::= QUORUM INTEGER */
{ 222, -2 }, /* (88) keep ::= KEEP intitemlist */ 225, /* (92) days ::= DAYS INTEGER */
{ 223, -2 }, /* (89) cache ::= CACHE INTEGER */ 226, /* (93) minrows ::= MINROWS INTEGER */
{ 224, -2 }, /* (90) replica ::= REPLICA INTEGER */ 227, /* (94) maxrows ::= MAXROWS INTEGER */
{ 225, -2 }, /* (91) quorum ::= QUORUM INTEGER */ 228, /* (95) blocks ::= BLOCKS INTEGER */
{ 226, -2 }, /* (92) days ::= DAYS INTEGER */ 229, /* (96) ctime ::= CTIME INTEGER */
{ 227, -2 }, /* (93) minrows ::= MINROWS INTEGER */ 230, /* (97) wal ::= WAL INTEGER */
{ 228, -2 }, /* (94) maxrows ::= MAXROWS INTEGER */ 231, /* (98) fsync ::= FSYNC INTEGER */
{ 229, -2 }, /* (95) blocks ::= BLOCKS INTEGER */ 232, /* (99) comp ::= COMP INTEGER */
{ 230, -2 }, /* (96) ctime ::= CTIME INTEGER */ 233, /* (100) prec ::= PRECISION STRING */
{ 231, -2 }, /* (97) wal ::= WAL INTEGER */ 234, /* (101) update ::= UPDATE INTEGER */
{ 232, -2 }, /* (98) fsync ::= FSYNC INTEGER */ 235, /* (102) cachelast ::= CACHELAST INTEGER */
{ 233, -2 }, /* (99) comp ::= COMP INTEGER */ 236, /* (103) partitions ::= PARTITIONS INTEGER */
{ 234, -2 }, /* (100) prec ::= PRECISION STRING */ 206, /* (104) db_optr ::= */
{ 235, -2 }, /* (101) update ::= UPDATE INTEGER */ 206, /* (105) db_optr ::= db_optr cache */
{ 236, -2 }, /* (102) cachelast ::= CACHELAST INTEGER */ 206, /* (106) db_optr ::= db_optr replica */
{ 237, -2 }, /* (103) partitions ::= PARTITIONS INTEGER */ 206, /* (107) db_optr ::= db_optr quorum */
{ 207, 0 }, /* (104) db_optr ::= */ 206, /* (108) db_optr ::= db_optr days */
{ 207, -2 }, /* (105) db_optr ::= db_optr cache */ 206, /* (109) db_optr ::= db_optr minrows */
{ 207, -2 }, /* (106) db_optr ::= db_optr replica */ 206, /* (110) db_optr ::= db_optr maxrows */
{ 207, -2 }, /* (107) db_optr ::= db_optr quorum */ 206, /* (111) db_optr ::= db_optr blocks */
{ 207, -2 }, /* (108) db_optr ::= db_optr days */ 206, /* (112) db_optr ::= db_optr ctime */
{ 207, -2 }, /* (109) db_optr ::= db_optr minrows */ 206, /* (113) db_optr ::= db_optr wal */
{ 207, -2 }, /* (110) db_optr ::= db_optr maxrows */ 206, /* (114) db_optr ::= db_optr fsync */
{ 207, -2 }, /* (111) db_optr ::= db_optr blocks */ 206, /* (115) db_optr ::= db_optr comp */
{ 207, -2 }, /* (112) db_optr ::= db_optr ctime */ 206, /* (116) db_optr ::= db_optr prec */
{ 207, -2 }, /* (113) db_optr ::= db_optr wal */ 206, /* (117) db_optr ::= db_optr keep */
{ 207, -2 }, /* (114) db_optr ::= db_optr fsync */ 206, /* (118) db_optr ::= db_optr update */
{ 207, -2 }, /* (115) db_optr ::= db_optr comp */ 206, /* (119) db_optr ::= db_optr cachelast */
{ 207, -2 }, /* (116) db_optr ::= db_optr prec */ 207, /* (120) topic_optr ::= db_optr */
{ 207, -2 }, /* (117) db_optr ::= db_optr keep */ 207, /* (121) topic_optr ::= topic_optr partitions */
{ 207, -2 }, /* (118) db_optr ::= db_optr update */ 201, /* (122) alter_db_optr ::= */
{ 207, -2 }, /* (119) db_optr ::= db_optr cachelast */ 201, /* (123) alter_db_optr ::= alter_db_optr replica */
{ 208, -1 }, /* (120) topic_optr ::= db_optr */ 201, /* (124) alter_db_optr ::= alter_db_optr quorum */
{ 208, -2 }, /* (121) topic_optr ::= topic_optr partitions */ 201, /* (125) alter_db_optr ::= alter_db_optr keep */
{ 202, 0 }, /* (122) alter_db_optr ::= */ 201, /* (126) alter_db_optr ::= alter_db_optr blocks */
{ 202, -2 }, /* (123) alter_db_optr ::= alter_db_optr replica */ 201, /* (127) alter_db_optr ::= alter_db_optr comp */
{ 202, -2 }, /* (124) alter_db_optr ::= alter_db_optr quorum */ 201, /* (128) alter_db_optr ::= alter_db_optr update */
{ 202, -2 }, /* (125) alter_db_optr ::= alter_db_optr keep */ 201, /* (129) alter_db_optr ::= alter_db_optr cachelast */
{ 202, -2 }, /* (126) alter_db_optr ::= alter_db_optr blocks */ 202, /* (130) alter_topic_optr ::= alter_db_optr */
{ 202, -2 }, /* (127) alter_db_optr ::= alter_db_optr comp */ 202, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
{ 202, -2 }, /* (128) alter_db_optr ::= alter_db_optr update */ 208, /* (132) typename ::= ids */
{ 202, -2 }, /* (129) alter_db_optr ::= alter_db_optr cachelast */ 208, /* (133) typename ::= ids LP signed RP */
{ 203, -1 }, /* (130) alter_topic_optr ::= alter_db_optr */ 208, /* (134) typename ::= ids UNSIGNED */
{ 203, -2 }, /* (131) alter_topic_optr ::= alter_topic_optr partitions */ 237, /* (135) signed ::= INTEGER */
{ 209, -1 }, /* (132) typename ::= ids */ 237, /* (136) signed ::= PLUS INTEGER */
{ 209, -4 }, /* (133) typename ::= ids LP signed RP */ 237, /* (137) signed ::= MINUS INTEGER */
{ 209, -2 }, /* (134) typename ::= ids UNSIGNED */ 196, /* (138) cmd ::= CREATE TABLE create_table_args */
{ 238, -1 }, /* (135) signed ::= INTEGER */ 196, /* (139) cmd ::= CREATE TABLE create_stable_args */
{ 238, -2 }, /* (136) signed ::= PLUS INTEGER */ 196, /* (140) cmd ::= CREATE STABLE create_stable_args */
{ 238, -2 }, /* (137) signed ::= MINUS INTEGER */ 196, /* (141) cmd ::= CREATE TABLE create_table_list */
{ 197, -3 }, /* (138) cmd ::= CREATE TABLE create_table_args */ 240, /* (142) create_table_list ::= create_from_stable */
{ 197, -3 }, /* (139) cmd ::= CREATE TABLE create_stable_args */ 240, /* (143) create_table_list ::= create_table_list create_from_stable */
{ 197, -3 }, /* (140) cmd ::= CREATE STABLE create_stable_args */ 238, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ 197, -3 }, /* (141) cmd ::= CREATE TABLE create_table_list */ 239, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ 241, -1 }, /* (142) create_table_list ::= create_from_stable */ 241, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ 241, -2 }, /* (143) create_table_list ::= create_table_list create_from_stable */ 241, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ 239, -6 }, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ 244, /* (148) tagNamelist ::= tagNamelist COMMA ids */
{ 240, -10 }, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ 244, /* (149) tagNamelist ::= ids */
{ 242, -10 }, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ 238, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
{ 242, -13 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ 242, /* (151) columnlist ::= columnlist COMMA column */
{ 245, -3 }, /* (148) tagNamelist ::= tagNamelist COMMA ids */ 242, /* (152) columnlist ::= column */
{ 245, -1 }, /* (149) tagNamelist ::= ids */ 246, /* (153) column ::= ids typename */
{ 239, -5 }, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */ 243, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
{ 243, -3 }, /* (151) columnlist ::= columnlist COMMA column */ 243, /* (155) tagitemlist ::= tagitem */
{ 243, -1 }, /* (152) columnlist ::= column */ 247, /* (156) tagitem ::= INTEGER */
{ 247, -2 }, /* (153) column ::= ids typename */ 247, /* (157) tagitem ::= FLOAT */
{ 244, -3 }, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */ 247, /* (158) tagitem ::= STRING */
{ 244, -1 }, /* (155) tagitemlist ::= tagitem */ 247, /* (159) tagitem ::= BOOL */
{ 248, -1 }, /* (156) tagitem ::= INTEGER */ 247, /* (160) tagitem ::= NULL */
{ 248, -1 }, /* (157) tagitem ::= FLOAT */ 247, /* (161) tagitem ::= NOW */
{ 248, -1 }, /* (158) tagitem ::= STRING */ 247, /* (162) tagitem ::= MINUS INTEGER */
{ 248, -1 }, /* (159) tagitem ::= BOOL */ 247, /* (163) tagitem ::= MINUS FLOAT */
{ 248, -1 }, /* (160) tagitem ::= NULL */ 247, /* (164) tagitem ::= PLUS INTEGER */
{ 248, -1 }, /* (161) tagitem ::= NOW */ 247, /* (165) tagitem ::= PLUS FLOAT */
{ 248, -2 }, /* (162) tagitem ::= MINUS INTEGER */ 245, /* (166) select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{ 248, -2 }, /* (163) tagitem ::= MINUS FLOAT */ 245, /* (167) select ::= LP select RP */
{ 248, -2 }, /* (164) tagitem ::= PLUS INTEGER */ 261, /* (168) union ::= select */
{ 248, -2 }, /* (165) tagitem ::= PLUS FLOAT */ 261, /* (169) union ::= union UNION ALL select */
{ 246, -14 }, /* (166) select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ 196, /* (170) cmd ::= union */
{ 246, -3 }, /* (167) select ::= LP select RP */ 245, /* (171) select ::= SELECT selcollist */
{ 262, -1 }, /* (168) union ::= select */ 262, /* (172) sclp ::= selcollist COMMA */
{ 262, -4 }, /* (169) union ::= union UNION ALL select */ 262, /* (173) sclp ::= */
{ 197, -1 }, /* (170) cmd ::= union */ 248, /* (174) selcollist ::= sclp distinct expr as */
{ 246, -2 }, /* (171) select ::= SELECT selcollist */ 248, /* (175) selcollist ::= sclp STAR */
{ 263, -2 }, /* (172) sclp ::= selcollist COMMA */ 265, /* (176) as ::= AS ids */
{ 263, 0 }, /* (173) sclp ::= */ 265, /* (177) as ::= ids */
{ 249, -4 }, /* (174) selcollist ::= sclp distinct expr as */ 265, /* (178) as ::= */
{ 249, -2 }, /* (175) selcollist ::= sclp STAR */ 263, /* (179) distinct ::= DISTINCT */
{ 266, -2 }, /* (176) as ::= AS ids */ 263, /* (180) distinct ::= */
{ 266, -1 }, /* (177) as ::= ids */ 249, /* (181) from ::= FROM tablelist */
{ 266, 0 }, /* (178) as ::= */ 249, /* (182) from ::= FROM sub */
{ 264, -1 }, /* (179) distinct ::= DISTINCT */ 267, /* (183) sub ::= LP union RP */
{ 264, 0 }, /* (180) distinct ::= */ 267, /* (184) sub ::= LP union RP ids */
{ 250, -2 }, /* (181) from ::= FROM tablelist */ 267, /* (185) sub ::= sub COMMA LP union RP ids */
{ 250, -2 }, /* (182) from ::= FROM sub */ 266, /* (186) tablelist ::= ids cpxName */
{ 268, -3 }, /* (183) sub ::= LP union RP */ 266, /* (187) tablelist ::= ids cpxName ids */
{ 268, -4 }, /* (184) sub ::= LP union RP ids */ 266, /* (188) tablelist ::= tablelist COMMA ids cpxName */
{ 268, -6 }, /* (185) sub ::= sub COMMA LP union RP ids */ 266, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
{ 267, -2 }, /* (186) tablelist ::= ids cpxName */ 268, /* (190) tmvar ::= VARIABLE */
{ 267, -3 }, /* (187) tablelist ::= ids cpxName ids */ 251, /* (191) interval_opt ::= INTERVAL LP tmvar RP */
{ 267, -4 }, /* (188) tablelist ::= tablelist COMMA ids cpxName */ 251, /* (192) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{ 267, -5 }, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */ 251, /* (193) interval_opt ::= */
{ 269, -1 }, /* (190) tmvar ::= VARIABLE */ 253, /* (194) session_option ::= */
{ 252, -4 }, /* (191) interval_opt ::= INTERVAL LP tmvar RP */ 253, /* (195) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{ 252, -6 }, /* (192) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ 254, /* (196) windowstate_option ::= */
{ 252, 0 }, /* (193) interval_opt ::= */ 254, /* (197) windowstate_option ::= STATE_WINDOW LP ids RP */
{ 254, 0 }, /* (194) session_option ::= */ 255, /* (198) fill_opt ::= */
{ 254, -7 }, /* (195) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ 255, /* (199) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 255, 0 }, /* (196) windowstate_option ::= */ 255, /* (200) fill_opt ::= FILL LP ID RP */
{ 255, -4 }, /* (197) windowstate_option ::= STATE_WINDOW LP ids RP */ 252, /* (201) sliding_opt ::= SLIDING LP tmvar RP */
{ 256, 0 }, /* (198) fill_opt ::= */ 252, /* (202) sliding_opt ::= */
{ 256, -6 }, /* (199) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ 258, /* (203) orderby_opt ::= */
{ 256, -4 }, /* (200) fill_opt ::= FILL LP ID RP */ 258, /* (204) orderby_opt ::= ORDER BY sortlist */
{ 253, -4 }, /* (201) sliding_opt ::= SLIDING LP tmvar RP */ 269, /* (205) sortlist ::= sortlist COMMA item sortorder */
{ 253, 0 }, /* (202) sliding_opt ::= */ 269, /* (206) sortlist ::= item sortorder */
{ 259, 0 }, /* (203) orderby_opt ::= */ 271, /* (207) item ::= ids cpxName */
{ 259, -3 }, /* (204) orderby_opt ::= ORDER BY sortlist */ 272, /* (208) sortorder ::= ASC */
{ 270, -4 }, /* (205) sortlist ::= sortlist COMMA item sortorder */ 272, /* (209) sortorder ::= DESC */
{ 270, -2 }, /* (206) sortlist ::= item sortorder */ 272, /* (210) sortorder ::= */
{ 272, -2 }, /* (207) item ::= ids cpxName */ 256, /* (211) groupby_opt ::= */
{ 273, -1 }, /* (208) sortorder ::= ASC */ 256, /* (212) groupby_opt ::= GROUP BY grouplist */
{ 273, -1 }, /* (209) sortorder ::= DESC */ 273, /* (213) grouplist ::= grouplist COMMA item */
{ 273, 0 }, /* (210) sortorder ::= */ 273, /* (214) grouplist ::= item */
{ 257, 0 }, /* (211) groupby_opt ::= */ 257, /* (215) having_opt ::= */
{ 257, -3 }, /* (212) groupby_opt ::= GROUP BY grouplist */ 257, /* (216) having_opt ::= HAVING expr */
{ 274, -3 }, /* (213) grouplist ::= grouplist COMMA item */ 260, /* (217) limit_opt ::= */
{ 274, -1 }, /* (214) grouplist ::= item */ 260, /* (218) limit_opt ::= LIMIT signed */
{ 258, 0 }, /* (215) having_opt ::= */ 260, /* (219) limit_opt ::= LIMIT signed OFFSET signed */
{ 258, -2 }, /* (216) having_opt ::= HAVING expr */ 260, /* (220) limit_opt ::= LIMIT signed COMMA signed */
{ 261, 0 }, /* (217) limit_opt ::= */ 259, /* (221) slimit_opt ::= */
{ 261, -2 }, /* (218) limit_opt ::= LIMIT signed */ 259, /* (222) slimit_opt ::= SLIMIT signed */
{ 261, -4 }, /* (219) limit_opt ::= LIMIT signed OFFSET signed */ 259, /* (223) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 261, -4 }, /* (220) limit_opt ::= LIMIT signed COMMA signed */ 259, /* (224) slimit_opt ::= SLIMIT signed COMMA signed */
{ 260, 0 }, /* (221) slimit_opt ::= */ 250, /* (225) where_opt ::= */
{ 260, -2 }, /* (222) slimit_opt ::= SLIMIT signed */ 250, /* (226) where_opt ::= WHERE expr */
{ 260, -4 }, /* (223) slimit_opt ::= SLIMIT signed SOFFSET signed */ 264, /* (227) expr ::= LP expr RP */
{ 260, -4 }, /* (224) slimit_opt ::= SLIMIT signed COMMA signed */ 264, /* (228) expr ::= ID */
{ 251, 0 }, /* (225) where_opt ::= */ 264, /* (229) expr ::= ID DOT ID */
{ 251, -2 }, /* (226) where_opt ::= WHERE expr */ 264, /* (230) expr ::= ID DOT STAR */
{ 265, -3 }, /* (227) expr ::= LP expr RP */ 264, /* (231) expr ::= INTEGER */
{ 265, -1 }, /* (228) expr ::= ID */ 264, /* (232) expr ::= MINUS INTEGER */
{ 265, -3 }, /* (229) expr ::= ID DOT ID */ 264, /* (233) expr ::= PLUS INTEGER */
{ 265, -3 }, /* (230) expr ::= ID DOT STAR */ 264, /* (234) expr ::= FLOAT */
{ 265, -1 }, /* (231) expr ::= INTEGER */ 264, /* (235) expr ::= MINUS FLOAT */
{ 265, -2 }, /* (232) expr ::= MINUS INTEGER */ 264, /* (236) expr ::= PLUS FLOAT */
{ 265, -2 }, /* (233) expr ::= PLUS INTEGER */ 264, /* (237) expr ::= STRING */
{ 265, -1 }, /* (234) expr ::= FLOAT */ 264, /* (238) expr ::= NOW */
{ 265, -2 }, /* (235) expr ::= MINUS FLOAT */ 264, /* (239) expr ::= VARIABLE */
{ 265, -2 }, /* (236) expr ::= PLUS FLOAT */ 264, /* (240) expr ::= PLUS VARIABLE */
{ 265, -1 }, /* (237) expr ::= STRING */ 264, /* (241) expr ::= MINUS VARIABLE */
{ 265, -1 }, /* (238) expr ::= NOW */ 264, /* (242) expr ::= BOOL */
{ 265, -1 }, /* (239) expr ::= VARIABLE */ 264, /* (243) expr ::= NULL */
{ 265, -2 }, /* (240) expr ::= PLUS VARIABLE */ 264, /* (244) expr ::= ID LP exprlist RP */
{ 265, -2 }, /* (241) expr ::= MINUS VARIABLE */ 264, /* (245) expr ::= ID LP STAR RP */
{ 265, -1 }, /* (242) expr ::= BOOL */ 264, /* (246) expr ::= expr IS NULL */
{ 265, -1 }, /* (243) expr ::= NULL */ 264, /* (247) expr ::= expr IS NOT NULL */
{ 265, -4 }, /* (244) expr ::= ID LP exprlist RP */ 264, /* (248) expr ::= expr LT expr */
{ 265, -4 }, /* (245) expr ::= ID LP STAR RP */ 264, /* (249) expr ::= expr GT expr */
{ 265, -3 }, /* (246) expr ::= expr IS NULL */ 264, /* (250) expr ::= expr LE expr */
{ 265, -4 }, /* (247) expr ::= expr IS NOT NULL */ 264, /* (251) expr ::= expr GE expr */
{ 265, -3 }, /* (248) expr ::= expr LT expr */ 264, /* (252) expr ::= expr NE expr */
{ 265, -3 }, /* (249) expr ::= expr GT expr */ 264, /* (253) expr ::= expr EQ expr */
{ 265, -3 }, /* (250) expr ::= expr LE expr */ 264, /* (254) expr ::= expr BETWEEN expr AND expr */
{ 265, -3 }, /* (251) expr ::= expr GE expr */ 264, /* (255) expr ::= expr AND expr */
{ 265, -3 }, /* (252) expr ::= expr NE expr */ 264, /* (256) expr ::= expr OR expr */
{ 265, -3 }, /* (253) expr ::= expr EQ expr */ 264, /* (257) expr ::= expr PLUS expr */
{ 265, -5 }, /* (254) expr ::= expr BETWEEN expr AND expr */ 264, /* (258) expr ::= expr MINUS expr */
{ 265, -3 }, /* (255) expr ::= expr AND expr */ 264, /* (259) expr ::= expr STAR expr */
{ 265, -3 }, /* (256) expr ::= expr OR expr */ 264, /* (260) expr ::= expr SLASH expr */
{ 265, -3 }, /* (257) expr ::= expr PLUS expr */ 264, /* (261) expr ::= expr REM expr */
{ 265, -3 }, /* (258) expr ::= expr MINUS expr */ 264, /* (262) expr ::= expr LIKE expr */
{ 265, -3 }, /* (259) expr ::= expr STAR expr */ 264, /* (263) expr ::= expr IN LP exprlist RP */
{ 265, -3 }, /* (260) expr ::= expr SLASH expr */ 204, /* (264) exprlist ::= exprlist COMMA expritem */
{ 265, -3 }, /* (261) expr ::= expr REM expr */ 204, /* (265) exprlist ::= expritem */
{ 265, -3 }, /* (262) expr ::= expr LIKE expr */ 274, /* (266) expritem ::= expr */
{ 265, -5 }, /* (263) expr ::= expr IN LP exprlist RP */ 274, /* (267) expritem ::= */
{ 205, -3 }, /* (264) exprlist ::= exprlist COMMA expritem */ 196, /* (268) cmd ::= RESET QUERY CACHE */
{ 205, -1 }, /* (265) exprlist ::= expritem */ 196, /* (269) cmd ::= SYNCDB ids REPLICA */
{ 275, -1 }, /* (266) expritem ::= expr */ 196, /* (270) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 275, 0 }, /* (267) expritem ::= */ 196, /* (271) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 197, -3 }, /* (268) cmd ::= RESET QUERY CACHE */ 196, /* (272) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{ 197, -3 }, /* (269) cmd ::= SYNCDB ids REPLICA */ 196, /* (273) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 197, -7 }, /* (270) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ 196, /* (274) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 197, -7 }, /* (271) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ 196, /* (275) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 197, -7 }, /* (272) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ 196, /* (276) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 197, -7 }, /* (273) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ 196, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{ 197, -7 }, /* (274) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ 196, /* (278) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ 197, -8 }, /* (275) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ 196, /* (279) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ 197, -9 }, /* (276) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ 196, /* (280) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{ 197, -7 }, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ 196, /* (281) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ 197, -7 }, /* (278) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ 196, /* (282) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{ 197, -7 }, /* (279) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ 196, /* (283) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{ 197, -7 }, /* (280) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ 196, /* (284) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{ 197, -7 }, /* (281) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ 196, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{ 197, -7 }, /* (282) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ 196, /* (286) cmd ::= KILL CONNECTION INTEGER */
{ 197, -8 }, /* (283) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ 196, /* (287) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{ 197, -9 }, /* (284) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ 196, /* (288) cmd ::= KILL QUERY INTEGER COLON INTEGER */
{ 197, -7 }, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ };
{ 197, -3 }, /* (286) cmd ::= KILL CONNECTION INTEGER */
{ 197, -5 }, /* (287) cmd ::= KILL STREAM INTEGER COLON INTEGER */ /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
{ 197, -5 }, /* (288) cmd ::= KILL QUERY INTEGER COLON INTEGER */ ** of symbols on the right-hand side of that rule. */
static const signed char yyRuleInfoNRhs[] = {
-1, /* (0) program ::= cmd */
-2, /* (1) cmd ::= SHOW DATABASES */
-2, /* (2) cmd ::= SHOW TOPICS */
-2, /* (3) cmd ::= SHOW FUNCTIONS */
-2, /* (4) cmd ::= SHOW MNODES */
-2, /* (5) cmd ::= SHOW DNODES */
-2, /* (6) cmd ::= SHOW ACCOUNTS */
-2, /* (7) cmd ::= SHOW USERS */
-2, /* (8) cmd ::= SHOW MODULES */
-2, /* (9) cmd ::= SHOW QUERIES */
-2, /* (10) cmd ::= SHOW CONNECTIONS */
-2, /* (11) cmd ::= SHOW STREAMS */
-2, /* (12) cmd ::= SHOW VARIABLES */
-2, /* (13) cmd ::= SHOW SCORES */
-2, /* (14) cmd ::= SHOW GRANTS */
-2, /* (15) cmd ::= SHOW VNODES */
-3, /* (16) cmd ::= SHOW VNODES ids */
0, /* (17) dbPrefix ::= */
-2, /* (18) dbPrefix ::= ids DOT */
0, /* (19) cpxName ::= */
-2, /* (20) cpxName ::= DOT ids */
-5, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
-5, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
-4, /* (23) cmd ::= SHOW CREATE DATABASE ids */
-3, /* (24) cmd ::= SHOW dbPrefix TABLES */
-5, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
-3, /* (26) cmd ::= SHOW dbPrefix STABLES */
-5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
-3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
-4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
-5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (32) cmd ::= DROP DATABASE ifexists ids */
-4, /* (33) cmd ::= DROP TOPIC ifexists ids */
-3, /* (34) cmd ::= DROP FUNCTION ids */
-3, /* (35) cmd ::= DROP DNODE ids */
-3, /* (36) cmd ::= DROP USER ids */
-3, /* (37) cmd ::= DROP ACCOUNT ids */
-2, /* (38) cmd ::= USE ids */
-3, /* (39) cmd ::= DESCRIBE ids cpxName */
-5, /* (40) cmd ::= ALTER USER ids PASS ids */
-5, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (42) cmd ::= ALTER DNODE ids ids */
-5, /* (43) cmd ::= ALTER DNODE ids ids ids */
-3, /* (44) cmd ::= ALTER LOCAL ids */
-4, /* (45) cmd ::= ALTER LOCAL ids ids */
-4, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
-4, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-6, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
-1, /* (51) ids ::= ID */
-1, /* (52) ids ::= STRING */
-2, /* (53) ifexists ::= IF EXISTS */
0, /* (54) ifexists ::= */
-3, /* (55) ifnotexists ::= IF NOT EXISTS */
0, /* (56) ifnotexists ::= */
-3, /* (57) cmd ::= CREATE DNODE ids */
-6, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
-8, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-9, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-5, /* (63) cmd ::= CREATE USER ids PASS ids */
0, /* (64) bufsize ::= */
-2, /* (65) bufsize ::= BUFSIZE INTEGER */
0, /* (66) pps ::= */
-2, /* (67) pps ::= PPS INTEGER */
0, /* (68) tseries ::= */
-2, /* (69) tseries ::= TSERIES INTEGER */
0, /* (70) dbs ::= */
-2, /* (71) dbs ::= DBS INTEGER */
0, /* (72) streams ::= */
-2, /* (73) streams ::= STREAMS INTEGER */
0, /* (74) storage ::= */
-2, /* (75) storage ::= STORAGE INTEGER */
0, /* (76) qtime ::= */
-2, /* (77) qtime ::= QTIME INTEGER */
0, /* (78) users ::= */
-2, /* (79) users ::= USERS INTEGER */
0, /* (80) conns ::= */
-2, /* (81) conns ::= CONNS INTEGER */
0, /* (82) state ::= */
-2, /* (83) state ::= STATE ids */
-9, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-3, /* (85) intitemlist ::= intitemlist COMMA intitem */
-1, /* (86) intitemlist ::= intitem */
-1, /* (87) intitem ::= INTEGER */
-2, /* (88) keep ::= KEEP intitemlist */
-2, /* (89) cache ::= CACHE INTEGER */
-2, /* (90) replica ::= REPLICA INTEGER */
-2, /* (91) quorum ::= QUORUM INTEGER */
-2, /* (92) days ::= DAYS INTEGER */
-2, /* (93) minrows ::= MINROWS INTEGER */
-2, /* (94) maxrows ::= MAXROWS INTEGER */
-2, /* (95) blocks ::= BLOCKS INTEGER */
-2, /* (96) ctime ::= CTIME INTEGER */
-2, /* (97) wal ::= WAL INTEGER */
-2, /* (98) fsync ::= FSYNC INTEGER */
-2, /* (99) comp ::= COMP INTEGER */
-2, /* (100) prec ::= PRECISION STRING */
-2, /* (101) update ::= UPDATE INTEGER */
-2, /* (102) cachelast ::= CACHELAST INTEGER */
-2, /* (103) partitions ::= PARTITIONS INTEGER */
0, /* (104) db_optr ::= */
-2, /* (105) db_optr ::= db_optr cache */
-2, /* (106) db_optr ::= db_optr replica */
-2, /* (107) db_optr ::= db_optr quorum */
-2, /* (108) db_optr ::= db_optr days */
-2, /* (109) db_optr ::= db_optr minrows */
-2, /* (110) db_optr ::= db_optr maxrows */
-2, /* (111) db_optr ::= db_optr blocks */
-2, /* (112) db_optr ::= db_optr ctime */
-2, /* (113) db_optr ::= db_optr wal */
-2, /* (114) db_optr ::= db_optr fsync */
-2, /* (115) db_optr ::= db_optr comp */
-2, /* (116) db_optr ::= db_optr prec */
-2, /* (117) db_optr ::= db_optr keep */
-2, /* (118) db_optr ::= db_optr update */
-2, /* (119) db_optr ::= db_optr cachelast */
-1, /* (120) topic_optr ::= db_optr */
-2, /* (121) topic_optr ::= topic_optr partitions */
0, /* (122) alter_db_optr ::= */
-2, /* (123) alter_db_optr ::= alter_db_optr replica */
-2, /* (124) alter_db_optr ::= alter_db_optr quorum */
-2, /* (125) alter_db_optr ::= alter_db_optr keep */
-2, /* (126) alter_db_optr ::= alter_db_optr blocks */
-2, /* (127) alter_db_optr ::= alter_db_optr comp */
-2, /* (128) alter_db_optr ::= alter_db_optr update */
-2, /* (129) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (130) alter_topic_optr ::= alter_db_optr */
-2, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
-1, /* (132) typename ::= ids */
-4, /* (133) typename ::= ids LP signed RP */
-2, /* (134) typename ::= ids UNSIGNED */
-1, /* (135) signed ::= INTEGER */
-2, /* (136) signed ::= PLUS INTEGER */
-2, /* (137) signed ::= MINUS INTEGER */
-3, /* (138) cmd ::= CREATE TABLE create_table_args */
-3, /* (139) cmd ::= CREATE TABLE create_stable_args */
-3, /* (140) cmd ::= CREATE STABLE create_stable_args */
-3, /* (141) cmd ::= CREATE TABLE create_table_list */
-1, /* (142) create_table_list ::= create_from_stable */
-2, /* (143) create_table_list ::= create_table_list create_from_stable */
-6, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-13, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
-3, /* (148) tagNamelist ::= tagNamelist COMMA ids */
-1, /* (149) tagNamelist ::= ids */
-5, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (151) columnlist ::= columnlist COMMA column */
-1, /* (152) columnlist ::= column */
-2, /* (153) column ::= ids typename */
-3, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (155) tagitemlist ::= tagitem */
-1, /* (156) tagitem ::= INTEGER */
-1, /* (157) tagitem ::= FLOAT */
-1, /* (158) tagitem ::= STRING */
-1, /* (159) tagitem ::= BOOL */
-1, /* (160) tagitem ::= NULL */
-1, /* (161) tagitem ::= NOW */
-2, /* (162) tagitem ::= MINUS INTEGER */
-2, /* (163) tagitem ::= MINUS FLOAT */
-2, /* (164) tagitem ::= PLUS INTEGER */
-2, /* (165) tagitem ::= PLUS FLOAT */
-14, /* (166) select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
-3, /* (167) select ::= LP select RP */
-1, /* (168) union ::= select */
-4, /* (169) union ::= union UNION ALL select */
-1, /* (170) cmd ::= union */
-2, /* (171) select ::= SELECT selcollist */
-2, /* (172) sclp ::= selcollist COMMA */
0, /* (173) sclp ::= */
-4, /* (174) selcollist ::= sclp distinct expr as */
-2, /* (175) selcollist ::= sclp STAR */
-2, /* (176) as ::= AS ids */
-1, /* (177) as ::= ids */
0, /* (178) as ::= */
-1, /* (179) distinct ::= DISTINCT */
0, /* (180) distinct ::= */
-2, /* (181) from ::= FROM tablelist */
-2, /* (182) from ::= FROM sub */
-3, /* (183) sub ::= LP union RP */
-4, /* (184) sub ::= LP union RP ids */
-6, /* (185) sub ::= sub COMMA LP union RP ids */
-2, /* (186) tablelist ::= ids cpxName */
-3, /* (187) tablelist ::= ids cpxName ids */
-4, /* (188) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (190) tmvar ::= VARIABLE */
-4, /* (191) interval_opt ::= INTERVAL LP tmvar RP */
-6, /* (192) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
0, /* (193) interval_opt ::= */
0, /* (194) session_option ::= */
-7, /* (195) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
0, /* (196) windowstate_option ::= */
-4, /* (197) windowstate_option ::= STATE_WINDOW LP ids RP */
0, /* (198) fill_opt ::= */
-6, /* (199) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (200) fill_opt ::= FILL LP ID RP */
-4, /* (201) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (202) sliding_opt ::= */
0, /* (203) orderby_opt ::= */
-3, /* (204) orderby_opt ::= ORDER BY sortlist */
-4, /* (205) sortlist ::= sortlist COMMA item sortorder */
-2, /* (206) sortlist ::= item sortorder */
-2, /* (207) item ::= ids cpxName */
-1, /* (208) sortorder ::= ASC */
-1, /* (209) sortorder ::= DESC */
0, /* (210) sortorder ::= */
0, /* (211) groupby_opt ::= */
-3, /* (212) groupby_opt ::= GROUP BY grouplist */
-3, /* (213) grouplist ::= grouplist COMMA item */
-1, /* (214) grouplist ::= item */
0, /* (215) having_opt ::= */
-2, /* (216) having_opt ::= HAVING expr */
0, /* (217) limit_opt ::= */
-2, /* (218) limit_opt ::= LIMIT signed */
-4, /* (219) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (220) limit_opt ::= LIMIT signed COMMA signed */
0, /* (221) slimit_opt ::= */
-2, /* (222) slimit_opt ::= SLIMIT signed */
-4, /* (223) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (224) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (225) where_opt ::= */
-2, /* (226) where_opt ::= WHERE expr */
-3, /* (227) expr ::= LP expr RP */
-1, /* (228) expr ::= ID */
-3, /* (229) expr ::= ID DOT ID */
-3, /* (230) expr ::= ID DOT STAR */
-1, /* (231) expr ::= INTEGER */
-2, /* (232) expr ::= MINUS INTEGER */
-2, /* (233) expr ::= PLUS INTEGER */
-1, /* (234) expr ::= FLOAT */
-2, /* (235) expr ::= MINUS FLOAT */
-2, /* (236) expr ::= PLUS FLOAT */
-1, /* (237) expr ::= STRING */
-1, /* (238) expr ::= NOW */
-1, /* (239) expr ::= VARIABLE */
-2, /* (240) expr ::= PLUS VARIABLE */
-2, /* (241) expr ::= MINUS VARIABLE */
-1, /* (242) expr ::= BOOL */
-1, /* (243) expr ::= NULL */
-4, /* (244) expr ::= ID LP exprlist RP */
-4, /* (245) expr ::= ID LP STAR RP */
-3, /* (246) expr ::= expr IS NULL */
-4, /* (247) expr ::= expr IS NOT NULL */
-3, /* (248) expr ::= expr LT expr */
-3, /* (249) expr ::= expr GT expr */
-3, /* (250) expr ::= expr LE expr */
-3, /* (251) expr ::= expr GE expr */
-3, /* (252) expr ::= expr NE expr */
-3, /* (253) expr ::= expr EQ expr */
-5, /* (254) expr ::= expr BETWEEN expr AND expr */
-3, /* (255) expr ::= expr AND expr */
-3, /* (256) expr ::= expr OR expr */
-3, /* (257) expr ::= expr PLUS expr */
-3, /* (258) expr ::= expr MINUS expr */
-3, /* (259) expr ::= expr STAR expr */
-3, /* (260) expr ::= expr SLASH expr */
-3, /* (261) expr ::= expr REM expr */
-3, /* (262) expr ::= expr LIKE expr */
-5, /* (263) expr ::= expr IN LP exprlist RP */
-3, /* (264) exprlist ::= exprlist COMMA expritem */
-1, /* (265) exprlist ::= expritem */
-1, /* (266) expritem ::= expr */
0, /* (267) expritem ::= */
-3, /* (268) cmd ::= RESET QUERY CACHE */
-3, /* (269) cmd ::= SYNCDB ids REPLICA */
-7, /* (270) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (271) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (272) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (273) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (274) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (275) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (276) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
-7, /* (278) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (279) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (280) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (281) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (282) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (283) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-9, /* (284) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
-3, /* (286) cmd ::= KILL CONNECTION INTEGER */
-5, /* (287) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (288) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -2128,30 +2451,34 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ...@@ -2128,30 +2451,34 @@ static void yy_accept(yyParser*); /* Forward Declaration */
** only called from one place, optimizing compilers will in-line it, which ** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact. ** means that the extra parameters have no performance impact.
*/ */
static void yy_reduce( static YYACTIONTYPE yy_reduce(
yyParser *yypParser, /* The parser */ yyParser *yypParser, /* The parser */
unsigned int yyruleno, /* Number of the rule by which to reduce */ unsigned int yyruleno, /* Number of the rule by which to reduce */
int yyLookahead, /* Lookahead token, or YYNOCODE if none */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */
ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */
ParseCTX_PDECL /* %extra_context */
){ ){
int yygoto; /* The next state */ int yygoto; /* The next state */
int yyact; /* The next action */ YYACTIONTYPE yyact; /* The next action */
yyStackEntry *yymsp; /* The top of the parser's stack */ yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */ int yysize; /* Amount to pop the stack */
ParseARG_FETCH; ParseARG_FETCH
(void)yyLookahead; (void)yyLookahead;
(void)yyLookaheadToken; (void)yyLookaheadToken;
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfo[yyruleno].nrhs; yysize = yyRuleInfoNRhs[yyruleno];
if( yysize ){ if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
yyTracePrompt, yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
yymsp[yysize].stateno);
}else{ }else{
fprintf(yyTraceFILE, "%sReduce %d [%s].\n", fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno]); yyTracePrompt, yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
} }
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
...@@ -2159,7 +2486,7 @@ static void yy_reduce( ...@@ -2159,7 +2486,7 @@ static void yy_reduce(
/* Check that the stack is large enough to grow by a single entry /* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room ** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */ ** enough on the stack to push the LHS value */
if( yyRuleInfo[yyruleno].nrhs==0 ){ if( yyRuleInfoNRhs[yyruleno]==0 ){
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++; yypParser->yyhwm++;
...@@ -2169,13 +2496,19 @@ static void yy_reduce( ...@@ -2169,13 +2496,19 @@ static void yy_reduce(
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
if( yypParser->yytos>=yypParser->yystackEnd ){ if( yypParser->yytos>=yypParser->yystackEnd ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
return; /* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
#else #else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){ if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
return; /* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
} }
...@@ -2197,226 +2530,346 @@ static void yy_reduce( ...@@ -2197,226 +2530,346 @@ static void yy_reduce(
case 138: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==138); case 138: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==138);
case 139: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==139); case 139: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==139);
case 140: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==140); case 140: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==140);
#line 63 "sql.y"
{} {}
#line 2536 "sql.c"
break; break;
case 1: /* cmd ::= SHOW DATABASES */ case 1: /* cmd ::= SHOW DATABASES */
#line 66 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
#line 2541 "sql.c"
break; break;
case 2: /* cmd ::= SHOW TOPICS */ case 2: /* cmd ::= SHOW TOPICS */
#line 67 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
#line 2546 "sql.c"
break; break;
case 3: /* cmd ::= SHOW FUNCTIONS */ case 3: /* cmd ::= SHOW FUNCTIONS */
#line 68 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);}
#line 2551 "sql.c"
break; break;
case 4: /* cmd ::= SHOW MNODES */ case 4: /* cmd ::= SHOW MNODES */
#line 69 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
#line 2556 "sql.c"
break; break;
case 5: /* cmd ::= SHOW DNODES */ case 5: /* cmd ::= SHOW DNODES */
#line 70 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
#line 2561 "sql.c"
break; break;
case 6: /* cmd ::= SHOW ACCOUNTS */ case 6: /* cmd ::= SHOW ACCOUNTS */
#line 71 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
#line 2566 "sql.c"
break; break;
case 7: /* cmd ::= SHOW USERS */ case 7: /* cmd ::= SHOW USERS */
#line 72 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);}
#line 2571 "sql.c"
break; break;
case 8: /* cmd ::= SHOW MODULES */ case 8: /* cmd ::= SHOW MODULES */
#line 74 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); }
#line 2576 "sql.c"
break; break;
case 9: /* cmd ::= SHOW QUERIES */ case 9: /* cmd ::= SHOW QUERIES */
#line 75 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); }
#line 2581 "sql.c"
break; break;
case 10: /* cmd ::= SHOW CONNECTIONS */ case 10: /* cmd ::= SHOW CONNECTIONS */
#line 76 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
#line 2586 "sql.c"
break; break;
case 11: /* cmd ::= SHOW STREAMS */ case 11: /* cmd ::= SHOW STREAMS */
#line 77 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); }
#line 2591 "sql.c"
break; break;
case 12: /* cmd ::= SHOW VARIABLES */ case 12: /* cmd ::= SHOW VARIABLES */
#line 78 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); }
#line 2596 "sql.c"
break; break;
case 13: /* cmd ::= SHOW SCORES */ case 13: /* cmd ::= SHOW SCORES */
#line 79 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); }
#line 2601 "sql.c"
break; break;
case 14: /* cmd ::= SHOW GRANTS */ case 14: /* cmd ::= SHOW GRANTS */
#line 80 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); }
#line 2606 "sql.c"
break; break;
case 15: /* cmd ::= SHOW VNODES */ case 15: /* cmd ::= SHOW VNODES */
#line 82 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
#line 2611 "sql.c"
break; break;
case 16: /* cmd ::= SHOW VNODES IPTOKEN */ case 16: /* cmd ::= SHOW VNODES ids */
#line 83 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
#line 2616 "sql.c"
break; break;
case 17: /* dbPrefix ::= */ case 17: /* dbPrefix ::= */
#line 87 "sql.y"
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
#line 2621 "sql.c"
break; break;
case 18: /* dbPrefix ::= ids DOT */ case 18: /* dbPrefix ::= ids DOT */
#line 88 "sql.y"
{yylhsminor.yy0 = yymsp[-1].minor.yy0; } {yylhsminor.yy0 = yymsp[-1].minor.yy0; }
#line 2626 "sql.c"
yymsp[-1].minor.yy0 = yylhsminor.yy0; yymsp[-1].minor.yy0 = yylhsminor.yy0;
break; break;
case 19: /* cpxName ::= */ case 19: /* cpxName ::= */
#line 91 "sql.y"
{yymsp[1].minor.yy0.n = 0; } {yymsp[1].minor.yy0.n = 0; }
#line 2632 "sql.c"
break; break;
case 20: /* cpxName ::= DOT ids */ case 20: /* cpxName ::= DOT ids */
#line 92 "sql.y"
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; } {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; }
#line 2637 "sql.c"
break; break;
case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */ case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */
#line 94 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0); setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0);
} }
#line 2645 "sql.c"
break; break;
case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */ case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */
#line 98 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0); setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0);
} }
#line 2653 "sql.c"
break; break;
case 23: /* cmd ::= SHOW CREATE DATABASE ids */ case 23: /* cmd ::= SHOW CREATE DATABASE ids */
#line 103 "sql.y"
{ {
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0); setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0);
} }
#line 2660 "sql.c"
break; break;
case 24: /* cmd ::= SHOW dbPrefix TABLES */ case 24: /* cmd ::= SHOW dbPrefix TABLES */
#line 107 "sql.y"
{ {
setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0);
} }
#line 2667 "sql.c"
break; break;
case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */ case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */
#line 111 "sql.y"
{ {
setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
} }
#line 2674 "sql.c"
break; break;
case 26: /* cmd ::= SHOW dbPrefix STABLES */ case 26: /* cmd ::= SHOW dbPrefix STABLES */
#line 115 "sql.y"
{ {
setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0);
} }
#line 2681 "sql.c"
break; break;
case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */ case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */
#line 119 "sql.y"
{ {
SStrToken token; SStrToken token;
tSetDbName(&token, &yymsp[-3].minor.yy0); tSetDbName(&token, &yymsp[-3].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0);
} }
#line 2690 "sql.c"
break; break;
case 28: /* cmd ::= SHOW dbPrefix VGROUPS */ case 28: /* cmd ::= SHOW dbPrefix VGROUPS */
#line 125 "sql.y"
{ {
SStrToken token; SStrToken token;
tSetDbName(&token, &yymsp[-1].minor.yy0); tSetDbName(&token, &yymsp[-1].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
} }
#line 2699 "sql.c"
break; break;
case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */ case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */
#line 131 "sql.y"
{ {
SStrToken token; SStrToken token;
tSetDbName(&token, &yymsp[-2].minor.yy0); tSetDbName(&token, &yymsp[-2].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0);
} }
#line 2708 "sql.c"
break; break;
case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */ case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */
#line 138 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1);
} }
#line 2716 "sql.c"
break; break;
case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */ case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */
#line 144 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE);
} }
#line 2724 "sql.c"
break; break;
case 32: /* cmd ::= DROP DATABASE ifexists ids */ case 32: /* cmd ::= DROP DATABASE ifexists ids */
#line 149 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); } { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
#line 2729 "sql.c"
break; break;
case 33: /* cmd ::= DROP TOPIC ifexists ids */ case 33: /* cmd ::= DROP TOPIC ifexists ids */
#line 150 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); } { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
#line 2734 "sql.c"
break; break;
case 34: /* cmd ::= DROP FUNCTION ids */ case 34: /* cmd ::= DROP FUNCTION ids */
#line 151 "sql.y"
{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); } { setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); }
#line 2739 "sql.c"
break; break;
case 35: /* cmd ::= DROP DNODE ids */ case 35: /* cmd ::= DROP DNODE ids */
#line 153 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); }
#line 2744 "sql.c"
break; break;
case 36: /* cmd ::= DROP USER ids */ case 36: /* cmd ::= DROP USER ids */
#line 154 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); }
#line 2749 "sql.c"
break; break;
case 37: /* cmd ::= DROP ACCOUNT ids */ case 37: /* cmd ::= DROP ACCOUNT ids */
#line 155 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); }
#line 2754 "sql.c"
break; break;
case 38: /* cmd ::= USE ids */ case 38: /* cmd ::= USE ids */
#line 158 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} { setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
#line 2759 "sql.c"
break; break;
case 39: /* cmd ::= DESCRIBE ids cpxName */ case 39: /* cmd ::= DESCRIBE ids cpxName */
#line 161 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
} }
#line 2767 "sql.c"
break; break;
case 40: /* cmd ::= ALTER USER ids PASS ids */ case 40: /* cmd ::= ALTER USER ids PASS ids */
#line 167 "sql.y"
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); }
#line 2772 "sql.c"
break; break;
case 41: /* cmd ::= ALTER USER ids PRIVILEGE ids */ case 41: /* cmd ::= ALTER USER ids PRIVILEGE ids */
#line 168 "sql.y"
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
#line 2777 "sql.c"
break; break;
case 42: /* cmd ::= ALTER DNODE ids ids */ case 42: /* cmd ::= ALTER DNODE ids ids */
#line 169 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
#line 2782 "sql.c"
break; break;
case 43: /* cmd ::= ALTER DNODE ids ids ids */ case 43: /* cmd ::= ALTER DNODE ids ids ids */
#line 170 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
#line 2787 "sql.c"
break; break;
case 44: /* cmd ::= ALTER LOCAL ids */ case 44: /* cmd ::= ALTER LOCAL ids */
#line 171 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } { setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); }
#line 2792 "sql.c"
break; break;
case 45: /* cmd ::= ALTER LOCAL ids ids */ case 45: /* cmd ::= ALTER LOCAL ids ids */
#line 172 "sql.y"
{ 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); }
#line 2797 "sql.c"
break; break;
case 46: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 46: /* cmd ::= ALTER DATABASE ids alter_db_optr */
case 47: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==47); case 47: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==47);
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy214, &t);} #line 173 "sql.y"
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy42, &t);}
#line 2803 "sql.c"
break; break;
case 48: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 48: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy547);} #line 176 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy341);}
#line 2808 "sql.c"
break; break;
case 49: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 49: /* 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.yy547);} #line 177 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy341);}
#line 2813 "sql.c"
break; break;
case 50: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ case 50: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy525);} #line 181 "sql.y"
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy131);}
#line 2818 "sql.c"
break; break;
case 51: /* ids ::= ID */ case 51: /* ids ::= ID */
case 52: /* ids ::= STRING */ yytestcase(yyruleno==52); case 52: /* ids ::= STRING */ yytestcase(yyruleno==52);
#line 187 "sql.y"
{yylhsminor.yy0 = yymsp[0].minor.yy0; } {yylhsminor.yy0 = yymsp[0].minor.yy0; }
#line 2824 "sql.c"
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 53: /* ifexists ::= IF EXISTS */ case 53: /* ifexists ::= IF EXISTS */
#line 191 "sql.y"
{ yymsp[-1].minor.yy0.n = 1;} { yymsp[-1].minor.yy0.n = 1;}
#line 2830 "sql.c"
break; break;
case 54: /* ifexists ::= */ case 54: /* ifexists ::= */
case 56: /* ifnotexists ::= */ yytestcase(yyruleno==56); case 56: /* ifnotexists ::= */ yytestcase(yyruleno==56);
case 180: /* distinct ::= */ yytestcase(yyruleno==180); case 180: /* distinct ::= */ yytestcase(yyruleno==180);
#line 192 "sql.y"
{ yymsp[1].minor.yy0.n = 0;} { yymsp[1].minor.yy0.n = 0;}
#line 2837 "sql.c"
break; break;
case 55: /* ifnotexists ::= IF NOT EXISTS */ case 55: /* ifnotexists ::= IF NOT EXISTS */
#line 195 "sql.y"
{ yymsp[-2].minor.yy0.n = 1;} { yymsp[-2].minor.yy0.n = 1;}
#line 2842 "sql.c"
break; break;
case 57: /* cmd ::= CREATE DNODE ids */ case 57: /* cmd ::= CREATE DNODE ids */
#line 200 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
#line 2847 "sql.c"
break; break;
case 58: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 58: /* 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.yy547);} #line 202 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy341);}
#line 2852 "sql.c"
break; break;
case 59: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 59: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case 60: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==60); case 60: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==60);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy214, &yymsp[-2].minor.yy0);} #line 203 "sql.y"
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy42, &yymsp[-2].minor.yy0);}
#line 2858 "sql.c"
break; break;
case 61: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ case 61: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy31, &yymsp[0].minor.yy0, 1);} #line 205 "sql.y"
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy163, &yymsp[0].minor.yy0, 1);}
#line 2863 "sql.c"
break; break;
case 62: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ case 62: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy31, &yymsp[0].minor.yy0, 2);} #line 206 "sql.y"
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy163, &yymsp[0].minor.yy0, 2);}
#line 2868 "sql.c"
break; break;
case 63: /* cmd ::= CREATE USER ids PASS ids */ case 63: /* cmd ::= CREATE USER ids PASS ids */
#line 207 "sql.y"
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
#line 2873 "sql.c"
break; break;
case 64: /* bufsize ::= */ case 64: /* bufsize ::= */
case 66: /* pps ::= */ yytestcase(yyruleno==66); case 66: /* pps ::= */ yytestcase(yyruleno==66);
...@@ -2428,7 +2881,9 @@ static void yy_reduce( ...@@ -2428,7 +2881,9 @@ static void yy_reduce(
case 78: /* users ::= */ yytestcase(yyruleno==78); case 78: /* users ::= */ yytestcase(yyruleno==78);
case 80: /* conns ::= */ yytestcase(yyruleno==80); case 80: /* conns ::= */ yytestcase(yyruleno==80);
case 82: /* state ::= */ yytestcase(yyruleno==82); case 82: /* state ::= */ yytestcase(yyruleno==82);
#line 209 "sql.y"
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
#line 2887 "sql.c"
break; break;
case 65: /* bufsize ::= BUFSIZE INTEGER */ case 65: /* bufsize ::= BUFSIZE INTEGER */
case 67: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==67); case 67: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==67);
...@@ -2440,42 +2895,54 @@ static void yy_reduce( ...@@ -2440,42 +2895,54 @@ static void yy_reduce(
case 79: /* users ::= USERS INTEGER */ yytestcase(yyruleno==79); case 79: /* users ::= USERS INTEGER */ yytestcase(yyruleno==79);
case 81: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==81); case 81: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==81);
case 83: /* state ::= STATE ids */ yytestcase(yyruleno==83); case 83: /* state ::= STATE ids */ yytestcase(yyruleno==83);
#line 210 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
#line 2901 "sql.c"
break; break;
case 84: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 84: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
#line 240 "sql.y"
{ {
yylhsminor.yy547.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy341.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy547.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yylhsminor.yy341.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy547.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; yylhsminor.yy341.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy547.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; yylhsminor.yy341.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy547.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; yylhsminor.yy341.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy547.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; yylhsminor.yy341.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy547.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; yylhsminor.yy341.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy547.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; yylhsminor.yy341.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy547.stat = yymsp[0].minor.yy0; yylhsminor.yy341.stat = yymsp[0].minor.yy0;
} }
yymsp[-8].minor.yy547 = yylhsminor.yy547; #line 2916 "sql.c"
yymsp[-8].minor.yy341 = yylhsminor.yy341;
break; break;
case 85: /* intitemlist ::= intitemlist COMMA intitem */ case 85: /* intitemlist ::= intitemlist COMMA intitem */
case 154: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==154); case 154: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==154);
{ yylhsminor.yy525 = tVariantListAppend(yymsp[-2].minor.yy525, &yymsp[0].minor.yy506, -1); } #line 256 "sql.y"
yymsp[-2].minor.yy525 = yylhsminor.yy525; { yylhsminor.yy131 = tVariantListAppend(yymsp[-2].minor.yy131, &yymsp[0].minor.yy516, -1); }
#line 2923 "sql.c"
yymsp[-2].minor.yy131 = yylhsminor.yy131;
break; break;
case 86: /* intitemlist ::= intitem */ case 86: /* intitemlist ::= intitem */
case 155: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==155); case 155: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==155);
{ yylhsminor.yy525 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); } #line 257 "sql.y"
yymsp[0].minor.yy525 = yylhsminor.yy525; { yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[0].minor.yy516, -1); }
#line 2930 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 87: /* intitem ::= INTEGER */ case 87: /* intitem ::= INTEGER */
case 156: /* tagitem ::= INTEGER */ yytestcase(yyruleno==156); case 156: /* tagitem ::= INTEGER */ yytestcase(yyruleno==156);
case 157: /* tagitem ::= FLOAT */ yytestcase(yyruleno==157); case 157: /* tagitem ::= FLOAT */ yytestcase(yyruleno==157);
case 158: /* tagitem ::= STRING */ yytestcase(yyruleno==158); case 158: /* tagitem ::= STRING */ yytestcase(yyruleno==158);
case 159: /* tagitem ::= BOOL */ yytestcase(yyruleno==159); case 159: /* tagitem ::= BOOL */ yytestcase(yyruleno==159);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy506, &yymsp[0].minor.yy0); } #line 259 "sql.y"
yymsp[0].minor.yy506 = yylhsminor.yy506; { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0); }
#line 2940 "sql.c"
yymsp[0].minor.yy516 = yylhsminor.yy516;
break; break;
case 88: /* keep ::= KEEP intitemlist */ case 88: /* keep ::= KEEP intitemlist */
{ yymsp[-1].minor.yy525 = yymsp[0].minor.yy525; } #line 263 "sql.y"
{ yymsp[-1].minor.yy131 = yymsp[0].minor.yy131; }
#line 2946 "sql.c"
break; break;
case 89: /* cache ::= CACHE INTEGER */ case 89: /* cache ::= CACHE INTEGER */
case 90: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==90); case 90: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==90);
...@@ -2492,639 +2959,912 @@ static void yy_reduce( ...@@ -2492,639 +2959,912 @@ static void yy_reduce(
case 101: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==101); case 101: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==101);
case 102: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==102); case 102: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==102);
case 103: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==103); case 103: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==103);
#line 265 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
#line 2965 "sql.c"
break; break;
case 104: /* db_optr ::= */ case 104: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy214); yymsp[1].minor.yy214.dbType = TSDB_DB_TYPE_DEFAULT;} #line 282 "sql.y"
{setDefaultCreateDbOption(&yymsp[1].minor.yy42); yymsp[1].minor.yy42.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 2970 "sql.c"
break; break;
case 105: /* db_optr ::= db_optr cache */ case 105: /* db_optr ::= db_optr cache */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 284 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 2975 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 106: /* db_optr ::= db_optr replica */ case 106: /* db_optr ::= db_optr replica */
case 123: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==123); case 123: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==123);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 285 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 2982 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 107: /* db_optr ::= db_optr quorum */ case 107: /* db_optr ::= db_optr quorum */
case 124: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==124); case 124: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==124);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 286 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 2989 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 108: /* db_optr ::= db_optr days */ case 108: /* db_optr ::= db_optr days */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 287 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 2995 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 109: /* db_optr ::= db_optr minrows */ case 109: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } #line 288 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3001 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 110: /* db_optr ::= db_optr maxrows */ case 110: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } #line 289 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3007 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 111: /* db_optr ::= db_optr blocks */ case 111: /* db_optr ::= db_optr blocks */
case 126: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==126); case 126: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==126);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 290 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3014 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 112: /* db_optr ::= db_optr ctime */ case 112: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 291 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3020 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 113: /* db_optr ::= db_optr wal */ case 113: /* db_optr ::= db_optr wal */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 292 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3026 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 114: /* db_optr ::= db_optr fsync */ case 114: /* db_optr ::= db_optr fsync */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 293 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3032 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 115: /* db_optr ::= db_optr comp */ case 115: /* db_optr ::= db_optr comp */
case 127: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==127); case 127: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==127);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 294 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3039 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 116: /* db_optr ::= db_optr prec */ case 116: /* db_optr ::= db_optr prec */
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.precision = yymsp[0].minor.yy0; } #line 295 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.precision = yymsp[0].minor.yy0; }
#line 3045 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 117: /* db_optr ::= db_optr keep */ case 117: /* db_optr ::= db_optr keep */
case 125: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==125); case 125: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==125);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.keep = yymsp[0].minor.yy525; } #line 296 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.keep = yymsp[0].minor.yy131; }
#line 3052 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 118: /* db_optr ::= db_optr update */ case 118: /* db_optr ::= db_optr update */
case 128: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==128); case 128: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==128);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 297 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3059 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 119: /* db_optr ::= db_optr cachelast */ case 119: /* db_optr ::= db_optr cachelast */
case 129: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==129); case 129: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==129);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 298 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3066 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 120: /* topic_optr ::= db_optr */ case 120: /* topic_optr ::= db_optr */
case 130: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==130); case 130: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==130);
{ yylhsminor.yy214 = yymsp[0].minor.yy214; yylhsminor.yy214.dbType = TSDB_DB_TYPE_TOPIC; } #line 302 "sql.y"
yymsp[0].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[0].minor.yy42; yylhsminor.yy42.dbType = TSDB_DB_TYPE_TOPIC; }
#line 3073 "sql.c"
yymsp[0].minor.yy42 = yylhsminor.yy42;
break; break;
case 121: /* topic_optr ::= topic_optr partitions */ case 121: /* topic_optr ::= topic_optr partitions */
case 131: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==131); case 131: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==131);
{ yylhsminor.yy214 = yymsp[-1].minor.yy214; yylhsminor.yy214.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 303 "sql.y"
yymsp[-1].minor.yy214 = yylhsminor.yy214; { yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3080 "sql.c"
yymsp[-1].minor.yy42 = yylhsminor.yy42;
break; break;
case 122: /* alter_db_optr ::= */ case 122: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy214); yymsp[1].minor.yy214.dbType = TSDB_DB_TYPE_DEFAULT;} #line 306 "sql.y"
{ setDefaultCreateDbOption(&yymsp[1].minor.yy42); yymsp[1].minor.yy42.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 3086 "sql.c"
break; break;
case 132: /* typename ::= ids */ case 132: /* typename ::= ids */
#line 326 "sql.y"
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSetColumnType (&yylhsminor.yy31, &yymsp[0].minor.yy0); tSetColumnType (&yylhsminor.yy163, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy31 = yylhsminor.yy31; #line 3094 "sql.c"
yymsp[0].minor.yy163 = yylhsminor.yy163;
break; break;
case 133: /* typename ::= ids LP signed RP */ case 133: /* typename ::= ids LP signed RP */
#line 332 "sql.y"
{ {
if (yymsp[-1].minor.yy501 <= 0) { if (yymsp[-1].minor.yy459 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
tSetColumnType(&yylhsminor.yy31, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy163, &yymsp[-3].minor.yy0);
} else { } else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy501; // negative value of name length yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy459; // negative value of name length
tSetColumnType(&yylhsminor.yy31, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy163, &yymsp[-3].minor.yy0);
} }
} }
yymsp[-3].minor.yy31 = yylhsminor.yy31; #line 3108 "sql.c"
yymsp[-3].minor.yy163 = yylhsminor.yy163;
break; break;
case 134: /* typename ::= ids UNSIGNED */ case 134: /* typename ::= ids UNSIGNED */
#line 343 "sql.y"
{ {
yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.type = 0;
yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
tSetColumnType (&yylhsminor.yy31, &yymsp[-1].minor.yy0); tSetColumnType (&yylhsminor.yy163, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy31 = yylhsminor.yy31; #line 3118 "sql.c"
yymsp[-1].minor.yy163 = yylhsminor.yy163;
break; break;
case 135: /* signed ::= INTEGER */ case 135: /* signed ::= INTEGER */
{ yylhsminor.yy501 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 350 "sql.y"
yymsp[0].minor.yy501 = yylhsminor.yy501; { yylhsminor.yy459 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3124 "sql.c"
yymsp[0].minor.yy459 = yylhsminor.yy459;
break; break;
case 136: /* signed ::= PLUS INTEGER */ case 136: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy501 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } #line 351 "sql.y"
{ yymsp[-1].minor.yy459 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3130 "sql.c"
break; break;
case 137: /* signed ::= MINUS INTEGER */ case 137: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy501 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} #line 352 "sql.y"
{ yymsp[-1].minor.yy459 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
#line 3135 "sql.c"
break; break;
case 141: /* cmd ::= CREATE TABLE create_table_list */ case 141: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy158;} #line 358 "sql.y"
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy272;}
#line 3140 "sql.c"
break; break;
case 142: /* create_table_list ::= create_from_stable */ case 142: /* create_table_list ::= create_from_stable */
#line 362 "sql.y"
{ {
SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql));
pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));
taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy432); taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy96);
pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
yylhsminor.yy158 = pCreateTable; yylhsminor.yy272 = pCreateTable;
} }
yymsp[0].minor.yy158 = yylhsminor.yy158; #line 3152 "sql.c"
yymsp[0].minor.yy272 = yylhsminor.yy272;
break; break;
case 143: /* create_table_list ::= create_table_list create_from_stable */ case 143: /* create_table_list ::= create_table_list create_from_stable */
#line 371 "sql.y"
{ {
taosArrayPush(yymsp[-1].minor.yy158->childTableInfo, &yymsp[0].minor.yy432); taosArrayPush(yymsp[-1].minor.yy272->childTableInfo, &yymsp[0].minor.yy96);
yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy272 = yymsp[-1].minor.yy272;
} }
yymsp[-1].minor.yy158 = yylhsminor.yy158; #line 3161 "sql.c"
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break; break;
case 144: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ case 144: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
#line 377 "sql.y"
{ {
yylhsminor.yy158 = tSetCreateTableInfo(yymsp[-1].minor.yy525, NULL, NULL, TSQL_CREATE_TABLE); yylhsminor.yy272 = tSetCreateTableInfo(yymsp[-1].minor.yy131, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy158, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0); setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0);
} }
yymsp[-5].minor.yy158 = yylhsminor.yy158; #line 3173 "sql.c"
yymsp[-5].minor.yy272 = yylhsminor.yy272;
break; break;
case 145: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ case 145: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
#line 387 "sql.y"
{ {
yylhsminor.yy158 = tSetCreateTableInfo(yymsp[-5].minor.yy525, yymsp[-1].minor.yy525, NULL, TSQL_CREATE_STABLE); yylhsminor.yy272 = tSetCreateTableInfo(yymsp[-5].minor.yy131, yymsp[-1].minor.yy131, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy158, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy158 = yylhsminor.yy158; #line 3185 "sql.c"
yymsp[-9].minor.yy272 = yylhsminor.yy272;
break; break;
case 146: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ case 146: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
#line 398 "sql.y"
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yylhsminor.yy432 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy525, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy131, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy432 = yylhsminor.yy432; #line 3195 "sql.c"
yymsp[-9].minor.yy96 = yylhsminor.yy96;
break; break;
case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
#line 404 "sql.y"
{ {
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n;
yylhsminor.yy432 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy525, yymsp[-1].minor.yy525, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy131, yymsp[-1].minor.yy131, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
} }
yymsp[-12].minor.yy432 = yylhsminor.yy432; #line 3205 "sql.c"
yymsp[-12].minor.yy96 = yylhsminor.yy96;
break; break;
case 148: /* tagNamelist ::= tagNamelist COMMA ids */ case 148: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy525, &yymsp[0].minor.yy0); yylhsminor.yy525 = yymsp[-2].minor.yy525; } #line 412 "sql.y"
yymsp[-2].minor.yy525 = yylhsminor.yy525; {taosArrayPush(yymsp[-2].minor.yy131, &yymsp[0].minor.yy0); yylhsminor.yy131 = yymsp[-2].minor.yy131; }
#line 3211 "sql.c"
yymsp[-2].minor.yy131 = yylhsminor.yy131;
break; break;
case 149: /* tagNamelist ::= ids */ case 149: /* tagNamelist ::= ids */
{yylhsminor.yy525 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy525, &yymsp[0].minor.yy0);} #line 413 "sql.y"
yymsp[0].minor.yy525 = yylhsminor.yy525; {yylhsminor.yy131 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy131, &yymsp[0].minor.yy0);}
#line 3217 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 150: /* create_table_args ::= ifnotexists ids cpxName AS select */ case 150: /* create_table_args ::= ifnotexists ids cpxName AS select */
#line 417 "sql.y"
{ {
yylhsminor.yy158 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy464, TSQL_CREATE_STREAM); yylhsminor.yy272 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy256, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy158, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0);
} }
yymsp[-4].minor.yy158 = yylhsminor.yy158; #line 3229 "sql.c"
yymsp[-4].minor.yy272 = yylhsminor.yy272;
break; break;
case 151: /* columnlist ::= columnlist COMMA column */ case 151: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy525, &yymsp[0].minor.yy31); yylhsminor.yy525 = yymsp[-2].minor.yy525; } #line 428 "sql.y"
yymsp[-2].minor.yy525 = yylhsminor.yy525; {taosArrayPush(yymsp[-2].minor.yy131, &yymsp[0].minor.yy163); yylhsminor.yy131 = yymsp[-2].minor.yy131; }
#line 3235 "sql.c"
yymsp[-2].minor.yy131 = yylhsminor.yy131;
break; break;
case 152: /* columnlist ::= column */ case 152: /* columnlist ::= column */
{yylhsminor.yy525 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy525, &yymsp[0].minor.yy31);} #line 429 "sql.y"
yymsp[0].minor.yy525 = yylhsminor.yy525; {yylhsminor.yy131 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy131, &yymsp[0].minor.yy163);}
#line 3241 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 153: /* column ::= ids typename */ case 153: /* column ::= ids typename */
#line 433 "sql.y"
{ {
tSetColumnInfo(&yylhsminor.yy31, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy31); tSetColumnInfo(&yylhsminor.yy163, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy163);
} }
yymsp[-1].minor.yy31 = yylhsminor.yy31; #line 3249 "sql.c"
yymsp[-1].minor.yy163 = yylhsminor.yy163;
break; break;
case 160: /* tagitem ::= NULL */ case 160: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy506, &yymsp[0].minor.yy0); } #line 448 "sql.y"
yymsp[0].minor.yy506 = yylhsminor.yy506; { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0); }
#line 3255 "sql.c"
yymsp[0].minor.yy516 = yylhsminor.yy516;
break; break;
case 161: /* tagitem ::= NOW */ case 161: /* tagitem ::= NOW */
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy506, &yymsp[0].minor.yy0);} #line 449 "sql.y"
yymsp[0].minor.yy506 = yylhsminor.yy506; { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0);}
#line 3261 "sql.c"
yymsp[0].minor.yy516 = yylhsminor.yy516;
break; break;
case 162: /* tagitem ::= MINUS INTEGER */ case 162: /* tagitem ::= MINUS INTEGER */
case 163: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==163); case 163: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==163);
case 164: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==164); case 164: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==164);
case 165: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==165); case 165: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==165);
#line 451 "sql.y"
{ {
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.yy506, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy516, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy506 = yylhsminor.yy506; #line 3275 "sql.c"
yymsp[-1].minor.yy516 = yylhsminor.yy516;
break; break;
case 166: /* select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ case 166: /* select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
#line 482 "sql.y"
{ {
yylhsminor.yy464 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy525, yymsp[-11].minor.yy412, yymsp[-10].minor.yy370, yymsp[-4].minor.yy525, yymsp[-2].minor.yy525, &yymsp[-9].minor.yy520, &yymsp[-7].minor.yy259, &yymsp[-6].minor.yy144, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy525, &yymsp[0].minor.yy126, &yymsp[-1].minor.yy126, yymsp[-3].minor.yy370); yylhsminor.yy256 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy131, yymsp[-11].minor.yy544, yymsp[-10].minor.yy46, yymsp[-4].minor.yy131, yymsp[-2].minor.yy131, &yymsp[-9].minor.yy530, &yymsp[-7].minor.yy39, &yymsp[-6].minor.yy538, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy131, &yymsp[0].minor.yy284, &yymsp[-1].minor.yy284, yymsp[-3].minor.yy46);
} }
yymsp[-13].minor.yy464 = yylhsminor.yy464; #line 3283 "sql.c"
yymsp[-13].minor.yy256 = yylhsminor.yy256;
break; break;
case 167: /* select ::= LP select RP */ case 167: /* select ::= LP select RP */
{yymsp[-2].minor.yy464 = yymsp[-1].minor.yy464;} #line 486 "sql.y"
{yymsp[-2].minor.yy256 = yymsp[-1].minor.yy256;}
#line 3289 "sql.c"
break; break;
case 168: /* union ::= select */ case 168: /* union ::= select */
{ yylhsminor.yy525 = setSubclause(NULL, yymsp[0].minor.yy464); } #line 490 "sql.y"
yymsp[0].minor.yy525 = yylhsminor.yy525; { yylhsminor.yy131 = setSubclause(NULL, yymsp[0].minor.yy256); }
#line 3294 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 169: /* union ::= union UNION ALL select */ case 169: /* union ::= union UNION ALL select */
{ yylhsminor.yy525 = appendSelectClause(yymsp[-3].minor.yy525, yymsp[0].minor.yy464); } #line 491 "sql.y"
yymsp[-3].minor.yy525 = yylhsminor.yy525; { yylhsminor.yy131 = appendSelectClause(yymsp[-3].minor.yy131, yymsp[0].minor.yy256); }
#line 3300 "sql.c"
yymsp[-3].minor.yy131 = yylhsminor.yy131;
break; break;
case 170: /* cmd ::= union */ case 170: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy525, NULL, TSDB_SQL_SELECT); } #line 493 "sql.y"
{ setSqlInfo(pInfo, yymsp[0].minor.yy131, NULL, TSDB_SQL_SELECT); }
#line 3306 "sql.c"
break; break;
case 171: /* select ::= SELECT selcollist */ case 171: /* select ::= SELECT selcollist */
#line 500 "sql.y"
{ {
yylhsminor.yy464 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy525, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yylhsminor.yy256 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy131, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy464 = yylhsminor.yy464; #line 3313 "sql.c"
yymsp[-1].minor.yy256 = yylhsminor.yy256;
break; break;
case 172: /* sclp ::= selcollist COMMA */ case 172: /* sclp ::= selcollist COMMA */
{yylhsminor.yy525 = yymsp[-1].minor.yy525;} #line 512 "sql.y"
yymsp[-1].minor.yy525 = yylhsminor.yy525; {yylhsminor.yy131 = yymsp[-1].minor.yy131;}
#line 3319 "sql.c"
yymsp[-1].minor.yy131 = yylhsminor.yy131;
break; break;
case 173: /* sclp ::= */ case 173: /* sclp ::= */
case 203: /* orderby_opt ::= */ yytestcase(yyruleno==203); case 203: /* orderby_opt ::= */ yytestcase(yyruleno==203);
{yymsp[1].minor.yy525 = 0;} #line 513 "sql.y"
{yymsp[1].minor.yy131 = 0;}
#line 3326 "sql.c"
break; break;
case 174: /* selcollist ::= sclp distinct expr as */ case 174: /* selcollist ::= sclp distinct expr as */
#line 514 "sql.y"
{ {
yylhsminor.yy525 = tSqlExprListAppend(yymsp[-3].minor.yy525, yymsp[-1].minor.yy370, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yylhsminor.yy131 = tSqlExprListAppend(yymsp[-3].minor.yy131, yymsp[-1].minor.yy46, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-3].minor.yy525 = yylhsminor.yy525; #line 3333 "sql.c"
yymsp[-3].minor.yy131 = yylhsminor.yy131;
break; break;
case 175: /* selcollist ::= sclp STAR */ case 175: /* selcollist ::= sclp STAR */
#line 518 "sql.y"
{ {
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL);
yylhsminor.yy525 = tSqlExprListAppend(yymsp[-1].minor.yy525, pNode, 0, 0); yylhsminor.yy131 = tSqlExprListAppend(yymsp[-1].minor.yy131, pNode, 0, 0);
} }
yymsp[-1].minor.yy525 = yylhsminor.yy525; #line 3342 "sql.c"
yymsp[-1].minor.yy131 = yylhsminor.yy131;
break; break;
case 176: /* as ::= AS ids */ case 176: /* as ::= AS ids */
#line 526 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
#line 3348 "sql.c"
break; break;
case 177: /* as ::= ids */ case 177: /* as ::= ids */
#line 527 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } { yylhsminor.yy0 = yymsp[0].minor.yy0; }
#line 3353 "sql.c"
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 178: /* as ::= */ case 178: /* as ::= */
#line 528 "sql.y"
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
#line 3359 "sql.c"
break; break;
case 179: /* distinct ::= DISTINCT */ case 179: /* distinct ::= DISTINCT */
#line 531 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } { yylhsminor.yy0 = yymsp[0].minor.yy0; }
#line 3364 "sql.c"
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 181: /* from ::= FROM tablelist */ case 181: /* from ::= FROM tablelist */
case 182: /* from ::= FROM sub */ yytestcase(yyruleno==182); case 182: /* from ::= FROM sub */ yytestcase(yyruleno==182);
{yymsp[-1].minor.yy412 = yymsp[0].minor.yy412;} #line 537 "sql.y"
{yymsp[-1].minor.yy544 = yymsp[0].minor.yy544;}
#line 3371 "sql.c"
break; break;
case 183: /* sub ::= LP union RP */ case 183: /* sub ::= LP union RP */
{yymsp[-2].minor.yy412 = addSubqueryElem(NULL, yymsp[-1].minor.yy525, NULL);} #line 542 "sql.y"
{yymsp[-2].minor.yy544 = addSubqueryElem(NULL, yymsp[-1].minor.yy131, NULL);}
#line 3376 "sql.c"
break; break;
case 184: /* sub ::= LP union RP ids */ case 184: /* sub ::= LP union RP ids */
{yymsp[-3].minor.yy412 = addSubqueryElem(NULL, yymsp[-2].minor.yy525, &yymsp[0].minor.yy0);} #line 543 "sql.y"
{yymsp[-3].minor.yy544 = addSubqueryElem(NULL, yymsp[-2].minor.yy131, &yymsp[0].minor.yy0);}
#line 3381 "sql.c"
break; break;
case 185: /* sub ::= sub COMMA LP union RP ids */ case 185: /* sub ::= sub COMMA LP union RP ids */
{yylhsminor.yy412 = addSubqueryElem(yymsp[-5].minor.yy412, yymsp[-2].minor.yy525, &yymsp[0].minor.yy0);} #line 544 "sql.y"
yymsp[-5].minor.yy412 = yylhsminor.yy412; {yylhsminor.yy544 = addSubqueryElem(yymsp[-5].minor.yy544, yymsp[-2].minor.yy131, &yymsp[0].minor.yy0);}
#line 3386 "sql.c"
yymsp[-5].minor.yy544 = yylhsminor.yy544;
break; break;
case 186: /* tablelist ::= ids cpxName */ case 186: /* tablelist ::= ids cpxName */
#line 548 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy412 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy544 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-1].minor.yy412 = yylhsminor.yy412; #line 3395 "sql.c"
yymsp[-1].minor.yy544 = yylhsminor.yy544;
break; break;
case 187: /* tablelist ::= ids cpxName ids */ case 187: /* tablelist ::= ids cpxName ids */
#line 553 "sql.y"
{ {
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy412 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy544 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-2].minor.yy412 = yylhsminor.yy412; #line 3404 "sql.c"
yymsp[-2].minor.yy544 = yylhsminor.yy544;
break; break;
case 188: /* tablelist ::= tablelist COMMA ids cpxName */ case 188: /* tablelist ::= tablelist COMMA ids cpxName */
#line 558 "sql.y"
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy412 = setTableNameList(yymsp[-3].minor.yy412, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy544 = setTableNameList(yymsp[-3].minor.yy544, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-3].minor.yy412 = yylhsminor.yy412; #line 3413 "sql.c"
yymsp[-3].minor.yy544 = yylhsminor.yy544;
break; break;
case 189: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 189: /* tablelist ::= tablelist COMMA ids cpxName ids */
#line 563 "sql.y"
{ {
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy412 = setTableNameList(yymsp[-4].minor.yy412, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy544 = setTableNameList(yymsp[-4].minor.yy544, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-4].minor.yy412 = yylhsminor.yy412; #line 3422 "sql.c"
yymsp[-4].minor.yy544 = yylhsminor.yy544;
break; break;
case 190: /* tmvar ::= VARIABLE */ case 190: /* tmvar ::= VARIABLE */
#line 570 "sql.y"
{yylhsminor.yy0 = yymsp[0].minor.yy0;} {yylhsminor.yy0 = yymsp[0].minor.yy0;}
#line 3428 "sql.c"
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 191: /* interval_opt ::= INTERVAL LP tmvar RP */ case 191: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy520.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy520.offset.n = 0;} #line 573 "sql.y"
{yymsp[-3].minor.yy530.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy530.offset.n = 0;}
#line 3434 "sql.c"
break; break;
case 192: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ case 192: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy520.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy520.offset = yymsp[-1].minor.yy0;} #line 574 "sql.y"
{yymsp[-5].minor.yy530.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy530.offset = yymsp[-1].minor.yy0;}
#line 3439 "sql.c"
break; break;
case 193: /* interval_opt ::= */ case 193: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy520, 0, sizeof(yymsp[1].minor.yy520));} #line 575 "sql.y"
{memset(&yymsp[1].minor.yy530, 0, sizeof(yymsp[1].minor.yy530));}
#line 3444 "sql.c"
break; break;
case 194: /* session_option ::= */ case 194: /* session_option ::= */
{yymsp[1].minor.yy259.col.n = 0; yymsp[1].minor.yy259.gap.n = 0;} #line 578 "sql.y"
{yymsp[1].minor.yy39.col.n = 0; yymsp[1].minor.yy39.gap.n = 0;}
#line 3449 "sql.c"
break; break;
case 195: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ case 195: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
#line 579 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
yymsp[-6].minor.yy259.col = yymsp[-4].minor.yy0; yymsp[-6].minor.yy39.col = yymsp[-4].minor.yy0;
yymsp[-6].minor.yy259.gap = yymsp[-1].minor.yy0; yymsp[-6].minor.yy39.gap = yymsp[-1].minor.yy0;
} }
#line 3458 "sql.c"
break; break;
case 196: /* windowstate_option ::= */ case 196: /* windowstate_option ::= */
{ yymsp[1].minor.yy144.col.n = 0; yymsp[1].minor.yy144.col.z = NULL;} #line 585 "sql.y"
{ yymsp[1].minor.yy538.col.n = 0; yymsp[1].minor.yy538.col.z = NULL;}
#line 3463 "sql.c"
break; break;
case 197: /* windowstate_option ::= STATE_WINDOW LP ids RP */ case 197: /* windowstate_option ::= STATE_WINDOW LP ids RP */
{ yymsp[-3].minor.yy144.col = yymsp[-1].minor.yy0; } #line 586 "sql.y"
{ yymsp[-3].minor.yy538.col = yymsp[-1].minor.yy0; }
#line 3468 "sql.c"
break; break;
case 198: /* fill_opt ::= */ case 198: /* fill_opt ::= */
{ yymsp[1].minor.yy525 = 0; } #line 590 "sql.y"
{ yymsp[1].minor.yy131 = 0; }
#line 3473 "sql.c"
break; break;
case 199: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 199: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
#line 591 "sql.y"
{ {
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.yy525, &A, -1, 0); tVariantListInsert(yymsp[-1].minor.yy131, &A, -1, 0);
yymsp[-5].minor.yy525 = yymsp[-1].minor.yy525; yymsp[-5].minor.yy131 = yymsp[-1].minor.yy131;
} }
#line 3485 "sql.c"
break; break;
case 200: /* fill_opt ::= FILL LP ID RP */ case 200: /* fill_opt ::= FILL LP ID RP */
#line 600 "sql.y"
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy525 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yymsp[-3].minor.yy131 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
#line 3493 "sql.c"
break; break;
case 201: /* sliding_opt ::= SLIDING LP tmvar RP */ case 201: /* sliding_opt ::= SLIDING LP tmvar RP */
#line 606 "sql.y"
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
#line 3498 "sql.c"
break; break;
case 202: /* sliding_opt ::= */ case 202: /* sliding_opt ::= */
#line 607 "sql.y"
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
#line 3503 "sql.c"
break; break;
case 204: /* orderby_opt ::= ORDER BY sortlist */ case 204: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy525 = yymsp[0].minor.yy525;} #line 619 "sql.y"
{yymsp[-2].minor.yy131 = yymsp[0].minor.yy131;}
#line 3508 "sql.c"
break; break;
case 205: /* sortlist ::= sortlist COMMA item sortorder */ case 205: /* sortlist ::= sortlist COMMA item sortorder */
#line 621 "sql.y"
{ {
yylhsminor.yy525 = tVariantListAppend(yymsp[-3].minor.yy525, &yymsp[-1].minor.yy506, yymsp[0].minor.yy52); yylhsminor.yy131 = tVariantListAppend(yymsp[-3].minor.yy131, &yymsp[-1].minor.yy516, yymsp[0].minor.yy43);
} }
yymsp[-3].minor.yy525 = yylhsminor.yy525; #line 3515 "sql.c"
yymsp[-3].minor.yy131 = yylhsminor.yy131;
break; break;
case 206: /* sortlist ::= item sortorder */ case 206: /* sortlist ::= item sortorder */
#line 625 "sql.y"
{ {
yylhsminor.yy525 = tVariantListAppend(NULL, &yymsp[-1].minor.yy506, yymsp[0].minor.yy52); yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[-1].minor.yy516, yymsp[0].minor.yy43);
} }
yymsp[-1].minor.yy525 = yylhsminor.yy525; #line 3523 "sql.c"
yymsp[-1].minor.yy131 = yylhsminor.yy131;
break; break;
case 207: /* item ::= ids cpxName */ case 207: /* item ::= ids cpxName */
#line 630 "sql.y"
{ {
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.yy506, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy516, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy506 = yylhsminor.yy506; #line 3534 "sql.c"
yymsp[-1].minor.yy516 = yylhsminor.yy516;
break; break;
case 208: /* sortorder ::= ASC */ case 208: /* sortorder ::= ASC */
{ yymsp[0].minor.yy52 = TSDB_ORDER_ASC; } #line 638 "sql.y"
{ yymsp[0].minor.yy43 = TSDB_ORDER_ASC; }
#line 3540 "sql.c"
break; break;
case 209: /* sortorder ::= DESC */ case 209: /* sortorder ::= DESC */
{ yymsp[0].minor.yy52 = TSDB_ORDER_DESC;} #line 639 "sql.y"
{ yymsp[0].minor.yy43 = TSDB_ORDER_DESC;}
#line 3545 "sql.c"
break; break;
case 210: /* sortorder ::= */ case 210: /* sortorder ::= */
{ yymsp[1].minor.yy52 = TSDB_ORDER_ASC; } #line 640 "sql.y"
{ yymsp[1].minor.yy43 = TSDB_ORDER_ASC; }
#line 3550 "sql.c"
break; break;
case 211: /* groupby_opt ::= */ case 211: /* groupby_opt ::= */
{ yymsp[1].minor.yy525 = 0;} #line 648 "sql.y"
{ yymsp[1].minor.yy131 = 0;}
#line 3555 "sql.c"
break; break;
case 212: /* groupby_opt ::= GROUP BY grouplist */ case 212: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy525 = yymsp[0].minor.yy525;} #line 649 "sql.y"
{ yymsp[-2].minor.yy131 = yymsp[0].minor.yy131;}
#line 3560 "sql.c"
break; break;
case 213: /* grouplist ::= grouplist COMMA item */ case 213: /* grouplist ::= grouplist COMMA item */
#line 651 "sql.y"
{ {
yylhsminor.yy525 = tVariantListAppend(yymsp[-2].minor.yy525, &yymsp[0].minor.yy506, -1); yylhsminor.yy131 = tVariantListAppend(yymsp[-2].minor.yy131, &yymsp[0].minor.yy516, -1);
} }
yymsp[-2].minor.yy525 = yylhsminor.yy525; #line 3567 "sql.c"
yymsp[-2].minor.yy131 = yylhsminor.yy131;
break; break;
case 214: /* grouplist ::= item */ case 214: /* grouplist ::= item */
#line 655 "sql.y"
{ {
yylhsminor.yy525 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[0].minor.yy516, -1);
} }
yymsp[0].minor.yy525 = yylhsminor.yy525; #line 3575 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 215: /* having_opt ::= */ case 215: /* having_opt ::= */
case 225: /* where_opt ::= */ yytestcase(yyruleno==225); case 225: /* where_opt ::= */ yytestcase(yyruleno==225);
case 267: /* expritem ::= */ yytestcase(yyruleno==267); case 267: /* expritem ::= */ yytestcase(yyruleno==267);
{yymsp[1].minor.yy370 = 0;} #line 662 "sql.y"
{yymsp[1].minor.yy46 = 0;}
#line 3583 "sql.c"
break; break;
case 216: /* having_opt ::= HAVING expr */ case 216: /* having_opt ::= HAVING expr */
case 226: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==226); case 226: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==226);
{yymsp[-1].minor.yy370 = yymsp[0].minor.yy370;} #line 663 "sql.y"
{yymsp[-1].minor.yy46 = yymsp[0].minor.yy46;}
#line 3589 "sql.c"
break; break;
case 217: /* limit_opt ::= */ case 217: /* limit_opt ::= */
case 221: /* slimit_opt ::= */ yytestcase(yyruleno==221); case 221: /* slimit_opt ::= */ yytestcase(yyruleno==221);
{yymsp[1].minor.yy126.limit = -1; yymsp[1].minor.yy126.offset = 0;} #line 667 "sql.y"
{yymsp[1].minor.yy284.limit = -1; yymsp[1].minor.yy284.offset = 0;}
#line 3595 "sql.c"
break; break;
case 218: /* limit_opt ::= LIMIT signed */ case 218: /* limit_opt ::= LIMIT signed */
case 222: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==222); case 222: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==222);
{yymsp[-1].minor.yy126.limit = yymsp[0].minor.yy501; yymsp[-1].minor.yy126.offset = 0;} #line 668 "sql.y"
{yymsp[-1].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-1].minor.yy284.offset = 0;}
#line 3601 "sql.c"
break; break;
case 219: /* limit_opt ::= LIMIT signed OFFSET signed */ case 219: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy126.limit = yymsp[-2].minor.yy501; yymsp[-3].minor.yy126.offset = yymsp[0].minor.yy501;} #line 670 "sql.y"
{ yymsp[-3].minor.yy284.limit = yymsp[-2].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[0].minor.yy459;}
#line 3606 "sql.c"
break; break;
case 220: /* limit_opt ::= LIMIT signed COMMA signed */ case 220: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy126.limit = yymsp[0].minor.yy501; yymsp[-3].minor.yy126.offset = yymsp[-2].minor.yy501;} #line 672 "sql.y"
{ yymsp[-3].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[-2].minor.yy459;}
#line 3611 "sql.c"
break; break;
case 223: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ case 223: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy126.limit = yymsp[-2].minor.yy501; yymsp[-3].minor.yy126.offset = yymsp[0].minor.yy501;} #line 678 "sql.y"
{yymsp[-3].minor.yy284.limit = yymsp[-2].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[0].minor.yy459;}
#line 3616 "sql.c"
break; break;
case 224: /* slimit_opt ::= SLIMIT signed COMMA signed */ case 224: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy126.limit = yymsp[0].minor.yy501; yymsp[-3].minor.yy126.offset = yymsp[-2].minor.yy501;} #line 680 "sql.y"
{yymsp[-3].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[-2].minor.yy459;}
#line 3621 "sql.c"
break; break;
case 227: /* expr ::= LP expr RP */ case 227: /* expr ::= LP expr RP */
{yylhsminor.yy370 = yymsp[-1].minor.yy370; yylhsminor.yy370->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy370->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} #line 693 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = yymsp[-1].minor.yy46; yylhsminor.yy46->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy46->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
#line 3626 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 228: /* expr ::= ID */ case 228: /* expr ::= ID */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} #line 695 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);}
#line 3632 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 229: /* expr ::= ID DOT ID */ case 229: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} #line 696 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);}
#line 3638 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 230: /* expr ::= ID DOT STAR */ case 230: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} #line 697 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);}
#line 3644 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 231: /* expr ::= INTEGER */ case 231: /* expr ::= INTEGER */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} #line 699 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);}
#line 3650 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 232: /* expr ::= MINUS INTEGER */ case 232: /* expr ::= MINUS INTEGER */
case 233: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==233); case 233: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==233);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} #line 700 "sql.y"
yymsp[-1].minor.yy370 = yylhsminor.yy370; { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);}
#line 3657 "sql.c"
yymsp[-1].minor.yy46 = yylhsminor.yy46;
break; break;
case 234: /* expr ::= FLOAT */ case 234: /* expr ::= FLOAT */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} #line 702 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);}
#line 3663 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 235: /* expr ::= MINUS FLOAT */ case 235: /* expr ::= MINUS FLOAT */
case 236: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==236); case 236: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==236);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} #line 703 "sql.y"
yymsp[-1].minor.yy370 = yylhsminor.yy370; { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);}
#line 3670 "sql.c"
yymsp[-1].minor.yy46 = yylhsminor.yy46;
break; break;
case 237: /* expr ::= STRING */ case 237: /* expr ::= STRING */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} #line 705 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);}
#line 3676 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 238: /* expr ::= NOW */ case 238: /* expr ::= NOW */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } #line 706 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); }
#line 3682 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 239: /* expr ::= VARIABLE */ case 239: /* expr ::= VARIABLE */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} #line 707 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);}
#line 3688 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 240: /* expr ::= PLUS VARIABLE */ case 240: /* expr ::= PLUS VARIABLE */
case 241: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==241); case 241: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==241);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} #line 708 "sql.y"
yymsp[-1].minor.yy370 = yylhsminor.yy370; { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);}
#line 3695 "sql.c"
yymsp[-1].minor.yy46 = yylhsminor.yy46;
break; break;
case 242: /* expr ::= BOOL */ case 242: /* expr ::= BOOL */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} #line 710 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);}
#line 3701 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 243: /* expr ::= NULL */ case 243: /* expr ::= NULL */
{ yylhsminor.yy370 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} #line 711 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; { yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);}
#line 3707 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 244: /* expr ::= ID LP exprlist RP */ case 244: /* expr ::= ID LP exprlist RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy370 = tSqlExprCreateFunction(yymsp[-1].minor.yy525, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } #line 714 "sql.y"
yymsp[-3].minor.yy370 = yylhsminor.yy370; { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy46 = tSqlExprCreateFunction(yymsp[-1].minor.yy131, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3713 "sql.c"
yymsp[-3].minor.yy46 = yylhsminor.yy46;
break; break;
case 245: /* expr ::= ID LP STAR RP */ case 245: /* expr ::= ID LP STAR RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy370 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } #line 717 "sql.y"
yymsp[-3].minor.yy370 = yylhsminor.yy370; { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy46 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3719 "sql.c"
yymsp[-3].minor.yy46 = yylhsminor.yy46;
break; break;
case 246: /* expr ::= expr IS NULL */ case 246: /* expr ::= expr IS NULL */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, NULL, TK_ISNULL);} #line 720 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, NULL, TK_ISNULL);}
#line 3725 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 247: /* expr ::= expr IS NOT NULL */ case 247: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-3].minor.yy370, NULL, TK_NOTNULL);} #line 721 "sql.y"
yymsp[-3].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-3].minor.yy46, NULL, TK_NOTNULL);}
#line 3731 "sql.c"
yymsp[-3].minor.yy46 = yylhsminor.yy46;
break; break;
case 248: /* expr ::= expr LT expr */ case 248: /* expr ::= expr LT expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LT);} #line 724 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LT);}
#line 3737 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 249: /* expr ::= expr GT expr */ case 249: /* expr ::= expr GT expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_GT);} #line 725 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_GT);}
#line 3743 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 250: /* expr ::= expr LE expr */ case 250: /* expr ::= expr LE expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LE);} #line 726 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LE);}
#line 3749 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 251: /* expr ::= expr GE expr */ case 251: /* expr ::= expr GE expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_GE);} #line 727 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_GE);}
#line 3755 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 252: /* expr ::= expr NE expr */ case 252: /* expr ::= expr NE expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_NE);} #line 728 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_NE);}
#line 3761 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 253: /* expr ::= expr EQ expr */ case 253: /* expr ::= expr EQ expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_EQ);} #line 729 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_EQ);}
#line 3767 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 254: /* expr ::= expr BETWEEN expr AND expr */ case 254: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy370); yylhsminor.yy370 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy370, yymsp[-2].minor.yy370, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy370, TK_LE), TK_AND);} #line 731 "sql.y"
yymsp[-4].minor.yy370 = yylhsminor.yy370; { tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy46); yylhsminor.yy46 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy46, yymsp[-2].minor.yy46, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy46, TK_LE), TK_AND);}
#line 3773 "sql.c"
yymsp[-4].minor.yy46 = yylhsminor.yy46;
break; break;
case 255: /* expr ::= expr AND expr */ case 255: /* expr ::= expr AND expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_AND);} #line 733 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_AND);}
#line 3779 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 256: /* expr ::= expr OR expr */ case 256: /* expr ::= expr OR expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_OR); } #line 734 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_OR); }
#line 3785 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 257: /* expr ::= expr PLUS expr */ case 257: /* expr ::= expr PLUS expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_PLUS); } #line 737 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_PLUS); }
#line 3791 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 258: /* expr ::= expr MINUS expr */ case 258: /* expr ::= expr MINUS expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_MINUS); } #line 738 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_MINUS); }
#line 3797 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 259: /* expr ::= expr STAR expr */ case 259: /* expr ::= expr STAR expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_STAR); } #line 739 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_STAR); }
#line 3803 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 260: /* expr ::= expr SLASH expr */ case 260: /* expr ::= expr SLASH expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_DIVIDE);} #line 740 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_DIVIDE);}
#line 3809 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 261: /* expr ::= expr REM expr */ case 261: /* expr ::= expr REM expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_REM); } #line 741 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_REM); }
#line 3815 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 262: /* expr ::= expr LIKE expr */ case 262: /* expr ::= expr LIKE expr */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-2].minor.yy370, yymsp[0].minor.yy370, TK_LIKE); } #line 744 "sql.y"
yymsp[-2].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LIKE); }
#line 3821 "sql.c"
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break; break;
case 263: /* expr ::= expr IN LP exprlist RP */ case 263: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy370 = tSqlExprCreate(yymsp[-4].minor.yy370, (tSqlExpr*)yymsp[-1].minor.yy525, TK_IN); } #line 747 "sql.y"
yymsp[-4].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = tSqlExprCreate(yymsp[-4].minor.yy46, (tSqlExpr*)yymsp[-1].minor.yy131, TK_IN); }
#line 3827 "sql.c"
yymsp[-4].minor.yy46 = yylhsminor.yy46;
break; break;
case 264: /* exprlist ::= exprlist COMMA expritem */ case 264: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy525 = tSqlExprListAppend(yymsp[-2].minor.yy525,yymsp[0].minor.yy370,0, 0);} #line 755 "sql.y"
yymsp[-2].minor.yy525 = yylhsminor.yy525; {yylhsminor.yy131 = tSqlExprListAppend(yymsp[-2].minor.yy131,yymsp[0].minor.yy46,0, 0);}
#line 3833 "sql.c"
yymsp[-2].minor.yy131 = yylhsminor.yy131;
break; break;
case 265: /* exprlist ::= expritem */ case 265: /* exprlist ::= expritem */
{yylhsminor.yy525 = tSqlExprListAppend(0,yymsp[0].minor.yy370,0, 0);} #line 756 "sql.y"
yymsp[0].minor.yy525 = yylhsminor.yy525; {yylhsminor.yy131 = tSqlExprListAppend(0,yymsp[0].minor.yy46,0, 0);}
#line 3839 "sql.c"
yymsp[0].minor.yy131 = yylhsminor.yy131;
break; break;
case 266: /* expritem ::= expr */ case 266: /* expritem ::= expr */
{yylhsminor.yy370 = yymsp[0].minor.yy370;} #line 757 "sql.y"
yymsp[0].minor.yy370 = yylhsminor.yy370; {yylhsminor.yy46 = yymsp[0].minor.yy46;}
#line 3845 "sql.c"
yymsp[0].minor.yy46 = yylhsminor.yy46;
break; break;
case 268: /* cmd ::= RESET QUERY CACHE */ case 268: /* cmd ::= RESET QUERY CACHE */
#line 761 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
#line 3851 "sql.c"
break; break;
case 269: /* cmd ::= SYNCDB ids REPLICA */ case 269: /* cmd ::= SYNCDB ids REPLICA */
#line 764 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
#line 3856 "sql.c"
break; break;
case 270: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 270: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
#line 767 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3865 "sql.c"
break; break;
case 271: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ case 271: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
#line 773 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3134,22 +3874,28 @@ static void yy_reduce( ...@@ -3134,22 +3874,28 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3878 "sql.c"
break; break;
case 272: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ case 272: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
#line 783 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3887 "sql.c"
break; break;
case 273: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 273: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
#line 790 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3896 "sql.c"
break; break;
case 274: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ case 274: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
#line 795 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3159,8 +3905,10 @@ static void yy_reduce( ...@@ -3159,8 +3905,10 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3909 "sql.c"
break; break;
case 275: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ case 275: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
#line 805 "sql.y"
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -3173,34 +3921,42 @@ static void yy_reduce( ...@@ -3173,34 +3921,42 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3925 "sql.c"
break; break;
case 276: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ case 276: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
#line 818 "sql.y"
{ {
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);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy506, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy516, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3939 "sql.c"
break; break;
case 277: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ case 277: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
#line 829 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3948 "sql.c"
break; break;
case 278: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ case 278: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
#line 836 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3957 "sql.c"
break; break;
case 279: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ case 279: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
#line 842 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3210,22 +3966,28 @@ static void yy_reduce( ...@@ -3210,22 +3966,28 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3970 "sql.c"
break; break;
case 280: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ case 280: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
#line 852 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3979 "sql.c"
break; break;
case 281: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ case 281: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
#line 859 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 3988 "sql.c"
break; break;
case 282: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ case 282: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
#line 864 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3235,8 +3997,10 @@ static void yy_reduce( ...@@ -3235,8 +3997,10 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 4001 "sql.c"
break; break;
case 283: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ case 283: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
#line 874 "sql.y"
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -3249,42 +4013,53 @@ static void yy_reduce( ...@@ -3249,42 +4013,53 @@ static void yy_reduce(
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 4017 "sql.c"
break; break;
case 284: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ case 284: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
#line 887 "sql.y"
{ {
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);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy506, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy516, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 4031 "sql.c"
break; break;
case 285: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ case 285: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
#line 898 "sql.y"
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy525, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy131, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
#line 4040 "sql.c"
break; break;
case 286: /* cmd ::= KILL CONNECTION INTEGER */ case 286: /* cmd ::= KILL CONNECTION INTEGER */
#line 905 "sql.y"
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
#line 4045 "sql.c"
break; break;
case 287: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ case 287: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
#line 906 "sql.y"
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
#line 4050 "sql.c"
break; break;
case 288: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ case 288: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
#line 907 "sql.y"
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
#line 4055 "sql.c"
break; break;
default: default:
break; break;
/********** End reduce actions ************************************************/ /********** End reduce actions ************************************************/
}; };
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) ); assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
yygoto = yyRuleInfo[yyruleno].lhs; yygoto = yyRuleInfoLhs[yyruleno];
yysize = yyRuleInfo[yyruleno].nrhs; yysize = yyRuleInfoNRhs[yyruleno];
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto); yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table /* There are no SHIFTREDUCE actions on nonterminals because the table
...@@ -3299,6 +4074,7 @@ static void yy_reduce( ...@@ -3299,6 +4074,7 @@ static void yy_reduce(
yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto; yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift"); yyTraceShift(yypParser, yyact, "... then shift");
return yyact;
} }
/* /*
...@@ -3308,7 +4084,8 @@ static void yy_reduce( ...@@ -3308,7 +4084,8 @@ static void yy_reduce(
static void yy_parse_failed( static void yy_parse_failed(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
...@@ -3319,7 +4096,8 @@ static void yy_parse_failed( ...@@ -3319,7 +4096,8 @@ static void yy_parse_failed(
** parser fails */ ** parser fails */
/************ Begin %parse_failure code ***************************************/ /************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/ /************ End %parse_failure code *****************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
#endif /* YYNOERRORRECOVERY */ #endif /* YYNOERRORRECOVERY */
...@@ -3331,9 +4109,11 @@ static void yy_syntax_error( ...@@ -3331,9 +4109,11 @@ static void yy_syntax_error(
int yymajor, /* The major type of the error token */ int yymajor, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#define TOKEN yyminor #define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/ /************ Begin %syntax_error code ****************************************/
#line 37 "sql.y"
pInfo->valid = false; pInfo->valid = false;
int32_t outputBufLen = tListLen(pInfo->msg); int32_t outputBufLen = tListLen(pInfo->msg);
...@@ -3356,8 +4136,10 @@ static void yy_syntax_error( ...@@ -3356,8 +4136,10 @@ static void yy_syntax_error(
} }
assert(len <= outputBufLen); assert(len <= outputBufLen);
#line 4140 "sql.c"
/************ End %syntax_error code ******************************************/ /************ End %syntax_error code ******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* /*
...@@ -3366,7 +4148,8 @@ static void yy_syntax_error( ...@@ -3366,7 +4148,8 @@ static void yy_syntax_error(
static void yy_accept( static void yy_accept(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
...@@ -3379,9 +4162,11 @@ static void yy_accept( ...@@ -3379,9 +4162,11 @@ static void yy_accept(
/* 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 *****************************************/ /*********** Begin %parse_accept code *****************************************/
#line 61 "sql.y"
#line 4167 "sql.c"
/*********** End %parse_accept code *******************************************/ /*********** End %parse_accept code *******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* The main parser program. /* The main parser program.
...@@ -3410,45 +4195,47 @@ void Parse( ...@@ -3410,45 +4195,47 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */ ParseARG_PDECL /* Optional %extra_argument parameter */
){ ){
YYMINORTYPE yyminorunion; YYMINORTYPE yyminorunion;
unsigned int yyact; /* The parser action. */ YYACTIONTYPE yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyendofinput; /* True if we are at the end of input */ int yyendofinput; /* True if we are at the end of input */
#endif #endif
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
int yyerrorhit = 0; /* True if yymajor has invoked an error */ int yyerrorhit = 0; /* True if yymajor has invoked an error */
#endif #endif
yyParser *yypParser; /* The parser */ yyParser *yypParser = (yyParser*)yyp; /* The parser */
ParseCTX_FETCH
ParseARG_STORE
yypParser = (yyParser*)yyp;
assert( yypParser->yytos!=0 ); assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
yyendofinput = (yymajor==0); yyendofinput = (yymajor==0);
#endif #endif
ParseARG_STORE;
yyact = yypParser->yytos->stateno;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
int stateno = yypParser->yytos->stateno; if( yyact < YY_MIN_REDUCE ){
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno); yyTracePrompt,yyTokenName[yymajor],yyact);
}else{ }else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE); yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
} }
} }
#endif #endif
do{ do{
yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); assert( yyact==yypParser->yytos->stateno );
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){ if( yyact >= YY_MIN_REDUCE ){
yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){ }else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,yymajor,yyminor); yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt--; yypParser->yyerrcnt--;
#endif #endif
yymajor = YYNOCODE; break;
}else if( yyact==YY_ACCEPT_ACTION ){ }else if( yyact==YY_ACCEPT_ACTION ){
yypParser->yytos--; yypParser->yytos--;
yy_accept(yypParser); yy_accept(yypParser);
...@@ -3499,10 +4286,9 @@ void Parse( ...@@ -3499,10 +4286,9 @@ void Parse(
yymajor = YYNOCODE; yymajor = YYNOCODE;
}else{ }else{
while( yypParser->yytos >= yypParser->yystack while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action( && (yyact = yy_find_reduce_action(
yypParser->yytos->stateno, yypParser->yytos->stateno,
YYERRORSYMBOL)) >= YY_MIN_REDUCE YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
){ ){
yy_pop_parser_stack(yypParser); yy_pop_parser_stack(yypParser);
} }
...@@ -3519,6 +4305,8 @@ void Parse( ...@@ -3519,6 +4305,8 @@ void Parse(
} }
yypParser->yyerrcnt = 3; yypParser->yyerrcnt = 3;
yyerrorhit = 1; yyerrorhit = 1;
if( yymajor==YYNOCODE ) break;
yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY) #elif defined(YYNOERRORRECOVERY)
/* If the YYNOERRORRECOVERY macro is defined, then do not attempt to /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
** do any kind of error recovery. Instead, simply invoke the syntax ** do any kind of error recovery. Instead, simply invoke the syntax
...@@ -3529,8 +4317,7 @@ void Parse( ...@@ -3529,8 +4317,7 @@ void Parse(
*/ */
yy_syntax_error(yypParser,yymajor, yyminor); yy_syntax_error(yypParser,yymajor, yyminor);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE; break;
#else /* YYERRORSYMBOL is not defined */ #else /* YYERRORSYMBOL is not defined */
/* This is what we do if the grammar does not define ERROR: /* This is what we do if the grammar does not define ERROR:
** **
...@@ -3552,10 +4339,10 @@ void Parse( ...@@ -3552,10 +4339,10 @@ void Parse(
yypParser->yyerrcnt = -1; yypParser->yyerrcnt = -1;
#endif #endif
} }
yymajor = YYNOCODE; break;
#endif #endif
} }
}while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
yyStackEntry *i; yyStackEntry *i;
...@@ -3570,3 +4357,17 @@ void Parse( ...@@ -3570,3 +4357,17 @@ void Parse(
#endif #endif
return; return;
} }
/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
int ParseFallback(int iToken){
#ifdef YYFALLBACK
assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
return yyFallback[iToken];
#else
(void)iToken;
return 0;
#endif
}
...@@ -407,11 +407,56 @@ TEST(testCase, parse_time) { ...@@ -407,11 +407,56 @@ TEST(testCase, parse_time) {
taosParseTime(t41, &time, strlen(t41), TSDB_TIME_PRECISION_MILLI, 0); taosParseTime(t41, &time, strlen(t41), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, 852048000999); EXPECT_EQ(time, 852048000999);
int64_t k = timezone;
char t42[] = "1997-1-1T0:0:0.999999999Z"; char t42[] = "1997-1-1T0:0:0.999999999Z";
taosParseTime(t42, &time, strlen(t42), TSDB_TIME_PRECISION_MILLI, 0); taosParseTime(t42, &time, strlen(t42), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, 852048000999 - timezone * MILLISECOND_PER_SECOND); EXPECT_EQ(time, 852048000999 - timezone * MILLISECOND_PER_SECOND);
// "%Y-%m-%d %H:%M:%S" format with TimeZone appendix is also treated as legal
// and TimeZone will be processed
char t60[] = "2017-4-3 1:1:2.980";
char t61[] = "2017-4-3 2:1:2.98+9:00";
taosParseTime(t60, &time, strlen(t60), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t61, &time1, strlen(t61), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t62[] = "2017-4-3 2:1:2.98+09:00";
taosParseTime(t62, &time, strlen(t62), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t61, &time1, strlen(t61), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t63[] = "2017-4-3 2:1:2.98+0900";
taosParseTime(t63, &time, strlen(t63), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t62, &time1, strlen(t62), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t64[] = "2017-4-2 17:1:2.98Z";
taosParseTime(t63, &time, strlen(t63), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t64, &time1, strlen(t64), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
// "%Y-%m-%d%H:%M:%S" format with TimeZone appendix is also treated as legal
// and TimeZone will be processed
char t80[] = "2017-4-51:1:2.980";
char t81[] = "2017-4-52:1:2.98+9:00";
taosParseTime(t80, &time, strlen(t80), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t81, &time1, strlen(t81), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t82[] = "2017-4-52:1:2.98+09:00";
taosParseTime(t82, &time, strlen(t82), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t81, &time1, strlen(t81), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t83[] = "2017-4-52:1:2.98+0900";
taosParseTime(t83, &time, strlen(t83), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t82, &time1, strlen(t82), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
char t84[] = "2017-4-417:1:2.98Z";
taosParseTime(t83, &time, strlen(t83), TSDB_TIME_PRECISION_MILLI, 0);
taosParseTime(t84, &time1, strlen(t84), TSDB_TIME_PRECISION_MILLI, 0);
EXPECT_EQ(time, time1);
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// illegal timestamp format // illegal timestamp format
char t15[] = "2017-12-33 0:0:0"; char t15[] = "2017-12-33 0:0:0";
...@@ -430,8 +475,7 @@ TEST(testCase, parse_time) { ...@@ -430,8 +475,7 @@ TEST(testCase, parse_time) {
EXPECT_EQ(taosParseTime(t19, &time, strlen(t19), TSDB_TIME_PRECISION_MILLI, 0), -1); EXPECT_EQ(taosParseTime(t19, &time, strlen(t19), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t20[] = "2017-12-31 9:0:0.1+12:99"; char t20[] = "2017-12-31 9:0:0.1+12:99";
EXPECT_EQ(taosParseTime(t20, &time, strlen(t20), TSDB_TIME_PRECISION_MILLI, 0), 0); EXPECT_EQ(taosParseTime(t20, &time, strlen(t20), TSDB_TIME_PRECISION_MILLI, 0), -1);
EXPECT_EQ(time, 1514682000100);
char t21[] = "2017-12-31T9:0:0.1+12:99"; char t21[] = "2017-12-31T9:0:0.1+12:99";
EXPECT_EQ(taosParseTime(t21, &time, strlen(t21), TSDB_TIME_PRECISION_MILLI, 0), -1); EXPECT_EQ(taosParseTime(t21, &time, strlen(t21), TSDB_TIME_PRECISION_MILLI, 0), -1);
...@@ -441,8 +485,103 @@ TEST(testCase, parse_time) { ...@@ -441,8 +485,103 @@ TEST(testCase, parse_time) {
char t23[] = "2017-12-31T9:0:0.1+13:1"; char t23[] = "2017-12-31T9:0:0.1+13:1";
EXPECT_EQ(taosParseTime(t23, &time, strlen(t23), TSDB_TIME_PRECISION_MILLI, 0), 0); EXPECT_EQ(taosParseTime(t23, &time, strlen(t23), TSDB_TIME_PRECISION_MILLI, 0), 0);
char t24[] = "2017-12-31T9:0:0.1+13:001";
EXPECT_EQ(taosParseTime(t24, &time, strlen(t24), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t25[] = "2017-12-31T9:0:0.1+13:00abc";
EXPECT_EQ(taosParseTime(t25, &time, strlen(t25), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t26[] = "2017-12-31T9:0:0.1+13001";
EXPECT_EQ(taosParseTime(t26, &time, strlen(t26), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t27[] = "2017-12-31T9:0:0.1+1300abc";
EXPECT_EQ(taosParseTime(t27, &time, strlen(t27), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t28[] = "2017-12-31T9:0:0Z+12:00";
EXPECT_EQ(taosParseTime(t28, &time, strlen(t28), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t29[] = "2017-12-31T9:0:0.123Z+12:00";
EXPECT_EQ(taosParseTime(t29, &time, strlen(t29), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t65[] = "2017-12-31 9:0:0.1+13:001";
EXPECT_EQ(taosParseTime(t65, &time, strlen(t65), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t66[] = "2017-12-31 9:0:0.1+13:00abc";
EXPECT_EQ(taosParseTime(t66, &time, strlen(t66), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t67[] = "2017-12-31 9:0:0.1+13001";
EXPECT_EQ(taosParseTime(t67, &time, strlen(t67), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t68[] = "2017-12-31 9:0:0.1+1300abc";
EXPECT_EQ(taosParseTime(t68, &time, strlen(t68), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t69[] = "2017-12-31 9:0:0Z+12:00";
EXPECT_EQ(taosParseTime(t69, &time, strlen(t69), TSDB_TIME_PRECISION_MILLI, 0), -1);
char t70[] = "2017-12-31 9:0:0.123Z+12:00";
EXPECT_EQ(taosParseTime(t70, &time, strlen(t70), TSDB_TIME_PRECISION_MILLI, 0), -1);
}
/* test parse time profiling */
TEST(testCase, parse_time_profile) {
taos_options(TSDB_OPTION_TIMEZONE, "GMT-8");
char t1[] = "2018-1-8 1:1:1.952";
char t2[] = "2018-1-8T1:1:1.952+0800";
char t3[] = "2018-1-8 1:1:1.952+0800";
char t4[] = "2018-1-81:1:1.952+0800";
char t5[] = "2018-1-8 1:1:1.952";
char t6[] = "2018-1-8T1:1:1.952+08:00";
char t7[] = "2018-1-8 1:1:1.952+08:00";
char t8[] = "2018-1-81:1:1.952+08:00";
char t9[] = "2018-1-8 1:1:1.952";
char t10[] = "2018-1-8T1:1:1.952Z";
char t11[] = "2018-1-8 1:1:1.952z";
char t12[] = "2018-1-81:1:1.952Z";
struct timeval start, end;
int64_t time = 0, time1 = 0;
int32_t total_run = 100000000;
long total_time_us;
gettimeofday(&start, NULL);
for (int i = 0; i < total_run; ++i) {
taosParseTime(t1, &time, strlen(t1), TSDB_TIME_PRECISION_MILLI, 0);
}
gettimeofday(&end, NULL);
total_time_us = ((end.tv_sec - start.tv_sec)* 1000000) + (end.tv_usec - start.tv_usec);
printf("[t1] The elapsed time is %f seconds in %d run, average:%fns\n", total_time_us/1000000.0, total_run, 1000*(float)total_time_us/(float)total_run);
gettimeofday(&start, NULL);
for (int i = 0; i < total_run; ++i) {
taosParseTime(t2, &time, strlen(t2), TSDB_TIME_PRECISION_MILLI, 0);
}
gettimeofday(&end, NULL);
total_time_us = ((end.tv_sec - start.tv_sec)* 1000000) + (end.tv_usec - start.tv_usec);
printf("[t2] The elapsed time is %f seconds in %d run, average:%fns\n", total_time_us/1000000.0, total_run, 1000*(float)total_time_us/(float)total_run);
gettimeofday(&start, NULL);
for (int i = 0; i < total_run; ++i) {
taosParseTime(t3, &time, strlen(t3), TSDB_TIME_PRECISION_MILLI, 0);
}
gettimeofday(&end, NULL);
total_time_us = ((end.tv_sec - start.tv_sec)* 1000000) + (end.tv_usec - start.tv_usec);
printf("[t3] The elapsed time is %f seconds in %d run, average:%fns\n", total_time_us/1000000.0, total_run, 1000*(float)total_time_us/(float)total_run);
gettimeofday(&start, NULL);
for (int i = 0; i < total_run; ++i) {
taosParseTime(t4, &time, strlen(t4), TSDB_TIME_PRECISION_MILLI, 0);
}
gettimeofday(&end, NULL);
total_time_us = ((end.tv_sec - start.tv_sec)* 1000000) + (end.tv_usec - start.tv_usec);
printf("[t4] The elapsed time is %f seconds in %d run, average:%fns\n", total_time_us/1000000.0, total_run, 1000*(float)total_time_us/(float)total_run);
} }
TEST(testCase, tvariant_convert) { TEST(testCase, tvariant_convert) {
// 1. bool data to all other data types // 1. bool data to all other data types
tVariant t = {0}; tVariant t = {0};
......
...@@ -261,11 +261,20 @@ int tfsMkdirRecurAt(const char *rname, int level, int id) { ...@@ -261,11 +261,20 @@ int tfsMkdirRecurAt(const char *rname, int level, int id) {
// Try to create upper // Try to create upper
char *s = strdup(rname); char *s = strdup(rname);
if (tfsMkdirRecurAt(dirname(s), level, id) < 0) { // Make a copy of dirname(s) because the implementation of 'dirname' differs on different platforms.
tfree(s); // Some platform may modify the contents of the string passed into dirname(). Others may return a pointer to
// internal static storage space that will be overwritten by next call. For case like that, we should not use
// the pointer directly in this recursion.
// See https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dirname.3.html
char *dir = strdup(dirname(s));
if (tfsMkdirRecurAt(dir, level, id) < 0) {
free(s);
free(dir);
return -1; return -1;
} }
tfree(s); free(s);
free(dir);
if (tfsMkdirAt(rname, level, id) < 0) { if (tfsMkdirAt(rname, level, id) < 0) {
return -1; return -1;
......
...@@ -25,7 +25,7 @@ extern "C" { ...@@ -25,7 +25,7 @@ extern "C" {
#define TSDB_PATTERN_MATCH 0 #define TSDB_PATTERN_MATCH 0
#define TSDB_PATTERN_NOMATCH 1 #define TSDB_PATTERN_NOMATCH 1
#define TSDB_PATTERN_NOWILDCARDMATCH 2 #define TSDB_PATTERN_NOWILDCARDMATCH 2
#define TSDB_PATTERN_STRING_MAX_LEN 20 #define TSDB_PATTERN_STRING_MAX_LEN 100
#define FLT_COMPAR_TOL_FACTOR 4 #define FLT_COMPAR_TOL_FACTOR 4
#define FLT_EQUAL(_x, _y) (fabs((_x) - (_y)) <= (FLT_COMPAR_TOL_FACTOR * FLT_EPSILON)) #define FLT_EQUAL(_x, _y) (fabs((_x) - (_y)) <= (FLT_COMPAR_TOL_FACTOR * FLT_EPSILON))
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import time
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
import datetime
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
break
return buildPath
def run(self):
tdSql.prepare()
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
tdSql.execute("create database timezone")
tdSql.execute("use timezone")
tdSql.execute("create stable st (ts timestamp, id int ) tags (index int)")
tdSql.execute("insert into tb0 using st tags (1) values ('2021-07-01 00:00:00.000',0)")
tdSql.query("select ts from tb0")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb1 using st tags (1) values ('2021-07-01T00:00:00.000+07:50',1)")
tdSql.query("select ts from tb1")
tdSql.checkData(0, 0, "2021-07-01 00:10:00.000")
tdSql.execute("insert into tb2 using st tags (1) values ('2021-07-01T00:00:00.000+08:00',2)")
tdSql.query("select ts from tb2")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb3 using st tags (1) values ('2021-07-01T00:00:00.000Z',3)")
tdSql.query("select ts from tb3")
tdSql.checkData(0, 0, "2021-07-01 08:00:00.000")
tdSql.execute("insert into tb4 using st tags (1) values ('2021-07-01 00:00:00.000+07:50',4)")
tdSql.query("select ts from tb4")
tdSql.checkData(0, 0, "2021-07-01 00:10:00.000")
tdSql.execute("insert into tb5 using st tags (1) values ('2021-07-01 00:00:00.000Z',5)")
tdSql.query("select ts from tb5")
tdSql.checkData(0, 0, "2021-07-01 08:00:00.000")
tdSql.execute("insert into tb6 using st tags (1) values ('2021-07-01T00:00:00.000+0800',6)")
tdSql.query("select ts from tb6")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb7 using st tags (1) values ('2021-07-01 00:00:00.000+0800',7)")
tdSql.query("select ts from tb7")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb8 using st tags (1) values ('2021-07-0100:00:00.000',8)")
tdSql.query("select ts from tb8")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb9 using st tags (1) values ('2021-07-0100:00:00.000+0800',9)")
tdSql.query("select ts from tb9")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb10 using st tags (1) values ('2021-07-0100:00:00.000+08:00',10)")
tdSql.query("select ts from tb10")
tdSql.checkData(0, 0, "2021-07-01 00:00:00.000")
tdSql.execute("insert into tb11 using st tags (1) values ('2021-07-0100:00:00.000+07:00',11)")
tdSql.query("select ts from tb11")
tdSql.checkData(0, 0, "2021-07-01 01:00:00.000")
tdSql.execute("insert into tb12 using st tags (1) values ('2021-07-0100:00:00.000+0700',12)")
tdSql.query("select ts from tb12")
tdSql.checkData(0, 0, "2021-07-01 01:00:00.000")
tdSql.execute("insert into tb13 using st tags (1) values ('2021-07-0100:00:00.000+07:12',13)")
tdSql.query("select ts from tb13")
tdSql.checkData(0, 0, "2021-07-01 00:48:00.000")
tdSql.execute("insert into tb14 using st tags (1) values ('2021-07-0100:00:00.000+712',14)")
tdSql.query("select ts from tb14")
tdSql.checkData(0, 0, "2021-06-28 08:58:00.000")
tdSql.execute("insert into tb15 using st tags (1) values ('2021-07-0100:00:00.000Z',15)")
tdSql.query("select ts from tb15")
tdSql.checkData(0, 0, "2021-07-01 08:00:00.000")
tdSql.execute("insert into tb16 using st tags (1) values ('2021-7-1 00:00:00.000Z',16)")
tdSql.query("select ts from tb16")
tdSql.checkData(0, 0, "2021-07-01 08:00:00.000")
tdSql.execute("insert into tb17 using st tags (1) values ('2021-07-0100:00:00.000+0750',17)")
tdSql.query("select ts from tb17")
tdSql.checkData(0, 0, "2021-07-01 00:10:00.000")
tdSql.execute("insert into tb18 using st tags (1) values ('2021-07-0100:00:00.000+0752',18)")
tdSql.query("select ts from tb18")
tdSql.checkData(0, 0, "2021-07-01 00:08:00.000")
tdSql.execute("insert into tb19 using st tags (1) values ('2021-07-0100:00:00.000+075',19)")
tdSql.query("select ts from tb19")
tdSql.checkData(0, 0, "2021-07-01 00:55:00.000")
tdSql.execute("insert into tb20 using st tags (1) values ('2021-07-0100:00:00.000+75',20)")
tdSql.query("select ts from tb20")
tdSql.checkData(0, 0, "2021-06-28 05:00:00.000")
tdSql.execute("insert into tb21 using st tags (1) values ('2021-7-1 1:1:1.234+075',21)")
tdSql.query("select ts from tb21")
tdSql.checkData(0, 0, "2021-07-01 01:56:01.234")
tdSql.execute("insert into tb22 using st tags (1) values ('2021-7-1T1:1:1.234+075',22)")
tdSql.query("select ts from tb22")
tdSql.checkData(0, 0, "2021-07-01 01:56:01.234")
tdSql.execute("insert into tb23 using st tags (1) values ('2021-7-131:1:1.234+075',22)")
tdSql.query("select ts from tb23")
tdSql.checkData(0, 0, "2021-07-13 01:56:01.234")
tdSql.error("insert into tberror using st tags (1) values ('20210701 00:00:00.000+0800',0)")
tdSql.error("insert into tberror using st tags (1) values ('2021070100:00:00.000+0800',0)")
tdSql.error("insert into tberror using st tags (1) values ('202171 00:00:00.000+0800',0)")
tdSql.error("insert into tberror using st tags (1) values ('2021 07 01 00:00:00.000+0800',0)")
tdSql.error("insert into tberror using st tags (1) values ('2021 -07-0100:00:00.000+0800',0)")
tdSql.error("insert into tberror using st tags (1) values ('2021-7-11:1:1.234+075',0)")
os.system("rm -rf ./TimeZone/*.py.sql")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import os
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
import datetime
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def checkCommunity(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
return False
else:
return True
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosdump" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root) - len("/build/bin")]
break
return buildPath
def run(self):
# clear envs
tdSql.execute(" create database ZoneTime precision 'us' ")
tdSql.execute(" use ZoneTime ")
tdSql.execute(" create stable st (ts timestamp , id int , val float) tags (tag1 timestamp ,tag2 int) ")
# standard case for Timestamp
tdSql.execute(" insert into tb1 using st tags (\"2021-07-01 00:00:00.000\" , 2) values( \"2021-07-01 00:00:00.000\" , 1 , 1.0 ) ")
case1 = (tdSql.getResult("select * from tb1"))
print(case1)
if case1 == [(datetime.datetime(2021, 7, 1, 0, 0), 1, 1.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01 00:00:00.000' ")
# RCF-3339 : it allows "T" is replaced by " "
tdSql.execute(" insert into tb2 using st tags (\"2021-07-01T00:00:00.000+07:50\" , 2) values( \"2021-07-01T00:00:00.000+07:50\" , 2 , 2.0 ) ")
case2 = (tdSql.getResult("select * from tb2"))
print(case2)
if case2 == [(datetime.datetime(2021, 7, 1, 0, 10), 2, 2.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01T00:00:00.000+07:50'! ")
tdSql.execute(" insert into tb3 using st tags (\"2021-07-01T00:00:00.000+08:00\" , 3) values( \"2021-07-01T00:00:00.000+08:00\" , 3 , 3.0 ) ")
case3 = (tdSql.getResult("select * from tb3"))
print(case3)
if case3 == [(datetime.datetime(2021, 7, 1, 0, 0), 3, 3.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01T00:00:00.000+08:00'! ")
tdSql.execute(" insert into tb4 using st tags (\"2021-07-01T00:00:00.000Z\" , 4) values( \"2021-07-01T00:00:00.000Z\" , 4 , 4.0 ) ")
case4 = (tdSql.getResult("select * from tb4"))
print(case4)
if case4 == [(datetime.datetime(2021, 7, 1, 8, 0), 4, 4.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01T00:00:00.000Z'! ")
tdSql.execute(" insert into tb5 using st tags (\"2021-07-01 00:00:00.000+07:50\" , 5) values( \"2021-07-01 00:00:00.000+07:50\" , 5 , 5.0 ) ")
case5 = (tdSql.getResult("select * from tb5"))
print(case5)
if case5 == [(datetime.datetime(2021, 7, 1, 0, 10), 5, 5.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01 00:00:00.000+08:00 ")
tdSql.execute(" insert into tb6 using st tags (\"2021-07-01 00:00:00.000Z\" , 6) values( \"2021-07-01 00:00:00.000Z\" , 6 , 6.0 ) ")
case6 = (tdSql.getResult("select * from tb6"))
print(case6)
if case6 == [(datetime.datetime(2021, 7, 1, 8, 0), 6, 6.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01 00:00:00.000Z'! ")
# ISO 8610 timestamp format , time days and hours must be split by "T"
tdSql.execute(" insert into tb7 using st tags (\"2021-07-01T00:00:00.000+0800\" , 7) values( \"2021-07-01T00:00:00.000+0800\" , 7 , 7.0 ) ")
case7 = (tdSql.getResult("select * from tb7"))
print(case7)
if case7 == [(datetime.datetime(2021, 7, 1, 0, 0), 7, 7.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01T00:00:00.000+0800'! ")
tdSql.execute(" insert into tb8 using st tags (\"2021-07-01T00:00:00.000+08\" , 8) values( \"2021-07-01T00:00:00.000+08\" , 8 , 8.0 ) ")
case8 = (tdSql.getResult("select * from tb8"))
print(case8)
if case8 == [(datetime.datetime(2021, 7, 1, 0, 0), 8, 8.0)]:
print ("check pass! ")
else:
print ("check failed about timestamp '2021-07-01T00:00:00.000+08'! ")
# Non-standard case for Timestamp
tdSql.execute(" insert into tb9 using st tags (\"2021-07-01 00:00:00.000+0800\" , 9) values( \"2021-07-01 00:00:00.000+0800\" , 9 , 9.0 ) ")
case9 = (tdSql.getResult("select * from tb9"))
print(case9)
tdSql.execute(" insert into tb10 using st tags (\"2021-07-0100:00:00.000\" , 10) values( \"2021-07-0100:00:00.000\" , 10 , 10.0 ) ")
case10 = (tdSql.getResult("select * from tb10"))
print(case10)
tdSql.execute(" insert into tb11 using st tags (\"2021-07-0100:00:00.000+0800\" , 11) values( \"2021-07-0100:00:00.000+0800\" , 11 , 11.0 ) ")
case11 = (tdSql.getResult("select * from tb11"))
print(case11)
tdSql.execute(" insert into tb12 using st tags (\"2021-07-0100:00:00.000+08:00\" , 12) values( \"2021-07-0100:00:00.000+08:00\" , 12 , 12.0 ) ")
case12 = (tdSql.getResult("select * from tb12"))
print(case12)
tdSql.execute(" insert into tb13 using st tags (\"2021-07-0100:00:00.000Z\" , 13) values( \"2021-07-0100:00:00.000Z\" , 13 , 13.0 ) ")
case13 = (tdSql.getResult("select * from tb13"))
print(case13)
tdSql.execute(" insert into tb14 using st tags (\"2021-07-0100:00:00.000Z\" , 14) values( \"2021-07-0100:00:00.000Z\" , 14 , 14.0 ) ")
case14 = (tdSql.getResult("select * from tb14"))
print(case14)
tdSql.execute(" insert into tb15 using st tags (\"2021-07-0100:00:00.000+08\" , 15) values( \"2021-07-0100:00:00.000+08\" , 15 , 15.0 ) ")
case15 = (tdSql.getResult("select * from tb15"))
print(case15)
tdSql.execute(" insert into tb16 using st tags (\"2021-07-0100:00:00.000+07:50\" , 16) values( \"2021-07-0100:00:00.000+07:50\" , 16 , 16.0 ) ")
case16 = (tdSql.getResult("select * from tb16"))
print(case16)
os.system("rm -rf *.py.sql")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
...@@ -16,6 +16,7 @@ from util.log import * ...@@ -16,6 +16,7 @@ from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
from datetime import timedelta
class TDTestCase: class TDTestCase:
def init(self, conn, logSql): def init(self, conn, logSql):
...@@ -36,15 +37,36 @@ class TDTestCase: ...@@ -36,15 +37,36 @@ class TDTestCase:
ret = tdSql.query('show dnodes') ret = tdSql.query('show dnodes')
ret = tdSql.execute('alter dnode "%s" debugFlag 135' % tdSql.getData(0,0)) dnodeId = tdSql.getData(0, 0);
tdLog.info('alter dnode "%s" debugFlag 135 -> ret: %d' % (tdSql.getData(0, 0), ret)) dnodeEndpoint = tdSql.getData(0, 1);
ret = tdSql.execute('alter dnode "%s" debugFlag 135' % dnodeId)
tdLog.info('alter dnode "%s" debugFlag 135 -> ret: %d' % (dnodeId, ret))
ret = tdSql.query('show mnodes') ret = tdSql.query('show mnodes')
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkData(0, 2, "master")
role_time = tdSql.getData(0, 3)
create_time = tdSql.getData(0, 4)
time_delta = timedelta(milliseconds=100)
if create_time-time_delta < role_time < create_time+time_delta:
tdLog.info("role_time {} and create_time {} expected within range".format(role_time, create_time))
else:
tdLog.exit("role_time {} and create_time {} not expected within range".format(role_time, create_time))
ret = tdSql.query('show vgroups') ret = tdSql.query('show vgroups')
tdSql.checkRows(0) tdSql.checkRows(0)
tdSql.execute('create stable st (ts timestamp, f int) tags(t int)')
tdSql.execute('create table ct1 using st tags(1)');
tdSql.execute('create table ct2 using st tags(2)');
ret = tdSql.query('show vnodes "{}"'.format(dnodeEndpoint))
tdSql.checkRows(1)
tdSql.checkData(0, 0, 2)
tdSql.checkData(0, 1, "master")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -29,6 +29,10 @@ python3 ./test.py -f insert/in_function.py ...@@ -29,6 +29,10 @@ python3 ./test.py -f insert/in_function.py
python3 ./test.py -f insert/modify_column.py python3 ./test.py -f insert/modify_column.py
python3 ./test.py -f insert/line_insert.py python3 ./test.py -f insert/line_insert.py
# timezone
python3 ./test.py -f TimeZone/TestCaseTimeZone.py
#table #table
python3 ./test.py -f table/alter_wal0.py python3 ./test.py -f table/alter_wal0.py
python3 ./test.py -f table/column_name.py python3 ./test.py -f table/column_name.py
......
...@@ -25,7 +25,7 @@ class TDTestCase: ...@@ -25,7 +25,7 @@ class TDTestCase:
def run(self): def run(self):
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(53, 1, 864000) tdSql.checkData(54, 1, 864000)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册