提交 aa063917 编写于 作者: H Haojun Liao

[td-2895] merge develop.

...@@ -16,6 +16,7 @@ SET(TD_GRANT FALSE) ...@@ -16,6 +16,7 @@ SET(TD_GRANT FALSE)
SET(TD_MQTT FALSE) SET(TD_MQTT FALSE)
SET(TD_TSDB_PLUGINS FALSE) SET(TD_TSDB_PLUGINS FALSE)
SET(TD_STORAGE FALSE) SET(TD_STORAGE FALSE)
SET(TD_TOPIC FALSE)
SET(TD_COVER FALSE) SET(TD_COVER FALSE)
SET(TD_MEM_CHECK FALSE) SET(TD_MEM_CHECK FALSE)
......
...@@ -25,6 +25,10 @@ IF (TD_STORAGE) ...@@ -25,6 +25,10 @@ IF (TD_STORAGE)
ADD_DEFINITIONS(-D_STORAGE) ADD_DEFINITIONS(-D_STORAGE)
ENDIF () ENDIF ()
IF (TD_TOPIC)
ADD_DEFINITIONS(-D_TOPIC)
ENDIF ()
IF (TD_GODLL) IF (TD_GODLL)
ADD_DEFINITIONS(-D_TD_GO_DLL_) ADD_DEFINITIONS(-D_TD_GO_DLL_)
ENDIF () ENDIF ()
......
...@@ -9,6 +9,14 @@ ELSEIF (${ACCOUNT} MATCHES "false") ...@@ -9,6 +9,14 @@ ELSEIF (${ACCOUNT} MATCHES "false")
MESSAGE(STATUS "Build without account plugins") MESSAGE(STATUS "Build without account plugins")
ENDIF () ENDIF ()
IF (${TOPIC} MATCHES "true")
SET(TD_TOPIC TRUE)
MESSAGE(STATUS "Build with topic plugins")
ELSEIF (${TOPIC} MATCHES "false")
SET(TD_TOPIC FALSE)
MESSAGE(STATUS "Build without topic plugins")
ENDIF ()
IF (${COVER} MATCHES "true") IF (${COVER} MATCHES "true")
SET(TD_COVER TRUE) SET(TD_COVER TRUE)
MESSAGE(STATUS "Build with test coverage") MESSAGE(STATUS "Build with test coverage")
......
...@@ -2426,7 +2426,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col ...@@ -2426,7 +2426,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
default: default:
return TSDB_CODE_TSC_INVALID_SQL; return TSDB_CODE_TSC_INVALID_SQL;
} }
...@@ -5538,6 +5538,8 @@ static void setCreateDBOption(SCreateDbMsg* pMsg, SCreateDbInfo* pCreateDb) { ...@@ -5538,6 +5538,8 @@ static void setCreateDBOption(SCreateDbMsg* pMsg, SCreateDbInfo* pCreateDb) {
pMsg->ignoreExist = pCreateDb->ignoreExists; pMsg->ignoreExist = pCreateDb->ignoreExists;
pMsg->update = pCreateDb->update; pMsg->update = pCreateDb->update;
pMsg->cacheLastRow = pCreateDb->cachelast; pMsg->cacheLastRow = pCreateDb->cachelast;
pMsg->dbType = pCreateDb->dbType;
pMsg->partitions = htons(pCreateDb->partitions);
} }
int32_t parseCreateDBOptions(SSqlCmd* pCmd, SCreateDbInfo* pCreateDbSql) { int32_t parseCreateDBOptions(SSqlCmd* pCmd, SCreateDbInfo* pCreateDbSql) {
...@@ -6168,6 +6170,15 @@ int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCreateDbMsg* pCreate) { ...@@ -6168,6 +6170,15 @@ int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCreateDbMsg* pCreate) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg);
} }
val = (int16_t)htons(pCreate->partitions);
if (val != -1 &&
(val < TSDB_MIN_DB_PARTITON_OPTION || val > TSDB_MAX_DB_PARTITON_OPTION)) {
snprintf(msg, tListLen(msg), "invalid topic option partition: %d valid range: [%d, %d]", val,
TSDB_MIN_DB_PARTITON_OPTION, TSDB_MAX_DB_PARTITON_OPTION);
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg);
}
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -1071,7 +1071,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1071,7 +1071,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t tscBuildCreateDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int32_t tscBuildCreateDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
pCmd->payloadLen = sizeof(SCreateDbMsg); pCmd->payloadLen = sizeof(SCreateDbMsg);
pCmd->msgType = TSDB_MSG_TYPE_CM_CREATE_DB;
pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_CM_CREATE_DB : TSDB_MSG_TYPE_CM_CREATE_TP;
SCreateDbMsg *pCreateDbMsg = (SCreateDbMsg *)pCmd->payload; SCreateDbMsg *pCreateDbMsg = (SCreateDbMsg *)pCmd->payload;
...@@ -1203,7 +1204,7 @@ int32_t tscBuildDropDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1203,7 +1204,7 @@ int32_t tscBuildDropDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pDropDbMsg->ignoreNotExists = pInfo->pMiscInfo->existsCheck ? 1 : 0; pDropDbMsg->ignoreNotExists = pInfo->pMiscInfo->existsCheck ? 1 : 0;
pCmd->msgType = TSDB_MSG_TYPE_CM_DROP_DB; pCmd->msgType = (pInfo->pMiscInfo->dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_CM_DROP_DB : TSDB_MSG_TYPE_CM_DROP_TP;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -1530,9 +1531,11 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) { ...@@ -1530,9 +1531,11 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
pCmd->payloadLen = sizeof(SAlterDbMsg); pCmd->payloadLen = sizeof(SAlterDbMsg);
pCmd->msgType = TSDB_MSG_TYPE_CM_ALTER_DB; pCmd->msgType = (pInfo->pMiscInfo->dbOpt.dbType == TSDB_DB_TYPE_DEFAULT) ? TSDB_MSG_TYPE_CM_ALTER_DB : TSDB_MSG_TYPE_CM_ALTER_TP;
SAlterDbMsg *pAlterDbMsg = (SAlterDbMsg* )pCmd->payload; SAlterDbMsg *pAlterDbMsg = (SAlterDbMsg* )pCmd->payload;
pAlterDbMsg->dbType = -1;
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0);
tNameExtractFullName(&pTableMetaInfo->name, pAlterDbMsg->db); tNameExtractFullName(&pTableMetaInfo->name, pAlterDbMsg->db);
......
...@@ -1944,7 +1944,11 @@ void tscFirstRoundRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) { ...@@ -1944,7 +1944,11 @@ void tscFirstRoundRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
// tag or group by column // tag or group by column
if (TSDB_COL_IS_TAG(pExpr->colInfo.flag) || pExpr->functionId == TSDB_FUNC_PRJ) { if (TSDB_COL_IS_TAG(pExpr->colInfo.flag) || pExpr->functionId == TSDB_FUNC_PRJ) {
memcpy(p + offset, row[i], length[i]); if (row[i] == NULL) {
setNull(p + offset, pExpr->resType, pExpr->resBytes);
} else {
memcpy(p + offset, row[i], length[i]);
}
offset += pExpr->resBytes; offset += pExpr->resBytes;
} }
} }
......
...@@ -95,6 +95,7 @@ extern int8_t tsCompression; ...@@ -95,6 +95,7 @@ extern int8_t tsCompression;
extern int8_t tsWAL; extern int8_t tsWAL;
extern int32_t tsFsyncPeriod; extern int32_t tsFsyncPeriod;
extern int32_t tsReplications; extern int32_t tsReplications;
extern int16_t tsPartitons;
extern int32_t tsQuorum; extern int32_t tsQuorum;
extern int8_t tsUpdate; extern int8_t tsUpdate;
extern int8_t tsCacheLastRow; extern int8_t tsCacheLastRow;
......
...@@ -126,8 +126,9 @@ int8_t tsWAL = TSDB_DEFAULT_WAL_LEVEL; ...@@ -126,8 +126,9 @@ int8_t tsWAL = TSDB_DEFAULT_WAL_LEVEL;
int32_t tsFsyncPeriod = TSDB_DEFAULT_FSYNC_PERIOD; int32_t tsFsyncPeriod = TSDB_DEFAULT_FSYNC_PERIOD;
int32_t tsReplications = TSDB_DEFAULT_DB_REPLICA_OPTION; int32_t tsReplications = TSDB_DEFAULT_DB_REPLICA_OPTION;
int32_t tsQuorum = TSDB_DEFAULT_DB_QUORUM_OPTION; int32_t tsQuorum = TSDB_DEFAULT_DB_QUORUM_OPTION;
int16_t tsPartitons = TSDB_DEFAULT_DB_PARTITON_OPTION;
int8_t tsUpdate = TSDB_DEFAULT_DB_UPDATE_OPTION; int8_t tsUpdate = TSDB_DEFAULT_DB_UPDATE_OPTION;
int8_t tsCacheLastRow = TSDB_DEFAULT_CACHE_BLOCK_SIZE; int8_t tsCacheLastRow = TSDB_DEFAULT_CACHE_LAST_ROW;
int32_t tsMaxVgroupsPerDb = 0; int32_t tsMaxVgroupsPerDb = 0;
int32_t tsMinTablePerVnode = TSDB_TABLES_STEP; int32_t tsMinTablePerVnode = TSDB_TABLES_STEP;
int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES; int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES;
...@@ -853,6 +854,16 @@ static void doInitGlobalConfig(void) { ...@@ -853,6 +854,16 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE; cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
cfg.option = "partitions";
cfg.ptr = &tsPartitons;
cfg.valType = TAOS_CFG_VTYPE_INT16;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = TSDB_MIN_DB_PARTITON_OPTION;
cfg.maxValue = TSDB_MAX_DB_PARTITON_OPTION;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
cfg.option = "quorum"; cfg.option = "quorum";
cfg.ptr = &tsQuorum; cfg.ptr = &tsQuorum;
cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.valType = TAOS_CFG_VTYPE_INT32;
......
package com.taosdata.jdbc; package com.taosdata.jdbc;
import java.io.*;
import java.sql.Driver; import java.sql.Driver;
import java.sql.DriverPropertyInfo; import java.sql.DriverPropertyInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
public abstract class AbstractDriver implements Driver { public abstract class AbstractDriver implements Driver {
private static final String TAOS_CFG_FILENAME = "taos.cfg";
/**
* @param cfgDirPath
* @return return the config dir
**/
protected File loadConfigDir(String cfgDirPath) {
if (cfgDirPath == null)
return loadDefaultConfigDir();
File cfgDir = new File(cfgDirPath);
if (!cfgDir.exists())
return loadDefaultConfigDir();
return cfgDir;
}
/**
* @return search the default config dir, if the config dir is not exist will return null
*/
protected File loadDefaultConfigDir() {
File cfgDir;
File cfgDir_linux = new File("/etc/taos");
cfgDir = cfgDir_linux.exists() ? cfgDir_linux : null;
File cfgDir_windows = new File("C:\\TDengine\\cfg");
cfgDir = (cfgDir == null && cfgDir_windows.exists()) ? cfgDir_windows : cfgDir;
return cfgDir;
}
protected List<String> loadConfigEndpoints(File cfgFile) {
List<String> endpoints = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(cfgFile))) {
String line = null;
while ((line = reader.readLine()) != null) {
if (line.trim().startsWith("firstEp") || line.trim().startsWith("secondEp")) {
endpoints.add(line.substring(line.indexOf('p') + 1).trim());
}
if (endpoints.size() > 1)
break;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return endpoints;
}
protected void loadTaosConfig(Properties info) {
if ((info.getProperty(TSDBDriver.PROPERTY_KEY_HOST) == null || info.getProperty(TSDBDriver.PROPERTY_KEY_HOST).isEmpty()) && (
info.getProperty(TSDBDriver.PROPERTY_KEY_PORT) == null || info.getProperty(TSDBDriver.PROPERTY_KEY_PORT).isEmpty())) {
File cfgDir = loadConfigDir(info.getProperty(TSDBDriver.PROPERTY_KEY_CONFIG_DIR));
File cfgFile = cfgDir.listFiles((dir, name) -> TAOS_CFG_FILENAME.equalsIgnoreCase(name))[0];
List<String> endpoints = loadConfigEndpoints(cfgFile);
if (!endpoints.isEmpty()) {
info.setProperty(TSDBDriver.PROPERTY_KEY_HOST, endpoints.get(0).split(":")[0]);
info.setProperty(TSDBDriver.PROPERTY_KEY_PORT, endpoints.get(0).split(":")[1]);
}
}
}
protected DriverPropertyInfo[] getPropertyInfo(Properties info) { protected DriverPropertyInfo[] getPropertyInfo(Properties info) {
DriverPropertyInfo hostProp = new DriverPropertyInfo(TSDBDriver.PROPERTY_KEY_HOST, info.getProperty(TSDBDriver.PROPERTY_KEY_HOST)); DriverPropertyInfo hostProp = new DriverPropertyInfo(TSDBDriver.PROPERTY_KEY_HOST, info.getProperty(TSDBDriver.PROPERTY_KEY_HOST));
hostProp.required = false; hostProp.required = false;
...@@ -154,6 +92,4 @@ public abstract class AbstractDriver implements Driver { ...@@ -154,6 +92,4 @@ public abstract class AbstractDriver implements Driver {
return urlProps; return urlProps;
} }
} }
...@@ -52,4 +52,14 @@ public class ColumnMetaData { ...@@ -52,4 +52,14 @@ public class ColumnMetaData {
public void setColIndex(int colIndex) { public void setColIndex(int colIndex) {
this.colIndex = colIndex; this.colIndex = colIndex;
} }
@Override
public String toString() {
return "ColumnMetaData{" +
"colType=" + colType +
", colName='" + colName + '\'' +
", colSize=" + colSize +
", colIndex=" + colIndex +
'}';
}
} }
...@@ -87,11 +87,10 @@ public class TSDBConnection extends AbstractConnection { ...@@ -87,11 +87,10 @@ public class TSDBConnection extends AbstractConnection {
} }
public void close() throws SQLException { public void close() throws SQLException {
if (isClosed()) { if (isClosed)
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_CONNECTION_CLOSED); return;
}
this.isClosed = true;
this.connector.closeConnection(); this.connector.closeConnection();
this.isClosed = true;
} }
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
......
...@@ -112,8 +112,6 @@ public class TSDBDriver extends AbstractDriver { ...@@ -112,8 +112,6 @@ public class TSDBDriver extends AbstractDriver {
if ((props = parseURL(url, info)) == null) { if ((props = parseURL(url, info)) == null) {
return null; return null;
} }
//load taos.cfg start
loadTaosConfig(info);
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),
......
/*************************************************************************** /**
* *************************************************************************
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com> * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
* *
* This program is free software: you can use, redistribute, and/or modify * This program is free software: you can use, redistribute, and/or modify
...@@ -11,7 +12,7 @@ ...@@ -11,7 +12,7 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ **************************************************************************** */
package com.taosdata.jdbc; package com.taosdata.jdbc;
import com.taosdata.jdbc.utils.TaosInfo; import com.taosdata.jdbc.utils.TaosInfo;
...@@ -20,6 +21,9 @@ import java.sql.SQLException; ...@@ -20,6 +21,9 @@ import java.sql.SQLException;
import java.sql.SQLWarning; import java.sql.SQLWarning;
import java.util.List; import java.util.List;
/**
* JNI connector
* */
public class TSDBJNIConnector { public class TSDBJNIConnector {
private static volatile Boolean isInitialized = false; private static volatile Boolean isInitialized = false;
......
...@@ -20,18 +20,16 @@ import java.util.ArrayList; ...@@ -20,18 +20,16 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class TSDBResultSet extends AbstractResultSet implements ResultSet { public class TSDBResultSet extends AbstractResultSet implements ResultSet {
private TSDBJNIConnector jniConnector; private final TSDBJNIConnector jniConnector;
private final TSDBStatement statement; private final TSDBStatement statement;
private long resultSetPointer = 0L; private final long resultSetPointer;
private List<ColumnMetaData> columnMetaDataList = new ArrayList<>(); private List<ColumnMetaData> columnMetaDataList = new ArrayList<>();
private final TSDBResultSetRowData rowData;
private TSDBResultSetRowData rowData; private final TSDBResultSetBlockData blockData;
private TSDBResultSetBlockData blockData;
private boolean batchFetch = false; private boolean batchFetch = false;
private boolean lastWasNull = false; private boolean lastWasNull = false;
private final int COLUMN_INDEX_START_VALUE = 1; private boolean isClosed;
public void setBatchFetch(boolean batchFetch) { public void setBatchFetch(boolean batchFetch) {
this.batchFetch = batchFetch; this.batchFetch = batchFetch;
...@@ -56,13 +54,13 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -56,13 +54,13 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
int code = this.jniConnector.getSchemaMetaData(this.resultSetPointer, this.columnMetaDataList); int code = this.jniConnector.getSchemaMetaData(this.resultSetPointer, this.columnMetaDataList);
if (code == TSDBConstants.JNI_CONNECTION_NULL) { if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} }
if (code == TSDBConstants.JNI_RESULT_SET_NULL) { if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_RESULT_SET_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
} }
if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) { if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_NUM_OF_FIELDS_0)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_NUM_OF_FIELDS_0);
} }
this.rowData = new TSDBResultSetRowData(this.columnMetaDataList.size()); this.rowData = new TSDBResultSetRowData(this.columnMetaDataList.size());
this.blockData = new TSDBResultSetBlockData(this.columnMetaDataList, this.columnMetaDataList.size()); this.blockData = new TSDBResultSetBlockData(this.columnMetaDataList, this.columnMetaDataList.size());
...@@ -78,16 +76,12 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -78,16 +76,12 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
this.blockData.reset(); this.blockData.reset();
if (code == TSDBConstants.JNI_CONNECTION_NULL) { if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} else if (code == TSDBConstants.JNI_RESULT_SET_NULL) { } else if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_RESULT_SET_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
} else if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) { } else if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_NUM_OF_FIELDS_0)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_NUM_OF_FIELDS_0);
} else if (code == TSDBConstants.JNI_FETCH_END) { } else return code != TSDBConstants.JNI_FETCH_END;
return false;
}
return true;
} else { } else {
if (rowData != null) { if (rowData != null) {
this.rowData.clear(); this.rowData.clear();
...@@ -95,11 +89,11 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -95,11 +89,11 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
int code = this.jniConnector.fetchRow(this.resultSetPointer, this.rowData); int code = this.jniConnector.fetchRow(this.resultSetPointer, this.rowData);
if (code == TSDBConstants.JNI_CONNECTION_NULL) { if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} else if (code == TSDBConstants.JNI_RESULT_SET_NULL) { } else if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_RESULT_SET_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
} else if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) { } else if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_NUM_OF_FIELDS_0)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_NUM_OF_FIELDS_0);
} else if (code == TSDBConstants.JNI_FETCH_END) { } else if (code == TSDBConstants.JNI_FETCH_END) {
return false; return false;
} else { } else {
...@@ -109,14 +103,17 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -109,14 +103,17 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
} }
public void close() throws SQLException { public void close() throws SQLException {
if (isClosed)
return;
if (this.jniConnector != null) { if (this.jniConnector != null) {
int code = this.jniConnector.freeResultSet(this.resultSetPointer); int code = this.jniConnector.freeResultSet(this.resultSetPointer);
if (code == TSDBConstants.JNI_CONNECTION_NULL) { if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} else if (code == TSDBConstants.JNI_RESULT_SET_NULL) { } else if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_RESULT_SET_NULL)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
} }
} }
isClosed = true;
} }
public boolean wasNull() throws SQLException { public boolean wasNull() throws SQLException {
...@@ -415,8 +412,8 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -415,8 +412,8 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
} }
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
//TODO: check if need release resources if (isClosed)
boolean isClosed = true; return true;
if (jniConnector != null) { if (jniConnector != null) {
isClosed = jniConnector.isResultsetClosed(); isClosed = jniConnector.isResultsetClosed();
} }
...@@ -429,14 +426,12 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -429,14 +426,12 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
} }
private int getTrueColumnIndex(int columnIndex) throws SQLException { private int getTrueColumnIndex(int columnIndex) throws SQLException {
if (columnIndex < this.COLUMN_INDEX_START_VALUE) { if (columnIndex < 1)
throw new SQLException("Column Index out of range, " + columnIndex + " < " + this.COLUMN_INDEX_START_VALUE); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_RANGE, "columnIndex(" + columnIndex + "): < 1");
}
int numOfCols = this.columnMetaDataList.size(); int numOfCols = this.columnMetaDataList.size();
if (columnIndex > numOfCols) { if (columnIndex > numOfCols)
throw new SQLException("Column Index out of range, " + columnIndex + " > " + numOfCols); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_RANGE, "columnIndex: " + columnIndex);
}
return columnIndex - 1; return columnIndex - 1;
} }
} }
...@@ -73,11 +73,11 @@ public class TSDBStatement extends AbstractStatement { ...@@ -73,11 +73,11 @@ public class TSDBStatement extends AbstractStatement {
} }
public void close() throws SQLException { public void close() throws SQLException {
if (!isClosed) { if (isClosed)
if (this.resultSet != null) return;
this.resultSet.close(); if (this.resultSet != null && !this.resultSet.isClosed())
isClosed = true; this.resultSet.close();
} isClosed = true;
} }
public boolean execute(String sql) throws SQLException { public boolean execute(String sql) throws SQLException {
......
...@@ -7,24 +7,26 @@ import java.sql.SQLWarning; ...@@ -7,24 +7,26 @@ import java.sql.SQLWarning;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.junit.Assert.*;
public class TSDBJNIConnectorTest { public class TSDBJNIConnectorTest {
public static void main(String[] args) { private static TSDBResultSetRowData rowData;
@Test
public void test() {
try { try {
TSDBJNIConnector.init("/etc/taos/taos.cfg", "en_US.UTF-8", "", ""); // init
TSDBJNIConnector.init(null, null, null, null);
// connect
TSDBJNIConnector connector = new TSDBJNIConnector(); TSDBJNIConnector connector = new TSDBJNIConnector();
connector.connect("127.0.0.1", 6030, "test", "root", "taosdata"); connector.connect("127.0.0.1", 6030, null, "root", "taosdata");
long pSql = connector.executeQuery("show dnodes"); // executeQuery
// if pSql is create/insert/update/delete/alter SQL long pSql = connector.executeQuery("show variables");
if (connector.isUpdateQuery(pSql)) { if (connector.isUpdateQuery(pSql)) {
connector.freeResultSet(pSql); connector.freeResultSet(pSql);
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_WITH_EXECUTEQUERY); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_WITH_EXECUTEQUERY);
} }
// get schema
List<ColumnMetaData> columnMetaDataList = new ArrayList<>(); List<ColumnMetaData> columnMetaDataList = new ArrayList<>();
int code = connector.getSchemaMetaData(pSql, columnMetaDataList); int code = connector.getSchemaMetaData(pSql, columnMetaDataList);
if (code == TSDBConstants.JNI_CONNECTION_NULL) { if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL));
...@@ -35,6 +37,29 @@ public class TSDBJNIConnectorTest { ...@@ -35,6 +37,29 @@ public class TSDBJNIConnectorTest {
if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) { if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_NUM_OF_FIELDS_0)); throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_NUM_OF_FIELDS_0));
} }
int columnSize = columnMetaDataList.size();
// print metadata
for (int i = 0; i < columnSize; i++) {
System.out.println(columnMetaDataList.get(i));
}
rowData = new TSDBResultSetRowData(columnSize);
// iterate resultSet
for (int i = 0; next(connector, pSql); i++) {
System.out.println("col[" + i + "] size: " + rowData.getColSize());
rowData.getData().stream().forEach(col -> System.out.print(col + "\t"));
System.out.println();
}
// close resultSet
code = connector.freeResultSet(pSql);
if (code == TSDBConstants.JNI_CONNECTION_NULL) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} else if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
}
// close statement
// close connection
connector.closeConnection();
} catch (SQLWarning throwables) { } catch (SQLWarning throwables) {
throwables.printStackTrace(); throwables.printStackTrace();
...@@ -43,88 +68,22 @@ public class TSDBJNIConnectorTest { ...@@ -43,88 +68,22 @@ public class TSDBJNIConnectorTest {
} }
} }
private static boolean next(TSDBJNIConnector connector, long pSql) throws SQLException {
@Test if (rowData != null)
public void isClosed() { rowData.clear();
}
int code = connector.fetchRow(pSql, rowData);
@Test if (code == TSDBConstants.JNI_CONNECTION_NULL) {
public void isResultsetClosed() { throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_CONNECTION_NULL);
} } else if (code == TSDBConstants.JNI_RESULT_SET_NULL) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_RESULT_SET_NULL);
@Test } else if (code == TSDBConstants.JNI_NUM_OF_FIELDS_0) {
public void init() { throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_JNI_NUM_OF_FIELDS_0);
} } else if (code == TSDBConstants.JNI_FETCH_END) {
return false;
@Test } else {
public void initImp() { return true;
} }
@Test
public void setOptions() {
}
@Test
public void getTsCharset() {
}
@Test
public void connect() {
}
@Test
public void executeQuery() {
}
@Test
public void getErrCode() {
}
@Test
public void getErrMsg() {
}
@Test
public void isUpdateQuery() {
}
@Test
public void freeResultSet() {
}
@Test
public void getAffectedRows() {
}
@Test
public void getSchemaMetaData() {
}
@Test
public void fetchRow() {
}
@Test
public void fetchBlock() {
}
@Test
public void closeConnection() {
}
@Test
public void subscribe() {
}
@Test
public void consume() {
}
@Test
public void unsubscribe() {
} }
@Test
public void validateCreateTableSql() {
}
} }
\ No newline at end of file
...@@ -31,6 +31,10 @@ IF (TD_MQTT) ...@@ -31,6 +31,10 @@ IF (TD_MQTT)
TARGET_LINK_LIBRARIES(taosd mqtt) TARGET_LINK_LIBRARIES(taosd mqtt)
ENDIF () ENDIF ()
IF (TD_TOPIC)
TARGET_LINK_LIBRARIES(taosd topic)
ENDIF ()
SET(PREPARE_ENV_CMD "prepare_env_cmd") SET(PREPARE_ENV_CMD "prepare_env_cmd")
SET(PREPARE_ENV_TARGET "prepare_env_target") SET(PREPARE_ENV_TARGET "prepare_env_target")
ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD} ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD}
......
...@@ -146,10 +146,10 @@ void dnodeSendRpcMWriteRsp(void *pMsg, int32_t code) { ...@@ -146,10 +146,10 @@ void dnodeSendRpcMWriteRsp(void *pMsg, int32_t code) {
} }
dTrace("msg:%p, app:%p type:%s master:%p will be responsed", pWrite, pWrite->rpcMsg.ahandle, dTrace("msg:%p, app:%p type:%s master:%p will be responsed", pWrite, pWrite->rpcMsg.ahandle,
taosMsg[pWrite->rpcMsg.msgType], pWrite->pBatchMasterMsg); taosMsg[pWrite->rpcMsg.msgType], pWrite->pBatchMasterMsg);
if (pWrite->pBatchMasterMsg && pWrite != pWrite->pBatchMasterMsg) { if (pWrite->pBatchMasterMsg && pWrite != pWrite->pBatchMasterMsg) {
dError("msg:%p, app:%p type:%s master:%p sub message should not response!", pWrite, pWrite->rpcMsg.ahandle, dError("msg:%p, app:%p type:%s master:%p sub message should not response!", pWrite, pWrite->rpcMsg.ahandle,
taosMsg[pWrite->rpcMsg.msgType], pWrite->pBatchMasterMsg); taosMsg[pWrite->rpcMsg.msgType], pWrite->pBatchMasterMsg);
return; return;
} }
......
...@@ -189,6 +189,11 @@ static void dnodeCheckDataDirOpenned(char *dir) { ...@@ -189,6 +189,11 @@ static void dnodeCheckDataDirOpenned(char *dir) {
} }
static int32_t dnodeInitStorage() { static int32_t dnodeInitStorage() {
if (tsDiskCfgNum == 1 && dnodeCreateDir(tsDataDir) < 0) {
dError("failed to create dir: %s, reason: %s", tsDataDir, strerror(errno));
return -1;
}
if (tfsInit(tsDiskCfg, tsDiskCfgNum) < 0) { if (tfsInit(tsDiskCfg, tsDiskCfgNum) < 0) {
dError("failed to init TFS since %s", tstrerror(terrno)); dError("failed to init TFS since %s", tstrerror(terrno));
return -1; return -1;
......
...@@ -47,8 +47,11 @@ int32_t dnodeInitShell() { ...@@ -47,8 +47,11 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DNODE]= dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DNODE]= dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DNODE] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DNODE] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DB] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DB] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_TP] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DB] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DB] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_TP] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_DB] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_DB] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_TP] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_TABLE]= dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_TABLE]= dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_TABLE] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_TABLE] = dnodeDispatchToMWriteQueue;
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_TABLE] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_TABLE] = dnodeDispatchToMWriteQueue;
......
...@@ -222,6 +222,9 @@ do { \ ...@@ -222,6 +222,9 @@ do { \
#define TSDB_MQTT_TOPIC_LEN 64 #define TSDB_MQTT_TOPIC_LEN 64
#define TSDB_MQTT_CLIENT_ID_LEN 32 #define TSDB_MQTT_CLIENT_ID_LEN 32
#define TSDB_DB_TYPE_DEFAULT 0
#define TSDB_DB_TYPE_TOPIC 1
#define TSDB_DEFAULT_PKT_SIZE 65480 //same as RPC_MAX_UDP_SIZE #define TSDB_DEFAULT_PKT_SIZE 65480 //same as RPC_MAX_UDP_SIZE
#define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE #define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE
...@@ -306,6 +309,10 @@ do { \ ...@@ -306,6 +309,10 @@ do { \
#define TSDB_MAX_DB_REPLICA_OPTION 3 #define TSDB_MAX_DB_REPLICA_OPTION 3
#define TSDB_DEFAULT_DB_REPLICA_OPTION 1 #define TSDB_DEFAULT_DB_REPLICA_OPTION 1
#define TSDB_MIN_DB_PARTITON_OPTION 0
#define TSDB_MAX_DB_PARTITON_OPTION 1000
#define TSDB_DEFAULT_DB_PARTITON_OPTION 4
#define TSDB_MIN_DB_QUORUM_OPTION 1 #define TSDB_MIN_DB_QUORUM_OPTION 1
#define TSDB_MAX_DB_QUORUM_OPTION 2 #define TSDB_MAX_DB_QUORUM_OPTION 2
#define TSDB_DEFAULT_DB_QUORUM_OPTION 1 #define TSDB_DEFAULT_DB_QUORUM_OPTION 1
......
...@@ -185,6 +185,9 @@ int32_t* taosGetErrno(); ...@@ -185,6 +185,9 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_INVALID_DB_OPTION_DAYS TAOS_DEF_ERROR_CODE(0, 0x0390) //"Invalid database option: days out of range") #define TSDB_CODE_MND_INVALID_DB_OPTION_DAYS TAOS_DEF_ERROR_CODE(0, 0x0390) //"Invalid database option: days out of range")
#define TSDB_CODE_MND_INVALID_DB_OPTION_KEEP TAOS_DEF_ERROR_CODE(0, 0x0391) //"Invalid database option: keep >= keep1 >= keep0 >= days") #define TSDB_CODE_MND_INVALID_DB_OPTION_KEEP TAOS_DEF_ERROR_CODE(0, 0x0391) //"Invalid database option: keep >= keep1 >= keep0 >= days")
#define TSDB_CODE_MND_INVALID_TOPIC TAOS_DEF_ERROR_CODE(0, 0x0392) //"Invalid topic name)
#define TSDB_CODE_MND_INVALID_TOPIC_OPTION TAOS_DEF_ERROR_CODE(0, 0x0393) //"Invalid topic option)
// dnode // dnode
#define TSDB_CODE_DND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0400) //"Message not processed") #define TSDB_CODE_DND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0400) //"Message not processed")
#define TSDB_CODE_DND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0401) //"Dnode out of memory") #define TSDB_CODE_DND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0401) //"Dnode out of memory")
......
...@@ -107,6 +107,12 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY13, "dummy13" ) ...@@ -107,6 +107,12 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY13, "dummy13" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_NETWORK_TEST, "nettest" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_NETWORK_TEST, "nettest" )
// message for topic
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TP, "create-tp" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TP, "drop-tp" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_TP, "use-tp" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TP, "alter-tp" )
#ifndef TAOS_MESSAGE_C #ifndef TAOS_MESSAGE_C
TSDB_MSG_TYPE_MAX // 105 TSDB_MSG_TYPE_MAX // 105
#endif #endif
...@@ -141,6 +147,7 @@ enum _mgmt_table { ...@@ -141,6 +147,7 @@ enum _mgmt_table {
TSDB_MGMT_TABLE_VNODES, TSDB_MGMT_TABLE_VNODES,
TSDB_MGMT_TABLE_STREAMTABLES, TSDB_MGMT_TABLE_STREAMTABLES,
TSDB_MGMT_TABLE_CLUSTER, TSDB_MGMT_TABLE_CLUSTER,
TSDB_MGMT_TABLE_TP,
TSDB_MGMT_TABLE_MAX, TSDB_MGMT_TABLE_MAX,
}; };
...@@ -558,7 +565,9 @@ typedef struct { ...@@ -558,7 +565,9 @@ typedef struct {
int8_t ignoreExist; int8_t ignoreExist;
int8_t update; int8_t update;
int8_t cacheLastRow; int8_t cacheLastRow;
int8_t reserve[8]; int8_t dbType;
int16_t partitions;
int8_t reserve[5];
} SCreateDbMsg, SAlterDbMsg; } SCreateDbMsg, SAlterDbMsg;
typedef struct { typedef struct {
...@@ -677,7 +686,8 @@ typedef struct { ...@@ -677,7 +686,8 @@ typedef struct {
int8_t cacheLastRow; int8_t cacheLastRow;
int32_t vgCfgVersion; int32_t vgCfgVersion;
int8_t dbReplica; int8_t dbReplica;
int8_t reserved[9]; int8_t dbType;
int8_t reserved[8];
} SVnodeCfg; } SVnodeCfg;
typedef struct { typedef struct {
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_TP
#define TDENGINE_TP
#ifdef __cplusplus
extern "C" {
#endif
int32_t tpInit();
void tpCleanUp();
void tpUpdateTs(int32_t *seq, void *pMsg);
#ifdef __cplusplus
}
#endif
#endif
...@@ -62,144 +62,147 @@ ...@@ -62,144 +62,147 @@
#define TK_BITNOT 43 #define TK_BITNOT 43
#define TK_SHOW 44 #define TK_SHOW 44
#define TK_DATABASES 45 #define TK_DATABASES 45
#define TK_MNODES 46 #define TK_TOPICS 46
#define TK_DNODES 47 #define TK_MNODES 47
#define TK_ACCOUNTS 48 #define TK_DNODES 48
#define TK_USERS 49 #define TK_ACCOUNTS 49
#define TK_MODULES 50 #define TK_USERS 50
#define TK_QUERIES 51 #define TK_MODULES 51
#define TK_CONNECTIONS 52 #define TK_QUERIES 52
#define TK_STREAMS 53 #define TK_CONNECTIONS 53
#define TK_VARIABLES 54 #define TK_STREAMS 54
#define TK_SCORES 55 #define TK_VARIABLES 55
#define TK_GRANTS 56 #define TK_SCORES 56
#define TK_VNODES 57 #define TK_GRANTS 57
#define TK_IPTOKEN 58 #define TK_VNODES 58
#define TK_DOT 59 #define TK_IPTOKEN 59
#define TK_CREATE 60 #define TK_DOT 60
#define TK_TABLE 61 #define TK_CREATE 61
#define TK_DATABASE 62 #define TK_TABLE 62
#define TK_TABLES 63 #define TK_DATABASE 63
#define TK_STABLES 64 #define TK_TABLES 64
#define TK_VGROUPS 65 #define TK_STABLES 65
#define TK_DROP 66 #define TK_VGROUPS 66
#define TK_STABLE 67 #define TK_DROP 67
#define TK_DNODE 68 #define TK_STABLE 68
#define TK_USER 69 #define TK_TOPIC 69
#define TK_ACCOUNT 70 #define TK_DNODE 70
#define TK_USE 71 #define TK_USER 71
#define TK_DESCRIBE 72 #define TK_ACCOUNT 72
#define TK_ALTER 73 #define TK_USE 73
#define TK_PASS 74 #define TK_DESCRIBE 74
#define TK_PRIVILEGE 75 #define TK_ALTER 75
#define TK_LOCAL 76 #define TK_PASS 76
#define TK_IF 77 #define TK_PRIVILEGE 77
#define TK_EXISTS 78 #define TK_LOCAL 78
#define TK_PPS 79 #define TK_IF 79
#define TK_TSERIES 80 #define TK_EXISTS 80
#define TK_DBS 81 #define TK_PPS 81
#define TK_STORAGE 82 #define TK_TSERIES 82
#define TK_QTIME 83 #define TK_DBS 83
#define TK_CONNS 84 #define TK_STORAGE 84
#define TK_STATE 85 #define TK_QTIME 85
#define TK_KEEP 86 #define TK_CONNS 86
#define TK_CACHE 87 #define TK_STATE 87
#define TK_REPLICA 88 #define TK_KEEP 88
#define TK_QUORUM 89 #define TK_CACHE 89
#define TK_DAYS 90 #define TK_REPLICA 90
#define TK_MINROWS 91 #define TK_QUORUM 91
#define TK_MAXROWS 92 #define TK_DAYS 92
#define TK_BLOCKS 93 #define TK_MINROWS 93
#define TK_CTIME 94 #define TK_MAXROWS 94
#define TK_WAL 95 #define TK_BLOCKS 95
#define TK_FSYNC 96 #define TK_CTIME 96
#define TK_COMP 97 #define TK_WAL 97
#define TK_PRECISION 98 #define TK_FSYNC 98
#define TK_UPDATE 99 #define TK_COMP 99
#define TK_CACHELAST 100 #define TK_PRECISION 100
#define TK_LP 101 #define TK_UPDATE 101
#define TK_RP 102 #define TK_CACHELAST 102
#define TK_UNSIGNED 103 #define TK_PARTITIONS 103
#define TK_TAGS 104 #define TK_LP 104
#define TK_USING 105 #define TK_RP 105
#define TK_COMMA 106 #define TK_UNSIGNED 106
#define TK_AS 107 #define TK_TAGS 107
#define TK_NULL 108 #define TK_USING 108
#define TK_SELECT 109 #define TK_COMMA 109
#define TK_UNION 110 #define TK_AS 110
#define TK_ALL 111 #define TK_NULL 111
#define TK_DISTINCT 112 #define TK_SELECT 112
#define TK_FROM 113 #define TK_UNION 113
#define TK_VARIABLE 114 #define TK_ALL 114
#define TK_INTERVAL 115 #define TK_DISTINCT 115
#define TK_FILL 116 #define TK_FROM 116
#define TK_SLIDING 117 #define TK_VARIABLE 117
#define TK_ORDER 118 #define TK_INTERVAL 118
#define TK_BY 119 #define TK_FILL 119
#define TK_ASC 120 #define TK_SLIDING 120
#define TK_DESC 121 #define TK_ORDER 121
#define TK_GROUP 122 #define TK_BY 122
#define TK_HAVING 123 #define TK_ASC 123
#define TK_LIMIT 124 #define TK_DESC 124
#define TK_OFFSET 125 #define TK_GROUP 125
#define TK_SLIMIT 126 #define TK_HAVING 126
#define TK_SOFFSET 127 #define TK_LIMIT 127
#define TK_WHERE 128 #define TK_OFFSET 128
#define TK_NOW 129 #define TK_SLIMIT 129
#define TK_RESET 130 #define TK_SOFFSET 130
#define TK_QUERY 131 #define TK_WHERE 131
#define TK_ADD 132 #define TK_NOW 132
#define TK_COLUMN 133 #define TK_RESET 133
#define TK_TAG 134 #define TK_QUERY 134
#define TK_CHANGE 135 #define TK_ADD 135
#define TK_SET 136 #define TK_COLUMN 136
#define TK_KILL 137 #define TK_TAG 137
#define TK_CONNECTION 138 #define TK_CHANGE 138
#define TK_STREAM 139 #define TK_SET 139
#define TK_COLON 140 #define TK_KILL 140
#define TK_ABORT 141 #define TK_CONNECTION 141
#define TK_AFTER 142 #define TK_STREAM 142
#define TK_ATTACH 143 #define TK_COLON 143
#define TK_BEFORE 144 #define TK_ABORT 144
#define TK_BEGIN 145 #define TK_AFTER 145
#define TK_CASCADE 146 #define TK_ATTACH 146
#define TK_CLUSTER 147 #define TK_BEFORE 147
#define TK_CONFLICT 148 #define TK_BEGIN 148
#define TK_COPY 149 #define TK_CASCADE 149
#define TK_DEFERRED 150 #define TK_CLUSTER 150
#define TK_DELIMITERS 151 #define TK_CONFLICT 151
#define TK_DETACH 152 #define TK_COPY 152
#define TK_EACH 153 #define TK_DEFERRED 153
#define TK_END 154 #define TK_DELIMITERS 154
#define TK_EXPLAIN 155 #define TK_DETACH 155
#define TK_FAIL 156 #define TK_EACH 156
#define TK_FOR 157 #define TK_END 157
#define TK_IGNORE 158 #define TK_EXPLAIN 158
#define TK_IMMEDIATE 159 #define TK_FAIL 159
#define TK_INITIALLY 160 #define TK_FOR 160
#define TK_INSTEAD 161 #define TK_IGNORE 161
#define TK_MATCH 162 #define TK_IMMEDIATE 162
#define TK_KEY 163 #define TK_INITIALLY 163
#define TK_OF 164 #define TK_INSTEAD 164
#define TK_RAISE 165 #define TK_MATCH 165
#define TK_REPLACE 166 #define TK_KEY 166
#define TK_RESTRICT 167 #define TK_OF 167
#define TK_ROW 168 #define TK_RAISE 168
#define TK_STATEMENT 169 #define TK_REPLACE 169
#define TK_TRIGGER 170 #define TK_RESTRICT 170
#define TK_VIEW 171 #define TK_ROW 171
#define TK_SEMI 172 #define TK_STATEMENT 172
#define TK_NONE 173 #define TK_TRIGGER 173
#define TK_PREV 174 #define TK_VIEW 174
#define TK_LINEAR 175 #define TK_SEMI 175
#define TK_IMPORT 176 #define TK_NONE 176
#define TK_METRIC 177 #define TK_PREV 177
#define TK_TBNAME 178 #define TK_LINEAR 178
#define TK_JOIN 179 #define TK_IMPORT 179
#define TK_METRICS 180 #define TK_METRIC 180
#define TK_INSERT 181 #define TK_TBNAME 181
#define TK_INTO 182 #define TK_JOIN 182
#define TK_VALUES 183 #define TK_METRICS 183
#define TK_INSERT 184
#define TK_INTO 185
#define TK_VALUES 186
#define TK_SPACE 300 #define TK_SPACE 300
...@@ -210,7 +213,6 @@ ...@@ -210,7 +213,6 @@
#define TK_BIN 305 // bin format data 0b111 #define TK_BIN 305 // bin format data 0b111
#define TK_FILE 306 #define TK_FILE 306
#define TK_QUESTION 307 // denoting the placeholder of "?",when invoking statement bind query #define TK_QUESTION 307 // denoting the placeholder of "?",when invoking statement bind query
#define TK_FUNCTION 308
#endif #endif
......
...@@ -46,10 +46,11 @@ ...@@ -46,10 +46,11 @@
#include <stdio.h> #include <stdio.h>
#include "os.h" #include "os.h"
#ifdef TD_WINDOWS #ifdef WINDOWS
#include <winsock2.h>
typedef unsigned __int32 uint32_t;
#pragma comment ( lib, "ws2_32.lib" ) #pragma comment ( lib, "ws2_32.lib" )
#pragma comment ( lib, "winmm.lib" )
#pragma comment ( lib, "wldap32.lib" )
#endif #endif
#endif #endif
...@@ -95,6 +96,7 @@ extern char configDir[]; ...@@ -95,6 +96,7 @@ extern char configDir[];
#define MAX_QUERY_SQL_LENGTH 256 #define MAX_QUERY_SQL_LENGTH 256
#define MAX_DATABASE_COUNT 256 #define MAX_DATABASE_COUNT 256
#define INPUT_BUF_LEN 256
typedef enum CREATE_SUB_TALBE_MOD_EN { typedef enum CREATE_SUB_TALBE_MOD_EN {
PRE_CREATE_SUBTBL, PRE_CREATE_SUBTBL,
...@@ -1595,18 +1597,17 @@ static void printfQuerySystemInfo(TAOS * taos) { ...@@ -1595,18 +1597,17 @@ static void printfQuerySystemInfo(TAOS * taos) {
} }
void ERROR_EXIT(const char *msg) { perror(msg); exit(0); } void ERROR_EXIT(const char *msg) { perror(msg); exit(-1); }
int postProceSql(char* host, uint16_t port, char* sqlstr) int postProceSql(char* host, uint16_t port, char* sqlstr)
{ {
char *req_fmt = "POST %s HTTP/1.1\r\nHost: %s:%d\r\nAccept: */*\r\n%s\r\nContent-Length: %d\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n%s"; char *req_fmt = "POST %s HTTP/1.1\r\nHost: %s:%d\r\nAccept: */*\r\nAuthorization: Basic %s\r\nContent-Length: %d\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n%s";
char *url = "/rest/sql"; char *url = "/rest/sql";
char *auth = "Authorization: Basic cm9vdDp0YW9zZGF0YQ==";
struct hostent *server; struct hostent *server;
struct sockaddr_in serv_addr; struct sockaddr_in serv_addr;
int sockfd, bytes, sent, received, req_str_len, resp_len; int bytes, sent, received, req_str_len, resp_len;
char *request_buf; char *request_buf;
char response_buf[RESP_BUF_LEN]; char response_buf[RESP_BUF_LEN];
uint16_t rest_port = port + TSDB_PORT_HTTP; uint16_t rest_port = port + TSDB_PORT_HTTP;
...@@ -1617,18 +1618,37 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1617,18 +1618,37 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
if (NULL == request_buf) if (NULL == request_buf)
ERROR_EXIT("ERROR, cannot allocate memory."); ERROR_EXIT("ERROR, cannot allocate memory.");
int r = snprintf(request_buf, char userpass_buf[INPUT_BUF_LEN];
req_buf_len, int mod_table[] = {0, 2, 1};
req_fmt, url, host, rest_port,
auth, strlen(sqlstr), sqlstr); static char base64[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
if (r >= req_buf_len) { 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
free(request_buf); 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
ERROR_EXIT("ERROR too long request"); 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
} 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
printf("Request:\n%s\n", request_buf); 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'};
snprintf(userpass_buf, INPUT_BUF_LEN, "%s:%s",
g_Dbs.user, g_Dbs.password);
size_t userpass_buf_len = strlen(userpass_buf);
size_t encoded_len = 4 * ((userpass_buf_len +2) / 3);
char base64_buf[INPUT_BUF_LEN];
#ifdef WINDOWS
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
SOCKET sockfd;
#else
int sockfd;
#endif
sockfd = socket(AF_INET, SOCK_STREAM, 0); sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) { if (sockfd < 0) {
#ifdef WINDOWS
fprintf(stderr, "Could not create socket : %d" , WSAGetLastError());
#endif
debugPrint("%s() LN%d sockfd=%d\n", __func__, __LINE__, sockfd);
free(request_buf); free(request_buf);
ERROR_EXIT("ERROR opening socket"); ERROR_EXIT("ERROR opening socket");
} }
...@@ -1639,20 +1659,68 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1639,20 +1659,68 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
ERROR_EXIT("ERROR, no such host"); ERROR_EXIT("ERROR, no such host");
} }
debugPrint("h_name: %s\nh_addretype: %s\nh_length: %d\n",
server->h_name,
(server->h_addrtype == AF_INET)?"ipv4":"ipv6",
server->h_length);
memset(&serv_addr, 0, sizeof(serv_addr)); memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET; serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(rest_port); serv_addr.sin_port = htons(rest_port);
#ifdef WINDOWS
serv_addr.sin_addr.s_addr = inet_addr(host);
#else
memcpy(&serv_addr.sin_addr.s_addr,server->h_addr,server->h_length); memcpy(&serv_addr.sin_addr.s_addr,server->h_addr,server->h_length);
#endif
if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) { int retConn = connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr));
debugPrint("%s() LN%d connect() return %d\n", __func__, __LINE__, retConn);
if (retConn < 0) {
free(request_buf); free(request_buf);
ERROR_EXIT("ERROR connecting"); ERROR_EXIT("ERROR connecting");
} }
memset(base64_buf, 0, INPUT_BUF_LEN);
for (int n = 0, m = 0; n < userpass_buf_len;) {
uint32_t oct_a = n < userpass_buf_len ?
(unsigned char) userpass_buf[n++]:0;
uint32_t oct_b = n < userpass_buf_len ?
(unsigned char) userpass_buf[n++]:0;
uint32_t oct_c = n < userpass_buf_len ?
(unsigned char) userpass_buf[n++]:0;
uint32_t triple = (oct_a << 0x10) + (oct_b << 0x08) + oct_c;
base64_buf[m++] = base64[(triple >> 3* 6) & 0x3f];
base64_buf[m++] = base64[(triple >> 2* 6) & 0x3f];
base64_buf[m++] = base64[(triple >> 1* 6) & 0x3f];
base64_buf[m++] = base64[(triple >> 0* 6) & 0x3f];
}
for (int l = 0; l < mod_table[userpass_buf_len % 3]; l++)
base64_buf[encoded_len - 1 - l] = '=';
debugPrint("%s() LN%d: auth string base64 encoded: %s\n", __func__, __LINE__, base64_buf);
char *auth = base64_buf;
int r = snprintf(request_buf,
req_buf_len,
req_fmt, url, host, rest_port,
auth, strlen(sqlstr), sqlstr);
if (r >= req_buf_len) {
free(request_buf);
ERROR_EXIT("ERROR too long request");
}
verbosePrint("%s() LN%d: Request:\n%s\n", __func__, __LINE__, request_buf);
req_str_len = strlen(request_buf); req_str_len = strlen(request_buf);
sent = 0; sent = 0;
do { do {
#ifdef WINDOWS
bytes = send(sockfd, request_buf + sent, req_str_len - sent, 0);
#else
bytes = write(sockfd, request_buf + sent, req_str_len - sent); bytes = write(sockfd, request_buf + sent, req_str_len - sent);
#endif
if (bytes < 0) if (bytes < 0)
ERROR_EXIT("ERROR writing message to socket"); ERROR_EXIT("ERROR writing message to socket");
if (bytes == 0) if (bytes == 0)
...@@ -1664,7 +1732,11 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1664,7 +1732,11 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
resp_len = sizeof(response_buf) - 1; resp_len = sizeof(response_buf) - 1;
received = 0; received = 0;
do { do {
#ifdef WINDOWS
bytes = recv(sockfd, response_buf + received, resp_len - received, 0);
#else
bytes = read(sockfd, response_buf + received, resp_len - received); bytes = read(sockfd, response_buf + received, resp_len - received);
#endif
if (bytes < 0) { if (bytes < 0) {
free(request_buf); free(request_buf);
ERROR_EXIT("ERROR reading response from socket"); ERROR_EXIT("ERROR reading response from socket");
...@@ -1683,7 +1755,12 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1683,7 +1755,12 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
printf("Response:\n%s\n", response_buf); printf("Response:\n%s\n", response_buf);
free(request_buf); free(request_buf);
#ifdef WINDOWS
closesocket(sockfd);
WSACleanup();
#else
close(sockfd); close(sockfd);
#endif
return 0; return 0;
} }
...@@ -2143,7 +2220,7 @@ static int createDatabases() { ...@@ -2143,7 +2220,7 @@ static int createDatabases() {
debugPrint("%s() %d command: %s\n", __func__, __LINE__, command); debugPrint("%s() %d command: %s\n", __func__, __LINE__, command);
if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) { if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) {
taos_close(taos); taos_close(taos);
printf("\ncreate database %s failed!\n\n", g_Dbs.db[i].dbName); fprintf(stderr, "\ncreate database %s failed!\n\n", g_Dbs.db[i].dbName);
return -1; return -1;
} }
printf("\ncreate database %s success!\n\n", g_Dbs.db[i].dbName); printf("\ncreate database %s success!\n\n", g_Dbs.db[i].dbName);
...@@ -2242,6 +2319,7 @@ static void* createTable(void *sarg) ...@@ -2242,6 +2319,7 @@ static void* createTable(void *sarg)
len = 0; len = 0;
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer);
if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)){ if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)){
fprintf(stderr, "queryDbExec() failed. buffer:\n%s\n", buffer);
free(buffer); free(buffer);
return NULL; return NULL;
} }
...@@ -2256,7 +2334,9 @@ static void* createTable(void *sarg) ...@@ -2256,7 +2334,9 @@ static void* createTable(void *sarg)
if (0 != len) { if (0 != len) {
verbosePrint("%s() %d buffer: %s\n", __func__, __LINE__, buffer); verbosePrint("%s() %d buffer: %s\n", __func__, __LINE__, buffer);
(void)queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE); if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)) {
fprintf(stderr, "queryDbExec() failed. buffer:\n%s\n", buffer);
}
} }
free(buffer); free(buffer);
...@@ -3949,9 +4029,7 @@ send_to_server: ...@@ -3949,9 +4029,7 @@ send_to_server:
int affectedRows = queryDbExec( int affectedRows = queryDbExec(
winfo->taos, buffer, INSERT_TYPE); winfo->taos, buffer, INSERT_TYPE);
if (0 > affectedRows) { if (0 < affectedRows) {
goto free_and_statistics;
} else {
endTs = taosGetTimestampUs(); endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs; int64_t delay = endTs - startTs;
if (delay > winfo->maxDelay) winfo->maxDelay = delay; if (delay > winfo->maxDelay) winfo->maxDelay = delay;
...@@ -3960,12 +4038,15 @@ send_to_server: ...@@ -3960,12 +4038,15 @@ send_to_server:
winfo->totalDelay += delay; winfo->totalDelay += delay;
winfo->avgDelay = (double)winfo->totalDelay / winfo->cntDelay; winfo->avgDelay = (double)winfo->totalDelay / winfo->cntDelay;
winfo->totalAffectedRows += affectedRows; winfo->totalAffectedRows += affectedRows;
} else {
fprintf(stderr, "queryDbExec() buffer:\n%s\naffected rows is %d", buffer, affectedRows);
goto free_and_statistics;
} }
int64_t currentPrintTime = taosGetTimestampMs(); int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) { if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n", printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n",
winfo->threadID, winfo->threadID,
winfo->totalRowsInserted, winfo->totalRowsInserted,
winfo->totalAffectedRows); winfo->totalAffectedRows);
lastPrintTime = currentPrintTime; lastPrintTime = currentPrintTime;
...@@ -4102,10 +4183,11 @@ static void* syncWrite(void *sarg) { ...@@ -4102,10 +4183,11 @@ static void* syncWrite(void *sarg) {
winfo->totalAffectedRows = 0; winfo->totalAffectedRows = 0;
for (int tID = winfo->start_table_id; tID <= winfo->end_table_id; tID++) { for (int tID = winfo->start_table_id; tID <= winfo->end_table_id; tID++) {
int64_t tmp_time = time_counter;
for (int i = 0; i < g_args.num_of_DPT;) { for (int i = 0; i < g_args.num_of_DPT;) {
int tblInserted = i; int tblInserted = i;
int64_t tmp_time = time_counter;
char *pstr = buffer; char *pstr = buffer;
pstr += sprintf(pstr, pstr += sprintf(pstr,
...@@ -4160,8 +4242,7 @@ static void* syncWrite(void *sarg) { ...@@ -4160,8 +4242,7 @@ static void* syncWrite(void *sarg) {
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer);
int affectedRows = queryDbExec(winfo->taos, buffer, 1); int affectedRows = queryDbExec(winfo->taos, buffer, 1);
verbosePrint("%s() LN%d: affectedRows:%d\n", __func__, __LINE__, affectedRows); if (0 < affectedRows){
if (0 <= affectedRows){
endTs = taosGetTimestampUs(); endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs; int64_t delay = endTs - startTs;
if (delay > winfo->maxDelay) if (delay > winfo->maxDelay)
...@@ -4172,9 +4253,11 @@ static void* syncWrite(void *sarg) { ...@@ -4172,9 +4253,11 @@ static void* syncWrite(void *sarg) {
winfo->totalDelay += delay; winfo->totalDelay += delay;
winfo->totalAffectedRows += affectedRows; winfo->totalAffectedRows += affectedRows;
winfo->avgDelay = (double)winfo->totalDelay / winfo->cntDelay; winfo->avgDelay = (double)winfo->totalDelay / winfo->cntDelay;
} else {
fprintf(stderr, "queryDbExec() buffer:\n%s\naffected rows is %d", buffer, affectedRows);
} }
verbosePrint("%s() LN%d: totalaffectedRows:%"PRId64"\n", __func__, __LINE__, winfo->totalAffectedRows); verbosePrint("%s() LN%d: totalaffectedRows:%"PRId64" tblInserted=%d\n", __func__, __LINE__, winfo->totalAffectedRows, tblInserted);
if (g_args.insert_interval) { if (g_args.insert_interval) {
et = taosGetTimestampMs(); et = taosGetTimestampMs();
} }
...@@ -4258,7 +4341,7 @@ static void* syncWriteWithStb(void *sarg) { ...@@ -4258,7 +4341,7 @@ static void* syncWriteWithStb(void *sarg) {
int sampleUsePos; int sampleUsePos;
debugPrint("%s() LN%d insertRows=%"PRId64"\n", __func__, __LINE__, superTblInfo->insertRows); verbosePrint("%s() LN%d insertRows=%"PRId64"\n", __func__, __LINE__, superTblInfo->insertRows);
for (uint32_t tID = winfo->start_table_id; tID <= winfo->end_table_id; for (uint32_t tID = winfo->start_table_id; tID <= winfo->end_table_id;
tID++) { tID++) {
...@@ -4364,7 +4447,7 @@ static void* syncWriteWithStb(void *sarg) { ...@@ -4364,7 +4447,7 @@ static void* syncWriteWithStb(void *sarg) {
} }
len += retLen; len += retLen;
verbosePrint("%s() LN%d retLen=%d len=%d k=%d buffer=%s\n", __func__, __LINE__, retLen, len, k, buffer); verbosePrint("%s() LN%d retLen=%d len=%d k=%d \nbuffer=%s\n", __func__, __LINE__, retLen, len, k, buffer);
tblInserted++; tblInserted++;
k++; k++;
...@@ -4376,42 +4459,46 @@ static void* syncWriteWithStb(void *sarg) { ...@@ -4376,42 +4459,46 @@ static void* syncWriteWithStb(void *sarg) {
winfo->totalRowsInserted += k; winfo->totalRowsInserted += k;
int64_t startTs = taosGetTimestampUs();
int64_t endTs;
int affectedRows;
if (0 == strncasecmp(superTblInfo->insertMode, "taosc", strlen("taosc"))) { if (0 == strncasecmp(superTblInfo->insertMode, "taosc", strlen("taosc"))) {
int64_t startTs;
int64_t endTs;
startTs = taosGetTimestampUs();
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer);
int affectedRows = queryDbExec(winfo->taos, buffer, INSERT_TYPE); affectedRows = queryDbExec(winfo->taos, buffer, INSERT_TYPE);
if (0 > affectedRows){ if (0 > affectedRows){
goto free_and_statistics_2; goto free_and_statistics_2;
} else {
endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs;
if (delay > winfo->maxDelay) winfo->maxDelay = delay;
if (delay < winfo->minDelay) winfo->minDelay = delay;
winfo->cntDelay++;
winfo->totalDelay += delay;
}
winfo->totalAffectedRows += affectedRows;
int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n",
winfo->threadID,
winfo->totalRowsInserted,
winfo->totalAffectedRows);
lastPrintTime = currentPrintTime;
} }
} else { } else {
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer);
int retCode = postProceSql(g_Dbs.host, g_Dbs.port, buffer); int retCode = postProceSql(g_Dbs.host, g_Dbs.port, buffer);
if (0 != retCode) { if (0 != retCode) {
printf("========restful return fail, threadID[%d]\n", winfo->threadID); printf("========restful return fail, threadID[%d]\n", winfo->threadID);
goto free_and_statistics_2; goto free_and_statistics_2;
} }
affectedRows = k;
} }
endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs;
if (delay > winfo->maxDelay) winfo->maxDelay = delay;
if (delay < winfo->minDelay) winfo->minDelay = delay;
winfo->cntDelay++;
winfo->totalDelay += delay;
winfo->totalAffectedRows += affectedRows;
int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n",
winfo->threadID,
winfo->totalRowsInserted,
winfo->totalAffectedRows);
lastPrintTime = currentPrintTime;
}
if (g_args.insert_interval) { if (g_args.insert_interval) {
et = taosGetTimestampMs(); et = taosGetTimestampMs();
} }
......
...@@ -175,7 +175,9 @@ typedef struct { ...@@ -175,7 +175,9 @@ typedef struct {
int8_t quorum; int8_t quorum;
int8_t update; int8_t update;
int8_t cacheLastRow; int8_t cacheLastRow;
int8_t reserved[10]; int8_t dbType;
int16_t partitions;
int8_t reserved[7];
} SDbCfg; } SDbCfg;
typedef struct SDbObj { typedef struct SDbObj {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "tname.h" #include "tname.h"
#include "tbn.h" #include "tbn.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "tp.h"
#include "mnode.h" #include "mnode.h"
#include "mnodeDef.h" #include "mnodeDef.h"
#include "mnodeInt.h" #include "mnodeInt.h"
...@@ -38,8 +39,8 @@ ...@@ -38,8 +39,8 @@
#include "mnodeVgroup.h" #include "mnodeVgroup.h"
#define VG_LIST_SIZE 8 #define VG_LIST_SIZE 8
int64_t tsDbRid = -1; int64_t tsDbRid = -1;
static void * tsDbSdb = NULL; void * tsDbSdb = NULL;
static int32_t tsDbUpdateSize; static int32_t tsDbUpdateSize;
static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *pMsg); static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *pMsg);
...@@ -48,8 +49,14 @@ static int32_t mnodeSetDbDropping(SDbObj *pDb); ...@@ -48,8 +49,14 @@ static int32_t mnodeSetDbDropping(SDbObj *pDb);
static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void *pConn); static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg); static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg);
static int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg);
static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg); static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg);
int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg);
#ifndef _TOPIC
int32_t tpInit() { return 0; }
void tpCleanUp() {}
void tpUpdateTs(int32_t *seq, void *pMsg) {}
#endif
static void mnodeDestroyDb(SDbObj *pDb) { static void mnodeDestroyDb(SDbObj *pDb) {
pthread_mutex_destroy(&pDb->mutex); pthread_mutex_destroy(&pDb->mutex);
...@@ -176,7 +183,7 @@ int32_t mnodeInitDbs() { ...@@ -176,7 +183,7 @@ int32_t mnodeInitDbs() {
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_DB, mnodeCancelGetNextDb); mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_DB, mnodeCancelGetNextDb);
mDebug("table:dbs table is created"); mDebug("table:dbs table is created");
return 0; return tpInit();
} }
void *mnodeGetNextDb(void *pIter, SDbObj **pDb) { void *mnodeGetNextDb(void *pIter, SDbObj **pDb) {
...@@ -332,6 +339,17 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) { ...@@ -332,6 +339,17 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
return TSDB_CODE_MND_INVALID_DB_OPTION; return TSDB_CODE_MND_INVALID_DB_OPTION;
} }
if (pCfg->dbType < 0 || pCfg->dbType > 1) {
mError("invalid db option dbType:%d valid range: [%d, %d]", pCfg->dbType, 0, 1);
return TSDB_CODE_MND_INVALID_DB_OPTION;
}
if (pCfg->partitions < TSDB_MIN_DB_PARTITON_OPTION || pCfg->partitions > TSDB_MAX_DB_PARTITON_OPTION) {
mError("invalid db option partitions:%d valid range: [%d, %d]", pCfg->partitions, TSDB_MIN_DB_PARTITON_OPTION,
TSDB_MAX_DB_PARTITON_OPTION);
return TSDB_CODE_MND_INVALID_DB_OPTION;
}
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -354,6 +372,8 @@ static void mnodeSetDefaultDbCfg(SDbCfg *pCfg) { ...@@ -354,6 +372,8 @@ static void mnodeSetDefaultDbCfg(SDbCfg *pCfg) {
if (pCfg->quorum < 0) pCfg->quorum = tsQuorum; if (pCfg->quorum < 0) pCfg->quorum = tsQuorum;
if (pCfg->update < 0) pCfg->update = tsUpdate; if (pCfg->update < 0) pCfg->update = tsUpdate;
if (pCfg->cacheLastRow < 0) pCfg->cacheLastRow = tsCacheLastRow; if (pCfg->cacheLastRow < 0) pCfg->cacheLastRow = tsCacheLastRow;
if (pCfg->dbType < 0) pCfg->dbType = 0;
if (pCfg->partitions < 0) pCfg->partitions = tsPartitons;
} }
static int32_t mnodeCreateDbCb(SMnodeMsg *pMsg, int32_t code) { static int32_t mnodeCreateDbCb(SMnodeMsg *pMsg, int32_t code) {
...@@ -408,7 +428,9 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg * ...@@ -408,7 +428,9 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *
.replications = pCreate->replications, .replications = pCreate->replications,
.quorum = pCreate->quorum, .quorum = pCreate->quorum,
.update = pCreate->update, .update = pCreate->update,
.cacheLastRow = pCreate->cacheLastRow .cacheLastRow = pCreate->cacheLastRow,
.dbType = pCreate->dbType,
.partitions = pCreate->partitions
}; };
mnodeSetDefaultDbCfg(&pDb->cfg); mnodeSetDefaultDbCfg(&pDb->cfg);
...@@ -501,6 +523,7 @@ void mnodeRemoveVgroupFromDb(SVgObj *pVgroup) { ...@@ -501,6 +523,7 @@ void mnodeRemoveVgroupFromDb(SVgObj *pVgroup) {
} }
void mnodeCleanupDbs() { void mnodeCleanupDbs() {
tpCleanUp();
sdbCloseTable(tsDbRid); sdbCloseTable(tsDbRid);
tsDbSdb = NULL; tsDbSdb = NULL;
} }
...@@ -660,7 +683,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn ...@@ -660,7 +683,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
return 0; return 0;
} }
static char *mnodeGetDbStr(char *src) { char *mnodeGetDbStr(char *src) {
char *pos = strstr(src, TS_PATH_DELIMITER); char *pos = strstr(src, TS_PATH_DELIMITER);
if (pos != NULL) ++pos; if (pos != NULL) ++pos;
...@@ -852,6 +875,7 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) { ...@@ -852,6 +875,7 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) {
pCreate->daysToKeep2 = htonl(pCreate->daysToKeep2); pCreate->daysToKeep2 = htonl(pCreate->daysToKeep2);
pCreate->commitTime = htonl(pCreate->commitTime); pCreate->commitTime = htonl(pCreate->commitTime);
pCreate->fsyncPeriod = htonl(pCreate->fsyncPeriod); pCreate->fsyncPeriod = htonl(pCreate->fsyncPeriod);
pCreate->partitions = htons(pCreate->partitions);
pCreate->minRowsPerFileBlock = htonl(pCreate->minRowsPerFileBlock); pCreate->minRowsPerFileBlock = htonl(pCreate->minRowsPerFileBlock);
pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock); pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock);
...@@ -887,6 +911,8 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) { ...@@ -887,6 +911,8 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) {
int8_t precision = pAlter->precision; int8_t precision = pAlter->precision;
int8_t update = pAlter->update; int8_t update = pAlter->update;
int8_t cacheLastRow = pAlter->cacheLastRow; int8_t cacheLastRow = pAlter->cacheLastRow;
int8_t dbType = pAlter->dbType;
int16_t partitions = htons(pAlter->partitions);
terrno = TSDB_CODE_SUCCESS; terrno = TSDB_CODE_SUCCESS;
...@@ -1004,6 +1030,16 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) { ...@@ -1004,6 +1030,16 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) {
newCfg.cacheLastRow = cacheLastRow; newCfg.cacheLastRow = cacheLastRow;
} }
if (dbType >= 0 && dbType != pDb->cfg.dbType) {
mDebug("db:%s, dbType:%d change to %d", pDb->name, pDb->cfg.dbType, dbType);
newCfg.dbType = dbType;
}
if (partitions >= 0 && partitions != pDb->cfg.partitions) {
mDebug("db:%s, partitions:%d change to %d", pDb->name, pDb->cfg.partitions, partitions);
newCfg.partitions = partitions;
}
return newCfg; return newCfg;
} }
...@@ -1031,6 +1067,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -1031,6 +1067,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
} }
static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) { static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) {
mDebug("db:%s, type:%d do alter operation", pDb->name, pDb->cfg.dbType);
SDbCfg newCfg = mnodeGetAlterDbOption(pDb, pAlter); SDbCfg newCfg = mnodeGetAlterDbOption(pDb, pAlter);
if (terrno != TSDB_CODE_SUCCESS) { if (terrno != TSDB_CODE_SUCCESS) {
return terrno; return terrno;
...@@ -1061,9 +1099,9 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) { ...@@ -1061,9 +1099,9 @@ static int32_t mnodeAlterDb(SDbObj *pDb, SAlterDbMsg *pAlter, void *pMsg) {
return code; return code;
} }
static int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg) { int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg) {
SAlterDbMsg *pAlter = pMsg->rpcMsg.pCont; SAlterDbMsg *pAlter = pMsg->rpcMsg.pCont;
mDebug("db:%s, alter db msg is received from thandle:%p", pAlter->db, pMsg->rpcMsg.handle); mDebug("db:%s, alter db msg is received from thandle:%p, dbType:%d", pAlter->db, pMsg->rpcMsg.handle, pAlter->dbType);
if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pAlter->db); if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pAlter->db);
if (pMsg->pDb == NULL) { if (pMsg->pDb == NULL) {
......
...@@ -109,6 +109,7 @@ static char *mnodeGetShowType(int32_t showType) { ...@@ -109,6 +109,7 @@ static char *mnodeGetShowType(int32_t showType) {
case TSDB_MGMT_TABLE_VNODES: return "show vnodes"; case TSDB_MGMT_TABLE_VNODES: return "show vnodes";
case TSDB_MGMT_TABLE_CLUSTER: return "show clusters"; case TSDB_MGMT_TABLE_CLUSTER: return "show clusters";
case TSDB_MGMT_TABLE_STREAMTABLES : return "show streamtables"; case TSDB_MGMT_TABLE_STREAMTABLES : return "show streamtables";
case TSDB_MGMT_TABLE_TP: return "show topics";
default: return "undefined"; default: return "undefined";
} }
} }
......
...@@ -367,6 +367,11 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) { ...@@ -367,6 +367,11 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) {
maxIdPoolSize = MAX(maxIdPoolSize, idPoolSize); maxIdPoolSize = MAX(maxIdPoolSize, idPoolSize);
} }
// create one table each vnode
if (pDb->cfg.dbType == TSDB_DB_TYPE_TOPIC) {
maxIdPoolSize = 1;
}
// new vgroup // new vgroup
if (pInputVgroup->idPool == NULL) { if (pInputVgroup->idPool == NULL) {
pInputVgroup->idPool = taosInitIdPool(maxIdPoolSize); pInputVgroup->idPool = taosInitIdPool(maxIdPoolSize);
...@@ -379,6 +384,11 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) { ...@@ -379,6 +384,11 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) {
} }
} }
// create one table each vnode
if (pDb->cfg.dbType == TSDB_DB_TYPE_TOPIC) {
return TSDB_CODE_SUCCESS;
}
// realloc all vgroups in db // realloc all vgroups in db
int32_t newIdPoolSize; int32_t newIdPoolSize;
if (minIdPoolSize * 4 < tsTableIncStepPerVnode) { if (minIdPoolSize * 4 < tsTableIncStepPerVnode) {
...@@ -449,6 +459,10 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi ...@@ -449,6 +459,10 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
maxVgroupsPerDb = MIN(maxVgroupsPerDb, TSDB_MAX_VNODES_PER_DB); maxVgroupsPerDb = MIN(maxVgroupsPerDb, TSDB_MAX_VNODES_PER_DB);
} }
if (pDb->cfg.dbType == TSDB_DB_TYPE_TOPIC) {
maxVgroupsPerDb = TSDB_MAX_DB_PARTITON_OPTION;
}
int32_t code = TSDB_CODE_MND_NO_ENOUGH_DNODES; int32_t code = TSDB_CODE_MND_NO_ENOUGH_DNODES;
if (pDb->numOfVgroups < maxVgroupsPerDb) { if (pDb->numOfVgroups < maxVgroupsPerDb) {
mDebug("msg:%p, app:%p db:%s, try to create a new vgroup, numOfVgroups:%d maxVgroupsPerDb:%d", pMsg, mDebug("msg:%p, app:%p db:%s, try to create a new vgroup, numOfVgroups:%d maxVgroupsPerDb:%d", pMsg,
...@@ -881,6 +895,7 @@ static SCreateVnodeMsg *mnodeBuildVnodeMsg(SVgObj *pVgroup) { ...@@ -881,6 +895,7 @@ static SCreateVnodeMsg *mnodeBuildVnodeMsg(SVgObj *pVgroup) {
pCfg->update = pDb->cfg.update; pCfg->update = pDb->cfg.update;
pCfg->cacheLastRow = pDb->cfg.cacheLastRow; pCfg->cacheLastRow = pDb->cfg.cacheLastRow;
pCfg->dbReplica = pDb->cfg.replications; pCfg->dbReplica = pDb->cfg.replications;
pCfg->dbType = pDb->cfg.dbType;
SVnodeDesc *pNodes = pVnode->nodes; SVnodeDesc *pNodes = pVnode->nodes;
for (int32_t j = 0; j < pVgroup->numOfVnodes; ++j) { for (int32_t j = 0; j < pVgroup->numOfVnodes; ++j) {
......
...@@ -125,6 +125,8 @@ typedef struct SCreateDbInfo { ...@@ -125,6 +125,8 @@ typedef struct SCreateDbInfo {
int8_t update; int8_t update;
int8_t cachelast; int8_t cachelast;
SArray *keep; SArray *keep;
int8_t dbType;
int16_t partitions;
} SCreateDbInfo; } SCreateDbInfo;
typedef struct SCreateAcctInfo { typedef struct SCreateAcctInfo {
...@@ -155,6 +157,7 @@ typedef struct SUserInfo { ...@@ -155,6 +157,7 @@ typedef struct SUserInfo {
typedef struct SMiscInfo { typedef struct SMiscInfo {
SArray *a; // SArray<SStrToken> SArray *a; // SArray<SStrToken>
bool existsCheck; bool existsCheck;
int16_t dbType;
int16_t tableType; int16_t tableType;
SUserInfo user; SUserInfo user;
union { union {
...@@ -278,7 +281,7 @@ void setCreatedTableName(SSqlInfo *pInfo, SStrToken *pTableNameToken, SStrToken ...@@ -278,7 +281,7 @@ void setCreatedTableName(SSqlInfo *pInfo, SStrToken *pTableNameToken, SStrToken
void SqlInfoDestroy(SSqlInfo *pInfo); void SqlInfoDestroy(SSqlInfo *pInfo);
void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParams, ...); void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParams, ...);
void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck,int16_t tableType); void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck,int16_t dbType,int16_t tableType);
void setShowOptions(SSqlInfo *pInfo, int32_t type, SStrToken* prefix, SStrToken* pPatterns); void setShowOptions(SSqlInfo *pInfo, int32_t type, SStrToken* prefix, SStrToken* pPatterns);
void setCreateDbInfo(SSqlInfo *pInfo, int32_t type, SStrToken *pToken, SCreateDbInfo *pDB, SStrToken *pIgExists); void setCreateDbInfo(SSqlInfo *pInfo, int32_t type, SStrToken *pToken, SCreateDbInfo *pDB, SStrToken *pIgExists);
...@@ -289,6 +292,7 @@ void setKillSql(SSqlInfo *pInfo, int32_t type, SStrToken *ip); ...@@ -289,6 +292,7 @@ void setKillSql(SSqlInfo *pInfo, int32_t type, SStrToken *ip);
void setAlterUserSql(SSqlInfo *pInfo, int16_t type, SStrToken *pName, SStrToken* pPwd, SStrToken *pPrivilege); void setAlterUserSql(SSqlInfo *pInfo, int16_t type, SStrToken *pName, SStrToken* pPwd, SStrToken *pPrivilege);
void setDefaultCreateDbOption(SCreateDbInfo *pDBInfo); void setDefaultCreateDbOption(SCreateDbInfo *pDBInfo);
void setDefaultCreateTopicOption(SCreateDbInfo *pDBInfo);
// prefix show db.tables; // prefix show db.tables;
void setDbName(SStrToken *pCpxName, SStrToken *pDb); void setDbName(SStrToken *pCpxName, SStrToken *pDb);
......
...@@ -817,7 +817,7 @@ void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParam, ...) { ...@@ -817,7 +817,7 @@ void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParam, ...) {
va_end(va); va_end(va);
} }
void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck, int16_t tableType) { void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck, int16_t dbType, int16_t tableType) {
pInfo->type = type; pInfo->type = type;
if (pInfo->pMiscInfo == NULL) { if (pInfo->pMiscInfo == NULL) {
...@@ -828,6 +828,7 @@ void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrTo ...@@ -828,6 +828,7 @@ void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrTo
taosArrayPush(pInfo->pMiscInfo->a, pToken); taosArrayPush(pInfo->pMiscInfo->a, pToken);
pInfo->pMiscInfo->existsCheck = (existsCheck->n == 1); pInfo->pMiscInfo->existsCheck = (existsCheck->n == 1);
pInfo->pMiscInfo->dbType = dbType;
pInfo->pMiscInfo->tableType = tableType; pInfo->pMiscInfo->tableType = tableType;
} }
...@@ -947,6 +948,17 @@ void setDefaultCreateDbOption(SCreateDbInfo *pDBInfo) { ...@@ -947,6 +948,17 @@ void setDefaultCreateDbOption(SCreateDbInfo *pDBInfo) {
pDBInfo->keep = NULL; pDBInfo->keep = NULL;
pDBInfo->update = -1; pDBInfo->update = -1;
pDBInfo->cachelast = 0; pDBInfo->cachelast = -1;
pDBInfo->dbType = -1;
pDBInfo->partitions = -1;
memset(&pDBInfo->precision, 0, sizeof(SStrToken)); memset(&pDBInfo->precision, 0, sizeof(SStrToken));
} }
void setDefaultCreateTopicOption(SCreateDbInfo *pDBInfo) {
setDefaultCreateDbOption(pDBInfo);
pDBInfo->dbType = TSDB_DB_TYPE_TOPIC;
pDBInfo->partitions = TSDB_DEFAULT_DB_PARTITON_OPTION;
}
...@@ -215,6 +215,9 @@ static SKeyword keywordTable[] = { ...@@ -215,6 +215,9 @@ static SKeyword keywordTable[] = {
{"UNION", TK_UNION}, {"UNION", TK_UNION},
{"CACHELAST", TK_CACHELAST}, {"CACHELAST", TK_CACHELAST},
{"DISTINCT", TK_DISTINCT}, {"DISTINCT", TK_DISTINCT},
{"PARTITIONS", TK_PARTITIONS},
{"TOPIC", TK_TOPIC},
{"TOPICS", TK_TOPICS}
}; };
static const char isIdChar[] = { static const char isIdChar[] = {
......
...@@ -97,27 +97,27 @@ ...@@ -97,27 +97,27 @@
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 257 #define YYNOCODE 263
#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;
SCreatedTableInfo yy32; SLimitVal yy18;
tSQLExpr* yy114; SCreateDbInfo yy94;
TAOS_FIELD yy215; int yy116;
SQuerySQL* yy216; SSubclauseInfo* yy141;
int64_t yy221; tSQLExprList* yy170;
SCreateDbInfo yy222; tVariant yy218;
tSQLExprList* yy258; SIntervalVal yy220;
SIntervalVal yy264; SCreatedTableInfo yy252;
SCreateTableSQL* yy278; tSQLExpr* yy282;
SCreateAcctInfo yy299; SCreateTableSQL* yy310;
int yy348; SQuerySQL* yy372;
SArray* yy349; SCreateAcctInfo yy419;
SSubclauseInfo* yy417; SArray* yy429;
tVariant yy426; TAOS_FIELD yy451;
SLimitVal yy454; int64_t yy481;
} YYMINORTYPE; } YYMINORTYPE;
#ifndef YYSTACKDEPTH #ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100 #define YYSTACKDEPTH 100
...@@ -127,17 +127,17 @@ typedef union { ...@@ -127,17 +127,17 @@ typedef union {
#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo
#define ParseARG_STORE yypParser->pInfo = pInfo #define ParseARG_STORE yypParser->pInfo = pInfo
#define YYFALLBACK 1 #define YYFALLBACK 1
#define YYNSTATE 294 #define YYNSTATE 306
#define YYNRULE 254 #define YYNRULE 263
#define YYNTOKEN 184 #define YYNTOKEN 187
#define YY_MAX_SHIFT 293 #define YY_MAX_SHIFT 305
#define YY_MIN_SHIFTREDUCE 477 #define YY_MIN_SHIFTREDUCE 494
#define YY_MAX_SHIFTREDUCE 730 #define YY_MAX_SHIFTREDUCE 756
#define YY_ERROR_ACTION 731 #define YY_ERROR_ACTION 757
#define YY_ACCEPT_ACTION 732 #define YY_ACCEPT_ACTION 758
#define YY_NO_ACTION 733 #define YY_NO_ACTION 759
#define YY_MIN_REDUCE 734 #define YY_MIN_REDUCE 760
#define YY_MAX_REDUCE 987 #define YY_MAX_REDUCE 1022
/************* End control #defines *******************************************/ /************* End control #defines *******************************************/
/* Define the yytestcase() macro to be a no-op if is not already defined /* Define the yytestcase() macro to be a no-op if is not already defined
...@@ -203,249 +203,255 @@ typedef union { ...@@ -203,249 +203,255 @@ 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 (651) #define YY_ACTTAB_COUNT (668)
static const YYACTIONTYPE yy_action[] = { static const YYACTIONTYPE yy_action[] = {
/* 0 */ 74, 521, 732, 293, 521, 165, 186, 291, 28, 522, /* 0 */ 176, 541, 176, 197, 303, 17, 135, 620, 174, 542,
/* 10 */ 190, 893, 522, 43, 44, 969, 47, 48, 15, 776, /* 10 */ 1004, 204, 1005, 47, 48, 30, 51, 52, 135, 201,
/* 20 */ 198, 37, 152, 46, 242, 51, 49, 53, 50, 854, /* 20 */ 209, 41, 176, 50, 253, 55, 53, 57, 54, 758,
/* 30 */ 855, 27, 858, 42, 41, 871, 128, 40, 39, 38, /* 30 */ 305, 203, 1005, 46, 45, 279, 278, 44, 43, 42,
/* 40 */ 43, 44, 882, 47, 48, 882, 188, 198, 37, 868, /* 40 */ 47, 48, 214, 51, 52, 906, 928, 209, 41, 541,
/* 50 */ 46, 242, 51, 49, 53, 50, 187, 128, 203, 225, /* 50 */ 50, 253, 55, 53, 57, 54, 199, 542, 660, 903,
/* 60 */ 42, 41, 979, 165, 40, 39, 38, 43, 44, 890, /* 60 */ 46, 45, 216, 135, 44, 43, 42, 48, 906, 51,
/* 70 */ 47, 48, 193, 970, 198, 37, 165, 46, 242, 51, /* 70 */ 52, 30, 956, 209, 41, 917, 50, 253, 55, 53,
/* 80 */ 49, 53, 50, 871, 128, 192, 970, 42, 41, 258, /* 80 */ 57, 54, 250, 130, 75, 289, 46, 45, 906, 236,
/* 90 */ 521, 40, 39, 38, 290, 289, 115, 239, 522, 71, /* 90 */ 44, 43, 42, 495, 496, 497, 498, 499, 500, 501,
/* 100 */ 77, 43, 45, 128, 47, 48, 205, 66, 198, 37, /* 100 */ 502, 503, 504, 505, 506, 507, 304, 925, 81, 226,
/* 110 */ 28, 46, 242, 51, 49, 53, 50, 40, 39, 38, /* 110 */ 70, 541, 212, 47, 48, 903, 51, 52, 30, 542,
/* 120 */ 921, 42, 41, 278, 65, 40, 39, 38, 865, 678, /* 120 */ 209, 41, 24, 50, 253, 55, 53, 57, 54, 957,
/* 130 */ 287, 871, 859, 210, 478, 479, 480, 481, 482, 483, /* 130 */ 36, 248, 704, 46, 45, 135, 664, 44, 43, 42,
/* 140 */ 484, 485, 486, 487, 488, 489, 292, 72, 201, 215, /* 140 */ 47, 49, 894, 51, 52, 241, 892, 209, 41, 229,
/* 150 */ 44, 868, 47, 48, 856, 871, 198, 37, 209, 46, /* 150 */ 50, 253, 55, 53, 57, 54, 233, 232, 180, 213,
/* 160 */ 242, 51, 49, 53, 50, 869, 922, 204, 237, 42, /* 160 */ 46, 45, 903, 218, 44, 43, 42, 23, 267, 298,
/* 170 */ 41, 96, 163, 40, 39, 38, 278, 21, 256, 286, /* 170 */ 297, 266, 265, 264, 296, 263, 295, 294, 293, 262,
/* 180 */ 285, 255, 254, 253, 284, 252, 283, 282, 281, 251, /* 180 */ 292, 291, 866, 30, 854, 855, 856, 857, 858, 859,
/* 190 */ 280, 279, 835, 594, 823, 824, 825, 826, 827, 828, /* 190 */ 860, 861, 862, 863, 864, 865, 867, 868, 51, 52,
/* 200 */ 829, 830, 831, 832, 833, 834, 836, 837, 47, 48, /* 200 */ 917, 76, 209, 41, 900, 50, 253, 55, 53, 57,
/* 210 */ 87, 86, 198, 37, 28, 46, 242, 51, 49, 53, /* 210 */ 54, 299, 18, 30, 198, 46, 45, 69, 269, 44,
/* 220 */ 50, 268, 267, 16, 211, 42, 41, 265, 264, 40, /* 220 */ 43, 42, 208, 717, 272, 269, 708, 903, 711, 185,
/* 230 */ 39, 38, 197, 691, 28, 634, 682, 123, 685, 174, /* 230 */ 714, 219, 208, 717, 271, 186, 708, 906, 711, 101,
/* 240 */ 688, 22, 42, 41, 73, 175, 40, 39, 38, 34, /* 240 */ 714, 114, 113, 184, 289, 644, 215, 221, 641, 891,
/* 250 */ 108, 107, 173, 197, 691, 867, 67, 682, 121, 685, /* 250 */ 642, 128, 643, 1014, 205, 206, 77, 902, 252, 36,
/* 260 */ 21, 688, 286, 285, 194, 195, 34, 284, 241, 283, /* 260 */ 23, 706, 298, 297, 205, 206, 967, 296, 71, 295,
/* 270 */ 282, 281, 202, 280, 279, 868, 659, 660, 680, 841, /* 270 */ 294, 293, 24, 292, 291, 874, 223, 224, 872, 873,
/* 280 */ 22, 857, 839, 840, 169, 194, 195, 842, 34, 844, /* 280 */ 36, 1001, 904, 875, 805, 877, 878, 876, 161, 879,
/* 290 */ 845, 843, 785, 846, 847, 152, 230, 631, 218, 51, /* 290 */ 880, 55, 53, 57, 54, 1000, 220, 707, 814, 46,
/* 300 */ 49, 53, 50, 28, 23, 222, 221, 42, 41, 224, /* 300 */ 45, 235, 161, 44, 43, 42, 99, 104, 192, 44,
/* 310 */ 638, 40, 39, 38, 681, 618, 181, 10, 615, 207, /* 310 */ 43, 42, 93, 103, 109, 112, 102, 254, 78, 302,
/* 320 */ 616, 76, 617, 138, 243, 932, 777, 94, 98, 152, /* 320 */ 301, 122, 106, 5, 151, 56, 1, 149, 999, 33,
/* 330 */ 966, 196, 52, 88, 103, 106, 97, 28, 28, 28, /* 330 */ 150, 88, 83, 87, 657, 56, 169, 165, 716, 30,
/* 340 */ 965, 261, 100, 626, 868, 690, 212, 213, 3, 142, /* 340 */ 30, 25, 167, 164, 117, 116, 115, 30, 716, 889,
/* 350 */ 684, 227, 687, 52, 31, 83, 79, 82, 258, 228, /* 350 */ 890, 29, 893, 715, 645, 193, 46, 45, 3, 162,
/* 360 */ 689, 158, 154, 29, 60, 964, 690, 156, 111, 110, /* 360 */ 44, 43, 42, 715, 222, 207, 806, 276, 275, 12,
/* 370 */ 109, 182, 683, 4, 686, 262, 266, 270, 868, 868, /* 370 */ 161, 685, 686, 80, 652, 145, 710, 709, 713, 712,
/* 380 */ 868, 689, 646, 61, 57, 208, 125, 622, 260, 623, /* 380 */ 273, 277, 238, 903, 903, 239, 672, 61, 281, 31,
/* 390 */ 650, 651, 711, 692, 56, 18, 17, 17, 604, 245, /* 390 */ 132, 903, 676, 677, 737, 718, 60, 20, 19, 19,
/* 400 */ 606, 870, 29, 29, 56, 58, 247, 605, 183, 26, /* 400 */ 64, 194, 630, 256, 92, 91, 31, 31, 62, 6,
/* 410 */ 75, 56, 248, 105, 104, 12, 11, 694, 167, 93, /* 410 */ 178, 632, 258, 720, 631, 60, 79, 28, 60, 65,
/* 420 */ 92, 619, 63, 168, 593, 14, 13, 620, 170, 621, /* 420 */ 259, 14, 13, 67, 648, 619, 649, 179, 98, 97,
/* 430 */ 120, 118, 164, 931, 171, 172, 199, 122, 178, 179, /* 430 */ 16, 15, 646, 966, 647, 111, 110, 127, 125, 181,
/* 440 */ 177, 162, 176, 928, 166, 927, 200, 269, 884, 892, /* 440 */ 175, 182, 183, 189, 190, 188, 173, 187, 177, 905,
/* 450 */ 35, 899, 901, 124, 914, 913, 139, 864, 140, 137, /* 450 */ 210, 963, 919, 962, 211, 280, 949, 39, 129, 948,
/* 460 */ 34, 141, 226, 787, 250, 119, 645, 160, 240, 231, /* 460 */ 144, 927, 934, 36, 936, 126, 131, 146, 899, 237,
/* 470 */ 62, 32, 259, 784, 881, 59, 189, 235, 129, 54, /* 470 */ 147, 671, 142, 148, 817, 261, 136, 37, 251, 66,
/* 480 */ 131, 984, 84, 983, 130, 238, 133, 981, 132, 143, /* 480 */ 916, 58, 63, 137, 171, 138, 34, 270, 242, 249,
/* 490 */ 263, 978, 236, 234, 90, 977, 232, 134, 975, 144, /* 490 */ 813, 1019, 89, 200, 1018, 1016, 246, 139, 247, 152,
/* 500 */ 805, 135, 33, 30, 161, 774, 99, 772, 101, 95, /* 500 */ 140, 274, 1013, 95, 245, 1012, 1010, 153, 835, 35,
/* 510 */ 102, 770, 769, 214, 153, 767, 766, 765, 764, 763, /* 510 */ 243, 32, 38, 172, 40, 802, 105, 800, 107, 108,
/* 520 */ 155, 157, 760, 758, 756, 754, 752, 36, 159, 271, /* 520 */ 798, 797, 225, 163, 795, 794, 793, 792, 791, 790,
/* 530 */ 229, 68, 69, 915, 272, 273, 274, 275, 276, 277, /* 530 */ 166, 168, 787, 785, 783, 781, 779, 170, 290, 240,
/* 540 */ 288, 730, 184, 206, 249, 216, 217, 185, 180, 729, /* 540 */ 72, 73, 950, 100, 282, 283, 284, 285, 286, 287,
/* 550 */ 80, 219, 220, 728, 716, 768, 223, 227, 70, 628, /* 550 */ 288, 300, 756, 195, 217, 260, 227, 228, 755, 230,
/* 560 */ 64, 147, 146, 806, 145, 148, 149, 151, 112, 150, /* 560 */ 196, 191, 231, 84, 85, 754, 742, 234, 238, 654,
/* 570 */ 113, 647, 762, 761, 244, 114, 866, 753, 6, 126, /* 570 */ 74, 68, 673, 255, 796, 8, 156, 133, 836, 118,
/* 580 */ 136, 1, 2, 191, 233, 24, 25, 7, 652, 127, /* 580 */ 154, 159, 155, 158, 157, 160, 119, 789, 2, 120,
/* 590 */ 8, 693, 5, 9, 19, 695, 20, 78, 246, 562, /* 590 */ 870, 788, 901, 121, 780, 4, 202, 141, 678, 143,
/* 600 */ 558, 76, 556, 555, 554, 551, 525, 257, 81, 85, /* 600 */ 244, 134, 9, 10, 82, 719, 882, 26, 27, 7,
/* 610 */ 29, 596, 55, 595, 592, 89, 91, 546, 544, 536, /* 610 */ 11, 21, 721, 22, 583, 257, 579, 577, 80, 576,
/* 620 */ 542, 538, 540, 534, 532, 564, 563, 561, 560, 559, /* 620 */ 575, 572, 545, 268, 86, 90, 31, 94, 96, 59,
/* 630 */ 557, 553, 552, 56, 523, 493, 491, 734, 733, 733, /* 630 */ 622, 621, 618, 567, 565, 557, 563, 559, 561, 555,
/* 640 */ 733, 733, 733, 733, 733, 733, 733, 733, 733, 116, /* 640 */ 553, 586, 585, 584, 582, 581, 580, 578, 574, 573,
/* 650 */ 117, /* 650 */ 60, 543, 511, 509, 760, 759, 759, 759, 759, 759,
/* 660 */ 759, 759, 759, 759, 759, 759, 123, 124,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 193, 1, 185, 186, 1, 245, 187, 188, 188, 9, /* 0 */ 251, 1, 251, 190, 191, 251, 191, 5, 251, 9,
/* 10 */ 205, 188, 9, 13, 14, 255, 16, 17, 245, 192, /* 10 */ 261, 260, 261, 13, 14, 191, 16, 17, 191, 210,
/* 20 */ 20, 21, 195, 23, 24, 25, 26, 27, 28, 222, /* 20 */ 20, 21, 251, 23, 24, 25, 26, 27, 28, 188,
/* 30 */ 223, 224, 225, 33, 34, 230, 188, 37, 38, 39, /* 30 */ 189, 260, 261, 33, 34, 33, 34, 37, 38, 39,
/* 40 */ 13, 14, 228, 16, 17, 228, 226, 20, 21, 229, /* 40 */ 13, 14, 210, 16, 17, 236, 191, 20, 21, 1,
/* 50 */ 23, 24, 25, 26, 27, 28, 242, 188, 205, 242, /* 50 */ 23, 24, 25, 26, 27, 28, 232, 9, 37, 235,
/* 60 */ 33, 34, 230, 245, 37, 38, 39, 13, 14, 246, /* 60 */ 33, 34, 210, 191, 37, 38, 39, 14, 236, 16,
/* 70 */ 16, 17, 254, 255, 20, 21, 245, 23, 24, 25, /* 70 */ 17, 191, 257, 20, 21, 234, 23, 24, 25, 26,
/* 80 */ 26, 27, 28, 230, 188, 254, 255, 33, 34, 77, /* 80 */ 27, 28, 255, 191, 257, 81, 33, 34, 236, 248,
/* 90 */ 1, 37, 38, 39, 63, 64, 65, 249, 9, 251, /* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
/* 100 */ 193, 13, 14, 188, 16, 17, 205, 107, 20, 21, /* 100 */ 52, 53, 54, 55, 56, 57, 58, 252, 197, 61,
/* 110 */ 188, 23, 24, 25, 26, 27, 28, 37, 38, 39, /* 110 */ 110, 1, 232, 13, 14, 235, 16, 17, 191, 9,
/* 120 */ 251, 33, 34, 79, 193, 37, 38, 39, 188, 102, /* 120 */ 20, 21, 104, 23, 24, 25, 26, 27, 28, 257,
/* 130 */ 205, 230, 225, 188, 45, 46, 47, 48, 49, 50, /* 130 */ 112, 259, 105, 33, 34, 191, 115, 37, 38, 39,
/* 140 */ 51, 52, 53, 54, 55, 56, 57, 251, 226, 60, /* 140 */ 13, 14, 231, 16, 17, 253, 0, 20, 21, 134,
/* 150 */ 14, 229, 16, 17, 223, 230, 20, 21, 66, 23, /* 150 */ 23, 24, 25, 26, 27, 28, 141, 142, 251, 232,
/* 160 */ 24, 25, 26, 27, 28, 220, 251, 227, 253, 33, /* 160 */ 33, 34, 235, 67, 37, 38, 39, 88, 89, 90,
/* 170 */ 34, 74, 245, 37, 38, 39, 79, 86, 87, 88, /* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
/* 180 */ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, /* 180 */ 101, 102, 209, 191, 211, 212, 213, 214, 215, 216,
/* 190 */ 99, 100, 204, 5, 206, 207, 208, 209, 210, 211, /* 190 */ 217, 218, 219, 220, 221, 222, 223, 224, 16, 17,
/* 200 */ 212, 213, 214, 215, 216, 217, 218, 219, 16, 17, /* 200 */ 234, 257, 20, 21, 191, 23, 24, 25, 26, 27,
/* 210 */ 133, 134, 20, 21, 188, 23, 24, 25, 26, 27, /* 210 */ 28, 210, 44, 191, 248, 33, 34, 197, 79, 37,
/* 220 */ 28, 33, 34, 44, 132, 33, 34, 135, 136, 37, /* 220 */ 38, 39, 1, 2, 232, 79, 5, 235, 7, 61,
/* 230 */ 38, 39, 1, 2, 188, 37, 5, 188, 7, 60, /* 230 */ 9, 135, 1, 2, 138, 67, 5, 236, 7, 76,
/* 240 */ 9, 101, 33, 34, 231, 66, 37, 38, 39, 109, /* 240 */ 9, 73, 74, 75, 81, 2, 233, 191, 5, 229,
/* 250 */ 71, 72, 73, 1, 2, 229, 243, 5, 101, 7, /* 250 */ 7, 104, 9, 236, 33, 34, 237, 235, 37, 112,
/* 260 */ 86, 9, 88, 89, 33, 34, 109, 93, 37, 95, /* 260 */ 88, 1, 90, 91, 33, 34, 227, 95, 249, 97,
/* 270 */ 96, 97, 226, 99, 100, 229, 120, 121, 1, 204, /* 270 */ 98, 99, 104, 101, 102, 209, 33, 34, 212, 213,
/* 280 */ 101, 0, 207, 208, 245, 33, 34, 212, 109, 214, /* 280 */ 112, 251, 226, 217, 196, 219, 220, 221, 200, 223,
/* 290 */ 215, 216, 192, 218, 219, 195, 247, 106, 131, 25, /* 290 */ 224, 25, 26, 27, 28, 251, 67, 37, 196, 33,
/* 300 */ 26, 27, 28, 188, 113, 138, 139, 33, 34, 130, /* 300 */ 34, 133, 200, 37, 38, 39, 62, 63, 140, 37,
/* 310 */ 112, 37, 38, 39, 37, 2, 137, 101, 5, 66, /* 310 */ 38, 39, 68, 69, 70, 71, 72, 15, 197, 64,
/* 320 */ 7, 105, 9, 107, 15, 221, 192, 61, 62, 195, /* 320 */ 65, 66, 78, 62, 63, 104, 198, 199, 251, 68,
/* 330 */ 245, 59, 101, 67, 68, 69, 70, 188, 188, 188, /* 330 */ 69, 70, 71, 72, 109, 104, 62, 63, 117, 191,
/* 340 */ 245, 226, 76, 102, 229, 114, 33, 34, 61, 62, /* 340 */ 191, 116, 68, 69, 70, 71, 72, 191, 117, 228,
/* 350 */ 5, 110, 7, 101, 67, 68, 69, 70, 77, 102, /* 350 */ 229, 230, 231, 132, 111, 251, 33, 34, 194, 195,
/* 360 */ 129, 61, 62, 106, 106, 245, 114, 67, 68, 69, /* 360 */ 37, 38, 39, 132, 135, 60, 196, 138, 139, 104,
/* 370 */ 70, 245, 5, 101, 7, 226, 226, 226, 229, 229, /* 370 */ 200, 123, 124, 108, 105, 110, 5, 5, 7, 7,
/* 380 */ 229, 129, 102, 125, 106, 132, 106, 5, 135, 7, /* 380 */ 232, 232, 113, 235, 235, 105, 105, 109, 232, 109,
/* 390 */ 102, 102, 102, 102, 106, 106, 106, 106, 102, 102, /* 390 */ 109, 235, 105, 105, 105, 105, 109, 109, 109, 109,
/* 400 */ 102, 230, 106, 106, 106, 127, 102, 102, 245, 101, /* 400 */ 109, 251, 105, 105, 136, 137, 109, 109, 130, 104,
/* 410 */ 106, 106, 104, 74, 75, 133, 134, 108, 245, 133, /* 410 */ 251, 105, 105, 111, 105, 109, 109, 104, 109, 128,
/* 420 */ 134, 108, 101, 245, 103, 133, 134, 5, 245, 7, /* 420 */ 107, 136, 137, 104, 5, 106, 7, 251, 136, 137,
/* 430 */ 61, 62, 245, 221, 245, 245, 221, 188, 245, 245, /* 430 */ 136, 137, 5, 227, 7, 76, 77, 62, 63, 251,
/* 440 */ 245, 245, 245, 221, 245, 221, 221, 221, 228, 188, /* 440 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 236,
/* 450 */ 244, 188, 188, 188, 252, 252, 188, 188, 188, 232, /* 450 */ 227, 227, 234, 227, 227, 227, 258, 250, 191, 258,
/* 460 */ 109, 188, 228, 188, 188, 59, 114, 188, 118, 248, /* 460 */ 238, 191, 191, 112, 191, 60, 191, 191, 191, 234,
/* 470 */ 124, 188, 188, 188, 241, 126, 248, 248, 240, 123, /* 470 */ 191, 117, 240, 191, 191, 191, 246, 191, 121, 127,
/* 480 */ 238, 188, 188, 188, 239, 122, 236, 188, 237, 188, /* 480 */ 247, 126, 129, 245, 191, 244, 191, 191, 254, 125,
/* 490 */ 188, 188, 117, 116, 188, 188, 115, 235, 188, 188, /* 490 */ 191, 191, 191, 254, 191, 191, 254, 243, 120, 191,
/* 500 */ 188, 234, 188, 188, 188, 188, 188, 188, 188, 85, /* 500 */ 242, 191, 191, 191, 119, 191, 191, 191, 191, 191,
/* 510 */ 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, /* 510 */ 118, 191, 191, 191, 131, 191, 191, 191, 191, 191,
/* 520 */ 188, 188, 188, 188, 188, 188, 188, 128, 188, 84, /* 520 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
/* 530 */ 189, 189, 189, 189, 49, 81, 83, 53, 82, 80, /* 530 */ 191, 191, 191, 191, 191, 191, 191, 191, 103, 192,
/* 540 */ 77, 5, 189, 189, 189, 140, 5, 189, 189, 5, /* 540 */ 192, 192, 192, 87, 86, 50, 83, 85, 54, 84,
/* 550 */ 193, 140, 5, 5, 87, 189, 131, 110, 106, 102, /* 550 */ 82, 79, 5, 192, 192, 192, 143, 5, 5, 143,
/* 560 */ 111, 197, 201, 203, 202, 200, 198, 196, 190, 199, /* 560 */ 192, 192, 5, 197, 197, 5, 89, 134, 113, 105,
/* 570 */ 190, 102, 189, 189, 104, 190, 228, 189, 101, 101, /* 570 */ 109, 114, 105, 107, 192, 104, 202, 104, 208, 193,
/* 580 */ 233, 194, 191, 1, 101, 106, 106, 119, 102, 101, /* 580 */ 207, 204, 206, 203, 205, 201, 193, 192, 198, 193,
/* 590 */ 119, 102, 101, 101, 101, 108, 101, 74, 104, 9, /* 590 */ 225, 192, 234, 193, 192, 194, 1, 241, 105, 239,
/* 600 */ 5, 105, 5, 5, 5, 5, 78, 15, 74, 134, /* 600 */ 104, 104, 122, 122, 76, 105, 225, 109, 109, 104,
/* 610 */ 106, 5, 16, 5, 102, 134, 134, 5, 5, 5, /* 610 */ 104, 104, 111, 104, 9, 107, 5, 5, 108, 5,
/* 620 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 620 */ 5, 5, 80, 15, 76, 137, 109, 137, 137, 16,
/* 630 */ 5, 5, 5, 106, 78, 59, 58, 0, 256, 256, /* 630 */ 5, 5, 105, 5, 5, 5, 5, 5, 5, 5,
/* 640 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 21, /* 640 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 650 */ 21, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 650 */ 109, 80, 60, 59, 0, 262, 262, 262, 262, 262,
/* 660 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 660 */ 262, 262, 262, 262, 262, 262, 21, 21, 262, 262,
/* 670 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 670 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 680 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 680 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 690 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 690 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 700 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 700 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 710 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 710 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 720 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 720 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 730 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 730 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 740 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 740 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 750 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 750 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 760 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 760 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 770 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 770 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 780 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 780 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 790 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 790 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 800 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 800 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 810 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 810 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 820 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, /* 820 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 830 */ 256, 256, 256, 256, 256, /* 830 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 840 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 850 */ 262, 262, 262, 262, 262,
}; };
#define YY_SHIFT_COUNT (293) #define YY_SHIFT_COUNT (305)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (637) #define YY_SHIFT_MAX (654)
static const unsigned short int yy_shift_ofst[] = { static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 179, 91, 174, 12, 231, 252, 3, 3, 3, 3, /* 0 */ 168, 79, 79, 172, 172, 139, 221, 231, 110, 110,
/* 10 */ 3, 3, 3, 3, 3, 0, 89, 252, 313, 313, /* 10 */ 110, 110, 110, 110, 110, 110, 110, 0, 48, 231,
/* 20 */ 313, 313, 140, 3, 3, 3, 3, 281, 3, 3, /* 20 */ 243, 243, 243, 243, 18, 110, 110, 110, 110, 146,
/* 30 */ 97, 12, 44, 44, 651, 252, 252, 252, 252, 252, /* 30 */ 110, 110, 163, 139, 4, 4, 668, 668, 668, 231,
/* 40 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, /* 40 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
/* 50 */ 252, 252, 252, 252, 252, 313, 313, 188, 188, 188, /* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 243,
/* 60 */ 188, 188, 188, 188, 157, 3, 3, 198, 3, 3, /* 60 */ 243, 2, 2, 2, 2, 2, 2, 2, 147, 110,
/* 70 */ 3, 156, 156, 191, 3, 3, 3, 3, 3, 3, /* 70 */ 110, 21, 110, 110, 110, 248, 248, 225, 110, 110,
/* 80 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 80 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
/* 90 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 90 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
/* 100 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 100 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
/* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 110 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
/* 120 */ 3, 351, 406, 406, 406, 352, 352, 352, 406, 346, /* 120 */ 110, 110, 110, 110, 110, 110, 110, 110, 351, 405,
/* 130 */ 349, 356, 350, 363, 375, 377, 381, 399, 351, 406, /* 130 */ 405, 405, 354, 354, 354, 405, 352, 353, 355, 357,
/* 140 */ 406, 406, 12, 406, 406, 424, 445, 485, 454, 453, /* 140 */ 364, 378, 385, 392, 383, 351, 405, 405, 405, 435,
/* 150 */ 484, 456, 459, 406, 463, 406, 463, 406, 463, 406, /* 150 */ 139, 139, 405, 405, 456, 458, 495, 463, 462, 494,
/* 160 */ 651, 651, 27, 54, 88, 54, 54, 136, 192, 274, /* 160 */ 465, 468, 435, 405, 472, 472, 405, 472, 405, 472,
/* 170 */ 274, 274, 274, 266, 287, 300, 209, 209, 209, 209, /* 170 */ 405, 668, 668, 27, 100, 127, 100, 100, 53, 182,
/* 180 */ 92, 167, 80, 80, 216, 253, 31, 241, 257, 280, /* 180 */ 266, 266, 266, 266, 244, 261, 274, 323, 323, 323,
/* 190 */ 288, 289, 290, 291, 345, 367, 277, 272, 309, 278, /* 190 */ 323, 229, 15, 272, 272, 265, 96, 255, 269, 280,
/* 200 */ 258, 296, 297, 298, 304, 305, 308, 77, 282, 286, /* 200 */ 281, 287, 288, 289, 290, 371, 372, 260, 305, 302,
/* 210 */ 321, 292, 382, 422, 339, 369, 536, 405, 541, 544, /* 210 */ 278, 291, 297, 298, 306, 307, 309, 313, 268, 285,
/* 220 */ 411, 547, 548, 467, 425, 447, 457, 449, 470, 477, /* 220 */ 292, 319, 294, 419, 427, 359, 375, 547, 413, 552,
/* 230 */ 452, 469, 478, 582, 483, 486, 488, 479, 468, 480, /* 230 */ 553, 416, 557, 560, 477, 433, 455, 464, 457, 466,
/* 240 */ 471, 489, 491, 487, 492, 470, 493, 494, 495, 496, /* 240 */ 471, 461, 467, 473, 595, 496, 493, 497, 498, 480,
/* 250 */ 523, 590, 595, 597, 598, 599, 600, 528, 592, 534, /* 250 */ 499, 481, 500, 505, 501, 506, 466, 507, 508, 509,
/* 260 */ 475, 504, 504, 596, 481, 482, 504, 606, 608, 512, /* 260 */ 510, 528, 605, 611, 612, 614, 615, 616, 542, 608,
/* 270 */ 504, 612, 613, 614, 615, 616, 617, 618, 619, 620, /* 270 */ 548, 488, 517, 517, 613, 490, 491, 517, 625, 626,
/* 280 */ 621, 622, 623, 624, 625, 626, 627, 527, 556, 628, /* 280 */ 527, 517, 628, 629, 630, 631, 632, 633, 634, 635,
/* 290 */ 629, 576, 578, 637, /* 290 */ 636, 637, 638, 639, 640, 641, 642, 643, 644, 541,
/* 300 */ 571, 645, 646, 592, 594, 654,
}; };
#define YY_REDUCE_COUNT (161) #define YY_REDUCE_COUNT (172)
#define YY_REDUCE_MIN (-240) #define YY_REDUCE_MIN (-251)
#define YY_REDUCE_MAX (391) #define YY_REDUCE_MAX (402)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -183, -12, 75, -193, -182, -169, -180, -85, -152, -78, /* 0 */ -159, -27, -27, 66, 66, 121, -249, -229, -176, -128,
/* 10 */ 46, 115, 149, 150, 151, -177, -181, -240, -195, -147, /* 10 */ -173, -120, -73, -8, 148, 149, 156, -145, -187, -251,
/* 20 */ -99, -75, -186, 49, -131, -104, -60, -93, -55, 26, /* 20 */ -191, -168, -148, 1, -34, -108, -185, -56, 13, -89,
/* 30 */ -173, -69, 100, 134, 13, -227, -73, 39, 85, 95, /* 30 */ 56, 22, 88, 20, 102, 170, 19, 128, 164, -246,
/* 40 */ 120, 126, 163, 173, 178, 183, 187, 189, 190, 193, /* 40 */ -243, -93, 30, 44, 77, 104, 150, 159, 176, 188,
/* 50 */ 194, 195, 196, 197, 199, -168, 171, 104, 212, 215, /* 50 */ 189, 190, 191, 192, 193, 194, 195, 196, 197, 17,
/* 60 */ 222, 224, 225, 226, 220, 249, 261, 206, 263, 264, /* 60 */ 213, 39, 206, 223, 224, 226, 227, 228, 218, 267,
/* 70 */ 265, 202, 203, 227, 268, 269, 270, 273, 275, 276, /* 70 */ 270, 207, 271, 273, 275, 198, 201, 222, 276, 277,
/* 80 */ 279, 283, 284, 285, 293, 294, 295, 299, 301, 302, /* 80 */ 279, 282, 283, 284, 286, 293, 295, 296, 299, 300,
/* 90 */ 303, 306, 307, 310, 311, 312, 314, 315, 316, 317, /* 90 */ 301, 303, 304, 308, 310, 311, 312, 314, 315, 316,
/* 100 */ 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, /* 100 */ 317, 318, 320, 321, 322, 324, 325, 326, 327, 328,
/* 110 */ 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, /* 110 */ 329, 330, 331, 332, 333, 334, 335, 336, 337, 338,
/* 120 */ 340, 234, 341, 342, 343, 221, 228, 229, 344, 233, /* 120 */ 339, 340, 341, 342, 343, 344, 345, 346, 235, 347,
/* 130 */ 238, 245, 242, 251, 250, 262, 267, 347, 348, 353, /* 130 */ 348, 349, 234, 239, 242, 350, 233, 230, 238, 241,
/* 140 */ 354, 355, 357, 358, 359, 360, 362, 361, 364, 365, /* 140 */ 254, 258, 356, 232, 360, 358, 361, 362, 363, 365,
/* 150 */ 368, 370, 371, 366, 378, 383, 380, 384, 385, 388, /* 150 */ 366, 367, 368, 369, 370, 373, 376, 374, 379, 380,
/* 160 */ 387, 391, /* 160 */ 377, 384, 381, 382, 386, 393, 395, 396, 399, 400,
/* 170 */ 402, 390, 401,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 731, 786, 775, 783, 972, 972, 731, 731, 731, 731, /* 0 */ 757, 869, 815, 881, 803, 812, 1007, 1007, 757, 757,
/* 10 */ 731, 731, 731, 731, 731, 894, 749, 972, 731, 731, /* 10 */ 757, 757, 757, 757, 757, 757, 757, 929, 776, 1007,
/* 20 */ 731, 731, 731, 731, 731, 731, 731, 783, 731, 731, /* 20 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 812,
/* 30 */ 788, 783, 788, 788, 889, 731, 731, 731, 731, 731, /* 30 */ 757, 757, 818, 812, 818, 818, 924, 853, 871, 757,
/* 40 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 40 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 50 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 50 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 60 */ 731, 731, 731, 731, 731, 731, 731, 896, 898, 900, /* 60 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 70 */ 731, 918, 918, 887, 731, 731, 731, 731, 731, 731, /* 70 */ 757, 931, 933, 935, 757, 953, 953, 922, 757, 757,
/* 80 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 80 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 90 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 773, /* 90 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 100 */ 731, 771, 731, 731, 731, 731, 731, 731, 731, 731, /* 100 */ 757, 757, 757, 757, 757, 801, 757, 799, 757, 757,
/* 110 */ 731, 731, 731, 731, 731, 759, 731, 731, 731, 731, /* 110 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 120 */ 731, 731, 751, 751, 751, 731, 731, 731, 751, 925, /* 120 */ 757, 757, 786, 757, 757, 757, 757, 757, 757, 778,
/* 130 */ 929, 923, 911, 919, 910, 906, 905, 933, 731, 751, /* 130 */ 778, 778, 757, 757, 757, 778, 960, 964, 958, 946,
/* 140 */ 751, 751, 783, 751, 751, 804, 802, 800, 792, 798, /* 140 */ 954, 945, 941, 940, 968, 757, 778, 778, 778, 816,
/* 150 */ 794, 796, 790, 751, 781, 751, 781, 751, 781, 751, /* 150 */ 812, 812, 778, 778, 834, 832, 830, 822, 828, 824,
/* 160 */ 822, 838, 731, 934, 731, 971, 924, 961, 960, 967, /* 160 */ 826, 820, 804, 778, 810, 810, 778, 810, 778, 810,
/* 170 */ 959, 958, 957, 731, 731, 731, 953, 954, 956, 955, /* 170 */ 778, 853, 871, 757, 969, 757, 1006, 959, 996, 995,
/* 180 */ 731, 731, 963, 962, 731, 731, 731, 731, 731, 731, /* 180 */ 1002, 994, 993, 992, 757, 757, 757, 988, 989, 991,
/* 190 */ 731, 731, 731, 731, 731, 731, 731, 936, 731, 930, /* 190 */ 990, 757, 757, 998, 997, 757, 757, 757, 757, 757,
/* 200 */ 926, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 200 */ 757, 757, 757, 757, 757, 757, 757, 757, 971, 757,
/* 210 */ 848, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 210 */ 965, 961, 757, 757, 757, 757, 757, 757, 757, 757,
/* 220 */ 731, 731, 731, 731, 731, 886, 731, 731, 731, 731, /* 220 */ 757, 883, 757, 757, 757, 757, 757, 757, 757, 757,
/* 230 */ 897, 731, 731, 731, 731, 731, 731, 920, 731, 912, /* 230 */ 757, 757, 757, 757, 757, 757, 921, 757, 757, 757,
/* 240 */ 731, 731, 731, 731, 731, 860, 731, 731, 731, 731, /* 240 */ 757, 932, 757, 757, 757, 757, 757, 757, 955, 757,
/* 250 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 250 */ 947, 757, 757, 757, 757, 757, 895, 757, 757, 757,
/* 260 */ 731, 982, 980, 731, 731, 731, 976, 731, 731, 731, /* 260 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757,
/* 270 */ 974, 731, 731, 731, 731, 731, 731, 731, 731, 731, /* 270 */ 757, 757, 1017, 1015, 757, 757, 757, 1011, 757, 757,
/* 280 */ 731, 731, 731, 731, 731, 731, 731, 807, 731, 757, /* 280 */ 757, 1009, 757, 757, 757, 757, 757, 757, 757, 757,
/* 290 */ 755, 731, 747, 731, /* 290 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 837,
/* 300 */ 757, 784, 782, 757, 774, 757,
}; };
/********** End of lemon-generated parsing tables *****************************/ /********** End of lemon-generated parsing tables *****************************/
...@@ -511,6 +517,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -511,6 +517,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* BITNOT => nothing */ 0, /* BITNOT => nothing */
0, /* SHOW => nothing */ 0, /* SHOW => nothing */
0, /* DATABASES => nothing */ 0, /* DATABASES => nothing */
0, /* TOPICS => nothing */
0, /* MNODES => nothing */ 0, /* MNODES => nothing */
0, /* DNODES => nothing */ 0, /* DNODES => nothing */
0, /* ACCOUNTS => nothing */ 0, /* ACCOUNTS => nothing */
...@@ -533,6 +540,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -533,6 +540,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* VGROUPS => nothing */ 0, /* VGROUPS => nothing */
0, /* DROP => nothing */ 0, /* DROP => nothing */
1, /* STABLE => ID */ 1, /* STABLE => ID */
0, /* TOPIC => nothing */
0, /* DNODE => nothing */ 0, /* DNODE => nothing */
0, /* USER => nothing */ 0, /* USER => nothing */
0, /* ACCOUNT => nothing */ 0, /* ACCOUNT => nothing */
...@@ -566,6 +574,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -566,6 +574,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* PRECISION => nothing */ 0, /* PRECISION => nothing */
0, /* UPDATE => nothing */ 0, /* UPDATE => nothing */
0, /* CACHELAST => nothing */ 0, /* CACHELAST => nothing */
0, /* PARTITIONS => nothing */
0, /* LP => nothing */ 0, /* LP => nothing */
0, /* RP => nothing */ 0, /* RP => nothing */
0, /* UNSIGNED => nothing */ 0, /* UNSIGNED => nothing */
...@@ -781,216 +790,222 @@ static const char *const yyTokenName[] = { ...@@ -781,216 +790,222 @@ static const char *const yyTokenName[] = {
/* 43 */ "BITNOT", /* 43 */ "BITNOT",
/* 44 */ "SHOW", /* 44 */ "SHOW",
/* 45 */ "DATABASES", /* 45 */ "DATABASES",
/* 46 */ "MNODES", /* 46 */ "TOPICS",
/* 47 */ "DNODES", /* 47 */ "MNODES",
/* 48 */ "ACCOUNTS", /* 48 */ "DNODES",
/* 49 */ "USERS", /* 49 */ "ACCOUNTS",
/* 50 */ "MODULES", /* 50 */ "USERS",
/* 51 */ "QUERIES", /* 51 */ "MODULES",
/* 52 */ "CONNECTIONS", /* 52 */ "QUERIES",
/* 53 */ "STREAMS", /* 53 */ "CONNECTIONS",
/* 54 */ "VARIABLES", /* 54 */ "STREAMS",
/* 55 */ "SCORES", /* 55 */ "VARIABLES",
/* 56 */ "GRANTS", /* 56 */ "SCORES",
/* 57 */ "VNODES", /* 57 */ "GRANTS",
/* 58 */ "IPTOKEN", /* 58 */ "VNODES",
/* 59 */ "DOT", /* 59 */ "IPTOKEN",
/* 60 */ "CREATE", /* 60 */ "DOT",
/* 61 */ "TABLE", /* 61 */ "CREATE",
/* 62 */ "DATABASE", /* 62 */ "TABLE",
/* 63 */ "TABLES", /* 63 */ "DATABASE",
/* 64 */ "STABLES", /* 64 */ "TABLES",
/* 65 */ "VGROUPS", /* 65 */ "STABLES",
/* 66 */ "DROP", /* 66 */ "VGROUPS",
/* 67 */ "STABLE", /* 67 */ "DROP",
/* 68 */ "DNODE", /* 68 */ "STABLE",
/* 69 */ "USER", /* 69 */ "TOPIC",
/* 70 */ "ACCOUNT", /* 70 */ "DNODE",
/* 71 */ "USE", /* 71 */ "USER",
/* 72 */ "DESCRIBE", /* 72 */ "ACCOUNT",
/* 73 */ "ALTER", /* 73 */ "USE",
/* 74 */ "PASS", /* 74 */ "DESCRIBE",
/* 75 */ "PRIVILEGE", /* 75 */ "ALTER",
/* 76 */ "LOCAL", /* 76 */ "PASS",
/* 77 */ "IF", /* 77 */ "PRIVILEGE",
/* 78 */ "EXISTS", /* 78 */ "LOCAL",
/* 79 */ "PPS", /* 79 */ "IF",
/* 80 */ "TSERIES", /* 80 */ "EXISTS",
/* 81 */ "DBS", /* 81 */ "PPS",
/* 82 */ "STORAGE", /* 82 */ "TSERIES",
/* 83 */ "QTIME", /* 83 */ "DBS",
/* 84 */ "CONNS", /* 84 */ "STORAGE",
/* 85 */ "STATE", /* 85 */ "QTIME",
/* 86 */ "KEEP", /* 86 */ "CONNS",
/* 87 */ "CACHE", /* 87 */ "STATE",
/* 88 */ "REPLICA", /* 88 */ "KEEP",
/* 89 */ "QUORUM", /* 89 */ "CACHE",
/* 90 */ "DAYS", /* 90 */ "REPLICA",
/* 91 */ "MINROWS", /* 91 */ "QUORUM",
/* 92 */ "MAXROWS", /* 92 */ "DAYS",
/* 93 */ "BLOCKS", /* 93 */ "MINROWS",
/* 94 */ "CTIME", /* 94 */ "MAXROWS",
/* 95 */ "WAL", /* 95 */ "BLOCKS",
/* 96 */ "FSYNC", /* 96 */ "CTIME",
/* 97 */ "COMP", /* 97 */ "WAL",
/* 98 */ "PRECISION", /* 98 */ "FSYNC",
/* 99 */ "UPDATE", /* 99 */ "COMP",
/* 100 */ "CACHELAST", /* 100 */ "PRECISION",
/* 101 */ "LP", /* 101 */ "UPDATE",
/* 102 */ "RP", /* 102 */ "CACHELAST",
/* 103 */ "UNSIGNED", /* 103 */ "PARTITIONS",
/* 104 */ "TAGS", /* 104 */ "LP",
/* 105 */ "USING", /* 105 */ "RP",
/* 106 */ "COMMA", /* 106 */ "UNSIGNED",
/* 107 */ "AS", /* 107 */ "TAGS",
/* 108 */ "NULL", /* 108 */ "USING",
/* 109 */ "SELECT", /* 109 */ "COMMA",
/* 110 */ "UNION", /* 110 */ "AS",
/* 111 */ "ALL", /* 111 */ "NULL",
/* 112 */ "DISTINCT", /* 112 */ "SELECT",
/* 113 */ "FROM", /* 113 */ "UNION",
/* 114 */ "VARIABLE", /* 114 */ "ALL",
/* 115 */ "INTERVAL", /* 115 */ "DISTINCT",
/* 116 */ "FILL", /* 116 */ "FROM",
/* 117 */ "SLIDING", /* 117 */ "VARIABLE",
/* 118 */ "ORDER", /* 118 */ "INTERVAL",
/* 119 */ "BY", /* 119 */ "FILL",
/* 120 */ "ASC", /* 120 */ "SLIDING",
/* 121 */ "DESC", /* 121 */ "ORDER",
/* 122 */ "GROUP", /* 122 */ "BY",
/* 123 */ "HAVING", /* 123 */ "ASC",
/* 124 */ "LIMIT", /* 124 */ "DESC",
/* 125 */ "OFFSET", /* 125 */ "GROUP",
/* 126 */ "SLIMIT", /* 126 */ "HAVING",
/* 127 */ "SOFFSET", /* 127 */ "LIMIT",
/* 128 */ "WHERE", /* 128 */ "OFFSET",
/* 129 */ "NOW", /* 129 */ "SLIMIT",
/* 130 */ "RESET", /* 130 */ "SOFFSET",
/* 131 */ "QUERY", /* 131 */ "WHERE",
/* 132 */ "ADD", /* 132 */ "NOW",
/* 133 */ "COLUMN", /* 133 */ "RESET",
/* 134 */ "TAG", /* 134 */ "QUERY",
/* 135 */ "CHANGE", /* 135 */ "ADD",
/* 136 */ "SET", /* 136 */ "COLUMN",
/* 137 */ "KILL", /* 137 */ "TAG",
/* 138 */ "CONNECTION", /* 138 */ "CHANGE",
/* 139 */ "STREAM", /* 139 */ "SET",
/* 140 */ "COLON", /* 140 */ "KILL",
/* 141 */ "ABORT", /* 141 */ "CONNECTION",
/* 142 */ "AFTER", /* 142 */ "STREAM",
/* 143 */ "ATTACH", /* 143 */ "COLON",
/* 144 */ "BEFORE", /* 144 */ "ABORT",
/* 145 */ "BEGIN", /* 145 */ "AFTER",
/* 146 */ "CASCADE", /* 146 */ "ATTACH",
/* 147 */ "CLUSTER", /* 147 */ "BEFORE",
/* 148 */ "CONFLICT", /* 148 */ "BEGIN",
/* 149 */ "COPY", /* 149 */ "CASCADE",
/* 150 */ "DEFERRED", /* 150 */ "CLUSTER",
/* 151 */ "DELIMITERS", /* 151 */ "CONFLICT",
/* 152 */ "DETACH", /* 152 */ "COPY",
/* 153 */ "EACH", /* 153 */ "DEFERRED",
/* 154 */ "END", /* 154 */ "DELIMITERS",
/* 155 */ "EXPLAIN", /* 155 */ "DETACH",
/* 156 */ "FAIL", /* 156 */ "EACH",
/* 157 */ "FOR", /* 157 */ "END",
/* 158 */ "IGNORE", /* 158 */ "EXPLAIN",
/* 159 */ "IMMEDIATE", /* 159 */ "FAIL",
/* 160 */ "INITIALLY", /* 160 */ "FOR",
/* 161 */ "INSTEAD", /* 161 */ "IGNORE",
/* 162 */ "MATCH", /* 162 */ "IMMEDIATE",
/* 163 */ "KEY", /* 163 */ "INITIALLY",
/* 164 */ "OF", /* 164 */ "INSTEAD",
/* 165 */ "RAISE", /* 165 */ "MATCH",
/* 166 */ "REPLACE", /* 166 */ "KEY",
/* 167 */ "RESTRICT", /* 167 */ "OF",
/* 168 */ "ROW", /* 168 */ "RAISE",
/* 169 */ "STATEMENT", /* 169 */ "REPLACE",
/* 170 */ "TRIGGER", /* 170 */ "RESTRICT",
/* 171 */ "VIEW", /* 171 */ "ROW",
/* 172 */ "SEMI", /* 172 */ "STATEMENT",
/* 173 */ "NONE", /* 173 */ "TRIGGER",
/* 174 */ "PREV", /* 174 */ "VIEW",
/* 175 */ "LINEAR", /* 175 */ "SEMI",
/* 176 */ "IMPORT", /* 176 */ "NONE",
/* 177 */ "METRIC", /* 177 */ "PREV",
/* 178 */ "TBNAME", /* 178 */ "LINEAR",
/* 179 */ "JOIN", /* 179 */ "IMPORT",
/* 180 */ "METRICS", /* 180 */ "METRIC",
/* 181 */ "INSERT", /* 181 */ "TBNAME",
/* 182 */ "INTO", /* 182 */ "JOIN",
/* 183 */ "VALUES", /* 183 */ "METRICS",
/* 184 */ "error", /* 184 */ "INSERT",
/* 185 */ "program", /* 185 */ "INTO",
/* 186 */ "cmd", /* 186 */ "VALUES",
/* 187 */ "dbPrefix", /* 187 */ "error",
/* 188 */ "ids", /* 188 */ "program",
/* 189 */ "cpxName", /* 189 */ "cmd",
/* 190 */ "ifexists", /* 190 */ "dbPrefix",
/* 191 */ "alter_db_optr", /* 191 */ "ids",
/* 192 */ "acct_optr", /* 192 */ "cpxName",
/* 193 */ "ifnotexists", /* 193 */ "ifexists",
/* 194 */ "db_optr", /* 194 */ "alter_db_optr",
/* 195 */ "pps", /* 195 */ "alter_topic_optr",
/* 196 */ "tseries", /* 196 */ "acct_optr",
/* 197 */ "dbs", /* 197 */ "ifnotexists",
/* 198 */ "streams", /* 198 */ "db_optr",
/* 199 */ "storage", /* 199 */ "topic_optr",
/* 200 */ "qtime", /* 200 */ "pps",
/* 201 */ "users", /* 201 */ "tseries",
/* 202 */ "conns", /* 202 */ "dbs",
/* 203 */ "state", /* 203 */ "streams",
/* 204 */ "keep", /* 204 */ "storage",
/* 205 */ "tagitemlist", /* 205 */ "qtime",
/* 206 */ "cache", /* 206 */ "users",
/* 207 */ "replica", /* 207 */ "conns",
/* 208 */ "quorum", /* 208 */ "state",
/* 209 */ "days", /* 209 */ "keep",
/* 210 */ "minrows", /* 210 */ "tagitemlist",
/* 211 */ "maxrows", /* 211 */ "cache",
/* 212 */ "blocks", /* 212 */ "replica",
/* 213 */ "ctime", /* 213 */ "quorum",
/* 214 */ "wal", /* 214 */ "days",
/* 215 */ "fsync", /* 215 */ "minrows",
/* 216 */ "comp", /* 216 */ "maxrows",
/* 217 */ "prec", /* 217 */ "blocks",
/* 218 */ "update", /* 218 */ "ctime",
/* 219 */ "cachelast", /* 219 */ "wal",
/* 220 */ "typename", /* 220 */ "fsync",
/* 221 */ "signed", /* 221 */ "comp",
/* 222 */ "create_table_args", /* 222 */ "prec",
/* 223 */ "create_stable_args", /* 223 */ "update",
/* 224 */ "create_table_list", /* 224 */ "cachelast",
/* 225 */ "create_from_stable", /* 225 */ "partitions",
/* 226 */ "columnlist", /* 226 */ "typename",
/* 227 */ "tagNamelist", /* 227 */ "signed",
/* 228 */ "select", /* 228 */ "create_table_args",
/* 229 */ "column", /* 229 */ "create_stable_args",
/* 230 */ "tagitem", /* 230 */ "create_table_list",
/* 231 */ "selcollist", /* 231 */ "create_from_stable",
/* 232 */ "from", /* 232 */ "columnlist",
/* 233 */ "where_opt", /* 233 */ "tagNamelist",
/* 234 */ "interval_opt", /* 234 */ "select",
/* 235 */ "fill_opt", /* 235 */ "column",
/* 236 */ "sliding_opt", /* 236 */ "tagitem",
/* 237 */ "groupby_opt", /* 237 */ "selcollist",
/* 238 */ "orderby_opt", /* 238 */ "from",
/* 239 */ "having_opt", /* 239 */ "where_opt",
/* 240 */ "slimit_opt", /* 240 */ "interval_opt",
/* 241 */ "limit_opt", /* 241 */ "fill_opt",
/* 242 */ "union", /* 242 */ "sliding_opt",
/* 243 */ "sclp", /* 243 */ "groupby_opt",
/* 244 */ "distinct", /* 244 */ "orderby_opt",
/* 245 */ "expr", /* 245 */ "having_opt",
/* 246 */ "as", /* 246 */ "slimit_opt",
/* 247 */ "tablelist", /* 247 */ "limit_opt",
/* 248 */ "tmvar", /* 248 */ "union",
/* 249 */ "sortlist", /* 249 */ "sclp",
/* 250 */ "sortitem", /* 250 */ "distinct",
/* 251 */ "item", /* 251 */ "expr",
/* 252 */ "sortorder", /* 252 */ "as",
/* 253 */ "grouplist", /* 253 */ "tablelist",
/* 254 */ "exprlist", /* 254 */ "tmvar",
/* 255 */ "expritem", /* 255 */ "sortlist",
/* 256 */ "sortitem",
/* 257 */ "item",
/* 258 */ "sortorder",
/* 259 */ "grouplist",
/* 260 */ "exprlist",
/* 261 */ "expritem",
}; };
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
...@@ -1000,258 +1015,267 @@ static const char *const yyTokenName[] = { ...@@ -1000,258 +1015,267 @@ static const char *const yyTokenName[] = {
static const char *const yyRuleName[] = { static const char *const yyRuleName[] = {
/* 0 */ "program ::= cmd", /* 0 */ "program ::= cmd",
/* 1 */ "cmd ::= SHOW DATABASES", /* 1 */ "cmd ::= SHOW DATABASES",
/* 2 */ "cmd ::= SHOW MNODES", /* 2 */ "cmd ::= SHOW TOPICS",
/* 3 */ "cmd ::= SHOW DNODES", /* 3 */ "cmd ::= SHOW MNODES",
/* 4 */ "cmd ::= SHOW ACCOUNTS", /* 4 */ "cmd ::= SHOW DNODES",
/* 5 */ "cmd ::= SHOW USERS", /* 5 */ "cmd ::= SHOW ACCOUNTS",
/* 6 */ "cmd ::= SHOW MODULES", /* 6 */ "cmd ::= SHOW USERS",
/* 7 */ "cmd ::= SHOW QUERIES", /* 7 */ "cmd ::= SHOW MODULES",
/* 8 */ "cmd ::= SHOW CONNECTIONS", /* 8 */ "cmd ::= SHOW QUERIES",
/* 9 */ "cmd ::= SHOW STREAMS", /* 9 */ "cmd ::= SHOW CONNECTIONS",
/* 10 */ "cmd ::= SHOW VARIABLES", /* 10 */ "cmd ::= SHOW STREAMS",
/* 11 */ "cmd ::= SHOW SCORES", /* 11 */ "cmd ::= SHOW VARIABLES",
/* 12 */ "cmd ::= SHOW GRANTS", /* 12 */ "cmd ::= SHOW SCORES",
/* 13 */ "cmd ::= SHOW VNODES", /* 13 */ "cmd ::= SHOW GRANTS",
/* 14 */ "cmd ::= SHOW VNODES IPTOKEN", /* 14 */ "cmd ::= SHOW VNODES",
/* 15 */ "dbPrefix ::=", /* 15 */ "cmd ::= SHOW VNODES IPTOKEN",
/* 16 */ "dbPrefix ::= ids DOT", /* 16 */ "dbPrefix ::=",
/* 17 */ "cpxName ::=", /* 17 */ "dbPrefix ::= ids DOT",
/* 18 */ "cpxName ::= DOT ids", /* 18 */ "cpxName ::=",
/* 19 */ "cmd ::= SHOW CREATE TABLE ids cpxName", /* 19 */ "cpxName ::= DOT ids",
/* 20 */ "cmd ::= SHOW CREATE DATABASE ids", /* 20 */ "cmd ::= SHOW CREATE TABLE ids cpxName",
/* 21 */ "cmd ::= SHOW dbPrefix TABLES", /* 21 */ "cmd ::= SHOW CREATE DATABASE ids",
/* 22 */ "cmd ::= SHOW dbPrefix TABLES LIKE ids", /* 22 */ "cmd ::= SHOW dbPrefix TABLES",
/* 23 */ "cmd ::= SHOW dbPrefix STABLES", /* 23 */ "cmd ::= SHOW dbPrefix TABLES LIKE ids",
/* 24 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids", /* 24 */ "cmd ::= SHOW dbPrefix STABLES",
/* 25 */ "cmd ::= SHOW dbPrefix VGROUPS", /* 25 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids",
/* 26 */ "cmd ::= SHOW dbPrefix VGROUPS ids", /* 26 */ "cmd ::= SHOW dbPrefix VGROUPS",
/* 27 */ "cmd ::= DROP TABLE ifexists ids cpxName", /* 27 */ "cmd ::= SHOW dbPrefix VGROUPS ids",
/* 28 */ "cmd ::= DROP STABLE ifexists ids cpxName", /* 28 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 29 */ "cmd ::= DROP DATABASE ifexists ids", /* 29 */ "cmd ::= DROP STABLE ifexists ids cpxName",
/* 30 */ "cmd ::= DROP DNODE ids", /* 30 */ "cmd ::= DROP DATABASE ifexists ids",
/* 31 */ "cmd ::= DROP USER ids", /* 31 */ "cmd ::= DROP TOPIC ifexists ids",
/* 32 */ "cmd ::= DROP ACCOUNT ids", /* 32 */ "cmd ::= DROP DNODE ids",
/* 33 */ "cmd ::= USE ids", /* 33 */ "cmd ::= DROP USER ids",
/* 34 */ "cmd ::= DESCRIBE ids cpxName", /* 34 */ "cmd ::= DROP ACCOUNT ids",
/* 35 */ "cmd ::= ALTER USER ids PASS ids", /* 35 */ "cmd ::= USE ids",
/* 36 */ "cmd ::= ALTER USER ids PRIVILEGE ids", /* 36 */ "cmd ::= DESCRIBE ids cpxName",
/* 37 */ "cmd ::= ALTER DNODE ids ids", /* 37 */ "cmd ::= ALTER USER ids PASS ids",
/* 38 */ "cmd ::= ALTER DNODE ids ids ids", /* 38 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
/* 39 */ "cmd ::= ALTER LOCAL ids", /* 39 */ "cmd ::= ALTER DNODE ids ids",
/* 40 */ "cmd ::= ALTER LOCAL ids ids", /* 40 */ "cmd ::= ALTER DNODE ids ids ids",
/* 41 */ "cmd ::= ALTER DATABASE ids alter_db_optr", /* 41 */ "cmd ::= ALTER LOCAL ids",
/* 42 */ "cmd ::= ALTER ACCOUNT ids acct_optr", /* 42 */ "cmd ::= ALTER LOCAL ids ids",
/* 43 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", /* 43 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
/* 44 */ "ids ::= ID", /* 44 */ "cmd ::= ALTER TOPIC ids alter_topic_optr",
/* 45 */ "ids ::= STRING", /* 45 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
/* 46 */ "ifexists ::= IF EXISTS", /* 46 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
/* 47 */ "ifexists ::=", /* 47 */ "ids ::= ID",
/* 48 */ "ifnotexists ::= IF NOT EXISTS", /* 48 */ "ids ::= STRING",
/* 49 */ "ifnotexists ::=", /* 49 */ "ifexists ::= IF EXISTS",
/* 50 */ "cmd ::= CREATE DNODE ids", /* 50 */ "ifexists ::=",
/* 51 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", /* 51 */ "ifnotexists ::= IF NOT EXISTS",
/* 52 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", /* 52 */ "ifnotexists ::=",
/* 53 */ "cmd ::= CREATE USER ids PASS ids", /* 53 */ "cmd ::= CREATE DNODE ids",
/* 54 */ "pps ::=", /* 54 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
/* 55 */ "pps ::= PPS INTEGER", /* 55 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
/* 56 */ "tseries ::=", /* 56 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr",
/* 57 */ "tseries ::= TSERIES INTEGER", /* 57 */ "cmd ::= CREATE USER ids PASS ids",
/* 58 */ "dbs ::=", /* 58 */ "pps ::=",
/* 59 */ "dbs ::= DBS INTEGER", /* 59 */ "pps ::= PPS INTEGER",
/* 60 */ "streams ::=", /* 60 */ "tseries ::=",
/* 61 */ "streams ::= STREAMS INTEGER", /* 61 */ "tseries ::= TSERIES INTEGER",
/* 62 */ "storage ::=", /* 62 */ "dbs ::=",
/* 63 */ "storage ::= STORAGE INTEGER", /* 63 */ "dbs ::= DBS INTEGER",
/* 64 */ "qtime ::=", /* 64 */ "streams ::=",
/* 65 */ "qtime ::= QTIME INTEGER", /* 65 */ "streams ::= STREAMS INTEGER",
/* 66 */ "users ::=", /* 66 */ "storage ::=",
/* 67 */ "users ::= USERS INTEGER", /* 67 */ "storage ::= STORAGE INTEGER",
/* 68 */ "conns ::=", /* 68 */ "qtime ::=",
/* 69 */ "conns ::= CONNS INTEGER", /* 69 */ "qtime ::= QTIME INTEGER",
/* 70 */ "state ::=", /* 70 */ "users ::=",
/* 71 */ "state ::= STATE ids", /* 71 */ "users ::= USERS INTEGER",
/* 72 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", /* 72 */ "conns ::=",
/* 73 */ "keep ::= KEEP tagitemlist", /* 73 */ "conns ::= CONNS INTEGER",
/* 74 */ "cache ::= CACHE INTEGER", /* 74 */ "state ::=",
/* 75 */ "replica ::= REPLICA INTEGER", /* 75 */ "state ::= STATE ids",
/* 76 */ "quorum ::= QUORUM INTEGER", /* 76 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
/* 77 */ "days ::= DAYS INTEGER", /* 77 */ "keep ::= KEEP tagitemlist",
/* 78 */ "minrows ::= MINROWS INTEGER", /* 78 */ "cache ::= CACHE INTEGER",
/* 79 */ "maxrows ::= MAXROWS INTEGER", /* 79 */ "replica ::= REPLICA INTEGER",
/* 80 */ "blocks ::= BLOCKS INTEGER", /* 80 */ "quorum ::= QUORUM INTEGER",
/* 81 */ "ctime ::= CTIME INTEGER", /* 81 */ "days ::= DAYS INTEGER",
/* 82 */ "wal ::= WAL INTEGER", /* 82 */ "minrows ::= MINROWS INTEGER",
/* 83 */ "fsync ::= FSYNC INTEGER", /* 83 */ "maxrows ::= MAXROWS INTEGER",
/* 84 */ "comp ::= COMP INTEGER", /* 84 */ "blocks ::= BLOCKS INTEGER",
/* 85 */ "prec ::= PRECISION STRING", /* 85 */ "ctime ::= CTIME INTEGER",
/* 86 */ "update ::= UPDATE INTEGER", /* 86 */ "wal ::= WAL INTEGER",
/* 87 */ "cachelast ::= CACHELAST INTEGER", /* 87 */ "fsync ::= FSYNC INTEGER",
/* 88 */ "db_optr ::=", /* 88 */ "comp ::= COMP INTEGER",
/* 89 */ "db_optr ::= db_optr cache", /* 89 */ "prec ::= PRECISION STRING",
/* 90 */ "db_optr ::= db_optr replica", /* 90 */ "update ::= UPDATE INTEGER",
/* 91 */ "db_optr ::= db_optr quorum", /* 91 */ "cachelast ::= CACHELAST INTEGER",
/* 92 */ "db_optr ::= db_optr days", /* 92 */ "partitions ::= PARTITIONS INTEGER",
/* 93 */ "db_optr ::= db_optr minrows", /* 93 */ "db_optr ::=",
/* 94 */ "db_optr ::= db_optr maxrows", /* 94 */ "db_optr ::= db_optr cache",
/* 95 */ "db_optr ::= db_optr blocks", /* 95 */ "db_optr ::= db_optr replica",
/* 96 */ "db_optr ::= db_optr ctime", /* 96 */ "db_optr ::= db_optr quorum",
/* 97 */ "db_optr ::= db_optr wal", /* 97 */ "db_optr ::= db_optr days",
/* 98 */ "db_optr ::= db_optr fsync", /* 98 */ "db_optr ::= db_optr minrows",
/* 99 */ "db_optr ::= db_optr comp", /* 99 */ "db_optr ::= db_optr maxrows",
/* 100 */ "db_optr ::= db_optr prec", /* 100 */ "db_optr ::= db_optr blocks",
/* 101 */ "db_optr ::= db_optr keep", /* 101 */ "db_optr ::= db_optr ctime",
/* 102 */ "db_optr ::= db_optr update", /* 102 */ "db_optr ::= db_optr wal",
/* 103 */ "db_optr ::= db_optr cachelast", /* 103 */ "db_optr ::= db_optr fsync",
/* 104 */ "alter_db_optr ::=", /* 104 */ "db_optr ::= db_optr comp",
/* 105 */ "alter_db_optr ::= alter_db_optr replica", /* 105 */ "db_optr ::= db_optr prec",
/* 106 */ "alter_db_optr ::= alter_db_optr quorum", /* 106 */ "db_optr ::= db_optr keep",
/* 107 */ "alter_db_optr ::= alter_db_optr keep", /* 107 */ "db_optr ::= db_optr update",
/* 108 */ "alter_db_optr ::= alter_db_optr blocks", /* 108 */ "db_optr ::= db_optr cachelast",
/* 109 */ "alter_db_optr ::= alter_db_optr comp", /* 109 */ "topic_optr ::= db_optr",
/* 110 */ "alter_db_optr ::= alter_db_optr wal", /* 110 */ "topic_optr ::= topic_optr partitions",
/* 111 */ "alter_db_optr ::= alter_db_optr fsync", /* 111 */ "alter_db_optr ::=",
/* 112 */ "alter_db_optr ::= alter_db_optr update", /* 112 */ "alter_db_optr ::= alter_db_optr replica",
/* 113 */ "alter_db_optr ::= alter_db_optr cachelast", /* 113 */ "alter_db_optr ::= alter_db_optr quorum",
/* 114 */ "typename ::= ids", /* 114 */ "alter_db_optr ::= alter_db_optr keep",
/* 115 */ "typename ::= ids LP signed RP", /* 115 */ "alter_db_optr ::= alter_db_optr blocks",
/* 116 */ "typename ::= ids UNSIGNED", /* 116 */ "alter_db_optr ::= alter_db_optr comp",
/* 117 */ "signed ::= INTEGER", /* 117 */ "alter_db_optr ::= alter_db_optr wal",
/* 118 */ "signed ::= PLUS INTEGER", /* 118 */ "alter_db_optr ::= alter_db_optr fsync",
/* 119 */ "signed ::= MINUS INTEGER", /* 119 */ "alter_db_optr ::= alter_db_optr update",
/* 120 */ "cmd ::= CREATE TABLE create_table_args", /* 120 */ "alter_db_optr ::= alter_db_optr cachelast",
/* 121 */ "cmd ::= CREATE TABLE create_stable_args", /* 121 */ "alter_topic_optr ::= alter_db_optr",
/* 122 */ "cmd ::= CREATE STABLE create_stable_args", /* 122 */ "alter_topic_optr ::= alter_topic_optr partitions",
/* 123 */ "cmd ::= CREATE TABLE create_table_list", /* 123 */ "typename ::= ids",
/* 124 */ "create_table_list ::= create_from_stable", /* 124 */ "typename ::= ids LP signed RP",
/* 125 */ "create_table_list ::= create_table_list create_from_stable", /* 125 */ "typename ::= ids UNSIGNED",
/* 126 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", /* 126 */ "signed ::= INTEGER",
/* 127 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", /* 127 */ "signed ::= PLUS INTEGER",
/* 128 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", /* 128 */ "signed ::= MINUS INTEGER",
/* 129 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP", /* 129 */ "cmd ::= CREATE TABLE create_table_args",
/* 130 */ "tagNamelist ::= tagNamelist COMMA ids", /* 130 */ "cmd ::= CREATE TABLE create_stable_args",
/* 131 */ "tagNamelist ::= ids", /* 131 */ "cmd ::= CREATE STABLE create_stable_args",
/* 132 */ "create_table_args ::= ifnotexists ids cpxName AS select", /* 132 */ "cmd ::= CREATE TABLE create_table_list",
/* 133 */ "columnlist ::= columnlist COMMA column", /* 133 */ "create_table_list ::= create_from_stable",
/* 134 */ "columnlist ::= column", /* 134 */ "create_table_list ::= create_table_list create_from_stable",
/* 135 */ "column ::= ids typename", /* 135 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
/* 136 */ "tagitemlist ::= tagitemlist COMMA tagitem", /* 136 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
/* 137 */ "tagitemlist ::= tagitem", /* 137 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
/* 138 */ "tagitem ::= INTEGER", /* 138 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP",
/* 139 */ "tagitem ::= FLOAT", /* 139 */ "tagNamelist ::= tagNamelist COMMA ids",
/* 140 */ "tagitem ::= STRING", /* 140 */ "tagNamelist ::= ids",
/* 141 */ "tagitem ::= BOOL", /* 141 */ "create_table_args ::= ifnotexists ids cpxName AS select",
/* 142 */ "tagitem ::= NULL", /* 142 */ "columnlist ::= columnlist COMMA column",
/* 143 */ "tagitem ::= MINUS INTEGER", /* 143 */ "columnlist ::= column",
/* 144 */ "tagitem ::= MINUS FLOAT", /* 144 */ "column ::= ids typename",
/* 145 */ "tagitem ::= PLUS INTEGER", /* 145 */ "tagitemlist ::= tagitemlist COMMA tagitem",
/* 146 */ "tagitem ::= PLUS FLOAT", /* 146 */ "tagitemlist ::= tagitem",
/* 147 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", /* 147 */ "tagitem ::= INTEGER",
/* 148 */ "union ::= select", /* 148 */ "tagitem ::= FLOAT",
/* 149 */ "union ::= LP union RP", /* 149 */ "tagitem ::= STRING",
/* 150 */ "union ::= union UNION ALL select", /* 150 */ "tagitem ::= BOOL",
/* 151 */ "union ::= union UNION ALL LP select RP", /* 151 */ "tagitem ::= NULL",
/* 152 */ "cmd ::= union", /* 152 */ "tagitem ::= MINUS INTEGER",
/* 153 */ "select ::= SELECT selcollist", /* 153 */ "tagitem ::= MINUS FLOAT",
/* 154 */ "sclp ::= selcollist COMMA", /* 154 */ "tagitem ::= PLUS INTEGER",
/* 155 */ "sclp ::=", /* 155 */ "tagitem ::= PLUS FLOAT",
/* 156 */ "selcollist ::= sclp distinct expr as", /* 156 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt",
/* 157 */ "selcollist ::= sclp STAR", /* 157 */ "union ::= select",
/* 158 */ "as ::= AS ids", /* 158 */ "union ::= LP union RP",
/* 159 */ "as ::= ids", /* 159 */ "union ::= union UNION ALL select",
/* 160 */ "as ::=", /* 160 */ "union ::= union UNION ALL LP select RP",
/* 161 */ "distinct ::= DISTINCT", /* 161 */ "cmd ::= union",
/* 162 */ "distinct ::=", /* 162 */ "select ::= SELECT selcollist",
/* 163 */ "from ::= FROM tablelist", /* 163 */ "sclp ::= selcollist COMMA",
/* 164 */ "tablelist ::= ids cpxName", /* 164 */ "sclp ::=",
/* 165 */ "tablelist ::= ids cpxName ids", /* 165 */ "selcollist ::= sclp distinct expr as",
/* 166 */ "tablelist ::= tablelist COMMA ids cpxName", /* 166 */ "selcollist ::= sclp STAR",
/* 167 */ "tablelist ::= tablelist COMMA ids cpxName ids", /* 167 */ "as ::= AS ids",
/* 168 */ "tmvar ::= VARIABLE", /* 168 */ "as ::= ids",
/* 169 */ "interval_opt ::= INTERVAL LP tmvar RP", /* 169 */ "as ::=",
/* 170 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", /* 170 */ "distinct ::= DISTINCT",
/* 171 */ "interval_opt ::=", /* 171 */ "distinct ::=",
/* 172 */ "fill_opt ::=", /* 172 */ "from ::= FROM tablelist",
/* 173 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", /* 173 */ "tablelist ::= ids cpxName",
/* 174 */ "fill_opt ::= FILL LP ID RP", /* 174 */ "tablelist ::= ids cpxName ids",
/* 175 */ "sliding_opt ::= SLIDING LP tmvar RP", /* 175 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 176 */ "sliding_opt ::=", /* 176 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 177 */ "orderby_opt ::=", /* 177 */ "tmvar ::= VARIABLE",
/* 178 */ "orderby_opt ::= ORDER BY sortlist", /* 178 */ "interval_opt ::= INTERVAL LP tmvar RP",
/* 179 */ "sortlist ::= sortlist COMMA item sortorder", /* 179 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP",
/* 180 */ "sortlist ::= item sortorder", /* 180 */ "interval_opt ::=",
/* 181 */ "item ::= ids cpxName", /* 181 */ "fill_opt ::=",
/* 182 */ "sortorder ::= ASC", /* 182 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 183 */ "sortorder ::= DESC", /* 183 */ "fill_opt ::= FILL LP ID RP",
/* 184 */ "sortorder ::=", /* 184 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 185 */ "groupby_opt ::=", /* 185 */ "sliding_opt ::=",
/* 186 */ "groupby_opt ::= GROUP BY grouplist", /* 186 */ "orderby_opt ::=",
/* 187 */ "grouplist ::= grouplist COMMA item", /* 187 */ "orderby_opt ::= ORDER BY sortlist",
/* 188 */ "grouplist ::= item", /* 188 */ "sortlist ::= sortlist COMMA item sortorder",
/* 189 */ "having_opt ::=", /* 189 */ "sortlist ::= item sortorder",
/* 190 */ "having_opt ::= HAVING expr", /* 190 */ "item ::= ids cpxName",
/* 191 */ "limit_opt ::=", /* 191 */ "sortorder ::= ASC",
/* 192 */ "limit_opt ::= LIMIT signed", /* 192 */ "sortorder ::= DESC",
/* 193 */ "limit_opt ::= LIMIT signed OFFSET signed", /* 193 */ "sortorder ::=",
/* 194 */ "limit_opt ::= LIMIT signed COMMA signed", /* 194 */ "groupby_opt ::=",
/* 195 */ "slimit_opt ::=", /* 195 */ "groupby_opt ::= GROUP BY grouplist",
/* 196 */ "slimit_opt ::= SLIMIT signed", /* 196 */ "grouplist ::= grouplist COMMA item",
/* 197 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", /* 197 */ "grouplist ::= item",
/* 198 */ "slimit_opt ::= SLIMIT signed COMMA signed", /* 198 */ "having_opt ::=",
/* 199 */ "where_opt ::=", /* 199 */ "having_opt ::= HAVING expr",
/* 200 */ "where_opt ::= WHERE expr", /* 200 */ "limit_opt ::=",
/* 201 */ "expr ::= LP expr RP", /* 201 */ "limit_opt ::= LIMIT signed",
/* 202 */ "expr ::= ID", /* 202 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 203 */ "expr ::= ID DOT ID", /* 203 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 204 */ "expr ::= ID DOT STAR", /* 204 */ "slimit_opt ::=",
/* 205 */ "expr ::= INTEGER", /* 205 */ "slimit_opt ::= SLIMIT signed",
/* 206 */ "expr ::= MINUS INTEGER", /* 206 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 207 */ "expr ::= PLUS INTEGER", /* 207 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 208 */ "expr ::= FLOAT", /* 208 */ "where_opt ::=",
/* 209 */ "expr ::= MINUS FLOAT", /* 209 */ "where_opt ::= WHERE expr",
/* 210 */ "expr ::= PLUS FLOAT", /* 210 */ "expr ::= LP expr RP",
/* 211 */ "expr ::= STRING", /* 211 */ "expr ::= ID",
/* 212 */ "expr ::= NOW", /* 212 */ "expr ::= ID DOT ID",
/* 213 */ "expr ::= VARIABLE", /* 213 */ "expr ::= ID DOT STAR",
/* 214 */ "expr ::= BOOL", /* 214 */ "expr ::= INTEGER",
/* 215 */ "expr ::= ID LP exprlist RP", /* 215 */ "expr ::= MINUS INTEGER",
/* 216 */ "expr ::= ID LP STAR RP", /* 216 */ "expr ::= PLUS INTEGER",
/* 217 */ "expr ::= expr IS NULL", /* 217 */ "expr ::= FLOAT",
/* 218 */ "expr ::= expr IS NOT NULL", /* 218 */ "expr ::= MINUS FLOAT",
/* 219 */ "expr ::= expr LT expr", /* 219 */ "expr ::= PLUS FLOAT",
/* 220 */ "expr ::= expr GT expr", /* 220 */ "expr ::= STRING",
/* 221 */ "expr ::= expr LE expr", /* 221 */ "expr ::= NOW",
/* 222 */ "expr ::= expr GE expr", /* 222 */ "expr ::= VARIABLE",
/* 223 */ "expr ::= expr NE expr", /* 223 */ "expr ::= BOOL",
/* 224 */ "expr ::= expr EQ expr", /* 224 */ "expr ::= ID LP exprlist RP",
/* 225 */ "expr ::= expr BETWEEN expr AND expr", /* 225 */ "expr ::= ID LP STAR RP",
/* 226 */ "expr ::= expr AND expr", /* 226 */ "expr ::= expr IS NULL",
/* 227 */ "expr ::= expr OR expr", /* 227 */ "expr ::= expr IS NOT NULL",
/* 228 */ "expr ::= expr PLUS expr", /* 228 */ "expr ::= expr LT expr",
/* 229 */ "expr ::= expr MINUS expr", /* 229 */ "expr ::= expr GT expr",
/* 230 */ "expr ::= expr STAR expr", /* 230 */ "expr ::= expr LE expr",
/* 231 */ "expr ::= expr SLASH expr", /* 231 */ "expr ::= expr GE expr",
/* 232 */ "expr ::= expr REM expr", /* 232 */ "expr ::= expr NE expr",
/* 233 */ "expr ::= expr LIKE expr", /* 233 */ "expr ::= expr EQ expr",
/* 234 */ "expr ::= expr IN LP exprlist RP", /* 234 */ "expr ::= expr BETWEEN expr AND expr",
/* 235 */ "exprlist ::= exprlist COMMA expritem", /* 235 */ "expr ::= expr AND expr",
/* 236 */ "exprlist ::= expritem", /* 236 */ "expr ::= expr OR expr",
/* 237 */ "expritem ::= expr", /* 237 */ "expr ::= expr PLUS expr",
/* 238 */ "expritem ::=", /* 238 */ "expr ::= expr MINUS expr",
/* 239 */ "cmd ::= RESET QUERY CACHE", /* 239 */ "expr ::= expr STAR expr",
/* 240 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", /* 240 */ "expr ::= expr SLASH expr",
/* 241 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", /* 241 */ "expr ::= expr REM expr",
/* 242 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", /* 242 */ "expr ::= expr LIKE expr",
/* 243 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", /* 243 */ "expr ::= expr IN LP exprlist RP",
/* 244 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", /* 244 */ "exprlist ::= exprlist COMMA expritem",
/* 245 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", /* 245 */ "exprlist ::= expritem",
/* 246 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", /* 246 */ "expritem ::= expr",
/* 247 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", /* 247 */ "expritem ::=",
/* 248 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", /* 248 */ "cmd ::= RESET QUERY CACHE",
/* 249 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", /* 249 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 250 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", /* 250 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 251 */ "cmd ::= KILL CONNECTION INTEGER", /* 251 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 252 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", /* 252 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 253 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", /* 253 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 254 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 255 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 256 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 257 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 258 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 259 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 260 */ "cmd ::= KILL CONNECTION INTEGER",
/* 261 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 262 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
}; };
#endif /* NDEBUG */ #endif /* NDEBUG */
...@@ -1372,52 +1396,52 @@ static void yy_destructor( ...@@ -1372,52 +1396,52 @@ static void yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 204: /* keep */ case 209: /* keep */
case 205: /* tagitemlist */ case 210: /* tagitemlist */
case 226: /* columnlist */ case 232: /* columnlist */
case 227: /* tagNamelist */ case 233: /* tagNamelist */
case 235: /* fill_opt */ case 241: /* fill_opt */
case 237: /* groupby_opt */ case 243: /* groupby_opt */
case 238: /* orderby_opt */ case 244: /* orderby_opt */
case 249: /* sortlist */ case 255: /* sortlist */
case 253: /* grouplist */ case 259: /* grouplist */
{ {
taosArrayDestroy((yypminor->yy349)); taosArrayDestroy((yypminor->yy429));
} }
break; break;
case 224: /* create_table_list */ case 230: /* create_table_list */
{ {
destroyCreateTableSql((yypminor->yy278)); destroyCreateTableSql((yypminor->yy310));
} }
break; break;
case 228: /* select */ case 234: /* select */
{ {
doDestroyQuerySql((yypminor->yy216)); doDestroyQuerySql((yypminor->yy372));
} }
break; break;
case 231: /* selcollist */ case 237: /* selcollist */
case 243: /* sclp */ case 249: /* sclp */
case 254: /* exprlist */ case 260: /* exprlist */
{ {
tSqlExprListDestroy((yypminor->yy258)); tSqlExprListDestroy((yypminor->yy170));
} }
break; break;
case 233: /* where_opt */ case 239: /* where_opt */
case 239: /* having_opt */ case 245: /* having_opt */
case 245: /* expr */ case 251: /* expr */
case 255: /* expritem */ case 261: /* expritem */
{ {
tSqlExprDestroy((yypminor->yy114)); tSqlExprDestroy((yypminor->yy282));
} }
break; break;
case 242: /* union */ case 248: /* union */
{ {
destroyAllSelectClause((yypminor->yy417)); destroyAllSelectClause((yypminor->yy141));
} }
break; break;
case 250: /* sortitem */ case 256: /* sortitem */
{ {
tVariantDestroy(&(yypminor->yy426)); tVariantDestroy(&(yypminor->yy218));
} }
break; break;
/********* End destructor definitions *****************************************/ /********* End destructor definitions *****************************************/
...@@ -1711,260 +1735,269 @@ static const struct { ...@@ -1711,260 +1735,269 @@ static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = { } yyRuleInfo[] = {
{ 185, -1 }, /* (0) program ::= cmd */ { 188, -1 }, /* (0) program ::= cmd */
{ 186, -2 }, /* (1) cmd ::= SHOW DATABASES */ { 189, -2 }, /* (1) cmd ::= SHOW DATABASES */
{ 186, -2 }, /* (2) cmd ::= SHOW MNODES */ { 189, -2 }, /* (2) cmd ::= SHOW TOPICS */
{ 186, -2 }, /* (3) cmd ::= SHOW DNODES */ { 189, -2 }, /* (3) cmd ::= SHOW MNODES */
{ 186, -2 }, /* (4) cmd ::= SHOW ACCOUNTS */ { 189, -2 }, /* (4) cmd ::= SHOW DNODES */
{ 186, -2 }, /* (5) cmd ::= SHOW USERS */ { 189, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */
{ 186, -2 }, /* (6) cmd ::= SHOW MODULES */ { 189, -2 }, /* (6) cmd ::= SHOW USERS */
{ 186, -2 }, /* (7) cmd ::= SHOW QUERIES */ { 189, -2 }, /* (7) cmd ::= SHOW MODULES */
{ 186, -2 }, /* (8) cmd ::= SHOW CONNECTIONS */ { 189, -2 }, /* (8) cmd ::= SHOW QUERIES */
{ 186, -2 }, /* (9) cmd ::= SHOW STREAMS */ { 189, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */
{ 186, -2 }, /* (10) cmd ::= SHOW VARIABLES */ { 189, -2 }, /* (10) cmd ::= SHOW STREAMS */
{ 186, -2 }, /* (11) cmd ::= SHOW SCORES */ { 189, -2 }, /* (11) cmd ::= SHOW VARIABLES */
{ 186, -2 }, /* (12) cmd ::= SHOW GRANTS */ { 189, -2 }, /* (12) cmd ::= SHOW SCORES */
{ 186, -2 }, /* (13) cmd ::= SHOW VNODES */ { 189, -2 }, /* (13) cmd ::= SHOW GRANTS */
{ 186, -3 }, /* (14) cmd ::= SHOW VNODES IPTOKEN */ { 189, -2 }, /* (14) cmd ::= SHOW VNODES */
{ 187, 0 }, /* (15) dbPrefix ::= */ { 189, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */
{ 187, -2 }, /* (16) dbPrefix ::= ids DOT */ { 190, 0 }, /* (16) dbPrefix ::= */
{ 189, 0 }, /* (17) cpxName ::= */ { 190, -2 }, /* (17) dbPrefix ::= ids DOT */
{ 189, -2 }, /* (18) cpxName ::= DOT ids */ { 192, 0 }, /* (18) cpxName ::= */
{ 186, -5 }, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */ { 192, -2 }, /* (19) cpxName ::= DOT ids */
{ 186, -4 }, /* (20) cmd ::= SHOW CREATE DATABASE ids */ { 189, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */
{ 186, -3 }, /* (21) cmd ::= SHOW dbPrefix TABLES */ { 189, -4 }, /* (21) cmd ::= SHOW CREATE DATABASE ids */
{ 186, -5 }, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */ { 189, -3 }, /* (22) cmd ::= SHOW dbPrefix TABLES */
{ 186, -3 }, /* (23) cmd ::= SHOW dbPrefix STABLES */ { 189, -5 }, /* (23) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 186, -5 }, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */ { 189, -3 }, /* (24) cmd ::= SHOW dbPrefix STABLES */
{ 186, -3 }, /* (25) cmd ::= SHOW dbPrefix VGROUPS */ { 189, -5 }, /* (25) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 186, -4 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */ { 189, -3 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS */
{ 186, -5 }, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */ { 189, -4 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS ids */
{ 186, -5 }, /* (28) cmd ::= DROP STABLE ifexists ids cpxName */ { 189, -5 }, /* (28) cmd ::= DROP TABLE ifexists ids cpxName */
{ 186, -4 }, /* (29) cmd ::= DROP DATABASE ifexists ids */ { 189, -5 }, /* (29) cmd ::= DROP STABLE ifexists ids cpxName */
{ 186, -3 }, /* (30) cmd ::= DROP DNODE ids */ { 189, -4 }, /* (30) cmd ::= DROP DATABASE ifexists ids */
{ 186, -3 }, /* (31) cmd ::= DROP USER ids */ { 189, -4 }, /* (31) cmd ::= DROP TOPIC ifexists ids */
{ 186, -3 }, /* (32) cmd ::= DROP ACCOUNT ids */ { 189, -3 }, /* (32) cmd ::= DROP DNODE ids */
{ 186, -2 }, /* (33) cmd ::= USE ids */ { 189, -3 }, /* (33) cmd ::= DROP USER ids */
{ 186, -3 }, /* (34) cmd ::= DESCRIBE ids cpxName */ { 189, -3 }, /* (34) cmd ::= DROP ACCOUNT ids */
{ 186, -5 }, /* (35) cmd ::= ALTER USER ids PASS ids */ { 189, -2 }, /* (35) cmd ::= USE ids */
{ 186, -5 }, /* (36) cmd ::= ALTER USER ids PRIVILEGE ids */ { 189, -3 }, /* (36) cmd ::= DESCRIBE ids cpxName */
{ 186, -4 }, /* (37) cmd ::= ALTER DNODE ids ids */ { 189, -5 }, /* (37) cmd ::= ALTER USER ids PASS ids */
{ 186, -5 }, /* (38) cmd ::= ALTER DNODE ids ids ids */ { 189, -5 }, /* (38) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 186, -3 }, /* (39) cmd ::= ALTER LOCAL ids */ { 189, -4 }, /* (39) cmd ::= ALTER DNODE ids ids */
{ 186, -4 }, /* (40) cmd ::= ALTER LOCAL ids ids */ { 189, -5 }, /* (40) cmd ::= ALTER DNODE ids ids ids */
{ 186, -4 }, /* (41) cmd ::= ALTER DATABASE ids alter_db_optr */ { 189, -3 }, /* (41) cmd ::= ALTER LOCAL ids */
{ 186, -4 }, /* (42) cmd ::= ALTER ACCOUNT ids acct_optr */ { 189, -4 }, /* (42) cmd ::= ALTER LOCAL ids ids */
{ 186, -6 }, /* (43) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ { 189, -4 }, /* (43) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 188, -1 }, /* (44) ids ::= ID */ { 189, -4 }, /* (44) cmd ::= ALTER TOPIC ids alter_topic_optr */
{ 188, -1 }, /* (45) ids ::= STRING */ { 189, -4 }, /* (45) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 190, -2 }, /* (46) ifexists ::= IF EXISTS */ { 189, -6 }, /* (46) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 190, 0 }, /* (47) ifexists ::= */ { 191, -1 }, /* (47) ids ::= ID */
{ 193, -3 }, /* (48) ifnotexists ::= IF NOT EXISTS */ { 191, -1 }, /* (48) ids ::= STRING */
{ 193, 0 }, /* (49) ifnotexists ::= */ { 193, -2 }, /* (49) ifexists ::= IF EXISTS */
{ 186, -3 }, /* (50) cmd ::= CREATE DNODE ids */ { 193, 0 }, /* (50) ifexists ::= */
{ 186, -6 }, /* (51) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ { 197, -3 }, /* (51) ifnotexists ::= IF NOT EXISTS */
{ 186, -5 }, /* (52) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { 197, 0 }, /* (52) ifnotexists ::= */
{ 186, -5 }, /* (53) cmd ::= CREATE USER ids PASS ids */ { 189, -3 }, /* (53) cmd ::= CREATE DNODE ids */
{ 195, 0 }, /* (54) pps ::= */ { 189, -6 }, /* (54) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 195, -2 }, /* (55) pps ::= PPS INTEGER */ { 189, -5 }, /* (55) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 196, 0 }, /* (56) tseries ::= */ { 189, -5 }, /* (56) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{ 196, -2 }, /* (57) tseries ::= TSERIES INTEGER */ { 189, -5 }, /* (57) cmd ::= CREATE USER ids PASS ids */
{ 197, 0 }, /* (58) dbs ::= */ { 200, 0 }, /* (58) pps ::= */
{ 197, -2 }, /* (59) dbs ::= DBS INTEGER */ { 200, -2 }, /* (59) pps ::= PPS INTEGER */
{ 198, 0 }, /* (60) streams ::= */ { 201, 0 }, /* (60) tseries ::= */
{ 198, -2 }, /* (61) streams ::= STREAMS INTEGER */ { 201, -2 }, /* (61) tseries ::= TSERIES INTEGER */
{ 199, 0 }, /* (62) storage ::= */ { 202, 0 }, /* (62) dbs ::= */
{ 199, -2 }, /* (63) storage ::= STORAGE INTEGER */ { 202, -2 }, /* (63) dbs ::= DBS INTEGER */
{ 200, 0 }, /* (64) qtime ::= */ { 203, 0 }, /* (64) streams ::= */
{ 200, -2 }, /* (65) qtime ::= QTIME INTEGER */ { 203, -2 }, /* (65) streams ::= STREAMS INTEGER */
{ 201, 0 }, /* (66) users ::= */ { 204, 0 }, /* (66) storage ::= */
{ 201, -2 }, /* (67) users ::= USERS INTEGER */ { 204, -2 }, /* (67) storage ::= STORAGE INTEGER */
{ 202, 0 }, /* (68) conns ::= */ { 205, 0 }, /* (68) qtime ::= */
{ 202, -2 }, /* (69) conns ::= CONNS INTEGER */ { 205, -2 }, /* (69) qtime ::= QTIME INTEGER */
{ 203, 0 }, /* (70) state ::= */ { 206, 0 }, /* (70) users ::= */
{ 203, -2 }, /* (71) state ::= STATE ids */ { 206, -2 }, /* (71) users ::= USERS INTEGER */
{ 192, -9 }, /* (72) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { 207, 0 }, /* (72) conns ::= */
{ 204, -2 }, /* (73) keep ::= KEEP tagitemlist */ { 207, -2 }, /* (73) conns ::= CONNS INTEGER */
{ 206, -2 }, /* (74) cache ::= CACHE INTEGER */ { 208, 0 }, /* (74) state ::= */
{ 207, -2 }, /* (75) replica ::= REPLICA INTEGER */ { 208, -2 }, /* (75) state ::= STATE ids */
{ 208, -2 }, /* (76) quorum ::= QUORUM INTEGER */ { 196, -9 }, /* (76) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 209, -2 }, /* (77) days ::= DAYS INTEGER */ { 209, -2 }, /* (77) keep ::= KEEP tagitemlist */
{ 210, -2 }, /* (78) minrows ::= MINROWS INTEGER */ { 211, -2 }, /* (78) cache ::= CACHE INTEGER */
{ 211, -2 }, /* (79) maxrows ::= MAXROWS INTEGER */ { 212, -2 }, /* (79) replica ::= REPLICA INTEGER */
{ 212, -2 }, /* (80) blocks ::= BLOCKS INTEGER */ { 213, -2 }, /* (80) quorum ::= QUORUM INTEGER */
{ 213, -2 }, /* (81) ctime ::= CTIME INTEGER */ { 214, -2 }, /* (81) days ::= DAYS INTEGER */
{ 214, -2 }, /* (82) wal ::= WAL INTEGER */ { 215, -2 }, /* (82) minrows ::= MINROWS INTEGER */
{ 215, -2 }, /* (83) fsync ::= FSYNC INTEGER */ { 216, -2 }, /* (83) maxrows ::= MAXROWS INTEGER */
{ 216, -2 }, /* (84) comp ::= COMP INTEGER */ { 217, -2 }, /* (84) blocks ::= BLOCKS INTEGER */
{ 217, -2 }, /* (85) prec ::= PRECISION STRING */ { 218, -2 }, /* (85) ctime ::= CTIME INTEGER */
{ 218, -2 }, /* (86) update ::= UPDATE INTEGER */ { 219, -2 }, /* (86) wal ::= WAL INTEGER */
{ 219, -2 }, /* (87) cachelast ::= CACHELAST INTEGER */ { 220, -2 }, /* (87) fsync ::= FSYNC INTEGER */
{ 194, 0 }, /* (88) db_optr ::= */ { 221, -2 }, /* (88) comp ::= COMP INTEGER */
{ 194, -2 }, /* (89) db_optr ::= db_optr cache */ { 222, -2 }, /* (89) prec ::= PRECISION STRING */
{ 194, -2 }, /* (90) db_optr ::= db_optr replica */ { 223, -2 }, /* (90) update ::= UPDATE INTEGER */
{ 194, -2 }, /* (91) db_optr ::= db_optr quorum */ { 224, -2 }, /* (91) cachelast ::= CACHELAST INTEGER */
{ 194, -2 }, /* (92) db_optr ::= db_optr days */ { 225, -2 }, /* (92) partitions ::= PARTITIONS INTEGER */
{ 194, -2 }, /* (93) db_optr ::= db_optr minrows */ { 198, 0 }, /* (93) db_optr ::= */
{ 194, -2 }, /* (94) db_optr ::= db_optr maxrows */ { 198, -2 }, /* (94) db_optr ::= db_optr cache */
{ 194, -2 }, /* (95) db_optr ::= db_optr blocks */ { 198, -2 }, /* (95) db_optr ::= db_optr replica */
{ 194, -2 }, /* (96) db_optr ::= db_optr ctime */ { 198, -2 }, /* (96) db_optr ::= db_optr quorum */
{ 194, -2 }, /* (97) db_optr ::= db_optr wal */ { 198, -2 }, /* (97) db_optr ::= db_optr days */
{ 194, -2 }, /* (98) db_optr ::= db_optr fsync */ { 198, -2 }, /* (98) db_optr ::= db_optr minrows */
{ 194, -2 }, /* (99) db_optr ::= db_optr comp */ { 198, -2 }, /* (99) db_optr ::= db_optr maxrows */
{ 194, -2 }, /* (100) db_optr ::= db_optr prec */ { 198, -2 }, /* (100) db_optr ::= db_optr blocks */
{ 194, -2 }, /* (101) db_optr ::= db_optr keep */ { 198, -2 }, /* (101) db_optr ::= db_optr ctime */
{ 194, -2 }, /* (102) db_optr ::= db_optr update */ { 198, -2 }, /* (102) db_optr ::= db_optr wal */
{ 194, -2 }, /* (103) db_optr ::= db_optr cachelast */ { 198, -2 }, /* (103) db_optr ::= db_optr fsync */
{ 191, 0 }, /* (104) alter_db_optr ::= */ { 198, -2 }, /* (104) db_optr ::= db_optr comp */
{ 191, -2 }, /* (105) alter_db_optr ::= alter_db_optr replica */ { 198, -2 }, /* (105) db_optr ::= db_optr prec */
{ 191, -2 }, /* (106) alter_db_optr ::= alter_db_optr quorum */ { 198, -2 }, /* (106) db_optr ::= db_optr keep */
{ 191, -2 }, /* (107) alter_db_optr ::= alter_db_optr keep */ { 198, -2 }, /* (107) db_optr ::= db_optr update */
{ 191, -2 }, /* (108) alter_db_optr ::= alter_db_optr blocks */ { 198, -2 }, /* (108) db_optr ::= db_optr cachelast */
{ 191, -2 }, /* (109) alter_db_optr ::= alter_db_optr comp */ { 199, -1 }, /* (109) topic_optr ::= db_optr */
{ 191, -2 }, /* (110) alter_db_optr ::= alter_db_optr wal */ { 199, -2 }, /* (110) topic_optr ::= topic_optr partitions */
{ 191, -2 }, /* (111) alter_db_optr ::= alter_db_optr fsync */ { 194, 0 }, /* (111) alter_db_optr ::= */
{ 191, -2 }, /* (112) alter_db_optr ::= alter_db_optr update */ { 194, -2 }, /* (112) alter_db_optr ::= alter_db_optr replica */
{ 191, -2 }, /* (113) alter_db_optr ::= alter_db_optr cachelast */ { 194, -2 }, /* (113) alter_db_optr ::= alter_db_optr quorum */
{ 220, -1 }, /* (114) typename ::= ids */ { 194, -2 }, /* (114) alter_db_optr ::= alter_db_optr keep */
{ 220, -4 }, /* (115) typename ::= ids LP signed RP */ { 194, -2 }, /* (115) alter_db_optr ::= alter_db_optr blocks */
{ 220, -2 }, /* (116) typename ::= ids UNSIGNED */ { 194, -2 }, /* (116) alter_db_optr ::= alter_db_optr comp */
{ 221, -1 }, /* (117) signed ::= INTEGER */ { 194, -2 }, /* (117) alter_db_optr ::= alter_db_optr wal */
{ 221, -2 }, /* (118) signed ::= PLUS INTEGER */ { 194, -2 }, /* (118) alter_db_optr ::= alter_db_optr fsync */
{ 221, -2 }, /* (119) signed ::= MINUS INTEGER */ { 194, -2 }, /* (119) alter_db_optr ::= alter_db_optr update */
{ 186, -3 }, /* (120) cmd ::= CREATE TABLE create_table_args */ { 194, -2 }, /* (120) alter_db_optr ::= alter_db_optr cachelast */
{ 186, -3 }, /* (121) cmd ::= CREATE TABLE create_stable_args */ { 195, -1 }, /* (121) alter_topic_optr ::= alter_db_optr */
{ 186, -3 }, /* (122) cmd ::= CREATE STABLE create_stable_args */ { 195, -2 }, /* (122) alter_topic_optr ::= alter_topic_optr partitions */
{ 186, -3 }, /* (123) cmd ::= CREATE TABLE create_table_list */ { 226, -1 }, /* (123) typename ::= ids */
{ 224, -1 }, /* (124) create_table_list ::= create_from_stable */ { 226, -4 }, /* (124) typename ::= ids LP signed RP */
{ 224, -2 }, /* (125) create_table_list ::= create_table_list create_from_stable */ { 226, -2 }, /* (125) typename ::= ids UNSIGNED */
{ 222, -6 }, /* (126) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { 227, -1 }, /* (126) signed ::= INTEGER */
{ 223, -10 }, /* (127) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { 227, -2 }, /* (127) signed ::= PLUS INTEGER */
{ 225, -10 }, /* (128) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ { 227, -2 }, /* (128) signed ::= MINUS INTEGER */
{ 225, -13 }, /* (129) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ { 189, -3 }, /* (129) cmd ::= CREATE TABLE create_table_args */
{ 227, -3 }, /* (130) tagNamelist ::= tagNamelist COMMA ids */ { 189, -3 }, /* (130) cmd ::= CREATE TABLE create_stable_args */
{ 227, -1 }, /* (131) tagNamelist ::= ids */ { 189, -3 }, /* (131) cmd ::= CREATE STABLE create_stable_args */
{ 222, -5 }, /* (132) create_table_args ::= ifnotexists ids cpxName AS select */ { 189, -3 }, /* (132) cmd ::= CREATE TABLE create_table_list */
{ 226, -3 }, /* (133) columnlist ::= columnlist COMMA column */ { 230, -1 }, /* (133) create_table_list ::= create_from_stable */
{ 226, -1 }, /* (134) columnlist ::= column */ { 230, -2 }, /* (134) create_table_list ::= create_table_list create_from_stable */
{ 229, -2 }, /* (135) column ::= ids typename */ { 228, -6 }, /* (135) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ 205, -3 }, /* (136) tagitemlist ::= tagitemlist COMMA tagitem */ { 229, -10 }, /* (136) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ 205, -1 }, /* (137) tagitemlist ::= tagitem */ { 231, -10 }, /* (137) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ 230, -1 }, /* (138) tagitem ::= INTEGER */ { 231, -13 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ 230, -1 }, /* (139) tagitem ::= FLOAT */ { 233, -3 }, /* (139) tagNamelist ::= tagNamelist COMMA ids */
{ 230, -1 }, /* (140) tagitem ::= STRING */ { 233, -1 }, /* (140) tagNamelist ::= ids */
{ 230, -1 }, /* (141) tagitem ::= BOOL */ { 228, -5 }, /* (141) create_table_args ::= ifnotexists ids cpxName AS select */
{ 230, -1 }, /* (142) tagitem ::= NULL */ { 232, -3 }, /* (142) columnlist ::= columnlist COMMA column */
{ 230, -2 }, /* (143) tagitem ::= MINUS INTEGER */ { 232, -1 }, /* (143) columnlist ::= column */
{ 230, -2 }, /* (144) tagitem ::= MINUS FLOAT */ { 235, -2 }, /* (144) column ::= ids typename */
{ 230, -2 }, /* (145) tagitem ::= PLUS INTEGER */ { 210, -3 }, /* (145) tagitemlist ::= tagitemlist COMMA tagitem */
{ 230, -2 }, /* (146) tagitem ::= PLUS FLOAT */ { 210, -1 }, /* (146) tagitemlist ::= tagitem */
{ 228, -12 }, /* (147) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { 236, -1 }, /* (147) tagitem ::= INTEGER */
{ 242, -1 }, /* (148) union ::= select */ { 236, -1 }, /* (148) tagitem ::= FLOAT */
{ 242, -3 }, /* (149) union ::= LP union RP */ { 236, -1 }, /* (149) tagitem ::= STRING */
{ 242, -4 }, /* (150) union ::= union UNION ALL select */ { 236, -1 }, /* (150) tagitem ::= BOOL */
{ 242, -6 }, /* (151) union ::= union UNION ALL LP select RP */ { 236, -1 }, /* (151) tagitem ::= NULL */
{ 186, -1 }, /* (152) cmd ::= union */ { 236, -2 }, /* (152) tagitem ::= MINUS INTEGER */
{ 228, -2 }, /* (153) select ::= SELECT selcollist */ { 236, -2 }, /* (153) tagitem ::= MINUS FLOAT */
{ 243, -2 }, /* (154) sclp ::= selcollist COMMA */ { 236, -2 }, /* (154) tagitem ::= PLUS INTEGER */
{ 243, 0 }, /* (155) sclp ::= */ { 236, -2 }, /* (155) tagitem ::= PLUS FLOAT */
{ 231, -4 }, /* (156) selcollist ::= sclp distinct expr as */ { 234, -12 }, /* (156) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ 231, -2 }, /* (157) selcollist ::= sclp STAR */ { 248, -1 }, /* (157) union ::= select */
{ 246, -2 }, /* (158) as ::= AS ids */ { 248, -3 }, /* (158) union ::= LP union RP */
{ 246, -1 }, /* (159) as ::= ids */ { 248, -4 }, /* (159) union ::= union UNION ALL select */
{ 246, 0 }, /* (160) as ::= */ { 248, -6 }, /* (160) union ::= union UNION ALL LP select RP */
{ 244, -1 }, /* (161) distinct ::= DISTINCT */ { 189, -1 }, /* (161) cmd ::= union */
{ 244, 0 }, /* (162) distinct ::= */ { 234, -2 }, /* (162) select ::= SELECT selcollist */
{ 232, -2 }, /* (163) from ::= FROM tablelist */ { 249, -2 }, /* (163) sclp ::= selcollist COMMA */
{ 247, -2 }, /* (164) tablelist ::= ids cpxName */ { 249, 0 }, /* (164) sclp ::= */
{ 247, -3 }, /* (165) tablelist ::= ids cpxName ids */ { 237, -4 }, /* (165) selcollist ::= sclp distinct expr as */
{ 247, -4 }, /* (166) tablelist ::= tablelist COMMA ids cpxName */ { 237, -2 }, /* (166) selcollist ::= sclp STAR */
{ 247, -5 }, /* (167) tablelist ::= tablelist COMMA ids cpxName ids */ { 252, -2 }, /* (167) as ::= AS ids */
{ 248, -1 }, /* (168) tmvar ::= VARIABLE */ { 252, -1 }, /* (168) as ::= ids */
{ 234, -4 }, /* (169) interval_opt ::= INTERVAL LP tmvar RP */ { 252, 0 }, /* (169) as ::= */
{ 234, -6 }, /* (170) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ { 250, -1 }, /* (170) distinct ::= DISTINCT */
{ 234, 0 }, /* (171) interval_opt ::= */ { 250, 0 }, /* (171) distinct ::= */
{ 235, 0 }, /* (172) fill_opt ::= */ { 238, -2 }, /* (172) from ::= FROM tablelist */
{ 235, -6 }, /* (173) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { 253, -2 }, /* (173) tablelist ::= ids cpxName */
{ 235, -4 }, /* (174) fill_opt ::= FILL LP ID RP */ { 253, -3 }, /* (174) tablelist ::= ids cpxName ids */
{ 236, -4 }, /* (175) sliding_opt ::= SLIDING LP tmvar RP */ { 253, -4 }, /* (175) tablelist ::= tablelist COMMA ids cpxName */
{ 236, 0 }, /* (176) sliding_opt ::= */ { 253, -5 }, /* (176) tablelist ::= tablelist COMMA ids cpxName ids */
{ 238, 0 }, /* (177) orderby_opt ::= */ { 254, -1 }, /* (177) tmvar ::= VARIABLE */
{ 238, -3 }, /* (178) orderby_opt ::= ORDER BY sortlist */ { 240, -4 }, /* (178) interval_opt ::= INTERVAL LP tmvar RP */
{ 249, -4 }, /* (179) sortlist ::= sortlist COMMA item sortorder */ { 240, -6 }, /* (179) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{ 249, -2 }, /* (180) sortlist ::= item sortorder */ { 240, 0 }, /* (180) interval_opt ::= */
{ 251, -2 }, /* (181) item ::= ids cpxName */ { 241, 0 }, /* (181) fill_opt ::= */
{ 252, -1 }, /* (182) sortorder ::= ASC */ { 241, -6 }, /* (182) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 252, -1 }, /* (183) sortorder ::= DESC */ { 241, -4 }, /* (183) fill_opt ::= FILL LP ID RP */
{ 252, 0 }, /* (184) sortorder ::= */ { 242, -4 }, /* (184) sliding_opt ::= SLIDING LP tmvar RP */
{ 237, 0 }, /* (185) groupby_opt ::= */ { 242, 0 }, /* (185) sliding_opt ::= */
{ 237, -3 }, /* (186) groupby_opt ::= GROUP BY grouplist */ { 244, 0 }, /* (186) orderby_opt ::= */
{ 253, -3 }, /* (187) grouplist ::= grouplist COMMA item */ { 244, -3 }, /* (187) orderby_opt ::= ORDER BY sortlist */
{ 253, -1 }, /* (188) grouplist ::= item */ { 255, -4 }, /* (188) sortlist ::= sortlist COMMA item sortorder */
{ 239, 0 }, /* (189) having_opt ::= */ { 255, -2 }, /* (189) sortlist ::= item sortorder */
{ 239, -2 }, /* (190) having_opt ::= HAVING expr */ { 257, -2 }, /* (190) item ::= ids cpxName */
{ 241, 0 }, /* (191) limit_opt ::= */ { 258, -1 }, /* (191) sortorder ::= ASC */
{ 241, -2 }, /* (192) limit_opt ::= LIMIT signed */ { 258, -1 }, /* (192) sortorder ::= DESC */
{ 241, -4 }, /* (193) limit_opt ::= LIMIT signed OFFSET signed */ { 258, 0 }, /* (193) sortorder ::= */
{ 241, -4 }, /* (194) limit_opt ::= LIMIT signed COMMA signed */ { 243, 0 }, /* (194) groupby_opt ::= */
{ 240, 0 }, /* (195) slimit_opt ::= */ { 243, -3 }, /* (195) groupby_opt ::= GROUP BY grouplist */
{ 240, -2 }, /* (196) slimit_opt ::= SLIMIT signed */ { 259, -3 }, /* (196) grouplist ::= grouplist COMMA item */
{ 240, -4 }, /* (197) slimit_opt ::= SLIMIT signed SOFFSET signed */ { 259, -1 }, /* (197) grouplist ::= item */
{ 240, -4 }, /* (198) slimit_opt ::= SLIMIT signed COMMA signed */ { 245, 0 }, /* (198) having_opt ::= */
{ 233, 0 }, /* (199) where_opt ::= */ { 245, -2 }, /* (199) having_opt ::= HAVING expr */
{ 233, -2 }, /* (200) where_opt ::= WHERE expr */ { 247, 0 }, /* (200) limit_opt ::= */
{ 245, -3 }, /* (201) expr ::= LP expr RP */ { 247, -2 }, /* (201) limit_opt ::= LIMIT signed */
{ 245, -1 }, /* (202) expr ::= ID */ { 247, -4 }, /* (202) limit_opt ::= LIMIT signed OFFSET signed */
{ 245, -3 }, /* (203) expr ::= ID DOT ID */ { 247, -4 }, /* (203) limit_opt ::= LIMIT signed COMMA signed */
{ 245, -3 }, /* (204) expr ::= ID DOT STAR */ { 246, 0 }, /* (204) slimit_opt ::= */
{ 245, -1 }, /* (205) expr ::= INTEGER */ { 246, -2 }, /* (205) slimit_opt ::= SLIMIT signed */
{ 245, -2 }, /* (206) expr ::= MINUS INTEGER */ { 246, -4 }, /* (206) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 245, -2 }, /* (207) expr ::= PLUS INTEGER */ { 246, -4 }, /* (207) slimit_opt ::= SLIMIT signed COMMA signed */
{ 245, -1 }, /* (208) expr ::= FLOAT */ { 239, 0 }, /* (208) where_opt ::= */
{ 245, -2 }, /* (209) expr ::= MINUS FLOAT */ { 239, -2 }, /* (209) where_opt ::= WHERE expr */
{ 245, -2 }, /* (210) expr ::= PLUS FLOAT */ { 251, -3 }, /* (210) expr ::= LP expr RP */
{ 245, -1 }, /* (211) expr ::= STRING */ { 251, -1 }, /* (211) expr ::= ID */
{ 245, -1 }, /* (212) expr ::= NOW */ { 251, -3 }, /* (212) expr ::= ID DOT ID */
{ 245, -1 }, /* (213) expr ::= VARIABLE */ { 251, -3 }, /* (213) expr ::= ID DOT STAR */
{ 245, -1 }, /* (214) expr ::= BOOL */ { 251, -1 }, /* (214) expr ::= INTEGER */
{ 245, -4 }, /* (215) expr ::= ID LP exprlist RP */ { 251, -2 }, /* (215) expr ::= MINUS INTEGER */
{ 245, -4 }, /* (216) expr ::= ID LP STAR RP */ { 251, -2 }, /* (216) expr ::= PLUS INTEGER */
{ 245, -3 }, /* (217) expr ::= expr IS NULL */ { 251, -1 }, /* (217) expr ::= FLOAT */
{ 245, -4 }, /* (218) expr ::= expr IS NOT NULL */ { 251, -2 }, /* (218) expr ::= MINUS FLOAT */
{ 245, -3 }, /* (219) expr ::= expr LT expr */ { 251, -2 }, /* (219) expr ::= PLUS FLOAT */
{ 245, -3 }, /* (220) expr ::= expr GT expr */ { 251, -1 }, /* (220) expr ::= STRING */
{ 245, -3 }, /* (221) expr ::= expr LE expr */ { 251, -1 }, /* (221) expr ::= NOW */
{ 245, -3 }, /* (222) expr ::= expr GE expr */ { 251, -1 }, /* (222) expr ::= VARIABLE */
{ 245, -3 }, /* (223) expr ::= expr NE expr */ { 251, -1 }, /* (223) expr ::= BOOL */
{ 245, -3 }, /* (224) expr ::= expr EQ expr */ { 251, -4 }, /* (224) expr ::= ID LP exprlist RP */
{ 245, -5 }, /* (225) expr ::= expr BETWEEN expr AND expr */ { 251, -4 }, /* (225) expr ::= ID LP STAR RP */
{ 245, -3 }, /* (226) expr ::= expr AND expr */ { 251, -3 }, /* (226) expr ::= expr IS NULL */
{ 245, -3 }, /* (227) expr ::= expr OR expr */ { 251, -4 }, /* (227) expr ::= expr IS NOT NULL */
{ 245, -3 }, /* (228) expr ::= expr PLUS expr */ { 251, -3 }, /* (228) expr ::= expr LT expr */
{ 245, -3 }, /* (229) expr ::= expr MINUS expr */ { 251, -3 }, /* (229) expr ::= expr GT expr */
{ 245, -3 }, /* (230) expr ::= expr STAR expr */ { 251, -3 }, /* (230) expr ::= expr LE expr */
{ 245, -3 }, /* (231) expr ::= expr SLASH expr */ { 251, -3 }, /* (231) expr ::= expr GE expr */
{ 245, -3 }, /* (232) expr ::= expr REM expr */ { 251, -3 }, /* (232) expr ::= expr NE expr */
{ 245, -3 }, /* (233) expr ::= expr LIKE expr */ { 251, -3 }, /* (233) expr ::= expr EQ expr */
{ 245, -5 }, /* (234) expr ::= expr IN LP exprlist RP */ { 251, -5 }, /* (234) expr ::= expr BETWEEN expr AND expr */
{ 254, -3 }, /* (235) exprlist ::= exprlist COMMA expritem */ { 251, -3 }, /* (235) expr ::= expr AND expr */
{ 254, -1 }, /* (236) exprlist ::= expritem */ { 251, -3 }, /* (236) expr ::= expr OR expr */
{ 255, -1 }, /* (237) expritem ::= expr */ { 251, -3 }, /* (237) expr ::= expr PLUS expr */
{ 255, 0 }, /* (238) expritem ::= */ { 251, -3 }, /* (238) expr ::= expr MINUS expr */
{ 186, -3 }, /* (239) cmd ::= RESET QUERY CACHE */ { 251, -3 }, /* (239) expr ::= expr STAR expr */
{ 186, -7 }, /* (240) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { 251, -3 }, /* (240) expr ::= expr SLASH expr */
{ 186, -7 }, /* (241) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { 251, -3 }, /* (241) expr ::= expr REM expr */
{ 186, -7 }, /* (242) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { 251, -3 }, /* (242) expr ::= expr LIKE expr */
{ 186, -7 }, /* (243) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { 251, -5 }, /* (243) expr ::= expr IN LP exprlist RP */
{ 186, -8 }, /* (244) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { 260, -3 }, /* (244) exprlist ::= exprlist COMMA expritem */
{ 186, -9 }, /* (245) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { 260, -1 }, /* (245) exprlist ::= expritem */
{ 186, -7 }, /* (246) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { 261, -1 }, /* (246) expritem ::= expr */
{ 186, -7 }, /* (247) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { 261, 0 }, /* (247) expritem ::= */
{ 186, -7 }, /* (248) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { 189, -3 }, /* (248) cmd ::= RESET QUERY CACHE */
{ 186, -7 }, /* (249) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { 189, -7 }, /* (249) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 186, -8 }, /* (250) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { 189, -7 }, /* (250) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 186, -3 }, /* (251) cmd ::= KILL CONNECTION INTEGER */ { 189, -7 }, /* (251) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 186, -5 }, /* (252) cmd ::= KILL STREAM INTEGER COLON INTEGER */ { 189, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 186, -5 }, /* (253) cmd ::= KILL QUERY INTEGER COLON INTEGER */ { 189, -8 }, /* (253) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 189, -9 }, /* (254) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 189, -7 }, /* (255) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ 189, -7 }, /* (256) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ 189, -7 }, /* (257) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ 189, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{ 189, -8 }, /* (259) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{ 189, -3 }, /* (260) cmd ::= KILL CONNECTION INTEGER */
{ 189, -5 }, /* (261) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{ 189, -5 }, /* (262) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -2045,867 +2078,886 @@ static void yy_reduce( ...@@ -2045,867 +2078,886 @@ static void yy_reduce(
/********** Begin reduce actions **********************************************/ /********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor; YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */ case 0: /* program ::= cmd */
case 120: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==120); case 129: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==129);
case 121: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==121); case 130: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==130);
case 122: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==122); case 131: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==131);
{} {}
break; break;
case 1: /* cmd ::= SHOW DATABASES */ case 1: /* cmd ::= SHOW DATABASES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
break; break;
case 2: /* cmd ::= SHOW MNODES */ case 2: /* cmd ::= SHOW TOPICS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
break;
case 3: /* cmd ::= SHOW MNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
break; break;
case 3: /* cmd ::= SHOW DNODES */ case 4: /* cmd ::= SHOW DNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
break; break;
case 4: /* cmd ::= SHOW ACCOUNTS */ case 5: /* cmd ::= SHOW ACCOUNTS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
break; break;
case 5: /* cmd ::= SHOW USERS */ case 6: /* cmd ::= SHOW USERS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);}
break; break;
case 6: /* cmd ::= SHOW MODULES */ case 7: /* cmd ::= SHOW MODULES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); }
break; break;
case 7: /* cmd ::= SHOW QUERIES */ case 8: /* cmd ::= SHOW QUERIES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); }
break; break;
case 8: /* cmd ::= SHOW CONNECTIONS */ case 9: /* cmd ::= SHOW CONNECTIONS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);} { setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
break; break;
case 9: /* cmd ::= SHOW STREAMS */ case 10: /* cmd ::= SHOW STREAMS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); }
break; break;
case 10: /* cmd ::= SHOW VARIABLES */ case 11: /* cmd ::= SHOW VARIABLES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); }
break; break;
case 11: /* cmd ::= SHOW SCORES */ case 12: /* cmd ::= SHOW SCORES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); }
break; break;
case 12: /* cmd ::= SHOW GRANTS */ case 13: /* cmd ::= SHOW GRANTS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); }
break; break;
case 13: /* cmd ::= SHOW VNODES */ case 14: /* cmd ::= SHOW VNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
break; break;
case 14: /* cmd ::= SHOW VNODES IPTOKEN */ case 15: /* cmd ::= SHOW VNODES IPTOKEN */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
break; break;
case 15: /* dbPrefix ::= */ case 16: /* dbPrefix ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
break; break;
case 16: /* dbPrefix ::= ids DOT */ case 17: /* dbPrefix ::= ids DOT */
{yylhsminor.yy0 = yymsp[-1].minor.yy0; } {yylhsminor.yy0 = yymsp[-1].minor.yy0; }
yymsp[-1].minor.yy0 = yylhsminor.yy0; yymsp[-1].minor.yy0 = yylhsminor.yy0;
break; break;
case 17: /* cpxName ::= */ case 18: /* cpxName ::= */
{yymsp[1].minor.yy0.n = 0; } {yymsp[1].minor.yy0.n = 0; }
break; break;
case 18: /* cpxName ::= DOT ids */ case 19: /* cpxName ::= DOT ids */
{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; }
break; break;
case 19: /* cmd ::= SHOW CREATE TABLE ids cpxName */ case 20: /* cmd ::= SHOW CREATE TABLE ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSQLElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0); setDCLSQLElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0);
} }
break; break;
case 20: /* cmd ::= SHOW CREATE DATABASE ids */ case 21: /* cmd ::= SHOW CREATE DATABASE ids */
{ {
setDCLSQLElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0); setDCLSQLElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0);
} }
break; break;
case 21: /* cmd ::= SHOW dbPrefix TABLES */ case 22: /* cmd ::= SHOW dbPrefix TABLES */
{ {
setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0);
} }
break; break;
case 22: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */ case 23: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ {
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);
} }
break; break;
case 23: /* cmd ::= SHOW dbPrefix STABLES */ case 24: /* cmd ::= SHOW dbPrefix STABLES */
{ {
setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0);
} }
break; break;
case 24: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */ case 25: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ {
SStrToken token; SStrToken token;
setDbName(&token, &yymsp[-3].minor.yy0); setDbName(&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);
} }
break; break;
case 25: /* cmd ::= SHOW dbPrefix VGROUPS */ case 26: /* cmd ::= SHOW dbPrefix VGROUPS */
{ {
SStrToken token; SStrToken token;
setDbName(&token, &yymsp[-1].minor.yy0); setDbName(&token, &yymsp[-1].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
} }
break; break;
case 26: /* cmd ::= SHOW dbPrefix VGROUPS ids */ case 27: /* cmd ::= SHOW dbPrefix VGROUPS ids */
{ {
SStrToken token; SStrToken token;
setDbName(&token, &yymsp[-2].minor.yy0); setDbName(&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);
} }
break; break;
case 27: /* cmd ::= DROP TABLE ifexists ids cpxName */ case 28: /* cmd ::= DROP TABLE ifexists ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1);
} }
break; break;
case 28: /* cmd ::= DROP STABLE ifexists ids cpxName */ case 29: /* cmd ::= DROP STABLE ifexists ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, TSDB_SUPER_TABLE); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE);
} }
break; break;
case 29: /* cmd ::= DROP DATABASE ifexists ids */ case 30: /* cmd ::= DROP DATABASE ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, -1); } { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
break;
case 31: /* cmd ::= DROP TOPIC ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
break; break;
case 30: /* cmd ::= DROP DNODE ids */ case 32: /* cmd ::= DROP DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); }
break; break;
case 31: /* cmd ::= DROP USER ids */ case 33: /* cmd ::= DROP USER ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); }
break; break;
case 32: /* cmd ::= DROP ACCOUNT ids */ case 34: /* cmd ::= DROP ACCOUNT ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); }
break; break;
case 33: /* cmd ::= USE ids */ case 35: /* cmd ::= USE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} { setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
break; break;
case 34: /* cmd ::= DESCRIBE ids cpxName */ case 36: /* cmd ::= DESCRIBE ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
} }
break; break;
case 35: /* cmd ::= ALTER USER ids PASS ids */ case 37: /* cmd ::= ALTER USER ids PASS ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); }
break; break;
case 36: /* cmd ::= ALTER USER ids PRIVILEGE ids */ case 38: /* cmd ::= ALTER USER ids PRIVILEGE ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
break; break;
case 37: /* cmd ::= ALTER DNODE ids ids */ case 39: /* cmd ::= ALTER DNODE ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 38: /* cmd ::= ALTER DNODE ids ids ids */ case 40: /* cmd ::= ALTER DNODE ids ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 39: /* cmd ::= ALTER LOCAL ids */ case 41: /* cmd ::= ALTER LOCAL ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); }
break; break;
case 40: /* cmd ::= ALTER LOCAL ids ids */ case 42: /* cmd ::= ALTER LOCAL ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 41: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 43: /* cmd ::= ALTER DATABASE ids alter_db_optr */
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy222, &t);} case 44: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==44);
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &t);}
break; break;
case 42: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 45: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy299);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy419);}
break; break;
case 43: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 46: /* 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.yy299);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);}
break; break;
case 44: /* ids ::= ID */ case 47: /* ids ::= ID */
case 45: /* ids ::= STRING */ yytestcase(yyruleno==45); case 48: /* ids ::= STRING */ yytestcase(yyruleno==48);
{yylhsminor.yy0 = yymsp[0].minor.yy0; } {yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 46: /* ifexists ::= IF EXISTS */ case 49: /* ifexists ::= IF EXISTS */
{ yymsp[-1].minor.yy0.n = 1;} { yymsp[-1].minor.yy0.n = 1;}
break; break;
case 47: /* ifexists ::= */ case 50: /* ifexists ::= */
case 49: /* ifnotexists ::= */ yytestcase(yyruleno==49); case 52: /* ifnotexists ::= */ yytestcase(yyruleno==52);
case 162: /* distinct ::= */ yytestcase(yyruleno==162); case 171: /* distinct ::= */ yytestcase(yyruleno==171);
{ yymsp[1].minor.yy0.n = 0;} { yymsp[1].minor.yy0.n = 0;}
break; break;
case 48: /* ifnotexists ::= IF NOT EXISTS */ case 51: /* ifnotexists ::= IF NOT EXISTS */
{ yymsp[-2].minor.yy0.n = 1;} { yymsp[-2].minor.yy0.n = 1;}
break; break;
case 50: /* cmd ::= CREATE DNODE ids */ case 53: /* cmd ::= CREATE DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break; break;
case 51: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 54: /* 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.yy299);} { setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);}
break; break;
case 52: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 55: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy222, &yymsp[-2].minor.yy0);} case 56: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==56);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &yymsp[-2].minor.yy0);}
break; break;
case 53: /* cmd ::= CREATE USER ids PASS ids */ case 57: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
break; break;
case 54: /* pps ::= */ case 58: /* pps ::= */
case 56: /* tseries ::= */ yytestcase(yyruleno==56); case 60: /* tseries ::= */ yytestcase(yyruleno==60);
case 58: /* dbs ::= */ yytestcase(yyruleno==58); case 62: /* dbs ::= */ yytestcase(yyruleno==62);
case 60: /* streams ::= */ yytestcase(yyruleno==60); case 64: /* streams ::= */ yytestcase(yyruleno==64);
case 62: /* storage ::= */ yytestcase(yyruleno==62); case 66: /* storage ::= */ yytestcase(yyruleno==66);
case 64: /* qtime ::= */ yytestcase(yyruleno==64); case 68: /* qtime ::= */ yytestcase(yyruleno==68);
case 66: /* users ::= */ yytestcase(yyruleno==66); case 70: /* users ::= */ yytestcase(yyruleno==70);
case 68: /* conns ::= */ yytestcase(yyruleno==68); case 72: /* conns ::= */ yytestcase(yyruleno==72);
case 70: /* state ::= */ yytestcase(yyruleno==70); case 74: /* state ::= */ yytestcase(yyruleno==74);
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
break; break;
case 55: /* pps ::= PPS INTEGER */ case 59: /* pps ::= PPS INTEGER */
case 57: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==57); case 61: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==61);
case 59: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==59); case 63: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==63);
case 61: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==61); case 65: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==65);
case 63: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==63); case 67: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==67);
case 65: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==65); case 69: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==69);
case 67: /* users ::= USERS INTEGER */ yytestcase(yyruleno==67); case 71: /* users ::= USERS INTEGER */ yytestcase(yyruleno==71);
case 69: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==69); case 73: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==73);
case 71: /* state ::= STATE ids */ yytestcase(yyruleno==71); case 75: /* state ::= STATE ids */ yytestcase(yyruleno==75);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 72: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 76: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ {
yylhsminor.yy299.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy419.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy299.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yylhsminor.yy419.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy299.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; yylhsminor.yy419.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy299.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; yylhsminor.yy419.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy299.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; yylhsminor.yy419.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy299.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; yylhsminor.yy419.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy299.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; yylhsminor.yy419.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy299.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; yylhsminor.yy419.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy299.stat = yymsp[0].minor.yy0; yylhsminor.yy419.stat = yymsp[0].minor.yy0;
} }
yymsp[-8].minor.yy299 = yylhsminor.yy299; yymsp[-8].minor.yy419 = yylhsminor.yy419;
break; break;
case 73: /* keep ::= KEEP tagitemlist */ case 77: /* keep ::= KEEP tagitemlist */
{ yymsp[-1].minor.yy349 = yymsp[0].minor.yy349; } { yymsp[-1].minor.yy429 = yymsp[0].minor.yy429; }
break; break;
case 74: /* cache ::= CACHE INTEGER */ case 78: /* cache ::= CACHE INTEGER */
case 75: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==75); case 79: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==79);
case 76: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==76); case 80: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==80);
case 77: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==77); case 81: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==81);
case 78: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==78); case 82: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==82);
case 79: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==79); case 83: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==83);
case 80: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==80); case 84: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==84);
case 81: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==81); case 85: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==85);
case 82: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==82); case 86: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==86);
case 83: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==83); case 87: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==87);
case 84: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==84); case 88: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==88);
case 85: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==85); case 89: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==89);
case 86: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==86); case 90: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==90);
case 87: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==87); case 91: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==91);
case 92: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==92);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 88: /* db_optr ::= */ case 93: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy222);} {setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;}
break; break;
case 89: /* db_optr ::= db_optr cache */ case 94: /* db_optr ::= db_optr cache */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 90: /* db_optr ::= db_optr replica */ case 95: /* db_optr ::= db_optr replica */
case 105: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==105); case 112: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==112);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 91: /* db_optr ::= db_optr quorum */ case 96: /* db_optr ::= db_optr quorum */
case 106: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==106); case 113: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==113);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 92: /* db_optr ::= db_optr days */ case 97: /* db_optr ::= db_optr days */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 93: /* db_optr ::= db_optr minrows */ case 98: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 94: /* db_optr ::= db_optr maxrows */ case 99: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 95: /* db_optr ::= db_optr blocks */ case 100: /* db_optr ::= db_optr blocks */
case 108: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==108); case 115: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==115);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 96: /* db_optr ::= db_optr ctime */ case 101: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 97: /* db_optr ::= db_optr wal */ case 102: /* db_optr ::= db_optr wal */
case 110: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==110); case 117: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==117);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 98: /* db_optr ::= db_optr fsync */ case 103: /* db_optr ::= db_optr fsync */
case 111: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==111); case 118: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==118);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 99: /* db_optr ::= db_optr comp */ case 104: /* db_optr ::= db_optr comp */
case 109: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==109); case 116: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==116);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 100: /* db_optr ::= db_optr prec */ case 105: /* db_optr ::= db_optr prec */
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.precision = yymsp[0].minor.yy0; } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 101: /* db_optr ::= db_optr keep */ case 106: /* db_optr ::= db_optr keep */
case 107: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==107); case 114: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==114);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.keep = yymsp[0].minor.yy349; } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.keep = yymsp[0].minor.yy429; }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 102: /* db_optr ::= db_optr update */ case 107: /* db_optr ::= db_optr update */
case 112: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==112); case 119: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==119);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 103: /* db_optr ::= db_optr cachelast */ case 108: /* db_optr ::= db_optr cachelast */
case 113: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==113); case 120: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==120);
{ yylhsminor.yy222 = yymsp[-1].minor.yy222; yylhsminor.yy222.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy222 = yylhsminor.yy222; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 104: /* alter_db_optr ::= */ case 109: /* topic_optr ::= db_optr */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy222);} case 121: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==121);
break; { yylhsminor.yy94 = yymsp[0].minor.yy94; yylhsminor.yy94.dbType = TSDB_DB_TYPE_TOPIC; }
case 114: /* typename ::= ids */ yymsp[0].minor.yy94 = yylhsminor.yy94;
break;
case 110: /* topic_optr ::= topic_optr partitions */
case 122: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==122);
{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy94 = yylhsminor.yy94;
break;
case 111: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;}
break;
case 123: /* typename ::= ids */
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSqlSetColumnType (&yylhsminor.yy215, &yymsp[0].minor.yy0); tSqlSetColumnType (&yylhsminor.yy451, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy215 = yylhsminor.yy215; yymsp[0].minor.yy451 = yylhsminor.yy451;
break; break;
case 115: /* typename ::= ids LP signed RP */ case 124: /* typename ::= ids LP signed RP */
{ {
if (yymsp[-1].minor.yy221 <= 0) { if (yymsp[-1].minor.yy481 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
tSqlSetColumnType(&yylhsminor.yy215, &yymsp[-3].minor.yy0); tSqlSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0);
} else { } else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy221; // negative value of name length yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy481; // negative value of name length
tSqlSetColumnType(&yylhsminor.yy215, &yymsp[-3].minor.yy0); tSqlSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0);
} }
} }
yymsp[-3].minor.yy215 = yylhsminor.yy215; yymsp[-3].minor.yy451 = yylhsminor.yy451;
break; break;
case 116: /* typename ::= ids UNSIGNED */ case 125: /* typename ::= ids UNSIGNED */
{ {
yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.type = 0;
yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
tSqlSetColumnType (&yylhsminor.yy215, &yymsp[-1].minor.yy0); tSqlSetColumnType (&yylhsminor.yy451, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy215 = yylhsminor.yy215; yymsp[-1].minor.yy451 = yylhsminor.yy451;
break; break;
case 117: /* signed ::= INTEGER */ case 126: /* signed ::= INTEGER */
{ yylhsminor.yy221 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy221 = yylhsminor.yy221; yymsp[0].minor.yy481 = yylhsminor.yy481;
break; break;
case 118: /* signed ::= PLUS INTEGER */ case 127: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy221 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yymsp[-1].minor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 119: /* signed ::= MINUS INTEGER */ case 128: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy221 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} { yymsp[-1].minor.yy481 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break; break;
case 123: /* cmd ::= CREATE TABLE create_table_list */ case 132: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy278;} { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy310;}
break; break;
case 124: /* create_table_list ::= create_from_stable */ case 133: /* create_table_list ::= create_from_stable */
{ {
SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL)); SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL));
pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));
taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy32); taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy252);
pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
yylhsminor.yy278 = pCreateTable; yylhsminor.yy310 = pCreateTable;
} }
yymsp[0].minor.yy278 = yylhsminor.yy278; yymsp[0].minor.yy310 = yylhsminor.yy310;
break; break;
case 125: /* create_table_list ::= create_table_list create_from_stable */ case 134: /* create_table_list ::= create_table_list create_from_stable */
{ {
taosArrayPush(yymsp[-1].minor.yy278->childTableInfo, &yymsp[0].minor.yy32); taosArrayPush(yymsp[-1].minor.yy310->childTableInfo, &yymsp[0].minor.yy252);
yylhsminor.yy278 = yymsp[-1].minor.yy278; yylhsminor.yy310 = yymsp[-1].minor.yy310;
} }
yymsp[-1].minor.yy278 = yylhsminor.yy278; yymsp[-1].minor.yy310 = yylhsminor.yy310;
break; break;
case 126: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ case 135: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ {
yylhsminor.yy278 = tSetCreateSqlElems(yymsp[-1].minor.yy349, NULL, NULL, TSQL_CREATE_TABLE); yylhsminor.yy310 = tSetCreateSqlElems(yymsp[-1].minor.yy429, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy278, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy310, 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.yy278 = yylhsminor.yy278; yymsp[-5].minor.yy310 = yylhsminor.yy310;
break; break;
case 127: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ case 136: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ {
yylhsminor.yy278 = tSetCreateSqlElems(yymsp[-5].minor.yy349, yymsp[-1].minor.yy349, NULL, TSQL_CREATE_STABLE); yylhsminor.yy310 = tSetCreateSqlElems(yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy278, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy310, 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.yy278 = yylhsminor.yy278; yymsp[-9].minor.yy310 = yylhsminor.yy310;
break; break;
case 128: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ case 137: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yylhsminor.yy32 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy349, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy429, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy32 = yylhsminor.yy32; yymsp[-9].minor.yy252 = yylhsminor.yy252;
break; break;
case 129: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ case 138: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ {
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.yy32 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy349, yymsp[-1].minor.yy349, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
} }
yymsp[-12].minor.yy32 = yylhsminor.yy32; yymsp[-12].minor.yy252 = yylhsminor.yy252;
break; break;
case 130: /* tagNamelist ::= tagNamelist COMMA ids */ case 139: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy349, &yymsp[0].minor.yy0); yylhsminor.yy349 = yymsp[-2].minor.yy349; } {taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy0); yylhsminor.yy429 = yymsp[-2].minor.yy429; }
yymsp[-2].minor.yy349 = yylhsminor.yy349; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 131: /* tagNamelist ::= ids */ case 140: /* tagNamelist ::= ids */
{yylhsminor.yy349 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy349, &yymsp[0].minor.yy0);} {yylhsminor.yy429 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy0);}
yymsp[0].minor.yy349 = yylhsminor.yy349; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 132: /* create_table_args ::= ifnotexists ids cpxName AS select */ case 141: /* create_table_args ::= ifnotexists ids cpxName AS select */
{ {
yylhsminor.yy278 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy216, TSQL_CREATE_STREAM); yylhsminor.yy310 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy372, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy278, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy310, 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.yy278 = yylhsminor.yy278; yymsp[-4].minor.yy310 = yylhsminor.yy310;
break; break;
case 133: /* columnlist ::= columnlist COMMA column */ case 142: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy349, &yymsp[0].minor.yy215); yylhsminor.yy349 = yymsp[-2].minor.yy349; } {taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy451); yylhsminor.yy429 = yymsp[-2].minor.yy429; }
yymsp[-2].minor.yy349 = yylhsminor.yy349; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 134: /* columnlist ::= column */ case 143: /* columnlist ::= column */
{yylhsminor.yy349 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy349, &yymsp[0].minor.yy215);} {yylhsminor.yy429 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy451);}
yymsp[0].minor.yy349 = yylhsminor.yy349; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 135: /* column ::= ids typename */ case 144: /* column ::= ids typename */
{ {
tSqlSetColumnInfo(&yylhsminor.yy215, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy215); tSqlSetColumnInfo(&yylhsminor.yy451, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy451);
} }
yymsp[-1].minor.yy215 = yylhsminor.yy215; yymsp[-1].minor.yy451 = yylhsminor.yy451;
break; break;
case 136: /* tagitemlist ::= tagitemlist COMMA tagitem */ case 145: /* tagitemlist ::= tagitemlist COMMA tagitem */
{ yylhsminor.yy349 = tVariantListAppend(yymsp[-2].minor.yy349, &yymsp[0].minor.yy426, -1); } { yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1); }
yymsp[-2].minor.yy349 = yylhsminor.yy349; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 137: /* tagitemlist ::= tagitem */ case 146: /* tagitemlist ::= tagitem */
{ yylhsminor.yy349 = tVariantListAppend(NULL, &yymsp[0].minor.yy426, -1); } { yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1); }
yymsp[0].minor.yy349 = yylhsminor.yy349; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 138: /* tagitem ::= INTEGER */ case 147: /* tagitem ::= INTEGER */
case 139: /* tagitem ::= FLOAT */ yytestcase(yyruleno==139); case 148: /* tagitem ::= FLOAT */ yytestcase(yyruleno==148);
case 140: /* tagitem ::= STRING */ yytestcase(yyruleno==140); case 149: /* tagitem ::= STRING */ yytestcase(yyruleno==149);
case 141: /* tagitem ::= BOOL */ yytestcase(yyruleno==141); case 150: /* tagitem ::= BOOL */ yytestcase(yyruleno==150);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy426, &yymsp[0].minor.yy0); } { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy426 = yylhsminor.yy426; yymsp[0].minor.yy218 = yylhsminor.yy218;
break; break;
case 142: /* tagitem ::= NULL */ case 151: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy426, &yymsp[0].minor.yy0); } { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy426 = yylhsminor.yy426; yymsp[0].minor.yy218 = yylhsminor.yy218;
break; break;
case 143: /* tagitem ::= MINUS INTEGER */ case 152: /* tagitem ::= MINUS INTEGER */
case 144: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==144); case 153: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==153);
case 145: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==145); case 154: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==154);
case 146: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==146); case 155: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==155);
{ {
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.yy426, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy426 = yylhsminor.yy426; yymsp[-1].minor.yy218 = yylhsminor.yy218;
break; break;
case 147: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ case 156: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ {
yylhsminor.yy216 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy258, yymsp[-9].minor.yy349, yymsp[-8].minor.yy114, yymsp[-4].minor.yy349, yymsp[-3].minor.yy349, &yymsp[-7].minor.yy264, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy349, &yymsp[0].minor.yy454, &yymsp[-1].minor.yy454); yylhsminor.yy372 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy170, yymsp[-9].minor.yy429, yymsp[-8].minor.yy282, yymsp[-4].minor.yy429, yymsp[-3].minor.yy429, &yymsp[-7].minor.yy220, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy429, &yymsp[0].minor.yy18, &yymsp[-1].minor.yy18);
} }
yymsp[-11].minor.yy216 = yylhsminor.yy216; yymsp[-11].minor.yy372 = yylhsminor.yy372;
break; break;
case 148: /* union ::= select */ case 157: /* union ::= select */
{ yylhsminor.yy417 = setSubclause(NULL, yymsp[0].minor.yy216); } { yylhsminor.yy141 = setSubclause(NULL, yymsp[0].minor.yy372); }
yymsp[0].minor.yy417 = yylhsminor.yy417; yymsp[0].minor.yy141 = yylhsminor.yy141;
break; break;
case 149: /* union ::= LP union RP */ case 158: /* union ::= LP union RP */
{ yymsp[-2].minor.yy417 = yymsp[-1].minor.yy417; } { yymsp[-2].minor.yy141 = yymsp[-1].minor.yy141; }
break; break;
case 150: /* union ::= union UNION ALL select */ case 159: /* union ::= union UNION ALL select */
{ yylhsminor.yy417 = appendSelectClause(yymsp[-3].minor.yy417, yymsp[0].minor.yy216); } { yylhsminor.yy141 = appendSelectClause(yymsp[-3].minor.yy141, yymsp[0].minor.yy372); }
yymsp[-3].minor.yy417 = yylhsminor.yy417; yymsp[-3].minor.yy141 = yylhsminor.yy141;
break; break;
case 151: /* union ::= union UNION ALL LP select RP */ case 160: /* union ::= union UNION ALL LP select RP */
{ yylhsminor.yy417 = appendSelectClause(yymsp[-5].minor.yy417, yymsp[-1].minor.yy216); } { yylhsminor.yy141 = appendSelectClause(yymsp[-5].minor.yy141, yymsp[-1].minor.yy372); }
yymsp[-5].minor.yy417 = yylhsminor.yy417; yymsp[-5].minor.yy141 = yylhsminor.yy141;
break; break;
case 152: /* cmd ::= union */ case 161: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy417, NULL, TSDB_SQL_SELECT); } { setSqlInfo(pInfo, yymsp[0].minor.yy141, NULL, TSDB_SQL_SELECT); }
break; break;
case 153: /* select ::= SELECT selcollist */ case 162: /* select ::= SELECT selcollist */
{ {
yylhsminor.yy216 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy258, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yylhsminor.yy372 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy170, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy216 = yylhsminor.yy216; yymsp[-1].minor.yy372 = yylhsminor.yy372;
break; break;
case 154: /* sclp ::= selcollist COMMA */ case 163: /* sclp ::= selcollist COMMA */
{yylhsminor.yy258 = yymsp[-1].minor.yy258;} {yylhsminor.yy170 = yymsp[-1].minor.yy170;}
yymsp[-1].minor.yy258 = yylhsminor.yy258; yymsp[-1].minor.yy170 = yylhsminor.yy170;
break; break;
case 155: /* sclp ::= */ case 164: /* sclp ::= */
{yymsp[1].minor.yy258 = 0;} {yymsp[1].minor.yy170 = 0;}
break; break;
case 156: /* selcollist ::= sclp distinct expr as */ case 165: /* selcollist ::= sclp distinct expr as */
{ {
yylhsminor.yy258 = tSqlExprListAppend(yymsp[-3].minor.yy258, yymsp[-1].minor.yy114, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yylhsminor.yy170 = tSqlExprListAppend(yymsp[-3].minor.yy170, yymsp[-1].minor.yy282, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-3].minor.yy258 = yylhsminor.yy258; yymsp[-3].minor.yy170 = yylhsminor.yy170;
break; break;
case 157: /* selcollist ::= sclp STAR */ case 166: /* selcollist ::= sclp STAR */
{ {
tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL); tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL);
yylhsminor.yy258 = tSqlExprListAppend(yymsp[-1].minor.yy258, pNode, 0, 0); yylhsminor.yy170 = tSqlExprListAppend(yymsp[-1].minor.yy170, pNode, 0, 0);
} }
yymsp[-1].minor.yy258 = yylhsminor.yy258; yymsp[-1].minor.yy170 = yylhsminor.yy170;
break; break;
case 158: /* as ::= AS ids */ case 167: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 159: /* as ::= ids */ case 168: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } { yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 160: /* as ::= */ case 169: /* as ::= */
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
break; break;
case 161: /* distinct ::= DISTINCT */ case 170: /* distinct ::= DISTINCT */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } { yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 163: /* from ::= FROM tablelist */ case 172: /* from ::= FROM tablelist */
{yymsp[-1].minor.yy349 = yymsp[0].minor.yy349;} {yymsp[-1].minor.yy429 = yymsp[0].minor.yy429;}
break; break;
case 164: /* tablelist ::= ids cpxName */ case 173: /* tablelist ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy349 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy349 = tVariantListAppendToken(yylhsminor.yy349, &yymsp[-1].minor.yy0, -1); // table alias name yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[-1].minor.yy0, -1); // table alias name
} }
yymsp[-1].minor.yy349 = yylhsminor.yy349; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 165: /* tablelist ::= ids cpxName ids */ case 174: /* tablelist ::= ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy349 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy349 = tVariantListAppendToken(yylhsminor.yy349, &yymsp[0].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[0].minor.yy0, -1);
} }
yymsp[-2].minor.yy349 = yylhsminor.yy349; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 166: /* tablelist ::= tablelist COMMA ids cpxName */ case 175: /* tablelist ::= tablelist COMMA ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy349 = tVariantListAppendToken(yymsp[-3].minor.yy349, &yymsp[-1].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy349 = tVariantListAppendToken(yylhsminor.yy349, &yymsp[-1].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[-1].minor.yy0, -1);
} }
yymsp[-3].minor.yy349 = yylhsminor.yy349; yymsp[-3].minor.yy429 = yylhsminor.yy429;
break; break;
case 167: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 176: /* tablelist ::= tablelist COMMA ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy349 = tVariantListAppendToken(yymsp[-4].minor.yy349, &yymsp[-2].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(yymsp[-4].minor.yy429, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy349 = tVariantListAppendToken(yylhsminor.yy349, &yymsp[0].minor.yy0, -1); yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[0].minor.yy0, -1);
} }
yymsp[-4].minor.yy349 = yylhsminor.yy349; yymsp[-4].minor.yy429 = yylhsminor.yy429;
break; break;
case 168: /* tmvar ::= VARIABLE */ case 177: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;} {yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 169: /* interval_opt ::= INTERVAL LP tmvar RP */ case 178: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy264.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy264.offset.n = 0; yymsp[-3].minor.yy264.offset.z = NULL; yymsp[-3].minor.yy264.offset.type = 0;} {yymsp[-3].minor.yy220.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy220.offset.n = 0; yymsp[-3].minor.yy220.offset.z = NULL; yymsp[-3].minor.yy220.offset.type = 0;}
break; break;
case 170: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ case 179: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy264.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy264.offset = yymsp[-1].minor.yy0;} {yymsp[-5].minor.yy220.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy220.offset = yymsp[-1].minor.yy0;}
break; break;
case 171: /* interval_opt ::= */ case 180: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy264, 0, sizeof(yymsp[1].minor.yy264));} {memset(&yymsp[1].minor.yy220, 0, sizeof(yymsp[1].minor.yy220));}
break; break;
case 172: /* fill_opt ::= */ case 181: /* fill_opt ::= */
{yymsp[1].minor.yy349 = 0; } {yymsp[1].minor.yy429 = 0; }
break; break;
case 173: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 182: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ {
tVariant A = {0}; tVariant A = {0};
toTSDBType(yymsp[-3].minor.yy0.type); toTSDBType(yymsp[-3].minor.yy0.type);
tVariantCreate(&A, &yymsp[-3].minor.yy0); tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantListInsert(yymsp[-1].minor.yy349, &A, -1, 0); tVariantListInsert(yymsp[-1].minor.yy429, &A, -1, 0);
yymsp[-5].minor.yy349 = yymsp[-1].minor.yy349; yymsp[-5].minor.yy429 = yymsp[-1].minor.yy429;
} }
break; break;
case 174: /* fill_opt ::= FILL LP ID RP */ case 183: /* fill_opt ::= FILL LP ID RP */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy349 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yymsp[-3].minor.yy429 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
break; break;
case 175: /* sliding_opt ::= SLIDING LP tmvar RP */ case 184: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
break; break;
case 176: /* sliding_opt ::= */ case 185: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
break; break;
case 177: /* orderby_opt ::= */ case 186: /* orderby_opt ::= */
{yymsp[1].minor.yy349 = 0;} {yymsp[1].minor.yy429 = 0;}
break; break;
case 178: /* orderby_opt ::= ORDER BY sortlist */ case 187: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy349 = yymsp[0].minor.yy349;} {yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;}
break; break;
case 179: /* sortlist ::= sortlist COMMA item sortorder */ case 188: /* sortlist ::= sortlist COMMA item sortorder */
{ {
yylhsminor.yy349 = tVariantListAppend(yymsp[-3].minor.yy349, &yymsp[-1].minor.yy426, yymsp[0].minor.yy348); yylhsminor.yy429 = tVariantListAppend(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116);
} }
yymsp[-3].minor.yy349 = yylhsminor.yy349; yymsp[-3].minor.yy429 = yylhsminor.yy429;
break; break;
case 180: /* sortlist ::= item sortorder */ case 189: /* sortlist ::= item sortorder */
{ {
yylhsminor.yy349 = tVariantListAppend(NULL, &yymsp[-1].minor.yy426, yymsp[0].minor.yy348); yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116);
} }
yymsp[-1].minor.yy349 = yylhsminor.yy349; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 181: /* item ::= ids cpxName */ case 190: /* item ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yylhsminor.yy426, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy426 = yylhsminor.yy426; yymsp[-1].minor.yy218 = yylhsminor.yy218;
break; break;
case 182: /* sortorder ::= ASC */ case 191: /* sortorder ::= ASC */
{ yymsp[0].minor.yy348 = TSDB_ORDER_ASC; } { yymsp[0].minor.yy116 = TSDB_ORDER_ASC; }
break; break;
case 183: /* sortorder ::= DESC */ case 192: /* sortorder ::= DESC */
{ yymsp[0].minor.yy348 = TSDB_ORDER_DESC;} { yymsp[0].minor.yy116 = TSDB_ORDER_DESC;}
break; break;
case 184: /* sortorder ::= */ case 193: /* sortorder ::= */
{ yymsp[1].minor.yy348 = TSDB_ORDER_ASC; } { yymsp[1].minor.yy116 = TSDB_ORDER_ASC; }
break; break;
case 185: /* groupby_opt ::= */ case 194: /* groupby_opt ::= */
{ yymsp[1].minor.yy349 = 0;} { yymsp[1].minor.yy429 = 0;}
break; break;
case 186: /* groupby_opt ::= GROUP BY grouplist */ case 195: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy349 = yymsp[0].minor.yy349;} { yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;}
break; break;
case 187: /* grouplist ::= grouplist COMMA item */ case 196: /* grouplist ::= grouplist COMMA item */
{ {
yylhsminor.yy349 = tVariantListAppend(yymsp[-2].minor.yy349, &yymsp[0].minor.yy426, -1); yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1);
} }
yymsp[-2].minor.yy349 = yylhsminor.yy349; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 188: /* grouplist ::= item */ case 197: /* grouplist ::= item */
{ {
yylhsminor.yy349 = tVariantListAppend(NULL, &yymsp[0].minor.yy426, -1); yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1);
} }
yymsp[0].minor.yy349 = yylhsminor.yy349; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 189: /* having_opt ::= */ case 198: /* having_opt ::= */
case 199: /* where_opt ::= */ yytestcase(yyruleno==199); case 208: /* where_opt ::= */ yytestcase(yyruleno==208);
case 238: /* expritem ::= */ yytestcase(yyruleno==238); case 247: /* expritem ::= */ yytestcase(yyruleno==247);
{yymsp[1].minor.yy114 = 0;} {yymsp[1].minor.yy282 = 0;}
break; break;
case 190: /* having_opt ::= HAVING expr */ case 199: /* having_opt ::= HAVING expr */
case 200: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==200); case 209: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==209);
{yymsp[-1].minor.yy114 = yymsp[0].minor.yy114;} {yymsp[-1].minor.yy282 = yymsp[0].minor.yy282;}
break; break;
case 191: /* limit_opt ::= */ case 200: /* limit_opt ::= */
case 195: /* slimit_opt ::= */ yytestcase(yyruleno==195); case 204: /* slimit_opt ::= */ yytestcase(yyruleno==204);
{yymsp[1].minor.yy454.limit = -1; yymsp[1].minor.yy454.offset = 0;} {yymsp[1].minor.yy18.limit = -1; yymsp[1].minor.yy18.offset = 0;}
break; break;
case 192: /* limit_opt ::= LIMIT signed */ case 201: /* limit_opt ::= LIMIT signed */
case 196: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==196); case 205: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==205);
{yymsp[-1].minor.yy454.limit = yymsp[0].minor.yy221; yymsp[-1].minor.yy454.offset = 0;} {yymsp[-1].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-1].minor.yy18.offset = 0;}
break; break;
case 193: /* limit_opt ::= LIMIT signed OFFSET signed */ case 202: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy454.limit = yymsp[-2].minor.yy221; yymsp[-3].minor.yy454.offset = yymsp[0].minor.yy221;} { yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;}
break; break;
case 194: /* limit_opt ::= LIMIT signed COMMA signed */ case 203: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy454.limit = yymsp[0].minor.yy221; yymsp[-3].minor.yy454.offset = yymsp[-2].minor.yy221;} { yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;}
break; break;
case 197: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ case 206: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy454.limit = yymsp[-2].minor.yy221; yymsp[-3].minor.yy454.offset = yymsp[0].minor.yy221;} {yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;}
break; break;
case 198: /* slimit_opt ::= SLIMIT signed COMMA signed */ case 207: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy454.limit = yymsp[0].minor.yy221; yymsp[-3].minor.yy454.offset = yymsp[-2].minor.yy221;} {yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;}
break; break;
case 201: /* expr ::= LP expr RP */ case 210: /* expr ::= LP expr RP */
{yylhsminor.yy114 = yymsp[-1].minor.yy114; yylhsminor.yy114->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy114->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} {yylhsminor.yy282 = yymsp[-1].minor.yy282; yylhsminor.yy282->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy282->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 202: /* expr ::= ID */ case 211: /* expr ::= ID */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 203: /* expr ::= ID DOT ID */ case 212: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 204: /* expr ::= ID DOT STAR */ case 213: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 205: /* expr ::= INTEGER */ case 214: /* expr ::= INTEGER */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 206: /* expr ::= MINUS INTEGER */ case 215: /* expr ::= MINUS INTEGER */
case 207: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==207); case 216: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==216);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy114 = yylhsminor.yy114; yymsp[-1].minor.yy282 = yylhsminor.yy282;
break; break;
case 208: /* expr ::= FLOAT */ case 217: /* expr ::= FLOAT */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 209: /* expr ::= MINUS FLOAT */ case 218: /* expr ::= MINUS FLOAT */
case 210: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==210); case 219: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==219);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy114 = yylhsminor.yy114; yymsp[-1].minor.yy282 = yylhsminor.yy282;
break; break;
case 211: /* expr ::= STRING */ case 220: /* expr ::= STRING */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 212: /* expr ::= NOW */ case 221: /* expr ::= NOW */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 213: /* expr ::= VARIABLE */ case 222: /* expr ::= VARIABLE */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 214: /* expr ::= BOOL */ case 223: /* expr ::= BOOL */
{ yylhsminor.yy114 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} { yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 215: /* expr ::= ID LP exprlist RP */ case 224: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy114 = tSqlExprCreateFunction(yymsp[-1].minor.yy258, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy282 = tSqlExprCreateFunction(yymsp[-1].minor.yy170, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy114 = yylhsminor.yy114; yymsp[-3].minor.yy282 = yylhsminor.yy282;
break; break;
case 216: /* expr ::= ID LP STAR RP */ case 225: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy114 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy282 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy114 = yylhsminor.yy114; yymsp[-3].minor.yy282 = yylhsminor.yy282;
break; break;
case 217: /* expr ::= expr IS NULL */ case 226: /* expr ::= expr IS NULL */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, NULL, TK_ISNULL);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, NULL, TK_ISNULL);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 218: /* expr ::= expr IS NOT NULL */ case 227: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-3].minor.yy114, NULL, TK_NOTNULL);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-3].minor.yy282, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy114 = yylhsminor.yy114; yymsp[-3].minor.yy282 = yylhsminor.yy282;
break; break;
case 219: /* expr ::= expr LT expr */ case 228: /* expr ::= expr LT expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_LT);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LT);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 220: /* expr ::= expr GT expr */ case 229: /* expr ::= expr GT expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_GT);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_GT);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 221: /* expr ::= expr LE expr */ case 230: /* expr ::= expr LE expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_LE);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LE);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 222: /* expr ::= expr GE expr */ case 231: /* expr ::= expr GE expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_GE);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_GE);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 223: /* expr ::= expr NE expr */ case 232: /* expr ::= expr NE expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_NE);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_NE);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 224: /* expr ::= expr EQ expr */ case 233: /* expr ::= expr EQ expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_EQ);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_EQ);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 225: /* expr ::= expr BETWEEN expr AND expr */ case 234: /* expr ::= expr BETWEEN expr AND expr */
{ tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy114); yylhsminor.yy114 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy114, yymsp[-2].minor.yy114, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy114, TK_LE), TK_AND);} { tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy282); yylhsminor.yy282 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy282, yymsp[-2].minor.yy282, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy282, TK_LE), TK_AND);}
yymsp[-4].minor.yy114 = yylhsminor.yy114; yymsp[-4].minor.yy282 = yylhsminor.yy282;
break; break;
case 226: /* expr ::= expr AND expr */ case 235: /* expr ::= expr AND expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_AND);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_AND);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 227: /* expr ::= expr OR expr */ case 236: /* expr ::= expr OR expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_OR); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_OR); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 228: /* expr ::= expr PLUS expr */ case 237: /* expr ::= expr PLUS expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_PLUS); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_PLUS); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 229: /* expr ::= expr MINUS expr */ case 238: /* expr ::= expr MINUS expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_MINUS); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_MINUS); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 230: /* expr ::= expr STAR expr */ case 239: /* expr ::= expr STAR expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_STAR); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_STAR); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 231: /* expr ::= expr SLASH expr */ case 240: /* expr ::= expr SLASH expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_DIVIDE);} {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_DIVIDE);}
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 232: /* expr ::= expr REM expr */ case 241: /* expr ::= expr REM expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_REM); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_REM); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 233: /* expr ::= expr LIKE expr */ case 242: /* expr ::= expr LIKE expr */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-2].minor.yy114, yymsp[0].minor.yy114, TK_LIKE); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LIKE); }
yymsp[-2].minor.yy114 = yylhsminor.yy114; yymsp[-2].minor.yy282 = yylhsminor.yy282;
break; break;
case 234: /* expr ::= expr IN LP exprlist RP */ case 243: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy114 = tSqlExprCreate(yymsp[-4].minor.yy114, (tSQLExpr*)yymsp[-1].minor.yy258, TK_IN); } {yylhsminor.yy282 = tSqlExprCreate(yymsp[-4].minor.yy282, (tSQLExpr*)yymsp[-1].minor.yy170, TK_IN); }
yymsp[-4].minor.yy114 = yylhsminor.yy114; yymsp[-4].minor.yy282 = yylhsminor.yy282;
break; break;
case 235: /* exprlist ::= exprlist COMMA expritem */ case 244: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy258 = tSqlExprListAppend(yymsp[-2].minor.yy258,yymsp[0].minor.yy114,0, 0);} {yylhsminor.yy170 = tSqlExprListAppend(yymsp[-2].minor.yy170,yymsp[0].minor.yy282,0, 0);}
yymsp[-2].minor.yy258 = yylhsminor.yy258; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 236: /* exprlist ::= expritem */ case 245: /* exprlist ::= expritem */
{yylhsminor.yy258 = tSqlExprListAppend(0,yymsp[0].minor.yy114,0, 0);} {yylhsminor.yy170 = tSqlExprListAppend(0,yymsp[0].minor.yy282,0, 0);}
yymsp[0].minor.yy258 = yylhsminor.yy258; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 237: /* expritem ::= expr */ case 246: /* expritem ::= expr */
{yylhsminor.yy114 = yymsp[0].minor.yy114;} {yylhsminor.yy282 = yymsp[0].minor.yy282;}
yymsp[0].minor.yy114 = yylhsminor.yy114; yymsp[0].minor.yy282 = yylhsminor.yy282;
break; break;
case 239: /* cmd ::= RESET QUERY CACHE */ case 248: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break; break;
case 240: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 249: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy349, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 241: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ case 250: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -2916,14 +2968,14 @@ static void yy_reduce( ...@@ -2916,14 +2968,14 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 242: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 251: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy349, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 243: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ case 252: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -2934,7 +2986,7 @@ static void yy_reduce( ...@@ -2934,7 +2986,7 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 244: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ case 253: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -2948,26 +3000,26 @@ static void yy_reduce( ...@@ -2948,26 +3000,26 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 245: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ case 254: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ {
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy426, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy218, -1);
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&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);
} }
break; break;
case 246: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ case 255: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy349, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, 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);
} }
break; break;
case 247: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ case 256: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -2978,14 +3030,14 @@ static void yy_reduce( ...@@ -2978,14 +3030,14 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 248: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ case 257: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy349, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, 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);
} }
break; break;
case 249: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ case 258: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -2996,7 +3048,7 @@ static void yy_reduce( ...@@ -2996,7 +3048,7 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 250: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ case 259: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -3010,13 +3062,13 @@ static void yy_reduce( ...@@ -3010,13 +3062,13 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 251: /* cmd ::= KILL CONNECTION INTEGER */ case 260: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break; break;
case 252: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ case 261: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break; break;
case 253: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ case 262: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break; break;
default: default:
......
...@@ -197,6 +197,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_VGROUP_NOT_READY, "Database unsynced") ...@@ -197,6 +197,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_VGROUP_NOT_READY, "Database unsynced")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_DAYS, "Invalid database option: days out of range") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_DAYS, "Invalid database option: days out of range")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_KEEP, "Invalid database option: keep >= keep1 >= keep0 >= days") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_KEEP, "Invalid database option: keep >= keep1 >= keep0 >= days")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC, "Invalid topic name")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC_OPTION, "Invalid topic option")
// dnode // dnode
TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, "Message not processed") TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, "Message not processed")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, "Dnode out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, "Dnode out of memory")
......
...@@ -40,6 +40,7 @@ typedef struct { ...@@ -40,6 +40,7 @@ typedef struct {
int32_t queuedWMsg; int32_t queuedWMsg;
int32_t queuedRMsg; int32_t queuedRMsg;
int32_t flowctrlLevel; int32_t flowctrlLevel;
int32_t sequence; // for topic
int8_t status; int8_t status;
int8_t role; int8_t role;
int8_t accessState; int8_t accessState;
...@@ -47,7 +48,7 @@ typedef struct { ...@@ -47,7 +48,7 @@ typedef struct {
int8_t isCommiting; int8_t isCommiting;
int8_t dbReplica; int8_t dbReplica;
int8_t dropped; int8_t dropped;
int8_t reserved; int8_t dbType;
uint64_t version; // current version uint64_t version; // current version
uint64_t cversion; // version while commit start uint64_t cversion; // version while commit start
uint64_t fversion; // version on saved data file uint64_t fversion; // version on saved data file
......
...@@ -42,6 +42,7 @@ static void vnodeLoadCfg(SVnodeObj *pVnode, SCreateVnodeMsg* vnodeMsg) { ...@@ -42,6 +42,7 @@ static void vnodeLoadCfg(SVnodeObj *pVnode, SCreateVnodeMsg* vnodeMsg) {
pVnode->syncCfg.replica = vnodeMsg->cfg.vgReplica; pVnode->syncCfg.replica = vnodeMsg->cfg.vgReplica;
pVnode->syncCfg.quorum = vnodeMsg->cfg.quorum; pVnode->syncCfg.quorum = vnodeMsg->cfg.quorum;
pVnode->dbReplica = vnodeMsg->cfg.dbReplica; pVnode->dbReplica = vnodeMsg->cfg.dbReplica;
pVnode->dbType = vnodeMsg->cfg.dbType;
for (int i = 0; i < pVnode->syncCfg.replica; ++i) { for (int i = 0; i < pVnode->syncCfg.replica; ++i) {
SVnodeDesc *node = &vnodeMsg->nodes[i]; SVnodeDesc *node = &vnodeMsg->nodes[i];
...@@ -214,7 +215,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -214,7 +215,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON *dbReplica = cJSON_GetObjectItem(root, "dbReplica"); cJSON *dbReplica = cJSON_GetObjectItem(root, "dbReplica");
if (!dbReplica || dbReplica->type != cJSON_Number) { if (!dbReplica || dbReplica->type != cJSON_Number) {
vError("vgId:%d, failed to read %s, dbReplica not found", pVnode->vgId, file); vWarn("vgId:%d, failed to read %s, dbReplica not found", pVnode->vgId, file);
vnodeMsg.cfg.dbReplica = vnodeMsg.cfg.vgReplica; vnodeMsg.cfg.dbReplica = vnodeMsg.cfg.vgReplica;
vnodeMsg.cfg.vgCfgVersion = 0; vnodeMsg.cfg.vgCfgVersion = 0;
} else { } else {
...@@ -230,7 +231,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -230,7 +231,7 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON *update = cJSON_GetObjectItem(root, "update"); cJSON *update = cJSON_GetObjectItem(root, "update");
if (!update || update->type != cJSON_Number) { if (!update || update->type != cJSON_Number) {
vError("vgId: %d, failed to read %s, update not found", pVnode->vgId, file); vWarn("vgId: %d, failed to read %s, update not found", pVnode->vgId, file);
vnodeMsg.cfg.update = 0; vnodeMsg.cfg.update = 0;
vnodeMsg.cfg.vgCfgVersion = 0; vnodeMsg.cfg.vgCfgVersion = 0;
} else { } else {
...@@ -239,13 +240,21 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) { ...@@ -239,13 +240,21 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON *cacheLastRow = cJSON_GetObjectItem(root, "cacheLastRow"); cJSON *cacheLastRow = cJSON_GetObjectItem(root, "cacheLastRow");
if (!cacheLastRow || cacheLastRow->type != cJSON_Number) { if (!cacheLastRow || cacheLastRow->type != cJSON_Number) {
vError("vgId: %d, failed to read %s, cacheLastRow not found", pVnode->vgId, file); vWarn("vgId: %d, failed to read %s, cacheLastRow not found", pVnode->vgId, file);
vnodeMsg.cfg.cacheLastRow = 0; vnodeMsg.cfg.cacheLastRow = 0;
vnodeMsg.cfg.vgCfgVersion = 0; vnodeMsg.cfg.vgCfgVersion = 0;
} else { } else {
vnodeMsg.cfg.cacheLastRow = (int8_t)cacheLastRow->valueint; vnodeMsg.cfg.cacheLastRow = (int8_t)cacheLastRow->valueint;
} }
cJSON *dbType = cJSON_GetObjectItem(root, "dbType");
if (!dbType || dbType->type != cJSON_Number) {
vWarn("vgId: %d, failed to read %s, dbType not found", pVnode->vgId, file);
vnodeMsg.cfg.dbType = 0;
} else {
vnodeMsg.cfg.dbType = (int8_t)dbType->valueint;
}
cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos");
if (!nodeInfos || nodeInfos->type != cJSON_Array) { if (!nodeInfos || nodeInfos->type != cJSON_Array) {
vError("vgId:%d, failed to read %s, nodeInfos not found", pVnode->vgId, file); vError("vgId:%d, failed to read %s, nodeInfos not found", pVnode->vgId, file);
...@@ -337,6 +346,7 @@ int32_t vnodeWriteCfg(SCreateVnodeMsg *pMsg) { ...@@ -337,6 +346,7 @@ int32_t vnodeWriteCfg(SCreateVnodeMsg *pMsg) {
len += snprintf(content + len, maxLen - len, " \"quorum\": %d,\n", pMsg->cfg.quorum); len += snprintf(content + len, maxLen - len, " \"quorum\": %d,\n", pMsg->cfg.quorum);
len += snprintf(content + len, maxLen - len, " \"update\": %d,\n", pMsg->cfg.update); len += snprintf(content + len, maxLen - len, " \"update\": %d,\n", pMsg->cfg.update);
len += snprintf(content + len, maxLen - len, " \"cacheLastRow\": %d,\n", pMsg->cfg.cacheLastRow); len += snprintf(content + len, maxLen - len, " \"cacheLastRow\": %d,\n", pMsg->cfg.cacheLastRow);
len += snprintf(content + len, maxLen - len, " \"dbType\": %d,\n", pMsg->cfg.dbType);
len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n"); len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n");
for (int32_t i = 0; i < pMsg->cfg.vgReplica; i++) { for (int32_t i = 0; i < pMsg->cfg.vgReplica; i++) {
SVnodeDesc *node = &pMsg->nodes[i]; SVnodeDesc *node = &pMsg->nodes[i];
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "tp.h"
#include "taosmsg.h" #include "taosmsg.h"
#include "taoserror.h" #include "taoserror.h"
#include "tglobal.h" #include "tglobal.h"
...@@ -139,6 +140,10 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR ...@@ -139,6 +140,10 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
vTrace("vgId:%d, submit msg is processed", pVnode->vgId); vTrace("vgId:%d, submit msg is processed", pVnode->vgId);
if (pVnode->dbType == TSDB_DB_TYPE_TOPIC && pVnode->role == TAOS_SYNC_ROLE_MASTER) {
tpUpdateTs(&pVnode->sequence, pCont);
}
// save insert result into item // save insert result into item
SShellSubmitRspMsg *pRsp = NULL; SShellSubmitRspMsg *pRsp = NULL;
if (pRet) { if (pRet) {
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 100
system sh/cfg.sh -n dnode1 -c partitions -v 4
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ====step1 create with default para
sql create topic t1;
sql use t1;
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
if $data02 != 4 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 < 1 then
return -1
endi
#numofvgroups
if $data03 < 1 then
return -1
endi
sql show t1.vgroups;
if $rows < 1 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
if $data04 < 1 then
return -1
endi
sql show t1.tables;
if $rows < 1 then
return -1
endi
sql drop topic t1
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
sql_error use t1;
sql_error show t1.vgroups;
sql_error show t1.stables;
sql_error show t1.tables;
print ====step2 create with giving para
sql create topic t1 partitions 6;
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
if $data02 != 6 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 != 6 then
return -1
endi
#numofvgroups
if $data03 != 6 then
return -1
endi
sql show t1.vgroups;
if $rows != 6 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
if $data00 != ps then
return -1
endi
if $data04 != 6 then
return -1
endi
sql show t1.tables;
if $rows != 6 then
return -1
endi
sql describe t1.ps;
if $data00 != off then
return -1
endi
if $data10 != ts then
return -1
endi
if $data20 != content then
return -1
endi
if $data30 != pid then
return -1
endi
sql describe t1.p1;
if $data00 != off then
return -1
endi
if $data10 != ts then
return -1
endi
if $data20 != content then
return -1
endi
if $data30 != pid then
return -1
endi
sql drop topic t1
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
sql_error show t1.vgroups;
sql_error show t1.stables;
sql_error show t1.tables;
sql_error create topic t1 partitions -1;
sql_error create topic t1 partitions 0;
sql_error create topic t1 partitions 10001;
print =============step3 create with db para
sql create topic db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
sql show databases
if $data00 != db then
return -1
endi
if $data02 != 4 then
return -1
endi
if $data03 != 4 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data06 != 10 then
return -1
endi
if $data07 != 20,20,20 then
return -1
endi
if $data08 != 2 then
return -1
endi
if $data09 != 4 then
return -1
endi
sql drop topic db;
sql create topic db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 partitions 7
sql show databases
if $data00 != db then
return -1
endi
if $data02 != 7 then
return -1
endi
if $data03 != 7 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data06 != 10 then
return -1
endi
if $data07 != 20,20,20 then
return -1
endi
if $data08 != 2 then
return -1
endi
if $data09 != 4 then
return -1
endi
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != db then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != db then
return -1
endi
#tables
if $data02 != 7 then
return -1
endi
#numofvgroups
sql show db.vgroups;
if $rows != 7 then
return -1
endi
sql show db.stables;
if $rows != 1 then
return -1
endi
sql show db.tables;
if $rows != 7 then
return -1
endi
print ============== step name
sql_error alter database db name d1
sql_error alter database db name d2
sql_error alter topic db name d1
sql_error alter topic db name d2
print ============== step ntables
sql_error alter database db ntables -1
sql_error alter database db ntables 0
sql_error alter database db ntables 1
sql_error alter database db ntables 10
sql_error alter topic db ntables -1
sql_error alter topic db ntables 0
sql_error alter topic db ntables 1
sql_error alter topic db ntables 10
print ============== step vgroups
sql_error alter database db vgroups -1
sql_error alter database db vgroups 0
sql_error alter database db vgroups 1
sql_error alter database db vgroups 10
sql_error alter topic db vgroups -1
sql_error alter topic db vgroups 0
sql_error alter topic db vgroups 1
sql_error alter topic db vgroups 10
print ============== step replica
sql_error alter database db replica 2
sql_error alter database db replica 3
sql_error alter database db replica 0
sql_error alter topic db replica 2
sql_error alter topic db replica 3
sql_error alter topic db replica 0
sql alter database db replica 1
sql show databases
print replica $data4_db
if $data4_db != 1 then
return -1
endi
sql show topics
if $rows != 1 then
return -1
endi
print ============== step quorum
sql show databases
print quorum $data5_db
if $data5_db != 1 then
return -1
endi
sql_error alter topic db quorum 1
sql alter database db quorum 1
sql show databases
print quorum $data5_db
if $data5_db != 1 then
return -1
endi
sql_error alter database db quorum 2
sql_error alter database db quorum 3
sql_error alter topic db quorum 2
sql_error alter topic db quorum 3
sql_error alter database db quorum 0
sql_error alter database db quorum 4
sql_error alter database db quorum 5
sql_error alter database db quorum -1
sql_error alter topic db quorum 0
sql_error alter topic db quorum 4
sql_error alter topic db quorum 5
sql_error alter topic db quorum -1
print ============== step days
sql_error alter database db days 0
sql_error alter database db days 1
sql_error alter database db days 2
sql_error alter database db days 10
sql_error alter database db days 50
sql_error alter database db days 100
sql_error alter topic db days 0
sql_error alter topic db days 1
sql_error alter topic db days 2
sql_error alter topic db days 10
sql_error alter topic db days 50
sql_error alter topic db days 100
print ============== step keep
sql show databases
print keep $data7_db
if $data7_db != 20,20,20 then
return -1
endi
sql_error topic db keep 20
sql alter database db keep 20
sql show databases
print keep $data7_db
if $data7_db != 20,20,20 then
return -1
endi
sql_error topic db keep 30
sql alter database db keep 30
sql show databases
print keep $data7_db
if $data7_db != 20,20,30 then
return -1
endi
sql_error alter topic db keep 40
sql alter database db keep 40
sql show databases
print keep $data7_db
if $data7_db != 20,20,40 then
return -1
endi
sql alter database db keep 40
sql alter database db keep 30
sql alter database db keep 20
sql_error alter database db keep 10
sql_error alter database db keep 9
sql_error alter database db keep 1
sql alter database db keep 0
sql alter database db keep -1
sql_error alter database db keep 365001
sql_error alter topic db keep 40
sql_error alter topic db keep 30
sql_error alter topic db keep 20
sql_error alter topic db keep 10
sql_error alter topic db keep 9
sql_error alter topic db keep 1
sql_error alter topic db keep 0
sql_error alter topic db keep -1
sql_error alter topic db keep 365001
print ============== step cache
sql_error alter database db cache 60
sql_error alter database db cache 50
sql_error alter database db cache 20
sql_error alter database db cache 3
sql_error alter database db cache 129
sql_error alter database db cache 300
sql_error alter database db cache 0
sql_error alter database db cache -1
sql_error alter topic db cache 60
sql_error alter topic db cache 50
sql_error alter topic db cache 20
sql_error alter topic db cache 3
sql_error alter topic db cache 129
sql_error alter topic db cache 300
sql_error alter topic db cache 0
sql_error alter topic db cache -1
print ============== step blocks
sql show databases
print blocks $data9_db
if $data9_db != 4 then
return -1
endi
sql_error alter topic db blocks 10
sql alter database db blocks 10
sql show databases
print blocks $data9_db
if $data9_db != 10 then
return -1
endi
sql_error alter topic db blocks 20
sql alter database db blocks 20
sql show databases
print blocks $data9_db
if $data9_db != 20 then
return -1
endi
sql_error alter topic db blocks 20
sql alter database db blocks 30
sql show databases
print blocks $data9_db
if $data9_db != 30 then
return -1
endi
sql alter database db blocks 40
sql alter database db blocks 30
sql alter database db blocks 20
sql alter database db blocks 10
sql_error alter database db blocks 2
sql_error alter database db blocks 1
sql alter database db blocks 0
sql_error alter database db blocks -1
sql_error alter database db blocks 10001
sql_error alter topic db blocks 40
sql_error alter topic db blocks 30
sql_error alter topic db blocks 20
sql_error alter topic db blocks 10
sql_error alter topic db blocks 2
sql_error alter topic db blocks 1
sql_error alter topic db blocks 0
sql_error alter topic db blocks -1
sql_error alter topic db blocks 10001
print ============== step minrows
sql_error alter database db minrows 1
sql_error alter database db minrows 100
sql_error alter database db minrows 1000
sql_error alter topic db minrows 1
sql_error alter topic db minrows 100
sql_error alter topic db minrows 1000
print ============== step maxrows
sql_error alter database db maxrows 1
sql_error alter database db maxrows 100
sql_error alter database db maxrows 1000
sql_error alter topic db maxrows 1
sql_error alter topic db maxrows 100
sql_error alter topic db maxrows 1000
print ============== step wallevel
sql show databases
print wallevel $data12_db
if $data12_db != 1 then
return -1
endi
sql_error alter topic db wal 1
sql alter database db wal 1
sql show databases
print wal $data12_db
if $data12_db != 1 then
return -1
endi
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 0
sql_error alter database db wal 3
sql_error alter database db wal 4
sql_error alter database db wal -1
sql_error alter database db wal 1000
sql_error alter topic db wal 1
sql_error alter topic db wal 2
sql_error alter topic db wal 1
sql_error alter topic db wal 2
sql_error alter topic db wal 0
sql_error alter topic db wal 3
sql_error alter topic db wal 4
sql_error alter topic db wal -1
sql_error alter topic db wal 1000
print ============== step fsync
sql alter database db fsync 0
sql alter database db fsync 1
sql alter database db fsync 3600
sql alter database db fsync 18000
sql alter database db fsync 180000
sql_error alter database db fsync 180001
sql_error alter database db fsync -1
sql_error alter topic db fsync 0
sql_error alter topic db fsync 1
sql_error alter topic db fsync 3600
sql_error alter topic db fsync 18000
sql_error alter topic db fsync 180000
sql_error alter topic db fsync 180001
sql_error alter topic db fsync -1
print ============== step comp
sql show databases
print comp $data14_db
if $data14_db != 2 then
return -1
endi
sql_error alter topic db comp 1
sql alter database db comp 1
sql show databases
print comp $data14_db
if $data14_db != 1 then
return -1
endi
sql_error alter topic db comp 2
sql alter database db comp 2
sql show databases
print comp $data14_db
if $data14_db != 2 then
return -1
endi
sql_error alter topic db comp 0
sql alter database db comp 0
sql show databases
print comp $data14_db
if $data14_db != 0 then
return -1
endi
sql_error alter database db comp 3
sql_error alter database db comp 4
sql_error alter database db comp 5
sql_error alter database db comp -1
sql_error alter topic db comp 3
sql_error alter topic db comp 4
sql_error alter topic db comp 5
sql_error alter topic db comp -1
print ============== step precision
sql_error alter database db prec 'us'
sql_error alter topic db prec 'us'
print ============== step status
sql_error alter database db status 'delete'
sql_error alter topic db status 'delete'
print ============== step drop
sql drop database db
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
print ============== step db1
sql create database d1
sql_error alter database d1 partitions 2
sql_error alter topic d1 partitions 2
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql alter database d1 fsync 0
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql drop database d1
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
print ============== step db2
sql create topic d1
sql show topics;
if $rows != 1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql alter database d1 fsync 0
sql show topics;
if $rows != 1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql drop database d1
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
print ============== step db3
sql create topic d1
sql show topics;
if $rows != 1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql alter topic d1 partitions 2
sql show topics;
if $rows != 1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql drop database d1
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 0 then
return -1
endi
print ============== step partitions
sql create topic t1 partitions 5
sql_error alter database t1 partitions -1
sql_error alter database t1 partitions 0
sql_error alter database t1 partitions 1
sql_error alter database t1 partitions 2
sql_error alter database t1 partitions 3
sql_error alter database t1 partitions 100
sql_error alter database t1 partitions 1000
sql_error alter database t1 partitions 10000
sql_error alter topic t1 partitions -1
sql_error alter topic t1 partitions 0
sql_error alter database t1 partitions 10000
sql alter topic t1 partitions 1
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 != 1 then
return -1
endi
#numofvgroups
sql show t1.vgroups;
if $rows != 1 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
sql show t1.tables;
if $rows != 1 then
return -1
endi
sql alter topic t1 partitions 2
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 != 2 then
return -1
endi
#numofvgroups
sql show t1.vgroups;
if $rows != 2 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
sql show t1.tables;
if $rows != 2 then
return -1
endi
sql alter topic t1 partitions 3
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 != 3 then
return -1
endi
#numofvgroups
sql show t1.vgroups;
if $rows != 3 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
sql show t1.tables;
if $rows != 3 then
return -1
endi
sql alter topic t1 partitions 10
sql show topics;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
if $data00 != t1 then
return -1
endi
#tables
if $data02 != 10 then
return -1
endi
#numofvgroups
sql show t1.vgroups;
if $rows != 10 then
return -1
endi
sql show t1.stables;
if $rows != 1 then
return -1
endi
sql show t1.tables;
if $rows != 10 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ==== step1
sql create topic t1 partitions 2;
sql show t1.tables
if $rows != 2 then
return -1
endi
sql show t1.vgroups
if $rows != 2 then
return -1
endi
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p3 values(1, now, '1');
sql_error insert into t1.p3 values(1, now, '2');
sql_error insert into t1.p3 values(1, now, '3');
sql_error insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql select * from t1.p1 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p2 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
print ==== step2
sql alter topic t1 partitions 4;
sql show t1.tables
if $rows != 4 then
return -1
endi
sql show t1.vgroups
if $rows != 4 then
return -1
endi
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p3 values(1, now, '1');
sql insert into t1.p3 values(1, now, '2');
sql insert into t1.p3 values(1, now, '3');
sql insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p4 values(1, now, '1');
sql insert into t1.p4 values(1, now, '2');
sql insert into t1.p4 values(1, now, '3');
sql insert into t1.p4 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p4 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p4 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '2');
sql_error insert into t1.p5 values(1, now, '3');
sql_error insert into t1.p5 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p5 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p5 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql select * from t1.p1 order by off asc
if $rows != 66 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p2 order by off asc
if $rows != 66 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p3 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p4 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
print ==== step3
sql alter topic t1 partitions 1;
sql show t1.tables
if $rows != 1 then
return -1
endi
sql show t1.vgroups
if $rows != 1 then
return -1
endi
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p2 values(1, now, '1');
sql_error insert into t1.p2 values(1, now, '2');
sql_error insert into t1.p2 values(1, now, '3');
sql_error insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p3 values(1, now, '1');
sql_error insert into t1.p3 values(1, now, '2');
sql_error insert into t1.p3 values(1, now, '3');
sql_error insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p4 values(1, now, '1');
sql_error insert into t1.p4 values(1, now, '2');
sql_error insert into t1.p4 values(1, now, '3');
sql_error insert into t1.p4 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p4 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p4 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '2');
sql_error insert into t1.p5 values(1, now, '3');
sql_error insert into t1.p5 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql_error insert into t1.p5 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql_error insert into t1.p5 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql select * from t1.p1 order by off asc
if $rows != 99 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql_error select * from t1.p2 order by off asc
sql_error select * from t1.p3 order by off asc
sql_error select * from t1.p4 order by off asc
print ==== step4
sql alter topic t1 partitions 3;
sql show t1.tables
if $rows != 3 then
return -1
endi
sql show t1.vgroups
if $rows != 3 then
return -1
endi
sql insert into t1.p1 values(1, now, '1');
sql insert into t1.p1 values(1, now, '2');
sql insert into t1.p1 values(1, now, '3');
sql insert into t1.p1 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p1 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p1 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p2 values(1, now, '1');
sql insert into t1.p2 values(1, now, '2');
sql insert into t1.p2 values(1, now, '3');
sql insert into t1.p2 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p2 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p2 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql insert into t1.p3 values(1, now, '1');
sql insert into t1.p3 values(1, now, '2');
sql insert into t1.p3 values(1, now, '3');
sql insert into t1.p3 values(1, now, '4')(2, now, '5')(3, now, '6')(4, now, '7')(5, now, '8')(6, now, '9');
sql insert into t1.p3 values(1, now, '10')(2, now, '11')(3, now, '12')(4, now, '13')(5, now, '14')(6, now, '15');
sql insert into t1.p3 values(1, now, '16')(2, now,'17')(3, now,'18')(4, now,'19')(5, now,'20')(6, now,'21')(7, now,'22')(8, now,'23')(9, now,'24')(10, now,'25')(11, now,'26')(12, now,'27')(13, now,'28')(14, now,'29')(15, now,'30')(16, now,'31')(17, now,'32')(18, now,'33');
sql_error insert into t1.p4 values(1, now, '1');
sql_error insert into t1.p5 values(1, now, '1');
sql_error insert into t1.p6 values(1, now, '1');
sql_error select * from t1.p4 order by off asc
sql_error select * from t1.p5 order by off asc
sql_error select * from t1.p6 order by off asc
sql select * from t1.p1 order by off asc
if $rows != 132 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p2 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.p3 order by off asc
if $rows != 33 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data12 != 2 then
return -1
endi
if $data22 != 3 then
return -1
endi
sql select * from t1.ps order by off asc
if $rows != 198 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
print ======================== dnode1 start
$db = testdb
sql create database $db
sql use $db
sql create stable st2 (ts timestamp, f1 int, f2 float, f3 double, f4 bigint, f5 smallint, f6 tinyint, f7 bool, f8 binary(10), f9 nchar(10)) tags (id1 int, id2 float, id3 nchar(10), id4 double, id5 smallint, id6 bigint, id7 binary(10))
sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+200s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+300s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+400s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+500s,4,4.0,4.0,4,4,4,true,"4","4")
sql select f1,last(*) from st2 group by f1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data02 != 1 then
print $data02
return -1
endi
if $data03 != 1.00000 then
return -1
endi
if $data04 != 1.000000000 then
return -1
endi
if $data05 != 1 then
return -1
endi
if $data06 != 1 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != 1 then
return -1
endi
if $data09 != 1 then
return -1
endi
sql select f1,last(f1,st2.*) from st2 group by f1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1.00000 then
return -1
endi
if $data05 != 1.000000000 then
return -1
endi
if $data06 != 1 then
return -1
endi
if $data07 != 1 then
return -1
endi
if $data08 != 1 then
return -1
endi
if $data09 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...@@ -68,6 +68,8 @@ cd ../../../debug; make ...@@ -68,6 +68,8 @@ cd ../../../debug; make
./test.sh -f general/db/repeat.sim ./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim ./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim ./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/topic1.sim
./test.sh -f general/db/topic2.sim
./test.sh -f general/db/nosuchfile.sim ./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/field/2.sim ./test.sh -f general/field/2.sim
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
./test.sh -f general/db/repeat.sim ./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim ./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim ./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/topic1.sim
./test.sh -f general/db/topic2.sim
./test.sh -f general/table/autocreate.sim ./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim ./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim ./test.sh -f general/table/basic2.sim
......
...@@ -316,6 +316,7 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "unit" ] && [ "$1" == ...@@ -316,6 +316,7 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "unit" ] && [ "$1" ==
cd debug/ cd debug/
stopTaosd stopTaosd
rm -rf /var/lib/taos/*
nohup build/bin/taosd -c /etc/taos/ > /dev/null 2>&1 & nohup build/bin/taosd -c /etc/taos/ > /dev/null 2>&1 &
sleep 30 sleep 30
...@@ -358,6 +359,7 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$1" == ...@@ -358,6 +359,7 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$1" ==
pwd pwd
cd debug/build/bin cd debug/build/bin
rm -rf /var/lib/taos/*
nohup ./taosd -c /etc/taos/ > /dev/null 2>&1 & nohup ./taosd -c /etc/taos/ > /dev/null 2>&1 &
sleep 30 sleep 30
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册