diff --git a/documentation20/cn/12.taos-sql/docs.md b/documentation20/cn/12.taos-sql/docs.md
index b4fa2b160aa8ec04ba3a45db0fbbca17022cbd23..58191e0bd8faa02b0ff2381f1cdd576b379ae9fc 100644
--- a/documentation20/cn/12.taos-sql/docs.md
+++ b/documentation20/cn/12.taos-sql/docs.md
@@ -29,21 +29,21 @@ taos> DESCRIBE meters;
## 支持的数据类型
-使用TDengine,最重要的是时间戳。创建并插入记录、查询历史记录的时候,均需要指定时间戳。时间戳有如下规则:
+使用 TDengine,最重要的是时间戳。创建并插入记录、查询历史记录的时候,均需要指定时间戳。时间戳有如下规则:
-- 时间格式为```YYYY-MM-DD HH:mm:ss.MS```, 默认时间分辨率为毫秒。比如:```2017-08-12 18:25:58.128```
-- 内部函数now是服务器的当前时间
-- 插入记录时,如果时间戳为now,插入数据时使用服务器当前时间
-- Epoch Time: 时间戳也可以是一个长整数,表示从1970-01-01 08:00:00.000开始的毫秒数
-- 时间可以加减,比如 now-2h,表明查询时刻向前推2个小时(最近2小时)。 数字后面的时间单位可以是 a(毫秒)、s(秒)、 m(分)、h(小时)、d(天)、w(周)。 比如select * from t1 where ts > now-2w and ts <= now-1w, 表示查询两周前整整一周的数据。 在指定降频操作(down sampling)的时间窗口(interval)时,时间单位还可以使用 n(自然月) 和 y(自然年)。
+- 时间格式为 ```YYYY-MM-DD HH:mm:ss.MS```,默认时间分辨率为毫秒。比如:```2017-08-12 18:25:58.128```
+- 内部函数 now 是客户端的当前时间
+- 插入记录时,如果时间戳为 now,插入数据时使用提交这条记录的客户端的当前时间
+- Epoch Time:时间戳也可以是一个长整数,表示从 1970-01-01 08:00:00.000 开始的毫秒数
+- 时间可以加减,比如 now-2h,表明查询时刻向前推 2 个小时(最近 2 小时)。数字后面的时间单位可以是 u(微秒)、a(毫秒)、s(秒)、m(分)、h(小时)、d(天)、w(周)。 比如 `select * from t1 where ts > now-2w and ts <= now-1w`,表示查询两周前整整一周的数据。在指定降频操作(down sampling)的时间窗口(interval)时,时间单位还可以使用 n(自然月) 和 y(自然年)。
-TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMicrosecond就可支持微秒。
+TDengine 缺省的时间戳是毫秒精度,但通过修改配置参数 enableMicrosecond 就可以支持微秒。
-在TDengine中,普通表的数据模型中可使用以下10种数据类型。
+在TDengine中,普通表的数据模型中可使用以下 10 种数据类型。
| | 类型 | Bytes | 说明 |
| ---- | :-------: | ------ | ------------------------------------------------------------ |
-| 1 | TIMESTAMP | 8 | 时间戳。缺省精度毫秒,可支持微秒。从格林威治时间 1970-01-01 00:00:00.000 (UTC/GMT) 开始,计时不能早于该时间。 |
+| 1 | TIMESTAMP | 8 | 时间戳。缺省精度毫秒,可支持微秒。从格林威治时间 1970-01-01 00:00:00.000 (UTC/GMT) 开始,计时不能早于该时间。(从 2.0.18 版本开始,已经去除了这一时间范围限制) |
| 2 | INT | 4 | 整型,范围 [-2^31+1, 2^31-1], -2^31 用作 NULL |
| 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63 用于 NULL |
| 4 | FLOAT | 4 | 浮点型,有效位数 6-7,范围 [-3.4E38, 3.4E38] |
diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c
index 3249529b34580b519ef1c6dbe9bfe7e76e0cb7cc..0cfcff3a9869cecb318ca293fbb9e165924a1c07 100644
--- a/src/client/src/tscAsync.c
+++ b/src/client/src/tscAsync.c
@@ -301,7 +301,7 @@ static void tscAsyncResultCallback(SSchedMsg *pMsg) {
taosReleaseRef(tscObjRef, pSql->self);
}
-void tscAsyncResultOnError(SSqlObj* pSql) {
+void tscAsyncResultOnError(SSqlObj* pSql) {
SSchedMsg schedMsg = {0};
schedMsg.fp = tscAsyncResultCallback;
schedMsg.ahandle = (void *)pSql->self;
@@ -505,10 +505,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
return;
_error:
- if (code != TSDB_CODE_SUCCESS) {
- pSql->res.code = code;
- tscAsyncResultOnError(pSql);
- }
-
+ pRes->code = code;
+ tscAsyncResultOnError(pSql);
taosReleaseRef(tscObjRef, pSql->self);
}
diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c
index b0728aa8aac3c38698371a4b2cdc759fdbe5f045..5841aa0cd559759225534a4b1abe95b162ba9102 100644
--- a/src/client/src/tscSQLParser.c
+++ b/src/client/src/tscSQLParser.c
@@ -3293,7 +3293,8 @@ static int32_t extractColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SC
}
if (pSchema->type == TSDB_DATA_TYPE_BOOL) {
- if (pExpr->tokenId != TK_EQ && pExpr->tokenId != TK_NE) {
+ int32_t t = pExpr->tokenId;
+ if (t != TK_EQ && t != TK_NE && t != TK_NOTNULL && t != TK_ISNULL) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
}
}
@@ -3493,7 +3494,8 @@ static int32_t validateSQLExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, SQueryInfo* pQuer
}
pList->ids[pList->num++] = index;
- } else if (pExpr->tokenId == TK_FLOAT && (isnan(pExpr->value.dKey) || isinf(pExpr->value.dKey))) {
+ } else if ((pExpr->tokenId == TK_FLOAT && (isnan(pExpr->value.dKey) || isinf(pExpr->value.dKey))) ||
+ pExpr->tokenId == TK_NULL) {
return TSDB_CODE_TSC_INVALID_SQL;
} else if (pExpr->type == SQL_NODE_SQLFUNCTION) {
if (*type == NON_ARITHMEIC_EXPR) {
@@ -3727,6 +3729,39 @@ static int32_t setExprToCond(tSqlExpr** parent, tSqlExpr* pExpr, const char* msg
return TSDB_CODE_SUCCESS;
}
+static int32_t validateNullExpr(tSqlExpr* pExpr, char* msgBuf) {
+ const char* msg = "only support is [not] null";
+
+ tSqlExpr* pRight = pExpr->pRight;
+ if (pRight->tokenId == TK_NULL && (!(pExpr->tokenId == TK_ISNULL || pExpr->tokenId == TK_NOTNULL))) {
+ return invalidSqlErrMsg(msgBuf, msg);
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
+// check for like expression
+static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) {
+ const char* msg1 = "wildcard string should be less than 20 characters";
+ const char* msg2 = "illegal column name";
+
+ tSqlExpr* pLeft = pExpr->pLeft;
+ tSqlExpr* pRight = pExpr->pRight;
+
+ if (pExpr->tokenId == TK_LIKE) {
+ if (pRight->value.nLen > TSDB_PATTERN_STRING_MAX_LEN) {
+ return invalidSqlErrMsg(msgBuf, msg1);
+ }
+
+ SSchema* pSchema = tscGetTableSchema(pTableMeta);
+ if ((!isTablenameToken(&pLeft->colInfo)) && !IS_VAR_DATA_TYPE(pSchema[index].type)) {
+ return invalidSqlErrMsg(msgBuf, msg2);
+ }
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SCondExpr* pCondExpr,
int32_t* type, int32_t parentOptr) {
const char* msg1 = "table query cannot use tags filter";
@@ -3736,8 +3771,7 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
const char* msg5 = "not support ordinary column join";
const char* msg6 = "only one query condition on tbname allowed";
const char* msg7 = "only in/like allowed in filter table name";
- const char* msg8 = "wildcard string should be less than 20 characters";
-
+
tSqlExpr* pLeft = (*pExpr)->pLeft;
tSqlExpr* pRight = (*pExpr)->pRight;
@@ -3753,6 +3787,18 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
STableMeta* pTableMeta = pTableMetaInfo->pTableMeta;
+ // validate the null expression
+ int32_t code = validateNullExpr(*pExpr, tscGetErrorMsgPayload(pCmd));
+ if (code != TSDB_CODE_SUCCESS) {
+ return code;
+ }
+
+ // validate the like expression
+ code = validateLikeExpr(*pExpr, pTableMeta, index.columnIndex, tscGetErrorMsgPayload(pCmd));
+ if (code != TSDB_CODE_SUCCESS) {
+ return code;
+ }
+
if (index.columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX) { // query on time range
if (!validateJoinExprNode(pCmd, pQueryInfo, *pExpr, &index)) {
return TSDB_CODE_TSC_INVALID_SQL;
@@ -3774,7 +3820,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
int16_t leftIdx = index.tableIndex;
- SColumnIndex index = COLUMN_INDEX_INITIALIZER;
if (getColumnIndexByName(pCmd, &pRight->colInfo, pQueryInfo, &index) != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
@@ -3821,20 +3866,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
}
- // check for like expression
- if ((*pExpr)->tokenId == TK_LIKE) {
- if (pRight->value.nLen > TSDB_PATTERN_STRING_MAX_LEN) {
- return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8);
- }
-
- SSchema* pSchema = tscGetTableSchema(pTableMetaInfo->pTableMeta);
-
- if ((!isTablenameToken(&pLeft->colInfo)) && pSchema[index.columnIndex].type != TSDB_DATA_TYPE_BINARY &&
- pSchema[index.columnIndex].type != TSDB_DATA_TYPE_NCHAR) {
- return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
- }
- }
-
// in case of in operator, keep it in a seprate attribute
if (index.columnIndex == TSDB_TBNAME_COLUMN_INDEX) {
if (!validTableNameOptr(*pExpr)) {
diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c
index ad3624646160c17a04a286ae3e076d868851aaaf..57b57dba5a2982fc04447b6c3f60a67744935e7a 100644
--- a/src/client/src/tscUtil.c
+++ b/src/client/src/tscUtil.c
@@ -309,7 +309,7 @@ void tscSetResRawPtr(SSqlRes* pRes, SQueryInfo* pQueryInfo) {
int32_t offset = 0;
- for (int32_t i = 0; i < pRes->numOfCols; ++i) {
+ for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutput; ++i) {
SInternalField* pInfo = (SInternalField*)TARRAY_GET_ELEM(pQueryInfo->fieldsInfo.internalField, i);
pRes->urow[i] = pRes->data + offset * pRes->numOfRows;
diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c
index ea0ef4655d4cc98949012f125d9805ac20642d1a..410e6bb1888a11858e5d091f3f82c54df4dc2022 100644
--- a/src/dnode/src/dnodeMain.c
+++ b/src/dnode/src/dnodeMain.c
@@ -238,9 +238,11 @@ static int32_t dnodeInitStorage() {
}
TDIR *tdir = tfsOpendir("vnode_bak/.staging");
- if (tfsReaddir(tdir) != NULL) {
+ bool stagingNotEmpty = tfsReaddir(tdir) != NULL;
+ tfsClosedir(tdir);
+
+ if (stagingNotEmpty) {
dError("vnode_bak/.staging dir not empty, fix it first.");
- tfsClosedir(tdir);
return -1;
}
diff --git a/src/dnode/src/dnodeVWrite.c b/src/dnode/src/dnodeVWrite.c
index 87b31e4604882d750e4a43fde4a6d818cc862e98..84fd260d91420ea19a796f10fa96d1fbbb1ac648 100644
--- a/src/dnode/src/dnodeVWrite.c
+++ b/src/dnode/src/dnodeVWrite.c
@@ -205,7 +205,7 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
pWrite->rpcMsg.ahandle, taosMsg[pWrite->pHead.msgType], qtypeStr[qtype], pWrite->pHead.version);
pWrite->code = vnodeProcessWrite(pVnode, &pWrite->pHead, qtype, pWrite);
- if (pWrite->code <= 0) pWrite->processedCount = 1;
+ if (pWrite->code <= 0) atomic_add_fetch_32(&pWrite->processedCount, 1);
if (pWrite->code > 0) pWrite->code = 0;
if (pWrite->code == 0 && pWrite->pHead.msgType != TSDB_MSG_TYPE_SUBMIT) forceFsync = true;
diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c
index 9f367b41f8aaefd5871d206093105657d6c25378..7eb55acda829e0bd21b798a4effd66983e1dcc61 100644
--- a/src/kit/taosdemo/taosdemo.c
+++ b/src/kit/taosdemo/taosdemo.c
@@ -85,7 +85,7 @@ enum TEST_MODE {
#define MAX_NUM_DATATYPE 10
#define MAX_DB_COUNT 8
-#define MAX_SUPER_TABLE_COUNT 8
+#define MAX_SUPER_TABLE_COUNT 200
#define MAX_COLUMN_COUNT 1024
#define MAX_TAG_COUNT 128
@@ -506,7 +506,7 @@ static int taosRandom()
#endif
-static int createDatabases();
+static int createDatabasesAndStables();
static void createChildTables();
static int queryDbExec(TAOS *taos, char *command, QUERY_TYPE type, bool quiet);
@@ -2416,7 +2416,7 @@ static int createSuperTable(TAOS * taos, char* dbName,
return 0;
}
-static int createDatabases() {
+static int createDatabasesAndStables() {
TAOS * taos = NULL;
int ret = 0;
taos = taos_connect(g_Dbs.host, g_Dbs.user, g_Dbs.password, NULL, g_Dbs.port);
@@ -4090,7 +4090,7 @@ static bool getInfoFromJsonFile(char* file) {
}
bool ret = false;
- int maxLen = 64000;
+ int maxLen = 6400000;
char *content = calloc(1, maxLen + 1);
int len = fread(content, 1, maxLen, fp);
if (len <= 0) {
@@ -4455,7 +4455,7 @@ static int generateDataTail(char *tableName, int32_t tableSeq,
break;
}
- buffer += sprintf(buffer, " %s", data);
+ buffer += snprintf(buffer, retLen + 1, "%s", data);
k++;
len += retLen;
remainderBufLen -= retLen;
@@ -4682,6 +4682,12 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
for (int i = 0; i < batchPerTblTimes; i ++) {
getTableName(tableName, pThreadInfo, tableSeq);
+ if (0 == strlen(tableName)) {
+ errorPrint("[%d] %s() LN%d, getTableName return null\n",
+ pThreadInfo->threadID, __func__, __LINE__);
+ return NULL;
+ exit(-1);
+ }
int headLen;
if (i == 0) {
@@ -4728,7 +4734,7 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
remainderBufLen -= dataLen;
recOfBatch += batchPerTbl;
- startTime += batchPerTbl * superTblInfo->timeStampStep;
+// startTime += batchPerTbl * superTblInfo->timeStampStep;
pThreadInfo->totalInsertRows += batchPerTbl;
verbosePrint("[%d] %s() LN%d batchPerTbl=%d recOfBatch=%d\n",
pThreadInfo->threadID, __func__, __LINE__,
@@ -4738,9 +4744,12 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
if (insertMode == INTERLACE_INSERT_MODE) {
if (tableSeq == pThreadInfo->start_table_from + pThreadInfo->ntables) {
// turn to first table
- startTime += batchPerTbl * superTblInfo->timeStampStep;
tableSeq = pThreadInfo->start_table_from;
generatedRecPerTbl += batchPerTbl;
+
+ startTime = pThreadInfo->start_time
+ + generatedRecPerTbl * superTblInfo->timeStampStep;
+
flagSleep = true;
if (generatedRecPerTbl >= insertRows)
break;
@@ -5490,7 +5499,7 @@ static int insertTestProcess() {
init_rand_data();
// create database and super tables
- if(createDatabases() != 0) {
+ if(createDatabasesAndStables() != 0) {
fclose(g_fpOfInsertResult);
return -1;
}
diff --git a/src/os/inc/osArm32.h b/src/os/inc/osArm32.h
index 24ff95522ebc7ca2b2c23e9961371df58aa2fc6d..54835a1ca8d95b1b05707f165301ac5defc3e961 100644
--- a/src/os/inc/osArm32.h
+++ b/src/os/inc/osArm32.h
@@ -77,6 +77,7 @@ extern "C" {
#include
#include
#include
+#include
#define TAOS_OS_FUNC_LZ4
#define BUILDIN_CLZL(val) __builtin_clzll(val)
diff --git a/src/os/inc/osArm64.h b/src/os/inc/osArm64.h
index 22f0000e96c5083556a3751e57f5bdb18d686332..76098f684617abb7d96a17c2a13238b82cb69cef 100644
--- a/src/os/inc/osArm64.h
+++ b/src/os/inc/osArm64.h
@@ -78,6 +78,7 @@ extern "C" {
#include
#include
#include
+#include
#ifdef __cplusplus
}
diff --git a/src/os/inc/osLinux32.h b/src/os/inc/osLinux32.h
index cfef05368fe76f14604a91f1551b850a79898a4b..eee4999399ace745e6800f81cb09144e828f8cfc 100644
--- a/src/os/inc/osLinux32.h
+++ b/src/os/inc/osLinux32.h
@@ -77,6 +77,7 @@ extern "C" {
#include
#include
#include
+#include
#define TAOS_OS_FUNC_LZ4
#define BUILDIN_CLZL(val) __builtin_clzll(val)
diff --git a/src/os/inc/osLinux64.h b/src/os/inc/osLinux64.h
index a2febd51b7b769439b681aaf1871fe514b5558f3..0dfc819da339bfba77b5778aa27a8b60c48ca447 100644
--- a/src/os/inc/osLinux64.h
+++ b/src/os/inc/osLinux64.h
@@ -75,6 +75,7 @@ extern "C" {
#include
#include
#include
+#include
#ifndef _ALPINE
#include
#endif
diff --git a/src/os/inc/osSocket.h b/src/os/inc/osSocket.h
index 111fca712c20c1b0ef4b2c19e0a30f61c5e2029e..cf75b74a9afa75caa15ec82e191d781159af944f 100644
--- a/src/os/inc/osSocket.h
+++ b/src/os/inc/osSocket.h
@@ -68,6 +68,8 @@ void taosSetMaskSIGPIPE();
// TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
int32_t taosSetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *optval, int32_t optlen);
+int32_t taosGetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *optval, int32_t* optlen);
+
// TAOS_OS_FUNC_SOCKET_INET
uint32_t taosInetAddr(char *ipAddr);
const char *taosInetNtoa(struct in_addr ipInt);
diff --git a/src/os/src/detail/osSocket.c b/src/os/src/detail/osSocket.c
index 1186a6dd0a0247f3df44f1065fdacfa7d8df6e07..db976acccd7d61223fc742b7dcdb736bea6a5f57 100644
--- a/src/os/src/detail/osSocket.c
+++ b/src/os/src/detail/osSocket.c
@@ -71,6 +71,9 @@ int32_t taosSetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *op
return setsockopt(socketfd, level, optname, optval, (socklen_t)optlen);
}
+int32_t taosGetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *optval, int32_t* optlen) {
+ return getsockopt(socketfd, level, optname, optval, (socklen_t *)optlen);
+}
#endif
#ifndef TAOS_OS_FUNC_SOCKET_INET
diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y
index b026f9023523118c2a5615b1f8f2c5d1594ffcbf..174b31a9c6cec7b4c3274b35939fb3773cc6d70d 100644
--- a/src/query/inc/sql.y
+++ b/src/query/inc/sql.y
@@ -675,6 +675,7 @@ expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(&X, TK_STRING);}
expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(&X, TK_NOW); }
expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(&X, TK_VARIABLE);}
expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(&X, TK_BOOL);}
+expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(&X, TK_NULL);}
// ordinary functions: min(x), max(x), top(k, 20)
expr(A) ::= ID(X) LP exprlist(Y) RP(E). { A = tSqlExprCreateFunction(Y, &X, &E, X.type); }
diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c
index a5fc45fa9cd5f1e91065ff507a7cf8173f31cc7a..dc1be4fe01a532f9edfa6bfe146adb5d9cce1bf1 100644
--- a/src/query/src/qSqlParser.c
+++ b/src/query/src/qSqlParser.c
@@ -127,7 +127,12 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) {
pSqlExpr->token = *pToken;
}
- if (optrType == TK_INTEGER || optrType == TK_STRING || optrType == TK_FLOAT || optrType == TK_BOOL) {
+ if (optrType == TK_NULL) {
+ pToken->type = TSDB_DATA_TYPE_NULL;
+ tVariantCreate(&pSqlExpr->value, pToken);
+ pSqlExpr->tokenId = optrType;
+ pSqlExpr->type = SQL_NODE_VALUE;
+ } else if (optrType == TK_INTEGER || optrType == TK_STRING || optrType == TK_FLOAT || optrType == TK_BOOL) {
toTSDBType(pToken->type);
tVariantCreate(&pSqlExpr->value, pToken);
@@ -356,7 +361,11 @@ void tSqlExprCompact(tSqlExpr** pExpr) {
bool tSqlExprIsLeaf(tSqlExpr* pExpr) {
return (pExpr->pRight == NULL && pExpr->pLeft == NULL) &&
- (pExpr->tokenId == 0 || pExpr->tokenId == TK_ID || (pExpr->tokenId >= TK_BOOL && pExpr->tokenId <= TK_NCHAR) || pExpr->tokenId == TK_SET);
+ (pExpr->tokenId == 0 ||
+ (pExpr->tokenId == TK_ID) ||
+ (pExpr->tokenId >= TK_BOOL && pExpr->tokenId <= TK_NCHAR) ||
+ (pExpr->tokenId == TK_NULL) ||
+ (pExpr->tokenId == TK_SET));
}
bool tSqlExprIsParentOfLeaf(tSqlExpr* pExpr) {
diff --git a/src/query/src/queryMain.c b/src/query/src/queryMain.c
index 9d2fb70d9620f5f219b4b7206af18fe1ed9466dc..2ff0c9676e72074874c977899599c6666715c2ec 100644
--- a/src/query/src/queryMain.c
+++ b/src/query/src/queryMain.c
@@ -372,6 +372,7 @@ int32_t qKillQuery(qinfo_t qinfo) {
return TSDB_CODE_QRY_INVALID_QHANDLE;
}
+ qDebug("QInfo:%"PRIu64" query killed", pQInfo->qId);
setQueryKilled(pQInfo);
// Wait for the query executing thread being stopped/
diff --git a/src/query/src/sql.c b/src/query/src/sql.c
index df7aaaf001b7b8dba6047413438e69256f95dbf2..28208e532af4c4d7688208c19622a352076e9bc8 100644
--- a/src/query/src/sql.c
+++ b/src/query/src/sql.c
@@ -129,16 +129,16 @@ typedef union {
#define ParseARG_STORE yypParser->pInfo = pInfo
#define YYFALLBACK 1
#define YYNSTATE 315
-#define YYNRULE 266
+#define YYNRULE 267
#define YYNTOKEN 187
#define YY_MAX_SHIFT 314
-#define YY_MIN_SHIFTREDUCE 505
-#define YY_MAX_SHIFTREDUCE 770
-#define YY_ERROR_ACTION 771
-#define YY_ACCEPT_ACTION 772
-#define YY_NO_ACTION 773
-#define YY_MIN_REDUCE 774
-#define YY_MAX_REDUCE 1039
+#define YY_MIN_SHIFTREDUCE 506
+#define YY_MAX_SHIFTREDUCE 772
+#define YY_ERROR_ACTION 773
+#define YY_ACCEPT_ACTION 774
+#define YY_NO_ACTION 775
+#define YY_MIN_REDUCE 776
+#define YY_MAX_REDUCE 1042
/************* End control #defines *******************************************/
/* Define the yytestcase() macro to be a no-op if is not already defined
@@ -204,146 +204,146 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (679)
+#define YY_ACTTAB_COUNT (680)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 133, 552, 202, 312, 206, 140, 941, 17, 85, 553,
- /* 10 */ 772, 314, 179, 47, 48, 140, 51, 52, 30, 181,
- /* 20 */ 214, 41, 181, 50, 262, 55, 53, 57, 54, 1020,
- /* 30 */ 920, 209, 1021, 46, 45, 185, 181, 44, 43, 42,
- /* 40 */ 47, 48, 908, 51, 52, 208, 1021, 214, 41, 552,
- /* 50 */ 50, 262, 55, 53, 57, 54, 932, 553, 1017, 203,
- /* 60 */ 46, 45, 917, 247, 44, 43, 42, 48, 938, 51,
- /* 70 */ 52, 242, 972, 214, 41, 552, 50, 262, 55, 53,
- /* 80 */ 57, 54, 973, 553, 257, 278, 46, 45, 298, 225,
- /* 90 */ 44, 43, 42, 506, 507, 508, 509, 510, 511, 512,
- /* 100 */ 513, 514, 515, 516, 517, 518, 313, 631, 1016, 231,
- /* 110 */ 70, 552, 30, 47, 48, 1015, 51, 52, 819, 553,
- /* 120 */ 214, 41, 166, 50, 262, 55, 53, 57, 54, 44,
- /* 130 */ 43, 42, 717, 46, 45, 288, 287, 44, 43, 42,
- /* 140 */ 47, 49, 198, 51, 52, 140, 140, 214, 41, 234,
- /* 150 */ 50, 262, 55, 53, 57, 54, 916, 238, 237, 227,
+ /* 0 */ 133, 553, 202, 312, 206, 140, 943, 226, 140, 554,
+ /* 10 */ 774, 314, 17, 47, 48, 140, 51, 52, 30, 181,
+ /* 20 */ 214, 41, 181, 50, 262, 55, 53, 57, 54, 1023,
+ /* 30 */ 922, 209, 1024, 46, 45, 179, 181, 44, 43, 42,
+ /* 40 */ 47, 48, 920, 51, 52, 208, 1024, 214, 41, 553,
+ /* 50 */ 50, 262, 55, 53, 57, 54, 934, 554, 185, 203,
+ /* 60 */ 46, 45, 919, 247, 44, 43, 42, 48, 940, 51,
+ /* 70 */ 52, 242, 974, 214, 41, 79, 50, 262, 55, 53,
+ /* 80 */ 57, 54, 975, 632, 257, 30, 46, 45, 278, 225,
+ /* 90 */ 44, 43, 42, 507, 508, 509, 510, 511, 512, 513,
+ /* 100 */ 514, 515, 516, 517, 518, 519, 313, 553, 85, 231,
+ /* 110 */ 70, 288, 287, 47, 48, 554, 51, 52, 298, 219,
+ /* 120 */ 214, 41, 553, 50, 262, 55, 53, 57, 54, 918,
+ /* 130 */ 554, 105, 718, 46, 45, 1020, 298, 44, 43, 42,
+ /* 140 */ 47, 49, 910, 51, 52, 922, 140, 214, 41, 234,
+ /* 150 */ 50, 262, 55, 53, 57, 54, 1019, 238, 237, 227,
/* 160 */ 46, 45, 285, 284, 44, 43, 42, 23, 276, 307,
/* 170 */ 306, 275, 274, 273, 305, 272, 304, 303, 302, 271,
- /* 180 */ 301, 300, 880, 30, 868, 869, 870, 871, 872, 873,
- /* 190 */ 874, 875, 876, 877, 878, 879, 881, 882, 51, 52,
- /* 200 */ 18, 30, 214, 41, 906, 50, 262, 55, 53, 57,
- /* 210 */ 54, 259, 79, 78, 25, 46, 45, 190, 199, 44,
- /* 220 */ 43, 42, 82, 191, 217, 28, 30, 917, 268, 118,
- /* 230 */ 117, 189, 12, 213, 730, 932, 84, 721, 81, 724,
- /* 240 */ 74, 727, 218, 213, 730, 917, 80, 721, 36, 724,
- /* 250 */ 204, 727, 30, 903, 904, 29, 907, 46, 45, 71,
- /* 260 */ 74, 44, 43, 42, 223, 210, 211, 281, 36, 261,
- /* 270 */ 917, 23, 914, 307, 306, 210, 211, 723, 305, 726,
- /* 280 */ 304, 303, 302, 278, 301, 300, 311, 310, 126, 677,
- /* 290 */ 241, 888, 68, 282, 886, 887, 917, 245, 197, 889,
- /* 300 */ 219, 891, 892, 890, 670, 893, 894, 55, 53, 57,
- /* 310 */ 54, 1, 154, 263, 220, 46, 45, 30, 221, 44,
- /* 320 */ 43, 42, 105, 103, 108, 308, 920, 298, 69, 97,
- /* 330 */ 107, 113, 116, 106, 224, 655, 56, 280, 652, 110,
- /* 340 */ 653, 226, 654, 30, 920, 667, 56, 5, 156, 729,
- /* 350 */ 183, 920, 24, 33, 155, 92, 87, 91, 286, 729,
- /* 360 */ 905, 917, 174, 170, 719, 728, 228, 229, 172, 169,
- /* 370 */ 121, 120, 119, 828, 820, 728, 918, 166, 166, 3,
- /* 380 */ 167, 243, 674, 212, 290, 31, 683, 917, 698, 699,
- /* 390 */ 135, 689, 690, 750, 731, 60, 20, 19, 19, 722,
- /* 400 */ 720, 725, 61, 64, 641, 184, 265, 643, 31, 733,
- /* 410 */ 31, 60, 267, 642, 115, 114, 83, 60, 96, 95,
- /* 420 */ 186, 14, 13, 65, 62, 180, 187, 6, 102, 101,
- /* 430 */ 67, 188, 630, 16, 15, 659, 657, 660, 658, 131,
- /* 440 */ 129, 194, 195, 193, 656, 178, 192, 182, 1031, 919,
- /* 450 */ 983, 239, 982, 215, 979, 978, 216, 289, 39, 132,
- /* 460 */ 940, 948, 950, 130, 134, 933, 138, 246, 965, 964,
- /* 470 */ 151, 915, 150, 682, 248, 913, 205, 299, 104, 884,
- /* 480 */ 160, 260, 152, 153, 145, 143, 141, 831, 270, 66,
- /* 490 */ 250, 930, 63, 255, 37, 176, 34, 279, 58, 142,
- /* 500 */ 827, 1036, 93, 1035, 1033, 157, 283, 1030, 99, 1029,
- /* 510 */ 1027, 158, 849, 35, 258, 32, 38, 256, 177, 816,
- /* 520 */ 109, 814, 111, 112, 254, 812, 811, 230, 168, 252,
- /* 530 */ 809, 808, 807, 806, 805, 804, 171, 173, 801, 799,
- /* 540 */ 797, 795, 793, 175, 249, 244, 72, 75, 40, 251,
- /* 550 */ 966, 291, 292, 293, 294, 295, 296, 297, 309, 200,
- /* 560 */ 222, 770, 269, 232, 233, 769, 235, 201, 196, 88,
- /* 570 */ 89, 236, 768, 756, 755, 240, 245, 8, 810, 662,
- /* 580 */ 122, 161, 123, 165, 163, 803, 850, 159, 162, 164,
- /* 590 */ 124, 802, 73, 125, 794, 4, 2, 264, 76, 684,
- /* 600 */ 136, 137, 687, 77, 144, 148, 146, 147, 149, 896,
- /* 610 */ 207, 253, 26, 691, 139, 27, 9, 732, 10, 7,
- /* 620 */ 734, 11, 21, 266, 22, 86, 594, 84, 590, 588,
- /* 630 */ 587, 586, 583, 556, 277, 31, 59, 90, 633, 94,
- /* 640 */ 632, 629, 578, 98, 100, 576, 568, 574, 570, 572,
- /* 650 */ 566, 564, 597, 596, 595, 593, 592, 591, 589, 585,
- /* 660 */ 584, 60, 554, 522, 520, 774, 773, 773, 773, 773,
- /* 670 */ 773, 773, 773, 773, 773, 773, 773, 127, 128,
+ /* 180 */ 301, 300, 882, 30, 870, 871, 872, 873, 874, 875,
+ /* 190 */ 876, 877, 878, 879, 880, 881, 883, 884, 51, 52,
+ /* 200 */ 821, 1018, 214, 41, 166, 50, 262, 55, 53, 57,
+ /* 210 */ 54, 259, 18, 78, 82, 46, 45, 198, 223, 44,
+ /* 220 */ 43, 42, 213, 731, 217, 25, 722, 919, 725, 190,
+ /* 230 */ 728, 221, 213, 731, 199, 191, 722, 724, 725, 727,
+ /* 240 */ 728, 118, 117, 189, 263, 905, 906, 29, 909, 44,
+ /* 250 */ 43, 42, 30, 74, 210, 211, 308, 922, 261, 30,
+ /* 260 */ 23, 36, 307, 306, 210, 211, 934, 305, 30, 304,
+ /* 270 */ 303, 302, 74, 301, 300, 890, 908, 183, 888, 889,
+ /* 280 */ 36, 204, 922, 891, 916, 893, 894, 892, 224, 895,
+ /* 290 */ 896, 280, 656, 218, 830, 653, 919, 654, 166, 655,
+ /* 300 */ 281, 69, 241, 919, 68, 55, 53, 57, 54, 282,
+ /* 310 */ 197, 671, 919, 46, 45, 30, 822, 44, 43, 42,
+ /* 320 */ 166, 103, 108, 228, 229, 56, 220, 97, 107, 113,
+ /* 330 */ 116, 106, 732, 907, 723, 56, 726, 110, 730, 30,
+ /* 340 */ 735, 12, 732, 5, 156, 84, 184, 81, 730, 33,
+ /* 350 */ 155, 92, 87, 91, 729, 278, 286, 1, 154, 919,
+ /* 360 */ 174, 170, 186, 212, 729, 80, 172, 169, 121, 120,
+ /* 370 */ 119, 46, 45, 3, 167, 44, 43, 42, 71, 720,
+ /* 380 */ 290, 699, 700, 919, 311, 310, 126, 243, 668, 675,
+ /* 390 */ 678, 31, 684, 690, 180, 24, 135, 60, 245, 691,
+ /* 400 */ 752, 657, 733, 20, 19, 61, 19, 6, 64, 642,
+ /* 410 */ 265, 1034, 644, 31, 31, 721, 60, 267, 643, 187,
+ /* 420 */ 28, 83, 60, 268, 96, 95, 188, 62, 65, 14,
+ /* 430 */ 13, 102, 101, 660, 67, 661, 631, 194, 16, 15,
+ /* 440 */ 658, 195, 659, 115, 114, 131, 129, 193, 178, 192,
+ /* 450 */ 182, 921, 985, 984, 215, 981, 239, 980, 132, 942,
+ /* 460 */ 216, 289, 39, 950, 952, 967, 134, 966, 138, 935,
+ /* 470 */ 246, 130, 248, 917, 151, 915, 150, 205, 683, 250,
+ /* 480 */ 152, 886, 299, 153, 291, 148, 146, 260, 142, 932,
+ /* 490 */ 141, 58, 833, 270, 66, 255, 143, 37, 63, 176,
+ /* 500 */ 34, 279, 829, 258, 144, 1039, 93, 256, 1038, 1036,
+ /* 510 */ 157, 254, 283, 1033, 99, 1032, 1030, 158, 851, 35,
+ /* 520 */ 252, 145, 32, 38, 177, 818, 109, 816, 111, 40,
+ /* 530 */ 112, 814, 813, 230, 168, 811, 810, 809, 808, 807,
+ /* 540 */ 806, 171, 173, 803, 801, 799, 797, 795, 175, 249,
+ /* 550 */ 244, 72, 75, 104, 251, 968, 292, 293, 294, 295,
+ /* 560 */ 296, 297, 309, 200, 222, 269, 772, 232, 201, 233,
+ /* 570 */ 771, 88, 89, 196, 235, 236, 770, 758, 757, 240,
+ /* 580 */ 245, 8, 264, 73, 812, 663, 805, 161, 852, 159,
+ /* 590 */ 160, 163, 162, 164, 165, 122, 123, 124, 804, 76,
+ /* 600 */ 125, 796, 4, 2, 685, 136, 137, 688, 77, 149,
+ /* 610 */ 147, 207, 253, 86, 692, 898, 139, 9, 10, 26,
+ /* 620 */ 27, 734, 7, 11, 736, 21, 22, 266, 595, 591,
+ /* 630 */ 589, 84, 588, 587, 584, 557, 277, 94, 90, 31,
+ /* 640 */ 634, 633, 59, 630, 579, 577, 98, 569, 575, 571,
+ /* 650 */ 573, 567, 565, 100, 598, 597, 596, 594, 593, 592,
+ /* 660 */ 590, 586, 585, 60, 555, 523, 521, 776, 775, 127,
+ /* 670 */ 775, 775, 775, 775, 775, 775, 775, 775, 775, 128,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 191, 1, 190, 191, 210, 191, 191, 252, 197, 9,
+ /* 0 */ 191, 1, 190, 191, 210, 191, 191, 191, 191, 9,
/* 10 */ 188, 189, 252, 13, 14, 191, 16, 17, 191, 252,
/* 20 */ 20, 21, 252, 23, 24, 25, 26, 27, 28, 262,
/* 30 */ 236, 261, 262, 33, 34, 252, 252, 37, 38, 39,
- /* 40 */ 13, 14, 231, 16, 17, 261, 262, 20, 21, 1,
+ /* 40 */ 13, 14, 226, 16, 17, 261, 262, 20, 21, 1,
/* 50 */ 23, 24, 25, 26, 27, 28, 234, 9, 252, 232,
/* 60 */ 33, 34, 235, 254, 37, 38, 39, 14, 253, 16,
- /* 70 */ 17, 249, 258, 20, 21, 1, 23, 24, 25, 26,
- /* 80 */ 27, 28, 258, 9, 260, 79, 33, 34, 81, 67,
+ /* 70 */ 17, 249, 258, 20, 21, 258, 23, 24, 25, 26,
+ /* 80 */ 27, 28, 258, 5, 260, 191, 33, 34, 79, 67,
/* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
- /* 100 */ 52, 53, 54, 55, 56, 57, 58, 5, 252, 61,
- /* 110 */ 110, 1, 191, 13, 14, 252, 16, 17, 196, 9,
- /* 120 */ 20, 21, 200, 23, 24, 25, 26, 27, 28, 37,
- /* 130 */ 38, 39, 105, 33, 34, 33, 34, 37, 38, 39,
- /* 140 */ 13, 14, 252, 16, 17, 191, 191, 20, 21, 135,
- /* 150 */ 23, 24, 25, 26, 27, 28, 235, 143, 144, 137,
+ /* 100 */ 52, 53, 54, 55, 56, 57, 58, 1, 197, 61,
+ /* 110 */ 110, 33, 34, 13, 14, 9, 16, 17, 81, 210,
+ /* 120 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 235,
+ /* 130 */ 9, 76, 105, 33, 34, 252, 81, 37, 38, 39,
+ /* 140 */ 13, 14, 231, 16, 17, 236, 191, 20, 21, 135,
+ /* 150 */ 23, 24, 25, 26, 27, 28, 252, 143, 144, 137,
/* 160 */ 33, 34, 140, 141, 37, 38, 39, 88, 89, 90,
/* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
/* 180 */ 101, 102, 209, 191, 211, 212, 213, 214, 215, 216,
/* 190 */ 217, 218, 219, 220, 221, 222, 223, 224, 16, 17,
- /* 200 */ 44, 191, 20, 21, 0, 23, 24, 25, 26, 27,
- /* 210 */ 28, 256, 258, 258, 104, 33, 34, 61, 252, 37,
- /* 220 */ 38, 39, 197, 67, 232, 104, 191, 235, 107, 73,
- /* 230 */ 74, 75, 104, 1, 2, 234, 108, 5, 110, 7,
- /* 240 */ 104, 9, 232, 1, 2, 235, 237, 5, 112, 7,
- /* 250 */ 249, 9, 191, 228, 229, 230, 231, 33, 34, 250,
- /* 260 */ 104, 37, 38, 39, 67, 33, 34, 232, 112, 37,
- /* 270 */ 235, 88, 191, 90, 91, 33, 34, 5, 95, 7,
- /* 280 */ 97, 98, 99, 79, 101, 102, 64, 65, 66, 105,
- /* 290 */ 134, 209, 136, 232, 212, 213, 235, 113, 142, 217,
- /* 300 */ 210, 219, 220, 221, 37, 223, 224, 25, 26, 27,
- /* 310 */ 28, 198, 199, 15, 233, 33, 34, 191, 210, 37,
- /* 320 */ 38, 39, 76, 62, 63, 210, 236, 81, 197, 68,
- /* 330 */ 69, 70, 71, 72, 137, 2, 104, 140, 5, 78,
- /* 340 */ 7, 191, 9, 191, 236, 109, 104, 62, 63, 117,
- /* 350 */ 252, 236, 116, 68, 69, 70, 71, 72, 232, 117,
- /* 360 */ 229, 235, 62, 63, 1, 133, 33, 34, 68, 69,
- /* 370 */ 70, 71, 72, 196, 196, 133, 226, 200, 200, 194,
- /* 380 */ 195, 105, 115, 60, 232, 109, 105, 235, 124, 125,
- /* 390 */ 109, 105, 105, 105, 105, 109, 109, 109, 109, 5,
- /* 400 */ 37, 7, 109, 109, 105, 252, 105, 105, 109, 111,
- /* 410 */ 109, 109, 105, 105, 76, 77, 109, 109, 138, 139,
- /* 420 */ 252, 138, 139, 129, 131, 252, 252, 104, 138, 139,
- /* 430 */ 104, 252, 106, 138, 139, 5, 5, 7, 7, 62,
- /* 440 */ 63, 252, 252, 252, 111, 252, 252, 252, 236, 236,
- /* 450 */ 227, 191, 227, 227, 227, 227, 227, 227, 251, 191,
- /* 460 */ 191, 191, 191, 60, 191, 234, 191, 234, 259, 259,
- /* 470 */ 191, 234, 238, 117, 255, 191, 255, 103, 87, 225,
- /* 480 */ 206, 122, 191, 191, 243, 245, 247, 191, 191, 128,
- /* 490 */ 255, 248, 130, 255, 191, 191, 191, 191, 127, 246,
- /* 500 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
- /* 510 */ 191, 191, 191, 191, 126, 191, 191, 121, 191, 191,
- /* 520 */ 191, 191, 191, 191, 120, 191, 191, 191, 191, 119,
+ /* 200 */ 196, 252, 20, 21, 200, 23, 24, 25, 26, 27,
+ /* 210 */ 28, 256, 44, 258, 197, 33, 34, 252, 67, 37,
+ /* 220 */ 38, 39, 1, 2, 232, 104, 5, 235, 7, 61,
+ /* 230 */ 9, 210, 1, 2, 252, 67, 5, 5, 7, 7,
+ /* 240 */ 9, 73, 74, 75, 15, 228, 229, 230, 231, 37,
+ /* 250 */ 38, 39, 191, 104, 33, 34, 210, 236, 37, 191,
+ /* 260 */ 88, 112, 90, 91, 33, 34, 234, 95, 191, 97,
+ /* 270 */ 98, 99, 104, 101, 102, 209, 0, 252, 212, 213,
+ /* 280 */ 112, 249, 236, 217, 191, 219, 220, 221, 137, 223,
+ /* 290 */ 224, 140, 2, 232, 196, 5, 235, 7, 200, 9,
+ /* 300 */ 232, 197, 134, 235, 136, 25, 26, 27, 28, 232,
+ /* 310 */ 142, 37, 235, 33, 34, 191, 196, 37, 38, 39,
+ /* 320 */ 200, 62, 63, 33, 34, 104, 233, 68, 69, 70,
+ /* 330 */ 71, 72, 111, 229, 5, 104, 7, 78, 117, 191,
+ /* 340 */ 111, 104, 111, 62, 63, 108, 252, 110, 117, 68,
+ /* 350 */ 69, 70, 71, 72, 133, 79, 232, 198, 199, 235,
+ /* 360 */ 62, 63, 252, 60, 133, 237, 68, 69, 70, 71,
+ /* 370 */ 72, 33, 34, 194, 195, 37, 38, 39, 250, 1,
+ /* 380 */ 232, 124, 125, 235, 64, 65, 66, 105, 109, 115,
+ /* 390 */ 105, 109, 105, 105, 252, 116, 109, 109, 113, 105,
+ /* 400 */ 105, 111, 105, 109, 109, 109, 109, 104, 109, 105,
+ /* 410 */ 105, 236, 105, 109, 109, 37, 109, 105, 105, 252,
+ /* 420 */ 104, 109, 109, 107, 138, 139, 252, 131, 129, 138,
+ /* 430 */ 139, 138, 139, 5, 104, 7, 106, 252, 138, 139,
+ /* 440 */ 5, 252, 7, 76, 77, 62, 63, 252, 252, 252,
+ /* 450 */ 252, 236, 227, 227, 227, 227, 191, 227, 191, 191,
+ /* 460 */ 227, 227, 251, 191, 191, 259, 191, 259, 191, 234,
+ /* 470 */ 234, 60, 255, 234, 191, 191, 238, 255, 117, 255,
+ /* 480 */ 191, 225, 103, 191, 86, 240, 242, 122, 246, 248,
+ /* 490 */ 247, 127, 191, 191, 128, 255, 245, 191, 130, 191,
+ /* 500 */ 191, 191, 191, 126, 244, 191, 191, 121, 191, 191,
+ /* 510 */ 191, 120, 191, 191, 191, 191, 191, 191, 191, 191,
+ /* 520 */ 119, 243, 191, 191, 191, 191, 191, 191, 191, 132,
/* 530 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
- /* 540 */ 191, 191, 191, 191, 118, 192, 192, 192, 132, 192,
- /* 550 */ 192, 86, 50, 83, 85, 54, 84, 82, 79, 192,
- /* 560 */ 192, 5, 192, 145, 5, 5, 145, 192, 192, 197,
- /* 570 */ 197, 5, 5, 90, 89, 135, 113, 104, 192, 105,
- /* 580 */ 193, 202, 193, 201, 203, 192, 208, 207, 205, 204,
- /* 590 */ 193, 192, 114, 193, 192, 194, 198, 107, 109, 105,
- /* 600 */ 104, 109, 105, 104, 244, 240, 242, 241, 239, 225,
- /* 610 */ 1, 104, 109, 105, 104, 109, 123, 105, 123, 104,
- /* 620 */ 111, 104, 104, 107, 104, 76, 9, 108, 5, 5,
- /* 630 */ 5, 5, 5, 80, 15, 109, 16, 76, 5, 139,
- /* 640 */ 5, 105, 5, 139, 139, 5, 5, 5, 5, 5,
- /* 650 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- /* 660 */ 5, 109, 80, 60, 59, 0, 263, 263, 263, 263,
- /* 670 */ 263, 263, 263, 263, 263, 263, 263, 21, 21, 263,
+ /* 540 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 118,
+ /* 550 */ 192, 192, 192, 87, 192, 192, 50, 83, 85, 54,
+ /* 560 */ 84, 82, 79, 192, 192, 192, 5, 145, 192, 5,
+ /* 570 */ 5, 197, 197, 192, 145, 5, 5, 90, 89, 135,
+ /* 580 */ 113, 104, 107, 114, 192, 105, 192, 202, 208, 207,
+ /* 590 */ 206, 203, 205, 204, 201, 193, 193, 193, 192, 109,
+ /* 600 */ 193, 192, 194, 198, 105, 104, 109, 105, 104, 239,
+ /* 610 */ 241, 1, 104, 76, 105, 225, 104, 123, 123, 109,
+ /* 620 */ 109, 105, 104, 104, 111, 104, 104, 107, 9, 5,
+ /* 630 */ 5, 108, 5, 5, 5, 80, 15, 139, 76, 109,
+ /* 640 */ 5, 5, 16, 105, 5, 5, 139, 5, 5, 5,
+ /* 650 */ 5, 5, 5, 139, 5, 5, 5, 5, 5, 5,
+ /* 660 */ 5, 5, 5, 109, 80, 60, 59, 0, 263, 21,
+ /* 670 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 21,
/* 680 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
/* 690 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
/* 700 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
@@ -362,101 +362,101 @@ static const YYCODETYPE yy_lookahead[] = {
/* 830 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
/* 840 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
/* 850 */ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- /* 860 */ 263, 263, 263, 263, 263, 263,
+ /* 860 */ 263, 263, 263, 263, 263, 263, 263,
};
#define YY_SHIFT_COUNT (314)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (665)
+#define YY_SHIFT_MAX (667)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 156, 79, 79, 183, 183, 6, 232, 242, 74, 74,
- /* 10 */ 74, 74, 74, 74, 74, 74, 74, 0, 48, 242,
- /* 20 */ 333, 333, 333, 333, 110, 136, 74, 74, 74, 204,
- /* 30 */ 74, 74, 246, 6, 7, 7, 679, 679, 679, 242,
- /* 40 */ 242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
- /* 50 */ 242, 242, 242, 242, 242, 242, 242, 242, 242, 333,
- /* 60 */ 333, 102, 102, 102, 102, 102, 102, 102, 74, 74,
- /* 70 */ 74, 267, 74, 136, 136, 74, 74, 74, 264, 264,
- /* 80 */ 236, 136, 74, 74, 74, 74, 74, 74, 74, 74,
- /* 90 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
- /* 100 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
- /* 110 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
- /* 120 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
- /* 130 */ 74, 74, 403, 403, 403, 356, 356, 356, 403, 356,
- /* 140 */ 403, 361, 362, 371, 359, 388, 396, 404, 410, 426,
- /* 150 */ 416, 403, 403, 403, 374, 6, 6, 403, 403, 391,
- /* 160 */ 465, 502, 470, 469, 501, 472, 475, 374, 403, 479,
- /* 170 */ 479, 403, 479, 403, 479, 403, 679, 679, 27, 100,
- /* 180 */ 127, 100, 100, 53, 182, 282, 282, 282, 282, 261,
- /* 190 */ 285, 300, 224, 224, 224, 224, 22, 14, 92, 92,
- /* 200 */ 128, 197, 222, 276, 184, 281, 286, 287, 288, 289,
- /* 210 */ 272, 394, 363, 323, 298, 293, 294, 299, 301, 302,
- /* 220 */ 307, 308, 121, 280, 283, 290, 326, 295, 430, 431,
- /* 230 */ 338, 377, 556, 418, 559, 560, 421, 566, 567, 483,
- /* 240 */ 485, 440, 463, 490, 473, 478, 474, 489, 494, 496,
- /* 250 */ 497, 492, 499, 609, 507, 508, 510, 503, 493, 506,
- /* 260 */ 495, 512, 515, 509, 517, 490, 518, 516, 520, 519,
- /* 270 */ 549, 617, 623, 624, 625, 626, 627, 553, 619, 561,
- /* 280 */ 500, 526, 526, 620, 504, 505, 526, 633, 635, 536,
- /* 290 */ 526, 637, 640, 641, 642, 643, 644, 645, 646, 647,
- /* 300 */ 648, 649, 650, 651, 652, 653, 654, 655, 552, 582,
- /* 310 */ 656, 657, 603, 605, 665,
+ /* 0 */ 168, 79, 79, 172, 172, 9, 221, 231, 106, 106,
+ /* 10 */ 106, 106, 106, 106, 106, 106, 106, 0, 48, 231,
+ /* 20 */ 290, 290, 290, 290, 121, 149, 106, 106, 106, 276,
+ /* 30 */ 106, 106, 55, 9, 37, 37, 680, 680, 680, 231,
+ /* 40 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
+ /* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 290,
+ /* 60 */ 290, 78, 78, 78, 78, 78, 78, 78, 106, 106,
+ /* 70 */ 106, 274, 106, 149, 149, 106, 106, 106, 257, 257,
+ /* 80 */ 279, 149, 106, 106, 106, 106, 106, 106, 106, 106,
+ /* 90 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ /* 100 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ /* 110 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ /* 120 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ /* 130 */ 106, 106, 411, 411, 411, 361, 361, 361, 411, 361,
+ /* 140 */ 411, 366, 368, 364, 365, 377, 386, 391, 401, 431,
+ /* 150 */ 397, 411, 411, 411, 379, 9, 9, 411, 411, 466,
+ /* 160 */ 398, 506, 474, 473, 505, 476, 479, 379, 411, 483,
+ /* 170 */ 483, 411, 483, 411, 483, 411, 680, 680, 27, 100,
+ /* 180 */ 127, 100, 100, 53, 182, 280, 280, 280, 280, 259,
+ /* 190 */ 281, 298, 338, 338, 338, 338, 22, 14, 212, 212,
+ /* 200 */ 237, 151, 320, 282, 285, 287, 288, 294, 295, 297,
+ /* 210 */ 232, 329, 378, 303, 229, 296, 299, 304, 305, 307,
+ /* 220 */ 312, 313, 316, 286, 291, 293, 330, 300, 428, 435,
+ /* 230 */ 367, 383, 561, 422, 564, 565, 429, 570, 571, 487,
+ /* 240 */ 489, 444, 467, 475, 477, 469, 480, 490, 499, 501,
+ /* 250 */ 502, 497, 504, 610, 508, 509, 512, 510, 494, 511,
+ /* 260 */ 495, 516, 518, 513, 519, 475, 521, 520, 522, 523,
+ /* 270 */ 537, 619, 624, 625, 627, 628, 629, 555, 621, 562,
+ /* 280 */ 498, 530, 530, 626, 507, 514, 530, 635, 636, 538,
+ /* 290 */ 530, 639, 640, 642, 643, 644, 645, 646, 647, 649,
+ /* 300 */ 650, 651, 652, 653, 654, 655, 656, 657, 554, 584,
+ /* 310 */ 648, 658, 605, 607, 667,
};
#define YY_REDUCE_COUNT (177)
-#define YY_REDUCE_MIN (-245)
-#define YY_REDUCE_MAX (402)
+#define YY_REDUCE_MIN (-240)
+#define YY_REDUCE_MAX (409)
static const short yy_reduce_ofst[] = {
- /* 0 */ -178, -27, -27, 82, 82, 25, -230, -216, -173, -176,
- /* 10 */ -45, -8, 10, 35, 61, 126, 152, -185, -188, -233,
- /* 20 */ -206, 90, 108, 115, -191, 1, -186, -46, 81, -189,
- /* 30 */ 150, -79, -78, 131, 177, 178, 9, 113, 185, -245,
- /* 40 */ -240, -217, -194, -144, -137, -110, -34, 98, 153, 168,
- /* 50 */ 173, 174, 179, 189, 190, 191, 193, 194, 195, 212,
- /* 60 */ 213, 223, 225, 226, 227, 228, 229, 230, 260, 268,
- /* 70 */ 269, 207, 270, 231, 233, 271, 273, 275, 209, 210,
- /* 80 */ 234, 237, 279, 284, 291, 292, 296, 297, 303, 304,
- /* 90 */ 305, 306, 309, 310, 311, 312, 313, 314, 315, 316,
- /* 100 */ 317, 318, 319, 320, 321, 322, 324, 325, 327, 328,
- /* 110 */ 329, 330, 331, 332, 334, 335, 336, 337, 339, 340,
- /* 120 */ 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,
- /* 130 */ 351, 352, 353, 354, 355, 219, 221, 235, 357, 238,
- /* 140 */ 358, 243, 239, 253, 240, 360, 241, 364, 366, 365,
- /* 150 */ 369, 367, 368, 370, 254, 372, 373, 375, 376, 378,
- /* 160 */ 380, 274, 379, 383, 381, 385, 382, 384, 386, 387,
- /* 170 */ 389, 393, 397, 399, 400, 402, 398, 401,
+ /* 0 */ -178, -27, -27, 66, 66, 17, -230, -216, -173, -176,
+ /* 10 */ -45, -8, 61, 68, 77, 124, 148, -185, -188, -233,
+ /* 20 */ -206, -91, 21, 46, -191, 32, -186, -183, 93, -89,
+ /* 30 */ -184, -106, 4, 104, 98, 120, 128, 159, 179, -240,
+ /* 40 */ -217, -194, -117, -96, -51, -35, -18, 25, 94, 110,
+ /* 50 */ 142, 167, 174, 185, 189, 195, 196, 197, 198, 175,
+ /* 60 */ 215, 225, 226, 227, 228, 230, 233, 234, 265, 267,
+ /* 70 */ 268, 211, 272, 235, 236, 273, 275, 277, 206, 208,
+ /* 80 */ 238, 239, 283, 284, 289, 292, 301, 302, 306, 308,
+ /* 90 */ 309, 310, 311, 314, 315, 317, 318, 319, 321, 322,
+ /* 100 */ 323, 324, 325, 326, 327, 328, 331, 332, 333, 334,
+ /* 110 */ 335, 336, 337, 339, 340, 341, 342, 343, 344, 345,
+ /* 120 */ 346, 347, 348, 349, 350, 351, 352, 353, 354, 355,
+ /* 130 */ 356, 357, 358, 359, 360, 217, 222, 224, 362, 240,
+ /* 140 */ 363, 241, 243, 242, 251, 260, 278, 244, 369, 245,
+ /* 150 */ 370, 371, 372, 373, 256, 374, 375, 376, 381, 380,
+ /* 160 */ 382, 384, 385, 387, 388, 389, 393, 390, 392, 402,
+ /* 170 */ 403, 394, 404, 406, 407, 409, 405, 408,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 771, 883, 829, 895, 817, 826, 1023, 1023, 771, 771,
- /* 10 */ 771, 771, 771, 771, 771, 771, 771, 942, 790, 1023,
- /* 20 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 826,
- /* 30 */ 771, 771, 832, 826, 832, 832, 937, 867, 885, 771,
- /* 40 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 50 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 60 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 70 */ 771, 944, 947, 771, 771, 949, 771, 771, 969, 969,
- /* 80 */ 935, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 90 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 100 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 815,
- /* 110 */ 771, 813, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 120 */ 771, 771, 771, 771, 771, 771, 800, 771, 771, 771,
- /* 130 */ 771, 771, 792, 792, 792, 771, 771, 771, 792, 771,
- /* 140 */ 792, 976, 980, 974, 962, 970, 961, 957, 955, 954,
- /* 150 */ 984, 792, 792, 792, 830, 826, 826, 792, 792, 848,
- /* 160 */ 846, 844, 836, 842, 838, 840, 834, 818, 792, 824,
- /* 170 */ 824, 792, 824, 792, 824, 792, 867, 885, 771, 985,
- /* 180 */ 771, 1022, 975, 1012, 1011, 1018, 1010, 1009, 1008, 771,
- /* 190 */ 771, 771, 1004, 1005, 1007, 1006, 771, 771, 1014, 1013,
- /* 200 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 210 */ 771, 771, 771, 987, 771, 981, 977, 771, 771, 771,
- /* 220 */ 771, 771, 771, 771, 771, 771, 897, 771, 771, 771,
- /* 230 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 240 */ 771, 771, 934, 771, 771, 771, 771, 945, 771, 771,
- /* 250 */ 771, 771, 771, 771, 771, 771, 771, 971, 771, 963,
- /* 260 */ 771, 771, 771, 771, 771, 909, 771, 771, 771, 771,
- /* 270 */ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 280 */ 771, 1034, 1032, 771, 771, 771, 1028, 771, 771, 771,
- /* 290 */ 1026, 771, 771, 771, 771, 771, 771, 771, 771, 771,
- /* 300 */ 771, 771, 771, 771, 771, 771, 771, 771, 851, 771,
- /* 310 */ 798, 796, 771, 788, 771,
+ /* 0 */ 773, 885, 831, 897, 819, 828, 1026, 1026, 773, 773,
+ /* 10 */ 773, 773, 773, 773, 773, 773, 773, 944, 792, 1026,
+ /* 20 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 828,
+ /* 30 */ 773, 773, 834, 828, 834, 834, 939, 869, 887, 773,
+ /* 40 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 50 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 60 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 70 */ 773, 946, 949, 773, 773, 951, 773, 773, 971, 971,
+ /* 80 */ 937, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 90 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 100 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 817,
+ /* 110 */ 773, 815, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 120 */ 773, 773, 773, 773, 773, 773, 802, 773, 773, 773,
+ /* 130 */ 773, 773, 794, 794, 794, 773, 773, 773, 794, 773,
+ /* 140 */ 794, 978, 982, 976, 964, 972, 963, 959, 957, 956,
+ /* 150 */ 986, 794, 794, 794, 832, 828, 828, 794, 794, 850,
+ /* 160 */ 848, 846, 838, 844, 840, 842, 836, 820, 794, 826,
+ /* 170 */ 826, 794, 826, 794, 826, 794, 869, 887, 773, 987,
+ /* 180 */ 773, 1025, 977, 1015, 1014, 1021, 1013, 1012, 1011, 773,
+ /* 190 */ 773, 773, 1007, 1008, 1010, 1009, 773, 773, 1017, 1016,
+ /* 200 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 210 */ 773, 773, 773, 989, 773, 983, 979, 773, 773, 773,
+ /* 220 */ 773, 773, 773, 773, 773, 773, 899, 773, 773, 773,
+ /* 230 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 240 */ 773, 773, 936, 773, 773, 773, 773, 947, 773, 773,
+ /* 250 */ 773, 773, 773, 773, 773, 773, 773, 973, 773, 965,
+ /* 260 */ 773, 773, 773, 773, 773, 911, 773, 773, 773, 773,
+ /* 270 */ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 280 */ 773, 1037, 1035, 773, 773, 773, 1031, 773, 773, 773,
+ /* 290 */ 1029, 773, 773, 773, 773, 773, 773, 773, 773, 773,
+ /* 300 */ 773, 773, 773, 773, 773, 773, 773, 773, 853, 773,
+ /* 310 */ 800, 798, 773, 790, 773,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1245,46 +1245,47 @@ static const char *const yyRuleName[] = {
/* 223 */ "expr ::= NOW",
/* 224 */ "expr ::= VARIABLE",
/* 225 */ "expr ::= BOOL",
- /* 226 */ "expr ::= ID LP exprlist RP",
- /* 227 */ "expr ::= ID LP STAR RP",
- /* 228 */ "expr ::= expr IS NULL",
- /* 229 */ "expr ::= expr IS NOT NULL",
- /* 230 */ "expr ::= expr LT expr",
- /* 231 */ "expr ::= expr GT expr",
- /* 232 */ "expr ::= expr LE expr",
- /* 233 */ "expr ::= expr GE expr",
- /* 234 */ "expr ::= expr NE expr",
- /* 235 */ "expr ::= expr EQ expr",
- /* 236 */ "expr ::= expr BETWEEN expr AND expr",
- /* 237 */ "expr ::= expr AND expr",
- /* 238 */ "expr ::= expr OR expr",
- /* 239 */ "expr ::= expr PLUS expr",
- /* 240 */ "expr ::= expr MINUS expr",
- /* 241 */ "expr ::= expr STAR expr",
- /* 242 */ "expr ::= expr SLASH expr",
- /* 243 */ "expr ::= expr REM expr",
- /* 244 */ "expr ::= expr LIKE expr",
- /* 245 */ "expr ::= expr IN LP exprlist RP",
- /* 246 */ "exprlist ::= exprlist COMMA expritem",
- /* 247 */ "exprlist ::= expritem",
- /* 248 */ "expritem ::= expr",
- /* 249 */ "expritem ::=",
- /* 250 */ "cmd ::= RESET QUERY CACHE",
- /* 251 */ "cmd ::= SYNCDB ids REPLICA",
- /* 252 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
- /* 253 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
- /* 254 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
- /* 255 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
- /* 256 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
- /* 257 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
- /* 258 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
- /* 259 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
- /* 260 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
- /* 261 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
- /* 262 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
- /* 263 */ "cmd ::= KILL CONNECTION INTEGER",
- /* 264 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
- /* 265 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
+ /* 226 */ "expr ::= NULL",
+ /* 227 */ "expr ::= ID LP exprlist RP",
+ /* 228 */ "expr ::= ID LP STAR RP",
+ /* 229 */ "expr ::= expr IS NULL",
+ /* 230 */ "expr ::= expr IS NOT NULL",
+ /* 231 */ "expr ::= expr LT expr",
+ /* 232 */ "expr ::= expr GT expr",
+ /* 233 */ "expr ::= expr LE expr",
+ /* 234 */ "expr ::= expr GE expr",
+ /* 235 */ "expr ::= expr NE expr",
+ /* 236 */ "expr ::= expr EQ expr",
+ /* 237 */ "expr ::= expr BETWEEN expr AND expr",
+ /* 238 */ "expr ::= expr AND expr",
+ /* 239 */ "expr ::= expr OR expr",
+ /* 240 */ "expr ::= expr PLUS expr",
+ /* 241 */ "expr ::= expr MINUS expr",
+ /* 242 */ "expr ::= expr STAR expr",
+ /* 243 */ "expr ::= expr SLASH expr",
+ /* 244 */ "expr ::= expr REM expr",
+ /* 245 */ "expr ::= expr LIKE expr",
+ /* 246 */ "expr ::= expr IN LP exprlist RP",
+ /* 247 */ "exprlist ::= exprlist COMMA expritem",
+ /* 248 */ "exprlist ::= expritem",
+ /* 249 */ "expritem ::= expr",
+ /* 250 */ "expritem ::=",
+ /* 251 */ "cmd ::= RESET QUERY CACHE",
+ /* 252 */ "cmd ::= SYNCDB ids REPLICA",
+ /* 253 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
+ /* 254 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
+ /* 255 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
+ /* 256 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
+ /* 257 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
+ /* 258 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
+ /* 259 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
+ /* 260 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
+ /* 261 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
+ /* 262 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
+ /* 263 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
+ /* 264 */ "cmd ::= KILL CONNECTION INTEGER",
+ /* 265 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
+ /* 266 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
};
#endif /* NDEBUG */
@@ -1970,46 +1971,47 @@ static const struct {
{ 252, -1 }, /* (223) expr ::= NOW */
{ 252, -1 }, /* (224) expr ::= VARIABLE */
{ 252, -1 }, /* (225) expr ::= BOOL */
- { 252, -4 }, /* (226) expr ::= ID LP exprlist RP */
- { 252, -4 }, /* (227) expr ::= ID LP STAR RP */
- { 252, -3 }, /* (228) expr ::= expr IS NULL */
- { 252, -4 }, /* (229) expr ::= expr IS NOT NULL */
- { 252, -3 }, /* (230) expr ::= expr LT expr */
- { 252, -3 }, /* (231) expr ::= expr GT expr */
- { 252, -3 }, /* (232) expr ::= expr LE expr */
- { 252, -3 }, /* (233) expr ::= expr GE expr */
- { 252, -3 }, /* (234) expr ::= expr NE expr */
- { 252, -3 }, /* (235) expr ::= expr EQ expr */
- { 252, -5 }, /* (236) expr ::= expr BETWEEN expr AND expr */
- { 252, -3 }, /* (237) expr ::= expr AND expr */
- { 252, -3 }, /* (238) expr ::= expr OR expr */
- { 252, -3 }, /* (239) expr ::= expr PLUS expr */
- { 252, -3 }, /* (240) expr ::= expr MINUS expr */
- { 252, -3 }, /* (241) expr ::= expr STAR expr */
- { 252, -3 }, /* (242) expr ::= expr SLASH expr */
- { 252, -3 }, /* (243) expr ::= expr REM expr */
- { 252, -3 }, /* (244) expr ::= expr LIKE expr */
- { 252, -5 }, /* (245) expr ::= expr IN LP exprlist RP */
- { 261, -3 }, /* (246) exprlist ::= exprlist COMMA expritem */
- { 261, -1 }, /* (247) exprlist ::= expritem */
- { 262, -1 }, /* (248) expritem ::= expr */
- { 262, 0 }, /* (249) expritem ::= */
- { 189, -3 }, /* (250) cmd ::= RESET QUERY CACHE */
- { 189, -3 }, /* (251) cmd ::= SYNCDB ids REPLICA */
- { 189, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
- { 189, -7 }, /* (253) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
- { 189, -7 }, /* (254) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
- { 189, -7 }, /* (255) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
- { 189, -8 }, /* (256) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
- { 189, -9 }, /* (257) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
- { 189, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
- { 189, -7 }, /* (259) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
- { 189, -7 }, /* (260) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
- { 189, -7 }, /* (261) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
- { 189, -8 }, /* (262) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
- { 189, -3 }, /* (263) cmd ::= KILL CONNECTION INTEGER */
- { 189, -5 }, /* (264) cmd ::= KILL STREAM INTEGER COLON INTEGER */
- { 189, -5 }, /* (265) cmd ::= KILL QUERY INTEGER COLON INTEGER */
+ { 252, -1 }, /* (226) expr ::= NULL */
+ { 252, -4 }, /* (227) expr ::= ID LP exprlist RP */
+ { 252, -4 }, /* (228) expr ::= ID LP STAR RP */
+ { 252, -3 }, /* (229) expr ::= expr IS NULL */
+ { 252, -4 }, /* (230) expr ::= expr IS NOT NULL */
+ { 252, -3 }, /* (231) expr ::= expr LT expr */
+ { 252, -3 }, /* (232) expr ::= expr GT expr */
+ { 252, -3 }, /* (233) expr ::= expr LE expr */
+ { 252, -3 }, /* (234) expr ::= expr GE expr */
+ { 252, -3 }, /* (235) expr ::= expr NE expr */
+ { 252, -3 }, /* (236) expr ::= expr EQ expr */
+ { 252, -5 }, /* (237) expr ::= expr BETWEEN expr AND expr */
+ { 252, -3 }, /* (238) expr ::= expr AND expr */
+ { 252, -3 }, /* (239) expr ::= expr OR expr */
+ { 252, -3 }, /* (240) expr ::= expr PLUS expr */
+ { 252, -3 }, /* (241) expr ::= expr MINUS expr */
+ { 252, -3 }, /* (242) expr ::= expr STAR expr */
+ { 252, -3 }, /* (243) expr ::= expr SLASH expr */
+ { 252, -3 }, /* (244) expr ::= expr REM expr */
+ { 252, -3 }, /* (245) expr ::= expr LIKE expr */
+ { 252, -5 }, /* (246) expr ::= expr IN LP exprlist RP */
+ { 261, -3 }, /* (247) exprlist ::= exprlist COMMA expritem */
+ { 261, -1 }, /* (248) exprlist ::= expritem */
+ { 262, -1 }, /* (249) expritem ::= expr */
+ { 262, 0 }, /* (250) expritem ::= */
+ { 189, -3 }, /* (251) cmd ::= RESET QUERY CACHE */
+ { 189, -3 }, /* (252) cmd ::= SYNCDB ids REPLICA */
+ { 189, -7 }, /* (253) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
+ { 189, -7 }, /* (254) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
+ { 189, -7 }, /* (255) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
+ { 189, -7 }, /* (256) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
+ { 189, -8 }, /* (257) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
+ { 189, -9 }, /* (258) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
+ { 189, -7 }, /* (259) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
+ { 189, -7 }, /* (260) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
+ { 189, -7 }, /* (261) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
+ { 189, -7 }, /* (262) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
+ { 189, -8 }, /* (263) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
+ { 189, -3 }, /* (264) cmd ::= KILL CONNECTION INTEGER */
+ { 189, -5 }, /* (265) cmd ::= KILL STREAM INTEGER COLON INTEGER */
+ { 189, -5 }, /* (266) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -2794,7 +2796,7 @@ static void yy_reduce(
break;
case 200: /* having_opt ::= */
case 210: /* where_opt ::= */ yytestcase(yyruleno==210);
- case 249: /* expritem ::= */ yytestcase(yyruleno==249);
+ case 250: /* expritem ::= */ yytestcase(yyruleno==250);
{yymsp[1].minor.yy118 = 0;}
break;
case 201: /* having_opt ::= HAVING expr */
@@ -2871,112 +2873,116 @@ static void yy_reduce(
{ yylhsminor.yy118 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy118 = yylhsminor.yy118;
break;
- case 226: /* expr ::= ID LP exprlist RP */
+ case 226: /* expr ::= NULL */
+{ yylhsminor.yy118 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);}
+ yymsp[0].minor.yy118 = yylhsminor.yy118;
+ break;
+ case 227: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy118 = tSqlExprCreateFunction(yymsp[-1].minor.yy159, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy118 = yylhsminor.yy118;
break;
- case 227: /* expr ::= ID LP STAR RP */
+ case 228: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy118 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy118 = yylhsminor.yy118;
break;
- case 228: /* expr ::= expr IS NULL */
+ case 229: /* expr ::= expr IS NULL */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, NULL, TK_ISNULL);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 229: /* expr ::= expr IS NOT NULL */
+ case 230: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-3].minor.yy118, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy118 = yylhsminor.yy118;
break;
- case 230: /* expr ::= expr LT expr */
+ case 231: /* expr ::= expr LT expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_LT);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 231: /* expr ::= expr GT expr */
+ case 232: /* expr ::= expr GT expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_GT);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 232: /* expr ::= expr LE expr */
+ case 233: /* expr ::= expr LE expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_LE);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 233: /* expr ::= expr GE expr */
+ case 234: /* expr ::= expr GE expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_GE);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 234: /* expr ::= expr NE expr */
+ case 235: /* expr ::= expr NE expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_NE);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 235: /* expr ::= expr EQ expr */
+ case 236: /* expr ::= expr EQ expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_EQ);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 236: /* expr ::= expr BETWEEN expr AND expr */
+ case 237: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy118); yylhsminor.yy118 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy118, yymsp[-2].minor.yy118, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy118, TK_LE), TK_AND);}
yymsp[-4].minor.yy118 = yylhsminor.yy118;
break;
- case 237: /* expr ::= expr AND expr */
+ case 238: /* expr ::= expr AND expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_AND);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 238: /* expr ::= expr OR expr */
+ case 239: /* expr ::= expr OR expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_OR); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 239: /* expr ::= expr PLUS expr */
+ case 240: /* expr ::= expr PLUS expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_PLUS); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 240: /* expr ::= expr MINUS expr */
+ case 241: /* expr ::= expr MINUS expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_MINUS); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 241: /* expr ::= expr STAR expr */
+ case 242: /* expr ::= expr STAR expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_STAR); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 242: /* expr ::= expr SLASH expr */
+ case 243: /* expr ::= expr SLASH expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_DIVIDE);}
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 243: /* expr ::= expr REM expr */
+ case 244: /* expr ::= expr REM expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_REM); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 244: /* expr ::= expr LIKE expr */
+ case 245: /* expr ::= expr LIKE expr */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-2].minor.yy118, yymsp[0].minor.yy118, TK_LIKE); }
yymsp[-2].minor.yy118 = yylhsminor.yy118;
break;
- case 245: /* expr ::= expr IN LP exprlist RP */
+ case 246: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy118 = tSqlExprCreate(yymsp[-4].minor.yy118, (tSqlExpr*)yymsp[-1].minor.yy159, TK_IN); }
yymsp[-4].minor.yy118 = yylhsminor.yy118;
break;
- case 246: /* exprlist ::= exprlist COMMA expritem */
+ case 247: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy159 = tSqlExprListAppend(yymsp[-2].minor.yy159,yymsp[0].minor.yy118,0, 0);}
yymsp[-2].minor.yy159 = yylhsminor.yy159;
break;
- case 247: /* exprlist ::= expritem */
+ case 248: /* exprlist ::= expritem */
{yylhsminor.yy159 = tSqlExprListAppend(0,yymsp[0].minor.yy118,0, 0);}
yymsp[0].minor.yy159 = yylhsminor.yy159;
break;
- case 248: /* expritem ::= expr */
+ case 249: /* expritem ::= expr */
{yylhsminor.yy118 = yymsp[0].minor.yy118;}
yymsp[0].minor.yy118 = yylhsminor.yy118;
break;
- case 250: /* cmd ::= RESET QUERY CACHE */
+ case 251: /* cmd ::= RESET QUERY CACHE */
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break;
- case 251: /* cmd ::= SYNCDB ids REPLICA */
+ case 252: /* cmd ::= SYNCDB ids REPLICA */
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
break;
- case 252: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
+ case 253: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy159, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 253: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
+ case 254: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@@ -2987,14 +2993,14 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 254: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
+ case 255: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy159, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 255: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
+ case 256: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@@ -3005,7 +3011,7 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 256: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
+ case 257: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
@@ -3019,7 +3025,7 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 257: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
+ case 258: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
@@ -3031,14 +3037,14 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 258: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
+ case 259: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy159, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 259: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
+ case 260: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@@ -3049,14 +3055,14 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 260: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
+ case 261: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy159, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 261: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
+ case 262: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@@ -3067,7 +3073,7 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 262: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
+ case 263: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
@@ -3081,13 +3087,13 @@ static void yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
- case 263: /* cmd ::= KILL CONNECTION INTEGER */
+ case 264: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break;
- case 264: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
+ case 265: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break;
- case 265: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
+ case 266: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break;
default:
diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c
index b33cdb8b807f545943e3676a96098818e54b31dd..77941cba82010a9187227b4740c4100680577403 100644
--- a/src/util/src/tsocket.c
+++ b/src/util/src/tsocket.c
@@ -22,6 +22,8 @@
#define SIGPIPE EPIPE
#endif
+#define TCP_CONN_TIMEOUT 3000 // conn timeout
+
int32_t taosGetFqdn(char *fqdn) {
char hostname[1024];
hostname[1023] = '\0';
@@ -346,10 +348,47 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie
serverAddr.sin_addr.s_addr = destIp;
serverAddr.sin_port = (uint16_t)htons((uint16_t)destPort);
- ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
+#ifdef _TD_LINUX
+ taosSetNonblocking(sockFd, 1);
+ ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
+ if (ret == -1) {
+ if (errno == EHOSTUNREACH) {
+ uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno));
+ taosCloseSocket(sockFd);
+ return -1;
+ } else if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) {
+ struct pollfd wfd[1];
+
+ wfd[0].fd = sockFd;
+ wfd[0].events = POLLOUT;
+
+ int res = poll(wfd, 1, TCP_CONN_TIMEOUT);
+ if (res == -1 || res == 0) {
+ uError("failed to connect socket, ip:0x%x, port:%hu(poll error/conn timeout)", destIp, destPort);
+ taosCloseSocket(sockFd); //
+ return -1;
+ }
+ int optVal = -1, optLen = sizeof(int);
+ if ((0 != taosGetSockOpt(sockFd, SOL_SOCKET, SO_ERROR, &optVal, &optLen)) || (optVal != 0)) {
+ uError("failed to connect socket, ip:0x%x, port:%hu(connect host error)", destIp, destPort);
+ taosCloseSocket(sockFd); //
+ return -1;
+ }
+ ret = 0;
+ } else { // Other error
+ uError("failed to connect socket, ip:0x%x, port:%hu(target host cannot be reached)", destIp, destPort);
+ taosCloseSocket(sockFd); //
+ return -1;
+ }
+ }
+ taosSetNonblocking(sockFd, 0);
+
+#else
+ ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
+#endif
if (ret != 0) {
- // uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno));
+ uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno));
taosCloseSocket(sockFd);
sockFd = -1;
} else {
diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c
index 8233c45632b1b08c6dfe24a1a692f21379dc5036..0836ade77ff6617ee032e7266c99ff73088f221b 100644
--- a/src/vnode/src/vnodeRead.c
+++ b/src/vnode/src/vnodeRead.c
@@ -364,7 +364,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
// register the qhandle to connect to quit query immediate if connection is broken
if (vnodeNotifyCurrentQhandle(pRead->rpcHandle, pRetrieve->qId, *handle, pVnode->vgId) != TSDB_CODE_SUCCESS) {
- vError("vgId:%d, QInfo:%"PRIu64 "-%p, retrieve discarded since link is broken, %p", pVnode->vgId, pRetrieve->qhandle, *handle, pRead->rpcHandle);
+ vError("vgId:%d, QInfo:%"PRIu64 "-%p, retrieve discarded since link is broken, conn:%p", pVnode->vgId, pRetrieve->qhandle, *handle, pRead->rpcHandle);
code = TSDB_CODE_RPC_NETWORK_UNAVAIL;
qKillQuery(*handle);
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);
@@ -409,7 +409,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
// client is broken, the query needs to be killed immediately.
int32_t vnodeNotifyCurrentQhandle(void *handle, uint64_t qId, void *qhandle, int32_t vgId) {
SRetrieveTableMsg *pMsg = rpcMallocCont(sizeof(SRetrieveTableMsg));
- pMsg->qhandle = htobe64((uint64_t)qhandle);
+ pMsg->qId = htobe64(qId);
pMsg->header.vgId = htonl(vgId);
pMsg->header.contLen = htonl(sizeof(SRetrieveTableMsg));
diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c
index e318978a11186a86dff79a5aaea234b9719ce979..92e1ba804be5ab30366594933ebcdaff3bd0727b 100644
--- a/src/vnode/src/vnodeWrite.c
+++ b/src/vnode/src/vnodeWrite.c
@@ -96,6 +96,7 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
// write into WAL
code = walWrite(pVnode->wal, pHead);
if (code < 0) {
+ if (syncCode > 0) atomic_sub_fetch_32(&pWrite->processedCount, 1);
vError("vgId:%d, hver:%" PRIu64 " vver:%" PRIu64 " code:0x%x", pVnode->vgId, pHead->version, pVnode->version, code);
return code;
}
@@ -104,7 +105,10 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
// write data locally
code = (*vnodeProcessWriteMsgFp[pHead->msgType])(pVnode, pHead->cont, pRspRet);
- if (code < 0) return code;
+ if (code < 0) {
+ if (syncCode > 0) atomic_sub_fetch_32(&pWrite->processedCount, 1);
+ return code;
+ }
return syncCode;
}
diff --git a/tests/script/general/parser/topbot.sim b/tests/script/general/parser/topbot.sim
index e23bbf6724ea7b95a759764ac80cc2dbcdb73398..5c61acb2ba246f1f0102ed01b90e0b164ebfa8dc 100644
--- a/tests/script/general/parser/topbot.sim
+++ b/tests/script/general/parser/topbot.sim
@@ -325,4 +325,56 @@ if $row != 0 then
return -1
endi
+print ===============================>td-3621
+sql create table ttm2(ts timestamp, k bool);
+sql insert into ttm2 values('2021-1-1 1:1:1', true)
+sql insert into ttm2 values('2021-1-1 1:1:2', NULL)
+sql insert into ttm2 values('2021-1-1 1:1:3', false)
+sql select * from ttm2 where k is not null
+if $row != 2 then
+ return -1
+endi
+
+if $data00 != @21-01-01 01:01:01.000@ then
+ print expect 21-01-01 01:01:01.000, actual $data00
+ return -1
+endi
+
+sql select * from ttm2 where k is null
+if $row != 1 then
+ return -1
+endi
+
+if $data00 != @21-01-01 01:01:02.000@ then
+ return -1
+endi
+
+sql select * from ttm2 where k=true
+if $row != 1 then
+ return -1
+endi
+
+if $data00 != @21-01-01 01:01:01.000@ then
+ return -1
+endi
+
+sql select * from ttm2 where k=false
+if $row != 1 then
+ return -1
+endi
+
+if $data00 != @21-01-01 01:01:03.000@ then
+ return -1
+endi
+
+sql select * from ttm2 where k<>false
+if $row != 1 then
+ return -1
+endi
+
+sql_error select * from ttm2 where k=null
+sql_error select * from ttm2 where k<>null
+sql_error select * from ttm2 where k like null
+sql_error select * from ttm2 where k