提交 59a6e07b 编写于 作者: J jiajingbin

Merge branch 'develop' into test/td-6581-4

...@@ -18,6 +18,7 @@ ENDIF () ...@@ -18,6 +18,7 @@ ENDIF ()
SET(TD_ACCOUNT FALSE) SET(TD_ACCOUNT FALSE)
SET(TD_ADMIN FALSE) SET(TD_ADMIN FALSE)
SET(TD_GRANT FALSE) SET(TD_GRANT FALSE)
SET(TD_USB_DONGLE 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)
......
...@@ -13,6 +13,10 @@ IF (TD_GRANT) ...@@ -13,6 +13,10 @@ IF (TD_GRANT)
ADD_DEFINITIONS(-D_GRANT) ADD_DEFINITIONS(-D_GRANT)
ENDIF () ENDIF ()
IF (TD_USB_DONGLE)
ADD_DEFINITIONS(-D_USB_DONGLE)
ENDIF ()
IF (TD_MQTT) IF (TD_MQTT)
ADD_DEFINITIONS(-D_MQTT) ADD_DEFINITIONS(-D_MQTT)
ENDIF () ENDIF ()
......
IF (TD_LINUX) IF (TD_LINUX)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
ELSEIF (TD_WINDOWS) ELSEIF (TD_WINDOWS)
IF (TD_POWER) IF (TD_POWER)
SET(CMAKE_INSTALL_PREFIX C:/PowerDB) SET(CMAKE_INSTALL_PREFIX C:/PowerDB)
...@@ -41,6 +40,5 @@ ELSEIF (TD_WINDOWS) ...@@ -41,6 +40,5 @@ ELSEIF (TD_WINDOWS)
ELSEIF (TD_DARWIN) ELSEIF (TD_DARWIN)
SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Darwin ${TD_VER_NUMBER})")
ENDIF () ENDIF ()
...@@ -334,7 +334,6 @@ JDBC连接器可能报错的错误码包括3种:JDBC driver本身的报错( ...@@ -334,7 +334,6 @@ JDBC连接器可能报错的错误码包括3种:JDBC driver本身的报错(
从 2.1.2.0 版本开始,TDengine 的 **JDBC-JNI** 实现大幅改进了参数绑定方式对数据写入(INSERT)场景的支持。采用这种方式写入数据时,能避免 SQL 语法解析的资源消耗,从而在很多情况下显著提升写入性能。(注意:**JDBC-RESTful** 实现并不提供参数绑定这种使用方式。) 从 2.1.2.0 版本开始,TDengine 的 **JDBC-JNI** 实现大幅改进了参数绑定方式对数据写入(INSERT)场景的支持。采用这种方式写入数据时,能避免 SQL 语法解析的资源消耗,从而在很多情况下显著提升写入性能。(注意:**JDBC-RESTful** 实现并不提供参数绑定这种使用方式。)
```java ```java
Statement stmt = conn.createStatement();
Random r = new Random(); Random r = new Random();
// INSERT 语句中,VALUES 部分允许指定具体的数据列;如果采取自动建表,则 TAGS 部分需要设定全部 TAGS 列的参数值: // INSERT 语句中,VALUES 部分允许指定具体的数据列;如果采取自动建表,则 TAGS 部分需要设定全部 TAGS 列的参数值:
......
...@@ -280,9 +280,6 @@ function install_blm3_config() { ...@@ -280,9 +280,6 @@ function install_blm3_config() {
${csudo} chmod 644 ${cfg_install_dir}/blm.toml ${csudo} chmod 644 ${cfg_install_dir}/blm.toml
fi fi
# restore the backup standard input, and turn off 6
exec 0<&6 6<&-
[ -f ${cfg_dir}/blm.toml ] && [ -f ${cfg_dir}/blm.toml ] &&
${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.org ${csudo} mv ${cfg_dir}/blm.toml ${cfg_dir}/blm.toml.org
......
...@@ -6,35 +6,6 @@ ...@@ -6,35 +6,6 @@
#include "com_alibaba_datax_plugin_writer_JniConnection.h" #include "com_alibaba_datax_plugin_writer_JniConnection.h"
#include "jniCommon.h" #include "jniCommon.h"
jclass g_arrayListClass;
jmethodID g_arrayListConstructFp;
jmethodID g_arrayListAddFp;
jclass g_metadataClass;
jmethodID g_metadataConstructFp;
jfieldID g_metadataColtypeField;
jfieldID g_metadataColnameField;
jfieldID g_metadataColsizeField;
jfieldID g_metadataColindexField;
jclass g_rowdataClass;
jmethodID g_rowdataConstructor;
jmethodID g_rowdataClearFp;
jmethodID g_rowdataSetBooleanFp;
jmethodID g_rowdataSetByteFp;
jmethodID g_rowdataSetShortFp;
jmethodID g_rowdataSetIntFp;
jmethodID g_rowdataSetLongFp;
jmethodID g_rowdataSetFloatFp;
jmethodID g_rowdataSetDoubleFp;
jmethodID g_rowdataSetStringFp;
jmethodID g_rowdataSetTimestampFp;
jmethodID g_rowdataSetByteArrayFp;
jmethodID g_blockdataSetByteArrayFp;
jmethodID g_blockdataSetNumOfRowsFp;
jmethodID g_blockdataSetNumOfColsFp;
JNIEXPORT void JNICALL Java_com_alibaba_datax_plugin_writer_JniConnection_initImp(JNIEnv *env, jobject jobj, JNIEXPORT void JNICALL Java_com_alibaba_datax_plugin_writer_JniConnection_initImp(JNIEnv *env, jobject jobj,
jstring jconfigDir) { jstring jconfigDir) {
if (jconfigDir != NULL) { if (jconfigDir != NULL) {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "tscParseLine.h" #include "tscParseLine.h"
typedef struct { typedef struct {
char sTableName[TSDB_TABLE_NAME_LEN]; char sTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
SHashObj* tagHash; SHashObj* tagHash;
SHashObj* fieldHash; SHashObj* fieldHash;
SArray* tags; //SArray<SSchema> SArray* tags; //SArray<SSchema>
...@@ -64,13 +64,13 @@ typedef enum { ...@@ -64,13 +64,13 @@ typedef enum {
} ESchemaAction; } ESchemaAction;
typedef struct { typedef struct {
char sTableName[TSDB_TABLE_NAME_LEN]; char sTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
SArray* tags; //SArray<SSchema> SArray* tags; //SArray<SSchema>
SArray* fields; //SArray<SSchema> SArray* fields; //SArray<SSchema>
} SCreateSTableActionInfo; } SCreateSTableActionInfo;
typedef struct { typedef struct {
char sTableName[TSDB_TABLE_NAME_LEN]; char sTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
SSchema* field; SSchema* field;
} SAlterSTableActionInfo; } SAlterSTableActionInfo;
...@@ -155,13 +155,13 @@ static int32_t getSmlMd5ChildTableName(TAOS_SML_DATA_POINT* point, char* tableNa ...@@ -155,13 +155,13 @@ static int32_t getSmlMd5ChildTableName(TAOS_SML_DATA_POINT* point, char* tableNa
qsort(point->tags, point->tagNum, sizeof(TAOS_SML_KV), compareSmlColKv); qsort(point->tags, point->tagNum, sizeof(TAOS_SML_KV), compareSmlColKv);
SStringBuilder sb; memset(&sb, 0, sizeof(sb)); SStringBuilder sb; memset(&sb, 0, sizeof(sb));
char sTableName[TSDB_TABLE_NAME_LEN] = {0}; char sTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(sTableName, point->stableName); strtolower(sTableName, point->stableName);
taosStringBuilderAppendString(&sb, sTableName); taosStringBuilderAppendString(&sb, sTableName);
for (int j = 0; j < point->tagNum; ++j) { for (int j = 0; j < point->tagNum; ++j) {
taosStringBuilderAppendChar(&sb, ','); taosStringBuilderAppendChar(&sb, ',');
TAOS_SML_KV* tagKv = point->tags + j; TAOS_SML_KV* tagKv = point->tags + j;
char tagName[TSDB_COL_NAME_LEN] = {0}; char tagName[TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(tagName, tagKv->key); strtolower(tagName, tagKv->key);
taosStringBuilderAppendString(&sb, tagName); taosStringBuilderAppendString(&sb, tagName);
taosStringBuilderAppendChar(&sb, '='); taosStringBuilderAppendChar(&sb, '=');
...@@ -214,8 +214,8 @@ static int32_t buildDataPointSchemas(TAOS_SML_DATA_POINT* points, int numPoint, ...@@ -214,8 +214,8 @@ static int32_t buildDataPointSchemas(TAOS_SML_DATA_POINT* points, int numPoint,
for (int j = 0; j < point->tagNum; ++j) { for (int j = 0; j < point->tagNum; ++j) {
TAOS_SML_KV* tagKv = point->tags + j; TAOS_SML_KV* tagKv = point->tags + j;
if (!point->childTableName) { if (!point->childTableName) {
char childTableName[TSDB_TABLE_NAME_LEN]; char childTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
int32_t tableNameLen = TSDB_TABLE_NAME_LEN; int32_t tableNameLen = TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE;
getSmlMd5ChildTableName(point, childTableName, &tableNameLen, info); getSmlMd5ChildTableName(point, childTableName, &tableNameLen, info);
point->childTableName = calloc(1, tableNameLen+1); point->childTableName = calloc(1, tableNameLen+1);
strncpy(point->childTableName, childTableName, tableNameLen); strncpy(point->childTableName, childTableName, tableNameLen);
...@@ -261,7 +261,7 @@ static int32_t buildDataPointSchemas(TAOS_SML_DATA_POINT* points, int numPoint, ...@@ -261,7 +261,7 @@ static int32_t buildDataPointSchemas(TAOS_SML_DATA_POINT* points, int numPoint,
static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash, SArray* dbAttrArray, bool isTag, char sTableName[], static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash, SArray* dbAttrArray, bool isTag, char sTableName[],
SSchemaAction* action, bool* actionNeeded, SSmlLinesInfo* info) { SSchemaAction* action, bool* actionNeeded, SSmlLinesInfo* info) {
char fieldNameLowerCase[TSDB_COL_NAME_LEN] = {0}; char fieldNameLowerCase[TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(fieldNameLowerCase, pointColField->name); strtolower(fieldNameLowerCase, pointColField->name);
size_t* pDbIndex = taosHashGet(dbAttrHash, fieldNameLowerCase, strlen(fieldNameLowerCase)); size_t* pDbIndex = taosHashGet(dbAttrHash, fieldNameLowerCase, strlen(fieldNameLowerCase));
...@@ -281,7 +281,7 @@ static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash ...@@ -281,7 +281,7 @@ static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash
action->action = SCHEMA_ACTION_CHANGE_COLUMN_SIZE; action->action = SCHEMA_ACTION_CHANGE_COLUMN_SIZE;
} }
memset(&action->alterSTable, 0, sizeof(SAlterSTableActionInfo)); memset(&action->alterSTable, 0, sizeof(SAlterSTableActionInfo));
memcpy(action->alterSTable.sTableName, sTableName, TSDB_TABLE_NAME_LEN); memcpy(action->alterSTable.sTableName, sTableName, TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE);
action->alterSTable.field = pointColField; action->alterSTable.field = pointColField;
*actionNeeded = true; *actionNeeded = true;
} }
...@@ -292,7 +292,7 @@ static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash ...@@ -292,7 +292,7 @@ static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash
action->action = SCHEMA_ACTION_ADD_COLUMN; action->action = SCHEMA_ACTION_ADD_COLUMN;
} }
memset(&action->alterSTable, 0, sizeof(SAlterSTableActionInfo)); memset(&action->alterSTable, 0, sizeof(SAlterSTableActionInfo));
memcpy(action->alterSTable.sTableName, sTableName, TSDB_TABLE_NAME_LEN); memcpy(action->alterSTable.sTableName, sTableName, TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE);
action->alterSTable.field = pointColField; action->alterSTable.field = pointColField;
*actionNeeded = true; *actionNeeded = true;
} }
...@@ -536,7 +536,7 @@ static int32_t retrieveTableMeta(TAOS* taos, char* tableName, STableMeta** pTabl ...@@ -536,7 +536,7 @@ static int32_t retrieveTableMeta(TAOS* taos, char* tableName, STableMeta** pTabl
tscDebug("SML:0x%" PRIx64 " retrieve table meta. super table name: %s", info->id, tableName); tscDebug("SML:0x%" PRIx64 " retrieve table meta. super table name: %s", info->id, tableName);
char tableNameLowerCase[TSDB_TABLE_NAME_LEN]; char tableNameLowerCase[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
strtolower(tableNameLowerCase, tableName); strtolower(tableNameLowerCase, tableName);
char sql[256]; char sql[256];
...@@ -623,7 +623,7 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas, SSmlLinesInfo* ...@@ -623,7 +623,7 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas, SSmlLinesInfo*
SSchemaAction schemaAction = {0}; SSchemaAction schemaAction = {0};
schemaAction.action = SCHEMA_ACTION_CREATE_STABLE; schemaAction.action = SCHEMA_ACTION_CREATE_STABLE;
memset(&schemaAction.createSTable, 0, sizeof(SCreateSTableActionInfo)); memset(&schemaAction.createSTable, 0, sizeof(SCreateSTableActionInfo));
memcpy(schemaAction.createSTable.sTableName, pointSchema->sTableName, TSDB_TABLE_NAME_LEN); memcpy(schemaAction.createSTable.sTableName, pointSchema->sTableName, TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE);
schemaAction.createSTable.tags = pointSchema->tags; schemaAction.createSTable.tags = pointSchema->tags;
schemaAction.createSTable.fields = pointSchema->fields; schemaAction.createSTable.fields = pointSchema->fields;
applySchemaAction(taos, &schemaAction, info); applySchemaAction(taos, &schemaAction, info);
...@@ -659,7 +659,7 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas, SSmlLinesInfo* ...@@ -659,7 +659,7 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas, SSmlLinesInfo*
SSchema* pointColTs = taosArrayGet(pointSchema->fields, 0); SSchema* pointColTs = taosArrayGet(pointSchema->fields, 0);
SSchema* dbColTs = taosArrayGet(dbSchema.fields, 0); SSchema* dbColTs = taosArrayGet(dbSchema.fields, 0);
memcpy(pointColTs->name, dbColTs->name, TSDB_COL_NAME_LEN); memcpy(pointColTs->name, dbColTs->name, TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE);
for (int j = 1; j < pointFieldSize; ++j) { for (int j = 1; j < pointFieldSize; ++j) {
SSchema* pointCol = taosArrayGet(pointSchema->fields, j); SSchema* pointCol = taosArrayGet(pointSchema->fields, j);
......
...@@ -4523,10 +4523,8 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t ...@@ -4523,10 +4523,8 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t
// check for match expression // check for match expression
static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) { static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) {
const char* msg1 = "regular expression string should be less than %d characters"; const char* msg1 = "regular expression string should be less than %d characters";
const char* msg2 = "illegal column type for match/nmatch";
const char* msg3 = "invalid regular expression"; const char* msg3 = "invalid regular expression";
tSqlExpr* pLeft = pExpr->pLeft;
tSqlExpr* pRight = pExpr->pRight; tSqlExpr* pRight = pExpr->pRight;
if (pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH) { if (pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH) {
...@@ -4536,11 +4534,6 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_ ...@@ -4536,11 +4534,6 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_
return invalidOperationMsg(msgBuf, tmp); return invalidOperationMsg(msgBuf, tmp);
} }
SSchema* pSchema = tscGetTableSchema(pTableMeta);
if ((!isTablenameToken(&pLeft->columnName)) &&(pSchema[index].type != TSDB_DATA_TYPE_BINARY)) {
return invalidOperationMsg(msgBuf, msg2);
}
if (!(pRight->type == SQL_NODE_VALUE && pRight->value.nType == TSDB_DATA_TYPE_BINARY)) { if (!(pRight->type == SQL_NODE_VALUE && pRight->value.nType == TSDB_DATA_TYPE_BINARY)) {
return invalidOperationMsg(msgBuf, msg3); return invalidOperationMsg(msgBuf, msg3);
} }
...@@ -6375,6 +6368,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6375,6 +6368,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)}; SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)};
//handle Escape character backstick
if (name.z[0] == TS_ESCAPE_CHAR && name.z[name.n - 1] == TS_ESCAPE_CHAR) {
memmove(name.z, name.z + 1, name.n);
name.z[name.n - TS_ESCAPE_CHAR_SIZE] = '\0';
name.n -= TS_ESCAPE_CHAR_SIZE;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17); return invalidOperationMsg(pMsg, msg17);
} }
...@@ -6799,16 +6798,21 @@ static int32_t setKeepOption(SSqlCmd* pCmd, SCreateDbMsg* pMsg, SCreateDbInfo* p ...@@ -6799,16 +6798,21 @@ static int32_t setKeepOption(SSqlCmd* pCmd, SCreateDbMsg* pMsg, SCreateDbInfo* p
tVariantListItem* p1 = (s > 1) ? taosArrayGet(pKeep, 1) : p0; tVariantListItem* p1 = (s > 1) ? taosArrayGet(pKeep, 1) : p0;
tVariantListItem* p2 = (s > 2) ? taosArrayGet(pKeep, 2) : p1; tVariantListItem* p2 = (s > 2) ? taosArrayGet(pKeep, 2) : p1;
if ((int32_t)p0->pVar.i64 <= 0 || (int32_t)p1->pVar.i64 <= 0 || (int32_t)p2->pVar.i64 <= 0) { int32_t daysToKeep0 = (int32_t)p0->pVar.i64;
int32_t daysToKeep1 = (int32_t)(int32_t)p1->pVar.i64;
int32_t daysToKeep2 = (int32_t)p2->pVar.i64;
if (daysToKeep0 <= 0 || daysToKeep1 <= 0 || daysToKeep2 <= 0 ||
daysToKeep0 > TSDB_MAX_KEEP || daysToKeep1 > TSDB_MAX_KEEP || daysToKeep2 > TSDB_MAX_KEEP) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2);
} }
if (!(((int32_t)p0->pVar.i64 <= (int32_t)p1->pVar.i64) && ((int32_t)p1->pVar.i64 <= (int32_t)p2->pVar.i64))) {
if (!((daysToKeep0 <= daysToKeep1) && (daysToKeep1 <= daysToKeep2))) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3);
} }
pMsg->daysToKeep0 = htonl((int32_t)p0->pVar.i64); pMsg->daysToKeep0 = htonl(daysToKeep0);
pMsg->daysToKeep1 = htonl((int32_t)p1->pVar.i64); pMsg->daysToKeep1 = htonl(daysToKeep1);
pMsg->daysToKeep2 = htonl((int32_t)p2->pVar.i64); pMsg->daysToKeep2 = htonl(daysToKeep2);
} }
......
...@@ -139,7 +139,7 @@ typedef uint64_t TKEY; ...@@ -139,7 +139,7 @@ typedef uint64_t TKEY;
#define tdGetTKEY(key) (((TKEY)ABS(key)) | (TKEY_NEGATIVE_FLAG & (TKEY)(key))) #define tdGetTKEY(key) (((TKEY)ABS(key)) | (TKEY_NEGATIVE_FLAG & (TKEY)(key)))
#define tdGetKey(tkey) (((TSKEY)((tkey)&TKEY_VALUE_FILTER)) * (TKEY_IS_NEGATIVE(tkey) ? -1 : 1)) #define tdGetKey(tkey) (((TSKEY)((tkey)&TKEY_VALUE_FILTER)) * (TKEY_IS_NEGATIVE(tkey) ? -1 : 1))
#define MIN_TS_KEY ((TSKEY)0x8000000000000001) #define MIN_TS_KEY ((TSKEY)0xc000000000000001)
#define MAX_TS_KEY ((TSKEY)0x3fffffffffffffff) #define MAX_TS_KEY ((TSKEY)0x3fffffffffffffff)
#define TD_TO_TKEY(key) tdGetTKEY(((key) < MIN_TS_KEY) ? MIN_TS_KEY : (((key) > MAX_TS_KEY) ? MAX_TS_KEY : key)) #define TD_TO_TKEY(key) tdGetTKEY(((key) < MIN_TS_KEY) ? MIN_TS_KEY : (((key) > MAX_TS_KEY) ? MAX_TS_KEY : key))
......
Subproject commit edad746514b2a53a8cf6061c93b98b52a5388692 Subproject commit 9ae793ad2d567eb11d10627b65698f612542e988
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
<include>**/*Test.java</include> <include>**/*Test.java</include>
</includes> </includes>
<excludes> <excludes>
<exclude>**/HttpClientPoolUtilTest.java</exclude>
<exclude>**/AppMemoryLeakTest.java</exclude> <exclude>**/AppMemoryLeakTest.java</exclude>
<exclude>**/JDBCTypeAndTypeCompareTest.java</exclude> <exclude>**/JDBCTypeAndTypeCompareTest.java</exclude>
<exclude>**/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java</exclude> <exclude>**/ConnectMultiTaosdByRestfulWithDifferentTokenTest.java</exclude>
......
...@@ -32,6 +32,7 @@ public class TSDBErrorNumbers { ...@@ -32,6 +32,7 @@ public class TSDBErrorNumbers {
public static final int ERROR_USER_IS_REQUIRED = 0x2319; // user is required public static final int ERROR_USER_IS_REQUIRED = 0x2319; // user is required
public static final int ERROR_PASSWORD_IS_REQUIRED = 0x231a; // password is required public static final int ERROR_PASSWORD_IS_REQUIRED = 0x231a; // password is required
public static final int ERROR_INVALID_JSON_FORMAT = 0x231b; public static final int ERROR_INVALID_JSON_FORMAT = 0x231b;
public static final int ERROR_HTTP_ENTITY_IS_NULL = 0x231c; //http entity is null
public static final int ERROR_UNKNOWN = 0x2350; //unknown error public static final int ERROR_UNKNOWN = 0x2350; //unknown error
...@@ -74,6 +75,7 @@ public class TSDBErrorNumbers { ...@@ -74,6 +75,7 @@ public class TSDBErrorNumbers {
errorNumbers.add(ERROR_USER_IS_REQUIRED); errorNumbers.add(ERROR_USER_IS_REQUIRED);
errorNumbers.add(ERROR_PASSWORD_IS_REQUIRED); errorNumbers.add(ERROR_PASSWORD_IS_REQUIRED);
errorNumbers.add(ERROR_INVALID_JSON_FORMAT); errorNumbers.add(ERROR_INVALID_JSON_FORMAT);
errorNumbers.add(ERROR_HTTP_ENTITY_IS_NULL);
errorNumbers.add(ERROR_RESTFul_Client_Protocol_Exception); errorNumbers.add(ERROR_RESTFul_Client_Protocol_Exception);
......
...@@ -19,6 +19,7 @@ import com.google.common.primitives.Longs; ...@@ -19,6 +19,7 @@ import com.google.common.primitives.Longs;
import com.google.common.primitives.Shorts; import com.google.common.primitives.Shorts;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.sql.*; import java.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
...@@ -256,7 +257,11 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -256,7 +257,11 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
public byte[] getBytes(int columnIndex) throws SQLException { public byte[] getBytes(int columnIndex) throws SQLException {
checkAvailability(columnIndex, this.columnMetaDataList.size()); checkAvailability(columnIndex, this.columnMetaDataList.size());
if (this.getBatchFetch())
return this.blockData.getString(columnIndex).getBytes();
Object value = this.rowData.getObject(columnIndex); Object value = this.rowData.getObject(columnIndex);
this.lastWasNull = value == null;
if (value == null) if (value == null)
return null; return null;
...@@ -331,8 +336,10 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -331,8 +336,10 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
return new BigDecimal(this.blockData.getLong(columnIndex - 1)); return new BigDecimal(this.blockData.getLong(columnIndex - 1));
this.lastWasNull = this.rowData.wasNull(columnIndex); this.lastWasNull = this.rowData.wasNull(columnIndex);
BigDecimal res = null; if (lastWasNull)
if (!lastWasNull) { return null;
BigDecimal res;
int nativeType = this.columnMetaDataList.get(columnIndex - 1).getColType(); int nativeType = this.columnMetaDataList.get(columnIndex - 1).getColType();
switch (nativeType) { switch (nativeType) {
case TSDBConstants.TSDB_DATA_TYPE_TINYINT: case TSDBConstants.TSDB_DATA_TYPE_TINYINT:
...@@ -350,7 +357,6 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -350,7 +357,6 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
default: default:
res = new BigDecimal(this.rowData.getObject(columnIndex).toString()); res = new BigDecimal(this.rowData.getObject(columnIndex).toString());
} }
}
return res; return res;
} }
...@@ -465,12 +471,6 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet { ...@@ -465,12 +471,6 @@ public class TSDBResultSet extends AbstractResultSet implements ResultSet {
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
return isClosed; return isClosed;
// if (isClosed)
// return true;
// if (jniConnector != null) {
// isClosed = jniConnector.isResultsetClosed();
// }
// return isClosed;
} }
public String getNString(int columnIndex) throws SQLException { public String getNString(int columnIndex) throws SQLException {
......
...@@ -84,8 +84,7 @@ public class TSDBStatement extends AbstractStatement { ...@@ -84,8 +84,7 @@ public class TSDBStatement extends AbstractStatement {
long pSql = this.connection.getConnector().executeQuery(sql); long pSql = this.connection.getConnector().executeQuery(sql);
// if pSql is create/insert/update/delete/alter SQL // if pSql is create/insert/update/delete/alter SQL
if (this.connection.getConnector().isUpdateQuery(pSql)) { if (this.connection.getConnector().isUpdateQuery(pSql)) {
int rows = this.connection.getConnector().getAffectedRows(pSql); this.affectedRows = this.connection.getConnector().getAffectedRows(pSql);
this.affectedRows = rows == 0 ? -1 : this.connection.getConnector().getAffectedRows(pSql);
this.connection.getConnector().freeResultSet(pSql); this.connection.getConnector().freeResultSet(pSql);
return false; return false;
} }
......
...@@ -255,11 +255,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -255,11 +255,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return null; return null;
}
wasNull = false;
if (value instanceof byte[]) if (value instanceof byte[])
return new String((byte[]) value); return new String((byte[]) value);
return value.toString(); return value.toString();
...@@ -270,11 +268,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -270,11 +268,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return false; return false;
}
wasNull = false;
if (value instanceof Boolean) if (value instanceof Boolean)
return (boolean) value; return (boolean) value;
return Boolean.parseBoolean(value.toString()); return Boolean.parseBoolean(value.toString());
...@@ -285,11 +281,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -285,11 +281,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return 0; return 0;
}
wasNull = false;
long valueAsLong = Long.parseLong(value.toString()); long valueAsLong = Long.parseLong(value.toString());
if (valueAsLong == Byte.MIN_VALUE) if (valueAsLong == Byte.MIN_VALUE)
return 0; return 0;
...@@ -309,11 +303,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -309,11 +303,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return 0; return 0;
}
wasNull = false;
long valueAsLong = Long.parseLong(value.toString()); long valueAsLong = Long.parseLong(value.toString());
if (valueAsLong == Short.MIN_VALUE) if (valueAsLong == Short.MIN_VALUE)
return 0; return 0;
...@@ -327,11 +319,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -327,11 +319,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return 0; return 0;
}
wasNull = false;
long valueAsLong = Long.parseLong(value.toString()); long valueAsLong = Long.parseLong(value.toString());
if (valueAsLong == Integer.MIN_VALUE) if (valueAsLong == Integer.MIN_VALUE)
return 0; return 0;
...@@ -345,15 +335,11 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -345,15 +335,11 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return 0; return 0;
} if (value instanceof Timestamp)
wasNull = false;
if (value instanceof Timestamp) {
return ((Timestamp) value).getTime(); return ((Timestamp) value).getTime();
}
long valueAsLong = 0; long valueAsLong = 0;
try { try {
valueAsLong = Long.parseLong(value.toString()); valueAsLong = Long.parseLong(value.toString());
...@@ -370,11 +356,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -370,11 +356,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
if (value == null) { wasNull = value == null;
wasNull = true; if (value == null)
return 0; return 0;
}
wasNull = false;
if (value instanceof Float) if (value instanceof Float)
return (float) value; return (float) value;
if (value instanceof Double) if (value instanceof Double)
...@@ -387,11 +371,10 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -387,11 +371,10 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) { if (value == null) {
wasNull = true;
return 0; return 0;
} }
wasNull = false;
if (value instanceof Double || value instanceof Float) if (value instanceof Double || value instanceof Float)
return (double) value; return (double) value;
return Double.parseDouble(value.toString()); return Double.parseDouble(value.toString());
...@@ -402,6 +385,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -402,6 +385,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) if (value == null)
return null; return null;
if (value instanceof byte[]) if (value instanceof byte[])
...@@ -428,6 +412,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -428,6 +412,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) if (value == null)
return null; return null;
if (value instanceof Timestamp) if (value instanceof Timestamp)
...@@ -440,6 +425,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -440,6 +425,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) if (value == null)
return null; return null;
if (value instanceof Timestamp) if (value instanceof Timestamp)
...@@ -457,6 +443,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -457,6 +443,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) if (value == null)
return null; return null;
if (value instanceof Timestamp) if (value instanceof Timestamp)
...@@ -473,6 +460,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -473,6 +460,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
ret = Utils.parseTimestamp(value.toString()); ret = Utils.parseTimestamp(value.toString());
} catch (Exception e) { } catch (Exception e) {
ret = null; ret = null;
wasNull = true;
} }
return ret; return ret;
} }
...@@ -488,7 +476,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -488,7 +476,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
public Object getObject(int columnIndex) throws SQLException { public Object getObject(int columnIndex) throws SQLException {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
return resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
return value;
} }
@Override @Override
...@@ -507,9 +497,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -507,9 +497,9 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
checkAvailability(columnIndex, resultSet.get(pos).size()); checkAvailability(columnIndex, resultSet.get(pos).size());
Object value = resultSet.get(pos).get(columnIndex - 1); Object value = resultSet.get(pos).get(columnIndex - 1);
wasNull = value == null;
if (value == null) if (value == null)
return null; return null;
if (value instanceof Long || value instanceof Integer || value instanceof Short || value instanceof Byte) if (value instanceof Long || value instanceof Integer || value instanceof Short || value instanceof Byte)
return new BigDecimal(Long.parseLong(value.toString())); return new BigDecimal(Long.parseLong(value.toString()));
if (value instanceof Double || value instanceof Float) if (value instanceof Double || value instanceof Float)
......
...@@ -140,8 +140,7 @@ public class RestfulStatement extends AbstractStatement { ...@@ -140,8 +140,7 @@ public class RestfulStatement extends AbstractStatement {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
JSONArray data = jsonObject.getJSONArray("data"); JSONArray data = jsonObject.getJSONArray("data");
if (data != null) { if (data != null) {
int rows = data.getJSONArray(0).getInteger(0); return data.getJSONArray(0).getInteger(0);
return rows == 0 ? -1 : data.getJSONArray(0).getInteger(0);
} }
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
} }
......
...@@ -5,6 +5,7 @@ import com.taosdata.jdbc.TSDBErrorNumbers; ...@@ -5,6 +5,7 @@ import com.taosdata.jdbc.TSDBErrorNumbers;
import org.apache.http.HeaderElement; import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator; import org.apache.http.HeaderElementIterator;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpRequestRetryHandler; import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.config.RequestConfig; import org.apache.http.client.config.RequestConfig;
...@@ -30,12 +31,12 @@ import java.sql.SQLException; ...@@ -30,12 +31,12 @@ import java.sql.SQLException;
public class HttpClientPoolUtil { public class HttpClientPoolUtil {
private static final String DEFAULT_CONTENT_TYPE = "application/json"; private static final String DEFAULT_CONTENT_TYPE = "application/json";
private static final int DEFAULT_MAX_TOTAL = 200;
private static final int DEFAULT_MAX_PER_ROUTE = 20;
private static final int DEFAULT_TIME_OUT = 15000;
private static final int DEFAULT_HTTP_KEEP_TIME = 15000;
private static final int DEFAULT_MAX_RETRY_COUNT = 5; private static final int DEFAULT_MAX_RETRY_COUNT = 5;
private static final int DEFAULT_MAX_TOTAL = 50;
private static final int DEFAULT_MAX_PER_ROUTE = 5;
private static final int DEFAULT_HTTP_KEEP_TIME = -1;
private static final ConnectionKeepAliveStrategy DEFAULT_KEEP_ALIVE_STRATEGY = (response, context) -> { private static final ConnectionKeepAliveStrategy DEFAULT_KEEP_ALIVE_STRATEGY = (response, context) -> {
HeaderElementIterator it = new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE)); HeaderElementIterator it = new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE));
while (it.hasNext()) { while (it.hasNext()) {
...@@ -52,29 +53,19 @@ public class HttpClientPoolUtil { ...@@ -52,29 +53,19 @@ public class HttpClientPoolUtil {
return DEFAULT_HTTP_KEEP_TIME * 1000; return DEFAULT_HTTP_KEEP_TIME * 1000;
}; };
private static final HttpRequestRetryHandler retryHandler = (exception, executionCount, httpContext) -> {
if (executionCount >= DEFAULT_MAX_RETRY_COUNT)
// do not retry if over max retry count
return false;
if (exception instanceof InterruptedIOException)
// timeout
return false;
if (exception instanceof UnknownHostException)
// unknown host
return false;
if (exception instanceof SSLException)
// SSL handshake exception
return false;
return true;
};
private static CloseableHttpClient httpClient; private static CloseableHttpClient httpClient;
static { static {
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
connectionManager.setMaxTotal(DEFAULT_MAX_TOTAL); connectionManager.setMaxTotal(DEFAULT_MAX_TOTAL);
connectionManager.setDefaultMaxPerRoute(DEFAULT_MAX_PER_ROUTE); connectionManager.setDefaultMaxPerRoute(DEFAULT_MAX_PER_ROUTE);
httpClient = HttpClients.custom().setKeepAliveStrategy(DEFAULT_KEEP_ALIVE_STRATEGY).setConnectionManager(connectionManager).setRetryHandler(retryHandler).build();
httpClient = HttpClients.custom()
.setKeepAliveStrategy(DEFAULT_KEEP_ALIVE_STRATEGY)
.setConnectionManager(connectionManager)
.setRetryHandler((exception, executionCount, httpContext) -> executionCount < DEFAULT_MAX_RETRY_COUNT)
.build();
} }
/*** execute GET request ***/ /*** execute GET request ***/
...@@ -118,9 +109,10 @@ public class HttpClientPoolUtil { ...@@ -118,9 +109,10 @@ public class HttpClientPoolUtil {
HttpContext context = HttpClientContext.create(); HttpContext context = HttpClientContext.create();
CloseableHttpResponse httpResponse = httpClient.execute(method, context); CloseableHttpResponse httpResponse = httpClient.execute(method, context);
httpEntity = httpResponse.getEntity(); httpEntity = httpResponse.getEntity();
if (httpEntity != null) { if (httpEntity == null) {
responseBody = EntityUtils.toString(httpEntity, StandardCharsets.UTF_8); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_HTTP_ENTITY_IS_NULL, "httpEntity is null, sql: " + data);
} }
responseBody = EntityUtils.toString(httpEntity, StandardCharsets.UTF_8);
} catch (ClientProtocolException e) { } catch (ClientProtocolException e) {
e.printStackTrace(); e.printStackTrace();
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESTFul_Client_Protocol_Exception, e.getMessage()); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESTFul_Client_Protocol_Exception, e.getMessage());
...@@ -139,9 +131,6 @@ public class HttpClientPoolUtil { ...@@ -139,9 +131,6 @@ public class HttpClientPoolUtil {
private static HttpRequestBase getRequest(String uri, String methodName) { private static HttpRequestBase getRequest(String uri, String methodName) {
HttpRequestBase method; HttpRequestBase method;
RequestConfig requestConfig = RequestConfig.custom() RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(DEFAULT_TIME_OUT * 1000)
.setConnectTimeout(DEFAULT_TIME_OUT * 1000)
.setConnectionRequestTimeout(DEFAULT_TIME_OUT * 1000)
.setExpectContinueEnabled(false) .setExpectContinueEnabled(false)
.build(); .build();
if (HttpPut.METHOD_NAME.equalsIgnoreCase(methodName)) { if (HttpPut.METHOD_NAME.equalsIgnoreCase(methodName)) {
......
...@@ -660,7 +660,6 @@ public class RestfulResultSetTest { ...@@ -660,7 +660,6 @@ public class RestfulResultSetTest {
@BeforeClass @BeforeClass
public static void beforeClass() { public static void beforeClass() {
try { try {
Class.forName("com.taosdata.jdbc.rs.RestfulDriver");
conn = DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/restful_test?user=root&password=taosdata"); conn = DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/restful_test?user=root&password=taosdata");
stmt = conn.createStatement(); stmt = conn.createStatement();
stmt.execute("create database if not exists restful_test"); stmt.execute("create database if not exists restful_test");
...@@ -670,7 +669,7 @@ public class RestfulResultSetTest { ...@@ -670,7 +669,7 @@ public class RestfulResultSetTest {
stmt.execute("insert into restful_test.weather values('2021-01-01 00:00:00.000', 1, 100, 3.1415, 3.1415926, 'abc', 10, 10, true, '涛思数据')"); stmt.execute("insert into restful_test.weather values('2021-01-01 00:00:00.000', 1, 100, 3.1415, 3.1415926, 'abc', 10, 10, true, '涛思数据')");
rs = stmt.executeQuery("select * from restful_test.weather"); rs = stmt.executeQuery("select * from restful_test.weather");
rs.next(); rs.next();
} catch (ClassNotFoundException | SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
package com.taosdata.jdbc.rs;
import org.junit.*;
import java.sql.*;
public class WasNullTest {
// private static final String host = "127.0.0.1";
private static final String host = "master";
private Connection conn;
@Test
public void testGetTimestamp() {
try (Statement stmt = conn.createStatement()) {
stmt.execute("drop table if exists weather");
stmt.execute("create table if not exists weather(f1 timestamp, f2 timestamp, f3 int)");
stmt.execute("insert into restful_test.weather values('2021-01-01 00:00:00.000', NULL, 100)");
ResultSet rs = stmt.executeQuery("select * from restful_test.weather");
ResultSetMetaData meta = rs.getMetaData();
while (rs.next()) {
for (int i = 1; i <= meta.getColumnCount(); i++) {
if (i == 2) {
Object value = rs.getTimestamp(i);
boolean wasNull = rs.wasNull();
Assert.assertNull(value);
Assert.assertTrue(wasNull);
} else {
Object value = rs.getObject(i);
boolean wasNull = rs.wasNull();
Assert.assertNotNull(value);
Assert.assertFalse(wasNull);
}
}
}
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test
public void testGetObject() {
try (Statement stmt = conn.createStatement()) {
stmt.execute("drop table if exists weather");
stmt.execute("create table if not exists weather(f1 timestamp, f2 int, f3 bigint, f4 float, f5 double, f6 binary(64), f7 smallint, f8 tinyint, f9 bool, f10 nchar(64))");
stmt.execute("insert into restful_test.weather values('2021-01-01 00:00:00.000', 1, 100, 3.1415, 3.1415926, NULL, 10, 10, true, '涛思数据')");
ResultSet rs = stmt.executeQuery("select * from restful_test.weather");
ResultSetMetaData meta = rs.getMetaData();
while (rs.next()) {
for (int i = 1; i <= meta.getColumnCount(); i++) {
Object value = rs.getObject(i);
boolean wasNull = rs.wasNull();
if (i == 6) {
Assert.assertNull(value);
Assert.assertTrue(wasNull);
} else {
Assert.assertNotNull(value);
Assert.assertFalse(wasNull);
}
}
}
} catch (SQLException e) {
e.printStackTrace();
}
}
@Before
public void before() {
try {
conn = DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/restful_test?user=root&password=taosdata");
Statement stmt = conn.createStatement();
stmt.execute("drop database if exists restful_test");
stmt.execute("create database if not exists restful_test");
} catch (SQLException e) {
e.printStackTrace();
}
}
@After
public void after() {
try {
Statement statement = conn.createStatement();
statement.execute("drop database if exists restful_test");
if (conn != null)
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
package com.taosdata.jdbc.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.taosdata.jdbc.TSDBDriver;
import com.taosdata.jdbc.TSDBError;
import org.junit.Test;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class HttpClientPoolUtilTest {
String user = "root";
String password = "taosdata";
String host = "127.0.0.1";
String dbname = "log";
@Test
public void test() {
// given
List<Thread> threads = IntStream.range(0, 4000).mapToObj(i -> new Thread(() -> {
useDB();
// try {
// TimeUnit.SECONDS.sleep(10);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
})).collect(Collectors.toList());
threads.forEach(Thread::start);
for (Thread thread : threads) {
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
private void useDB() {
try {
user = URLEncoder.encode(user, StandardCharsets.UTF_8.displayName());
password = URLEncoder.encode(password, StandardCharsets.UTF_8.displayName());
String loginUrl = "http://" + host + ":" + 6041 + "/rest/login/" + user + "/" + password + "";
String result = HttpClientPoolUtil.execute(loginUrl);
JSONObject jsonResult = JSON.parseObject(result);
String status = jsonResult.getString("status");
String token = jsonResult.getString("desc");
if (!status.equals("succ")) {
throw new SQLException(jsonResult.getString("desc"));
}
String url = "http://" + host + ":6041/rest/sql";
String sql = "use " + dbname;
result = HttpClientPoolUtil.execute(url, sql, token);
JSONObject resultJson = JSON.parseObject(result);
if (resultJson.getString("status").equals("error")) {
throw TSDBError.createSQLException(resultJson.getInteger("code"), resultJson.getString("desc"));
}
} catch (UnsupportedEncodingException | SQLException e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
...@@ -39,6 +39,10 @@ IF (TD_GRANT) ...@@ -39,6 +39,10 @@ IF (TD_GRANT)
TARGET_LINK_LIBRARIES(taosd grant) TARGET_LINK_LIBRARIES(taosd grant)
ENDIF () ENDIF ()
IF (TD_USB_DONGLE)
TARGET_LINK_LIBRARIES(taosd usb_dongle)
ENDIF ()
IF (TD_MQTT) IF (TD_MQTT)
TARGET_LINK_LIBRARIES(taosd mqtt) TARGET_LINK_LIBRARIES(taosd mqtt)
ENDIF () ENDIF ()
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "twal.h" #include "twal.h"
#include "tfs.h" #include "tfs.h"
#include "tsync.h" #include "tsync.h"
#include "tgrant.h"
#include "dnodeStep.h" #include "dnodeStep.h"
#include "dnodePeer.h" #include "dnodePeer.h"
#include "dnodeModule.h" #include "dnodeModule.h"
...@@ -88,6 +89,7 @@ static SStep tsDnodeSteps[] = { ...@@ -88,6 +89,7 @@ static SStep tsDnodeSteps[] = {
{"dnode-statustmr", dnodeInitStatusTimer,dnodeCleanupStatusTimer}, {"dnode-statustmr", dnodeInitStatusTimer,dnodeCleanupStatusTimer},
{"dnode-telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry}, {"dnode-telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry},
{"dnode-script", scriptEnvPoolInit, scriptEnvPoolCleanup}, {"dnode-script", scriptEnvPoolInit, scriptEnvPoolCleanup},
{"dnode-grant", grantInit, grantCleanUp},
}; };
static SStep tsDnodeCompactSteps[] = { static SStep tsDnodeCompactSteps[] = {
......
...@@ -295,7 +295,7 @@ do { \ ...@@ -295,7 +295,7 @@ do { \
#define TSDB_DEFAULT_DAYS_PER_FILE 10 #define TSDB_DEFAULT_DAYS_PER_FILE 10
#define TSDB_MIN_KEEP 1 // data in db to be reserved. #define TSDB_MIN_KEEP 1 // data in db to be reserved.
#define TSDB_MAX_KEEP 365000 // data in db to be reserved. #define TSDB_MAX_KEEP 36500 // data in db to be reserved.
#define TSDB_DEFAULT_KEEP 3650 // ten years #define TSDB_DEFAULT_KEEP 3650 // ten years
#define TSDB_DEFAULT_MIN_ROW_FBLOCK 100 #define TSDB_DEFAULT_MIN_ROW_FBLOCK 100
......
...@@ -212,6 +212,7 @@ ...@@ -212,6 +212,7 @@
#define TK_INSERT 194 #define TK_INSERT 194
#define TK_INTO 195 #define TK_INTO 195
#define TK_VALUES 196 #define TK_VALUES 196
#define TK_FILE 197
...@@ -223,7 +224,6 @@ ...@@ -223,7 +224,6 @@
#define TK_HEX 303 // hex number 0x123 #define TK_HEX 303 // hex number 0x123
#define TK_OCT 304 // oct number #define TK_OCT 304 // oct number
#define TK_BIN 305 // bin format data 0b111 #define TK_BIN 305 // bin format data 0b111
#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
#endif #endif
......
...@@ -927,9 +927,12 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) { ...@@ -927,9 +927,12 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) {
pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock); pCreate->maxRowsPerFileBlock = htonl(pCreate->maxRowsPerFileBlock);
int32_t code; int32_t code;
#ifdef GRANT_CHECK_WRITE
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) { if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
code = TSDB_CODE_GRANT_EXPIRED; code = TSDB_CODE_GRANT_EXPIRED;
} else if (!pMsg->pUser->writeAuth) { } // else
#endif
if (!pMsg->pUser->writeAuth) {
code = TSDB_CODE_MND_NO_RIGHTS; code = TSDB_CODE_MND_NO_RIGHTS;
} else { } else {
code = mnodeCreateDb(pMsg->pUser->pAcct, pCreate, pMsg); code = mnodeCreateDb(pMsg->pUser->pAcct, pCreate, pMsg);
......
...@@ -191,9 +191,11 @@ static int32_t mnodeUpdateFunc(SFuncObj *pFunc, void *pMsg) { ...@@ -191,9 +191,11 @@ static int32_t mnodeUpdateFunc(SFuncObj *pFunc, void *pMsg) {
} }
*/ */
int32_t mnodeCreateFunc(SAcctObj *pAcct, char *name, int32_t codeLen, char *codeScript, char *path, uint8_t outputType, int16_t outputLen, int32_t funcType, int32_t bufSize, SMnodeMsg *pMsg) { int32_t mnodeCreateFunc(SAcctObj *pAcct, char *name, int32_t codeLen, char *codeScript, char *path, uint8_t outputType, int16_t outputLen, int32_t funcType, int32_t bufSize, SMnodeMsg *pMsg) {
#ifdef GRANT_CHECK_WRITE
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) { if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
return TSDB_CODE_GRANT_EXPIRED; return TSDB_CODE_GRANT_EXPIRED;
} }
#endif
if (!pMsg->pUser->writeAuth) { if (!pMsg->pUser->writeAuth) {
return TSDB_CODE_MND_NO_RIGHTS; return TSDB_CODE_MND_NO_RIGHTS;
......
...@@ -55,7 +55,7 @@ static SStep tsMnodeSteps[] = { ...@@ -55,7 +55,7 @@ static SStep tsMnodeSteps[] = {
{"mnodes", mnodeInitMnodes, mnodeCleanupMnodes}, {"mnodes", mnodeInitMnodes, mnodeCleanupMnodes},
{"sdb", sdbInit, sdbCleanUp}, {"sdb", sdbInit, sdbCleanUp},
{"balance", bnInit, bnCleanUp}, {"balance", bnInit, bnCleanUp},
{"grant", grantInit, grantCleanUp}, // {"grant", grantInit, grantCleanUp},
{"show", mnodeInitShow, mnodeCleanUpShow} {"show", mnodeInitShow, mnodeCleanUpShow}
}; };
......
...@@ -65,14 +65,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) { ...@@ -65,14 +65,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
return TSDB_CODE_MND_MSG_NOT_PROCESSED; return TSDB_CODE_MND_MSG_NOT_PROCESSED;
} }
#ifdef GRANT_CHECK_WRITE
int32_t code = grantCheck(TSDB_GRANT_TIME); int32_t code = grantCheck(TSDB_GRANT_TIME);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType],
tstrerror(code)); tstrerror(code));
return code; return code;
} }
#endif
code = mnodeInitMsg(pMsg); int32_t code = mnodeInitMsg(pMsg);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType], mError("msg:%p, app:%p type:%s not processed, reason:%s", pMsg, pMsg->rpcMsg.ahandle, taosMsg[pMsg->rpcMsg.msgType],
tstrerror(code)); tstrerror(code));
......
...@@ -65,6 +65,8 @@ static void taosGetSystemTimezone() { ...@@ -65,6 +65,8 @@ static void taosGetSystemTimezone() {
struct tm tm1; struct tm tm1;
localtime_r(&tx1, &tm1); localtime_r(&tx1, &tm1);
tsDaylight = daylight;
/* /*
* format example: * format example:
* *
......
...@@ -213,6 +213,8 @@ static void taosGetSystemTimezone() { ...@@ -213,6 +213,8 @@ static void taosGetSystemTimezone() {
int32_t tz = (-timezone * MILLISECOND_PER_SECOND) / MILLISECOND_PER_HOUR; int32_t tz = (-timezone * MILLISECOND_PER_SECOND) / MILLISECOND_PER_HOUR;
tz += daylight; tz += daylight;
tsDaylight = daylight;
/* /*
* format example: * format example:
* *
......
...@@ -380,15 +380,20 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec ...@@ -380,15 +380,20 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
assert(toPrecision == TSDB_TIME_PRECISION_MILLI || assert(toPrecision == TSDB_TIME_PRECISION_MILLI ||
toPrecision == TSDB_TIME_PRECISION_MICRO || toPrecision == TSDB_TIME_PRECISION_MICRO ||
toPrecision == TSDB_TIME_PRECISION_NANO); toPrecision == TSDB_TIME_PRECISION_NANO);
double tempResult = (double)time;
switch(fromPrecision) { switch(fromPrecision) {
case TSDB_TIME_PRECISION_MILLI: { case TSDB_TIME_PRECISION_MILLI: {
switch (toPrecision) { switch (toPrecision) {
case TSDB_TIME_PRECISION_MILLI: case TSDB_TIME_PRECISION_MILLI:
return time; return time;
case TSDB_TIME_PRECISION_MICRO: case TSDB_TIME_PRECISION_MICRO:
return time * 1000; tempResult *= 1000;
time *= 1000;
goto end_;
case TSDB_TIME_PRECISION_NANO: case TSDB_TIME_PRECISION_NANO:
return time * 1000000; tempResult *= 1000000;
time *= 1000000;
goto end_;
} }
} // end from milli } // end from milli
case TSDB_TIME_PRECISION_MICRO: { case TSDB_TIME_PRECISION_MICRO: {
...@@ -398,7 +403,9 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec ...@@ -398,7 +403,9 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
case TSDB_TIME_PRECISION_MICRO: case TSDB_TIME_PRECISION_MICRO:
return time; return time;
case TSDB_TIME_PRECISION_NANO: case TSDB_TIME_PRECISION_NANO:
return time * 1000; tempResult *= 1000;
time *= 1000;
goto end_;
} }
} //end from micro } //end from micro
case TSDB_TIME_PRECISION_NANO: { case TSDB_TIME_PRECISION_NANO: {
...@@ -416,6 +423,10 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec ...@@ -416,6 +423,10 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
return time; // only to pass windows compilation return time; // only to pass windows compilation
} }
} //end switch fromPrecision } //end switch fromPrecision
end_:
if (tempResult > (double)INT64_MAX) return INT64_MAX;
if (tempResult < (double)INT64_MIN) return INT64_MIN + 1; // INT64_MIN means NULL
return time;
} }
static int32_t getDuration(int64_t val, char unit, int64_t* result, int32_t timePrecision) { static int32_t getDuration(int64_t val, char unit, int64_t* result, int32_t timePrecision) {
......
...@@ -91,6 +91,17 @@ static void taosGetSystemTimezone() { ...@@ -91,6 +91,17 @@ static void taosGetSystemTimezone() {
strcpy(tsTimezone, tz); strcpy(tsTimezone, tz);
} }
cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT; cfg_timezone->cfgStatus = TAOS_CFG_CSTATUS_DEFAULT;
#ifdef _MSC_VER
#if _MSC_VER >= 1900
int64_t timezone = _timezone;
int32_t daylight = _daylight;
char **tzname = _tzname;
#endif
#endif
tsDaylight = daylight;
uInfo("timezone not configured, use default"); uInfo("timezone not configured, use default");
} }
} }
......
Subproject commit f56aa0f485d7bb6aebbcefc2007eeecdccb767c8 Subproject commit ba539ce69dc4fe53536e9b0517fe75917dce5c46
...@@ -154,12 +154,13 @@ typedef struct HttpContext { ...@@ -154,12 +154,13 @@ typedef struct HttpContext {
char db[/*TSDB_ACCT_ID_LEN + */TSDB_DB_NAME_LEN]; char db[/*TSDB_ACCT_ID_LEN + */TSDB_DB_NAME_LEN];
TAOS * taos; TAOS * taos;
void * ppContext; void * ppContext;
pthread_mutex_t ctxMutex;
HttpSession *session; HttpSession *session;
z_stream gzipStream; z_stream gzipStream;
HttpParser *parser; HttpParser *parser;
HttpSqlCmd singleCmd; HttpSqlCmd singleCmd;
HttpSqlCmds *multiCmds; HttpSqlCmds *multiCmds;
JsonBuf * jsonBuf; JsonBuf *jsonBuf;
HttpEncodeMethod *encodeMethod; HttpEncodeMethod *encodeMethod;
HttpDecodeMethod *decodeMethod; HttpDecodeMethod *decodeMethod;
struct HttpThread *pThread; struct HttpThread *pThread;
......
...@@ -67,6 +67,8 @@ static void httpDestroyContext(void *data) { ...@@ -67,6 +67,8 @@ static void httpDestroyContext(void *data) {
pContext->parser = NULL; pContext->parser = NULL;
} }
pthread_mutex_destroy(&pContext->ctxMutex);
tfree(pContext); tfree(pContext);
} }
...@@ -128,6 +130,8 @@ HttpContext *httpCreateContext(SOCKET fd) { ...@@ -128,6 +130,8 @@ HttpContext *httpCreateContext(SOCKET fd) {
// set the ref to 0 // set the ref to 0
taosCacheRelease(tsHttpServer.contextCache, (void **)&ppContext, false); taosCacheRelease(tsHttpServer.contextCache, (void **)&ppContext, false);
pthread_mutex_init(&pContext->ctxMutex, NULL);
return pContext; return pContext;
} }
......
...@@ -45,15 +45,14 @@ bool httpProcessData(HttpContext* pContext) { ...@@ -45,15 +45,14 @@ bool httpProcessData(HttpContext* pContext) {
httpTrace("context:%p, fd:%d, process options request", pContext, pContext->fd); httpTrace("context:%p, fd:%d, process options request", pContext, pContext->fd);
httpSendOptionResp(pContext, "process options request success"); httpSendOptionResp(pContext, "process options request success");
} else { } else {
if (!httpDecodeRequest(pContext)) { pthread_mutex_lock(&pContext->ctxMutex);
/*
* httpCloseContextByApp has been called when parsing the error if (httpDecodeRequest(pContext)) {
*/
// httpCloseContextByApp(pContext);
} else {
httpClearParser(pContext->parser); httpClearParser(pContext->parser);
httpProcessRequest(pContext); httpProcessRequest(pContext);
} }
pthread_mutex_unlock(&pContext->ctxMutex);
} }
return true; return true;
......
...@@ -406,7 +406,14 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int32_t code) { ...@@ -406,7 +406,14 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int32_t code) {
if (pContext->session == NULL) { if (pContext->session == NULL) {
httpSendErrorResp(pContext, TSDB_CODE_HTTP_SESSION_FULL); httpSendErrorResp(pContext, TSDB_CODE_HTTP_SESSION_FULL);
} else { } else {
// httpProcessRequestCb called by another thread and a subsequent thread calls this
// function again, if this function called by httpProcessRequestCb executes memset
// just before the subsequent thread executes *Cmd function, nativSql will be NULL
pthread_mutex_lock(&pContext->ctxMutex);
httpExecCmd(pContext); httpExecCmd(pContext);
pthread_mutex_unlock(&pContext->ctxMutex);
} }
} }
......
...@@ -281,7 +281,7 @@ void *destroyRelationInfo(SRelationInfo* pFromInfo); ...@@ -281,7 +281,7 @@ void *destroyRelationInfo(SRelationInfo* pFromInfo);
SRelationInfo *addSubqueryElem(SRelationInfo* pRelationInfo, SArray* pSub, SStrToken* pAlias); SRelationInfo *addSubqueryElem(SRelationInfo* pRelationInfo, SArray* pSub, SStrToken* pAlias);
// sql expr leaf node // sql expr leaf node
tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType); tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optrType);
tSqlExpr *tSqlExprCreateFunction(SArray *pParam, SStrToken *pFuncToken, SStrToken *endToken, int32_t optType); tSqlExpr *tSqlExprCreateFunction(SArray *pParam, SStrToken *pFuncToken, SStrToken *endToken, int32_t optType);
SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken); SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken);
......
...@@ -90,7 +90,6 @@ dbPrefix(A) ::= ids(X) DOT. {A = X; } ...@@ -90,7 +90,6 @@ dbPrefix(A) ::= ids(X) DOT. {A = X; }
%type cpxName {SStrToken} %type cpxName {SStrToken}
cpxName(A) ::= . {A.n = 0; } cpxName(A) ::= . {A.n = 0; }
cpxName(A) ::= DOT ids(Y). {A = Y; A.n += 1; } cpxName(A) ::= DOT ids(Y). {A = Y; A.n += 1; }
cmd ::= SHOW CREATE TABLE ids(X) cpxName(Y). { cmd ::= SHOW CREATE TABLE ids(X) cpxName(Y). {
X.n += Y.n; X.n += Y.n;
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &X); setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &X);
...@@ -520,7 +519,7 @@ selcollist(A) ::= sclp(P) distinct(Z) expr(X) as(Y). { ...@@ -520,7 +519,7 @@ selcollist(A) ::= sclp(P) distinct(Z) expr(X) as(Y). {
} }
selcollist(A) ::= sclp(P) STAR. { selcollist(A) ::= sclp(P) STAR. {
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
A = tSqlExprListAppend(P, pNode, 0, 0); A = tSqlExprListAppend(P, pNode, 0, 0);
} }
...@@ -701,23 +700,23 @@ where_opt(A) ::= WHERE expr(X). {A = X;} ...@@ -701,23 +700,23 @@ where_opt(A) ::= WHERE expr(X). {A = X;}
expr(A) ::= LP(X) expr(Y) RP(Z). {A = Y; A->exprToken.z = X.z; A->exprToken.n = (Z.z - X.z + 1);} expr(A) ::= LP(X) expr(Y) RP(Z). {A = Y; A->exprToken.z = X.z; A->exprToken.n = (Z.z - X.z + 1);}
expr(A) ::= ID(X). { A = tSqlExprCreateIdValue(&X, TK_ID);} expr(A) ::= ID(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_ID);}
expr(A) ::= ID(X) DOT ID(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(&X, TK_ID);} expr(A) ::= ID(X) DOT ID(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(pInfo, &X, TK_ID);}
expr(A) ::= ID(X) DOT STAR(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(&X, TK_ALL);} expr(A) ::= ID(X) DOT STAR(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(pInfo, &X, TK_ALL);}
expr(A) ::= INTEGER(X). { A = tSqlExprCreateIdValue(&X, TK_INTEGER);} expr(A) ::= INTEGER(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= MINUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(&X, TK_INTEGER);} expr(A) ::= MINUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= PLUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(&X, TK_INTEGER);} expr(A) ::= PLUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= FLOAT(X). { A = tSqlExprCreateIdValue(&X, TK_FLOAT);} expr(A) ::= FLOAT(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= MINUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(&X, TK_FLOAT);} expr(A) ::= MINUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= PLUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(&X, TK_FLOAT);} expr(A) ::= PLUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(&X, TK_STRING);} expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_STRING);}
expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(&X, TK_NOW); } expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_NOW); }
expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(&X, TK_VARIABLE);} expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= PLUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(&X, TK_VARIABLE);} expr(A) ::= PLUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= MINUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(&X, TK_VARIABLE);} expr(A) ::= MINUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(&X, TK_BOOL);} expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_BOOL);}
expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(&X, TK_NULL);} expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_NULL);}
// ordinary functions: min(x), max(x), top(k, 20) // ordinary functions: min(x), max(x), top(k, 20)
expr(A) ::= ID(X) LP exprlist(Y) RP(E). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFunction(Y, &X, &E, X.type); } expr(A) ::= ID(X) LP exprlist(Y) RP(E). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFunction(Y, &X, &E, X.type); }
...@@ -922,4 +921,4 @@ cmd ::= KILL QUERY INTEGER(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); s ...@@ -922,4 +921,4 @@ cmd ::= KILL QUERY INTEGER(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); s
%fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED %fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED
DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD
LIKE MATCH NMATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL LIKE MATCH NMATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL
NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES. NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES FILE.
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "tdigest.h" #include "tdigest.h"
#include "ttype.h" #include "ttype.h"
#include "tsdb.h" #include "tsdb.h"
#include "tglobal.h"
#include "qAggMain.h" #include "qAggMain.h"
#include "qFill.h" #include "qFill.h"
...@@ -172,7 +171,11 @@ typedef struct SDerivInfo { ...@@ -172,7 +171,11 @@ typedef struct SDerivInfo {
} SDerivInfo; } SDerivInfo;
typedef struct { typedef struct {
double cumSum; union {
double d64CumSum;
int64_t i64CumSum;
uint64_t u64CumSum;
};
} SCumSumInfo; } SCumSumInfo;
typedef struct { typedef struct {
...@@ -4709,7 +4712,7 @@ static bool csum_function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pResIn ...@@ -4709,7 +4712,7 @@ static bool csum_function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pResIn
} }
SCumSumInfo* pCumSumInfo = GET_ROWCELL_INTERBUF(pResInfo); SCumSumInfo* pCumSumInfo = GET_ROWCELL_INTERBUF(pResInfo);
pCumSumInfo->cumSum = 0; pCumSumInfo->i64CumSum = 0;
return true; return true;
} }
...@@ -4733,20 +4736,30 @@ static void csum_function(SQLFunctionCtx *pCtx) { ...@@ -4733,20 +4736,30 @@ static void csum_function(SQLFunctionCtx *pCtx) {
continue; continue;
} }
if (IS_SIGNED_NUMERIC_TYPE(pCtx->inputType)) {
int64_t v = 0;
GET_TYPED_DATA(v, int64_t, pCtx->inputType, pData);
pCumSumInfo->i64CumSum += v;
} else if (IS_UNSIGNED_NUMERIC_TYPE(pCtx->inputType)) {
uint64_t v = 0;
GET_TYPED_DATA(v, uint64_t, pCtx->inputType, pData);
pCumSumInfo->u64CumSum += v;
} else if (IS_FLOAT_TYPE(pCtx->inputType)) {
double v = 0; double v = 0;
GET_TYPED_DATA(v, double, pCtx->inputType, pData); GET_TYPED_DATA(v, double, pCtx->inputType, pData);
pCumSumInfo->cumSum += v; pCumSumInfo->d64CumSum += v;
}
*pTimestamp = (tsList != NULL) ? tsList[i] : 0; *pTimestamp = (tsList != NULL) ? tsList[i] : 0;
if (IS_SIGNED_NUMERIC_TYPE(pCtx->inputType)) { if (IS_SIGNED_NUMERIC_TYPE(pCtx->inputType)) {
int64_t *retVal = (int64_t *)pCtx->pOutput; int64_t *retVal = (int64_t *)pCtx->pOutput;
*retVal = (int64_t)(pCumSumInfo->cumSum); *retVal = (int64_t)(pCumSumInfo->i64CumSum);
} else if (IS_UNSIGNED_NUMERIC_TYPE(pCtx->inputType)) { } else if (IS_UNSIGNED_NUMERIC_TYPE(pCtx->inputType)) {
uint64_t *retVal = (uint64_t *)pCtx->pOutput; uint64_t *retVal = (uint64_t *)pCtx->pOutput;
*retVal = (uint64_t)(pCumSumInfo->cumSum); *retVal = (uint64_t)(pCumSumInfo->u64CumSum);
} else if (IS_FLOAT_TYPE(pCtx->inputType)) { } else if (IS_FLOAT_TYPE(pCtx->inputType)) {
double *retVal = (double*) pCtx->pOutput; double *retVal = (double*) pCtx->pOutput;
SET_DOUBLE_VAL(retVal, pCumSumInfo->cumSum); SET_DOUBLE_VAL(retVal, pCumSumInfo->d64CumSum);
} }
++notNullElems; ++notNullElems;
......
...@@ -1841,6 +1841,15 @@ int32_t filterInitValFieldData(SFilterInfo *info) { ...@@ -1841,6 +1841,15 @@ int32_t filterInitValFieldData(SFilterInfo *info) {
qError("dump value to type[%d] failed", type); qError("dump value to type[%d] failed", type);
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
// match/nmatch for nchar type need convert from ucs4 to mbs
if(type == TSDB_DATA_TYPE_NCHAR &&
(unit->compare.optr == TSDB_RELATION_MATCH || unit->compare.optr == TSDB_RELATION_NMATCH)){
char newValData[TSDB_REGEX_STRING_DEFAULT_LEN * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE] = {0};
int32_t len = taosUcs4ToMbs(varDataVal(fi->data), varDataLen(fi->data), varDataVal(newValData));
varDataSetLen(newValData, len);
varDataCopy(fi->data, newValData);
}
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -2960,8 +2969,17 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, int8_t** p, SDataStat ...@@ -2960,8 +2969,17 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, int8_t** p, SDataStat
all = false; all = false;
continue; continue;
} }
// match/nmatch for nchar type need convert from ucs4 to mbs
if(info->cunits[uidx].dataType == TSDB_DATA_TYPE_NCHAR && (info->cunits[uidx].optr == TSDB_RELATION_MATCH || info->cunits[uidx].optr == TSDB_RELATION_NMATCH)){
char *newColData = calloc(info->cunits[uidx].dataSize * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE, 1);
int len = taosUcs4ToMbs(varDataVal(colData), varDataLen(colData), varDataVal(newColData));
varDataSetLen(newColData, len);
(*p)[i] = filterDoCompare(gDataCompare[info->cunits[uidx].func], info->cunits[uidx].optr, newColData, info->cunits[uidx].valData);
tfree(newColData);
}else{
(*p)[i] = filterDoCompare(gDataCompare[info->cunits[uidx].func], info->cunits[uidx].optr, colData, info->cunits[uidx].valData); (*p)[i] = filterDoCompare(gDataCompare[info->cunits[uidx].func], info->cunits[uidx].optr, colData, info->cunits[uidx].valData);
}
if ((*p)[i] == 0) { if ((*p)[i] == 0) {
all = false; all = false;
...@@ -3009,8 +3027,16 @@ bool filterExecuteImpl(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis * ...@@ -3009,8 +3027,16 @@ bool filterExecuteImpl(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis *
} else if (cunit->rfunc >= 0) { } else if (cunit->rfunc >= 0) {
(*p)[i] = (*gRangeCompare[cunit->rfunc])(colData, colData, cunit->valData, cunit->valData2, gDataCompare[cunit->func]); (*p)[i] = (*gRangeCompare[cunit->rfunc])(colData, colData, cunit->valData, cunit->valData2, gDataCompare[cunit->func]);
} else { } else {
if(cunit->dataType == TSDB_DATA_TYPE_NCHAR && (cunit->optr == TSDB_RELATION_MATCH || cunit->optr == TSDB_RELATION_NMATCH)){
char *newColData = calloc(cunit->dataSize * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE, 1);
int len = taosUcs4ToMbs(varDataVal(colData), varDataLen(colData), varDataVal(newColData));
varDataSetLen(newColData, len);
(*p)[i] = filterDoCompare(gDataCompare[cunit->func], cunit->optr, newColData, cunit->valData);
tfree(newColData);
}else{
(*p)[i] = filterDoCompare(gDataCompare[cunit->func], cunit->optr, colData, cunit->valData); (*p)[i] = filterDoCompare(gDataCompare[cunit->func], cunit->optr, colData, cunit->valData);
} }
}
//FILTER_UNIT_SET_R(info, uidx, p[i]); //FILTER_UNIT_SET_R(info, uidx, p[i]);
//FILTER_UNIT_SET_F(info, uidx); //FILTER_UNIT_SET_F(info, uidx);
......
...@@ -67,7 +67,6 @@ SSqlInfo qSqlParse(const char *pStr) { ...@@ -67,7 +67,6 @@ SSqlInfo qSqlParse(const char *pStr) {
sqlInfo.valid = false; sqlInfo.valid = false;
goto abort_parse; goto abort_parse;
} }
default: default:
Parse(pParser, t0.type, t0, &sqlInfo); Parse(pParser, t0.type, t0, &sqlInfo);
if (sqlInfo.valid == false) { if (sqlInfo.valid == false) {
...@@ -134,7 +133,7 @@ SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken) { ...@@ -134,7 +133,7 @@ SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken) {
return pList; return pList;
} }
tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) { tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optrType) {
tSqlExpr *pSqlExpr = calloc(1, sizeof(tSqlExpr)); tSqlExpr *pSqlExpr = calloc(1, sizeof(tSqlExpr));
if (pToken != NULL) { if (pToken != NULL) {
...@@ -169,6 +168,7 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) { ...@@ -169,6 +168,7 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) {
char unit = 0; char unit = 0;
int32_t ret = parseAbsoluteDuration(pToken->z, pToken->n, &pSqlExpr->value.i64, &unit, TSDB_TIME_PRECISION_NANO); int32_t ret = parseAbsoluteDuration(pToken->z, pToken->n, &pSqlExpr->value.i64, &unit, TSDB_TIME_PRECISION_NANO);
if (ret != TSDB_CODE_SUCCESS) { if (ret != TSDB_CODE_SUCCESS) {
snprintf(pInfo->msg, tListLen(pInfo->msg), "%s", pToken->z);
terrno = TSDB_CODE_TSC_SQL_SYNTAX_ERROR; terrno = TSDB_CODE_TSC_SQL_SYNTAX_ERROR;
} }
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
** input grammar file: ** input grammar file:
*/ */
#include <stdio.h> #include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/ /************ Begin %include sections from the grammar ************************/
#include <stdio.h> #include <stdio.h>
...@@ -77,10 +76,8 @@ ...@@ -77,10 +76,8 @@
** zero the stack is dynamically sized using realloc() ** zero the stack is dynamically sized using realloc()
** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_SDECL A static variable declaration for the %extra_argument
** ParseARG_PDECL A parameter declaration for the %extra_argument ** ParseARG_PDECL A parameter declaration for the %extra_argument
** ParseARG_PARAM Code to pass %extra_argument as a subroutine parameter
** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_STORE Code to store %extra_argument into yypParser
** ParseARG_FETCH Code to extract %extra_argument from yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser
** ParseCTX_* As ParseARG_ except for %extra_context
** YYERRORSYMBOL is the code number of the error symbol. If not ** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing. ** defined, then do no error processing.
** YYNSTATE the combined number of states. ** YYNSTATE the combined number of states.
...@@ -100,48 +97,41 @@ ...@@ -100,48 +97,41 @@
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 278 #define YYNOCODE 281
#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;
SRelationInfo* yy8; SWindowStateVal yy48;
SWindowStateVal yy40; SCreateTableSql* yy102;
SSqlNode* yy56; tVariant yy106;
SCreateDbInfo yy90; int64_t yy109;
int yy96; SSessionWindowVal yy139;
int32_t yy104; SCreateDbInfo yy142;
SSessionWindowVal yy147; tSqlExpr* yy146;
SCreatedTableInfo yy152; SRelationInfo* yy164;
SLimitVal yy166; int yy172;
SCreateAcctInfo yy171; SArray* yy221;
TAOS_FIELD yy183; SIntervalVal yy280;
int64_t yy325; int32_t yy340;
SIntervalVal yy400; SSqlNode* yy376;
SArray* yy421; SCreatedTableInfo yy416;
tVariant yy430; SLimitVal yy454;
SCreateTableSql* yy438; SCreateAcctInfo yy491;
tSqlExpr* yy439; TAOS_FIELD yy503;
} YYMINORTYPE; } YYMINORTYPE;
#ifndef YYSTACKDEPTH #ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100 #define YYSTACKDEPTH 100
#endif #endif
#define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_SDECL SSqlInfo* pInfo;
#define ParseARG_PDECL ,SSqlInfo* pInfo #define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_PARAM ,pInfo #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo
#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo; #define ParseARG_STORE yypParser->pInfo = pInfo
#define ParseARG_STORE yypParser->pInfo=pInfo;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1 #define YYFALLBACK 1
#define YYNSTATE 368 #define YYNSTATE 368
#define YYNRULE 294 #define YYNRULE 294
#define YYNRULE_WITH_ACTION 294 #define YYNTOKEN 198
#define YYNTOKEN 197
#define YY_MAX_SHIFT 367 #define YY_MAX_SHIFT 367
#define YY_MIN_SHIFTREDUCE 576 #define YY_MIN_SHIFTREDUCE 576
#define YY_MAX_SHIFTREDUCE 869 #define YY_MAX_SHIFTREDUCE 869
...@@ -151,7 +141,6 @@ typedef union { ...@@ -151,7 +141,6 @@ typedef union {
#define YY_MIN_REDUCE 873 #define YY_MIN_REDUCE 873
#define YY_MAX_REDUCE 1166 #define YY_MAX_REDUCE 1166
/************* End control #defines *******************************************/ /************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
/* Define the yytestcase() macro to be a no-op if is not already defined /* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise. ** otherwise.
...@@ -223,246 +212,247 @@ static const YYACTIONTYPE yy_action[] = { ...@@ -223,246 +212,247 @@ static const YYACTIONTYPE yy_action[] = {
/* 20 */ 255, 53, 52, 51, 628, 62, 324, 67, 65, 68, /* 20 */ 255, 53, 52, 51, 628, 62, 324, 67, 65, 68,
/* 30 */ 66, 157, 629, 286, 238, 58, 57, 344, 343, 56, /* 30 */ 66, 157, 629, 286, 238, 58, 57, 344, 343, 56,
/* 40 */ 55, 54, 59, 60, 247, 63, 64, 252, 1029, 255, /* 40 */ 55, 54, 59, 60, 247, 63, 64, 252, 1029, 255,
/* 50 */ 53, 52, 51, 209, 62, 324, 67, 65, 68, 66, /* 50 */ 53, 52, 51, 664, 62, 324, 67, 65, 68, 66,
/* 60 */ 999, 1042, 997, 998, 58, 57, 664, 1000, 56, 55, /* 60 */ 999, 1042, 997, 998, 58, 57, 209, 1000, 56, 55,
/* 70 */ 54, 1001, 1048, 1002, 1003, 58, 57, 277, 1015, 56, /* 70 */ 54, 1001, 1048, 1002, 1003, 58, 57, 277, 1015, 56,
/* 80 */ 55, 54, 59, 60, 164, 63, 64, 38, 82, 255, /* 80 */ 55, 54, 59, 60, 215, 63, 64, 38, 82, 255,
/* 90 */ 53, 52, 51, 88, 62, 324, 67, 65, 68, 66, /* 90 */ 53, 52, 51, 88, 62, 324, 67, 65, 68, 66,
/* 100 */ 284, 283, 249, 752, 58, 57, 1029, 211, 56, 55, /* 100 */ 284, 283, 249, 752, 58, 57, 1029, 211, 56, 55,
/* 110 */ 54, 38, 59, 61, 806, 63, 64, 1042, 1143, 255, /* 110 */ 54, 322, 59, 61, 806, 63, 64, 1042, 1143, 255,
/* 120 */ 53, 52, 51, 628, 62, 324, 67, 65, 68, 66, /* 120 */ 53, 52, 51, 628, 62, 324, 67, 65, 68, 66,
/* 130 */ 45, 629, 237, 239, 58, 57, 1026, 164, 56, 55, /* 130 */ 45, 629, 237, 239, 58, 57, 1026, 164, 56, 55,
/* 140 */ 54, 60, 1023, 63, 64, 771, 772, 255, 53, 52, /* 140 */ 54, 60, 1023, 63, 64, 771, 772, 255, 53, 52,
/* 150 */ 51, 95, 62, 324, 67, 65, 68, 66, 38, 1090, /* 150 */ 51, 628, 62, 324, 67, 65, 68, 66, 812, 629,
/* 160 */ 1025, 296, 58, 57, 322, 83, 56, 55, 54, 577, /* 160 */ 815, 216, 58, 57, 322, 100, 56, 55, 54, 577,
/* 170 */ 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, /* 170 */ 578, 579, 580, 581, 582, 583, 584, 585, 586, 587,
/* 180 */ 588, 589, 590, 155, 322, 236, 63, 64, 756, 248, /* 180 */ 588, 589, 590, 155, 164, 236, 63, 64, 756, 248,
/* 190 */ 255, 53, 52, 51, 628, 62, 324, 67, 65, 68, /* 190 */ 255, 53, 52, 51, 269, 62, 324, 67, 65, 68,
/* 200 */ 66, 251, 629, 245, 354, 58, 57, 1026, 215, 56, /* 200 */ 66, 1017, 354, 273, 272, 58, 57, 251, 217, 56,
/* 210 */ 55, 54, 1089, 44, 320, 361, 360, 319, 318, 317, /* 210 */ 55, 54, 1089, 44, 320, 361, 360, 319, 318, 317,
/* 220 */ 359, 316, 315, 314, 358, 313, 357, 356, 808, 38, /* 220 */ 359, 316, 315, 314, 358, 313, 357, 356, 38, 1137,
/* 230 */ 1, 180, 24, 991, 979, 980, 981, 982, 983, 984, /* 230 */ 56, 55, 54, 24, 29, 991, 979, 980, 981, 982,
/* 240 */ 985, 986, 987, 988, 989, 990, 992, 993, 256, 214, /* 240 */ 983, 984, 985, 986, 987, 988, 989, 990, 992, 993,
/* 250 */ 38, 254, 821, 922, 100, 810, 222, 813, 164, 816, /* 250 */ 214, 14, 254, 821, 1136, 96, 810, 222, 813, 1090,
/* 260 */ 192, 211, 139, 138, 137, 221, 809, 254, 821, 329, /* 260 */ 816, 296, 97, 139, 138, 137, 221, 211, 254, 821,
/* 270 */ 88, 810, 1143, 813, 246, 816, 1028, 29, 1026, 67, /* 270 */ 329, 88, 810, 256, 813, 1135, 816, 1025, 1143, 819,
/* 280 */ 65, 68, 66, 38, 1162, 233, 234, 58, 57, 325, /* 280 */ 67, 65, 68, 66, 326, 99, 233, 234, 58, 57,
/* 290 */ 1017, 56, 55, 54, 38, 333, 56, 55, 54, 1026, /* 290 */ 325, 164, 56, 55, 54, 1012, 1013, 35, 1016, 811,
/* 300 */ 269, 233, 234, 258, 5, 41, 182, 45, 211, 273, /* 300 */ 231, 814, 233, 234, 258, 5, 41, 182, 45, 365,
/* 310 */ 272, 181, 106, 111, 102, 110, 164, 73, 736, 1143, /* 310 */ 364, 148, 181, 106, 111, 102, 110, 164, 263, 736,
/* 320 */ 932, 733, 812, 734, 815, 735, 263, 192, 334, 276, /* 320 */ 38, 1028, 733, 85, 734, 86, 735, 154, 152, 151,
/* 330 */ 309, 80, 1026, 94, 69, 123, 117, 128, 229, 335, /* 330 */ 276, 309, 80, 211, 38, 69, 123, 117, 128, 229,
/* 340 */ 362, 960, 127, 1026, 133, 136, 126, 202, 200, 198, /* 340 */ 362, 960, 232, 127, 1143, 133, 136, 126, 202, 200,
/* 350 */ 69, 260, 261, 130, 197, 143, 142, 141, 140, 74, /* 350 */ 198, 69, 260, 261, 130, 197, 143, 142, 141, 140,
/* 360 */ 44, 97, 361, 360, 788, 923, 38, 359, 38, 822, /* 360 */ 280, 44, 280, 361, 360, 245, 94, 1100, 359, 1026,
/* 370 */ 817, 358, 192, 357, 356, 38, 818, 38, 38, 259, /* 370 */ 822, 817, 358, 38, 357, 356, 38, 818, 38, 246,
/* 380 */ 811, 257, 814, 332, 331, 822, 817, 264, 125, 298, /* 380 */ 259, 38, 257, 1026, 332, 331, 822, 817, 825, 38,
/* 390 */ 264, 93, 818, 326, 1012, 1013, 35, 1016, 178, 14, /* 390 */ 298, 264, 93, 818, 265, 38, 262, 38, 339, 338,
/* 400 */ 354, 179, 265, 96, 262, 264, 339, 338, 154, 152, /* 400 */ 38, 264, 178, 264, 922, 125, 788, 81, 932, 3,
/* 410 */ 151, 336, 749, 340, 81, 1026, 1027, 1026, 3, 193, /* 410 */ 193, 192, 179, 749, 1027, 192, 212, 354, 333, 73,
/* 420 */ 341, 787, 342, 346, 1026, 278, 1026, 1026, 365, 364, /* 420 */ 820, 334, 1026, 335, 923, 1026, 336, 1026, 1, 180,
/* 430 */ 148, 85, 86, 99, 76, 737, 738, 768, 9, 39, /* 430 */ 1026, 192, 76, 95, 340, 1162, 737, 738, 1026, 9,
/* 440 */ 778, 779, 722, 819, 301, 724, 216, 303, 1014, 723, /* 440 */ 341, 1014, 342, 278, 1026, 346, 1026, 83, 768, 1026,
/* 450 */ 34, 159, 844, 823, 70, 26, 39, 253, 39, 70, /* 450 */ 778, 779, 722, 808, 301, 724, 303, 39, 253, 723,
/* 460 */ 79, 98, 627, 70, 135, 134, 25, 25, 280, 280, /* 460 */ 34, 74, 159, 787, 70, 26, 39, 844, 39, 70,
/* 470 */ 16, 116, 15, 115, 77, 18, 25, 17, 741, 6, /* 470 */ 98, 823, 77, 70, 627, 79, 16, 116, 15, 115,
/* 480 */ 742, 274, 739, 304, 740, 20, 122, 19, 121, 22, /* 480 */ 6, 25, 18, 213, 17, 25, 274, 741, 25, 742,
/* 490 */ 217, 21, 711, 1100, 1137, 1136, 1135, 825, 231, 156, /* 490 */ 739, 809, 740, 304, 20, 122, 19, 121, 22, 218,
/* 500 */ 232, 820, 212, 213, 218, 210, 1099, 219, 220, 224, /* 500 */ 21, 135, 134, 210, 219, 220, 1154, 711, 156, 1099,
/* 510 */ 225, 226, 223, 207, 1154, 243, 1096, 1095, 244, 345, /* 510 */ 1050, 224, 225, 226, 223, 207, 243, 1096, 1095, 244,
/* 520 */ 1050, 1061, 1043, 48, 1058, 1059, 1063, 153, 281, 158, /* 520 */ 345, 48, 1061, 1058, 1059, 1063, 1082, 158, 163, 1043,
/* 530 */ 163, 292, 1024, 175, 1082, 174, 1081, 279, 84, 285, /* 530 */ 281, 153, 292, 1081, 285, 174, 1024, 175, 1022, 176,
/* 540 */ 1022, 310, 176, 240, 177, 171, 167, 937, 306, 307, /* 540 */ 177, 937, 306, 307, 308, 311, 312, 46, 767, 165,
/* 550 */ 308, 767, 311, 312, 1040, 165, 166, 46, 287, 289, /* 550 */ 205, 42, 1040, 323, 931, 330, 1161, 113, 1160, 75,
/* 560 */ 297, 299, 205, 168, 42, 78, 75, 50, 323, 931, /* 560 */ 1157, 183, 337, 1153, 240, 119, 78, 287, 289, 1152,
/* 570 */ 330, 1161, 113, 1160, 295, 169, 293, 291, 1157, 183, /* 570 */ 299, 50, 166, 1149, 184, 297, 957, 167, 43, 40,
/* 580 */ 337, 1153, 119, 288, 1152, 1149, 184, 957, 43, 40, /* 580 */ 47, 206, 919, 293, 129, 917, 131, 295, 132, 915,
/* 590 */ 47, 206, 919, 129, 49, 917, 131, 132, 915, 914, /* 590 */ 291, 914, 168, 266, 195, 196, 911, 288, 910, 909,
/* 600 */ 266, 195, 196, 911, 910, 909, 908, 907, 906, 905, /* 600 */ 908, 907, 906, 905, 199, 201, 902, 900, 898, 896,
/* 610 */ 199, 201, 902, 900, 898, 896, 203, 893, 204, 889, /* 610 */ 203, 893, 204, 889, 49, 310, 279, 84, 89, 290,
/* 620 */ 355, 124, 89, 290, 1083, 347, 348, 349, 350, 351, /* 620 */ 1083, 355, 348, 124, 347, 349, 350, 230, 351, 250,
/* 630 */ 352, 353, 363, 869, 230, 250, 305, 267, 268, 868, /* 630 */ 305, 352, 353, 363, 869, 267, 268, 868, 227, 270,
/* 640 */ 270, 227, 228, 271, 867, 850, 107, 936, 935, 108, /* 640 */ 271, 228, 107, 936, 935, 108, 867, 850, 275, 849,
/* 650 */ 849, 275, 280, 300, 10, 282, 744, 87, 30, 90, /* 650 */ 913, 280, 300, 912, 10, 87, 282, 744, 144, 187,
/* 660 */ 913, 912, 904, 186, 958, 190, 185, 187, 144, 191, /* 660 */ 904, 186, 958, 185, 188, 189, 191, 190, 145, 903,
/* 670 */ 189, 188, 145, 146, 147, 903, 995, 895, 4, 894, /* 670 */ 959, 146, 995, 2, 147, 30, 895, 169, 170, 894,
/* 680 */ 959, 769, 160, 33, 780, 170, 172, 2, 161, 162, /* 680 */ 171, 172, 4, 33, 1005, 90, 769, 160, 162, 780,
/* 690 */ 774, 91, 242, 776, 92, 1005, 294, 11, 12, 31, /* 690 */ 161, 242, 774, 91, 31, 776, 92, 294, 11, 32,
/* 700 */ 32, 13, 27, 302, 28, 99, 101, 104, 36, 103, /* 700 */ 12, 13, 27, 28, 302, 101, 99, 642, 104, 36,
/* 710 */ 642, 37, 105, 677, 675, 674, 673, 671, 670, 669, /* 710 */ 103, 675, 37, 677, 105, 674, 673, 671, 670, 669,
/* 720 */ 666, 321, 109, 632, 7, 826, 824, 8, 327, 328, /* 720 */ 666, 632, 321, 109, 7, 327, 328, 824, 8, 112,
/* 730 */ 112, 114, 71, 72, 118, 714, 39, 120, 713, 710, /* 730 */ 826, 114, 71, 72, 118, 714, 39, 713, 710, 120,
/* 740 */ 658, 656, 648, 654, 650, 652, 646, 644, 680, 679, /* 740 */ 658, 656, 648, 654, 650, 652, 646, 644, 680, 679,
/* 750 */ 678, 676, 672, 668, 667, 194, 630, 594, 873, 872, /* 750 */ 678, 676, 672, 668, 667, 194, 630, 594, 873, 872,
/* 760 */ 872, 872, 872, 872, 872, 872, 872, 872, 872, 872, /* 760 */ 872, 872, 872, 872, 872, 872, 872, 872, 872, 872,
/* 770 */ 872, 149, 150, /* 770 */ 872, 149, 150,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 266, 1, 199, 200, 199, 266, 245, 5, 266, 9, /* 0 */ 268, 1, 201, 202, 201, 268, 247, 5, 268, 9,
/* 10 */ 249, 197, 198, 13, 14, 253, 16, 17, 247, 277, /* 10 */ 251, 199, 200, 13, 14, 255, 16, 17, 249, 279,
/* 20 */ 20, 21, 22, 23, 1, 25, 26, 27, 28, 29, /* 20 */ 20, 21, 22, 23, 1, 25, 26, 27, 28, 29,
/* 30 */ 30, 199, 9, 271, 263, 35, 36, 35, 36, 39, /* 30 */ 30, 201, 9, 273, 265, 35, 36, 35, 36, 39,
/* 40 */ 40, 41, 13, 14, 245, 16, 17, 206, 249, 20, /* 40 */ 40, 41, 13, 14, 247, 16, 17, 208, 251, 20,
/* 50 */ 21, 22, 23, 266, 25, 26, 27, 28, 29, 30, /* 50 */ 21, 22, 23, 5, 25, 26, 27, 28, 29, 30,
/* 60 */ 223, 247, 225, 226, 35, 36, 5, 230, 39, 40, /* 60 */ 225, 249, 227, 228, 35, 36, 268, 232, 39, 40,
/* 70 */ 41, 234, 267, 236, 237, 35, 36, 263, 0, 39, /* 70 */ 41, 236, 269, 238, 239, 35, 36, 265, 0, 39,
/* 80 */ 40, 41, 13, 14, 199, 16, 17, 199, 88, 20, /* 80 */ 40, 41, 13, 14, 268, 16, 17, 201, 88, 20,
/* 90 */ 21, 22, 23, 84, 25, 26, 27, 28, 29, 30, /* 90 */ 21, 22, 23, 84, 25, 26, 27, 28, 29, 30,
/* 100 */ 268, 269, 245, 39, 35, 36, 249, 266, 39, 40, /* 100 */ 270, 271, 247, 39, 35, 36, 251, 268, 39, 40,
/* 110 */ 41, 199, 13, 14, 85, 16, 17, 247, 277, 20, /* 110 */ 41, 86, 13, 14, 85, 16, 17, 249, 279, 20,
/* 120 */ 21, 22, 23, 1, 25, 26, 27, 28, 29, 30, /* 120 */ 21, 22, 23, 1, 25, 26, 27, 28, 29, 30,
/* 130 */ 121, 9, 244, 263, 35, 36, 248, 199, 39, 40, /* 130 */ 121, 9, 246, 265, 35, 36, 250, 201, 39, 40,
/* 140 */ 41, 14, 199, 16, 17, 127, 128, 20, 21, 22, /* 140 */ 41, 14, 201, 16, 17, 127, 128, 20, 21, 22,
/* 150 */ 23, 250, 25, 26, 27, 28, 29, 30, 199, 274, /* 150 */ 23, 1, 25, 26, 27, 28, 29, 30, 5, 9,
/* 160 */ 248, 276, 35, 36, 86, 264, 39, 40, 41, 47, /* 160 */ 7, 268, 35, 36, 86, 209, 39, 40, 41, 47,
/* 170 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, /* 170 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/* 180 */ 58, 59, 60, 61, 86, 63, 16, 17, 124, 246, /* 180 */ 58, 59, 60, 61, 201, 63, 16, 17, 124, 248,
/* 190 */ 20, 21, 22, 23, 1, 25, 26, 27, 28, 29, /* 190 */ 20, 21, 22, 23, 144, 25, 26, 27, 28, 29,
/* 200 */ 30, 206, 9, 244, 92, 35, 36, 248, 266, 39, /* 200 */ 30, 245, 92, 153, 154, 35, 36, 208, 268, 39,
/* 210 */ 40, 41, 274, 100, 101, 102, 103, 104, 105, 106, /* 210 */ 40, 41, 276, 100, 101, 102, 103, 104, 105, 106,
/* 220 */ 107, 108, 109, 110, 111, 112, 113, 114, 1, 199, /* 220 */ 107, 108, 109, 110, 111, 112, 113, 114, 201, 268,
/* 230 */ 208, 209, 46, 223, 224, 225, 226, 227, 228, 229, /* 230 */ 39, 40, 41, 46, 84, 225, 226, 227, 228, 229,
/* 240 */ 230, 231, 232, 233, 234, 235, 236, 237, 206, 63, /* 240 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
/* 250 */ 199, 1, 2, 205, 207, 5, 70, 7, 199, 9, /* 250 */ 63, 84, 1, 2, 268, 88, 5, 70, 7, 276,
/* 260 */ 212, 266, 76, 77, 78, 79, 39, 1, 2, 83, /* 260 */ 9, 278, 209, 76, 77, 78, 79, 268, 1, 2,
/* 270 */ 84, 5, 277, 7, 244, 9, 249, 84, 248, 27, /* 270 */ 83, 84, 5, 208, 7, 268, 9, 250, 279, 126,
/* 280 */ 28, 29, 30, 199, 249, 35, 36, 35, 36, 39, /* 280 */ 27, 28, 29, 30, 15, 118, 35, 36, 35, 36,
/* 290 */ 243, 39, 40, 41, 199, 244, 39, 40, 41, 248, /* 290 */ 39, 201, 39, 40, 41, 242, 243, 244, 245, 5,
/* 300 */ 144, 35, 36, 70, 64, 65, 66, 121, 266, 153, /* 300 */ 268, 7, 35, 36, 70, 64, 65, 66, 121, 67,
/* 310 */ 154, 71, 72, 73, 74, 75, 199, 99, 2, 277, /* 310 */ 68, 69, 71, 72, 73, 74, 75, 201, 70, 2,
/* 320 */ 205, 5, 5, 7, 7, 9, 70, 212, 244, 143, /* 320 */ 201, 251, 5, 85, 7, 85, 9, 64, 65, 66,
/* 330 */ 90, 145, 248, 274, 84, 64, 65, 66, 152, 244, /* 330 */ 143, 90, 145, 268, 201, 84, 64, 65, 66, 152,
/* 340 */ 221, 222, 71, 248, 73, 74, 75, 64, 65, 66, /* 340 */ 223, 224, 268, 71, 279, 73, 74, 75, 64, 65,
/* 350 */ 84, 35, 36, 82, 71, 72, 73, 74, 75, 141, /* 350 */ 66, 84, 35, 36, 82, 71, 72, 73, 74, 75,
/* 360 */ 100, 207, 102, 103, 78, 205, 199, 107, 199, 119, /* 360 */ 122, 100, 122, 102, 103, 246, 276, 241, 107, 250,
/* 370 */ 120, 111, 212, 113, 114, 199, 126, 199, 199, 146, /* 370 */ 119, 120, 111, 201, 113, 114, 201, 126, 201, 246,
/* 380 */ 5, 148, 7, 150, 151, 119, 120, 199, 80, 272, /* 380 */ 146, 201, 148, 250, 150, 151, 119, 120, 119, 201,
/* 390 */ 199, 274, 126, 15, 240, 241, 242, 243, 210, 84, /* 390 */ 274, 201, 276, 126, 146, 201, 148, 201, 150, 151,
/* 400 */ 92, 210, 146, 88, 148, 199, 150, 151, 64, 65, /* 400 */ 201, 201, 212, 201, 207, 80, 78, 209, 207, 205,
/* 410 */ 66, 244, 99, 244, 207, 248, 210, 248, 203, 204, /* 410 */ 206, 214, 212, 99, 212, 214, 268, 92, 246, 99,
/* 420 */ 244, 135, 244, 244, 248, 85, 248, 248, 67, 68, /* 420 */ 126, 246, 250, 246, 207, 250, 246, 250, 210, 211,
/* 430 */ 69, 85, 85, 118, 99, 119, 120, 85, 125, 99, /* 430 */ 250, 214, 99, 252, 246, 251, 119, 120, 250, 125,
/* 440 */ 85, 85, 85, 126, 85, 85, 266, 85, 241, 85, /* 440 */ 246, 243, 246, 85, 250, 246, 250, 266, 85, 250,
/* 450 */ 84, 99, 85, 85, 99, 99, 99, 62, 99, 99, /* 450 */ 85, 85, 85, 1, 85, 85, 85, 99, 62, 85,
/* 460 */ 84, 99, 85, 99, 80, 81, 99, 99, 122, 122, /* 460 */ 84, 141, 99, 135, 99, 99, 99, 85, 99, 99,
/* 470 */ 147, 147, 149, 149, 139, 147, 99, 149, 5, 84, /* 470 */ 99, 85, 139, 99, 85, 84, 147, 147, 149, 149,
/* 480 */ 7, 199, 5, 117, 7, 147, 147, 149, 149, 147, /* 480 */ 84, 99, 147, 268, 149, 99, 201, 5, 99, 7,
/* 490 */ 266, 149, 116, 239, 266, 266, 266, 119, 266, 199, /* 490 */ 5, 39, 7, 117, 147, 147, 149, 149, 147, 268,
/* 500 */ 266, 126, 266, 266, 266, 266, 239, 266, 266, 266, /* 500 */ 149, 80, 81, 268, 268, 268, 251, 116, 201, 241,
/* 510 */ 266, 266, 266, 266, 249, 239, 239, 239, 239, 239, /* 510 */ 201, 268, 268, 268, 268, 268, 241, 241, 241, 241,
/* 520 */ 199, 199, 247, 265, 199, 199, 199, 62, 247, 199, /* 520 */ 241, 267, 201, 201, 201, 201, 277, 201, 201, 249,
/* 530 */ 199, 199, 247, 199, 275, 251, 275, 201, 201, 270, /* 530 */ 249, 62, 201, 277, 272, 253, 249, 201, 201, 201,
/* 540 */ 199, 91, 199, 270, 199, 255, 259, 199, 199, 199, /* 540 */ 201, 201, 201, 201, 201, 201, 201, 201, 126, 263,
/* 550 */ 199, 126, 199, 199, 262, 261, 260, 199, 270, 270, /* 550 */ 201, 201, 264, 201, 201, 201, 201, 201, 201, 140,
/* 560 */ 136, 133, 199, 258, 199, 138, 140, 137, 199, 199, /* 560 */ 201, 201, 201, 201, 272, 201, 138, 272, 272, 201,
/* 570 */ 199, 199, 199, 199, 131, 257, 130, 129, 199, 199, /* 570 */ 133, 137, 262, 201, 201, 136, 201, 261, 201, 201,
/* 580 */ 199, 199, 199, 132, 199, 199, 199, 199, 199, 199, /* 580 */ 201, 201, 201, 130, 201, 201, 201, 131, 201, 201,
/* 590 */ 199, 199, 199, 199, 142, 199, 199, 199, 199, 199, /* 590 */ 129, 201, 260, 201, 201, 201, 201, 132, 201, 201,
/* 600 */ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, /* 600 */ 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
/* 610 */ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, /* 610 */ 201, 201, 201, 201, 142, 91, 203, 203, 203, 203,
/* 620 */ 115, 98, 201, 201, 201, 97, 53, 94, 96, 57, /* 620 */ 203, 115, 53, 98, 97, 94, 96, 203, 57, 203,
/* 630 */ 95, 93, 86, 5, 201, 201, 201, 155, 5, 5, /* 630 */ 203, 95, 93, 86, 5, 155, 5, 5, 203, 155,
/* 640 */ 155, 201, 201, 5, 5, 102, 207, 211, 211, 207, /* 640 */ 5, 203, 209, 213, 213, 209, 5, 102, 144, 101,
/* 650 */ 101, 144, 122, 117, 84, 99, 85, 123, 84, 99, /* 650 */ 203, 122, 117, 203, 84, 123, 99, 85, 204, 216,
/* 660 */ 201, 201, 201, 218, 220, 216, 219, 214, 202, 213, /* 660 */ 203, 220, 222, 221, 219, 217, 215, 218, 204, 203,
/* 670 */ 215, 217, 202, 202, 202, 201, 238, 201, 203, 201, /* 670 */ 224, 204, 240, 210, 204, 84, 203, 259, 258, 203,
/* 680 */ 222, 85, 84, 252, 85, 256, 254, 208, 84, 99, /* 680 */ 257, 256, 205, 254, 240, 99, 85, 84, 99, 85,
/* 690 */ 85, 84, 1, 85, 84, 238, 84, 134, 134, 99, /* 690 */ 84, 1, 85, 84, 99, 85, 84, 84, 134, 99,
/* 700 */ 99, 84, 84, 117, 84, 118, 80, 72, 89, 88, /* 700 */ 134, 84, 84, 84, 117, 80, 118, 5, 72, 89,
/* 710 */ 5, 89, 88, 9, 5, 5, 5, 5, 5, 5, /* 710 */ 88, 5, 89, 9, 88, 5, 5, 5, 5, 5,
/* 720 */ 5, 15, 80, 87, 84, 119, 85, 84, 26, 61, /* 720 */ 5, 87, 15, 80, 84, 26, 61, 85, 84, 149,
/* 730 */ 149, 149, 16, 16, 149, 5, 99, 149, 5, 85, /* 730 */ 119, 149, 16, 16, 149, 5, 99, 5, 85, 149,
/* 740 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 740 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 750 */ 5, 5, 5, 5, 5, 99, 87, 62, 0, 278, /* 750 */ 5, 5, 5, 5, 5, 99, 87, 62, 0, 280,
/* 760 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 760 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 770 */ 278, 21, 21, 278, 278, 278, 278, 278, 278, 278, /* 770 */ 280, 21, 21, 280, 280, 280, 280, 280, 280, 280,
/* 780 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 780 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 790 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 790 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 800 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 800 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 810 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 810 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 820 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 820 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 830 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 830 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 840 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 840 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 850 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 850 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 860 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 860 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 870 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 870 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 880 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 880 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 890 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 890 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 900 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 900 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 910 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 910 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 920 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 920 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 930 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 930 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 940 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 940 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 950 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 950 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 960 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 960 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
/* 970 */ 280,
}; };
#define YY_SHIFT_COUNT (367) #define YY_SHIFT_COUNT (367)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (758) #define YY_SHIFT_MAX (758)
static const unsigned short int yy_shift_ofst[] = { static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 186, 113, 113, 260, 260, 98, 250, 266, 266, 193, /* 0 */ 187, 113, 113, 261, 261, 25, 251, 267, 267, 150,
/* 10 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 10 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 20 */ 23, 23, 23, 0, 122, 266, 316, 316, 316, 9, /* 20 */ 23, 23, 23, 0, 122, 267, 317, 317, 317, 9,
/* 30 */ 9, 23, 23, 18, 23, 78, 23, 23, 23, 23, /* 30 */ 9, 23, 23, 18, 23, 78, 23, 23, 23, 23,
/* 40 */ 308, 98, 112, 112, 61, 773, 773, 773, 266, 266, /* 40 */ 325, 25, 110, 110, 48, 773, 773, 773, 267, 267,
/* 50 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 50 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
/* 60 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 60 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
/* 70 */ 316, 316, 316, 2, 2, 2, 2, 2, 2, 2, /* 70 */ 317, 317, 317, 2, 2, 2, 2, 2, 2, 2,
/* 80 */ 23, 23, 23, 64, 23, 23, 23, 9, 9, 23, /* 80 */ 23, 23, 23, 64, 23, 23, 23, 9, 9, 23,
/* 90 */ 23, 23, 23, 286, 286, 313, 9, 23, 23, 23, /* 90 */ 23, 23, 23, 328, 328, 314, 9, 23, 23, 23,
/* 100 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 100 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 110 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 110 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 120 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 120 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 130 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 130 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 140 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, /* 140 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
/* 150 */ 23, 23, 23, 23, 23, 23, 465, 465, 465, 425, /* 150 */ 23, 23, 23, 23, 23, 23, 469, 469, 469, 422,
/* 160 */ 425, 425, 425, 465, 465, 427, 426, 428, 430, 424, /* 160 */ 422, 422, 422, 469, 469, 428, 419, 437, 434, 439,
/* 170 */ 443, 446, 448, 451, 452, 465, 465, 465, 450, 450, /* 170 */ 456, 453, 461, 465, 472, 469, 469, 469, 524, 524,
/* 180 */ 505, 98, 98, 465, 465, 523, 528, 573, 533, 532, /* 180 */ 506, 25, 25, 469, 469, 525, 527, 569, 531, 530,
/* 190 */ 572, 535, 538, 505, 61, 465, 465, 546, 546, 465, /* 190 */ 571, 536, 539, 506, 48, 469, 469, 547, 547, 469,
/* 200 */ 546, 465, 546, 465, 465, 773, 773, 29, 69, 69, /* 200 */ 547, 469, 547, 469, 469, 773, 773, 29, 69, 69,
/* 210 */ 99, 69, 127, 170, 240, 252, 252, 252, 252, 252, /* 210 */ 99, 69, 127, 170, 241, 253, 253, 253, 253, 253,
/* 220 */ 252, 271, 283, 40, 40, 40, 40, 233, 256, 156, /* 220 */ 253, 272, 284, 40, 40, 40, 40, 234, 248, 50,
/* 230 */ 315, 257, 257, 317, 375, 361, 344, 340, 346, 347, /* 230 */ 167, 191, 191, 153, 294, 242, 263, 358, 238, 240,
/* 240 */ 352, 355, 356, 218, 335, 357, 359, 360, 362, 364, /* 240 */ 363, 365, 366, 320, 333, 367, 369, 370, 371, 374,
/* 250 */ 366, 367, 368, 227, 395, 378, 377, 323, 324, 328, /* 250 */ 376, 382, 386, 452, 396, 269, 389, 329, 330, 335,
/* 260 */ 473, 477, 338, 339, 376, 342, 384, 628, 482, 633, /* 260 */ 482, 485, 347, 348, 391, 351, 421, 629, 480, 631,
/* 270 */ 634, 485, 638, 639, 543, 549, 507, 530, 536, 570, /* 270 */ 632, 484, 635, 641, 545, 548, 504, 529, 535, 570,
/* 280 */ 534, 571, 574, 556, 560, 596, 598, 599, 604, 605, /* 280 */ 532, 572, 591, 557, 586, 601, 603, 604, 606, 607,
/* 290 */ 590, 607, 608, 610, 691, 612, 600, 563, 601, 564, /* 290 */ 589, 609, 610, 612, 690, 613, 595, 564, 600, 566,
/* 300 */ 617, 536, 618, 586, 620, 587, 626, 619, 621, 635, /* 300 */ 617, 535, 618, 587, 619, 588, 625, 620, 622, 636,
/* 310 */ 705, 622, 624, 704, 709, 710, 711, 712, 713, 714, /* 310 */ 702, 623, 626, 704, 706, 710, 711, 712, 713, 714,
/* 320 */ 715, 636, 706, 642, 640, 641, 606, 643, 702, 668, /* 320 */ 715, 634, 707, 643, 640, 642, 611, 644, 699, 665,
/* 330 */ 716, 581, 582, 637, 637, 637, 637, 717, 585, 588, /* 330 */ 716, 580, 582, 637, 637, 637, 637, 717, 585, 590,
/* 340 */ 637, 637, 637, 730, 733, 654, 637, 735, 736, 737, /* 340 */ 637, 637, 637, 730, 732, 653, 637, 735, 736, 737,
/* 350 */ 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, /* 350 */ 738, 739, 740, 741, 742, 743, 744, 745, 746, 747,
/* 360 */ 748, 749, 656, 669, 750, 751, 695, 758, /* 360 */ 748, 749, 656, 669, 750, 751, 695, 758,
}; };
#define YY_REDUCE_COUNT (206) #define YY_REDUCE_COUNT (206)
#define YY_REDUCE_MIN (-266) #define YY_REDUCE_MIN (-268)
#define YY_REDUCE_MAX (479) #define YY_REDUCE_MAX (477)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -186, 10, 10, -163, -163, 154, -159, -5, 42, -168, /* 0 */ -188, 10, 10, -165, -165, 53, -161, -1, 65, -170,
/* 10 */ -112, -115, 117, -41, 30, 51, 84, 95, 167, 169, /* 10 */ -114, -17, 116, 119, 133, 172, 175, 177, 180, 188,
/* 20 */ 176, 178, 179, -195, -197, -258, -239, -201, -143, -229, /* 20 */ 194, 196, 199, -197, -199, -260, -241, -203, -145, -231,
/* 30 */ -130, -62, 59, -238, -57, 47, 188, 191, 206, -88, /* 30 */ -132, -64, 90, -240, -59, -44, 190, 200, 202, 27,
/* 40 */ 48, 207, 115, 160, 119, -99, 22, 215, -266, -261, /* 40 */ 197, 198, 201, 217, 117, 181, 218, 204, -268, -263,
/* 50 */ -213, -58, 180, 224, 228, 229, 230, 232, 234, 236, /* 50 */ -202, -184, -107, -60, -39, -14, 7, 32, 74, 148,
/* 60 */ 237, 238, 239, 241, 242, 243, 244, 245, 246, 247, /* 60 */ 215, 231, 235, 236, 237, 243, 244, 245, 246, 247,
/* 70 */ 27, 35, 265, 254, 267, 276, 277, 278, 279, 280, /* 70 */ 70, 184, 255, 126, 268, 275, 276, 277, 278, 279,
/* 80 */ 282, 300, 321, 258, 322, 325, 326, 275, 281, 327, /* 80 */ 285, 307, 309, 254, 321, 322, 323, 280, 281, 324,
/* 90 */ 330, 331, 332, 259, 261, 284, 285, 334, 341, 343, /* 90 */ 326, 327, 331, 249, 256, 282, 287, 336, 337, 338,
/* 100 */ 345, 348, 349, 350, 351, 353, 354, 358, 363, 365, /* 100 */ 339, 340, 341, 342, 343, 344, 345, 346, 349, 350,
/* 110 */ 369, 370, 371, 372, 373, 374, 379, 380, 381, 382, /* 110 */ 352, 353, 354, 355, 356, 357, 359, 360, 361, 362,
/* 120 */ 383, 385, 386, 387, 388, 389, 390, 391, 392, 393, /* 120 */ 364, 368, 372, 373, 375, 377, 378, 379, 380, 381,
/* 130 */ 394, 396, 397, 398, 399, 400, 401, 402, 403, 404, /* 130 */ 383, 384, 385, 387, 388, 390, 392, 393, 394, 395,
/* 140 */ 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, /* 140 */ 397, 398, 399, 400, 401, 402, 403, 404, 405, 406,
/* 150 */ 415, 416, 417, 418, 419, 420, 336, 337, 421, 269, /* 150 */ 407, 408, 409, 410, 411, 412, 413, 414, 415, 262,
/* 160 */ 273, 288, 289, 422, 423, 292, 294, 296, 287, 305, /* 160 */ 292, 295, 296, 416, 417, 288, 286, 310, 316, 332,
/* 170 */ 318, 429, 290, 432, 431, 433, 434, 435, 436, 437, /* 170 */ 418, 420, 423, 425, 429, 424, 426, 427, 430, 431,
/* 180 */ 438, 439, 442, 440, 441, 444, 447, 445, 453, 454, /* 180 */ 432, 433, 436, 435, 438, 440, 442, 441, 443, 445,
/* 190 */ 455, 449, 456, 457, 458, 459, 460, 466, 470, 461, /* 190 */ 448, 449, 451, 444, 446, 447, 450, 454, 464, 457,
/* 200 */ 471, 474, 472, 476, 478, 479, 475, /* 200 */ 467, 466, 470, 473, 476, 463, 477,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 870, 994, 933, 1004, 920, 930, 1145, 1145, 1145, 870, /* 0 */ 870, 994, 933, 1004, 920, 930, 1145, 1145, 1145, 870,
...@@ -718,6 +708,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -718,6 +708,7 @@ static const YYCODETYPE yyFallback[] = {
1, /* INSERT => ID */ 1, /* INSERT => ID */
1, /* INTO => ID */ 1, /* INTO => ID */
1, /* VALUES => ID */ 1, /* VALUES => ID */
1, /* FILE => ID */
}; };
#endif /* YYFALLBACK */ #endif /* YYFALLBACK */
...@@ -757,7 +748,6 @@ struct yyParser { ...@@ -757,7 +748,6 @@ struct yyParser {
int yyerrcnt; /* Shifts left before out of the error */ int yyerrcnt; /* Shifts left before out of the error */
#endif #endif
ParseARG_SDECL /* A place to hold %extra_argument */ ParseARG_SDECL /* A place to hold %extra_argument */
ParseCTX_SDECL /* A place to hold %extra_context */
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */ int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */ yyStackEntry *yystack; /* The parser's stack */
...@@ -1002,87 +992,89 @@ static const char *const yyTokenName[] = { ...@@ -1002,87 +992,89 @@ static const char *const yyTokenName[] = {
/* 194 */ "INSERT", /* 194 */ "INSERT",
/* 195 */ "INTO", /* 195 */ "INTO",
/* 196 */ "VALUES", /* 196 */ "VALUES",
/* 197 */ "program", /* 197 */ "FILE",
/* 198 */ "cmd", /* 198 */ "error",
/* 199 */ "ids", /* 199 */ "program",
/* 200 */ "dbPrefix", /* 200 */ "cmd",
/* 201 */ "cpxName", /* 201 */ "ids",
/* 202 */ "ifexists", /* 202 */ "dbPrefix",
/* 203 */ "alter_db_optr", /* 203 */ "cpxName",
/* 204 */ "alter_topic_optr", /* 204 */ "ifexists",
/* 205 */ "acct_optr", /* 205 */ "alter_db_optr",
/* 206 */ "exprlist", /* 206 */ "alter_topic_optr",
/* 207 */ "ifnotexists", /* 207 */ "acct_optr",
/* 208 */ "db_optr", /* 208 */ "exprlist",
/* 209 */ "topic_optr", /* 209 */ "ifnotexists",
/* 210 */ "typename", /* 210 */ "db_optr",
/* 211 */ "bufsize", /* 211 */ "topic_optr",
/* 212 */ "pps", /* 212 */ "typename",
/* 213 */ "tseries", /* 213 */ "bufsize",
/* 214 */ "dbs", /* 214 */ "pps",
/* 215 */ "streams", /* 215 */ "tseries",
/* 216 */ "storage", /* 216 */ "dbs",
/* 217 */ "qtime", /* 217 */ "streams",
/* 218 */ "users", /* 218 */ "storage",
/* 219 */ "conns", /* 219 */ "qtime",
/* 220 */ "state", /* 220 */ "users",
/* 221 */ "intitemlist", /* 221 */ "conns",
/* 222 */ "intitem", /* 222 */ "state",
/* 223 */ "keep", /* 223 */ "intitemlist",
/* 224 */ "cache", /* 224 */ "intitem",
/* 225 */ "replica", /* 225 */ "keep",
/* 226 */ "quorum", /* 226 */ "cache",
/* 227 */ "days", /* 227 */ "replica",
/* 228 */ "minrows", /* 228 */ "quorum",
/* 229 */ "maxrows", /* 229 */ "days",
/* 230 */ "blocks", /* 230 */ "minrows",
/* 231 */ "ctime", /* 231 */ "maxrows",
/* 232 */ "wal", /* 232 */ "blocks",
/* 233 */ "fsync", /* 233 */ "ctime",
/* 234 */ "comp", /* 234 */ "wal",
/* 235 */ "prec", /* 235 */ "fsync",
/* 236 */ "update", /* 236 */ "comp",
/* 237 */ "cachelast", /* 237 */ "prec",
/* 238 */ "partitions", /* 238 */ "update",
/* 239 */ "signed", /* 239 */ "cachelast",
/* 240 */ "create_table_args", /* 240 */ "partitions",
/* 241 */ "create_stable_args", /* 241 */ "signed",
/* 242 */ "create_table_list", /* 242 */ "create_table_args",
/* 243 */ "create_from_stable", /* 243 */ "create_stable_args",
/* 244 */ "columnlist", /* 244 */ "create_table_list",
/* 245 */ "tagitemlist", /* 245 */ "create_from_stable",
/* 246 */ "tagNamelist", /* 246 */ "columnlist",
/* 247 */ "select", /* 247 */ "tagitemlist",
/* 248 */ "column", /* 248 */ "tagNamelist",
/* 249 */ "tagitem", /* 249 */ "select",
/* 250 */ "selcollist", /* 250 */ "column",
/* 251 */ "from", /* 251 */ "tagitem",
/* 252 */ "where_opt", /* 252 */ "selcollist",
/* 253 */ "interval_option", /* 253 */ "from",
/* 254 */ "sliding_opt", /* 254 */ "where_opt",
/* 255 */ "session_option", /* 255 */ "interval_option",
/* 256 */ "windowstate_option", /* 256 */ "sliding_opt",
/* 257 */ "fill_opt", /* 257 */ "session_option",
/* 258 */ "groupby_opt", /* 258 */ "windowstate_option",
/* 259 */ "having_opt", /* 259 */ "fill_opt",
/* 260 */ "orderby_opt", /* 260 */ "groupby_opt",
/* 261 */ "slimit_opt", /* 261 */ "having_opt",
/* 262 */ "limit_opt", /* 262 */ "orderby_opt",
/* 263 */ "union", /* 263 */ "slimit_opt",
/* 264 */ "sclp", /* 264 */ "limit_opt",
/* 265 */ "distinct", /* 265 */ "union",
/* 266 */ "expr", /* 266 */ "sclp",
/* 267 */ "as", /* 267 */ "distinct",
/* 268 */ "tablelist", /* 268 */ "expr",
/* 269 */ "sub", /* 269 */ "as",
/* 270 */ "tmvar", /* 270 */ "tablelist",
/* 271 */ "intervalKey", /* 271 */ "sub",
/* 272 */ "sortlist", /* 272 */ "tmvar",
/* 273 */ "sortitem", /* 273 */ "intervalKey",
/* 274 */ "item", /* 274 */ "sortlist",
/* 275 */ "sortorder", /* 275 */ "sortitem",
/* 276 */ "grouplist", /* 276 */ "item",
/* 277 */ "expritem", /* 277 */ "sortorder",
/* 278 */ "grouplist",
/* 279 */ "expritem",
}; };
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
...@@ -1432,29 +1424,28 @@ static int yyGrowStack(yyParser *p){ ...@@ -1432,29 +1424,28 @@ static int yyGrowStack(yyParser *p){
/* Initialize a new parser that has already been allocated. /* Initialize a new parser that has already been allocated.
*/ */
void ParseInit(void *yypRawParser ParseCTX_PDECL){ void ParseInit(void *yypParser){
yyParser *yypParser = (yyParser*)yypRawParser; yyParser *pParser = (yyParser*)yypParser;
ParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
yypParser->yyhwm = 0; pParser->yyhwm = 0;
#endif #endif
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
yypParser->yytos = NULL; pParser->yytos = NULL;
yypParser->yystack = NULL; pParser->yystack = NULL;
yypParser->yystksz = 0; pParser->yystksz = 0;
if( yyGrowStack(yypParser) ){ if( yyGrowStack(pParser) ){
yypParser->yystack = &yypParser->yystk0; pParser->yystack = &pParser->yystk0;
yypParser->yystksz = 1; pParser->yystksz = 1;
} }
#endif #endif
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1; pParser->yyerrcnt = -1;
#endif #endif
yypParser->yytos = yypParser->yystack; pParser->yytos = pParser->yystack;
yypParser->yystack[0].stateno = 0; pParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0; pParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1];
#endif #endif
} }
...@@ -1471,14 +1462,11 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){ ...@@ -1471,14 +1462,11 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){
** A pointer to a parser. This pointer is used in subsequent calls ** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree. ** to Parse and ParseFree.
*/ */
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){
yyParser *yypParser; yyParser *pParser;
yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
if( yypParser ){ if( pParser ) ParseInit(pParser);
ParseCTX_STORE return pParser;
ParseInit(yypParser ParseCTX_PARAM);
}
return (void*)yypParser;
} }
#endif /* Parse_ENGINEALWAYSONSTACK */ #endif /* Parse_ENGINEALWAYSONSTACK */
...@@ -1495,8 +1483,7 @@ static void yy_destructor( ...@@ -1495,8 +1483,7 @@ static void yy_destructor(
YYCODETYPE yymajor, /* Type code for object to destroy */ YYCODETYPE yymajor, /* Type code for object to destroy */
YYMINORTYPE *yypminor /* The object to be destroyed */ YYMINORTYPE *yypminor /* The object to be destroyed */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
switch( yymajor ){ switch( yymajor ){
/* Here is inserted the actions which take place when a /* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen ** terminal or non-terminal is destroyed. This can happen
...@@ -1509,60 +1496,60 @@ static void yy_destructor( ...@@ -1509,60 +1496,60 @@ static void yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 206: /* exprlist */ case 208: /* exprlist */
case 250: /* selcollist */ case 252: /* selcollist */
case 264: /* sclp */ case 266: /* sclp */
{ {
tSqlExprListDestroy((yypminor->yy421)); tSqlExprListDestroy((yypminor->yy221));
} }
break; break;
case 221: /* intitemlist */ case 223: /* intitemlist */
case 223: /* keep */ case 225: /* keep */
case 244: /* columnlist */ case 246: /* columnlist */
case 245: /* tagitemlist */ case 247: /* tagitemlist */
case 246: /* tagNamelist */ case 248: /* tagNamelist */
case 257: /* fill_opt */ case 259: /* fill_opt */
case 258: /* groupby_opt */ case 260: /* groupby_opt */
case 260: /* orderby_opt */ case 262: /* orderby_opt */
case 272: /* sortlist */ case 274: /* sortlist */
case 276: /* grouplist */ case 278: /* grouplist */
{ {
taosArrayDestroy((yypminor->yy421)); taosArrayDestroy((yypminor->yy221));
} }
break; break;
case 242: /* create_table_list */ case 244: /* create_table_list */
{ {
destroyCreateTableSql((yypminor->yy438)); destroyCreateTableSql((yypminor->yy102));
} }
break; break;
case 247: /* select */ case 249: /* select */
{ {
destroySqlNode((yypminor->yy56)); destroySqlNode((yypminor->yy376));
} }
break; break;
case 251: /* from */ case 253: /* from */
case 268: /* tablelist */ case 270: /* tablelist */
case 269: /* sub */ case 271: /* sub */
{ {
destroyRelationInfo((yypminor->yy8)); destroyRelationInfo((yypminor->yy164));
} }
break; break;
case 252: /* where_opt */ case 254: /* where_opt */
case 259: /* having_opt */ case 261: /* having_opt */
case 266: /* expr */ case 268: /* expr */
case 277: /* expritem */ case 279: /* expritem */
{ {
tSqlExprDestroy((yypminor->yy439)); tSqlExprDestroy((yypminor->yy146));
} }
break; break;
case 263: /* union */ case 265: /* union */
{ {
destroyAllSqlNode((yypminor->yy421)); destroyAllSqlNode((yypminor->yy221));
} }
break; break;
case 273: /* sortitem */ case 275: /* sortitem */
{ {
tVariantDestroy(&(yypminor->yy430)); tVariantDestroy(&(yypminor->yy106));
} }
break; break;
/********* End destructor definitions *****************************************/ /********* End destructor definitions *****************************************/
...@@ -1674,11 +1661,12 @@ int ParseCoverage(FILE *out){ ...@@ -1674,11 +1661,12 @@ int ParseCoverage(FILE *out){
** Find the appropriate action for a parser given the terminal ** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static YYACTIONTYPE yy_find_shift_action( static unsigned int yy_find_shift_action(
YYCODETYPE iLookAhead, /* The look-ahead token */ yyParser *pParser, /* The parser */
YYACTIONTYPE stateno /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
int stateno = pParser->yytos->stateno;
if( stateno>YY_MAX_SHIFT ) return stateno; if( stateno>YY_MAX_SHIFT ) return stateno;
assert( stateno <= YY_SHIFT_COUNT ); assert( stateno <= YY_SHIFT_COUNT );
...@@ -1687,19 +1675,15 @@ static YYACTIONTYPE yy_find_shift_action( ...@@ -1687,19 +1675,15 @@ static YYACTIONTYPE yy_find_shift_action(
#endif #endif
do{ do{
i = yy_shift_ofst[stateno]; i = yy_shift_ofst[stateno];
assert( i>=0 ); assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) );
assert( i<=YY_ACTTAB_COUNT );
assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN ); assert( iLookAhead < YYNTOKEN );
i += iLookAhead; i += iLookAhead;
assert( i<(int)YY_NLOOKAHEAD );
if( yy_lookahead[i]!=iLookAhead ){ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK #ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */ YYCODETYPE iFallback; /* Fallback token */
assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) ); if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
iFallback = yyFallback[iLookAhead]; && (iFallback = yyFallback[iLookAhead])!=0 ){
if( iFallback!=0 ){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
...@@ -1714,8 +1698,15 @@ static YYACTIONTYPE yy_find_shift_action( ...@@ -1714,8 +1698,15 @@ static YYACTIONTYPE yy_find_shift_action(
#ifdef YYWILDCARD #ifdef YYWILDCARD
{ {
int j = i - iLookAhead + YYWILDCARD; int j = i - iLookAhead + YYWILDCARD;
assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); if(
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
...@@ -1729,7 +1720,6 @@ static YYACTIONTYPE yy_find_shift_action( ...@@ -1729,7 +1720,6 @@ static YYACTIONTYPE yy_find_shift_action(
#endif /* YYWILDCARD */ #endif /* YYWILDCARD */
return yy_default[stateno]; return yy_default[stateno];
}else{ }else{
assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
return yy_action[i]; return yy_action[i];
} }
}while(1); }while(1);
...@@ -1739,8 +1729,8 @@ static YYACTIONTYPE yy_find_shift_action( ...@@ -1739,8 +1729,8 @@ static YYACTIONTYPE yy_find_shift_action(
** Find the appropriate action for a parser given the non-terminal ** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static YYACTIONTYPE yy_find_reduce_action( static int yy_find_reduce_action(
YYACTIONTYPE stateno, /* Current state number */ int stateno, /* Current state number */
YYCODETYPE iLookAhead /* The look-ahead token */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
...@@ -1769,8 +1759,7 @@ static YYACTIONTYPE yy_find_reduce_action( ...@@ -1769,8 +1759,7 @@ static YYACTIONTYPE yy_find_reduce_action(
** The following routine is called if the stack overflows. ** The following routine is called if the stack overflows.
*/ */
static void yyStackOverflow(yyParser *yypParser){ static void yyStackOverflow(yyParser *yypParser){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
...@@ -1781,8 +1770,7 @@ static void yyStackOverflow(yyParser *yypParser){ ...@@ -1781,8 +1770,7 @@ static void yyStackOverflow(yyParser *yypParser){
** stack every overflows */ ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/ /******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/ /******** End %stack_overflow code ********************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument var */ ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
ParseCTX_STORE
} }
/* /*
...@@ -1811,8 +1799,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ ...@@ -1811,8 +1799,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
*/ */
static void yy_shift( static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */ yyParser *yypParser, /* The parser to be shifted */
YYACTIONTYPE yyNewState, /* The new state to shift in */ int yyNewState, /* The new state to shift in */
YYCODETYPE yyMajor, /* The major token to shift in */ int yyMajor, /* The major token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */ ParseTOKENTYPE yyMinor /* The minor token to shift in */
){ ){
yyStackEntry *yytos; yyStackEntry *yytos;
...@@ -1842,608 +1830,313 @@ static void yy_shift( ...@@ -1842,608 +1830,313 @@ static void yy_shift(
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
} }
yytos = yypParser->yytos; yytos = yypParser->yytos;
yytos->stateno = yyNewState; yytos->stateno = (YYACTIONTYPE)yyNewState;
yytos->major = yyMajor; yytos->major = (YYCODETYPE)yyMajor;
yytos->minor.yy0 = yyMinor; yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift"); yyTraceShift(yypParser, yyNewState, "Shift");
} }
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side /* The following table contains information about every rule that
** of that rule */ ** is used during the reduce.
static const YYCODETYPE yyRuleInfoLhs[] = { */
197, /* (0) program ::= cmd */ static const struct {
198, /* (1) cmd ::= SHOW DATABASES */ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
198, /* (2) cmd ::= SHOW TOPICS */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */
198, /* (3) cmd ::= SHOW FUNCTIONS */ } yyRuleInfo[] = {
198, /* (4) cmd ::= SHOW MNODES */ { 199, -1 }, /* (0) program ::= cmd */
198, /* (5) cmd ::= SHOW DNODES */ { 200, -2 }, /* (1) cmd ::= SHOW DATABASES */
198, /* (6) cmd ::= SHOW ACCOUNTS */ { 200, -2 }, /* (2) cmd ::= SHOW TOPICS */
198, /* (7) cmd ::= SHOW USERS */ { 200, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */
198, /* (8) cmd ::= SHOW MODULES */ { 200, -2 }, /* (4) cmd ::= SHOW MNODES */
198, /* (9) cmd ::= SHOW QUERIES */ { 200, -2 }, /* (5) cmd ::= SHOW DNODES */
198, /* (10) cmd ::= SHOW CONNECTIONS */ { 200, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */
198, /* (11) cmd ::= SHOW STREAMS */ { 200, -2 }, /* (7) cmd ::= SHOW USERS */
198, /* (12) cmd ::= SHOW VARIABLES */ { 200, -2 }, /* (8) cmd ::= SHOW MODULES */
198, /* (13) cmd ::= SHOW SCORES */ { 200, -2 }, /* (9) cmd ::= SHOW QUERIES */
198, /* (14) cmd ::= SHOW GRANTS */ { 200, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */
198, /* (15) cmd ::= SHOW VNODES */ { 200, -2 }, /* (11) cmd ::= SHOW STREAMS */
198, /* (16) cmd ::= SHOW VNODES ids */ { 200, -2 }, /* (12) cmd ::= SHOW VARIABLES */
200, /* (17) dbPrefix ::= */ { 200, -2 }, /* (13) cmd ::= SHOW SCORES */
200, /* (18) dbPrefix ::= ids DOT */ { 200, -2 }, /* (14) cmd ::= SHOW GRANTS */
201, /* (19) cpxName ::= */ { 200, -2 }, /* (15) cmd ::= SHOW VNODES */
201, /* (20) cpxName ::= DOT ids */ { 200, -3 }, /* (16) cmd ::= SHOW VNODES ids */
198, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ { 202, 0 }, /* (17) dbPrefix ::= */
198, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ { 202, -2 }, /* (18) dbPrefix ::= ids DOT */
198, /* (23) cmd ::= SHOW CREATE DATABASE ids */ { 203, 0 }, /* (19) cpxName ::= */
198, /* (24) cmd ::= SHOW dbPrefix TABLES */ { 203, -2 }, /* (20) cpxName ::= DOT ids */
198, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ { 200, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
198, /* (26) cmd ::= SHOW dbPrefix STABLES */ { 200, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
198, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ { 200, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */
198, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ { 200, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */
198, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ { 200, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
198, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ { 200, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */
198, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ { 200, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
198, /* (32) cmd ::= DROP DATABASE ifexists ids */ { 200, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
198, /* (33) cmd ::= DROP TOPIC ifexists ids */ { 200, -4 }, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
198, /* (34) cmd ::= DROP FUNCTION ids */ { 200, -5 }, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
198, /* (35) cmd ::= DROP DNODE ids */ { 200, -5 }, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
198, /* (36) cmd ::= DROP USER ids */ { 200, -4 }, /* (32) cmd ::= DROP DATABASE ifexists ids */
198, /* (37) cmd ::= DROP ACCOUNT ids */ { 200, -4 }, /* (33) cmd ::= DROP TOPIC ifexists ids */
198, /* (38) cmd ::= USE ids */ { 200, -3 }, /* (34) cmd ::= DROP FUNCTION ids */
198, /* (39) cmd ::= DESCRIBE ids cpxName */ { 200, -3 }, /* (35) cmd ::= DROP DNODE ids */
198, /* (40) cmd ::= DESC ids cpxName */ { 200, -3 }, /* (36) cmd ::= DROP USER ids */
198, /* (41) cmd ::= ALTER USER ids PASS ids */ { 200, -3 }, /* (37) cmd ::= DROP ACCOUNT ids */
198, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ { 200, -2 }, /* (38) cmd ::= USE ids */
198, /* (43) cmd ::= ALTER DNODE ids ids */ { 200, -3 }, /* (39) cmd ::= DESCRIBE ids cpxName */
198, /* (44) cmd ::= ALTER DNODE ids ids ids */ { 200, -3 }, /* (40) cmd ::= DESC ids cpxName */
198, /* (45) cmd ::= ALTER LOCAL ids */ { 200, -5 }, /* (41) cmd ::= ALTER USER ids PASS ids */
198, /* (46) cmd ::= ALTER LOCAL ids ids */ { 200, -5 }, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
198, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ { 200, -4 }, /* (43) cmd ::= ALTER DNODE ids ids */
198, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ { 200, -5 }, /* (44) cmd ::= ALTER DNODE ids ids ids */
198, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ { 200, -3 }, /* (45) cmd ::= ALTER LOCAL ids */
198, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ { 200, -4 }, /* (46) cmd ::= ALTER LOCAL ids ids */
198, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ { 200, -4 }, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
199, /* (52) ids ::= ID */ { 200, -4 }, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
199, /* (53) ids ::= STRING */ { 200, -4 }, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
202, /* (54) ifexists ::= IF EXISTS */ { 200, -6 }, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
202, /* (55) ifexists ::= */ { 200, -6 }, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
207, /* (56) ifnotexists ::= IF NOT EXISTS */ { 201, -1 }, /* (52) ids ::= ID */
207, /* (57) ifnotexists ::= */ { 201, -1 }, /* (53) ids ::= STRING */
198, /* (58) cmd ::= CREATE DNODE ids */ { 204, -2 }, /* (54) ifexists ::= IF EXISTS */
198, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ { 204, 0 }, /* (55) ifexists ::= */
198, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { 209, -3 }, /* (56) ifnotexists ::= IF NOT EXISTS */
198, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ { 209, 0 }, /* (57) ifnotexists ::= */
198, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ { 200, -3 }, /* (58) cmd ::= CREATE DNODE ids */
198, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ { 200, -6 }, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
198, /* (64) cmd ::= CREATE USER ids PASS ids */ { 200, -5 }, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
211, /* (65) bufsize ::= */ { 200, -5 }, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
211, /* (66) bufsize ::= BUFSIZE INTEGER */ { 200, -8 }, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
212, /* (67) pps ::= */ { 200, -9 }, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
212, /* (68) pps ::= PPS INTEGER */ { 200, -5 }, /* (64) cmd ::= CREATE USER ids PASS ids */
213, /* (69) tseries ::= */ { 213, 0 }, /* (65) bufsize ::= */
213, /* (70) tseries ::= TSERIES INTEGER */ { 213, -2 }, /* (66) bufsize ::= BUFSIZE INTEGER */
214, /* (71) dbs ::= */ { 214, 0 }, /* (67) pps ::= */
214, /* (72) dbs ::= DBS INTEGER */ { 214, -2 }, /* (68) pps ::= PPS INTEGER */
215, /* (73) streams ::= */ { 215, 0 }, /* (69) tseries ::= */
215, /* (74) streams ::= STREAMS INTEGER */ { 215, -2 }, /* (70) tseries ::= TSERIES INTEGER */
216, /* (75) storage ::= */ { 216, 0 }, /* (71) dbs ::= */
216, /* (76) storage ::= STORAGE INTEGER */ { 216, -2 }, /* (72) dbs ::= DBS INTEGER */
217, /* (77) qtime ::= */ { 217, 0 }, /* (73) streams ::= */
217, /* (78) qtime ::= QTIME INTEGER */ { 217, -2 }, /* (74) streams ::= STREAMS INTEGER */
218, /* (79) users ::= */ { 218, 0 }, /* (75) storage ::= */
218, /* (80) users ::= USERS INTEGER */ { 218, -2 }, /* (76) storage ::= STORAGE INTEGER */
219, /* (81) conns ::= */ { 219, 0 }, /* (77) qtime ::= */
219, /* (82) conns ::= CONNS INTEGER */ { 219, -2 }, /* (78) qtime ::= QTIME INTEGER */
220, /* (83) state ::= */ { 220, 0 }, /* (79) users ::= */
220, /* (84) state ::= STATE ids */ { 220, -2 }, /* (80) users ::= USERS INTEGER */
205, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { 221, 0 }, /* (81) conns ::= */
221, /* (86) intitemlist ::= intitemlist COMMA intitem */ { 221, -2 }, /* (82) conns ::= CONNS INTEGER */
221, /* (87) intitemlist ::= intitem */ { 222, 0 }, /* (83) state ::= */
222, /* (88) intitem ::= INTEGER */ { 222, -2 }, /* (84) state ::= STATE ids */
223, /* (89) keep ::= KEEP intitemlist */ { 207, -9 }, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
224, /* (90) cache ::= CACHE INTEGER */ { 223, -3 }, /* (86) intitemlist ::= intitemlist COMMA intitem */
225, /* (91) replica ::= REPLICA INTEGER */ { 223, -1 }, /* (87) intitemlist ::= intitem */
226, /* (92) quorum ::= QUORUM INTEGER */ { 224, -1 }, /* (88) intitem ::= INTEGER */
227, /* (93) days ::= DAYS INTEGER */ { 225, -2 }, /* (89) keep ::= KEEP intitemlist */
228, /* (94) minrows ::= MINROWS INTEGER */ { 226, -2 }, /* (90) cache ::= CACHE INTEGER */
229, /* (95) maxrows ::= MAXROWS INTEGER */ { 227, -2 }, /* (91) replica ::= REPLICA INTEGER */
230, /* (96) blocks ::= BLOCKS INTEGER */ { 228, -2 }, /* (92) quorum ::= QUORUM INTEGER */
231, /* (97) ctime ::= CTIME INTEGER */ { 229, -2 }, /* (93) days ::= DAYS INTEGER */
232, /* (98) wal ::= WAL INTEGER */ { 230, -2 }, /* (94) minrows ::= MINROWS INTEGER */
233, /* (99) fsync ::= FSYNC INTEGER */ { 231, -2 }, /* (95) maxrows ::= MAXROWS INTEGER */
234, /* (100) comp ::= COMP INTEGER */ { 232, -2 }, /* (96) blocks ::= BLOCKS INTEGER */
235, /* (101) prec ::= PRECISION STRING */ { 233, -2 }, /* (97) ctime ::= CTIME INTEGER */
236, /* (102) update ::= UPDATE INTEGER */ { 234, -2 }, /* (98) wal ::= WAL INTEGER */
237, /* (103) cachelast ::= CACHELAST INTEGER */ { 235, -2 }, /* (99) fsync ::= FSYNC INTEGER */
238, /* (104) partitions ::= PARTITIONS INTEGER */ { 236, -2 }, /* (100) comp ::= COMP INTEGER */
208, /* (105) db_optr ::= */ { 237, -2 }, /* (101) prec ::= PRECISION STRING */
208, /* (106) db_optr ::= db_optr cache */ { 238, -2 }, /* (102) update ::= UPDATE INTEGER */
208, /* (107) db_optr ::= db_optr replica */ { 239, -2 }, /* (103) cachelast ::= CACHELAST INTEGER */
208, /* (108) db_optr ::= db_optr quorum */ { 240, -2 }, /* (104) partitions ::= PARTITIONS INTEGER */
208, /* (109) db_optr ::= db_optr days */ { 210, 0 }, /* (105) db_optr ::= */
208, /* (110) db_optr ::= db_optr minrows */ { 210, -2 }, /* (106) db_optr ::= db_optr cache */
208, /* (111) db_optr ::= db_optr maxrows */ { 210, -2 }, /* (107) db_optr ::= db_optr replica */
208, /* (112) db_optr ::= db_optr blocks */ { 210, -2 }, /* (108) db_optr ::= db_optr quorum */
208, /* (113) db_optr ::= db_optr ctime */ { 210, -2 }, /* (109) db_optr ::= db_optr days */
208, /* (114) db_optr ::= db_optr wal */ { 210, -2 }, /* (110) db_optr ::= db_optr minrows */
208, /* (115) db_optr ::= db_optr fsync */ { 210, -2 }, /* (111) db_optr ::= db_optr maxrows */
208, /* (116) db_optr ::= db_optr comp */ { 210, -2 }, /* (112) db_optr ::= db_optr blocks */
208, /* (117) db_optr ::= db_optr prec */ { 210, -2 }, /* (113) db_optr ::= db_optr ctime */
208, /* (118) db_optr ::= db_optr keep */ { 210, -2 }, /* (114) db_optr ::= db_optr wal */
208, /* (119) db_optr ::= db_optr update */ { 210, -2 }, /* (115) db_optr ::= db_optr fsync */
208, /* (120) db_optr ::= db_optr cachelast */ { 210, -2 }, /* (116) db_optr ::= db_optr comp */
209, /* (121) topic_optr ::= db_optr */ { 210, -2 }, /* (117) db_optr ::= db_optr prec */
209, /* (122) topic_optr ::= topic_optr partitions */ { 210, -2 }, /* (118) db_optr ::= db_optr keep */
203, /* (123) alter_db_optr ::= */ { 210, -2 }, /* (119) db_optr ::= db_optr update */
203, /* (124) alter_db_optr ::= alter_db_optr replica */ { 210, -2 }, /* (120) db_optr ::= db_optr cachelast */
203, /* (125) alter_db_optr ::= alter_db_optr quorum */ { 211, -1 }, /* (121) topic_optr ::= db_optr */
203, /* (126) alter_db_optr ::= alter_db_optr keep */ { 211, -2 }, /* (122) topic_optr ::= topic_optr partitions */
203, /* (127) alter_db_optr ::= alter_db_optr blocks */ { 205, 0 }, /* (123) alter_db_optr ::= */
203, /* (128) alter_db_optr ::= alter_db_optr comp */ { 205, -2 }, /* (124) alter_db_optr ::= alter_db_optr replica */
203, /* (129) alter_db_optr ::= alter_db_optr update */ { 205, -2 }, /* (125) alter_db_optr ::= alter_db_optr quorum */
203, /* (130) alter_db_optr ::= alter_db_optr cachelast */ { 205, -2 }, /* (126) alter_db_optr ::= alter_db_optr keep */
204, /* (131) alter_topic_optr ::= alter_db_optr */ { 205, -2 }, /* (127) alter_db_optr ::= alter_db_optr blocks */
204, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ { 205, -2 }, /* (128) alter_db_optr ::= alter_db_optr comp */
210, /* (133) typename ::= ids */ { 205, -2 }, /* (129) alter_db_optr ::= alter_db_optr update */
210, /* (134) typename ::= ids LP signed RP */ { 205, -2 }, /* (130) alter_db_optr ::= alter_db_optr cachelast */
210, /* (135) typename ::= ids UNSIGNED */ { 206, -1 }, /* (131) alter_topic_optr ::= alter_db_optr */
239, /* (136) signed ::= INTEGER */ { 206, -2 }, /* (132) alter_topic_optr ::= alter_topic_optr partitions */
239, /* (137) signed ::= PLUS INTEGER */ { 212, -1 }, /* (133) typename ::= ids */
239, /* (138) signed ::= MINUS INTEGER */ { 212, -4 }, /* (134) typename ::= ids LP signed RP */
198, /* (139) cmd ::= CREATE TABLE create_table_args */ { 212, -2 }, /* (135) typename ::= ids UNSIGNED */
198, /* (140) cmd ::= CREATE TABLE create_stable_args */ { 241, -1 }, /* (136) signed ::= INTEGER */
198, /* (141) cmd ::= CREATE STABLE create_stable_args */ { 241, -2 }, /* (137) signed ::= PLUS INTEGER */
198, /* (142) cmd ::= CREATE TABLE create_table_list */ { 241, -2 }, /* (138) signed ::= MINUS INTEGER */
242, /* (143) create_table_list ::= create_from_stable */ { 200, -3 }, /* (139) cmd ::= CREATE TABLE create_table_args */
242, /* (144) create_table_list ::= create_table_list create_from_stable */ { 200, -3 }, /* (140) cmd ::= CREATE TABLE create_stable_args */
240, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { 200, -3 }, /* (141) cmd ::= CREATE STABLE create_stable_args */
241, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { 200, -3 }, /* (142) cmd ::= CREATE TABLE create_table_list */
243, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ { 244, -1 }, /* (143) create_table_list ::= create_from_stable */
243, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ { 244, -2 }, /* (144) create_table_list ::= create_table_list create_from_stable */
246, /* (149) tagNamelist ::= tagNamelist COMMA ids */ { 242, -6 }, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
246, /* (150) tagNamelist ::= ids */ { 243, -10 }, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
240, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ { 245, -10 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
244, /* (152) columnlist ::= columnlist COMMA column */ { 245, -13 }, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
244, /* (153) columnlist ::= column */ { 248, -3 }, /* (149) tagNamelist ::= tagNamelist COMMA ids */
248, /* (154) column ::= ids typename */ { 248, -1 }, /* (150) tagNamelist ::= ids */
245, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ { 242, -5 }, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
245, /* (156) tagitemlist ::= tagitem */ { 246, -3 }, /* (152) columnlist ::= columnlist COMMA column */
249, /* (157) tagitem ::= INTEGER */ { 246, -1 }, /* (153) columnlist ::= column */
249, /* (158) tagitem ::= FLOAT */ { 250, -2 }, /* (154) column ::= ids typename */
249, /* (159) tagitem ::= STRING */ { 247, -3 }, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
249, /* (160) tagitem ::= BOOL */ { 247, -1 }, /* (156) tagitemlist ::= tagitem */
249, /* (161) tagitem ::= NULL */ { 251, -1 }, /* (157) tagitem ::= INTEGER */
249, /* (162) tagitem ::= NOW */ { 251, -1 }, /* (158) tagitem ::= FLOAT */
249, /* (163) tagitem ::= MINUS INTEGER */ { 251, -1 }, /* (159) tagitem ::= STRING */
249, /* (164) tagitem ::= MINUS FLOAT */ { 251, -1 }, /* (160) tagitem ::= BOOL */
249, /* (165) tagitem ::= PLUS INTEGER */ { 251, -1 }, /* (161) tagitem ::= NULL */
249, /* (166) tagitem ::= PLUS FLOAT */ { 251, -1 }, /* (162) tagitem ::= NOW */
247, /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ { 251, -2 }, /* (163) tagitem ::= MINUS INTEGER */
247, /* (168) select ::= LP select RP */ { 251, -2 }, /* (164) tagitem ::= MINUS FLOAT */
263, /* (169) union ::= select */ { 251, -2 }, /* (165) tagitem ::= PLUS INTEGER */
263, /* (170) union ::= union UNION ALL select */ { 251, -2 }, /* (166) tagitem ::= PLUS FLOAT */
198, /* (171) cmd ::= union */ { 249, -14 }, /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
247, /* (172) select ::= SELECT selcollist */ { 249, -3 }, /* (168) select ::= LP select RP */
264, /* (173) sclp ::= selcollist COMMA */ { 265, -1 }, /* (169) union ::= select */
264, /* (174) sclp ::= */ { 265, -4 }, /* (170) union ::= union UNION ALL select */
250, /* (175) selcollist ::= sclp distinct expr as */ { 200, -1 }, /* (171) cmd ::= union */
250, /* (176) selcollist ::= sclp STAR */ { 249, -2 }, /* (172) select ::= SELECT selcollist */
267, /* (177) as ::= AS ids */ { 266, -2 }, /* (173) sclp ::= selcollist COMMA */
267, /* (178) as ::= ids */ { 266, 0 }, /* (174) sclp ::= */
267, /* (179) as ::= */ { 252, -4 }, /* (175) selcollist ::= sclp distinct expr as */
265, /* (180) distinct ::= DISTINCT */ { 252, -2 }, /* (176) selcollist ::= sclp STAR */
265, /* (181) distinct ::= */ { 269, -2 }, /* (177) as ::= AS ids */
251, /* (182) from ::= FROM tablelist */ { 269, -1 }, /* (178) as ::= ids */
251, /* (183) from ::= FROM sub */ { 269, 0 }, /* (179) as ::= */
269, /* (184) sub ::= LP union RP */ { 267, -1 }, /* (180) distinct ::= DISTINCT */
269, /* (185) sub ::= LP union RP ids */ { 267, 0 }, /* (181) distinct ::= */
269, /* (186) sub ::= sub COMMA LP union RP ids */ { 253, -2 }, /* (182) from ::= FROM tablelist */
268, /* (187) tablelist ::= ids cpxName */ { 253, -2 }, /* (183) from ::= FROM sub */
268, /* (188) tablelist ::= ids cpxName ids */ { 271, -3 }, /* (184) sub ::= LP union RP */
268, /* (189) tablelist ::= tablelist COMMA ids cpxName */ { 271, -4 }, /* (185) sub ::= LP union RP ids */
268, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ { 271, -6 }, /* (186) sub ::= sub COMMA LP union RP ids */
270, /* (191) tmvar ::= VARIABLE */ { 270, -2 }, /* (187) tablelist ::= ids cpxName */
253, /* (192) interval_option ::= intervalKey LP tmvar RP */ { 270, -3 }, /* (188) tablelist ::= ids cpxName ids */
253, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ { 270, -4 }, /* (189) tablelist ::= tablelist COMMA ids cpxName */
253, /* (194) interval_option ::= */ { 270, -5 }, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
271, /* (195) intervalKey ::= INTERVAL */ { 272, -1 }, /* (191) tmvar ::= VARIABLE */
271, /* (196) intervalKey ::= EVERY */ { 255, -4 }, /* (192) interval_option ::= intervalKey LP tmvar RP */
255, /* (197) session_option ::= */ { 255, -6 }, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
255, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { 255, 0 }, /* (194) interval_option ::= */
256, /* (199) windowstate_option ::= */ { 273, -1 }, /* (195) intervalKey ::= INTERVAL */
256, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ { 273, -1 }, /* (196) intervalKey ::= EVERY */
257, /* (201) fill_opt ::= */ { 257, 0 }, /* (197) session_option ::= */
257, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { 257, -7 }, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
257, /* (203) fill_opt ::= FILL LP ID RP */ { 258, 0 }, /* (199) windowstate_option ::= */
254, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ { 258, -4 }, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */
254, /* (205) sliding_opt ::= */ { 259, 0 }, /* (201) fill_opt ::= */
260, /* (206) orderby_opt ::= */ { 259, -6 }, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
260, /* (207) orderby_opt ::= ORDER BY sortlist */ { 259, -4 }, /* (203) fill_opt ::= FILL LP ID RP */
272, /* (208) sortlist ::= sortlist COMMA item sortorder */ { 256, -4 }, /* (204) sliding_opt ::= SLIDING LP tmvar RP */
272, /* (209) sortlist ::= item sortorder */ { 256, 0 }, /* (205) sliding_opt ::= */
274, /* (210) item ::= ids cpxName */ { 262, 0 }, /* (206) orderby_opt ::= */
275, /* (211) sortorder ::= ASC */ { 262, -3 }, /* (207) orderby_opt ::= ORDER BY sortlist */
275, /* (212) sortorder ::= DESC */ { 274, -4 }, /* (208) sortlist ::= sortlist COMMA item sortorder */
275, /* (213) sortorder ::= */ { 274, -2 }, /* (209) sortlist ::= item sortorder */
258, /* (214) groupby_opt ::= */ { 276, -2 }, /* (210) item ::= ids cpxName */
258, /* (215) groupby_opt ::= GROUP BY grouplist */ { 277, -1 }, /* (211) sortorder ::= ASC */
276, /* (216) grouplist ::= grouplist COMMA item */ { 277, -1 }, /* (212) sortorder ::= DESC */
276, /* (217) grouplist ::= item */ { 277, 0 }, /* (213) sortorder ::= */
259, /* (218) having_opt ::= */ { 260, 0 }, /* (214) groupby_opt ::= */
259, /* (219) having_opt ::= HAVING expr */ { 260, -3 }, /* (215) groupby_opt ::= GROUP BY grouplist */
262, /* (220) limit_opt ::= */ { 278, -3 }, /* (216) grouplist ::= grouplist COMMA item */
262, /* (221) limit_opt ::= LIMIT signed */ { 278, -1 }, /* (217) grouplist ::= item */
262, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ { 261, 0 }, /* (218) having_opt ::= */
262, /* (223) limit_opt ::= LIMIT signed COMMA signed */ { 261, -2 }, /* (219) having_opt ::= HAVING expr */
261, /* (224) slimit_opt ::= */ { 264, 0 }, /* (220) limit_opt ::= */
261, /* (225) slimit_opt ::= SLIMIT signed */ { 264, -2 }, /* (221) limit_opt ::= LIMIT signed */
261, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ { 264, -4 }, /* (222) limit_opt ::= LIMIT signed OFFSET signed */
261, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ { 264, -4 }, /* (223) limit_opt ::= LIMIT signed COMMA signed */
252, /* (228) where_opt ::= */ { 263, 0 }, /* (224) slimit_opt ::= */
252, /* (229) where_opt ::= WHERE expr */ { 263, -2 }, /* (225) slimit_opt ::= SLIMIT signed */
266, /* (230) expr ::= LP expr RP */ { 263, -4 }, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */
266, /* (231) expr ::= ID */ { 263, -4 }, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */
266, /* (232) expr ::= ID DOT ID */ { 254, 0 }, /* (228) where_opt ::= */
266, /* (233) expr ::= ID DOT STAR */ { 254, -2 }, /* (229) where_opt ::= WHERE expr */
266, /* (234) expr ::= INTEGER */ { 268, -3 }, /* (230) expr ::= LP expr RP */
266, /* (235) expr ::= MINUS INTEGER */ { 268, -1 }, /* (231) expr ::= ID */
266, /* (236) expr ::= PLUS INTEGER */ { 268, -3 }, /* (232) expr ::= ID DOT ID */
266, /* (237) expr ::= FLOAT */ { 268, -3 }, /* (233) expr ::= ID DOT STAR */
266, /* (238) expr ::= MINUS FLOAT */ { 268, -1 }, /* (234) expr ::= INTEGER */
266, /* (239) expr ::= PLUS FLOAT */ { 268, -2 }, /* (235) expr ::= MINUS INTEGER */
266, /* (240) expr ::= STRING */ { 268, -2 }, /* (236) expr ::= PLUS INTEGER */
266, /* (241) expr ::= NOW */ { 268, -1 }, /* (237) expr ::= FLOAT */
266, /* (242) expr ::= VARIABLE */ { 268, -2 }, /* (238) expr ::= MINUS FLOAT */
266, /* (243) expr ::= PLUS VARIABLE */ { 268, -2 }, /* (239) expr ::= PLUS FLOAT */
266, /* (244) expr ::= MINUS VARIABLE */ { 268, -1 }, /* (240) expr ::= STRING */
266, /* (245) expr ::= BOOL */ { 268, -1 }, /* (241) expr ::= NOW */
266, /* (246) expr ::= NULL */ { 268, -1 }, /* (242) expr ::= VARIABLE */
266, /* (247) expr ::= ID LP exprlist RP */ { 268, -2 }, /* (243) expr ::= PLUS VARIABLE */
266, /* (248) expr ::= ID LP STAR RP */ { 268, -2 }, /* (244) expr ::= MINUS VARIABLE */
266, /* (249) expr ::= expr IS NULL */ { 268, -1 }, /* (245) expr ::= BOOL */
266, /* (250) expr ::= expr IS NOT NULL */ { 268, -1 }, /* (246) expr ::= NULL */
266, /* (251) expr ::= expr LT expr */ { 268, -4 }, /* (247) expr ::= ID LP exprlist RP */
266, /* (252) expr ::= expr GT expr */ { 268, -4 }, /* (248) expr ::= ID LP STAR RP */
266, /* (253) expr ::= expr LE expr */ { 268, -3 }, /* (249) expr ::= expr IS NULL */
266, /* (254) expr ::= expr GE expr */ { 268, -4 }, /* (250) expr ::= expr IS NOT NULL */
266, /* (255) expr ::= expr NE expr */ { 268, -3 }, /* (251) expr ::= expr LT expr */
266, /* (256) expr ::= expr EQ expr */ { 268, -3 }, /* (252) expr ::= expr GT expr */
266, /* (257) expr ::= expr BETWEEN expr AND expr */ { 268, -3 }, /* (253) expr ::= expr LE expr */
266, /* (258) expr ::= expr AND expr */ { 268, -3 }, /* (254) expr ::= expr GE expr */
266, /* (259) expr ::= expr OR expr */ { 268, -3 }, /* (255) expr ::= expr NE expr */
266, /* (260) expr ::= expr PLUS expr */ { 268, -3 }, /* (256) expr ::= expr EQ expr */
266, /* (261) expr ::= expr MINUS expr */ { 268, -5 }, /* (257) expr ::= expr BETWEEN expr AND expr */
266, /* (262) expr ::= expr STAR expr */ { 268, -3 }, /* (258) expr ::= expr AND expr */
266, /* (263) expr ::= expr SLASH expr */ { 268, -3 }, /* (259) expr ::= expr OR expr */
266, /* (264) expr ::= expr REM expr */ { 268, -3 }, /* (260) expr ::= expr PLUS expr */
266, /* (265) expr ::= expr LIKE expr */ { 268, -3 }, /* (261) expr ::= expr MINUS expr */
266, /* (266) expr ::= expr MATCH expr */ { 268, -3 }, /* (262) expr ::= expr STAR expr */
266, /* (267) expr ::= expr NMATCH expr */ { 268, -3 }, /* (263) expr ::= expr SLASH expr */
266, /* (268) expr ::= expr IN LP exprlist RP */ { 268, -3 }, /* (264) expr ::= expr REM expr */
206, /* (269) exprlist ::= exprlist COMMA expritem */ { 268, -3 }, /* (265) expr ::= expr LIKE expr */
206, /* (270) exprlist ::= expritem */ { 268, -3 }, /* (266) expr ::= expr MATCH expr */
277, /* (271) expritem ::= expr */ { 268, -3 }, /* (267) expr ::= expr NMATCH expr */
277, /* (272) expritem ::= */ { 268, -5 }, /* (268) expr ::= expr IN LP exprlist RP */
198, /* (273) cmd ::= RESET QUERY CACHE */ { 208, -3 }, /* (269) exprlist ::= exprlist COMMA expritem */
198, /* (274) cmd ::= SYNCDB ids REPLICA */ { 208, -1 }, /* (270) exprlist ::= expritem */
198, /* (275) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { 279, -1 }, /* (271) expritem ::= expr */
198, /* (276) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { 279, 0 }, /* (272) expritem ::= */
198, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ { 200, -3 }, /* (273) cmd ::= RESET QUERY CACHE */
198, /* (278) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { 200, -3 }, /* (274) cmd ::= SYNCDB ids REPLICA */
198, /* (279) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { 200, -7 }, /* (275) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
198, /* (280) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { 200, -7 }, /* (276) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
198, /* (281) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { 200, -7 }, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
198, /* (282) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ { 200, -7 }, /* (278) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
198, /* (283) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { 200, -7 }, /* (279) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
198, /* (284) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { 200, -8 }, /* (280) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
198, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ { 200, -9 }, /* (281) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
198, /* (286) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { 200, -7 }, /* (282) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
198, /* (287) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { 200, -7 }, /* (283) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
198, /* (288) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { 200, -7 }, /* (284) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
198, /* (289) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ { 200, -7 }, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
198, /* (290) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ { 200, -7 }, /* (286) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
198, /* (291) cmd ::= KILL CONNECTION INTEGER */ { 200, -7 }, /* (287) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
198, /* (292) cmd ::= KILL STREAM INTEGER COLON INTEGER */ { 200, -8 }, /* (288) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
198, /* (293) cmd ::= KILL QUERY INTEGER COLON INTEGER */ { 200, -9 }, /* (289) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
}; { 200, -7 }, /* (290) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{ 200, -3 }, /* (291) cmd ::= KILL CONNECTION INTEGER */
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number { 200, -5 }, /* (292) cmd ::= KILL STREAM INTEGER COLON INTEGER */
** of symbols on the right-hand side of that rule. */ { 200, -5 }, /* (293) cmd ::= KILL QUERY INTEGER COLON INTEGER */
static const signed char yyRuleInfoNRhs[] = {
-1, /* (0) program ::= cmd */
-2, /* (1) cmd ::= SHOW DATABASES */
-2, /* (2) cmd ::= SHOW TOPICS */
-2, /* (3) cmd ::= SHOW FUNCTIONS */
-2, /* (4) cmd ::= SHOW MNODES */
-2, /* (5) cmd ::= SHOW DNODES */
-2, /* (6) cmd ::= SHOW ACCOUNTS */
-2, /* (7) cmd ::= SHOW USERS */
-2, /* (8) cmd ::= SHOW MODULES */
-2, /* (9) cmd ::= SHOW QUERIES */
-2, /* (10) cmd ::= SHOW CONNECTIONS */
-2, /* (11) cmd ::= SHOW STREAMS */
-2, /* (12) cmd ::= SHOW VARIABLES */
-2, /* (13) cmd ::= SHOW SCORES */
-2, /* (14) cmd ::= SHOW GRANTS */
-2, /* (15) cmd ::= SHOW VNODES */
-3, /* (16) cmd ::= SHOW VNODES ids */
0, /* (17) dbPrefix ::= */
-2, /* (18) dbPrefix ::= ids DOT */
0, /* (19) cpxName ::= */
-2, /* (20) cpxName ::= DOT ids */
-5, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
-5, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
-4, /* (23) cmd ::= SHOW CREATE DATABASE ids */
-3, /* (24) cmd ::= SHOW dbPrefix TABLES */
-5, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
-3, /* (26) cmd ::= SHOW dbPrefix STABLES */
-5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
-3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
-4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
-5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (32) cmd ::= DROP DATABASE ifexists ids */
-4, /* (33) cmd ::= DROP TOPIC ifexists ids */
-3, /* (34) cmd ::= DROP FUNCTION ids */
-3, /* (35) cmd ::= DROP DNODE ids */
-3, /* (36) cmd ::= DROP USER ids */
-3, /* (37) cmd ::= DROP ACCOUNT ids */
-2, /* (38) cmd ::= USE ids */
-3, /* (39) cmd ::= DESCRIBE ids cpxName */
-3, /* (40) cmd ::= DESC ids cpxName */
-5, /* (41) cmd ::= ALTER USER ids PASS ids */
-5, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (43) cmd ::= ALTER DNODE ids ids */
-5, /* (44) cmd ::= ALTER DNODE ids ids ids */
-3, /* (45) cmd ::= ALTER LOCAL ids */
-4, /* (46) cmd ::= ALTER LOCAL ids ids */
-4, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
-4, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-6, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
-1, /* (52) ids ::= ID */
-1, /* (53) ids ::= STRING */
-2, /* (54) ifexists ::= IF EXISTS */
0, /* (55) ifexists ::= */
-3, /* (56) ifnotexists ::= IF NOT EXISTS */
0, /* (57) ifnotexists ::= */
-3, /* (58) cmd ::= CREATE DNODE ids */
-6, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
-8, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-9, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-5, /* (64) cmd ::= CREATE USER ids PASS ids */
0, /* (65) bufsize ::= */
-2, /* (66) bufsize ::= BUFSIZE INTEGER */
0, /* (67) pps ::= */
-2, /* (68) pps ::= PPS INTEGER */
0, /* (69) tseries ::= */
-2, /* (70) tseries ::= TSERIES INTEGER */
0, /* (71) dbs ::= */
-2, /* (72) dbs ::= DBS INTEGER */
0, /* (73) streams ::= */
-2, /* (74) streams ::= STREAMS INTEGER */
0, /* (75) storage ::= */
-2, /* (76) storage ::= STORAGE INTEGER */
0, /* (77) qtime ::= */
-2, /* (78) qtime ::= QTIME INTEGER */
0, /* (79) users ::= */
-2, /* (80) users ::= USERS INTEGER */
0, /* (81) conns ::= */
-2, /* (82) conns ::= CONNS INTEGER */
0, /* (83) state ::= */
-2, /* (84) state ::= STATE ids */
-9, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-3, /* (86) intitemlist ::= intitemlist COMMA intitem */
-1, /* (87) intitemlist ::= intitem */
-1, /* (88) intitem ::= INTEGER */
-2, /* (89) keep ::= KEEP intitemlist */
-2, /* (90) cache ::= CACHE INTEGER */
-2, /* (91) replica ::= REPLICA INTEGER */
-2, /* (92) quorum ::= QUORUM INTEGER */
-2, /* (93) days ::= DAYS INTEGER */
-2, /* (94) minrows ::= MINROWS INTEGER */
-2, /* (95) maxrows ::= MAXROWS INTEGER */
-2, /* (96) blocks ::= BLOCKS INTEGER */
-2, /* (97) ctime ::= CTIME INTEGER */
-2, /* (98) wal ::= WAL INTEGER */
-2, /* (99) fsync ::= FSYNC INTEGER */
-2, /* (100) comp ::= COMP INTEGER */
-2, /* (101) prec ::= PRECISION STRING */
-2, /* (102) update ::= UPDATE INTEGER */
-2, /* (103) cachelast ::= CACHELAST INTEGER */
-2, /* (104) partitions ::= PARTITIONS INTEGER */
0, /* (105) db_optr ::= */
-2, /* (106) db_optr ::= db_optr cache */
-2, /* (107) db_optr ::= db_optr replica */
-2, /* (108) db_optr ::= db_optr quorum */
-2, /* (109) db_optr ::= db_optr days */
-2, /* (110) db_optr ::= db_optr minrows */
-2, /* (111) db_optr ::= db_optr maxrows */
-2, /* (112) db_optr ::= db_optr blocks */
-2, /* (113) db_optr ::= db_optr ctime */
-2, /* (114) db_optr ::= db_optr wal */
-2, /* (115) db_optr ::= db_optr fsync */
-2, /* (116) db_optr ::= db_optr comp */
-2, /* (117) db_optr ::= db_optr prec */
-2, /* (118) db_optr ::= db_optr keep */
-2, /* (119) db_optr ::= db_optr update */
-2, /* (120) db_optr ::= db_optr cachelast */
-1, /* (121) topic_optr ::= db_optr */
-2, /* (122) topic_optr ::= topic_optr partitions */
0, /* (123) alter_db_optr ::= */
-2, /* (124) alter_db_optr ::= alter_db_optr replica */
-2, /* (125) alter_db_optr ::= alter_db_optr quorum */
-2, /* (126) alter_db_optr ::= alter_db_optr keep */
-2, /* (127) alter_db_optr ::= alter_db_optr blocks */
-2, /* (128) alter_db_optr ::= alter_db_optr comp */
-2, /* (129) alter_db_optr ::= alter_db_optr update */
-2, /* (130) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (131) alter_topic_optr ::= alter_db_optr */
-2, /* (132) alter_topic_optr ::= alter_topic_optr partitions */
-1, /* (133) typename ::= ids */
-4, /* (134) typename ::= ids LP signed RP */
-2, /* (135) typename ::= ids UNSIGNED */
-1, /* (136) signed ::= INTEGER */
-2, /* (137) signed ::= PLUS INTEGER */
-2, /* (138) signed ::= MINUS INTEGER */
-3, /* (139) cmd ::= CREATE TABLE create_table_args */
-3, /* (140) cmd ::= CREATE TABLE create_stable_args */
-3, /* (141) cmd ::= CREATE STABLE create_stable_args */
-3, /* (142) cmd ::= CREATE TABLE create_table_list */
-1, /* (143) create_table_list ::= create_from_stable */
-2, /* (144) create_table_list ::= create_table_list create_from_stable */
-6, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-13, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
-3, /* (149) tagNamelist ::= tagNamelist COMMA ids */
-1, /* (150) tagNamelist ::= ids */
-5, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (152) columnlist ::= columnlist COMMA column */
-1, /* (153) columnlist ::= column */
-2, /* (154) column ::= ids typename */
-3, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (156) tagitemlist ::= tagitem */
-1, /* (157) tagitem ::= INTEGER */
-1, /* (158) tagitem ::= FLOAT */
-1, /* (159) tagitem ::= STRING */
-1, /* (160) tagitem ::= BOOL */
-1, /* (161) tagitem ::= NULL */
-1, /* (162) tagitem ::= NOW */
-2, /* (163) tagitem ::= MINUS INTEGER */
-2, /* (164) tagitem ::= MINUS FLOAT */
-2, /* (165) tagitem ::= PLUS INTEGER */
-2, /* (166) tagitem ::= PLUS FLOAT */
-14, /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
-3, /* (168) select ::= LP select RP */
-1, /* (169) union ::= select */
-4, /* (170) union ::= union UNION ALL select */
-1, /* (171) cmd ::= union */
-2, /* (172) select ::= SELECT selcollist */
-2, /* (173) sclp ::= selcollist COMMA */
0, /* (174) sclp ::= */
-4, /* (175) selcollist ::= sclp distinct expr as */
-2, /* (176) selcollist ::= sclp STAR */
-2, /* (177) as ::= AS ids */
-1, /* (178) as ::= ids */
0, /* (179) as ::= */
-1, /* (180) distinct ::= DISTINCT */
0, /* (181) distinct ::= */
-2, /* (182) from ::= FROM tablelist */
-2, /* (183) from ::= FROM sub */
-3, /* (184) sub ::= LP union RP */
-4, /* (185) sub ::= LP union RP ids */
-6, /* (186) sub ::= sub COMMA LP union RP ids */
-2, /* (187) tablelist ::= ids cpxName */
-3, /* (188) tablelist ::= ids cpxName ids */
-4, /* (189) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (191) tmvar ::= VARIABLE */
-4, /* (192) interval_option ::= intervalKey LP tmvar RP */
-6, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
0, /* (194) interval_option ::= */
-1, /* (195) intervalKey ::= INTERVAL */
-1, /* (196) intervalKey ::= EVERY */
0, /* (197) session_option ::= */
-7, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
0, /* (199) windowstate_option ::= */
-4, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */
0, /* (201) fill_opt ::= */
-6, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (203) fill_opt ::= FILL LP ID RP */
-4, /* (204) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (205) sliding_opt ::= */
0, /* (206) orderby_opt ::= */
-3, /* (207) orderby_opt ::= ORDER BY sortlist */
-4, /* (208) sortlist ::= sortlist COMMA item sortorder */
-2, /* (209) sortlist ::= item sortorder */
-2, /* (210) item ::= ids cpxName */
-1, /* (211) sortorder ::= ASC */
-1, /* (212) sortorder ::= DESC */
0, /* (213) sortorder ::= */
0, /* (214) groupby_opt ::= */
-3, /* (215) groupby_opt ::= GROUP BY grouplist */
-3, /* (216) grouplist ::= grouplist COMMA item */
-1, /* (217) grouplist ::= item */
0, /* (218) having_opt ::= */
-2, /* (219) having_opt ::= HAVING expr */
0, /* (220) limit_opt ::= */
-2, /* (221) limit_opt ::= LIMIT signed */
-4, /* (222) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (223) limit_opt ::= LIMIT signed COMMA signed */
0, /* (224) slimit_opt ::= */
-2, /* (225) slimit_opt ::= SLIMIT signed */
-4, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (228) where_opt ::= */
-2, /* (229) where_opt ::= WHERE expr */
-3, /* (230) expr ::= LP expr RP */
-1, /* (231) expr ::= ID */
-3, /* (232) expr ::= ID DOT ID */
-3, /* (233) expr ::= ID DOT STAR */
-1, /* (234) expr ::= INTEGER */
-2, /* (235) expr ::= MINUS INTEGER */
-2, /* (236) expr ::= PLUS INTEGER */
-1, /* (237) expr ::= FLOAT */
-2, /* (238) expr ::= MINUS FLOAT */
-2, /* (239) expr ::= PLUS FLOAT */
-1, /* (240) expr ::= STRING */
-1, /* (241) expr ::= NOW */
-1, /* (242) expr ::= VARIABLE */
-2, /* (243) expr ::= PLUS VARIABLE */
-2, /* (244) expr ::= MINUS VARIABLE */
-1, /* (245) expr ::= BOOL */
-1, /* (246) expr ::= NULL */
-4, /* (247) expr ::= ID LP exprlist RP */
-4, /* (248) expr ::= ID LP STAR RP */
-3, /* (249) expr ::= expr IS NULL */
-4, /* (250) expr ::= expr IS NOT NULL */
-3, /* (251) expr ::= expr LT expr */
-3, /* (252) expr ::= expr GT expr */
-3, /* (253) expr ::= expr LE expr */
-3, /* (254) expr ::= expr GE expr */
-3, /* (255) expr ::= expr NE expr */
-3, /* (256) expr ::= expr EQ expr */
-5, /* (257) expr ::= expr BETWEEN expr AND expr */
-3, /* (258) expr ::= expr AND expr */
-3, /* (259) expr ::= expr OR expr */
-3, /* (260) expr ::= expr PLUS expr */
-3, /* (261) expr ::= expr MINUS expr */
-3, /* (262) expr ::= expr STAR expr */
-3, /* (263) expr ::= expr SLASH expr */
-3, /* (264) expr ::= expr REM expr */
-3, /* (265) expr ::= expr LIKE expr */
-3, /* (266) expr ::= expr MATCH expr */
-3, /* (267) expr ::= expr NMATCH expr */
-5, /* (268) expr ::= expr IN LP exprlist RP */
-3, /* (269) exprlist ::= exprlist COMMA expritem */
-1, /* (270) exprlist ::= expritem */
-1, /* (271) expritem ::= expr */
0, /* (272) expritem ::= */
-3, /* (273) cmd ::= RESET QUERY CACHE */
-3, /* (274) cmd ::= SYNCDB ids REPLICA */
-7, /* (275) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (276) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (277) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (278) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (279) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (280) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (281) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (282) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
-7, /* (283) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (284) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (285) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (286) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (287) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (288) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-9, /* (289) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (290) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
-3, /* (291) cmd ::= KILL CONNECTION INTEGER */
-5, /* (292) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (293) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -2458,34 +2151,30 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ...@@ -2458,34 +2151,30 @@ static void yy_accept(yyParser*); /* Forward Declaration */
** only called from one place, optimizing compilers will in-line it, which ** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact. ** means that the extra parameters have no performance impact.
*/ */
static YYACTIONTYPE yy_reduce( static void yy_reduce(
yyParser *yypParser, /* The parser */ yyParser *yypParser, /* The parser */
unsigned int yyruleno, /* Number of the rule by which to reduce */ unsigned int yyruleno, /* Number of the rule by which to reduce */
int yyLookahead, /* Lookahead token, or YYNOCODE if none */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */
ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */
ParseCTX_PDECL /* %extra_context */
){ ){
int yygoto; /* The next state */ int yygoto; /* The next state */
YYACTIONTYPE yyact; /* The next action */ int yyact; /* The next action */
yyStackEntry *yymsp; /* The top of the parser's stack */ yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */ int yysize; /* Amount to pop the stack */
ParseARG_FETCH ParseARG_FETCH;
(void)yyLookahead; (void)yyLookahead;
(void)yyLookaheadToken; (void)yyLookaheadToken;
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfoNRhs[yyruleno]; yysize = yyRuleInfo[yyruleno].nrhs;
if( yysize ){ if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
yyTracePrompt, yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
yymsp[yysize].stateno);
}else{ }else{
fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno], yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
} }
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
...@@ -2493,7 +2182,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -2493,7 +2182,7 @@ static YYACTIONTYPE yy_reduce(
/* Check that the stack is large enough to grow by a single entry /* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room ** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */ ** enough on the stack to push the LHS value */
if( yyRuleInfoNRhs[yyruleno]==0 ){ if( yyRuleInfo[yyruleno].nrhs==0 ){
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++; yypParser->yyhwm++;
...@@ -2503,19 +2192,13 @@ static YYACTIONTYPE yy_reduce( ...@@ -2503,19 +2192,13 @@ static YYACTIONTYPE yy_reduce(
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
if( yypParser->yytos>=yypParser->yystackEnd ){ if( yypParser->yytos>=yypParser->yystackEnd ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
/* The call to yyStackOverflow() above pops the stack until it is return;
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
#else #else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){ if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
/* The call to yyStackOverflow() above pops the stack until it is return;
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
} }
...@@ -2713,16 +2396,16 @@ static YYACTIONTYPE yy_reduce( ...@@ -2713,16 +2396,16 @@ static YYACTIONTYPE yy_reduce(
break; break;
case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */
case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48); case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48);
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy90, &t);} { SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy142, &t);}
break; break;
case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy171);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy491);}
break; break;
case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 50: /* 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.yy171);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy491);}
break; break;
case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy421);} { setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy221);}
break; break;
case 52: /* ids ::= ID */ case 52: /* ids ::= ID */
case 53: /* ids ::= STRING */ yytestcase(yyruleno==53); case 53: /* ids ::= STRING */ yytestcase(yyruleno==53);
...@@ -2744,17 +2427,17 @@ static YYACTIONTYPE yy_reduce( ...@@ -2744,17 +2427,17 @@ static YYACTIONTYPE yy_reduce(
{ 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 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 59: /* 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.yy171);} { setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy491);}
break; break;
case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61); case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy90, &yymsp[-2].minor.yy0);} { setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy142, &yymsp[-2].minor.yy0);}
break; break;
case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy183, &yymsp[0].minor.yy0, 1);} { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy503, &yymsp[0].minor.yy0, 1);}
break; break;
case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy183, &yymsp[0].minor.yy0, 2);} { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy503, &yymsp[0].minor.yy0, 2);}
break; break;
case 64: /* cmd ::= CREATE USER ids PASS ids */ case 64: /* 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);}
...@@ -2785,38 +2468,38 @@ static YYACTIONTYPE yy_reduce( ...@@ -2785,38 +2468,38 @@ static YYACTIONTYPE yy_reduce(
break; break;
case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ {
yylhsminor.yy171.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy491.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy171.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yylhsminor.yy491.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy171.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; yylhsminor.yy491.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy171.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; yylhsminor.yy491.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy171.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; yylhsminor.yy491.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy171.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; yylhsminor.yy491.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy171.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; yylhsminor.yy491.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy171.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; yylhsminor.yy491.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy171.stat = yymsp[0].minor.yy0; yylhsminor.yy491.stat = yymsp[0].minor.yy0;
} }
yymsp[-8].minor.yy171 = yylhsminor.yy171; yymsp[-8].minor.yy491 = yylhsminor.yy491;
break; break;
case 86: /* intitemlist ::= intitemlist COMMA intitem */ case 86: /* intitemlist ::= intitemlist COMMA intitem */
case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155); case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155);
{ yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } { yylhsminor.yy221 = tVariantListAppend(yymsp[-2].minor.yy221, &yymsp[0].minor.yy106, -1); }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy221 = yylhsminor.yy221;
break; break;
case 87: /* intitemlist ::= intitem */ case 87: /* intitemlist ::= intitem */
case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156); case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156);
{ yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } { yylhsminor.yy221 = tVariantListAppend(NULL, &yymsp[0].minor.yy106, -1); }
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 88: /* intitem ::= INTEGER */ case 88: /* intitem ::= INTEGER */
case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157); case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157);
case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158); case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158);
case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159); case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159);
case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160); case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy106, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy430 = yylhsminor.yy430; yymsp[0].minor.yy106 = yylhsminor.yy106;
break; break;
case 89: /* keep ::= KEEP intitemlist */ case 89: /* keep ::= KEEP intitemlist */
{ yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } { yymsp[-1].minor.yy221 = yymsp[0].minor.yy221; }
break; break;
case 90: /* cache ::= CACHE INTEGER */ case 90: /* cache ::= CACHE INTEGER */
case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91); case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91);
...@@ -2836,221 +2519,221 @@ static YYACTIONTYPE yy_reduce( ...@@ -2836,221 +2519,221 @@ static YYACTIONTYPE yy_reduce(
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 105: /* db_optr ::= */ case 105: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy90); yymsp[1].minor.yy90.dbType = TSDB_DB_TYPE_DEFAULT;} {setDefaultCreateDbOption(&yymsp[1].minor.yy142); yymsp[1].minor.yy142.dbType = TSDB_DB_TYPE_DEFAULT;}
break; break;
case 106: /* db_optr ::= db_optr cache */ case 106: /* db_optr ::= db_optr cache */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 107: /* db_optr ::= db_optr replica */ case 107: /* db_optr ::= db_optr replica */
case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124); case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 108: /* db_optr ::= db_optr quorum */ case 108: /* db_optr ::= db_optr quorum */
case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125); case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 109: /* db_optr ::= db_optr days */ case 109: /* db_optr ::= db_optr days */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 110: /* db_optr ::= db_optr minrows */ case 110: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 111: /* db_optr ::= db_optr maxrows */ case 111: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 112: /* db_optr ::= db_optr blocks */ case 112: /* db_optr ::= db_optr blocks */
case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127); case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 113: /* db_optr ::= db_optr ctime */ case 113: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 114: /* db_optr ::= db_optr wal */ case 114: /* db_optr ::= db_optr wal */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 115: /* db_optr ::= db_optr fsync */ case 115: /* db_optr ::= db_optr fsync */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 116: /* db_optr ::= db_optr comp */ case 116: /* db_optr ::= db_optr comp */
case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128); case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 117: /* db_optr ::= db_optr prec */ case 117: /* db_optr ::= db_optr prec */
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.precision = yymsp[0].minor.yy0; } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 118: /* db_optr ::= db_optr keep */ case 118: /* db_optr ::= db_optr keep */
case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126); case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.keep = yymsp[0].minor.yy421; } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.keep = yymsp[0].minor.yy221; }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 119: /* db_optr ::= db_optr update */ case 119: /* db_optr ::= db_optr update */
case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129); case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 120: /* db_optr ::= db_optr cachelast */ case 120: /* db_optr ::= db_optr cachelast */
case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130); case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 121: /* topic_optr ::= db_optr */ case 121: /* topic_optr ::= db_optr */
case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131); case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131);
{ yylhsminor.yy90 = yymsp[0].minor.yy90; yylhsminor.yy90.dbType = TSDB_DB_TYPE_TOPIC; } { yylhsminor.yy142 = yymsp[0].minor.yy142; yylhsminor.yy142.dbType = TSDB_DB_TYPE_TOPIC; }
yymsp[0].minor.yy90 = yylhsminor.yy90; yymsp[0].minor.yy142 = yylhsminor.yy142;
break; break;
case 122: /* topic_optr ::= topic_optr partitions */ case 122: /* topic_optr ::= topic_optr partitions */
case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132); case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132);
{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy142 = yymsp[-1].minor.yy142; yylhsminor.yy142.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy90 = yylhsminor.yy90; yymsp[-1].minor.yy142 = yylhsminor.yy142;
break; break;
case 123: /* alter_db_optr ::= */ case 123: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy90); yymsp[1].minor.yy90.dbType = TSDB_DB_TYPE_DEFAULT;} { setDefaultCreateDbOption(&yymsp[1].minor.yy142); yymsp[1].minor.yy142.dbType = TSDB_DB_TYPE_DEFAULT;}
break; break;
case 133: /* typename ::= ids */ case 133: /* typename ::= ids */
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSetColumnType (&yylhsminor.yy183, &yymsp[0].minor.yy0); tSetColumnType (&yylhsminor.yy503, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy183 = yylhsminor.yy183; yymsp[0].minor.yy503 = yylhsminor.yy503;
break; break;
case 134: /* typename ::= ids LP signed RP */ case 134: /* typename ::= ids LP signed RP */
{ {
if (yymsp[-1].minor.yy325 <= 0) { if (yymsp[-1].minor.yy109 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
tSetColumnType(&yylhsminor.yy183, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy503, &yymsp[-3].minor.yy0);
} else { } else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy325; // negative value of name length yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy109; // negative value of name length
tSetColumnType(&yylhsminor.yy183, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy503, &yymsp[-3].minor.yy0);
} }
} }
yymsp[-3].minor.yy183 = yylhsminor.yy183; yymsp[-3].minor.yy503 = yylhsminor.yy503;
break; break;
case 135: /* typename ::= ids UNSIGNED */ case 135: /* 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);
tSetColumnType (&yylhsminor.yy183, &yymsp[-1].minor.yy0); tSetColumnType (&yylhsminor.yy503, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy183 = yylhsminor.yy183; yymsp[-1].minor.yy503 = yylhsminor.yy503;
break; break;
case 136: /* signed ::= INTEGER */ case 136: /* signed ::= INTEGER */
{ yylhsminor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy109 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy325 = yylhsminor.yy325; yymsp[0].minor.yy109 = yylhsminor.yy109;
break; break;
case 137: /* signed ::= PLUS INTEGER */ case 137: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yymsp[-1].minor.yy109 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 138: /* signed ::= MINUS INTEGER */ case 138: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy325 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} { yymsp[-1].minor.yy109 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break; break;
case 142: /* cmd ::= CREATE TABLE create_table_list */ case 142: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy438;} { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy102;}
break; break;
case 143: /* create_table_list ::= create_from_stable */ case 143: /* 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.yy152); taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy416);
pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
yylhsminor.yy438 = pCreateTable; yylhsminor.yy102 = pCreateTable;
} }
yymsp[0].minor.yy438 = yylhsminor.yy438; yymsp[0].minor.yy102 = yylhsminor.yy102;
break; break;
case 144: /* create_table_list ::= create_table_list create_from_stable */ case 144: /* create_table_list ::= create_table_list create_from_stable */
{ {
taosArrayPush(yymsp[-1].minor.yy438->childTableInfo, &yymsp[0].minor.yy152); taosArrayPush(yymsp[-1].minor.yy102->childTableInfo, &yymsp[0].minor.yy416);
yylhsminor.yy438 = yymsp[-1].minor.yy438; yylhsminor.yy102 = yymsp[-1].minor.yy102;
} }
yymsp[-1].minor.yy438 = yylhsminor.yy438; yymsp[-1].minor.yy102 = yylhsminor.yy102;
break; break;
case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ {
yylhsminor.yy438 = tSetCreateTableInfo(yymsp[-1].minor.yy421, NULL, NULL, TSQL_CREATE_TABLE); yylhsminor.yy102 = tSetCreateTableInfo(yymsp[-1].minor.yy221, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy438, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy102, 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.yy438 = yylhsminor.yy438; yymsp[-5].minor.yy102 = yylhsminor.yy102;
break; break;
case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ {
yylhsminor.yy438 = tSetCreateTableInfo(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, TSQL_CREATE_STABLE); yylhsminor.yy102 = tSetCreateTableInfo(yymsp[-5].minor.yy221, yymsp[-1].minor.yy221, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy438, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy102, 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.yy438 = yylhsminor.yy438; yymsp[-9].minor.yy102 = yylhsminor.yy102;
break; break;
case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ case 147: /* 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.yy152 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy421, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); yylhsminor.yy416 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy221, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy152 = yylhsminor.yy152; yymsp[-9].minor.yy416 = yylhsminor.yy416;
break; break;
case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ case 148: /* 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.yy152 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); yylhsminor.yy416 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy221, yymsp[-1].minor.yy221, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
} }
yymsp[-12].minor.yy152 = yylhsminor.yy152; yymsp[-12].minor.yy416 = yylhsminor.yy416;
break; break;
case 149: /* tagNamelist ::= tagNamelist COMMA ids */ case 149: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); yylhsminor.yy421 = yymsp[-2].minor.yy421; } {taosArrayPush(yymsp[-2].minor.yy221, &yymsp[0].minor.yy0); yylhsminor.yy221 = yymsp[-2].minor.yy221; }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy221 = yylhsminor.yy221;
break; break;
case 150: /* tagNamelist ::= ids */ case 150: /* tagNamelist ::= ids */
{yylhsminor.yy421 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy0);} {yylhsminor.yy221 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy221, &yymsp[0].minor.yy0);}
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */ case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */
{ {
yylhsminor.yy438 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy56, TSQL_CREATE_STREAM); yylhsminor.yy102 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy376, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy438, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy102, 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.yy438 = yylhsminor.yy438; yymsp[-4].minor.yy102 = yylhsminor.yy102;
break; break;
case 152: /* columnlist ::= columnlist COMMA column */ case 152: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy183); yylhsminor.yy421 = yymsp[-2].minor.yy421; } {taosArrayPush(yymsp[-2].minor.yy221, &yymsp[0].minor.yy503); yylhsminor.yy221 = yymsp[-2].minor.yy221; }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy221 = yylhsminor.yy221;
break; break;
case 153: /* columnlist ::= column */ case 153: /* columnlist ::= column */
{yylhsminor.yy421 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy183);} {yylhsminor.yy221 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy221, &yymsp[0].minor.yy503);}
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 154: /* column ::= ids typename */ case 154: /* column ::= ids typename */
{ {
tSetColumnInfo(&yylhsminor.yy183, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy183); tSetColumnInfo(&yylhsminor.yy503, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy503);
} }
yymsp[-1].minor.yy183 = yylhsminor.yy183; yymsp[-1].minor.yy503 = yylhsminor.yy503;
break; break;
case 161: /* tagitem ::= NULL */ case 161: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy106, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy430 = yylhsminor.yy430; yymsp[0].minor.yy106 = yylhsminor.yy106;
break; break;
case 162: /* tagitem ::= NOW */ case 162: /* tagitem ::= NOW */
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0);} { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy106, &yymsp[0].minor.yy0);}
yymsp[0].minor.yy430 = yylhsminor.yy430; yymsp[0].minor.yy106 = yylhsminor.yy106;
break; break;
case 163: /* tagitem ::= MINUS INTEGER */ case 163: /* tagitem ::= MINUS INTEGER */
case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164); case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164);
...@@ -3060,56 +2743,56 @@ static YYACTIONTYPE yy_reduce( ...@@ -3060,56 +2743,56 @@ static YYACTIONTYPE yy_reduce(
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yylhsminor.yy430, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy106, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy430 = yylhsminor.yy430; yymsp[-1].minor.yy106 = yylhsminor.yy106;
break; break;
case 167: /* select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ case 167: /* select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{ {
yylhsminor.yy56 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy421, yymsp[-11].minor.yy8, yymsp[-10].minor.yy439, yymsp[-4].minor.yy421, yymsp[-2].minor.yy421, &yymsp[-9].minor.yy400, &yymsp[-7].minor.yy147, &yymsp[-6].minor.yy40, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy421, &yymsp[0].minor.yy166, &yymsp[-1].minor.yy166, yymsp[-3].minor.yy439); yylhsminor.yy376 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy221, yymsp[-11].minor.yy164, yymsp[-10].minor.yy146, yymsp[-4].minor.yy221, yymsp[-2].minor.yy221, &yymsp[-9].minor.yy280, &yymsp[-7].minor.yy139, &yymsp[-6].minor.yy48, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy221, &yymsp[0].minor.yy454, &yymsp[-1].minor.yy454, yymsp[-3].minor.yy146);
} }
yymsp[-13].minor.yy56 = yylhsminor.yy56; yymsp[-13].minor.yy376 = yylhsminor.yy376;
break; break;
case 168: /* select ::= LP select RP */ case 168: /* select ::= LP select RP */
{yymsp[-2].minor.yy56 = yymsp[-1].minor.yy56;} {yymsp[-2].minor.yy376 = yymsp[-1].minor.yy376;}
break; break;
case 169: /* union ::= select */ case 169: /* union ::= select */
{ yylhsminor.yy421 = setSubclause(NULL, yymsp[0].minor.yy56); } { yylhsminor.yy221 = setSubclause(NULL, yymsp[0].minor.yy376); }
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 170: /* union ::= union UNION ALL select */ case 170: /* union ::= union UNION ALL select */
{ yylhsminor.yy421 = appendSelectClause(yymsp[-3].minor.yy421, yymsp[0].minor.yy56); } { yylhsminor.yy221 = appendSelectClause(yymsp[-3].minor.yy221, yymsp[0].minor.yy376); }
yymsp[-3].minor.yy421 = yylhsminor.yy421; yymsp[-3].minor.yy221 = yylhsminor.yy221;
break; break;
case 171: /* cmd ::= union */ case 171: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy421, NULL, TSDB_SQL_SELECT); } { setSqlInfo(pInfo, yymsp[0].minor.yy221, NULL, TSDB_SQL_SELECT); }
break; break;
case 172: /* select ::= SELECT selcollist */ case 172: /* select ::= SELECT selcollist */
{ {
yylhsminor.yy56 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy421, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yylhsminor.yy376 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy221, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy56 = yylhsminor.yy56; yymsp[-1].minor.yy376 = yylhsminor.yy376;
break; break;
case 173: /* sclp ::= selcollist COMMA */ case 173: /* sclp ::= selcollist COMMA */
{yylhsminor.yy421 = yymsp[-1].minor.yy421;} {yylhsminor.yy221 = yymsp[-1].minor.yy221;}
yymsp[-1].minor.yy421 = yylhsminor.yy421; yymsp[-1].minor.yy221 = yylhsminor.yy221;
break; break;
case 174: /* sclp ::= */ case 174: /* sclp ::= */
case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206); case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206);
{yymsp[1].minor.yy421 = 0;} {yymsp[1].minor.yy221 = 0;}
break; break;
case 175: /* selcollist ::= sclp distinct expr as */ case 175: /* selcollist ::= sclp distinct expr as */
{ {
yylhsminor.yy421 = tSqlExprListAppend(yymsp[-3].minor.yy421, yymsp[-1].minor.yy439, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yylhsminor.yy221 = tSqlExprListAppend(yymsp[-3].minor.yy221, yymsp[-1].minor.yy146, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-3].minor.yy421 = yylhsminor.yy421; yymsp[-3].minor.yy221 = yylhsminor.yy221;
break; break;
case 176: /* selcollist ::= sclp STAR */ case 176: /* selcollist ::= sclp STAR */
{ {
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
yylhsminor.yy421 = tSqlExprListAppend(yymsp[-1].minor.yy421, pNode, 0, 0); yylhsminor.yy221 = tSqlExprListAppend(yymsp[-1].minor.yy221, pNode, 0, 0);
} }
yymsp[-1].minor.yy421 = yylhsminor.yy421; yymsp[-1].minor.yy221 = yylhsminor.yy221;
break; break;
case 177: /* as ::= AS ids */ case 177: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
...@@ -3127,85 +2810,85 @@ static YYACTIONTYPE yy_reduce( ...@@ -3127,85 +2810,85 @@ static YYACTIONTYPE yy_reduce(
break; break;
case 182: /* from ::= FROM tablelist */ case 182: /* from ::= FROM tablelist */
case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183); case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183);
{yymsp[-1].minor.yy8 = yymsp[0].minor.yy8;} {yymsp[-1].minor.yy164 = yymsp[0].minor.yy164;}
break; break;
case 184: /* sub ::= LP union RP */ case 184: /* sub ::= LP union RP */
{yymsp[-2].minor.yy8 = addSubqueryElem(NULL, yymsp[-1].minor.yy421, NULL);} {yymsp[-2].minor.yy164 = addSubqueryElem(NULL, yymsp[-1].minor.yy221, NULL);}
break; break;
case 185: /* sub ::= LP union RP ids */ case 185: /* sub ::= LP union RP ids */
{yymsp[-3].minor.yy8 = addSubqueryElem(NULL, yymsp[-2].minor.yy421, &yymsp[0].minor.yy0);} {yymsp[-3].minor.yy164 = addSubqueryElem(NULL, yymsp[-2].minor.yy221, &yymsp[0].minor.yy0);}
break; break;
case 186: /* sub ::= sub COMMA LP union RP ids */ case 186: /* sub ::= sub COMMA LP union RP ids */
{yylhsminor.yy8 = addSubqueryElem(yymsp[-5].minor.yy8, yymsp[-2].minor.yy421, &yymsp[0].minor.yy0);} {yylhsminor.yy164 = addSubqueryElem(yymsp[-5].minor.yy164, yymsp[-2].minor.yy221, &yymsp[0].minor.yy0);}
yymsp[-5].minor.yy8 = yylhsminor.yy8; yymsp[-5].minor.yy164 = yylhsminor.yy164;
break; break;
case 187: /* tablelist ::= ids cpxName */ case 187: /* tablelist ::= ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy8 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy164 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-1].minor.yy8 = yylhsminor.yy8; yymsp[-1].minor.yy164 = yylhsminor.yy164;
break; break;
case 188: /* tablelist ::= ids cpxName ids */ case 188: /* tablelist ::= ids cpxName ids */
{ {
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy8 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy164 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-2].minor.yy8 = yylhsminor.yy8; yymsp[-2].minor.yy164 = yylhsminor.yy164;
break; break;
case 189: /* tablelist ::= tablelist COMMA ids cpxName */ case 189: /* tablelist ::= tablelist COMMA ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy8 = setTableNameList(yymsp[-3].minor.yy8, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy164 = setTableNameList(yymsp[-3].minor.yy164, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-3].minor.yy8 = yylhsminor.yy8; yymsp[-3].minor.yy164 = yylhsminor.yy164;
break; break;
case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */
{ {
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy8 = setTableNameList(yymsp[-4].minor.yy8, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy164 = setTableNameList(yymsp[-4].minor.yy164, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-4].minor.yy8 = yylhsminor.yy8; yymsp[-4].minor.yy164 = yylhsminor.yy164;
break; break;
case 191: /* tmvar ::= VARIABLE */ case 191: /* 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 192: /* interval_option ::= intervalKey LP tmvar RP */ case 192: /* interval_option ::= intervalKey LP tmvar RP */
{yylhsminor.yy400.interval = yymsp[-1].minor.yy0; yylhsminor.yy400.offset.n = 0; yylhsminor.yy400.token = yymsp[-3].minor.yy104;} {yylhsminor.yy280.interval = yymsp[-1].minor.yy0; yylhsminor.yy280.offset.n = 0; yylhsminor.yy280.token = yymsp[-3].minor.yy340;}
yymsp[-3].minor.yy400 = yylhsminor.yy400; yymsp[-3].minor.yy280 = yylhsminor.yy280;
break; break;
case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{yylhsminor.yy400.interval = yymsp[-3].minor.yy0; yylhsminor.yy400.offset = yymsp[-1].minor.yy0; yylhsminor.yy400.token = yymsp[-5].minor.yy104;} {yylhsminor.yy280.interval = yymsp[-3].minor.yy0; yylhsminor.yy280.offset = yymsp[-1].minor.yy0; yylhsminor.yy280.token = yymsp[-5].minor.yy340;}
yymsp[-5].minor.yy400 = yylhsminor.yy400; yymsp[-5].minor.yy280 = yylhsminor.yy280;
break; break;
case 194: /* interval_option ::= */ case 194: /* interval_option ::= */
{memset(&yymsp[1].minor.yy400, 0, sizeof(yymsp[1].minor.yy400));} {memset(&yymsp[1].minor.yy280, 0, sizeof(yymsp[1].minor.yy280));}
break; break;
case 195: /* intervalKey ::= INTERVAL */ case 195: /* intervalKey ::= INTERVAL */
{yymsp[0].minor.yy104 = TK_INTERVAL;} {yymsp[0].minor.yy340 = TK_INTERVAL;}
break; break;
case 196: /* intervalKey ::= EVERY */ case 196: /* intervalKey ::= EVERY */
{yymsp[0].minor.yy104 = TK_EVERY; } {yymsp[0].minor.yy340 = TK_EVERY; }
break; break;
case 197: /* session_option ::= */ case 197: /* session_option ::= */
{yymsp[1].minor.yy147.col.n = 0; yymsp[1].minor.yy147.gap.n = 0;} {yymsp[1].minor.yy139.col.n = 0; yymsp[1].minor.yy139.gap.n = 0;}
break; break;
case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
yymsp[-6].minor.yy147.col = yymsp[-4].minor.yy0; yymsp[-6].minor.yy139.col = yymsp[-4].minor.yy0;
yymsp[-6].minor.yy147.gap = yymsp[-1].minor.yy0; yymsp[-6].minor.yy139.gap = yymsp[-1].minor.yy0;
} }
break; break;
case 199: /* windowstate_option ::= */ case 199: /* windowstate_option ::= */
{ yymsp[1].minor.yy40.col.n = 0; yymsp[1].minor.yy40.col.z = NULL;} { yymsp[1].minor.yy48.col.n = 0; yymsp[1].minor.yy48.col.z = NULL;}
break; break;
case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */ case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */
{ yymsp[-3].minor.yy40.col = yymsp[-1].minor.yy0; } { yymsp[-3].minor.yy48.col = yymsp[-1].minor.yy0; }
break; break;
case 201: /* fill_opt ::= */ case 201: /* fill_opt ::= */
{ yymsp[1].minor.yy421 = 0; } { yymsp[1].minor.yy221 = 0; }
break; break;
case 202: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 202: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ {
...@@ -3213,14 +2896,14 @@ static YYACTIONTYPE yy_reduce( ...@@ -3213,14 +2896,14 @@ static YYACTIONTYPE yy_reduce(
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.yy421, &A, -1, 0); tVariantListInsert(yymsp[-1].minor.yy221, &A, -1, 0);
yymsp[-5].minor.yy421 = yymsp[-1].minor.yy421; yymsp[-5].minor.yy221 = yymsp[-1].minor.yy221;
} }
break; break;
case 203: /* fill_opt ::= FILL LP ID RP */ case 203: /* fill_opt ::= FILL LP ID RP */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy421 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yymsp[-3].minor.yy221 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
break; break;
case 204: /* sliding_opt ::= SLIDING LP tmvar RP */ case 204: /* sliding_opt ::= SLIDING LP tmvar RP */
...@@ -3230,243 +2913,243 @@ static YYACTIONTYPE yy_reduce( ...@@ -3230,243 +2913,243 @@ static YYACTIONTYPE yy_reduce(
{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 207: /* orderby_opt ::= ORDER BY sortlist */ case 207: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} {yymsp[-2].minor.yy221 = yymsp[0].minor.yy221;}
break; break;
case 208: /* sortlist ::= sortlist COMMA item sortorder */ case 208: /* sortlist ::= sortlist COMMA item sortorder */
{ {
yylhsminor.yy421 = tVariantListAppend(yymsp[-3].minor.yy421, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); yylhsminor.yy221 = tVariantListAppend(yymsp[-3].minor.yy221, &yymsp[-1].minor.yy106, yymsp[0].minor.yy172);
} }
yymsp[-3].minor.yy421 = yylhsminor.yy421; yymsp[-3].minor.yy221 = yylhsminor.yy221;
break; break;
case 209: /* sortlist ::= item sortorder */ case 209: /* sortlist ::= item sortorder */
{ {
yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); yylhsminor.yy221 = tVariantListAppend(NULL, &yymsp[-1].minor.yy106, yymsp[0].minor.yy172);
} }
yymsp[-1].minor.yy421 = yylhsminor.yy421; yymsp[-1].minor.yy221 = yylhsminor.yy221;
break; break;
case 210: /* item ::= ids cpxName */ case 210: /* 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.yy430, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy106, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy430 = yylhsminor.yy430; yymsp[-1].minor.yy106 = yylhsminor.yy106;
break; break;
case 211: /* sortorder ::= ASC */ case 211: /* sortorder ::= ASC */
{ yymsp[0].minor.yy96 = TSDB_ORDER_ASC; } { yymsp[0].minor.yy172 = TSDB_ORDER_ASC; }
break; break;
case 212: /* sortorder ::= DESC */ case 212: /* sortorder ::= DESC */
{ yymsp[0].minor.yy96 = TSDB_ORDER_DESC;} { yymsp[0].minor.yy172 = TSDB_ORDER_DESC;}
break; break;
case 213: /* sortorder ::= */ case 213: /* sortorder ::= */
{ yymsp[1].minor.yy96 = TSDB_ORDER_ASC; } { yymsp[1].minor.yy172 = TSDB_ORDER_ASC; }
break; break;
case 214: /* groupby_opt ::= */ case 214: /* groupby_opt ::= */
{ yymsp[1].minor.yy421 = 0;} { yymsp[1].minor.yy221 = 0;}
break; break;
case 215: /* groupby_opt ::= GROUP BY grouplist */ case 215: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} { yymsp[-2].minor.yy221 = yymsp[0].minor.yy221;}
break; break;
case 216: /* grouplist ::= grouplist COMMA item */ case 216: /* grouplist ::= grouplist COMMA item */
{ {
yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); yylhsminor.yy221 = tVariantListAppend(yymsp[-2].minor.yy221, &yymsp[0].minor.yy106, -1);
} }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy221 = yylhsminor.yy221;
break; break;
case 217: /* grouplist ::= item */ case 217: /* grouplist ::= item */
{ {
yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); yylhsminor.yy221 = tVariantListAppend(NULL, &yymsp[0].minor.yy106, -1);
} }
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 218: /* having_opt ::= */ case 218: /* having_opt ::= */
case 228: /* where_opt ::= */ yytestcase(yyruleno==228); case 228: /* where_opt ::= */ yytestcase(yyruleno==228);
case 272: /* expritem ::= */ yytestcase(yyruleno==272); case 272: /* expritem ::= */ yytestcase(yyruleno==272);
{yymsp[1].minor.yy439 = 0;} {yymsp[1].minor.yy146 = 0;}
break; break;
case 219: /* having_opt ::= HAVING expr */ case 219: /* having_opt ::= HAVING expr */
case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229); case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229);
{yymsp[-1].minor.yy439 = yymsp[0].minor.yy439;} {yymsp[-1].minor.yy146 = yymsp[0].minor.yy146;}
break; break;
case 220: /* limit_opt ::= */ case 220: /* limit_opt ::= */
case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224); case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224);
{yymsp[1].minor.yy166.limit = -1; yymsp[1].minor.yy166.offset = 0;} {yymsp[1].minor.yy454.limit = -1; yymsp[1].minor.yy454.offset = 0;}
break; break;
case 221: /* limit_opt ::= LIMIT signed */ case 221: /* limit_opt ::= LIMIT signed */
case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225); case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225);
{yymsp[-1].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-1].minor.yy166.offset = 0;} {yymsp[-1].minor.yy454.limit = yymsp[0].minor.yy109; yymsp[-1].minor.yy454.offset = 0;}
break; break;
case 222: /* limit_opt ::= LIMIT signed OFFSET signed */ case 222: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy166.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[0].minor.yy325;} { yymsp[-3].minor.yy454.limit = yymsp[-2].minor.yy109; yymsp[-3].minor.yy454.offset = yymsp[0].minor.yy109;}
break; break;
case 223: /* limit_opt ::= LIMIT signed COMMA signed */ case 223: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[-2].minor.yy325;} { yymsp[-3].minor.yy454.limit = yymsp[0].minor.yy109; yymsp[-3].minor.yy454.offset = yymsp[-2].minor.yy109;}
break; break;
case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy166.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[0].minor.yy325;} {yymsp[-3].minor.yy454.limit = yymsp[-2].minor.yy109; yymsp[-3].minor.yy454.offset = yymsp[0].minor.yy109;}
break; break;
case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */ case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[-2].minor.yy325;} {yymsp[-3].minor.yy454.limit = yymsp[0].minor.yy109; yymsp[-3].minor.yy454.offset = yymsp[-2].minor.yy109;}
break; break;
case 230: /* expr ::= LP expr RP */ case 230: /* expr ::= LP expr RP */
{yylhsminor.yy439 = yymsp[-1].minor.yy439; yylhsminor.yy439->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy439->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} {yylhsminor.yy146 = yymsp[-1].minor.yy146; yylhsminor.yy146->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy146->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 231: /* expr ::= ID */ case 231: /* expr ::= ID */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 232: /* expr ::= ID DOT ID */ case 232: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 233: /* expr ::= ID DOT STAR */ case 233: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 234: /* expr ::= INTEGER */ case 234: /* expr ::= INTEGER */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 235: /* expr ::= MINUS INTEGER */ case 235: /* expr ::= MINUS INTEGER */
case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236); case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy439 = yylhsminor.yy439; yymsp[-1].minor.yy146 = yylhsminor.yy146;
break; break;
case 237: /* expr ::= FLOAT */ case 237: /* expr ::= FLOAT */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 238: /* expr ::= MINUS FLOAT */ case 238: /* expr ::= MINUS FLOAT */
case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239); case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy439 = yylhsminor.yy439; yymsp[-1].minor.yy146 = yylhsminor.yy146;
break; break;
case 240: /* expr ::= STRING */ case 240: /* expr ::= STRING */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 241: /* expr ::= NOW */ case 241: /* expr ::= NOW */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 242: /* expr ::= VARIABLE */ case 242: /* expr ::= VARIABLE */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 243: /* expr ::= PLUS VARIABLE */ case 243: /* expr ::= PLUS VARIABLE */
case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244); case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);}
yymsp[-1].minor.yy439 = yylhsminor.yy439; yymsp[-1].minor.yy146 = yylhsminor.yy146;
break; break;
case 245: /* expr ::= BOOL */ case 245: /* expr ::= BOOL */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 246: /* expr ::= NULL */ case 246: /* expr ::= NULL */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} { yylhsminor.yy146 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 247: /* expr ::= ID LP exprlist RP */ case 247: /* expr ::= ID LP exprlist RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy439 = tSqlExprCreateFunction(yymsp[-1].minor.yy421, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy146 = tSqlExprCreateFunction(yymsp[-1].minor.yy221, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy439 = yylhsminor.yy439; yymsp[-3].minor.yy146 = yylhsminor.yy146;
break; break;
case 248: /* expr ::= ID LP STAR RP */ case 248: /* expr ::= ID LP STAR RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy439 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy146 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy439 = yylhsminor.yy439; yymsp[-3].minor.yy146 = yylhsminor.yy146;
break; break;
case 249: /* expr ::= expr IS NULL */ case 249: /* expr ::= expr IS NULL */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, NULL, TK_ISNULL);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, NULL, TK_ISNULL);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 250: /* expr ::= expr IS NOT NULL */ case 250: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-3].minor.yy439, NULL, TK_NOTNULL);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-3].minor.yy146, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy439 = yylhsminor.yy439; yymsp[-3].minor.yy146 = yylhsminor.yy146;
break; break;
case 251: /* expr ::= expr LT expr */ case 251: /* expr ::= expr LT expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LT);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_LT);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 252: /* expr ::= expr GT expr */ case 252: /* expr ::= expr GT expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_GT);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_GT);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 253: /* expr ::= expr LE expr */ case 253: /* expr ::= expr LE expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LE);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_LE);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 254: /* expr ::= expr GE expr */ case 254: /* expr ::= expr GE expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_GE);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_GE);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 255: /* expr ::= expr NE expr */ case 255: /* expr ::= expr NE expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_NE);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_NE);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 256: /* expr ::= expr EQ expr */ case 256: /* expr ::= expr EQ expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_EQ);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_EQ);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 257: /* expr ::= expr BETWEEN expr AND expr */ case 257: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy439); yylhsminor.yy439 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy439, yymsp[-2].minor.yy439, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy439, TK_LE), TK_AND);} { tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy146); yylhsminor.yy146 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy146, yymsp[-2].minor.yy146, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy146, TK_LE), TK_AND);}
yymsp[-4].minor.yy439 = yylhsminor.yy439; yymsp[-4].minor.yy146 = yylhsminor.yy146;
break; break;
case 258: /* expr ::= expr AND expr */ case 258: /* expr ::= expr AND expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_AND);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_AND);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 259: /* expr ::= expr OR expr */ case 259: /* expr ::= expr OR expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_OR); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_OR); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 260: /* expr ::= expr PLUS expr */ case 260: /* expr ::= expr PLUS expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_PLUS); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_PLUS); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 261: /* expr ::= expr MINUS expr */ case 261: /* expr ::= expr MINUS expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_MINUS); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_MINUS); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 262: /* expr ::= expr STAR expr */ case 262: /* expr ::= expr STAR expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_STAR); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_STAR); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 263: /* expr ::= expr SLASH expr */ case 263: /* expr ::= expr SLASH expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_DIVIDE);} {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_DIVIDE);}
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 264: /* expr ::= expr REM expr */ case 264: /* expr ::= expr REM expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_REM); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_REM); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 265: /* expr ::= expr LIKE expr */ case 265: /* expr ::= expr LIKE expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LIKE); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_LIKE); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 266: /* expr ::= expr MATCH expr */ case 266: /* expr ::= expr MATCH expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_MATCH); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_MATCH); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 267: /* expr ::= expr NMATCH expr */ case 267: /* expr ::= expr NMATCH expr */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_NMATCH); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-2].minor.yy146, yymsp[0].minor.yy146, TK_NMATCH); }
yymsp[-2].minor.yy439 = yylhsminor.yy439; yymsp[-2].minor.yy146 = yylhsminor.yy146;
break; break;
case 268: /* expr ::= expr IN LP exprlist RP */ case 268: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy439 = tSqlExprCreate(yymsp[-4].minor.yy439, (tSqlExpr*)yymsp[-1].minor.yy421, TK_IN); } {yylhsminor.yy146 = tSqlExprCreate(yymsp[-4].minor.yy146, (tSqlExpr*)yymsp[-1].minor.yy221, TK_IN); }
yymsp[-4].minor.yy439 = yylhsminor.yy439; yymsp[-4].minor.yy146 = yylhsminor.yy146;
break; break;
case 269: /* exprlist ::= exprlist COMMA expritem */ case 269: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy421 = tSqlExprListAppend(yymsp[-2].minor.yy421,yymsp[0].minor.yy439,0, 0);} {yylhsminor.yy221 = tSqlExprListAppend(yymsp[-2].minor.yy221,yymsp[0].minor.yy146,0, 0);}
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy221 = yylhsminor.yy221;
break; break;
case 270: /* exprlist ::= expritem */ case 270: /* exprlist ::= expritem */
{yylhsminor.yy421 = tSqlExprListAppend(0,yymsp[0].minor.yy439,0, 0);} {yylhsminor.yy221 = tSqlExprListAppend(0,yymsp[0].minor.yy146,0, 0);}
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy221 = yylhsminor.yy221;
break; break;
case 271: /* expritem ::= expr */ case 271: /* expritem ::= expr */
{yylhsminor.yy439 = yymsp[0].minor.yy439;} {yylhsminor.yy146 = yymsp[0].minor.yy146;}
yymsp[0].minor.yy439 = yylhsminor.yy439; yymsp[0].minor.yy146 = yylhsminor.yy146;
break; break;
case 273: /* cmd ::= RESET QUERY CACHE */ case 273: /* cmd ::= RESET QUERY CACHE */
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
...@@ -3477,7 +3160,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3477,7 +3160,7 @@ static YYACTIONTYPE yy_reduce(
case 275: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 275: /* 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 = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, 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;
...@@ -3495,14 +3178,14 @@ static YYACTIONTYPE yy_reduce( ...@@ -3495,14 +3178,14 @@ static YYACTIONTYPE yy_reduce(
case 277: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ case 277: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 278: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 278: /* 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 = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, 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;
...@@ -3537,7 +3220,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3537,7 +3220,7 @@ static YYACTIONTYPE yy_reduce(
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.yy430, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy106, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3546,14 +3229,14 @@ static YYACTIONTYPE yy_reduce( ...@@ -3546,14 +3229,14 @@ static YYACTIONTYPE yy_reduce(
case 282: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ case 282: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 283: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ case 283: /* 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 = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, 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;
...@@ -3571,14 +3254,14 @@ static YYACTIONTYPE yy_reduce( ...@@ -3571,14 +3254,14 @@ static YYACTIONTYPE yy_reduce(
case 285: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ case 285: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 286: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ case 286: /* 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 = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, 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;
...@@ -3613,7 +3296,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3613,7 +3296,7 @@ static YYACTIONTYPE yy_reduce(
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.yy430, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy106, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3622,7 +3305,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3622,7 +3305,7 @@ static YYACTIONTYPE yy_reduce(
case 290: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ case 290: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy221, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
...@@ -3639,9 +3322,9 @@ static YYACTIONTYPE yy_reduce( ...@@ -3639,9 +3322,9 @@ static YYACTIONTYPE yy_reduce(
break; break;
/********** End reduce actions ************************************************/ /********** End reduce actions ************************************************/
}; };
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) ); assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
yygoto = yyRuleInfoLhs[yyruleno]; yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfoNRhs[yyruleno]; yysize = yyRuleInfo[yyruleno].nrhs;
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto); yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table /* There are no SHIFTREDUCE actions on nonterminals because the table
...@@ -3656,7 +3339,6 @@ static YYACTIONTYPE yy_reduce( ...@@ -3656,7 +3339,6 @@ static YYACTIONTYPE yy_reduce(
yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto; yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift"); yyTraceShift(yypParser, yyact, "... then shift");
return yyact;
} }
/* /*
...@@ -3666,8 +3348,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3666,8 +3348,7 @@ static YYACTIONTYPE yy_reduce(
static void yy_parse_failed( static void yy_parse_failed(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
...@@ -3678,8 +3359,7 @@ static void yy_parse_failed( ...@@ -3678,8 +3359,7 @@ static void yy_parse_failed(
** parser fails */ ** parser fails */
/************ Begin %parse_failure code ***************************************/ /************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/ /************ End %parse_failure code *****************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
#endif /* YYNOERRORRECOVERY */ #endif /* YYNOERRORRECOVERY */
...@@ -3691,8 +3371,7 @@ static void yy_syntax_error( ...@@ -3691,8 +3371,7 @@ static void yy_syntax_error(
int yymajor, /* The major type of the error token */ int yymajor, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#define TOKEN yyminor #define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/ /************ Begin %syntax_error code ****************************************/
...@@ -3718,8 +3397,7 @@ static void yy_syntax_error( ...@@ -3718,8 +3397,7 @@ static void yy_syntax_error(
assert(len <= outputBufLen); assert(len <= outputBufLen);
/************ End %syntax_error code ******************************************/ /************ End %syntax_error code ******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* /*
...@@ -3728,8 +3406,7 @@ static void yy_syntax_error( ...@@ -3728,8 +3406,7 @@ static void yy_syntax_error(
static void yy_accept( static void yy_accept(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
...@@ -3744,8 +3421,7 @@ static void yy_accept( ...@@ -3744,8 +3421,7 @@ static void yy_accept(
/*********** Begin %parse_accept code *****************************************/ /*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/ /*********** End %parse_accept code *******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* The main parser program. /* The main parser program.
...@@ -3774,47 +3450,45 @@ void Parse( ...@@ -3774,47 +3450,45 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */ ParseARG_PDECL /* Optional %extra_argument parameter */
){ ){
YYMINORTYPE yyminorunion; YYMINORTYPE yyminorunion;
YYACTIONTYPE yyact; /* The parser action. */ unsigned int yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyendofinput; /* True if we are at the end of input */ int yyendofinput; /* True if we are at the end of input */
#endif #endif
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
int yyerrorhit = 0; /* True if yymajor has invoked an error */ int yyerrorhit = 0; /* True if yymajor has invoked an error */
#endif #endif
yyParser *yypParser = (yyParser*)yyp; /* The parser */ yyParser *yypParser; /* The parser */
ParseCTX_FETCH
ParseARG_STORE
yypParser = (yyParser*)yyp;
assert( yypParser->yytos!=0 ); assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
yyendofinput = (yymajor==0); yyendofinput = (yymajor==0);
#endif #endif
ParseARG_STORE;
yyact = yypParser->yytos->stateno;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
if( yyact < YY_MIN_REDUCE ){ int stateno = yypParser->yytos->stateno;
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],yyact); yyTracePrompt,yyTokenName[yymajor],stateno);
}else{ }else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE); yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE);
} }
} }
#endif #endif
do{ do{
assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){ if( yyact >= YY_MIN_REDUCE ){
yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor);
yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){ }else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); yy_shift(yypParser,yyact,yymajor,yyminor);
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt--; yypParser->yyerrcnt--;
#endif #endif
break; yymajor = YYNOCODE;
}else if( yyact==YY_ACCEPT_ACTION ){ }else if( yyact==YY_ACCEPT_ACTION ){
yypParser->yytos--; yypParser->yytos--;
yy_accept(yypParser); yy_accept(yypParser);
...@@ -3865,9 +3539,10 @@ void Parse( ...@@ -3865,9 +3539,10 @@ void Parse(
yymajor = YYNOCODE; yymajor = YYNOCODE;
}else{ }else{
while( yypParser->yytos >= yypParser->yystack while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action( && (yyact = yy_find_reduce_action(
yypParser->yytos->stateno, yypParser->yytos->stateno,
YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE YYERRORSYMBOL)) >= YY_MIN_REDUCE
){ ){
yy_pop_parser_stack(yypParser); yy_pop_parser_stack(yypParser);
} }
...@@ -3884,8 +3559,6 @@ void Parse( ...@@ -3884,8 +3559,6 @@ void Parse(
} }
yypParser->yyerrcnt = 3; yypParser->yyerrcnt = 3;
yyerrorhit = 1; yyerrorhit = 1;
if( yymajor==YYNOCODE ) break;
yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY) #elif defined(YYNOERRORRECOVERY)
/* If the YYNOERRORRECOVERY macro is defined, then do not attempt to /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
** do any kind of error recovery. Instead, simply invoke the syntax ** do any kind of error recovery. Instead, simply invoke the syntax
...@@ -3896,7 +3569,8 @@ void Parse( ...@@ -3896,7 +3569,8 @@ void Parse(
*/ */
yy_syntax_error(yypParser,yymajor, yyminor); yy_syntax_error(yypParser,yymajor, yyminor);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
break; yymajor = YYNOCODE;
#else /* YYERRORSYMBOL is not defined */ #else /* YYERRORSYMBOL is not defined */
/* This is what we do if the grammar does not define ERROR: /* This is what we do if the grammar does not define ERROR:
** **
...@@ -3918,10 +3592,10 @@ void Parse( ...@@ -3918,10 +3592,10 @@ void Parse(
yypParser->yyerrcnt = -1; yypParser->yyerrcnt = -1;
#endif #endif
} }
break; yymajor = YYNOCODE;
#endif #endif
} }
}while( yypParser->yytos>yypParser->yystack ); }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
yyStackEntry *i; yyStackEntry *i;
...@@ -3936,17 +3610,3 @@ void Parse( ...@@ -3936,17 +3610,3 @@ void Parse(
#endif #endif
return; return;
} }
/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
int ParseFallback(int iToken){
#ifdef YYFALLBACK
assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
return yyFallback[iToken];
#else
(void)iToken;
return 0;
#endif
}
...@@ -67,7 +67,9 @@ int tsdbCompact(STsdbRepo *pRepo) { return tsdbAsyncCompact(pRepo); } ...@@ -67,7 +67,9 @@ int tsdbCompact(STsdbRepo *pRepo) { return tsdbAsyncCompact(pRepo); }
void *tsdbCompactImpl(STsdbRepo *pRepo) { void *tsdbCompactImpl(STsdbRepo *pRepo) {
// Check if there are files in TSDB FS to compact // Check if there are files in TSDB FS to compact
if (REPO_FS(pRepo)->cstatus->pmf == NULL) { if (REPO_FS(pRepo)->cstatus->pmf == NULL) {
tsdbInfo("vgId:%d no file to compact in FS", REPO_ID(pRepo)); pRepo->compactState = TSDB_NO_COMPACT;
tsem_post(&(pRepo->readyToCommit));
tsdbInfo("vgId:%d compact over, no file to compact in FS", REPO_ID(pRepo));
return NULL; return NULL;
} }
......
...@@ -417,14 +417,20 @@ int32_t compareFindItemInSet(const void *pLeft, const void* pRight) { ...@@ -417,14 +417,20 @@ int32_t compareFindItemInSet(const void *pLeft, const void* pRight) {
int32_t compareWStrPatternComp(const void* pLeft, const void* pRight) { int32_t compareWStrPatternComp(const void* pLeft, const void* pRight) {
SPatternCompareInfo pInfo = {'%', '_'}; SPatternCompareInfo pInfo = {'%', '_'};
size_t size = varDataLen(pLeft)/TSDB_NCHAR_SIZE;
assert(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN * TSDB_NCHAR_SIZE); assert(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN * TSDB_NCHAR_SIZE);
wchar_t *pattern = calloc(varDataLen(pRight) + 1, sizeof(wchar_t)); wchar_t *pattern = calloc(varDataLen(pRight) + 1, sizeof(wchar_t));
wchar_t *str = calloc(size + 1, sizeof(wchar_t));
memcpy(pattern, varDataVal(pRight), varDataLen(pRight)); memcpy(pattern, varDataVal(pRight), varDataLen(pRight));
memcpy(str, varDataVal(pLeft), size * sizeof(wchar_t));
int32_t ret = WCSPatternMatch(pattern, str, size, &pInfo);
int32_t ret = WCSPatternMatch(pattern, varDataVal(pLeft), varDataLen(pLeft)/TSDB_NCHAR_SIZE, &pInfo);
free(pattern); free(pattern);
free(str);
return (ret == TSDB_PATTERN_MATCH) ? 0 : 1; return (ret == TSDB_PATTERN_MATCH) ? 0 : 1;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "query.h" #include "query.h"
#include "vnodeStatus.h" #include "vnodeStatus.h"
#include "tgrant.h"
int32_t vNumOfExistedQHandle; // current initialized and existed query handle in current dnode int32_t vNumOfExistedQHandle; // current initialized and existed query handle in current dnode
...@@ -55,6 +56,11 @@ int32_t vnodeProcessRead(void *vparam, SVReadMsg *pRead) { ...@@ -55,6 +56,11 @@ int32_t vnodeProcessRead(void *vparam, SVReadMsg *pRead) {
} }
static int32_t vnodeCheckRead(SVnodeObj *pVnode) { static int32_t vnodeCheckRead(SVnodeObj *pVnode) {
if (grantCheck(TSDB_GRANT_TIME) != TSDB_CODE_SUCCESS) {
vDebug("vgId:%d, grant expired, refCount:%d pVnode:%p", pVnode->vgId, pVnode->refCount, pVnode);
return TSDB_CODE_GRANT_EXPIRED;
}
if (!vnodeInReadyStatus(pVnode)) { if (!vnodeInReadyStatus(pVnode)) {
vDebug("vgId:%d, vnode status is %s, refCount:%d pVnode:%p", pVnode->vgId, vnodeStatus[pVnode->status], vDebug("vgId:%d, vnode status is %s, refCount:%d pVnode:%p", pVnode->vgId, vnodeStatus[pVnode->status],
pVnode->refCount, pVnode); pVnode->refCount, pVnode);
......
...@@ -31,6 +31,7 @@ class TDTestCase: ...@@ -31,6 +31,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('reset query cache') tdSql.execute('reset query cache')
tdSql.execute('drop database if exists db') tdSql.execute('drop database if exists db')
tdSql.error('create database db keep 365000');
tdSql.execute('create database db precision "ns";') tdSql.execute('create database db precision "ns";')
tdSql.query('show databases;') tdSql.query('show databases;')
tdSql.checkData(0,16,'ns') tdSql.checkData(0,16,'ns')
......
...@@ -405,7 +405,7 @@ python3 ./test.py -f query/queryWildcardLength.py ...@@ -405,7 +405,7 @@ python3 ./test.py -f query/queryWildcardLength.py
python3 ./test.py -f query/queryTbnameUpperLower.py python3 ./test.py -f query/queryTbnameUpperLower.py
python3 ./test.py -f query/query.py python3 ./test.py -f query/query.py
python3 ./test.py -f query/queryDiffColsOr.py python3 ./test.py -f query/queryDiffColsTagsAndOr.py
python3 ./test.py -f client/nettest.py python3 ./test.py -f client/nettest.py
......
...@@ -147,6 +147,9 @@ class TDTestCase: ...@@ -147,6 +147,9 @@ class TDTestCase:
tdSql.error("select derivative(col, 10s, 1) from stb group by id") tdSql.error("select derivative(col, 10s, 1) from stb group by id")
tdSql.error("select derivative(col, 999ms, 1) from stb group by id") tdSql.error("select derivative(col, 999ms, 1) from stb group by id")
tdSql.error("select derivative(col, 10s, 2) from stb group by id") tdSql.error("select derivative(col, 10s, 2) from stb group by id")
tdSql.error("select derivative(col, -106752999999999922222d, 0) from stb group by tbname"); #overflow error
tdSql.error("select derivative(col, 10y, 0) from stb group by tbname") #TD-10399, DB error: syntax error near '10y, 0) from stb group by tbname;'
tdSql.error("select derivative(col, -106752d, 0) from stb group by tbname") #TD-10398 overflow tips
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
......
...@@ -1581,7 +1581,7 @@ class TDTestCase: ...@@ -1581,7 +1581,7 @@ class TDTestCase:
# self.td5798() # self.td5798()
# develop branch # develop branch
self.td4889() # self.td4889() In the scenario that with vnode/wal/wal* but without meta/data in vnode, the status is reset to 0 right now.
self.td5798() self.td5798()
def stop(self): def stop(self):
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
from util.common import tdCom
class TDTestCase:
def init(self, conn, logSql):
## add for TD-6672
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def insertData(self, tb_name):
insert_sql_list = [f'insert into {tb_name} values ("2021-01-01 12:00:00", 1, 1, 1, 3, 1.1, 1.1, "binary", "nchar", true, 1)',
f'insert into {tb_name} values ("2021-01-05 12:00:00", 2, 2, 1, 3, 1.1, 1.1, "binary", "nchar", true, 2)',
f'insert into {tb_name} values ("2021-01-07 12:00:00", 1, 3, 1, 2, 1.1, 1.1, "binary", "nchar", true, 3)',
f'insert into {tb_name} values ("2021-01-09 12:00:00", 1, 2, 4, 3, 1.1, 1.1, "binary", "nchar", true, 4)',
f'insert into {tb_name} values ("2021-01-11 12:00:00", 1, 2, 5, 5, 1.1, 1.1, "binary", "nchar", true, 5)',
f'insert into {tb_name} values ("2021-01-13 12:00:00", 1, 2, 1, 3, 6.6, 1.1, "binary", "nchar", true, 6)',
f'insert into {tb_name} values ("2021-01-15 12:00:00", 1, 2, 1, 3, 1.1, 7.7, "binary", "nchar", true, 7)',
f'insert into {tb_name} values ("2021-01-17 12:00:00", 1, 2, 1, 3, 1.1, 1.1, "binary8", "nchar", true, 8)',
f'insert into {tb_name} values ("2021-01-19 12:00:00", 1, 2, 1, 3, 1.1, 1.1, "binary", "nchar9", true, 9)',
f'insert into {tb_name} values ("2021-01-21 12:00:00", 1, 2, 1, 3, 1.1, 1.1, "binary", "nchar", false, 10)',
f'insert into {tb_name} values ("2021-01-23 12:00:00", 1, 3, 1, 3, 1.1, 1.1, Null, Null, false, 11)'
]
for sql in insert_sql_list:
tdSql.execute(sql)
def initTb(self):
tdCom.cleanTb()
tb_name = tdCom.getLongName(8, "letters")
tdSql.execute(
f"CREATE TABLE {tb_name} (ts timestamp, c1 tinyint, c2 smallint, c3 int, c4 bigint, c5 float, c6 double, c7 binary(100), c8 nchar(200), c9 bool, c10 int)")
self.insertData(tb_name)
return tb_name
def initStb(self):
tdCom.cleanTb()
tb_name = tdCom.getLongName(8, "letters")
tdSql.execute(
f"CREATE TABLE {tb_name} (ts timestamp, c1 tinyint, c2 smallint, c3 int, c4 bigint, c5 float, c6 double, c7 binary(100), c8 nchar(200), c9 bool, c10 int) tags (t1 tinyint, t2 smallint, t3 int, t4 bigint, t5 float, t6 double, t7 binary(100), t8 nchar(200), t9 bool, t10 int)")
for i in range(1, 6):
tdSql.execute(
f'CREATE TABLE {tb_name}_sub_{i} using {tb_name} tags ({i}, {i}, {i}, {i}, {i}.{i}, {i}.{i}, "binary{i}", "nchar{i}", true, {i})')
self.insertData(f'{tb_name}_sub_{i}')
return tb_name
def initTwoStb(self):
tdCom.cleanTb()
tb_name = tdCom.getLongName(8, "letters")
tb_name1 = f'{tb_name}1'
tb_name2 = f'{tb_name}2'
tdSql.execute(
f"CREATE TABLE {tb_name1} (ts timestamp, c1 tinyint, c2 smallint, c3 int, c4 bigint, c5 float, c6 double, c7 binary(100), c8 nchar(200), c9 bool, c10 int) tags (t1 tinyint, t2 smallint, t3 int, t4 bigint, t5 float, t6 double, t7 binary(100), t8 nchar(200), t9 bool, t10 int)")
tdSql.execute(
f"CREATE TABLE {tb_name2} (ts timestamp, c1 tinyint, c2 smallint, c3 int, c4 bigint, c5 float, c6 double, c7 binary(100), c8 nchar(200), c9 bool, c10 int) tags (t1 tinyint, t2 smallint, t3 int, t4 bigint, t5 float, t6 double, t7 binary(100), t8 nchar(200), t9 bool, t10 int)")
tdSql.execute(
f'CREATE TABLE {tb_name1}_sub using {tb_name1} tags (1, 1, 1, 1, 1.1, 1.1, "binary1", "nchar1", true, 1)')
tdSql.execute(
f'CREATE TABLE {tb_name2}_sub using {tb_name2} tags (1, 1, 1, 1, 1.1, 1.1, "binary1", "nchar1", true, 1)')
self.insertData(f'{tb_name1}_sub')
self.insertData(f'{tb_name2}_sub')
return tb_name
def queryLastC10(self, query_sql, multi=False):
if multi:
res = tdSql.query(query_sql.replace('c10', 'last(*)'), True)
else:
res = tdSql.query(query_sql.replace('*', 'last(*)'), True)
return int(res[0][-1])
def queryTsCol(self, tb_name):
# ts and ts
query_sql = f'select * from {tb_name} where ts > "2021-01-11 12:00:00" or ts < "2021-01-13 12:00:00"'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and ts <= "2021-01-13 12:00:00"'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 6)
## ts or and tinyint col
query_sql = f'select * from {tb_name} where ts > "2021-01-11 12:00:00" or c1 = 2'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c1 != 2'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## ts or and smallint col
query_sql = f'select * from {tb_name} where ts <> "2021-01-11 12:00:00" or c2 = 10'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c2 <= 1'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 1)
## ts or and int col
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" or c3 = 4'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and c3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## ts or and big col
query_sql = f'select * from {tb_name} where ts is Null or c4 = 5'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts is not Null and c4 = 2'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 3)
## ts or and float col
query_sql = f'select * from {tb_name} where ts between "2021-01-17 12:00:00" and "2021-01-23 12:00:00" or c5 = 6.6'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and c5 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## ts or and double col
query_sql = f'select * from {tb_name} where ts between "2021-01-17 12:00:00" and "2021-01-23 12:00:00" or c6 = 7.7'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and c6 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## ts or and binary col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" or c7 like "binary_"'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c7 in ("binary")'
tdSql.query(query_sql)
tdSql.checkRows(5)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## ts or and nchar col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" or c8 like "nchar%"'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and c8 is Null'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## ts or and bool col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" or c9=false'
tdSql.error(query_sql)
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and c9=true'
tdSql.query(query_sql)
tdSql.checkRows(5)
tdSql.checkEqual(self.queryLastC10(query_sql), 9)
## multi cols
query_sql = f'select * from {tb_name} where ts > "2021-01-03 12:00:00" and c1 != 2 and c2 >= 2 and c3 <> 4 and c4 < 4 and c5 > 1 and c6 >= 1.1 and c7 is not Null and c8 = "nchar" and c9=false'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 10)
def queryTsTag(self, tb_name):
## ts and tinyint col
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and t1 != 2'
tdSql.query(query_sql)
tdSql.checkRows(20)
## ts and smallint col
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and t2 <= 1'
tdSql.query(query_sql)
tdSql.checkRows(5)
## ts or and int col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and t3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(4)
## ts or and big col
query_sql = f'select * from {tb_name} where ts is not Null and t4 = 2'
tdSql.query(query_sql)
tdSql.checkRows(11)
## ts or and float col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and t5 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
## ts or and double col
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and t6 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## ts or and binary col
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and t7 in ("binary1")'
tdSql.query(query_sql)
tdSql.checkRows(5)
## ts or and nchar col
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and t8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(35)
## ts or and bool col
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(35)
## multi cols
query_sql = f'select * from {tb_name} where ts > "2021-01-03 12:00:00" and t1 != 2 and t2 >= 2 and t3 <> 4 and t4 < 4 and t5 > 1 and t6 >= 1.1 and t7 is not Null and t8 = "nchar3" and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(10)
def queryTsColTag(self, tb_name):
## ts and tinyint col tag
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c1 >= 2 and t1 != 2'
tdSql.query(query_sql)
tdSql.checkRows(4)
## ts and smallint col tag
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c2 >=3 and t2 <= 1'
tdSql.query(query_sql)
tdSql.checkRows(1)
## ts or and int col tag
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and c3 < 3 and t3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(3)
## ts or and big col tag
query_sql = f'select * from {tb_name} where ts is not Null and c4 <> 1 and t4 = 2'
tdSql.query(query_sql)
tdSql.checkRows(11)
## ts or and float col tag
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00" and c5 is not Null and t5 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
## ts or and double col tag
query_sql = f'select * from {tb_name} where ts < "2021-01-11 12:00:00"and c6 = 1.1 and t6 = 1.1'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## ts or and binary col tag
query_sql = f'select * from {tb_name} where ts <= "2021-01-11 12:00:00" and c7 is Null and t7 in ("binary1")'
tdSql.query(query_sql)
tdSql.checkRows(0)
## ts or and nchar col tag
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and c8 like "nch%" and t8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(30)
## ts or and bool col tag
query_sql = f'select * from {tb_name} where ts >= "2021-01-11 12:00:00" and c9=false and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(10)
## multi cols tag
query_sql = f'select * from {tb_name} where ts > "2021-01-03 12:00:00" and c1 = 1 and c2 != 3 and c3 <= 2 and c4 >= 2 and c5 in (1.2, 1.1) and c6 < 2.2 and c7 like "bina%" and c8 is not Null and c9 = true and t1 != 2 and t2 >= 2 and t3 <> 4 and t4 < 4 and t5 > 1 and t6 >= 1.1 and t7 is not Null and t8 = "nchar3" and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(2)
def queryFullColType(self, tb_name):
## != or and
query_sql = f'select * from {tb_name} where c1 != 1 or c2 = 3'
tdSql.query(query_sql)
tdSql.checkRows(3)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1 != 1 and c2 = 2'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 2)
## <> or and
query_sql = f'select * from {tb_name} where c1 <> 1 or c3 = 3'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 2)
query_sql = f'select * from {tb_name} where c1 <> 2 and c3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## >= or and
query_sql = f'select * from {tb_name} where c1 >= 2 or c3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
query_sql = f'select * from {tb_name} where c1 >= 2 and c3 = 1'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 2)
## <= or and
query_sql = f'select * from {tb_name} where c1 <= 1 or c3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(10)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1 <= 1 and c3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 4)
## <> or and is Null
query_sql = f'select * from {tb_name} where c1 <> 1 or c7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1 <> 2 and c7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## > or and is not Null
query_sql = f'select * from {tb_name} where c2 > 2 or c8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c2 > 2 and c8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 3)
## > or < or >= or <= or != or <> or = Null
query_sql = f'select * from {tb_name} where c1 > 1 or c2 < 2 or c3 >= 4 or c4 <= 2 or c5 != 1.1 or c6 <> 1.1 or c7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(8)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1 = 1 and c2 > 1 and c3 >= 1 and c4 <= 5 and c5 != 6.6 and c6 <> 7.7 and c7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## tiny small int big or
query_sql = f'select * from {tb_name} where c1 = 2 or c2 = 3 or c3 = 4 or c4 = 5'
tdSql.query(query_sql)
tdSql.checkRows(5)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1 = 1 and c2 = 2 and c3 = 1 and c4 = 3'
tdSql.query(query_sql)
tdSql.checkRows(5)
tdSql.checkEqual(self.queryLastC10(query_sql), 10)
## float double binary nchar bool or
query_sql = f'select * from {tb_name} where c5=6.6 or c6=7.7 or c7="binary8" or c8="nchar9" or c9=false'
tdSql.query(query_sql)
tdSql.checkRows(6)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c5=1.1 and c6=7.7 and c7="binary" and c8="nchar" and c9=true'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 7)
## all types or
query_sql = f'select * from {tb_name} where c1=2 or c2=3 or c3=4 or c4=5 or c5=6.6 or c6=7.7 or c7 nmatch "binary[134]" or c8="nchar9" or c9=false'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where c1=1 and c2=2 and c3=1 and c4=3 and c5=1.1 and c6=1.1 and c7 match "binary[28]" and c8 in ("nchar") and c9=true'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 8)
query_sql = f'select * from {tb_name} where c1=1 and c2=2 or c3=1 and c4=3 and c5=1.1 and c6=1.1 and c7 match "binary[28]" and c8 in ("nchar") and c9=true'
tdSql.query(query_sql)
tdSql.checkRows(7)
tdSql.checkEqual(self.queryLastC10(query_sql), 10)
def queryFullTagType(self, tb_name):
## != or and
query_sql = f'select * from {tb_name} where t1 != 1 or t2 = 3'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 != 1 and t2 = 2'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## <> or and
query_sql = f'select * from {tb_name} where t1 <> 1 or t3 = 3'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 <> 2 and t3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## >= or and
query_sql = f'select * from {tb_name} where t1 >= 2 or t3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 >= 1 and t3 = 1'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## <= or and
query_sql = f'select * from {tb_name} where t1 <= 1 or t3 = 4'
tdSql.query(query_sql)
tdSql.checkRows(22)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 <= 3 and t3 = 2'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## <> or and is Null
query_sql = f'select * from {tb_name} where t1 <> 1 or t7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 <> 2 and t7 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## > or and is not Null
query_sql = f'select * from {tb_name} where t2 > 2 or t8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(55)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t2 > 2 and t8 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(33)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## > or < or >= or <= or != or <> or = Null
query_sql = f'select * from {tb_name} where t1 > 1 or t2 < 2 or t3 >= 4 or t4 <= 2 or t5 != 1.1 or t6 <> 1.1 or t7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(55)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 >= 1 and t2 > 1 and t3 >= 1 and t4 <= 5 and t5 != 6.6 and t6 <> 7.7 and t7 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## tiny small int big or and
query_sql = f'select * from {tb_name} where t1 = 2 or t2 = 3 or t3 = 4 or t4 = 5'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1 = 1 and t2 = 2 and t3 = 1 and t4 = 3'
tdSql.query(query_sql)
tdSql.checkRows(0)
## float double binary nchar bool or and
query_sql = f'select * from {tb_name} where t5=2.2 or t6=7.7 or t7="binary8" or t8="nchar9" or t9=false'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t5=2.2 and t6=2.2 and t7="binary2" and t8="nchar2" and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## all types or and
query_sql = f'select * from {tb_name} where t1=2 or t2=3 or t3=4 or t4=5 or t5=6.6 or t6=7.7 or t7 nmatch "binary[134]" or t8="nchar9" or t9=false'
tdSql.query(query_sql)
tdSql.checkRows(44)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1=1 and t2=1 and t3>=1 and t4!=2 and t5=1.1 and t6=1.1 and t7 match "binary[18]" and t8 in ("nchar1") and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
query_sql = f'select * from {tb_name} where t1=1 and t2=1 or t3>=1 and t4!=2 and t5=1.1 and t6=1.1 and t7 match "binary[18]" and t8 in ("nchar1") and t9=true'
tdSql.query(query_sql)
tdSql.checkRows(11)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
def queryColMultiExpression(self, tb_name):
## condition_A and condition_B or condition_C (> < >=)
query_sql = f'select * from {tb_name} where c1 > 2 and c2 < 4 or c3 >= 4'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## (condition_A and condition_B) or condition_C (<= != <>)
query_sql = f'select * from {tb_name} where (c1 <= 1 and c2 != 2) or c4 <> 3'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## condition_A and (condition_B or condition_C) (Null not Null)
query_sql = f'select * from {tb_name} where c1 is not Null and (c6 = 7.7 or c8 is Null)'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## condition_A or condition_B and condition_C (> < >=)
query_sql = f'select * from {tb_name} where c1 > 2 or c2 < 4 and c3 >= 4'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## (condition_A or condition_B) and condition_C (<= != <>)
query_sql = f'select * from {tb_name} where (c1 <= 1 or c2 != 2) and c4 <> 3'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## condition_A or (condition_B and condition_C) (Null not Null)
query_sql = f'select * from {tb_name} where c6 >= 7.7 or (c1 is not Null and c3 =5)'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 7)
## condition_A or (condition_B and condition_C) or condition_D (> != < Null)
query_sql = f'select * from {tb_name} where c1 != 1 or (c2 >2 and c3 < 1) or c7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## condition_A and (condition_B or condition_C) and condition_D (>= = <= not Null)
query_sql = f'select * from {tb_name} where c4 >= 4 and (c1 = 2 or c5 <= 1.1) and c7 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(1)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
## (condition_A and condition_B) or (condition_C or condition_D) (Null >= > =)
query_sql = f'select * from {tb_name} where (c8 is Null and c1 >= 1) or (c3 > 3 or c4 =2)'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 11)
## (condition_A or condition_B) or condition_C or (condition_D and condition_E) (>= <= = not Null <>)
query_sql = f'select * from {tb_name} where (c1 >= 2 or c2 <= 1) or c3 = 4 or (c7 is not Null and c6 <> 1.1)'
tdSql.query(query_sql)
tdSql.checkRows(4)
tdSql.checkEqual(self.queryLastC10(query_sql), 7)
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
query_sql = f'select * from {tb_name} where c1 != 1 or (c2 <= 1 and c3 <4) or (c3 >= 4 or c7 is not Null) and c9 <> true'
tdSql.query(query_sql)
tdSql.checkRows(3)
tdSql.checkEqual(self.queryLastC10(query_sql), 10)
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
query_sql = f'select * from {tb_name} where (c1 != 1 or (c2 <= 2 and c3 >= 4) or (c3 >= 4 or c7 is not Null)) and c9 != false'
tdSql.query(query_sql)
tdSql.checkRows(9)
tdSql.checkEqual(self.queryLastC10(query_sql), 9)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
query_sql = f'select * from {tb_name} where c1 != 1 or (c2 <= 3 and c3 > 4) and c3 <= 5 and (c7 is not Null and c9 != false)'
tdSql.query(query_sql)
tdSql.checkRows(2)
tdSql.checkEqual(self.queryLastC10(query_sql), 5)
def queryTagMultiExpression(self, tb_name):
## condition_A and condition_B or condition_C (> < >=)
query_sql = f'select * from {tb_name} where t1 > 2 and t2 < 4 or t3 >= 4'
tdSql.query(query_sql)
tdSql.checkRows(33)
## (condition_A and condition_B) or condition_C (<= != <>)
query_sql = f'select * from {tb_name} where (t1 <= 1 and t2 != 2) or t4 <> 3'
tdSql.query(query_sql)
tdSql.checkRows(44)
## condition_A and (condition_B or condition_C) (Null not Null)
query_sql = f'select * from {tb_name} where t1 is not Null and (t6 = 7.7 or t8 is not Null)'
tdSql.query(query_sql)
tdSql.checkRows(55)
## condition_A or condition_B and condition_C (> < >=)
query_sql = f'select * from {tb_name} where t1 > 2 or t2 < 4 and t3 >= 4'
tdSql.query(query_sql)
tdSql.checkRows(33)
## (condition_A or condition_B) and condition_C (<= != <>)
query_sql = f'select * from {tb_name} where (t1 <= 1 or t2 != 2) and t4 <> 3'
tdSql.query(query_sql)
tdSql.checkRows(33)
## condition_A or (condition_B and condition_C) (Null not Null)
query_sql = f'select * from {tb_name} where t6 >= 7.7 or (t1 is not Null and t3 =5)'
tdSql.query(query_sql)
tdSql.checkRows(11)
## condition_A or (condition_B and condition_C) or condition_D (> != < Null)
query_sql = f'select * from {tb_name} where t1 != 1 or (t2 >2 and t3 < 1) or t7 is Null'
tdSql.query(query_sql)
tdSql.checkRows(44)
## condition_A and (condition_B or condition_C) and condition_D (>= = <= not Null)
query_sql = f'select * from {tb_name} where t4 >= 2 and (t1 = 2 or t5 <= 1.1) and t7 is not Null'
tdSql.query(query_sql)
tdSql.checkRows(11)
## (condition_A and condition_B) or (condition_C or condition_D) (Null >= > =)
query_sql = f'select * from {tb_name} where (t8 is Null and t1 >= 1) or (t3 > 3 or t4 =2)'
tdSql.query(query_sql)
tdSql.checkRows(33)
## (condition_A or condition_B) or condition_C or (condition_D and condition_E) (>= <= = not Null <>)
query_sql = f'select * from {tb_name} where (t1 >= 2 or t2 <= 1) or t3 = 4 or (t7 is not Null and t6 <> 1.1)'
tdSql.query(query_sql)
tdSql.checkRows(55)
## condition_A or (condition_B and condition_C) or (condition_D and condition_E) and condition_F
query_sql = f'select * from {tb_name} where t1 != 1 or (t2 <= 1 and t3 <4) or (t3 >= 4 or t7 is not Null) and t9 <> true'
tdSql.query(query_sql)
tdSql.checkRows(55)
## (condition_A or (condition_B and condition_C) or (condition_D and condition_E)) and condition_F
query_sql = f'select * from {tb_name} where (t1 != 1 or (t2 <= 2 and t3 >= 4) or (t3 >= 4 or t7 is not Null)) and t9 != false'
tdSql.query(query_sql)
tdSql.checkRows(55)
## (condition_A or condition_B) or (condition_C or condition_D) and (condition_E or condition_F or condition_G)
query_sql = f'select * from {tb_name} where t1 != 1 or (t2 <= 3 and t3 > 4) and t3 <= 5 and (t7 is not Null and t9 != false)'
tdSql.query(query_sql)
tdSql.checkRows(44)
def queryColPreCal(self, tb_name):
## avg sum condition_A or/and condition_B
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c10 = 5 or c8 is Null'
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 3)
tdSql.checkEqual(int(res[1]), 6)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c6 = 1.1 and c8 is not Null'
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 16)
## avg sum condition_A or/and condition_B or/and condition_C
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c10 = 4 or c8 is Null or c9 = false '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 2)
tdSql.checkEqual(int(res[1]), 6)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c6 = 1.1 and c8 is not Null and c9 = false '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 1)
tdSql.checkEqual(int(res[1]), 1)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c6 = 1.1 and c8 is not Null or c9 = false '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 17)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where c6 = 1.1 or c8 is not Null and c9 = false '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 17)
## count avg sum condition_A or/and condition_B or/and condition_C interval
query_sql = f'select count(*), avg(c3), sum(c3) from {tb_name} where c10 = 4 or c8 is Null or c9 = false interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 1)
tdSql.checkEqual(int(res[0][2]), 4)
tdSql.checkEqual(int(res[0][3]), 4)
tdSql.checkEqual(int(res[1][1]), 2)
tdSql.checkEqual(int(res[1][2]), 1)
tdSql.checkEqual(int(res[1][3]), 2)
query_sql = f'select count(*), avg(c3), sum(c3) from {tb_name} where c6 = 1.1 and c8 is not Null and c9 = false interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(1)
tdSql.checkEqual(int(res[0][1]), 1)
tdSql.checkEqual(int(res[0][2]), 1)
tdSql.checkEqual(int(res[0][3]), 1)
## count avg sum condition_A or condition_B or in and like or condition_C interval
query_sql = f'select count(*), sum(c3) from {tb_name} where c10 = 4 or c8 is Null or c2 in (1, 2) and c7 like "binary_" or c1 <> 1 interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 2)
tdSql.checkEqual(int(res[0][2]), 5)
tdSql.checkEqual(int(res[1][1]), 2)
tdSql.checkEqual(int(res[1][2]), 2)
def queryTagPreCal(self, tb_name):
## avg sum condition_A or/and condition_B
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t10 = 5 or t8 is Null'
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 1)
tdSql.checkEqual(int(res[1]), 18)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t6 = 1.1 and t8 is not Null'
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 18)
## avg sum condition_A or/and condition_B or/and condition_C
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t10 = 4 or t8 is Null or t9 = true '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 1)
tdSql.checkEqual(int(res[1]), 90)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t6 = 1.1 and t8 is not Null and t9 = true '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[0]), 1)
tdSql.checkEqual(int(res[1]), 18)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t6 = 1.1 and t8 is not Null or t9 = true '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 90)
query_sql = f'select avg(c3), sum(c3) from {tb_name} where t6 = 1.1 or t8 is not Null and t9 = true '
res = tdSql.query(query_sql, True)[0]
tdSql.checkEqual(int(res[1]), 90)
## count avg sum condition_A or/and condition_B or/and condition_C interval
query_sql = f'select count(*), avg(c3), sum(c3) from {tb_name} where t10 = 4 or t8 is Null or t9 = true interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 25)
tdSql.checkEqual(int(res[0][2]), 2)
tdSql.checkEqual(int(res[0][3]), 60)
tdSql.checkEqual(int(res[1][1]), 30)
tdSql.checkEqual(int(res[1][2]), 1)
tdSql.checkEqual(int(res[1][3]), 30)
query_sql = f'select count(*), avg(c3), sum(c3) from {tb_name} where t6 = 1.1 and t8 is not Null and t9 = true interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 5)
tdSql.checkEqual(int(res[0][2]), 2)
tdSql.checkEqual(int(res[0][3]), 12)
tdSql.checkEqual(int(res[1][1]), 6)
tdSql.checkEqual(int(res[1][2]), 1)
tdSql.checkEqual(int(res[1][3]), 6)
## count avg sum condition_A or condition_B or in and like or condition_C interval
query_sql = f'select count(*), sum(c3) from {tb_name} where t10 = 4 or t8 is Null or t2 in (1, 2) and t7 like "binary_" or t1 <> 1 interval(16d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 25)
tdSql.checkEqual(int(res[0][2]), 60)
tdSql.checkEqual(int(res[1][1]), 30)
tdSql.checkEqual(int(res[1][2]), 30)
def queryMultiTb(self, tb_name):
## select from (condition_A or condition_B)
query_sql = f'select c10 from (select * from {tb_name} where c1 >1 or c2 >=3)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(3)
tdSql.checkEqual(int(res[2][0]), 11)
## select from (condition_A or condition_B) where condition_A or condition_B
query_sql = f'select c10 from (select * from {tb_name} where c1 >1 or c2 >=3) where c1 =2 or c4 = 2'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[1][0]), 3)
## select from (condition_A or condition_B and like and in) where condition_A or condition_B or like and in
query_sql = f'select c10 from (select * from {tb_name} where c1 >1 or c2 = 2 and c7 like "binar_" and c4 in (3, 5)) where c1 != 2 or c3 = 1 or c8 like "ncha_" and c9 in (true)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(7)
tdSql.checkEqual(int(res[6][0]), 10)
## select count avg sum from (condition_A or condition_B and like and in) where condition_A or condition_B or like and in interval
query_sql = f'select count(*), avg(c6), sum(c3) from (select * from {tb_name} where c1 >1 or c2 = 2 and c7 like "binar_" and c4 in (3, 5)) where c1 != 2 or c3 = 1 or c8 like "ncha_" and c9 in (true) interval(8d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(3)
tdSql.checkEqual(int(res[0][1]), 3)
tdSql.checkEqual(int(res[0][2]), 1)
tdSql.checkEqual(int(res[0][3]), 10)
tdSql.checkEqual(int(res[1][1]), 3)
tdSql.checkEqual(int(res[1][2]), 3)
tdSql.checkEqual(int(res[1][3]), 3)
tdSql.checkEqual(int(res[2][1]), 1)
tdSql.checkEqual(int(res[2][2]), 1)
tdSql.checkEqual(int(res[2][3]), 1)
## cname
query_sql = f'select c10 from (select * from {tb_name} where c1 >1 or c2 = 2 and c7 like "binar_" and c4 in (3, 5)) a where a.c1 != 2 or a.c3 = 1 or a.c8 like "ncha_" and a.c9 in (true)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(7)
tdSql.checkEqual(int(res[6][0]), 10)
## multi cname
query_sql = f'select b.c10 from (select * from {tb_name} where c9 = true or c2 = 2) a, (select * from {tb_name} where c7 like "binar_" or c4 in (3, 5)) b where a.ts = b.ts'
res = tdSql.query(query_sql, True)
tdSql.checkRows(10)
tdSql.checkEqual(int(res[9][0]), 10)
def queryMultiTbWithTag(self, tb_name):
## select count avg sum from (condition_A or condition_B and like and in) where condition_A or condition_B or condition_tag_C or condition_tag_D or like and in interval
query_sql = f'select count(*), avg(c6), sum(c3) from (select * from {tb_name} where c1 >1 or c2 = 2 and c7 like "binar_" and c4 in (3, 5)) where c1 != 2 or c3 = 1 or t1=2 or t1=3 or c8 like "ncha_" and c9 in (true) interval(8d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(3)
tdSql.checkEqual(int(res[0][1]), 17)
tdSql.checkEqual(int(res[0][2]), 1)
tdSql.checkEqual(int(res[0][3]), 38)
tdSql.checkEqual(int(res[1][1]), 10)
tdSql.checkEqual(int(res[1][2]), 2)
tdSql.checkEqual(int(res[1][3]), 17)
tdSql.checkEqual(int(res[2][1]), 8)
tdSql.checkEqual(int(res[2][2]), 1)
tdSql.checkEqual(int(res[2][3]), 15)
## select count avg sum from (condition_A and condition_B and and line and in and ts and condition_tag_A and condition_tag_B and between) where condition_C orr condition_D or condition_tag_C or condition_tag_D or like and in interval
query_sql = f'select count(*), avg(c6), sum(c3) from (select * from {tb_name} where c1 >= 1 and c2 = 2 and c7 like "binar_" and c4 in (3, 5) and ts > "2021-01-11 12:00:00" and t1 < 2 and t1 > 0 and c6 between 0 and 7) where c1 != 2 or c3 = 1 or t1=2 or t1=3 or c8 like "ncha_" and c9 in (true) interval(8d)'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(int(res[0][1]), 2)
tdSql.checkEqual(int(res[0][2]), 1)
tdSql.checkEqual(int(res[0][3]), 2)
tdSql.checkEqual(int(res[1][1]), 1)
tdSql.checkEqual(int(res[1][2]), 1)
tdSql.checkEqual(int(res[1][3]), 1)
def queryJoin(self, tb_name):
## between tss tag
query_sql = f'select stb1.ts, stb2.ts, stb1.t1, stb1.c10 from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.ts <= "2021-01-07 12:00:00" and stb2.ts < "2021-01-07 12:00:00" and stb1.t1 = stb2.t1'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
tdSql.checkEqual(str(res[0][0]), "2021-01-01 12:00:00")
tdSql.checkEqual(str(res[1][1]), "2021-01-05 12:00:00")
## between ts tag col
query_sql = f'select stb1.t1, stb2.t1, stb1.c1, stb2.c2 from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.t1 = stb2.t1 and stb2.c2 <= 2 and stb1.c1 > 0'
res = tdSql.query(query_sql, True)
tdSql.checkRows(9)
## between ts tags
query_sql = f'select stb1.t1, stb2.t1, stb1.c1, stb2.c2 from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.t1 = stb2.t1 and stb1.t1 = 1 '
res = tdSql.query(query_sql, True)
tdSql.checkRows(11)
## between ts tag tbnames
query_sql = f'select stb1.t1, stb2.t1, stb1.c1, stb2.c2 from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.t1 = stb2.t1 and stb1.tbname is not Null'
res = tdSql.query(query_sql, True)
tdSql.checkRows(11)
## between ts col tag tbname
query_sql = f'select stb1.tbname, stb1.t1, stb2.t1, stb1.c1, stb2.c2 from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.t1 = stb2.t1 and stb1.tbname is not Null and stb1.c2 = 3'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
query_sql = f'select stb1.tbname, stb1.*, stb2.tbname, stb1.* from {tb_name}1 stb1, {tb_name}2 stb2 where stb1.ts = stb2.ts and stb1.t1 = stb2.t1 and (stb1.t2 != 1 or stb1.t3 <= 1) and (stb2.tbname like "{tb_name}%" or stb2.tbname is Null ) and stb1.tbname is not Null and stb2.c2 = 3'
res = tdSql.query(query_sql, True)
tdSql.checkRows(2)
def checkTbColTypeOperator(self):
'''
Ordinary table full column type and operator
'''
tb_name = self.initTb()
self.queryFullColType(tb_name)
def checkStbColTypeOperator(self):
'''
Super table full column type and operator
'''
tb_name = self.initStb()
self.queryFullColType(f'{tb_name}_sub_1')
def checkStbTagTypeOperator(self):
'''
Super table full tag type and operator
'''
tb_name = self.initStb()
self.queryFullTagType(tb_name)
def checkTbTsCol(self):
'''
Ordinary table ts and col check
'''
tb_name = self.initTb()
self.queryTsCol(tb_name)
def checkStbTsTol(self):
tb_name = self.initStb()
self.queryTsCol(f'{tb_name}_sub_1')
def checkStbTsTag(self):
tb_name = self.initStb()
self.queryTsTag(tb_name)
def checkStbTsColTag(self):
tb_name = self.initStb()
self.queryTsColTag(tb_name)
def checkTbMultiExpression(self):
'''
Ordinary table multiExpression
'''
tb_name = self.initTb()
self.queryColMultiExpression(tb_name)
def checkStbMultiExpression(self):
'''
Super table multiExpression
'''
tb_name = self.initStb()
self.queryColMultiExpression(f'{tb_name}_sub_1')
self.queryTagMultiExpression(tb_name)
def checkTbPreCal(self):
'''
Ordinary table precal
'''
tb_name = self.initTb()
self.queryColPreCal(tb_name)
def checkStbPreCal(self):
'''
Super table precal
'''
tb_name = self.initStb()
self.queryColPreCal(f'{tb_name}_sub_1')
self.queryTagPreCal(tb_name)
def checkMultiTb(self):
'''
test "or" in multi ordinary table
'''
tb_name = self.initTb()
self.queryMultiTb(tb_name)
def checkMultiStb(self):
'''
test "or" in multi super table
'''
tb_name = self.initStb()
self.queryMultiTb(f'{tb_name}_sub_1')
def checkMultiTbWithTag(self):
'''
test Multi tb with tag
'''
tb_name = self.initStb()
self.queryMultiTbWithTag(tb_name)
def checkMultiStbJoin(self):
'''
join test
'''
tb_name = self.initTwoStb()
self.queryJoin(tb_name)
def run(self):
tdSql.prepare()
self.checkTbColTypeOperator()
self.checkStbColTypeOperator()
self.checkStbTagTypeOperator()
self.checkTbTsCol()
self.checkStbTsTol()
self.checkStbTsTag()
self.checkStbTsColTag()
self.checkTbMultiExpression()
self.checkStbMultiExpression()
self.checkTbPreCal()
self.checkStbPreCal()
self.checkMultiTb()
self.checkMultiStb()
self.checkMultiTbWithTag()
self.checkMultiStbJoin()
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
...@@ -29,18 +29,18 @@ class TDTestCase: ...@@ -29,18 +29,18 @@ class TDTestCase:
print("==============step1") print("==============step1")
##2021-09-17 For jira: https://jira.taosdata.com:18080/browse/TD-6585 ##2021-09-17 For jira: https://jira.taosdata.com:18080/browse/TD-6585
tdSql.execute( tdSql.execute(
"create stable if not exists stb_test(ts timestamp,c0 binary(32),c1 int) tags(t0 binary(32))" "create stable if not exists stb_test(ts timestamp,c0 binary(32),c1 int,c2 nchar(50)) tags(t0 binary(32),t1 nchar(50))"
) )
tdSql.execute( tdSql.execute(
'create table if not exists stb_1 using stb_test tags("abcdefgasdfg12346")' 'create table if not exists stb_1 using stb_test tags("abcdefgasdfg12346","涛思数据")'
) )
tdLog.info('insert into stb_1 values("2021-09-13 10:00:00.001","abcefdasdqwerxasdazx12345",15') tdLog.info('insert into stb_1 values("2021-09-13 10:00:00.001","abcefdasdqwerxasdazx12345",15,"引擎一组"')
tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.002","abcefdasdqwerxasdazx12345",15)') tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.002","abcefdasdqwerxasdazx12345",15,"引擎一组一号")')
tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.003","aaaaafffwwqqxzz",16)') tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.003","aaaaafffwwqqxzz",16,"引擎一组二号")')
tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.004","fffwwqqxzz",17)') tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.004","fffwwqqxzz",17,"涛涛思思")')
tdSql.execute('insert into stb_1 values("2020-10-13 10:00:00.001","abcd\\\efgh",100)') tdSql.execute('insert into stb_1 values("2020-10-13 10:00:00.001","abcd\\\efgh",100,"思涛思")')
tdSql.query('select * from stb_test where tbname match "asd"') tdSql.query('select * from stb_test where tbname match "asd"')
tdSql.checkRows(0) tdSql.checkRows(0)
...@@ -98,6 +98,31 @@ class TDTestCase: ...@@ -98,6 +98,31 @@ class TDTestCase:
tdSql.query("select * from stb_1 where c0 nmatch '\\\\'") tdSql.query("select * from stb_1 where c0 nmatch '\\\\'")
tdSql.checkRows(3) tdSql.checkRows(3)
#2021-10-20 for https://jira.taosdata.com:18080/browse/TD-10708
tdSql.query('select * from stb_1 where c2 match "^涛"')
tdSql.checkRows(1)
tdSql.query('select * from stb_1 where c2 nmatch "^涛"')
tdSql.checkRows(3)
tdSql.query('select * from stb_1 where c2 match "号$"')
tdSql.checkRows(2)
tdSql.query('select * from stb_1 where c2 nmatch "号$"')
tdSql.checkRows(2)
tdSql.query('select * from stb_1 where c2 match "涛+思"')
tdSql.checkRows(2)
tdSql.query('select * from stb_1 where c2 nmatch "涛+思"')
tdSql.checkRows(2)
tdSql.query('select * from stb_1 where c2 match "涛*思"')
tdSql.checkRows(2)
tdSql.query('select * from stb_1 where c2 nmatch "涛*思"')
tdSql.checkRows(2)
......
...@@ -54,27 +54,36 @@ class TDTestCase: ...@@ -54,27 +54,36 @@ class TDTestCase:
binPath = buildPath + "/build/bin/" binPath = buildPath + "/build/bin/"
if(threadID == 0): if(threadID == 0):
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT -m t" % print("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords))
os.system("%staosdemo -y -t %d -n %d -b INT,INT,INT,INT" %
(binPath, self.numberOfTables, self.numberOfRecords)) (binPath, self.numberOfTables, self.numberOfRecords))
if(threadID == 1): if(threadID == 1):
time.sleep(2) time.sleep(2)
print("use test") print("use test")
while True: max_try = 100
count = 0
while (count < max_try):
try: try:
tdSql.execute("use test") tdSql.execute("use test")
break break
except Exception as e: except Exception as e:
tdLog.info("use database test failed") tdLog.info("use database test failed")
time.sleep(1) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
# check if all the tables have heen created # check if all the tables have heen created
while True: count = 0
while (count < max_try):
try: try:
tdSql.query("show tables") tdSql.query("show tables")
except Exception as e: except Exception as e:
tdLog.info("show tables test failed") tdLog.info("show tables test failed")
time.sleep(1) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
rows = tdSql.queryRows rows = tdSql.queryRows
...@@ -83,13 +92,17 @@ class TDTestCase: ...@@ -83,13 +92,17 @@ class TDTestCase:
break break
time.sleep(1) time.sleep(1)
# check if there are any records in the last created table # check if there are any records in the last created table
while True: count = 0
while (count < max_try):
print("query started") print("query started")
print("try %d times" % count)
try: try:
tdSql.query("select * from test.t7") tdSql.query("select * from test.d7")
except Exception as e: except Exception as e:
tdLog.info("select * test failed") tdLog.info("select * test failed")
time.sleep(2) time.sleep(2)
count += 1
print("try %d times" % count)
continue continue
rows = tdSql.queryRows rows = tdSql.queryRows
...@@ -100,8 +113,8 @@ class TDTestCase: ...@@ -100,8 +113,8 @@ class TDTestCase:
print("alter table test.meters add column c10 int") print("alter table test.meters add column c10 int")
tdSql.execute("alter table test.meters add column c10 int") tdSql.execute("alter table test.meters add column c10 int")
print("insert into test.t7 values (now, 1, 2, 3, 4, 0)") print("insert into test.d7 values (now, 1, 2, 3, 4, 0)")
tdSql.execute("insert into test.t7 values (now, 1, 2, 3, 4, 0)") tdSql.execute("insert into test.d7 values (now, 1, 2, 3, 4, 0)")
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
......
...@@ -88,6 +88,18 @@ sql select csum(tbcol) as b from $tb where ts <= $ms interval(1m) -x step6 ...@@ -88,6 +88,18 @@ sql select csum(tbcol) as b from $tb where ts <= $ms interval(1m) -x step6
return -1 return -1
step6: step6:
print =============== csum result overflow follow sum behavior
sql create table overflow(ts timestamp, c1 bigint)
sql insert into overflow values(now-1s, NULL)(now, 9223372036854775807)(now+1s, 9223372036854775807)
sql select csum(c1) from overflow
print $data00 , $data01, $data10, $data11
if $data01 != 9223372036854775807 then
return -1
endi
if $data11 != -2 then
return -1
endi
print =============== clear print =============== clear
sql drop database $db sql drop database $db
sql show databases sql show databases
......
...@@ -86,12 +86,13 @@ endi ...@@ -86,12 +86,13 @@ endi
if $data07 != 11,12,13 then if $data07 != 11,12,13 then
return -1 return -1
endi endi
sql alter database $db keep 365000,365000,365000 sql_error alter database $db keep 365000,365000,365000
sql alter database $db keep 36500,36500,36500
sql show databases sql show databases
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data07 != 365000,365000,365000 then if $data07 != 36500,36500,36500 then
return -1 return -1
endi endi
......
...@@ -79,15 +79,16 @@ endi ...@@ -79,15 +79,16 @@ endi
if $data07 != 13 then if $data07 != 13 then
return -1 return -1
endi endi
sql alter database $db keep 365000 sql alter database $db keep 36500
sql show databases sql show databases
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data07 != 365000 then if $data07 != 36500 then
return -1 return -1
endi endi
sql_error alter database $db keep 365000
##### alter table test, simeplest case ##### alter table test, simeplest case
sql create table tb (ts timestamp, c1 int, c2 int, c3 int) sql create table tb (ts timestamp, c1 int, c2 int, c3 int)
......
...@@ -144,6 +144,25 @@ if $data30 != @456 123@ then ...@@ -144,6 +144,25 @@ if $data30 != @456 123@ then
return -1 return -1
endi endi
##MODIFY TAG
sql alter stable stb0 add tag `key` binary(10)
sql alter stable stb0 add tag `value` nchar(10)
sql alter stable stb0 modify tag `key` binary(15)
sql alter stable stb0 modify tag `value` nchar(15)
sql describe stb0;
if $rows != 7 then
return -1
endi
if $data52 != 15 then
return -1
endi
if $data62 != 15 then
return -1
endi
##SET TAG ##SET TAG
sql insert into ctb0 values (now, 1) sql insert into ctb0 values (now, 1)
...@@ -155,6 +174,7 @@ sql alter table ctb0 set tag `456 123`=2 ...@@ -155,6 +174,7 @@ sql alter table ctb0 set tag `456 123`=2
#sql alter table ctb0 set tag `abc.123`=2 #sql alter table ctb0 set tag `abc.123`=2
#change tag has bug when using dot in tagname #change tag has bug when using dot in tagname
print ======================= test insert specific tags automatically create table print ======================= test insert specific tags automatically create table
sql alter table ctb0 set tag `321`=2 sql alter table ctb0 set tag `321`=2
...@@ -184,3 +204,4 @@ if $data24 != NULL then ...@@ -184,3 +204,4 @@ if $data24 != NULL then
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册