diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index d7e86bab4f..8956c3b7cf 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -955,9 +955,14 @@ typedef struct {
char db[TSDB_DB_FNAME_LEN];
char tb[TSDB_TABLE_NAME_LEN];
int64_t showId;
- int8_t free;
} SRetrieveTableReq;
+typedef struct SSysTableSchema {
+ int8_t type;
+ col_id_t colId;
+ int32_t bytes;
+} SSysTableSchema;
+
int32_t tSerializeSRetrieveTableReq(void* buf, int32_t bufLen, SRetrieveTableReq* pReq);
int32_t tDeserializeSRetrieveTableReq(void* buf, int32_t bufLen, SRetrieveTableReq* pReq);
diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h
index 5f919a28d7..e553dff270 100644
--- a/include/common/tmsgdef.h
+++ b/include/common/tmsgdef.h
@@ -136,7 +136,6 @@ enum {
TD_DEF_MSG_TYPE(TDMT_MND_KILL_CONN, "mnode-kill-conn", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_HEARTBEAT, "mnode-heartbeat", SClientHbBatchReq, SClientHbBatchRsp)
TD_DEF_MSG_TYPE(TDMT_MND_SHOW, "mnode-show", NULL, NULL)
- TD_DEF_MSG_TYPE(TDMT_MND_SHOW_RETRIEVE, "mnode-retrieve", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_SYSTABLE_RETRIEVE, "mnode-systable-retrieve", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_STATUS, "mnode-status", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_TRANS_TIMER, "mnode-trans-tmr", NULL, NULL)
@@ -189,8 +188,8 @@ enum {
TD_DEF_MSG_TYPE(TDMT_VND_CREATE_TOPIC, "vnode-create-topic", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_ALTER_TOPIC, "vnode-alter-topic", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_DROP_TOPIC, "vnode-drop-topic", NULL, NULL)
- TD_DEF_MSG_TYPE(TDMT_VND_SHOW_TABLES, "vnode-show-tables", SVShowTablesReq, SVShowTablesRsp)
- TD_DEF_MSG_TYPE(TDMT_VND_SHOW_TABLES_FETCH, "vnode-show-tables-fetch", SVShowTablesFetchReq, SVShowTablesFetchRsp)
+// TD_DEF_MSG_TYPE(TDMT_VND_SHOW_TABLES, "vnode-show-tables", SVShowTablesReq, SVShowTablesRsp)
+// TD_DEF_MSG_TYPE(TDMT_VND_SHOW_TABLES_FETCH, "vnode-show-tables-fetch", SVShowTablesFetchReq, SVShowTablesFetchRsp)
TD_DEF_MSG_TYPE(TDMT_VND_QUERY_CONTINUE, "vnode-query-continue", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_QUERY_HEARTBEAT, "vnode-query-heartbeat", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_EXPLAIN, "vnode-explain", NULL, NULL)
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index f5b9c23ee6..7840d18256 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -182,47 +182,48 @@
#define TK_FIRST 164
#define TK_LAST 165
#define TK_NOW 166
-#define TK_ROWTS 167
-#define TK_TBNAME 168
-#define TK_QSTARTTS 169
-#define TK_QENDTS 170
-#define TK_WSTARTTS 171
-#define TK_WENDTS 172
-#define TK_WDURATION 173
-#define TK_BETWEEN 174
-#define TK_IS 175
-#define TK_NK_LT 176
-#define TK_NK_GT 177
-#define TK_NK_LE 178
-#define TK_NK_GE 179
-#define TK_NK_NE 180
-#define TK_MATCH 181
-#define TK_NMATCH 182
-#define TK_JOIN 183
-#define TK_INNER 184
-#define TK_SELECT 185
-#define TK_DISTINCT 186
-#define TK_WHERE 187
-#define TK_PARTITION 188
-#define TK_BY 189
-#define TK_SESSION 190
-#define TK_STATE_WINDOW 191
-#define TK_SLIDING 192
-#define TK_FILL 193
-#define TK_VALUE 194
-#define TK_NONE 195
-#define TK_PREV 196
-#define TK_LINEAR 197
-#define TK_NEXT 198
-#define TK_GROUP 199
-#define TK_HAVING 200
-#define TK_ORDER 201
-#define TK_SLIMIT 202
-#define TK_SOFFSET 203
-#define TK_LIMIT 204
-#define TK_OFFSET 205
-#define TK_ASC 206
-#define TK_NULLS 207
+#define TK_TODAY 167
+#define TK_ROWTS 168
+#define TK_TBNAME 169
+#define TK_QSTARTTS 170
+#define TK_QENDTS 171
+#define TK_WSTARTTS 172
+#define TK_WENDTS 173
+#define TK_WDURATION 174
+#define TK_BETWEEN 175
+#define TK_IS 176
+#define TK_NK_LT 177
+#define TK_NK_GT 178
+#define TK_NK_LE 179
+#define TK_NK_GE 180
+#define TK_NK_NE 181
+#define TK_MATCH 182
+#define TK_NMATCH 183
+#define TK_JOIN 184
+#define TK_INNER 185
+#define TK_SELECT 186
+#define TK_DISTINCT 187
+#define TK_WHERE 188
+#define TK_PARTITION 189
+#define TK_BY 190
+#define TK_SESSION 191
+#define TK_STATE_WINDOW 192
+#define TK_SLIDING 193
+#define TK_FILL 194
+#define TK_VALUE 195
+#define TK_NONE 196
+#define TK_PREV 197
+#define TK_LINEAR 198
+#define TK_NEXT 199
+#define TK_GROUP 200
+#define TK_HAVING 201
+#define TK_ORDER 202
+#define TK_SLIMIT 203
+#define TK_SOFFSET 204
+#define TK_LIMIT 205
+#define TK_OFFSET 206
+#define TK_ASC 207
+#define TK_NULLS 208
#define TK_NK_SPACE 300
#define TK_NK_COMMENT 301
diff --git a/include/common/ttypes.h b/include/common/ttypes.h
index 032cb44122..1bce57f191 100644
--- a/include/common/ttypes.h
+++ b/include/common/ttypes.h
@@ -24,7 +24,6 @@ extern "C" {
#include "types.h"
// ----------------- For variable data types such as TSDB_DATA_TYPE_BINARY and TSDB_DATA_TYPE_NCHAR
-typedef int32_t VarDataOffsetT;
typedef uint32_t TDRowLenT;
typedef uint8_t TDRowValT;
typedef uint64_t TDRowVerT;
diff --git a/include/util/tdef.h b/include/util/tdef.h
index f276a1a812..eeaa34007a 100644
--- a/include/util/tdef.h
+++ b/include/util/tdef.h
@@ -100,6 +100,7 @@ extern const int32_t TYPE_BYTES[15];
#define TSDB_TIME_PRECISION_NANO_DIGITS 19
#define TSDB_INFORMATION_SCHEMA_DB "information_schema"
+#define TSDB_PERFORMANCE_SCHEMA_DB "performance_schema"
#define TSDB_INS_TABLE_DNODES "dnodes"
#define TSDB_INS_TABLE_MNODES "mnodes"
#define TSDB_INS_TABLE_MODULES "modules"
@@ -117,6 +118,7 @@ extern const int32_t TYPE_BYTES[15];
#define TSDB_INS_TABLE_VGROUPS "vgroups"
#define TSDB_INS_TABLE_BNODES "bnodes"
#define TSDB_INS_TABLE_SNODES "snodes"
+#define TSDB_INS_TABLE_LICENCES "grants"
#define TSDB_INDEX_TYPE_SMA "SMA"
#define TSDB_INDEX_TYPE_FULLTEXT "FULLTEXT"
diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h
index 142c4ee5c3..0f12880272 100644
--- a/source/client/inc/clientInt.h
+++ b/source/client/inc/clientInt.h
@@ -284,7 +284,7 @@ int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArra
int32_t buildRequest(STscObj* pTscObj, const char* sql, int sqlLen, SRequestObj** pRequest);
-void* doFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4);
+void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4);
void doSetOneRowPtr(SReqResultInfo* pResultInfo);
int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32_t numOfCols, int32_t numOfRows,
bool convertUcs4);
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index d09205d088..52262eeaef 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -193,13 +193,6 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
STscObj* pTscObj = pRequest->pTscObj;
SMsgSendInfo* pSendMsg = buildMsgInfoImpl(pRequest);
- if (pMsgInfo->msgType == TDMT_VND_SHOW_TABLES) {
- SShowReqInfo* pShowReqInfo = &pRequest->body.showInfo;
- if (pShowReqInfo->pArray == NULL) {
- pShowReqInfo->currentIndex = 0; // set the first vnode/ then iterate the next vnode
- pShowReqInfo->pArray = pMsgInfo->pExtension;
- }
- }
int64_t transporterId = 0;
asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &pMsgInfo->epSet, &transporterId, pSendMsg);
@@ -614,102 +607,38 @@ void doSetOneRowPtr(SReqResultInfo* pResultInfo) {
}
}
-void* doFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4) {
+void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4) {
assert(pRequest != NULL);
+
SReqResultInfo* pResultInfo = &pRequest->body.resInfo;
-
- SEpSet epSet = {0};
-
if (pResultInfo->pData == NULL || pResultInfo->current >= pResultInfo->numOfRows) {
- if (pRequest->type == TDMT_VND_QUERY) {
- // All data has returned to App already, no need to try again
- if (pResultInfo->completed) {
- pResultInfo->numOfRows = 0;
- return NULL;
- }
-
- SReqResultInfo* pResInfo = &pRequest->body.resInfo;
- pRequest->code = schedulerFetchRows(pRequest->body.queryJob, (void**)&pResInfo->pData);
- if (pRequest->code != TSDB_CODE_SUCCESS) {
- pResultInfo->numOfRows = 0;
- return NULL;
- }
-
- pRequest->code = setQueryResultFromRsp(&pRequest->body.resInfo, (SRetrieveTableRsp*)pResInfo->pData, convertUcs4);
- if (pRequest->code != TSDB_CODE_SUCCESS) {
- pResultInfo->numOfRows = 0;
- return NULL;
- }
-
- tscDebug("0x%" PRIx64 " fetch results, numOfRows:%d total Rows:%" PRId64 ", complete:%d, reqId:0x%" PRIx64,
- pRequest->self, pResInfo->numOfRows, pResInfo->totalRows, pResInfo->completed, pRequest->requestId);
-
- if (pResultInfo->numOfRows == 0) {
- return NULL;
- }
-
- goto _return;
- } else if (pRequest->type == TDMT_MND_SHOW) {
- pRequest->type = TDMT_MND_SHOW_RETRIEVE;
- epSet = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp);
- } else if (pRequest->type == TDMT_VND_SHOW_TABLES) {
- pRequest->type = TDMT_VND_SHOW_TABLES_FETCH;
- SShowReqInfo* pShowReqInfo = &pRequest->body.showInfo;
- SVgroupInfo* pVgroupInfo = taosArrayGet(pShowReqInfo->pArray, pShowReqInfo->currentIndex);
-
- epSet = pVgroupInfo->epSet;
- } else if (pRequest->type == TDMT_VND_SHOW_TABLES_FETCH) {
- pRequest->type = TDMT_VND_SHOW_TABLES;
- SShowReqInfo* pShowReqInfo = &pRequest->body.showInfo;
- pShowReqInfo->currentIndex += 1;
- if (pShowReqInfo->currentIndex >= taosArrayGetSize(pShowReqInfo->pArray)) {
- return NULL;
- }
-
- SVgroupInfo* pVgroupInfo = taosArrayGet(pShowReqInfo->pArray, pShowReqInfo->currentIndex);
- SVShowTablesReq* pShowReq = taosMemoryCalloc(1, sizeof(SVShowTablesReq));
- pShowReq->head.vgId = htonl(pVgroupInfo->vgId);
-
- pRequest->body.requestMsg.len = sizeof(SVShowTablesReq);
- pRequest->body.requestMsg.pData = pShowReq;
-
- SMsgSendInfo* body = buildMsgInfoImpl(pRequest);
- epSet = pVgroupInfo->epSet;
-
- int64_t transporterId = 0;
- STscObj* pTscObj = pRequest->pTscObj;
- asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, body);
- tsem_wait(&pRequest->body.rspSem);
-
- pRequest->type = TDMT_VND_SHOW_TABLES_FETCH;
- } else if (pRequest->type == TDMT_MND_SHOW_RETRIEVE) {
- epSet = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp);
-
- if (pResultInfo->completed) {
- return NULL;
- }
- }
-
+ // All data has returned to App already, no need to try again
if (pResultInfo->completed) {
pResultInfo->numOfRows = 0;
return NULL;
}
- SMsgSendInfo* body = buildMsgInfoImpl(pRequest);
+ SReqResultInfo* pResInfo = &pRequest->body.resInfo;
+ pRequest->code = schedulerFetchRows(pRequest->body.queryJob, (void**)&pResInfo->pData);
+ if (pRequest->code != TSDB_CODE_SUCCESS) {
+ pResultInfo->numOfRows = 0;
+ return NULL;
+ }
- int64_t transporterId = 0;
- STscObj* pTscObj = pRequest->pTscObj;
- asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, body);
+ pRequest->code = setQueryResultFromRsp(&pRequest->body.resInfo, (SRetrieveTableRsp*)pResInfo->pData, convertUcs4);
+ if (pRequest->code != TSDB_CODE_SUCCESS) {
+ pResultInfo->numOfRows = 0;
+ return NULL;
+ }
- tsem_wait(&pRequest->body.rspSem);
+ tscDebug("0x%" PRIx64 " fetch results, numOfRows:%d total Rows:%" PRId64 ", complete:%d, reqId:0x%" PRIx64,
+ pRequest->self, pResInfo->numOfRows, pResInfo->totalRows, pResInfo->completed, pRequest->requestId);
- pResultInfo->current = 0;
- if (pResultInfo->numOfRows <= pResultInfo->current) {
+ if (pResultInfo->numOfRows == 0) {
return NULL;
}
}
-_return:
if (setupOneRowPtr) {
doSetOneRowPtr(pResultInfo);
pResultInfo->current += 1;
diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c
index 7bc29e2427..6fab4aa4e1 100644
--- a/source/client/src/clientMain.c
+++ b/source/client/src/clientMain.c
@@ -170,7 +170,7 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
return NULL;
}
- return doFetchRow(pRequest, true, true);
+ return doFetchRows(pRequest, true, true);
} else if (TD_RES_TMQ(res)) {
SMqRspObj *msg = ((SMqRspObj *)res);
@@ -436,7 +436,7 @@ int taos_fetch_block_s(TAOS_RES *res, int *numOfRows, TAOS_ROW *rows) {
return 0;
}
- doFetchRow(pRequest, false, true);
+ doFetchRows(pRequest, false, true);
// TODO refactor
SReqResultInfo *pResultInfo = &pRequest->body.resInfo;
@@ -471,7 +471,7 @@ int taos_fetch_raw_block(TAOS_RES *res, int *numOfRows, void **pData) {
return 0;
}
- doFetchRow(pRequest, false, true);
+ doFetchRows(pRequest, false, false);
SReqResultInfo *pResultInfo = &pRequest->body.resInfo;
diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c
index 960cf1620a..67c5679cac 100644
--- a/source/client/src/clientMsgHandler.c
+++ b/source/client/src/clientMsgHandler.c
@@ -13,13 +13,13 @@
* along with this program. If not, see .
*/
-#include "catalog.h"
-#include "clientInt.h"
-#include "clientLog.h"
#include "os.h"
-#include "query.h"
#include "tdef.h"
#include "tname.h"
+#include "clientInt.h"
+#include "clientLog.h"
+#include "catalog.h"
+#include "query.h"
int32_t (*handleRequestRspFp[TDMT_MAX])(void*, const SDataBuf* pMsg, int32_t code);
@@ -82,160 +82,21 @@ int32_t processConnectRsp(void* param, const SDataBuf* pMsg, int32_t code) {
return 0;
}
-SMsgSendInfo* buildMsgInfoImpl(SRequestObj* pRequest) {
+SMsgSendInfo* buildMsgInfoImpl(SRequestObj *pRequest) {
SMsgSendInfo* pMsgSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
pMsgSendInfo->requestObjRefId = pRequest->self;
- pMsgSendInfo->requestId = pRequest->requestId;
- pMsgSendInfo->param = pRequest;
- pMsgSendInfo->msgType = pRequest->type;
+ pMsgSendInfo->requestId = pRequest->requestId;
+ pMsgSendInfo->param = pRequest;
+ pMsgSendInfo->msgType = pRequest->type;
- if (pRequest->type == TDMT_MND_SHOW_RETRIEVE || pRequest->type == TDMT_VND_SHOW_TABLES_FETCH) {
- if (pRequest->type == TDMT_MND_SHOW_RETRIEVE) {
- SRetrieveTableReq retrieveReq = {0};
- retrieveReq.showId = pRequest->body.showInfo.execId;
+ assert(pRequest != NULL);
+ pMsgSendInfo->msgInfo = pRequest->body.requestMsg;
- int32_t contLen = tSerializeSRetrieveTableReq(NULL, 0, &retrieveReq);
- void* pReq = taosMemoryMalloc(contLen);
- tSerializeSRetrieveTableReq(pReq, contLen, &retrieveReq);
- pMsgSendInfo->msgInfo.pData = pReq;
- pMsgSendInfo->msgInfo.len = contLen;
- pMsgSendInfo->msgInfo.handle = NULL;
- } else {
- SVShowTablesFetchReq* pFetchMsg = taosMemoryCalloc(1, sizeof(SVShowTablesFetchReq));
- if (pFetchMsg == NULL) {
- return NULL;
- }
-
- pFetchMsg->id = htobe64(pRequest->body.showInfo.execId);
- pFetchMsg->head.vgId = htonl(pRequest->body.showInfo.vgId);
-
- pMsgSendInfo->msgInfo.pData = pFetchMsg;
- pMsgSendInfo->msgInfo.len = sizeof(SVShowTablesFetchReq);
- pMsgSendInfo->msgInfo.handle = NULL;
- }
- } else {
- assert(pRequest != NULL);
- pMsgSendInfo->msgInfo = pRequest->body.requestMsg;
- }
-
- pMsgSendInfo->fp = (handleRequestRspFp[TMSG_INDEX(pRequest->type)] == NULL)
- ? genericRspCallback
- : handleRequestRspFp[TMSG_INDEX(pRequest->type)];
+ pMsgSendInfo->fp = (handleRequestRspFp[TMSG_INDEX(pRequest->type)] == NULL)? genericRspCallback:handleRequestRspFp[TMSG_INDEX(pRequest->type)];
return pMsgSendInfo;
}
-int32_t processShowRsp(void* param, const SDataBuf* pMsg, int32_t code) {
- SRequestObj* pRequest = param;
- if (code != TSDB_CODE_SUCCESS) {
- setErrno(pRequest, code);
- tsem_post(&pRequest->body.rspSem);
- return code;
- }
-
- SShowRsp showRsp = {0};
- tDeserializeSShowRsp(pMsg->pData, pMsg->len, &showRsp);
- STableMetaRsp* pMetaMsg = &showRsp.tableMeta;
-
- taosMemoryFreeClear(pRequest->body.resInfo.pRspMsg);
- pRequest->body.resInfo.pRspMsg = pMsg->pData;
- SReqResultInfo* pResInfo = &pRequest->body.resInfo;
-
- if (pResInfo->fields == NULL) {
- TAOS_FIELD* pFields = taosMemoryCalloc(pMetaMsg->numOfColumns, sizeof(TAOS_FIELD));
- for (int32_t i = 0; i < pMetaMsg->numOfColumns; ++i) {
- SSchema* pSchema = &pMetaMsg->pSchemas[i];
- tstrncpy(pFields[i].name, pSchema->name, tListLen(pFields[i].name));
- pFields[i].type = pSchema->type;
- pFields[i].bytes = pSchema->bytes;
- }
-
- pResInfo->fields = pFields;
- }
-
- pResInfo->numOfCols = pMetaMsg->numOfColumns;
- pRequest->body.showInfo.execId = showRsp.showId;
- tFreeSShowRsp(&showRsp);
-
- // todo
- if (pRequest->type == TDMT_VND_SHOW_TABLES) {
- SShowReqInfo* pShowInfo = &pRequest->body.showInfo;
-
- int32_t index = pShowInfo->currentIndex;
- SVgroupInfo* pInfo = taosArrayGet(pShowInfo->pArray, index);
- pShowInfo->vgId = pInfo->vgId;
- }
-
- tsem_post(&pRequest->body.rspSem);
- return 0;
-}
-
-int32_t processRetrieveMnodeRsp(void* param, const SDataBuf* pMsg, int32_t code) {
- SRequestObj* pRequest = param;
- SReqResultInfo* pResInfo = &pRequest->body.resInfo;
- taosMemoryFreeClear(pResInfo->pRspMsg);
-
- if (code != TSDB_CODE_SUCCESS) {
- setErrno(pRequest, code);
- tsem_post(&pRequest->body.rspSem);
- return code;
- }
-
- assert(pMsg->len >= sizeof(SRetrieveTableRsp));
-
- SRetrieveTableRsp* pRetrieve = (SRetrieveTableRsp*)pMsg->pData;
- pRetrieve->numOfRows = htonl(pRetrieve->numOfRows);
- pRetrieve->precision = htons(pRetrieve->precision);
-
- pResInfo->pRspMsg = pMsg->pData;
- pResInfo->numOfRows = pRetrieve->numOfRows;
- pResInfo->pData = pRetrieve->data;
- pResInfo->completed = pRetrieve->completed;
-
- pResInfo->current = 0;
- // setResultDataPtr(pResInfo, pResInfo->fields, pResInfo->numOfCols, pResInfo->numOfRows);
-
- tscDebug("0x%" PRIx64 " numOfRows:%d, complete:%d, qId:0x%" PRIx64, pRequest->self, pRetrieve->numOfRows,
- pRetrieve->completed, pRequest->body.showInfo.execId);
-
- tsem_post(&pRequest->body.rspSem);
- return 0;
-}
-
-int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
- SRequestObj* pRequest = param;
-
- SReqResultInfo* pResInfo = &pRequest->body.resInfo;
- taosMemoryFreeClear(pResInfo->pRspMsg);
-
- if (code != TSDB_CODE_SUCCESS) {
- setErrno(pRequest, code);
- tsem_post(&pRequest->body.rspSem);
- return code;
- }
-
- assert(pMsg->len >= sizeof(SRetrieveTableRsp));
-
- pResInfo->pRspMsg = pMsg->pData;
-
- SVShowTablesFetchRsp* pFetchRsp = (SVShowTablesFetchRsp*)pMsg->pData;
- pFetchRsp->numOfRows = htonl(pFetchRsp->numOfRows);
- pFetchRsp->precision = htons(pFetchRsp->precision);
-
- pResInfo->pRspMsg = pMsg->pData;
- pResInfo->numOfRows = pFetchRsp->numOfRows;
- pResInfo->pData = pFetchRsp->data;
-
- pResInfo->current = 0;
- // setResultDataPtr(pResInfo, pResInfo->fields, pResInfo->numOfCols, pResInfo->numOfRows);
-
- tscDebug("0x%" PRIx64 " numOfRows:%d, complete:%d, qId:0x%" PRIx64, pRequest->self, pFetchRsp->numOfRows,
- pFetchRsp->completed, pRequest->body.showInfo.execId);
-
- tsem_post(&pRequest->body.rspSem);
- return 0;
-}
-
int32_t processCreateDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
// todo rsp with the vnode id list
SRequestObj* pRequest = param;
@@ -253,7 +114,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
if (TSDB_CODE_MND_DB_NOT_EXIST == code) {
SUseDbRsp usedbRsp = {0};
tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp);
- struct SCatalog* pCatalog = NULL;
+ struct SCatalog *pCatalog = NULL;
if (usedbRsp.vgVersion >= 0) {
int32_t code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
@@ -423,14 +284,9 @@ void initMsgHandleFp() {
tscProcessMsgRsp[TSDB_SQL_SHOW_CREATE_DATABASE] = tscProcessShowCreateRsp;
#endif
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_CONNECT)] = processConnectRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_SHOW)] = processShowRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_SHOW_RETRIEVE)] = processRetrieveMnodeRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_CREATE_DB)] = processCreateDbRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_USE_DB)] = processUseDbRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_CREATE_STB)] = processCreateTableRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_MND_DROP_DB)] = processDropDbRsp;
-
- handleRequestRspFp[TMSG_INDEX(TDMT_VND_SHOW_TABLES)] = processShowRsp;
- handleRequestRspFp[TMSG_INDEX(TDMT_VND_SHOW_TABLES_FETCH)] = processRetrieveVndRsp;
+ handleRequestRspFp[TMSG_INDEX(TDMT_MND_CONNECT)] = processConnectRsp;
+ handleRequestRspFp[TMSG_INDEX(TDMT_MND_CREATE_DB)] = processCreateDbRsp;
+ handleRequestRspFp[TMSG_INDEX(TDMT_MND_USE_DB)] = processUseDbRsp;
+ handleRequestRspFp[TMSG_INDEX(TDMT_MND_CREATE_STB)] = processCreateTableRsp;
+ handleRequestRspFp[TMSG_INDEX(TDMT_MND_DROP_DB)] = processDropDbRsp;
}
diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp
index fd2abbb559..f5d8d7ec67 100644
--- a/source/client/test/clientTests.cpp
+++ b/source/client/test/clientTests.cpp
@@ -675,8 +675,15 @@ TEST(testCase, agg_query_tables) {
char str[512] = {0};
while ((pRow = taos_fetch_row(pRes)) != NULL) {
+ int32_t* length = taos_fetch_lengths(pRes);
+ for(int32_t i = 0; i < numOfFields; ++i) {
+ printf("(%d):%d " , i, length[i]);
+ }
+ printf("\n");
+
int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
printf("%s\n", str);
+ memset(str, 0, sizeof(str));
}
taos_free_result(pRes);
diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c
index 4d0a2b5e0d..4aeaec5051 100644
--- a/source/common/src/tmsg.c
+++ b/source/common/src/tmsg.c
@@ -2182,7 +2182,7 @@ int32_t tSerializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableReq
if (tStartEncode(&encoder) < 0) return -1;
if (tEncodeI64(&encoder, pReq->showId) < 0) return -1;
if (tEncodeI32(&encoder, pReq->type) < 0) return -1;
- if (tEncodeI8(&encoder, pReq->free) < 0) return -1;
+// if (tEncodeI8(&encoder, pReq->free) < 0) return -1;
if (tEncodeCStr(&encoder, pReq->db) < 0) return -1;
if (tEncodeCStr(&encoder, pReq->tb) < 0) return -1;
tEndEncode(&encoder);
@@ -2199,7 +2199,7 @@ int32_t tDeserializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableR
if (tStartDecode(&decoder) < 0) return -1;
if (tDecodeI64(&decoder, &pReq->showId) < 0) return -1;
if (tDecodeI32(&decoder, &pReq->type) < 0) return -1;
- if (tDecodeI8(&decoder, &pReq->free) < 0) return -1;
+// if (tDecodeI8(&decoder, &pReq->free) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->tb) < 0) return -1;
tEndDecode(&decoder);
diff --git a/source/dnode/mgmt/CMakeLists.txt b/source/dnode/mgmt/CMakeLists.txt
index 8fb4b02479..e002bbe444 100644
--- a/source/dnode/mgmt/CMakeLists.txt
+++ b/source/dnode/mgmt/CMakeLists.txt
@@ -24,13 +24,6 @@ target_include_directories(
)
target_link_libraries(taosd dnode)
-IF (TD_GRANT)
- TARGET_LINK_LIBRARIES(taosd grant)
-ENDIF ()
-IF (TD_USB_DONGLE)
- TARGET_LINK_LIBRARIES(taosd usb_dongle)
-ENDIF ()
-
if(${BUILD_TEST})
add_subdirectory(test)
endif(${BUILD_TEST})
diff --git a/source/dnode/mgmt/exe/dndMain.c b/source/dnode/mgmt/exe/dndMain.c
index 80c431fe36..ae2b734319 100644
--- a/source/dnode/mgmt/exe/dndMain.c
+++ b/source/dnode/mgmt/exe/dndMain.c
@@ -91,7 +91,7 @@ static int32_t dndParseArgs(int32_t argc, char const *argv[]) {
}
static void dndGenerateGrant() {
- grantParseParameter();
+ parseGrantParameter();
}
static void dndPrintVersion() {
diff --git a/source/dnode/mgmt/mm/mmHandle.c b/source/dnode/mgmt/mm/mmHandle.c
index 63240c3224..c4b99c2bc9 100644
--- a/source/dnode/mgmt/mm/mmHandle.c
+++ b/source/dnode/mgmt/mm/mmHandle.c
@@ -164,7 +164,6 @@ void mmInitMsgHandle(SMgmtWrapper *pWrapper) {
dndSetMsgHandle(pWrapper, TDMT_MND_KILL_CONN, mmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_MND_HEARTBEAT, mmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_MND_SHOW, mmProcessReadMsg, DEFAULT_HANDLE);
- dndSetMsgHandle(pWrapper, TDMT_MND_SHOW_RETRIEVE, mmProcessReadMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_MND_SYSTABLE_RETRIEVE, mmProcessReadMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_MND_STATUS, mmProcessReadMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_MND_KILL_TRANS, mmProcessWriteMsg, DEFAULT_HANDLE);
diff --git a/source/dnode/mgmt/qm/qmHandle.c b/source/dnode/mgmt/qm/qmHandle.c
index 4fda72759a..96fb4d20e4 100644
--- a/source/dnode/mgmt/qm/qmHandle.c
+++ b/source/dnode/mgmt/qm/qmHandle.c
@@ -95,5 +95,4 @@ void qmInitMsgHandle(SMgmtWrapper *pWrapper) {
dndSetMsgHandle(pWrapper, TDMT_VND_TASKS_STATUS, qmProcessFetchMsg, QNODE_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_CANCEL_TASK, qmProcessFetchMsg, QNODE_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_DROP_TASK, qmProcessFetchMsg, QNODE_HANDLE);
- dndSetMsgHandle(pWrapper, TDMT_VND_SHOW_TABLES, qmProcessFetchMsg, QNODE_HANDLE);
}
diff --git a/source/dnode/mgmt/test/sut/src/sut.cpp b/source/dnode/mgmt/test/sut/src/sut.cpp
index 14197153b4..01532e66f9 100644
--- a/source/dnode/mgmt/test/sut/src/sut.cpp
+++ b/source/dnode/mgmt/test/sut/src/sut.cpp
@@ -133,17 +133,17 @@ const char* Testbase::GetMetaTbName() { return metaRsp.tbName; }
void Testbase::SendShowRetrieveReq() {
SRetrieveTableReq retrieveReq = {0};
retrieveReq.showId = showId;
- retrieveReq.free = 0;
+// retrieveReq.free = 0;
int32_t contLen = tSerializeSRetrieveTableReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
tSerializeSRetrieveTableReq(pReq, contLen, &retrieveReq);
- SRpcMsg* pRsp = SendReq(TDMT_MND_SHOW_RETRIEVE, pReq, contLen);
- pRetrieveRsp = (SRetrieveTableRsp*)pRsp->pCont;
- pRetrieveRsp->numOfRows = htonl(pRetrieveRsp->numOfRows);
- pRetrieveRsp->useconds = htobe64(pRetrieveRsp->useconds);
- pRetrieveRsp->compLen = htonl(pRetrieveRsp->compLen);
+// SRpcMsg* pRsp = SendReq(TDMT_MND_SHOW_RETRIEVE, pReq, contLen);
+// pRetrieveRsp = (SRetrieveTableRsp*)pRsp->pCont;
+// pRetrieveRsp->numOfRows = htonl(pRetrieveRsp->numOfRows);
+// pRetrieveRsp->useconds = htobe64(pRetrieveRsp->useconds);
+// pRetrieveRsp->compLen = htonl(pRetrieveRsp->compLen);
pData = pRetrieveRsp->data;
pos = 0;
diff --git a/source/dnode/mgmt/vm/vmHandle.c b/source/dnode/mgmt/vm/vmHandle.c
index 0e74ca656c..3623654218 100644
--- a/source/dnode/mgmt/vm/vmHandle.c
+++ b/source/dnode/mgmt/vm/vmHandle.c
@@ -335,8 +335,6 @@ void vmInitMsgHandle(SMgmtWrapper *pWrapper) {
dndSetMsgHandle(pWrapper, TDMT_VND_CREATE_SMA, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_CANCEL_SMA, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_DROP_SMA, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
- dndSetMsgHandle(pWrapper, TDMT_VND_SHOW_TABLES, (NodeMsgFp)vmProcessFetchMsg, DEFAULT_HANDLE);
- dndSetMsgHandle(pWrapper, TDMT_VND_SHOW_TABLES_FETCH, (NodeMsgFp)vmProcessFetchMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_MQ_SET_CONN, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_MQ_REB, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
dndSetMsgHandle(pWrapper, TDMT_VND_MQ_CANCEL_CONN, (NodeMsgFp)vmProcessWriteMsg, DEFAULT_HANDLE);
diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h
index 38dbdc4799..e827dd5131 100644
--- a/source/dnode/mnode/impl/inc/mndDef.h
+++ b/source/dnode/mnode/impl/inc/mndDef.h
@@ -385,14 +385,14 @@ typedef struct {
int16_t numOfColumns;
int32_t rowSize;
int32_t numOfRows;
- int32_t numOfReads;
int32_t payloadLen;
void* pIter;
SMnode* pMnode;
+ STableMetaRsp* pMeta;
+ bool sysDbRsp;
char db[TSDB_DB_FNAME_LEN];
int16_t offset[TSDB_MAX_COLUMNS];
int32_t bytes[TSDB_MAX_COLUMNS];
- char payload[];
} SShowObj;
typedef struct {
diff --git a/source/dnode/mnode/impl/inc/mndGrant.h b/source/dnode/mnode/impl/inc/mndGrant.h
index ad3dc7f79d..a2ff5ea6ce 100644
--- a/source/dnode/mnode/impl/inc/mndGrant.h
+++ b/source/dnode/mnode/impl/inc/mndGrant.h
@@ -44,6 +44,7 @@ void grantReset(EGrantType grant, uint64_t value);
void grantAdd(EGrantType grant, uint64_t value);
void grantRestore(EGrantType grant, uint64_t value);
+void parseGrantParameter();
#ifdef __cplusplus
}
#endif
diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h
index fa1502fe10..11c1b09cc9 100644
--- a/source/dnode/mnode/impl/inc/mndInt.h
+++ b/source/dnode/mnode/impl/inc/mndInt.h
@@ -41,8 +41,7 @@ extern "C" {
typedef int32_t (*MndMsgFp)(SNodeMsg *pMsg);
typedef int32_t (*MndInitFp)(SMnode *pMnode);
typedef void (*MndCleanupFp)(SMnode *pMnode);
-typedef int32_t (*ShowMetaFp)(SNodeMsg *pMsg, SShowObj *pShow, STableMetaRsp *pMeta);
-typedef int32_t (*ShowRetrieveFp)(SNodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows);
+typedef int32_t (*ShowRetrieveFp)(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
typedef void (*ShowFreeIterFp)(SMnode *pMnode, void *pIter);
typedef struct SMnodeLoad {
@@ -98,7 +97,7 @@ typedef struct {
int64_t timeseriesAllowed;
} SGrantInfo;
-typedef struct SMnode {
+struct SMnode {
int32_t selfId;
int64_t clusterId;
int8_t replica;
@@ -122,7 +121,7 @@ typedef struct SMnode {
SGrantInfo grant;
MndMsgFp msgFp[TDMT_MAX];
SMsgCb msgCb;
-} SMnode;
+};
void mndSetMsgHandle(SMnode *pMnode, tmsg_t msgType, MndMsgFp fp);
int64_t mndGenerateUid(char *name, int32_t len);
diff --git a/source/dnode/mnode/impl/src/mndBnode.c b/source/dnode/mnode/impl/src/mndBnode.c
index 86e2976516..f7c4a6c225 100644
--- a/source/dnode/mnode/impl/src/mndBnode.c
+++ b/source/dnode/mnode/impl/src/mndBnode.c
@@ -33,8 +33,7 @@ static int32_t mndProcessCreateBnodeReq(SNodeMsg *pReq);
static int32_t mndProcessCreateBnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessDropBnodeReq(SNodeMsg *pReq);
static int32_t mndProcessDropBnodeRsp(SNodeMsg *pRsp);
-static int32_t mndGetBnodeMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextBnode(SMnode *pMnode, void *pIter);
int32_t mndInitBnode(SMnode *pMnode) {
@@ -438,39 +437,35 @@ static int32_t mndProcessDropBnodeRsp(SNodeMsg *pRsp) {
return 0;
}
-static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveBnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
int32_t cols = 0;
SBnodeObj *pObj = NULL;
- char *pWrite;
while (numOfRows < rows) {
pShow->pIter = sdbFetch(pSdb, SDB_BNODE, pShow->pIter, (void **)&pObj);
if (pShow->pIter == NULL) break;
cols = 0;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pObj->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pObj->id;
- cols++;
+ char buf[TSDB_EP_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(buf, pObj->pDnode->ep, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pObj->pDnode->ep, pShow->bytes[cols]);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, buf, false);
- cols++;
-
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pObj->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pObj->createdTime, false);
numOfRows++;
sdbRelease(pSdb, pObj);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c
index 5a811ea490..57326b26ce 100644
--- a/source/dnode/mnode/impl/src/mndCluster.c
+++ b/source/dnode/mnode/impl/src/mndCluster.c
@@ -26,7 +26,7 @@ static int32_t mndClusterActionInsert(SSdb *pSdb, SClusterObj *pCluster);
static int32_t mndClusterActionDelete(SSdb *pSdb, SClusterObj *pCluster);
static int32_t mndClusterActionUpdate(SSdb *pSdb, SClusterObj *pOldCluster, SClusterObj *pNewCluster);
static int32_t mndCreateDefaultCluster(SMnode *pMnode);
-static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
static void mndCancelGetNextCluster(SMnode *pMnode, void *pIter);
int32_t mndInitCluster(SMnode *pMnode) {
@@ -178,12 +178,11 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
return sdbWrite(pMnode->pSdb, pRaw);
}
-static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
SMnode *pMnode = pMsg->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
int32_t cols = 0;
- char *pWrite;
SClusterObj *pCluster = NULL;
while (numOfRows < rows) {
@@ -191,25 +190,23 @@ static int32_t mndRetrieveClusters(SNodeMsg *pMsg, SShowObj *pShow, char *data,
if (pShow->pIter == NULL) break;
cols = 0;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pCluster->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pCluster->id;
- cols++;
+ char buf[tListLen(pCluster->name) + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(buf, pCluster->name, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pCluster->name, TSDB_CLUSTER_ID_LEN);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, buf, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pCluster->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pCluster->createdTime, false);
sdbRelease(pSdb, pCluster);
numOfRows++;
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c
index 1a865247b9..d2a3c38135 100644
--- a/source/dnode/mnode/impl/src/mndConsumer.c
+++ b/source/dnode/mnode/impl/src/mndConsumer.c
@@ -35,7 +35,7 @@ static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer);
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer);
static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pConsumer, SMqConsumerObj *pNewConsumer);
static int32_t mndProcessConsumerMetaMsg(SNodeMsg *pMsg);
-static int32_t mndRetrieveConsumer(SNodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveConsumer(SNodeMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
static void mndCancelGetNextConsumer(SMnode *pMnode, void *pIter);
int32_t mndInitConsumer(SMnode *pMnode) {
diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c
index 49e9ccaba6..3db4e9870e 100644
--- a/source/dnode/mnode/impl/src/mndDb.c
+++ b/source/dnode/mnode/impl/src/mndDb.c
@@ -38,7 +38,7 @@ static int32_t mndProcessDropDbReq(SNodeMsg *pReq);
static int32_t mndProcessUseDbReq(SNodeMsg *pReq);
static int32_t mndProcessSyncDbReq(SNodeMsg *pReq);
static int32_t mndProcessCompactDbReq(SNodeMsg *pReq);
-static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rowsCapacity);
static void mndCancelGetNextDb(SMnode *pMnode, void *pIter);
static int32_t mndProcessGetDbCfgReq(SNodeMsg *pReq);
static int32_t mndProcessGetIndexReq(SNodeMsg *pReq);
@@ -1351,90 +1351,76 @@ char *mnGetDbStr(char *src) {
return pos;
}
-static char *getDataPosition(char *pData, SShowObj *pShow, int32_t cols, int32_t rows, int32_t capacityOfRow) {
- return pData + pShow->offset[cols] * capacityOfRow + pShow->bytes[cols] * rows;
-}
-
-static void dumpDbInfoToPayload(char *data, SDbObj *pDb, SShowObj *pShow, int32_t rows, int32_t rowCapacity,
- int64_t numOfTables) {
+static void dumpDbInfoData(SSDataBlock* pBlock, SDbObj *pDb, SShowObj *pShow, int32_t rows, int64_t numOfTables) {
int32_t cols = 0;
- char *pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
+ char* buf = taosMemoryMalloc(pShow->bytes[cols]);
char *name = mnGetDbStr(pDb->name);
if (name != NULL) {
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, name, pShow->bytes[cols]);
+ STR_WITH_MAXSIZE_TO_VARSTR(buf, name, pShow->bytes[cols]);
} else {
- STR_TO_VARSTR(pWrite, "NULL");
+// STR_TO_VARSTR(pWrite, "NULL");
+ ASSERT(0);
}
- cols++;
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int64_t *)pWrite = pDb->createdTime;
- cols++;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, buf, false);
+ taosMemoryFree(buf);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int16_t *)pWrite = pDb->cfg.numOfVgroups;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->createdTime, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int64_t *)pWrite = numOfTables;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.numOfVgroups, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int16_t *)pWrite = pDb->cfg.replications;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&numOfTables, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int16_t *)pWrite = pDb->cfg.quorum;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.replications, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.daysPerFile;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.quorum, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.daysPerFile, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
char tmp[128] = {0};
+ int32_t len = 0;
if (pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep1 || pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep2) {
- sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep0);
+ len = sprintf(&tmp[VARSTR_HEADER_SIZE], "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep0);
} else {
- sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep0, pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2);
+ len = sprintf(&tmp[VARSTR_HEADER_SIZE], "%d,%d,%d", pDb->cfg.daysToKeep0, pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2);
}
- STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, strlen(tmp));
- cols++;
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.cacheBlockSize;
- cols++;
+ varDataSetLen(tmp, len);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)tmp, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.totalBlocks;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.cacheBlockSize, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.minRows;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.totalBlocks, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.maxRows;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.minRows, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int8_t *)pWrite = pDb->cfg.walLevel;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.maxRows, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.fsyncPeriod;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.walLevel, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int8_t *)pWrite = pDb->cfg.compression;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.fsyncPeriod, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int8_t *)pWrite = pDb->cfg.cacheLastRow;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.compression, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.cacheLastRow, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
char *prec = NULL;
switch (pDb->cfg.precision) {
case TSDB_TIME_PRECISION_MILLI:
@@ -1450,28 +1436,31 @@ static void dumpDbInfoToPayload(char *data, SDbObj *pDb, SShowObj *pShow, int32_
prec = "none";
break;
}
- STR_WITH_SIZE_TO_VARSTR(pWrite, prec, 2);
- cols++;
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int32_t *)pWrite = pDb->cfg.ttl;
- cols++;
+ char t[10] = {0};
+ STR_WITH_SIZE_TO_VARSTR(t, prec, 2);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)t, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int8_t *)pWrite = pDb->cfg.singleSTable;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.ttl, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
- *(int8_t *)pWrite = pDb->cfg.streamMode;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.singleSTable, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.streamMode, false);
- pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
char *status = "ready";
- STR_WITH_SIZE_TO_VARSTR(pWrite, status, strlen(status));
- cols++;
+ char b[24] = {0};
+ STR_WITH_SIZE_TO_VARSTR(b, status, strlen(status));
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, rows, (const char *)b, false);
// pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
// *(int8_t *)pWrite = pDb->cfg.update;
+
}
static void setInformationSchemaDbCfg(SDbObj *pDbObj) {
@@ -1486,6 +1475,18 @@ static void setInformationSchemaDbCfg(SDbObj *pDbObj) {
pDbObj->cfg.precision = TSDB_TIME_PRECISION_MILLI;
}
+static void setPerfSchemaDbCfg(SDbObj* pDbObj) {
+ ASSERT(pDbObj != NULL);
+ strncpy(pDbObj->name, TSDB_PERFORMANCE_SCHEMA_DB, tListLen(pDbObj->name));
+
+ pDbObj->createdTime = 0;
+ pDbObj->cfg.numOfVgroups = 0;
+ pDbObj->cfg.quorum = 1;
+ pDbObj->cfg.replications = 1;
+ pDbObj->cfg.update = 1;
+ pDbObj->cfg.precision = TSDB_TIME_PRECISION_MILLI;
+}
+
static bool mndGetTablesOfDbFp(SMnode *pMnode, void *pObj, void *p1, void *p2, void *p3) {
SVgObj *pVgroup = pObj;
int32_t *numOfTables = p1;
@@ -1494,12 +1495,28 @@ static bool mndGetTablesOfDbFp(SMnode *pMnode, void *pObj, void *p1, void *p2, v
return true;
}
-static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rowsCapacity) {
+static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rowsCapacity) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SDbObj *pDb = NULL;
+ // Append the information_schema database into the result.
+ if (!pShow->sysDbRsp) {
+ SDbObj infoschemaDb = {0};
+ setInformationSchemaDbCfg(&infoschemaDb);
+ dumpDbInfoData(pBlock, &infoschemaDb, pShow, numOfRows, 14);
+
+ numOfRows += 1;
+
+ SDbObj perfschemaDb = {0};
+ setPerfSchemaDbCfg(&perfschemaDb);
+ dumpDbInfoData(pBlock, &perfschemaDb, pShow, numOfRows, 3);
+
+ numOfRows += 1;
+ pShow->sysDbRsp = true;
+ }
+
while (numOfRows < rowsCapacity) {
pShow->pIter = sdbFetch(pSdb, SDB_DB, pShow->pIter, (void **)&pDb);
if (pShow->pIter == NULL) {
@@ -1509,21 +1526,12 @@ static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
int32_t numOfTables = 0;
sdbTraverse(pSdb, SDB_VGROUP, mndGetTablesOfDbFp, &numOfTables, NULL, NULL);
- dumpDbInfoToPayload(data, pDb, pShow, numOfRows, rowsCapacity, numOfTables);
+ dumpDbInfoData(pBlock, pDb, pShow, numOfRows, numOfTables);
numOfRows++;
sdbRelease(pSdb, pDb);
}
- // Append the information_schema database into the result.
- if (numOfRows < rowsCapacity) {
- SDbObj dummyISDb = {0};
- setInformationSchemaDbCfg(&dummyISDb);
- dumpDbInfoToPayload(data, &dummyISDb, pShow, numOfRows, rowsCapacity, 14);
- numOfRows += 1;
- }
-
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rowsCapacity, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c
index 86ec49127a..fc6ec86c49 100644
--- a/source/dnode/mnode/impl/src/mndDnode.c
+++ b/source/dnode/mnode/impl/src/mndDnode.c
@@ -56,9 +56,9 @@ static int32_t mndProcessConfigDnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessStatusReq(SNodeMsg *pReq);
static int32_t mndGetConfigMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveConfigs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveConfigs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextConfig(SMnode *pMnode, void *pIter);
-static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextDnode(SMnode *pMnode, void *pIter);
int32_t mndInitDnode(SMnode *pMnode) {
@@ -669,7 +669,7 @@ static int32_t mndGetConfigMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *
return 0;
}
-static int32_t mndRetrieveConfigs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveConfigs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
int32_t totalRows = 0;
int32_t numOfRows = 0;
@@ -694,34 +694,36 @@ static int32_t mndRetrieveConfigs(SNodeMsg *pReq, SShowObj *pShow, char *data, i
snprintf(cfgVals[totalRows], TSDB_CONIIG_VALUE_LEN, "%s", tsCharset);
totalRows++;
+ char buf[TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE] = {0};
+ char bufVal[TSDB_CONIIG_VALUE_LEN + VARSTR_HEADER_SIZE] = {0};
+
for (int32_t i = 0; i < totalRows; i++) {
cols = 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, cfgOpts[i], TSDB_CONFIG_OPTION_LEN);
- cols++;
+ STR_WITH_MAXSIZE_TO_VARSTR(buf, cfgOpts[i], TSDB_CONFIG_OPTION_LEN);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, cfgVals[i], TSDB_CONIIG_VALUE_LEN);
- cols++;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) buf, false);
+
+ STR_WITH_MAXSIZE_TO_VARSTR(bufVal, cfgVals[i], TSDB_CONIIG_VALUE_LEN);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) bufVal, false);
numOfRows++;
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
static void mndCancelGetNextConfig(SMnode *pMnode, void *pIter) {}
-static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
int32_t cols = 0;
SDnodeObj *pDnode = NULL;
- char *pWrite;
int64_t curMs = taosGetTimestampMs();
while (numOfRows < rows) {
@@ -731,40 +733,42 @@ static int32_t mndRetrieveDnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, in
cols = 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pDnode->id;
- cols++;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pDnode->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pDnode->ep, pShow->bytes[cols]);
- cols++;
+ char buf[tListLen(pDnode->ep) + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(buf, pDnode->ep, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = mndGetVnodesNum(pMnode, pDnode->id);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, buf, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pDnode->numOfSupportVnodes;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ int16_t id = mndGetVnodesNum(pMnode, pDnode->id);
+ colDataAppend(pColInfo, numOfRows, (const char*) &id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, online ? "ready" : "offline");
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pDnode->numOfSupportVnodes, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pDnode->createdTime;
- cols++;
+ char b1[9] = {0};
+ STR_TO_VARSTR(b1, online? "ready":"offline");
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, online ? "" : offlineReason[pDnode->offlineReason]);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, b1, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pDnode->createdTime, false);
+
+ char b[tListLen(offlineReason) + VARSTR_HEADER_SIZE] = {0};
+ STR_TO_VARSTR(b, online ? "" : offlineReason[pDnode->offlineReason]);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, b, false);
numOfRows++;
sdbRelease(pSdb, pDnode);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c
index 842e74197b..a18afbea73 100644
--- a/source/dnode/mnode/impl/src/mndFunc.c
+++ b/source/dnode/mnode/impl/src/mndFunc.c
@@ -34,8 +34,7 @@ static int32_t mndDropFunc(SMnode *pMnode, SNodeMsg *pReq, SFuncObj *pFunc);
static int32_t mndProcessCreateFuncReq(SNodeMsg *pReq);
static int32_t mndProcessDropFuncReq(SNodeMsg *pReq);
static int32_t mndProcessRetrieveFuncReq(SNodeMsg *pReq);
-static int32_t mndGetFuncMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextFunc(SMnode *pMnode, void *pIter);
int32_t mndInitFunc(SMnode *pMnode) {
@@ -462,70 +461,6 @@ RETRIEVE_FUNC_OVER:
return code;
}
-static int32_t mndGetFuncMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta) {
- SMnode *pMnode = pReq->pNode;
- SSdb *pSdb = pMnode->pSdb;
-
- int32_t cols = 0;
- SSchema *pSchema = pMeta->pSchemas;
-
- pShow->bytes[cols] = TSDB_FUNC_NAME_LEN + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "name");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = PATH_MAX + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "comment");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 4;
- pSchema[cols].type = TSDB_DATA_TYPE_INT;
- strcpy(pSchema[cols].name, "aggregate");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = TSDB_TYPE_STR_MAX_LEN + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "outputtype");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 8;
- pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
- strcpy(pSchema[cols].name, "create_time");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 4;
- pSchema[cols].type = TSDB_DATA_TYPE_INT;
- strcpy(pSchema[cols].name, "code_len");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 4;
- pSchema[cols].type = TSDB_DATA_TYPE_INT;
- strcpy(pSchema[cols].name, "bufsize");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pMeta->numOfColumns = cols;
- pShow->numOfColumns = cols;
-
- pShow->offset[0] = 0;
- for (int32_t i = 1; i < cols; ++i) {
- pShow->offset[i] = pShow->offset[i - 1] + pShow->bytes[i - 1];
- }
-
- pShow->numOfRows = sdbGetSize(pSdb, SDB_FUNC);
- pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
- strcpy(pMeta->tbName, mndShowStr(pShow->type));
-
- return 0;
-}
-
static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int16_t len) {
char *msg = "unknown";
if (type >= sizeof(tDataTypes) / sizeof(tDataTypes[0])) {
@@ -544,13 +479,12 @@ static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int16_t le
return tDataTypes[type].name;
}
-static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SFuncObj *pFunc = NULL;
int32_t cols = 0;
- char *pWrite;
char buf[TSDB_TYPE_STR_MAX_LEN];
while (numOfRows < rows) {
@@ -559,41 +493,43 @@ static int32_t mndRetrieveFuncs(SNodeMsg *pReq, SShowObj *pShow, char *data, int
cols = 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pFunc->name, pShow->bytes[cols]);
- cols++;
+ char b1[tListLen(pFunc->name) + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(b1, pFunc->name, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pFunc->pComment, pShow->bytes[cols]);
- cols++;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) b1, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pFunc->funcType == TSDB_FUNC_TYPE_AGGREGATE ? 1 : 0;
- cols++;
+ char* b2 = taosMemoryCalloc(1, pShow->bytes[cols]);
+ STR_WITH_MAXSIZE_TO_VARSTR(b2, pFunc->pComment, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, mnodeGenTypeStr(buf, TSDB_TYPE_STR_MAX_LEN, pFunc->outputType, pFunc->outputLen),
- pShow->bytes[cols]);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) b2, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pFunc->createdTime;
- cols++;
+ int32_t isAgg = (pFunc->funcType == TSDB_FUNC_TYPE_AGGREGATE) ? 1 : 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pFunc->codeSize;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &isAgg, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pFunc->bufSize;
- cols++;
+ char b3[TSDB_TYPE_STR_MAX_LEN] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(b3, mnodeGenTypeStr(buf, TSDB_TYPE_STR_MAX_LEN, pFunc->outputType, pFunc->outputLen), pShow->bytes[cols]);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) b3, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pFunc->createdTime, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pFunc->codeSize, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pFunc->bufSize, false);
numOfRows++;
sdbRelease(pSdb, pFunc);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndGrant.c b/source/dnode/mnode/impl/src/mndGrant.c
index 37f87142e6..c97d4dd807 100644
--- a/source/dnode/mnode/impl/src/mndGrant.c
+++ b/source/dnode/mnode/impl/src/mndGrant.c
@@ -28,4 +28,6 @@ void grantReset(EGrantType grant, uint64_t value) {}
void grantAdd(EGrantType grant, uint64_t value) {}
void grantRestore(EGrantType grant, uint64_t value) {}
-#endif
\ No newline at end of file
+#endif
+
+void parseGrantParameter() { parseGrantParameter(); }
\ No newline at end of file
diff --git a/source/dnode/mnode/impl/src/mndInfoSchema.c b/source/dnode/mnode/impl/src/mndInfoSchema.c
index d60e7f5cf9..b210ee0d4f 100644
--- a/source/dnode/mnode/impl/src/mndInfoSchema.c
+++ b/source/dnode/mnode/impl/src/mndInfoSchema.c
@@ -23,54 +23,54 @@
//!!!! Note: only APPEND columns in below tables, NO insert !!!!
static const SInfosTableSchema dnodesSchema[] = {
{.name = "id", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
- {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
{.name = "max_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
- {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
- {.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema mnodesSchema[] = {
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "role", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "role", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "role_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
};
static const SInfosTableSchema modulesSchema[] = {
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "endpoint", .bytes = 134, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "module", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = 134, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "module", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema qnodesSchema[] = {
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
};
static const SInfosTableSchema snodesSchema[] = {
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
};
static const SInfosTableSchema bnodesSchema[] = {
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
};
static const SInfosTableSchema clusterSchema[] = {
{.name = "id", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT},
- {.name = "name", .bytes = TSDB_CLUSTER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "name", .bytes = TSDB_CLUSTER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
};
static const SInfosTableSchema userDBSchema[] = {
- {.name = "name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "vgroups", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
{.name = "ntables", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT},
- {.name = "replica", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
- {.name = "quorum", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
+ {.name = "replica", .bytes = 2, .type = TSDB_DATA_TYPE_TINYINT},
+ {.name = "quorum", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
{.name = "days", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "keep", .bytes = 24 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "keep", .bytes = 24 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "cache", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "blocks", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "minrows", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
@@ -79,61 +79,61 @@ static const SInfosTableSchema userDBSchema[] = {
{.name = "fsync", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "comp", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
{.name = "cachelast", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
- {.name = "precision", .bytes = 2 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "precision", .bytes = 2 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "ttl", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "single_stable", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
{.name = "stream_mode", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT},
- {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
// {.name = "update", .bytes = 1, .type =
// TSDB_DATA_TYPE_TINYINT}, // disable update
};
static const SInfosTableSchema userFuncSchema[] = {
- {.name = "name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "name", .bytes = 32, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "ntables", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "precision", .bytes = 2, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "precision", .bytes = 2, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "status", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema userIdxSchema[] = {
- {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "index_database", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "index_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "column_name", .bytes = SYSTABLE_SCH_COL_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "index_type", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "index_extensions", .bytes = 256, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "index_database", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "index_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "column_name", .bytes = SYSTABLE_SCH_COL_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "index_type", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "index_extensions", .bytes = 256, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema userStbsSchema[] = {
- {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "columns", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "tags", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "last_update", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
- {.name = "table_comment", .bytes = 1024 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_INT},
+ {.name = "table_comment", .bytes = 1024 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema userStreamsSchema[] = {
- {.name = "stream_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "user_name", .bytes = 23, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "dest_table", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "stream_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "user_name", .bytes = 23, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "dest_table", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
- {.name = "sql", .bytes = 1024, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "sql", .bytes = 1024, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableSchema userTblsSchema[] = {
- {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
{.name = "columns", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "uid", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT},
{.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "ttl", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "table_comment", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
};
static const SInfosTableSchema userTblDistSchema[] = {
- {.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "table_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "distributed_histogram", .bytes = 500, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "table_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "distributed_histogram", .bytes = 500, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "min_of_rows", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "max_of_rows", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "avg_of_rows", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
@@ -146,23 +146,39 @@ static const SInfosTableSchema userTblDistSchema[] = {
{.name = "seek_header_time", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
};
static const SInfosTableSchema userUsersSchema[] = {
- {.name = "name", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "privilege", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "name", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "privilege", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
- {.name = "account", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "account", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
+};
+static const SInfosTableSchema grantsSchema[] = {
+ {.name = "version", .bytes = 8 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "expire time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "expired", .bytes = 5 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "storage(GB)", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "databases", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "users", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "accounts", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "connections", .bytes = 11 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "streams", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "cpu cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "speed(PPS)", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "querytime", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
};
static const SInfosTableSchema vgroupsSchema[] = {
{.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "tables", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "status", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "status", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "onlines", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "v1_dnode", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "v1_status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "v1_status", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "v2_dnode", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "v2_status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "v2_status", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "v3_dnode", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "v3_status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "v3_status", .bytes = 10, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "compacting", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "nfiles", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "file_size", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
@@ -170,16 +186,16 @@ static const SInfosTableSchema vgroupsSchema[] = {
// TODO put into perf schema
static const SInfosTableSchema topicSchema[] = {
- {.name = "topic_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "topic_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
- {.name = "sql", .bytes = 1024, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "sql", .bytes = 1024, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "row_len", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
};
static const SInfosTableSchema consumerSchema[] = {
- {.name = "client_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "group_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "client_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "group_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "pid", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
{.name = "status", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
// ep
@@ -188,10 +204,10 @@ static const SInfosTableSchema consumerSchema[] = {
};
static const SInfosTableSchema subscribeSchema[] = {
- {.name = "topic_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
- {.name = "group_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "topic_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
+ {.name = "group_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
{.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT},
- {.name = "client_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_BINARY},
+ {.name = "client_id", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR},
};
static const SInfosTableMeta infosMeta[] = {
@@ -211,6 +227,7 @@ static const SInfosTableMeta infosMeta[] = {
{TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)},
{TSDB_INS_TABLE_USER_USERS, userUsersSchema, tListLen(userUsersSchema)},
{TSDB_INS_TABLE_VGROUPS, vgroupsSchema, tListLen(vgroupsSchema)},
+ {TSDB_INS_TABLE_LICENCES, grantsSchema, tListLen(grantsSchema)},
};
// connection/application/
@@ -286,7 +303,7 @@ int32_t mndBuildInsTableSchema(SMnode *pMnode, const char *dbFName, const char *
}
int32_t mndInitInfos(SMnode *pMnode) {
- pMnode->infosMeta = taosHashInit(20, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
+ pMnode->infosMeta = taosHashInit(20, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK);
if (pMnode->infosMeta == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c
index 8c75a737a2..6be7097e6a 100644
--- a/source/dnode/mnode/impl/src/mndMnode.c
+++ b/source/dnode/mnode/impl/src/mndMnode.c
@@ -35,7 +35,7 @@ static int32_t mndProcessDropMnodeReq(SNodeMsg *pReq);
static int32_t mndProcessCreateMnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessAlterMnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessDropMnodeRsp(SNodeMsg *pRsp);
-static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
static void mndCancelGetNextMnode(SMnode *pMnode, void *pIter);
int32_t mndInitMnode(SMnode *pMnode) {
@@ -615,7 +615,7 @@ static int32_t mndProcessDropMnodeRsp(SNodeMsg *pRsp) {
return 0;
}
-static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
@@ -628,35 +628,33 @@ static int32_t mndRetrieveMnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, in
if (pShow->pIter == NULL) break;
cols = 0;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pObj->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pObj->id;
- cols++;
+ char b1[TSDB_EP_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(b1, pObj->pDnode->ep, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pObj->pDnode->ep, pShow->bytes[cols]);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, b1, false);
- cols++;
-
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
const char *roles = mndGetRoleStr(pObj->role);
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, roles, pShow->bytes[cols]);
- cols++;
+ char* b2 = taosMemoryCalloc(1, strlen(roles) + VARSTR_HEADER_SIZE);
+ STR_WITH_MAXSIZE_TO_VARSTR(b2, roles, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pObj->roleTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) b2, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pObj->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pObj->roleTime, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pObj->createdTime, false);
numOfRows++;
sdbRelease(pSdb, pObj);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c
index 974c88a752..556e17ad2d 100644
--- a/source/dnode/mnode/impl/src/mndProfile.c
+++ b/source/dnode/mnode/impl/src/mndProfile.c
@@ -78,9 +78,9 @@ int32_t mndInitProfile(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_MND_KILL_QUERY, mndProcessKillQueryReq);
mndSetMsgHandle(pMnode, TDMT_MND_KILL_CONN, mndProcessKillConnReq);
- mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_CONNS, mndRetrieveConns);
+// mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_CONNS, mndRetrieveConns);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_CONNS, mndCancelGetNextConn);
- mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_QUERIES, mndRetrieveQueries);
+// mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_QUERIES, mndRetrieveQueries);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_QUERIES, mndCancelGetNextQuery);
return 0;
@@ -687,7 +687,7 @@ static int32_t mndRetrieveConns(SNodeMsg *pReq, SShowObj *pShow, char *data, int
numOfRows++;
}
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
@@ -905,8 +905,7 @@ static int32_t mndRetrieveQueries(SNodeMsg *pReq, SShowObj *pShow, char *data, i
}
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndQnode.c b/source/dnode/mnode/impl/src/mndQnode.c
index 3f8c7e88f9..3b622795cb 100644
--- a/source/dnode/mnode/impl/src/mndQnode.c
+++ b/source/dnode/mnode/impl/src/mndQnode.c
@@ -34,7 +34,7 @@ static int32_t mndProcessCreateQnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessDropQnodeReq(SNodeMsg *pReq);
static int32_t mndProcessDropQnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessQnodeListReq(SNodeMsg *pReq);
-static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextQnode(SMnode *pMnode, void *pIter);
int32_t mndInitQnode(SMnode *pMnode) {
@@ -497,7 +497,7 @@ static int32_t mndProcessDropQnodeRsp(SNodeMsg *pRsp) {
return 0;
}
-static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
@@ -510,26 +510,22 @@ static int32_t mndRetrieveQnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, in
if (pShow->pIter == NULL) break;
cols = 0;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*)&pObj->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pObj->id;
- cols++;
+ char ep[TSDB_EP_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(ep, pObj->pDnode->ep, pShow->bytes[cols]);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)ep, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pObj->pDnode->ep, pShow->bytes[cols]);
-
- cols++;
-
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pObj->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pObj->createdTime, false);
numOfRows++;
sdbRelease(pSdb, pObj);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c
index 03e6049d82..d9f4f142df 100644
--- a/source/dnode/mnode/impl/src/mndShow.c
+++ b/source/dnode/mnode/impl/src/mndShow.c
@@ -60,7 +60,6 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowReq *pReq) {
showObj.type = pReq->type;
showObj.payloadLen = pReq->payloadLen;
memcpy(showObj.db, pReq->db, TSDB_DB_FNAME_LEN);
- memcpy(showObj.payload, pReq->payload, pReq->payloadLen);
int32_t keepTime = tsShellActivityTimer * 6 * 1000;
SShowObj *pShow = taosCachePut(pMgmt->cache, &showId, sizeof(int64_t), &showObj, size, keepTime);
@@ -113,95 +112,10 @@ static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove) {
taosCacheRelease(pMgmt->cache, (void **)(&pShow), forceRemove);
}
-static int32_t mndProcessRetrieveReq(SNodeMsg *pReq) {
- SMnode *pMnode = pReq->pNode;
- SShowMgmt *pMgmt = &pMnode->showMgmt;
- int32_t rowsToRead = 0;
- int32_t size = 0;
- int32_t rowsRead = 0;
-
- SRetrieveTableReq retrieveReq = {0};
- if (tDeserializeSRetrieveTableReq(pReq->rpcMsg.pCont, pReq->rpcMsg.contLen, &retrieveReq) != 0) {
- terrno = TSDB_CODE_INVALID_MSG;
- return -1;
- }
-
- SShowObj *pShow = mndAcquireShowObj(pMnode, retrieveReq.showId);
- if (pShow == NULL) {
- terrno = TSDB_CODE_MND_INVALID_SHOWOBJ;
- mError("failed to process show-retrieve req:%p since %s", pShow, terrstr());
- return -1;
- }
-
- ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type];
- if (retrieveFp == NULL) {
- mndReleaseShowObj(pShow, false);
- terrno = TSDB_CODE_MSG_NOT_PROCESSED;
- mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr());
- return -1;
- }
-
- mDebug("show:0x%" PRIx64 ", start retrieve data, numOfReads:%d numOfRows:%d type:%s", pShow->id, pShow->numOfReads,
- pShow->numOfRows, mndShowStr(pShow->type));
-
- if (mndCheckRetrieveFinished(pShow)) {
- mDebug("show:0x%" PRIx64 ", read finished, numOfReads:%d numOfRows:%d", pShow->id, pShow->numOfReads,
- pShow->numOfRows);
- pShow->numOfReads = pShow->numOfRows;
- }
-
- if ((retrieveReq.free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
- rowsToRead = pShow->numOfRows - pShow->numOfReads;
- }
-
- /* return no more than 100 tables in one round trip */
- if (rowsToRead > SHOW_STEP_SIZE) rowsToRead = SHOW_STEP_SIZE;
-
- /*
- * the actual number of table may be larger than the value of pShow->numOfRows, if a query is
- * issued during a continuous create table operation. Therefore, rowToRead may be less than 0.
- */
- if (rowsToRead < 0) rowsToRead = 0;
- size = pShow->rowSize * rowsToRead;
-
- size += SHOW_STEP_SIZE;
- SRetrieveTableRsp *pRsp = rpcMallocCont(size);
- if (pRsp == NULL) {
- mndReleaseShowObj(pShow, false);
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr());
- return -1;
- }
-
- // if free flag is set, client wants to clean the resources
- if ((retrieveReq.free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
- rowsRead = (*retrieveFp)(pReq, pShow, pRsp->data, rowsToRead);
- }
-
- mDebug("show:0x%" PRIx64 ", stop retrieve data, rowsRead:%d rowsToRead:%d", pShow->id, rowsRead, rowsToRead);
-
- pRsp->numOfRows = htonl(rowsRead);
- pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision
-
- pReq->pRsp = pRsp;
- pReq->rspLen = size;
-
- if (rowsRead == 0 || rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) {
- pRsp->completed = 1;
- mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
- mndReleaseShowObj(pShow, true);
- } else {
- mDebug("show:0x%" PRIx64 ", retrieve not completed yet", pShow->id);
- mndReleaseShowObj(pShow, false);
- }
-
- return TSDB_CODE_SUCCESS;
-}
-
static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
SMnode *pMnode = pReq->pNode;
SShowMgmt *pMgmt = &pMnode->showMgmt;
- int32_t rowsToRead = 0;
+ int32_t rowsToRead = SHOW_STEP_SIZE;
int32_t size = 0;
int32_t rowsRead = 0;
@@ -225,15 +139,14 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
return -1;
}
- STableMetaRsp *meta = (STableMetaRsp *)taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb));
- pShow->numOfRows = 100;
-
+ pShow->pMeta = (STableMetaRsp *)taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb));
+ pShow->numOfColumns = pShow->pMeta->numOfColumns;
int32_t offset = 0;
- for(int32_t i = 0; i < meta->numOfColumns; ++i) {
- pShow->numOfColumns = meta->numOfColumns;
+
+ for(int32_t i = 0; i < pShow->pMeta->numOfColumns; ++i) {
pShow->offset[i] = offset;
- int32_t bytes = meta->pSchemas[i].bytes;
+ int32_t bytes = pShow->pMeta->pSchemas[i].bytes;
pShow->rowSize += bytes;
pShow->bytes[i] = bytes;
offset += bytes;
@@ -245,8 +158,6 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
mError("failed to process show-retrieve req:%p since %s", pShow, terrstr());
return -1;
}
-
- pShow->numOfReads = 0;
}
ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type];
@@ -257,61 +168,87 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
return -1;
}
- mDebug("show:0x%" PRIx64 ", start retrieve data, numOfReads:%d numOfRows:%d type:%s", pShow->id, pShow->numOfReads,
- pShow->numOfRows, mndShowStr(pShow->type));
+ mDebug("show:0x%" PRIx64 ", start retrieve data, type:%s", pShow->id, mndShowStr(pShow->type));
+ int32_t numOfCols = pShow->pMeta->numOfColumns;
+
+ SSDataBlock* pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock));
+ pBlock->pDataBlock = taosArrayInit(numOfCols, sizeof(SColumnInfoData));
+ pBlock->info.numOfCols = numOfCols;
+
+ for(int32_t i = 0; i < numOfCols; ++i) {
+ SColumnInfoData idata = {0};
+ SSchema* p = &pShow->pMeta->pSchemas[i];
+
+ idata.info.bytes = p->bytes;
+ idata.info.type = p->type;
+ idata.info.colId = p->colId;
+
+ taosArrayPush(pBlock->pDataBlock, &idata);
+ if (IS_VAR_DATA_TYPE(p->type)) {
+ pBlock->info.hasVarCol = true;
+ }
+ }
+
+ blockDataEnsureCapacity(pBlock, rowsToRead);
if (mndCheckRetrieveFinished((SShowObj*) pShow)) {
- mDebug("show:0x%" PRIx64 ", read finished, numOfReads:%d numOfRows:%d", pShow->id, pShow->numOfReads,
- pShow->numOfRows);
- pShow->numOfReads = pShow->numOfRows;
+ mDebug("show:0x%" PRIx64 ", read finished, numOfRows:%d", pShow->id, pShow->numOfRows);
+ rowsRead = 0;
+ } else {
+ rowsRead = (*retrieveFp)(pReq, (SShowObj *)pShow, pBlock, rowsToRead);
+ if (rowsRead < 0) {
+ terrno = rowsRead;
+ mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
+ mndReleaseShowObj((SShowObj *)pShow, true);
+ return -1;
+ }
+
+ pBlock->info.rows = rowsRead;
+ mDebug("show:0x%" PRIx64 ", stop retrieve data, rowsRead:%d numOfRows:%d", pShow->id, rowsRead, pShow->numOfRows);
}
- if ((retrieveReq.free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
- rowsToRead = pShow->numOfRows - pShow->numOfReads;
- }
+ // numOfCols + sizeof(SSysTableSchema) * numOfCols + data payload
+ size = sizeof(SRetrieveMetaTableRsp) + sizeof(int32_t) + sizeof(SSysTableSchema) * pShow->pMeta->numOfColumns + blockDataGetSize(pBlock)
+ + blockDataGetSerialMetaSize(pBlock);
- /* return no more than 100 tables in one round trip */
- if (rowsToRead > SHOW_STEP_SIZE) rowsToRead = SHOW_STEP_SIZE;
-
- /*
- * the actual number of table may be larger than the value of pShow->numOfRows, if a query is
- * issued during a continuous create table operation. Therefore, rowToRead may be less than 0.
- */
- if (rowsToRead < 0) rowsToRead = 0;
- size = pShow->rowSize * rowsToRead;
-
- size += SHOW_STEP_SIZE;
SRetrieveMetaTableRsp *pRsp = rpcMallocCont(size);
if (pRsp == NULL) {
mndReleaseShowObj((SShowObj*) pShow, false);
terrno = TSDB_CODE_OUT_OF_MEMORY;
mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr());
+ blockDataDestroy(pBlock);
return -1;
}
pRsp->handle = htobe64(pShow->id);
// if free flag is set, client wants to clean the resources
- if ((retrieveReq.free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
- rowsRead = (*retrieveFp)(pReq, (SShowObj*) pShow, pRsp->data, rowsToRead);
- if (rowsRead < 0) {
- terrno = rowsRead;
- rpcFreeCont(pRsp);
- mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
- mndReleaseShowObj((SShowObj*) pShow, true);
- return -1;
- }
- }
+ if (rowsRead > 0) {
+ char * pStart = pRsp->data;
+ SSchema *ps = pShow->pMeta->pSchemas;
- mDebug("show:0x%" PRIx64 ", stop retrieve data, rowsRead:%d rowsToRead:%d", pShow->id, rowsRead, rowsToRead);
+ *(int32_t *)pStart = htonl(pShow->pMeta->numOfColumns);
+ pStart += sizeof(int32_t); // number of columns
+
+ for (int32_t i = 0; i < pShow->pMeta->numOfColumns; ++i) {
+ SSysTableSchema *pSchema = (SSysTableSchema *)pStart;
+ pSchema->bytes = htonl(ps[i].bytes);
+ pSchema->colId = htons(ps[i].colId);
+ pSchema->type = ps[i].type;
+
+ pStart += sizeof(SSysTableSchema);
+ }
+
+ int32_t len = 0;
+ blockCompressEncode(pBlock, pStart, &len, pShow->pMeta->numOfColumns, false);
+ }
pRsp->numOfRows = htonl(rowsRead);
pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision
+ pReq->pRsp = pRsp;
+ pReq->rspLen = size;
- pReq->pRsp = pRsp;
- pReq->rspLen = size;
-
- if (rowsRead == 0 || rowsToRead == 0 || (rowsRead < rowsToRead)) {
+ if (rowsRead == 0 || rowsRead < rowsToRead) {
pRsp->completed = 1;
mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
mndReleaseShowObj((SShowObj*) pShow, true);
@@ -320,6 +257,7 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
mndReleaseShowObj((SShowObj*) pShow, false);
}
+ blockDataDestroy(pBlock);
return TSDB_CODE_SUCCESS;
}
@@ -379,7 +317,7 @@ char *mndShowStr(int32_t showType) {
}
static bool mndCheckRetrieveFinished(SShowObj *pShow) {
- if (pShow->pIter == NULL && pShow->numOfReads != 0) {
+ if (pShow->pIter == NULL && pShow->numOfRows != 0) {
return true;
}
return false;
diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c
index f56c72d93e..70e41a73b7 100644
--- a/source/dnode/mnode/impl/src/mndSma.c
+++ b/source/dnode/mnode/impl/src/mndSma.c
@@ -40,8 +40,7 @@ static int32_t mndProcessMCreateSmaReq(SNodeMsg *pReq);
static int32_t mndProcessMDropSmaReq(SNodeMsg *pReq);
static int32_t mndProcessVCreateSmaRsp(SNodeMsg *pRsp);
static int32_t mndProcessVDropSmaRsp(SNodeMsg *pRsp);
-static int32_t mndGetSmaMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveSma(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveSma(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextSma(SMnode *pMnode, void *pIter);
int32_t mndInitSma(SMnode *pMnode) {
@@ -765,14 +764,12 @@ static int32_t mndGetSmaMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMe
return 0;
}
-static int32_t mndRetrieveSma(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveSma(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SSmaObj *pSma = NULL;
int32_t cols = 0;
- char *pWrite;
- char prefix[TSDB_DB_FNAME_LEN] = {0};
SDbObj *pDb = mndAcquireDb(pMnode, pShow->db);
if (pDb == NULL) return 0;
@@ -790,27 +787,32 @@ static int32_t mndRetrieveSma(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
SName smaName = {0};
tNameFromString(&smaName, pSma->name, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, (char *)tNameGetTableName(&smaName));
- cols++;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pSma->createdTime;
+ char n[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_TO_VARSTR(n, (char *)tNameGetTableName(&smaName));
cols++;
SName stbName = {0};
tNameFromString(&stbName, pSma->stb, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, (char *)tNameGetTableName(&stbName));
- cols++;
+
+ char n1[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_TO_VARSTR(n1, (char *)tNameGetTableName(&stbName));
+
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) n, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pSma->createdTime, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)n1, false);
numOfRows++;
sdbRelease(pSdb, pSma);
}
mndReleaseDb(pMnode, pDb);
- pShow->numOfReads += numOfRows;
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndSnode.c b/source/dnode/mnode/impl/src/mndSnode.c
index cc25e523c1..686cf1400d 100644
--- a/source/dnode/mnode/impl/src/mndSnode.c
+++ b/source/dnode/mnode/impl/src/mndSnode.c
@@ -33,7 +33,7 @@ static int32_t mndProcessCreateSnodeReq(SNodeMsg *pReq);
static int32_t mndProcessCreateSnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessDropSnodeReq(SNodeMsg *pReq);
static int32_t mndProcessDropSnodeRsp(SNodeMsg *pRsp);
-static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextSnode(SMnode *pMnode, void *pIter);
int32_t mndInitSnode(SMnode *pMnode) {
@@ -447,39 +447,35 @@ static int32_t mndProcessDropSnodeRsp(SNodeMsg *pRsp) {
return 0;
}
-static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveSnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
int32_t cols = 0;
SSnodeObj *pObj = NULL;
- char *pWrite;
while (numOfRows < rows) {
pShow->pIter = sdbFetch(pSdb, SDB_SNODE, pShow->pIter, (void **)&pObj);
if (pShow->pIter == NULL) break;
cols = 0;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*)&pObj->id, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pObj->id;
- cols++;
+ char ep[TSDB_EP_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(ep, pObj->pDnode->ep, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pObj->pDnode->ep, pShow->bytes[cols]);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)ep, false);
- cols++;
-
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pObj->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pObj->createdTime, false);
numOfRows++;
sdbRelease(pSdb, pObj);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c
index afcea6e732..92a67fd7e9 100644
--- a/source/dnode/mnode/impl/src/mndStb.c
+++ b/source/dnode/mnode/impl/src/mndStb.c
@@ -39,7 +39,7 @@ static int32_t mndProcessVCreateStbRsp(SNodeMsg *pRsp);
static int32_t mndProcessVAlterStbRsp(SNodeMsg *pRsp);
static int32_t mndProcessVDropStbRsp(SNodeMsg *pRsp);
static int32_t mndProcessTableMetaReq(SNodeMsg *pReq);
-static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextStb(SMnode *pMnode, void *pIter);
int32_t mndInitStb(SMnode *pMnode) {
@@ -1638,13 +1638,12 @@ static void mndExtractTableName(char *tableId, char *name) {
}
}
-static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SStbObj *pStb = NULL;
int32_t cols = 0;
- char *pWrite;
SDbObj* pDb = NULL;
if (strlen(pShow->db) > 0) {
@@ -1664,42 +1663,45 @@ static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
cols = 0;
SName name = {0};
- char stbName[TSDB_TABLE_NAME_LEN] = {0};
- mndExtractTableName(pStb->name, stbName);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, stbName);
- cols++;
+ char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ mndExtractTableName(pStb->name, &stbName[VARSTR_HEADER_SIZE]);
+ varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE]));
- char db[TSDB_DB_NAME_LEN] = {0};
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) stbName, false);
+
+ char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
tNameFromString(&name, pStb->db, T_NAME_ACCT|T_NAME_DB);
- tNameGetDbName(&name, db);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, db);
- cols++;
+ tNameGetDbName(&name, varDataVal(db));
+ varDataSetLen(db, strlen(varDataVal(db)));
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pStb->createdTime;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) db, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pStb->numOfColumns;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pStb->createdTime, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pStb->numOfTags;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pStb->numOfColumns, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pStb->updateTime; // number of tables
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pStb->numOfTags, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- if (pStb->commentLen != 0) {
- STR_TO_VARSTR(pWrite, pStb->comment);
- } else {
- STR_TO_VARSTR(pWrite, "");
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pStb->updateTime, false); // number of tables
+
+ char* p = taosMemoryMalloc(pStb->commentLen + VARSTR_HEADER_SIZE); // check malloc failures
+ if (p != NULL) {
+ if (pStb->commentLen != 0) {
+ STR_TO_VARSTR(p, pStb->comment);
+ } else {
+ STR_TO_VARSTR(p, "");
+ }
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
+ colDataAppend(pColInfo, numOfRows, (const char *)p, false);
+ taosMemoryFree(p);
}
- cols++;
numOfRows++;
sdbRelease(pSdb, pStb);
@@ -1709,8 +1711,7 @@ static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
mndReleaseDb(pMnode, pDb);
}
- pShow->numOfReads += numOfRows;
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c
index 4411db97a5..a7285162fa 100644
--- a/source/dnode/mnode/impl/src/mndStream.c
+++ b/source/dnode/mnode/impl/src/mndStream.c
@@ -58,7 +58,7 @@ int32_t mndInitStream(SMnode *pMnode) {
/*mndSetMsgHandle(pMnode, TDMT_MND_DROP_STREAM, mndProcessDropStreamReq);*/
/*mndSetMsgHandle(pMnode, TDMT_MND_DROP_STREAM_RSP, mndProcessDropStreamInRsp);*/
- mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TP, mndRetrieveStream);
+// mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TP, mndRetrieveStream);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_TP, mndCancelGetNextStream);
return sdbSetTable(pMnode->pSdb, table);
@@ -515,8 +515,7 @@ static int32_t mndRetrieveStream(SNodeMsg *pReq, SShowObj *pShow, char *data, in
}
mndReleaseDb(pMnode, pDb);
- pShow->numOfReads += numOfRows;
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c
index 4d7f00c24c..65a304e951 100644
--- a/source/dnode/mnode/impl/src/mndTopic.c
+++ b/source/dnode/mnode/impl/src/mndTopic.c
@@ -35,7 +35,6 @@ static int32_t mndTopicActionUpdate(SSdb *pSdb, SMqTopicObj *pTopic, SMqTopicObj
static int32_t mndProcessCreateTopicReq(SNodeMsg *pReq);
static int32_t mndProcessDropTopicReq(SNodeMsg *pReq);
static int32_t mndProcessDropTopicInRsp(SNodeMsg *pRsp);
-static int32_t mndProcessTopicMetaReq(SNodeMsg *pReq);
static int32_t mndGetTopicMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
static int32_t mndRetrieveTopic(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
static void mndCancelGetNextTopic(SMnode *pMnode, void *pIter);
@@ -53,7 +52,7 @@ int32_t mndInitTopic(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_MND_DROP_TOPIC, mndProcessDropTopicReq);
mndSetMsgHandle(pMnode, TDMT_VND_DROP_TOPIC_RSP, mndProcessDropTopicInRsp);
- mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TP, mndRetrieveTopic);
+// mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TP, mndRetrieveTopic);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_TP, mndCancelGetNextTopic);
return sdbSetTable(pMnode->pSdb, table);
@@ -595,8 +594,7 @@ static int32_t mndRetrieveTopic(SNodeMsg *pReq, SShowObj *pShow, char *data, int
}
mndReleaseDb(pMnode, pDb);
- pShow->numOfReads += numOfRows;
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c
index cfaaa304a9..e1bf4b1b7d 100644
--- a/source/dnode/mnode/impl/src/mndTrans.c
+++ b/source/dnode/mnode/impl/src/mndTrans.c
@@ -74,7 +74,7 @@ int32_t mndInitTrans(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_MND_TRANS_TIMER, mndProcessTransReq);
mndSetMsgHandle(pMnode, TDMT_MND_KILL_TRANS, mndProcessKillTransReq);
- mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TRANS, mndRetrieveTrans);
+// mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_TRANS, mndRetrieveTrans);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_TRANS, mndCancelGetNextTrans);
return sdbSetTable(pMnode->pSdb, table);
}
@@ -1370,8 +1370,7 @@ static int32_t mndRetrieveTrans(SNodeMsg *pReq, SShowObj *pShow, char *data, int
sdbRelease(pSdb, pTrans);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c
index 6e1aae64ab..e2b1725d9c 100644
--- a/source/dnode/mnode/impl/src/mndUser.c
+++ b/source/dnode/mnode/impl/src/mndUser.c
@@ -35,8 +35,7 @@ static int32_t mndProcessCreateUserReq(SNodeMsg *pReq);
static int32_t mndProcessAlterUserReq(SNodeMsg *pReq);
static int32_t mndProcessDropUserReq(SNodeMsg *pReq);
static int32_t mndProcessGetUserAuthReq(SNodeMsg *pReq);
-static int32_t mndGetUserMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextUser(SMnode *pMnode, void *pIter);
int32_t mndInitUser(SMnode *pMnode) {
@@ -640,53 +639,7 @@ GET_AUTH_OVER:
return code;
}
-static int32_t mndGetUserMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta) {
- SMnode *pMnode = pReq->pNode;
- SSdb *pSdb = pMnode->pSdb;
-
- int32_t cols = 0;
- SSchema *pSchema = pMeta->pSchemas;
-
- pShow->bytes[cols] = TSDB_USER_LEN + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "name");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 10 + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "privilege");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 8;
- pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP;
- strcpy(pSchema[cols].name, "create_time");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = TSDB_USER_LEN + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- strcpy(pSchema[cols].name, "account");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pMeta->numOfColumns = cols;
- pShow->numOfColumns = cols;
-
- pShow->offset[0] = 0;
- for (int32_t i = 1; i < cols; ++i) {
- pShow->offset[i] = pShow->offset[i - 1] + pShow->bytes[i - 1];
- }
-
- pShow->numOfRows = sdbGetSize(pSdb, SDB_USER);
- pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
- strcpy(pMeta->tbName, mndShowStr(pShow->type));
-
- return 0;
-}
-
-static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
@@ -700,34 +653,32 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int
cols = 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pUser->user, pShow->bytes[cols]);
- cols++;
+ SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- if (pUser->superUser) {
- const char *src = "super";
- STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
- } else {
- const char *src = "normal";
- STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
- }
- cols++;
+ char name[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->user, pShow->bytes[cols]);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int64_t *)pWrite = pUser->createdTime;
- cols++;
+ colDataAppend(pColInfo, numOfRows, (const char*) name, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, pUser->acct, pShow->bytes[cols]);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+
+ const char* src = pUser->superUser? "super":"normal";
+ char b[10+VARSTR_HEADER_SIZE] = {0};
+ STR_WITH_SIZE_TO_VARSTR(b, src, strlen(src));
+ colDataAppend(pColInfo, numOfRows, (const char*) b, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char*) &pUser->createdTime, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
+ STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->acct, pShow->bytes[cols]);
+ colDataAppend(pColInfo, numOfRows, (const char*) name, false);
numOfRows++;
sdbRelease(pSdb, pUser);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c
index bbe1760feb..dcb48c95a7 100644
--- a/source/dnode/mnode/impl/src/mndVgroup.c
+++ b/source/dnode/mnode/impl/src/mndVgroup.c
@@ -35,10 +35,9 @@ static int32_t mndProcessDropVnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessSyncVnodeRsp(SNodeMsg *pRsp);
static int32_t mndProcessCompactVnodeRsp(SNodeMsg *pRsp);
-static int32_t mndGetVgroupMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta);
-static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextVgroup(SMnode *pMnode, void *pIter);
-static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows);
+static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows);
static void mndCancelGetNextVnode(SMnode *pMnode, void *pIter);
int32_t mndInitVgroup(SMnode *pMnode) {
@@ -499,64 +498,12 @@ static int32_t mndGetVgroupMaxReplica(SMnode *pMnode, char *dbName, int8_t *pRep
return 0;
}
-static int32_t mndGetVgroupMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta) {
- SMnode *pMnode = pReq->pNode;
- SSdb *pSdb = pMnode->pSdb;
-
- if (mndGetVgroupMaxReplica(pMnode, pShow->db, &pShow->replica, &pShow->numOfRows) != 0) {
- return -1;
- }
-
- int32_t cols = 0;
- SSchema *pSchema = pMeta->pSchemas;
-
- pShow->bytes[cols] = 4;
- pSchema[cols].type = TSDB_DATA_TYPE_INT;
- strcpy(pSchema[cols].name, "vgId");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 4;
- pSchema[cols].type = TSDB_DATA_TYPE_INT;
- strcpy(pSchema[cols].name, "tables");
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- for (int32_t i = 0; i < pShow->replica; ++i) {
- pShow->bytes[cols] = 2;
- pSchema[cols].type = TSDB_DATA_TYPE_SMALLINT;
- snprintf(pSchema[cols].name, TSDB_COL_NAME_LEN, "v%d_dnode", i + 1);
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
-
- pShow->bytes[cols] = 9 + VARSTR_HEADER_SIZE;
- pSchema[cols].type = TSDB_DATA_TYPE_BINARY;
- snprintf(pSchema[cols].name, TSDB_COL_NAME_LEN, "v%d_status", i + 1);
- pSchema[cols].bytes = pShow->bytes[cols];
- cols++;
- }
-
- pMeta->numOfColumns = cols;
- pShow->numOfColumns = cols;
-
- pShow->offset[0] = 0;
- for (int32_t i = 1; i < cols; ++i) {
- pShow->offset[i] = pShow->offset[i - 1] + pShow->bytes[i - 1];
- }
-
- pShow->rowSize = pShow->offset[cols - 1] + pShow->bytes[cols - 1];
- strcpy(pMeta->tbName, mndShowStr(pShow->type));
-
- return 0;
-}
-
-static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SVgObj *pVgroup = NULL;
int32_t cols = 0;
- char *pWrite;
SDbObj *pDb = NULL;
if (strlen(pShow->db) > 0) {
@@ -575,46 +522,61 @@ static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, char *data, i
}
cols = 0;
-
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pVgroup->vgId;
- cols++;
+ SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->vgId, false);
SName name = {0};
- char db[TSDB_DB_NAME_LEN] = {0};
- tNameFromString(&name, pVgroup->dbName, T_NAME_ACCT|T_NAME_DB);
- tNameGetDbName(&name, db);
+ char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ tNameFromString(&name, pVgroup->dbName, T_NAME_ACCT | T_NAME_DB);
+ tNameGetDbName(&name, varDataVal(db));
+ varDataSetLen(db, strlen(varDataVal(db)));
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, db);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)db, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pVgroup->numOfTables;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->numOfTables, false);
- //status
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, "ready"); // TODO
- cols++;
+ // status
+ char buf[10] = {0};
+ STR_TO_VARSTR(buf, "ready"); // TODO
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, buf, false);
- //onlines
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int32_t *)pWrite = pVgroup->replica;
- cols++;
+ // onlines
+ int32_t onlines = pVgroup->replica;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&onlines, false);
+ // default 3 replica
+ for (int32_t i = 0; i < 3; ++i) {
- for (int32_t i = 0; i < pVgroup->replica; ++i) {
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(int16_t *)pWrite = pVgroup->vnodeGid[i].dnodeId;
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ if (i < pVgroup->replica) {
+ colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->vnodeGid[i].dnodeId, false);
- const char *role = mndGetRoleStr(pVgroup->vnodeGid[i].role);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_WITH_MAXSIZE_TO_VARSTR(pWrite, role, pShow->bytes[cols]);
- cols++;
+ char buf1[20] = {0};
+ const char *role = mndGetRoleStr(pVgroup->vnodeGid[i].role);
+ STR_WITH_MAXSIZE_TO_VARSTR(buf1, role, pShow->bytes[cols]);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)buf1, false);
+ } else {
+ colDataAppendNULL(pColInfo, numOfRows);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppendNULL(pColInfo, numOfRows);
+ }
}
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppendNULL(pColInfo, numOfRows);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppendNULL(pColInfo, numOfRows);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
+ colDataAppendNULL(pColInfo, numOfRows);
+
numOfRows++;
sdbRelease(pSdb, pVgroup);
}
@@ -623,8 +585,7 @@ static int32_t mndRetrieveVgroups(SNodeMsg *pReq, SShowObj *pShow, char *data, i
mndReleaseDb(pMnode, pDb);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
@@ -653,12 +614,11 @@ int32_t mndGetVnodesNum(SMnode *pMnode, int32_t dnodeId) {
return numOfVnodes;
}
-static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) {
+static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) {
SMnode *pMnode = pReq->pNode;
SSdb *pSdb = pMnode->pSdb;
int32_t numOfRows = 0;
SVgObj *pVgroup = NULL;
- char *pWrite;
int32_t cols = 0;
// int32_t dnodeId = pShow->replica;
@@ -670,30 +630,29 @@ static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, in
SVnodeGid *pVgid = &pVgroup->vnodeGid[i];
cols = 0;
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(uint32_t *)pWrite = pVgroup->vgId;
- cols++;
+ SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->vgId, false);
SName name = {0};
- char db[TSDB_DB_NAME_LEN] = {0};
- tNameFromString(&name, pVgroup->dbName, T_NAME_ACCT|T_NAME_DB);
- tNameGetDbName(&name, db);
+ char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ tNameFromString(&name, pVgroup->dbName, T_NAME_ACCT | T_NAME_DB);
+ tNameGetDbName(&name, varDataVal(db));
+ varDataSetLen(db, strlen(varDataVal(db)));
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, db);
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)db, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(uint32_t *)pWrite = 0; //todo: Tables
- cols++;
+ uint32_t val = 0;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&val, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- STR_TO_VARSTR(pWrite, mndGetRoleStr(pVgid->role));
- cols++;
+ char buf[20] = {0};
+ STR_TO_VARSTR(buf, mndGetRoleStr(pVgid->role));
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)buf, false);
- pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
- *(uint32_t *)pWrite = pVgroup->replica; //onlines
- cols++;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->replica, false); // onlines
numOfRows++;
}
@@ -701,8 +660,7 @@ static int32_t mndRetrieveVnodes(SNodeMsg *pReq, SShowObj *pShow, char *data, in
sdbRelease(pSdb, pVgroup);
}
- mndVacuumResult(data, pShow->numOfColumns, numOfRows, rows, pShow);
- pShow->numOfReads += numOfRows;
+ pShow->numOfRows += numOfRows;
return numOfRows;
}
diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c
index 0d1e890097..7b299f1f3c 100644
--- a/source/dnode/qnode/src/qnode.c
+++ b/source/dnode/qnode/src/qnode.c
@@ -73,10 +73,6 @@ int32_t qndProcessFetchMsg(SQnode *pQnode, SRpcMsg *pMsg) {
return qWorkerProcessCancelMsg(pQnode, pQnode->pQuery, pMsg);
case TDMT_VND_DROP_TASK:
return qWorkerProcessDropMsg(pQnode, pQnode->pQuery, pMsg);
- case TDMT_VND_SHOW_TABLES:
- return qWorkerProcessShowMsg(pQnode, pQnode->pQuery, pMsg);
- case TDMT_VND_SHOW_TABLES_FETCH:
- // return vnodeGetTableList(pQnode, pMsg);
case TDMT_VND_TABLE_META:
// return vnodeGetTableMeta(pQnode, pMsg);
case TDMT_VND_CONSUME:
diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h
index a93e1741bb..6e85c4df64 100644
--- a/source/dnode/vnode/inc/vnode.h
+++ b/source/dnode/vnode/inc/vnode.h
@@ -25,82 +25,144 @@
#include "tfs.h"
#include "wal.h"
+#include "tcommon.h"
+#include "tfs.h"
#include "tmallocator.h"
#include "tmsg.h"
#include "trow.h"
-#include "tmallocator.h"
-#include "tcommon.h"
-#include "tfs.h"
#ifdef __cplusplus
extern "C" {
#endif
-/* ------------------------ TYPES EXPOSED ------------------------ */
-typedef struct SMgmtWrapper SMgmtWrapper;
-typedef struct SVnode SVnode;
+// vnode
+typedef struct SVnode SVnode;
+typedef struct SMetaCfg SMetaCfg; // todo: remove
+typedef struct STsdbCfg STsdbCfg; // todo: remove
+typedef struct STqCfg STqCfg; // todo: remove
+typedef struct SVnodeCfg SVnodeCfg;
+
+int vnodeInit();
+void vnodeCleanup();
+SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg);
+void vnodeClose(SVnode *pVnode);
+void vnodeDestroy(const char *path);
+void vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs);
+int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
+int vnodeProcessCMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
+int vnodeProcessSyncReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
+int vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg);
+int vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
+int32_t vnodeAlter(SVnode *pVnode, const SVnodeCfg *pCfg);
+int32_t vnodeCompact(SVnode *pVnode);
+int32_t vnodeSync(SVnode *pVnode);
+int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad);
+int vnodeValidateTableHash(SVnodeCfg *pVnodeOptions, char *tableFName);
+
+// meta
+typedef struct SMeta SMeta; // todo: remove
+typedef struct SMTbCursor SMTbCursor; // todo: remove
+typedef struct SMCtbCursor SMCtbCursor; // todo: remove
+typedef struct SMSmaCursor SMSmaCursor; // todo: remove
#define META_SUPER_TABLE TD_SUPER_TABLE
#define META_CHILD_TABLE TD_CHILD_TABLE
#define META_NORMAL_TABLE TD_NORMAL_TABLE
-// Types exported
-typedef struct SMeta SMeta;
-
-typedef struct SMetaCfg {
- /// LRU cache size
- uint64_t lruSize;
-} SMetaCfg;
-
-typedef struct SMTbCursor SMTbCursor;
-typedef struct SMCtbCursor SMCtbCursor;
-typedef struct SMSmaCursor SMSmaCursor;
-
typedef SVCreateTbReq STbCfg;
typedef SVCreateTSmaReq SSmaCfg;
-typedef struct SDataStatis {
- int16_t colId;
- int16_t maxIndex;
- int16_t minIndex;
- int16_t numOfNull;
- int64_t sum;
- int64_t max;
- int64_t min;
-} SDataStatis;
+SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, bool isinline);
+STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver);
+void *metaGetSmaInfoByIndex(SMeta *pMeta, int64_t indexUid, bool isDecode);
+STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid);
+SArray *metaGetSmaTbUids(SMeta *pMeta, bool isDup);
+int metaGetTbNum(SMeta *pMeta);
+SMTbCursor *metaOpenTbCursor(SMeta *pMeta);
+void metaCloseTbCursor(SMTbCursor *pTbCur);
+char *metaTbCursorNext(SMTbCursor *pTbCur);
+SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid);
+void metaCloseCtbCurosr(SMCtbCursor *pCtbCur);
+tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur);
-typedef struct STsdbQueryCond {
- STimeWindow twindow;
- int32_t order; // desc|asc order to iterate the data block
- int32_t numOfCols;
- SColumnInfo *colList;
- bool loadExternalRows; // load external rows or not
- int32_t type; // data block load type:
-} STsdbQueryCond;
+SMSmaCursor *metaOpenSmaCursor(SMeta *pMeta, tb_uid_t uid);
+void metaCloseSmaCursor(SMSmaCursor *pSmaCur);
+int64_t metaSmaCursorNext(SMSmaCursor *pSmaCur);
-typedef struct {
- TSKEY lastKey;
- uint64_t uid;
-} STableKeyInfo;
+// tsdb
+typedef struct STsdb STsdb;
+typedef struct SDataStatis SDataStatis;
+typedef struct STsdbQueryCond STsdbQueryCond;
+typedef void *tsdbReaderT;
+#define BLOCK_LOAD_OFFSET_SEQ_ORDER 1
+#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
+#define BLOCK_LOAD_TABLE_RR_ORDER 3
+#define TABLE_TID(t) (t)->tid
+#define TABLE_UID(t) (t)->uid
+STsdb *tsdbOpen(const char *path, int32_t vgId, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory *pMAF, SMeta *pMeta,
+ STfs *pTfs);
+void tsdbClose(STsdb *);
+void tsdbRemove(const char *path);
+int tsdbInsertData(STsdb *pTsdb, SSubmitReq *pMsg, SSubmitRsp *pRsp);
+int tsdbPrepareCommit(STsdb *pTsdb);
+int tsdbCommit(STsdb *pTsdb);
+int32_t tsdbInitSma(STsdb *pTsdb);
+int32_t tsdbCreateTSma(STsdb *pTsdb, char *pMsg);
+int32_t tsdbDropTSma(STsdb *pTsdb, char *pMsg);
+tsdbReaderT *tsdbQueryTables(STsdb *tsdb, STsdbQueryCond *pCond, STableGroupInfo *tableInfoGroup, uint64_t qId,
+ uint64_t taskId);
+tsdbReaderT tsdbQueryCacheLast(STsdb *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupList, uint64_t qId,
+ void *pMemRef);
+int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT *pReader, STableBlockDistInfo *pTableBlockInfo);
+bool isTsdbCacheLastRow(tsdbReaderT *pReader);
+int32_t tsdbQuerySTableByTagCond(void *pMeta, uint64_t uid, TSKEY skey, const char *pTagCond, size_t len,
+ int16_t tagNameRelType, const char *tbnameCond, STableGroupInfo *pGroupInfo,
+ SColIndex *pColIndex, int32_t numOfCols, uint64_t reqId, uint64_t taskId);
+int64_t tsdbGetNumOfRowsInMemTable(tsdbReaderT *pHandle);
+bool tsdbNextDataBlock(tsdbReaderT pTsdbReadHandle);
+void tsdbRetrieveDataBlockInfo(tsdbReaderT *pTsdbReadHandle, SDataBlockInfo *pBlockInfo);
+int32_t tsdbRetrieveDataBlockStatisInfo(tsdbReaderT *pTsdbReadHandle, SDataStatis **pBlockStatis);
+SArray *tsdbRetrieveDataBlock(tsdbReaderT *pTsdbReadHandle, SArray *pColumnIdList);
+void tsdbDestroyTableGroup(STableGroupInfo *pGroupList);
+int32_t tsdbGetOneTableGroup(void *pMeta, uint64_t uid, TSKEY startKey, STableGroupInfo *pGroupInfo);
+int32_t tsdbGetTableGroupFromIdList(STsdb *tsdb, SArray *pTableIdList, STableGroupInfo *pGroupInfo);
+void tsdbCleanupReadHandle(tsdbReaderT queryHandle);
+int32_t tsdbUpdateSmaWindow(STsdb *pTsdb, SSubmitReq *pMsg, int64_t version);
+int32_t tsdbInsertTSmaData(STsdb *pTsdb, int64_t indexUid, const char *msg);
+int32_t tsdbDropTSmaData(STsdb *pTsdb, int64_t indexUid);
+int32_t tsdbInsertRSmaData(STsdb *pTsdb, char *msg);
-typedef struct STable {
- uint64_t tid;
- uint64_t uid;
- STSchema *pSchema;
-} STable;
+// tq
+enum {
+ TQ_STREAM_TOKEN__DATA = 1,
+ TQ_STREAM_TOKEN__WATERMARK,
+ TQ_STREAM_TOKEN__CHECKPOINT,
+};
-#define BLOCK_LOAD_OFFSET_SEQ_ORDER 1
-#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
-#define BLOCK_LOAD_TABLE_RR_ORDER 3
+typedef struct STqReadHandle STqReadHandle;
-#define TABLE_TID(t) (t)->tid
-#define TABLE_UID(t) (t)->uid
+STqReadHandle *tqInitSubmitMsgScanner(SMeta *pMeta);
-// TYPES EXPOSED
-typedef struct STsdb STsdb;
+void tqReadHandleSetColIdList(STqReadHandle *pReadHandle, SArray *pColIdList);
+int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const SArray *tbUidList);
+int tqReadHandleAddTbUidList(STqReadHandle *pHandle, const SArray *tbUidList);
+int32_t tqReadHandleSetMsg(STqReadHandle *pHandle, SSubmitReq *pMsg, int64_t ver);
+bool tqNextDataBlock(STqReadHandle *pHandle);
+int tqRetrieveDataBlockInfo(STqReadHandle *pHandle, SDataBlockInfo *pBlockInfo);
+SArray *tqRetrieveDataBlock(STqReadHandle *pHandle);
-typedef struct STsdbCfg {
+// need to reposition
+typedef struct SMgmtWrapper SMgmtWrapper;
+
+int32_t tdScanAndConvertSubmitMsg(SSubmitReq *pMsg);
+
+// structs
+struct SMetaCfg {
+ uint64_t lruSize;
+};
+
+struct STsdbCfg {
int8_t precision;
int8_t update;
int8_t compression;
@@ -112,15 +174,13 @@ typedef struct STsdbCfg {
int32_t keep2;
uint64_t lruCacheSize;
SArray *retentions;
-} STsdbCfg;
+};
-
-typedef struct {
- // TODO
+struct STqCfg {
int32_t reserved;
-} STqCfg;
+};
-typedef struct {
+struct SVnodeCfg {
int32_t vgId;
uint64_t dbId;
STfs *pTfs;
@@ -140,9 +200,9 @@ typedef struct {
uint32_t hashBegin;
uint32_t hashEnd;
int8_t hashMethod;
-} SVnodeCfg;
+};
-typedef struct {
+struct STqReadHandle {
int64_t ver;
int64_t tbUid;
SHashObj *tbIdHash;
@@ -155,133 +215,38 @@ typedef struct {
int32_t sver;
SSchemaWrapper *pSchemaWrapper;
STSchema *pSchema;
-} STqReadHandle;
-
-/* ------------------------ SVnode ------------------------ */
-/**
- * @brief Initialize the vnode module
- *
- * @return int 0 for success and -1 for failure
- */
-int vnodeInit();
-
-/**
- * @brief Cleanup the vnode module
- *
- */
-void vnodeCleanup();
-
-/**
- * @brief Open a VNODE.
- *
- * @param path path of the vnode
- * @param pVnodeCfg options of the vnode
- * @return SVnode* The vnode object
- */
-SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg);
-
-/**
- * @brief Close a VNODE
- *
- * @param pVnode The vnode object to close
- */
-void vnodeClose(SVnode *pVnode);
-
-/**
- * @brief Destroy a VNODE.
- *
- * @param path Path of the VNODE.
- */
-void vnodeDestroy(const char *path);
-
-/**
- * @brief Process an array of write messages.
- *
- * @param pVnode The vnode object.
- * @param pMsgs The array of SRpcMsg
- */
-void vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs);
-
-/**
- * @brief Apply a write request message.
- *
- * @param pVnode The vnode object.
- * @param pMsg The request message
- * @param pRsp The response message
- * @return int 0 for success, -1 for failure
- */
-int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
-
-/**
- * @brief Process a consume message.
- *
- * @param pVnode The vnode object.
- * @param pMsg The request message
- * @param pRsp The response message
- * @return int 0 for success, -1 for failure
- */
-int vnodeProcessCMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
-
-/**
- * @brief Process the sync request
- *
- * @param pVnode
- * @param pMsg
- * @param pRsp
- * @return int
- */
-int vnodeProcessSyncReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
-
-/**
- * @brief Process a query message.
- *
- * @param pVnode The vnode object.
- * @param pMsg The request message
- * @return int 0 for success, -1 for failure
- */
-int vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg);
-
-/**
- * @brief Process a fetch message.
- *
- * @param pVnode The vnode object.
- * @param pMsg The request message
- * @return int 0 for success, -1 for failure
- */
-int vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo);
-
-/* ------------------------ SVnodeCfg ------------------------ */
-/**
- * @brief Initialize VNODE options.
- *
- * @param pOptions The options object to be initialized. It should not be NULL.
- */
-void vnodeOptionsInit(SVnodeCfg *pOptions);
-
-/**
- * @brief Clear VNODE options.
- *
- * @param pOptions Options to clear.
- */
-void vnodeOptionsClear(SVnodeCfg *pOptions);
-
-int vnodeValidateTableHash(SVnodeCfg *pVnodeOptions, char *tableFName);
-
-/* ------------------------ FOR COMPILE ------------------------ */
-
-int32_t vnodeAlter(SVnode *pVnode, const SVnodeCfg *pCfg);
-int32_t vnodeCompact(SVnode *pVnode);
-int32_t vnodeSync(SVnode *pVnode);
-int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad);
-
-/* ------------------------- TQ READ --------------------------- */
-
-enum {
- TQ_STREAM_TOKEN__DATA = 1,
- TQ_STREAM_TOKEN__WATERMARK,
- TQ_STREAM_TOKEN__CHECKPOINT,
};
+struct SDataStatis {
+ int16_t colId;
+ int16_t maxIndex;
+ int16_t minIndex;
+ int16_t numOfNull;
+ int64_t sum;
+ int64_t max;
+ int64_t min;
+};
+
+struct STsdbQueryCond {
+ STimeWindow twindow;
+ int32_t order; // desc|asc order to iterate the data block
+ int32_t numOfCols;
+ SColumnInfo *colList;
+ bool loadExternalRows; // load external rows or not
+ int32_t type; // data block load type:
+};
+
+typedef struct {
+ TSKEY lastKey;
+ uint64_t uid;
+} STableKeyInfo;
+
+typedef struct STable {
+ uint64_t tid;
+ uint64_t uid;
+ STSchema *pSchema;
+} STable;
+
typedef struct {
int8_t type;
int8_t reserved[7];
@@ -292,294 +257,6 @@ typedef struct {
};
} STqStreamToken;
-STqReadHandle *tqInitSubmitMsgScanner(SMeta *pMeta);
-
-static FORCE_INLINE void tqReadHandleSetColIdList(STqReadHandle *pReadHandle, SArray *pColIdList) {
- pReadHandle->pColIdList = pColIdList;
-}
-
-// static FORCE_INLINE void tqReadHandleSetTbUid(STqReadHandle* pHandle, int64_t tbUid) {
-// pHandle->tbUid = tbUid;
-//}
-
-static FORCE_INLINE int tqReadHandleSetTbUidList(STqReadHandle *pHandle, const SArray *tbUidList) {
- if (pHandle->tbIdHash) {
- taosHashClear(pHandle->tbIdHash);
- }
-
- pHandle->tbIdHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
- if (pHandle->tbIdHash == NULL) {
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- return -1;
- }
-
- for (int i = 0; i < taosArrayGetSize(tbUidList); i++) {
- int64_t *pKey = (int64_t *)taosArrayGet(tbUidList, i);
- taosHashPut(pHandle->tbIdHash, pKey, sizeof(int64_t), NULL, 0);
- }
-
- return 0;
-}
-
-static FORCE_INLINE int tqReadHandleAddTbUidList(STqReadHandle *pHandle, const SArray *tbUidList) {
- if (pHandle->tbIdHash == NULL) {
- pHandle->tbIdHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
- if (pHandle->tbIdHash == NULL) {
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- return -1;
- }
- }
-
- for (int i = 0; i < taosArrayGetSize(tbUidList); i++) {
- int64_t *pKey = (int64_t *)taosArrayGet(tbUidList, i);
- taosHashPut(pHandle->tbIdHash, pKey, sizeof(int64_t), NULL, 0);
- }
-
- return 0;
-}
-
-int32_t tqReadHandleSetMsg(STqReadHandle *pHandle, SSubmitReq *pMsg, int64_t ver);
-bool tqNextDataBlock(STqReadHandle *pHandle);
-int tqRetrieveDataBlockInfo(STqReadHandle *pHandle, SDataBlockInfo *pBlockInfo);
-// return SArray
-SArray *tqRetrieveDataBlock(STqReadHandle *pHandle);
-
-// meta.h
-SMeta *metaOpen(const char *path, const SMetaCfg *pMetaCfg, SMemAllocatorFactory *pMAF);
-void metaClose(SMeta *pMeta);
-void metaRemove(const char *path);
-int metaCreateTable(SMeta *pMeta, STbCfg *pTbCfg);
-int metaDropTable(SMeta *pMeta, tb_uid_t uid);
-int metaCommit(SMeta *pMeta);
-int32_t metaCreateTSma(SMeta *pMeta, SSmaCfg *pCfg);
-int32_t metaDropTSma(SMeta *pMeta, int64_t indexUid);
-STbCfg *metaGetTbInfoByUid(SMeta *pMeta, tb_uid_t uid);
-STbCfg *metaGetTbInfoByName(SMeta *pMeta, char *tbname, tb_uid_t *uid);
-SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, bool isinline);
-STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver);
-void *metaGetSmaInfoByIndex(SMeta *pMeta, int64_t indexUid, bool isDecode);
-STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid);
-SArray *metaGetSmaTbUids(SMeta *pMeta, bool isDup);
-int metaGetTbNum(SMeta *pMeta);
-SMTbCursor *metaOpenTbCursor(SMeta *pMeta);
-void metaCloseTbCursor(SMTbCursor *pTbCur);
-char *metaTbCursorNext(SMTbCursor *pTbCur);
-SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid);
-void metaCloseCtbCurosr(SMCtbCursor *pCtbCur);
-tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur);
-
-SMSmaCursor *metaOpenSmaCursor(SMeta *pMeta, tb_uid_t uid);
-void metaCloseSmaCursor(SMSmaCursor *pSmaCur);
-int64_t metaSmaCursorNext(SMSmaCursor *pSmaCur);
-
-// Options
-void metaOptionsInit(SMetaCfg *pMetaCfg);
-void metaOptionsClear(SMetaCfg *pMetaCfg);
-
-// query condition to build multi-table data block iterator
-// STsdb
-STsdb *tsdbOpen(const char *path, int32_t vgId, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory *pMAF, SMeta *pMeta, STfs *pTfs);
-void tsdbClose(STsdb *);
-void tsdbRemove(const char *path);
-int tsdbInsertData(STsdb *pTsdb, SSubmitReq *pMsg, SSubmitRsp *pRsp);
-int tsdbPrepareCommit(STsdb *pTsdb);
-int tsdbCommit(STsdb *pTsdb);
-
-
-int32_t tsdbInitSma(STsdb *pTsdb);
-int32_t tsdbCreateTSma(STsdb *pTsdb, char *pMsg);
-int32_t tsdbDropTSma(STsdb *pTsdb, char *pMsg);
-/**
- * @brief When submit msg received, update the relative expired window synchronously.
- *
- * @param pTsdb
- * @param pMsg
- * @param version
- * @return int32_t
- */
-int32_t tsdbUpdateSmaWindow(STsdb *pTsdb, SSubmitReq *pMsg, int64_t version);
-
-/**
- * @brief Insert tSma(Time-range-wise SMA) data from stream computing engine
- *
- * @param pTsdb
- * @param indexUid
- * @param msg
- * @return int32_t
- */
-int32_t tsdbInsertTSmaData(STsdb *pTsdb, int64_t indexUid, const char *msg);
-
-/**
- * @brief Drop tSma data and local cache.
- *
- * @param pTsdb
- * @param indexUid
- * @return int32_t
- */
-int32_t tsdbDropTSmaData(STsdb *pTsdb, int64_t indexUid);
-
-/**
- * @brief Insert RSma(Rollup SMA) data.
- *
- * @param pTsdb
- * @param msg
- * @return int32_t
- */
-int32_t tsdbInsertRSmaData(STsdb *pTsdb, char *msg);
-
-// TODO: This is the basic params, and should wrap the params to a queryHandle.
-/**
- * @brief Get tSma(Time-range-wise SMA) data.
- *
- * @param pTsdb
- * @param pData
- * @param indexUid
- * @param querySKey
- * @param nMaxResult
- * @return int32_t
- */
-int32_t tsdbGetTSmaData(STsdb *pTsdb, char *pData, int64_t indexUid, TSKEY querySKey, int32_t nMaxResult);
-
-// STsdbCfg
-int tsdbOptionsInit(STsdbCfg *);
-void tsdbOptionsClear(STsdbCfg *);
-
-typedef void* tsdbReaderT;
-
-/**
- * Get the data block iterator, starting from position according to the query condition
- *
- * @param tsdb tsdb handle
- * @param pCond query condition, including time window, result set order, and basic required columns for each block
- * @param tableInfoGroup table object list in the form of set, grouped into different sets according to the
- * group by condition
- * @param qinfo query info handle from query processor
- * @return
- */
-tsdbReaderT *tsdbQueryTables(STsdb *tsdb, STsdbQueryCond *pCond, STableGroupInfo *tableInfoGroup, uint64_t qId, uint64_t taskId);
-
-/**
- * Get the last row of the given query time window for all the tables in STableGroupInfo object.
- * Note that only one data block with only row will be returned while invoking retrieve data block function for
- * all tables in this group.
- *
- * @param tsdb tsdb handle
- * @param pCond query condition, including time window, result set order, and basic required columns for each block
- * @param tableInfo table list.
- * @return
- */
-//tsdbReaderT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STableGroupInfo *tableInfo, uint64_t qId,
-// SMemRef *pRef);
-
-
-tsdbReaderT tsdbQueryCacheLast(STsdb *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupList, uint64_t qId, void* pMemRef);
-
-int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT* pReader, STableBlockDistInfo* pTableBlockInfo);
-
-bool isTsdbCacheLastRow(tsdbReaderT* pReader);
-
-/**
- *
- * @param tsdb
- * @param uid
- * @param skey
- * @param pTagCond
- * @param len
- * @param tagNameRelType
- * @param tbnameCond
- * @param pGroupInfo
- * @param pColIndex
- * @param numOfCols
- * @param reqId
- * @return
- */
-int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const char* pTagCond, size_t len,
- int16_t tagNameRelType, const char* tbnameCond, STableGroupInfo* pGroupInfo,
- SColIndex* pColIndex, int32_t numOfCols, uint64_t reqId, uint64_t taskId);
-/**
- * get num of rows in mem table
- *
- * @param pHandle
- * @return row size
- */
-
-int64_t tsdbGetNumOfRowsInMemTable(tsdbReaderT* pHandle);
-
-/**
- * move to next block if exists
- *
- * @param pTsdbReadHandle
- * @return
- */
-bool tsdbNextDataBlock(tsdbReaderT pTsdbReadHandle);
-
-/**
- * Get current data block information
- *
- * @param pTsdbReadHandle
- * @param pBlockInfo
- * @return
- */
-void tsdbRetrieveDataBlockInfo(tsdbReaderT *pTsdbReadHandle, SDataBlockInfo *pBlockInfo);
-
-/**
- *
- * Get the pre-calculated information w.r.t. current data block.
- *
- * In case of data block in cache, the pBlockStatis will always be NULL.
- * If a block is not completed loaded from disk, the pBlockStatis will be NULL.
-
- * @pBlockStatis the pre-calculated value for current data blocks. if the block is a cache block, always return 0
- * @return
- */
-int32_t tsdbRetrieveDataBlockStatisInfo(tsdbReaderT *pTsdbReadHandle, SDataStatis **pBlockStatis);
-
-/**
- *
- * The query condition with primary timestamp is passed to iterator during its constructor function,
- * the returned data block must be satisfied with the time window condition in any cases,
- * which means the SData data block is not actually the completed disk data blocks.
- *
- * @param pTsdbReadHandle query handle
- * @param pColumnIdList required data columns id list
- * @return
- */
-SArray *tsdbRetrieveDataBlock(tsdbReaderT *pTsdbReadHandle, SArray *pColumnIdList);
-
-/**
- * destroy the created table group list, which is generated by tag query
- * @param pGroupList
- */
-void tsdbDestroyTableGroup(STableGroupInfo *pGroupList);
-
-/**
- * create the table group result including only one table, used to handle the normal table query
- *
- * @param tsdb tsdbHandle
- * @param uid table uid
- * @param pGroupInfo the generated result
- * @return
- */
-int32_t tsdbGetOneTableGroup(void *pMeta, uint64_t uid, TSKEY startKey, STableGroupInfo *pGroupInfo);
-
-/**
- *
- * @param tsdb
- * @param pTableIdList
- * @param pGroupInfo
- * @return
- */
-int32_t tsdbGetTableGroupFromIdList(STsdb *tsdb, SArray *pTableIdList, STableGroupInfo *pGroupInfo);
-
-/**
- * clean up the query handle
- * @param queryHandle
- */
-void tsdbCleanupReadHandle(tsdbReaderT queryHandle);
-
-int32_t tdScanAndConvertSubmitMsg(SSubmitReq *pMsg);
-
-
#ifdef __cplusplus
}
#endif
diff --git a/source/dnode/vnode/src/inc/meta.h b/source/dnode/vnode/src/inc/meta.h
index b04364daf8..b3553f5d2d 100644
--- a/source/dnode/vnode/src/inc/meta.h
+++ b/source/dnode/vnode/src/inc/meta.h
@@ -24,6 +24,17 @@ typedef struct SMetaCache SMetaCache;
typedef struct SMetaIdx SMetaIdx;
typedef struct SMetaDB SMetaDB;
+SMeta* metaOpen(const char* path, const SMetaCfg* pMetaCfg, SMemAllocatorFactory* pMAF);
+void metaClose(SMeta* pMeta);
+void metaRemove(const char* path);
+int metaCreateTable(SMeta* pMeta, STbCfg* pTbCfg);
+int metaDropTable(SMeta* pMeta, tb_uid_t uid);
+int metaCommit(SMeta* pMeta);
+int32_t metaCreateTSma(SMeta* pMeta, SSmaCfg* pCfg);
+int32_t metaDropTSma(SMeta* pMeta, int64_t indexUid);
+STbCfg* metaGetTbInfoByUid(SMeta* pMeta, tb_uid_t uid);
+STbCfg* metaGetTbInfoByName(SMeta* pMeta, char* tbname, tb_uid_t* uid);
+
// SMetaDB
int metaOpenDB(SMeta* pMeta);
void metaCloseDB(SMeta* pMeta);
diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h
index 29a45723c4..7168493666 100644
--- a/source/dnode/vnode/src/inc/vnodeInt.h
+++ b/source/dnode/vnode/src/inc/vnodeInt.h
@@ -17,6 +17,9 @@
#define _TD_VNODE_DEF_H_
#include "executor.h"
+#include "filter.h"
+#include "qworker.h"
+#include "sync.h"
#include "tchecksum.h"
#include "tcoding.h"
#include "tcompression.h"
@@ -25,14 +28,15 @@
#include "tglobal.h"
#include "tlist.h"
#include "tlockfree.h"
+#include "tlosertree.h"
#include "tmacro.h"
#include "tmallocator.h"
#include "tskiplist.h"
+#include "tstream.h"
#include "ttime.h"
#include "ttimer.h"
#include "vnode.h"
#include "wal.h"
-#include "qworker.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/vnode/src/meta/metaBDBImpl.c b/source/dnode/vnode/src/meta/metaBDBImpl.c
index a8270f746d..249e489029 100644
--- a/source/dnode/vnode/src/meta/metaBDBImpl.c
+++ b/source/dnode/vnode/src/meta/metaBDBImpl.c
@@ -16,10 +16,7 @@
#define ALLOW_FORBID_FUNC
#include "db.h"
-#include "metaDef.h"
-
-#include "tcoding.h"
-#include "thash.h"
+#include "vnodeInt.h"
#define IMPL_WITH_LOCK 1
// #if IMPL_WITH_LOCK
@@ -262,7 +259,7 @@ int metaSaveSmaToDB(SMeta *pMeta, STSma *pSmaCfg) {
return 0;
}
-int metaRemoveSmaFromDb(SMeta *pMeta, int64_t indexUid) {
+int metaRemoveSmaFromDb(SMeta *pMeta, int64_t indexUid) {
// TODO
#if 0
DBT key = {0};
@@ -668,7 +665,7 @@ STbCfg *metaGetTbInfoByName(SMeta *pMeta, char *tbname, tb_uid_t *uid) {
}
void *metaGetSmaInfoByIndex(SMeta *pMeta, int64_t indexUid, bool isDecode) {
- STSma * pCfg = NULL;
+ STSma *pCfg = NULL;
SMetaDB *pDB = pMeta->pDB;
DBT key = {0};
DBT value = {0};
@@ -711,9 +708,9 @@ static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_
int ret;
void *pBuf;
// SSchema *pSchema;
- SSchemaKey schemaKey = {uid, sver, 0};
- DBT key = {0};
- DBT value = {0};
+ SSchemaKey schemaKey = {uid, sver, 0};
+ DBT key = {0};
+ DBT value = {0};
// Set key/value properties
key.data = &schemaKey;
@@ -761,14 +758,14 @@ SMTbCursor *metaOpenTbCursor(SMeta *pMeta) {
}
int metaGetTbNum(SMeta *pMeta) {
- SMetaDB *pDB = pMeta->pDB;
+ SMetaDB *pDB = pMeta->pDB;
DB_BTREE_STAT *sp1;
pDB->pTbDB->stat(pDB->pNtbIdx, NULL, &sp1, 0);
-
+
DB_BTREE_STAT *sp2;
pDB->pTbDB->stat(pDB->pCtbIdx, NULL, &sp2, 0);
-
+
return sp1->bt_nkeys + sp2->bt_nkeys;
}
diff --git a/source/dnode/vnode/src/meta/metaCfg.c b/source/dnode/vnode/src/meta/metaCfg.c
index a5fcb32698..371c20f157 100644
--- a/source/dnode/vnode/src/meta/metaCfg.c
+++ b/source/dnode/vnode/src/meta/metaCfg.c
@@ -18,11 +18,6 @@
const SMetaCfg defaultMetaOptions = {.lruSize = 0};
/* ------------------------ EXPOSED METHODS ------------------------ */
-void metaOptionsInit(SMetaCfg *pMetaOptions) { metaOptionsCopy(pMetaOptions, &defaultMetaOptions); }
-
-void metaOptionsClear(SMetaCfg *pMetaOptions) {
- // TODO
-}
int metaValidateOptions(const SMetaCfg *pMetaOptions) {
// TODO
diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c
index 6dea4a4e57..5022d0e050 100644
--- a/source/dnode/vnode/src/meta/metaQuery.c
+++ b/source/dnode/vnode/src/meta/metaQuery.c
@@ -11,4 +11,6 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
- */
\ No newline at end of file
+ */
+
+#include "vnodeInt.h"
\ No newline at end of file
diff --git a/source/dnode/vnode/src/meta/metaTDBImpl.c b/source/dnode/vnode/src/meta/metaTDBImpl.c
index 6f218ad72b..9b9f54b5ba 100644
--- a/source/dnode/vnode/src/meta/metaTDBImpl.c
+++ b/source/dnode/vnode/src/meta/metaTDBImpl.c
@@ -15,7 +15,6 @@
#include "vnodeInt.h"
-#include "tdbInt.h"
typedef struct SPoolMem {
int64_t size;
struct SPoolMem *prev;
@@ -27,18 +26,18 @@ typedef struct SPoolMem {
static SPoolMem *openPool();
static void clearPool(SPoolMem *pPool);
static void closePool(SPoolMem *pPool);
-static void * poolMalloc(void *arg, size_t size);
+static void *poolMalloc(void *arg, size_t size);
static void poolFree(void *arg, void *ptr);
struct SMetaDB {
TXN txn;
- TENV * pEnv;
- TDB * pTbDB;
- TDB * pSchemaDB;
- TDB * pNameIdx;
- TDB * pStbIdx;
- TDB * pNtbIdx;
- TDB * pCtbIdx;
+ TENV *pEnv;
+ TDB *pTbDB;
+ TDB *pSchemaDB;
+ TDB *pNameIdx;
+ TDB *pStbIdx;
+ TDB *pNtbIdx;
+ TDB *pCtbIdx;
SPoolMem *pPool;
#ifdef META_TDB_SMA_TEST
TDB *pSmaDB;
@@ -52,7 +51,7 @@ typedef struct __attribute__((__packed__)) {
} SSchemaDbKey;
typedef struct {
- char * name;
+ char *name;
tb_uid_t uid;
} SNameIdxKey;
@@ -251,14 +250,14 @@ void metaCloseDB(SMeta *pMeta) {
int metaSaveTableToDB(SMeta *pMeta, STbCfg *pTbCfg) {
tb_uid_t uid;
- SMetaDB * pMetaDb;
- void * pKey;
- void * pVal;
+ SMetaDB *pMetaDb;
+ void *pKey;
+ void *pVal;
int kLen;
int vLen;
int ret;
char buf[512];
- void * pBuf;
+ void *pBuf;
SCtbIdxKey ctbIdxKey;
SSchemaDbKey schemaDbKey;
SSchemaWrapper schemaWrapper;
@@ -375,11 +374,11 @@ int metaRemoveTableFromDb(SMeta *pMeta, tb_uid_t uid) {
STbCfg *metaGetTbInfoByUid(SMeta *pMeta, tb_uid_t uid) {
int ret;
SMetaDB *pMetaDb = pMeta->pDB;
- void * pKey;
- void * pVal;
+ void *pKey;
+ void *pVal;
int kLen;
int vLen;
- STbCfg * pTbCfg;
+ STbCfg *pTbCfg;
// Fetch
pKey = &uid;
@@ -431,14 +430,14 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
}
static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_t sver, bool isinline, bool isGetEx) {
- void * pKey;
- void * pVal;
+ void *pKey;
+ void *pVal;
int kLen;
int vLen;
int ret;
SSchemaDbKey schemaDbKey;
SSchemaWrapper *pSchemaWrapper;
- void * pBuf;
+ void *pBuf;
// fetch
schemaDbKey.uid = uid;
@@ -465,9 +464,9 @@ STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {
tb_uid_t quid;
SSchemaWrapper *pSW;
STSchemaBuilder sb;
- SSchemaEx * pSchema;
- STSchema * pTSchema;
- STbCfg * pTbCfg;
+ SSchemaEx *pSchema;
+ STSchema *pTSchema;
+ STbCfg *pTbCfg;
pTbCfg = metaGetTbInfoByUid(pMeta, uid);
if (pTbCfg->type == META_CHILD_TABLE) {
@@ -498,7 +497,7 @@ struct SMTbCursor {
SMTbCursor *metaOpenTbCursor(SMeta *pMeta) {
SMTbCursor *pTbCur = NULL;
- SMetaDB * pDB = pMeta->pDB;
+ SMetaDB *pDB = pMeta->pDB;
pTbCur = (SMTbCursor *)taosMemoryCalloc(1, sizeof(*pTbCur));
if (pTbCur == NULL) {
@@ -520,12 +519,12 @@ void metaCloseTbCursor(SMTbCursor *pTbCur) {
}
char *metaTbCursorNext(SMTbCursor *pTbCur) {
- void * pKey = NULL;
- void * pVal = NULL;
+ void *pKey = NULL;
+ void *pVal = NULL;
int kLen;
int vLen;
int ret;
- void * pBuf;
+ void *pBuf;
STbCfg tbCfg;
for (;;) {
@@ -548,17 +547,17 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
}
struct SMCtbCursor {
- TDBC * pCur;
+ TDBC *pCur;
tb_uid_t suid;
- void * pKey;
- void * pVal;
+ void *pKey;
+ void *pVal;
int kLen;
int vLen;
};
SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid) {
SMCtbCursor *pCtbCur = NULL;
- SMetaDB * pDB = pMeta->pDB;
+ SMetaDB *pDB = pMeta->pDB;
int ret;
pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
@@ -654,7 +653,6 @@ STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid) {
continue;
}
-
++pSW->number;
STSma *tptr = (STSma *)taosMemoryRealloc(pSW->tSma, pSW->number * sizeof(STSma));
if (tptr == NULL) {
@@ -709,10 +707,10 @@ int metaSaveSmaToDB(SMeta *pMeta, STSma *pSmaCfg) {
// ASSERT(0);
#ifdef META_TDB_SMA_TEST
- int32_t ret = 0;
+ int32_t ret = 0;
SMetaDB *pMetaDb = pMeta->pDB;
- void *pBuf = NULL, *qBuf = NULL;
- void *key = {0}, *val = {0};
+ void *pBuf = NULL, *qBuf = NULL;
+ void *key = {0}, *val = {0};
// save sma info
int32_t len = tEncodeTSma(NULL, pSmaCfg);
@@ -1103,7 +1101,7 @@ static void closePool(SPoolMem *pPool) {
}
static void *poolMalloc(void *arg, size_t size) {
- void * ptr = NULL;
+ void *ptr = NULL;
SPoolMem *pPool = (SPoolMem *)arg;
SPoolMem *pMem;
diff --git a/source/dnode/vnode/src/meta/metaTbCfg.c b/source/dnode/vnode/src/meta/metaTbCfg.c
index 8ecc808786..9d5012c17f 100644
--- a/source/dnode/vnode/src/meta/metaTbCfg.c
+++ b/source/dnode/vnode/src/meta/metaTbCfg.c
@@ -14,7 +14,6 @@
*/
#include "vnodeInt.h"
-#include "tcoding.h"
int metaValidateTbCfg(SMeta *pMeta, const STbCfg *pTbOptions) {
// TODO
diff --git a/source/dnode/vnode/src/meta/metaTbTag.c b/source/dnode/vnode/src/meta/metaTbTag.c
index 6dea4a4e57..5022d0e050 100644
--- a/source/dnode/vnode/src/meta/metaTbTag.c
+++ b/source/dnode/vnode/src/meta/metaTbTag.c
@@ -11,4 +11,6 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
- */
\ No newline at end of file
+ */
+
+#include "vnodeInt.h"
\ No newline at end of file
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index f48262deba..f57103aab4 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -13,9 +13,6 @@
* along with this program. If not, see .
*/
-#include "tcompare.h"
-#include "tdatablock.h"
-#include "tstream.h"
#include "vnodeInt.h"
int32_t tqInit() { return tqPushMgrInit(); }
diff --git a/source/dnode/vnode/src/tq/tqCommit.c b/source/dnode/vnode/src/tq/tqCommit.c
index f2f48bbc8a..8e59243a9c 100644
--- a/source/dnode/vnode/src/tq/tqCommit.c
+++ b/source/dnode/vnode/src/tq/tqCommit.c
@@ -12,3 +12,5 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+
+#include "vnodeInt.h"
diff --git a/source/dnode/vnode/src/tq/tqMetaStore.c b/source/dnode/vnode/src/tq/tqMetaStore.c
index 84f12f93c6..357917e0ba 100644
--- a/source/dnode/vnode/src/tq/tqMetaStore.c
+++ b/source/dnode/vnode/src/tq/tqMetaStore.c
@@ -14,13 +14,13 @@
*/
#include "vnodeInt.h"
// TODO:replace by an abstract file layer
-#include
-#include
-#include
-#include "osDir.h"
+// #include
+// #include
+// #include
+// #include "osDir.h"
#define TQ_META_NAME "tq.meta"
-#define TQ_IDX_NAME "tq.idx"
+#define TQ_IDX_NAME "tq.idx"
static int32_t tqHandlePutCommitted(STqMetaStore*, int64_t key, void* value);
static void* tqHandleGetUncommitted(STqMetaStore*, int64_t key);
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index c69f8ce09a..9282f7197e 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -13,8 +13,7 @@
* along with this program. If not, see .
*/
-#include "tdatablock.h"
-#include "vnode.h"
+#include "vnodeInt.h"
STqReadHandle* tqInitSubmitMsgScanner(SMeta* pMeta) {
STqReadHandle* pReadHandle = taosMemoryMalloc(sizeof(STqReadHandle));
@@ -88,7 +87,7 @@ int tqRetrieveDataBlockInfo(STqReadHandle* pHandle, SDataBlockInfo* pBlockInfo)
pBlockInfo->numOfCols = taosArrayGetSize(pHandle->pColIdList);
pBlockInfo->rows = pHandle->pBlock->numOfRows;
-// pBlockInfo->uid = pHandle->pBlock->uid; // the uid can not be assigned to pBlockData.
+ // pBlockInfo->uid = pHandle->pBlock->uid; // the uid can not be assigned to pBlockData.
return 0;
}
@@ -177,3 +176,41 @@ SArray* tqRetrieveDataBlock(STqReadHandle* pHandle) {
}
return pArray;
}
+
+void tqReadHandleSetColIdList(STqReadHandle* pReadHandle, SArray* pColIdList) { pReadHandle->pColIdList = pColIdList; }
+
+int tqReadHandleSetTbUidList(STqReadHandle* pHandle, const SArray* tbUidList) {
+ if (pHandle->tbIdHash) {
+ taosHashClear(pHandle->tbIdHash);
+ }
+
+ pHandle->tbIdHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
+ if (pHandle->tbIdHash == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return -1;
+ }
+
+ for (int i = 0; i < taosArrayGetSize(tbUidList); i++) {
+ int64_t* pKey = (int64_t*)taosArrayGet(tbUidList, i);
+ taosHashPut(pHandle->tbIdHash, pKey, sizeof(int64_t), NULL, 0);
+ }
+
+ return 0;
+}
+
+int tqReadHandleAddTbUidList(STqReadHandle* pHandle, const SArray* tbUidList) {
+ if (pHandle->tbIdHash == NULL) {
+ pHandle->tbIdHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
+ if (pHandle->tbIdHash == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return -1;
+ }
+ }
+
+ for (int i = 0; i < taosArrayGetSize(tbUidList); i++) {
+ int64_t* pKey = (int64_t*)taosArrayGet(tbUidList, i);
+ taosHashPut(pHandle->tbIdHash, pKey, sizeof(int64_t), NULL, 0);
+ }
+
+ return 0;
+}
diff --git a/source/dnode/vnode/src/tsdb/tsdbBDBImpl.c b/source/dnode/vnode/src/tsdb/tsdbBDBImpl.c
index 0deef2e4c9..acd9c2dcaa 100644
--- a/source/dnode/vnode/src/tsdb/tsdbBDBImpl.c
+++ b/source/dnode/vnode/src/tsdb/tsdbBDBImpl.c
@@ -16,9 +16,7 @@
#define ALLOW_FORBID_FUNC
#include "db.h"
-#include "taoserror.h"
-#include "tcoding.h"
-#include "thash.h"
+#include "vnodeInt.h"
#define IMPL_WITH_LOCK 1
@@ -139,7 +137,7 @@ int32_t tsdbSaveSmaToDB(SDBFile *pDBF, void *key, uint32_t keySize, void *data,
return 0;
}
-void *tsdbGetSmaDataByKey(SDBFile *pDBF, void* key, uint32_t keySize, uint32_t *valueSize) {
+void *tsdbGetSmaDataByKey(SDBFile *pDBF, void *key, uint32_t keySize, uint32_t *valueSize) {
void *result = NULL;
DBT key1 = {0};
DBT value1 = {0};
diff --git a/source/dnode/vnode/src/tsdb/tsdbFS.c b/source/dnode/vnode/src/tsdb/tsdbFS.c
index eff350ddda..bd3888864d 100644
--- a/source/dnode/vnode/src/tsdb/tsdbFS.c
+++ b/source/dnode/vnode/src/tsdb/tsdbFS.c
@@ -13,9 +13,7 @@
* along with this program. If not, see .
*/
-#include
#include "vnodeInt.h"
-#include "os.h"
typedef enum { TSDB_TXN_TEMP_FILE = 0, TSDB_TXN_CURR_FILE } TSDB_TXN_FILE_T;
static const char *tsdbTxnFname[] = {"current.t", "current"};
@@ -97,8 +95,8 @@ static int tsdbEncodeDFileSetArray(void **buf, SArray *pArray) {
return tlen;
}
-static void *tsdbDecodeDFileSetArray(STsdb*pRepo, void *buf, SArray *pArray) {
- uint64_t nset = 0;
+static void *tsdbDecodeDFileSetArray(STsdb *pRepo, void *buf, SArray *pArray) {
+ uint64_t nset = 0;
taosArrayClear(pArray);
@@ -122,7 +120,7 @@ static int tsdbEncodeFSStatus(void **buf, SFSStatus *pStatus) {
return tlen;
}
-static void *tsdbDecodeFSStatus(STsdb*pRepo, void *buf, SFSStatus *pStatus) {
+static void *tsdbDecodeFSStatus(STsdb *pRepo, void *buf, SFSStatus *pStatus) {
tsdbResetFSStatus(pStatus);
// pStatus->pmf = &(pStatus->mf);
@@ -407,8 +405,8 @@ int tsdbUpdateDFileSet(STsdbFS *pfs, const SDFileSet *pSet) { return tsdbAddDFil
static int tsdbSaveFSStatus(STsdb *pRepo, SFSStatus *pStatus) {
SFSHeader fsheader;
- void * pBuf = NULL;
- void * ptr;
+ void *pBuf = NULL;
+ void *ptr;
char hbuf[TSDB_FILE_HEAD_SIZE] = "\0";
char tfname[TSDB_FILENAME_LEN] = "\0";
char cfname[TSDB_FILENAME_LEN] = "\0";
@@ -592,7 +590,7 @@ void tsdbFSIterSeek(SFSIter *pIter, int fid) {
}
SDFileSet *tsdbFSIterNext(SFSIter *pIter) {
- STsdbFS * pfs = pIter->pfs;
+ STsdbFS *pfs = pIter->pfs;
SDFileSet *pSet;
if (pIter->index < 0) {
@@ -651,12 +649,12 @@ static void tsdbGetTxnFname(STsdb *pRepo, TSDB_TXN_FILE_T ftype, char fname[]) {
}
static int tsdbOpenFSFromCurrent(STsdb *pRepo) {
- STsdbFS * pfs = REPO_FS(pRepo);
+ STsdbFS *pfs = REPO_FS(pRepo);
TdFilePtr pFile = NULL;
- void * buffer = NULL;
+ void *buffer = NULL;
SFSHeader fsheader;
char current[TSDB_FILENAME_LEN] = "\0";
- void * ptr;
+ void *ptr;
tsdbGetTxnFname(pRepo, TSDB_TXN_CURR_FILE, current);
@@ -746,7 +744,7 @@ _err:
// Scan and try to fix incorrect files
static int tsdbScanAndTryFixFS(STsdb *pRepo) {
- STsdbFS * pfs = REPO_FS(pRepo);
+ STsdbFS *pfs = REPO_FS(pRepo);
SFSStatus *pStatus = pfs->cstatus;
// if (tsdbScanAndTryFixMFile(pRepo) < 0) {
@@ -908,9 +906,9 @@ static int tsdbScanAndTryFixFS(STsdb *pRepo) {
// }
static int tsdbScanRootDir(STsdb *pRepo) {
- char rootDir[TSDB_FILENAME_LEN];
- char bname[TSDB_FILENAME_LEN];
- STsdbFS * pfs = REPO_FS(pRepo);
+ char rootDir[TSDB_FILENAME_LEN];
+ char bname[TSDB_FILENAME_LEN];
+ STsdbFS *pfs = REPO_FS(pRepo);
const STfsFile *pf;
tsdbGetRootDir(REPO_ID(pRepo), rootDir);
@@ -942,9 +940,9 @@ static int tsdbScanRootDir(STsdb *pRepo) {
}
static int tsdbScanDataDir(STsdb *pRepo) {
- char dataDir[TSDB_FILENAME_LEN];
- char bname[TSDB_FILENAME_LEN];
- STsdbFS * pfs = REPO_FS(pRepo);
+ char dataDir[TSDB_FILENAME_LEN];
+ char bname[TSDB_FILENAME_LEN];
+ STsdbFS *pfs = REPO_FS(pRepo);
const STfsFile *pf;
tsdbGetDataDir(REPO_ID(pRepo), dataDir);
@@ -1107,14 +1105,14 @@ static bool tsdbIsTFileInFS(STsdbFS *pfs, const STfsFile *pf) {
// }
static int tsdbRestoreDFileSet(STsdb *pRepo) {
- char dataDir[TSDB_FILENAME_LEN];
- char bname[TSDB_FILENAME_LEN];
- STfsDir * tdir = NULL;
+ char dataDir[TSDB_FILENAME_LEN];
+ char bname[TSDB_FILENAME_LEN];
+ STfsDir *tdir = NULL;
const STfsFile *pf = NULL;
- const char * pattern = "^v[0-9]+f[0-9]+\\.(head|data|last|smad|smal)(-ver[0-9]+)?$";
- SArray * fArray = NULL;
- regex_t regex;
- STsdbFS * pfs = REPO_FS(pRepo);
+ const char *pattern = "^v[0-9]+f[0-9]+\\.(head|data|last|smad|smal)(-ver[0-9]+)?$";
+ SArray *fArray = NULL;
+ regex_t regex;
+ STsdbFS *pfs = REPO_FS(pRepo);
tsdbGetDataDir(REPO_ID(pRepo), dataDir);
@@ -1327,7 +1325,7 @@ static int tsdbComparTFILE(const void *arg1, const void *arg2) {
}
static void tsdbScanAndTryFixDFilesHeader(STsdb *pRepo, int32_t *nExpired) {
- STsdbFS * pfs = REPO_FS(pRepo);
+ STsdbFS *pfs = REPO_FS(pRepo);
SFSStatus *pStatus = pfs->cstatus;
SDFInfo info;
diff --git a/source/dnode/vnode/src/tsdb/tsdbOptions.c b/source/dnode/vnode/src/tsdb/tsdbOptions.c
index da7a1d393f..2c57a7406e 100644
--- a/source/dnode/vnode/src/tsdb/tsdbOptions.c
+++ b/source/dnode/vnode/src/tsdb/tsdbOptions.c
@@ -26,15 +26,6 @@ const STsdbCfg defautlTsdbOptions = {.precision = 0,
.update = 0,
.compression = TWO_STAGE_COMP};
-int tsdbOptionsInit(STsdbCfg *pTsdbOptions) {
- // TODO
- return 0;
-}
-
-void tsdbOptionsClear(STsdbCfg *pTsdbOptions) {
- // TODO
-}
-
int tsdbValidateOptions(const STsdbCfg *pTsdbOptions) {
// TODO
return 0;
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c
index 550e7cd183..9509dfa462 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead.c
@@ -13,18 +13,6 @@
* along with this program. If not, see .
*/
-#include "os.h"
-#include "talgo.h"
-#include "tcompare.h"
-#include "tdatablock.h"
-#include "tdataformat.h"
-#include "texception.h"
-#include "vnodeInt.h"
-
-#include "filter.h"
-#include "taosdef.h"
-#include "tlosertree.h"
-#include "tmsg.h"
#include "vnodeInt.h"
#define EXTRA_BYTES 2
diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c
index 4a70738e86..ef417cabc6 100644
--- a/source/dnode/vnode/src/vnd/vnodeCfg.c
+++ b/source/dnode/vnode/src/vnd/vnodeCfg.c
@@ -18,13 +18,6 @@
const SVnodeCfg defaultVnodeOptions = {
.wsize = 96 * 1024 * 1024, .ssize = 1 * 1024 * 1024, .lsize = 1024, .walCfg = {.level = TAOS_WAL_WRITE}}; /* TODO */
-void vnodeOptionsInit(SVnodeCfg *pVnodeOptions) { /* TODO */
- vnodeOptionsCopy(pVnodeOptions, &defaultVnodeOptions);
-}
-
-void vnodeOptionsClear(SVnodeCfg *pVnodeOptions) { /* TODO */
-}
-
int vnodeValidateOptions(const SVnodeCfg *pVnodeOptions) {
// TODO
return 0;
@@ -36,14 +29,14 @@ void vnodeOptionsCopy(SVnodeCfg *pDest, const SVnodeCfg *pSrc) {
int vnodeValidateTableHash(SVnodeCfg *pVnodeOptions, char *tableFName) {
uint32_t hashValue = 0;
-
+
switch (pVnodeOptions->hashMethod) {
default:
hashValue = MurmurHash3_32(tableFName, strlen(tableFName));
break;
}
- // TODO OPEN THIS !!!!!!!
+ // TODO OPEN THIS !!!!!!!
#if 0
if (hashValue < pVnodeOptions->hashBegin || hashValue > pVnodeOptions->hashEnd) {
terrno = TSDB_CODE_VND_HASH_MISMATCH;
@@ -53,5 +46,3 @@ int vnodeValidateTableHash(SVnodeCfg *pVnodeOptions, char *tableFName) {
return TSDB_CODE_SUCCESS;
}
-
-
diff --git a/source/dnode/vnode/src/vnd/vnodeInt.c b/source/dnode/vnode/src/vnd/vnodeInt.c
index 24294c4b58..270dc377b9 100644
--- a/source/dnode/vnode/src/vnd/vnodeInt.c
+++ b/source/dnode/vnode/src/vnd/vnodeInt.c
@@ -14,7 +14,6 @@
*/
#define _DEFAULT_SOURCE
-#include "sync.h"
#include "vnodeInt.h"
// #include "vnodeInt.h"
diff --git a/source/dnode/vnode/src/vnd/vnodeMgr.c b/source/dnode/vnode/src/vnd/vnodeMgr.c
index 40f43bcd12..df5e2ceffa 100644
--- a/source/dnode/vnode/src/vnd/vnodeMgr.c
+++ b/source/dnode/vnode/src/vnd/vnodeMgr.c
@@ -14,7 +14,6 @@
*/
#include "vnodeInt.h"
-#include "tglobal.h"
SVnodeMgr vnodeMgr = {.vnodeInitFlag = TD_MOD_UNINITIALIZED};
diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c
index f56ded9f15..87ce471de9 100644
--- a/source/dnode/vnode/src/vnd/vnodeQuery.c
+++ b/source/dnode/vnode/src/vnd/vnodeQuery.c
@@ -13,10 +13,8 @@
* along with this program. If not, see .
*/
-#include "executor.h"
#include "vnodeInt.h"
-static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg);
static int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg);
int vnodeQueryOpen(SVnode *pVnode) {
@@ -57,11 +55,6 @@ int vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
return qWorkerProcessCancelMsg(pVnode, pVnode->pQuery, pMsg);
case TDMT_VND_DROP_TASK:
return qWorkerProcessDropMsg(pVnode, pVnode->pQuery, pMsg);
- case TDMT_VND_SHOW_TABLES:
- return qWorkerProcessShowMsg(pVnode, pVnode->pQuery, pMsg);
- case TDMT_VND_SHOW_TABLES_FETCH:
- return vnodeGetTableList(pVnode, pMsg);
- // return qWorkerProcessShowFetchMsg(pVnode->pMeta, pVnode->pQuery, pMsg);
case TDMT_VND_TABLE_META:
return vnodeGetTableMeta(pVnode, pMsg);
case TDMT_VND_CONSUME:
@@ -207,74 +200,3 @@ _exit:
tmsgSendRsp(&rpcMsg);
return TSDB_CODE_SUCCESS;
}
-
-static void freeItemHelper(void *pItem) {
- char *p = *(char **)pItem;
- taosMemoryFree(p);
-}
-
-/**
- * @param pVnode
- * @param pMsg
- * @param pRsp
- */
-static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
- SMTbCursor *pCur = metaOpenTbCursor(pVnode->pMeta);
- SArray *pArray = taosArrayInit(10, POINTER_BYTES);
-
- char *name = NULL;
- int32_t totalLen = 0;
- int32_t numOfTables = 0;
- while ((name = metaTbCursorNext(pCur)) != NULL) {
- if (numOfTables < 10000) { // TODO: temp get tables of vnode, and should del when show tables commad ok.
- taosArrayPush(pArray, &name);
- totalLen += strlen(name);
- } else {
- taosMemoryFreeClear(name);
- }
-
- numOfTables++;
- }
-
- // TODO: temp debug, and should del when show tables command ok
- vInfo("====vgId:%d, numOfTables: %d", pVnode->vgId, numOfTables);
- if (numOfTables > 10000) {
- numOfTables = 10000;
- }
-
- metaCloseTbCursor(pCur);
-
- int32_t rowLen =
- (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE) + 8 + 2 + (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE) + 8 + 4;
- // int32_t numOfTables = (int32_t)taosArrayGetSize(pArray);
-
- int32_t payloadLen = rowLen * numOfTables;
- // SVShowTablesFetchReq *pFetchReq = pMsg->pCont;
-
- SVShowTablesFetchRsp *pFetchRsp = (SVShowTablesFetchRsp *)rpcMallocCont(sizeof(SVShowTablesFetchRsp) + payloadLen);
- memset(pFetchRsp, 0, sizeof(SVShowTablesFetchRsp) + payloadLen);
-
- char *p = pFetchRsp->data;
- for (int32_t i = 0; i < numOfTables; ++i) {
- char *n = taosArrayGetP(pArray, i);
- STR_TO_VARSTR(p, n);
-
- p += (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE);
- // taosMemoryFree(n);
- }
-
- pFetchRsp->numOfRows = htonl(numOfTables);
- pFetchRsp->precision = 0;
-
- SRpcMsg rpcMsg = {
- .handle = pMsg->handle,
- .ahandle = pMsg->ahandle,
- .pCont = pFetchRsp,
- .contLen = sizeof(SVShowTablesFetchRsp) + payloadLen,
- .code = 0,
- };
-
- tmsgSendRsp(&rpcMsg);
- taosArrayDestroyEx(pArray, freeItemHelper);
- return 0;
-}
diff --git a/source/dnode/vnode/src/vnd/vnodeWrite.c b/source/dnode/vnode/src/vnd/vnodeWrite.c
index 0449319dc2..24b5d4bae5 100644
--- a/source/dnode/vnode/src/vnd/vnodeWrite.c
+++ b/source/dnode/vnode/src/vnd/vnodeWrite.c
@@ -81,7 +81,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
// TODO: to encapsule a free API
taosMemoryFree(vCreateTbReq.stbCfg.pSchema);
taosMemoryFree(vCreateTbReq.stbCfg.pTagSchema);
- if(vCreateTbReq.stbCfg.pRSmaParam) {
+ if (vCreateTbReq.stbCfg.pRSmaParam) {
taosMemoryFree(vCreateTbReq.stbCfg.pRSmaParam->pFuncIds);
taosMemoryFree(vCreateTbReq.stbCfg.pRSmaParam);
}
@@ -235,13 +235,13 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
if (tsdbCreateTSma(pVnode->pTsdb, POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead))) < 0) {
// TODO
}
- // } break;
- // case TDMT_VND_CANCEL_SMA: { // timeRangeSMA
- // } break;
- // case TDMT_VND_DROP_SMA: { // timeRangeSMA
- // if (tsdbDropTSma(pVnode->pTsdb, POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead))) < 0) {
- // // TODO
- // }
+ // } break;
+ // case TDMT_VND_CANCEL_SMA: { // timeRangeSMA
+ // } break;
+ // case TDMT_VND_DROP_SMA: { // timeRangeSMA
+ // if (tsdbDropTSma(pVnode->pTsdb, POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead))) < 0) {
+ // // TODO
+ // }
#if 0
tsdbTSmaSub(pVnode->pTsdb, 1);
SVDropTSmaReq vDropSmaReq = {0};
diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h
index 37bc4b771f..cb787e77a6 100644
--- a/source/libs/executor/inc/executorimpl.h
+++ b/source/libs/executor/inc/executorimpl.h
@@ -451,13 +451,13 @@ typedef struct SSysTableScanInfo {
int32_t accountId;
bool showRewrite;
- SNode* pCondition; // db_name filter condition, to discard data that are not in current database
+ SNode *pCondition; // db_name filter condition, to discard data that are not in current database
void *pCur; // cursor for iterate the local table meta store.
SArray *scanCols; // SArray scan column id list
int32_t type; // show type, TODO remove it
SName name;
- SSDataBlock* pRes;
+ SSDataBlock *pRes;
int32_t capacity;
int64_t numOfBlocks; // extract basic running information.
SLoadRemoteDataInfo loadInfo;
diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c
index 0eac507822..68e70da976 100644
--- a/source/libs/executor/src/executorimpl.c
+++ b/source/libs/executor/src/executorimpl.c
@@ -4007,10 +4007,9 @@ static int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInf
return TSDB_CODE_SUCCESS;
}
-// TODO if only one or two columnss required, how to extract data?
-int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadInfo, int32_t numOfRows,
- char* pData, int32_t compLen, int32_t numOfOutput, int64_t startTs,
- uint64_t* total, SArray* pColList) {
+// TODO if only one or two columns required, how to extract data?
+int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadInfo, int32_t numOfRows, char* pData,
+ int32_t compLen, int32_t numOfOutput, int64_t startTs, uint64_t* total, SArray* pColList) {
blockDataEnsureCapacity(pRes, numOfRows);
if (pColList == NULL) { // data from other sources
@@ -4040,18 +4039,70 @@ int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadI
}
} else { // extract data according to pColList
ASSERT(numOfOutput == taosArrayGetSize(pColList));
+ char* pStart = pData;
+
+ int32_t numOfCols = htonl(*(int32_t*)pStart);
+ pStart += sizeof(int32_t);
+
+ SSysTableSchema* pSchema = (SSysTableSchema*)pStart;
+ for(int32_t i = 0; i < numOfCols; ++i) {
+ SSysTableSchema* p = (SSysTableSchema*)pStart;
+
+ p->colId = htons(p->colId);
+ p->bytes = htonl(p->bytes);
+ pStart += sizeof(SSysTableSchema);
+ }
+
+ SSDataBlock block = {.pDataBlock = taosArrayInit(numOfCols, sizeof(SColumnInfoData)), .info.numOfCols = numOfCols};
+ for(int32_t i = 0; i < numOfCols; ++i) {
+ SColumnInfoData idata = {0};
+ idata.info.type = pSchema[i].type;
+ idata.info.bytes = pSchema[i].bytes;
+ idata.info.colId = pSchema[i].colId;
+
+ taosArrayPush(block.pDataBlock, &idata);
+ if (IS_VAR_DATA_TYPE(idata.info.type)) {
+ block.info.hasVarCol = true;
+ }
+ }
+
+ blockDataEnsureCapacity(&block, numOfRows);
+
+ int32_t* colLen = (int32_t*) pStart;
+ pStart += sizeof(int32_t) * numOfCols;
+
+ for (int32_t i = 0; i < numOfCols; ++i) {
+ colLen[i] = htonl(colLen[i]);
+ ASSERT(colLen[i] >= 0);
+
+ SColumnInfoData* pColInfoData = taosArrayGet(block.pDataBlock, i);
+ if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
+ pColInfoData->varmeta.length = colLen[i];
+ pColInfoData->varmeta.allocLen = colLen[i];
+
+ memcpy(pColInfoData->varmeta.offset, pStart, sizeof(int32_t) * numOfRows);
+ pStart += sizeof(int32_t) * numOfRows;
+
+ pColInfoData->pData = taosMemoryMalloc(colLen[i]);
+ } else {
+ memcpy(pColInfoData->nullbitmap, pStart, BitmapLen(numOfRows));
+ pStart += BitmapLen(numOfRows);
+ }
+
+ memcpy(pColInfoData->pData, pStart, colLen[i]);
+ pStart += colLen[i];
+ }
// data from mnode
- for (int32_t i = 0; i < numOfOutput; ++i) {
+ for (int32_t i = 0; i < numOfCols; ++i) {
+ SColumnInfoData* pSrc = taosArrayGet(block.pDataBlock, i);
+
for (int32_t j = 0; j < numOfOutput; ++j) {
int16_t colIndex = *(int16_t*)taosArrayGet(pColList, j);
+
if (colIndex - 1 == i) {
SColumnInfoData* pColInfoData = taosArrayGet(pRes->pDataBlock, j);
-
- for (int32_t k = 0; k < numOfRows; ++k) {
- colDataAppend(pColInfoData, k, pData, false);
- pData += pColInfoData->info.bytes;
- }
+ colDataAssign(pColInfoData, pSrc, numOfRows);
break;
}
}
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index 3ce84077f1..f7f1d470bb 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -685,6 +685,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
int64_t startTs = taosGetTimestampUs();
+ _retry:
pInfo->req.type = pInfo->type;
strncpy(pInfo->req.tb, tNameGetTableName(&pInfo->name), tListLen(pInfo->req.tb));
if (pInfo->showRewrite) {
@@ -738,7 +739,12 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
setSDataBlockFromFetchRsp(pInfo->pRes, &pInfo->loadInfo, pTableRsp->numOfRows, pTableRsp->data, pTableRsp->compLen,
pOperator->numOfOutput, startTs, NULL, pInfo->scanCols);
- return doFilterResult(pInfo);
+ doFilterResult(pInfo);
+ if (pInfo->pRes->info.rows == 0) {
+ goto _retry;
+ }
+
+ return pInfo->pRes;
}
return NULL;
@@ -756,12 +762,12 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
return NULL;
}
- pInfo->accountId = accountId;
+ pInfo->accountId = accountId;
pInfo->showRewrite = showRewrite;
- pInfo->pRes = pResBlock;
- pInfo->capacity = 4096;
- pInfo->pCondition = pCondition;
- pInfo->scanCols = colList;
+ pInfo->pRes = pResBlock;
+ pInfo->capacity = 4096;
+ pInfo->pCondition = pCondition;
+ pInfo->scanCols = colList;
// TODO remove it
int32_t tableType = 0;
@@ -772,6 +778,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
tableType = TSDB_MGMT_TABLE_USER;
} else if (strncasecmp(name, TSDB_INS_TABLE_DNODES, tListLen(pName->tname)) == 0) {
tableType = TSDB_MGMT_TABLE_DNODE;
+ } else if (strncasecmp(name, TSDB_INS_TABLE_LICENCES, tListLen(pName->tname)) == 0) {
+ tableType = TSDB_MGMT_TABLE_GRANTS;
} else if (strncasecmp(name, TSDB_INS_TABLE_MNODES, tListLen(pName->tname)) == 0) {
tableType = TSDB_MGMT_TABLE_MNODE;
} else if (strncasecmp(name, TSDB_INS_TABLE_MODULES, tListLen(pName->tname)) == 0) {
@@ -796,6 +804,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
tableType = TSDB_MGMT_TABLE_VGROUP;
} else if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED, tListLen(pName->tname)) == 0) {
// tableType = TSDB_MGMT_TABLE_DIST;
+ } else if (strncasecmp(name, TSDB_INS_TABLE_CLUSTER, tListLen(pName->tname)) == 0) {
+ tableType = TSDB_MGMT_TABLE_CLUSTER;
} else {
ASSERT(0);
}
@@ -833,15 +843,15 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
#endif
}
- pOperator->name = "SysTableScanOperator";
+ pOperator->name = "SysTableScanOperator";
pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN;
pOperator->blockingOptr = false;
- pOperator->status = OP_NOT_OPENED;
- pOperator->info = pInfo;
- pOperator->numOfOutput = pResBlock->info.numOfCols;
- pOperator->getNextFn = doSysTableScan;
- pOperator->closeFn = destroySysScanOperator;
- pOperator->pTaskInfo = pTaskInfo;
+ pOperator->status = OP_NOT_OPENED;
+ pOperator->info = pInfo;
+ pOperator->numOfOutput = pResBlock->info.numOfCols;
+ pOperator->getNextFn = doSysTableScan;
+ pOperator->closeFn = destroySysScanOperator;
+ pOperator->pTaskInfo = pTaskInfo;
return pOperator;
}
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index 94aec0e744..12ae5819b4 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -588,6 +588,7 @@ column_reference(A) ::= column_name(B).
column_reference(A) ::= table_name(B) NK_DOT column_name(C). { A = createRawExprNodeExt(pCxt, &B, &C, createColumnNode(pCxt, &B, &C)); }
pseudo_column(A) ::= NOW(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
+pseudo_column(A) ::= TODAY(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= ROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= TBNAME(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= QSTARTTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 5c2f10f810..0493771b61 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -175,6 +175,7 @@ static SKeyword keywordTable[] = {
{"TBNAME", TK_TBNAME},
{"TIMESTAMP", TK_TIMESTAMP},
{"TINYINT", TK_TINYINT},
+ {"TODAY", TK_TODAY},
{"TOPIC", TK_TOPIC},
{"TOPICS", TK_TOPICS},
{"TSERIES", TK_TSERIES},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index b3947b872e..7919fcedd1 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -2363,7 +2363,6 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
break;
case QUERY_NODE_SHOW_APPS_STMT:
case QUERY_NODE_SHOW_CONNECTIONS_STMT:
- case QUERY_NODE_SHOW_LICENCE_STMT:
case QUERY_NODE_SHOW_QUERIES_STMT:
case QUERY_NODE_SHOW_SCORES_STMT:
case QUERY_NODE_SHOW_TOPICS_STMT:
@@ -2551,6 +2550,8 @@ static const char* getSysTableName(ENodeType type) {
return TSDB_INS_TABLE_BNODES;
case QUERY_NODE_SHOW_SNODES_STMT:
return TSDB_INS_TABLE_SNODES;
+ case QUERY_NODE_SHOW_LICENCE_STMT:
+ return TSDB_INS_TABLE_LICENCES;
default:
break;
}
@@ -3058,6 +3059,7 @@ static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) {
static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pQuery->pRoot)) {
+ case QUERY_NODE_SHOW_LICENCE_STMT:
case QUERY_NODE_SHOW_DATABASES_STMT:
case QUERY_NODE_SHOW_TABLES_STMT:
case QUERY_NODE_SHOW_STABLES_STMT:
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index 610f6b9263..b1f8a24a83 100644
--- a/source/libs/parser/src/sql.c
+++ b/source/libs/parser/src/sql.c
@@ -100,24 +100,24 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
-#define YYNOCODE 314
+#define YYNOCODE 315
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- ENullOrder yy69;
- SNode* yy140;
- EFillMode yy174;
- SAlterOption yy181;
- SNodeList* yy220;
- EJoinType yy224;
- EOrder yy238;
- SToken yy253;
- bool yy273;
- SDataType yy368;
- EOperatorType yy480;
- int32_t yy528;
+ SToken yy29;
+ bool yy47;
+ EFillMode yy144;
+ EJoinType yy162;
+ SNode* yy182;
+ EOrder yy218;
+ SNodeList* yy334;
+ EOperatorType yy380;
+ ENullOrder yy487;
+ SAlterOption yy515;
+ int32_t yy550;
+ SDataType yy574;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -133,16 +133,17 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYNSTATE 548
-#define YYNRULE 410
-#define YYNTOKEN 208
+#define YYNRULE 411
+#define YYNRULE_WITH_ACTION 411
+#define YYNTOKEN 209
#define YY_MAX_SHIFT 547
-#define YY_MIN_SHIFTREDUCE 807
-#define YY_MAX_SHIFTREDUCE 1216
-#define YY_ERROR_ACTION 1217
-#define YY_ACCEPT_ACTION 1218
-#define YY_NO_ACTION 1219
-#define YY_MIN_REDUCE 1220
-#define YY_MAX_REDUCE 1629
+#define YY_MIN_SHIFTREDUCE 808
+#define YY_MAX_SHIFTREDUCE 1218
+#define YY_ERROR_ACTION 1219
+#define YY_ACCEPT_ACTION 1220
+#define YY_NO_ACTION 1221
+#define YY_MIN_REDUCE 1222
+#define YY_MAX_REDUCE 1632
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -209,483 +210,483 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (1533)
+#define YY_ACTTAB_COUNT (1539)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 463, 25, 194, 52, 257, 306, 1497, 9, 8, 72,
- /* 10 */ 277, 388, 30, 28, 463, 274, 369, 1421, 1423, 270,
- /* 20 */ 266, 1481, 1052, 310, 1336, 1340, 396, 115, 1072, 1481,
- /* 30 */ 1514, 1497, 1481, 1477, 1483, 1342, 1608, 446, 1050, 1340,
- /* 40 */ 166, 1477, 1484, 391, 1477, 1483, 462, 449, 385, 131,
- /* 50 */ 11, 1468, 406, 1606, 165, 1514, 312, 1057, 29, 27,
- /* 60 */ 26, 348, 446, 30, 28, 1159, 463, 119, 1498, 1499,
- /* 70 */ 1503, 266, 449, 1052, 1, 72, 1468, 30, 28, 265,
- /* 80 */ 42, 1135, 375, 41, 462, 266, 238, 1052, 1497, 1050,
- /* 90 */ 1331, 1340, 229, 1498, 1499, 1503, 407, 544, 540, 539,
- /* 100 */ 1075, 11, 462, 1050, 450, 435, 1621, 269, 1057, 1051,
- /* 110 */ 1430, 463, 1514, 381, 380, 11, 30, 28, 430, 446,
- /* 120 */ 311, 117, 1057, 1232, 266, 1, 1052, 1608, 1608, 449,
- /* 130 */ 513, 511, 1243, 1468, 430, 1468, 1340, 1124, 12, 1,
- /* 140 */ 131, 1607, 1050, 100, 1606, 1606, 1053, 1318, 544, 70,
- /* 150 */ 1498, 1499, 1503, 1547, 420, 1128, 12, 1546, 1543, 100,
- /* 160 */ 1051, 1057, 544, 1056, 1076, 1077, 1103, 1104, 1105, 1106,
- /* 170 */ 1107, 1108, 1109, 1110, 1051, 463, 98, 1468, 7, 22,
- /* 180 */ 1242, 30, 28, 448, 319, 132, 128, 1554, 1555, 266,
- /* 190 */ 1559, 1052, 98, 132, 118, 132, 348, 1053, 1298, 1387,
- /* 200 */ 1340, 544, 129, 1554, 1555, 256, 1559, 1050, 425, 421,
- /* 210 */ 1385, 1053, 1074, 1051, 1056, 1076, 1077, 1103, 1104, 1105,
- /* 220 */ 1106, 1107, 1108, 1109, 1110, 1468, 1057, 1221, 1056, 1076,
- /* 230 */ 1077, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 305,
- /* 240 */ 844, 304, 843, 7, 1076, 1077, 9, 8, 84, 132,
- /* 250 */ 1053, 83, 82, 81, 80, 79, 78, 77, 76, 75,
- /* 260 */ 845, 32, 31, 29, 27, 26, 544, 1056, 1076, 1077,
- /* 270 */ 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1051, 132,
- /* 280 */ 424, 1418, 52, 30, 28, 237, 65, 1072, 139, 132,
- /* 290 */ 383, 266, 377, 1052, 327, 96, 382, 339, 1241, 97,
- /* 300 */ 101, 378, 376, 1335, 379, 216, 340, 1332, 1370, 1050,
- /* 310 */ 32, 31, 29, 27, 26, 1053, 84, 1566, 1154, 83,
- /* 320 */ 82, 81, 80, 79, 78, 77, 76, 75, 1057, 1220,
- /* 330 */ 334, 1183, 1056, 1076, 1077, 1103, 1104, 1105, 1106, 1107,
- /* 340 */ 1108, 1109, 1110, 1468, 1078, 7, 164, 445, 241, 137,
- /* 350 */ 372, 895, 498, 93, 92, 91, 90, 89, 88, 87,
- /* 360 */ 86, 85, 417, 1181, 1182, 1184, 1185, 501, 544, 1312,
- /* 370 */ 897, 1079, 374, 1091, 250, 50, 141, 140, 49, 338,
- /* 380 */ 1051, 1122, 333, 332, 331, 330, 329, 430, 326, 325,
- /* 390 */ 324, 323, 322, 318, 317, 316, 315, 314, 313, 463,
- /* 400 */ 164, 30, 28, 489, 372, 1561, 463, 450, 320, 266,
- /* 410 */ 1561, 1052, 100, 1431, 1387, 347, 251, 1053, 249, 248,
- /* 420 */ 271, 371, 1514, 1558, 1340, 1385, 374, 1050, 1557, 446,
- /* 430 */ 1123, 1340, 1215, 1216, 1056, 1076, 1077, 1103, 1104, 1105,
- /* 440 */ 1106, 1107, 1108, 1109, 1110, 98, 1057, 1269, 1127, 32,
- /* 450 */ 31, 29, 27, 26, 432, 127, 1554, 1555, 1317, 1559,
- /* 460 */ 1114, 423, 189, 1, 1073, 32, 31, 29, 27, 26,
- /* 470 */ 1561, 59, 24, 264, 1117, 1118, 1119, 1120, 1121, 1125,
- /* 480 */ 1126, 32, 31, 29, 27, 26, 544, 241, 1556, 175,
- /* 490 */ 1166, 157, 1333, 122, 155, 1158, 1074, 1240, 1051, 520,
- /* 500 */ 519, 518, 517, 281, 1380, 516, 515, 514, 102, 509,
- /* 510 */ 508, 507, 506, 505, 504, 503, 502, 108, 159, 209,
- /* 520 */ 1122, 158, 500, 494, 933, 486, 485, 484, 937, 483,
- /* 530 */ 939, 940, 482, 942, 479, 1053, 948, 476, 950, 951,
- /* 540 */ 473, 470, 1468, 1239, 1173, 496, 116, 1329, 1218, 1316,
- /* 550 */ 6, 222, 1056, 1076, 1077, 1103, 1104, 1105, 1106, 1107,
- /* 560 */ 1108, 1109, 1110, 220, 493, 492, 491, 21, 490, 1123,
- /* 570 */ 161, 437, 23, 160, 843, 1238, 142, 32, 31, 29,
- /* 580 */ 27, 26, 32, 31, 29, 27, 26, 1127, 1468, 115,
- /* 590 */ 367, 1325, 1213, 152, 1272, 1327, 125, 1343, 498, 463,
- /* 600 */ 463, 282, 365, 397, 361, 357, 353, 151, 1337, 460,
- /* 610 */ 1387, 24, 264, 1117, 1118, 1119, 1120, 1121, 1125, 1126,
- /* 620 */ 1468, 1422, 1323, 169, 1340, 1340, 297, 276, 447, 463,
- /* 630 */ 273, 272, 1608, 53, 1608, 115, 149, 1237, 461, 67,
- /* 640 */ 1065, 299, 1497, 1342, 1457, 131, 383, 131, 377, 1606,
- /* 650 */ 163, 1606, 382, 162, 1340, 97, 1058, 378, 376, 1212,
- /* 660 */ 379, 32, 31, 29, 27, 26, 1514, 48, 47, 309,
- /* 670 */ 1387, 136, 405, 446, 512, 1057, 303, 1157, 300, 1259,
- /* 680 */ 289, 1386, 1468, 449, 246, 1497, 295, 1468, 291, 287,
- /* 690 */ 133, 1154, 434, 148, 279, 121, 106, 145, 1497, 1236,
- /* 700 */ 409, 384, 115, 68, 1498, 1499, 1503, 1547, 488, 1514,
- /* 710 */ 1342, 240, 1543, 132, 143, 464, 433, 32, 31, 29,
- /* 720 */ 27, 26, 1514, 1608, 1091, 395, 449, 1061, 463, 446,
- /* 730 */ 1468, 1235, 1234, 1299, 441, 438, 131, 208, 393, 449,
- /* 740 */ 1606, 1497, 463, 1468, 1468, 1231, 69, 1498, 1499, 1503,
- /* 750 */ 1547, 280, 1387, 1340, 259, 1543, 126, 1254, 278, 119,
- /* 760 */ 1498, 1499, 1503, 1385, 1066, 1514, 547, 1340, 190, 436,
- /* 770 */ 430, 1233, 433, 1230, 413, 1574, 1468, 1468, 1060, 386,
- /* 780 */ 213, 1069, 449, 95, 1052, 1252, 1468, 1229, 1228, 536,
- /* 790 */ 1468, 532, 528, 524, 212, 100, 1227, 44, 1622, 1226,
- /* 800 */ 1050, 1180, 69, 1498, 1499, 1503, 1547, 389, 191, 178,
- /* 810 */ 259, 1543, 126, 180, 434, 1225, 1224, 418, 1468, 1057,
- /* 820 */ 66, 1223, 33, 206, 1497, 33, 1129, 1059, 98, 1087,
- /* 830 */ 343, 1575, 1468, 1468, 1488, 1381, 404, 64, 187, 1554,
- /* 840 */ 429, 1468, 428, 114, 1468, 1608, 1486, 61, 1514, 1063,
- /* 850 */ 44, 1497, 33, 459, 921, 446, 1019, 366, 131, 544,
- /* 860 */ 1468, 1468, 1606, 184, 1577, 449, 1468, 439, 442, 1468,
- /* 870 */ 197, 1051, 94, 104, 199, 1514, 455, 205, 1497, 106,
- /* 880 */ 1515, 412, 446, 926, 171, 69, 1498, 1499, 1503, 1547,
- /* 890 */ 431, 2, 449, 259, 1543, 1620, 1468, 193, 1062, 1036,
- /* 900 */ 1072, 168, 1514, 468, 1581, 869, 104, 954, 1053, 446,
- /* 910 */ 958, 284, 69, 1498, 1499, 1503, 1547, 288, 245, 449,
- /* 920 */ 259, 1543, 1620, 1468, 870, 1056, 105, 895, 1497, 247,
- /* 930 */ 964, 1604, 106, 104, 1028, 214, 963, 107, 321, 69,
- /* 940 */ 1498, 1499, 1503, 1547, 1420, 138, 328, 259, 1543, 1620,
- /* 950 */ 336, 335, 1514, 1497, 337, 1083, 341, 342, 1565, 446,
- /* 960 */ 1082, 344, 144, 1081, 345, 346, 1080, 147, 51, 449,
- /* 970 */ 349, 150, 368, 1468, 398, 399, 370, 1514, 434, 1330,
- /* 980 */ 1497, 154, 411, 400, 446, 1326, 255, 74, 401, 228,
- /* 990 */ 1498, 1499, 1503, 156, 449, 373, 109, 408, 1468, 110,
- /* 1000 */ 1328, 1324, 111, 112, 1514, 1079, 1497, 170, 173, 1608,
- /* 1010 */ 419, 446, 1588, 410, 70, 1498, 1499, 1503, 1547, 453,
- /* 1020 */ 1057, 449, 131, 1544, 5, 1468, 1606, 1578, 183, 176,
- /* 1030 */ 1514, 416, 1497, 1587, 179, 1568, 258, 446, 422, 427,
- /* 1040 */ 1497, 70, 1498, 1499, 1503, 1547, 415, 449, 1154, 444,
- /* 1050 */ 1543, 1468, 4, 99, 414, 1078, 1514, 1562, 34, 260,
- /* 1060 */ 443, 186, 440, 446, 1514, 17, 1429, 233, 1498, 1499,
- /* 1070 */ 1503, 446, 124, 449, 1497, 1529, 451, 1468, 185, 452,
- /* 1080 */ 456, 449, 203, 1428, 268, 1468, 201, 1497, 263, 58,
- /* 1090 */ 457, 458, 1341, 232, 1498, 1499, 1503, 1623, 1514, 1497,
- /* 1100 */ 192, 233, 1498, 1499, 1503, 446, 1605, 466, 215, 1313,
- /* 1110 */ 60, 1514, 495, 217, 211, 449, 543, 40, 446, 1468,
- /* 1120 */ 219, 223, 267, 1514, 224, 426, 221, 1462, 449, 1461,
- /* 1130 */ 446, 283, 1468, 1497, 1458, 233, 1498, 1499, 1503, 285,
- /* 1140 */ 449, 286, 1046, 1047, 1468, 134, 290, 1456, 225, 1498,
- /* 1150 */ 1499, 1503, 292, 293, 294, 1455, 296, 1514, 1454, 1497,
- /* 1160 */ 231, 1498, 1499, 1503, 446, 1445, 298, 135, 301, 302,
- /* 1170 */ 1031, 1030, 1439, 1438, 449, 307, 308, 1437, 1468, 103,
- /* 1180 */ 1002, 1413, 1412, 1514, 1436, 1497, 1411, 1410, 1409, 1408,
- /* 1190 */ 446, 1407, 1406, 1405, 234, 1498, 1499, 1503, 1404, 1403,
- /* 1200 */ 449, 1402, 1401, 1400, 1468, 1004, 1391, 1390, 1389, 1514,
- /* 1210 */ 1497, 1399, 1398, 1397, 1396, 1395, 446, 1394, 1393, 1392,
- /* 1220 */ 226, 1498, 1499, 1503, 1388, 1271, 449, 1453, 1447, 1435,
- /* 1230 */ 1468, 1426, 1319, 146, 1514, 1497, 862, 1270, 1268, 352,
- /* 1240 */ 1266, 446, 350, 356, 1497, 351, 235, 1498, 1499, 1503,
- /* 1250 */ 1264, 449, 1262, 360, 354, 1468, 355, 359, 1251, 1514,
- /* 1260 */ 358, 362, 363, 1250, 1247, 1321, 446, 969, 1514, 1320,
- /* 1270 */ 1260, 227, 1498, 1499, 1503, 446, 449, 364, 73, 1497,
- /* 1280 */ 1468, 971, 894, 252, 893, 449, 892, 891, 1255, 1468,
- /* 1290 */ 253, 888, 887, 1253, 387, 254, 236, 1498, 1499, 1503,
- /* 1300 */ 390, 1246, 392, 1514, 512, 1511, 1498, 1499, 1503, 1245,
- /* 1310 */ 446, 153, 510, 1497, 394, 71, 1452, 167, 43, 1038,
- /* 1320 */ 449, 1446, 113, 1434, 1468, 402, 1433, 1425, 172, 14,
- /* 1330 */ 54, 3, 403, 1486, 177, 37, 35, 1514, 33, 15,
- /* 1340 */ 1510, 1498, 1499, 1503, 446, 38, 1179, 1497, 10, 120,
- /* 1350 */ 181, 19, 188, 1172, 449, 182, 1497, 55, 1468, 56,
- /* 1360 */ 20, 1151, 1497, 1201, 8, 1150, 1206, 36, 130, 174,
- /* 1370 */ 123, 1514, 1200, 16, 243, 1498, 1499, 1503, 446, 261,
- /* 1380 */ 1514, 1315, 1205, 1204, 262, 195, 1514, 446, 449, 1089,
- /* 1390 */ 1497, 13, 1468, 446, 1088, 196, 18, 449, 1424, 1177,
- /* 1400 */ 202, 1468, 1115, 449, 198, 200, 45, 1468, 1509, 1498,
- /* 1410 */ 1499, 1503, 57, 61, 1514, 454, 1497, 244, 1498, 1499,
- /* 1420 */ 1503, 446, 1485, 242, 1498, 1499, 1503, 204, 207, 1067,
- /* 1430 */ 39, 449, 465, 955, 467, 1468, 952, 275, 469, 471,
- /* 1440 */ 1514, 472, 209, 949, 474, 475, 494, 446, 943, 477,
- /* 1450 */ 478, 239, 1498, 1499, 1503, 941, 480, 449, 481, 947,
- /* 1460 */ 932, 1468, 946, 62, 945, 944, 487, 966, 496, 46,
- /* 1470 */ 962, 63, 960, 860, 497, 499, 901, 230, 1498, 1499,
- /* 1480 */ 1503, 965, 883, 210, 882, 881, 880, 493, 492, 491,
- /* 1490 */ 879, 490, 878, 877, 876, 896, 898, 873, 872, 871,
- /* 1500 */ 868, 867, 866, 865, 1267, 521, 522, 1265, 1263, 523,
- /* 1510 */ 526, 525, 527, 529, 530, 1261, 534, 533, 1249, 531,
- /* 1520 */ 535, 537, 538, 1248, 1244, 541, 542, 1219, 1054, 1219,
- /* 1530 */ 546, 218, 545,
+ /* 0 */ 450, 257, 1483, 269, 25, 194, 1432, 117, 122, 1234,
+ /* 10 */ 312, 1331, 30, 28, 1479, 1486, 306, 1499, 1483, 1382,
+ /* 20 */ 266, 462, 1053, 21, 1075, 32, 31, 29, 27, 26,
+ /* 30 */ 1479, 1485, 23, 32, 31, 29, 27, 26, 1051, 274,
+ /* 40 */ 238, 1516, 32, 31, 29, 27, 26, 1611, 446, 1073,
+ /* 50 */ 11, 30, 28, 1161, 348, 406, 1483, 1058, 449, 266,
+ /* 60 */ 131, 1053, 1470, 1320, 1609, 30, 28, 434, 1479, 1485,
+ /* 70 */ 430, 9, 8, 266, 1, 1053, 463, 1051, 68, 1500,
+ /* 80 */ 1501, 1505, 1550, 540, 539, 72, 240, 1546, 1175, 11,
+ /* 90 */ 1499, 1051, 369, 424, 450, 100, 1058, 544, 1611, 407,
+ /* 100 */ 1433, 1342, 1261, 11, 32, 31, 29, 27, 26, 1052,
+ /* 110 */ 1058, 131, 348, 1, 1516, 1609, 32, 31, 29, 27,
+ /* 120 */ 26, 433, 118, 1389, 384, 277, 1300, 1, 98, 256,
+ /* 130 */ 1611, 449, 1423, 1425, 1387, 1470, 544, 432, 127, 1557,
+ /* 140 */ 1558, 270, 1562, 131, 498, 1137, 1054, 1609, 1052, 115,
+ /* 150 */ 544, 69, 1500, 1501, 1505, 1550, 845, 1344, 844, 259,
+ /* 160 */ 1546, 126, 1052, 1057, 1077, 1078, 1104, 1105, 1106, 1107,
+ /* 170 */ 1108, 1109, 1110, 1111, 1112, 164, 846, 381, 380, 372,
+ /* 180 */ 1578, 462, 1564, 1220, 84, 1054, 132, 83, 82, 81,
+ /* 190 */ 80, 79, 78, 77, 76, 75, 29, 27, 26, 1054,
+ /* 200 */ 1561, 374, 1057, 1077, 1078, 1104, 1105, 1106, 1107, 1108,
+ /* 210 */ 1109, 1110, 1111, 1112, 1319, 132, 1057, 1077, 1078, 1104,
+ /* 220 */ 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1318, 30,
+ /* 230 */ 28, 547, 305, 1564, 304, 12, 282, 266, 383, 1053,
+ /* 240 */ 377, 896, 132, 1215, 382, 213, 462, 97, 95, 378,
+ /* 250 */ 376, 1560, 379, 115, 536, 1051, 532, 528, 524, 212,
+ /* 260 */ 898, 1345, 32, 31, 29, 27, 26, 1611, 30, 28,
+ /* 270 */ 448, 1499, 463, 132, 1058, 209, 266, 498, 1053, 494,
+ /* 280 */ 131, 310, 30, 28, 1609, 66, 52, 1076, 206, 1074,
+ /* 290 */ 266, 7, 1053, 1333, 1051, 1516, 65, 1342, 1516, 96,
+ /* 300 */ 12, 496, 433, 1245, 334, 446, 463, 1337, 1051, 489,
+ /* 310 */ 101, 1214, 449, 1058, 544, 311, 1470, 1334, 459, 438,
+ /* 320 */ 493, 492, 491, 1185, 490, 1092, 1052, 1058, 513, 511,
+ /* 330 */ 7, 1342, 69, 1500, 1501, 1505, 1550, 423, 1470, 395,
+ /* 340 */ 259, 1546, 126, 1274, 7, 1222, 412, 132, 1470, 171,
+ /* 350 */ 141, 140, 393, 544, 190, 417, 1183, 1184, 1186, 1187,
+ /* 360 */ 413, 1577, 500, 1054, 1037, 1052, 168, 544, 1244, 93,
+ /* 370 */ 92, 91, 90, 89, 88, 87, 86, 85, 1327, 1052,
+ /* 380 */ 1057, 1077, 1078, 1104, 1105, 1106, 1107, 1108, 1109, 1110,
+ /* 390 */ 1111, 1112, 1079, 430, 1389, 383, 52, 377, 1611, 1329,
+ /* 400 */ 271, 382, 1054, 132, 97, 1387, 378, 376, 1243, 379,
+ /* 410 */ 1242, 1610, 405, 1470, 1241, 1609, 1054, 1338, 100, 1057,
+ /* 420 */ 1077, 1078, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111,
+ /* 430 */ 1112, 1077, 1078, 1057, 1077, 1078, 1104, 1105, 1106, 1107,
+ /* 440 */ 1108, 1109, 1110, 1111, 1112, 430, 30, 28, 237, 420,
+ /* 450 */ 1073, 98, 439, 1470, 266, 1470, 1053, 327, 59, 1470,
+ /* 460 */ 339, 128, 1557, 1558, 1420, 1562, 1080, 1160, 397, 340,
+ /* 470 */ 100, 139, 1051, 32, 31, 29, 27, 26, 437, 1335,
+ /* 480 */ 934, 486, 485, 484, 938, 483, 940, 941, 482, 943,
+ /* 490 */ 479, 1058, 949, 476, 951, 952, 473, 470, 1223, 1611,
+ /* 500 */ 1569, 1156, 1564, 98, 425, 421, 9, 8, 1, 463,
+ /* 510 */ 189, 241, 131, 129, 1557, 1558, 1609, 1562, 319, 84,
+ /* 520 */ 1559, 1240, 83, 82, 81, 80, 79, 78, 77, 76,
+ /* 530 */ 75, 544, 216, 1325, 1342, 1372, 1092, 32, 31, 29,
+ /* 540 */ 27, 26, 338, 1052, 1124, 333, 332, 331, 330, 329,
+ /* 550 */ 1239, 326, 325, 324, 323, 322, 318, 317, 316, 315,
+ /* 560 */ 314, 313, 1271, 137, 116, 463, 1470, 1238, 501, 222,
+ /* 570 */ 1314, 1389, 1389, 6, 320, 32, 31, 29, 27, 26,
+ /* 580 */ 1054, 220, 1424, 1388, 175, 1168, 169, 447, 1237, 50,
+ /* 590 */ 1342, 1075, 49, 1125, 142, 1470, 488, 1057, 1077, 1078,
+ /* 600 */ 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1235,
+ /* 610 */ 1236, 1129, 1470, 241, 520, 519, 518, 517, 281, 1233,
+ /* 620 */ 516, 515, 514, 102, 509, 508, 507, 506, 505, 504,
+ /* 630 */ 503, 502, 108, 1470, 1232, 1499, 24, 264, 1119, 1120,
+ /* 640 */ 1121, 1122, 1123, 1127, 1128, 463, 1124, 463, 1231, 463,
+ /* 650 */ 1159, 844, 276, 463, 72, 1470, 347, 67, 1339, 1516,
+ /* 660 */ 115, 375, 460, 114, 1470, 279, 446, 367, 1344, 1256,
+ /* 670 */ 1342, 870, 1342, 115, 1342, 463, 449, 436, 1342, 1470,
+ /* 680 */ 1470, 1344, 1230, 1229, 461, 48, 47, 309, 1499, 136,
+ /* 690 */ 871, 386, 463, 1470, 303, 1125, 119, 1500, 1501, 1505,
+ /* 700 */ 1342, 208, 246, 297, 295, 1389, 291, 287, 133, 1301,
+ /* 710 */ 512, 278, 1516, 1129, 300, 1156, 1387, 1342, 299, 446,
+ /* 720 */ 157, 1053, 463, 155, 1499, 1228, 1227, 1470, 1470, 449,
+ /* 730 */ 445, 280, 132, 1470, 435, 1624, 1126, 1051, 24, 264,
+ /* 740 */ 1119, 1120, 1121, 1122, 1123, 1127, 1128, 1342, 1516, 69,
+ /* 750 */ 1500, 1501, 1505, 1550, 1130, 446, 1058, 259, 1546, 1623,
+ /* 760 */ 1499, 1459, 1226, 152, 1225, 449, 125, 191, 1584, 1470,
+ /* 770 */ 1470, 1470, 365, 343, 361, 357, 353, 151, 159, 22,
+ /* 780 */ 161, 158, 418, 160, 1516, 69, 1500, 1501, 1505, 1550,
+ /* 790 */ 1254, 446, 441, 259, 1546, 1623, 544, 289, 1217, 1218,
+ /* 800 */ 1383, 449, 250, 53, 1607, 1470, 149, 1470, 1052, 1470,
+ /* 810 */ 1499, 163, 389, 106, 162, 44, 178, 409, 404, 1182,
+ /* 820 */ 180, 69, 1500, 1501, 1505, 1550, 1490, 184, 164, 259,
+ /* 830 */ 1546, 1623, 372, 366, 1516, 33, 1580, 1499, 1488, 1131,
+ /* 840 */ 1568, 446, 431, 1116, 251, 1054, 249, 248, 1061, 371,
+ /* 850 */ 1517, 449, 1499, 33, 374, 1470, 193, 1088, 1073, 1060,
+ /* 860 */ 434, 1516, 1057, 148, 2, 121, 33, 145, 446, 284,
+ /* 870 */ 1020, 228, 1500, 1501, 1505, 288, 1516, 197, 449, 1499,
+ /* 880 */ 245, 199, 1470, 446, 143, 94, 273, 272, 104, 455,
+ /* 890 */ 896, 1611, 205, 449, 247, 1029, 1066, 1470, 70, 1500,
+ /* 900 */ 1501, 1505, 1550, 1516, 131, 321, 1549, 1546, 1609, 214,
+ /* 910 */ 446, 1422, 1059, 70, 1500, 1501, 1505, 1550, 64, 1064,
+ /* 920 */ 449, 444, 1546, 430, 1470, 106, 328, 442, 61, 927,
+ /* 930 */ 1063, 1058, 44, 468, 104, 138, 922, 955, 959, 336,
+ /* 940 */ 70, 1500, 1501, 1505, 1550, 335, 105, 337, 100, 1547,
+ /* 950 */ 965, 1084, 341, 106, 104, 1499, 342, 964, 107, 1083,
+ /* 960 */ 144, 345, 344, 1082, 346, 349, 147, 434, 51, 150,
+ /* 970 */ 1081, 464, 368, 370, 1332, 154, 373, 1328, 74, 1516,
+ /* 980 */ 399, 98, 1499, 1062, 400, 401, 446, 255, 408, 156,
+ /* 990 */ 1499, 187, 1557, 429, 170, 428, 449, 173, 1611, 109,
+ /* 1000 */ 1470, 110, 1330, 265, 1326, 111, 1516, 112, 1080, 411,
+ /* 1010 */ 419, 131, 1591, 446, 1516, 1609, 229, 1500, 1501, 1505,
+ /* 1020 */ 1067, 446, 398, 449, 410, 453, 1058, 1470, 1581, 416,
+ /* 1030 */ 414, 449, 176, 179, 1499, 1470, 5, 1070, 1590, 415,
+ /* 1040 */ 258, 422, 427, 233, 1500, 1501, 1505, 4, 99, 1079,
+ /* 1050 */ 1571, 232, 1500, 1501, 1505, 185, 183, 1156, 1516, 124,
+ /* 1060 */ 1565, 34, 443, 260, 17, 446, 1431, 1532, 1499, 186,
+ /* 1070 */ 440, 1430, 456, 457, 60, 449, 1499, 451, 458, 1470,
+ /* 1080 */ 452, 1499, 268, 426, 201, 203, 1343, 466, 58, 221,
+ /* 1090 */ 1626, 1315, 1516, 211, 192, 119, 1500, 1501, 1505, 446,
+ /* 1100 */ 1516, 1608, 215, 495, 217, 1516, 543, 446, 223, 449,
+ /* 1110 */ 40, 1464, 446, 1470, 224, 219, 263, 449, 1463, 283,
+ /* 1120 */ 1460, 1470, 449, 1499, 267, 285, 1470, 1047, 1499, 233,
+ /* 1130 */ 1500, 1501, 1505, 388, 1625, 286, 1499, 233, 1500, 1501,
+ /* 1140 */ 1505, 1048, 225, 1500, 1501, 1505, 290, 1516, 396, 1458,
+ /* 1150 */ 134, 294, 1516, 292, 446, 293, 1457, 296, 1456, 446,
+ /* 1160 */ 1516, 298, 166, 1447, 449, 391, 135, 446, 1470, 449,
+ /* 1170 */ 385, 301, 302, 1470, 1317, 1441, 165, 449, 1032, 1031,
+ /* 1180 */ 1499, 1470, 1440, 307, 231, 1500, 1501, 1505, 308, 234,
+ /* 1190 */ 1500, 1501, 1505, 1439, 1438, 1499, 1003, 226, 1500, 1501,
+ /* 1200 */ 1505, 1415, 42, 1414, 1516, 41, 1499, 1413, 1412, 1411,
+ /* 1210 */ 1410, 446, 1409, 1408, 1407, 1406, 1405, 1404, 1403, 1516,
+ /* 1220 */ 1402, 449, 1401, 1400, 103, 1470, 446, 1399, 1398, 1397,
+ /* 1230 */ 1516, 1499, 1396, 1395, 1394, 209, 449, 446, 1393, 494,
+ /* 1240 */ 1470, 235, 1500, 1501, 1505, 1392, 1005, 449, 1391, 1390,
+ /* 1250 */ 1273, 1470, 1455, 1449, 1437, 1516, 227, 1500, 1501, 1505,
+ /* 1260 */ 1428, 496, 446, 1321, 146, 1499, 1272, 236, 1500, 1501,
+ /* 1270 */ 1505, 1270, 449, 350, 352, 351, 1470, 863, 1499, 1268,
+ /* 1280 */ 493, 492, 491, 356, 490, 354, 1266, 355, 1264, 1516,
+ /* 1290 */ 1253, 359, 1513, 1500, 1501, 1505, 446, 358, 1252, 360,
+ /* 1300 */ 362, 363, 1516, 1249, 364, 1323, 449, 972, 73, 446,
+ /* 1310 */ 1470, 153, 1499, 512, 970, 1322, 895, 510, 894, 449,
+ /* 1320 */ 1499, 893, 892, 1470, 1262, 1499, 1512, 1500, 1501, 1505,
+ /* 1330 */ 252, 889, 888, 1257, 253, 387, 1516, 1255, 254, 243,
+ /* 1340 */ 1500, 1501, 1505, 446, 1516, 390, 1248, 392, 1247, 1516,
+ /* 1350 */ 394, 446, 71, 449, 1454, 167, 446, 1470, 1039, 1448,
+ /* 1360 */ 402, 449, 113, 1436, 1435, 1470, 449, 1499, 1427, 54,
+ /* 1370 */ 1470, 123, 1499, 1511, 1500, 1501, 1505, 172, 14, 43,
+ /* 1380 */ 3, 244, 1500, 1501, 1505, 33, 242, 1500, 1501, 1505,
+ /* 1390 */ 38, 1516, 177, 1181, 15, 403, 1516, 120, 446, 1488,
+ /* 1400 */ 174, 181, 37, 446, 19, 56, 1174, 182, 449, 55,
+ /* 1410 */ 20, 1203, 1470, 449, 36, 1153, 1152, 1470, 16, 1208,
+ /* 1420 */ 1202, 35, 261, 1207, 1206, 262, 8, 13, 239, 1500,
+ /* 1430 */ 1501, 1505, 1090, 230, 1500, 1501, 1505, 188, 130, 1117,
+ /* 1440 */ 1089, 195, 196, 18, 1426, 1179, 198, 454, 10, 200,
+ /* 1450 */ 45, 202, 57, 1068, 204, 61, 956, 39, 467, 275,
+ /* 1460 */ 1487, 471, 469, 207, 465, 953, 472, 474, 950, 475,
+ /* 1470 */ 477, 944, 478, 480, 942, 933, 481, 62, 967, 948,
+ /* 1480 */ 46, 63, 961, 963, 487, 861, 497, 902, 947, 499,
+ /* 1490 */ 946, 877, 884, 945, 883, 882, 210, 881, 899, 880,
+ /* 1500 */ 879, 878, 897, 874, 873, 872, 869, 1269, 868, 966,
+ /* 1510 */ 867, 866, 521, 522, 523, 1267, 525, 526, 527, 1265,
+ /* 1520 */ 529, 530, 531, 1263, 533, 534, 535, 1251, 537, 538,
+ /* 1530 */ 1250, 1246, 541, 542, 1221, 1055, 218, 545, 546,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 217, 277, 278, 219, 239, 261, 211, 1, 2, 226,
- /* 10 */ 244, 4, 12, 13, 217, 239, 233, 251, 252, 227,
- /* 20 */ 20, 256, 22, 226, 240, 242, 19, 235, 20, 256,
- /* 30 */ 235, 211, 256, 268, 269, 243, 292, 242, 38, 242,
- /* 40 */ 33, 268, 269, 36, 268, 269, 20, 252, 41, 305,
- /* 50 */ 50, 256, 217, 309, 47, 235, 217, 57, 14, 15,
- /* 60 */ 16, 49, 242, 12, 13, 14, 217, 272, 273, 274,
- /* 70 */ 275, 20, 252, 22, 74, 226, 256, 12, 13, 259,
- /* 80 */ 73, 75, 233, 76, 20, 20, 247, 22, 211, 38,
- /* 90 */ 211, 242, 272, 273, 274, 275, 261, 97, 214, 215,
- /* 100 */ 20, 50, 20, 38, 252, 310, 311, 255, 57, 109,
- /* 110 */ 258, 217, 235, 221, 222, 50, 12, 13, 217, 242,
- /* 120 */ 226, 210, 57, 212, 20, 74, 22, 292, 292, 252,
- /* 130 */ 221, 222, 211, 256, 217, 256, 242, 132, 74, 74,
- /* 140 */ 305, 305, 38, 242, 309, 309, 146, 0, 97, 272,
- /* 150 */ 273, 274, 275, 276, 136, 150, 74, 280, 281, 242,
- /* 160 */ 109, 57, 97, 163, 164, 165, 166, 167, 168, 169,
- /* 170 */ 170, 171, 172, 173, 109, 217, 275, 256, 74, 174,
- /* 180 */ 211, 12, 13, 14, 226, 185, 285, 286, 287, 20,
- /* 190 */ 289, 22, 275, 185, 220, 185, 49, 146, 224, 235,
- /* 200 */ 242, 97, 285, 286, 287, 241, 289, 38, 190, 191,
- /* 210 */ 246, 146, 20, 109, 163, 164, 165, 166, 167, 168,
- /* 220 */ 169, 170, 171, 172, 173, 256, 57, 0, 163, 164,
- /* 230 */ 165, 166, 167, 168, 169, 170, 171, 172, 173, 145,
- /* 240 */ 20, 147, 22, 74, 164, 165, 1, 2, 21, 185,
- /* 250 */ 146, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- /* 260 */ 40, 12, 13, 14, 15, 16, 97, 163, 164, 165,
- /* 270 */ 166, 167, 168, 169, 170, 171, 172, 173, 109, 185,
- /* 280 */ 20, 242, 219, 12, 13, 18, 216, 20, 249, 185,
- /* 290 */ 52, 20, 54, 22, 27, 232, 58, 30, 211, 61,
- /* 300 */ 230, 63, 64, 240, 66, 228, 39, 237, 231, 38,
- /* 310 */ 12, 13, 14, 15, 16, 146, 21, 183, 184, 24,
- /* 320 */ 25, 26, 27, 28, 29, 30, 31, 32, 57, 0,
- /* 330 */ 67, 163, 163, 164, 165, 166, 167, 168, 169, 170,
- /* 340 */ 171, 172, 173, 256, 20, 74, 61, 50, 50, 47,
- /* 350 */ 65, 38, 49, 24, 25, 26, 27, 28, 29, 30,
- /* 360 */ 31, 32, 194, 195, 196, 197, 198, 223, 97, 225,
- /* 370 */ 57, 20, 87, 75, 35, 73, 113, 114, 76, 112,
- /* 380 */ 109, 83, 115, 116, 117, 118, 119, 217, 121, 122,
- /* 390 */ 123, 124, 125, 126, 127, 128, 129, 130, 131, 217,
- /* 400 */ 61, 12, 13, 85, 65, 270, 217, 252, 226, 20,
- /* 410 */ 270, 22, 242, 258, 235, 226, 77, 146, 79, 80,
- /* 420 */ 241, 82, 235, 288, 242, 246, 87, 38, 288, 242,
- /* 430 */ 132, 242, 164, 165, 163, 164, 165, 166, 167, 168,
- /* 440 */ 169, 170, 171, 172, 173, 275, 57, 0, 150, 12,
- /* 450 */ 13, 14, 15, 16, 284, 285, 286, 287, 0, 289,
- /* 460 */ 163, 274, 138, 74, 20, 12, 13, 14, 15, 16,
- /* 470 */ 270, 216, 174, 175, 176, 177, 178, 179, 180, 181,
- /* 480 */ 182, 12, 13, 14, 15, 16, 97, 50, 288, 138,
- /* 490 */ 14, 78, 237, 234, 81, 4, 20, 211, 109, 52,
- /* 500 */ 53, 54, 55, 56, 245, 58, 59, 60, 61, 62,
- /* 510 */ 63, 64, 65, 66, 67, 68, 69, 70, 78, 61,
- /* 520 */ 83, 81, 57, 65, 88, 89, 90, 91, 92, 93,
- /* 530 */ 94, 95, 96, 97, 98, 146, 100, 101, 102, 103,
- /* 540 */ 104, 105, 256, 211, 75, 87, 18, 236, 208, 0,
- /* 550 */ 43, 23, 163, 164, 165, 166, 167, 168, 169, 170,
- /* 560 */ 171, 172, 173, 35, 106, 107, 108, 2, 110, 132,
- /* 570 */ 78, 3, 2, 81, 22, 211, 48, 12, 13, 14,
- /* 580 */ 15, 16, 12, 13, 14, 15, 16, 150, 256, 235,
- /* 590 */ 38, 236, 139, 33, 0, 236, 36, 243, 49, 217,
- /* 600 */ 217, 261, 42, 261, 44, 45, 46, 47, 226, 226,
- /* 610 */ 235, 174, 175, 176, 177, 178, 179, 180, 181, 182,
- /* 620 */ 256, 246, 236, 236, 242, 242, 142, 227, 236, 217,
- /* 630 */ 12, 13, 292, 73, 292, 235, 76, 211, 226, 111,
- /* 640 */ 22, 157, 211, 243, 0, 305, 52, 305, 54, 309,
- /* 650 */ 78, 309, 58, 81, 242, 61, 38, 63, 64, 206,
- /* 660 */ 66, 12, 13, 14, 15, 16, 235, 139, 140, 141,
- /* 670 */ 235, 143, 264, 242, 71, 57, 148, 186, 75, 0,
- /* 680 */ 36, 246, 256, 252, 156, 211, 158, 256, 160, 161,
- /* 690 */ 162, 184, 261, 133, 227, 135, 71, 137, 211, 211,
- /* 700 */ 75, 22, 235, 272, 273, 274, 275, 276, 236, 235,
- /* 710 */ 243, 280, 281, 185, 154, 97, 242, 12, 13, 14,
- /* 720 */ 15, 16, 235, 292, 75, 21, 252, 109, 217, 242,
- /* 730 */ 256, 211, 211, 224, 71, 71, 305, 226, 34, 252,
- /* 740 */ 309, 211, 217, 256, 256, 211, 272, 273, 274, 275,
- /* 750 */ 276, 226, 235, 242, 280, 281, 282, 0, 241, 272,
- /* 760 */ 273, 274, 275, 246, 146, 235, 19, 242, 294, 201,
- /* 770 */ 217, 212, 242, 211, 300, 301, 256, 256, 38, 22,
- /* 780 */ 33, 163, 252, 36, 22, 0, 256, 211, 211, 42,
- /* 790 */ 256, 44, 45, 46, 47, 242, 211, 71, 311, 211,
- /* 800 */ 38, 75, 272, 273, 274, 275, 276, 22, 312, 71,
- /* 810 */ 280, 281, 282, 75, 261, 211, 211, 303, 256, 57,
- /* 820 */ 73, 211, 71, 76, 211, 71, 75, 38, 275, 75,
- /* 830 */ 252, 301, 256, 256, 74, 245, 252, 74, 285, 286,
- /* 840 */ 287, 256, 289, 138, 256, 292, 86, 84, 235, 109,
- /* 850 */ 71, 211, 71, 106, 75, 242, 75, 214, 305, 97,
- /* 860 */ 256, 256, 309, 297, 271, 252, 256, 203, 205, 256,
- /* 870 */ 71, 109, 71, 71, 75, 235, 75, 75, 211, 71,
- /* 880 */ 235, 134, 242, 75, 137, 272, 273, 274, 275, 276,
- /* 890 */ 290, 293, 252, 280, 281, 282, 256, 306, 109, 152,
- /* 900 */ 20, 154, 235, 71, 291, 38, 71, 75, 146, 242,
- /* 910 */ 75, 217, 272, 273, 274, 275, 276, 36, 267, 252,
- /* 920 */ 280, 281, 282, 256, 57, 163, 71, 38, 211, 221,
- /* 930 */ 75, 291, 71, 71, 144, 262, 75, 75, 217, 272,
- /* 940 */ 273, 274, 275, 276, 217, 120, 250, 280, 281, 282,
- /* 950 */ 132, 248, 235, 211, 248, 20, 217, 266, 291, 242,
- /* 960 */ 20, 260, 219, 20, 242, 253, 20, 219, 219, 252,
- /* 970 */ 217, 219, 213, 256, 242, 266, 235, 235, 261, 235,
- /* 980 */ 211, 235, 253, 153, 242, 235, 213, 217, 265, 272,
- /* 990 */ 273, 274, 275, 235, 252, 221, 235, 260, 256, 235,
- /* 1000 */ 235, 235, 235, 235, 235, 20, 211, 216, 216, 292,
- /* 1010 */ 193, 242, 302, 242, 272, 273, 274, 275, 276, 192,
- /* 1020 */ 57, 252, 305, 281, 200, 256, 309, 271, 298, 257,
- /* 1030 */ 235, 256, 211, 302, 257, 299, 256, 242, 256, 199,
- /* 1040 */ 211, 272, 273, 274, 275, 276, 188, 252, 184, 280,
- /* 1050 */ 281, 256, 187, 242, 259, 20, 235, 270, 120, 207,
- /* 1060 */ 204, 283, 202, 242, 235, 74, 257, 272, 273, 274,
- /* 1070 */ 275, 242, 296, 252, 211, 279, 256, 256, 295, 256,
- /* 1080 */ 135, 252, 216, 257, 256, 256, 242, 211, 259, 216,
- /* 1090 */ 254, 253, 242, 272, 273, 274, 275, 313, 235, 211,
- /* 1100 */ 307, 272, 273, 274, 275, 242, 308, 238, 231, 225,
- /* 1110 */ 74, 235, 221, 217, 216, 252, 213, 263, 242, 256,
- /* 1120 */ 218, 229, 259, 235, 229, 304, 209, 0, 252, 0,
- /* 1130 */ 242, 64, 256, 211, 0, 272, 273, 274, 275, 38,
- /* 1140 */ 252, 159, 38, 38, 256, 38, 159, 0, 272, 273,
- /* 1150 */ 274, 275, 38, 38, 159, 0, 38, 235, 0, 211,
- /* 1160 */ 272, 273, 274, 275, 242, 0, 38, 74, 150, 149,
- /* 1170 */ 109, 146, 0, 0, 252, 53, 142, 0, 256, 120,
- /* 1180 */ 86, 0, 0, 235, 0, 211, 0, 0, 0, 0,
- /* 1190 */ 242, 0, 0, 0, 272, 273, 274, 275, 0, 0,
- /* 1200 */ 252, 0, 0, 0, 256, 22, 0, 0, 0, 235,
- /* 1210 */ 211, 0, 0, 0, 0, 0, 242, 0, 0, 0,
- /* 1220 */ 272, 273, 274, 275, 0, 0, 252, 0, 0, 0,
- /* 1230 */ 256, 0, 0, 43, 235, 211, 51, 0, 0, 43,
- /* 1240 */ 0, 242, 38, 43, 211, 36, 272, 273, 274, 275,
- /* 1250 */ 0, 252, 0, 43, 38, 256, 36, 36, 0, 235,
- /* 1260 */ 38, 38, 36, 0, 0, 0, 242, 22, 235, 0,
- /* 1270 */ 0, 272, 273, 274, 275, 242, 252, 43, 83, 211,
- /* 1280 */ 256, 38, 38, 22, 38, 252, 38, 38, 0, 256,
- /* 1290 */ 22, 38, 38, 0, 39, 22, 272, 273, 274, 275,
- /* 1300 */ 38, 0, 22, 235, 71, 272, 273, 274, 275, 0,
- /* 1310 */ 242, 81, 71, 211, 22, 20, 0, 155, 138, 38,
- /* 1320 */ 252, 0, 151, 0, 256, 22, 0, 0, 43, 189,
- /* 1330 */ 74, 71, 138, 86, 75, 138, 183, 235, 71, 189,
- /* 1340 */ 272, 273, 274, 275, 242, 71, 75, 211, 189, 74,
- /* 1350 */ 74, 74, 86, 75, 252, 71, 211, 74, 256, 4,
- /* 1360 */ 71, 75, 211, 38, 2, 75, 75, 71, 86, 133,
- /* 1370 */ 135, 235, 38, 71, 272, 273, 274, 275, 242, 38,
- /* 1380 */ 235, 0, 38, 38, 38, 86, 235, 242, 252, 75,
- /* 1390 */ 211, 74, 256, 242, 75, 75, 74, 252, 0, 75,
- /* 1400 */ 43, 256, 163, 252, 74, 74, 74, 256, 272, 273,
- /* 1410 */ 274, 275, 74, 84, 235, 136, 211, 272, 273, 274,
- /* 1420 */ 275, 242, 86, 272, 273, 274, 275, 133, 86, 22,
- /* 1430 */ 74, 252, 85, 75, 38, 256, 75, 38, 74, 38,
- /* 1440 */ 235, 74, 61, 75, 38, 74, 65, 242, 75, 38,
- /* 1450 */ 74, 272, 273, 274, 275, 75, 38, 252, 74, 99,
- /* 1460 */ 22, 256, 99, 74, 99, 99, 87, 38, 87, 74,
- /* 1470 */ 38, 74, 22, 51, 50, 72, 57, 272, 273, 274,
- /* 1480 */ 275, 109, 38, 71, 38, 38, 38, 106, 107, 108,
- /* 1490 */ 38, 110, 38, 38, 22, 38, 57, 38, 38, 38,
- /* 1500 */ 38, 38, 38, 38, 0, 38, 36, 0, 0, 43,
- /* 1510 */ 36, 38, 43, 38, 36, 0, 36, 38, 0, 43,
- /* 1520 */ 43, 38, 37, 0, 0, 22, 21, 314, 22, 314,
- /* 1530 */ 20, 22, 21, 314, 314, 314, 314, 314, 314, 314,
- /* 1540 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1550 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1560 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1570 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1580 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1590 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1600 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1610 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1620 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1630 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1640 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1650 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1660 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1670 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1680 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1690 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1700 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1710 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1720 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1730 */ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
- /* 1740 */ 314,
+ /* 0 */ 253, 240, 257, 256, 278, 279, 259, 211, 235, 213,
+ /* 10 */ 218, 237, 12, 13, 269, 270, 262, 212, 257, 246,
+ /* 20 */ 20, 20, 22, 2, 20, 12, 13, 14, 15, 16,
+ /* 30 */ 269, 270, 2, 12, 13, 14, 15, 16, 38, 240,
+ /* 40 */ 248, 236, 12, 13, 14, 15, 16, 293, 243, 20,
+ /* 50 */ 50, 12, 13, 14, 49, 218, 257, 57, 253, 20,
+ /* 60 */ 306, 22, 257, 0, 310, 12, 13, 262, 269, 270,
+ /* 70 */ 218, 1, 2, 20, 74, 22, 218, 38, 273, 274,
+ /* 80 */ 275, 276, 277, 215, 216, 227, 281, 282, 75, 50,
+ /* 90 */ 212, 38, 234, 20, 253, 243, 57, 97, 293, 262,
+ /* 100 */ 259, 243, 0, 50, 12, 13, 14, 15, 16, 109,
+ /* 110 */ 57, 306, 49, 74, 236, 310, 12, 13, 14, 15,
+ /* 120 */ 16, 243, 221, 236, 22, 245, 225, 74, 276, 242,
+ /* 130 */ 293, 253, 252, 253, 247, 257, 97, 285, 286, 287,
+ /* 140 */ 288, 228, 290, 306, 49, 75, 146, 310, 109, 236,
+ /* 150 */ 97, 273, 274, 275, 276, 277, 20, 244, 22, 281,
+ /* 160 */ 282, 283, 109, 163, 164, 165, 166, 167, 168, 169,
+ /* 170 */ 170, 171, 172, 173, 174, 61, 40, 222, 223, 65,
+ /* 180 */ 302, 20, 271, 209, 21, 146, 186, 24, 25, 26,
+ /* 190 */ 27, 28, 29, 30, 31, 32, 14, 15, 16, 146,
+ /* 200 */ 289, 87, 163, 164, 165, 166, 167, 168, 169, 170,
+ /* 210 */ 171, 172, 173, 174, 0, 186, 163, 164, 165, 166,
+ /* 220 */ 167, 168, 169, 170, 171, 172, 173, 174, 0, 12,
+ /* 230 */ 13, 19, 145, 271, 147, 74, 262, 20, 52, 22,
+ /* 240 */ 54, 38, 186, 139, 58, 33, 20, 61, 36, 63,
+ /* 250 */ 64, 289, 66, 236, 42, 38, 44, 45, 46, 47,
+ /* 260 */ 57, 244, 12, 13, 14, 15, 16, 293, 12, 13,
+ /* 270 */ 14, 212, 218, 186, 57, 61, 20, 49, 22, 65,
+ /* 280 */ 306, 227, 12, 13, 310, 73, 220, 20, 76, 20,
+ /* 290 */ 20, 74, 22, 212, 38, 236, 217, 243, 236, 233,
+ /* 300 */ 74, 87, 243, 212, 67, 243, 218, 241, 38, 85,
+ /* 310 */ 231, 207, 253, 57, 97, 227, 257, 238, 106, 71,
+ /* 320 */ 106, 107, 108, 163, 110, 75, 109, 57, 222, 223,
+ /* 330 */ 74, 243, 273, 274, 275, 276, 277, 275, 257, 21,
+ /* 340 */ 281, 282, 283, 0, 74, 0, 134, 186, 257, 137,
+ /* 350 */ 113, 114, 34, 97, 295, 195, 196, 197, 198, 199,
+ /* 360 */ 301, 302, 57, 146, 152, 109, 154, 97, 212, 24,
+ /* 370 */ 25, 26, 27, 28, 29, 30, 31, 32, 237, 109,
+ /* 380 */ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
+ /* 390 */ 173, 174, 20, 218, 236, 52, 220, 54, 293, 237,
+ /* 400 */ 242, 58, 146, 186, 61, 247, 63, 64, 212, 66,
+ /* 410 */ 212, 306, 265, 257, 212, 310, 146, 241, 243, 163,
+ /* 420 */ 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
+ /* 430 */ 174, 164, 165, 163, 164, 165, 166, 167, 168, 169,
+ /* 440 */ 170, 171, 172, 173, 174, 218, 12, 13, 18, 136,
+ /* 450 */ 20, 276, 204, 257, 20, 257, 22, 27, 217, 257,
+ /* 460 */ 30, 286, 287, 288, 243, 290, 20, 4, 262, 39,
+ /* 470 */ 243, 250, 38, 12, 13, 14, 15, 16, 3, 238,
+ /* 480 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ /* 490 */ 98, 57, 100, 101, 102, 103, 104, 105, 0, 293,
+ /* 500 */ 184, 185, 271, 276, 191, 192, 1, 2, 74, 218,
+ /* 510 */ 138, 50, 306, 286, 287, 288, 310, 290, 227, 21,
+ /* 520 */ 289, 212, 24, 25, 26, 27, 28, 29, 30, 31,
+ /* 530 */ 32, 97, 229, 237, 243, 232, 75, 12, 13, 14,
+ /* 540 */ 15, 16, 112, 109, 83, 115, 116, 117, 118, 119,
+ /* 550 */ 212, 121, 122, 123, 124, 125, 126, 127, 128, 129,
+ /* 560 */ 130, 131, 0, 47, 18, 218, 257, 212, 224, 23,
+ /* 570 */ 226, 236, 236, 43, 227, 12, 13, 14, 15, 16,
+ /* 580 */ 146, 35, 247, 247, 138, 14, 237, 237, 212, 73,
+ /* 590 */ 243, 20, 76, 132, 48, 257, 237, 163, 164, 165,
+ /* 600 */ 166, 167, 168, 169, 170, 171, 172, 173, 174, 213,
+ /* 610 */ 212, 150, 257, 50, 52, 53, 54, 55, 56, 212,
+ /* 620 */ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ /* 630 */ 68, 69, 70, 257, 212, 212, 175, 176, 177, 178,
+ /* 640 */ 179, 180, 181, 182, 183, 218, 83, 218, 212, 218,
+ /* 650 */ 187, 22, 228, 218, 227, 257, 227, 111, 227, 236,
+ /* 660 */ 236, 234, 227, 138, 257, 228, 243, 38, 244, 0,
+ /* 670 */ 243, 38, 243, 236, 243, 218, 253, 202, 243, 257,
+ /* 680 */ 257, 244, 212, 212, 227, 139, 140, 141, 212, 143,
+ /* 690 */ 57, 22, 218, 257, 148, 132, 273, 274, 275, 276,
+ /* 700 */ 243, 227, 156, 142, 158, 236, 160, 161, 162, 225,
+ /* 710 */ 71, 242, 236, 150, 75, 185, 247, 243, 157, 243,
+ /* 720 */ 78, 22, 218, 81, 212, 212, 212, 257, 257, 253,
+ /* 730 */ 50, 227, 186, 257, 311, 312, 132, 38, 175, 176,
+ /* 740 */ 177, 178, 179, 180, 181, 182, 183, 243, 236, 273,
+ /* 750 */ 274, 275, 276, 277, 150, 243, 57, 281, 282, 283,
+ /* 760 */ 212, 0, 212, 33, 212, 253, 36, 313, 292, 257,
+ /* 770 */ 257, 257, 42, 253, 44, 45, 46, 47, 78, 175,
+ /* 780 */ 78, 81, 304, 81, 236, 273, 274, 275, 276, 277,
+ /* 790 */ 0, 243, 71, 281, 282, 283, 97, 36, 164, 165,
+ /* 800 */ 246, 253, 35, 73, 292, 257, 76, 257, 109, 257,
+ /* 810 */ 212, 78, 22, 71, 81, 71, 71, 75, 253, 75,
+ /* 820 */ 75, 273, 274, 275, 276, 277, 74, 298, 61, 281,
+ /* 830 */ 282, 283, 65, 215, 236, 71, 272, 212, 86, 75,
+ /* 840 */ 292, 243, 291, 163, 77, 146, 79, 80, 38, 82,
+ /* 850 */ 236, 253, 212, 71, 87, 257, 307, 75, 20, 38,
+ /* 860 */ 262, 236, 163, 133, 294, 135, 71, 137, 243, 218,
+ /* 870 */ 75, 273, 274, 275, 276, 36, 236, 71, 253, 212,
+ /* 880 */ 268, 75, 257, 243, 154, 71, 12, 13, 71, 75,
+ /* 890 */ 38, 293, 75, 253, 222, 144, 22, 257, 273, 274,
+ /* 900 */ 275, 276, 277, 236, 306, 218, 281, 282, 310, 263,
+ /* 910 */ 243, 218, 38, 273, 274, 275, 276, 277, 74, 109,
+ /* 920 */ 253, 281, 282, 218, 257, 71, 251, 206, 84, 75,
+ /* 930 */ 109, 57, 71, 71, 71, 120, 75, 75, 75, 132,
+ /* 940 */ 273, 274, 275, 276, 277, 249, 71, 249, 243, 282,
+ /* 950 */ 75, 20, 218, 71, 71, 212, 267, 75, 75, 20,
+ /* 960 */ 220, 243, 261, 20, 254, 218, 220, 262, 220, 220,
+ /* 970 */ 20, 97, 214, 236, 236, 236, 222, 236, 218, 236,
+ /* 980 */ 267, 276, 212, 109, 153, 266, 243, 214, 261, 236,
+ /* 990 */ 212, 286, 287, 288, 217, 290, 253, 217, 293, 236,
+ /* 1000 */ 257, 236, 236, 260, 236, 236, 236, 236, 20, 254,
+ /* 1010 */ 194, 306, 303, 243, 236, 310, 273, 274, 275, 276,
+ /* 1020 */ 146, 243, 243, 253, 243, 193, 57, 257, 272, 257,
+ /* 1030 */ 260, 253, 258, 258, 212, 257, 201, 163, 303, 189,
+ /* 1040 */ 257, 257, 200, 273, 274, 275, 276, 188, 243, 20,
+ /* 1050 */ 300, 273, 274, 275, 276, 296, 299, 185, 236, 297,
+ /* 1060 */ 271, 120, 205, 208, 74, 243, 258, 280, 212, 284,
+ /* 1070 */ 203, 258, 135, 255, 74, 253, 212, 257, 254, 257,
+ /* 1080 */ 257, 212, 257, 305, 243, 217, 243, 239, 217, 210,
+ /* 1090 */ 314, 226, 236, 217, 308, 273, 274, 275, 276, 243,
+ /* 1100 */ 236, 309, 232, 222, 218, 236, 214, 243, 230, 253,
+ /* 1110 */ 264, 0, 243, 257, 230, 219, 260, 253, 0, 64,
+ /* 1120 */ 0, 257, 253, 212, 260, 38, 257, 38, 212, 273,
+ /* 1130 */ 274, 275, 276, 4, 312, 159, 212, 273, 274, 275,
+ /* 1140 */ 276, 38, 273, 274, 275, 276, 159, 236, 19, 0,
+ /* 1150 */ 38, 159, 236, 38, 243, 38, 0, 38, 0, 243,
+ /* 1160 */ 236, 38, 33, 0, 253, 36, 74, 243, 257, 253,
+ /* 1170 */ 41, 150, 149, 257, 0, 0, 47, 253, 109, 146,
+ /* 1180 */ 212, 257, 0, 53, 273, 274, 275, 276, 142, 273,
+ /* 1190 */ 274, 275, 276, 0, 0, 212, 86, 273, 274, 275,
+ /* 1200 */ 276, 0, 73, 0, 236, 76, 212, 0, 0, 0,
+ /* 1210 */ 0, 243, 0, 0, 0, 0, 0, 0, 0, 236,
+ /* 1220 */ 0, 253, 0, 0, 120, 257, 243, 0, 0, 0,
+ /* 1230 */ 236, 212, 0, 0, 0, 61, 253, 243, 0, 65,
+ /* 1240 */ 257, 273, 274, 275, 276, 0, 22, 253, 0, 0,
+ /* 1250 */ 0, 257, 0, 0, 0, 236, 273, 274, 275, 276,
+ /* 1260 */ 0, 87, 243, 0, 43, 212, 0, 273, 274, 275,
+ /* 1270 */ 276, 0, 253, 38, 43, 36, 257, 51, 212, 0,
+ /* 1280 */ 106, 107, 108, 43, 110, 38, 0, 36, 0, 236,
+ /* 1290 */ 0, 36, 273, 274, 275, 276, 243, 38, 0, 43,
+ /* 1300 */ 38, 36, 236, 0, 43, 0, 253, 38, 83, 243,
+ /* 1310 */ 257, 81, 212, 71, 22, 0, 38, 71, 38, 253,
+ /* 1320 */ 212, 38, 38, 257, 0, 212, 273, 274, 275, 276,
+ /* 1330 */ 22, 38, 38, 0, 22, 39, 236, 0, 22, 273,
+ /* 1340 */ 274, 275, 276, 243, 236, 38, 0, 22, 0, 236,
+ /* 1350 */ 22, 243, 20, 253, 0, 155, 243, 257, 38, 0,
+ /* 1360 */ 22, 253, 151, 0, 0, 257, 253, 212, 0, 74,
+ /* 1370 */ 257, 135, 212, 273, 274, 275, 276, 43, 190, 138,
+ /* 1380 */ 71, 273, 274, 275, 276, 71, 273, 274, 275, 276,
+ /* 1390 */ 71, 236, 75, 75, 190, 138, 236, 74, 243, 86,
+ /* 1400 */ 133, 74, 138, 243, 74, 4, 75, 71, 253, 74,
+ /* 1410 */ 71, 38, 257, 253, 71, 75, 75, 257, 71, 75,
+ /* 1420 */ 38, 184, 38, 38, 38, 38, 2, 74, 273, 274,
+ /* 1430 */ 275, 276, 75, 273, 274, 275, 276, 86, 86, 163,
+ /* 1440 */ 75, 86, 75, 74, 0, 75, 74, 136, 190, 74,
+ /* 1450 */ 74, 43, 74, 22, 133, 84, 75, 74, 38, 38,
+ /* 1460 */ 86, 38, 74, 86, 85, 75, 74, 38, 75, 74,
+ /* 1470 */ 38, 75, 74, 38, 75, 22, 74, 74, 38, 99,
+ /* 1480 */ 74, 74, 22, 38, 87, 51, 50, 57, 99, 72,
+ /* 1490 */ 99, 22, 38, 99, 38, 38, 71, 38, 57, 38,
+ /* 1500 */ 38, 38, 38, 38, 38, 38, 38, 0, 38, 109,
+ /* 1510 */ 38, 38, 38, 36, 43, 0, 38, 36, 43, 0,
+ /* 1520 */ 38, 36, 43, 0, 38, 36, 43, 0, 38, 37,
+ /* 1530 */ 0, 0, 22, 21, 315, 22, 22, 21, 20, 315,
+ /* 1540 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1550 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1560 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1570 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1580 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1590 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1600 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1610 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1620 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1630 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1640 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1650 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1660 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1670 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1680 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1690 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1700 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1710 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1720 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1730 */ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ /* 1740 */ 315, 315, 315, 315, 315, 315, 315, 315,
};
#define YY_SHIFT_COUNT (547)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (1524)
+#define YY_SHIFT_MAX (1531)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 528, 0, 51, 65, 65, 65, 65, 104, 65, 65,
- /* 10 */ 271, 389, 64, 169, 271, 271, 271, 271, 271, 271,
- /* 20 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
- /* 30 */ 271, 271, 271, 271, 82, 82, 82, 8, 618, 618,
- /* 40 */ 94, 26, 26, 10, 618, 80, 80, 26, 26, 26,
- /* 50 */ 26, 26, 26, 12, 192, 260, 10, 192, 26, 26,
- /* 60 */ 192, 26, 192, 192, 192, 26, 303, 267, 298, 437,
- /* 70 */ 437, 295, 339, 762, 238, 762, 762, 762, 762, 762,
- /* 80 */ 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- /* 90 */ 762, 762, 762, 762, 80, 220, 147, 313, 324, 324,
- /* 100 */ 324, 549, 313, 444, 192, 192, 192, 318, 465, 436,
- /* 110 */ 436, 436, 436, 436, 436, 436, 747, 227, 594, 453,
- /* 120 */ 168, 80, 285, 80, 18, 552, 351, 134, 507, 134,
- /* 130 */ 476, 568, 491, 880, 881, 889, 790, 880, 880, 825,
- /* 140 */ 818, 818, 880, 935, 940, 12, 444, 943, 12, 12,
- /* 150 */ 880, 12, 946, 192, 192, 192, 192, 192, 192, 192,
- /* 160 */ 192, 192, 192, 192, 889, 880, 946, 444, 935, 830,
- /* 170 */ 940, 303, 444, 943, 303, 985, 817, 827, 963, 817,
- /* 180 */ 827, 963, 963, 824, 840, 858, 865, 864, 444, 1035,
- /* 190 */ 938, 852, 856, 860, 991, 192, 827, 963, 963, 827,
- /* 200 */ 963, 945, 444, 943, 303, 318, 303, 444, 1036, 889,
- /* 210 */ 465, 880, 303, 946, 1533, 1533, 1533, 1533, 1533, 447,
- /* 220 */ 560, 329, 7, 458, 1381, 469, 565, 570, 649, 705,
- /* 230 */ 249, 249, 249, 249, 249, 249, 249, 302, 263, 44,
- /* 240 */ 6, 5, 44, 44, 44, 644, 484, 603, 413, 440,
- /* 250 */ 492, 572, 679, 757, 785, 704, 625, 726, 738, 245,
- /* 260 */ 268, 664, 663, 751, 297, 754, 760, 781, 799, 801,
- /* 270 */ 802, 808, 740, 789, 779, 832, 835, 855, 861, 862,
- /* 280 */ 763, 867, 1127, 1129, 1067, 1134, 1101, 982, 1104, 1105,
- /* 290 */ 1107, 987, 1147, 1114, 1115, 995, 1155, 1118, 1158, 1128,
- /* 300 */ 1165, 1093, 1018, 1020, 1061, 1025, 1172, 1173, 1122, 1034,
- /* 310 */ 1177, 1184, 1094, 1181, 1182, 1186, 1187, 1188, 1189, 1191,
- /* 320 */ 1192, 1193, 1198, 1199, 1201, 1202, 1203, 1211, 1212, 1059,
- /* 330 */ 1213, 1214, 1215, 1217, 1218, 1219, 1183, 1206, 1207, 1208,
- /* 340 */ 1224, 1225, 1227, 1228, 1229, 1231, 1190, 1232, 1185, 1237,
- /* 350 */ 1238, 1204, 1209, 1196, 1240, 1216, 1220, 1200, 1250, 1222,
- /* 360 */ 1221, 1210, 1252, 1223, 1226, 1234, 1258, 1263, 1264, 1265,
- /* 370 */ 1195, 1230, 1243, 1233, 1245, 1269, 1244, 1246, 1248, 1249,
- /* 380 */ 1241, 1233, 1253, 1254, 1270, 1261, 1288, 1268, 1255, 1293,
- /* 390 */ 1273, 1262, 1301, 1280, 1309, 1292, 1295, 1316, 1180, 1162,
- /* 400 */ 1281, 1321, 1171, 1303, 1194, 1235, 1323, 1326, 1197, 1327,
- /* 410 */ 1256, 1285, 1236, 1260, 1267, 1140, 1259, 1274, 1271, 1275,
- /* 420 */ 1276, 1277, 1278, 1284, 1247, 1283, 1289, 1150, 1286, 1290,
- /* 430 */ 1266, 1153, 1296, 1282, 1291, 1302, 1159, 1355, 1325, 1334,
- /* 440 */ 1341, 1344, 1345, 1346, 1362, 1239, 1299, 1314, 1319, 1317,
- /* 450 */ 1322, 1320, 1324, 1330, 1331, 1279, 1332, 1398, 1357, 1294,
- /* 460 */ 1338, 1329, 1336, 1342, 1407, 1356, 1347, 1358, 1396, 1399,
- /* 470 */ 1364, 1361, 1401, 1367, 1368, 1406, 1371, 1373, 1411, 1376,
- /* 480 */ 1380, 1418, 1384, 1360, 1363, 1365, 1366, 1438, 1379, 1389,
- /* 490 */ 1429, 1372, 1395, 1397, 1432, 1233, 1450, 1422, 1424, 1419,
- /* 500 */ 1403, 1412, 1444, 1446, 1447, 1448, 1452, 1454, 1455, 1472,
- /* 510 */ 1439, 1241, 1457, 1233, 1459, 1460, 1461, 1462, 1463, 1464,
- /* 520 */ 1465, 1504, 1467, 1470, 1466, 1507, 1473, 1474, 1469, 1508,
- /* 530 */ 1475, 1478, 1476, 1515, 1479, 1480, 1477, 1518, 1483, 1485,
- /* 540 */ 1523, 1524, 1503, 1505, 1506, 1509, 1511, 1510,
+ /* 0 */ 546, 0, 39, 53, 53, 53, 53, 217, 53, 53,
+ /* 10 */ 270, 434, 161, 256, 270, 270, 270, 270, 270, 270,
+ /* 20 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
+ /* 30 */ 270, 270, 270, 270, 226, 226, 226, 29, 874, 874,
+ /* 40 */ 87, 1, 1, 56, 874, 267, 267, 1, 1, 1,
+ /* 50 */ 1, 1, 1, 5, 4, 73, 56, 4, 1, 1,
+ /* 60 */ 4, 1, 4, 4, 4, 1, 95, 430, 461, 563,
+ /* 70 */ 563, 163, 767, 699, 186, 699, 699, 699, 699, 699,
+ /* 80 */ 699, 699, 699, 699, 699, 699, 699, 699, 699, 699,
+ /* 90 */ 699, 699, 699, 699, 267, 136, 63, 203, 372, 372,
+ /* 100 */ 372, 228, 203, 269, 4, 4, 4, 224, 305, 392,
+ /* 110 */ 392, 392, 392, 392, 392, 392, 212, 498, 343, 104,
+ /* 120 */ 160, 267, 114, 267, 313, 629, 446, 316, 530, 316,
+ /* 130 */ 571, 475, 463, 838, 839, 852, 751, 838, 838, 815,
+ /* 140 */ 807, 807, 838, 931, 939, 5, 269, 943, 5, 5,
+ /* 150 */ 838, 5, 950, 4, 4, 4, 4, 4, 4, 4,
+ /* 160 */ 4, 4, 4, 4, 852, 838, 950, 269, 931, 831,
+ /* 170 */ 939, 95, 269, 943, 95, 988, 816, 832, 969, 816,
+ /* 180 */ 832, 969, 969, 835, 842, 850, 859, 872, 269, 1029,
+ /* 190 */ 941, 855, 857, 867, 990, 4, 832, 969, 969, 832,
+ /* 200 */ 969, 937, 269, 943, 95, 224, 95, 269, 1000, 852,
+ /* 210 */ 305, 838, 95, 950, 1539, 1539, 1539, 1539, 1539, 562,
+ /* 220 */ 730, 345, 1129, 214, 1174, 13, 21, 30, 250, 525,
+ /* 230 */ 92, 92, 92, 92, 92, 92, 92, 516, 237, 182,
+ /* 240 */ 70, 604, 182, 182, 182, 761, 561, 639, 642, 700,
+ /* 250 */ 702, 733, 102, 669, 790, 318, 742, 744, 745, 505,
+ /* 260 */ 634, 248, 721, 764, 680, 782, 752, 795, 806, 814,
+ /* 270 */ 817, 854, 810, 821, 861, 862, 863, 875, 882, 883,
+ /* 280 */ 844, 633, 1111, 1118, 1055, 1120, 1087, 976, 1089, 1103,
+ /* 290 */ 1112, 987, 1149, 1115, 1117, 992, 1156, 1119, 1158, 1123,
+ /* 300 */ 1163, 1092, 1021, 1023, 1069, 1033, 1175, 1182, 1130, 1046,
+ /* 310 */ 1193, 1194, 1110, 1201, 1203, 1207, 1208, 1209, 1210, 1212,
+ /* 320 */ 1213, 1214, 1215, 1216, 1217, 1218, 1220, 1222, 1223, 1104,
+ /* 330 */ 1227, 1228, 1229, 1232, 1233, 1234, 1224, 1238, 1245, 1248,
+ /* 340 */ 1249, 1250, 1252, 1253, 1254, 1260, 1221, 1263, 1226, 1266,
+ /* 350 */ 1271, 1235, 1239, 1231, 1279, 1247, 1251, 1240, 1286, 1259,
+ /* 360 */ 1255, 1256, 1288, 1262, 1265, 1261, 1290, 1298, 1303, 1305,
+ /* 370 */ 1225, 1230, 1269, 1242, 1292, 1315, 1278, 1280, 1283, 1284,
+ /* 380 */ 1246, 1242, 1293, 1294, 1324, 1308, 1333, 1312, 1296, 1337,
+ /* 390 */ 1316, 1307, 1346, 1325, 1348, 1328, 1332, 1354, 1241, 1200,
+ /* 400 */ 1320, 1359, 1211, 1338, 1257, 1236, 1363, 1364, 1264, 1368,
+ /* 410 */ 1295, 1334, 1267, 1309, 1314, 1188, 1317, 1319, 1318, 1323,
+ /* 420 */ 1327, 1330, 1331, 1336, 1313, 1335, 1339, 1204, 1340, 1341,
+ /* 430 */ 1351, 1237, 1343, 1352, 1344, 1347, 1258, 1401, 1373, 1382,
+ /* 440 */ 1384, 1385, 1386, 1387, 1424, 1276, 1355, 1357, 1365, 1353,
+ /* 450 */ 1369, 1367, 1370, 1372, 1375, 1311, 1376, 1444, 1408, 1321,
+ /* 460 */ 1378, 1371, 1374, 1377, 1431, 1383, 1379, 1381, 1420, 1421,
+ /* 470 */ 1388, 1390, 1423, 1392, 1393, 1429, 1395, 1396, 1432, 1398,
+ /* 480 */ 1399, 1435, 1402, 1380, 1389, 1391, 1394, 1453, 1397, 1403,
+ /* 490 */ 1440, 1400, 1406, 1407, 1445, 1242, 1460, 1434, 1436, 1430,
+ /* 500 */ 1417, 1425, 1454, 1456, 1457, 1459, 1461, 1462, 1463, 1469,
+ /* 510 */ 1441, 1246, 1464, 1242, 1465, 1466, 1467, 1468, 1470, 1472,
+ /* 520 */ 1473, 1507, 1474, 1477, 1471, 1515, 1478, 1481, 1475, 1519,
+ /* 530 */ 1482, 1485, 1479, 1523, 1486, 1489, 1483, 1527, 1490, 1492,
+ /* 540 */ 1530, 1531, 1510, 1512, 1513, 1514, 1516, 1518,
};
#define YY_REDUCE_COUNT (218)
-#define YY_REDUCE_MIN (-276)
-#define YY_REDUCE_MAX (1205)
+#define YY_REDUCE_MIN (-274)
+#define YY_REDUCE_MAX (1160)
static const short yy_reduce_ofst[] = {
- /* 0 */ 340, 431, 474, 530, 613, 640, 667, 717, -123, 769,
- /* 10 */ -205, 742, 553, -180, 795, 821, 487, 829, 863, 876,
- /* 20 */ 888, 922, 948, 974, 999, 1024, 1033, 1068, 1102, 1136,
- /* 30 */ 1145, 1151, 1179, 1205, 170, -99, -83, -165, -235, -224,
- /* 40 */ -256, -217, -151, 342, -227, -148, -234, -203, -106, -42,
- /* 50 */ 182, 189, 382, 63, -36, 187, -164, -208, 383, 412,
- /* 60 */ 179, 511, 400, 517, 467, 525, 70, -161, -276, -276,
- /* 70 */ -276, -89, 259, -121, -26, -79, -31, 87, 286, 332,
- /* 80 */ 364, 426, 488, 520, 521, 534, 562, 576, 577, 585,
- /* 90 */ 588, 604, 605, 610, 155, -116, -216, -108, 135, 140,
- /* 100 */ 200, 255, -91, 39, 354, 375, 435, 77, 144, 311,
- /* 110 */ 355, 359, 386, 387, 392, 472, 408, 559, 509, 496,
- /* 120 */ 514, 578, 590, 584, 566, 643, 593, 600, 600, 600,
- /* 130 */ 645, 591, 598, 694, 651, 708, 673, 721, 727, 696,
- /* 140 */ 703, 706, 739, 691, 701, 743, 722, 712, 748, 749,
- /* 150 */ 753, 752, 759, 741, 744, 746, 750, 758, 761, 764,
- /* 160 */ 765, 766, 767, 768, 774, 770, 773, 732, 709, 723,
- /* 170 */ 737, 791, 771, 729, 792, 756, 710, 772, 775, 731,
- /* 180 */ 777, 780, 782, 736, 730, 776, 783, 600, 811, 787,
- /* 190 */ 778, 784, 798, 793, 796, 645, 809, 820, 823, 826,
- /* 200 */ 828, 836, 844, 838, 866, 877, 873, 850, 869, 891,
- /* 210 */ 884, 896, 898, 903, 854, 892, 895, 902, 917,
+ /* 0 */ -26, -195, 59, -122, 476, 512, 548, 598, 625, 640,
+ /* 10 */ 423, 667, 705, 743, 770, 778, 822, 856, 864, 869,
+ /* 20 */ 911, 916, 924, 968, 983, 994, 1019, 1053, 1066, 1100,
+ /* 30 */ 1108, 1113, 1155, 1160, -148, 175, 227, -163, -239, -201,
+ /* 40 */ -246, -142, 427, 206, -255, -253, -120, 54, 88, 291,
+ /* 50 */ 347, 429, 431, 66, -113, 62, 105, -87, 435, 457,
+ /* 60 */ 158, 474, 424, 469, 437, 504, 79, -208, -274, -274,
+ /* 70 */ -274, -204, -227, 81, -99, 91, 156, 196, 198, 202,
+ /* 80 */ 309, 338, 355, 376, 398, 407, 422, 436, 470, 471,
+ /* 90 */ 513, 514, 550, 552, -159, -132, 176, -45, -89, -38,
+ /* 100 */ 231, 241, 106, 221, 17, 335, 336, 303, 344, -226,
+ /* 110 */ 141, 162, 296, 349, 350, 359, 147, 396, 484, 454,
+ /* 120 */ 478, 520, 554, 565, 529, 618, 564, 551, 551, 551,
+ /* 130 */ 614, 549, 570, 651, 612, 672, 646, 687, 693, 675,
+ /* 140 */ 696, 698, 734, 689, 701, 740, 718, 710, 746, 748,
+ /* 150 */ 747, 749, 758, 737, 738, 739, 741, 753, 763, 765,
+ /* 160 */ 766, 768, 769, 771, 754, 760, 773, 779, 713, 719,
+ /* 170 */ 727, 777, 781, 755, 780, 756, 709, 774, 772, 735,
+ /* 180 */ 775, 783, 784, 750, 757, 762, 759, 551, 805, 789,
+ /* 190 */ 785, 776, 792, 786, 787, 614, 808, 820, 823, 813,
+ /* 200 */ 825, 818, 841, 824, 868, 870, 871, 843, 848, 881,
+ /* 210 */ 865, 886, 876, 892, 846, 878, 884, 896, 879,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 10 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 20 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 30 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 40 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 50 */ 1217, 1217, 1217, 1276, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 60 */ 1217, 1217, 1217, 1217, 1217, 1217, 1274, 1414, 1217, 1549,
- /* 70 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 80 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 90 */ 1217, 1217, 1217, 1217, 1217, 1217, 1276, 1217, 1560, 1560,
- /* 100 */ 1560, 1274, 1217, 1217, 1217, 1217, 1217, 1369, 1217, 1217,
- /* 110 */ 1217, 1217, 1217, 1217, 1217, 1217, 1448, 1217, 1217, 1624,
- /* 120 */ 1217, 1217, 1322, 1217, 1584, 1217, 1576, 1552, 1566, 1553,
- /* 130 */ 1217, 1609, 1569, 1217, 1217, 1217, 1440, 1217, 1217, 1419,
- /* 140 */ 1416, 1416, 1217, 1217, 1217, 1276, 1217, 1217, 1276, 1276,
- /* 150 */ 1217, 1276, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 160 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1450,
- /* 170 */ 1217, 1274, 1217, 1217, 1274, 1217, 1591, 1589, 1217, 1591,
- /* 180 */ 1589, 1217, 1217, 1603, 1599, 1582, 1580, 1566, 1217, 1217,
- /* 190 */ 1217, 1627, 1615, 1611, 1217, 1217, 1589, 1217, 1217, 1589,
- /* 200 */ 1217, 1427, 1217, 1217, 1274, 1217, 1274, 1217, 1338, 1217,
- /* 210 */ 1217, 1217, 1274, 1217, 1442, 1372, 1372, 1277, 1222, 1217,
- /* 220 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1512,
- /* 230 */ 1513, 1602, 1601, 1512, 1526, 1525, 1524, 1217, 1217, 1507,
- /* 240 */ 1217, 1217, 1508, 1506, 1505, 1217, 1217, 1217, 1217, 1217,
- /* 250 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1550,
- /* 260 */ 1217, 1612, 1616, 1217, 1217, 1217, 1487, 1217, 1217, 1217,
- /* 270 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 280 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 290 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 300 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 310 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 320 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 330 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 340 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 350 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 360 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 370 */ 1217, 1217, 1217, 1383, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 380 */ 1303, 1302, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 390 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 400 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 410 */ 1217, 1217, 1217, 1573, 1583, 1217, 1217, 1217, 1217, 1217,
- /* 420 */ 1217, 1217, 1217, 1217, 1487, 1217, 1600, 1217, 1559, 1555,
- /* 430 */ 1217, 1217, 1551, 1217, 1217, 1610, 1217, 1217, 1217, 1217,
- /* 440 */ 1217, 1217, 1217, 1217, 1545, 1217, 1217, 1217, 1217, 1217,
- /* 450 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 460 */ 1217, 1217, 1486, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 470 */ 1366, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 480 */ 1217, 1217, 1217, 1351, 1349, 1348, 1347, 1217, 1344, 1217,
- /* 490 */ 1217, 1217, 1217, 1217, 1217, 1374, 1217, 1217, 1217, 1217,
- /* 500 */ 1217, 1297, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 510 */ 1217, 1288, 1217, 1287, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 520 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 530 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
- /* 540 */ 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217,
+ /* 0 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 10 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 20 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 30 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 40 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 50 */ 1219, 1219, 1219, 1278, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 60 */ 1219, 1219, 1219, 1219, 1219, 1219, 1276, 1416, 1219, 1552,
+ /* 70 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 80 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 90 */ 1219, 1219, 1219, 1219, 1219, 1219, 1278, 1219, 1563, 1563,
+ /* 100 */ 1563, 1276, 1219, 1219, 1219, 1219, 1219, 1371, 1219, 1219,
+ /* 110 */ 1219, 1219, 1219, 1219, 1219, 1219, 1450, 1219, 1219, 1627,
+ /* 120 */ 1219, 1219, 1324, 1219, 1587, 1219, 1579, 1555, 1569, 1556,
+ /* 130 */ 1219, 1612, 1572, 1219, 1219, 1219, 1442, 1219, 1219, 1421,
+ /* 140 */ 1418, 1418, 1219, 1219, 1219, 1278, 1219, 1219, 1278, 1278,
+ /* 150 */ 1219, 1278, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 160 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1452,
+ /* 170 */ 1219, 1276, 1219, 1219, 1276, 1219, 1594, 1592, 1219, 1594,
+ /* 180 */ 1592, 1219, 1219, 1606, 1602, 1585, 1583, 1569, 1219, 1219,
+ /* 190 */ 1219, 1630, 1618, 1614, 1219, 1219, 1592, 1219, 1219, 1592,
+ /* 200 */ 1219, 1429, 1219, 1219, 1276, 1219, 1276, 1219, 1340, 1219,
+ /* 210 */ 1219, 1219, 1276, 1219, 1444, 1374, 1374, 1279, 1224, 1219,
+ /* 220 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1514,
+ /* 230 */ 1515, 1605, 1604, 1514, 1529, 1528, 1527, 1219, 1219, 1509,
+ /* 240 */ 1219, 1219, 1510, 1508, 1507, 1219, 1219, 1219, 1219, 1219,
+ /* 250 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1553,
+ /* 260 */ 1219, 1615, 1619, 1219, 1219, 1219, 1489, 1219, 1219, 1219,
+ /* 270 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 280 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 290 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 300 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 310 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 320 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 330 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 340 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 350 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 360 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 370 */ 1219, 1219, 1219, 1385, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 380 */ 1305, 1304, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 390 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 400 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 410 */ 1219, 1219, 1219, 1576, 1586, 1219, 1219, 1219, 1219, 1219,
+ /* 420 */ 1219, 1219, 1219, 1219, 1489, 1219, 1603, 1219, 1562, 1558,
+ /* 430 */ 1219, 1219, 1554, 1219, 1219, 1613, 1219, 1219, 1219, 1219,
+ /* 440 */ 1219, 1219, 1219, 1219, 1548, 1219, 1219, 1219, 1219, 1219,
+ /* 450 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 460 */ 1219, 1219, 1488, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 470 */ 1368, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 480 */ 1219, 1219, 1219, 1353, 1351, 1350, 1349, 1219, 1346, 1219,
+ /* 490 */ 1219, 1219, 1219, 1219, 1219, 1376, 1219, 1219, 1219, 1219,
+ /* 500 */ 1219, 1299, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 510 */ 1219, 1290, 1219, 1289, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 520 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 530 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
+ /* 540 */ 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -959,153 +960,154 @@ static const char *const yyTokenName[] = {
/* 164 */ "FIRST",
/* 165 */ "LAST",
/* 166 */ "NOW",
- /* 167 */ "ROWTS",
- /* 168 */ "TBNAME",
- /* 169 */ "QSTARTTS",
- /* 170 */ "QENDTS",
- /* 171 */ "WSTARTTS",
- /* 172 */ "WENDTS",
- /* 173 */ "WDURATION",
- /* 174 */ "BETWEEN",
- /* 175 */ "IS",
- /* 176 */ "NK_LT",
- /* 177 */ "NK_GT",
- /* 178 */ "NK_LE",
- /* 179 */ "NK_GE",
- /* 180 */ "NK_NE",
- /* 181 */ "MATCH",
- /* 182 */ "NMATCH",
- /* 183 */ "JOIN",
- /* 184 */ "INNER",
- /* 185 */ "SELECT",
- /* 186 */ "DISTINCT",
- /* 187 */ "WHERE",
- /* 188 */ "PARTITION",
- /* 189 */ "BY",
- /* 190 */ "SESSION",
- /* 191 */ "STATE_WINDOW",
- /* 192 */ "SLIDING",
- /* 193 */ "FILL",
- /* 194 */ "VALUE",
- /* 195 */ "NONE",
- /* 196 */ "PREV",
- /* 197 */ "LINEAR",
- /* 198 */ "NEXT",
- /* 199 */ "GROUP",
- /* 200 */ "HAVING",
- /* 201 */ "ORDER",
- /* 202 */ "SLIMIT",
- /* 203 */ "SOFFSET",
- /* 204 */ "LIMIT",
- /* 205 */ "OFFSET",
- /* 206 */ "ASC",
- /* 207 */ "NULLS",
- /* 208 */ "cmd",
- /* 209 */ "account_options",
- /* 210 */ "alter_account_options",
- /* 211 */ "literal",
- /* 212 */ "alter_account_option",
- /* 213 */ "user_name",
- /* 214 */ "dnode_endpoint",
- /* 215 */ "dnode_host_name",
- /* 216 */ "not_exists_opt",
- /* 217 */ "db_name",
- /* 218 */ "db_options",
- /* 219 */ "exists_opt",
- /* 220 */ "alter_db_options",
- /* 221 */ "integer_list",
- /* 222 */ "variable_list",
- /* 223 */ "retention_list",
- /* 224 */ "alter_db_option",
- /* 225 */ "retention",
- /* 226 */ "full_table_name",
- /* 227 */ "column_def_list",
- /* 228 */ "tags_def_opt",
- /* 229 */ "table_options",
- /* 230 */ "multi_create_clause",
- /* 231 */ "tags_def",
- /* 232 */ "multi_drop_clause",
- /* 233 */ "alter_table_clause",
- /* 234 */ "alter_table_options",
- /* 235 */ "column_name",
- /* 236 */ "type_name",
- /* 237 */ "create_subtable_clause",
- /* 238 */ "specific_tags_opt",
- /* 239 */ "literal_list",
- /* 240 */ "drop_table_clause",
- /* 241 */ "col_name_list",
- /* 242 */ "table_name",
- /* 243 */ "column_def",
- /* 244 */ "func_name_list",
- /* 245 */ "alter_table_option",
- /* 246 */ "col_name",
- /* 247 */ "db_name_cond_opt",
- /* 248 */ "like_pattern_opt",
- /* 249 */ "table_name_cond",
- /* 250 */ "from_db_opt",
- /* 251 */ "func_name",
- /* 252 */ "function_name",
- /* 253 */ "index_name",
- /* 254 */ "index_options",
- /* 255 */ "func_list",
- /* 256 */ "duration_literal",
- /* 257 */ "sliding_opt",
- /* 258 */ "func",
- /* 259 */ "expression_list",
- /* 260 */ "topic_name",
- /* 261 */ "query_expression",
- /* 262 */ "analyze_opt",
- /* 263 */ "explain_options",
- /* 264 */ "agg_func_opt",
- /* 265 */ "bufsize_opt",
- /* 266 */ "stream_name",
- /* 267 */ "dnode_list",
- /* 268 */ "signed",
- /* 269 */ "signed_literal",
- /* 270 */ "table_alias",
- /* 271 */ "column_alias",
- /* 272 */ "expression",
- /* 273 */ "pseudo_column",
- /* 274 */ "column_reference",
- /* 275 */ "subquery",
- /* 276 */ "predicate",
- /* 277 */ "compare_op",
- /* 278 */ "in_op",
- /* 279 */ "in_predicate_value",
- /* 280 */ "boolean_value_expression",
- /* 281 */ "boolean_primary",
- /* 282 */ "common_expression",
- /* 283 */ "from_clause",
- /* 284 */ "table_reference_list",
- /* 285 */ "table_reference",
- /* 286 */ "table_primary",
- /* 287 */ "joined_table",
- /* 288 */ "alias_opt",
- /* 289 */ "parenthesized_joined_table",
- /* 290 */ "join_type",
- /* 291 */ "search_condition",
- /* 292 */ "query_specification",
- /* 293 */ "set_quantifier_opt",
- /* 294 */ "select_list",
- /* 295 */ "where_clause_opt",
- /* 296 */ "partition_by_clause_opt",
- /* 297 */ "twindow_clause_opt",
- /* 298 */ "group_by_clause_opt",
- /* 299 */ "having_clause_opt",
- /* 300 */ "select_sublist",
- /* 301 */ "select_item",
- /* 302 */ "fill_opt",
- /* 303 */ "fill_mode",
- /* 304 */ "group_by_list",
- /* 305 */ "query_expression_body",
- /* 306 */ "order_by_clause_opt",
- /* 307 */ "slimit_clause_opt",
- /* 308 */ "limit_clause_opt",
- /* 309 */ "query_primary",
- /* 310 */ "sort_specification_list",
- /* 311 */ "sort_specification",
- /* 312 */ "ordering_specification_opt",
- /* 313 */ "null_ordering_opt",
+ /* 167 */ "TODAY",
+ /* 168 */ "ROWTS",
+ /* 169 */ "TBNAME",
+ /* 170 */ "QSTARTTS",
+ /* 171 */ "QENDTS",
+ /* 172 */ "WSTARTTS",
+ /* 173 */ "WENDTS",
+ /* 174 */ "WDURATION",
+ /* 175 */ "BETWEEN",
+ /* 176 */ "IS",
+ /* 177 */ "NK_LT",
+ /* 178 */ "NK_GT",
+ /* 179 */ "NK_LE",
+ /* 180 */ "NK_GE",
+ /* 181 */ "NK_NE",
+ /* 182 */ "MATCH",
+ /* 183 */ "NMATCH",
+ /* 184 */ "JOIN",
+ /* 185 */ "INNER",
+ /* 186 */ "SELECT",
+ /* 187 */ "DISTINCT",
+ /* 188 */ "WHERE",
+ /* 189 */ "PARTITION",
+ /* 190 */ "BY",
+ /* 191 */ "SESSION",
+ /* 192 */ "STATE_WINDOW",
+ /* 193 */ "SLIDING",
+ /* 194 */ "FILL",
+ /* 195 */ "VALUE",
+ /* 196 */ "NONE",
+ /* 197 */ "PREV",
+ /* 198 */ "LINEAR",
+ /* 199 */ "NEXT",
+ /* 200 */ "GROUP",
+ /* 201 */ "HAVING",
+ /* 202 */ "ORDER",
+ /* 203 */ "SLIMIT",
+ /* 204 */ "SOFFSET",
+ /* 205 */ "LIMIT",
+ /* 206 */ "OFFSET",
+ /* 207 */ "ASC",
+ /* 208 */ "NULLS",
+ /* 209 */ "cmd",
+ /* 210 */ "account_options",
+ /* 211 */ "alter_account_options",
+ /* 212 */ "literal",
+ /* 213 */ "alter_account_option",
+ /* 214 */ "user_name",
+ /* 215 */ "dnode_endpoint",
+ /* 216 */ "dnode_host_name",
+ /* 217 */ "not_exists_opt",
+ /* 218 */ "db_name",
+ /* 219 */ "db_options",
+ /* 220 */ "exists_opt",
+ /* 221 */ "alter_db_options",
+ /* 222 */ "integer_list",
+ /* 223 */ "variable_list",
+ /* 224 */ "retention_list",
+ /* 225 */ "alter_db_option",
+ /* 226 */ "retention",
+ /* 227 */ "full_table_name",
+ /* 228 */ "column_def_list",
+ /* 229 */ "tags_def_opt",
+ /* 230 */ "table_options",
+ /* 231 */ "multi_create_clause",
+ /* 232 */ "tags_def",
+ /* 233 */ "multi_drop_clause",
+ /* 234 */ "alter_table_clause",
+ /* 235 */ "alter_table_options",
+ /* 236 */ "column_name",
+ /* 237 */ "type_name",
+ /* 238 */ "create_subtable_clause",
+ /* 239 */ "specific_tags_opt",
+ /* 240 */ "literal_list",
+ /* 241 */ "drop_table_clause",
+ /* 242 */ "col_name_list",
+ /* 243 */ "table_name",
+ /* 244 */ "column_def",
+ /* 245 */ "func_name_list",
+ /* 246 */ "alter_table_option",
+ /* 247 */ "col_name",
+ /* 248 */ "db_name_cond_opt",
+ /* 249 */ "like_pattern_opt",
+ /* 250 */ "table_name_cond",
+ /* 251 */ "from_db_opt",
+ /* 252 */ "func_name",
+ /* 253 */ "function_name",
+ /* 254 */ "index_name",
+ /* 255 */ "index_options",
+ /* 256 */ "func_list",
+ /* 257 */ "duration_literal",
+ /* 258 */ "sliding_opt",
+ /* 259 */ "func",
+ /* 260 */ "expression_list",
+ /* 261 */ "topic_name",
+ /* 262 */ "query_expression",
+ /* 263 */ "analyze_opt",
+ /* 264 */ "explain_options",
+ /* 265 */ "agg_func_opt",
+ /* 266 */ "bufsize_opt",
+ /* 267 */ "stream_name",
+ /* 268 */ "dnode_list",
+ /* 269 */ "signed",
+ /* 270 */ "signed_literal",
+ /* 271 */ "table_alias",
+ /* 272 */ "column_alias",
+ /* 273 */ "expression",
+ /* 274 */ "pseudo_column",
+ /* 275 */ "column_reference",
+ /* 276 */ "subquery",
+ /* 277 */ "predicate",
+ /* 278 */ "compare_op",
+ /* 279 */ "in_op",
+ /* 280 */ "in_predicate_value",
+ /* 281 */ "boolean_value_expression",
+ /* 282 */ "boolean_primary",
+ /* 283 */ "common_expression",
+ /* 284 */ "from_clause",
+ /* 285 */ "table_reference_list",
+ /* 286 */ "table_reference",
+ /* 287 */ "table_primary",
+ /* 288 */ "joined_table",
+ /* 289 */ "alias_opt",
+ /* 290 */ "parenthesized_joined_table",
+ /* 291 */ "join_type",
+ /* 292 */ "search_condition",
+ /* 293 */ "query_specification",
+ /* 294 */ "set_quantifier_opt",
+ /* 295 */ "select_list",
+ /* 296 */ "where_clause_opt",
+ /* 297 */ "partition_by_clause_opt",
+ /* 298 */ "twindow_clause_opt",
+ /* 299 */ "group_by_clause_opt",
+ /* 300 */ "having_clause_opt",
+ /* 301 */ "select_sublist",
+ /* 302 */ "select_item",
+ /* 303 */ "fill_opt",
+ /* 304 */ "fill_mode",
+ /* 305 */ "group_by_list",
+ /* 306 */ "query_expression_body",
+ /* 307 */ "order_by_clause_opt",
+ /* 308 */ "slimit_clause_opt",
+ /* 309 */ "limit_clause_opt",
+ /* 310 */ "query_primary",
+ /* 311 */ "sort_specification_list",
+ /* 312 */ "sort_specification",
+ /* 313 */ "ordering_specification_opt",
+ /* 314 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -1410,119 +1412,120 @@ static const char *const yyRuleName[] = {
/* 294 */ "column_reference ::= column_name",
/* 295 */ "column_reference ::= table_name NK_DOT column_name",
/* 296 */ "pseudo_column ::= NOW",
- /* 297 */ "pseudo_column ::= ROWTS",
- /* 298 */ "pseudo_column ::= TBNAME",
- /* 299 */ "pseudo_column ::= QSTARTTS",
- /* 300 */ "pseudo_column ::= QENDTS",
- /* 301 */ "pseudo_column ::= WSTARTTS",
- /* 302 */ "pseudo_column ::= WENDTS",
- /* 303 */ "pseudo_column ::= WDURATION",
- /* 304 */ "predicate ::= expression compare_op expression",
- /* 305 */ "predicate ::= expression BETWEEN expression AND expression",
- /* 306 */ "predicate ::= expression NOT BETWEEN expression AND expression",
- /* 307 */ "predicate ::= expression IS NULL",
- /* 308 */ "predicate ::= expression IS NOT NULL",
- /* 309 */ "predicate ::= expression in_op in_predicate_value",
- /* 310 */ "compare_op ::= NK_LT",
- /* 311 */ "compare_op ::= NK_GT",
- /* 312 */ "compare_op ::= NK_LE",
- /* 313 */ "compare_op ::= NK_GE",
- /* 314 */ "compare_op ::= NK_NE",
- /* 315 */ "compare_op ::= NK_EQ",
- /* 316 */ "compare_op ::= LIKE",
- /* 317 */ "compare_op ::= NOT LIKE",
- /* 318 */ "compare_op ::= MATCH",
- /* 319 */ "compare_op ::= NMATCH",
- /* 320 */ "in_op ::= IN",
- /* 321 */ "in_op ::= NOT IN",
- /* 322 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
- /* 323 */ "boolean_value_expression ::= boolean_primary",
- /* 324 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 325 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 326 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 327 */ "boolean_primary ::= predicate",
- /* 328 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 329 */ "common_expression ::= expression",
- /* 330 */ "common_expression ::= boolean_value_expression",
- /* 331 */ "from_clause ::= FROM table_reference_list",
- /* 332 */ "table_reference_list ::= table_reference",
- /* 333 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 334 */ "table_reference ::= table_primary",
- /* 335 */ "table_reference ::= joined_table",
- /* 336 */ "table_primary ::= table_name alias_opt",
- /* 337 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 338 */ "table_primary ::= subquery alias_opt",
- /* 339 */ "table_primary ::= parenthesized_joined_table",
- /* 340 */ "alias_opt ::=",
- /* 341 */ "alias_opt ::= table_alias",
- /* 342 */ "alias_opt ::= AS table_alias",
- /* 343 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 344 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 345 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
- /* 346 */ "join_type ::=",
- /* 347 */ "join_type ::= INNER",
- /* 348 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
- /* 349 */ "set_quantifier_opt ::=",
- /* 350 */ "set_quantifier_opt ::= DISTINCT",
- /* 351 */ "set_quantifier_opt ::= ALL",
- /* 352 */ "select_list ::= NK_STAR",
- /* 353 */ "select_list ::= select_sublist",
- /* 354 */ "select_sublist ::= select_item",
- /* 355 */ "select_sublist ::= select_sublist NK_COMMA select_item",
- /* 356 */ "select_item ::= common_expression",
- /* 357 */ "select_item ::= common_expression column_alias",
- /* 358 */ "select_item ::= common_expression AS column_alias",
- /* 359 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 360 */ "where_clause_opt ::=",
- /* 361 */ "where_clause_opt ::= WHERE search_condition",
- /* 362 */ "partition_by_clause_opt ::=",
- /* 363 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
- /* 364 */ "twindow_clause_opt ::=",
- /* 365 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
- /* 366 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
- /* 367 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
- /* 368 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
- /* 369 */ "sliding_opt ::=",
- /* 370 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
- /* 371 */ "fill_opt ::=",
- /* 372 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 373 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
- /* 374 */ "fill_mode ::= NONE",
- /* 375 */ "fill_mode ::= PREV",
- /* 376 */ "fill_mode ::= NULL",
- /* 377 */ "fill_mode ::= LINEAR",
- /* 378 */ "fill_mode ::= NEXT",
- /* 379 */ "group_by_clause_opt ::=",
- /* 380 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 381 */ "group_by_list ::= expression",
- /* 382 */ "group_by_list ::= group_by_list NK_COMMA expression",
- /* 383 */ "having_clause_opt ::=",
- /* 384 */ "having_clause_opt ::= HAVING search_condition",
- /* 385 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 386 */ "query_expression_body ::= query_primary",
- /* 387 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
- /* 388 */ "query_primary ::= query_specification",
- /* 389 */ "order_by_clause_opt ::=",
- /* 390 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 391 */ "slimit_clause_opt ::=",
- /* 392 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 393 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 394 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 395 */ "limit_clause_opt ::=",
- /* 396 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 397 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 398 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 399 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 400 */ "search_condition ::= common_expression",
- /* 401 */ "sort_specification_list ::= sort_specification",
- /* 402 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 403 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
- /* 404 */ "ordering_specification_opt ::=",
- /* 405 */ "ordering_specification_opt ::= ASC",
- /* 406 */ "ordering_specification_opt ::= DESC",
- /* 407 */ "null_ordering_opt ::=",
- /* 408 */ "null_ordering_opt ::= NULLS FIRST",
- /* 409 */ "null_ordering_opt ::= NULLS LAST",
+ /* 297 */ "pseudo_column ::= TODAY",
+ /* 298 */ "pseudo_column ::= ROWTS",
+ /* 299 */ "pseudo_column ::= TBNAME",
+ /* 300 */ "pseudo_column ::= QSTARTTS",
+ /* 301 */ "pseudo_column ::= QENDTS",
+ /* 302 */ "pseudo_column ::= WSTARTTS",
+ /* 303 */ "pseudo_column ::= WENDTS",
+ /* 304 */ "pseudo_column ::= WDURATION",
+ /* 305 */ "predicate ::= expression compare_op expression",
+ /* 306 */ "predicate ::= expression BETWEEN expression AND expression",
+ /* 307 */ "predicate ::= expression NOT BETWEEN expression AND expression",
+ /* 308 */ "predicate ::= expression IS NULL",
+ /* 309 */ "predicate ::= expression IS NOT NULL",
+ /* 310 */ "predicate ::= expression in_op in_predicate_value",
+ /* 311 */ "compare_op ::= NK_LT",
+ /* 312 */ "compare_op ::= NK_GT",
+ /* 313 */ "compare_op ::= NK_LE",
+ /* 314 */ "compare_op ::= NK_GE",
+ /* 315 */ "compare_op ::= NK_NE",
+ /* 316 */ "compare_op ::= NK_EQ",
+ /* 317 */ "compare_op ::= LIKE",
+ /* 318 */ "compare_op ::= NOT LIKE",
+ /* 319 */ "compare_op ::= MATCH",
+ /* 320 */ "compare_op ::= NMATCH",
+ /* 321 */ "in_op ::= IN",
+ /* 322 */ "in_op ::= NOT IN",
+ /* 323 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
+ /* 324 */ "boolean_value_expression ::= boolean_primary",
+ /* 325 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 326 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 327 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 328 */ "boolean_primary ::= predicate",
+ /* 329 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 330 */ "common_expression ::= expression",
+ /* 331 */ "common_expression ::= boolean_value_expression",
+ /* 332 */ "from_clause ::= FROM table_reference_list",
+ /* 333 */ "table_reference_list ::= table_reference",
+ /* 334 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 335 */ "table_reference ::= table_primary",
+ /* 336 */ "table_reference ::= joined_table",
+ /* 337 */ "table_primary ::= table_name alias_opt",
+ /* 338 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 339 */ "table_primary ::= subquery alias_opt",
+ /* 340 */ "table_primary ::= parenthesized_joined_table",
+ /* 341 */ "alias_opt ::=",
+ /* 342 */ "alias_opt ::= table_alias",
+ /* 343 */ "alias_opt ::= AS table_alias",
+ /* 344 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 345 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 346 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
+ /* 347 */ "join_type ::=",
+ /* 348 */ "join_type ::= INNER",
+ /* 349 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
+ /* 350 */ "set_quantifier_opt ::=",
+ /* 351 */ "set_quantifier_opt ::= DISTINCT",
+ /* 352 */ "set_quantifier_opt ::= ALL",
+ /* 353 */ "select_list ::= NK_STAR",
+ /* 354 */ "select_list ::= select_sublist",
+ /* 355 */ "select_sublist ::= select_item",
+ /* 356 */ "select_sublist ::= select_sublist NK_COMMA select_item",
+ /* 357 */ "select_item ::= common_expression",
+ /* 358 */ "select_item ::= common_expression column_alias",
+ /* 359 */ "select_item ::= common_expression AS column_alias",
+ /* 360 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 361 */ "where_clause_opt ::=",
+ /* 362 */ "where_clause_opt ::= WHERE search_condition",
+ /* 363 */ "partition_by_clause_opt ::=",
+ /* 364 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
+ /* 365 */ "twindow_clause_opt ::=",
+ /* 366 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
+ /* 367 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
+ /* 368 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
+ /* 369 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
+ /* 370 */ "sliding_opt ::=",
+ /* 371 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
+ /* 372 */ "fill_opt ::=",
+ /* 373 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 374 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
+ /* 375 */ "fill_mode ::= NONE",
+ /* 376 */ "fill_mode ::= PREV",
+ /* 377 */ "fill_mode ::= NULL",
+ /* 378 */ "fill_mode ::= LINEAR",
+ /* 379 */ "fill_mode ::= NEXT",
+ /* 380 */ "group_by_clause_opt ::=",
+ /* 381 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 382 */ "group_by_list ::= expression",
+ /* 383 */ "group_by_list ::= group_by_list NK_COMMA expression",
+ /* 384 */ "having_clause_opt ::=",
+ /* 385 */ "having_clause_opt ::= HAVING search_condition",
+ /* 386 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 387 */ "query_expression_body ::= query_primary",
+ /* 388 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
+ /* 389 */ "query_primary ::= query_specification",
+ /* 390 */ "order_by_clause_opt ::=",
+ /* 391 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 392 */ "slimit_clause_opt ::=",
+ /* 393 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 394 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 395 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 396 */ "limit_clause_opt ::=",
+ /* 397 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 398 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 399 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 400 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 401 */ "search_condition ::= common_expression",
+ /* 402 */ "sort_specification_list ::= sort_specification",
+ /* 403 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 404 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
+ /* 405 */ "ordering_specification_opt ::=",
+ /* 406 */ "ordering_specification_opt ::= ASC",
+ /* 407 */ "ordering_specification_opt ::= DESC",
+ /* 408 */ "null_ordering_opt ::=",
+ /* 409 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 410 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
@@ -1649,156 +1652,156 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
- case 208: /* cmd */
- case 211: /* literal */
- case 218: /* db_options */
- case 220: /* alter_db_options */
- case 225: /* retention */
- case 226: /* full_table_name */
- case 229: /* table_options */
- case 233: /* alter_table_clause */
- case 234: /* alter_table_options */
- case 237: /* create_subtable_clause */
- case 240: /* drop_table_clause */
- case 243: /* column_def */
- case 246: /* col_name */
- case 247: /* db_name_cond_opt */
- case 248: /* like_pattern_opt */
- case 249: /* table_name_cond */
- case 250: /* from_db_opt */
- case 251: /* func_name */
- case 254: /* index_options */
- case 256: /* duration_literal */
- case 257: /* sliding_opt */
- case 258: /* func */
- case 261: /* query_expression */
- case 263: /* explain_options */
- case 268: /* signed */
- case 269: /* signed_literal */
- case 272: /* expression */
- case 273: /* pseudo_column */
- case 274: /* column_reference */
- case 275: /* subquery */
- case 276: /* predicate */
- case 279: /* in_predicate_value */
- case 280: /* boolean_value_expression */
- case 281: /* boolean_primary */
- case 282: /* common_expression */
- case 283: /* from_clause */
- case 284: /* table_reference_list */
- case 285: /* table_reference */
- case 286: /* table_primary */
- case 287: /* joined_table */
- case 289: /* parenthesized_joined_table */
- case 291: /* search_condition */
- case 292: /* query_specification */
- case 295: /* where_clause_opt */
- case 297: /* twindow_clause_opt */
- case 299: /* having_clause_opt */
- case 301: /* select_item */
- case 302: /* fill_opt */
- case 305: /* query_expression_body */
- case 307: /* slimit_clause_opt */
- case 308: /* limit_clause_opt */
- case 309: /* query_primary */
- case 311: /* sort_specification */
+ case 209: /* cmd */
+ case 212: /* literal */
+ case 219: /* db_options */
+ case 221: /* alter_db_options */
+ case 226: /* retention */
+ case 227: /* full_table_name */
+ case 230: /* table_options */
+ case 234: /* alter_table_clause */
+ case 235: /* alter_table_options */
+ case 238: /* create_subtable_clause */
+ case 241: /* drop_table_clause */
+ case 244: /* column_def */
+ case 247: /* col_name */
+ case 248: /* db_name_cond_opt */
+ case 249: /* like_pattern_opt */
+ case 250: /* table_name_cond */
+ case 251: /* from_db_opt */
+ case 252: /* func_name */
+ case 255: /* index_options */
+ case 257: /* duration_literal */
+ case 258: /* sliding_opt */
+ case 259: /* func */
+ case 262: /* query_expression */
+ case 264: /* explain_options */
+ case 269: /* signed */
+ case 270: /* signed_literal */
+ case 273: /* expression */
+ case 274: /* pseudo_column */
+ case 275: /* column_reference */
+ case 276: /* subquery */
+ case 277: /* predicate */
+ case 280: /* in_predicate_value */
+ case 281: /* boolean_value_expression */
+ case 282: /* boolean_primary */
+ case 283: /* common_expression */
+ case 284: /* from_clause */
+ case 285: /* table_reference_list */
+ case 286: /* table_reference */
+ case 287: /* table_primary */
+ case 288: /* joined_table */
+ case 290: /* parenthesized_joined_table */
+ case 292: /* search_condition */
+ case 293: /* query_specification */
+ case 296: /* where_clause_opt */
+ case 298: /* twindow_clause_opt */
+ case 300: /* having_clause_opt */
+ case 302: /* select_item */
+ case 303: /* fill_opt */
+ case 306: /* query_expression_body */
+ case 308: /* slimit_clause_opt */
+ case 309: /* limit_clause_opt */
+ case 310: /* query_primary */
+ case 312: /* sort_specification */
{
- nodesDestroyNode((yypminor->yy140));
+ nodesDestroyNode((yypminor->yy182));
}
break;
- case 209: /* account_options */
- case 210: /* alter_account_options */
- case 212: /* alter_account_option */
- case 265: /* bufsize_opt */
+ case 210: /* account_options */
+ case 211: /* alter_account_options */
+ case 213: /* alter_account_option */
+ case 266: /* bufsize_opt */
{
}
break;
- case 213: /* user_name */
- case 214: /* dnode_endpoint */
- case 215: /* dnode_host_name */
- case 217: /* db_name */
- case 235: /* column_name */
- case 242: /* table_name */
- case 252: /* function_name */
- case 253: /* index_name */
- case 260: /* topic_name */
- case 266: /* stream_name */
- case 270: /* table_alias */
- case 271: /* column_alias */
- case 288: /* alias_opt */
+ case 214: /* user_name */
+ case 215: /* dnode_endpoint */
+ case 216: /* dnode_host_name */
+ case 218: /* db_name */
+ case 236: /* column_name */
+ case 243: /* table_name */
+ case 253: /* function_name */
+ case 254: /* index_name */
+ case 261: /* topic_name */
+ case 267: /* stream_name */
+ case 271: /* table_alias */
+ case 272: /* column_alias */
+ case 289: /* alias_opt */
{
}
break;
- case 216: /* not_exists_opt */
- case 219: /* exists_opt */
- case 262: /* analyze_opt */
- case 264: /* agg_func_opt */
- case 293: /* set_quantifier_opt */
+ case 217: /* not_exists_opt */
+ case 220: /* exists_opt */
+ case 263: /* analyze_opt */
+ case 265: /* agg_func_opt */
+ case 294: /* set_quantifier_opt */
{
}
break;
- case 221: /* integer_list */
- case 222: /* variable_list */
- case 223: /* retention_list */
- case 227: /* column_def_list */
- case 228: /* tags_def_opt */
- case 230: /* multi_create_clause */
- case 231: /* tags_def */
- case 232: /* multi_drop_clause */
- case 238: /* specific_tags_opt */
- case 239: /* literal_list */
- case 241: /* col_name_list */
- case 244: /* func_name_list */
- case 255: /* func_list */
- case 259: /* expression_list */
- case 267: /* dnode_list */
- case 294: /* select_list */
- case 296: /* partition_by_clause_opt */
- case 298: /* group_by_clause_opt */
- case 300: /* select_sublist */
- case 304: /* group_by_list */
- case 306: /* order_by_clause_opt */
- case 310: /* sort_specification_list */
+ case 222: /* integer_list */
+ case 223: /* variable_list */
+ case 224: /* retention_list */
+ case 228: /* column_def_list */
+ case 229: /* tags_def_opt */
+ case 231: /* multi_create_clause */
+ case 232: /* tags_def */
+ case 233: /* multi_drop_clause */
+ case 239: /* specific_tags_opt */
+ case 240: /* literal_list */
+ case 242: /* col_name_list */
+ case 245: /* func_name_list */
+ case 256: /* func_list */
+ case 260: /* expression_list */
+ case 268: /* dnode_list */
+ case 295: /* select_list */
+ case 297: /* partition_by_clause_opt */
+ case 299: /* group_by_clause_opt */
+ case 301: /* select_sublist */
+ case 305: /* group_by_list */
+ case 307: /* order_by_clause_opt */
+ case 311: /* sort_specification_list */
{
- nodesDestroyList((yypminor->yy220));
+ nodesDestroyList((yypminor->yy334));
}
break;
- case 224: /* alter_db_option */
- case 245: /* alter_table_option */
+ case 225: /* alter_db_option */
+ case 246: /* alter_table_option */
{
}
break;
- case 236: /* type_name */
+ case 237: /* type_name */
{
}
break;
- case 277: /* compare_op */
- case 278: /* in_op */
+ case 278: /* compare_op */
+ case 279: /* in_op */
{
}
break;
- case 290: /* join_type */
+ case 291: /* join_type */
{
}
break;
- case 303: /* fill_mode */
+ case 304: /* fill_mode */
{
}
break;
- case 312: /* ordering_specification_opt */
+ case 313: /* ordering_specification_opt */
{
}
break;
- case 313: /* null_ordering_opt */
+ case 314: /* null_ordering_opt */
{
}
@@ -1926,15 +1929,18 @@ static YYACTIONTYPE yy_find_shift_action(
do{
i = yy_shift_ofst[stateno];
assert( i>=0 );
- /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
+ assert( i<=YY_ACTTAB_COUNT );
+ assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
- if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
+ assert( i<(int)YY_NLOOKAHEAD );
+ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
- if( iLookAhead %s\n",
@@ -1949,16 +1955,8 @@ static YYACTIONTYPE yy_find_shift_action(
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
- if(
-#if YY_SHIFT_MIN+YYWILDCARD<0
- j>=0 &&
-#endif
-#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
- j0
- ){
+ assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
+ if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
@@ -1972,6 +1970,7 @@ static YYACTIONTYPE yy_find_shift_action(
#endif /* YYWILDCARD */
return yy_default[stateno];
}else{
+ assert( i>=0 && iyytos;
#ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
- yysize = yyRuleInfo[yyruleno].nrhs;
+ yysize = yyRuleInfoNRhs[yyruleno];
if( yysize ){
- fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
+ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
yyTracePrompt,
- yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
+ yyruleno, yyRuleName[yyruleno],
+ yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
@@ -2595,11 +3010,11 @@ static YYACTIONTYPE yy_reduce(
YYMINORTYPE yylhsminor;
case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
- yy_destructor(yypParser,209,&yymsp[0].minor);
+ yy_destructor(yypParser,210,&yymsp[0].minor);
break;
case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
- yy_destructor(yypParser,210,&yymsp[0].minor);
+ yy_destructor(yypParser,211,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
{ }
@@ -2613,20 +3028,20 @@ static YYACTIONTYPE yy_reduce(
case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9);
case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
-{ yy_destructor(yypParser,209,&yymsp[-2].minor);
+{ yy_destructor(yypParser,210,&yymsp[-2].minor);
{ }
- yy_destructor(yypParser,211,&yymsp[0].minor);
+ yy_destructor(yypParser,212,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
-{ yy_destructor(yypParser,212,&yymsp[0].minor);
+{ yy_destructor(yypParser,213,&yymsp[0].minor);
{ }
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
-{ yy_destructor(yypParser,210,&yymsp[-1].minor);
+{ yy_destructor(yypParser,211,&yymsp[-1].minor);
{ }
- yy_destructor(yypParser,212,&yymsp[0].minor);
+ yy_destructor(yypParser,213,&yymsp[0].minor);
}
break;
case 14: /* alter_account_option ::= PASS literal */
@@ -2640,31 +3055,31 @@ static YYACTIONTYPE yy_reduce(
case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
{ }
- yy_destructor(yypParser,211,&yymsp[0].minor);
+ yy_destructor(yypParser,212,&yymsp[0].minor);
break;
case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
break;
case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy253, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
break;
case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy253, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy29, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
break;
case 27: /* cmd ::= DROP USER user_name */
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy253, NULL); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy29, NULL); }
break;
case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
break;
case 30: /* cmd ::= DROP DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
break;
case 31: /* cmd ::= DROP DNODE dnode_endpoint */
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
@@ -2693,8 +3108,8 @@ static YYACTIONTYPE yy_reduce(
case 274: /* index_name ::= NK_ID */ yytestcase(yyruleno==274);
case 275: /* topic_name ::= NK_ID */ yytestcase(yyruleno==275);
case 276: /* stream_name ::= NK_ID */ yytestcase(yyruleno==276);
-{ yylhsminor.yy253 = yymsp[0].minor.yy0; }
- yymsp[0].minor.yy253 = yylhsminor.yy253;
+{ yylhsminor.yy29 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy29 = yylhsminor.yy29;
break;
case 39: /* cmd ::= ALTER LOCAL NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
@@ -2727,156 +3142,156 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
break;
case 49: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
-{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy273, &yymsp[-1].minor.yy253, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy47, &yymsp[-1].minor.yy29, yymsp[0].minor.yy182); }
break;
case 50: /* cmd ::= DROP DATABASE exists_opt db_name */
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy273, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy47, &yymsp[0].minor.yy29); }
break;
case 51: /* cmd ::= USE db_name */
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 52: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy253, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy182); }
break;
case 53: /* not_exists_opt ::= IF NOT EXISTS */
-{ yymsp[-2].minor.yy273 = true; }
+{ yymsp[-2].minor.yy47 = true; }
break;
case 54: /* not_exists_opt ::= */
case 56: /* exists_opt ::= */ yytestcase(yyruleno==56);
case 220: /* analyze_opt ::= */ yytestcase(yyruleno==220);
case 228: /* agg_func_opt ::= */ yytestcase(yyruleno==228);
- case 349: /* set_quantifier_opt ::= */ yytestcase(yyruleno==349);
-{ yymsp[1].minor.yy273 = false; }
+ case 350: /* set_quantifier_opt ::= */ yytestcase(yyruleno==350);
+{ yymsp[1].minor.yy47 = false; }
break;
case 55: /* exists_opt ::= IF EXISTS */
-{ yymsp[-1].minor.yy273 = true; }
+{ yymsp[-1].minor.yy47 = true; }
break;
case 57: /* db_options ::= */
-{ yymsp[1].minor.yy140 = createDatabaseOptions(pCxt); }
+{ yymsp[1].minor.yy182 = createDatabaseOptions(pCxt); }
break;
case 58: /* db_options ::= db_options BLOCKS NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pNumOfBlocks = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pNumOfBlocks = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 59: /* db_options ::= db_options CACHE NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pCacheBlockSize = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCacheBlockSize = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 60: /* db_options ::= db_options CACHELAST NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pCachelast = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCachelast = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 61: /* db_options ::= db_options COMP NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pCompressionLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pCompressionLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 62: /* db_options ::= db_options DAYS NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pDaysPerFile = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pDaysPerFile = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 63: /* db_options ::= db_options DAYS NK_VARIABLE */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 64: /* db_options ::= db_options FSYNC NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pFsyncPeriod = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pFsyncPeriod = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 65: /* db_options ::= db_options MAXROWS NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pMaxRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pMaxRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 66: /* db_options ::= db_options MINROWS NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pMinRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pMinRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 67: /* db_options ::= db_options KEEP integer_list */
case 68: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==68);
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pKeep = yymsp[0].minor.yy220; yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pKeep = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 69: /* db_options ::= db_options PRECISION NK_STRING */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pPrecision = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pPrecision = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 70: /* db_options ::= db_options QUORUM NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pQuorum = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pQuorum = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 71: /* db_options ::= db_options REPLICA NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pReplica = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pReplica = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 72: /* db_options ::= db_options TTL NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 73: /* db_options ::= db_options WAL NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pWalLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pWalLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 74: /* db_options ::= db_options VGROUPS NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pNumOfVgroups = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pNumOfVgroups = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 75: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pSingleStable = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pSingleStable = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 76: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pStreamMode = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pStreamMode = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 77: /* db_options ::= db_options RETENTIONS retention_list */
-{ ((SDatabaseOptions*)yymsp[-2].minor.yy140)->pRetentions = yymsp[0].minor.yy220; yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((SDatabaseOptions*)yymsp[-2].minor.yy182)->pRetentions = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 78: /* alter_db_options ::= alter_db_option */
-{ yylhsminor.yy140 = createDatabaseOptions(pCxt); yylhsminor.yy140 = setDatabaseAlterOption(pCxt, yylhsminor.yy140, &yymsp[0].minor.yy181); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createDatabaseOptions(pCxt); yylhsminor.yy182 = setDatabaseAlterOption(pCxt, yylhsminor.yy182, &yymsp[0].minor.yy515); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 79: /* alter_db_options ::= alter_db_options alter_db_option */
-{ yylhsminor.yy140 = setDatabaseAlterOption(pCxt, yymsp[-1].minor.yy140, &yymsp[0].minor.yy181); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = setDatabaseAlterOption(pCxt, yymsp[-1].minor.yy182, &yymsp[0].minor.yy515); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 80: /* alter_db_option ::= BLOCKS NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 81: /* alter_db_option ::= FSYNC NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 82: /* alter_db_option ::= KEEP integer_list */
case 83: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==83);
-{ yymsp[-1].minor.yy181.type = DB_OPTION_KEEP; yymsp[-1].minor.yy181.pList = yymsp[0].minor.yy220; }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_KEEP; yymsp[-1].minor.yy515.pList = yymsp[0].minor.yy334; }
break;
case 84: /* alter_db_option ::= WAL NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_WAL; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_WAL; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 85: /* alter_db_option ::= QUORUM NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 86: /* alter_db_option ::= CACHELAST NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 87: /* alter_db_option ::= REPLICA NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 88: /* integer_list ::= NK_INTEGER */
-{ yylhsminor.yy220 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
case 89: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
case 240: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==240);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy334 = yylhsminor.yy334;
break;
case 90: /* variable_list ::= NK_VARIABLE */
-{ yylhsminor.yy220 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
case 91: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy334 = yylhsminor.yy334;
break;
case 92: /* retention_list ::= retention */
case 112: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==112);
@@ -2886,10 +3301,10 @@ static YYACTIONTYPE yy_reduce(
case 201: /* func_name_list ::= func_name */ yytestcase(yyruleno==201);
case 210: /* func_list ::= func */ yytestcase(yyruleno==210);
case 263: /* literal_list ::= signed_literal */ yytestcase(yyruleno==263);
- case 354: /* select_sublist ::= select_item */ yytestcase(yyruleno==354);
- case 401: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==401);
-{ yylhsminor.yy220 = createNodeList(pCxt, yymsp[0].minor.yy140); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 355: /* select_sublist ::= select_item */ yytestcase(yyruleno==355);
+ case 402: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==402);
+{ yylhsminor.yy334 = createNodeList(pCxt, yymsp[0].minor.yy182); }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
case 93: /* retention_list ::= retention_list NK_COMMA retention */
case 123: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==123);
@@ -2897,238 +3312,238 @@ static YYACTIONTYPE yy_reduce(
case 202: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==202);
case 211: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==211);
case 264: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==264);
- case 355: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==355);
- case 402: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==402);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, yymsp[0].minor.yy140); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+ case 356: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==356);
+ case 403: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==403);
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, yymsp[0].minor.yy182); }
+ yymsp[-2].minor.yy334 = yylhsminor.yy334;
break;
case 94: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
-{ yylhsminor.yy140 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 95: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
case 97: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==97);
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy273, yymsp[-5].minor.yy140, yymsp[-3].minor.yy220, yymsp[-1].minor.yy220, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy47, yymsp[-5].minor.yy182, yymsp[-3].minor.yy334, yymsp[-1].minor.yy334, yymsp[0].minor.yy182); }
break;
case 96: /* cmd ::= CREATE TABLE multi_create_clause */
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy220); }
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy334); }
break;
case 98: /* cmd ::= DROP TABLE multi_drop_clause */
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy220); }
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy334); }
break;
case 99: /* cmd ::= DROP STABLE exists_opt full_table_name */
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy273, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy47, yymsp[0].minor.yy182); }
break;
case 100: /* cmd ::= ALTER TABLE alter_table_clause */
case 101: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==101);
case 242: /* cmd ::= query_expression */ yytestcase(yyruleno==242);
-{ pCxt->pRootNode = yymsp[0].minor.yy140; }
+{ pCxt->pRootNode = yymsp[0].minor.yy182; }
break;
case 102: /* alter_table_clause ::= full_table_name alter_table_options */
-{ yylhsminor.yy140 = createAlterTableOption(pCxt, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableOption(pCxt, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 103: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy253, yymsp[0].minor.yy368); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 104: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-{ yylhsminor.yy140 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy140, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy253); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy182, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy29); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 105: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy253, yymsp[0].minor.yy368); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 106: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-{ yylhsminor.yy140 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy253, &yymsp[0].minor.yy253); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 107: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy253, yymsp[0].minor.yy368); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 108: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-{ yylhsminor.yy140 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy140, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy253); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy182, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy29); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 109: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy253, yymsp[0].minor.yy368); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 110: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-{ yylhsminor.yy140 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy253, &yymsp[0].minor.yy253); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy182, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 111: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
-{ yylhsminor.yy140 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy140, &yymsp[-2].minor.yy253, yymsp[0].minor.yy140); }
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy182, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182); }
+ yymsp[-5].minor.yy182 = yylhsminor.yy182;
break;
case 113: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
case 116: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==116);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-1].minor.yy220, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-1].minor.yy334, yymsp[0].minor.yy182); }
+ yymsp[-1].minor.yy334 = yylhsminor.yy334;
break;
case 114: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
-{ yylhsminor.yy140 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy273, yymsp[-7].minor.yy140, yymsp[-5].minor.yy140, yymsp[-4].minor.yy220, yymsp[-1].minor.yy220); }
- yymsp[-8].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy47, yymsp[-7].minor.yy182, yymsp[-5].minor.yy182, yymsp[-4].minor.yy334, yymsp[-1].minor.yy334); }
+ yymsp[-8].minor.yy182 = yylhsminor.yy182;
break;
case 117: /* drop_table_clause ::= exists_opt full_table_name */
-{ yylhsminor.yy140 = createDropTableClause(pCxt, yymsp[-1].minor.yy273, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createDropTableClause(pCxt, yymsp[-1].minor.yy47, yymsp[0].minor.yy182); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 118: /* specific_tags_opt ::= */
case 149: /* tags_def_opt ::= */ yytestcase(yyruleno==149);
- case 362: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==362);
- case 379: /* group_by_clause_opt ::= */ yytestcase(yyruleno==379);
- case 389: /* order_by_clause_opt ::= */ yytestcase(yyruleno==389);
-{ yymsp[1].minor.yy220 = NULL; }
+ case 363: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==363);
+ case 380: /* group_by_clause_opt ::= */ yytestcase(yyruleno==380);
+ case 390: /* order_by_clause_opt ::= */ yytestcase(yyruleno==390);
+{ yymsp[1].minor.yy334 = NULL; }
break;
case 119: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
-{ yymsp[-2].minor.yy220 = yymsp[-1].minor.yy220; }
+{ yymsp[-2].minor.yy334 = yymsp[-1].minor.yy334; }
break;
case 120: /* full_table_name ::= table_name */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy253, NULL); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy29, NULL); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 121: /* full_table_name ::= db_name NK_DOT table_name */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy253, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRealTableNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, NULL); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 124: /* column_def ::= column_name type_name */
-{ yylhsminor.yy140 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy253, yymsp[0].minor.yy368, NULL); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy29, yymsp[0].minor.yy574, NULL); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 125: /* column_def ::= column_name type_name COMMENT NK_STRING */
-{ yylhsminor.yy140 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy253, yymsp[-2].minor.yy368, &yymsp[0].minor.yy0); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-2].minor.yy574, &yymsp[0].minor.yy0); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 126: /* type_name ::= BOOL */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_BOOL); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
case 127: /* type_name ::= TINYINT */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
case 128: /* type_name ::= SMALLINT */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
case 129: /* type_name ::= INT */
case 130: /* type_name ::= INTEGER */ yytestcase(yyruleno==130);
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_INT); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_INT); }
break;
case 131: /* type_name ::= BIGINT */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
case 132: /* type_name ::= FLOAT */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
case 133: /* type_name ::= DOUBLE */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
case 134: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy368 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
case 135: /* type_name ::= TIMESTAMP */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
case 136: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy368 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
case 137: /* type_name ::= TINYINT UNSIGNED */
-{ yymsp[-1].minor.yy368 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
case 138: /* type_name ::= SMALLINT UNSIGNED */
-{ yymsp[-1].minor.yy368 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
case 139: /* type_name ::= INT UNSIGNED */
-{ yymsp[-1].minor.yy368 = createDataType(TSDB_DATA_TYPE_UINT); }
+{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
case 140: /* type_name ::= BIGINT UNSIGNED */
-{ yymsp[-1].minor.yy368 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+{ yymsp[-1].minor.yy574 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
case 141: /* type_name ::= JSON */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_JSON); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
case 142: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy368 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
case 143: /* type_name ::= MEDIUMBLOB */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
case 144: /* type_name ::= BLOB */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_BLOB); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
case 145: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy368 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+{ yymsp[-3].minor.yy574 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
case 146: /* type_name ::= DECIMAL */
-{ yymsp[0].minor.yy368 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[0].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 147: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy368 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[-3].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 148: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy368 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+{ yymsp[-5].minor.yy574 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 150: /* tags_def_opt ::= tags_def */
- case 353: /* select_list ::= select_sublist */ yytestcase(yyruleno==353);
-{ yylhsminor.yy220 = yymsp[0].minor.yy220; }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 354: /* select_list ::= select_sublist */ yytestcase(yyruleno==354);
+{ yylhsminor.yy334 = yymsp[0].minor.yy334; }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
case 151: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
-{ yymsp[-3].minor.yy220 = yymsp[-1].minor.yy220; }
+{ yymsp[-3].minor.yy334 = yymsp[-1].minor.yy334; }
break;
case 152: /* table_options ::= */
-{ yymsp[1].minor.yy140 = createTableOptions(pCxt); }
+{ yymsp[1].minor.yy182 = createTableOptions(pCxt); }
break;
case 153: /* table_options ::= table_options COMMENT NK_STRING */
-{ ((STableOptions*)yymsp[-2].minor.yy140)->pComments = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-2].minor.yy182)->pComments = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 154: /* table_options ::= table_options KEEP integer_list */
-{ ((STableOptions*)yymsp[-2].minor.yy140)->pKeep = yymsp[0].minor.yy220; yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-2].minor.yy182)->pKeep = yymsp[0].minor.yy334; yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 155: /* table_options ::= table_options TTL NK_INTEGER */
-{ ((STableOptions*)yymsp[-2].minor.yy140)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-2].minor.yy182)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 156: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-{ ((STableOptions*)yymsp[-4].minor.yy140)->pSma = yymsp[-1].minor.yy220; yylhsminor.yy140 = yymsp[-4].minor.yy140; }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-4].minor.yy182)->pSma = yymsp[-1].minor.yy334; yylhsminor.yy182 = yymsp[-4].minor.yy182; }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 157: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
-{ ((STableOptions*)yymsp[-4].minor.yy140)->pFuncs = yymsp[-1].minor.yy220; yylhsminor.yy140 = yymsp[-4].minor.yy140; }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-4].minor.yy182)->pFuncs = yymsp[-1].minor.yy334; yylhsminor.yy182 = yymsp[-4].minor.yy182; }
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
case 158: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
-{ ((STableOptions*)yymsp[-2].minor.yy140)->pFilesFactor = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-2].minor.yy182)->pFilesFactor = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 159: /* table_options ::= table_options DELAY NK_INTEGER */
-{ ((STableOptions*)yymsp[-2].minor.yy140)->pDelay = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ ((STableOptions*)yymsp[-2].minor.yy182)->pDelay = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy182 = yymsp[-2].minor.yy182; }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 160: /* alter_table_options ::= alter_table_option */
-{ yylhsminor.yy140 = createTableOptions(pCxt); yylhsminor.yy140 = setTableAlterOption(pCxt, yylhsminor.yy140, &yymsp[0].minor.yy181); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createTableOptions(pCxt); yylhsminor.yy182 = setTableAlterOption(pCxt, yylhsminor.yy182, &yymsp[0].minor.yy515); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 161: /* alter_table_options ::= alter_table_options alter_table_option */
-{ yylhsminor.yy140 = setTableAlterOption(pCxt, yymsp[-1].minor.yy140, &yymsp[0].minor.yy181); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = setTableAlterOption(pCxt, yymsp[-1].minor.yy182, &yymsp[0].minor.yy515); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 162: /* alter_table_option ::= COMMENT NK_STRING */
-{ yymsp[-1].minor.yy181.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
case 163: /* alter_table_option ::= KEEP integer_list */
-{ yymsp[-1].minor.yy181.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy181.pList = yymsp[0].minor.yy220; }
+{ yymsp[-1].minor.yy515.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy515.pList = yymsp[0].minor.yy334; }
break;
case 164: /* alter_table_option ::= TTL NK_INTEGER */
-{ yymsp[-1].minor.yy181.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy181.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy515.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy515.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 167: /* col_name ::= column_name */
-{ yylhsminor.yy140 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy253); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 168: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
@@ -3140,13 +3555,13 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
break;
case 171: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy140, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
break;
case 172: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy140, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
break;
case 173: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy140, NULL); }
+{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy182, NULL); }
break;
case 174: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
@@ -3161,7 +3576,7 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
break;
case 178: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
break;
case 179: /* cmd ::= SHOW STREAMS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
@@ -3180,13 +3595,13 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); }
break;
case 185: /* cmd ::= SHOW CREATE DATABASE db_name */
-{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 186: /* cmd ::= SHOW CREATE TABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy182); }
break;
case 187: /* cmd ::= SHOW CREATE STABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy182); }
break;
case 188: /* cmd ::= SHOW QUERIES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); }
@@ -3208,111 +3623,111 @@ static YYACTIONTYPE yy_reduce(
break;
case 194: /* db_name_cond_opt ::= */
case 199: /* from_db_opt ::= */ yytestcase(yyruleno==199);
-{ yymsp[1].minor.yy140 = createDefaultDatabaseCondValue(pCxt); }
+{ yymsp[1].minor.yy182 = createDefaultDatabaseCondValue(pCxt); }
break;
case 195: /* db_name_cond_opt ::= db_name NK_DOT */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy253); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy29); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 196: /* like_pattern_opt ::= */
case 207: /* index_options ::= */ yytestcase(yyruleno==207);
- case 360: /* where_clause_opt ::= */ yytestcase(yyruleno==360);
- case 364: /* twindow_clause_opt ::= */ yytestcase(yyruleno==364);
- case 369: /* sliding_opt ::= */ yytestcase(yyruleno==369);
- case 371: /* fill_opt ::= */ yytestcase(yyruleno==371);
- case 383: /* having_clause_opt ::= */ yytestcase(yyruleno==383);
- case 391: /* slimit_clause_opt ::= */ yytestcase(yyruleno==391);
- case 395: /* limit_clause_opt ::= */ yytestcase(yyruleno==395);
-{ yymsp[1].minor.yy140 = NULL; }
+ case 361: /* where_clause_opt ::= */ yytestcase(yyruleno==361);
+ case 365: /* twindow_clause_opt ::= */ yytestcase(yyruleno==365);
+ case 370: /* sliding_opt ::= */ yytestcase(yyruleno==370);
+ case 372: /* fill_opt ::= */ yytestcase(yyruleno==372);
+ case 384: /* having_clause_opt ::= */ yytestcase(yyruleno==384);
+ case 392: /* slimit_clause_opt ::= */ yytestcase(yyruleno==392);
+ case 396: /* limit_clause_opt ::= */ yytestcase(yyruleno==396);
+{ yymsp[1].minor.yy182 = NULL; }
break;
case 197: /* like_pattern_opt ::= LIKE NK_STRING */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
case 198: /* table_name_cond ::= table_name */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy253); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy29); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 200: /* from_db_opt ::= FROM db_name */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy253); }
+{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy29); }
break;
case 203: /* func_name ::= function_name */
-{ yylhsminor.yy140 = createFunctionNode(pCxt, &yymsp[0].minor.yy253, NULL); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createFunctionNode(pCxt, &yymsp[0].minor.yy29, NULL); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 204: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy273, &yymsp[-3].minor.yy253, &yymsp[-1].minor.yy253, NULL, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy47, &yymsp[-3].minor.yy29, &yymsp[-1].minor.yy29, NULL, yymsp[0].minor.yy182); }
break;
case 205: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy273, &yymsp[-5].minor.yy253, &yymsp[-3].minor.yy253, yymsp[-1].minor.yy220, NULL); }
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy47, &yymsp[-5].minor.yy29, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334, NULL); }
break;
case 206: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29); }
break;
case 208: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
-{ yymsp[-8].minor.yy140 = createIndexOption(pCxt, yymsp[-6].minor.yy220, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), NULL, yymsp[0].minor.yy140); }
+{ yymsp[-8].minor.yy182 = createIndexOption(pCxt, yymsp[-6].minor.yy334, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), NULL, yymsp[0].minor.yy182); }
break;
case 209: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
-{ yymsp[-10].minor.yy140 = createIndexOption(pCxt, yymsp[-8].minor.yy220, releaseRawExprNode(pCxt, yymsp[-4].minor.yy140), releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), yymsp[0].minor.yy140); }
+{ yymsp[-10].minor.yy182 = createIndexOption(pCxt, yymsp[-8].minor.yy334, releaseRawExprNode(pCxt, yymsp[-4].minor.yy182), releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), yymsp[0].minor.yy182); }
break;
case 212: /* func ::= function_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy140 = createFunctionNode(pCxt, &yymsp[-3].minor.yy253, yymsp[-1].minor.yy220); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 213: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
-{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy253, yymsp[0].minor.yy140, NULL); }
+{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182, NULL); }
break;
case 214: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
-{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy253, NULL, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy47, &yymsp[-2].minor.yy29, NULL, &yymsp[0].minor.yy29); }
break;
case 215: /* cmd ::= DROP TOPIC exists_opt topic_name */
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy273, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy47, &yymsp[0].minor.yy29); }
break;
case 216: /* cmd ::= DESC full_table_name */
case 217: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==217);
-{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy182); }
break;
case 218: /* cmd ::= RESET QUERY CACHE */
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
break;
case 219: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
-{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy273, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy47, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
break;
case 221: /* analyze_opt ::= ANALYZE */
case 229: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==229);
- case 350: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==350);
-{ yymsp[0].minor.yy273 = true; }
+ case 351: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==351);
+{ yymsp[0].minor.yy47 = true; }
break;
case 222: /* explain_options ::= */
-{ yymsp[1].minor.yy140 = createDefaultExplainOptions(pCxt); }
+{ yymsp[1].minor.yy182 = createDefaultExplainOptions(pCxt); }
break;
case 223: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-{ yylhsminor.yy140 = setExplainVerbose(pCxt, yymsp[-2].minor.yy140, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = setExplainVerbose(pCxt, yymsp[-2].minor.yy182, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 224: /* explain_options ::= explain_options RATIO NK_FLOAT */
-{ yylhsminor.yy140 = setExplainRatio(pCxt, yymsp[-2].minor.yy140, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = setExplainRatio(pCxt, yymsp[-2].minor.yy182, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 225: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
-{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy220); }
+{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy334); }
break;
case 226: /* cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
-{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy273, &yymsp[-5].minor.yy253, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy368, yymsp[0].minor.yy528); }
+{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy47, &yymsp[-5].minor.yy29, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy574, yymsp[0].minor.yy550); }
break;
case 227: /* cmd ::= DROP FUNCTION function_name */
-{ pCxt->pRootNode = createDropFunctionStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropFunctionStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 230: /* bufsize_opt ::= */
-{ yymsp[1].minor.yy528 = 0; }
+{ yymsp[1].minor.yy550 = 0; }
break;
case 231: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
-{ yymsp[-1].minor.yy528 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
+{ yymsp[-1].minor.yy550 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 232: /* cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression */
-{ pCxt->pRootNode = createCreateStreamStmt(pCxt, &yymsp[-4].minor.yy253, &yymsp[-2].minor.yy253, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCreateStreamStmt(pCxt, &yymsp[-4].minor.yy29, &yymsp[-2].minor.yy29, yymsp[0].minor.yy182); }
break;
case 233: /* cmd ::= DROP STREAM stream_name */
-{ pCxt->pRootNode = createDropStreamStmt(pCxt, &yymsp[0].minor.yy253); }
+{ pCxt->pRootNode = createDropStreamStmt(pCxt, &yymsp[0].minor.yy29); }
break;
case 234: /* cmd ::= KILL CONNECTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
@@ -3324,36 +3739,36 @@ static YYACTIONTYPE yy_reduce(
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 237: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy220); }
+{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy334); }
break;
case 238: /* cmd ::= SPLIT VGROUP NK_INTEGER */
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
break;
case 239: /* dnode_list ::= DNODE NK_INTEGER */
-{ yymsp[-1].minor.yy220 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+{ yymsp[-1].minor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
break;
case 241: /* cmd ::= SYNCDB db_name REPLICA */
-{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy253); }
+{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy29); }
break;
case 243: /* literal ::= NK_INTEGER */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 244: /* literal ::= NK_FLOAT */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 245: /* literal ::= NK_STRING */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 246: /* literal ::= NK_BOOL */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 247: /* literal ::= TIMESTAMP NK_STRING */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 248: /* literal ::= duration_literal */
case 257: /* signed_literal ::= signed */ yytestcase(yyruleno==257);
@@ -3361,460 +3776,461 @@ static YYACTIONTYPE yy_reduce(
case 278: /* expression ::= pseudo_column */ yytestcase(yyruleno==278);
case 279: /* expression ::= column_reference */ yytestcase(yyruleno==279);
case 283: /* expression ::= subquery */ yytestcase(yyruleno==283);
- case 323: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==323);
- case 327: /* boolean_primary ::= predicate */ yytestcase(yyruleno==327);
- case 329: /* common_expression ::= expression */ yytestcase(yyruleno==329);
- case 330: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==330);
- case 332: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==332);
- case 334: /* table_reference ::= table_primary */ yytestcase(yyruleno==334);
- case 335: /* table_reference ::= joined_table */ yytestcase(yyruleno==335);
- case 339: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==339);
- case 386: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==386);
- case 388: /* query_primary ::= query_specification */ yytestcase(yyruleno==388);
-{ yylhsminor.yy140 = yymsp[0].minor.yy140; }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 324: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==324);
+ case 328: /* boolean_primary ::= predicate */ yytestcase(yyruleno==328);
+ case 330: /* common_expression ::= expression */ yytestcase(yyruleno==330);
+ case 331: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==331);
+ case 333: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==333);
+ case 335: /* table_reference ::= table_primary */ yytestcase(yyruleno==335);
+ case 336: /* table_reference ::= joined_table */ yytestcase(yyruleno==336);
+ case 340: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==340);
+ case 387: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==387);
+ case 389: /* query_primary ::= query_specification */ yytestcase(yyruleno==389);
+{ yylhsminor.yy182 = yymsp[0].minor.yy182; }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 249: /* literal ::= NULL */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 250: /* duration_literal ::= NK_VARIABLE */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 251: /* signed ::= NK_INTEGER */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 252: /* signed ::= NK_PLUS NK_INTEGER */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
break;
case 253: /* signed ::= NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
+ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 254: /* signed ::= NK_FLOAT */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 255: /* signed ::= NK_PLUS NK_FLOAT */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
break;
case 256: /* signed ::= NK_MINUS NK_FLOAT */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
+ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 258: /* signed_literal ::= NK_STRING */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 259: /* signed_literal ::= NK_BOOL */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 260: /* signed_literal ::= TIMESTAMP NK_STRING */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+{ yymsp[-1].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
break;
case 261: /* signed_literal ::= duration_literal */
- case 356: /* select_item ::= common_expression */ yytestcase(yyruleno==356);
- case 400: /* search_condition ::= common_expression */ yytestcase(yyruleno==400);
-{ yylhsminor.yy140 = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 357: /* select_item ::= common_expression */ yytestcase(yyruleno==357);
+ case 401: /* search_condition ::= common_expression */ yytestcase(yyruleno==401);
+{ yylhsminor.yy182 = releaseRawExprNode(pCxt, yymsp[0].minor.yy182); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 262: /* signed_literal ::= NULL */
-{ yymsp[0].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
+{ yymsp[0].minor.yy182 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
break;
case 280: /* expression ::= function_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy253, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy253, yymsp[-1].minor.yy220)); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy29, yymsp[-1].minor.yy334)); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 281: /* expression ::= function_name NK_LP NK_STAR NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy253, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy253, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy29, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
case 282: /* expression ::= function_name NK_LP expression AS type_name NK_RP */
{
- SNodeList *p = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140));
- p = addValueNodeFromTypeToList(pCxt, yymsp[-1].minor.yy368, p);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy253, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-5].minor.yy253, p));
+ SNodeList *p = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182));
+ p = addValueNodeFromTypeToList(pCxt, yymsp[-1].minor.yy574, p);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy29, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-5].minor.yy29, p));
}
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ yymsp[-5].minor.yy182 = yylhsminor.yy182;
break;
case 284: /* expression ::= NK_LP expression NK_RP */
- case 328: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==328);
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 329: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==329);
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 285: /* expression ::= NK_PLUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy140));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy182));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 286: /* expression ::= NK_MINUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy140), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy182), NULL));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
case 287: /* expression ::= expression NK_PLUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 288: /* expression ::= expression NK_MINUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 289: /* expression ::= expression NK_STAR expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 290: /* expression ::= expression NK_SLASH expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 291: /* expression ::= expression NK_REM expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 292: /* expression_list ::= expression */
-{ yylhsminor.yy220 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182)); }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
case 293: /* expression_list ::= expression_list NK_COMMA expression */
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, releaseRawExprNode(pCxt, yymsp[0].minor.yy182)); }
+ yymsp[-2].minor.yy334 = yylhsminor.yy334;
break;
case 294: /* column_reference ::= column_name */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy253, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy253)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy29, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy29)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
case 295: /* column_reference ::= table_name NK_DOT column_name */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy253, createColumnNode(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy253)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29, createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy29)); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
case 296: /* pseudo_column ::= NOW */
- case 297: /* pseudo_column ::= ROWTS */ yytestcase(yyruleno==297);
- case 298: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==298);
- case 299: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==299);
- case 300: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==300);
- case 301: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==301);
- case 302: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==302);
- case 303: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==303);
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 297: /* pseudo_column ::= TODAY */ yytestcase(yyruleno==297);
+ case 298: /* pseudo_column ::= ROWTS */ yytestcase(yyruleno==298);
+ case 299: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==299);
+ case 300: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==300);
+ case 301: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==301);
+ case 302: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==302);
+ case 303: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==303);
+ case 304: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==304);
+{ yylhsminor.yy182 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+ yymsp[0].minor.yy182 = yylhsminor.yy182;
break;
- case 304: /* predicate ::= expression compare_op expression */
- case 309: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==309);
+ case 305: /* predicate ::= expression compare_op expression */
+ case 310: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==310);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy480, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy380, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 305: /* predicate ::= expression BETWEEN expression AND expression */
+ case 306: /* predicate ::= expression BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy140), releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy182), releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+ yymsp[-4].minor.yy182 = yylhsminor.yy182;
break;
- case 306: /* predicate ::= expression NOT BETWEEN expression AND expression */
+ case 307: /* predicate ::= expression NOT BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[-5].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[-5].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ yymsp[-5].minor.yy182 = yylhsminor.yy182;
break;
- case 307: /* predicate ::= expression IS NULL */
+ case 308: /* predicate ::= expression IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), NULL));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 308: /* predicate ::= expression IS NOT NULL */
+ case 309: /* predicate ::= expression IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), NULL));
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
- case 310: /* compare_op ::= NK_LT */
-{ yymsp[0].minor.yy480 = OP_TYPE_LOWER_THAN; }
+ case 311: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_THAN; }
break;
- case 311: /* compare_op ::= NK_GT */
-{ yymsp[0].minor.yy480 = OP_TYPE_GREATER_THAN; }
+ case 312: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_THAN; }
break;
- case 312: /* compare_op ::= NK_LE */
-{ yymsp[0].minor.yy480 = OP_TYPE_LOWER_EQUAL; }
+ case 313: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_EQUAL; }
break;
- case 313: /* compare_op ::= NK_GE */
-{ yymsp[0].minor.yy480 = OP_TYPE_GREATER_EQUAL; }
+ case 314: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_EQUAL; }
break;
- case 314: /* compare_op ::= NK_NE */
-{ yymsp[0].minor.yy480 = OP_TYPE_NOT_EQUAL; }
+ case 315: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy380 = OP_TYPE_NOT_EQUAL; }
break;
- case 315: /* compare_op ::= NK_EQ */
-{ yymsp[0].minor.yy480 = OP_TYPE_EQUAL; }
+ case 316: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy380 = OP_TYPE_EQUAL; }
break;
- case 316: /* compare_op ::= LIKE */
-{ yymsp[0].minor.yy480 = OP_TYPE_LIKE; }
+ case 317: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy380 = OP_TYPE_LIKE; }
break;
- case 317: /* compare_op ::= NOT LIKE */
-{ yymsp[-1].minor.yy480 = OP_TYPE_NOT_LIKE; }
+ case 318: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_LIKE; }
break;
- case 318: /* compare_op ::= MATCH */
-{ yymsp[0].minor.yy480 = OP_TYPE_MATCH; }
+ case 319: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy380 = OP_TYPE_MATCH; }
break;
- case 319: /* compare_op ::= NMATCH */
-{ yymsp[0].minor.yy480 = OP_TYPE_NMATCH; }
+ case 320: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy380 = OP_TYPE_NMATCH; }
break;
- case 320: /* in_op ::= IN */
-{ yymsp[0].minor.yy480 = OP_TYPE_IN; }
+ case 321: /* in_op ::= IN */
+{ yymsp[0].minor.yy380 = OP_TYPE_IN; }
break;
- case 321: /* in_op ::= NOT IN */
-{ yymsp[-1].minor.yy480 = OP_TYPE_NOT_IN; }
+ case 322: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_IN; }
break;
- case 322: /* in_predicate_value ::= NK_LP expression_list NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy220)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 323: /* in_predicate_value ::= NK_LP expression_list NK_RP */
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 324: /* boolean_value_expression ::= NOT boolean_primary */
+ case 325: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy140), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy182), NULL));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
- case 325: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ case 326: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 326: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ case 327: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy182);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy182);
+ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), releaseRawExprNode(pCxt, yymsp[0].minor.yy182)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 331: /* from_clause ::= FROM table_reference_list */
- case 361: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==361);
- case 384: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==384);
-{ yymsp[-1].minor.yy140 = yymsp[0].minor.yy140; }
+ case 332: /* from_clause ::= FROM table_reference_list */
+ case 362: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==362);
+ case 385: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==385);
+{ yymsp[-1].minor.yy182 = yymsp[0].minor.yy182; }
break;
- case 333: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-{ yylhsminor.yy140 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy140, yymsp[0].minor.yy140, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 334: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy182 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy182, yymsp[0].minor.yy182, NULL); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 336: /* table_primary ::= table_name alias_opt */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy253, &yymsp[0].minor.yy253); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 337: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy182 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
- case 337: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, &yymsp[-3].minor.yy253, &yymsp[-1].minor.yy253, &yymsp[0].minor.yy253); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 338: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy182 = createRealTableNode(pCxt, &yymsp[-3].minor.yy29, &yymsp[-1].minor.yy29, &yymsp[0].minor.yy29); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
- case 338: /* table_primary ::= subquery alias_opt */
-{ yylhsminor.yy140 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140), &yymsp[0].minor.yy253); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 339: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy182 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182), &yymsp[0].minor.yy29); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
- case 340: /* alias_opt ::= */
-{ yymsp[1].minor.yy253 = nil_token; }
+ case 341: /* alias_opt ::= */
+{ yymsp[1].minor.yy29 = nil_token; }
break;
- case 341: /* alias_opt ::= table_alias */
-{ yylhsminor.yy253 = yymsp[0].minor.yy253; }
- yymsp[0].minor.yy253 = yylhsminor.yy253;
+ case 342: /* alias_opt ::= table_alias */
+{ yylhsminor.yy29 = yymsp[0].minor.yy29; }
+ yymsp[0].minor.yy29 = yylhsminor.yy29;
break;
- case 342: /* alias_opt ::= AS table_alias */
-{ yymsp[-1].minor.yy253 = yymsp[0].minor.yy253; }
+ case 343: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy29 = yymsp[0].minor.yy29; }
break;
- case 343: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 344: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==344);
-{ yymsp[-2].minor.yy140 = yymsp[-1].minor.yy140; }
+ case 344: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 345: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==345);
+{ yymsp[-2].minor.yy182 = yymsp[-1].minor.yy182; }
break;
- case 345: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-{ yylhsminor.yy140 = createJoinTableNode(pCxt, yymsp[-4].minor.yy224, yymsp[-5].minor.yy140, yymsp[-2].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ case 346: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+{ yylhsminor.yy182 = createJoinTableNode(pCxt, yymsp[-4].minor.yy162, yymsp[-5].minor.yy182, yymsp[-2].minor.yy182, yymsp[0].minor.yy182); }
+ yymsp[-5].minor.yy182 = yylhsminor.yy182;
break;
- case 346: /* join_type ::= */
-{ yymsp[1].minor.yy224 = JOIN_TYPE_INNER; }
+ case 347: /* join_type ::= */
+{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; }
break;
- case 347: /* join_type ::= INNER */
-{ yymsp[0].minor.yy224 = JOIN_TYPE_INNER; }
+ case 348: /* join_type ::= INNER */
+{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; }
break;
- case 348: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
+ case 349: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
- yymsp[-8].minor.yy140 = createSelectStmt(pCxt, yymsp[-7].minor.yy273, yymsp[-6].minor.yy220, yymsp[-5].minor.yy140);
- yymsp[-8].minor.yy140 = addWhereClause(pCxt, yymsp[-8].minor.yy140, yymsp[-4].minor.yy140);
- yymsp[-8].minor.yy140 = addPartitionByClause(pCxt, yymsp[-8].minor.yy140, yymsp[-3].minor.yy220);
- yymsp[-8].minor.yy140 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy140, yymsp[-2].minor.yy140);
- yymsp[-8].minor.yy140 = addGroupByClause(pCxt, yymsp[-8].minor.yy140, yymsp[-1].minor.yy220);
- yymsp[-8].minor.yy140 = addHavingClause(pCxt, yymsp[-8].minor.yy140, yymsp[0].minor.yy140);
+ yymsp[-8].minor.yy182 = createSelectStmt(pCxt, yymsp[-7].minor.yy47, yymsp[-6].minor.yy334, yymsp[-5].minor.yy182);
+ yymsp[-8].minor.yy182 = addWhereClause(pCxt, yymsp[-8].minor.yy182, yymsp[-4].minor.yy182);
+ yymsp[-8].minor.yy182 = addPartitionByClause(pCxt, yymsp[-8].minor.yy182, yymsp[-3].minor.yy334);
+ yymsp[-8].minor.yy182 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy182, yymsp[-2].minor.yy182);
+ yymsp[-8].minor.yy182 = addGroupByClause(pCxt, yymsp[-8].minor.yy182, yymsp[-1].minor.yy334);
+ yymsp[-8].minor.yy182 = addHavingClause(pCxt, yymsp[-8].minor.yy182, yymsp[0].minor.yy182);
}
break;
- case 351: /* set_quantifier_opt ::= ALL */
-{ yymsp[0].minor.yy273 = false; }
+ case 352: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy47 = false; }
break;
- case 352: /* select_list ::= NK_STAR */
-{ yymsp[0].minor.yy220 = NULL; }
+ case 353: /* select_list ::= NK_STAR */
+{ yymsp[0].minor.yy334 = NULL; }
break;
- case 357: /* select_item ::= common_expression column_alias */
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140), &yymsp[0].minor.yy253); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 358: /* select_item ::= common_expression column_alias */
+{ yylhsminor.yy182 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182), &yymsp[0].minor.yy29); }
+ yymsp[-1].minor.yy182 = yylhsminor.yy182;
break;
- case 358: /* select_item ::= common_expression AS column_alias */
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), &yymsp[0].minor.yy253); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 359: /* select_item ::= common_expression AS column_alias */
+{ yylhsminor.yy182 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), &yymsp[0].minor.yy29); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 359: /* select_item ::= table_name NK_DOT NK_STAR */
-{ yylhsminor.yy140 = createColumnNode(pCxt, &yymsp[-2].minor.yy253, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 360: /* select_item ::= table_name NK_DOT NK_STAR */
+{ yylhsminor.yy182 = createColumnNode(pCxt, &yymsp[-2].minor.yy29, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 363: /* partition_by_clause_opt ::= PARTITION BY expression_list */
- case 380: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==380);
- case 390: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==390);
-{ yymsp[-2].minor.yy220 = yymsp[0].minor.yy220; }
+ case 364: /* partition_by_clause_opt ::= PARTITION BY expression_list */
+ case 381: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==381);
+ case 391: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==391);
+{ yymsp[-2].minor.yy334 = yymsp[0].minor.yy334; }
break;
- case 365: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
-{ yymsp[-5].minor.yy140 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
+ case 366: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+{ yymsp[-5].minor.yy182 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
break;
- case 366: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
-{ yymsp[-3].minor.yy140 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
+ case 367: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
+{ yymsp[-3].minor.yy182 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy182)); }
break;
- case 367: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-5].minor.yy140 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), NULL, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 368: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy182 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), NULL, yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
break;
- case 368: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-7].minor.yy140 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy140), releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 369: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy182 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy182), releaseRawExprNode(pCxt, yymsp[-3].minor.yy182), yymsp[-1].minor.yy182, yymsp[0].minor.yy182); }
break;
- case 370: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
-{ yymsp[-3].minor.yy140 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy140); }
+ case 371: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+{ yymsp[-3].minor.yy182 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy182); }
break;
- case 372: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-{ yymsp[-3].minor.yy140 = createFillNode(pCxt, yymsp[-1].minor.yy174, NULL); }
+ case 373: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy182 = createFillNode(pCxt, yymsp[-1].minor.yy144, NULL); }
break;
- case 373: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy140 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy220)); }
+ case 374: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy182 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); }
break;
- case 374: /* fill_mode ::= NONE */
-{ yymsp[0].minor.yy174 = FILL_MODE_NONE; }
+ case 375: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy144 = FILL_MODE_NONE; }
break;
- case 375: /* fill_mode ::= PREV */
-{ yymsp[0].minor.yy174 = FILL_MODE_PREV; }
+ case 376: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy144 = FILL_MODE_PREV; }
break;
- case 376: /* fill_mode ::= NULL */
-{ yymsp[0].minor.yy174 = FILL_MODE_NULL; }
+ case 377: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy144 = FILL_MODE_NULL; }
break;
- case 377: /* fill_mode ::= LINEAR */
-{ yymsp[0].minor.yy174 = FILL_MODE_LINEAR; }
+ case 378: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy144 = FILL_MODE_LINEAR; }
break;
- case 378: /* fill_mode ::= NEXT */
-{ yymsp[0].minor.yy174 = FILL_MODE_NEXT; }
+ case 379: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy144 = FILL_MODE_NEXT; }
break;
- case 381: /* group_by_list ::= expression */
-{ yylhsminor.yy220 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140))); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 382: /* group_by_list ::= expression */
+{ yylhsminor.yy334 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); }
+ yymsp[0].minor.yy334 = yylhsminor.yy334;
break;
- case 382: /* group_by_list ::= group_by_list NK_COMMA expression */
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140))); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+ case 383: /* group_by_list ::= group_by_list NK_COMMA expression */
+{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy182))); }
+ yymsp[-2].minor.yy334 = yylhsminor.yy334;
break;
- case 385: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ case 386: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy140 = addOrderByClause(pCxt, yymsp[-3].minor.yy140, yymsp[-2].minor.yy220);
- yylhsminor.yy140 = addSlimitClause(pCxt, yylhsminor.yy140, yymsp[-1].minor.yy140);
- yylhsminor.yy140 = addLimitClause(pCxt, yylhsminor.yy140, yymsp[0].minor.yy140);
+ yylhsminor.yy182 = addOrderByClause(pCxt, yymsp[-3].minor.yy182, yymsp[-2].minor.yy334);
+ yylhsminor.yy182 = addSlimitClause(pCxt, yylhsminor.yy182, yymsp[-1].minor.yy182);
+ yylhsminor.yy182 = addLimitClause(pCxt, yylhsminor.yy182, yymsp[0].minor.yy182);
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
- case 387: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
-{ yylhsminor.yy140 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 388: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
+{ yylhsminor.yy182 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy182, yymsp[0].minor.yy182); }
+ yymsp[-3].minor.yy182 = yylhsminor.yy182;
break;
- case 392: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
- case 396: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==396);
-{ yymsp[-1].minor.yy140 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ case 393: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ case 397: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==397);
+{ yymsp[-1].minor.yy182 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 393: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 397: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==397);
-{ yymsp[-3].minor.yy140 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+ case 394: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 398: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==398);
+{ yymsp[-3].minor.yy182 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 394: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 398: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==398);
-{ yymsp[-3].minor.yy140 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+ case 395: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 399: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==399);
+{ yymsp[-3].minor.yy182 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 399: /* subquery ::= NK_LP query_expression NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy140); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 400: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy182 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy182); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 403: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
-{ yylhsminor.yy140 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), yymsp[-1].minor.yy238, yymsp[0].minor.yy69); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 404: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy182 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy182), yymsp[-1].minor.yy218, yymsp[0].minor.yy487); }
+ yymsp[-2].minor.yy182 = yylhsminor.yy182;
break;
- case 404: /* ordering_specification_opt ::= */
-{ yymsp[1].minor.yy238 = ORDER_ASC; }
+ case 405: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy218 = ORDER_ASC; }
break;
- case 405: /* ordering_specification_opt ::= ASC */
-{ yymsp[0].minor.yy238 = ORDER_ASC; }
+ case 406: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy218 = ORDER_ASC; }
break;
- case 406: /* ordering_specification_opt ::= DESC */
-{ yymsp[0].minor.yy238 = ORDER_DESC; }
+ case 407: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy218 = ORDER_DESC; }
break;
- case 407: /* null_ordering_opt ::= */
-{ yymsp[1].minor.yy69 = NULL_ORDER_DEFAULT; }
+ case 408: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy487 = NULL_ORDER_DEFAULT; }
break;
- case 408: /* null_ordering_opt ::= NULLS FIRST */
-{ yymsp[-1].minor.yy69 = NULL_ORDER_FIRST; }
+ case 409: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy487 = NULL_ORDER_FIRST; }
break;
- case 409: /* null_ordering_opt ::= NULLS LAST */
-{ yymsp[-1].minor.yy69 = NULL_ORDER_LAST; }
+ case 410: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy487 = NULL_ORDER_LAST; }
break;
default:
break;
/********** End reduce actions ************************************************/
};
- assert( yyruleno dataX_db
print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
if $data0_db != db then # name
diff --git a/tests/script/tsim/db/basic1.sim b/tests/script/tsim/db/basic1.sim
index c07ebd0400..49568d64ed 100644
--- a/tests/script/tsim/db/basic1.sim
+++ b/tests/script/tsim/db/basic1.sim
@@ -6,19 +6,19 @@ sql connect
print =============== create database
sql create database d1 vgroups 2
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d1 then
+if $data20 != d1 then
return -1
endi
-if $data02 != 2 then
+if $data22 != 2 then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
@@ -40,7 +40,7 @@ endi
print =============== drop database
sql drop database d1
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -49,7 +49,7 @@ sql create database d2 vgroups 2
sql create database d3 vgroups 3
sql create database d4 vgroups 4
sql show databases
-if $rows != 4 then
+if $rows != 5 then
return -1
endi
@@ -111,19 +111,19 @@ print =============== drop database
sql drop database d2
sql drop database d3
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d4 then
+if $data20 != d4 then
return -1
endi
-if $data02 != 4 then
+if $data22 != 4 then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
@@ -154,7 +154,7 @@ system sh/exec.sh -n dnode1 -s start
print =============== show databases
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/db/basic2.sim b/tests/script/tsim/db/basic2.sim
index e9222c8d32..0d34506b00 100644
--- a/tests/script/tsim/db/basic2.sim
+++ b/tests/script/tsim/db/basic2.sim
@@ -33,15 +33,15 @@ sql show databases
print rows: $rows
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d1 then
+if $data20 != d1 then
return -1
endi
-if $data02 != 2 then # vgroups
+if $data22 != 2 then # vgroups
return -1
endi
@@ -62,7 +62,7 @@ sql create table t2 (ts timestamp, i int);
sql create table t3 (ts timestamp, i int);
sql show databases
-if $rows != 3 then
+if $rows != 4 then
return -1
endi
diff --git a/tests/script/tsim/db/basic3.sim b/tests/script/tsim/db/basic3.sim
index 52a587cc16..62d160f1c4 100644
--- a/tests/script/tsim/db/basic3.sim
+++ b/tests/script/tsim/db/basic3.sim
@@ -29,15 +29,15 @@ sql create table d1.t3 (ts timestamp, i int);
sql create table d1.t4 (ts timestamp, i int);
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d1 then
+if $data20 != d1 then
return -1
endi
-if $data02 != 2 then
+if $data22 != 2 then
return -1
endi
@@ -57,7 +57,7 @@ sql create table d2.t2 (ts timestamp, i int);
sql create table d2.t3 (ts timestamp, i int);
sql show databases
-if $rows != 3 then
+if $rows != 4 then
return -1
endi
diff --git a/tests/script/tsim/db/basic6.sim b/tests/script/tsim/db/basic6.sim
index a768a0da38..4d0a1e9ee9 100644
--- a/tests/script/tsim/db/basic6.sim
+++ b/tests/script/tsim/db/basic6.sim
@@ -20,31 +20,31 @@ sql show databases
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != $db then
+if $data20 != $db then
return -1
endi
-if $data02 != 8 then
+if $data22 != 8 then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
-if $data04 != 1 then
+if $data24 != 1 then
return -1
endi
-if $data06 != 2880 then
+if $data26 != 2880 then
return -1
endi
-if $data07 != 3650,3650,3650 then
+if $data27 != 3650,3650,3650 then
return -1
endi
-if $data08 != 32 then
+if $data28 != 32 then
return -1
endi
-if $data09 != 12 then
+if $data29 != 12 then
return -1
endi
@@ -52,14 +52,14 @@ print =============== step2
sql_error create database $db
sql create database if not exists $db
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
print =============== step3
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -70,16 +70,16 @@ print =============== step5
sql create database $db replica 1 days 21600 keep 2160000
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
-if $data00 != $db then
+if $data20 != $db then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
-if $data04 != 1 then
+if $data24 != 1 then
return -1
endi
-if $data06 != 21600 then
+if $data26 != 21600 then
return -1
endi
@@ -314,7 +314,7 @@ endi
sql drop database $db
sql show databases
-if $rows != 0 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim
index 7f39474f4d..4dda6cd00f 100644
--- a/tests/script/tsim/db/create_all_options.sim
+++ b/tests/script/tsim/db/create_all_options.sim
@@ -99,7 +99,7 @@ sql create database db
sql show databases
print rows: $rows
print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
if $data0_db != db then # name
@@ -112,6 +112,7 @@ if $data3_db != 0 then # ntables
return -1
endi
if $data4_db != 1 then # replica
+ print expect 1, actual: $data4_db
return -1
endi
if $data5_db != 1 then # quorum
diff --git a/tests/script/tsim/db/error1.sim b/tests/script/tsim/db/error1.sim
index 6f62228ae7..2e00143eb9 100644
--- a/tests/script/tsim/db/error1.sim
+++ b/tests/script/tsim/db/error1.sim
@@ -42,19 +42,19 @@ re-create1:
sql create database d1 vgroups 2 -x re-create1
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d1 then
+if $data20 != d1 then
return -1
endi
-if $data02 != 2 then
+if $data22 != 2 then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
@@ -81,19 +81,19 @@ re-create2:
sql create database d1 vgroups 5 -x re-create2
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != d1 then
+if $data20 != d1 then
return -1
endi
-if $data02 != 5 then
+if $data22 != 5 then
return -1
endi
-if $data03 != 0 then
+if $data23 != 0 then
return -1
endi
diff --git a/tests/script/tsim/dnode/basic1.sim b/tests/script/tsim/dnode/basic1.sim
index 6f0d5f88b8..51399e9050 100644
--- a/tests/script/tsim/dnode/basic1.sim
+++ b/tests/script/tsim/dnode/basic1.sim
@@ -85,7 +85,7 @@ sql create database d1 vgroups 4;
sql create database d2;
sql show databases
-if $rows != 3 then
+if $rows != 4 then
return -1
endi
diff --git a/tests/script/tsim/insert/backquote.sim b/tests/script/tsim/insert/backquote.sim
index 71f35fabb2..819b1aea13 100644
--- a/tests/script/tsim/insert/backquote.sim
+++ b/tests/script/tsim/insert/backquote.sim
@@ -12,16 +12,16 @@ print rows: $rows
print $data00 $data01
print $data10 $data11
print $data20 $data21
-if $rows != 3 then
+if $rows != 4 then
return -1
endi
-if $data00 != database then
+if $data20 != database then
return -1
endi
-if $data10 != DataBase then
+if $data30 != DataBase then
return -1
endi
-if $data20 != information_schema then
+if $data00 != information_schema then
return -1
endi
@@ -206,16 +206,16 @@ print rows: $rows
print $data00 $data01
print $data10 $data11
print $data20 $data21
-if $rows != 3 then
+if $rows != 4 then
return -1
endi
-if $data00 != database then
+if $data20 != database then
return -1
endi
-if $data10 != DataBase then
+if $data30 != DataBase then
return -1
endi
-if $data20 != information_schema then
+if $data00 != information_schema then
return -1
endi
diff --git a/tests/script/tsim/insert/basic0.sim b/tests/script/tsim/insert/basic0.sim
index da74eb95e8..1ae8b372dc 100644
--- a/tests/script/tsim/insert/basic0.sim
+++ b/tests/script/tsim/insert/basic0.sim
@@ -7,7 +7,7 @@ sql connect
print =============== create database
sql create database d0
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/insert/basic1.sim b/tests/script/tsim/insert/basic1.sim
index 3a3f8d000e..d98407b380 100644
--- a/tests/script/tsim/insert/basic1.sim
+++ b/tests/script/tsim/insert/basic1.sim
@@ -7,7 +7,7 @@ sql connect
print =============== create database
sql create database d1
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/insert/null.sim b/tests/script/tsim/insert/null.sim
index fbaef8cc94..fab5335ac5 100644
--- a/tests/script/tsim/insert/null.sim
+++ b/tests/script/tsim/insert/null.sim
@@ -7,7 +7,7 @@ sql connect
print =============== create database
sql create database d0
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/parser/fourArithmetic-basic.sim b/tests/script/tsim/parser/fourArithmetic-basic.sim
index bb35df5a90..ebe20924be 100644
--- a/tests/script/tsim/parser/fourArithmetic-basic.sim
+++ b/tests/script/tsim/parser/fourArithmetic-basic.sim
@@ -28,7 +28,7 @@ print =============== create database
sql create database $dbNamme vgroups 1
sql show databases
print $data00 $data01 $data02
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/query/charScalarFunction.sim b/tests/script/tsim/query/charScalarFunction.sim
index 13108fecb7..d601405c12 100644
--- a/tests/script/tsim/query/charScalarFunction.sim
+++ b/tests/script/tsim/query/charScalarFunction.sim
@@ -83,6 +83,14 @@ sql insert into ntb5 values ("2022-01-01 00:00:00.000" , "0123456789" , "0123456
sql insert into ctb5 values ("2022-01-01 00:00:00.001" , NULL , NULL )
sql insert into ntb5 values ("2022-01-01 00:00:00.001" , NULL , NULL )
+sql create table stb3 (ts timestamp, c1 binary(64), c2 nchar(64), c3 nchar(64) ) tags (t1 nchar(64))
+sql create table ctb6 using stb3 tags("tag-nchar-6")
+sql create table ntb6 (ts timestamp, c1 binary(64), c2 nchar(64), c3 nchar(64) )
+sql insert into ctb6 values ("2022-01-01 00:00:00.000" , "0123456789" , "中文测试1" , "中文测试2" )
+sql insert into ntb6 values ("2022-01-01 00:00:00.000" , "0123456789" , "中文测试01", "中文测试01" )
+sql insert into ctb6 values ("2022-01-01 00:00:00.001" , NULL , NULL, NULL )
+sql insert into ntb6 values ("2022-01-01 00:00:00.001" , NULL , NULL, NULL )
+
$loop_test = 0
loop_test_pos:
@@ -150,6 +158,210 @@ if $data01 != 12 then
return -1
endi
+print ====> select c2 ,length(c2), char_length(c2) from ctb6
+sql select c2 ,length(c2), char_length(c2) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 20 then
+ return -1
+endi
+if $data02 != 5 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2 ,length(c2),char_length(c2) from ntb6
+sql select c2 ,length(c2),char_length(c2) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 24 then
+ return -1
+endi
+if $data02 != 6 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2 ,lower(c2), upper(c2) from ctb6
+sql select c2 ,lower(c2), upper(c2) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试1 then
+ return -1
+endi
+if $data02 != 中文测试1 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2 ,lower(c2), upper(c2) from ntb6
+sql select c2 ,lower(c2), upper(c2) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试01 then
+ return -1
+endi
+if $data02 != 中文测试01 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2, ltrim(c2), ltrim(c2) from ctb6
+sql select c2, ltrim(c2), ltrim(c2) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试1 then
+ return -1
+endi
+if $data02 != 中文测试1 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2, ltrim(c2), ltrim(c2) from ntb6
+sql select c2, ltrim(c2), ltrim(c2) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试01 then
+ return -1
+endi
+if $data02 != 中文测试01 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2, c3 , concat(c2,c3) from ctb6
+sql select c2, c3 , concat(c2,c3) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data02 != 中文测试01中文测试01 then
+ return -1
+endi
+if $data12 != NULL then
+ return -1
+endi
+
+print ====> select c2, c3 , concat(c2,c3) from ntb6
+sql select c2, c3 , concat(c2,c3) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data02 != 中文测试01中文测试01 then
+ return -1
+endi
+if $data12 != NULL then
+ return -1
+endi
+
+print ====> select c2, c3 , concat_ws('_', c2, c3) from ctb6
+sql select c2, c3 , concat_ws('_', c2, c3) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data02 != 中文测试01_中文测试01 then
+ return -1
+endi
+if $data12 != NULL then
+ return -1
+endi
+
+print ====> select c2, c3 , concat_ws('_', c2, c3) from ntb6
+sql select c2, c3 , concat_ws('_', c2, c3) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data02 != 中文测试01_中文测试01 then
+ return -1
+endi
+if $data12 != NULL then
+ return -1
+endi
+
+print ====> select c2, substr(c2,1, 4) from ctb6
+sql select c2, substr(c2,1, 4) from ctb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试01 then
+ return -1
+endi
+if $data02 != 中文测试01 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
+print ====> select c2, substr(c2,1, 4) from ntb6
+sql select c2, substr(c2,1, 4) from ntb6
+print ====> rows: $rows
+print ====> $data00 $data01 $data02
+print ====> $data10 $data11 $data12
+if $rows != 2 then
+ return -1
+endi
+if $data01 != 中文测试01 then
+ return -1
+endi
+if $data02 != 中文测试01 then
+ return -1
+endi
+if $data11 != NULL then
+ return -1
+endi
+
#sql_error select c1, length(t1), c2, length(t2) from ctb0
print ====> char_length
@@ -493,7 +705,7 @@ if $loop_test == 0 then
print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
-
+
$loop_cnt = 0
check_dnode_ready_0:
$loop_cnt = $loop_cnt + 1
@@ -511,7 +723,7 @@ if $loop_test == 0 then
goto check_dnode_ready_0
endi
- $loop_test = 1
+ $loop_test = 1
goto loop_test_pos
endi
diff --git a/tests/script/tsim/query/complex_group.sim b/tests/script/tsim/query/complex_group.sim
index d6ce26b69a..6c9a7c5a7a 100644
--- a/tests/script/tsim/query/complex_group.sim
+++ b/tests/script/tsim/query/complex_group.sim
@@ -25,7 +25,7 @@ sql connect
print =============== create database
sql create database db
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/query/complex_having.sim b/tests/script/tsim/query/complex_having.sim
index 10283153d8..86d4f7d4ca 100644
--- a/tests/script/tsim/query/complex_having.sim
+++ b/tests/script/tsim/query/complex_having.sim
@@ -25,7 +25,7 @@ sql connect
print =============== create database
sql create database db
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/query/complex_limit.sim b/tests/script/tsim/query/complex_limit.sim
index ac25135685..1691f2d443 100644
--- a/tests/script/tsim/query/complex_limit.sim
+++ b/tests/script/tsim/query/complex_limit.sim
@@ -24,11 +24,6 @@ sql connect
print =============== create database
sql create database db
-sql show databases
-if $rows != 2 then
- return -1
-endi
-
sql use db
print =============== create super table and child table
diff --git a/tests/script/tsim/query/complex_select.sim b/tests/script/tsim/query/complex_select.sim
index 1696d22da7..1ebcb2f49a 100644
--- a/tests/script/tsim/query/complex_select.sim
+++ b/tests/script/tsim/query/complex_select.sim
@@ -24,11 +24,6 @@ sql connect
print =============== create database
sql create database db
-sql show databases
-if $rows != 2 then
- return -1
-endi
-
sql use db
print =============== create super table and child table
@@ -114,14 +109,14 @@ print ====> rows0: $data00, $data01, $data02, $data03, $data04, $data05, $data06
if $rows != 1 then
return -1
endi
-if $data01 != 2 then
+if $data01 != 3 then
return -1
endi
-sql select * from ct1 limit 2 offset 1
+sql select * from ct1 limit 2 offset 7
print ====> sql : select * from ct1 limit 2 offset 7
print ====> rows: $rows
-if $rows != 2 then
+if $rows != 1 then
return -1
endi
if $data01 != 8 then
diff --git a/tests/script/tsim/query/complex_where.sim b/tests/script/tsim/query/complex_where.sim
index 312c1d98ed..7cd576400f 100644
--- a/tests/script/tsim/query/complex_where.sim
+++ b/tests/script/tsim/query/complex_where.sim
@@ -25,7 +25,7 @@ sql connect
print =============== create database
sql create database db
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
diff --git a/tests/script/tsim/query/diff.sim b/tests/script/tsim/query/diff.sim
index c55b080e44..7bfeeeba7f 100644
--- a/tests/script/tsim/query/diff.sim
+++ b/tests/script/tsim/query/diff.sim
@@ -123,7 +123,7 @@ step6:
print =============== clear
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/query/interval-offset.sim b/tests/script/tsim/query/interval-offset.sim
index 796944745a..e222077fa4 100644
--- a/tests/script/tsim/query/interval-offset.sim
+++ b/tests/script/tsim/query/interval-offset.sim
@@ -6,11 +6,6 @@ sql connect
print =============== create database
sql create database d0
-sql show databases
-if $rows != 2 then
- return -1
-endi
-
sql use d0
print =============== create super table and child table
diff --git a/tests/script/tsim/query/session.sim b/tests/script/tsim/query/session.sim
index 282d83bc27..3aee838625 100644
--- a/tests/script/tsim/query/session.sim
+++ b/tests/script/tsim/query/session.sim
@@ -256,7 +256,7 @@ endi
# $data0-11 != 1
# $data1-11 != 14
-print ====> select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)
+#print ====> select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)
#sql select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)
#if $rows != 2 then
# return -1
diff --git a/tests/script/tsim/show/basic.sim b/tests/script/tsim/show/basic.sim
index cc92686142..0c0670ff7f 100644
--- a/tests/script/tsim/show/basic.sim
+++ b/tests/script/tsim/show/basic.sim
@@ -28,8 +28,8 @@ sql connect
# select */column from information_schema.xxxx; xxxx include:
# dnodes, mnodes, modules, qnodes,
-# user_databases, user_functions, user_indexes, user_stables, user_streams,
-# user_tables, user_table_distributed, user_users, vgroups,
+# user_databases, user_functions, user_indexes, user_stables, user_streams,
+# user_tables, user_table_distributed, user_users, vgroups,
print =============== add dnode2 into cluster
sql create dnode $hostname port 7200
@@ -53,7 +53,7 @@ endi
#sql show modules
#sql show qnodes
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
#sql show functions
@@ -90,7 +90,7 @@ endi
#sql select * from information_schema.`modules`
#sql select * from information_schema.`qnodes`
sql select * from information_schema.user_databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
#sql select * from information_schema.user_functions
@@ -151,7 +151,7 @@ endi
#sql show modules
#sql show qnodes
sql show databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
#sql show functions
@@ -188,7 +188,7 @@ endi
#sql select * from information_schema.`modules`
#sql select * from information_schema.`qnodes`
sql select * from information_schema.user_databases
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
#sql select * from information_schema.user_functions
diff --git a/tests/script/tsim/sma/tsmaCreateInsertData.sim b/tests/script/tsim/sma/tsmaCreateInsertData.sim
index 9fc3700da1..b7a127e1b0 100644
--- a/tests/script/tsim/sma/tsmaCreateInsertData.sim
+++ b/tests/script/tsim/sma/tsmaCreateInsertData.sim
@@ -6,13 +6,6 @@ sql connect
print =============== create database
sql create database d1
-sql show databases
-if $rows != 2 then
- return -1
-endi
-
-print $data00 $data01 $data02
-
sql use d1
print =============== create super table, include column type for count/sum/min/max/first
diff --git a/tests/script/tsim/stable/disk.sim b/tests/script/tsim/stable/disk.sim
index 0e33c2066d..9f445cb6a8 100644
--- a/tests/script/tsim/stable/disk.sim
+++ b/tests/script/tsim/stable/disk.sim
@@ -199,7 +199,7 @@ print =============== step11
print =============== clear
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/stable/dnode3.sim b/tests/script/tsim/stable/dnode3.sim
index c2243b1ac8..e388bd9b31 100644
--- a/tests/script/tsim/stable/dnode3.sim
+++ b/tests/script/tsim/stable/dnode3.sim
@@ -206,7 +206,7 @@ print =============== step11
print =============== clear
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/stable/metrics.sim b/tests/script/tsim/stable/metrics.sim
index 948af72d09..c49de0e803 100644
--- a/tests/script/tsim/stable/metrics.sim
+++ b/tests/script/tsim/stable/metrics.sim
@@ -4,7 +4,7 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
-sleep 2000
+sleep 1000
sql connect
$dbPrefix = m_me_db
@@ -95,8 +95,8 @@ $i = 2
$tb = $tbPrefix . $i
sql insert into $tb values (now + 1m , 1 )
-print sleep 8000
-sleep 8000
+print sleep 2000
+sleep 2000
print =============== step6
@@ -130,7 +130,7 @@ endi
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/stable/refcount.sim b/tests/script/tsim/stable/refcount.sim
index 1f00483090..fffa6f75a4 100644
--- a/tests/script/tsim/stable/refcount.sim
+++ b/tests/script/tsim/stable/refcount.sim
@@ -20,7 +20,7 @@ sql insert into d1.t2 values(now, 1);
sql drop database d1;
sql show databases;
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -49,7 +49,7 @@ endi
sql drop database d2;
sql show databases;
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -78,7 +78,7 @@ endi
sql drop database d3;
sql show databases;
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -106,7 +106,7 @@ endi
sql drop database d4;
sql show databases;
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
@@ -123,7 +123,7 @@ sql insert into d5.t1 values(now, 1);
sql drop database d5;
sql show databases;
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/stable/show.sim b/tests/script/tsim/stable/show.sim
index 8ebb765a78..823aefe9d8 100644
--- a/tests/script/tsim/stable/show.sim
+++ b/tests/script/tsim/stable/show.sim
@@ -27,8 +27,9 @@ while $m < 128
$filter = ' . $tb
$filter = $filter . '
sql show stables like $filter
- # print sql : show stables like $filter ==> $rows
+ print sql : show stables like $filter
if $rows != 1 then
+ print expect 1, actual: $rows
return -1
endi
$m = $m + 1
diff --git a/tests/script/tsim/stable/vnode3.sim b/tests/script/tsim/stable/vnode3.sim
index 2d408b4191..97a8203883 100644
--- a/tests/script/tsim/stable/vnode3.sim
+++ b/tests/script/tsim/stable/vnode3.sim
@@ -174,7 +174,7 @@ print =============== step11
print =============== clear
sql drop database $db
sql show databases
-if $rows != 1 then
+if $rows != 2 then
return -1
endi
diff --git a/tests/script/tsim/table/basic1.sim b/tests/script/tsim/table/basic1.sim
index bdb49cc9cd..75cd0c8744 100644
--- a/tests/script/tsim/table/basic1.sim
+++ b/tests/script/tsim/table/basic1.sim
@@ -29,7 +29,7 @@ endi
print =============== create database
sql create database d1
sql show databases
-if $rows != 5 then
+if $rows != 6 then
return -1
endi
diff --git a/tests/script/tsim/tmq/basic.sim b/tests/script/tsim/tmq/basic.sim
index 1eeec46d53..9f55847965 100644
--- a/tests/script/tsim/tmq/basic.sim
+++ b/tests/script/tsim/tmq/basic.sim
@@ -50,10 +50,10 @@ endi
sql show databases
print ===> $rows $data00 $data01 $data02 $data03
-if $rows != 2 then
+if $rows != 3 then
return -1
endi
-if $data00 != tmqdb then
+if $data20 != tmqdb then
return -1
endi
diff --git a/tests/script/tsim/tmq/basic1.sim b/tests/script/tsim/tmq/basic1.sim
index bc827d79f4..ec33e89e84 100644
--- a/tests/script/tsim/tmq/basic1.sim
+++ b/tests/script/tsim/tmq/basic1.sim
@@ -36,12 +36,6 @@ sql connect
$dbNamme = d0
print =============== create database , vgroup 1
sql create database $dbNamme vgroups 1
-sql show databases
-print $data00 $data01 $data02
-if $rows != 2 then
- return -1
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim b/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
index c301219ad6..68c2d5a891 100644
--- a/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
+++ b/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
@@ -43,35 +43,6 @@ loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 2 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim b/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
index 0f38a8b58b..1b98bcdd5d 100644
--- a/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
+++ b/tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
@@ -42,36 +42,6 @@ $dbNamme = d0
loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
-sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 2 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim b/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
index 99d1c6e442..9f2b204b60 100644
--- a/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
+++ b/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
@@ -42,36 +42,6 @@ $dbNamme = d0
loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
-sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 2 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim b/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
index 76ad75aead..45dd4fd187 100644
--- a/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
+++ b/tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
@@ -42,36 +42,6 @@ $dbNamme = d0
loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
-sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 2 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/mainConsumerInMultiTopic.sim b/tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
index 095809abe9..2e2534d104 100644
--- a/tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
+++ b/tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
@@ -42,36 +42,6 @@ $dbNamme = d0
loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
-sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 1 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
@@ -197,6 +167,7 @@ system_content ../../debug/tests/test/c/tmq_sim -c ../../sim/tsim/cfg -d $dbNamm
print cmd result----> $system_content
#if $system_content != @{consume success: 20000, 0}@ then
if $system_content != $expect_result then
+ print expect @{consume success: 20000, 0}@ , actual @system_content
return -1
endi
diff --git a/tests/script/tsim/tmq/mainConsumerInOneTopic.sim b/tests/script/tsim/tmq/mainConsumerInOneTopic.sim
index fc20e2db23..d307723878 100644
--- a/tests/script/tsim/tmq/mainConsumerInOneTopic.sim
+++ b/tests/script/tsim/tmq/mainConsumerInOneTopic.sim
@@ -42,36 +42,6 @@ $dbNamme = d0
loop_vgroups:
print =============== create database $dbNamme vgroups $vgroups
sql create database $dbNamme vgroups $vgroups
-sql show databases
-print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
-print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
-print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
-
-if $loop_cnt == 0 then
- if $rows != 2 then
- return -1
- endi
- if $data02 != 1 then # vgroups
- print vgroups: $data02
- return -1
- endi
-else
- if $rows != 3 then
- return -1
- endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
- print vgroups: $data02
- return -1
- endi
- else
- if $data12 != 4 then # vgroups
- print vgroups: $data12
- return -1
- endi
- endi
-endi
-
sql use $dbNamme
print =============== create super table
diff --git a/tests/script/tsim/tmq/multiTopic.sim b/tests/script/tsim/tmq/multiTopic.sim
index cd977e5909..0ce6304799 100644
--- a/tests/script/tsim/tmq/multiTopic.sim
+++ b/tests/script/tsim/tmq/multiTopic.sim
@@ -48,24 +48,24 @@ print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $d
print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
if $loop_cnt == 0 then
- if $rows != 2 then
+ if $rows != 3 then
return -1
endi
- if $data02 != 1 then # vgroups
+ if $data22 != 1 then # vgroups
print vgroups: $data02
return -1
endi
else
- if $rows != 3 then
+ if $rows != 4 then
return -1
endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
+ if $data20 == d1 then
+ if $data22 != 4 then # vgroups
print vgroups: $data02
return -1
endi
else
- if $data12 != 4 then # vgroups
+ if $data32 != 4 then # vgroups
print vgroups: $data12
return -1
endi
diff --git a/tests/script/tsim/tmq/oneTopic.sim b/tests/script/tsim/tmq/oneTopic.sim
index 8e8d00977c..e3f9d727b9 100644
--- a/tests/script/tsim/tmq/oneTopic.sim
+++ b/tests/script/tsim/tmq/oneTopic.sim
@@ -48,24 +48,24 @@ print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $d
print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
if $loop_cnt == 0 then
- if $rows != 2 then
+ if $rows != 3 then
return -1
endi
- if $data02 != 1 then # vgroups
+ if $data22 != 1 then # vgroups
print vgroups: $data02
return -1
endi
else
- if $rows != 3 then
+ if $rows != 4 then
return -1
endi
- if $data00 == d1 then
- if $data02 != 4 then # vgroups
+ if $data20 == d1 then
+ if $data22 != 4 then # vgroups
print vgroups: $data02
return -1
endi
else
- if $data12 != 4 then # vgroups
+ if $data32 != 4 then # vgroups
print vgroups: $data12
return -1
endi