diff --git a/docs/en/08-client-libraries/50-odbc.mdx b/docs/en/08-client-libraries/50-odbc.mdx index 08b2c031c6..4d9161473a 100644 --- a/docs/en/08-client-libraries/50-odbc.mdx +++ b/docs/en/08-client-libraries/50-odbc.mdx @@ -49,7 +49,7 @@ TDengine ODBC driver supports two kinds of connections to TDengine cluster, nati 4.2 [Connection Type]: required field, we choose "WebSocket" - 4.3 [URL]: required field, the URL for the ODBC data source, for example, `http://localhost:6041` is the URL for a local TDengine cluster, `https://gw.cloud.taosdata.com?token=your_token` is the URL for a TDengine cloud service. + 4.3 [URL]: required field, the URL for the ODBC data source, for example, `http://localhost:6041` is the URL for a local TDengine cluster. 4.4 [Database]: optional field, the default database to access diff --git a/docs/en/10-deployment/02-docker.md b/docs/en/10-deployment/02-docker.md index 2a4511c7b1..2c281ec408 100644 --- a/docs/en/10-deployment/02-docker.md +++ b/docs/en/10-deployment/02-docker.md @@ -128,7 +128,7 @@ If you want to start your application in a container, you need to add the corres FROM ubuntu:20.04 RUN apt-get update && apt-get install -y wget ENV TDENGINE_VERSION=3.0.0.0 -RUN wget -c https://www.taosdata.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ +RUN wget -c https://tdengine.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && tar xvf TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && cd TDengine-client-${TDENGINE_VERSION} \ && ./install_client.sh \ @@ -229,7 +229,7 @@ Here is the full Dockerfile: ```docker FROM golang:1.17.6-buster as builder ENV TDENGINE_VERSION=3.0.0.0 -RUN wget -c https://www.taosdata.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ +RUN wget -c https://tdengine.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && tar xvf TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && cd TDengine-client-${TDENGINE_VERSION} \ && ./install_client.sh \ @@ -245,7 +245,7 @@ RUN go build FROM ubuntu:20.04 RUN apt-get update && apt-get install -y wget ENV TDENGINE_VERSION=3.0.0.0 -RUN wget -c https://www.taosdata.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ +RUN wget -c https://tdengine.com/assets-download/3.0/TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && tar xvf TDengine-client-${TDENGINE_VERSION}-Linux-x64.tar.gz \ && cd TDengine-client-${TDENGINE_VERSION} \ && ./install_client.sh \ diff --git a/docs/en/10-deployment/03-k8s.md b/docs/en/10-deployment/03-k8s.md index 10c0341598..affb492169 100644 --- a/docs/en/10-deployment/03-k8s.md +++ b/docs/en/10-deployment/03-k8s.md @@ -8,7 +8,7 @@ description: This document describes how to deploy TDengine on Kubernetes. As a time series database for Cloud Native architecture design, TDengine supports Kubernetes deployment. Firstly we introduce how to use YAML files to create a highly available TDengine cluster from scratch step by step for production usage, and highlight the common operations of TDengine in Kubernetes environment. -To meet [high availability ](https://docs.taosdata.com/tdinternal/high-availability/)requirements, clusters need to meet the following requirements: +To meet [high availability](../../tdinternal/high-availability/) requirements, clusters need to meet the following requirements: - 3 or more dnodes: multiple vnodes in the same vgroup of TDengine are not allowed to be distributed in one dnode at the same time, so if you create a database with 3 replicas, the number of dnodes is greater than or equal to 3 - 3 mnodes: mnode is responsible for the management of the entire TDengine cluster. The default number of mnode in TDengine cluster is only one. If the dnode where the mnode located is dropped, the entire cluster is unavailable. diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md index 5ec26df1fa..263834dba1 100644 --- a/docs/en/14-reference/06-taosdump.md +++ b/docs/en/14-reference/06-taosdump.md @@ -19,7 +19,7 @@ Users should not use taosdump to back up raw data, environment settings, hardwar There are two ways to install taosdump: -- Install the taosTools official installer. Please find taosTools from [Release History](https://docs.taosdata.com/releases/tools/) page and download and install it. +- Install the taosTools official installer. Please find taosTools from [Release History](../../releases/tools/) page and download and install it. - Compile taos-tools separately and install it. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details. diff --git a/docs/en/20-third-party/75-powerbi.md b/docs/en/20-third-party/75-powerbi.md index 4744467f30..03268a5610 100644 --- a/docs/en/20-third-party/75-powerbi.md +++ b/docs/en/20-third-party/75-powerbi.md @@ -19,7 +19,7 @@ With TDengine ODBC driver, PowerBI can access time series data stored in TDengin ## Install Driver -Depending on your TDengine server version, download appropriate version of TDengine client package from TDengine website [Download Link](https://docs.taosdata.com/get-started/package/), or TDengine explorer if you are using a local TDengine cluster. Install the TDengine client package on same Windows machine where PowerBI is running. +Depending on your TDengine server version, download appropriate version of TDengine client package from TDengine website [Download Link](../../get-started/package/), or TDengine explorer if you are using a local TDengine cluster. Install the TDengine client package on same Windows machine where PowerBI is running. ### Configure Data Source @@ -38,7 +38,7 @@ To better use Power BI to analyze the data stored in TDengine, you need to under 1. Dimention: it's normally category (text) data to describe such information as device, collection point, model. In the supertable template of TDengine, we use tag columns to store the dimention information. You can use SQL like `select distinct tbname, tag1, tag2 from supertable` to get dimentions. -2. Metric: quantitive (numeric) fileds that can be calculated, like SUM, AVERAGE, MINIMUM. If the collecting frequency is 1 second, then there are 31,536,000 records in one year, it will be too low efficient to import so big data into Power BI. In TDengine, you can use data partition query, window partition query, in combination with pseudo columns related to window, to import downsampled data into Power BI. For more details, please refer to [TDengine Specialized Queries](https://docs.taosdata.com/taos-sql/distinguished/)。 +2. Metric: quantitive (numeric) fileds that can be calculated, like SUM, AVERAGE, MINIMUM. If the collecting frequency is 1 second, then there are 31,536,000 records in one year, it will be too low efficient to import so big data into Power BI. In TDengine, you can use data partition query, window partition query, in combination with pseudo columns related to window, to import downsampled data into Power BI. For more details, please refer to [TDengine Specialized Queries](../../taos-sql/distinguished/)。 - Window partition query: for example, thermal meters collect one data per second, but you need to query the average temperature every 10 minutes, you can use window subclause to get the downsampling data you need. The corresponding SQL is like `select tbname, _wstart date,avg(temperature) temp from table interval(10m)`, in which _wstart is a pseudo column indicting the start time of a widow, 10m is the duration of the window, `avg(temperature)` indicates the aggregate value inside a window. diff --git a/docs/en/25-application/_03-immigrate.md b/docs/en/25-application/_03-immigrate.md index 4dc7ee711c..af31b31e3c 100644 --- a/docs/en/25-application/_03-immigrate.md +++ b/docs/en/25-application/_03-immigrate.md @@ -184,8 +184,6 @@ TDengine supports the standard JDBC 3.0 interface for manipulating databases, bu To facilitate historical data migration, we provide a plug-in for the data synchronization tool DataX, which can automatically write data into TDengine.The automatic data migration of DataX can only support the data migration process of a single value model. -For the specific usage of DataX and how to use DataX to write data to TDengine, please refer to [DataX-based TDengine Data Migration Tool](https://www.taosdata.com/engineering/16401.html). - After migrating via DataX, we found that we can significantly improve the efficiency of migrating historical data by starting multiple processes and migrating numerous metrics simultaneously. The following are some records of the migration process. We provide these as a reference for application migration. | Number of datax instances (number of concurrent processes) | Migration record speed (pieces/second) | diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md index f3099b13b4..4def3df638 100644 --- a/docs/en/28-releases/02-tools.md +++ b/docs/en/28-releases/02-tools.md @@ -6,7 +6,7 @@ description: This document provides download links for all released versions of taosTools installation packages can be downloaded at the following links: -For other historical version installers, please visit [here](https://www.taosdata.com/all-downloads). +For other historical version installers, please visit [here](https://tdengine.com/downloads/historical/). import Release from "/components/ReleaseV3"; diff --git a/include/common/systable.h b/include/common/systable.h index f0f8ac8cf6..77fd18da39 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -29,6 +29,7 @@ extern "C" { #define TSDB_INS_TABLE_QNODES "ins_qnodes" #define TSDB_INS_TABLE_BNODES "ins_bnodes" // no longer used #define TSDB_INS_TABLE_SNODES "ins_snodes" +#define TSDB_INS_TABLE_ARBGROUPS "ins_arbgroups" #define TSDB_INS_TABLE_CLUSTER "ins_cluster" #define TSDB_INS_TABLE_DATABASES "ins_databases" #define TSDB_INS_TABLE_FUNCTIONS "ins_functions" diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 93f17fa887..7a7f19c3af 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -76,6 +76,11 @@ extern int32_t tsHeartbeatInterval; extern int32_t tsHeartbeatTimeout; extern int32_t tsSnapReplMaxWaitN; +// arbitrator +extern int32_t tsArbHeartBeatIntervalSec; +extern int32_t tsArbCheckSyncIntervalSec; +extern int32_t tsArbSetAssignedTimeoutSec; + // vnode extern int64_t tsVndCommitMaxIntervalMs; diff --git a/include/common/tgrant.h b/include/common/tgrant.h index ca9e030117..ac0d3155c7 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -61,9 +61,6 @@ typedef enum { int32_t grantCheck(EGrantType grant); int32_t grantCheckExpire(EGrantType grant); char* tGetMachineId(); -#ifdef TD_UNIQ_GRANT -int32_t grantCheckLE(EGrantType grant); -#endif // #ifndef GRANTS_CFG #ifdef TD_ENTERPRISE @@ -76,7 +73,7 @@ int32_t grantCheckLE(EGrantType grant); {.name = "state", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ - {.name = "cpu_cores", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ + {.name = "cpu_cores", .bytes = 13 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ } #else #define GRANTS_SCHEMA \ @@ -88,7 +85,7 @@ int32_t grantCheckLE(EGrantType grant); {.name = "state", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ - {.name = "cpu_cores", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ + {.name = "cpu_cores", .bytes = 13 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ } #endif // #define GRANT_CFG_ADD diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 1f812fb584..4913a34527 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -150,6 +150,7 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_GRANTS_FULL, TSDB_MGMT_TABLE_GRANTS_LOGS, TSDB_MGMT_TABLE_MACHINES, + TSDB_MGMT_TABLE_ARBGROUP, TSDB_MGMT_TABLE_MAX, } EShowType; @@ -336,6 +337,7 @@ typedef enum ENodeType { QUERY_NODE_SHOW_QNODES_STMT, QUERY_NODE_SHOW_SNODES_STMT, QUERY_NODE_SHOW_BNODES_STMT, + QUERY_NODE_SHOW_ARBGROUPS_STMT, QUERY_NODE_SHOW_CLUSTER_STMT, QUERY_NODE_SHOW_DATABASES_STMT, QUERY_NODE_SHOW_FUNCTIONS_STMT, @@ -1154,6 +1156,7 @@ typedef struct { int32_t tsdbPageSize; int32_t sqlLen; char* sql; + int8_t withArbitrator; } SCreateDbReq; int32_t tSerializeSCreateDbReq(void* buf, int32_t bufLen, SCreateDbReq* pReq); @@ -1182,6 +1185,7 @@ typedef struct { int32_t walRetentionSize; int32_t sqlLen; char* sql; + int8_t withArbitrator; } SAlterDbReq; int32_t tSerializeSAlterDbReq(void* buf, int32_t bufLen, SAlterDbReq* pReq); @@ -1304,6 +1308,7 @@ typedef struct { SArray* pRetensions; int8_t schemaless; int16_t sstTrigger; + int8_t withArbitrator; } SDbCfgRsp; typedef SDbCfgRsp SDbCfgInfo; @@ -2147,6 +2152,99 @@ typedef struct { int32_t tSerializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); int32_t tDeserializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); +typedef struct { + int32_t vgId; + int32_t hbSeq; +} SVArbHbReqMember; + +typedef struct { + int32_t dnodeId; + char* arbToken; + int64_t arbTerm; + SArray* hbMembers; // SVArbHbReqMember +} SVArbHeartBeatReq; + +int32_t tSerializeSVArbHeartBeatReq(void* buf, int32_t bufLen, SVArbHeartBeatReq* pReq); +int32_t tDeserializeSVArbHeartBeatReq(void* buf, int32_t bufLen, SVArbHeartBeatReq* pReq); +void tFreeSVArbHeartBeatReq(SVArbHeartBeatReq* pReq); + +typedef struct { + int32_t vgId; + char memberToken[TSDB_ARB_TOKEN_SIZE]; + int32_t hbSeq; +} SVArbHbRspMember; + +typedef struct { + char arbToken[TSDB_ARB_TOKEN_SIZE]; + int32_t dnodeId; + SArray* hbMembers; // SVArbHbRspMember +} SVArbHeartBeatRsp; + +int32_t tSerializeSVArbHeartBeatRsp(void* buf, int32_t bufLen, SVArbHeartBeatRsp* pRsp); +int32_t tDeserializeSVArbHeartBeatRsp(void* buf, int32_t bufLen, SVArbHeartBeatRsp* pRsp); +void tFreeSVArbHeartBeatRsp(SVArbHeartBeatRsp* pRsp); + +typedef struct { + char* arbToken; + int64_t arbTerm; + char* member0Token; + char* member1Token; +} SVArbCheckSyncReq; + +int32_t tSerializeSVArbCheckSyncReq(void* buf, int32_t bufLen, SVArbCheckSyncReq* pReq); +int32_t tDeserializeSVArbCheckSyncReq(void* buf, int32_t bufLen, SVArbCheckSyncReq* pReq); +void tFreeSVArbCheckSyncReq(SVArbCheckSyncReq* pRsp); + +typedef struct { + char* arbToken; + char* member0Token; + char* member1Token; + int32_t vgId; + int32_t errCode; +} SVArbCheckSyncRsp; + +int32_t tSerializeSVArbCheckSyncRsp(void* buf, int32_t bufLen, SVArbCheckSyncRsp* pRsp); +int32_t tDeserializeSVArbCheckSyncRsp(void* buf, int32_t bufLen, SVArbCheckSyncRsp* pRsp); +void tFreeSVArbCheckSyncRsp(SVArbCheckSyncRsp* pRsp); + +typedef struct { + char* arbToken; + int64_t arbTerm; + char* memberToken; +} SVArbSetAssignedLeaderReq; + +int32_t tSerializeSVArbSetAssignedLeaderReq(void* buf, int32_t bufLen, SVArbSetAssignedLeaderReq* pReq); +int32_t tDeserializeSVArbSetAssignedLeaderReq(void* buf, int32_t bufLen, SVArbSetAssignedLeaderReq* pReq); +void tFreeSVArbSetAssignedLeaderReq(SVArbSetAssignedLeaderReq* pReq); + +typedef struct { + char* arbToken; + char* memberToken; + int32_t vgId; +} SVArbSetAssignedLeaderRsp; + +int32_t tSerializeSVArbSetAssignedLeaderRsp(void* buf, int32_t bufLen, SVArbSetAssignedLeaderRsp* pRsp); +int32_t tDeserializeSVArbSetAssignedLeaderRsp(void* buf, int32_t bufLen, SVArbSetAssignedLeaderRsp* pRsp); +void tFreeSVArbSetAssignedLeaderRsp(SVArbSetAssignedLeaderRsp* pRsp); + +typedef struct { + int32_t dnodeId; + char* token; +} SMArbUpdateGroupReqMember; + +typedef struct { + int32_t vgId; + int64_t dbUid; + SMArbUpdateGroupReqMember members[2]; + int8_t isSync; + SMArbUpdateGroupReqMember assignedLeader; + int64_t version; +} SMArbUpdateGroupReq; + +int32_t tSerializeSMArbUpdateGroupReq(void* buf, int32_t bufLen, SMArbUpdateGroupReq* pReq); +int32_t tDeserializeSMArbUpdateGroupReq(void* buf, int32_t bufLen, SMArbUpdateGroupReq* pReq); +void tFreeSMArbUpdateGroupReq(SMArbUpdateGroupReq* pReq); + typedef struct { char queryStrId[TSDB_QUERY_ID_LEN]; } SKillQueryReq; diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h index dd1e54318e..03bf8da707 100644 --- a/include/common/tmsgcb.h +++ b/include/common/tmsgcb.h @@ -36,9 +36,11 @@ typedef enum { SYNC_QUEUE, SYNC_RD_QUEUE, STREAM_QUEUE, + ARB_QUEUE, QUEUE_MAX, } EQueueType; +typedef void (*GetDnodeEp)(void* pData, int32_t dnodeId, char* pEp, char* pFqdn, uint16_t* pPort); typedef bool (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); typedef int32_t (*PutToQueueFp)(void* pMgmt, EQueueType qtype, SRpcMsg* pMsg); typedef int32_t (*GetQueueSizeFp)(void* pMgmt, int32_t vgId, EQueueType qtype); @@ -64,6 +66,7 @@ typedef struct { ReleaseHandleFp releaseHandleFp; ReportStartup reportStartupFp; UpdateDnodeInfoFp updateDnodeInfoFp; + GetDnodeEp getDnodeEpFp; } SMsgCb; void tmsgSetDefault(const SMsgCb* msgcb); diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 62392a9caa..532a54e9f1 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -272,6 +272,8 @@ TD_DEF_MSG_TYPE(TDMT_VND_DISABLE_WRITE, "vnode-disable-write", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_QUERY_COMPACT_PROGRESS, "vnode-query-compact-progress", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_KILL_COMPACT, "kill-compact", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_ARB_HEARTBEAT, "vnode-arb-hb", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_ARB_CHECK_SYNC, "vnode-arb-check-sync", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_MAX_MSG, "vnd-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_VND_MSG) @@ -341,6 +343,7 @@ TD_DEF_MSG_TYPE(TDMT_SYNC_PREP_SNAPSHOT_REPLY, "sync-prep-snapshot-reply", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_UNUSED_CODE, "sync-unused", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_FORCE_FOLLOWER, "sync-force-become-follower", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SYNC_SET_ASSIGNED_LEADER, "sync-set-assigned-leader", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_SYNC_MSG) @@ -367,6 +370,13 @@ TD_DEF_MSG_TYPE(TDMT_VND_TMQ_MAX_MSG, "vnd-tmq-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_TMQ_MSG) + TD_NEW_MSG_SEG(TDMT_MND_ARB_MSG) //9 << 8 + TD_DEF_MSG_TYPE(TDMT_MND_ARB_HEARTBEAT_TIMER, "mnd-arb-hb-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_CHECK_SYNC_TIMER, "mnd-arb-check-sync-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_UPDATE_GROUP, "mnd-arb-update-group", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_MAX_MSG, "mnd-arb-max", NULL, NULL) + TD_CLOSE_MSG_SEG(TDMT_END_ARB_MSG) + TD_NEW_MSG_SEG(TDMT_MAX_MSG) // msg end mark TD_CLOSE_MSG_SEG(TDMT_END_MAX_MSG) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 929f690471..145afa232b 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -170,206 +170,207 @@ #define TK_STABLES 151 #define TK_MNODES 152 #define TK_QNODES 153 -#define TK_FUNCTIONS 154 -#define TK_INDEXES 155 -#define TK_ACCOUNTS 156 -#define TK_APPS 157 -#define TK_CONNECTIONS 158 -#define TK_LICENCES 159 -#define TK_GRANTS 160 -#define TK_FULL 161 -#define TK_LOGS 162 -#define TK_MACHINES 163 -#define TK_QUERIES 164 -#define TK_SCORES 165 -#define TK_TOPICS 166 -#define TK_VARIABLES 167 -#define TK_BNODES 168 -#define TK_SNODES 169 -#define TK_TRANSACTIONS 170 -#define TK_DISTRIBUTED 171 -#define TK_CONSUMERS 172 -#define TK_SUBSCRIPTIONS 173 -#define TK_VNODES 174 -#define TK_ALIVE 175 -#define TK_VIEWS 176 -#define TK_VIEW 177 -#define TK_COMPACTS 178 -#define TK_NORMAL 179 -#define TK_CHILD 180 -#define TK_LIKE 181 -#define TK_TBNAME 182 -#define TK_QTAGS 183 -#define TK_AS 184 -#define TK_SYSTEM 185 -#define TK_INDEX 186 -#define TK_FUNCTION 187 -#define TK_INTERVAL 188 -#define TK_COUNT 189 -#define TK_LAST_ROW 190 -#define TK_META 191 -#define TK_ONLY 192 -#define TK_TOPIC 193 -#define TK_CONSUMER 194 -#define TK_GROUP 195 -#define TK_DESC 196 -#define TK_DESCRIBE 197 -#define TK_RESET 198 -#define TK_QUERY 199 -#define TK_CACHE 200 -#define TK_EXPLAIN 201 -#define TK_ANALYZE 202 -#define TK_VERBOSE 203 -#define TK_NK_BOOL 204 -#define TK_RATIO 205 -#define TK_NK_FLOAT 206 -#define TK_OUTPUTTYPE 207 -#define TK_AGGREGATE 208 -#define TK_BUFSIZE 209 -#define TK_LANGUAGE 210 -#define TK_REPLACE 211 -#define TK_STREAM 212 -#define TK_INTO 213 -#define TK_PAUSE 214 -#define TK_RESUME 215 -#define TK_TRIGGER 216 -#define TK_AT_ONCE 217 -#define TK_WINDOW_CLOSE 218 -#define TK_IGNORE 219 -#define TK_EXPIRED 220 -#define TK_FILL_HISTORY 221 -#define TK_UPDATE 222 -#define TK_SUBTABLE 223 -#define TK_UNTREATED 224 -#define TK_KILL 225 -#define TK_CONNECTION 226 -#define TK_TRANSACTION 227 -#define TK_BALANCE 228 -#define TK_VGROUP 229 -#define TK_LEADER 230 -#define TK_MERGE 231 -#define TK_REDISTRIBUTE 232 -#define TK_SPLIT 233 -#define TK_DELETE 234 -#define TK_INSERT 235 -#define TK_NK_BIN 236 -#define TK_NK_HEX 237 -#define TK_NULL 238 -#define TK_NK_QUESTION 239 -#define TK_NK_ALIAS 240 -#define TK_NK_ARROW 241 -#define TK_ROWTS 242 -#define TK_QSTART 243 -#define TK_QEND 244 -#define TK_QDURATION 245 -#define TK_WSTART 246 -#define TK_WEND 247 -#define TK_WDURATION 248 -#define TK_IROWTS 249 -#define TK_ISFILLED 250 -#define TK_CAST 251 -#define TK_NOW 252 -#define TK_TODAY 253 -#define TK_TIMEZONE 254 -#define TK_CLIENT_VERSION 255 -#define TK_SERVER_VERSION 256 -#define TK_SERVER_STATUS 257 -#define TK_CURRENT_USER 258 -#define TK_CASE 259 -#define TK_WHEN 260 -#define TK_THEN 261 -#define TK_ELSE 262 -#define TK_BETWEEN 263 -#define TK_IS 264 -#define TK_NK_LT 265 -#define TK_NK_GT 266 -#define TK_NK_LE 267 -#define TK_NK_GE 268 -#define TK_NK_NE 269 -#define TK_MATCH 270 -#define TK_NMATCH 271 -#define TK_CONTAINS 272 -#define TK_IN 273 -#define TK_JOIN 274 -#define TK_INNER 275 -#define TK_SELECT 276 -#define TK_NK_HINT 277 -#define TK_DISTINCT 278 -#define TK_WHERE 279 -#define TK_PARTITION 280 -#define TK_BY 281 -#define TK_SESSION 282 -#define TK_STATE_WINDOW 283 -#define TK_EVENT_WINDOW 284 -#define TK_COUNT_WINDOW 285 -#define TK_SLIDING 286 -#define TK_FILL 287 -#define TK_VALUE 288 -#define TK_VALUE_F 289 -#define TK_NONE 290 -#define TK_PREV 291 -#define TK_NULL_F 292 -#define TK_LINEAR 293 -#define TK_NEXT 294 -#define TK_HAVING 295 -#define TK_RANGE 296 -#define TK_EVERY 297 -#define TK_ORDER 298 -#define TK_SLIMIT 299 -#define TK_SOFFSET 300 -#define TK_LIMIT 301 -#define TK_OFFSET 302 -#define TK_ASC 303 -#define TK_NULLS 304 -#define TK_ABORT 305 -#define TK_AFTER 306 -#define TK_ATTACH 307 -#define TK_BEFORE 308 -#define TK_BEGIN 309 -#define TK_BITAND 310 -#define TK_BITNOT 311 -#define TK_BITOR 312 -#define TK_BLOCKS 313 -#define TK_CHANGE 314 -#define TK_COMMA 315 -#define TK_CONCAT 316 -#define TK_CONFLICT 317 -#define TK_COPY 318 -#define TK_DEFERRED 319 -#define TK_DELIMITERS 320 -#define TK_DETACH 321 -#define TK_DIVIDE 322 -#define TK_DOT 323 -#define TK_EACH 324 -#define TK_FAIL 325 -#define TK_FILE 326 -#define TK_FOR 327 -#define TK_GLOB 328 -#define TK_ID 329 -#define TK_IMMEDIATE 330 -#define TK_IMPORT 331 -#define TK_INITIALLY 332 -#define TK_INSTEAD 333 -#define TK_ISNULL 334 -#define TK_MODULES 335 -#define TK_NK_BITNOT 336 -#define TK_NK_SEMI 337 -#define TK_NOTNULL 338 -#define TK_OF 339 -#define TK_PLUS 340 -#define TK_PRIVILEGE 341 -#define TK_RAISE 342 -#define TK_RESTRICT 343 -#define TK_ROW 344 -#define TK_SEMI 345 -#define TK_STAR 346 -#define TK_STATEMENT 347 -#define TK_STRICT 348 -#define TK_STRING 349 -#define TK_TIMES 350 -#define TK_VALUES 351 -#define TK_VARIABLE 352 -#define TK_WAL 353 +#define TK_ARBGROUPS 154 +#define TK_FUNCTIONS 155 +#define TK_INDEXES 156 +#define TK_ACCOUNTS 157 +#define TK_APPS 158 +#define TK_CONNECTIONS 159 +#define TK_LICENCES 160 +#define TK_GRANTS 161 +#define TK_FULL 162 +#define TK_LOGS 163 +#define TK_MACHINES 164 +#define TK_QUERIES 165 +#define TK_SCORES 166 +#define TK_TOPICS 167 +#define TK_VARIABLES 168 +#define TK_BNODES 169 +#define TK_SNODES 170 +#define TK_TRANSACTIONS 171 +#define TK_DISTRIBUTED 172 +#define TK_CONSUMERS 173 +#define TK_SUBSCRIPTIONS 174 +#define TK_VNODES 175 +#define TK_ALIVE 176 +#define TK_VIEWS 177 +#define TK_VIEW 178 +#define TK_COMPACTS 179 +#define TK_NORMAL 180 +#define TK_CHILD 181 +#define TK_LIKE 182 +#define TK_TBNAME 183 +#define TK_QTAGS 184 +#define TK_AS 185 +#define TK_SYSTEM 186 +#define TK_INDEX 187 +#define TK_FUNCTION 188 +#define TK_INTERVAL 189 +#define TK_COUNT 190 +#define TK_LAST_ROW 191 +#define TK_META 192 +#define TK_ONLY 193 +#define TK_TOPIC 194 +#define TK_CONSUMER 195 +#define TK_GROUP 196 +#define TK_DESC 197 +#define TK_DESCRIBE 198 +#define TK_RESET 199 +#define TK_QUERY 200 +#define TK_CACHE 201 +#define TK_EXPLAIN 202 +#define TK_ANALYZE 203 +#define TK_VERBOSE 204 +#define TK_NK_BOOL 205 +#define TK_RATIO 206 +#define TK_NK_FLOAT 207 +#define TK_OUTPUTTYPE 208 +#define TK_AGGREGATE 209 +#define TK_BUFSIZE 210 +#define TK_LANGUAGE 211 +#define TK_REPLACE 212 +#define TK_STREAM 213 +#define TK_INTO 214 +#define TK_PAUSE 215 +#define TK_RESUME 216 +#define TK_TRIGGER 217 +#define TK_AT_ONCE 218 +#define TK_WINDOW_CLOSE 219 +#define TK_IGNORE 220 +#define TK_EXPIRED 221 +#define TK_FILL_HISTORY 222 +#define TK_UPDATE 223 +#define TK_SUBTABLE 224 +#define TK_UNTREATED 225 +#define TK_KILL 226 +#define TK_CONNECTION 227 +#define TK_TRANSACTION 228 +#define TK_BALANCE 229 +#define TK_VGROUP 230 +#define TK_LEADER 231 +#define TK_MERGE 232 +#define TK_REDISTRIBUTE 233 +#define TK_SPLIT 234 +#define TK_DELETE 235 +#define TK_INSERT 236 +#define TK_NK_BIN 237 +#define TK_NK_HEX 238 +#define TK_NULL 239 +#define TK_NK_QUESTION 240 +#define TK_NK_ALIAS 241 +#define TK_NK_ARROW 242 +#define TK_ROWTS 243 +#define TK_QSTART 244 +#define TK_QEND 245 +#define TK_QDURATION 246 +#define TK_WSTART 247 +#define TK_WEND 248 +#define TK_WDURATION 249 +#define TK_IROWTS 250 +#define TK_ISFILLED 251 +#define TK_CAST 252 +#define TK_NOW 253 +#define TK_TODAY 254 +#define TK_TIMEZONE 255 +#define TK_CLIENT_VERSION 256 +#define TK_SERVER_VERSION 257 +#define TK_SERVER_STATUS 258 +#define TK_CURRENT_USER 259 +#define TK_CASE 260 +#define TK_WHEN 261 +#define TK_THEN 262 +#define TK_ELSE 263 +#define TK_BETWEEN 264 +#define TK_IS 265 +#define TK_NK_LT 266 +#define TK_NK_GT 267 +#define TK_NK_LE 268 +#define TK_NK_GE 269 +#define TK_NK_NE 270 +#define TK_MATCH 271 +#define TK_NMATCH 272 +#define TK_CONTAINS 273 +#define TK_IN 274 +#define TK_JOIN 275 +#define TK_INNER 276 +#define TK_SELECT 277 +#define TK_NK_HINT 278 +#define TK_DISTINCT 279 +#define TK_WHERE 280 +#define TK_PARTITION 281 +#define TK_BY 282 +#define TK_SESSION 283 +#define TK_STATE_WINDOW 284 +#define TK_EVENT_WINDOW 285 +#define TK_COUNT_WINDOW 286 +#define TK_SLIDING 287 +#define TK_FILL 288 +#define TK_VALUE 289 +#define TK_VALUE_F 290 +#define TK_NONE 291 +#define TK_PREV 292 +#define TK_NULL_F 293 +#define TK_LINEAR 294 +#define TK_NEXT 295 +#define TK_HAVING 296 +#define TK_RANGE 297 +#define TK_EVERY 298 +#define TK_ORDER 299 +#define TK_SLIMIT 300 +#define TK_SOFFSET 301 +#define TK_LIMIT 302 +#define TK_OFFSET 303 +#define TK_ASC 304 +#define TK_NULLS 305 +#define TK_ABORT 306 +#define TK_AFTER 307 +#define TK_ATTACH 308 +#define TK_BEFORE 309 +#define TK_BEGIN 310 +#define TK_BITAND 311 +#define TK_BITNOT 312 +#define TK_BITOR 313 +#define TK_BLOCKS 314 +#define TK_CHANGE 315 +#define TK_COMMA 316 +#define TK_CONCAT 317 +#define TK_CONFLICT 318 +#define TK_COPY 319 +#define TK_DEFERRED 320 +#define TK_DELIMITERS 321 +#define TK_DETACH 322 +#define TK_DIVIDE 323 +#define TK_DOT 324 +#define TK_EACH 325 +#define TK_FAIL 326 +#define TK_FILE 327 +#define TK_FOR 328 +#define TK_GLOB 329 +#define TK_ID 330 +#define TK_IMMEDIATE 331 +#define TK_IMPORT 332 +#define TK_INITIALLY 333 +#define TK_INSTEAD 334 +#define TK_ISNULL 335 +#define TK_MODULES 336 +#define TK_NK_BITNOT 337 +#define TK_NK_SEMI 338 +#define TK_NOTNULL 339 +#define TK_OF 340 +#define TK_PLUS 341 +#define TK_PRIVILEGE 342 +#define TK_RAISE 343 +#define TK_RESTRICT 344 +#define TK_ROW 345 +#define TK_SEMI 346 +#define TK_STAR 347 +#define TK_STATEMENT 348 +#define TK_STRICT 349 +#define TK_STRING 350 +#define TK_TIMES 351 +#define TK_VALUES 352 +#define TK_VARIABLE 353 +#define TK_WAL 354 #define TK_NK_SPACE 600 diff --git a/include/dnode/mnode/mnode.h b/include/dnode/mnode/mnode.h index 6c3c7497b1..108e6f18a6 100644 --- a/include/dnode/mnode/mnode.h +++ b/include/dnode/mnode/mnode.h @@ -75,6 +75,9 @@ void mndStop(SMnode *pMnode); int32_t mndIsCatchUp(SMnode *pMnode); ESyncRole mndGetRole(SMnode *pMnode); +int64_t mndGetTerm(SMnode *pMnode); + +int32_t mndGetArbToken(SMnode *pMnode, char *outToken); /** * @brief Get mnode monitor info. diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h index 04bc839d51..b47a162a1a 100644 --- a/include/libs/executor/storageapi.h +++ b/include/libs/executor/storageapi.h @@ -238,12 +238,12 @@ typedef struct SStoreSnapshotFn { } SStoreSnapshotFn; typedef struct SStoreMeta { - SMTbCursor* (*openTableMetaCursor)(void* pVnode); // metaOpenTbCursor - void (*closeTableMetaCursor)(SMTbCursor* pTbCur); // metaCloseTbCursor - void (*pauseTableMetaCursor)(SMTbCursor* pTbCur); // metaPauseTbCursor - void (*resumeTableMetaCursor)(SMTbCursor* pTbCur, int8_t first); // metaResumeTbCursor - int32_t (*cursorNext)(SMTbCursor* pTbCur, ETableType jumpTableType); // metaTbCursorNext - int32_t (*cursorPrev)(SMTbCursor* pTbCur, ETableType jumpTableType); // metaTbCursorPrev + SMTbCursor* (*openTableMetaCursor)(void* pVnode); // metaOpenTbCursor + void (*closeTableMetaCursor)(SMTbCursor* pTbCur); // metaCloseTbCursor + void (*pauseTableMetaCursor)(SMTbCursor* pTbCur); // metaPauseTbCursor + void (*resumeTableMetaCursor)(SMTbCursor* pTbCur, int8_t first, int8_t move); // metaResumeTbCursor + int32_t (*cursorNext)(SMTbCursor* pTbCur, ETableType jumpTableType); // metaTbCursorNext + int32_t (*cursorPrev)(SMTbCursor* pTbCur, ETableType jumpTableType); // metaTbCursorPrev int32_t (*getTableTags)(void* pVnode, uint64_t suid, SArray* uidList); int32_t (*getTableTagsByUid)(void* pVnode, int64_t suid, SArray* uidList); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index b7c6a1902c..15522110b5 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -100,6 +100,7 @@ typedef struct SDatabaseOptions { int32_t sstTrigger; int32_t tablePrefix; int32_t tableSuffix; + int8_t withArbitrator; } SDatabaseOptions; typedef struct SCreateDatabaseStmt { diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index cb053d2548..0be03b82f3 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -80,6 +80,7 @@ typedef enum { TAOS_SYNC_STATE_LEADER = 102, TAOS_SYNC_STATE_ERROR = 103, TAOS_SYNC_STATE_LEARNER = 104, + TAOS_SYNC_STATE_ASSIGNED_LEADER = 105, } ESyncState; typedef enum { @@ -184,6 +185,7 @@ typedef struct SSyncFSM { void (*FpBecomeLeaderCb)(const struct SSyncFSM* pFsm); void (*FpBecomeFollowerCb)(const struct SSyncFSM* pFsm); void (*FpBecomeLearnerCb)(const struct SSyncFSM* pFsm); + void (*FpBecomeAssignedLeaderCb)(const struct SSyncFSM* pFsm); int32_t (*FpGetSnapshot)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot, void* pReaderParam, void** ppReader); int32_t (*FpGetSnapshotInfo)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot); @@ -273,6 +275,7 @@ int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq); int32_t syncCheckMember(int64_t rid); int32_t syncIsCatchUp(int64_t rid); ESyncRole syncGetRole(int64_t rid); +int64_t syncGetTerm(int64_t rid); int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg); int32_t syncReconfig(int64_t rid, SSyncCfg* pCfg); int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex); @@ -284,8 +287,13 @@ bool syncSnapshotSending(int64_t rid); bool syncSnapshotRecving(int64_t rid); int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq); int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg); +int32_t syncBecomeAssignedLeader(SSyncNode* ths, SRpcMsg* pRpcMsg); + +int32_t syncUpdateArbTerm(int64_t rid, SyncTerm arbTerm); SSyncState syncGetState(int64_t rid); +int32_t syncGetArbToken(int64_t rid, char* outToken); +int32_t syncGetAssignedLogSynced(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); const char* syncStr(ESyncState state); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index b2ebd34255..ba66cfb06a 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -323,6 +323,9 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_BNODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A7) #define TSDB_CODE_MND_TOO_FEW_MNODES TAOS_DEF_ERROR_CODE(0, 0x03A8) #define TSDB_CODE_MND_TOO_MANY_MNODES TAOS_DEF_ERROR_CODE(0, 0x03A9) +#define TSDB_CODE_MND_ARBGROUP_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AA) +#define TSDB_CODE_MND_ARBGROUP_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AB) +#define TSDB_CODE_MND_ARB_TOKEN_MISMATCH TAOS_DEF_ERROR_CODE(0, 0x03AC) // mnode-dnode-part2 #define TSDB_CODE_MND_TOO_MANY_DNODES TAOS_DEF_ERROR_CODE(0, 0x03B0) @@ -472,6 +475,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_VND_ALREADY_IS_VOTER TAOS_DEF_ERROR_CODE(0, 0x0533) // internal #define TSDB_CODE_VND_DIR_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0534) #define TSDB_CODE_VND_META_DATA_UNSAFE_DELETE TAOS_DEF_ERROR_CODE(0, 0x0535) +#define TSDB_CODE_VND_ARB_NOT_SYNCED TAOS_DEF_ERROR_CODE(0, 0x0536) // internal // tsdb #define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600) diff --git a/include/util/tdef.h b/include/util/tdef.h index e2d1beb5a5..fe24e4e6f6 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -279,6 +279,9 @@ typedef enum ELogicConditionType { #define TSDB_SHOW_SUBQUERY_LEN 1000 #define TSDB_LOG_VAR_LEN 32 +#define TSDB_ARB_GROUP_MEMBER_NUM 2 +#define TSDB_ARB_TOKEN_SIZE 32 + #define TSDB_TRANS_STAGE_LEN 12 #define TSDB_TRANS_TYPE_LEN 16 #define TSDB_TRANS_ERROR_LEN 512 @@ -425,6 +428,10 @@ typedef enum ELogicConditionType { #define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 #define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 +#define TSDB_DEFAULT_DB_WITH_ARBITRATOR 0 +#define TSDB_MIN_DB_WITH_ARBITRATOR 0 +#define TSDB_MAX_DB_WITH_ARBITRATOR 1 + #define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond #define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) #define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond @@ -523,12 +530,12 @@ enum { SND_WORKER_TYPE__UNIQUE, }; -#define DEFAULT_HANDLE 0 -#define MNODE_HANDLE 1 -#define QNODE_HANDLE -1 -#define SNODE_HANDLE -2 -#define VNODE_HANDLE -3 -#define CLIENT_HANDLE -5 +#define DEFAULT_HANDLE 0 +#define MNODE_HANDLE 1 +#define QNODE_HANDLE -1 +#define SNODE_HANDLE -2 +#define VNODE_HANDLE -3 +#define CLIENT_HANDLE -5 #define TSDB_CONFIG_OPTION_LEN 32 #define TSDB_CONFIG_VALUE_LEN 64 @@ -548,8 +555,8 @@ enum { // sort page size by default #define DEFAULT_PAGESIZE 4096 -#define VNODE_TIMEOUT_SEC 60 -#define MNODE_TIMEOUT_SEC 60 +#define VNODE_TIMEOUT_SEC 60 +#define MNODE_TIMEOUT_SEC 60 #define MONITOR_TABLENAME_LEN 200 #define MONITOR_TAG_NAME_LEN 100 diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 25cc5d7c79..e0c0cc89ab 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -68,6 +68,16 @@ static const SSysDbTableSchema snodesSchema[] = { {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, }; +static const SSysDbTableSchema arbGroupsSchema[] = { + {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, + {.name = "v1_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "v2_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "is_sync", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "assigned_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "assigned_token", .bytes = TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +}; + static const SSysDbTableSchema clusterSchema[] = { {.name = "id", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, {.name = "name", .bytes = TSDB_CLUSTER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, @@ -107,6 +117,7 @@ static const SSysDbTableSchema userDBSchema[] = { {.name = "table_suffix", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, {.name = "tsdb_pagesize", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, {.name = "keep_time_offset", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "with_arbitrator", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, }; static const SSysDbTableSchema userFuncSchema[] = { @@ -348,21 +359,24 @@ static const SSysDbTableSchema userCompactsDetailSchema[] = { {.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, }; -static const SSysDbTableSchema useGrantsFullSchema[] = { +static const SSysDbTableSchema userGrantsFullSchema[] = { {.name = "grant_name", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "display_name", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "expire", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "limits", .bytes = 512 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; -static const SSysDbTableSchema useGrantsLogsSchema[] = { +static const SSysDbTableSchema userGrantsLogsSchema[] = { {.name = "state", .bytes = 1536 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "active", .bytes = 512 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "machine", .bytes = TSDB_GRANT_LOG_COL_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; -static const SSysDbTableSchema useMachinesSchema[] = { +static const SSysDbTableSchema userMachinesSchema[] = { {.name = "id", .bytes = TSDB_CLUSTER_ID_LEN + 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +#ifndef TD_UNIQ_GRANT + {.name = "dnode_num", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, +#endif {.name = "machine", .bytes = 7552 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; @@ -395,9 +409,10 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_VIEWS, userViewsSchema, tListLen(userViewsSchema), false}, {TSDB_INS_TABLE_COMPACTS, userCompactsSchema, tListLen(userCompactsSchema), false}, {TSDB_INS_TABLE_COMPACT_DETAILS, userCompactsDetailSchema, tListLen(userCompactsDetailSchema), false}, - {TSDB_INS_TABLE_GRANTS_FULL, useGrantsFullSchema, tListLen(useGrantsFullSchema), true}, - {TSDB_INS_TABLE_GRANTS_LOGS, useGrantsLogsSchema, tListLen(useGrantsLogsSchema), true}, - {TSDB_INS_TABLE_MACHINES, useMachinesSchema, tListLen(useMachinesSchema), true}, + {TSDB_INS_TABLE_GRANTS_FULL, userGrantsFullSchema, tListLen(userGrantsFullSchema), true}, + {TSDB_INS_TABLE_GRANTS_LOGS, userGrantsLogsSchema, tListLen(userGrantsLogsSchema), true}, + {TSDB_INS_TABLE_MACHINES, userMachinesSchema, tListLen(userMachinesSchema), true}, + {TSDB_INS_TABLE_ARBGROUPS, arbGroupsSchema, tListLen(arbGroupsSchema), true}, }; static const SSysDbTableSchema connectionsSchema[] = { diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 7a5a7d1afc..3381d52050 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -82,6 +82,11 @@ int32_t tsMndGrantMode = 0; bool tsMndSkipGrant = false; bool tsEnableWhiteList = false; // ip white list cfg +// arbitrator +int32_t tsArbHeartBeatIntervalSec = 5; +int32_t tsArbCheckSyncIntervalSec = 10; +int32_t tsArbSetAssignedTimeoutSec = 30; + // dnode int64_t tsDndStart = 0; int64_t tsDndStartOsUptime = 0; @@ -672,6 +677,16 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { (TSDB_SYNC_SNAP_BUFFER_SIZE >> 2), CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; + if (cfgAddInt32(pCfg, "arbHeartBeatIntervalSec", tsArbHeartBeatIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt32(pCfg, "arbCheckSyncIntervalSec", tsArbCheckSyncIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt32(pCfg, "arbSetAssignedTimeoutSec", tsArbSetAssignedTimeoutSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) @@ -1187,6 +1202,10 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsHeartbeatTimeout = cfgGetItem(pCfg, "syncHeartbeatTimeout")->i32; tsSnapReplMaxWaitN = cfgGetItem(pCfg, "syncSnapReplMaxWaitN")->i32; + tsArbHeartBeatIntervalSec = cfgGetItem(pCfg, "arbHeartBeatIntervalSec")->i32; + tsArbCheckSyncIntervalSec = cfgGetItem(pCfg, "arbCheckSyncIntervalSec")->i32; + tsArbSetAssignedTimeoutSec = cfgGetItem(pCfg, "arbSetAssignedTimeoutSec")->i32; + tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64; tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64; tsMndSkipGrant = cfgGetItem(pCfg, "skipGrant")->bval; diff --git a/source/common/src/tgrant.c b/source/common/src/tgrant.c index 2b5d91788e..fa1a7d90b7 100644 --- a/source/common/src/tgrant.c +++ b/source/common/src/tgrant.c @@ -21,11 +21,5 @@ int32_t grantCheck(EGrantType grant) { return TSDB_CODE_SUCCESS; } int32_t grantCheckExpire(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#ifdef TD_UNIQ_GRANT -int32_t grantCheckLE(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#endif #else -#ifdef TD_UNIQ_GRANT -int32_t grantCheckExpire(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#endif #endif \ No newline at end of file diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 5b154df8a3..ff424ee558 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3024,6 +3024,9 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) { if (tEncodeI32(&encoder, pReq->keepTimeOffset) < 0) return -1; ENCODESQL(); + + if (tEncodeI32(&encoder, pReq->withArbitrator) < 0) return -1; + tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3093,8 +3096,12 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) DECODESQL(); - tEndDecode(&decoder); + pReq->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pReq->withArbitrator) < 0) return -1; + } + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; } @@ -3133,6 +3140,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tEncodeI32(&encoder, pReq->walRetentionSize) < 0) return -1; if (tEncodeI32(&encoder, pReq->keepTimeOffset) < 0) return -1; ENCODESQL(); + if (tEncodeI32(&encoder, pReq->withArbitrator) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3182,6 +3190,10 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { } DECODESQL(); + pReq->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pReq->withArbitrator) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -3969,6 +3981,7 @@ int32_t tSerializeSDbCfgRspImpl(SEncoder *encoder, const SDbCfgRsp *pRsp) { if (tEncodeI8(encoder, pRsp->schemaless) < 0) return -1; if (tEncodeI16(encoder, pRsp->sstTrigger) < 0) return -1; if (tEncodeI32(encoder, pRsp->keepTimeOffset) < 0) return -1; + if (tEncodeI8(encoder, pRsp->withArbitrator) < 0) return -1; return 0; } @@ -4041,6 +4054,10 @@ int32_t tDeserializeSDbCfgRspImpl(SDecoder *decoder, SDbCfgRsp *pRsp) { if (!tDecodeIsEnd(decoder)) { if (tDecodeI32(decoder, &pRsp->keepTimeOffset) < 0) return -1; } + pRsp->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(decoder)) { + if (tDecodeI8(decoder, &pRsp->withArbitrator) < 0) return -1; + } return 0; } @@ -5916,6 +5933,345 @@ int32_t tDeserializeSDCreateMnodeReq(void *buf, int32_t bufLen, SDCreateMnodeReq return 0; } +int32_t tSerializeSVArbHeartBeatReq(void *buf, int32_t bufLen, SVArbHeartBeatReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + + int32_t size = taosArrayGetSize(pReq->hbMembers); + if (tEncodeI32(&encoder, size) < 0) return -1; + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember *pMember = taosArrayGet(pReq->hbMembers, i); + if (tEncodeI32(&encoder, pMember->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pMember->hbSeq) < 0) return -1; + } + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbHeartBeatReq(void *buf, int32_t bufLen, SVArbHeartBeatReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + + pReq->hbMembers = taosArrayInit(16, sizeof(SVArbHbReqMember)); + int32_t size = 0; + if (tDecodeI32(&decoder, &size) < 0) return -1; + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember member = {0}; + if (tDecodeI32(&decoder, &member.vgId) < 0) return -1; + if (tDecodeI32(&decoder, &member.hbSeq) < 0) return -1; + taosArrayPush(pReq->hbMembers, &member); + } + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbHeartBeatReq(SVArbHeartBeatReq *pReq) { + if (!pReq) return; + taosMemoryFree(pReq->arbToken); + taosArrayDestroy(pReq->hbMembers); +} + +int32_t tSerializeSVArbHeartBeatRsp(void *buf, int32_t bufLen, SVArbHeartBeatRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->dnodeId) < 0) return -1; + int32_t sz = taosArrayGetSize(pRsp->hbMembers); + if (tEncodeI32(&encoder, sz) < 0) return -1; + for (int32_t i = 0; i < sz; i++) { + SVArbHbRspMember *pMember = taosArrayGet(pRsp->hbMembers, i); + if (tEncodeI32(&encoder, pMember->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pMember->hbSeq) < 0) return -1; + if (tEncodeCStr(&encoder, pMember->memberToken) < 0) return -1; + } + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbHeartBeatRsp(void *buf, int32_t bufLen, SVArbHeartBeatRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->dnodeId) < 0) return -1; + int32_t sz = 0; + if (tDecodeI32(&decoder, &sz) < 0) return -1; + pRsp->hbMembers = taosArrayInit(sz, sizeof(SVArbHbRspMember)); + for (int32_t i = 0; i < sz; i++) { + SVArbHbRspMember hbMember = {0}; + if (tDecodeI32(&decoder, &hbMember.vgId) < 0) return -1; + if (tDecodeI32(&decoder, &hbMember.hbSeq) < 0) return -1; + if (tDecodeCStrTo(&decoder, hbMember.memberToken) < 0) return -1; + taosArrayPush(pRsp->hbMembers, &hbMember); + } + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbHeartBeatRsp(SVArbHeartBeatRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosArrayDestroy(pRsp->hbMembers); +} + +int32_t tSerializeSVArbCheckSyncReq(void *buf, int32_t bufLen, SVArbCheckSyncReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->member0Token) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->member1Token) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbCheckSyncReq(void *buf, int32_t bufLen, SVArbCheckSyncReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + pReq->member0Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->member0Token) < 0) return -1; + pReq->member1Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->member1Token) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbCheckSyncReq(SVArbCheckSyncReq *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->member0Token); + taosMemoryFreeClear(pRsp->member1Token); +} + +int32_t tSerializeSVArbCheckSyncRsp(void *buf, int32_t bufLen, SVArbCheckSyncRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->member0Token) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->member1Token) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->errCode) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbCheckSyncRsp(void *buf, int32_t bufLen, SVArbCheckSyncRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pRsp->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + pRsp->member0Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->member0Token) < 0) return -1; + pRsp->member1Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->member1Token) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->errCode) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbCheckSyncRsp(SVArbCheckSyncRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->member0Token); + taosMemoryFreeClear(pRsp->member1Token); +} + +int32_t tSerializeSVArbSetAssignedLeaderReq(void *buf, int32_t bufLen, SVArbSetAssignedLeaderReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->memberToken) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbSetAssignedLeaderReq(void *buf, int32_t bufLen, SVArbSetAssignedLeaderReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + pReq->memberToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->memberToken) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbSetAssignedLeaderReq(SVArbSetAssignedLeaderReq *pReq) { + if (NULL == pReq) { + return; + } + taosMemoryFreeClear(pReq->arbToken); + taosMemoryFreeClear(pReq->memberToken); +} + +int32_t tSerializeSVArbSetAssignedLeaderRsp(void *buf, int32_t bufLen, SVArbSetAssignedLeaderRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->memberToken) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->vgId) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbSetAssignedLeaderRsp(void *buf, int32_t bufLen, SVArbSetAssignedLeaderRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pRsp->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + pRsp->memberToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->memberToken) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->vgId) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbSetAssignedLeaderRsp(SVArbSetAssignedLeaderRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->memberToken); +} + +int32_t tSerializeSMArbUpdateGroupReq(void *buf, int32_t bufLen, SMArbUpdateGroupReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI64(&encoder, pReq->dbUid) < 0) return -1; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + if (tEncodeI32(&encoder, pReq->members[i].dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->members[i].token) < 0) return -1; + } + if (tEncodeI8(&encoder, pReq->isSync) < 0) return -1; + if (tEncodeI32(&encoder, pReq->assignedLeader.dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->assignedLeader.token) < 0) return -1; + if (tEncodeI64(&encoder, pReq->version) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSMArbUpdateGroupReq(void *buf, int32_t bufLen, SMArbUpdateGroupReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->dbUid) < 0) return -1; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + if (tDecodeI32(&decoder, &pReq->members[i].dnodeId) < 0) return -1; + pReq->members[i].token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->members[i].token) < 0) return -1; + } + if (tDecodeI8(&decoder, &pReq->isSync) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->assignedLeader.dnodeId) < 0) return -1; + pReq->assignedLeader.token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->assignedLeader.token) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->version) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSMArbUpdateGroupReq(SMArbUpdateGroupReq *pReq) { + if (NULL == pReq) { + return; + } + for (int i = 0; i < 2; i++) { + taosMemoryFreeClear(pReq->members[i].token); + } + taosMemoryFreeClear(pReq->assignedLeader.token); +} + // int32_t tSerializeSAuthReq(void *buf, int32_t bufLen, SAuthReq *pReq) { // SEncoder encoder = {0}; // tEncoderInit(&encoder, buf, bufLen); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index aa5e87e8b1..393db84e18 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -90,16 +90,6 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) { rpcFreeCont(pRsp->pCont); } -void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) { - int32_t n = 0; - n += snprintf(buf + n, len - n, "%s", "{"); - for (int i = 0; i < epSet->numOfEps; i++) { - n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, - (i + 1 < epSet->numOfEps ? ", " : "")); - } - n += snprintf(buf + n, len - n, "%s", "}"); -} - void dmSendStatusReq(SDnodeMgmt *pMgmt) { SStatusReq req = {0}; diff --git a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h index 24f75e3c8b..bc2977fe31 100644 --- a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h +++ b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h @@ -33,6 +33,7 @@ typedef struct SMnodeMgmt { SSingleWorker fetchWorker; SSingleWorker readWorker; SSingleWorker writeWorker; + SSingleWorker arbWorker; SSingleWorker syncWorker; SSingleWorker syncRdWorker; bool stopped; @@ -53,6 +54,7 @@ int32_t mmProcessDropReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg); int32_t mmStartWorker(SMnodeMgmt *pMgmt); void mmStopWorker(SMnodeMgmt *pMgmt); int32_t mmPutMsgToWriteQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); +int32_t mmPutMsgToArbQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToSyncRdQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToReadQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index a3a5f1d971..7e38b994df 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -235,6 +235,9 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_INDEX_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_INDEX_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DISABLE_WRITE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_HEARTBEAT_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_CHECK_SYNC_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_ASSIGNED_LEADER_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT_ELECTION, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index bbd77c0828..75d5669824 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -107,6 +107,10 @@ int32_t mmPutMsgToWriteQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { return mmPutMsgToWorker(pMgmt, &pMgmt->writeWorker, pMsg); } +int32_t mmPutMsgToArbQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { + return mmPutMsgToWorker(pMgmt, &pMgmt->arbWorker, pMsg); +} + int32_t mmPutMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { return mmPutMsgToWorker(pMgmt, &pMgmt->syncWorker, pMsg); } @@ -153,6 +157,9 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { case READ_QUEUE: pWorker = &pMgmt->readWorker; break; + case ARB_QUEUE: + pWorker = &pMgmt->arbWorker; + break; case SYNC_QUEUE: pWorker = &pMgmt->syncWorker; break; @@ -252,6 +259,18 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) { return -1; } + SSingleWorkerCfg arbCfg = { + .min = 1, + .max = 1, + .name = "mnode-arb", + .fp = (FItem)mmProcessRpcMsg, + .param = pMgmt, + }; + if (tSingleWorkerInit(&pMgmt->arbWorker, &arbCfg) != 0) { + dError("failed to start mnode mnode-arb worker since %s", terrstr()); + return -1; + } + dDebug("mnode workers are initialized"); return 0; } @@ -263,6 +282,7 @@ void mmStopWorker(SMnodeMgmt *pMgmt) { tSingleWorkerCleanup(&pMgmt->fetchWorker); tSingleWorkerCleanup(&pMgmt->readWorker); tSingleWorkerCleanup(&pMgmt->writeWorker); + tSingleWorkerCleanup(&pMgmt->arbWorker); tSingleWorkerCleanup(&pMgmt->syncWorker); tSingleWorkerCleanup(&pMgmt->syncRdWorker); dDebug("mnode workers are closed"); diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index d9c368b582..375a34c04f 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -101,6 +101,7 @@ int32_t vmProcessDisableVnodeWriteReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessCheckLearnCatchupReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); +int32_t vmProcessArbHeartBeatReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); // vmFile.c int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index bfac0bab9d..722eaf1fd3 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -88,7 +88,9 @@ void vmGetMonitorInfo(SVnodeMgmt *pMgmt, SMonVmInfo *pInfo) { numOfInsertSuccessReqs += pLoad->numOfInsertSuccessReqs; numOfBatchInsertReqs += pLoad->numOfBatchInsertReqs; numOfBatchInsertSuccessReqs += pLoad->numOfBatchInsertSuccessReqs; - if (pLoad->syncState == TAOS_SYNC_STATE_LEADER) masterNum++; + if (pLoad->syncState == TAOS_SYNC_STATE_LEADER || pLoad->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + masterNum++; + } totalVnodes++; } @@ -770,6 +772,89 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return 0; } +int32_t vmProcessArbHeartBeatReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { + SVArbHeartBeatReq arbHbReq = {0}; + SVArbHeartBeatRsp arbHbRsp = {0}; + if (tDeserializeSVArbHeartBeatReq(pMsg->pCont, pMsg->contLen, &arbHbReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + if (arbHbReq.dnodeId != pMgmt->pData->dnodeId) { + terrno = TSDB_CODE_INVALID_MSG; + dError("dnodeId:%d not matched with local dnode", arbHbReq.dnodeId); + goto _OVER; + } + + if (strlen(arbHbReq.arbToken) == 0) { + terrno = TSDB_CODE_INVALID_MSG; + dError("dnodeId:%d arbToken is empty", arbHbReq.dnodeId); + goto _OVER; + } + + size_t size = taosArrayGetSize(arbHbReq.hbMembers); + + arbHbRsp.dnodeId = pMgmt->pData->dnodeId; + strncpy(arbHbRsp.arbToken, arbHbReq.arbToken, TSDB_ARB_TOKEN_SIZE); + arbHbRsp.hbMembers = taosArrayInit(size, sizeof(SVArbHbRspMember)); + + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember *pReqMember = taosArrayGet(arbHbReq.hbMembers, i); + SVnodeObj *pVnode = vmAcquireVnode(pMgmt, pReqMember->vgId); + if (pVnode == NULL) { + dError("dnodeId:%d vgId:%d not found failed to process arb hb req", arbHbReq.dnodeId, pReqMember->vgId); + continue; + } + + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = pReqMember->vgId; + rspMember.hbSeq = pReqMember->hbSeq; + if (vnodeGetArbToken(pVnode->pImpl, rspMember.memberToken) != 0) { + dError("dnodeId:%d vgId:%d failed to get arb token", arbHbReq.dnodeId, pReqMember->vgId); + vmReleaseVnode(pMgmt, pVnode); + continue; + } + + if (vnodeUpdateArbTerm(pVnode->pImpl, arbHbReq.arbTerm) != 0) { + dError("dnodeId:%d vgId:%d failed to update arb term", arbHbReq.dnodeId, pReqMember->vgId); + vmReleaseVnode(pMgmt, pVnode); + continue; + } + + taosArrayPush(arbHbRsp.hbMembers, &rspMember); + + vmReleaseVnode(pMgmt, pVnode); + } + + SRpcMsg rspMsg = {.info = pMsg->info}; + int32_t rspLen = tSerializeSVArbHeartBeatRsp(NULL, 0, &arbHbRsp); + if (rspLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + void *pRsp = rpcMallocCont(rspLen); + if (pRsp == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + if (tSerializeSVArbHeartBeatRsp(pRsp, rspLen, &arbHbRsp) <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pRsp); + goto _OVER; + } + pMsg->info.rsp = pRsp; + pMsg->info.rspLen = rspLen; + + terrno = TSDB_CODE_SUCCESS; + +_OVER: + tFreeSVArbHeartBeatReq(&arbHbReq); + tFreeSVArbHeartBeatRsp(&arbHbRsp); + return terrno == TSDB_CODE_SUCCESS ? 0 : -1; +} + SArray *vmGetMsgHandles() { int32_t code = -1; SArray *pArray = taosArrayInit(32, sizeof(SMgmtHandle)); @@ -873,6 +958,10 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_HEARTBEAT, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_CHECK_SYNC, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_ASSIGNED_LEADER, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; + code = 0; _OVER: diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index a6abe5ab4d..e4adfdb6b1 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -56,6 +56,9 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { case TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP: code = vmProcessCheckLearnCatchupReq(pMgmt, pMsg); break; + case TDMT_VND_ARB_HEARTBEAT: + code = vmProcessArbHeartBeatReq(pMgmt, pMsg); + break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; dGError("msg:%p, not processed in vnode-mgmt queue", pMsg); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 77760b16f4..754c42b82e 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -538,6 +538,7 @@ SMsgCb dmGetMsgcb(SDnode *pDnode) { .releaseHandleFp = dmReleaseHandle, .reportStartupFp = dmReportStartup, .updateDnodeInfoFp = dmUpdateDnodeInfo, + .getDnodeEpFp = dmGetDnodeEp, .data = &pDnode->data, }; return msgCb; diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 2175824acd..0dcb77d9df 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -184,11 +184,13 @@ int32_t dmReadEps(SDnodeData *pData); int32_t dmWriteEps(SDnodeData *pData); void dmUpdateEps(SDnodeData *pData, SArray *pDnodeEps); void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); +void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet); void dmRotateMnodeEpSet(SDnodeData *pData); void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet); void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); bool dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); void dmRemoveDnodePairs(SDnodeData *pData); +void dmGetDnodeEp(void *pData, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 20245c806b..2c341fbd4d 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -31,7 +31,8 @@ static bool dmIsEpChanged(SDnodeData *pData, int32_t dnodeId, const char *ep) static void dmResetEps(SDnodeData *pData, SArray *dnodeEps); static int32_t dmReadDnodePairs(SDnodeData *pData); -static void dmGetDnodeEp(SDnodeData *pData, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) { +void dmGetDnodeEp(void *data, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) { + SDnodeData *pData = data; taosThreadRwlockRdlock(&pData->lock); SDnodeEp *pDnodeEp = taosHashGet(pData->dnodeHash, &dnodeId, sizeof(int32_t)); @@ -335,6 +336,16 @@ void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { taosThreadRwlockUnlock(&pData->lock); } +void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) { + int32_t n = 0; + n += snprintf(buf + n, len - n, "%s", "{"); + for (int i = 0; i < epSet->numOfEps; i++) { + n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, + (i + 1 < epSet->numOfEps ? ", " : "")); + } + n += snprintf(buf + n, len - n, "%s", "}"); +} + static FORCE_INLINE void dmSwapEps(SEp *epLhs, SEp *epRhs) { SEp epTmp; diff --git a/source/dnode/mnode/impl/inc/mndArbGroup.h b/source/dnode/mnode/impl/inc/mndArbGroup.h new file mode 100644 index 0000000000..ed852cf581 --- /dev/null +++ b/source/dnode/mnode/impl/inc/mndArbGroup.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_MND_ARBGROUP_H_ +#define _TD_MND_ARBGROUP_H_ + +#include "mndInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t mndInitArbGroup(SMnode *pMnode); +void mndCleanupArbGroup(SMnode *pMnode); +SArbGroup *mndAcquireArbGroup(SMnode *pMnode, int32_t vgId); +void mndReleaseArbGroup(SMnode *pMnode, SArbGroup *pObj); +SSdbRaw *mndArbGroupActionEncode(SArbGroup *pGroup); +SSdbRow *mndArbGroupActionDecode(SSdbRaw *pRaw); + +void mndArbGroupInitFromVgObj(SVgObj *pVgObj, SArbGroup *outGroup); + +int32_t mndSetCreateArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup); +int32_t mndSetCreateArbGroupUndoLogs(STrans *pTrans, SArbGroup *pGroup); +int32_t mndSetCreateArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup); + +int32_t mndSetDropArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup); + +bool mndUpdateArbGroupByHeartBeat(SArbGroup *pGroup, SVArbHbRspMember *pRspMember, int64_t nowMs, int32_t dnodeId, + SArbGroup *pNewGroup); +bool mndUpdateArbGroupByCheckSync(SArbGroup *pGroup, int32_t vgId, char *member0Token, char *member1Token, + bool newIsSync, SArbGroup *pNewGroup); +bool mndUpdateArbGroupBySetAssignedLeader(SArbGroup *pGroup, int32_t vgId, char *memberToken, int32_t errcode, + SArbGroup *pNewGroup); + +int32_t mndGetArbGroupSize(SMnode *pMnode); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_ARBGROUP_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index b98ef31d75..a63157445b 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -104,6 +104,7 @@ typedef enum { TRN_CONFLICT_DB_INSIDE = 3, TRN_CONFLICT_TOPIC = 4, TRN_CONFLICT_TOPIC_INSIDE = 5, + TRN_CONFLICT_ARBGROUP = 6, } ETrnConflct; typedef enum { @@ -177,6 +178,7 @@ typedef struct { tmsg_t originRpcType; char dbname[TSDB_TABLE_FNAME_LEN]; char stbname[TSDB_TABLE_FNAME_LEN]; + int32_t arbGroupId; int32_t startFunc; int32_t stopFunc; int32_t paramLen; @@ -215,8 +217,6 @@ typedef struct { uint16_t port; char fqdn[TSDB_FQDN_LEN]; char ep[TSDB_EP_LEN]; - char active[TSDB_ACTIVE_KEY_LEN]; - char connActive[TSDB_CONN_ACTIVE_KEY_LEN]; char machineId[TSDB_MACHINE_ID_LEN + 1]; } SDnodeObj; @@ -248,6 +248,40 @@ typedef struct { SDnodeObj* pDnode; } SSnodeObj; +typedef struct { + int32_t dnodeId; + char token[TSDB_ARB_TOKEN_SIZE]; +} SArbAssignedLeader; + +typedef struct { + int32_t dnodeId; +} SArbMemberInfo; + +typedef struct { + int32_t nextHbSeq; + int32_t responsedHbSeq; + char token[TSDB_ARB_TOKEN_SIZE]; + int64_t lastHbMs; +} SArbMemberState; + +typedef struct { + SArbMemberInfo info; + SArbMemberState state; +} SArbGroupMember; + +typedef struct { + int32_t vgId; + int64_t dbUid; + SArbGroupMember members[TSDB_ARB_GROUP_MEMBER_NUM]; + int8_t isSync; + SArbAssignedLeader assignedLeader; + int64_t version; + + // following fields will not be duplicated + bool mutexInited; + TdThreadMutex mutex; +} SArbGroup; + typedef struct { int32_t maxUsers; int32_t maxDbs; @@ -344,6 +378,7 @@ typedef struct { int32_t walRollPeriod; int64_t walRetentionSize; int64_t walSegmentSize; + int8_t withArbitrator; } SDbCfg; typedef struct { diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index 83c2277612..ab104e316e 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -27,6 +27,7 @@ void mndCleanupDnode(SMnode *pMnode); SDnodeObj *mndAcquireDnode(SMnode *pMnode, int32_t dnodeId); void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode); SEpSet mndGetDnodeEpset(SDnodeObj *pDnode); +SEpSet mndGetDnodeEpsetById(SMnode *pMnode, int32_t dnodeId); int32_t mndGetDnodeSize(SMnode *pMnode); bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs); void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeInfo); diff --git a/source/dnode/mnode/impl/inc/mndStream.h b/source/dnode/mnode/impl/inc/mndStream.h index 5307ff4b05..5a4caf3348 100644 --- a/source/dnode/mnode/impl/inc/mndStream.h +++ b/source/dnode/mnode/impl/inc/mndStream.h @@ -107,7 +107,7 @@ SArray *mndTakeVgroupSnapshot(SMnode *pMnode, bool *allReady); void mndKillTransImpl(SMnode *pMnode, int32_t transId, const char *pDbName); int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset, int32_t retryCode); -STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, const char *name, const char *pMsg); +STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name, const char *pMsg); int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status); SSdbRaw *mndStreamActionEncode(SStreamObj *pStream); void killAllCheckpointTrans(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo); diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h index 59eaa915bc..8689df98af 100644 --- a/source/dnode/mnode/impl/inc/mndTrans.h +++ b/source/dnode/mnode/impl/inc/mndTrans.h @@ -78,6 +78,7 @@ int32_t mndTransAppendUndoAction(STrans *pTrans, STransAction *pAction); void mndTransSetRpcRsp(STrans *pTrans, void *pCont, int32_t contLen); void mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, void *param, int32_t paramLen); void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname); +void mndTransSetArbGroupId(STrans *pTrans, int32_t groupId); void mndTransSetSerial(STrans *pTrans); void mndTransSetParallel(STrans *pTrans); void mndTransSetOper(STrans *pTrans, EOperType oper); diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index b7f6769d12..444c16083c 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -29,6 +29,7 @@ void mndReleaseVgroup(SMnode *pMnode, SVgObj *pVgroup); SSdbRaw *mndVgroupActionEncode(SVgObj *pVgroup); SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw); SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup); +SEpSet mndGetVgroupEpsetById(SMnode *pMnode, int32_t vgId); int32_t mndGetVnodesNum(SMnode *pMnode, int32_t dnodeId); void mndSortVnodeGid(SVgObj *pVgroup); int64_t mndGetVnodesMemory(SMnode *pMnode, int32_t dnodeId); @@ -44,7 +45,7 @@ int32_t mndAddAlterVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pV int32_t mndAddDropVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, bool isRedo); int32_t mndSetMoveVgroupsInfoToTrans(SMnode *, STrans *pTrans, int32_t dropDnodeId, bool force, bool unsafe); int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, - SArray *pArray); + SArray *pArray, SVgObj* pNewVgroup); int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs, STimeWindow tw); int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, @@ -54,8 +55,8 @@ void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *p void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid); bool mndVgroupInDnode(SVgObj *pVgroup, int32_t dnodeId); -int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, - SDnodeObj *pDnode); +int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, + SDnodeObj *pDnode); int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgroup); diff --git a/source/dnode/mnode/impl/src/mndArbGroup.c b/source/dnode/mnode/impl/src/mndArbGroup.c new file mode 100644 index 0000000000..e056e698f3 --- /dev/null +++ b/source/dnode/mnode/impl/src/mndArbGroup.c @@ -0,0 +1,1096 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#define _DEFAULT_SOURCE +#include "mndArbGroup.h" +#include "audit.h" +#include "mndDb.h" +#include "mndDnode.h" +#include "mndPrivilege.h" +#include "mndShow.h" +#include "mndTrans.h" +#include "mndUser.h" +#include "mndVgroup.h" + +#define ARBGROUP_VER_NUMBER 1 +#define ARBGROUP_RESERVE_SIZE 64 + +static int32_t mndArbGroupActionInsert(SSdb *pSdb, SArbGroup *pGroup); +static int32_t mndArbGroupActionUpdate(SSdb *pSdb, SArbGroup *pOld, SArbGroup *pNew); +static int32_t mndArbGroupActionDelete(SSdb *pSdb, SArbGroup *pGroup); + +static void mndArbGroupDupObj(SArbGroup *pGroup, SArbGroup *pNew); +static void mndArbGroupSetAssignedLeader(SArbGroup *pGroup, int32_t index); +static void mndArbGroupResetAssignedLeader(SArbGroup *pGroup); + +static int32_t mndArbGroupUpdateTrans(SMnode *pMnode, SArbGroup *pNew); +static int32_t mndPullupArbUpdateGroup(SMnode *pMnode, SArbGroup *pNewGroup); + +static int32_t mndProcessArbHbTimer(SRpcMsg *pReq); +static int32_t mndProcessArbCheckSyncTimer(SRpcMsg *pReq); +static int32_t mndProcessArbUpdateGroupReq(SRpcMsg *pReq); +static int32_t mndProcessArbHbRsp(SRpcMsg *pRsp); +static int32_t mndProcessArbCheckSyncRsp(SRpcMsg *pRsp); +static int32_t mndProcessArbSetAssignedLeaderRsp(SRpcMsg *pRsp); +static int32_t mndRetrieveArbGroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); +static void mndCancelGetNextArbGroup(SMnode *pMnode, void *pIter); + +static int32_t mndArbCheckToken(const char *token1, const char *token2) { + if (token1 == NULL || token2 == NULL) return -1; + if (strlen(token1) == 0 || strlen(token2) == 0) return -1; + return strncmp(token1, token2, TSDB_ARB_TOKEN_SIZE); +} + +int32_t mndInitArbGroup(SMnode *pMnode) { + SSdbTable table = { + .sdbType = SDB_ARBGROUP, + .keyType = SDB_KEY_INT32, + .encodeFp = (SdbEncodeFp)mndArbGroupActionEncode, + .decodeFp = (SdbDecodeFp)mndArbGroupActionDecode, + .insertFp = (SdbInsertFp)mndArbGroupActionInsert, + .updateFp = (SdbUpdateFp)mndArbGroupActionUpdate, + .deleteFp = (SdbDeleteFp)mndArbGroupActionDelete, + }; + + mndSetMsgHandle(pMnode, TDMT_MND_ARB_HEARTBEAT_TIMER, mndProcessArbHbTimer); + mndSetMsgHandle(pMnode, TDMT_MND_ARB_CHECK_SYNC_TIMER, mndProcessArbCheckSyncTimer); + mndSetMsgHandle(pMnode, TDMT_MND_ARB_UPDATE_GROUP, mndProcessArbUpdateGroupReq); + mndSetMsgHandle(pMnode, TDMT_VND_ARB_HEARTBEAT_RSP, mndProcessArbHbRsp); + mndSetMsgHandle(pMnode, TDMT_VND_ARB_CHECK_SYNC_RSP, mndProcessArbCheckSyncRsp); + mndSetMsgHandle(pMnode, TDMT_SYNC_SET_ASSIGNED_LEADER_RSP, mndProcessArbSetAssignedLeaderRsp); + + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ARBGROUP, mndRetrieveArbGroups); + mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_ARBGROUP, mndCancelGetNextArbGroup); + + return sdbSetTable(pMnode->pSdb, table); +} + +void mndCleanupArbGroup(SMnode *pMnode) {} + +SArbGroup *mndAcquireArbGroup(SMnode *pMnode, int32_t vgId) { + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &vgId); + if (pGroup == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { + terrno = TSDB_CODE_MND_ARBGROUP_NOT_EXIST; + } + return pGroup; +} + +void mndReleaseArbGroup(SMnode *pMnode, SArbGroup *pGroup) { + SSdb *pSdb = pMnode->pSdb; + sdbRelease(pSdb, pGroup); +} + +void mndArbGroupInitFromVgObj(SVgObj *pVgObj, SArbGroup *outGroup) { + ASSERT(pVgObj->replica == 2); + memset(outGroup, 0, sizeof(SArbGroup)); + outGroup->dbUid = pVgObj->dbUid; + outGroup->vgId = pVgObj->vgId; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &outGroup->members[i]; + pMember->info.dnodeId = pVgObj->vnodeGid[i].dnodeId; + } +} + +SSdbRaw *mndArbGroupActionEncode(SArbGroup *pGroup) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + + int32_t size = sizeof(SArbGroup) + ARBGROUP_RESERVE_SIZE; + SSdbRaw *pRaw = sdbAllocRaw(SDB_ARBGROUP, ARBGROUP_VER_NUMBER, size); + if (pRaw == NULL) goto _OVER; + + int32_t dataPos = 0; + SDB_SET_INT32(pRaw, dataPos, pGroup->vgId, _OVER) + SDB_SET_INT64(pRaw, dataPos, pGroup->dbUid, _OVER) + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + SDB_SET_INT32(pRaw, dataPos, pMember->info.dnodeId, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pMember->state.token, TSDB_ARB_TOKEN_SIZE, _OVER) + } + SDB_SET_INT8(pRaw, dataPos, pGroup->isSync, _OVER) + + SArbAssignedLeader *pLeader = &pGroup->assignedLeader; + SDB_SET_INT32(pRaw, dataPos, pLeader->dnodeId, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pLeader->token, TSDB_ARB_TOKEN_SIZE, _OVER) + SDB_SET_INT64(pRaw, dataPos, pGroup->version, _OVER) + + SDB_SET_RESERVE(pRaw, dataPos, ARBGROUP_RESERVE_SIZE, _OVER) + + terrno = 0; + +_OVER: + if (terrno != 0) { + mError("arbgroup:%d, failed to encode to raw:%p since %s", pGroup->vgId, pRaw, terrstr()); + sdbFreeRaw(pRaw); + return NULL; + } + + mTrace("arbgroup:%d, encode to raw:%p, row:%p", pGroup->vgId, pRaw, pGroup); + return pRaw; +} + +SSdbRow *mndArbGroupActionDecode(SSdbRaw *pRaw) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + SSdbRow *pRow = NULL; + SArbGroup *pGroup = NULL; + + int8_t sver = 0; + if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; + + if (sver != ARBGROUP_VER_NUMBER) { + terrno = TSDB_CODE_SDB_INVALID_DATA_VER; + goto _OVER; + } + + pRow = sdbAllocRow(sizeof(SArbGroup)); + if (pRow == NULL) goto _OVER; + + pGroup = sdbGetRowObj(pRow); + if (pGroup == NULL) goto _OVER; + + int32_t dataPos = 0; + SDB_GET_INT32(pRaw, dataPos, &pGroup->vgId, _OVER) + SDB_GET_INT64(pRaw, dataPos, &pGroup->dbUid, _OVER) + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + SDB_GET_INT32(pRaw, dataPos, &pMember->info.dnodeId, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pMember->state.token, TSDB_ARB_TOKEN_SIZE, _OVER) + + pMember->state.nextHbSeq = 0; + pMember->state.responsedHbSeq = -1; + pMember->state.lastHbMs = 0; + } + SDB_GET_INT8(pRaw, dataPos, &pGroup->isSync, _OVER) + + SArbAssignedLeader *pLeader = &pGroup->assignedLeader; + SDB_GET_INT32(pRaw, dataPos, &pLeader->dnodeId, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pLeader->token, TSDB_ARB_TOKEN_SIZE, _OVER) + SDB_GET_INT64(pRaw, dataPos, &pGroup->version, _OVER) + + pGroup->mutexInited = false; + + SDB_GET_RESERVE(pRaw, dataPos, ARBGROUP_RESERVE_SIZE, _OVER) + + terrno = 0; + +_OVER: + if (terrno != 0) { + mError("arbgroup:%d, failed to decode from raw:%p since %s", pGroup == NULL ? 0 : pGroup->vgId, pRaw, terrstr()); + taosMemoryFreeClear(pRow); + return NULL; + } + + mTrace("arbgroup:%d, decode from raw:%p, row:%p", pGroup->vgId, pRaw, pGroup); + return pRow; +} + +static int32_t mndArbGroupActionInsert(SSdb *pSdb, SArbGroup *pGroup) { + mTrace("arbgroup:%d, perform insert action, row:%p", pGroup->vgId, pGroup); + if (!pGroup->mutexInited && (taosThreadMutexInit(&pGroup->mutex, NULL) == 0)) { + pGroup->mutexInited = true; + } + + return pGroup->mutexInited ? 0 : -1; +} + +static int32_t mndArbGroupActionDelete(SSdb *pSdb, SArbGroup *pGroup) { + mTrace("arbgroup:%d, perform delete action, row:%p", pGroup->vgId, pGroup); + if (pGroup->mutexInited) { + taosThreadMutexDestroy(&pGroup->mutex); + pGroup->mutexInited = false; + } + return 0; +} + +static int32_t mndArbGroupActionUpdate(SSdb *pSdb, SArbGroup *pOld, SArbGroup *pNew) { + mTrace("arbgroup:%d, perform update action, old row:%p new row:%p", pOld->vgId, pOld, pNew); + taosThreadMutexLock(&pOld->mutex); + + if (pOld->version != pNew->version) { + mInfo("arbgroup:%d, skip to perform update action, old row:%p new row:%p, old version:%" PRId64 + " new version:%" PRId64, + pOld->vgId, pOld, pNew, pOld->version, pNew->version); + taosThreadMutexUnlock(&pOld->mutex); + return 0; + } + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + memcpy(pOld->members[i].state.token, pNew->members[i].state.token, TSDB_ARB_TOKEN_SIZE); + } + pOld->isSync = pNew->isSync; + pOld->assignedLeader.dnodeId = pNew->assignedLeader.dnodeId; + memcpy(pOld->assignedLeader.token, pNew->assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + pOld->version++; + taosThreadMutexUnlock(&pOld->mutex); + return 0; +} + +int32_t mndSetCreateArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pRedoRaw = mndArbGroupActionEncode(pGroup); + if (pRedoRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; + if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_CREATING) != 0) return -1; + return 0; +} + +int32_t mndSetCreateArbGroupUndoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pUndoRaw = mndArbGroupActionEncode(pGroup); + if (pUndoRaw == NULL) return -1; + if (mndTransAppendUndolog(pTrans, pUndoRaw) != 0) return -1; + if (sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED) != 0) return -1; + return 0; +} + +int32_t mndSetCreateArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pCommitRaw = mndArbGroupActionEncode(pGroup); + if (pCommitRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; + if (sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY) != 0) return -1; + return 0; +} + +static int32_t mndSetDropArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pRedoRaw = mndArbGroupActionEncode(pGroup); + if (pRedoRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; + if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_DROPPING) != 0) return -1; + return 0; +} + +int32_t mndSetDropArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pCommitRaw = mndArbGroupActionEncode(pGroup); + if (pCommitRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; + if (sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED) != 0) return -1; + return 0; +} + +static void *mndBuildArbHeartBeatReq(int32_t *pContLen, char *arbToken, int32_t dnodeId, int64_t arbTerm, + SArray *hbMembers) { + SVArbHeartBeatReq req = {0}; + req.dnodeId = dnodeId; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.hbMembers = hbMembers; + + int32_t contLen = tSerializeSVArbHeartBeatReq(NULL, 0, &req); + if (contLen <= 0) return NULL; + + void *pReq = rpcMallocCont(contLen); + if (pReq == NULL) return NULL; + + if (tSerializeSVArbHeartBeatReq(pReq, contLen, &req) <= 0) { + rpcFreeCont(pReq); + return NULL; + } + *pContLen = contLen; + return pReq; +} + +static int32_t mndSendArbHeartBeatReq(SDnodeObj *pDnode, char *arbToken, int64_t arbTerm, SArray *hbMembers) { + int32_t contLen = 0; + void *pHead = mndBuildArbHeartBeatReq(&contLen, arbToken, pDnode->id, arbTerm, hbMembers); + if (pHead == NULL) { + mError("dnodeId:%d, failed to build arb-hb request", pDnode->id); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_VND_ARB_HEARTBEAT, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetDnodeEpset(pDnode); + if (epSet.numOfEps == 0) { + mError("dnodeId:%d, failed to send arb-hb request to dnode since no epSet found", pDnode->id); + rpcFreeCont(pHead); + return -1; + } + + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("dnodeId:%d, failed to send arb-hb request to dnode since 0x%x", pDnode->id, code); + } else { + mTrace("dnodeId:%d, send arb-hb request to dnode", pDnode->id); + } + return code; +} + +static int32_t mndProcessArbHbTimer(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SArbGroup *pArbGroup = NULL; + void *pIter = NULL; + + SHashObj *pDnodeHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); + + // collect member of same dnode + while (1) { + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + taosThreadMutexLock(&pArbGroup->mutex); + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pArbGroup->members[i]; + int32_t dnodeId = pMember->info.dnodeId; + void *pObj = taosHashGet(pDnodeHash, &dnodeId, sizeof(int32_t)); + SArray *hbMembers = NULL; + if (pObj) { + hbMembers = *(SArray **)pObj; + } else { + hbMembers = taosArrayInit(16, sizeof(SVArbHbReqMember)); + taosHashPut(pDnodeHash, &dnodeId, sizeof(int32_t), &hbMembers, POINTER_BYTES); + } + SVArbHbReqMember reqMember = {.vgId = pArbGroup->vgId, .hbSeq = pMember->state.nextHbSeq++}; + taosArrayPush(hbMembers, &reqMember); + } + + taosThreadMutexUnlock(&pArbGroup->mutex); + sdbRelease(pSdb, pArbGroup); + } + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-hb timer"); + pIter = taosHashIterate(pDnodeHash, NULL); + while (pIter) { + SArray *hbMembers = *(SArray **)pIter; + taosArrayDestroy(hbMembers); + pIter = taosHashIterate(pDnodeHash, pIter); + } + taosHashCleanup(pDnodeHash); + return -1; + } + + int64_t nowMs = taosGetTimestampMs(); + + pIter = NULL; + while (1) { + pIter = taosHashIterate(pDnodeHash, pIter); + if (pIter == NULL) break; + + int32_t dnodeId = *(int32_t *)taosHashGetKey(pIter, NULL); + SArray *hbMembers = *(SArray **)pIter; + + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (pDnode == NULL) { + mError("dnodeId:%d, timer failed to send arb-hb request, failed find dnode", dnodeId); + taosArrayDestroy(hbMembers); + continue; + } + + int64_t mndTerm = mndGetTerm(pMnode); + + if (mndIsDnodeOnline(pDnode, nowMs)) { + (void)mndSendArbHeartBeatReq(pDnode, arbToken, mndTerm, hbMembers); + } + + mndReleaseDnode(pMnode, pDnode); + taosArrayDestroy(hbMembers); + } + taosHashCleanup(pDnodeHash); + + return 0; +} + +static void *mndBuildArbCheckSyncReq(int32_t *pContLen, int32_t vgId, char *arbToken, int64_t arbTerm, + char *member0Token, char *member1Token) { + SVArbCheckSyncReq req = {0}; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.member0Token = member0Token; + req.member1Token = member1Token; + + int32_t reqLen = tSerializeSVArbCheckSyncReq(NULL, 0, &req); + int32_t contLen = reqLen + sizeof(SMsgHead); + + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(vgId); + if (tSerializeSVArbCheckSyncReq((char *)pHead + sizeof(SMsgHead), contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndSendArbCheckSyncReq(SMnode *pMnode, int32_t vgId, char *arbToken, int64_t term, char *member0Token, + char *member1Token) { + int32_t contLen = 0; + void *pHead = mndBuildArbCheckSyncReq(&contLen, vgId, arbToken, term, member0Token, member1Token); + if (!pHead) { + mError("vgId:%d, failed to build check-sync request", vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_VND_ARB_CHECK_SYNC, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetVgroupEpsetById(pMnode, vgId); + if (epSet.numOfEps == 0) { + mError("vgId:%d, failed to send check-sync request since no epSet found", vgId); + rpcFreeCont(pHead); + return -1; + } + + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("vgId:%d, failed to send check-sync request since 0x%x", vgId, code); + } else { + mDebug("vgId:%d, send check-sync request", vgId); + } + return code; +} + +static bool mndCheckArbMemberHbTimeout(SArbGroup *pArbGroup, int32_t index, int64_t nowMs) { + SArbGroupMember *pArbMember = &pArbGroup->members[index]; + return pArbMember->state.lastHbMs < (nowMs - tsArbSetAssignedTimeoutSec * 1000); +} + +static void *mndBuildArbSetAssignedLeaderReq(int32_t *pContLen, int32_t vgId, char *arbToken, int64_t arbTerm, + char *memberToken) { + SVArbSetAssignedLeaderReq req = {0}; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.memberToken = memberToken; + + int32_t reqLen = tSerializeSVArbSetAssignedLeaderReq(NULL, 0, &req); + int32_t contLen = reqLen + sizeof(SMsgHead); + + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(vgId); + if (tSerializeSVArbSetAssignedLeaderReq((char *)pHead + sizeof(SMsgHead), contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndSendArbSetAssignedLeaderReq(SMnode *pMnode, int32_t dnodeId, int32_t vgId, char *arbToken, + int64_t term, char *memberToken) { + int32_t contLen = 0; + void *pHead = mndBuildArbSetAssignedLeaderReq(&contLen, vgId, arbToken, term, memberToken); + if (!pHead) { + mError("vgId:%d, failed to build set-assigned request", vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_SYNC_SET_ASSIGNED_LEADER, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetDnodeEpsetById(pMnode, dnodeId); + if (epSet.numOfEps == 0) { + mError("dnodeId:%d vgId:%d, failed to send arb-set-assigned request to dnode since no epSet found", dnodeId, vgId); + rpcFreeCont(pHead); + return -1; + } + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("dnodeId:%d vgId:%d, failed to send arb-set-assigned request to dnode since 0x%x", dnodeId, vgId, code); + } else { + mInfo("dnodeId:%d vgId:%d, send arb-set-assigned request to dnode", dnodeId, vgId); + } + return code; +} + +static int32_t mndProcessArbCheckSyncTimer(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SArbGroup *pArbGroup = NULL; + SArbGroup arbGroupDup = {0}; + void *pIter = NULL; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-check-sync timer"); + return -1; + } + int64_t term = mndGetTerm(pMnode); + if (term < 0) { + mError("arb failed to get term since %s", terrstr()); + return -1; + } + + while (1) { + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + taosThreadMutexLock(&pArbGroup->mutex); + mndArbGroupDupObj(pArbGroup, &arbGroupDup); + taosThreadMutexUnlock(&pArbGroup->mutex); + + int32_t vgId = arbGroupDup.vgId; + int64_t nowMs = taosGetTimestampMs(); + + bool member0IsTimeout = mndCheckArbMemberHbTimeout(&arbGroupDup, 0, nowMs); + bool member1IsTimeout = mndCheckArbMemberHbTimeout(&arbGroupDup, 1, nowMs); + SArbAssignedLeader* pAssignedLeader = &arbGroupDup.assignedLeader; + int32_t currentAssignedDnodeId = pAssignedLeader->dnodeId; + + // 1. has assigned && is sync => send req + if (currentAssignedDnodeId != 0 && arbGroupDup.isSync == true) { + (void)mndSendArbSetAssignedLeaderReq(pMnode, currentAssignedDnodeId, vgId, arbToken, term, + pAssignedLeader->token); + mInfo("vgId:%d, arb send set assigned leader to dnodeId:%d", vgId, currentAssignedDnodeId); + sdbRelease(pSdb, pArbGroup); + continue; + } + + // 2. both of the two members are timeout => skip + if (member0IsTimeout && member1IsTimeout) { + sdbRelease(pSdb, pArbGroup); + continue; + } + + // 3. no member is timeout => check sync + if (member0IsTimeout == false && member1IsTimeout == false) { + // no assigned leader and not sync + if (currentAssignedDnodeId == 0 && !arbGroupDup.isSync) { + (void)mndSendArbCheckSyncReq(pMnode, arbGroupDup.vgId, arbToken, term, arbGroupDup.members[0].state.token, + arbGroupDup.members[1].state.token); + } + sdbRelease(pSdb, pArbGroup); + continue; + } + + // 4. one of the members is timeout => set assigned leader + int32_t candidateIndex = member0IsTimeout ? 1 : 0; + SArbGroupMember *pMember = &arbGroupDup.members[candidateIndex]; + + // has assigned leader and dnodeId not match => skip + if (currentAssignedDnodeId != 0 && currentAssignedDnodeId != pMember->info.dnodeId) { + mInfo("arb skip to set assigned leader to vgId:%d dnodeId:%d, assigned leader has been set to dnodeId:%d", vgId, + pMember->info.dnodeId, currentAssignedDnodeId); + sdbRelease(pSdb, pArbGroup); + continue; + } + + // not sync => skip + if (arbGroupDup.isSync == false) { + if (currentAssignedDnodeId == pMember->info.dnodeId) { + mDebug("arb skip to set assigned leader to vgId:%d dnodeId:%d, arb group is not sync", vgId, + pMember->info.dnodeId); + } else { + mInfo("arb skip to set assigned leader to vgId:%d dnodeId:%d, arb group is not sync", vgId, + pMember->info.dnodeId); + } + sdbRelease(pSdb, pArbGroup); + continue; + } + + // is sync && no assigned leader => write to sdb + SArbGroup newGroup = {0}; + mndArbGroupDupObj(&arbGroupDup, &newGroup); + mndArbGroupSetAssignedLeader(&newGroup, candidateIndex); + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mError("vgId:%d, arb failed to pullup set assigned leader to dnodeId:%d, since %s", vgId, pMember->info.dnodeId, + terrstr()); + sdbRelease(pSdb, pArbGroup); + return -1; + } + + mInfo("vgId:%d, arb pull up set assigned leader to dnodeId:%d", vgId, pMember->info.dnodeId); + + sdbRelease(pSdb, pArbGroup); + } + + return 0; +} + +static void *mndBuildArbUpdateGroupReq(int32_t *pContLen, SArbGroup *pNewGroup) { + SMArbUpdateGroupReq req = {0}; + req.vgId = pNewGroup->vgId; + req.dbUid = pNewGroup->dbUid; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + req.members[i].dnodeId = pNewGroup->members[i].info.dnodeId; + req.members[i].token = pNewGroup->members[i].state.token; + } + req.isSync = pNewGroup->isSync; + req.assignedLeader.dnodeId = pNewGroup->assignedLeader.dnodeId; + req.assignedLeader.token = pNewGroup->assignedLeader.token; + req.version = pNewGroup->version; + + int32_t contLen = tSerializeSMArbUpdateGroupReq(NULL, 0, &req); + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + if (tSerializeSMArbUpdateGroupReq(pHead, contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndPullupArbUpdateGroup(SMnode *pMnode, SArbGroup *pNewGroup) { + int32_t contLen = 0; + void *pHead = mndBuildArbUpdateGroupReq(&contLen, pNewGroup); + if (!pHead) { + mError("vgId:%d, failed to build arb-update-group request", pNewGroup->vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_UPDATE_GROUP, .pCont = pHead, .contLen = contLen, .info.noResp = true}; + + return tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); +} + +static int32_t mndProcessArbUpdateGroupReq(SRpcMsg *pReq) { + int ret = 0; + + SMArbUpdateGroupReq req = {0}; + tDeserializeSMArbUpdateGroupReq(pReq->pCont, pReq->contLen, &req); + + SArbGroup newGroup = {0}; + newGroup.vgId = req.vgId; + newGroup.dbUid = req.dbUid; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + newGroup.members[i].info.dnodeId = req.members[i].dnodeId; + memcpy(newGroup.members[i].state.token, req.members[i].token, TSDB_ARB_TOKEN_SIZE); + } + + newGroup.isSync = req.isSync; + newGroup.assignedLeader.dnodeId = req.assignedLeader.dnodeId; + memcpy(newGroup.assignedLeader.token, req.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + newGroup.version = req.version; + + SMnode *pMnode = pReq->info.node; + if (mndArbGroupUpdateTrans(pMnode, &newGroup) != 0) { + mError("vgId:%d, arb failed to update arbgroup, since %s", req.vgId, terrstr()); + ret = -1; + } + + tFreeSMArbUpdateGroupReq(&req); + return ret; +} + +static void mndArbGroupDupObj(SArbGroup *pGroup, SArbGroup *pNew) { + memcpy(pNew, pGroup, offsetof(SArbGroup, mutexInited)); +} + +static void mndArbGroupSetAssignedLeader(SArbGroup *pGroup, int32_t index) { + SArbGroupMember *pMember = &pGroup->members[index]; + + pGroup->assignedLeader.dnodeId = pMember->info.dnodeId; + strncpy(pGroup->assignedLeader.token, pMember->state.token, TSDB_ARB_TOKEN_SIZE); +} + +static void mndArbGroupResetAssignedLeader(SArbGroup *pGroup) { + pGroup->assignedLeader.dnodeId = 0; + memset(pGroup->assignedLeader.token, 0, TSDB_ARB_TOKEN_SIZE); +} + +static int32_t mndArbGroupUpdateTrans(SMnode *pMnode, SArbGroup *pNew) { + int32_t ret = -1; + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_ARBGROUP, NULL, "update-arbgroup"); + if (pTrans == NULL) { + mError("failed to update arbgroup in create trans, vgId:%d, since %s", pNew->vgId, terrstr()); + goto _OVER; + } + + mInfo("trans:%d, used to update arbgroup:%d, member0:[%d][%s] member1:[%d][%s] isSync:%d assigned:[%d][%s]", + pTrans->id, pNew->vgId, pNew->members[0].info.dnodeId, pNew->members[0].state.token, + pNew->members[1].info.dnodeId, pNew->members[1].state.token, pNew->isSync, pNew->assignedLeader.dnodeId, + pNew->assignedLeader.token); + + mndTransSetArbGroupId(pTrans, pNew->vgId); + if (mndTransCheckConflict(pMnode, pTrans) != 0) { + ret = -1; + goto _OVER; + } + + if (mndSetCreateArbGroupCommitLogs(pTrans, pNew) != 0) { + mError("failed to update arbgroup in set commit log, vgId:%d, since %s", pNew->vgId, terrstr()); + goto _OVER; + } + + if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER; + + ret = 0; + +_OVER: + mndTransDrop(pTrans); + return ret; +} + +bool mndUpdateArbGroupByHeartBeat(SArbGroup *pGroup, SVArbHbRspMember *pRspMember, int64_t nowMs, int32_t dnodeId, + SArbGroup *pNewGroup) { + bool updateToken = false; + SArbGroupMember *pMember = NULL; + + taosThreadMutexLock(&pGroup->mutex); + + int index = 0; + for (; index < TSDB_ARB_GROUP_MEMBER_NUM; index++) { + pMember = &pGroup->members[index]; + if (pMember->info.dnodeId == dnodeId) { + break; + } + pMember = NULL; + } + + if (pMember == NULL) { + mInfo("dnodeId:%d vgId:%d, arb token update check failed, no obj found", dnodeId, pRspMember->vgId); + goto _OVER; + } + + if (pMember->state.responsedHbSeq >= pRspMember->hbSeq) { + // skip + mInfo("dnodeId:%d vgId:%d, skip arb token update, heart beat seq expired, local:%d msg:%d", dnodeId, + pRspMember->vgId, pMember->state.responsedHbSeq, pRspMember->hbSeq); + goto _OVER; + } + + // update hb state + pMember->state.responsedHbSeq = pRspMember->hbSeq; + pMember->state.lastHbMs = nowMs; + if (mndArbCheckToken(pMember->state.token, pRspMember->memberToken) == 0) { + // skip + mDebug("dnodeId:%d vgId:%d, skip arb token update, token matched", dnodeId, pRspMember->vgId); + goto _OVER; + } + + // update token + mndArbGroupDupObj(pGroup, pNewGroup); + memcpy(pNewGroup->members[index].state.token, pRspMember->memberToken, TSDB_ARB_TOKEN_SIZE); + pNewGroup->isSync = false; + + bool resetAssigned = false; + if (pMember->info.dnodeId == pGroup->assignedLeader.dnodeId) { + mndArbGroupResetAssignedLeader(pNewGroup); + resetAssigned = true; + } + + updateToken = true; + mInfo("dnodeId:%d vgId:%d, arb token updating, resetAssigned:%d", dnodeId, pRspMember->vgId, resetAssigned); + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateToken; +} + +static int32_t mndUpdateArbHeartBeat(SMnode *pMnode, int32_t dnodeId, SArray *memberArray) { + int ret = 0; + int64_t nowMs = taosGetTimestampMs(); + + size_t size = taosArrayGetSize(memberArray); + for (size_t i = 0; i < size; i++) { + SVArbHbRspMember *pRspMember = taosArrayGet(memberArray, i); + + SArbGroup newGroup = {0}; + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &pRspMember->vgId); + if (pGroup == NULL) { + mInfo("failed to update arb token, vgId:%d not found", pRspMember->vgId); + continue; + } + + bool updateToken = mndUpdateArbGroupByHeartBeat(pGroup, pRspMember, nowMs, dnodeId, &newGroup); + if (updateToken) { + ret = mndPullupArbUpdateGroup(pMnode, &newGroup); + if (ret != 0) { + mInfo("failed to pullup update arb token, vgId:%d, since %s", pRspMember->vgId, terrstr()); + } + } + + sdbRelease(pMnode->pSdb, pGroup); + if (ret != 0) break; + } + + return ret; +} + +bool mndUpdateArbGroupByCheckSync(SArbGroup *pGroup, int32_t vgId, char *member0Token, char *member1Token, + bool newIsSync, SArbGroup *pNewGroup) { + bool updateIsSync = false; + + taosThreadMutexLock(&pGroup->mutex); + + if (pGroup->assignedLeader.dnodeId != 0) { + terrno = TSDB_CODE_SUCCESS; + mInfo("skip to update arb sync, vgId:%d has assigned leader:%d", vgId, pGroup->assignedLeader.dnodeId); + goto _OVER; + } + + char *local0Token = pGroup->members[0].state.token; + char *local1Token = pGroup->members[1].state.token; + if (mndArbCheckToken(local0Token, member0Token) != 0 || mndArbCheckToken(local1Token, member1Token) != 0) { + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + mInfo("skip to update arb sync, memberToken mismatch local:[%s][%s], msg:[%s][%s]", local0Token, local1Token, + member0Token, member1Token); + goto _OVER; + } + + if (pGroup->isSync != newIsSync) { + mndArbGroupDupObj(pGroup, pNewGroup); + pNewGroup->isSync = newIsSync; + + mInfo("vgId:%d, arb isSync updating, new isSync:%d", vgId, newIsSync); + updateIsSync = true; + } + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateIsSync; +} + +static int32_t mndUpdateArbSync(SMnode *pMnode, int32_t vgId, char *member0Token, char *member1Token, bool newIsSync) { + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &vgId); + if (pGroup == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + mInfo("failed to update arb sync, vgId:%d not found", vgId); + return -1; + } + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(pGroup, vgId, member0Token, member1Token, newIsSync, &newGroup); + if (updateIsSync) { + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mInfo("failed to pullup update arb sync, vgId:%d, since %s", vgId, terrstr()); + } + } + + sdbRelease(pMnode->pSdb, pGroup); + return 0; +} + +static int32_t mndProcessArbHbRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-hb response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbHeartBeatRsp arbHbRsp = {0}; + if (tDeserializeSVArbHeartBeatRsp(pRsp->pCont, pRsp->contLen, &arbHbRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + if (mndArbCheckToken(arbToken, arbHbRsp.arbToken) != 0) { + mInfo("arb hearbeat skip update for dnodeId:%d, arb token mismatch, local:[%s] msg:[%s]", arbHbRsp.dnodeId, + arbToken, arbHbRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + (void)mndUpdateArbHeartBeat(pMnode, arbHbRsp.dnodeId, arbHbRsp.hbMembers); + ret = 0; + +_OVER: + tFreeSVArbHeartBeatRsp(&arbHbRsp); + return ret; +} + +static int32_t mndProcessArbCheckSyncRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-check-sync response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbCheckSyncRsp syncRsp = {0}; + if (tDeserializeSVArbCheckSyncRsp(pRsp->pCont, pRsp->contLen, &syncRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + mInfo("arb sync check failed, since:%s", tstrerror(pRsp->code)); + return -1; + } + + if (mndArbCheckToken(arbToken, syncRsp.arbToken) != 0) { + mInfo("skip update arb sync for vgId:%d, arb token mismatch, local:[%s] msg:[%s]", syncRsp.vgId, arbToken, + syncRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + bool newIsSync = (syncRsp.errCode == TSDB_CODE_SUCCESS); + if (mndUpdateArbSync(pMnode, syncRsp.vgId, syncRsp.member0Token, syncRsp.member1Token, newIsSync) != 0) { + mInfo("failed to update arb sync for vgId:%d, since:%s", syncRsp.vgId, terrstr()); + goto _OVER; + } + + ret = 0; + +_OVER: + tFreeSVArbCheckSyncRsp(&syncRsp); + return ret; +} + +bool mndUpdateArbGroupBySetAssignedLeader(SArbGroup *pGroup, int32_t vgId, char *memberToken, int32_t errcode, + SArbGroup *pNewGroup) { + bool updateAssigned = false; + + taosThreadMutexLock(&pGroup->mutex); + if (mndArbCheckToken(pGroup->assignedLeader.token, memberToken) != 0) { + mInfo("skip update arb assigned for vgId:%d, member token mismatch, local:[%s] msg:[%s]", vgId, + pGroup->assignedLeader.token, memberToken); + goto _OVER; + } + + if (errcode != TSDB_CODE_SUCCESS) { + mInfo("skip update arb assigned for vgId:%d, since:%s", vgId, tstrerror(errcode)); + goto _OVER; + } + + if (pGroup->isSync) { + mndArbGroupDupObj(pGroup, pNewGroup); + pNewGroup->isSync = false; + + mInfo("vgId:%d, arb isSync is setting to false", vgId); + updateAssigned = true; + goto _OVER; + } + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateAssigned; +} + +static int32_t mndProcessArbSetAssignedLeaderRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-set-assigned response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbSetAssignedLeaderRsp setAssignedRsp = {0}; + if (tDeserializeSVArbSetAssignedLeaderRsp(pRsp->pCont, pRsp->contLen, &setAssignedRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + mInfo("arb set assigned failed, des failed since:%s", tstrerror(pRsp->code)); + return -1; + } + + if (mndArbCheckToken(arbToken, setAssignedRsp.arbToken) != 0) { + mInfo("skip update arb assigned for vgId:%d, arb token mismatch, local:[%s] msg:[%s]", setAssignedRsp.vgId, + arbToken, setAssignedRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + SArbGroup *pGroup = mndAcquireArbGroup(pMnode, setAssignedRsp.vgId); + if (!pGroup) { + mError("failed to set arb assigned for vgId:%d, since:%s", setAssignedRsp.vgId, terrstr()); + goto _OVER; + } + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(pGroup, setAssignedRsp.vgId, setAssignedRsp.memberToken, + pRsp->code, &newGroup); + if (updateAssigned) { + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mInfo("failed to pullup update arb assigned for vgId:%d, since:%s", setAssignedRsp.vgId, terrstr()); + goto _OVER; + } + } + + ret = 0; + +_OVER: + tFreeSVArbSetAssignedLeaderRsp(&setAssignedRsp); + return ret; +} + +static int32_t mndRetrieveArbGroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + int32_t cols = 0; + SArbGroup *pGroup = NULL; + + while (numOfRows < rows) { + pShow->pIter = sdbFetch(pSdb, SDB_ARBGROUP, pShow->pIter, (void **)&pGroup); + if (pShow->pIter == NULL) break; + + taosThreadMutexLock(&pGroup->mutex); + + cols = 0; + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + SVgObj *pVgObj = sdbAcquire(pSdb, SDB_VGROUP, &pGroup->vgId); + if (!pVgObj) { + taosThreadMutexUnlock(&pGroup->mutex); + sdbRelease(pSdb, pGroup); + continue; + } + char dbname[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(dbname, mndGetDbStr(pVgObj->dbName), TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE); + colDataSetVal(pColInfo, numOfRows, (const char *)dbname, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->vgId, false); + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pMember->info.dnodeId, false); + } + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->isSync, false); + + if (pGroup->assignedLeader.dnodeId != 0) { + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->assignedLeader.dnodeId, false); + + char token[TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(token, pGroup->assignedLeader.token, TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)token, false); + } else { + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetNULL(pColInfo, numOfRows); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetNULL(pColInfo, numOfRows); + } + + taosThreadMutexUnlock(&pGroup->mutex); + + numOfRows++; + sdbRelease(pSdb, pVgObj); + sdbRelease(pSdb, pGroup); + } + + pShow->numOfRows += numOfRows; + + return numOfRows; +} + +static void mndCancelGetNextArbGroup(SMnode *pMnode, void *pIter) { + SSdb *pSdb = pMnode->pSdb; + sdbCancelFetch(pSdb, pIter); +} + +int32_t mndGetArbGroupSize(SMnode *pMnode) { + SSdb *pSdb = pMnode->pSdb; + return sdbGetSize(pSdb, SDB_ARBGROUP); +} diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 37c2d19bd4..a1f3a24661 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -15,6 +15,8 @@ #define _DEFAULT_SOURCE #include "mndDb.h" +#include "audit.h" +#include "mndArbGroup.h" #include "mndCluster.h" #include "mndDnode.h" #include "mndIndex.h" @@ -30,12 +32,11 @@ #include "mndVgroup.h" #include "mndView.h" #include "systable.h" -#include "tjson.h" #include "thttp.h" -#include "audit.h" +#include "tjson.h" #define DB_VER_NUMBER 1 -#define DB_RESERVE_SIZE 42 +#define DB_RESERVE_SIZE 41 static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw); static int32_t mndDbActionInsert(SSdb *pSdb, SDbObj *pDb); @@ -43,14 +44,14 @@ static int32_t mndDbActionDelete(SSdb *pSdb, SDbObj *pDb); static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew); static int32_t mndNewDbActionValidate(SMnode *pMnode, STrans *pTrans, SSdbRaw *pRaw); -static int32_t mndProcessCreateDbReq(SRpcMsg *pReq); -static int32_t mndProcessAlterDbReq(SRpcMsg *pReq); -static int32_t mndProcessDropDbReq(SRpcMsg *pReq); -static int32_t mndProcessUseDbReq(SRpcMsg *pReq); -static int32_t mndProcessTrimDbReq(SRpcMsg *pReq); -static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity); -static void mndCancelGetNextDb(SMnode *pMnode, void *pIter); -static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq); +static int32_t mndProcessCreateDbReq(SRpcMsg *pReq); +static int32_t mndProcessAlterDbReq(SRpcMsg *pReq); +static int32_t mndProcessDropDbReq(SRpcMsg *pReq); +static int32_t mndProcessUseDbReq(SRpcMsg *pReq); +static int32_t mndProcessTrimDbReq(SRpcMsg *pReq); +static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity); +static void mndCancelGetNextDb(SMnode *pMnode, void *pIter); +static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq); #ifndef TD_ENTERPRISE int32_t mndProcessCompactDbReq(SRpcMsg *pReq) { return TSDB_CODE_OPS_NOT_SUPPORT; } @@ -139,6 +140,7 @@ SSdbRaw *mndDbActionEncode(SDbObj *pDb) { SDB_SET_INT32(pRaw, dataPos, pDb->cfg.tsdbPageSize, _OVER) SDB_SET_INT64(pRaw, dataPos, pDb->compactStartTime, _OVER) SDB_SET_INT32(pRaw, dataPos, pDb->cfg.keepTimeOffset, _OVER) + SDB_SET_INT8(pRaw, dataPos, pDb->cfg.withArbitrator, _OVER) SDB_SET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER) @@ -230,6 +232,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) { SDB_GET_INT32(pRaw, dataPos, &pDb->cfg.tsdbPageSize, _OVER) SDB_GET_INT64(pRaw, dataPos, &pDb->compactStartTime, _OVER) SDB_GET_INT32(pRaw, dataPos, &pDb->cfg.keepTimeOffset, _OVER) + SDB_GET_INT8(pRaw, dataPos, &pDb->cfg.withArbitrator, _OVER) SDB_GET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) taosInitRWLatch(&pDb->lock); @@ -319,6 +322,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) { pOld->cfg.minRows = pNew->cfg.minRows; pOld->cfg.maxRows = pNew->cfg.maxRows; pOld->cfg.tsdbPageSize = pNew->cfg.tsdbPageSize; + pOld->cfg.withArbitrator = pNew->cfg.withArbitrator; pOld->compactStartTime = pNew->compactStartTime; taosWUnLockLatch(&pOld->lock); return 0; @@ -393,7 +397,11 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) { if (pCfg->precision < TSDB_MIN_PRECISION && pCfg->precision > TSDB_MAX_PRECISION) return -1; if (pCfg->compression < TSDB_MIN_COMP_LEVEL || pCfg->compression > TSDB_MAX_COMP_LEVEL) return -1; if (pCfg->replications < TSDB_MIN_DB_REPLICA || pCfg->replications > TSDB_MAX_DB_REPLICA) return -1; +#ifdef TD_ENTERPRISE + if ((pCfg->replications == 2) ^ (pCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) return -1; +#else if (pCfg->replications != 1 && pCfg->replications != 3) return -1; +#endif if (pCfg->strict < TSDB_DB_STRICT_OFF || pCfg->strict > TSDB_DB_STRICT_ON) return -1; if (pCfg->schemaless < TSDB_DB_SCHEMALESS_OFF || pCfg->schemaless > TSDB_DB_SCHEMALESS_ON) return -1; if (pCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; @@ -418,33 +426,48 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) { return terrno; } -static int32_t mndCheckInChangeDbCfg(SMnode *pMnode, SDbCfg *pCfg) { +static int32_t mndCheckInChangeDbCfg(SMnode *pMnode, SDbCfg *pOldCfg, SDbCfg *pNewCfg) { terrno = TSDB_CODE_MND_INVALID_DB_OPTION; - if (pCfg->buffer < TSDB_MIN_BUFFER_PER_VNODE || pCfg->buffer > TSDB_MAX_BUFFER_PER_VNODE) return -1; - if (pCfg->pages < TSDB_MIN_PAGES_PER_VNODE || pCfg->pages > TSDB_MAX_PAGES_PER_VNODE) return -1; - if (pCfg->pageSize < TSDB_MIN_PAGESIZE_PER_VNODE || pCfg->pageSize > TSDB_MAX_PAGESIZE_PER_VNODE) return -1; - if (pCfg->daysPerFile < TSDB_MIN_DAYS_PER_FILE || pCfg->daysPerFile > TSDB_MAX_DAYS_PER_FILE) return -1; - if (pCfg->daysToKeep0 < TSDB_MIN_KEEP || pCfg->daysToKeep0 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep1 < TSDB_MIN_KEEP || pCfg->daysToKeep1 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep2 < TSDB_MIN_KEEP || pCfg->daysToKeep2 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep0 < pCfg->daysPerFile) return -1; - if (pCfg->daysToKeep0 > pCfg->daysToKeep1) return -1; - if (pCfg->daysToKeep1 > pCfg->daysToKeep2) return -1; - if (pCfg->keepTimeOffset < TSDB_MIN_KEEP_TIME_OFFSET || pCfg->keepTimeOffset > TSDB_MAX_KEEP_TIME_OFFSET) return -1; - if (pCfg->walFsyncPeriod < TSDB_MIN_FSYNC_PERIOD || pCfg->walFsyncPeriod > TSDB_MAX_FSYNC_PERIOD) return -1; - if (pCfg->walLevel < TSDB_MIN_WAL_LEVEL || pCfg->walLevel > TSDB_MAX_WAL_LEVEL) return -1; - if (pCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; - if (pCfg->cacheLastSize < TSDB_MIN_DB_CACHE_SIZE || pCfg->cacheLastSize > TSDB_MAX_DB_CACHE_SIZE) return -1; - if (pCfg->replications < TSDB_MIN_DB_REPLICA || pCfg->replications > TSDB_MAX_DB_REPLICA) return -1; - if (pCfg->replications != 1 && pCfg->replications != 3) return -1; - if (pCfg->sstTrigger < TSDB_MIN_STT_TRIGGER || pCfg->sstTrigger > TSDB_MAX_STT_TRIGGER) return -1; - if (pCfg->minRows < TSDB_MIN_MINROWS_FBLOCK || pCfg->minRows > TSDB_MAX_MINROWS_FBLOCK) return -1; - if (pCfg->maxRows < TSDB_MIN_MAXROWS_FBLOCK || pCfg->maxRows > TSDB_MAX_MAXROWS_FBLOCK) return -1; - if (pCfg->minRows > pCfg->maxRows) return -1; - if (pCfg->walRetentionPeriod < TSDB_DB_MIN_WAL_RETENTION_PERIOD) return -1; - if (pCfg->walRetentionSize < TSDB_DB_MIN_WAL_RETENTION_SIZE) return -1; - if (pCfg->strict < TSDB_DB_STRICT_OFF || pCfg->strict > TSDB_DB_STRICT_ON) return -1; - if (pCfg->replications > mndGetDnodeSize(pMnode)) { + if (pNewCfg->buffer < TSDB_MIN_BUFFER_PER_VNODE || pNewCfg->buffer > TSDB_MAX_BUFFER_PER_VNODE) return -1; + if (pNewCfg->pages < TSDB_MIN_PAGES_PER_VNODE || pNewCfg->pages > TSDB_MAX_PAGES_PER_VNODE) return -1; + if (pNewCfg->pageSize < TSDB_MIN_PAGESIZE_PER_VNODE || pNewCfg->pageSize > TSDB_MAX_PAGESIZE_PER_VNODE) return -1; + if (pNewCfg->daysPerFile < TSDB_MIN_DAYS_PER_FILE || pNewCfg->daysPerFile > TSDB_MAX_DAYS_PER_FILE) return -1; + if (pNewCfg->daysToKeep0 < TSDB_MIN_KEEP || pNewCfg->daysToKeep0 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep1 < TSDB_MIN_KEEP || pNewCfg->daysToKeep1 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep2 < TSDB_MIN_KEEP || pNewCfg->daysToKeep2 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep0 < pNewCfg->daysPerFile) return -1; + if (pNewCfg->daysToKeep0 > pNewCfg->daysToKeep1) return -1; + if (pNewCfg->daysToKeep1 > pNewCfg->daysToKeep2) return -1; + if (pNewCfg->keepTimeOffset < TSDB_MIN_KEEP_TIME_OFFSET || pNewCfg->keepTimeOffset > TSDB_MAX_KEEP_TIME_OFFSET) + return -1; + if (pNewCfg->walFsyncPeriod < TSDB_MIN_FSYNC_PERIOD || pNewCfg->walFsyncPeriod > TSDB_MAX_FSYNC_PERIOD) return -1; + if (pNewCfg->walLevel < TSDB_MIN_WAL_LEVEL || pNewCfg->walLevel > TSDB_MAX_WAL_LEVEL) return -1; + if (pNewCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pNewCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; + if (pNewCfg->cacheLastSize < TSDB_MIN_DB_CACHE_SIZE || pNewCfg->cacheLastSize > TSDB_MAX_DB_CACHE_SIZE) return -1; + if (pNewCfg->replications < TSDB_MIN_DB_REPLICA || pNewCfg->replications > TSDB_MAX_DB_REPLICA) return -1; +#ifdef TD_ENTERPRISE + if ((pNewCfg->replications == 2) ^ (pNewCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) return -1; + if (pNewCfg->replications == 2 && pNewCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR) { + if (pOldCfg->replications != 1 && pOldCfg->replications != 2) { + terrno = TSDB_CODE_OPS_NOT_SUPPORT; + return -1; + } + } + if (pNewCfg->replications != 2 && pOldCfg->replications == 2) { + terrno = TSDB_CODE_OPS_NOT_SUPPORT; + return -1; + } +#else + if (pNewCfg->replications != 1 && pNewCfg->replications != 3) return -1; +#endif + if (pNewCfg->sstTrigger < TSDB_MIN_STT_TRIGGER || pNewCfg->sstTrigger > TSDB_MAX_STT_TRIGGER) return -1; + if (pNewCfg->minRows < TSDB_MIN_MINROWS_FBLOCK || pNewCfg->minRows > TSDB_MAX_MINROWS_FBLOCK) return -1; + if (pNewCfg->maxRows < TSDB_MIN_MAXROWS_FBLOCK || pNewCfg->maxRows > TSDB_MAX_MAXROWS_FBLOCK) return -1; + if (pNewCfg->minRows > pNewCfg->maxRows) return -1; + if (pNewCfg->walRetentionPeriod < TSDB_DB_MIN_WAL_RETENTION_PERIOD) return -1; + if (pNewCfg->walRetentionSize < TSDB_DB_MIN_WAL_RETENTION_SIZE) return -1; + if (pNewCfg->strict < TSDB_DB_STRICT_OFF || pNewCfg->strict > TSDB_DB_STRICT_ON) return -1; + if (pNewCfg->replications > mndGetDnodeSize(pMnode)) { terrno = TSDB_CODE_MND_NO_ENOUGH_DNODES; return -1; } @@ -484,6 +507,7 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) { if (pCfg->walSegmentSize < 0) pCfg->walSegmentSize = TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE; if (pCfg->sstTrigger <= 0) pCfg->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; if (pCfg->tsdbPageSize <= 0) pCfg->tsdbPageSize = TSDB_DEFAULT_TSDB_PAGESIZE; + if (pCfg->withArbitrator < 0) pCfg->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; } static int32_t mndSetCreateDbPrepareAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) { @@ -515,6 +539,15 @@ static int32_t mndSetCreateDbRedoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD if (sdbSetRawStatus(pVgRaw, SDB_STATUS_UPDATE) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupRedoLogs(pTrans, &arbGroup) != 0) return -1; + } + } + return 0; } @@ -531,6 +564,15 @@ static int32_t mndSetCreateDbUndoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD if (sdbSetRawStatus(pVgRaw, SDB_STATUS_DROPPED) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupUndoLogs(pTrans, &arbGroup) != 0) return -1; + } + } + return 0; } @@ -548,6 +590,15 @@ static int32_t mndSetCreateDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj * if (sdbSetRawStatus(pVgRaw, SDB_STATUS_READY) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } + } + if (pUserDuped) { SSdbRaw *pUserRaw = mndUserActionEncode(pUserDuped); if (pUserRaw == NULL) return -1; @@ -629,6 +680,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate, .hashPrefix = pCreate->hashPrefix, .hashSuffix = pCreate->hashSuffix, .tsdbPageSize = pCreate->tsdbPageSize, + .withArbitrator = pCreate->withArbitrator, }; dbObj.cfg.numOfRetensions = pCreate->numOfRetensions; @@ -698,17 +750,17 @@ _OVER: return code; } -static void mndBuildAuditDetailInt32(char* detail, char* tmp, char* format, int32_t para){ - if(para > 0){ - if(strlen(detail) > 0) strcat(detail, ", "); +static void mndBuildAuditDetailInt32(char *detail, char *tmp, char *format, int32_t para) { + if (para > 0) { + if (strlen(detail) > 0) strcat(detail, ", "); sprintf(tmp, format, para); strcat(detail, tmp); } } -static void mndBuildAuditDetailInt64(char* detail, char* tmp, char* format, int64_t para){ - if(para > 0){ - if(strlen(detail) > 0) strcat(detail, ", "); +static void mndBuildAuditDetailInt64(char *detail, char *tmp, char *format, int64_t para) { + if (para > 0) { + if (strlen(detail) > 0) strcat(detail, ", "); sprintf(tmp, format, para); strcat(detail, tmp); } @@ -893,6 +945,12 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) { terrno = 0; } + if (pAlter->withArbitrator >= TSDB_MIN_DB_WITH_ARBITRATOR && pAlter->withArbitrator != pDb->cfg.withArbitrator) { + pDb->cfg.withArbitrator = pAlter->withArbitrator; + pDb->vgVersion++; + terrno = 0; + } + return terrno; } @@ -931,12 +989,24 @@ static int32_t mndSetAlterDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj * if (pIter == NULL) break; if (mndVgroupInDb(pVgroup, pNewDb->uid)) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pOldDb, pNewDb, pVgroup, pArray) != 0) { + SVgObj newVgroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pOldDb, pNewDb, pVgroup, pArray, &newVgroup) != 0) { sdbCancelFetch(pSdb, pIter); sdbRelease(pSdb, pVgroup); taosArrayDestroy(pArray); return -1; } + if (pNewDb->cfg.withArbitrator != pOldDb->cfg.withArbitrator) { + if (pNewDb->cfg.withArbitrator) { + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(&newVgroup, &arbGroup); + if (mndSetCreateArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } else { + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgroup, &arbGroup); + if (mndSetDropArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } + } } sdbRelease(pSdb, pVgroup); @@ -1013,7 +1083,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { goto _OVER; } - code = mndCheckInChangeDbCfg(pMnode, &dbObj.cfg); + code = mndCheckInChangeDbCfg(pMnode, &pDb->cfg, &dbObj.cfg); if (code != 0) goto _OVER; dbObj.cfgVersion++; @@ -1081,6 +1151,7 @@ static void mndDumpDbCfgInfo(SDbCfgRsp *cfgRsp, SDbObj *pDb) { cfgRsp->pRetensions = taosArrayDup(pDb->cfg.pRetensions, NULL); cfgRsp->schemaless = pDb->cfg.schemaless; cfgRsp->sstTrigger = pDb->cfg.sstTrigger; + cfgRsp->withArbitrator = pDb->cfg.withArbitrator; } static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) { @@ -1150,6 +1221,22 @@ static int32_t mndSetDropDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD SSdb *pSdb = pMnode->pSdb; void *pIter = NULL; + while (1) { + SArbGroup *pArbGroup = NULL; + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + if (pArbGroup->dbUid == pDb->uid) { + if (mndSetDropArbGroupCommitLogs(pTrans,pArbGroup) != 0) { + sdbCancelFetch(pSdb, pIter); + sdbRelease(pSdb, pArbGroup); + return -1; + } + } + + sdbRelease(pSdb, pArbGroup); + } + while (1) { SVgObj *pVgroup = NULL; pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); @@ -1277,7 +1364,7 @@ static int32_t mndDropDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb) { if (mndDropStreamByDb(pMnode, pTrans, pDb) != 0) goto _OVER; #ifdef TD_ENTERPRISE if (mndDropViewByDb(pMnode, pTrans, pDb) != 0) goto _OVER; -#endif +#endif if (mndDropSmasByDb(pMnode, pTrans, pDb) != 0) goto _OVER; if (mndDropIdxsByDb(pMnode, pTrans, pDb) != 0) goto _OVER; if (mndSetDropDbRedoActions(pMnode, pTrans, pDb) != 0) goto _OVER; @@ -1390,7 +1477,7 @@ static void mndBuildDBVgroupInfo(SDbObj *pDb, SMnode *pMnode, SArray *pVgList) { pEp->port = pDnode->port; } mndReleaseDnode(pMnode, pDnode); - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { vgInfo.epSet.inUse = gid; } } @@ -1562,21 +1649,19 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs, int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pDbCacheInfo->vgVersion >= pDb->vgVersion && - pDbCacheInfo->cfgVersion >= pDb->cfgVersion && - numOfTable == pDbCacheInfo->numOfTable && - pDbCacheInfo->stateTs == pDb->stateTs) { + if (pDbCacheInfo->vgVersion >= pDb->vgVersion && pDbCacheInfo->cfgVersion >= pDb->cfgVersion && + numOfTable == pDbCacheInfo->numOfTable && pDbCacheInfo->stateTs == pDb->stateTs) { mTrace("db:%s, valid dbinfo, vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d, not changed vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d", - pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, pDbCacheInfo->numOfTable, - pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); + pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, + pDbCacheInfo->numOfTable, pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); mndReleaseDb(pMnode, pDb); continue; } else { mInfo("db:%s, valid dbinfo, vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d, changed to vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d", - pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, pDbCacheInfo->numOfTable, - pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); + pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, + pDbCacheInfo->numOfTable, pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); } if (pDbCacheInfo->cfgVersion < pDb->cfgVersion) { @@ -1584,8 +1669,7 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs, mndDumpDbCfgInfo(rsp.cfgRsp, pDb); } - if (pDbCacheInfo->vgVersion < pDb->vgVersion || - numOfTable != pDbCacheInfo->numOfTable || + if (pDbCacheInfo->vgVersion < pDb->vgVersion || numOfTable != pDbCacheInfo->numOfTable || pDbCacheInfo->stateTs != pDb->stateTs) { rsp.useDbRsp = taosMemoryCalloc(1, sizeof(SUseDbRsp)); rsp.useDbRsp->pVgroupInfos = taosArrayInit(pDb->cfg.numOfVgroups, sizeof(SVgroupInfo)); @@ -1801,7 +1885,8 @@ bool mndIsDbReady(SMnode *pMnode, SDbObj *pDb) { if (pVgroup->dbUid == pDb->uid && pVgroup->replica > 1) { bool hasLeader = false; for (int32_t i = 0; i < pVgroup->replica; ++i) { - if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER || + pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { hasLeader = true; } } @@ -1991,6 +2076,9 @@ static void mndDumpDbInfoData(SMnode *pMnode, SSDataBlock *pBlock, SDbObj *pDb, pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, rows, (const char *)&pDb->cfg.keepTimeOffset, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, rows, (const char *)&pDb->cfg.withArbitrator, false); } taosMemoryFree(buf); diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index befb6d3521..57c947eb81 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -33,7 +33,7 @@ #include "taos_monitor.h" #define TSDB_DNODE_VER_NUMBER 2 -#define TSDB_DNODE_RESERVE_SIZE 64 +#define TSDB_DNODE_RESERVE_SIZE 40 static const char *offlineReason[] = { "", @@ -183,11 +183,10 @@ static SSdbRaw *mndDnodeActionEncode(SDnodeObj *pDnode) { SDB_SET_INT64(pRaw, dataPos, pDnode->updateTime, _OVER) SDB_SET_INT16(pRaw, dataPos, pDnode->port, _OVER) SDB_SET_BINARY(pRaw, dataPos, pDnode->fqdn, TSDB_FQDN_LEN, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pDnode->machineId, TSDB_MACHINE_ID_LEN, _OVER) SDB_SET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) - SDB_SET_INT16(pRaw, dataPos, TSDB_ACTIVE_KEY_LEN, _OVER) - SDB_SET_BINARY(pRaw, dataPos, pDnode->active, TSDB_ACTIVE_KEY_LEN, _OVER) - SDB_SET_INT16(pRaw, dataPos, TSDB_CONN_ACTIVE_KEY_LEN, _OVER) - SDB_SET_BINARY(pRaw, dataPos, pDnode->connActive, TSDB_CONN_ACTIVE_KEY_LEN, _OVER) + SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible + SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible SDB_SET_DATALEN(pRaw, dataPos, _OVER); terrno = 0; @@ -227,13 +226,14 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) { SDB_GET_INT64(pRaw, dataPos, &pDnode->updateTime, _OVER) SDB_GET_INT16(pRaw, dataPos, &pDnode->port, _OVER) SDB_GET_BINARY(pRaw, dataPos, pDnode->fqdn, TSDB_FQDN_LEN, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pDnode->machineId, TSDB_MACHINE_ID_LEN, _OVER) SDB_GET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) if (sver > 1) { int16_t keyLen = 0; SDB_GET_INT16(pRaw, dataPos, &keyLen, _OVER) - SDB_GET_BINARY(pRaw, dataPos, pDnode->active, keyLen, _OVER) + SDB_GET_BINARY(pRaw, dataPos, NULL, keyLen, _OVER) SDB_GET_INT16(pRaw, dataPos, &keyLen, _OVER) - SDB_GET_BINARY(pRaw, dataPos, pDnode->connActive, keyLen, _OVER) + SDB_GET_BINARY(pRaw, dataPos, NULL, keyLen, _OVER) } terrno = 0; @@ -271,12 +271,7 @@ static int32_t mndDnodeActionUpdate(SSdb *pSdb, SDnodeObj *pOld, SDnodeObj *pNew mTrace("dnode:%d, perform update action, old row:%p new row:%p", pOld->id, pOld, pNew); pOld->updateTime = pNew->updateTime; #ifdef TD_ENTERPRISE - if (strncmp(pOld->active, pNew->active, TSDB_ACTIVE_KEY_LEN) != 0) { - strncpy(pOld->active, pNew->active, TSDB_ACTIVE_KEY_LEN); - } - if (strncmp(pOld->connActive, pNew->connActive, TSDB_CONN_ACTIVE_KEY_LEN) != 0) { - strncpy(pOld->connActive, pNew->connActive, TSDB_CONN_ACTIVE_KEY_LEN); - } + tstrncpy(pOld->machineId, pNew->machineId, TSDB_MACHINE_ID_LEN + 1); #endif return 0; } @@ -311,6 +306,17 @@ SEpSet mndGetDnodeEpset(SDnodeObj *pDnode) { return epSet; } +SEpSet mndGetDnodeEpsetById(SMnode *pMnode, int32_t dnodeId) { + SEpSet epSet = {0}; + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (!pDnode) return epSet; + + epSet = mndGetDnodeEpset(pDnode); + + mndReleaseDnode(pMnode, pDnode); + return epSet; +} + static SDnodeObj *mndAcquireDnodeByEp(SMnode *pMnode, char *pEpStr) { SSdb *pSdb = pMnode->pSdb; @@ -705,6 +711,35 @@ _OVER: */ } +static int32_t mndUpdateDnodeObj(SMnode *pMnode, SDnodeObj *pDnode) { + int32_t code = 0; + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, NULL, "update-dnode-obj"); + if (pTrans == NULL) { + code = terrno; + goto _exit; + } + + pDnode->updateTime = taosGetTimestampMs(); + + SSdbRaw *pCommitRaw = mndDnodeActionEncode(pDnode); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + code = terrno; + goto _exit; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); + + if (mndTransPrepare(pMnode, pTrans) != 0) { + mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); + code = terrno; + goto _exit; + } + +_exit: + mndTransDrop(pTrans); + return code; +} + static int32_t mndProcessStatusReq(SRpcMsg *pReq) { SMnode *pMnode = pReq->info.node; SStatusReq statusReq = {0}; @@ -776,7 +811,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVload->vgId); if (pVgroup != NULL) { - if (pVload->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVload->syncState == TAOS_SYNC_STATE_LEADER || pVload->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { pVgroup->cacheUsage = pVload->cacheUsage; pVgroup->numOfCachedTables = pVload->numOfCachedTables; pVgroup->numOfTables = pVload->numOfTables; @@ -874,8 +909,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pDnode->numOfDiskCfg = statusReq.numOfDiskCfg; pDnode->memAvail = statusReq.memAvail; pDnode->memTotal = statusReq.memTotal; - if (pDnode->machineId[0] == 0 && statusReq.machineId[0] != 0) { + if (memcmp(pDnode->machineId, statusReq.machineId, TSDB_MACHINE_ID_LEN) != 0) { tstrncpy(pDnode->machineId, statusReq.machineId, TSDB_MACHINE_ID_LEN + 1); + mndUpdateDnodeObj(pMnode, pDnode); } SStatusRsp statusRsp = {0}; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 69a0bd477d..ee7cd83a8c 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "mndAcct.h" +#include "mndArbGroup.h" #include "mndCluster.h" #include "mndCompact.h" #include "mndCompactDetail.h" @@ -140,6 +141,22 @@ static void mndPullupTrimDb(SMnode *pMnode) { tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } +static int32_t mndPullupArbHeartbeat(SMnode *pMnode) { + mTrace("pullup arb hb"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_HEARTBEAT_TIMER, .pCont = pReq, .contLen = contLen, .info.noResp = 1}; + return tmsgPutToQueue(&pMnode->msgCb, ARB_QUEUE, &rpcMsg); +} + +static int32_t mndPullupArbCheckSync(SMnode *pMnode) { + mTrace("pullup arb sync"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_CHECK_SYNC_TIMER, .pCont = pReq, .contLen = contLen, .info.noResp = 1}; + return tmsgPutToQueue(&pMnode->msgCb, ARB_QUEUE, &rpcMsg); +} + static void mndCalMqRebalance(SMnode *pMnode) { int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); @@ -391,6 +408,18 @@ static void *mndThreadFp(void *param) { continue; } mndDoTimerPullupTask(pMnode, sec); + + if (sec % (tsArbHeartBeatIntervalSec) == 0) { + if (mndPullupArbHeartbeat(pMnode) != 0) { + mError("failed to pullup arb heartbeat, since:%s", terrstr()); + } + } + + if (sec % (tsArbCheckSyncIntervalSec) == 0) { + if (mndPullupArbCheckSync(pMnode) != 0) { + mError("failed to pullup arb check sync, since:%s", terrstr()); + } + } } return NULL; @@ -513,6 +542,7 @@ static int32_t mndInitSteps(SMnode *pMnode) { if (mndAllocStep(pMnode, "mnode-mnode", mndInitMnode, mndCleanupMnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-qnode", mndInitQnode, mndCleanupQnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-snode", mndInitSnode, mndCleanupSnode) != 0) return -1; + if (mndAllocStep(pMnode, "mnode-arbgroup", mndInitArbGroup, mndCleanupArbGroup) != 0) return -1; if (mndAllocStep(pMnode, "mnode-dnode", mndInitDnode, mndCleanupDnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-user", mndInitUser, mndCleanupUser) != 0) return -1; if (mndAllocStep(pMnode, "mnode-grant", mndInitGrant, mndCleanupGrant) != 0) return -1; @@ -694,6 +724,13 @@ ESyncRole mndGetRole(SMnode *pMnode) { return syncGetRole(rid); } +int64_t mndGetTerm(SMnode *pMnode) { + int64_t rid = pMnode->syncMgmt.sync; + return syncGetTerm(rid); +} + +int32_t mndGetArbToken(SMnode *pMnode, char *outToken) { return syncGetArbToken(pMnode->syncMgmt.sync, outToken); } + void mndStop(SMnode *pMnode) { mndSetStop(pMnode); mndSyncStop(pMnode); @@ -768,7 +805,8 @@ _OVER: pMsg->msgType == TDMT_MND_TRIM_DB_TIMER || pMsg->msgType == TDMT_MND_UPTIME_TIMER || pMsg->msgType == TDMT_MND_COMPACT_TIMER || pMsg->msgType == TDMT_MND_NODECHECK_TIMER || pMsg->msgType == TDMT_MND_GRANT_HB_TIMER || pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_CANDIDITATE || - pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_TIMER || pMsg->msgType == TDMT_MND_STREAM_REQ_CHKPT) { + pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_TIMER || pMsg->msgType == TDMT_MND_STREAM_REQ_CHKPT || + pMsg->msgType == TDMT_MND_ARB_HEARTBEAT_TIMER || pMsg->msgType == TDMT_MND_ARB_CHECK_SYNC_TIMER) { mTrace("timer not process since mnode restored:%d stopped:%d, sync restored:%d role:%s ", pMnode->restored, pMnode->stopped, state.restored, syncStr(state.state)); return -1; @@ -951,7 +989,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr pVnDesc->dnode_id = pVgid->dnodeId; tstrncpy(pVnDesc->vnode_role, syncStr(pVgid->syncState), sizeof(pVnDesc->vnode_role)); pVnDesc->syncState = pVgid->syncState; - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { tstrncpy(desc.status, "ready", sizeof(desc.status)); pClusterInfo->vgroups_alive++; } diff --git a/source/dnode/mnode/impl/src/mndQnode.c b/source/dnode/mnode/impl/src/mndQnode.c index 2f4ad69e2a..b86f14e698 100644 --- a/source/dnode/mnode/impl/src/mndQnode.c +++ b/source/dnode/mnode/impl/src/mndQnode.c @@ -189,7 +189,7 @@ int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj) { return 0; } -bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId) { +bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId) { return pQnode->pDnode->id == dnodeId; } @@ -434,7 +434,7 @@ _OVER: } mndReleaseQnode(pMnode, pObj); - tFreeSMCreateQnodeReq(&dropReq); + tFreeSDDropQnodeReq(&dropReq); return code; } diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index f887d05d37..b3124fa99f 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -67,6 +67,8 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_QNODE; } else if (strncasecmp(name, TSDB_INS_TABLE_SNODES, len) == 0) { type = TSDB_MGMT_TABLE_SNODE; + } else if (strncasecmp(name, TSDB_INS_TABLE_ARBGROUPS, len) == 0) { + type = TSDB_MGMT_TABLE_ARBGROUP; } else if (strncasecmp(name, TSDB_INS_TABLE_CLUSTER, len) == 0) { type = TSDB_MGMT_TABLE_CLUSTER; } else if (strncasecmp(name, TSDB_INS_TABLE_DATABASES, len) == 0) { diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 55317d03af..60b522f6fa 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -513,6 +513,7 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre createReq.numOfColumns = pStream->outputSchema.nCols; createReq.numOfTags = 1; // group id createReq.pColumns = taosArrayInit_s(sizeof(SField), createReq.numOfColumns); + // build fields for (int32_t i = 0; i < createReq.numOfColumns; i++) { SField *pField = taosArrayGet(createReq.pColumns, i); @@ -586,12 +587,15 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre mndFreeStb(&stbObj); mndReleaseStb(pMnode, pStb); mndReleaseDb(pMnode, pDb); - + mDebug("stream:%s create dst stable:%s, cols:%d", pStream->name, pStream->targetSTbName, pStream->outputSchema.nCols); return 0; + _OVER: tFreeSMCreateStbReq(&createReq); mndReleaseStb(pMnode, pStb); mndReleaseDb(pMnode, pDb); + + mDebug("stream:%s failed to create dst stable:%s, code:%s", pStream->name, pStream->targetSTbName, tstrerror(terrno)); return -1; } @@ -647,7 +651,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { terrno = TSDB_CODE_MND_INVALID_PLATFORM; goto _OVER; #endif - mInfo("stream:%s, start to create, sql:%s", createReq.name, createReq.sql); + mInfo("stream:%s, start to create stream, sql:%s", createReq.name, createReq.sql); if (mndCheckCreateStreamReq(&createReq) != 0) { mError("stream:%s, failed to create since %s", createReq.name, terrstr()); @@ -684,17 +688,20 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { goto _OVER; } - STrans *pTrans = doCreateTrans(pMnode, &streamObj, pReq, MND_STREAM_CREATE_NAME, "create stream tasks on dnodes"); + STrans *pTrans = doCreateTrans(pMnode, &streamObj, pReq, TRN_CONFLICT_DB, MND_STREAM_CREATE_NAME, "create stream tasks on dnodes"); if (pTrans == NULL) { goto _OVER; } // create stb for stream - if (createReq.createStb == STREAM_CREATE_STABLE_TRUE && - mndCreateStbForStream(pMnode, pTrans, &streamObj, pReq->info.conn.user) < 0) { - mError("trans:%d, failed to create stb for stream %s since %s", pTrans->id, createReq.name, terrstr()); - mndTransDrop(pTrans); - goto _OVER; + if (createReq.createStb == STREAM_CREATE_STABLE_TRUE) { + if (mndCreateStbForStream(pMnode, pTrans, &streamObj, pReq->info.conn.user) < 0) { + mError("trans:%d, failed to create stb for stream %s since %s", pTrans->id, createReq.name, terrstr()); + mndTransDrop(pTrans); + goto _OVER; + } + } else { + mDebug("stream:%s no need create stable", createReq.name); } // schedule stream task for stream obj @@ -724,7 +731,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { // add into buffer firstly // to make sure when the hb from vnode arrived, the newly created tasks have been in the task map already. taosThreadMutexLock(&execInfo.lock); - mDebug("stream stream:%s tasks register into node list", createReq.name); + mDebug("stream stream:%s start to register tasks into task_node_list", createReq.name); saveStreamTasksInfo(&streamObj, &execInfo); taosThreadMutexUnlock(&execInfo.lock); @@ -890,7 +897,7 @@ static int32_t mndProcessStreamCheckpointTrans(SMnode *pMnode, SStreamObj *pStre return -1; } - STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, MND_STREAM_CHECKPOINT_NAME, "gen checkpoint for stream"); + STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_CHECKPOINT_NAME, "gen checkpoint for stream"); if (pTrans == NULL) { mError("failed to checkpoint of stream name%s, checkpointId: %" PRId64 ", reason:%s", pStream->name, checkpointId, tstrerror(TSDB_CODE_MND_TRANS_CONFLICT)); @@ -1143,7 +1150,7 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) { return -1; } - STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, MND_STREAM_DROP_NAME, "drop stream"); + STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, TRN_CONFLICT_NOTHING, MND_STREAM_DROP_NAME, "drop stream"); if (pTrans == NULL) { mError("stream:%s, failed to drop since %s", dropReq.name, terrstr()); sdbRelease(pMnode->pSdb, pStream); @@ -1573,7 +1580,7 @@ static int32_t mndProcessPauseStreamReq(SRpcMsg *pReq) { return -1; } - STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, MND_STREAM_PAUSE_NAME, "pause the stream"); + STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, TRN_CONFLICT_NOTHING, MND_STREAM_PAUSE_NAME, "pause the stream"); if (pTrans == NULL) { mError("stream:%s failed to pause stream since %s", pauseReq.name, terrstr()); sdbRelease(pMnode->pSdb, pStream); @@ -1662,7 +1669,7 @@ static int32_t mndProcessResumeStreamReq(SRpcMsg *pReq) { return -1; } - STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, MND_STREAM_RESUME_NAME, "resume the stream"); + STrans *pTrans = doCreateTrans(pMnode, pStream, pReq, TRN_CONFLICT_NOTHING, MND_STREAM_RESUME_NAME, "resume the stream"); if (pTrans == NULL) { mError("stream:%s, failed to resume stream since %s", resumeReq.name, terrstr()); sdbRelease(pMnode->pSdb, pStream); @@ -1794,7 +1801,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange // here create only one trans if (pTrans == NULL) { - pTrans = doCreateTrans(pMnode, pStream, NULL, MND_STREAM_TASK_UPDATE_NAME, "update task epsets"); + pTrans = doCreateTrans(pMnode, pStream, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_TASK_UPDATE_NAME, "update task epsets"); if (pTrans == NULL) { sdbRelease(pSdb, pStream); sdbCancelFetch(pSdb, pIter); diff --git a/source/dnode/mnode/impl/src/mndStreamHb.c b/source/dnode/mnode/impl/src/mndStreamHb.c index 14f3c533e3..c8f943b931 100644 --- a/source/dnode/mnode/impl/src/mndStreamHb.c +++ b/source/dnode/mnode/impl/src/mndStreamHb.c @@ -66,7 +66,7 @@ static void addIntoCheckpointList(SArray* pList, const SFailedCheckpointInfo* pI } int32_t mndCreateStreamResetStatusTrans(SMnode *pMnode, SStreamObj *pStream) { - STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, MND_STREAM_TASK_RESET_NAME, " reset from failed checkpoint"); + STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_TASK_RESET_NAME, " reset from failed checkpoint"); if (pTrans == NULL) { return terrno; } @@ -156,7 +156,7 @@ static int32_t mndDropOrphanTasks(SMnode* pMnode, SArray* pList) { } SStreamObj dummyObj = {.uid = pTask->streamId, .sourceDb = "", .targetSTbName = ""}; - STrans* pTrans = doCreateTrans(pMnode, &dummyObj, NULL, MND_STREAM_DROP_NAME, "drop stream"); + STrans* pTrans = doCreateTrans(pMnode, &dummyObj, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_DROP_NAME, "drop stream"); if (pTrans == NULL) { mError("failed to create trans to drop orphan tasks since %s", terrstr()); return -1; diff --git a/source/dnode/mnode/impl/src/mndStreamTrans.c b/source/dnode/mnode/impl/src/mndStreamTrans.c index 2241d93465..16b735fbc4 100644 --- a/source/dnode/mnode/impl/src/mndStreamTrans.c +++ b/source/dnode/mnode/impl/src/mndStreamTrans.c @@ -161,8 +161,8 @@ int32_t mndAddtoCheckpointWaitingList(SStreamObj* pStream, int64_t checkpointId) return TSDB_CODE_SUCCESS; } -STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, const char *name, const char *pMsg) { - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pReq, name); +STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name, const char *pMsg) { + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, conflict, pReq, name); if (pTrans == NULL) { mError("failed to build trans:%s, reason: %s", name, tstrerror(TSDB_CODE_OUT_OF_MEMORY)); terrno = TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index a1490a3813..28c857319f 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -409,6 +409,7 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { pFsm->FpApplyQueueItems = mndApplyQueueItems; pFsm->FpReConfigCb = NULL; pFsm->FpBecomeLeaderCb = mndBecomeLeader; + pFsm->FpBecomeAssignedLeaderCb = NULL; pFsm->FpBecomeFollowerCb = mndBecomeFollower; pFsm->FpBecomeLearnerCb = mndBecomeLearner; pFsm->FpGetSnapshot = mndSyncGetSnapshot; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index f7db0d7b15..3af372a432 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -733,6 +733,8 @@ void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname) } } +void mndTransSetArbGroupId(STrans *pTrans, int32_t groupId) { pTrans->arbGroupId = groupId; } + void mndTransSetSerial(STrans *pTrans) { pTrans->exec = TRN_EXEC_SERIAL; } void mndTransSetParallel(STrans *pTrans) { pTrans->exec = TRN_EXEC_PARALLEL; } @@ -814,6 +816,12 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { conflict = true; } } + if (pNew->conflict == TRN_CONFLICT_ARBGROUP) { + if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; + if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) { + if (pNew->arbGroupId == pTrans->arbGroupId) conflict = true; + } + } if (conflict) { mError("trans:%d, db:%s stb:%s type:%d, can't execute since conflict with trans:%d db:%s stb:%s type:%d", @@ -1255,9 +1263,9 @@ static int32_t mndTransExecuteActions(SMnode *pMnode, STrans *pTrans, SArray *pA for (int32_t action = 0; action < numOfActions; ++action) { STransAction *pAction = taosArrayGet(pArray, action); - mDebug("trans:%d, %s:%d Sent:%d, Received:%d, errCode:0x%x, acceptableCode:0x%x, retryCode:0x%x", pTrans->id, - mndTransStr(pAction->stage), pAction->id, pAction->msgSent, pAction->msgReceived, pAction->errCode, - pAction->acceptableCode, pAction->retryCode); + mDebug("trans:%d, %s:%d Sent:%d, Received:%d, errCode:0x%x, acceptableCode:0x%x, retryCode:0x%x", + pTrans->id, mndTransStr(pAction->stage), pAction->id, pAction->msgSent, pAction->msgReceived, + pAction->errCode, pAction->acceptableCode, pAction->retryCode); if (pAction->msgSent) { if (pAction->msgReceived) { if (pAction->errCode != 0 && pAction->errCode != pAction->acceptableCode) { diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b0290191bc..571f17fab6 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "mndVgroup.h" #include "audit.h" +#include "mndArbGroup.h" #include "mndDb.h" #include "mndDnode.h" #include "mndMnode.h" @@ -351,7 +352,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg mInfo( "vgId:%d, build create vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d " "changeVersion:%d", - createReq.vgId, createReq.replica, createReq.selfIndex, createReq.learnerReplica, createReq.learnerReplica, + createReq.vgId, createReq.replica, createReq.selfIndex, createReq.learnerReplica, createReq.learnerSelfIndex, createReq.strict, createReq.changeVersion); for (int32_t i = 0; i < createReq.replica; ++i) { mInfo("vgId:%d, replica:%d ep:%s:%u", createReq.vgId, i, createReq.replicas[i].fqdn, createReq.replicas[i].port); @@ -738,10 +739,6 @@ void mndSortVnodeGid(SVgObj *pVgroup) { } static int32_t mndGetAvailableDnode(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, SArray *pArray) { - SSdb *pSdb = pMnode->pSdb; - int32_t allocedVnodes = 0; - void *pIter = NULL; - mDebug("start to sort %d dnodes", (int32_t)taosArrayGetSize(pArray)); taosArraySort(pArray, (__compar_fn_t)mndCompareDnodeVnodes); for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pArray); ++i) { @@ -883,7 +880,7 @@ SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup) { SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); if (pDnode == NULL) continue; - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { epset.inUse = epset.numOfEps; } @@ -895,6 +892,29 @@ SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup) { return epset; } +SEpSet mndGetVgroupEpsetById(SMnode *pMnode, int32_t vgId) { + SEpSet epset = {0}; + + SVgObj * pVgroup = mndAcquireVgroup(pMnode, vgId); + if (!pVgroup) return epset; + + for (int32_t v = 0; v < pVgroup->replica; ++v) { + const SVnodeGid *pVgid = &pVgroup->vnodeGid[v]; + SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); + if (pDnode == NULL) continue; + + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + epset.inUse = epset.numOfEps; + } + + addEpIntoEpSet(&epset, pDnode->fqdn, pDnode->port); + mndReleaseDnode(pMnode, pDnode); + } + + mndReleaseVgroup(pMnode, pVgroup); + return epset; +} + static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { SMnode *pMnode = pReq->info.node; SSdb *pSdb = pMnode->pSdb; @@ -958,7 +978,8 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p strcpy(role, "dropping"); } else if (online) { char *star = ""; - if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER || + pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (!pVgroup->vnodeGid[i].syncRestore && !pVgroup->vnodeGid[i].syncCanRead) { star = "**"; } else if (!pVgroup->vnodeGid[i].syncRestore && pVgroup->vnodeGid[i].syncCanRead) { @@ -2288,7 +2309,7 @@ int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTra return -1; } - int32_t dnodeId = pVgroup->vnodeGid[0].dnodeId; + int32_t dnodeId = 0; for (int i = 0; i < replica; i++) { if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { @@ -2389,81 +2410,102 @@ static int32_t mndCheckDnodeMemory(SMnode *pMnode, SDbObj *pOldDb, SDbObj *pNewD } int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, - SArray *pArray) { - SVgObj newVgroup = {0}; - memcpy(&newVgroup, pVgroup, sizeof(SVgObj)); + SArray *pArray, SVgObj *pNewVgroup) { + memcpy(pNewVgroup, pVgroup, sizeof(SVgObj)); if (pVgroup->replica <= 0 || pVgroup->replica == pNewDb->cfg.replications) { if (mndAddAlterVnodeConfigAction(pMnode, pTrans, pNewDb, pVgroup) != 0) return -1; - if (mndCheckDnodeMemory(pMnode, pOldDb, pNewDb, &newVgroup, pVgroup, pArray) != 0) return -1; + if (mndCheckDnodeMemory(pMnode, pOldDb, pNewDb, pNewVgroup, pVgroup, pArray) != 0) return -1; return 0; } mndTransSetSerial(pTrans); - if (newVgroup.replica == 1 && pNewDb->cfg.replications == 3) { + if (pNewVgroup->replica == 1 && pNewDb->cfg.replications == 3) { mInfo("db:%s, vgId:%d, will add 2 vnodes, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId); // add second - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; // learner stage - newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[1]) != 0) return -1; // follower stage - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; - if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; // add third - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; - newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[2]) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - } else if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; + } else if (pNewVgroup->replica == 3 && pNewDb->cfg.replications == 1) { mInfo("db:%s, vgId:%d, will remove 2 vnodes, vn:0 dnode:%d vn:1 dnode:%d vn:2 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId, pVgroup->vnodeGid[1].dnodeId, pVgroup->vnodeGid[2].dnodeId); SVnodeGid del1 = {0}; SVnodeGid del2 = {0}; - if (mndRemoveVnodeFromVgroup(pMnode, pTrans, &newVgroup, pArray, &del1) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + if (mndRemoveVnodeFromVgroup(pMnode, pTrans, pNewVgroup, pArray, &del1) != 0) return -1; + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &del1, true) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; - if (mndRemoveVnodeFromVgroup(pMnode, pTrans, &newVgroup, pArray, &del2) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + if (mndRemoveVnodeFromVgroup(pMnode, pTrans, pNewVgroup, pArray, &del2) != 0) return -1; + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &del2, true) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; + } else if (pNewVgroup->replica == 1 && pNewDb->cfg.replications == 2) { + mInfo("db:%s, vgId:%d, will add 1 vnode, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, + pVgroup->vnodeGid[0].dnodeId); + + // add second + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; + + // learner stage + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) + return -1; + + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[1]) != 0) return -1; + + // follower stage + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) + return -1; + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; } else { return -1; } - mndSortVnodeGid(&newVgroup); + mndSortVnodeGid(pNewVgroup); { - SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + SSdbRaw *pVgRaw = mndVgroupActionEncode(pNewVgroup); if (pVgRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pVgRaw) != 0) { sdbFreeRaw(pVgRaw); @@ -2622,7 +2664,7 @@ int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj } } if (mndAddCreateVnodeAction(pMnode, pTrans, db, &newVgroup, &newVgroup.vnodeGid[selected]) != 0) return -1; - } else if (newVgroup.replica == 3) { + } else if (newVgroup.replica == 2 || newVgroup.replica == 3) { for (int i = 0; i < newVgroup.replica; i++) { if (newVgroup.vnodeGid[i].dnodeId == pDnode->id) { newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_LEARNER; @@ -2716,6 +2758,12 @@ int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgro } #endif + if (pDb->cfg.withArbitrator) { + code = TSDB_CODE_OPS_NOT_SUPPORT; + mError("vgId:%d, db:%s, with arbitrator, split vgroup not allowed", pVgroup->vgId, pVgroup->dbName); + goto _OVER; + } + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB, pReq, "split-vgroup"); if (pTrans == NULL) goto _OVER; mndTransSetSerial(pTrans); @@ -2813,13 +2861,15 @@ int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgro // adjust vgroup replica if (pDb->cfg.replications != newVg1.replica) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray) != 0) goto _OVER; + SVgObj tmpGroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray, &tmpGroup) != 0) goto _OVER; } else { if (mndAddVgStatusAction(pTrans, &newVg1, SDB_STATUS_READY, TRN_STAGE_COMMIT_ACTION) < 0) goto _OVER; } if (pDb->cfg.replications != newVg2.replica) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg2, pArray) != 0) goto _OVER; + SVgObj tmpGroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg2, pArray, &tmpGroup) != 0) goto _OVER; } else { if (mndAddVgStatusAction(pTrans, &newVg2, SDB_STATUS_READY, TRN_STAGE_COMMIT_ACTION) < 0) goto _OVER; } @@ -2907,10 +2957,22 @@ static int32_t mndBalanceVgroupBetweenDnode(SMnode *pMnode, STrans *pTrans, SDno } SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName); + if (pDb == NULL) { + mError("vgId:%d, balance vgroup can't find db obj dbName:%s", pVgroup->vgId, pVgroup->dbName); + goto _OUT; + } + + if (pDb->cfg.withArbitrator) { + mInfo("vgId:%d, db:%s, with arbitrator, balance vgroup not allowed", pVgroup->vgId, pVgroup->dbName); + goto _OUT; + } + code = mndSetBalanceVgroupInfoToTrans(pMnode, pTrans, pDb, pVgroup, pSrc, pDst); if (code == 0) { code = taosHashPut(pBalancedVgroups, &pVgroup->vgId, sizeof(int32_t), &pVgroup->vgId, sizeof(int32_t)); } + + _OUT: mndReleaseDb(pMnode, pDb); sdbRelease(pSdb, pVgroup); sdbCancelFetch(pSdb, pIter); diff --git a/source/dnode/mnode/impl/test/CMakeLists.txt b/source/dnode/mnode/impl/test/CMakeLists.txt index bc5b5125f1..471f0535b8 100644 --- a/source/dnode/mnode/impl/test/CMakeLists.txt +++ b/source/dnode/mnode/impl/test/CMakeLists.txt @@ -1,6 +1,7 @@ enable_testing() add_subdirectory(acct) +add_subdirectory(arbgroup) #add_subdirectory(db) #add_subdirectory(dnode) add_subdirectory(func) diff --git a/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt b/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt new file mode 100644 index 0000000000..44ac305498 --- /dev/null +++ b/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt @@ -0,0 +1,13 @@ +SET(CMAKE_CXX_STANDARD 11) + +aux_source_directory(. MNODE_ARBGROUP_TEST_SRC) +add_executable(arbgroupTest ${MNODE_ARBGROUP_TEST_SRC}) +target_link_libraries( + arbgroupTest + PRIVATE dnode nodes planner gtest qcom +) + +add_test( + NAME arbgroupTest + COMMAND arbgroupTest +) diff --git a/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp b/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp new file mode 100644 index 0000000000..fdfc560d54 --- /dev/null +++ b/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +// #include +#include +#include +// #include "nodes.h" +// #include "planner.h" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wwrite-strings" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wsign-compare" + +// #include +#include "../../inc/mndArbGroup.h" + +namespace { + +void generateArbToken(int32_t nodeId, int32_t vgId, char* buf) { + memset(buf, 0, TSDB_ARB_TOKEN_SIZE); + int32_t randVal = taosSafeRand() % 1000; + int64_t currentMs = taosGetTimestampMs(); + snprintf(buf, TSDB_ARB_TOKEN_SIZE, "d%d#g%d#%" PRId64 "#%d", nodeId, vgId, currentMs, randVal); +} + +} // namespace + +class ArbgroupTest : public testing::Test { + protected: + static void SetUpTestSuite() { + std::cout << "setup env for arbgroupTest suite" << std::endl; + } + + static void TearDownTestSuite() { std::cout << "tearDown env for arbgroupTest suite" << std::endl; } + + virtual void SetUp() override {} + + virtual void TearDown() override {} + +}; + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +TEST_F(ArbgroupTest, 01_encode_decode_sdb) { + SArbGroup group = {0}; + group.vgId = 5; + group.dbUid = 1234; + group.members[0].info.dnodeId = 1; + generateArbToken(1, 5, group.members[0].state.token); + group.members[1].info.dnodeId = 2; + generateArbToken(2, 5, group.members[1].state.token); + group.isSync = 1; + group.assignedLeader.dnodeId = 1; + generateArbToken(1, 5, group.assignedLeader.token); + group.version = 2234; + + // -------------------------------------------------------------------------------- + SSdbRaw* pRaw = mndArbGroupActionEncode(&group); + ASSERT_NE(pRaw, nullptr); + + SSdbRow* pRow = mndArbGroupActionDecode(pRaw); + ASSERT_NE(pRow, nullptr); + + SArbGroup* pNewGroup = (SArbGroup*)sdbGetRowObj(pRow); + + EXPECT_EQ(group.vgId, pNewGroup->vgId); + EXPECT_EQ(group.dbUid, pNewGroup->dbUid); + EXPECT_EQ(group.members[0].info.dnodeId, pNewGroup->members[0].info.dnodeId); + EXPECT_EQ(group.members[1].info.dnodeId, pNewGroup->members[1].info.dnodeId); + EXPECT_EQ(group.isSync, pNewGroup->isSync); + EXPECT_EQ(group.assignedLeader.dnodeId, pNewGroup->assignedLeader.dnodeId); + + EXPECT_EQ(std::string(group.members[0].state.token), std::string(pNewGroup->members[0].state.token)); + EXPECT_EQ(std::string(group.members[1].state.token), std::string(pNewGroup->members[1].state.token)); + EXPECT_EQ(std::string(group.assignedLeader.token), std::string(pNewGroup->assignedLeader.token)); + EXPECT_EQ(group.version, pNewGroup->version); + + taosMemoryFree(pRow); + taosMemoryFree(pRaw); +} + +TEST_F(ArbgroupTest, 02_process_heart_beat_rsp) { + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 1; + group.assignedLeader.dnodeId = dnodeId; + strncpy(group.assignedLeader.token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // expired hb => skip + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq - 1; + strncpy(rspMember.memberToken, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_FALSE(updateToken); + EXPECT_NE(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_NE(group.members[0].state.lastHbMs, nowMs); + } + + { // old token + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq + 1; + strncpy(rspMember.memberToken, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_FALSE(updateToken); + EXPECT_EQ(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_EQ(group.members[0].state.lastHbMs, nowMs); + } + + { // new token + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq + 1; + generateArbToken(dnodeId, vgId, rspMember.memberToken); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_TRUE(updateToken); + EXPECT_EQ(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_EQ(group.members[0].state.lastHbMs, nowMs); + + EXPECT_EQ(std::string(newGroup.members[0].state.token), std::string(rspMember.memberToken)); + EXPECT_FALSE(newGroup.isSync); + EXPECT_EQ(newGroup.assignedLeader.dnodeId, 0); + EXPECT_EQ(std::string(newGroup.assignedLeader.token).size(), 0); + } + + taosThreadMutexDestroy(&group.mutex); +} + +TEST_F(ArbgroupTest, 03_process_check_sync_rsp) { + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 0; + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // token mismatch => skip + char member0Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member0Token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + char member1Token[TSDB_ARB_TOKEN_SIZE] = {0}; + generateArbToken(2, 5, member1Token); + bool newIsSync = false; + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(&group, vgId, member0Token, member1Token, newIsSync, &newGroup); + + EXPECT_FALSE(updateIsSync); + } + + { // newIsSync + char member0Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member0Token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + char member1Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member1Token, group.members[1].state.token, TSDB_ARB_TOKEN_SIZE); + bool newIsSync = true; + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(&group, vgId, member0Token, member1Token, newIsSync, &newGroup); + + EXPECT_TRUE(updateIsSync); + EXPECT_TRUE(newGroup.isSync); + } + + taosThreadMutexDestroy(&group.mutex); +} + +TEST_F(ArbgroupTest, 04_process_set_assigned_leader){ + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 1; + group.assignedLeader.dnodeId = dnodeId; + strncpy(group.assignedLeader.token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // token mismatch => skip + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + generateArbToken(dnodeId, vgId, memberToken); + int32_t errcode = TSDB_CODE_SUCCESS; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_FALSE(updateAssigned); + } + + { // errcode != TSDB_CODE_SUCCESS + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(memberToken, group.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + int32_t errcode = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_FALSE(updateAssigned); + } + + { // errcode == TSDB_CODE_SUCCESS + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(memberToken, group.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + int32_t errcode = TSDB_CODE_SUCCESS; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_TRUE(updateAssigned); + EXPECT_FALSE(newGroup.isSync); + } + + taosThreadMutexDestroy(&group.mutex); +} + +#pragma GCC diagnostic pop diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index e2d4a1f6fc..12a34b0305 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -153,7 +153,8 @@ typedef enum { SDB_COMPACT = 24, SDB_COMPACT_DETAIL = 25, SDB_GRANT = 26, // grant log - SDB_MAX = 27 + SDB_ARBGROUP = 27, + SDB_MAX = 28 } ESdbType; typedef struct SSdbRaw { diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index df228c1fcc..05231f8359 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -70,7 +70,9 @@ const char *sdbTableName(ESdbType type) { return "compact"; case SDB_COMPACT_DETAIL: return "compact_detail"; - default: + case SDB_ARBGROUP: + return "arb_group"; + default: return "undefine"; } } diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 294e75602e..8ae7e9706d 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -76,6 +76,9 @@ int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList); int32_t vnodeGetAllTableList(SVnode *pVnode, uint64_t uid, SArray *list); int32_t vnodeIsCatchUp(SVnode *pVnode); ESyncRole vnodeGetRole(SVnode *pVnode); +int32_t vnodeGetArbToken(SVnode *pVnode, char *outToken); + +int32_t vnodeUpdateArbTerm(SVnode *pVnode, int64_t arbTerm); int32_t vnodeGetCtbIdList(void *pVnode, int64_t suid, SArray *list); int32_t vnodeGetCtbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg), void *arg); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 9fdb4993bd..d564c5a36e 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -136,7 +136,7 @@ typedef SVCreateTSmaReq SSmaCfg; SMTbCursor* metaOpenTbCursor(void* pVnode); void metaCloseTbCursor(SMTbCursor* pTbCur); void metaPauseTbCursor(SMTbCursor* pTbCur); -void metaResumeTbCursor(SMTbCursor* pTbCur, int8_t first); +void metaResumeTbCursor(SMTbCursor* pTbCur, int8_t first, int8_t move); int32_t metaTbCursorNext(SMTbCursor* pTbCur, ETableType jumpTableType); int32_t metaTbCursorPrev(SMTbCursor* pTbCur, ETableType jumpTableType); diff --git a/source/dnode/vnode/src/meta/metaOpen.c b/source/dnode/vnode/src/meta/metaOpen.c index 8055d6e139..4a3dcd0e51 100644 --- a/source/dnode/vnode/src/meta/metaOpen.c +++ b/source/dnode/vnode/src/meta/metaOpen.c @@ -246,32 +246,20 @@ int metaAlterCache(SMeta *pMeta, int32_t nPage) { } int32_t metaRLock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta rlock %p", &pMeta->lock); - - ret = taosThreadRwlockRdlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockRdlock(&pMeta->lock); return ret; } int32_t metaWLock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta wlock %p", &pMeta->lock); - - ret = taosThreadRwlockWrlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockWrlock(&pMeta->lock); return ret; } int32_t metaULock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta ulock %p", &pMeta->lock); - - ret = taosThreadRwlockUnlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockUnlock(&pMeta->lock); return ret; } diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index cc7ae03483..c52e42d945 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -248,7 +248,7 @@ SMTbCursor *metaOpenTbCursor(void *pVnode) { // tdbTbcMoveToFirst((TBC *)pTbCur->pDbc); pTbCur->pMeta = pVnodeObj->pMeta; pTbCur->paused = 1; - metaResumeTbCursor(pTbCur, 1); + metaResumeTbCursor(pTbCur, 1, 0); return pTbCur; } @@ -273,7 +273,7 @@ void metaPauseTbCursor(SMTbCursor *pTbCur) { pTbCur->paused = 1; } } -void metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first) { +void metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first, int8_t move) { if (pTbCur->paused) { metaReaderDoInit(&pTbCur->mr, pTbCur->pMeta, META_READER_LOCK); @@ -282,9 +282,11 @@ void metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first) { if (first) { tdbTbcMoveToFirst((TBC *)pTbCur->pDbc); } else { - int c = 0; + int c = 1; tdbTbcMoveTo(pTbCur->pDbc, pTbCur->pKey, pTbCur->kLen, &c); - if (c < 0) { + if (c == 0) { + if (move) tdbTbcMoveToNext(pTbCur->pDbc); + } else if (c < 0) { tdbTbcMoveToPrev(pTbCur->pDbc); } else { tdbTbcMoveToNext(pTbCur->pDbc); diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 095e427462..61c610538e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -437,7 +437,7 @@ static int32_t doLoadSttFilesBlk(SSttBlockLoadInfo *pBlockLoadInfo, SLDataIter * code = loadTombFn(pReader1, pIter->pReader, pIter->pBlockLoadInfo); double el = (taosGetTimestampUs() - st) / 1000.0; - tsdbDebug("load the stt file info completed, elapsed time:%.2fms, %s", el, idStr); + tsdbDebug("load the stt file blk info completed, elapsed time:%.2fms, %s", el, idStr); return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index c7f6392565..b05ce0680b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -2168,8 +2168,8 @@ static bool initSttBlockReader(SSttBlockReader* pSttBlockReader, STableBlockScan pScanInfo->sttKeyInfo.nextProcKey = ASCENDING_TRAVERSE(pReader->info.order) ? pScanInfo->sttWindow.skey : pScanInfo->sttWindow.ekey; hasData = (pScanInfo->sttKeyInfo.status == STT_FILE_HAS_DATA); - } else { // not clean stt blocks - INIT_TIMEWINDOW(&pScanInfo->sttWindow); // reset the time window + } else { // not clean stt blocks + INIT_TIMEWINDOW(&pScanInfo->sttWindow); //reset the time window pScanInfo->sttBlockReturned = false; hasData = nextRowFromSttBlocks(pSttBlockReader, pScanInfo, pReader->suppInfo.pkSrcSlot, &pReader->info.verRange); } diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 63ca7251f5..daee8966f9 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -493,7 +493,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC VNODE_METRIC_TAG_NAME_DNODE_ID, VNODE_METRIC_TAG_NAME_DNODE_EP, VNODE_METRIC_TAG_NAME_VGROUP_ID, VNODE_METRIC_TAG_NAME_USERNAME, VNODE_METRIC_TAG_NAME_RESULT}; - counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", + counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", label_count, sample_labels); vInfo("vgId:%d, new metric:%p",TD_VID(pVnode), counter); if(taos_collector_registry_register_metric(counter) == 1){ @@ -503,7 +503,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC } } pVnode->monitor.insertCounter = counter; - vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter); + vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter); } return pVnode; @@ -560,6 +560,9 @@ int32_t vnodeIsCatchUp(SVnode *pVnode) { return syncIsCatchUp(pVnode->sync); } ESyncRole vnodeGetRole(SVnode *pVnode) { return syncGetRole(pVnode->sync); } +int32_t vnodeUpdateArbTerm(SVnode *pVnode, int64_t arbTerm) { return syncUpdateArbTerm(pVnode->sync, arbTerm); } +int32_t vnodeGetArbToken(SVnode *pVnode, char *outToken) { return syncGetArbToken(pVnode->sync, outToken); } + void vnodeStop(SVnode *pVnode) {} int64_t vnodeGetSyncHandle(SVnode *pVnode) { return pVnode->sync; } diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index d244d5b6bf..a85192546f 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -406,7 +406,7 @@ int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { int32_t vnodeGetLoadLite(SVnode *pVnode, SVnodeLoadLite *pLoad) { SSyncState syncState = syncGetState(pVnode->sync); - if (syncState.state == TAOS_SYNC_STATE_LEADER) { + if (syncState.state == TAOS_SYNC_STATE_LEADER || syncState.state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { pLoad->vgId = TD_VID(pVnode); pLoad->nTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1); return 0; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index e32d4b70e0..a03adb164b 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -31,20 +31,24 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, static int32_t vnodeProcessAlterTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginRpc); -static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg); static int32_t vnodeProcessCreateTSmaReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterConfirmReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessTrimReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); -static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg); static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCreateIndexReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropIndexReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); +static int32_t vnodeProcessArbCheckSyncReq(SVnode *pVnode, void *pReq, int32_t len, SRpcMsg *pRsp); + +static int32_t vnodePreCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token); +static int32_t vnodeCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token); extern int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); extern int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg); @@ -451,6 +455,21 @@ static int32_t vnodePreProcessBatchDeleteMsg(SVnode *pVnode, SRpcMsg *pMsg) { return code; } +static int32_t vnodePreProcessArbCheckSyncMsg(SVnode *pVnode, SRpcMsg *pMsg) { + SVArbCheckSyncReq syncReq = {0}; + + if (tDeserializeSVArbCheckSyncReq((char *)pMsg->pCont + sizeof(SMsgHead), pMsg->contLen - sizeof(SMsgHead), + &syncReq) != 0) { + return TSDB_CODE_INVALID_MSG; + } + + (void)vnodePreCheckAssignedLogSyncd(pVnode, syncReq.member0Token, syncReq.member1Token); + int32_t code = terrno; + tFreeSVArbCheckSyncReq(&syncReq); + + return code; +} + int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { int32_t code = 0; @@ -473,6 +492,9 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { case TDMT_VND_BATCH_DEL: { code = vnodePreProcessBatchDeleteMsg(pVnode, pMsg); } break; + case TDMT_VND_ARB_CHECK_SYNC: { + code = vnodePreProcessArbCheckSyncMsg(pVnode, pMsg); + } break; default: break; } @@ -643,6 +665,10 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg vnodeProcessKillCompactReq(pVnode, ver, pReq, len, pRsp); break; #endif + /* ARB */ + case TDMT_VND_ARB_CHECK_SYNC: + vnodeProcessArbCheckSyncReq(pVnode, pReq, len, pRsp); + break; default: vError("vgId:%d, unprocessed msg, %d", TD_VID(pVnode), pMsg->msgType); return -1; @@ -1489,7 +1515,7 @@ static int32_t vnodeRebuildSubmitReqMsg(SSubmitReq2 *pSubmitReq, void **ppMsg) { return code; } -static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg) { int32_t code = 0; terrno = 0; @@ -1710,8 +1736,8 @@ _exit: atomic_add_fetch_64(&pVnode->statis.nBatchInsert, 1); if(tsEnableMonitor && pSubmitRsp->affectedRows > 0 && strlen(pOriginalMsg->info.conn.user) > 0){ - const char *sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT_AFFECTED_ROWS, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT_AFFECTED_ROWS, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_add(pVnode->monitor.insertCounter, pSubmitRsp->affectedRows, sample_labels); } @@ -1725,14 +1751,14 @@ _exit: atomic_add_fetch_64(&pVnode->statis.nBatchInsertSuccess, 1); code = tdProcessRSmaSubmit(pVnode->pSma, ver, pSubmitReq, pReq, len); - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } else{ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Failed"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } @@ -1992,7 +2018,7 @@ static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pRe return 0; } -static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg) { int32_t code = 0; SDecoder *pCoder = &(SDecoder){0}; @@ -2038,14 +2064,14 @@ static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, in _err: /* if(code == TSDB_CODE_SUCCESS){ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } else{ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Failed"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } @@ -2119,6 +2145,98 @@ static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pR return 0; } +static int32_t vnodePreCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token) { + SSyncState syncState = syncGetState(pVnode->sync); + if (syncState.state != TAOS_SYNC_STATE_LEADER) { + terrno = TSDB_CODE_SYN_NOT_LEADER; + return -1; + } + + char token[TSDB_ARB_TOKEN_SIZE] = {0}; + if (vnodeGetArbToken(pVnode, token) != 0) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + if (strncmp(token, member0Token, TSDB_ARB_TOKEN_SIZE) != 0 && + strncmp(token, member1Token, TSDB_ARB_TOKEN_SIZE) != 0) { + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + return -1; + } + + terrno = TSDB_CODE_SUCCESS; + return 0; +} + +static int32_t vnodeCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token) { + int32_t code = vnodePreCheckAssignedLogSyncd(pVnode, member0Token, member1Token); + if (code != 0) { + return code; + } + + return syncGetAssignedLogSynced(pVnode->sync); +} + +static int32_t vnodeProcessArbCheckSyncReq(SVnode *pVnode, void *pReq, int32_t len, SRpcMsg *pRsp) { + int32_t code = 0; + + SVArbCheckSyncReq syncReq = {0}; + + if (tDeserializeSVArbCheckSyncReq(pReq, len, &syncReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + pRsp->msgType = TDMT_VND_ARB_CHECK_SYNC_RSP; + pRsp->code = TSDB_CODE_SUCCESS; + pRsp->pCont = NULL; + pRsp->contLen = 0; + + SVArbCheckSyncRsp syncRsp = {0}; + syncRsp.arbToken = syncReq.arbToken; + syncRsp.member0Token = syncReq.member0Token; + syncRsp.member1Token = syncReq.member1Token; + syncRsp.vgId = TD_VID(pVnode); + + (void)vnodeCheckAssignedLogSyncd(pVnode, syncReq.member0Token, syncReq.member1Token); + syncRsp.errCode = terrno; + + if (vnodeUpdateArbTerm(pVnode, syncReq.arbTerm) != 0) { + vError("vgId:%d, failed to update arb term", TD_VID(pVnode)); + code = -1; + goto _OVER; + } + + int32_t contLen = tSerializeSVArbCheckSyncRsp(NULL, 0, &syncRsp); + if (contLen <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = -1; + goto _OVER; + } + void *pHead = rpcMallocCont(contLen); + if (!pHead) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = -1; + goto _OVER; + } + + if (tSerializeSVArbCheckSyncRsp(pHead, contLen, &syncRsp) <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pHead); + code = -1; + goto _OVER; + } + + pRsp->pCont = pHead; + pRsp->contLen = contLen; + + terrno = TSDB_CODE_SUCCESS; + +_OVER: + tFreeSVArbCheckSyncReq(&syncReq); + return code; +} + #ifndef TD_ENTERPRISE int32_t vnodeProcessCompactVnodeReqImpl(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { return 0; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index f9f2ae6b21..63494a17b9 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -638,6 +638,14 @@ static void vnodeBecomeLeader(const SSyncFSM *pFsm) { } } +static void vnodeBecomeAssignedLeader(const SSyncFSM* pFsm) { + SVnode *pVnode = pFsm->data; + vDebug("vgId:%d, become assigned leader", pVnode->config.vgId); + if (pVnode->pTq) { + tqUpdateNodeStage(pVnode->pTq, true); + } +} + static bool vnodeApplyQueueEmpty(const SSyncFSM *pFsm) { SVnode *pVnode = pFsm->data; @@ -674,6 +682,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) { pFsm->FpApplyQueueEmptyCb = vnodeApplyQueueEmpty; pFsm->FpApplyQueueItems = vnodeApplyQueueItems; pFsm->FpBecomeLeaderCb = vnodeBecomeLeader; + pFsm->FpBecomeAssignedLeaderCb = vnodeBecomeAssignedLeader; pFsm->FpBecomeFollowerCb = vnodeBecomeFollower; pFsm->FpBecomeLearnerCb = vnodeBecomeLearner; pFsm->FpReConfigCb = NULL; diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 5280121f68..69a90f03ed 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -433,95 +433,113 @@ static bool sysTableIsCondOnOneTable(SNode* pCond, char* condTable) { return false; } -static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SStorageAPI* pAPI = &pTaskInfo->storageAPI; - +static SSDataBlock* doOptimizeTableNameFilter(SOperatorInfo* pOperator, SSDataBlock* dataBlock, char* dbname) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStorageAPI* pAPI = &pTaskInfo->storageAPI; SSysTableScanInfo* pInfo = pOperator->info; - if (pOperator->status == OP_EXEC_DONE) { + int32_t numOfRows = 0; + + char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(tableName, pInfo->req.filterTb); + + SMetaReader smrTable = {0}; + pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); + int32_t code = pAPI->metaReaderFn.getTableEntryByName(&smrTable, pInfo->req.filterTb); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly + pAPI->metaReaderFn.clearReader(&smrTable); + pInfo->loadInfo.totalRows = 0; return NULL; } - blockDataCleanup(pInfo->pRes); - int32_t numOfRows = 0; + if (smrTable.me.type == TSDB_SUPER_TABLE) { + pAPI->metaReaderFn.clearReader(&smrTable); + pInfo->loadInfo.totalRows = 0; + return NULL; + } - SSDataBlock* dataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_COLS); - blockDataEnsureCapacity(dataBlock, pOperator->resultInfo.capacity); + if (smrTable.me.type == TSDB_CHILD_TABLE) { + int64_t suid = smrTable.me.ctbEntry.suid; + pAPI->metaReaderFn.clearReader(&smrTable); + pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); + code = pAPI->metaReaderFn.getTableEntryByUid(&smrTable, suid); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly + pAPI->metaReaderFn.clearReader(&smrTable); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + } + char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + SSchemaWrapper* schemaRow = NULL; + if (smrTable.me.type == TSDB_SUPER_TABLE) { + schemaRow = &smrTable.me.stbEntry.schemaRow; + STR_TO_VARSTR(typeName, "CHILD_TABLE"); + } else if (smrTable.me.type == TSDB_NORMAL_TABLE) { + schemaRow = &smrTable.me.ntbEntry.schemaRow; + STR_TO_VARSTR(typeName, "NORMAL_TABLE"); + } + + sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, dataBlock, tableName, schemaRow, typeName); + pAPI->metaReaderFn.clearReader(&smrTable); + + if (numOfRows > 0) { + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + numOfRows = 0; + } + + pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; + setOperatorCompleted(pOperator); + + qDebug("get cols success, total rows:%" PRIu64 ", current:%" PRId64 " %s", pInfo->loadInfo.totalRows, + pInfo->pRes->info.rows, GET_TASKID(pTaskInfo)); + return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; +} + +int32_t doExtractDbName(char* dbname, SSysTableScanInfo* pInfo, SStorageAPI* pAPI) { + SName sn = {0}; const char* db = NULL; int32_t vgId = 0; pAPI->metaFn.getBasicInfo(pInfo->readHandle.vnode, &db, &vgId, NULL, NULL); - - SName sn = {0}; - char dbname[TSDB_DB_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; tNameFromString(&sn, db, T_NAME_ACCT | T_NAME_DB); tNameGetDbName(&sn, varDataVal(dbname)); varDataSetLen(dbname, strlen(varDataVal(dbname))); - // optimize when sql like where table_name='tablename' and xxx. - if (pInfo->req.filterTb[0]) { - char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - STR_TO_VARSTR(tableName, pInfo->req.filterTb); + return TSDB_CODE_SUCCESS; +} - SMetaReader smrTable = {0}; - pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); - int32_t code = pAPI->metaReaderFn.getTableEntryByName(&smrTable, pInfo->req.filterTb); - if (code != TSDB_CODE_SUCCESS) { - // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly - pAPI->metaReaderFn.clearReader(&smrTable); - blockDataDestroy(dataBlock); - pInfo->loadInfo.totalRows = 0; - return NULL; - } +static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStorageAPI* pAPI = &pTaskInfo->storageAPI; + SSysTableScanInfo* pInfo = pOperator->info; + int32_t numOfRows = 0; + int32_t ret = 0; + char dbname[TSDB_DB_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + SSDataBlock* pDataBlock = NULL; - if (smrTable.me.type == TSDB_SUPER_TABLE) { - pAPI->metaReaderFn.clearReader(&smrTable); - blockDataDestroy(dataBlock); - pInfo->loadInfo.totalRows = 0; - return NULL; - } - - if (smrTable.me.type == TSDB_CHILD_TABLE) { - int64_t suid = smrTable.me.ctbEntry.suid; - pAPI->metaReaderFn.clearReader(&smrTable); - pAPI->metaReaderFn.initReader(&smrTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); - code = pAPI->metaReaderFn.getTableEntryByUid(&smrTable, suid); - if (code != TSDB_CODE_SUCCESS) { - // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly - pAPI->metaReaderFn.clearReader(&smrTable); - blockDataDestroy(dataBlock); - pInfo->loadInfo.totalRows = 0; - return NULL; - } - } - - char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; - SSchemaWrapper* schemaRow = NULL; - if (smrTable.me.type == TSDB_SUPER_TABLE) { - schemaRow = &smrTable.me.stbEntry.schemaRow; - STR_TO_VARSTR(typeName, "CHILD_TABLE"); - } else if (smrTable.me.type == TSDB_NORMAL_TABLE) { - schemaRow = &smrTable.me.ntbEntry.schemaRow; - STR_TO_VARSTR(typeName, "NORMAL_TABLE"); - } - - sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, dataBlock, tableName, schemaRow, typeName); - pAPI->metaReaderFn.clearReader(&smrTable); - - if (numOfRows > 0) { - relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); - numOfRows = 0; - } - blockDataDestroy(dataBlock); - pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; - setOperatorCompleted(pOperator); - return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + blockDataCleanup(pInfo->pRes); + + pDataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_COLS); + blockDataEnsureCapacity(pDataBlock, pOperator->resultInfo.capacity); + doExtractDbName(dbname, pInfo, pAPI); + + // optimize when sql like where table_name='tablename' and xxx. + if (pInfo->req.filterTb[0]) { + SSDataBlock* p = doOptimizeTableNameFilter(pOperator, pDataBlock, dbname); + blockDataDestroy(pDataBlock); + return p; } - int32_t ret = 0; if (pInfo->pCur == NULL) { pInfo->pCur = pAPI->metaFn.openTableMetaCursor(pInfo->readHandle.vnode); + } else { + pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); } if (pInfo->pSchema == NULL) { @@ -532,26 +550,20 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { if (!pInfo->pCur || !pInfo->pSchema) { terrno = TSDB_CODE_OUT_OF_MEMORY; qError("sysTableScanUserCols failed since %s", terrstr(terrno)); - blockDataDestroy(dataBlock); + blockDataDestroy(pDataBlock); pInfo->loadInfo.totalRows = 0; return NULL; } - int32_t restore = pInfo->restore; - pInfo->restore = false; - - while (restore || ((ret = pAPI->metaFn.cursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0)) { - if (restore) { - restore = false; - } + while (((ret = pAPI->metaFn.cursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0)) { char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; SSchemaWrapper* schemaRow = NULL; if (pInfo->pCur->mr.me.type == TSDB_SUPER_TABLE) { - qDebug("sysTableScanUserCols cursor get super table"); + qDebug("sysTableScanUserCols cursor get super table, %s", GET_TASKID(pTaskInfo)); void* schema = taosHashGet(pInfo->pSchema, &pInfo->pCur->mr.me.uid, sizeof(int64_t)); if (schema == NULL) { SSchemaWrapper* schemaWrapper = tCloneSSchemaWrapper(&pInfo->pCur->mr.me.stbEntry.schemaRow); @@ -559,7 +571,8 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } continue; } else if (pInfo->pCur->mr.me.type == TSDB_CHILD_TABLE) { - qDebug("sysTableScanUserCols cursor get child table"); + qDebug("sysTableScanUserCols cursor get child table, %s", GET_TASKID(pTaskInfo)); + STR_TO_VARSTR(typeName, "CHILD_TABLE"); STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); int64_t suid = pInfo->pCur->mr.me.ctbEntry.suid; @@ -568,13 +581,14 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { schemaRow = *(SSchemaWrapper**)schema; } else { SMetaReader smrSuperTable = {0}; - pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, META_READER_LOCK, &pAPI->metaFn); + pAPI->metaReaderFn.initReader(&smrSuperTable, pInfo->readHandle.vnode, META_READER_NOLOCK, &pAPI->metaFn); int code = pAPI->metaReaderFn.getTableEntryByUid(&smrSuperTable, suid); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by pAPI->metaReaderFn.getTableEntryByName, therefore, return directly - qError("sysTableScanUserCols get meta by suid:%" PRId64 " error, code:%d", suid, code); + qError("sysTableScanUserCols get meta by suid:%" PRId64 " error, code:%d, %s", suid, code, GET_TASKID(pTaskInfo)); + pAPI->metaReaderFn.clearReader(&smrSuperTable); - blockDataDestroy(dataBlock); + blockDataDestroy(pDataBlock); pInfo->loadInfo.totalRows = 0; return NULL; } @@ -584,34 +598,35 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { pAPI->metaReaderFn.clearReader(&smrSuperTable); } } else if (pInfo->pCur->mr.me.type == TSDB_NORMAL_TABLE) { - qDebug("sysTableScanUserCols cursor get normal table"); + qDebug("sysTableScanUserCols cursor get normal table, %s", GET_TASKID(pTaskInfo)); schemaRow = &pInfo->pCur->mr.me.ntbEntry.schemaRow; STR_TO_VARSTR(typeName, "NORMAL_TABLE"); STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); } else { - qDebug("sysTableScanUserCols cursor get invalid table"); + qDebug("sysTableScanUserCols cursor get invalid table, %s", GET_TASKID(pTaskInfo)); continue; } if ((numOfRows + schemaRow->nCols) > pOperator->resultInfo.capacity) { - relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, pDataBlock, pOperator->exprSupp.pFilterInfo); numOfRows = 0; - pInfo->restore = true; if (pInfo->pRes->info.rows > 0) { + pAPI->metaFn.pauseTableMetaCursor(pInfo->pCur); break; } } else { - sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, dataBlock, tableName, schemaRow, typeName); + sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, pDataBlock, tableName, schemaRow, typeName); } } if (numOfRows > 0) { - relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + pAPI->metaFn.pauseTableMetaCursor(pInfo->pCur); + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, pDataBlock, pOperator->exprSupp.pFilterInfo); numOfRows = 0; } - blockDataDestroy(dataBlock); + blockDataDestroy(pDataBlock); if (ret != 0) { pAPI->metaFn.closeTableMetaCursor(pInfo->pCur); pInfo->pCur = NULL; @@ -619,8 +634,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; - qDebug("sysTableScanUserCols get cols success, rows:%" PRIu64, pInfo->loadInfo.totalRows); - + qDebug("get cols success, rows:%" PRIu64 " %s", pInfo->loadInfo.totalRows, GET_TASKID(pTaskInfo)); return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; } @@ -702,6 +716,8 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { int32_t ret = 0; if (pInfo->pCur == NULL) { pInfo->pCur = pAPI->metaFn.openTableMetaCursor(pInfo->readHandle.vnode); + } else { + pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); } bool blockFull = false; @@ -727,7 +743,6 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { } if ((smrSuperTable.me.stbEntry.schemaTag.nCols + numOfRows) > pOperator->resultInfo.capacity) { - pAPI->metaFn.cursorPrev(pInfo->pCur, TSDB_TABLE_MAX); blockFull = true; } else { sysTableUserTagsFillOneTableTags(pInfo, &smrSuperTable, &pInfo->pCur->mr, dbname, tableName, &numOfRows, @@ -741,6 +756,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { numOfRows = 0; if (pInfo->pRes->info.rows > 0) { + pAPI->metaFn.pauseTableMetaCursor(pInfo->pCur); break; } @@ -749,6 +765,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { } if (numOfRows > 0) { + pAPI->metaFn.pauseTableMetaCursor(pInfo->pCur); relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); numOfRows = 0; } @@ -1329,7 +1346,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) { firstMetaCursor = 1; } if (!firstMetaCursor) { - pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0); + pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 1); } blockDataCleanup(pInfo->pRes); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 3191fa4774..f000d87fdc 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -209,6 +209,8 @@ const char* nodesNodeName(ENodeType type) { return "ShowSnodesStmt"; case QUERY_NODE_SHOW_BNODES_STMT: return "ShowBnodesStmt"; + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return "ShowArbGroupsStmt"; case QUERY_NODE_SHOW_CLUSTER_STMT: return "ShowClusterStmt"; case QUERY_NODE_SHOW_DATABASES_STMT: @@ -266,7 +268,7 @@ const char* nodesNodeName(ENodeType type) { case QUERY_NODE_SHOW_COMPACTS_STMT: return "ShowCompactsStmt"; case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: - return "ShowCompactDetailsStmt"; + return "ShowCompactDetailsStmt"; case QUERY_NODE_SHOW_GRANTS_FULL_STMT: return "ShowGrantsFullStmt"; case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: @@ -3178,16 +3180,16 @@ static int32_t physiGroupCacheNodeToJson(const void* pObj, SJson* pJson) { int32_t code = physicPlanNodeToJson(pObj, pJson); if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGrpColsMayBeNull, pNode->grpColsMayBeNull); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGroupByUid, pNode->grpByUid); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGlobalGroup, pNode->globalGrp); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanBatchFetch, pNode->batchFetch); - } + } if (TSDB_CODE_SUCCESS == code) { code = nodeListToJson(pJson, jkGroupCachePhysiPlanGroupCols, pNode->pGroupCols); } @@ -6684,6 +6686,10 @@ static int32_t showQnodesStmtToJson(const void* pObj, SJson* pJson) { return sho static int32_t jsonToShowQnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } +static int32_t showArbGroupsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowArbGroupsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + static int32_t showClusterStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } static int32_t jsonToShowClusterStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } @@ -7209,6 +7215,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return showMnodesStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_QNODES_STMT: return showQnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return showArbGroupsStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_CLUSTER_STMT: return showClusterStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_DATABASES_STMT: @@ -7546,6 +7554,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToShowMnodesStmt(pJson, pObj); case QUERY_NODE_SHOW_QNODES_STMT: return jsonToShowQnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return jsonToShowArbGroupsStmt(pJson, pObj); case QUERY_NODE_SHOW_CLUSTER_STMT: return jsonToShowClusterStmt(pJson, pObj); case QUERY_NODE_SHOW_DATABASES_STMT: @@ -7610,7 +7620,7 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRestoreQnodeStmt(pJson, pObj); case QUERY_NODE_RESTORE_MNODE_STMT: return jsonToRestoreMnodeStmt(pJson, pObj); - case QUERY_NODE_RESTORE_VNODE_STMT: + case QUERY_NODE_RESTORE_VNODE_STMT: return jsonToRestoreVnodeStmt(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_SCAN: return jsonToLogicScanNode(pJson, pObj); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 1bdcda3ddf..7251db21b6 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -419,6 +419,7 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_QNODES_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: @@ -1072,6 +1073,7 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_QNODES_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: @@ -1363,7 +1365,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pPhyNode->pOnRight); nodesDestroyNode(pPhyNode->pFilterConditions); nodesDestroyList(pPhyNode->pTargets); - + nodesDestroyNode(pPhyNode->pPrimKeyCond); nodesDestroyNode(pPhyNode->pColEqCond); nodesDestroyNode(pPhyNode->pTagEqCond); @@ -1703,9 +1705,9 @@ void nodesListInsertListAfterPos(SNodeList* pTarget, SListCell* pPos, SNodeList* pSrc->pTail->pNext = pPos->pNext; pPos->pNext = pSrc->pHead; - + pTarget->length += pSrc->length; - nodesFree(pSrc); + nodesFree(pSrc); } SNode* nodesListGetNode(SNodeList* pList, int32_t index) { diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 7a609919da..6ad563ab62 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -196,7 +196,7 @@ SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind); SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type); SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, EOperatorType tableCondType); -SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName, EOperatorType tableCondType); +SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName, EOperatorType tableCondType); SNode* createShowCreateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); SNode* createShowAliveStmt(SAstCreateContext* pCxt, SNode* pDbName, ENodeType type); SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index d79aa87131..2cac8ee411 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -479,6 +479,7 @@ cmd ::= SHOW db_name_cond_opt(A) VGROUPS. cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } //cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +cmd ::= SHOW ARBGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, B, A, OP_TYPE_EQUAL); } cmd ::= SHOW INDEXES FROM db_name(B) NK_DOT table_name(A). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &B), createIdentifierValueNode(pCxt, &A), OP_TYPE_EQUAL); } @@ -530,7 +531,7 @@ table_kind_db_name_cond_opt(A) ::= db_name(C) NK_DOT. table_kind_db_name_cond_opt(A) ::= table_kind(B) db_name(C) NK_DOT. { A.kind = B; A.dbName = C; } %type table_kind { EShowKind } -%destructor table_kind { } +%destructor table_kind { } table_kind(A) ::= NORMAL. { A = SHOW_KIND_TABLES_NORMAL; } table_kind(A) ::= CHILD. { A = SHOW_KIND_TABLES_CHILD; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index daa939fb96..eee0eba78b 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -288,7 +288,7 @@ SNode* releaseRawExprNode(SAstCreateContext* pCxt, SNode* pNode) { } else if (pRawExpr->isPseudoColumn) { // all pseudo column are translate to function with same name strcpy(pExpr->userAlias, ((SFunctionNode*)pExpr)->functionName); - strcpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName); + strcpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName); } else { int32_t len = TMIN(sizeof(pExpr->aliasName) - 1, pRawExpr->n); @@ -1189,11 +1189,11 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr return select; } -SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags) { +SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags) { if (pStmt && QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { if (pCxt->pQueryCxt->biMode) { ((SSelectStmt*)pStmt)->tagScan = true; - } else { + } else { ((SSelectStmt*)pStmt)->tagScan = bSelectTags; } } @@ -1263,6 +1263,7 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { pOptions->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; pOptions->tablePrefix = TSDB_DEFAULT_HASH_PREFIX; pOptions->tableSuffix = TSDB_DEFAULT_HASH_SUFFIX; + pOptions->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; return (SNode*)pOptions; } @@ -1298,6 +1299,7 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) { pOptions->sstTrigger = -1; pOptions->tablePrefix = -1; pOptions->tableSuffix = -1; + pOptions->withArbitrator = -1; return (SNode*)pOptions; } @@ -1353,6 +1355,7 @@ static SNode* setDatabaseOptionImpl(SAstCreateContext* pCxt, SNode* pOptions, ED break; case DB_OPTION_REPLICA: pDbOptions->replica = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->withArbitrator = (pDbOptions->replica == 2); if (!alter) { updateWalOptionsDefault(pDbOptions); } @@ -1783,7 +1786,7 @@ SNode* createShowCompactsStmt(SAstCreateContext* pCxt, ENodeType type) { SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind) { if (pStmt == NULL) { return NULL; - } + } SShowStmt* pShow = (SShowStmt*)pStmt; pShow->showKind = showKind; return pStmt; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 5d268f7bda..f746304730 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -170,7 +170,7 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pEffectiveUser, pDb, pTable, authType, pCxt->pMetaCache); } -#endif +#endif if (TSDB_CODE_SUCCESS == code) { code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pDb, pCxt->pMetaCache); } @@ -459,6 +459,14 @@ static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* return TSDB_CODE_SUCCESS; } +static int32_t collectMetaKeyFromShowArbGroups(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_ARBGROUPS, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; +} + static int32_t collectMetaKeyFromShowCluster(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { if (pCxt->pParseCxt->enableSysInfo) { return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, @@ -668,7 +676,7 @@ static int32_t collectMetaKeyFromShowCreateView(SCollectMetaKeyCxt* pCxt, SShowC if (TSDB_CODE_SUCCESS == code) { code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache); } - + return code; } @@ -806,6 +814,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowSnodes(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_BNODES_STMT: return collectMetaKeyFromShowBnodes(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return collectMetaKeyFromShowArbGroups(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_CLUSTER_STMT: return collectMetaKeyFromShowCluster(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_DATABASES_STMT: diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index 4f523bf4f2..dd04a5c36c 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -41,7 +41,7 @@ static void setUserAuthInfo(SParseContext* pCxt, const char* pDbName, const char } else { snprintf(pAuth->user, sizeof(pAuth->user), "%s", pCxt->pUser); } - + if (NULL == pTabName) { tNameSetDbName(&pAuth->tbName, pCxt->acctId, pDbName, strlen(pDbName)); } else { @@ -173,7 +173,7 @@ static EDealRes authSelectImpl(SNode* pNode, void* pContext) { isView = true; } taosMemoryFree(pTableMeta); -#endif +#endif if (!isView) { pAuthCxt->errCode = checkAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, &pTagCond); if (TSDB_CODE_SUCCESS != pAuthCxt->errCode && NULL != pAuthCxt->pParseCxt->pEffectiveUser) { @@ -355,6 +355,7 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: return !pCxt->pParseCxt->enableSysInfo ? TSDB_CODE_PAR_PERMISSION_DENIED : TSDB_CODE_SUCCESS; case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_STABLES_STMT: diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index f0f84ebb29..77c63c38d8 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -969,7 +969,7 @@ static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt } _exit: - for (int32_t i = 0; i < TARRAY_SIZE(pTagVals); ++i) { + for (int32_t i = 0; i < taosArrayGetSize(pTagVals); ++i) { STagVal* p = (STagVal*)TARRAY_GET_ELEM(pTagVals, i); if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFreeClear(p->pData); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 7b82972093..3a2d200d31 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -306,6 +306,7 @@ static SKeyword keywordTable[] = { {"ALIVE", TK_ALIVE}, {"VARBINARY", TK_VARBINARY}, {"KEEP_TIME_OFFSET", TK_KEEP_TIME_OFFSET}, + {"ARBGROUPS", TK_ARBGROUPS}, }; // clang-format on diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a3f7c554bf..3d59146d13 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -100,6 +100,13 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { + .showType = QUERY_NODE_SHOW_ARBGROUPS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_ARBGROUPS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, { .showType = QUERY_NODE_SHOW_CLUSTER_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, @@ -263,7 +270,7 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .pTableName = TSDB_INS_TABLE_COMPACTS, .numOfShowCols = 1, .pShowCols = {"*"} - }, + }, { .showType = QUERY_NODE_SHOW_COMPACT_DETAILS_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, .pTableName = TSDB_INS_TABLE_COMPACT_DETAILS, @@ -380,7 +387,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac #endif int32_t code = TSDB_CODE_SUCCESS; - + if (pParCxt->async) { code = getViewMetaFromCache(pMetaCache, pName, pMeta); } else { @@ -390,7 +397,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac .mgmtEps = pParCxt->mgmtEpSet}; code = catalogGetViewMeta(pParCxt->pCatalog, &conn, pName, pMeta); } - + if (TSDB_CODE_SUCCESS != code && TSDB_CODE_PAR_TABLE_NOT_EXIST != code) { parserError("0x%" PRIx64 " catalogGetViewMeta error, code:%s, dbName:%s, viewName:%s", pParCxt->requestId, tstrerror(code), pName->dbname, pName->tname); @@ -401,7 +408,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac int32_t getTargetMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCache, const SName* pName, STableMeta** pMeta, bool couldBeView) { int32_t code = TSDB_CODE_SUCCESS; - + if (pParCxt->async) { code = getTableMetaFromCache(pMetaCache, pName, pMeta); #ifdef TD_ENTERPRISE @@ -420,7 +427,7 @@ int32_t getTargetMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCache, c .mgmtEps = pParCxt->mgmtEpSet}; code = catalogGetTableMeta(pParCxt->pCatalog, &conn, pName, pMeta); } - + if (TSDB_CODE_SUCCESS != code && TSDB_CODE_PAR_TABLE_NOT_EXIST != code) { parserError("0x%" PRIx64 " catalogGetTableMeta error, code:%s, dbName:%s, tbName:%s", pParCxt->requestId, tstrerror(code), pName->dbname, pName->tname); @@ -960,7 +967,7 @@ static void setColumnInfoByExpr(STempTableNode* pTable, SExprNode* pExpr, SColum assNode.pPlace = (SNode**)pColRef; assNode.pAssociationNode = (SNode*)*pColRef; taosArrayPush(pExpr->pAssociation, &assNode); - + strcpy(pCol->tableAlias, pTable->table.tableAlias); pCol->colId = isPrimaryKey(pTable, (SNode*)pExpr) ? PRIMARYKEY_TIMESTAMP_COL_ID : 0; strcpy(pCol->colName, pExpr->aliasName); @@ -1177,8 +1184,8 @@ static SNode* biMakeTbnameProjectAstNode(char* funcName, char* tableAlias) { if (valNode != NULL) { nodesListMakeAppend(&tbNameFunc->pParameterList, (SNode*)valNode); } - snprintf(tbNameFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), - (tableAlias)? "%s.tbname" : "%stbname", + snprintf(tbNameFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), + (tableAlias)? "%s.tbname" : "%stbname", (tableAlias)? tableAlias : ""); strncpy(tbNameFunc->node.aliasName, tbNameFunc->functionName, TSDB_COL_NAME_LEN); @@ -1190,13 +1197,13 @@ static SNode* biMakeTbnameProjectAstNode(char* funcName, char* tableAlias) { nodesListMakeAppend(&multiResFunc->pParameterList, (SNode*)tbNameFunc); if (tsKeepColumnName) { - snprintf(multiResFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), - (tableAlias)? "%s.tbname" : "%stbname", + snprintf(multiResFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), + (tableAlias)? "%s.tbname" : "%stbname", (tableAlias)? tableAlias : ""); strcpy(multiResFunc->node.aliasName, tbNameFunc->functionName); } else { - snprintf(multiResFunc->node.userAlias, sizeof(multiResFunc->node.userAlias), - tableAlias? "%s(%s.tbname)" : "%s(%stbname)", funcName, + snprintf(multiResFunc->node.userAlias, sizeof(multiResFunc->node.userAlias), + tableAlias? "%s(%s.tbname)" : "%s(%stbname)", funcName, tableAlias? tableAlias: ""); biMakeAliasNameInMD5(multiResFunc->node.userAlias, strlen(multiResFunc->node.userAlias), multiResFunc->node.aliasName); } @@ -1209,7 +1216,7 @@ static int32_t biRewriteSelectFuncParamStar(STranslateContext* pCxt, SSelectStmt SNodeList* pTbnameNodeList = nodesMakeList(); SFunctionNode* pFunc = (SFunctionNode*)pNode; - if (strcasecmp(pFunc->functionName, "last") == 0 || + if (strcasecmp(pFunc->functionName, "last") == 0 || strcasecmp(pFunc->functionName, "last_row") == 0 || strcasecmp(pFunc->functionName, "first") == 0) { SNodeList* pParams = pFunc->pParameterList; @@ -1259,8 +1266,8 @@ int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { size_t n = taosArrayGetSize(pTables); for (int32_t i = 0; i < n; ++i) { STableNode* pTable = taosArrayGetP(pTables, i); - if (nodeType(pTable) == QUERY_NODE_REAL_TABLE && - ((SRealTableNode*)pTable)->pMeta != NULL && + if (nodeType(pTable) == QUERY_NODE_REAL_TABLE && + ((SRealTableNode*)pTable)->pMeta != NULL && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { SNode* pTbnameNode = biMakeTbnameProjectAstNode(NULL, NULL); nodesListAppend(pTbnameNodeList, pTbnameNode); @@ -1273,9 +1280,9 @@ int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { char* pTableAlias = ((SColumnNode*)pNode)->tableAlias; STableNode* pTable = NULL; int32_t code = findTable(pCxt, pTableAlias, &pTable); - if (TSDB_CODE_SUCCESS == code && + if (TSDB_CODE_SUCCESS == code && nodeType(pTable) == QUERY_NODE_REAL_TABLE && - ((SRealTableNode*)pTable)->pMeta != NULL && + ((SRealTableNode*)pTable)->pMeta != NULL && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { SNode* pTbnameNode = biMakeTbnameProjectAstNode(NULL, pTableAlias); nodesListAppend(pTbnameNodeList, pTbnameNode); @@ -1967,7 +1974,7 @@ static int32_t translateInterpPseudoColumnFunc(STranslateContext* pCxt, SNode** return code; } translateColumn(pCxt, (SColumnNode**)ppNode); - return pCxt->errCode; + return pCxt->errCode; } return TSDB_CODE_SUCCESS; } @@ -2272,7 +2279,7 @@ static int32_t replacePsedudoColumnFuncWithColumn(STranslateContext* pCxt, SNode nodesDestroyNode(*ppNode); *ppNode = (SNode*)pCol; - return TSDB_CODE_SUCCESS; + return TSDB_CODE_SUCCESS; } } pCol->node.resType = pOldExpr->resType; @@ -2296,14 +2303,14 @@ static int32_t rewriteToColumnAndRetranslate(STranslateContext* pCxt, SNode** pp return generateSyntaxErrMsg(&pCxt->msgBuf, errCode); } else { return TSDB_CODE_SUCCESS; - } + } } static int32_t translateWindowPseudoColumnFunc(STranslateContext* pCxt, SNode** ppNode, bool* pRewriteToColumn) { SFunctionNode* pFunc = (SFunctionNode*)(*ppNode); if (!fmIsWindowPseudoColumnFunc(pFunc->funcId)) { return TSDB_CODE_SUCCESS; - } + } if (!isSelectStmt(pCxt->pCurrStmt)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WINDOW_PC); } @@ -2337,7 +2344,7 @@ static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SNode** pp pCxt->errCode = findTable(pCxt, pVal->literal, &pTable); if (TSDB_CODE_SUCCESS != pCxt->errCode || (NULL == pTable)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TBNAME); - } + } if (nodeType(pTable) != QUERY_NODE_REAL_TABLE) { *pRewriteToColumn = true; return rewriteToColumnAndRetranslate(pCxt, ppNode, TSDB_CODE_PAR_INVALID_TBNAME); @@ -2832,7 +2839,7 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) if (!pSelect->isDistinct) { nodesRewriteExprs(pSelect->pOrderByList, doCheckAggColCoexist, &cxt); } - if (((!cxt.existCol && 0 < pSelect->selectFuncNum) || (cxt.existCol && 1 == pSelect->selectFuncNum) ) + if (((!cxt.existCol && 0 < pSelect->selectFuncNum) || (cxt.existCol && 1 == pSelect->selectFuncNum) ) && !pSelect->hasOtherVectorFunc) { return rewriteColsToSelectValFunc(pCxt, pSelect); } @@ -4377,7 +4384,7 @@ static bool findEqCondTbNameInOperatorNode(STranslateContext* pCxt, SNode* pWher } else { code = findTable(pCxt, pTableAlias, &pTable); } - if (code == TSDB_CODE_SUCCESS && nodeType(pTable) == QUERY_NODE_REAL_TABLE && + if (code == TSDB_CODE_SUCCESS && nodeType(pTable) == QUERY_NODE_REAL_TABLE && ((SRealTableNode*)pTable)->pMeta && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { pInfo->pRealTable = (SRealTableNode*)pTable; return true; @@ -4413,7 +4420,7 @@ static void findEqualCondTbnameInLogicCondAnd(STranslateContext* pCxt, SNode* pW } } } - //TODO: logic cond + //TODO: logic cond } } @@ -4533,7 +4540,7 @@ static int32_t setEqualTbnameTableVgroups(STranslateContext* pCxt, SSelectStmt* pInfo->pRealTable->pVgroupList = vgsInfo; } else { taosMemoryFree(vgsInfo); - } + } } return TSDB_CODE_SUCCESS; } @@ -5111,7 +5118,7 @@ static int32_t translateInsertTable(STranslateContext* pCxt, SNode** pTable) { if (TSDB_CODE_SUCCESS == code && TSDB_CHILD_TABLE != ((SRealTableNode*)*pTable)->pMeta->tableType && TSDB_NORMAL_TABLE != ((SRealTableNode*)*pTable)->pMeta->tableType) { code = buildInvalidOperationMsg(&pCxt->msgBuf, "insert data into super table is not supported"); - + } return code; } @@ -5208,6 +5215,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS pReq->tsdbPageSize = pStmt->pOptions->tsdbPageSize; pReq->keepTimeOffset = pStmt->pOptions->keepTimeOffset; pReq->ignoreExist = pStmt->ignoreExists; + pReq->withArbitrator = pStmt->pOptions->withArbitrator; return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } @@ -5445,7 +5453,7 @@ static int32_t checkDbRetentionsOption(STranslateContext* pCxt, SNodeList* pRete "Invalid option retentions(freq/keep): %s should larger than %s", pKeep->literal, pFreq->literal); } - + if (NULL != pPrevFreq && pPrevFreq->datum.i >= pFreq->datum.i) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option retentions(freq): %s should larger than %s", pFreq->literal, @@ -5509,6 +5517,12 @@ static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbNa return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid duration value, should be keep2 >= keep1 >= keep0 >= 3 * duration"); } + + if ((pOptions->replica == 2) ^ (pOptions->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, + "Invalid database option, with_arbitrator should be used with replica 2"); + } + return TSDB_CODE_SUCCESS; } @@ -5561,7 +5575,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName TSDB_MAX_TSDB_PAGESIZE); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbEnumOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); + code = checkDbRangeOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); } if (TSDB_CODE_SUCCESS == code) { code = checkDbStrictOption(pCxt, pOptions); @@ -5600,6 +5614,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "sstTrigger", pOptions->sstTrigger, TSDB_MIN_STT_TRIGGER, TSDB_MAX_STT_TRIGGER); } + if (TSDB_CODE_SUCCESS == code) { + code = checkDbEnumOption(pCxt, "withArbitrator", pOptions->withArbitrator, TSDB_MIN_DB_WITH_ARBITRATOR, + TSDB_MAX_DB_WITH_ARBITRATOR); + } if (TSDB_CODE_SUCCESS == code) { code = checkDbTbPrefixSuffixOptions(pCxt, pOptions->tablePrefix, pOptions->tableSuffix); } @@ -5812,6 +5830,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt, pReq->minRows = pStmt->pOptions->minRowsPerBlock; pReq->walRetentionPeriod = pStmt->pOptions->walRetentionPeriod; pReq->walRetentionSize = pStmt->pOptions->walRetentionSize; + pReq->withArbitrator = pStmt->pOptions->withArbitrator; return; } @@ -7566,7 +7585,7 @@ static int32_t translateDescribe(STranslateContext* pCxt, SDescribeStmt* pStmt) taosMemoryFree(res.schemaRes.pSchema); } } -#endif +#endif return code; } @@ -7667,8 +7686,8 @@ static int32_t checkCreateStream(STranslateContext* pCxt, SCreateStreamStmt* pSt if (TSDB_VIEW_TABLE == tableType) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, "Unsupported stream query"); } -#endif - +#endif + return TSDB_CODE_SUCCESS; } @@ -8671,7 +8690,7 @@ static int32_t translateCreateView(STranslateContext* pCxt, SCreateViewStmt* pSt tNameGetFullDbName(&name, dbFName); int32_t code = validateCreateView(pCxt, pStmt); - if (TSDB_CODE_SUCCESS == code) { + if (TSDB_CODE_SUCCESS == code) { code = (*pCxt->pParseCxt->parseSqlFp)(pCxt->pParseCxt->parseSqlParam, pStmt->dbName, pStmt->pQuerySql, false, NULL, &res); } if (TSDB_CODE_SUCCESS == code) { @@ -8694,7 +8713,7 @@ static int32_t translateCreateView(STranslateContext* pCxt, SCreateViewStmt* pSt if (TSDB_CODE_SUCCESS == code) { code = buildCmdMsg(pCxt, TDMT_MND_CREATE_VIEW, (FSerializeFunc)tSerializeSCMCreateViewReq, &pStmt->createReq); } - + tFreeSCMCreateViewReq(&pStmt->createReq); return code; } @@ -8722,7 +8741,7 @@ static int32_t translateDropView(STranslateContext* pCxt, SDropViewStmt* pStmt) if (TSDB_CODE_SUCCESS != code) { return code; } - + return buildCmdMsg(pCxt, TDMT_MND_DROP_VIEW, (FSerializeFunc)tSerializeSCMDropViewReq, &dropReq); } @@ -8915,7 +8934,7 @@ static int32_t translateRevoke(STranslateContext* pCxt, SRevokeStmt* pStmt) { taosMemoryFree(pTableMeta); } #endif - + strcpy(req.user, pStmt->userName); sprintf(req.objname, "%d.%s", pCxt->pParseCxt->acctId, pStmt->objName); sprintf(req.tabName, "%s", pStmt->tabName); @@ -9024,7 +9043,7 @@ static int32_t translateShowCreateTable(STranslateContext* pCxt, SShowCreateTabl static int32_t translateShowCreateView(STranslateContext* pCxt, SShowCreateViewStmt* pStmt) { #ifndef TD_ENTERPRISE return TSDB_CODE_OPS_NOT_SUPPORT; -#else +#else SName name; toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, &name); return getViewMetaFromMetaCache(pCxt, &name, (SViewMeta**)&pStmt->pViewMeta); @@ -9439,7 +9458,7 @@ int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pS case QUERY_NODE_SHOW_VARIABLES_STMT: return extractShowVariablesResultSchema(numOfCols, pSchema); case QUERY_NODE_COMPACT_DATABASE_STMT: - return extractCompactDbResultSchema(numOfCols, pSchema); + return extractCompactDbResultSchema(numOfCols, pSchema); default: break; } @@ -10926,7 +10945,7 @@ static int32_t rewriteShowCompactDetailsStmt(STranslateContext* pCxt, SQuery* pQ nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = (SNode*)pStmt; } - return code; + return code; } static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { @@ -10960,6 +10979,7 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: code = rewriteShow(pCxt, pQuery); break; case QUERY_NODE_SHOW_VGROUPS_STMT: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 426164aada..326168b5c1 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,29 +104,29 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 517 +#define YYNOCODE 518 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SShowTablesOption yy91; - EShowKind yy101; - int32_t yy134; - EFillMode yy206; - SDataType yy224; - ENullOrder yy345; - int64_t yy525; - SNodeList* yy552; - bool yy559; - EOrder yy576; - STokenPair yy665; - SNode* yy718; - EOperatorType yy810; - int8_t yy883; - SAlterOption yy959; - SToken yy965; - EJoinType yy992; + STokenPair yy21; + int32_t yy396; + SNodeList* yy404; + EFillMode yy466; + SDataType yy504; + SAlterOption yy529; + ENullOrder yy669; + EJoinType yy680; + SToken yy701; + EShowKind yy705; + bool yy733; + EOperatorType yy884; + SNode* yy896; + int8_t yy915; + EOrder yy918; + int64_t yy949; + SShowTablesOption yy989; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -142,18 +142,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 861 -#define YYNRULE 671 -#define YYNRULE_WITH_ACTION 671 -#define YYNTOKEN 354 -#define YY_MAX_SHIFT 860 -#define YY_MIN_SHIFTREDUCE 1283 -#define YY_MAX_SHIFTREDUCE 1953 -#define YY_ERROR_ACTION 1954 -#define YY_ACCEPT_ACTION 1955 -#define YY_NO_ACTION 1956 -#define YY_MIN_REDUCE 1957 -#define YY_MAX_REDUCE 2627 +#define YYNSTATE 862 +#define YYNRULE 672 +#define YYNRULE_WITH_ACTION 672 +#define YYNTOKEN 355 +#define YY_MAX_SHIFT 861 +#define YY_MIN_SHIFTREDUCE 1284 +#define YY_MAX_SHIFTREDUCE 1955 +#define YY_ERROR_ACTION 1956 +#define YY_ACCEPT_ACTION 1957 +#define YY_NO_ACTION 1958 +#define YY_MIN_REDUCE 1959 +#define YY_MAX_REDUCE 2630 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -220,866 +220,900 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2994) +#define YY_ACTTAB_COUNT (3163) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2286, 573, 2136, 581, 574, 2000, 574, 2000, 2219, 665, - /* 10 */ 37, 310, 47, 45, 1875, 422, 590, 33, 2283, 747, - /* 20 */ 419, 1958, 1715, 40, 39, 722, 147, 46, 44, 43, - /* 30 */ 42, 41, 2195, 2196, 2138, 1801, 2043, 1713, 2286, 434, - /* 40 */ 433, 2603, 128, 1740, 2598, 127, 126, 125, 124, 123, - /* 50 */ 122, 121, 120, 119, 40, 39, 2284, 747, 46, 44, - /* 60 */ 43, 42, 41, 2602, 1722, 1796, 1744, 2599, 2601, 759, - /* 70 */ 1744, 19, 591, 2279, 1955, 40, 39, 185, 1721, 46, - /* 80 */ 44, 43, 42, 41, 583, 2325, 175, 128, 1969, 425, - /* 90 */ 127, 126, 125, 124, 123, 122, 121, 120, 119, 2365, - /* 100 */ 764, 2267, 430, 481, 857, 2194, 2196, 15, 1879, 832, - /* 110 */ 831, 830, 829, 437, 1740, 828, 827, 152, 822, 821, - /* 120 */ 820, 819, 818, 817, 816, 151, 810, 809, 808, 436, - /* 130 */ 435, 805, 804, 803, 184, 183, 802, 302, 2525, 721, - /* 140 */ 815, 139, 720, 2108, 2598, 1803, 1804, 2532, 540, 538, - /* 150 */ 681, 370, 173, 2598, 440, 218, 50, 344, 2603, 439, - /* 160 */ 239, 2598, 709, 204, 576, 458, 2008, 2599, 711, 519, - /* 170 */ 518, 2604, 204, 2529, 342, 75, 2599, 711, 74, 2201, - /* 180 */ 2602, 66, 1775, 1785, 2599, 2600, 388, 759, 371, 1802, - /* 190 */ 1805, 40, 39, 1323, 2199, 46, 44, 43, 42, 41, - /* 200 */ 237, 555, 553, 550, 1716, 681, 1714, 759, 2598, 1980, - /* 210 */ 40, 39, 1330, 700, 46, 44, 43, 42, 41, 46, - /* 220 */ 44, 43, 42, 41, 474, 664, 2604, 204, 705, 473, - /* 230 */ 200, 2599, 711, 1725, 195, 1325, 1328, 1329, 1719, 1720, - /* 240 */ 1772, 62, 1774, 1777, 1778, 1779, 1780, 1781, 1782, 1783, - /* 250 */ 1784, 738, 762, 761, 1795, 1797, 1798, 1799, 1800, 2, - /* 260 */ 47, 45, 2392, 1950, 174, 368, 710, 1738, 419, 2598, - /* 270 */ 1715, 1740, 2086, 380, 524, 681, 1776, 543, 2598, 760, - /* 280 */ 2147, 63, 542, 1801, 62, 1713, 1745, 709, 204, 812, - /* 290 */ 1745, 1919, 2599, 711, 50, 462, 2604, 204, 504, 209, - /* 300 */ 544, 2599, 711, 197, 2603, 369, 506, 706, 701, 694, - /* 310 */ 690, 490, 2262, 1796, 1957, 2188, 484, 1830, 2124, 19, - /* 320 */ 1430, 1743, 464, 460, 589, 306, 1721, 578, 722, 147, - /* 330 */ 85, 84, 477, 575, 1773, 217, 760, 2147, 137, 136, - /* 340 */ 135, 134, 133, 132, 131, 130, 129, 662, 469, 467, - /* 350 */ 1743, 224, 857, 391, 814, 15, 138, 1488, 534, 367, - /* 360 */ 220, 1432, 456, 616, 492, 453, 449, 445, 442, 470, - /* 370 */ 1949, 760, 2147, 1479, 789, 788, 787, 1483, 786, 1485, - /* 380 */ 1486, 785, 782, 1831, 1494, 779, 1496, 1497, 776, 773, - /* 390 */ 770, 55, 91, 1803, 1804, 90, 2273, 2252, 275, 531, - /* 400 */ 530, 529, 528, 523, 522, 521, 520, 374, 593, 1943, - /* 410 */ 306, 510, 509, 508, 507, 501, 500, 499, 12, 494, - /* 420 */ 493, 389, 229, 760, 2147, 485, 1582, 1583, 1908, 801, - /* 430 */ 1775, 1785, 1601, 1594, 1595, 1352, 1353, 1802, 1805, 724, - /* 440 */ 202, 2525, 2526, 138, 145, 2530, 533, 228, 1772, 2201, - /* 450 */ 621, 1740, 1716, 306, 1714, 2046, 799, 162, 161, 796, - /* 460 */ 795, 794, 159, 89, 729, 36, 417, 1825, 1826, 1827, - /* 470 */ 1828, 1829, 1833, 1834, 1835, 1836, 1663, 1664, 697, 696, - /* 480 */ 1906, 1907, 1909, 1910, 1911, 304, 1719, 1720, 1772, 185, - /* 490 */ 1774, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 738, - /* 500 */ 762, 761, 1795, 1797, 1798, 1799, 1800, 2, 12, 47, - /* 510 */ 45, 390, 2385, 2266, 304, 426, 274, 419, 1721, 1715, - /* 520 */ 273, 2386, 722, 147, 12, 653, 10, 241, 635, 634, - /* 530 */ 633, 576, 1801, 2008, 1713, 625, 144, 629, 62, 642, - /* 540 */ 651, 628, 649, 271, 270, 2366, 627, 632, 398, 397, - /* 550 */ 148, 62, 626, 2488, 654, 622, 1330, 43, 42, 41, - /* 560 */ 51, 2426, 1796, 1811, 635, 634, 633, 425, 19, 1740, - /* 570 */ 272, 625, 144, 629, 725, 1721, 425, 628, 764, 1832, - /* 580 */ 1328, 1329, 627, 632, 398, 397, 645, 764, 626, 99, - /* 590 */ 792, 622, 377, 639, 637, 403, 681, 655, 96, 2598, - /* 600 */ 269, 857, 2444, 2402, 15, 40, 39, 2426, 1741, 46, - /* 610 */ 44, 43, 42, 41, 2392, 392, 742, 2604, 204, 731, - /* 620 */ 743, 2489, 2599, 711, 2142, 40, 39, 2406, 2402, 46, - /* 630 */ 44, 43, 42, 41, 203, 2525, 2526, 2235, 145, 2530, - /* 640 */ 1872, 71, 1803, 1804, 70, 570, 496, 2262, 2444, 1332, - /* 650 */ 29, 1695, 2406, 1979, 568, 1739, 2425, 564, 560, 2463, - /* 660 */ 2392, 34, 742, 115, 2427, 746, 2429, 2430, 741, 107, - /* 670 */ 764, 1837, 2408, 2410, 416, 187, 714, 2517, 62, 1775, - /* 680 */ 1785, 415, 2513, 764, 40, 39, 1802, 1805, 46, 44, - /* 690 */ 43, 42, 41, 665, 2140, 222, 206, 2408, 2411, 631, - /* 700 */ 630, 1716, 2425, 1714, 2547, 2463, 2392, 306, 764, 115, - /* 710 */ 2427, 746, 2429, 2430, 741, 2201, 764, 2201, 172, 149, - /* 720 */ 306, 156, 2488, 2517, 404, 1920, 2150, 415, 2513, 306, - /* 730 */ 755, 1776, 2199, 1523, 1524, 1719, 1720, 1772, 2123, 1774, - /* 740 */ 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 738, 762, - /* 750 */ 761, 1795, 1797, 1798, 1799, 1800, 2, 47, 45, 1806, - /* 760 */ 2426, 1694, 1715, 760, 2147, 419, 704, 1715, 667, 2325, - /* 770 */ 722, 147, 793, 725, 472, 2192, 471, 1713, 2122, 1349, - /* 780 */ 1801, 1348, 1713, 478, 1891, 35, 329, 760, 2147, 1773, - /* 790 */ 2426, 40, 39, 160, 2444, 46, 44, 43, 42, 41, - /* 800 */ 517, 2444, 2201, 743, 516, 2010, 470, 479, 801, 414, - /* 810 */ 1796, 2132, 515, 2392, 1350, 742, 2532, 2199, 1721, 1978, - /* 820 */ 1698, 760, 2147, 1721, 799, 162, 161, 796, 795, 794, - /* 830 */ 159, 2444, 40, 39, 14, 13, 46, 44, 43, 42, - /* 840 */ 41, 498, 2528, 2392, 857, 742, 2201, 306, 1740, 857, - /* 850 */ 1701, 1704, 48, 424, 1349, 2425, 1348, 703, 2463, 1385, - /* 860 */ 2426, 2199, 115, 2427, 746, 2429, 2430, 741, 54, 764, - /* 870 */ 1977, 143, 2392, 743, 187, 2555, 2517, 2134, 760, 2147, - /* 880 */ 415, 2513, 205, 2525, 2526, 2425, 145, 2530, 2463, 1350, - /* 890 */ 1803, 1804, 115, 2427, 746, 2429, 2430, 741, 511, 764, - /* 900 */ 1386, 2444, 797, 2548, 2618, 2192, 2517, 314, 315, 1744, - /* 910 */ 415, 2513, 313, 2392, 1871, 742, 799, 162, 161, 796, - /* 920 */ 795, 794, 159, 2392, 526, 2262, 710, 1775, 1785, 2598, - /* 930 */ 1697, 612, 611, 1976, 1802, 1805, 2130, 760, 2147, 760, - /* 940 */ 2147, 1844, 1744, 715, 1716, 2532, 1714, 709, 204, 1716, - /* 950 */ 791, 1714, 2599, 711, 2334, 2425, 1741, 512, 2463, 513, - /* 960 */ 1700, 1703, 115, 2427, 746, 2429, 2430, 741, 2353, 764, - /* 970 */ 660, 2527, 666, 227, 2618, 733, 2517, 2489, 1719, 1720, - /* 980 */ 415, 2513, 1740, 1719, 1720, 1772, 2392, 1774, 1777, 1778, - /* 990 */ 1779, 1780, 1781, 1782, 1783, 1784, 738, 762, 761, 1795, - /* 1000 */ 1797, 1798, 1799, 1800, 2, 47, 45, 1442, 171, 276, - /* 1010 */ 1776, 760, 2147, 419, 2426, 1715, 2602, 428, 614, 613, - /* 1020 */ 717, 681, 1441, 681, 2598, 169, 2598, 743, 1801, 2568, - /* 1030 */ 1713, 592, 405, 2149, 760, 2147, 257, 282, 2426, 96, - /* 1040 */ 2199, 9, 2604, 204, 2604, 204, 1975, 2599, 711, 2599, - /* 1050 */ 711, 743, 180, 692, 2144, 2444, 760, 2147, 1796, 680, - /* 1060 */ 113, 610, 606, 602, 598, 2143, 256, 2392, 1773, 742, - /* 1070 */ 423, 1721, 760, 2147, 760, 2147, 277, 150, 172, 2444, - /* 1080 */ 2245, 1614, 1615, 760, 2147, 2139, 2149, 826, 824, 545, - /* 1090 */ 737, 2392, 285, 742, 728, 760, 2147, 857, 1446, 2392, - /* 1100 */ 48, 1985, 852, 318, 760, 2147, 199, 97, 798, 2425, - /* 1110 */ 254, 2192, 2463, 1445, 2426, 757, 115, 2427, 746, 2429, - /* 1120 */ 2430, 741, 488, 764, 758, 1613, 1616, 740, 2618, 1745, - /* 1130 */ 2517, 396, 395, 2425, 415, 2513, 2463, 77, 1803, 1804, - /* 1140 */ 115, 2427, 746, 2429, 2430, 741, 2201, 764, 760, 2147, - /* 1150 */ 736, 1900, 2618, 429, 2517, 2444, 428, 431, 415, 2513, - /* 1160 */ 338, 2199, 1745, 2178, 172, 172, 1901, 2392, 325, 742, - /* 1170 */ 760, 2147, 2149, 2149, 2201, 1775, 1785, 620, 244, 100, - /* 1180 */ 547, 619, 1802, 1805, 2537, 1864, 198, 253, 246, 2200, - /* 1190 */ 432, 88, 2087, 60, 251, 587, 3, 1716, 211, 1714, - /* 1200 */ 1970, 678, 1773, 394, 393, 1974, 618, 1899, 53, 2425, - /* 1210 */ 1642, 1973, 2463, 243, 1972, 726, 360, 2427, 746, 2429, - /* 1220 */ 2430, 741, 739, 764, 730, 2482, 2125, 1971, 1968, 1967, - /* 1230 */ 620, 1719, 1720, 1772, 619, 1774, 1777, 1778, 1779, 1780, - /* 1240 */ 1781, 1782, 1783, 1784, 738, 762, 761, 1795, 1797, 1798, - /* 1250 */ 1799, 1800, 2, 47, 45, 2426, 1966, 262, 2392, 153, - /* 1260 */ 260, 419, 1965, 1715, 2392, 1964, 681, 2392, 743, 2598, - /* 1270 */ 2591, 1963, 2356, 1962, 1864, 1961, 1801, 1960, 1713, 140, - /* 1280 */ 2392, 2392, 2392, 623, 2561, 286, 2426, 2604, 204, 718, - /* 1290 */ 624, 87, 2599, 711, 264, 266, 2444, 263, 265, 743, - /* 1300 */ 268, 2536, 657, 267, 656, 299, 1796, 1427, 2392, 2392, - /* 1310 */ 742, 713, 434, 433, 1425, 2392, 2030, 1822, 2392, 1721, - /* 1320 */ 2028, 2019, 1729, 447, 2392, 2017, 2392, 2444, 2392, 101, - /* 1330 */ 2392, 1952, 1953, 698, 160, 1801, 160, 1722, 636, 2392, - /* 1340 */ 112, 742, 638, 640, 688, 857, 49, 643, 15, 109, - /* 1350 */ 2425, 324, 323, 2463, 2413, 2426, 1724, 115, 2427, 746, - /* 1360 */ 2429, 2430, 741, 49, 764, 1796, 160, 142, 743, 2618, - /* 1370 */ 806, 2517, 1723, 188, 293, 415, 2513, 64, 1721, 2445, - /* 1380 */ 49, 2425, 2084, 2083, 2463, 2001, 1803, 1804, 115, 2427, - /* 1390 */ 746, 2429, 2430, 741, 1404, 764, 2444, 14, 13, 2271, - /* 1400 */ 2618, 807, 2517, 49, 735, 2551, 415, 2513, 2392, 1658, - /* 1410 */ 742, 1661, 2415, 2426, 695, 410, 702, 373, 372, 1895, - /* 1420 */ 749, 1905, 406, 1775, 1785, 1402, 743, 1705, 438, 2272, - /* 1430 */ 1802, 1805, 312, 2007, 76, 2189, 674, 158, 1904, 2552, - /* 1440 */ 1801, 727, 1693, 723, 2562, 1716, 160, 1714, 291, 2011, - /* 1450 */ 2425, 73, 1838, 2463, 2444, 1786, 301, 115, 2427, 746, - /* 1460 */ 2429, 2430, 741, 298, 764, 768, 2392, 305, 742, 2492, - /* 1470 */ 1796, 2517, 158, 2109, 160, 415, 2513, 5, 1611, 1719, - /* 1480 */ 1720, 1772, 441, 1774, 1777, 1778, 1779, 1780, 1781, 1782, - /* 1490 */ 1783, 1784, 738, 762, 761, 1795, 1797, 1798, 1799, 1800, - /* 1500 */ 2, 850, 141, 158, 1730, 446, 1725, 316, 2425, 752, - /* 1510 */ 2426, 2463, 320, 386, 454, 115, 2427, 746, 2429, 2430, - /* 1520 */ 741, 1472, 764, 743, 455, 1727, 337, 2490, 1748, 2517, - /* 1530 */ 466, 465, 212, 415, 2513, 213, 468, 215, 1733, 1735, - /* 1540 */ 1501, 1726, 332, 1635, 1738, 482, 1739, 1505, 489, 1512, - /* 1550 */ 226, 2444, 762, 761, 1795, 1797, 1798, 1799, 1800, 491, - /* 1560 */ 497, 495, 536, 2392, 502, 742, 514, 532, 527, 525, - /* 1570 */ 2264, 535, 537, 548, 549, 231, 546, 1510, 163, 232, - /* 1580 */ 551, 234, 552, 554, 556, 1746, 571, 4, 572, 579, - /* 1590 */ 582, 2426, 1741, 584, 580, 242, 93, 245, 1747, 1749, - /* 1600 */ 585, 586, 588, 248, 743, 2425, 1750, 594, 2463, 1706, - /* 1610 */ 250, 1696, 115, 2427, 746, 2429, 2430, 741, 94, 764, - /* 1620 */ 95, 2280, 255, 615, 732, 117, 2517, 646, 617, 647, - /* 1630 */ 415, 2513, 2444, 2137, 259, 2133, 364, 261, 659, 661, - /* 1640 */ 98, 1699, 1702, 1707, 2392, 165, 742, 166, 2135, 2131, - /* 1650 */ 167, 168, 154, 2343, 333, 2340, 278, 762, 761, 1795, - /* 1660 */ 1797, 1798, 1799, 1800, 2426, 2339, 1742, 669, 2326, 668, - /* 1670 */ 673, 283, 685, 676, 699, 2567, 750, 743, 2566, 8, - /* 1680 */ 708, 292, 288, 179, 411, 684, 2425, 290, 686, 2463, - /* 1690 */ 295, 670, 2539, 116, 2427, 746, 2429, 2430, 741, 281, - /* 1700 */ 764, 675, 294, 2426, 296, 2444, 683, 2517, 297, 719, - /* 1710 */ 2597, 2516, 2513, 716, 1743, 300, 743, 2392, 1864, 742, - /* 1720 */ 146, 2621, 2533, 2426, 1869, 1867, 191, 307, 155, 61, - /* 1730 */ 334, 753, 748, 2294, 2293, 157, 743, 2292, 335, 421, - /* 1740 */ 106, 2498, 2426, 336, 2444, 2148, 2384, 2383, 108, 327, - /* 1750 */ 754, 1, 207, 2193, 1307, 743, 2392, 854, 742, 2425, - /* 1760 */ 766, 339, 2463, 851, 2444, 164, 116, 2427, 746, 2429, - /* 1770 */ 2430, 741, 856, 764, 384, 363, 2392, 343, 742, 2364, - /* 1780 */ 2517, 2426, 385, 2444, 734, 2513, 52, 351, 341, 362, - /* 1790 */ 2363, 2362, 352, 82, 743, 2392, 2357, 742, 744, 443, - /* 1800 */ 444, 2463, 1686, 1687, 210, 116, 2427, 746, 2429, 2430, - /* 1810 */ 741, 448, 764, 2355, 450, 451, 452, 1685, 2425, 2517, - /* 1820 */ 2426, 2463, 2444, 379, 2513, 176, 2427, 746, 2429, 2430, - /* 1830 */ 741, 2354, 764, 743, 2392, 2352, 742, 2425, 387, 2426, - /* 1840 */ 2463, 457, 2351, 459, 177, 2427, 746, 2429, 2430, 741, - /* 1850 */ 2350, 764, 743, 2349, 461, 463, 1674, 2330, 2329, 214, - /* 1860 */ 216, 2444, 83, 1638, 2426, 1637, 2307, 682, 2558, 2306, - /* 1870 */ 2305, 475, 476, 2392, 2304, 742, 2425, 743, 2254, 2463, - /* 1880 */ 2444, 2303, 480, 116, 2427, 746, 2429, 2430, 741, 1581, - /* 1890 */ 764, 2251, 2392, 483, 742, 2250, 2244, 2517, 712, 2619, - /* 1900 */ 486, 2241, 2514, 487, 219, 2444, 2240, 86, 2239, 2238, - /* 1910 */ 2243, 2242, 2237, 221, 408, 2425, 223, 2392, 2463, 742, - /* 1920 */ 2236, 2234, 176, 2427, 746, 2429, 2430, 741, 2233, 764, - /* 1930 */ 2232, 503, 2231, 2229, 2425, 505, 2228, 2463, 225, 409, - /* 1940 */ 2227, 361, 2427, 746, 2429, 2430, 741, 2226, 764, 2249, - /* 1950 */ 2225, 2224, 2223, 2247, 2230, 2222, 2221, 2220, 2218, 2425, - /* 1960 */ 2217, 2216, 2463, 2426, 2215, 2559, 361, 2427, 746, 2429, - /* 1970 */ 2430, 741, 2214, 764, 2213, 2212, 743, 2211, 2210, 92, - /* 1980 */ 2209, 2248, 2426, 2246, 2208, 2207, 2206, 1587, 230, 2205, - /* 1990 */ 539, 2204, 541, 2203, 2202, 743, 375, 2049, 1443, 2426, - /* 2000 */ 233, 1447, 2048, 1439, 2444, 2047, 235, 236, 2045, 376, - /* 2010 */ 2042, 559, 740, 558, 2041, 563, 2392, 2034, 742, 557, - /* 2020 */ 2021, 2426, 562, 2444, 561, 565, 1996, 1995, 186, 569, - /* 2030 */ 1331, 2328, 2324, 2314, 743, 2392, 2302, 742, 249, 2301, - /* 2040 */ 2444, 566, 567, 238, 2278, 79, 2126, 2044, 2412, 240, - /* 2050 */ 196, 80, 2392, 577, 742, 2040, 252, 247, 2425, 595, - /* 2060 */ 597, 2463, 2444, 596, 2038, 354, 2427, 746, 2429, 2430, - /* 2070 */ 741, 599, 764, 2036, 2392, 600, 742, 2425, 603, 601, - /* 2080 */ 2463, 604, 605, 1378, 177, 2427, 746, 2429, 2430, 741, - /* 2090 */ 2033, 764, 609, 607, 2425, 2016, 418, 2463, 2014, 608, - /* 2100 */ 2426, 360, 2427, 746, 2429, 2430, 741, 2015, 764, 2013, - /* 2110 */ 2483, 707, 1992, 743, 2128, 1517, 2425, 1429, 663, 2463, - /* 2120 */ 2127, 1516, 1428, 361, 2427, 746, 2429, 2430, 741, 1426, - /* 2130 */ 764, 1424, 2031, 1423, 72, 823, 860, 1422, 258, 2620, - /* 2140 */ 1421, 2444, 1420, 825, 1415, 1417, 399, 2029, 1416, 400, - /* 2150 */ 1414, 2020, 331, 2392, 641, 742, 401, 2018, 402, 2426, - /* 2160 */ 644, 1991, 1990, 1989, 1988, 648, 650, 1987, 194, 118, - /* 2170 */ 652, 1672, 743, 28, 1668, 420, 2426, 848, 844, 840, - /* 2180 */ 836, 1670, 328, 1667, 2327, 2323, 67, 280, 1646, 743, - /* 2190 */ 1644, 2313, 671, 2300, 2299, 2425, 17, 1922, 2463, 2603, - /* 2200 */ 2444, 20, 361, 2427, 746, 2429, 2430, 741, 687, 764, - /* 2210 */ 407, 30, 2392, 56, 742, 284, 21, 2444, 23, 6, - /* 2220 */ 691, 201, 57, 114, 1896, 287, 321, 672, 689, 2392, - /* 2230 */ 170, 742, 1648, 1623, 693, 2426, 677, 1622, 7, 22, - /* 2240 */ 190, 289, 679, 1903, 2413, 32, 178, 189, 743, 31, - /* 2250 */ 65, 1890, 81, 24, 658, 1937, 2426, 2463, 1942, 1936, - /* 2260 */ 756, 356, 2427, 746, 2429, 2430, 741, 1943, 764, 743, - /* 2270 */ 412, 2425, 1941, 2426, 2463, 1940, 2444, 413, 346, 2427, - /* 2280 */ 746, 2429, 2430, 741, 1861, 764, 743, 59, 2392, 1860, - /* 2290 */ 742, 303, 181, 2298, 2277, 2426, 102, 2444, 103, 25, - /* 2300 */ 13, 1731, 1813, 309, 1812, 1823, 1788, 38, 743, 2392, - /* 2310 */ 308, 742, 1787, 11, 2444, 16, 182, 26, 192, 1757, - /* 2320 */ 2276, 1765, 745, 18, 27, 104, 2392, 311, 742, 279, - /* 2330 */ 2425, 58, 1898, 2463, 193, 317, 2444, 345, 2427, 746, - /* 2340 */ 2429, 2430, 741, 751, 764, 109, 69, 765, 2392, 322, - /* 2350 */ 742, 2425, 105, 2426, 2463, 2468, 2467, 763, 347, 2427, - /* 2360 */ 746, 2429, 2430, 741, 319, 764, 743, 1790, 2425, 68, - /* 2370 */ 2426, 2463, 1502, 767, 427, 353, 2427, 746, 2429, 2430, - /* 2380 */ 741, 769, 764, 743, 1499, 771, 1498, 774, 772, 775, - /* 2390 */ 2425, 777, 2426, 2463, 2444, 1495, 778, 357, 2427, 746, - /* 2400 */ 2429, 2430, 741, 1489, 764, 743, 2392, 780, 742, 781, - /* 2410 */ 783, 2444, 1487, 784, 1493, 1492, 1491, 110, 1490, 326, - /* 2420 */ 1478, 790, 111, 2392, 1511, 742, 78, 1507, 2426, 1376, - /* 2430 */ 800, 1411, 811, 2444, 1408, 1407, 1406, 1405, 1403, 1401, - /* 2440 */ 1400, 743, 1437, 1399, 1436, 2392, 813, 742, 2425, 208, - /* 2450 */ 1397, 2463, 1396, 1394, 1395, 348, 2427, 746, 2429, 2430, - /* 2460 */ 741, 1393, 764, 1392, 1391, 2425, 1433, 1431, 2463, 2444, - /* 2470 */ 1388, 1387, 358, 2427, 746, 2429, 2430, 741, 1384, 764, - /* 2480 */ 1383, 2392, 1382, 742, 1381, 2039, 833, 2425, 834, 2037, - /* 2490 */ 2463, 837, 835, 838, 349, 2427, 746, 2429, 2430, 741, - /* 2500 */ 839, 764, 2035, 841, 842, 843, 2032, 845, 846, 847, - /* 2510 */ 2012, 2426, 849, 1320, 1986, 1308, 853, 859, 330, 855, - /* 2520 */ 1956, 1717, 340, 2425, 743, 858, 2463, 1956, 1956, 1956, - /* 2530 */ 359, 2427, 746, 2429, 2430, 741, 2426, 764, 1956, 1956, - /* 2540 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 743, - /* 2550 */ 1956, 1956, 2444, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2560 */ 1956, 1956, 1956, 1956, 2392, 1956, 742, 1956, 1956, 1956, - /* 2570 */ 2426, 1956, 1956, 1956, 1956, 1956, 1956, 2444, 1956, 1956, - /* 2580 */ 1956, 1956, 1956, 743, 1956, 1956, 1956, 1956, 1956, 2392, - /* 2590 */ 1956, 742, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2600 */ 1956, 1956, 1956, 1956, 1956, 1956, 2425, 1956, 1956, 2463, - /* 2610 */ 1956, 2444, 1956, 350, 2427, 746, 2429, 2430, 741, 1956, - /* 2620 */ 764, 1956, 1956, 2392, 1956, 742, 1956, 1956, 1956, 1956, - /* 2630 */ 1956, 2425, 1956, 1956, 2463, 1956, 1956, 2426, 365, 2427, - /* 2640 */ 746, 2429, 2430, 741, 1956, 764, 1956, 1956, 1956, 1956, - /* 2650 */ 743, 1956, 1956, 2426, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2660 */ 1956, 1956, 1956, 1956, 1956, 2425, 743, 1956, 2463, 2426, - /* 2670 */ 1956, 1956, 366, 2427, 746, 2429, 2430, 741, 2444, 764, - /* 2680 */ 1956, 1956, 743, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2690 */ 2392, 1956, 742, 1956, 2444, 1956, 1956, 1956, 1956, 1956, - /* 2700 */ 1956, 1956, 1956, 1956, 1956, 1956, 2392, 1956, 742, 1956, - /* 2710 */ 2444, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2720 */ 1956, 1956, 2392, 1956, 742, 1956, 1956, 1956, 1956, 1956, - /* 2730 */ 1956, 1956, 2425, 1956, 1956, 2463, 2426, 1956, 1956, 2438, - /* 2740 */ 2427, 746, 2429, 2430, 741, 1956, 764, 1956, 2425, 743, - /* 2750 */ 1956, 2463, 2426, 1956, 1956, 2437, 2427, 746, 2429, 2430, - /* 2760 */ 741, 1956, 764, 1956, 2425, 743, 1956, 2463, 1956, 2426, - /* 2770 */ 1956, 2436, 2427, 746, 2429, 2430, 741, 2444, 764, 1956, - /* 2780 */ 1956, 1956, 743, 1956, 1956, 1956, 1956, 1956, 1956, 2392, - /* 2790 */ 1956, 742, 1956, 2444, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2800 */ 1956, 1956, 1956, 1956, 1956, 2392, 1956, 742, 1956, 1956, - /* 2810 */ 2444, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2820 */ 1956, 1956, 2392, 1956, 742, 1956, 1956, 1956, 1956, 1956, - /* 2830 */ 1956, 2425, 1956, 1956, 2463, 1956, 1956, 1956, 381, 2427, - /* 2840 */ 746, 2429, 2430, 741, 1956, 764, 1956, 2425, 1956, 1956, - /* 2850 */ 2463, 1956, 2426, 1956, 382, 2427, 746, 2429, 2430, 741, - /* 2860 */ 1956, 764, 1956, 1956, 2425, 743, 1956, 2463, 1956, 2426, - /* 2870 */ 1956, 378, 2427, 746, 2429, 2430, 741, 1956, 764, 1956, - /* 2880 */ 1956, 1956, 743, 1956, 2426, 1956, 1956, 1956, 1956, 1956, - /* 2890 */ 1956, 1956, 1956, 2444, 1956, 1956, 1956, 743, 1956, 1956, - /* 2900 */ 1956, 1956, 1956, 1956, 1956, 2392, 1956, 742, 1956, 1956, - /* 2910 */ 2444, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, - /* 2920 */ 1956, 1956, 2392, 1956, 742, 2444, 1956, 1956, 1956, 1956, - /* 2930 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2392, 1956, 742, - /* 2940 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2425, 1956, 1956, - /* 2950 */ 2463, 1956, 1956, 1956, 383, 2427, 746, 2429, 2430, 741, - /* 2960 */ 1956, 764, 1956, 1956, 744, 1956, 1956, 2463, 1956, 1956, - /* 2970 */ 1956, 356, 2427, 746, 2429, 2430, 741, 1956, 764, 2425, - /* 2980 */ 1956, 1956, 2463, 1956, 1956, 1956, 355, 2427, 746, 2429, - /* 2990 */ 2430, 741, 1956, 764, + /* 0 */ 2289, 174, 239, 2405, 761, 2149, 577, 711, 2010, 2088, + /* 10 */ 2601, 2140, 47, 45, 1877, 422, 474, 2535, 2286, 748, + /* 20 */ 419, 473, 1717, 1960, 138, 723, 147, 2409, 710, 204, + /* 30 */ 2389, 617, 1742, 2602, 712, 1803, 2045, 1715, 46, 44, + /* 40 */ 43, 42, 41, 2532, 128, 2429, 1431, 127, 126, 125, + /* 50 */ 124, 123, 122, 121, 120, 119, 40, 39, 726, 1742, + /* 60 */ 46, 44, 43, 42, 41, 1798, 425, 682, 185, 705, + /* 70 */ 2601, 19, 2411, 2413, 416, 761, 2149, 765, 1723, 2606, + /* 80 */ 760, 29, 2601, 765, 2203, 425, 2447, 1433, 2607, 204, + /* 90 */ 390, 388, 2269, 2602, 712, 138, 765, 2447, 2395, 2201, + /* 100 */ 743, 2605, 622, 665, 858, 2602, 2604, 15, 1881, 833, + /* 110 */ 832, 831, 830, 437, 1742, 829, 828, 152, 823, 822, + /* 120 */ 821, 820, 819, 818, 817, 151, 811, 810, 809, 436, + /* 130 */ 435, 806, 805, 804, 184, 183, 803, 302, 2528, 722, + /* 140 */ 2428, 139, 721, 2466, 2601, 1805, 1806, 115, 2430, 747, + /* 150 */ 2432, 2433, 742, 173, 765, 175, 1922, 1971, 344, 187, + /* 160 */ 704, 2520, 710, 204, 579, 415, 2516, 2602, 712, 2388, + /* 170 */ 576, 711, 426, 571, 2601, 342, 75, 66, 816, 74, + /* 180 */ 206, 2110, 569, 1777, 1787, 565, 561, 590, 2550, 371, + /* 190 */ 1804, 1807, 710, 204, 1324, 1596, 1597, 2602, 712, 723, + /* 200 */ 147, 237, 556, 554, 551, 1718, 423, 1716, 197, 723, + /* 210 */ 147, 40, 39, 1331, 172, 46, 44, 43, 42, 41, + /* 220 */ 2190, 760, 2151, 128, 425, 2368, 127, 126, 125, 124, + /* 230 */ 123, 122, 121, 120, 119, 765, 1326, 1329, 1330, 1721, + /* 240 */ 1722, 1774, 62, 1776, 1779, 1780, 1781, 1782, 1783, 1784, + /* 250 */ 1785, 1786, 739, 763, 762, 1797, 1799, 1800, 1801, 1802, + /* 260 */ 2, 47, 45, 1959, 2337, 1742, 368, 2605, 1740, 419, + /* 270 */ 1350, 1717, 1349, 760, 380, 524, 682, 1778, 544, 2601, + /* 280 */ 62, 594, 63, 543, 1803, 2369, 1715, 137, 136, 135, + /* 290 */ 134, 133, 132, 131, 130, 129, 1745, 2607, 204, 504, + /* 300 */ 1743, 545, 2602, 712, 802, 1351, 369, 506, 50, 663, + /* 310 */ 725, 202, 2528, 2529, 1798, 145, 2533, 484, 1832, 276, + /* 320 */ 19, 203, 2528, 2529, 241, 145, 2533, 1723, 577, 2125, + /* 330 */ 2010, 706, 85, 84, 477, 1775, 682, 217, 1874, 2601, + /* 340 */ 574, 40, 39, 575, 2002, 46, 44, 43, 42, 41, + /* 350 */ 469, 467, 62, 858, 391, 2606, 15, 2607, 204, 1489, + /* 360 */ 50, 367, 2602, 712, 456, 492, 2416, 453, 449, 445, + /* 370 */ 442, 470, 1745, 761, 2149, 1480, 790, 789, 788, 1484, + /* 380 */ 787, 1486, 1487, 786, 783, 1833, 1495, 780, 1497, 1498, + /* 390 */ 777, 774, 771, 209, 1805, 1806, 1723, 2276, 2255, 802, + /* 400 */ 532, 531, 530, 529, 528, 523, 522, 521, 520, 374, + /* 410 */ 434, 433, 306, 510, 509, 508, 507, 501, 500, 499, + /* 420 */ 701, 494, 493, 389, 2418, 1524, 1525, 485, 1584, 1585, + /* 430 */ 1910, 96, 1777, 1787, 1603, 1724, 1746, 40, 39, 1804, + /* 440 */ 1807, 46, 44, 43, 42, 41, 314, 315, 392, 1746, + /* 450 */ 306, 313, 396, 395, 1718, 185, 1716, 2144, 40, 39, + /* 460 */ 1945, 304, 46, 44, 43, 42, 41, 36, 417, 1827, + /* 470 */ 1828, 1829, 1830, 1831, 1835, 1836, 1837, 1838, 306, 2270, + /* 480 */ 698, 697, 1908, 1909, 1911, 1912, 1913, 100, 1721, 1722, + /* 490 */ 1774, 12, 1776, 1779, 1780, 1781, 1782, 1783, 1784, 1785, + /* 500 */ 1786, 739, 763, 762, 1797, 1799, 1800, 1801, 1802, 2, + /* 510 */ 12, 47, 45, 2429, 707, 702, 695, 691, 1644, 419, + /* 520 */ 2238, 1717, 306, 1982, 394, 393, 744, 619, 582, 2405, + /* 530 */ 1952, 575, 2002, 33, 1803, 2606, 1715, 304, 2601, 40, + /* 540 */ 39, 643, 813, 46, 44, 43, 42, 41, 1350, 793, + /* 550 */ 1349, 621, 1774, 2409, 2447, 620, 655, 2605, 1921, 2126, + /* 560 */ 2289, 2602, 2603, 714, 1798, 143, 2395, 2048, 743, 2124, + /* 570 */ 19, 2429, 272, 636, 635, 634, 2395, 1723, 2287, 748, + /* 580 */ 626, 144, 630, 1351, 726, 107, 629, 666, 646, 37, + /* 590 */ 310, 628, 633, 398, 397, 640, 638, 627, 2411, 2414, + /* 600 */ 623, 195, 269, 858, 535, 1727, 15, 815, 2428, 765, + /* 610 */ 2142, 2466, 2447, 1873, 200, 115, 2430, 747, 2432, 2433, + /* 620 */ 742, 12, 765, 10, 2395, 149, 743, 156, 2491, 2520, + /* 630 */ 761, 2149, 329, 415, 2516, 2197, 2198, 1951, 1957, 1717, + /* 640 */ 636, 635, 634, 71, 1805, 1806, 70, 626, 144, 630, + /* 650 */ 55, 458, 430, 629, 1715, 2196, 2198, 1747, 628, 633, + /* 660 */ 398, 397, 584, 2328, 627, 737, 2428, 623, 229, 2466, + /* 670 */ 1747, 490, 2265, 115, 2430, 747, 2432, 2433, 742, 2138, + /* 680 */ 765, 224, 1777, 1787, 517, 187, 2134, 2520, 516, 1804, + /* 690 */ 1807, 415, 2516, 534, 228, 1723, 515, 800, 162, 161, + /* 700 */ 797, 796, 795, 159, 1718, 1697, 1716, 800, 162, 161, + /* 710 */ 797, 796, 795, 159, 2551, 2203, 761, 2149, 440, 481, + /* 720 */ 220, 858, 91, 439, 658, 90, 657, 40, 39, 1742, + /* 730 */ 730, 46, 44, 43, 42, 41, 478, 274, 1721, 1722, + /* 740 */ 1774, 273, 1776, 1779, 1780, 1781, 1782, 1783, 1784, 1785, + /* 750 */ 1786, 739, 763, 762, 1797, 1799, 1800, 1801, 1802, 2, + /* 760 */ 47, 45, 1808, 2429, 541, 539, 2136, 370, 419, 682, + /* 770 */ 1717, 218, 2601, 723, 147, 160, 744, 2203, 2012, 496, + /* 780 */ 2265, 172, 462, 1803, 404, 1715, 2535, 761, 2149, 2152, + /* 790 */ 2607, 204, 2201, 2429, 89, 2602, 712, 800, 162, 161, + /* 800 */ 797, 796, 795, 159, 2447, 198, 744, 479, 2558, 464, + /* 810 */ 460, 99, 2531, 1798, 377, 62, 2395, 403, 743, 656, + /* 820 */ 62, 732, 1718, 2492, 1716, 35, 1723, 1893, 222, 761, + /* 830 */ 2149, 40, 39, 1824, 2447, 46, 44, 43, 42, 41, + /* 840 */ 761, 2149, 761, 2149, 761, 2149, 2395, 1813, 743, 498, + /* 850 */ 54, 1696, 858, 1742, 591, 48, 1721, 1722, 2428, 666, + /* 860 */ 511, 2466, 512, 2429, 513, 115, 2430, 747, 2432, 2433, + /* 870 */ 742, 1981, 765, 1980, 661, 1700, 744, 2621, 2571, 2520, + /* 880 */ 526, 2265, 2535, 415, 2516, 205, 2528, 2529, 2428, 145, + /* 890 */ 2533, 2466, 1778, 1805, 1806, 115, 2430, 747, 2432, 2433, + /* 900 */ 742, 96, 765, 667, 2447, 1703, 1706, 2621, 2530, 2520, + /* 910 */ 592, 2282, 1331, 415, 2516, 2089, 2395, 472, 743, 471, + /* 920 */ 434, 433, 761, 2149, 2395, 682, 2395, 2145, 2601, 227, + /* 930 */ 1731, 1777, 1787, 1746, 668, 2328, 1329, 1330, 1804, 1807, + /* 940 */ 761, 2149, 593, 1803, 2132, 1724, 2607, 204, 428, 470, + /* 950 */ 1775, 2602, 712, 1718, 682, 1716, 169, 2601, 2428, 1902, + /* 960 */ 2146, 2466, 2222, 405, 2151, 115, 2430, 747, 2432, 2433, + /* 970 */ 742, 2201, 765, 1798, 1903, 2607, 204, 2621, 792, 2520, + /* 980 */ 2602, 712, 727, 415, 2516, 306, 1723, 1721, 1722, 1774, + /* 990 */ 306, 1776, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, + /* 1000 */ 739, 763, 762, 1797, 1799, 1800, 1801, 1802, 2, 47, + /* 1010 */ 45, 654, 736, 51, 282, 1901, 1778, 419, 738, 1717, + /* 1020 */ 2203, 1699, 2203, 428, 1743, 2429, 652, 414, 650, 271, + /* 1030 */ 270, 172, 1803, 682, 1715, 2201, 2601, 756, 744, 2151, + /* 1040 */ 693, 40, 39, 2203, 1746, 46, 44, 43, 42, 41, + /* 1050 */ 424, 1702, 1705, 2564, 2607, 204, 761, 2149, 2201, 2602, + /* 1060 */ 712, 621, 1798, 40, 39, 620, 2447, 46, 44, 43, + /* 1070 */ 42, 41, 761, 2149, 1775, 1723, 277, 1742, 2395, 681, + /* 1080 */ 743, 431, 761, 2149, 1979, 761, 2149, 761, 2149, 172, + /* 1090 */ 761, 2149, 285, 2203, 761, 2149, 1443, 2151, 199, 1978, + /* 1100 */ 429, 858, 729, 2429, 48, 318, 275, 758, 2201, 148, + /* 1110 */ 759, 1442, 2491, 1732, 325, 1727, 744, 734, 2594, 2492, + /* 1120 */ 2428, 1834, 1977, 2466, 519, 518, 1976, 115, 2430, 747, + /* 1130 */ 2432, 2433, 742, 699, 765, 761, 2149, 2395, 1447, 2621, + /* 1140 */ 9, 2520, 1805, 1806, 2447, 415, 2516, 1735, 1737, 1616, + /* 1150 */ 1617, 113, 2395, 1446, 1747, 432, 2395, 2356, 743, 1353, + /* 1160 */ 1354, 763, 762, 1797, 1799, 1800, 1801, 1802, 150, 43, + /* 1170 */ 42, 41, 14, 13, 1975, 2395, 2141, 1974, 546, 2395, + /* 1180 */ 1777, 1787, 299, 306, 2203, 1665, 1666, 1804, 1807, 715, + /* 1190 */ 613, 612, 615, 614, 1615, 1618, 632, 631, 2428, 2202, + /* 1200 */ 718, 2466, 1718, 34, 1716, 115, 2430, 747, 2432, 2433, + /* 1210 */ 742, 1973, 765, 1839, 60, 1972, 1970, 2621, 171, 2520, + /* 1220 */ 548, 293, 679, 415, 2516, 1969, 142, 2395, 2448, 1968, + /* 1230 */ 2395, 1967, 1966, 1965, 1964, 1963, 1721, 1722, 1774, 1962, + /* 1240 */ 1776, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 739, + /* 1250 */ 763, 762, 1797, 1799, 1800, 1801, 1802, 2, 47, 45, + /* 1260 */ 2274, 2429, 827, 825, 2395, 1747, 419, 794, 1717, 2395, + /* 1270 */ 2194, 2359, 798, 2248, 744, 2194, 2539, 799, 2395, 1846, + /* 1280 */ 2194, 1803, 2395, 1715, 2395, 2395, 2395, 2395, 2395, 3, + /* 1290 */ 338, 2429, 2395, 2180, 1333, 1987, 853, 140, 1775, 77, + /* 1300 */ 1741, 53, 2447, 2127, 744, 2540, 1866, 262, 2032, 87, + /* 1310 */ 260, 1798, 2030, 624, 2395, 488, 743, 264, 266, 625, + /* 1320 */ 263, 265, 447, 268, 1723, 2021, 267, 2019, 160, 160, + /* 1330 */ 637, 689, 2447, 2086, 639, 286, 153, 1428, 1954, 1955, + /* 1340 */ 14, 13, 49, 1426, 2395, 2085, 743, 641, 49, 644, + /* 1350 */ 858, 188, 160, 15, 88, 2003, 2428, 64, 2013, 2466, + /* 1360 */ 2429, 324, 323, 115, 2430, 747, 2432, 2433, 742, 49, + /* 1370 */ 765, 49, 1726, 744, 1866, 2621, 2554, 2520, 1386, 101, + /* 1380 */ 1725, 415, 2516, 696, 312, 76, 2428, 410, 211, 2466, + /* 1390 */ 112, 1805, 1806, 115, 2430, 747, 2432, 2433, 742, 109, + /* 1400 */ 765, 2447, 158, 1660, 1663, 2495, 1897, 2520, 373, 372, + /* 1410 */ 851, 415, 2516, 2395, 703, 743, 406, 1907, 1707, 1387, + /* 1420 */ 750, 807, 438, 1906, 2275, 808, 291, 728, 2191, 1777, + /* 1430 */ 1787, 1803, 1840, 1695, 160, 73, 1804, 1807, 769, 158, + /* 1440 */ 160, 2009, 141, 158, 1788, 1405, 1613, 675, 724, 1403, + /* 1450 */ 2555, 1718, 2565, 1716, 301, 2428, 298, 716, 2466, 316, + /* 1460 */ 753, 1798, 115, 2430, 747, 2432, 2433, 742, 305, 765, + /* 1470 */ 719, 2111, 5, 441, 2493, 2429, 2520, 320, 446, 454, + /* 1480 */ 415, 2516, 386, 1750, 212, 1721, 1722, 1774, 744, 1776, + /* 1490 */ 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 739, 763, + /* 1500 */ 762, 1797, 1799, 1800, 1801, 1802, 2, 2429, 455, 1473, + /* 1510 */ 337, 466, 465, 1502, 1506, 1513, 2447, 1511, 163, 213, + /* 1520 */ 744, 215, 468, 1637, 332, 1740, 1741, 226, 2395, 482, + /* 1530 */ 743, 489, 491, 495, 497, 537, 502, 525, 514, 2267, + /* 1540 */ 527, 533, 1729, 536, 538, 549, 550, 547, 2447, 232, + /* 1550 */ 1728, 552, 231, 553, 234, 555, 557, 1748, 572, 4, + /* 1560 */ 2395, 573, 743, 580, 1743, 581, 242, 93, 583, 245, + /* 1570 */ 2428, 585, 1749, 2466, 586, 1751, 587, 115, 2430, 747, + /* 1580 */ 2432, 2433, 742, 248, 765, 250, 589, 1752, 2283, 733, + /* 1590 */ 94, 2520, 595, 616, 95, 415, 2516, 255, 618, 117, + /* 1600 */ 2139, 1708, 2428, 1698, 259, 2466, 2429, 364, 2135, 116, + /* 1610 */ 2430, 747, 2432, 2433, 742, 261, 765, 98, 165, 744, + /* 1620 */ 166, 647, 2137, 2520, 2133, 167, 168, 2519, 2516, 648, + /* 1630 */ 333, 2346, 662, 1701, 1704, 1709, 278, 660, 154, 2343, + /* 1640 */ 1744, 670, 2342, 669, 283, 674, 281, 2447, 676, 763, + /* 1650 */ 762, 1797, 1799, 1800, 1801, 1802, 2329, 677, 686, 2395, + /* 1660 */ 700, 743, 2570, 288, 751, 290, 8, 709, 671, 687, + /* 1670 */ 2569, 685, 179, 295, 2542, 2429, 292, 297, 684, 717, + /* 1680 */ 411, 2624, 720, 1745, 146, 1871, 300, 294, 744, 1869, + /* 1690 */ 296, 2600, 1866, 191, 2536, 61, 749, 2297, 334, 307, + /* 1700 */ 155, 2428, 2296, 335, 2466, 2429, 754, 207, 116, 2430, + /* 1710 */ 747, 2432, 2433, 742, 2501, 765, 2447, 157, 741, 755, + /* 1720 */ 108, 2295, 2520, 336, 1308, 1, 735, 2516, 2395, 339, + /* 1730 */ 743, 106, 2150, 327, 2429, 767, 852, 421, 855, 351, + /* 1740 */ 2387, 2386, 2195, 52, 384, 164, 2447, 744, 857, 363, + /* 1750 */ 362, 2429, 2367, 352, 343, 2366, 2365, 82, 2395, 2360, + /* 1760 */ 743, 341, 443, 385, 744, 444, 1688, 1689, 210, 448, + /* 1770 */ 745, 2358, 452, 2466, 450, 2447, 451, 116, 2430, 747, + /* 1780 */ 2432, 2433, 742, 1687, 765, 2357, 387, 2395, 2355, 743, + /* 1790 */ 457, 2520, 2447, 2354, 459, 379, 2516, 2353, 461, 2352, + /* 1800 */ 2428, 463, 1676, 2466, 2395, 2333, 743, 360, 2430, 747, + /* 1810 */ 2432, 2433, 742, 740, 765, 731, 2485, 214, 2332, 216, + /* 1820 */ 2429, 83, 1640, 1639, 2310, 2309, 2308, 475, 476, 2428, + /* 1830 */ 2307, 2306, 2466, 744, 2257, 480, 176, 2430, 747, 2432, + /* 1840 */ 2433, 742, 2254, 765, 1583, 483, 2428, 486, 2244, 2466, + /* 1850 */ 2429, 2253, 2247, 177, 2430, 747, 2432, 2433, 742, 2243, + /* 1860 */ 765, 2447, 487, 744, 219, 86, 2242, 2241, 2246, 2245, + /* 1870 */ 221, 2240, 2239, 2395, 2237, 743, 2236, 2235, 683, 2561, + /* 1880 */ 503, 223, 2234, 505, 2232, 2231, 2230, 2429, 2229, 2252, + /* 1890 */ 2228, 2447, 2227, 2226, 2250, 2233, 2225, 2224, 2223, 2221, + /* 1900 */ 744, 2220, 2219, 2395, 2218, 743, 225, 713, 2622, 2217, + /* 1910 */ 2216, 2215, 2214, 2213, 2212, 2428, 2211, 2251, 2466, 2249, + /* 1920 */ 92, 2210, 116, 2430, 747, 2432, 2433, 742, 2447, 765, + /* 1930 */ 2209, 2208, 230, 2207, 2206, 542, 2520, 1589, 540, 2205, + /* 1940 */ 2395, 2517, 743, 2204, 1444, 2428, 1448, 2051, 2466, 2050, + /* 1950 */ 375, 2049, 176, 2430, 747, 2432, 2433, 742, 376, 765, + /* 1960 */ 2429, 2047, 408, 1440, 2044, 560, 558, 2043, 233, 559, + /* 1970 */ 235, 563, 236, 744, 562, 2429, 2036, 564, 566, 2023, + /* 1980 */ 568, 570, 2428, 567, 1998, 2466, 186, 238, 744, 361, + /* 1990 */ 2430, 747, 2432, 2433, 742, 2562, 765, 79, 1997, 2415, + /* 2000 */ 1332, 2447, 240, 196, 80, 578, 2429, 247, 249, 2304, + /* 2010 */ 2281, 2128, 252, 2395, 2331, 743, 2447, 2327, 2317, 744, + /* 2020 */ 2305, 2046, 2042, 597, 1379, 596, 2040, 598, 2395, 600, + /* 2030 */ 743, 601, 602, 2038, 604, 409, 606, 2035, 605, 608, + /* 2040 */ 609, 610, 2018, 2016, 2017, 2015, 1994, 2447, 2130, 1518, + /* 2050 */ 1517, 72, 2129, 258, 1416, 2428, 1430, 824, 2466, 2395, + /* 2060 */ 1429, 743, 361, 2430, 747, 2432, 2433, 742, 1427, 765, + /* 2070 */ 2428, 1425, 1424, 2466, 826, 2429, 1423, 354, 2430, 747, + /* 2080 */ 2432, 2433, 742, 2033, 765, 399, 1422, 1421, 741, 2031, + /* 2090 */ 1418, 1417, 1415, 2429, 400, 2022, 401, 2020, 402, 645, + /* 2100 */ 642, 2428, 1993, 1992, 2466, 1991, 744, 649, 177, 2430, + /* 2110 */ 747, 2432, 2433, 742, 1990, 765, 2447, 651, 1989, 2429, + /* 2120 */ 653, 118, 1670, 708, 1672, 1669, 2330, 280, 2395, 2326, + /* 2130 */ 743, 56, 744, 1674, 2447, 1648, 1646, 28, 2316, 1650, + /* 2140 */ 2303, 672, 57, 67, 2302, 673, 2395, 17, 743, 2606, + /* 2150 */ 678, 65, 688, 170, 284, 1625, 1624, 20, 30, 407, + /* 2160 */ 2447, 680, 6, 2623, 1924, 287, 692, 1898, 418, 694, + /* 2170 */ 2428, 690, 2395, 2466, 743, 7, 289, 360, 2430, 747, + /* 2180 */ 2432, 2433, 742, 21, 765, 1905, 2486, 22, 2428, 178, + /* 2190 */ 190, 2466, 1892, 664, 420, 361, 2430, 747, 2432, 2433, + /* 2200 */ 742, 189, 765, 31, 257, 2429, 32, 201, 2416, 24, + /* 2210 */ 303, 861, 1944, 81, 2428, 1945, 1863, 2466, 744, 1939, + /* 2220 */ 180, 361, 2430, 747, 2432, 2433, 742, 331, 765, 611, + /* 2230 */ 607, 603, 599, 1938, 256, 412, 1943, 1942, 413, 1862, + /* 2240 */ 59, 2301, 181, 194, 2280, 103, 2447, 25, 58, 102, + /* 2250 */ 23, 13, 849, 845, 841, 837, 18, 328, 2395, 1733, + /* 2260 */ 743, 1815, 11, 1790, 2429, 1814, 1825, 182, 192, 38, + /* 2270 */ 1767, 1789, 16, 26, 27, 97, 1759, 744, 254, 311, + /* 2280 */ 746, 752, 1900, 2279, 193, 317, 2429, 69, 104, 322, + /* 2290 */ 105, 109, 2471, 2470, 768, 1792, 319, 764, 114, 744, + /* 2300 */ 659, 321, 1503, 2466, 68, 2447, 766, 356, 2430, 747, + /* 2310 */ 2432, 2433, 742, 427, 765, 770, 772, 2395, 1500, 743, + /* 2320 */ 773, 775, 778, 1499, 776, 781, 784, 2447, 1496, 779, + /* 2330 */ 1479, 1490, 782, 326, 1488, 757, 785, 110, 111, 2395, + /* 2340 */ 1512, 743, 1494, 78, 1508, 791, 1493, 244, 1412, 1377, + /* 2350 */ 1409, 1492, 801, 1408, 1491, 1407, 253, 246, 1406, 2428, + /* 2360 */ 1404, 1402, 2466, 251, 588, 2429, 346, 2430, 747, 2432, + /* 2370 */ 2433, 742, 1401, 765, 1400, 1438, 812, 1437, 744, 309, + /* 2380 */ 208, 2428, 243, 814, 2466, 1398, 308, 2429, 345, 2430, + /* 2390 */ 747, 2432, 2433, 742, 1397, 765, 1396, 1395, 1394, 1393, + /* 2400 */ 744, 1392, 1432, 1434, 1389, 279, 2447, 1388, 1385, 1384, + /* 2410 */ 1383, 1382, 2041, 834, 835, 836, 2039, 839, 2395, 838, + /* 2420 */ 743, 840, 2037, 2429, 842, 844, 2034, 846, 2447, 843, + /* 2430 */ 2014, 848, 847, 1988, 850, 1321, 744, 1309, 854, 330, + /* 2440 */ 2395, 856, 743, 1719, 860, 340, 859, 1958, 1958, 1958, + /* 2450 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2460 */ 2428, 1958, 1958, 2466, 2447, 1958, 1958, 347, 2430, 747, + /* 2470 */ 2432, 2433, 742, 1958, 765, 1958, 2395, 1958, 743, 1958, + /* 2480 */ 1958, 1958, 2428, 1958, 1958, 2466, 1958, 1958, 1958, 353, + /* 2490 */ 2430, 747, 2432, 2433, 742, 1958, 765, 1958, 1958, 1958, + /* 2500 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2429, 1958, 1958, + /* 2510 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2428, 1958, + /* 2520 */ 744, 2466, 2429, 1958, 1958, 357, 2430, 747, 2432, 2433, + /* 2530 */ 742, 1958, 765, 1958, 1958, 744, 1958, 2429, 1958, 1958, + /* 2540 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2447, 1958, + /* 2550 */ 744, 1958, 1958, 2429, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2560 */ 2395, 1958, 743, 2447, 1958, 1958, 744, 1958, 1958, 1958, + /* 2570 */ 1958, 1958, 1958, 1958, 1958, 2395, 1958, 743, 2447, 1958, + /* 2580 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2590 */ 2395, 1958, 743, 1958, 2447, 1958, 1958, 1958, 1958, 1958, + /* 2600 */ 1958, 1958, 2428, 1958, 1958, 2466, 2395, 1958, 743, 348, + /* 2610 */ 2430, 747, 2432, 2433, 742, 1958, 765, 2428, 1958, 1958, + /* 2620 */ 2466, 1958, 1958, 2429, 358, 2430, 747, 2432, 2433, 742, + /* 2630 */ 1958, 765, 2428, 1958, 1958, 2466, 744, 1958, 1958, 349, + /* 2640 */ 2430, 747, 2432, 2433, 742, 1958, 765, 1958, 2428, 1958, + /* 2650 */ 1958, 2466, 1958, 1958, 1958, 359, 2430, 747, 2432, 2433, + /* 2660 */ 742, 1958, 765, 1958, 2447, 1958, 1958, 2429, 1958, 1958, + /* 2670 */ 1958, 1958, 1958, 1958, 1958, 1958, 2395, 1958, 743, 1958, + /* 2680 */ 744, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2690 */ 1958, 1958, 1958, 1958, 2429, 1958, 1958, 1958, 1958, 1958, + /* 2700 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 744, 2447, 1958, + /* 2710 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2428, 1958, + /* 2720 */ 2395, 2466, 743, 1958, 1958, 350, 2430, 747, 2432, 2433, + /* 2730 */ 742, 1958, 765, 1958, 1958, 2447, 1958, 1958, 2429, 1958, + /* 2740 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2395, 1958, 743, + /* 2750 */ 1958, 744, 1958, 1958, 2429, 1958, 1958, 1958, 1958, 1958, + /* 2760 */ 1958, 1958, 2428, 1958, 1958, 2466, 1958, 744, 1958, 365, + /* 2770 */ 2430, 747, 2432, 2433, 742, 1958, 765, 2429, 1958, 2447, + /* 2780 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2428, + /* 2790 */ 744, 2395, 2466, 743, 1958, 2447, 366, 2430, 747, 2432, + /* 2800 */ 2433, 742, 1958, 765, 1958, 1958, 1958, 2395, 1958, 743, + /* 2810 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2447, 1958, + /* 2820 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2830 */ 2395, 1958, 743, 2428, 1958, 2429, 2466, 1958, 1958, 1958, + /* 2840 */ 2441, 2430, 747, 2432, 2433, 742, 1958, 765, 744, 2428, + /* 2850 */ 1958, 2429, 2466, 1958, 1958, 1958, 2440, 2430, 747, 2432, + /* 2860 */ 2433, 742, 1958, 765, 744, 1958, 1958, 1958, 1958, 1958, + /* 2870 */ 1958, 1958, 2428, 1958, 1958, 2466, 2447, 1958, 1958, 2439, + /* 2880 */ 2430, 747, 2432, 2433, 742, 1958, 765, 1958, 2395, 1958, + /* 2890 */ 743, 1958, 2447, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2900 */ 1958, 1958, 1958, 1958, 2395, 1958, 743, 1958, 1958, 2429, + /* 2910 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2920 */ 1958, 1958, 744, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 2930 */ 2428, 1958, 1958, 2466, 2429, 1958, 1958, 381, 2430, 747, + /* 2940 */ 2432, 2433, 742, 1958, 765, 1958, 2428, 744, 1958, 2466, + /* 2950 */ 2447, 1958, 1958, 382, 2430, 747, 2432, 2433, 742, 1958, + /* 2960 */ 765, 1958, 2395, 1958, 743, 1958, 1958, 2429, 1958, 1958, + /* 2970 */ 1958, 1958, 1958, 1958, 1958, 2447, 1958, 1958, 1958, 1958, + /* 2980 */ 744, 1958, 1958, 1958, 1958, 1958, 1958, 2395, 1958, 743, + /* 2990 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3000 */ 1958, 1958, 1958, 1958, 2428, 1958, 1958, 2466, 2447, 1958, + /* 3010 */ 1958, 378, 2430, 747, 2432, 2433, 742, 1958, 765, 1958, + /* 3020 */ 2395, 1958, 743, 1958, 1958, 1958, 1958, 1958, 1958, 2428, + /* 3030 */ 1958, 1958, 2466, 1958, 1958, 1958, 383, 2430, 747, 2432, + /* 3040 */ 2433, 742, 1958, 765, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3050 */ 1958, 1958, 1958, 2429, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3060 */ 1958, 1958, 745, 1958, 1958, 2466, 744, 1958, 1958, 356, + /* 3070 */ 2430, 747, 2432, 2433, 742, 1958, 765, 1958, 1958, 1958, + /* 3080 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3090 */ 1958, 1958, 1958, 1958, 2447, 1958, 1958, 1958, 1958, 1958, + /* 3100 */ 1958, 1958, 1958, 1958, 1958, 1958, 2395, 1958, 743, 1958, + /* 3110 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3120 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3130 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, + /* 3140 */ 1958, 1958, 1958, 1958, 1958, 1958, 1958, 1958, 2428, 1958, + /* 3150 */ 1958, 2466, 1958, 1958, 1958, 355, 2430, 747, 2432, 2433, + /* 3160 */ 742, 1958, 765, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 412, 364, 399, 364, 367, 368, 367, 368, 0, 369, - /* 10 */ 474, 475, 12, 13, 14, 427, 369, 2, 430, 431, - /* 20 */ 20, 0, 22, 8, 9, 369, 370, 12, 13, 14, - /* 30 */ 15, 16, 411, 412, 400, 35, 0, 37, 412, 12, - /* 40 */ 13, 485, 21, 20, 488, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 8, 9, 430, 431, 12, 13, - /* 60 */ 14, 15, 16, 507, 37, 65, 20, 511, 512, 20, - /* 70 */ 20, 71, 425, 426, 354, 8, 9, 398, 78, 12, - /* 80 */ 13, 14, 15, 16, 444, 445, 356, 21, 358, 455, - /* 90 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 434, - /* 100 */ 466, 422, 408, 369, 104, 411, 412, 107, 14, 73, + /* 0 */ 413, 380, 366, 387, 370, 371, 370, 486, 372, 388, + /* 10 */ 489, 401, 12, 13, 14, 428, 435, 459, 431, 432, + /* 20 */ 20, 440, 22, 0, 390, 370, 371, 411, 507, 508, + /* 30 */ 401, 397, 20, 512, 513, 35, 0, 37, 12, 13, + /* 40 */ 14, 15, 16, 485, 21, 358, 37, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 8, 9, 371, 20, + /* 60 */ 12, 13, 14, 15, 16, 65, 456, 486, 399, 371, + /* 70 */ 489, 71, 456, 457, 458, 370, 371, 467, 78, 486, + /* 80 */ 20, 33, 489, 467, 399, 456, 399, 78, 507, 508, + /* 90 */ 421, 406, 423, 512, 513, 390, 467, 399, 411, 414, + /* 100 */ 413, 508, 397, 20, 104, 512, 513, 107, 14, 73, /* 110 */ 74, 75, 76, 77, 20, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 100, 481, 482, 483, - /* 140 */ 385, 485, 486, 388, 488, 145, 146, 458, 414, 415, - /* 150 */ 485, 417, 18, 488, 434, 421, 107, 23, 485, 439, - /* 160 */ 365, 488, 506, 507, 369, 69, 371, 511, 512, 161, - /* 170 */ 162, 506, 507, 484, 40, 41, 511, 512, 44, 398, - /* 180 */ 507, 4, 182, 183, 511, 512, 405, 20, 54, 189, - /* 190 */ 190, 8, 9, 4, 413, 12, 13, 14, 15, 16, - /* 200 */ 66, 67, 68, 69, 204, 485, 206, 20, 488, 357, - /* 210 */ 8, 9, 23, 188, 12, 13, 14, 15, 16, 12, - /* 220 */ 13, 14, 15, 16, 434, 20, 506, 507, 20, 439, - /* 230 */ 184, 511, 512, 206, 184, 46, 47, 48, 238, 239, - /* 240 */ 240, 107, 242, 243, 244, 245, 246, 247, 248, 249, + /* 130 */ 94, 95, 96, 97, 98, 99, 100, 482, 483, 484, + /* 140 */ 453, 486, 487, 456, 489, 145, 146, 460, 461, 462, + /* 150 */ 463, 464, 465, 18, 467, 357, 108, 359, 23, 472, + /* 160 */ 462, 474, 507, 508, 14, 478, 479, 512, 513, 401, + /* 170 */ 20, 486, 404, 51, 489, 40, 41, 4, 386, 44, + /* 180 */ 493, 389, 60, 183, 184, 63, 64, 20, 501, 54, + /* 190 */ 190, 191, 507, 508, 4, 183, 184, 512, 513, 370, + /* 200 */ 371, 66, 67, 68, 69, 205, 391, 207, 398, 370, + /* 210 */ 371, 8, 9, 23, 399, 12, 13, 14, 15, 16, + /* 220 */ 410, 20, 407, 21, 456, 435, 24, 25, 26, 27, + /* 230 */ 28, 29, 30, 31, 32, 467, 46, 47, 48, 239, + /* 240 */ 240, 241, 107, 243, 244, 245, 246, 247, 248, 249, /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - /* 260 */ 12, 13, 410, 196, 379, 18, 485, 20, 20, 488, - /* 270 */ 22, 20, 387, 71, 27, 485, 182, 30, 488, 369, - /* 280 */ 370, 147, 35, 35, 107, 37, 240, 506, 507, 13, - /* 290 */ 240, 108, 511, 512, 107, 199, 506, 507, 51, 389, - /* 300 */ 53, 511, 512, 397, 3, 58, 59, 282, 283, 284, - /* 310 */ 285, 369, 370, 65, 0, 409, 69, 115, 0, 71, - /* 320 */ 37, 20, 226, 227, 20, 276, 78, 14, 369, 370, - /* 330 */ 196, 197, 198, 20, 240, 201, 369, 370, 24, 25, - /* 340 */ 26, 27, 28, 29, 30, 31, 32, 117, 214, 215, - /* 350 */ 20, 65, 104, 106, 78, 107, 389, 104, 87, 225, - /* 360 */ 418, 78, 228, 396, 117, 231, 232, 233, 234, 235, - /* 370 */ 303, 369, 370, 120, 121, 122, 123, 124, 125, 126, - /* 380 */ 127, 128, 129, 181, 131, 132, 133, 134, 135, 136, - /* 390 */ 137, 389, 106, 145, 146, 109, 149, 150, 139, 152, - /* 400 */ 153, 154, 155, 156, 157, 158, 159, 160, 70, 108, - /* 410 */ 276, 164, 165, 166, 167, 168, 169, 170, 260, 172, - /* 420 */ 173, 174, 151, 369, 370, 178, 179, 180, 238, 70, - /* 430 */ 182, 183, 185, 182, 183, 56, 57, 189, 190, 480, - /* 440 */ 481, 482, 483, 389, 485, 486, 175, 176, 240, 398, - /* 450 */ 396, 20, 204, 276, 206, 0, 138, 139, 140, 141, - /* 460 */ 142, 143, 144, 177, 413, 263, 264, 265, 266, 267, - /* 470 */ 268, 269, 270, 271, 272, 273, 217, 218, 288, 289, - /* 480 */ 290, 291, 292, 293, 294, 184, 238, 239, 240, 398, - /* 490 */ 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - /* 500 */ 252, 253, 254, 255, 256, 257, 258, 259, 260, 12, - /* 510 */ 13, 420, 400, 422, 184, 403, 140, 20, 78, 22, - /* 520 */ 144, 400, 369, 370, 260, 21, 262, 365, 73, 74, - /* 530 */ 75, 369, 35, 371, 37, 80, 81, 82, 107, 4, - /* 540 */ 36, 86, 38, 39, 40, 434, 91, 92, 93, 94, - /* 550 */ 469, 107, 97, 472, 19, 100, 23, 14, 15, 16, - /* 560 */ 107, 357, 65, 14, 73, 74, 75, 455, 71, 20, - /* 570 */ 35, 80, 81, 82, 370, 78, 455, 86, 466, 181, - /* 580 */ 47, 48, 91, 92, 93, 94, 51, 466, 97, 213, - /* 590 */ 117, 100, 216, 58, 59, 219, 485, 221, 378, 488, - /* 600 */ 65, 104, 398, 386, 107, 8, 9, 357, 20, 12, - /* 610 */ 13, 14, 15, 16, 410, 395, 412, 506, 507, 470, - /* 620 */ 370, 472, 511, 512, 404, 8, 9, 410, 386, 12, - /* 630 */ 13, 14, 15, 16, 481, 482, 483, 0, 485, 486, - /* 640 */ 4, 106, 145, 146, 109, 51, 369, 370, 398, 14, - /* 650 */ 33, 37, 410, 357, 60, 20, 452, 63, 64, 455, - /* 660 */ 410, 263, 412, 459, 460, 461, 462, 463, 464, 376, - /* 670 */ 466, 273, 455, 456, 457, 471, 33, 473, 107, 182, - /* 680 */ 183, 477, 478, 466, 8, 9, 189, 190, 12, 13, - /* 690 */ 14, 15, 16, 369, 401, 418, 492, 455, 456, 383, - /* 700 */ 384, 204, 452, 206, 500, 455, 410, 276, 466, 459, - /* 710 */ 460, 461, 462, 463, 464, 398, 466, 398, 398, 469, - /* 720 */ 276, 471, 472, 473, 405, 108, 406, 477, 478, 276, - /* 730 */ 413, 182, 413, 145, 146, 238, 239, 240, 0, 242, - /* 740 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - /* 750 */ 253, 254, 255, 256, 257, 258, 259, 12, 13, 14, - /* 760 */ 357, 37, 22, 369, 370, 20, 370, 22, 444, 445, - /* 770 */ 369, 370, 407, 370, 203, 410, 205, 37, 0, 20, - /* 780 */ 35, 22, 37, 389, 108, 2, 34, 369, 370, 240, - /* 790 */ 357, 8, 9, 33, 398, 12, 13, 14, 15, 16, - /* 800 */ 163, 398, 398, 370, 167, 372, 235, 389, 70, 405, - /* 810 */ 65, 399, 175, 410, 55, 412, 458, 413, 78, 357, - /* 820 */ 206, 369, 370, 78, 138, 139, 140, 141, 142, 143, - /* 830 */ 144, 398, 8, 9, 1, 2, 12, 13, 14, 15, - /* 840 */ 16, 389, 484, 410, 104, 412, 398, 276, 20, 104, - /* 850 */ 236, 237, 107, 405, 20, 452, 22, 461, 455, 37, - /* 860 */ 357, 413, 459, 460, 461, 462, 463, 464, 108, 466, - /* 870 */ 357, 37, 410, 370, 471, 372, 473, 399, 369, 370, - /* 880 */ 477, 478, 481, 482, 483, 452, 485, 486, 455, 55, - /* 890 */ 145, 146, 459, 460, 461, 462, 463, 464, 389, 466, - /* 900 */ 78, 398, 407, 500, 471, 410, 473, 139, 140, 20, - /* 910 */ 477, 478, 144, 410, 278, 412, 138, 139, 140, 141, - /* 920 */ 142, 143, 144, 410, 369, 370, 485, 182, 183, 488, - /* 930 */ 206, 374, 375, 357, 189, 190, 399, 369, 370, 369, - /* 940 */ 370, 108, 20, 300, 204, 458, 206, 506, 507, 204, - /* 950 */ 399, 206, 511, 512, 394, 452, 20, 389, 455, 389, - /* 960 */ 236, 237, 459, 460, 461, 462, 463, 464, 0, 466, - /* 970 */ 434, 484, 434, 418, 471, 470, 473, 472, 238, 239, - /* 980 */ 477, 478, 20, 238, 239, 240, 410, 242, 243, 244, - /* 990 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - /* 1000 */ 255, 256, 257, 258, 259, 12, 13, 22, 184, 449, - /* 1010 */ 182, 369, 370, 20, 357, 22, 3, 390, 374, 375, - /* 1020 */ 33, 485, 37, 485, 488, 398, 488, 370, 35, 372, - /* 1030 */ 37, 389, 405, 406, 369, 370, 35, 399, 357, 378, - /* 1040 */ 413, 42, 506, 507, 506, 507, 357, 511, 512, 511, - /* 1050 */ 512, 370, 51, 372, 389, 398, 369, 370, 65, 50, - /* 1060 */ 376, 60, 61, 62, 63, 404, 65, 410, 240, 412, - /* 1070 */ 390, 78, 369, 370, 369, 370, 389, 393, 398, 398, - /* 1080 */ 0, 145, 146, 369, 370, 401, 406, 383, 384, 104, - /* 1090 */ 399, 410, 389, 412, 389, 369, 370, 104, 22, 410, - /* 1100 */ 107, 360, 361, 389, 369, 370, 184, 106, 407, 452, - /* 1110 */ 109, 410, 455, 37, 357, 389, 459, 460, 461, 462, - /* 1120 */ 463, 464, 42, 466, 389, 189, 190, 370, 471, 240, - /* 1130 */ 473, 39, 40, 452, 477, 478, 455, 117, 145, 146, - /* 1140 */ 459, 460, 461, 462, 463, 464, 398, 466, 369, 370, - /* 1150 */ 71, 22, 471, 405, 473, 398, 390, 390, 477, 478, - /* 1160 */ 391, 413, 240, 394, 398, 398, 37, 410, 389, 412, - /* 1170 */ 369, 370, 406, 406, 398, 182, 183, 138, 177, 177, - /* 1180 */ 104, 142, 189, 190, 274, 275, 440, 186, 187, 413, - /* 1190 */ 389, 171, 387, 184, 193, 194, 33, 204, 230, 206, - /* 1200 */ 358, 192, 240, 111, 112, 357, 114, 78, 45, 452, - /* 1210 */ 208, 357, 455, 212, 357, 434, 459, 460, 461, 462, - /* 1220 */ 463, 464, 465, 466, 467, 468, 0, 357, 357, 357, - /* 1230 */ 138, 238, 239, 240, 142, 242, 243, 244, 245, 246, - /* 1240 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - /* 1250 */ 257, 258, 259, 12, 13, 357, 357, 110, 410, 33, - /* 1260 */ 113, 20, 357, 22, 410, 357, 485, 410, 370, 488, - /* 1270 */ 372, 357, 0, 357, 275, 357, 35, 357, 37, 33, - /* 1280 */ 410, 410, 410, 13, 423, 65, 357, 506, 507, 302, - /* 1290 */ 13, 45, 511, 512, 110, 110, 398, 113, 113, 370, - /* 1300 */ 110, 372, 220, 113, 222, 515, 65, 37, 410, 410, - /* 1310 */ 412, 298, 12, 13, 37, 410, 0, 238, 410, 78, - /* 1320 */ 0, 0, 22, 51, 410, 0, 410, 398, 410, 109, - /* 1330 */ 410, 145, 146, 504, 33, 35, 33, 37, 22, 410, - /* 1340 */ 107, 412, 22, 22, 33, 104, 33, 22, 107, 116, - /* 1350 */ 452, 12, 13, 455, 49, 357, 37, 459, 460, 461, - /* 1360 */ 462, 463, 464, 33, 466, 65, 33, 373, 370, 471, - /* 1370 */ 13, 473, 37, 33, 497, 477, 478, 33, 78, 398, - /* 1380 */ 33, 452, 386, 386, 455, 368, 145, 146, 459, 460, - /* 1390 */ 461, 462, 463, 464, 37, 466, 398, 1, 2, 423, - /* 1400 */ 471, 13, 473, 33, 104, 423, 477, 478, 410, 108, - /* 1410 */ 412, 108, 107, 357, 503, 503, 503, 12, 13, 108, - /* 1420 */ 503, 108, 433, 182, 183, 37, 370, 22, 373, 423, - /* 1430 */ 189, 190, 33, 370, 33, 409, 441, 33, 108, 423, - /* 1440 */ 35, 108, 37, 487, 423, 204, 33, 206, 108, 0, - /* 1450 */ 452, 33, 108, 455, 398, 108, 508, 459, 460, 461, - /* 1460 */ 462, 463, 464, 479, 466, 33, 410, 490, 412, 471, - /* 1470 */ 65, 473, 33, 388, 33, 477, 478, 279, 108, 238, - /* 1480 */ 239, 240, 435, 242, 243, 244, 245, 246, 247, 248, - /* 1490 */ 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - /* 1500 */ 259, 52, 33, 33, 204, 51, 206, 108, 452, 108, - /* 1510 */ 357, 455, 108, 454, 42, 459, 460, 461, 462, 463, - /* 1520 */ 464, 108, 466, 370, 453, 206, 108, 471, 20, 473, - /* 1530 */ 446, 219, 451, 477, 478, 378, 446, 378, 238, 239, - /* 1540 */ 108, 206, 437, 202, 20, 369, 20, 108, 370, 108, - /* 1550 */ 45, 398, 252, 253, 254, 255, 256, 257, 258, 419, - /* 1560 */ 419, 370, 181, 410, 416, 412, 369, 416, 419, 370, - /* 1570 */ 369, 416, 416, 105, 382, 381, 103, 108, 108, 369, - /* 1580 */ 102, 369, 380, 369, 369, 20, 362, 50, 366, 362, - /* 1590 */ 446, 357, 20, 412, 366, 378, 378, 378, 20, 20, - /* 1600 */ 371, 436, 371, 378, 370, 452, 20, 369, 455, 204, - /* 1610 */ 378, 206, 459, 460, 461, 462, 463, 464, 378, 466, - /* 1620 */ 378, 426, 378, 362, 471, 369, 473, 360, 398, 360, - /* 1630 */ 477, 478, 398, 398, 398, 398, 362, 398, 223, 450, - /* 1640 */ 107, 236, 237, 238, 410, 398, 412, 398, 398, 398, - /* 1650 */ 398, 398, 448, 410, 446, 410, 376, 252, 253, 254, - /* 1660 */ 255, 256, 257, 258, 357, 410, 20, 210, 445, 209, - /* 1670 */ 412, 376, 410, 369, 287, 496, 286, 370, 496, 295, - /* 1680 */ 195, 498, 428, 496, 304, 296, 452, 428, 297, 455, - /* 1690 */ 494, 443, 499, 459, 460, 461, 462, 463, 464, 442, - /* 1700 */ 466, 435, 495, 357, 493, 398, 280, 473, 435, 301, - /* 1710 */ 510, 477, 478, 299, 20, 509, 370, 410, 275, 412, - /* 1720 */ 370, 516, 458, 357, 117, 277, 371, 376, 376, 107, - /* 1730 */ 428, 187, 410, 410, 410, 376, 370, 410, 428, 410, - /* 1740 */ 376, 476, 357, 394, 398, 370, 410, 410, 107, 376, - /* 1750 */ 424, 491, 489, 410, 22, 370, 410, 359, 412, 452, - /* 1760 */ 402, 369, 455, 38, 398, 363, 459, 460, 461, 462, - /* 1770 */ 463, 464, 362, 466, 429, 447, 410, 355, 412, 0, - /* 1780 */ 473, 357, 429, 398, 477, 478, 438, 392, 377, 392, - /* 1790 */ 0, 0, 392, 45, 370, 410, 0, 412, 452, 37, - /* 1800 */ 229, 455, 37, 37, 37, 459, 460, 461, 462, 463, - /* 1810 */ 464, 229, 466, 0, 37, 37, 229, 37, 452, 473, - /* 1820 */ 357, 455, 398, 477, 478, 459, 460, 461, 462, 463, - /* 1830 */ 464, 0, 466, 370, 410, 0, 412, 452, 229, 357, - /* 1840 */ 455, 37, 0, 37, 459, 460, 461, 462, 463, 464, - /* 1850 */ 0, 466, 370, 0, 22, 37, 224, 0, 0, 212, - /* 1860 */ 212, 398, 213, 206, 357, 204, 0, 501, 502, 0, - /* 1870 */ 0, 200, 199, 410, 0, 412, 452, 370, 150, 455, - /* 1880 */ 398, 0, 49, 459, 460, 461, 462, 463, 464, 49, - /* 1890 */ 466, 0, 410, 37, 412, 0, 0, 473, 513, 514, - /* 1900 */ 37, 0, 478, 51, 49, 398, 0, 45, 0, 0, - /* 1910 */ 0, 0, 0, 49, 432, 452, 167, 410, 455, 412, - /* 1920 */ 0, 0, 459, 460, 461, 462, 463, 464, 0, 466, - /* 1930 */ 0, 37, 0, 0, 452, 167, 0, 455, 49, 432, - /* 1940 */ 0, 459, 460, 461, 462, 463, 464, 0, 466, 0, - /* 1950 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 452, - /* 1960 */ 0, 0, 455, 357, 0, 502, 459, 460, 461, 462, - /* 1970 */ 463, 464, 0, 466, 0, 0, 370, 0, 0, 45, - /* 1980 */ 0, 0, 357, 0, 0, 0, 0, 22, 150, 0, - /* 1990 */ 149, 0, 148, 0, 0, 370, 50, 0, 22, 357, - /* 2000 */ 65, 22, 0, 37, 398, 0, 65, 65, 0, 50, - /* 2010 */ 0, 42, 370, 51, 0, 42, 410, 0, 412, 37, - /* 2020 */ 0, 357, 51, 398, 37, 37, 0, 0, 33, 37, - /* 2030 */ 14, 0, 0, 0, 370, 410, 0, 412, 195, 0, - /* 2040 */ 398, 51, 42, 45, 0, 42, 0, 0, 49, 43, - /* 2050 */ 49, 42, 410, 49, 412, 0, 49, 42, 452, 37, - /* 2060 */ 42, 455, 398, 51, 0, 459, 460, 461, 462, 463, - /* 2070 */ 464, 37, 466, 0, 410, 51, 412, 452, 37, 42, - /* 2080 */ 455, 51, 42, 72, 459, 460, 461, 462, 463, 464, - /* 2090 */ 0, 466, 42, 37, 452, 0, 432, 455, 0, 51, - /* 2100 */ 357, 459, 460, 461, 462, 463, 464, 0, 466, 0, - /* 2110 */ 468, 505, 0, 370, 0, 37, 452, 37, 1, 455, - /* 2120 */ 0, 22, 37, 459, 460, 461, 462, 463, 464, 37, - /* 2130 */ 466, 37, 0, 37, 115, 33, 19, 37, 113, 514, - /* 2140 */ 37, 398, 37, 33, 22, 37, 22, 0, 37, 22, - /* 2150 */ 37, 0, 35, 410, 53, 412, 22, 0, 22, 357, - /* 2160 */ 37, 0, 0, 0, 0, 37, 37, 0, 51, 20, - /* 2170 */ 22, 108, 370, 107, 37, 432, 357, 60, 61, 62, - /* 2180 */ 63, 37, 65, 37, 0, 0, 107, 49, 22, 370, - /* 2190 */ 37, 0, 22, 0, 0, 452, 281, 108, 455, 3, - /* 2200 */ 398, 33, 459, 460, 461, 462, 463, 464, 37, 466, - /* 2210 */ 37, 107, 410, 184, 412, 187, 33, 398, 281, 50, - /* 2220 */ 105, 49, 184, 106, 108, 107, 109, 184, 107, 410, - /* 2230 */ 207, 412, 211, 184, 103, 357, 191, 184, 50, 33, - /* 2240 */ 33, 108, 191, 108, 49, 33, 107, 107, 370, 107, - /* 2250 */ 3, 108, 107, 33, 452, 37, 357, 455, 108, 37, - /* 2260 */ 143, 459, 460, 461, 462, 463, 464, 108, 466, 370, - /* 2270 */ 37, 452, 37, 357, 455, 37, 398, 37, 459, 460, - /* 2280 */ 461, 462, 463, 464, 108, 466, 370, 33, 410, 108, - /* 2290 */ 412, 49, 49, 0, 0, 357, 107, 398, 42, 33, - /* 2300 */ 2, 22, 105, 186, 105, 238, 108, 107, 370, 410, - /* 2310 */ 193, 412, 108, 261, 398, 107, 49, 107, 49, 108, - /* 2320 */ 0, 22, 241, 281, 107, 42, 410, 108, 412, 212, - /* 2330 */ 452, 274, 108, 455, 107, 107, 398, 459, 460, 461, - /* 2340 */ 462, 463, 464, 188, 466, 116, 107, 117, 410, 49, - /* 2350 */ 412, 452, 107, 357, 455, 107, 107, 107, 459, 460, - /* 2360 */ 461, 462, 463, 464, 186, 466, 370, 108, 452, 107, - /* 2370 */ 357, 455, 108, 37, 37, 459, 460, 461, 462, 463, - /* 2380 */ 464, 107, 466, 370, 108, 37, 108, 37, 107, 107, - /* 2390 */ 452, 37, 357, 455, 398, 108, 107, 459, 460, 461, - /* 2400 */ 462, 463, 464, 108, 466, 370, 410, 37, 412, 107, - /* 2410 */ 37, 398, 108, 107, 130, 130, 130, 107, 130, 33, - /* 2420 */ 119, 118, 107, 410, 37, 412, 107, 22, 357, 72, - /* 2430 */ 71, 37, 101, 398, 37, 37, 37, 37, 37, 37, - /* 2440 */ 37, 370, 78, 37, 78, 410, 101, 412, 452, 33, - /* 2450 */ 37, 455, 37, 22, 37, 459, 460, 461, 462, 463, - /* 2460 */ 464, 37, 466, 37, 37, 452, 78, 37, 455, 398, - /* 2470 */ 37, 37, 459, 460, 461, 462, 463, 464, 37, 466, - /* 2480 */ 37, 410, 22, 412, 37, 0, 37, 452, 51, 0, - /* 2490 */ 455, 37, 42, 51, 459, 460, 461, 462, 463, 464, - /* 2500 */ 42, 466, 0, 37, 51, 42, 0, 37, 51, 42, - /* 2510 */ 0, 357, 37, 37, 0, 22, 33, 20, 22, 21, - /* 2520 */ 517, 22, 22, 452, 370, 21, 455, 517, 517, 517, - /* 2530 */ 459, 460, 461, 462, 463, 464, 357, 466, 517, 517, - /* 2540 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 370, - /* 2550 */ 517, 517, 398, 517, 517, 517, 517, 517, 517, 517, - /* 2560 */ 517, 517, 517, 517, 410, 517, 412, 517, 517, 517, - /* 2570 */ 357, 517, 517, 517, 517, 517, 517, 398, 517, 517, - /* 2580 */ 517, 517, 517, 370, 517, 517, 517, 517, 517, 410, - /* 2590 */ 517, 412, 517, 517, 517, 517, 517, 517, 517, 517, - /* 2600 */ 517, 517, 517, 517, 517, 517, 452, 517, 517, 455, - /* 2610 */ 517, 398, 517, 459, 460, 461, 462, 463, 464, 517, - /* 2620 */ 466, 517, 517, 410, 517, 412, 517, 517, 517, 517, - /* 2630 */ 517, 452, 517, 517, 455, 517, 517, 357, 459, 460, - /* 2640 */ 461, 462, 463, 464, 517, 466, 517, 517, 517, 517, - /* 2650 */ 370, 517, 517, 357, 517, 517, 517, 517, 517, 517, - /* 2660 */ 517, 517, 517, 517, 517, 452, 370, 517, 455, 357, - /* 2670 */ 517, 517, 459, 460, 461, 462, 463, 464, 398, 466, - /* 2680 */ 517, 517, 370, 517, 517, 517, 517, 517, 517, 517, - /* 2690 */ 410, 517, 412, 517, 398, 517, 517, 517, 517, 517, - /* 2700 */ 517, 517, 517, 517, 517, 517, 410, 517, 412, 517, - /* 2710 */ 398, 517, 517, 517, 517, 517, 517, 517, 517, 517, - /* 2720 */ 517, 517, 410, 517, 412, 517, 517, 517, 517, 517, - /* 2730 */ 517, 517, 452, 517, 517, 455, 357, 517, 517, 459, - /* 2740 */ 460, 461, 462, 463, 464, 517, 466, 517, 452, 370, - /* 2750 */ 517, 455, 357, 517, 517, 459, 460, 461, 462, 463, - /* 2760 */ 464, 517, 466, 517, 452, 370, 517, 455, 517, 357, - /* 2770 */ 517, 459, 460, 461, 462, 463, 464, 398, 466, 517, - /* 2780 */ 517, 517, 370, 517, 517, 517, 517, 517, 517, 410, - /* 2790 */ 517, 412, 517, 398, 517, 517, 517, 517, 517, 517, - /* 2800 */ 517, 517, 517, 517, 517, 410, 517, 412, 517, 517, - /* 2810 */ 398, 517, 517, 517, 517, 517, 517, 517, 517, 517, - /* 2820 */ 517, 517, 410, 517, 412, 517, 517, 517, 517, 517, - /* 2830 */ 517, 452, 517, 517, 455, 517, 517, 517, 459, 460, - /* 2840 */ 461, 462, 463, 464, 517, 466, 517, 452, 517, 517, - /* 2850 */ 455, 517, 357, 517, 459, 460, 461, 462, 463, 464, - /* 2860 */ 517, 466, 517, 517, 452, 370, 517, 455, 517, 357, - /* 2870 */ 517, 459, 460, 461, 462, 463, 464, 517, 466, 517, - /* 2880 */ 517, 517, 370, 517, 357, 517, 517, 517, 517, 517, - /* 2890 */ 517, 517, 517, 398, 517, 517, 517, 370, 517, 517, - /* 2900 */ 517, 517, 517, 517, 517, 410, 517, 412, 517, 517, - /* 2910 */ 398, 517, 517, 517, 517, 517, 517, 517, 517, 517, - /* 2920 */ 517, 517, 410, 517, 412, 398, 517, 517, 517, 517, - /* 2930 */ 517, 517, 517, 517, 517, 517, 517, 410, 517, 412, - /* 2940 */ 517, 517, 517, 517, 517, 517, 517, 452, 517, 517, - /* 2950 */ 455, 517, 517, 517, 459, 460, 461, 462, 463, 464, - /* 2960 */ 517, 466, 517, 517, 452, 517, 517, 455, 517, 517, - /* 2970 */ 517, 459, 460, 461, 462, 463, 464, 517, 466, 452, - /* 2980 */ 517, 517, 455, 517, 517, 517, 459, 460, 461, 462, - /* 2990 */ 463, 464, 517, 466, 354, 354, 354, 354, 354, 354, - /* 3000 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3010 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3020 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3030 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3040 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3050 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3060 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3070 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3080 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3090 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3100 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3110 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3120 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3130 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3140 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3150 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3160 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3170 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3180 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3190 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3200 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3210 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3220 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3230 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3240 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3250 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3260 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3270 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3280 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3290 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3300 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3310 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3320 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3330 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - /* 3340 */ 354, 354, 354, 354, 354, 354, 354, 354, + /* 260 */ 260, 12, 13, 0, 395, 20, 18, 3, 20, 20, + /* 270 */ 20, 22, 22, 20, 71, 27, 486, 183, 30, 489, + /* 280 */ 107, 70, 147, 35, 35, 435, 37, 24, 25, 26, + /* 290 */ 27, 28, 29, 30, 31, 32, 20, 507, 508, 51, + /* 300 */ 20, 53, 512, 513, 70, 55, 58, 59, 107, 117, + /* 310 */ 481, 482, 483, 484, 65, 486, 487, 69, 115, 450, + /* 320 */ 71, 482, 483, 484, 366, 486, 487, 78, 370, 0, + /* 330 */ 372, 20, 197, 198, 199, 241, 486, 202, 4, 489, + /* 340 */ 365, 8, 9, 368, 369, 12, 13, 14, 15, 16, + /* 350 */ 215, 216, 107, 104, 106, 3, 107, 507, 508, 104, + /* 360 */ 107, 226, 512, 513, 229, 117, 49, 232, 233, 234, + /* 370 */ 235, 236, 20, 370, 371, 120, 121, 122, 123, 124, + /* 380 */ 125, 126, 127, 128, 129, 182, 131, 132, 133, 134, + /* 390 */ 135, 136, 137, 390, 145, 146, 78, 149, 150, 70, + /* 400 */ 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + /* 410 */ 12, 13, 277, 165, 166, 167, 168, 169, 170, 171, + /* 420 */ 189, 173, 174, 175, 107, 145, 146, 179, 180, 181, + /* 430 */ 239, 379, 183, 184, 186, 37, 20, 8, 9, 190, + /* 440 */ 191, 12, 13, 14, 15, 16, 139, 140, 396, 20, + /* 450 */ 277, 144, 39, 40, 205, 399, 207, 405, 8, 9, + /* 460 */ 108, 185, 12, 13, 14, 15, 16, 264, 265, 266, + /* 470 */ 267, 268, 269, 270, 271, 272, 273, 274, 277, 423, + /* 480 */ 289, 290, 291, 292, 293, 294, 295, 178, 239, 240, + /* 490 */ 241, 261, 243, 244, 245, 246, 247, 248, 249, 250, + /* 500 */ 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + /* 510 */ 261, 12, 13, 358, 283, 284, 285, 286, 209, 20, + /* 520 */ 0, 22, 277, 358, 111, 112, 371, 114, 365, 387, + /* 530 */ 197, 368, 369, 2, 35, 486, 37, 185, 489, 8, + /* 540 */ 9, 4, 13, 12, 13, 14, 15, 16, 20, 117, + /* 550 */ 22, 138, 241, 411, 399, 142, 19, 508, 108, 0, + /* 560 */ 413, 512, 513, 299, 65, 37, 411, 0, 413, 0, + /* 570 */ 71, 358, 35, 73, 74, 75, 411, 78, 431, 432, + /* 580 */ 80, 81, 82, 55, 371, 377, 86, 370, 51, 475, + /* 590 */ 476, 91, 92, 93, 94, 58, 59, 97, 456, 457, + /* 600 */ 100, 185, 65, 104, 87, 207, 107, 78, 453, 467, + /* 610 */ 402, 456, 399, 279, 185, 460, 461, 462, 463, 464, + /* 620 */ 465, 261, 467, 263, 411, 470, 413, 472, 473, 474, + /* 630 */ 370, 371, 34, 478, 479, 412, 413, 304, 355, 22, + /* 640 */ 73, 74, 75, 106, 145, 146, 109, 80, 81, 82, + /* 650 */ 390, 69, 409, 86, 37, 412, 413, 241, 91, 92, + /* 660 */ 93, 94, 445, 446, 97, 71, 453, 100, 151, 456, + /* 670 */ 241, 370, 371, 460, 461, 462, 463, 464, 465, 400, + /* 680 */ 467, 65, 183, 184, 164, 472, 400, 474, 168, 190, + /* 690 */ 191, 478, 479, 176, 177, 78, 176, 138, 139, 140, + /* 700 */ 141, 142, 143, 144, 205, 37, 207, 138, 139, 140, + /* 710 */ 141, 142, 143, 144, 501, 399, 370, 371, 435, 370, + /* 720 */ 419, 104, 106, 440, 221, 109, 223, 8, 9, 20, + /* 730 */ 414, 12, 13, 14, 15, 16, 390, 140, 239, 240, + /* 740 */ 241, 144, 243, 244, 245, 246, 247, 248, 249, 250, + /* 750 */ 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + /* 760 */ 12, 13, 14, 358, 415, 416, 400, 418, 20, 486, + /* 770 */ 22, 422, 489, 370, 371, 33, 371, 399, 373, 370, + /* 780 */ 371, 399, 200, 35, 406, 37, 459, 370, 371, 407, + /* 790 */ 507, 508, 414, 358, 178, 512, 513, 138, 139, 140, + /* 800 */ 141, 142, 143, 144, 399, 441, 371, 390, 373, 227, + /* 810 */ 228, 214, 485, 65, 217, 107, 411, 220, 413, 222, + /* 820 */ 107, 471, 205, 473, 207, 2, 78, 108, 419, 370, + /* 830 */ 371, 8, 9, 239, 399, 12, 13, 14, 15, 16, + /* 840 */ 370, 371, 370, 371, 370, 371, 411, 14, 413, 390, + /* 850 */ 108, 37, 104, 20, 370, 107, 239, 240, 453, 370, + /* 860 */ 390, 456, 390, 358, 390, 460, 461, 462, 463, 464, + /* 870 */ 465, 358, 467, 358, 435, 207, 371, 472, 373, 474, + /* 880 */ 370, 371, 459, 478, 479, 482, 483, 484, 453, 486, + /* 890 */ 487, 456, 183, 145, 146, 460, 461, 462, 463, 464, + /* 900 */ 465, 379, 467, 435, 399, 237, 238, 472, 485, 474, + /* 910 */ 426, 427, 23, 478, 479, 388, 411, 204, 413, 206, + /* 920 */ 12, 13, 370, 371, 411, 486, 411, 405, 489, 419, + /* 930 */ 22, 183, 184, 20, 445, 446, 47, 48, 190, 191, + /* 940 */ 370, 371, 390, 35, 400, 37, 507, 508, 391, 236, + /* 950 */ 241, 512, 513, 205, 486, 207, 399, 489, 453, 22, + /* 960 */ 390, 456, 0, 406, 407, 460, 461, 462, 463, 464, + /* 970 */ 465, 414, 467, 65, 37, 507, 508, 472, 400, 474, + /* 980 */ 512, 513, 435, 478, 479, 277, 78, 239, 240, 241, + /* 990 */ 277, 243, 244, 245, 246, 247, 248, 249, 250, 251, + /* 1000 */ 252, 253, 254, 255, 256, 257, 258, 259, 260, 12, + /* 1010 */ 13, 21, 104, 107, 400, 78, 183, 20, 400, 22, + /* 1020 */ 399, 207, 399, 391, 20, 358, 36, 406, 38, 39, + /* 1030 */ 40, 399, 35, 486, 37, 414, 489, 414, 371, 407, + /* 1040 */ 373, 8, 9, 399, 20, 12, 13, 14, 15, 16, + /* 1050 */ 406, 237, 238, 424, 507, 508, 370, 371, 414, 512, + /* 1060 */ 513, 138, 65, 8, 9, 142, 399, 12, 13, 14, + /* 1070 */ 15, 16, 370, 371, 241, 78, 390, 20, 411, 50, + /* 1080 */ 413, 391, 370, 371, 358, 370, 371, 370, 371, 399, + /* 1090 */ 370, 371, 390, 399, 370, 371, 22, 407, 185, 358, + /* 1100 */ 406, 104, 390, 358, 107, 390, 139, 390, 414, 470, + /* 1110 */ 390, 37, 473, 205, 390, 207, 371, 471, 373, 473, + /* 1120 */ 453, 182, 358, 456, 162, 163, 358, 460, 461, 462, + /* 1130 */ 463, 464, 465, 505, 467, 370, 371, 411, 22, 472, + /* 1140 */ 42, 474, 145, 146, 399, 478, 479, 239, 240, 145, + /* 1150 */ 146, 377, 411, 37, 241, 390, 411, 0, 413, 56, + /* 1160 */ 57, 253, 254, 255, 256, 257, 258, 259, 394, 14, + /* 1170 */ 15, 16, 1, 2, 358, 411, 402, 358, 104, 411, + /* 1180 */ 183, 184, 516, 277, 399, 218, 219, 190, 191, 33, + /* 1190 */ 375, 376, 375, 376, 190, 191, 384, 385, 453, 414, + /* 1200 */ 33, 456, 205, 264, 207, 460, 461, 462, 463, 464, + /* 1210 */ 465, 358, 467, 274, 185, 359, 358, 472, 185, 474, + /* 1220 */ 104, 498, 193, 478, 479, 358, 374, 411, 399, 358, + /* 1230 */ 411, 358, 358, 358, 358, 358, 239, 240, 241, 358, + /* 1240 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + /* 1250 */ 253, 254, 255, 256, 257, 258, 259, 260, 12, 13, + /* 1260 */ 424, 358, 384, 385, 411, 241, 20, 408, 22, 411, + /* 1270 */ 411, 0, 408, 0, 371, 411, 373, 408, 411, 108, + /* 1280 */ 411, 35, 411, 37, 411, 411, 411, 411, 411, 33, + /* 1290 */ 392, 358, 411, 395, 14, 361, 362, 33, 241, 117, + /* 1300 */ 20, 45, 399, 0, 371, 275, 276, 110, 0, 45, + /* 1310 */ 113, 65, 0, 13, 411, 42, 413, 110, 110, 13, + /* 1320 */ 113, 113, 51, 110, 78, 0, 113, 0, 33, 33, + /* 1330 */ 22, 33, 399, 387, 22, 65, 33, 37, 145, 146, + /* 1340 */ 1, 2, 33, 37, 411, 387, 413, 22, 33, 22, + /* 1350 */ 104, 33, 33, 107, 172, 369, 453, 33, 0, 456, + /* 1360 */ 358, 12, 13, 460, 461, 462, 463, 464, 465, 33, + /* 1370 */ 467, 33, 37, 371, 276, 472, 424, 474, 37, 109, + /* 1380 */ 37, 478, 479, 504, 33, 33, 453, 504, 231, 456, + /* 1390 */ 107, 145, 146, 460, 461, 462, 463, 464, 465, 116, + /* 1400 */ 467, 399, 33, 108, 108, 472, 108, 474, 12, 13, + /* 1410 */ 52, 478, 479, 411, 504, 413, 434, 108, 22, 78, + /* 1420 */ 504, 13, 374, 108, 424, 13, 108, 108, 410, 183, + /* 1430 */ 184, 35, 108, 37, 33, 33, 190, 191, 33, 33, + /* 1440 */ 33, 371, 33, 33, 108, 37, 108, 442, 488, 37, + /* 1450 */ 424, 205, 424, 207, 509, 453, 480, 301, 456, 108, + /* 1460 */ 108, 65, 460, 461, 462, 463, 464, 465, 491, 467, + /* 1470 */ 303, 389, 280, 436, 472, 358, 474, 108, 51, 42, + /* 1480 */ 478, 479, 455, 20, 452, 239, 240, 241, 371, 243, + /* 1490 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + /* 1500 */ 254, 255, 256, 257, 258, 259, 260, 358, 454, 108, + /* 1510 */ 108, 447, 220, 108, 108, 108, 399, 108, 108, 379, + /* 1520 */ 371, 379, 447, 203, 438, 20, 20, 45, 411, 370, + /* 1530 */ 413, 371, 420, 371, 420, 182, 417, 371, 370, 370, + /* 1540 */ 420, 417, 207, 417, 417, 105, 383, 103, 399, 370, + /* 1550 */ 207, 102, 382, 381, 370, 370, 370, 20, 363, 50, + /* 1560 */ 411, 367, 413, 363, 20, 367, 379, 379, 447, 379, + /* 1570 */ 453, 413, 20, 456, 372, 20, 437, 460, 461, 462, + /* 1580 */ 463, 464, 465, 379, 467, 379, 372, 20, 427, 472, + /* 1590 */ 379, 474, 370, 363, 379, 478, 479, 379, 399, 370, + /* 1600 */ 399, 205, 453, 207, 399, 456, 358, 363, 399, 460, + /* 1610 */ 461, 462, 463, 464, 465, 399, 467, 107, 399, 371, + /* 1620 */ 399, 361, 399, 474, 399, 399, 399, 478, 479, 361, + /* 1630 */ 447, 411, 451, 237, 238, 239, 377, 224, 449, 411, + /* 1640 */ 20, 211, 411, 210, 377, 413, 443, 399, 436, 253, + /* 1650 */ 254, 255, 256, 257, 258, 259, 446, 370, 411, 411, + /* 1660 */ 288, 413, 497, 429, 287, 429, 296, 196, 444, 298, + /* 1670 */ 497, 297, 497, 495, 500, 358, 499, 436, 281, 300, + /* 1680 */ 305, 517, 302, 20, 371, 117, 510, 496, 371, 278, + /* 1690 */ 494, 511, 276, 372, 459, 107, 411, 411, 429, 377, + /* 1700 */ 377, 453, 411, 429, 456, 358, 188, 490, 460, 461, + /* 1710 */ 462, 463, 464, 465, 477, 467, 399, 377, 371, 425, + /* 1720 */ 107, 411, 474, 395, 22, 492, 478, 479, 411, 370, + /* 1730 */ 413, 377, 371, 377, 358, 403, 38, 411, 360, 393, + /* 1740 */ 411, 411, 411, 439, 430, 364, 399, 371, 363, 448, + /* 1750 */ 393, 358, 0, 393, 356, 0, 0, 45, 411, 0, + /* 1760 */ 413, 378, 37, 430, 371, 230, 37, 37, 37, 230, + /* 1770 */ 453, 0, 230, 456, 37, 399, 37, 460, 461, 462, + /* 1780 */ 463, 464, 465, 37, 467, 0, 230, 411, 0, 413, + /* 1790 */ 37, 474, 399, 0, 37, 478, 479, 0, 22, 0, + /* 1800 */ 453, 37, 225, 456, 411, 0, 413, 460, 461, 462, + /* 1810 */ 463, 464, 465, 466, 467, 468, 469, 213, 0, 213, + /* 1820 */ 358, 214, 207, 205, 0, 0, 0, 201, 200, 453, + /* 1830 */ 0, 0, 456, 371, 150, 49, 460, 461, 462, 463, + /* 1840 */ 464, 465, 0, 467, 49, 37, 453, 37, 0, 456, + /* 1850 */ 358, 0, 0, 460, 461, 462, 463, 464, 465, 0, + /* 1860 */ 467, 399, 51, 371, 49, 45, 0, 0, 0, 0, + /* 1870 */ 49, 0, 0, 411, 0, 413, 0, 0, 502, 503, + /* 1880 */ 37, 168, 0, 168, 0, 0, 0, 358, 0, 0, + /* 1890 */ 0, 399, 0, 0, 0, 0, 0, 0, 0, 0, + /* 1900 */ 371, 0, 0, 411, 0, 413, 49, 514, 515, 0, + /* 1910 */ 0, 0, 0, 0, 0, 453, 0, 0, 456, 0, + /* 1920 */ 45, 0, 460, 461, 462, 463, 464, 465, 399, 467, + /* 1930 */ 0, 0, 150, 0, 0, 148, 474, 22, 149, 0, + /* 1940 */ 411, 479, 413, 0, 22, 453, 22, 0, 456, 0, + /* 1950 */ 50, 0, 460, 461, 462, 463, 464, 465, 50, 467, + /* 1960 */ 358, 0, 433, 37, 0, 42, 37, 0, 65, 51, + /* 1970 */ 65, 51, 65, 371, 37, 358, 0, 42, 37, 0, + /* 1980 */ 42, 37, 453, 51, 0, 456, 33, 45, 371, 460, + /* 1990 */ 461, 462, 463, 464, 465, 503, 467, 42, 0, 49, + /* 2000 */ 14, 399, 43, 49, 42, 49, 358, 42, 196, 0, + /* 2010 */ 0, 0, 49, 411, 0, 413, 399, 0, 0, 371, + /* 2020 */ 0, 0, 0, 51, 72, 37, 0, 42, 411, 37, + /* 2030 */ 413, 51, 42, 0, 37, 433, 42, 0, 51, 37, + /* 2040 */ 51, 42, 0, 0, 0, 0, 0, 399, 0, 37, + /* 2050 */ 22, 115, 0, 113, 22, 453, 37, 33, 456, 411, + /* 2060 */ 37, 413, 460, 461, 462, 463, 464, 465, 37, 467, + /* 2070 */ 453, 37, 37, 456, 33, 358, 37, 460, 461, 462, + /* 2080 */ 463, 464, 465, 0, 467, 22, 37, 37, 371, 0, + /* 2090 */ 37, 37, 37, 358, 22, 0, 22, 0, 22, 37, + /* 2100 */ 53, 453, 0, 0, 456, 0, 371, 37, 460, 461, + /* 2110 */ 462, 463, 464, 465, 0, 467, 399, 37, 0, 358, + /* 2120 */ 22, 20, 37, 506, 37, 37, 0, 49, 411, 0, + /* 2130 */ 413, 185, 371, 108, 399, 22, 37, 107, 0, 212, + /* 2140 */ 0, 22, 185, 107, 0, 185, 411, 282, 413, 3, + /* 2150 */ 192, 3, 37, 208, 188, 185, 185, 33, 107, 37, + /* 2160 */ 399, 192, 50, 515, 108, 107, 105, 108, 433, 103, + /* 2170 */ 453, 107, 411, 456, 413, 50, 108, 460, 461, 462, + /* 2180 */ 463, 464, 465, 33, 467, 108, 469, 33, 453, 107, + /* 2190 */ 33, 456, 108, 1, 433, 460, 461, 462, 463, 464, + /* 2200 */ 465, 107, 467, 107, 35, 358, 33, 49, 49, 33, + /* 2210 */ 49, 19, 108, 107, 453, 108, 108, 456, 371, 37, + /* 2220 */ 51, 460, 461, 462, 463, 464, 465, 35, 467, 60, + /* 2230 */ 61, 62, 63, 37, 65, 37, 37, 37, 37, 108, + /* 2240 */ 33, 0, 49, 51, 0, 42, 399, 33, 275, 107, + /* 2250 */ 282, 2, 60, 61, 62, 63, 282, 65, 411, 22, + /* 2260 */ 413, 105, 262, 108, 358, 105, 239, 49, 49, 107, + /* 2270 */ 22, 108, 107, 107, 107, 106, 108, 371, 109, 108, + /* 2280 */ 242, 189, 108, 0, 107, 107, 358, 107, 42, 49, + /* 2290 */ 107, 116, 107, 107, 37, 108, 187, 107, 106, 371, + /* 2300 */ 453, 109, 108, 456, 107, 399, 117, 460, 461, 462, + /* 2310 */ 463, 464, 465, 37, 467, 107, 37, 411, 108, 413, + /* 2320 */ 107, 37, 37, 108, 107, 37, 37, 399, 108, 107, + /* 2330 */ 119, 108, 107, 33, 108, 143, 107, 107, 107, 411, + /* 2340 */ 37, 413, 130, 107, 22, 118, 130, 178, 37, 72, + /* 2350 */ 37, 130, 71, 37, 130, 37, 187, 188, 37, 453, + /* 2360 */ 37, 37, 456, 194, 195, 358, 460, 461, 462, 463, + /* 2370 */ 464, 465, 37, 467, 37, 78, 101, 78, 371, 187, + /* 2380 */ 33, 453, 213, 101, 456, 37, 194, 358, 460, 461, + /* 2390 */ 462, 463, 464, 465, 37, 467, 37, 22, 37, 37, + /* 2400 */ 371, 37, 37, 78, 37, 213, 399, 37, 37, 37, + /* 2410 */ 22, 37, 0, 37, 51, 42, 0, 51, 411, 37, + /* 2420 */ 413, 42, 0, 358, 37, 42, 0, 37, 399, 51, + /* 2430 */ 0, 42, 51, 0, 37, 37, 371, 22, 33, 22, + /* 2440 */ 411, 21, 413, 22, 20, 22, 21, 518, 518, 518, + /* 2450 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 2460 */ 453, 518, 518, 456, 399, 518, 518, 460, 461, 462, + /* 2470 */ 463, 464, 465, 518, 467, 518, 411, 518, 413, 518, + /* 2480 */ 518, 518, 453, 518, 518, 456, 518, 518, 518, 460, + /* 2490 */ 461, 462, 463, 464, 465, 518, 467, 518, 518, 518, + /* 2500 */ 518, 518, 518, 518, 518, 518, 518, 358, 518, 518, + /* 2510 */ 518, 518, 518, 518, 518, 518, 518, 518, 453, 518, + /* 2520 */ 371, 456, 358, 518, 518, 460, 461, 462, 463, 464, + /* 2530 */ 465, 518, 467, 518, 518, 371, 518, 358, 518, 518, + /* 2540 */ 518, 518, 518, 518, 518, 518, 518, 518, 399, 518, + /* 2550 */ 371, 518, 518, 358, 518, 518, 518, 518, 518, 518, + /* 2560 */ 411, 518, 413, 399, 518, 518, 371, 518, 518, 518, + /* 2570 */ 518, 518, 518, 518, 518, 411, 518, 413, 399, 518, + /* 2580 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 2590 */ 411, 518, 413, 518, 399, 518, 518, 518, 518, 518, + /* 2600 */ 518, 518, 453, 518, 518, 456, 411, 518, 413, 460, + /* 2610 */ 461, 462, 463, 464, 465, 518, 467, 453, 518, 518, + /* 2620 */ 456, 518, 518, 358, 460, 461, 462, 463, 464, 465, + /* 2630 */ 518, 467, 453, 518, 518, 456, 371, 518, 518, 460, + /* 2640 */ 461, 462, 463, 464, 465, 518, 467, 518, 453, 518, + /* 2650 */ 518, 456, 518, 518, 518, 460, 461, 462, 463, 464, + /* 2660 */ 465, 518, 467, 518, 399, 518, 518, 358, 518, 518, + /* 2670 */ 518, 518, 518, 518, 518, 518, 411, 518, 413, 518, + /* 2680 */ 371, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 2690 */ 518, 518, 518, 518, 358, 518, 518, 518, 518, 518, + /* 2700 */ 518, 518, 518, 518, 518, 518, 518, 371, 399, 518, + /* 2710 */ 518, 518, 518, 518, 518, 518, 518, 518, 453, 518, + /* 2720 */ 411, 456, 413, 518, 518, 460, 461, 462, 463, 464, + /* 2730 */ 465, 518, 467, 518, 518, 399, 518, 518, 358, 518, + /* 2740 */ 518, 518, 518, 518, 518, 518, 518, 411, 518, 413, + /* 2750 */ 518, 371, 518, 518, 358, 518, 518, 518, 518, 518, + /* 2760 */ 518, 518, 453, 518, 518, 456, 518, 371, 518, 460, + /* 2770 */ 461, 462, 463, 464, 465, 518, 467, 358, 518, 399, + /* 2780 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 453, + /* 2790 */ 371, 411, 456, 413, 518, 399, 460, 461, 462, 463, + /* 2800 */ 464, 465, 518, 467, 518, 518, 518, 411, 518, 413, + /* 2810 */ 518, 518, 518, 518, 518, 518, 518, 518, 399, 518, + /* 2820 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 2830 */ 411, 518, 413, 453, 518, 358, 456, 518, 518, 518, + /* 2840 */ 460, 461, 462, 463, 464, 465, 518, 467, 371, 453, + /* 2850 */ 518, 358, 456, 518, 518, 518, 460, 461, 462, 463, + /* 2860 */ 464, 465, 518, 467, 371, 518, 518, 518, 518, 518, + /* 2870 */ 518, 518, 453, 518, 518, 456, 399, 518, 518, 460, + /* 2880 */ 461, 462, 463, 464, 465, 518, 467, 518, 411, 518, + /* 2890 */ 413, 518, 399, 518, 518, 518, 518, 518, 518, 518, + /* 2900 */ 518, 518, 518, 518, 411, 518, 413, 518, 518, 358, + /* 2910 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 2920 */ 518, 518, 371, 518, 518, 518, 518, 518, 518, 518, + /* 2930 */ 453, 518, 518, 456, 358, 518, 518, 460, 461, 462, + /* 2940 */ 463, 464, 465, 518, 467, 518, 453, 371, 518, 456, + /* 2950 */ 399, 518, 518, 460, 461, 462, 463, 464, 465, 518, + /* 2960 */ 467, 518, 411, 518, 413, 518, 518, 358, 518, 518, + /* 2970 */ 518, 518, 518, 518, 518, 399, 518, 518, 518, 518, + /* 2980 */ 371, 518, 518, 518, 518, 518, 518, 411, 518, 413, + /* 2990 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 3000 */ 518, 518, 518, 518, 453, 518, 518, 456, 399, 518, + /* 3010 */ 518, 460, 461, 462, 463, 464, 465, 518, 467, 518, + /* 3020 */ 411, 518, 413, 518, 518, 518, 518, 518, 518, 453, + /* 3030 */ 518, 518, 456, 518, 518, 518, 460, 461, 462, 463, + /* 3040 */ 464, 465, 518, 467, 518, 518, 518, 518, 518, 518, + /* 3050 */ 518, 518, 518, 358, 518, 518, 518, 518, 518, 518, + /* 3060 */ 518, 518, 453, 518, 518, 456, 371, 518, 518, 460, + /* 3070 */ 461, 462, 463, 464, 465, 518, 467, 518, 518, 518, + /* 3080 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 3090 */ 518, 518, 518, 518, 399, 518, 518, 518, 518, 518, + /* 3100 */ 518, 518, 518, 518, 518, 518, 411, 518, 413, 518, + /* 3110 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 3120 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 3130 */ 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + /* 3140 */ 518, 518, 518, 518, 518, 518, 518, 518, 453, 518, + /* 3150 */ 518, 456, 518, 518, 518, 460, 461, 462, 463, 464, + /* 3160 */ 465, 518, 467, 355, 355, 355, 355, 355, 355, 355, + /* 3170 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3180 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3190 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3200 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3210 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3220 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3230 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3240 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3250 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3260 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3270 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3280 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3290 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3300 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3310 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3320 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3330 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3340 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3350 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3360 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3370 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3380 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3390 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3400 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3410 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3420 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3430 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3440 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3450 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3460 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3470 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3480 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3490 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3500 */ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + /* 3510 */ 355, 355, 355, 355, 355, 355, 355, 355, }; -#define YY_SHIFT_COUNT (860) +#define YY_SHIFT_COUNT (861) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2514) +#define YY_SHIFT_MAX (2433) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 134, 0, 248, 0, 497, 497, 497, 497, 497, 497, - /* 10 */ 497, 497, 497, 497, 497, 497, 745, 993, 993, 1241, - /* 20 */ 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, - /* 30 */ 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, - /* 40 */ 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, - /* 50 */ 49, 431, 571, 187, 444, 453, 444, 444, 187, 187, - /* 60 */ 444, 1300, 444, 247, 1300, 177, 444, 23, 1405, 936, - /* 70 */ 167, 167, 1405, 1405, 189, 189, 936, 251, 588, 313, - /* 80 */ 313, 208, 167, 167, 167, 167, 167, 167, 167, 167, - /* 90 */ 167, 167, 167, 205, 304, 167, 167, 338, 23, 167, - /* 100 */ 205, 167, 23, 167, 167, 23, 167, 167, 23, 167, - /* 110 */ 23, 23, 23, 167, 359, 202, 202, 491, 66, 740, - /* 120 */ 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, - /* 130 */ 740, 740, 740, 740, 740, 740, 740, 740, 1092, 301, - /* 140 */ 251, 588, 379, 379, 283, 330, 330, 330, 264, 264, - /* 150 */ 738, 276, 283, 338, 230, 23, 158, 23, 23, 440, - /* 160 */ 23, 440, 440, 473, 752, 253, 253, 253, 253, 253, - /* 170 */ 253, 253, 253, 2117, 455, 21, 46, 67, 190, 25, - /* 180 */ 834, 94, 549, 27, 27, 50, 533, 922, 1129, 1129, - /* 190 */ 1129, 1009, 828, 1129, 759, 889, 635, 1039, 1002, 889, - /* 200 */ 889, 962, 910, 999, 1013, 910, 1163, 636, 276, 1198, - /* 210 */ 1454, 1472, 1508, 1312, 338, 1508, 338, 1341, 1524, 1526, - /* 220 */ 1505, 1526, 1505, 1381, 1524, 1526, 1524, 1505, 1381, 1381, - /* 230 */ 1381, 1468, 1473, 1524, 1478, 1524, 1524, 1524, 1565, 1537, - /* 240 */ 1565, 1537, 1508, 338, 338, 1572, 338, 1578, 1579, 338, - /* 250 */ 1578, 338, 1586, 338, 338, 1524, 338, 1565, 23, 23, - /* 260 */ 23, 23, 23, 23, 23, 23, 23, 23, 23, 1524, - /* 270 */ 752, 752, 1565, 440, 440, 440, 1415, 1533, 1508, 359, - /* 280 */ 1646, 1457, 1460, 1572, 359, 1198, 1524, 440, 1387, 1390, - /* 290 */ 1387, 1390, 1384, 1485, 1387, 1391, 1389, 1426, 1198, 1380, - /* 300 */ 1408, 1414, 1443, 1526, 1694, 1607, 1448, 1578, 359, 359, - /* 310 */ 1622, 1390, 440, 440, 440, 440, 1390, 440, 1544, 359, - /* 320 */ 473, 359, 1526, 440, 440, 1641, 440, 1524, 359, 1732, - /* 330 */ 1725, 1565, 2994, 2994, 2994, 2994, 2994, 2994, 2994, 2994, - /* 340 */ 2994, 36, 1001, 314, 535, 617, 183, 676, 15, 783, - /* 350 */ 824, 318, 778, 597, 597, 597, 597, 597, 597, 597, - /* 360 */ 597, 597, 686, 376, 504, 207, 207, 96, 286, 637, - /* 370 */ 271, 594, 614, 724, 8, 985, 1076, 259, 543, 833, - /* 380 */ 398, 543, 543, 543, 768, 768, 1272, 968, 760, 1080, - /* 390 */ 1246, 1020, 1226, 1147, 1184, 1185, 1190, 1270, 1277, 1316, - /* 400 */ 1320, 1321, 1325, 1082, 1301, 1303, 1220, 1311, 1313, 1330, - /* 410 */ 1340, 1186, 643, 987, 1333, 1396, 1344, 1079, 1347, 1305, - /* 420 */ 1370, 1399, 1401, 1404, 1413, 1339, 1418, 1432, 1439, 1441, - /* 430 */ 1469, 1470, 1233, 1319, 1335, 1357, 1388, 822, 1449, 1779, - /* 440 */ 1790, 1791, 1748, 1796, 1762, 1571, 1765, 1766, 1767, 1582, - /* 450 */ 1813, 1777, 1778, 1587, 1780, 1831, 1609, 1835, 1804, 1842, - /* 460 */ 1806, 1850, 1832, 1853, 1818, 1632, 1857, 1647, 1858, 1648, - /* 470 */ 1649, 1657, 1661, 1866, 1869, 1870, 1671, 1673, 1874, 1881, - /* 480 */ 1728, 1833, 1840, 1891, 1856, 1895, 1896, 1863, 1852, 1901, - /* 490 */ 1855, 1906, 1862, 1908, 1909, 1910, 1864, 1911, 1912, 1920, - /* 500 */ 1921, 1928, 1930, 1749, 1894, 1932, 1768, 1933, 1936, 1940, - /* 510 */ 1947, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, - /* 520 */ 1958, 1960, 1961, 1964, 1972, 1974, 1889, 1975, 1934, 1977, - /* 530 */ 1978, 1980, 1981, 1983, 1984, 1985, 1965, 1986, 1838, 1989, - /* 540 */ 1841, 1991, 1844, 1993, 1994, 1976, 1946, 1979, 1959, 1997, - /* 550 */ 1935, 1966, 2002, 1941, 2005, 1942, 2008, 2010, 1982, 1962, - /* 560 */ 1969, 2014, 1987, 1971, 1973, 2017, 1988, 1990, 2000, 2020, - /* 570 */ 1992, 2026, 1998, 2003, 1995, 1999, 2001, 2016, 2004, 2027, - /* 580 */ 2006, 2009, 2031, 2032, 2033, 2036, 2015, 1843, 2039, 1999, - /* 590 */ 2007, 2044, 2046, 2011, 2047, 2055, 2022, 2012, 2018, 2064, - /* 600 */ 2034, 2024, 2037, 2073, 2041, 2030, 2040, 2090, 2056, 2048, - /* 610 */ 2050, 2095, 2098, 2107, 2109, 2112, 2114, 2019, 2025, 2078, - /* 620 */ 2099, 2120, 2080, 2085, 2092, 2094, 2096, 2100, 2103, 2105, - /* 630 */ 2102, 2110, 2108, 2111, 2122, 2113, 2132, 2124, 2147, 2127, - /* 640 */ 2151, 2134, 2101, 2157, 2136, 2123, 2161, 2162, 2163, 2128, - /* 650 */ 2164, 2129, 2167, 2148, 2149, 2137, 2144, 2146, 2063, 2066, - /* 660 */ 2184, 2029, 2079, 2021, 1999, 2138, 2185, 2038, 2153, 2166, - /* 670 */ 2191, 2023, 2170, 2043, 2028, 2193, 2194, 2049, 2045, 2053, - /* 680 */ 2051, 2196, 2168, 1915, 2104, 2089, 2118, 2116, 2171, 2173, - /* 690 */ 2121, 2169, 2115, 2188, 2131, 2133, 2183, 2206, 2135, 2139, - /* 700 */ 2140, 2142, 2143, 2207, 2172, 2195, 2145, 2212, 1937, 2150, - /* 710 */ 2159, 2247, 2220, 2042, 2218, 2222, 2233, 2235, 2238, 2240, - /* 720 */ 2176, 2181, 2242, 2057, 2254, 2243, 2293, 2294, 2189, 2256, - /* 730 */ 2266, 2197, 2052, 2199, 2298, 2279, 2067, 2198, 2200, 2204, - /* 740 */ 2267, 2208, 2210, 2269, 2211, 2299, 2081, 2217, 2219, 2224, - /* 750 */ 2227, 2228, 2155, 2239, 2320, 2283, 2178, 2245, 2229, 1999, - /* 760 */ 2300, 2248, 2249, 2259, 2250, 2262, 2230, 2264, 2336, 2337, - /* 770 */ 2274, 2276, 2348, 2281, 2278, 2350, 2282, 2287, 2354, 2289, - /* 780 */ 2295, 2370, 2302, 2304, 2373, 2306, 2284, 2285, 2286, 2288, - /* 790 */ 2301, 2303, 2310, 2386, 2315, 2387, 2319, 2386, 2386, 2405, - /* 800 */ 2357, 2359, 2394, 2397, 2398, 2399, 2400, 2401, 2402, 2403, - /* 810 */ 2406, 2364, 2331, 2366, 2345, 2416, 2413, 2415, 2417, 2431, - /* 820 */ 2424, 2426, 2427, 2388, 2102, 2430, 2110, 2433, 2434, 2441, - /* 830 */ 2443, 2460, 2447, 2485, 2449, 2437, 2450, 2489, 2454, 2442, - /* 840 */ 2458, 2502, 2466, 2453, 2463, 2506, 2470, 2457, 2467, 2510, - /* 850 */ 2475, 2476, 2514, 2493, 2483, 2496, 2498, 2499, 2500, 2504, - /* 860 */ 2497, + /* 0 */ 135, 0, 249, 0, 499, 499, 499, 499, 499, 499, + /* 10 */ 499, 499, 499, 499, 499, 499, 748, 997, 997, 1246, + /* 20 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + /* 30 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + /* 40 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + /* 50 */ 201, 245, 713, 253, 708, 906, 708, 708, 253, 253, + /* 60 */ 708, 908, 708, 248, 908, 173, 708, 39, 1396, 1004, + /* 70 */ 60, 60, 1396, 1396, 190, 190, 1004, 12, 280, 150, + /* 80 */ 150, 311, 60, 60, 60, 60, 60, 60, 60, 60, + /* 90 */ 60, 60, 60, 83, 167, 60, 60, 211, 39, 60, + /* 100 */ 83, 60, 39, 60, 60, 39, 60, 60, 39, 60, + /* 110 */ 39, 39, 39, 60, 234, 203, 203, 500, 202, 617, + /* 120 */ 617, 617, 617, 617, 617, 617, 617, 617, 617, 617, + /* 130 */ 617, 617, 617, 617, 617, 617, 617, 617, 413, 352, + /* 140 */ 12, 280, 1103, 1103, 9, 276, 276, 276, 360, 360, + /* 150 */ 329, 529, 9, 211, 192, 39, 230, 39, 39, 318, + /* 160 */ 39, 318, 318, 432, 598, 255, 255, 255, 255, 255, + /* 170 */ 255, 255, 255, 2192, 567, 23, 429, 333, 191, 231, + /* 180 */ 528, 94, 833, 398, 398, 416, 889, 913, 937, 937, + /* 190 */ 937, 1029, 709, 937, 250, 1024, 1280, 923, 309, 1024, + /* 200 */ 1024, 1057, 1030, 1098, 264, 1030, 1256, 334, 529, 1192, + /* 210 */ 1427, 1437, 1463, 1292, 211, 1463, 211, 1320, 1505, 1506, + /* 220 */ 1482, 1506, 1482, 1353, 1505, 1506, 1505, 1482, 1353, 1353, + /* 230 */ 1353, 1440, 1444, 1505, 1449, 1505, 1505, 1505, 1537, 1509, + /* 240 */ 1537, 1509, 1463, 211, 211, 1544, 211, 1552, 1555, 211, + /* 250 */ 1552, 211, 1567, 211, 211, 1505, 211, 1537, 39, 39, + /* 260 */ 39, 39, 39, 39, 39, 39, 39, 39, 39, 1505, + /* 270 */ 598, 598, 1537, 318, 318, 318, 1413, 1510, 1463, 234, + /* 280 */ 1620, 1430, 1433, 1544, 234, 1192, 1505, 318, 1372, 1377, + /* 290 */ 1372, 1377, 1370, 1471, 1372, 1371, 1374, 1397, 1192, 1375, + /* 300 */ 1380, 1379, 1416, 1506, 1663, 1568, 1411, 1552, 234, 234, + /* 310 */ 1588, 1377, 318, 318, 318, 318, 1377, 318, 1518, 234, + /* 320 */ 432, 234, 1506, 318, 318, 1613, 318, 1505, 234, 1702, + /* 330 */ 1698, 1537, 3163, 3163, 3163, 3163, 3163, 3163, 3163, 3163, + /* 340 */ 3163, 36, 2169, 263, 537, 48, 450, 719, 531, 823, + /* 350 */ 1033, 559, 569, 1055, 1055, 1055, 1055, 1055, 1055, 1055, + /* 360 */ 1055, 1055, 659, 597, 990, 26, 26, 582, 616, 520, + /* 370 */ 517, 122, 668, 814, 962, 1074, 1116, 967, 1155, 1171, + /* 380 */ 939, 1155, 1155, 1155, 307, 307, 1271, 1157, 742, 1273, + /* 390 */ 1264, 1182, 1303, 1197, 1207, 1208, 1213, 1300, 1306, 1308, + /* 400 */ 1312, 1325, 1327, 503, 1295, 1296, 1270, 1298, 1309, 1315, + /* 410 */ 1318, 1193, 1156, 1167, 1319, 1339, 1324, 594, 1336, 317, + /* 420 */ 1338, 1351, 1352, 1369, 1401, 1349, 1402, 1405, 1406, 1407, + /* 430 */ 1409, 1410, 1283, 1335, 1343, 1408, 1412, 1341, 1358, 1752, + /* 440 */ 1755, 1756, 1712, 1759, 1725, 1535, 1729, 1730, 1731, 1539, + /* 450 */ 1771, 1737, 1739, 1542, 1746, 1785, 1556, 1788, 1753, 1793, + /* 460 */ 1757, 1797, 1776, 1799, 1764, 1577, 1805, 1604, 1818, 1606, + /* 470 */ 1607, 1615, 1618, 1824, 1825, 1826, 1626, 1628, 1830, 1831, + /* 480 */ 1684, 1786, 1795, 1842, 1808, 1851, 1852, 1810, 1811, 1848, + /* 490 */ 1815, 1859, 1820, 1866, 1867, 1868, 1821, 1869, 1871, 1872, + /* 500 */ 1874, 1876, 1877, 1713, 1843, 1882, 1715, 1884, 1885, 1886, + /* 510 */ 1888, 1889, 1890, 1892, 1893, 1894, 1895, 1896, 1897, 1898, + /* 520 */ 1899, 1901, 1902, 1904, 1909, 1910, 1857, 1911, 1875, 1912, + /* 530 */ 1913, 1914, 1916, 1917, 1919, 1921, 1930, 1915, 1931, 1782, + /* 540 */ 1933, 1789, 1934, 1787, 1939, 1943, 1922, 1900, 1924, 1908, + /* 550 */ 1947, 1903, 1926, 1949, 1905, 1951, 1907, 1961, 1964, 1929, + /* 560 */ 1918, 1923, 1967, 1937, 1920, 1935, 1976, 1941, 1932, 1938, + /* 570 */ 1979, 1944, 1984, 1942, 1955, 1953, 1950, 1954, 1986, 1956, + /* 580 */ 1998, 1959, 1962, 2014, 2017, 2018, 2020, 1965, 1812, 2009, + /* 590 */ 1950, 1963, 2010, 2011, 1952, 2021, 2022, 1988, 1972, 1985, + /* 600 */ 2026, 1992, 1980, 1990, 2033, 1997, 1987, 1994, 2037, 2002, + /* 610 */ 1989, 1999, 2042, 2043, 2044, 2045, 2046, 2048, 1936, 1940, + /* 620 */ 2012, 2028, 2052, 2019, 2023, 2031, 2034, 2035, 2039, 2049, + /* 630 */ 2050, 2024, 2041, 2053, 2054, 2032, 2055, 2083, 2063, 2089, + /* 640 */ 2072, 2095, 2074, 2047, 2097, 2076, 2062, 2102, 2103, 2105, + /* 650 */ 2070, 2114, 2080, 2118, 2098, 2101, 2085, 2087, 2088, 2025, + /* 660 */ 2030, 2126, 1946, 2036, 1927, 1950, 2078, 2129, 1957, 2099, + /* 670 */ 2113, 2138, 1945, 2119, 1960, 1966, 2140, 2144, 1970, 1958, + /* 680 */ 1971, 1969, 2146, 2124, 1865, 2051, 2056, 2058, 2059, 2115, + /* 690 */ 2122, 2064, 2112, 2061, 2125, 2066, 2068, 2150, 2154, 2077, + /* 700 */ 2082, 2094, 2096, 2084, 2157, 2158, 2159, 2106, 2173, 1968, + /* 710 */ 2104, 2107, 2148, 2176, 1974, 2182, 2196, 2198, 2199, 2200, + /* 720 */ 2201, 2108, 2131, 2161, 1973, 2207, 2193, 2241, 2244, 2142, + /* 730 */ 2203, 2214, 2156, 2000, 2160, 2249, 2237, 2027, 2155, 2162, + /* 740 */ 2163, 2218, 2165, 2166, 2219, 2168, 2248, 2038, 2167, 2171, + /* 750 */ 2174, 2177, 2178, 2092, 2180, 2283, 2246, 2109, 2183, 2175, + /* 760 */ 1950, 2240, 2185, 2186, 2187, 2190, 2197, 2189, 2194, 2257, + /* 770 */ 2276, 2208, 2210, 2279, 2213, 2215, 2284, 2217, 2220, 2285, + /* 780 */ 2222, 2223, 2288, 2225, 2226, 2289, 2229, 2212, 2216, 2221, + /* 790 */ 2224, 2211, 2227, 2230, 2300, 2231, 2303, 2236, 2300, 2300, + /* 800 */ 2322, 2277, 2281, 2311, 2313, 2316, 2318, 2321, 2323, 2324, + /* 810 */ 2335, 2337, 2297, 2275, 2299, 2282, 2347, 2348, 2357, 2359, + /* 820 */ 2375, 2361, 2362, 2364, 2325, 2024, 2365, 2041, 2367, 2370, + /* 830 */ 2371, 2372, 2388, 2374, 2412, 2376, 2363, 2373, 2416, 2382, + /* 840 */ 2366, 2379, 2422, 2387, 2378, 2383, 2426, 2390, 2381, 2389, + /* 850 */ 2430, 2397, 2398, 2433, 2415, 2405, 2417, 2420, 2421, 2423, + /* 860 */ 2425, 2424, }; #define YY_REDUCE_COUNT (340) -#define YY_REDUCE_MIN (-464) -#define YY_REDUCE_MAX (2527) +#define YY_REDUCE_MIN (-479) +#define YY_REDUCE_MAX (2695) static const short yy_reduce_ofst[] = { - /* 0 */ -280, 204, 250, 403, 433, 503, 657, 681, 898, 929, - /* 10 */ 998, 1056, 1153, 1234, 1307, 1346, 757, 1366, 1385, 1424, - /* 20 */ 1463, 1482, 1507, 1606, 1625, 1642, 1664, 1743, 1802, 1819, - /* 30 */ 1878, 1899, 1916, 1938, 1996, 2013, 2035, 2071, 2154, 2179, - /* 40 */ 2213, 2280, 2296, 2312, 2379, 2395, 2412, 2495, 2512, 2527, - /* 50 */ -344, -219, -210, -41, -335, 111, 536, 538, 153, 401, - /* 60 */ 781, 217, 441, -266, 242, -444, -327, 627, 112, -412, - /* 70 */ -33, 54, -366, 121, -363, -361, -374, 91, -306, -205, - /* 80 */ 162, 396, -90, 2, 394, 418, -58, 277, 452, 509, - /* 90 */ 568, 570, 555, -360, -353, 642, 665, 220, 319, 687, - /* 100 */ 324, 703, 404, 705, 714, 680, 726, 735, 448, 779, - /* 110 */ 766, 748, 767, 801, 684, -464, -464, -115, -270, -148, - /* 120 */ 296, 462, 513, 576, 689, 848, 854, 857, 870, 871, - /* 130 */ 872, 899, 905, 908, 914, 916, 918, 920, -94, -311, - /* 140 */ -321, -379, 557, 644, 316, -311, 358, 487, 149, 505, - /* 150 */ 293, -245, 704, 661, 560, 51, 81, 317, 320, 365, - /* 160 */ 776, 495, 701, 769, 741, -397, 412, 478, 537, 551, - /* 170 */ 638, 691, 551, 746, 805, 842, 861, 790, 829, 877, - /* 180 */ 994, 981, 981, 996, 997, 976, 1017, 982, 911, 912, - /* 190 */ 913, 989, 981, 917, 1055, 1006, 1063, 1026, 995, 1016, - /* 200 */ 1021, 981, 956, 956, 948, 956, 984, 977, 1085, 1047, - /* 210 */ 1059, 1071, 1084, 1081, 1157, 1090, 1159, 1105, 1176, 1178, - /* 220 */ 1140, 1191, 1141, 1148, 1197, 1199, 1201, 1149, 1151, 1155, - /* 230 */ 1156, 1192, 1194, 1210, 1202, 1212, 1214, 1215, 1224, 1222, - /* 240 */ 1227, 1228, 1144, 1217, 1218, 1181, 1219, 1229, 1165, 1225, - /* 250 */ 1231, 1232, 1195, 1240, 1242, 1238, 1244, 1261, 1230, 1235, - /* 260 */ 1236, 1237, 1239, 1247, 1249, 1250, 1251, 1252, 1253, 1256, - /* 270 */ 1267, 1269, 1274, 1243, 1245, 1255, 1189, 1204, 1208, 1280, - /* 280 */ 1223, 1248, 1257, 1258, 1295, 1266, 1304, 1262, 1179, 1254, - /* 290 */ 1182, 1259, 1193, 1183, 1187, 1207, 1196, 1211, 1273, 1205, - /* 300 */ 1200, 1206, 956, 1350, 1264, 1260, 1263, 1355, 1351, 1352, - /* 310 */ 1265, 1302, 1322, 1323, 1324, 1327, 1310, 1329, 1326, 1359, - /* 320 */ 1349, 1364, 1375, 1336, 1337, 1358, 1343, 1392, 1373, 1398, - /* 330 */ 1402, 1410, 1348, 1328, 1345, 1353, 1395, 1397, 1400, 1411, - /* 340 */ 1422, + /* 0 */ 283, -313, 155, 213, 405, 435, 505, 667, 745, 903, + /* 10 */ 933, 1002, 1117, 1149, 1248, 1317, 1347, 1376, 1393, 1462, + /* 20 */ 1492, 1529, 1602, 1617, 1648, 1717, 1735, 1761, 1847, 1906, + /* 30 */ 1928, 2007, 2029, 2065, 2149, 2164, 2179, 2195, 2265, 2309, + /* 40 */ 2336, 2380, 2396, 2419, 2477, 2493, 2551, 2576, 2609, 2695, + /* 50 */ -345, -315, -419, -171, -210, -150, 439, 468, -161, 403, + /* 60 */ 547, -384, -479, 349, 142, -407, 49, 557, -232, -413, + /* 70 */ -366, -295, -390, -371, -25, 163, 147, -331, 243, -364, + /* 80 */ -42, -302, 3, 260, 346, 417, 301, 409, 459, 470, + /* 90 */ 472, 474, 510, 217, 484, 552, 570, 52, 378, 686, + /* 100 */ 489, 702, 621, 712, 715, -185, 717, 720, 644, 724, + /* 110 */ 632, 694, 690, 765, 774, 114, 114, -379, -202, 165, + /* 120 */ 513, 515, 726, 741, 764, 768, 816, 819, 853, 858, + /* 130 */ 867, 871, 873, 874, 875, 876, 877, 881, -190, -442, + /* 140 */ 56, 223, 815, 817, 812, -442, 327, 423, 350, 646, + /* 150 */ 208, -208, 878, 522, -131, 316, 639, 623, 382, 859, + /* 160 */ 785, 864, 869, 898, 934, 279, 286, 366, 544, 578, + /* 170 */ 614, 618, 578, 364, 527, 856, 629, 666, 628, 723, + /* 180 */ 852, 829, 829, 946, 958, 836, 986, 952, 879, 883, + /* 190 */ 910, 982, 829, 916, 1048, 1000, 1070, 1018, 1005, 1026, + /* 200 */ 1028, 829, 960, 960, 945, 960, 976, 977, 1082, 1037, + /* 210 */ 1027, 1054, 1064, 1032, 1140, 1075, 1142, 1086, 1159, 1160, + /* 220 */ 1112, 1162, 1114, 1119, 1168, 1166, 1169, 1120, 1124, 1126, + /* 230 */ 1127, 1163, 1170, 1179, 1172, 1184, 1185, 1186, 1195, 1194, + /* 240 */ 1200, 1198, 1121, 1187, 1188, 1158, 1190, 1202, 1139, 1204, + /* 250 */ 1214, 1206, 1161, 1211, 1215, 1222, 1218, 1230, 1199, 1201, + /* 260 */ 1205, 1209, 1216, 1219, 1221, 1223, 1225, 1226, 1227, 1229, + /* 270 */ 1260, 1268, 1244, 1220, 1228, 1231, 1181, 1189, 1183, 1259, + /* 280 */ 1210, 1224, 1203, 1232, 1267, 1212, 1287, 1247, 1165, 1234, + /* 290 */ 1173, 1236, 1174, 1177, 1175, 1191, 1178, 1196, 1241, 1164, + /* 300 */ 1180, 1176, 960, 1313, 1235, 1233, 1217, 1321, 1322, 1323, + /* 310 */ 1237, 1269, 1285, 1286, 1291, 1310, 1274, 1326, 1294, 1340, + /* 320 */ 1328, 1354, 1361, 1329, 1330, 1332, 1331, 1359, 1356, 1378, + /* 330 */ 1381, 1385, 1304, 1301, 1314, 1333, 1346, 1357, 1360, 1383, + /* 340 */ 1398, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 10 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 20 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 30 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 40 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 50 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 60 */ 2295, 1954, 1954, 2258, 1954, 1954, 1954, 1954, 1954, 1954, - /* 70 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2265, 1954, 1954, - /* 80 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 90 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2053, 1954, 1954, - /* 100 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 110 */ 1954, 1954, 1954, 1954, 2051, 2519, 1954, 1954, 1954, 1954, - /* 120 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 130 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2531, - /* 140 */ 1954, 1954, 2025, 2025, 1954, 2531, 2531, 2531, 2491, 2491, - /* 150 */ 2051, 1954, 1954, 2053, 2333, 1954, 1954, 1954, 1954, 1954, - /* 160 */ 1954, 1954, 1954, 2177, 1984, 1954, 1954, 1954, 1954, 2201, - /* 170 */ 1954, 1954, 1954, 2321, 1954, 1954, 2560, 2622, 1954, 2563, - /* 180 */ 1954, 1954, 1954, 1954, 1954, 2270, 1954, 2550, 1954, 1954, - /* 190 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2129, 2315, 1954, - /* 200 */ 1954, 1954, 2523, 2537, 2606, 2524, 2521, 2544, 1954, 2554, - /* 210 */ 1954, 2358, 1954, 2347, 2053, 1954, 2053, 2308, 2253, 1954, - /* 220 */ 2263, 1954, 2263, 2260, 1954, 1954, 1954, 2263, 2260, 2260, - /* 230 */ 2260, 2118, 2114, 1954, 2112, 1954, 1954, 1954, 1954, 2009, - /* 240 */ 1954, 2009, 1954, 2053, 2053, 1954, 2053, 1954, 1954, 2053, - /* 250 */ 1954, 2053, 1954, 2053, 2053, 1954, 2053, 1954, 1954, 1954, - /* 260 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 270 */ 1954, 1954, 1954, 1954, 1954, 1954, 2345, 2331, 1954, 2051, - /* 280 */ 1954, 2319, 2317, 1954, 2051, 2554, 1954, 1954, 2576, 2571, - /* 290 */ 2576, 2571, 2590, 2586, 2576, 2595, 2592, 2556, 2554, 2625, - /* 300 */ 2612, 2608, 2537, 1954, 1954, 2542, 2540, 1954, 2051, 2051, - /* 310 */ 1954, 2571, 1954, 1954, 1954, 1954, 2571, 1954, 1954, 2051, - /* 320 */ 1954, 2051, 1954, 1954, 1954, 2145, 1954, 1954, 2051, 1954, - /* 330 */ 1993, 1954, 2310, 2336, 2291, 2291, 2180, 2180, 2180, 2054, - /* 340 */ 1959, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 350 */ 1954, 1954, 1954, 2589, 2588, 2443, 1954, 2495, 2494, 2493, - /* 360 */ 2484, 2442, 2141, 1954, 1954, 2441, 2440, 1954, 1954, 1954, - /* 370 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2434, 1954, - /* 380 */ 1954, 2435, 2433, 2432, 2282, 2281, 1954, 1954, 1954, 1954, - /* 390 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 400 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 410 */ 1954, 1954, 2609, 2613, 1954, 2520, 1954, 1954, 1954, 2414, - /* 420 */ 1954, 1954, 1954, 1954, 1954, 2382, 1954, 1954, 1954, 1954, - /* 430 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 440 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 450 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 460 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 470 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 480 */ 2259, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 490 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 500 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 510 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 520 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 530 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 540 */ 1954, 1954, 2274, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 550 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 560 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 570 */ 1954, 1954, 1954, 1954, 1998, 2421, 1954, 1954, 1954, 1954, - /* 580 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2424, - /* 590 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 600 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 610 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 620 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 630 */ 2093, 2092, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 640 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 650 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2425, 1954, - /* 660 */ 1954, 1954, 1954, 1954, 2416, 1954, 1954, 1954, 1954, 1954, - /* 670 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 680 */ 1954, 2605, 2557, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 690 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 700 */ 1954, 1954, 1954, 1954, 1954, 2414, 1954, 2587, 1954, 1954, - /* 710 */ 2603, 1954, 2607, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 720 */ 2530, 2526, 1954, 1954, 2522, 1954, 1954, 1954, 1954, 1954, - /* 730 */ 2481, 1954, 1954, 1954, 2515, 1954, 1954, 1954, 1954, 1954, - /* 740 */ 1954, 1954, 1954, 1954, 2425, 1954, 2428, 1954, 1954, 1954, - /* 750 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 2413, - /* 760 */ 1954, 2466, 2465, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 770 */ 2174, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 780 */ 1954, 1954, 1954, 1954, 1954, 1954, 2158, 2156, 2155, 2154, - /* 790 */ 1954, 2151, 1954, 2187, 1954, 1954, 1954, 2183, 2182, 1954, - /* 800 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 810 */ 1954, 1954, 1954, 1954, 1954, 2072, 1954, 1954, 1954, 1954, - /* 820 */ 1954, 1954, 1954, 1954, 2064, 1954, 2063, 1954, 1954, 1954, - /* 830 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 840 */ 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, - /* 850 */ 1954, 1954, 1954, 1954, 1983, 1954, 1954, 1954, 1954, 1954, - /* 860 */ 1954, + /* 0 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 10 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 20 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 30 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 40 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 50 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 60 */ 2298, 1956, 1956, 2261, 1956, 1956, 1956, 1956, 1956, 1956, + /* 70 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2268, 1956, 1956, + /* 80 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 90 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2055, 1956, 1956, + /* 100 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 110 */ 1956, 1956, 1956, 1956, 2053, 2522, 1956, 1956, 1956, 1956, + /* 120 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 130 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2534, + /* 140 */ 1956, 1956, 2027, 2027, 1956, 2534, 2534, 2534, 2494, 2494, + /* 150 */ 2053, 1956, 1956, 2055, 2336, 1956, 1956, 1956, 1956, 1956, + /* 160 */ 1956, 1956, 1956, 2179, 1986, 1956, 1956, 1956, 1956, 2203, + /* 170 */ 1956, 1956, 1956, 2324, 1956, 1956, 2563, 2625, 1956, 2566, + /* 180 */ 1956, 1956, 1956, 1956, 1956, 2273, 1956, 2553, 1956, 1956, + /* 190 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2131, 2318, 1956, + /* 200 */ 1956, 1956, 2526, 2540, 2609, 2527, 2524, 2547, 1956, 2557, + /* 210 */ 1956, 2361, 1956, 2350, 2055, 1956, 2055, 2311, 2256, 1956, + /* 220 */ 2266, 1956, 2266, 2263, 1956, 1956, 1956, 2266, 2263, 2263, + /* 230 */ 2263, 2120, 2116, 1956, 2114, 1956, 1956, 1956, 1956, 2011, + /* 240 */ 1956, 2011, 1956, 2055, 2055, 1956, 2055, 1956, 1956, 2055, + /* 250 */ 1956, 2055, 1956, 2055, 2055, 1956, 2055, 1956, 1956, 1956, + /* 260 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 270 */ 1956, 1956, 1956, 1956, 1956, 1956, 2348, 2334, 1956, 2053, + /* 280 */ 1956, 2322, 2320, 1956, 2053, 2557, 1956, 1956, 2579, 2574, + /* 290 */ 2579, 2574, 2593, 2589, 2579, 2598, 2595, 2559, 2557, 2628, + /* 300 */ 2615, 2611, 2540, 1956, 1956, 2545, 2543, 1956, 2053, 2053, + /* 310 */ 1956, 2574, 1956, 1956, 1956, 1956, 2574, 1956, 1956, 2053, + /* 320 */ 1956, 2053, 1956, 1956, 1956, 2147, 1956, 1956, 2053, 1956, + /* 330 */ 1995, 1956, 2313, 2339, 2294, 2294, 2182, 2182, 2182, 2056, + /* 340 */ 1961, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 350 */ 1956, 1956, 1956, 2592, 2591, 2446, 1956, 2498, 2497, 2496, + /* 360 */ 2487, 2445, 2143, 1956, 1956, 2444, 2443, 1956, 1956, 1956, + /* 370 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2437, 1956, + /* 380 */ 1956, 2438, 2436, 2435, 2285, 2284, 1956, 1956, 1956, 1956, + /* 390 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 400 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 410 */ 1956, 1956, 2612, 2616, 1956, 2523, 1956, 1956, 1956, 2417, + /* 420 */ 1956, 1956, 1956, 1956, 1956, 2385, 1956, 1956, 1956, 1956, + /* 430 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 440 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 450 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 460 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 470 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 480 */ 2262, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 490 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 500 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 510 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 520 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 530 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 540 */ 1956, 1956, 1956, 2277, 1956, 1956, 1956, 1956, 1956, 1956, + /* 550 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 560 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 570 */ 1956, 1956, 1956, 1956, 1956, 2000, 2424, 1956, 1956, 1956, + /* 580 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 590 */ 2427, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 600 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 610 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 620 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 630 */ 1956, 2095, 2094, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 640 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 650 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2428, + /* 660 */ 1956, 1956, 1956, 1956, 1956, 2419, 1956, 1956, 1956, 1956, + /* 670 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 680 */ 1956, 1956, 2608, 2560, 1956, 1956, 1956, 1956, 1956, 1956, + /* 690 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 700 */ 1956, 1956, 1956, 1956, 1956, 1956, 2417, 1956, 2590, 1956, + /* 710 */ 1956, 2606, 1956, 2610, 1956, 1956, 1956, 1956, 1956, 1956, + /* 720 */ 1956, 2533, 2529, 1956, 1956, 2525, 1956, 1956, 1956, 1956, + /* 730 */ 1956, 2484, 1956, 1956, 1956, 2518, 1956, 1956, 1956, 1956, + /* 740 */ 1956, 1956, 1956, 1956, 1956, 2428, 1956, 2431, 1956, 1956, + /* 750 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 760 */ 2416, 1956, 2469, 2468, 1956, 1956, 1956, 1956, 1956, 1956, + /* 770 */ 1956, 2176, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 780 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 2160, 2158, 2157, + /* 790 */ 2156, 1956, 2153, 1956, 2189, 1956, 1956, 1956, 2185, 2184, + /* 800 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 810 */ 1956, 1956, 1956, 1956, 1956, 1956, 2074, 1956, 1956, 1956, + /* 820 */ 1956, 1956, 1956, 1956, 1956, 2066, 1956, 2065, 1956, 1956, + /* 830 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 840 */ 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + /* 850 */ 1956, 1956, 1956, 1956, 1956, 1985, 1956, 1956, 1956, 1956, + /* 860 */ 1956, 1956, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1204,7 +1238,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 305, /* END => ABORT */ + 306, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1218,7 +1252,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* USING => nothing */ 0, /* TAGS => nothing */ 0, /* PRIMARY => nothing */ - 305, /* KEY => ABORT */ + 306, /* KEY => ABORT */ 0, /* BOOL => nothing */ 0, /* TINYINT => nothing */ 0, /* SMALLINT => nothing */ @@ -1253,6 +1287,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* STABLES => nothing */ 0, /* MNODES => nothing */ 0, /* QNODES => nothing */ + 0, /* ARBGROUPS => nothing */ 0, /* FUNCTIONS => nothing */ 0, /* INDEXES => nothing */ 0, /* ACCOUNTS => nothing */ @@ -1276,7 +1311,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 305, /* VIEW => ABORT */ + 306, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1405,54 +1440,54 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 305, /* AFTER => ABORT */ - 305, /* ATTACH => ABORT */ - 305, /* BEFORE => ABORT */ - 305, /* BEGIN => ABORT */ - 305, /* BITAND => ABORT */ - 305, /* BITNOT => ABORT */ - 305, /* BITOR => ABORT */ - 305, /* BLOCKS => ABORT */ - 305, /* CHANGE => ABORT */ - 305, /* COMMA => ABORT */ - 305, /* CONCAT => ABORT */ - 305, /* CONFLICT => ABORT */ - 305, /* COPY => ABORT */ - 305, /* DEFERRED => ABORT */ - 305, /* DELIMITERS => ABORT */ - 305, /* DETACH => ABORT */ - 305, /* DIVIDE => ABORT */ - 305, /* DOT => ABORT */ - 305, /* EACH => ABORT */ - 305, /* FAIL => ABORT */ - 305, /* FILE => ABORT */ - 305, /* FOR => ABORT */ - 305, /* GLOB => ABORT */ - 305, /* ID => ABORT */ - 305, /* IMMEDIATE => ABORT */ - 305, /* IMPORT => ABORT */ - 305, /* INITIALLY => ABORT */ - 305, /* INSTEAD => ABORT */ - 305, /* ISNULL => ABORT */ - 305, /* MODULES => ABORT */ - 305, /* NK_BITNOT => ABORT */ - 305, /* NK_SEMI => ABORT */ - 305, /* NOTNULL => ABORT */ - 305, /* OF => ABORT */ - 305, /* PLUS => ABORT */ - 305, /* PRIVILEGE => ABORT */ - 305, /* RAISE => ABORT */ - 305, /* RESTRICT => ABORT */ - 305, /* ROW => ABORT */ - 305, /* SEMI => ABORT */ - 305, /* STAR => ABORT */ - 305, /* STATEMENT => ABORT */ - 305, /* STRICT => ABORT */ - 305, /* STRING => ABORT */ - 305, /* TIMES => ABORT */ - 305, /* VALUES => ABORT */ - 305, /* VARIABLE => ABORT */ - 305, /* WAL => ABORT */ + 306, /* AFTER => ABORT */ + 306, /* ATTACH => ABORT */ + 306, /* BEFORE => ABORT */ + 306, /* BEGIN => ABORT */ + 306, /* BITAND => ABORT */ + 306, /* BITNOT => ABORT */ + 306, /* BITOR => ABORT */ + 306, /* BLOCKS => ABORT */ + 306, /* CHANGE => ABORT */ + 306, /* COMMA => ABORT */ + 306, /* CONCAT => ABORT */ + 306, /* CONFLICT => ABORT */ + 306, /* COPY => ABORT */ + 306, /* DEFERRED => ABORT */ + 306, /* DELIMITERS => ABORT */ + 306, /* DETACH => ABORT */ + 306, /* DIVIDE => ABORT */ + 306, /* DOT => ABORT */ + 306, /* EACH => ABORT */ + 306, /* FAIL => ABORT */ + 306, /* FILE => ABORT */ + 306, /* FOR => ABORT */ + 306, /* GLOB => ABORT */ + 306, /* ID => ABORT */ + 306, /* IMMEDIATE => ABORT */ + 306, /* IMPORT => ABORT */ + 306, /* INITIALLY => ABORT */ + 306, /* INSTEAD => ABORT */ + 306, /* ISNULL => ABORT */ + 306, /* MODULES => ABORT */ + 306, /* NK_BITNOT => ABORT */ + 306, /* NK_SEMI => ABORT */ + 306, /* NOTNULL => ABORT */ + 306, /* OF => ABORT */ + 306, /* PLUS => ABORT */ + 306, /* PRIVILEGE => ABORT */ + 306, /* RAISE => ABORT */ + 306, /* RESTRICT => ABORT */ + 306, /* ROW => ABORT */ + 306, /* SEMI => ABORT */ + 306, /* STAR => ABORT */ + 306, /* STATEMENT => ABORT */ + 306, /* STRICT => ABORT */ + 306, /* STRING => ABORT */ + 306, /* TIMES => ABORT */ + 306, /* VALUES => ABORT */ + 306, /* VARIABLE => ABORT */ + 306, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1694,369 +1729,370 @@ static const char *const yyTokenName[] = { /* 151 */ "STABLES", /* 152 */ "MNODES", /* 153 */ "QNODES", - /* 154 */ "FUNCTIONS", - /* 155 */ "INDEXES", - /* 156 */ "ACCOUNTS", - /* 157 */ "APPS", - /* 158 */ "CONNECTIONS", - /* 159 */ "LICENCES", - /* 160 */ "GRANTS", - /* 161 */ "FULL", - /* 162 */ "LOGS", - /* 163 */ "MACHINES", - /* 164 */ "QUERIES", - /* 165 */ "SCORES", - /* 166 */ "TOPICS", - /* 167 */ "VARIABLES", - /* 168 */ "BNODES", - /* 169 */ "SNODES", - /* 170 */ "TRANSACTIONS", - /* 171 */ "DISTRIBUTED", - /* 172 */ "CONSUMERS", - /* 173 */ "SUBSCRIPTIONS", - /* 174 */ "VNODES", - /* 175 */ "ALIVE", - /* 176 */ "VIEWS", - /* 177 */ "VIEW", - /* 178 */ "COMPACTS", - /* 179 */ "NORMAL", - /* 180 */ "CHILD", - /* 181 */ "LIKE", - /* 182 */ "TBNAME", - /* 183 */ "QTAGS", - /* 184 */ "AS", - /* 185 */ "SYSTEM", - /* 186 */ "INDEX", - /* 187 */ "FUNCTION", - /* 188 */ "INTERVAL", - /* 189 */ "COUNT", - /* 190 */ "LAST_ROW", - /* 191 */ "META", - /* 192 */ "ONLY", - /* 193 */ "TOPIC", - /* 194 */ "CONSUMER", - /* 195 */ "GROUP", - /* 196 */ "DESC", - /* 197 */ "DESCRIBE", - /* 198 */ "RESET", - /* 199 */ "QUERY", - /* 200 */ "CACHE", - /* 201 */ "EXPLAIN", - /* 202 */ "ANALYZE", - /* 203 */ "VERBOSE", - /* 204 */ "NK_BOOL", - /* 205 */ "RATIO", - /* 206 */ "NK_FLOAT", - /* 207 */ "OUTPUTTYPE", - /* 208 */ "AGGREGATE", - /* 209 */ "BUFSIZE", - /* 210 */ "LANGUAGE", - /* 211 */ "REPLACE", - /* 212 */ "STREAM", - /* 213 */ "INTO", - /* 214 */ "PAUSE", - /* 215 */ "RESUME", - /* 216 */ "TRIGGER", - /* 217 */ "AT_ONCE", - /* 218 */ "WINDOW_CLOSE", - /* 219 */ "IGNORE", - /* 220 */ "EXPIRED", - /* 221 */ "FILL_HISTORY", - /* 222 */ "UPDATE", - /* 223 */ "SUBTABLE", - /* 224 */ "UNTREATED", - /* 225 */ "KILL", - /* 226 */ "CONNECTION", - /* 227 */ "TRANSACTION", - /* 228 */ "BALANCE", - /* 229 */ "VGROUP", - /* 230 */ "LEADER", - /* 231 */ "MERGE", - /* 232 */ "REDISTRIBUTE", - /* 233 */ "SPLIT", - /* 234 */ "DELETE", - /* 235 */ "INSERT", - /* 236 */ "NK_BIN", - /* 237 */ "NK_HEX", - /* 238 */ "NULL", - /* 239 */ "NK_QUESTION", - /* 240 */ "NK_ALIAS", - /* 241 */ "NK_ARROW", - /* 242 */ "ROWTS", - /* 243 */ "QSTART", - /* 244 */ "QEND", - /* 245 */ "QDURATION", - /* 246 */ "WSTART", - /* 247 */ "WEND", - /* 248 */ "WDURATION", - /* 249 */ "IROWTS", - /* 250 */ "ISFILLED", - /* 251 */ "CAST", - /* 252 */ "NOW", - /* 253 */ "TODAY", - /* 254 */ "TIMEZONE", - /* 255 */ "CLIENT_VERSION", - /* 256 */ "SERVER_VERSION", - /* 257 */ "SERVER_STATUS", - /* 258 */ "CURRENT_USER", - /* 259 */ "CASE", - /* 260 */ "WHEN", - /* 261 */ "THEN", - /* 262 */ "ELSE", - /* 263 */ "BETWEEN", - /* 264 */ "IS", - /* 265 */ "NK_LT", - /* 266 */ "NK_GT", - /* 267 */ "NK_LE", - /* 268 */ "NK_GE", - /* 269 */ "NK_NE", - /* 270 */ "MATCH", - /* 271 */ "NMATCH", - /* 272 */ "CONTAINS", - /* 273 */ "IN", - /* 274 */ "JOIN", - /* 275 */ "INNER", - /* 276 */ "SELECT", - /* 277 */ "NK_HINT", - /* 278 */ "DISTINCT", - /* 279 */ "WHERE", - /* 280 */ "PARTITION", - /* 281 */ "BY", - /* 282 */ "SESSION", - /* 283 */ "STATE_WINDOW", - /* 284 */ "EVENT_WINDOW", - /* 285 */ "COUNT_WINDOW", - /* 286 */ "SLIDING", - /* 287 */ "FILL", - /* 288 */ "VALUE", - /* 289 */ "VALUE_F", - /* 290 */ "NONE", - /* 291 */ "PREV", - /* 292 */ "NULL_F", - /* 293 */ "LINEAR", - /* 294 */ "NEXT", - /* 295 */ "HAVING", - /* 296 */ "RANGE", - /* 297 */ "EVERY", - /* 298 */ "ORDER", - /* 299 */ "SLIMIT", - /* 300 */ "SOFFSET", - /* 301 */ "LIMIT", - /* 302 */ "OFFSET", - /* 303 */ "ASC", - /* 304 */ "NULLS", - /* 305 */ "ABORT", - /* 306 */ "AFTER", - /* 307 */ "ATTACH", - /* 308 */ "BEFORE", - /* 309 */ "BEGIN", - /* 310 */ "BITAND", - /* 311 */ "BITNOT", - /* 312 */ "BITOR", - /* 313 */ "BLOCKS", - /* 314 */ "CHANGE", - /* 315 */ "COMMA", - /* 316 */ "CONCAT", - /* 317 */ "CONFLICT", - /* 318 */ "COPY", - /* 319 */ "DEFERRED", - /* 320 */ "DELIMITERS", - /* 321 */ "DETACH", - /* 322 */ "DIVIDE", - /* 323 */ "DOT", - /* 324 */ "EACH", - /* 325 */ "FAIL", - /* 326 */ "FILE", - /* 327 */ "FOR", - /* 328 */ "GLOB", - /* 329 */ "ID", - /* 330 */ "IMMEDIATE", - /* 331 */ "IMPORT", - /* 332 */ "INITIALLY", - /* 333 */ "INSTEAD", - /* 334 */ "ISNULL", - /* 335 */ "MODULES", - /* 336 */ "NK_BITNOT", - /* 337 */ "NK_SEMI", - /* 338 */ "NOTNULL", - /* 339 */ "OF", - /* 340 */ "PLUS", - /* 341 */ "PRIVILEGE", - /* 342 */ "RAISE", - /* 343 */ "RESTRICT", - /* 344 */ "ROW", - /* 345 */ "SEMI", - /* 346 */ "STAR", - /* 347 */ "STATEMENT", - /* 348 */ "STRICT", - /* 349 */ "STRING", - /* 350 */ "TIMES", - /* 351 */ "VALUES", - /* 352 */ "VARIABLE", - /* 353 */ "WAL", - /* 354 */ "cmd", - /* 355 */ "account_options", - /* 356 */ "alter_account_options", - /* 357 */ "literal", - /* 358 */ "alter_account_option", - /* 359 */ "ip_range_list", - /* 360 */ "white_list", - /* 361 */ "white_list_opt", - /* 362 */ "user_name", - /* 363 */ "sysinfo_opt", - /* 364 */ "privileges", - /* 365 */ "priv_level", - /* 366 */ "with_opt", - /* 367 */ "priv_type_list", - /* 368 */ "priv_type", - /* 369 */ "db_name", - /* 370 */ "table_name", - /* 371 */ "topic_name", - /* 372 */ "search_condition", - /* 373 */ "dnode_endpoint", - /* 374 */ "force_opt", - /* 375 */ "unsafe_opt", - /* 376 */ "not_exists_opt", - /* 377 */ "db_options", - /* 378 */ "exists_opt", - /* 379 */ "alter_db_options", - /* 380 */ "speed_opt", - /* 381 */ "start_opt", - /* 382 */ "end_opt", - /* 383 */ "integer_list", - /* 384 */ "variable_list", - /* 385 */ "retention_list", - /* 386 */ "signed", - /* 387 */ "alter_db_option", - /* 388 */ "retention", - /* 389 */ "full_table_name", - /* 390 */ "column_def_list", - /* 391 */ "tags_def_opt", - /* 392 */ "table_options", - /* 393 */ "multi_create_clause", - /* 394 */ "tags_def", - /* 395 */ "multi_drop_clause", - /* 396 */ "alter_table_clause", - /* 397 */ "alter_table_options", - /* 398 */ "column_name", - /* 399 */ "type_name", - /* 400 */ "tags_literal", - /* 401 */ "create_subtable_clause", - /* 402 */ "specific_cols_opt", - /* 403 */ "tags_literal_list", - /* 404 */ "drop_table_clause", - /* 405 */ "col_name_list", - /* 406 */ "column_def", - /* 407 */ "duration_list", - /* 408 */ "rollup_func_list", - /* 409 */ "alter_table_option", - /* 410 */ "duration_literal", - /* 411 */ "rollup_func_name", - /* 412 */ "function_name", - /* 413 */ "col_name", - /* 414 */ "db_kind_opt", - /* 415 */ "table_kind_db_name_cond_opt", - /* 416 */ "like_pattern_opt", - /* 417 */ "db_name_cond_opt", - /* 418 */ "table_name_cond", - /* 419 */ "from_db_opt", - /* 420 */ "tag_list_opt", - /* 421 */ "table_kind", - /* 422 */ "tag_item", - /* 423 */ "column_alias", - /* 424 */ "index_options", - /* 425 */ "full_index_name", - /* 426 */ "index_name", - /* 427 */ "func_list", - /* 428 */ "sliding_opt", - /* 429 */ "sma_stream_opt", - /* 430 */ "func", - /* 431 */ "sma_func_name", - /* 432 */ "expression_list", - /* 433 */ "with_meta", - /* 434 */ "query_or_subquery", - /* 435 */ "where_clause_opt", - /* 436 */ "cgroup_name", - /* 437 */ "analyze_opt", - /* 438 */ "explain_options", - /* 439 */ "insert_query", - /* 440 */ "or_replace_opt", - /* 441 */ "agg_func_opt", - /* 442 */ "bufsize_opt", - /* 443 */ "language_opt", - /* 444 */ "full_view_name", - /* 445 */ "view_name", - /* 446 */ "stream_name", - /* 447 */ "stream_options", - /* 448 */ "col_list_opt", - /* 449 */ "tag_def_or_ref_opt", - /* 450 */ "subtable_opt", - /* 451 */ "ignore_opt", - /* 452 */ "expression", - /* 453 */ "on_vgroup_id", - /* 454 */ "dnode_list", - /* 455 */ "literal_func", - /* 456 */ "signed_literal", - /* 457 */ "literal_list", - /* 458 */ "table_alias", - /* 459 */ "expr_or_subquery", - /* 460 */ "pseudo_column", - /* 461 */ "column_reference", - /* 462 */ "function_expression", - /* 463 */ "case_when_expression", - /* 464 */ "star_func", - /* 465 */ "star_func_para_list", - /* 466 */ "noarg_func", - /* 467 */ "other_para_list", - /* 468 */ "star_func_para", - /* 469 */ "when_then_list", - /* 470 */ "case_when_else_opt", - /* 471 */ "common_expression", - /* 472 */ "when_then_expr", - /* 473 */ "predicate", - /* 474 */ "compare_op", - /* 475 */ "in_op", - /* 476 */ "in_predicate_value", - /* 477 */ "boolean_value_expression", - /* 478 */ "boolean_primary", - /* 479 */ "from_clause_opt", - /* 480 */ "table_reference_list", - /* 481 */ "table_reference", - /* 482 */ "table_primary", - /* 483 */ "joined_table", - /* 484 */ "alias_opt", - /* 485 */ "subquery", - /* 486 */ "parenthesized_joined_table", - /* 487 */ "join_type", - /* 488 */ "query_specification", - /* 489 */ "hint_list", - /* 490 */ "set_quantifier_opt", - /* 491 */ "tag_mode_opt", - /* 492 */ "select_list", - /* 493 */ "partition_by_clause_opt", - /* 494 */ "range_opt", - /* 495 */ "every_opt", - /* 496 */ "fill_opt", - /* 497 */ "twindow_clause_opt", - /* 498 */ "group_by_clause_opt", - /* 499 */ "having_clause_opt", - /* 500 */ "select_item", - /* 501 */ "partition_list", - /* 502 */ "partition_item", - /* 503 */ "interval_sliding_duration_literal", - /* 504 */ "fill_mode", - /* 505 */ "group_by_list", - /* 506 */ "query_expression", - /* 507 */ "query_simple", - /* 508 */ "order_by_clause_opt", - /* 509 */ "slimit_clause_opt", - /* 510 */ "limit_clause_opt", - /* 511 */ "union_query_expression", - /* 512 */ "query_simple_or_subquery", - /* 513 */ "sort_specification_list", - /* 514 */ "sort_specification", - /* 515 */ "ordering_specification_opt", - /* 516 */ "null_ordering_opt", + /* 154 */ "ARBGROUPS", + /* 155 */ "FUNCTIONS", + /* 156 */ "INDEXES", + /* 157 */ "ACCOUNTS", + /* 158 */ "APPS", + /* 159 */ "CONNECTIONS", + /* 160 */ "LICENCES", + /* 161 */ "GRANTS", + /* 162 */ "FULL", + /* 163 */ "LOGS", + /* 164 */ "MACHINES", + /* 165 */ "QUERIES", + /* 166 */ "SCORES", + /* 167 */ "TOPICS", + /* 168 */ "VARIABLES", + /* 169 */ "BNODES", + /* 170 */ "SNODES", + /* 171 */ "TRANSACTIONS", + /* 172 */ "DISTRIBUTED", + /* 173 */ "CONSUMERS", + /* 174 */ "SUBSCRIPTIONS", + /* 175 */ "VNODES", + /* 176 */ "ALIVE", + /* 177 */ "VIEWS", + /* 178 */ "VIEW", + /* 179 */ "COMPACTS", + /* 180 */ "NORMAL", + /* 181 */ "CHILD", + /* 182 */ "LIKE", + /* 183 */ "TBNAME", + /* 184 */ "QTAGS", + /* 185 */ "AS", + /* 186 */ "SYSTEM", + /* 187 */ "INDEX", + /* 188 */ "FUNCTION", + /* 189 */ "INTERVAL", + /* 190 */ "COUNT", + /* 191 */ "LAST_ROW", + /* 192 */ "META", + /* 193 */ "ONLY", + /* 194 */ "TOPIC", + /* 195 */ "CONSUMER", + /* 196 */ "GROUP", + /* 197 */ "DESC", + /* 198 */ "DESCRIBE", + /* 199 */ "RESET", + /* 200 */ "QUERY", + /* 201 */ "CACHE", + /* 202 */ "EXPLAIN", + /* 203 */ "ANALYZE", + /* 204 */ "VERBOSE", + /* 205 */ "NK_BOOL", + /* 206 */ "RATIO", + /* 207 */ "NK_FLOAT", + /* 208 */ "OUTPUTTYPE", + /* 209 */ "AGGREGATE", + /* 210 */ "BUFSIZE", + /* 211 */ "LANGUAGE", + /* 212 */ "REPLACE", + /* 213 */ "STREAM", + /* 214 */ "INTO", + /* 215 */ "PAUSE", + /* 216 */ "RESUME", + /* 217 */ "TRIGGER", + /* 218 */ "AT_ONCE", + /* 219 */ "WINDOW_CLOSE", + /* 220 */ "IGNORE", + /* 221 */ "EXPIRED", + /* 222 */ "FILL_HISTORY", + /* 223 */ "UPDATE", + /* 224 */ "SUBTABLE", + /* 225 */ "UNTREATED", + /* 226 */ "KILL", + /* 227 */ "CONNECTION", + /* 228 */ "TRANSACTION", + /* 229 */ "BALANCE", + /* 230 */ "VGROUP", + /* 231 */ "LEADER", + /* 232 */ "MERGE", + /* 233 */ "REDISTRIBUTE", + /* 234 */ "SPLIT", + /* 235 */ "DELETE", + /* 236 */ "INSERT", + /* 237 */ "NK_BIN", + /* 238 */ "NK_HEX", + /* 239 */ "NULL", + /* 240 */ "NK_QUESTION", + /* 241 */ "NK_ALIAS", + /* 242 */ "NK_ARROW", + /* 243 */ "ROWTS", + /* 244 */ "QSTART", + /* 245 */ "QEND", + /* 246 */ "QDURATION", + /* 247 */ "WSTART", + /* 248 */ "WEND", + /* 249 */ "WDURATION", + /* 250 */ "IROWTS", + /* 251 */ "ISFILLED", + /* 252 */ "CAST", + /* 253 */ "NOW", + /* 254 */ "TODAY", + /* 255 */ "TIMEZONE", + /* 256 */ "CLIENT_VERSION", + /* 257 */ "SERVER_VERSION", + /* 258 */ "SERVER_STATUS", + /* 259 */ "CURRENT_USER", + /* 260 */ "CASE", + /* 261 */ "WHEN", + /* 262 */ "THEN", + /* 263 */ "ELSE", + /* 264 */ "BETWEEN", + /* 265 */ "IS", + /* 266 */ "NK_LT", + /* 267 */ "NK_GT", + /* 268 */ "NK_LE", + /* 269 */ "NK_GE", + /* 270 */ "NK_NE", + /* 271 */ "MATCH", + /* 272 */ "NMATCH", + /* 273 */ "CONTAINS", + /* 274 */ "IN", + /* 275 */ "JOIN", + /* 276 */ "INNER", + /* 277 */ "SELECT", + /* 278 */ "NK_HINT", + /* 279 */ "DISTINCT", + /* 280 */ "WHERE", + /* 281 */ "PARTITION", + /* 282 */ "BY", + /* 283 */ "SESSION", + /* 284 */ "STATE_WINDOW", + /* 285 */ "EVENT_WINDOW", + /* 286 */ "COUNT_WINDOW", + /* 287 */ "SLIDING", + /* 288 */ "FILL", + /* 289 */ "VALUE", + /* 290 */ "VALUE_F", + /* 291 */ "NONE", + /* 292 */ "PREV", + /* 293 */ "NULL_F", + /* 294 */ "LINEAR", + /* 295 */ "NEXT", + /* 296 */ "HAVING", + /* 297 */ "RANGE", + /* 298 */ "EVERY", + /* 299 */ "ORDER", + /* 300 */ "SLIMIT", + /* 301 */ "SOFFSET", + /* 302 */ "LIMIT", + /* 303 */ "OFFSET", + /* 304 */ "ASC", + /* 305 */ "NULLS", + /* 306 */ "ABORT", + /* 307 */ "AFTER", + /* 308 */ "ATTACH", + /* 309 */ "BEFORE", + /* 310 */ "BEGIN", + /* 311 */ "BITAND", + /* 312 */ "BITNOT", + /* 313 */ "BITOR", + /* 314 */ "BLOCKS", + /* 315 */ "CHANGE", + /* 316 */ "COMMA", + /* 317 */ "CONCAT", + /* 318 */ "CONFLICT", + /* 319 */ "COPY", + /* 320 */ "DEFERRED", + /* 321 */ "DELIMITERS", + /* 322 */ "DETACH", + /* 323 */ "DIVIDE", + /* 324 */ "DOT", + /* 325 */ "EACH", + /* 326 */ "FAIL", + /* 327 */ "FILE", + /* 328 */ "FOR", + /* 329 */ "GLOB", + /* 330 */ "ID", + /* 331 */ "IMMEDIATE", + /* 332 */ "IMPORT", + /* 333 */ "INITIALLY", + /* 334 */ "INSTEAD", + /* 335 */ "ISNULL", + /* 336 */ "MODULES", + /* 337 */ "NK_BITNOT", + /* 338 */ "NK_SEMI", + /* 339 */ "NOTNULL", + /* 340 */ "OF", + /* 341 */ "PLUS", + /* 342 */ "PRIVILEGE", + /* 343 */ "RAISE", + /* 344 */ "RESTRICT", + /* 345 */ "ROW", + /* 346 */ "SEMI", + /* 347 */ "STAR", + /* 348 */ "STATEMENT", + /* 349 */ "STRICT", + /* 350 */ "STRING", + /* 351 */ "TIMES", + /* 352 */ "VALUES", + /* 353 */ "VARIABLE", + /* 354 */ "WAL", + /* 355 */ "cmd", + /* 356 */ "account_options", + /* 357 */ "alter_account_options", + /* 358 */ "literal", + /* 359 */ "alter_account_option", + /* 360 */ "ip_range_list", + /* 361 */ "white_list", + /* 362 */ "white_list_opt", + /* 363 */ "user_name", + /* 364 */ "sysinfo_opt", + /* 365 */ "privileges", + /* 366 */ "priv_level", + /* 367 */ "with_opt", + /* 368 */ "priv_type_list", + /* 369 */ "priv_type", + /* 370 */ "db_name", + /* 371 */ "table_name", + /* 372 */ "topic_name", + /* 373 */ "search_condition", + /* 374 */ "dnode_endpoint", + /* 375 */ "force_opt", + /* 376 */ "unsafe_opt", + /* 377 */ "not_exists_opt", + /* 378 */ "db_options", + /* 379 */ "exists_opt", + /* 380 */ "alter_db_options", + /* 381 */ "speed_opt", + /* 382 */ "start_opt", + /* 383 */ "end_opt", + /* 384 */ "integer_list", + /* 385 */ "variable_list", + /* 386 */ "retention_list", + /* 387 */ "signed", + /* 388 */ "alter_db_option", + /* 389 */ "retention", + /* 390 */ "full_table_name", + /* 391 */ "column_def_list", + /* 392 */ "tags_def_opt", + /* 393 */ "table_options", + /* 394 */ "multi_create_clause", + /* 395 */ "tags_def", + /* 396 */ "multi_drop_clause", + /* 397 */ "alter_table_clause", + /* 398 */ "alter_table_options", + /* 399 */ "column_name", + /* 400 */ "type_name", + /* 401 */ "tags_literal", + /* 402 */ "create_subtable_clause", + /* 403 */ "specific_cols_opt", + /* 404 */ "tags_literal_list", + /* 405 */ "drop_table_clause", + /* 406 */ "col_name_list", + /* 407 */ "column_def", + /* 408 */ "duration_list", + /* 409 */ "rollup_func_list", + /* 410 */ "alter_table_option", + /* 411 */ "duration_literal", + /* 412 */ "rollup_func_name", + /* 413 */ "function_name", + /* 414 */ "col_name", + /* 415 */ "db_kind_opt", + /* 416 */ "table_kind_db_name_cond_opt", + /* 417 */ "like_pattern_opt", + /* 418 */ "db_name_cond_opt", + /* 419 */ "table_name_cond", + /* 420 */ "from_db_opt", + /* 421 */ "tag_list_opt", + /* 422 */ "table_kind", + /* 423 */ "tag_item", + /* 424 */ "column_alias", + /* 425 */ "index_options", + /* 426 */ "full_index_name", + /* 427 */ "index_name", + /* 428 */ "func_list", + /* 429 */ "sliding_opt", + /* 430 */ "sma_stream_opt", + /* 431 */ "func", + /* 432 */ "sma_func_name", + /* 433 */ "expression_list", + /* 434 */ "with_meta", + /* 435 */ "query_or_subquery", + /* 436 */ "where_clause_opt", + /* 437 */ "cgroup_name", + /* 438 */ "analyze_opt", + /* 439 */ "explain_options", + /* 440 */ "insert_query", + /* 441 */ "or_replace_opt", + /* 442 */ "agg_func_opt", + /* 443 */ "bufsize_opt", + /* 444 */ "language_opt", + /* 445 */ "full_view_name", + /* 446 */ "view_name", + /* 447 */ "stream_name", + /* 448 */ "stream_options", + /* 449 */ "col_list_opt", + /* 450 */ "tag_def_or_ref_opt", + /* 451 */ "subtable_opt", + /* 452 */ "ignore_opt", + /* 453 */ "expression", + /* 454 */ "on_vgroup_id", + /* 455 */ "dnode_list", + /* 456 */ "literal_func", + /* 457 */ "signed_literal", + /* 458 */ "literal_list", + /* 459 */ "table_alias", + /* 460 */ "expr_or_subquery", + /* 461 */ "pseudo_column", + /* 462 */ "column_reference", + /* 463 */ "function_expression", + /* 464 */ "case_when_expression", + /* 465 */ "star_func", + /* 466 */ "star_func_para_list", + /* 467 */ "noarg_func", + /* 468 */ "other_para_list", + /* 469 */ "star_func_para", + /* 470 */ "when_then_list", + /* 471 */ "case_when_else_opt", + /* 472 */ "common_expression", + /* 473 */ "when_then_expr", + /* 474 */ "predicate", + /* 475 */ "compare_op", + /* 476 */ "in_op", + /* 477 */ "in_predicate_value", + /* 478 */ "boolean_value_expression", + /* 479 */ "boolean_primary", + /* 480 */ "from_clause_opt", + /* 481 */ "table_reference_list", + /* 482 */ "table_reference", + /* 483 */ "table_primary", + /* 484 */ "joined_table", + /* 485 */ "alias_opt", + /* 486 */ "subquery", + /* 487 */ "parenthesized_joined_table", + /* 488 */ "join_type", + /* 489 */ "query_specification", + /* 490 */ "hint_list", + /* 491 */ "set_quantifier_opt", + /* 492 */ "tag_mode_opt", + /* 493 */ "select_list", + /* 494 */ "partition_by_clause_opt", + /* 495 */ "range_opt", + /* 496 */ "every_opt", + /* 497 */ "fill_opt", + /* 498 */ "twindow_clause_opt", + /* 499 */ "group_by_clause_opt", + /* 500 */ "having_clause_opt", + /* 501 */ "select_item", + /* 502 */ "partition_list", + /* 503 */ "partition_item", + /* 504 */ "interval_sliding_duration_literal", + /* 505 */ "fill_mode", + /* 506 */ "group_by_list", + /* 507 */ "query_expression", + /* 508 */ "query_simple", + /* 509 */ "order_by_clause_opt", + /* 510 */ "slimit_clause_opt", + /* 511 */ "limit_clause_opt", + /* 512 */ "union_query_expression", + /* 513 */ "query_simple_or_subquery", + /* 514 */ "sort_specification_list", + /* 515 */ "sort_specification", + /* 516 */ "ordering_specification_opt", + /* 517 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2318,423 +2354,424 @@ static const char *const yyRuleName[] = { /* 251 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", /* 252 */ "cmd ::= SHOW MNODES", /* 253 */ "cmd ::= SHOW QNODES", - /* 254 */ "cmd ::= SHOW FUNCTIONS", - /* 255 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 256 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 257 */ "cmd ::= SHOW STREAMS", - /* 258 */ "cmd ::= SHOW ACCOUNTS", - /* 259 */ "cmd ::= SHOW APPS", - /* 260 */ "cmd ::= SHOW CONNECTIONS", - /* 261 */ "cmd ::= SHOW LICENCES", - /* 262 */ "cmd ::= SHOW GRANTS", - /* 263 */ "cmd ::= SHOW GRANTS FULL", - /* 264 */ "cmd ::= SHOW GRANTS LOGS", - /* 265 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 266 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 267 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 268 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 269 */ "cmd ::= SHOW QUERIES", - /* 270 */ "cmd ::= SHOW SCORES", - /* 271 */ "cmd ::= SHOW TOPICS", - /* 272 */ "cmd ::= SHOW VARIABLES", - /* 273 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 274 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 275 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 276 */ "cmd ::= SHOW BNODES", - /* 277 */ "cmd ::= SHOW SNODES", - /* 278 */ "cmd ::= SHOW CLUSTER", - /* 279 */ "cmd ::= SHOW TRANSACTIONS", - /* 280 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 281 */ "cmd ::= SHOW CONSUMERS", - /* 282 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 283 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 284 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 285 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 286 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 287 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 288 */ "cmd ::= SHOW VNODES", - /* 289 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 290 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 291 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 292 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 293 */ "cmd ::= SHOW COMPACTS", - /* 294 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 295 */ "table_kind_db_name_cond_opt ::=", - /* 296 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 297 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 298 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 299 */ "table_kind ::= NORMAL", - /* 300 */ "table_kind ::= CHILD", - /* 301 */ "db_name_cond_opt ::=", - /* 302 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 303 */ "like_pattern_opt ::=", - /* 304 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 305 */ "table_name_cond ::= table_name", - /* 306 */ "from_db_opt ::=", - /* 307 */ "from_db_opt ::= FROM db_name", - /* 308 */ "tag_list_opt ::=", - /* 309 */ "tag_list_opt ::= tag_item", - /* 310 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 311 */ "tag_item ::= TBNAME", - /* 312 */ "tag_item ::= QTAGS", - /* 313 */ "tag_item ::= column_name", - /* 314 */ "tag_item ::= column_name column_alias", - /* 315 */ "tag_item ::= column_name AS column_alias", - /* 316 */ "db_kind_opt ::=", - /* 317 */ "db_kind_opt ::= USER", - /* 318 */ "db_kind_opt ::= SYSTEM", - /* 319 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 320 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 321 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 322 */ "full_index_name ::= index_name", - /* 323 */ "full_index_name ::= db_name NK_DOT index_name", - /* 324 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 325 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 326 */ "func_list ::= func", - /* 327 */ "func_list ::= func_list NK_COMMA func", - /* 328 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 329 */ "sma_func_name ::= function_name", - /* 330 */ "sma_func_name ::= COUNT", - /* 331 */ "sma_func_name ::= FIRST", - /* 332 */ "sma_func_name ::= LAST", - /* 333 */ "sma_func_name ::= LAST_ROW", - /* 334 */ "sma_stream_opt ::=", - /* 335 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 336 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 337 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 338 */ "with_meta ::= AS", - /* 339 */ "with_meta ::= WITH META AS", - /* 340 */ "with_meta ::= ONLY META AS", - /* 341 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 342 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 343 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 344 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 345 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 346 */ "cmd ::= DESC full_table_name", - /* 347 */ "cmd ::= DESCRIBE full_table_name", - /* 348 */ "cmd ::= RESET QUERY CACHE", - /* 349 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 350 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 351 */ "analyze_opt ::=", - /* 352 */ "analyze_opt ::= ANALYZE", - /* 353 */ "explain_options ::=", - /* 354 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 355 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 356 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 357 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 358 */ "agg_func_opt ::=", - /* 359 */ "agg_func_opt ::= AGGREGATE", - /* 360 */ "bufsize_opt ::=", - /* 361 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 362 */ "language_opt ::=", - /* 363 */ "language_opt ::= LANGUAGE NK_STRING", - /* 364 */ "or_replace_opt ::=", - /* 365 */ "or_replace_opt ::= OR REPLACE", - /* 366 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 367 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 368 */ "full_view_name ::= view_name", - /* 369 */ "full_view_name ::= db_name NK_DOT view_name", - /* 370 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 371 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 372 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 373 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 374 */ "col_list_opt ::=", - /* 375 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 376 */ "tag_def_or_ref_opt ::=", - /* 377 */ "tag_def_or_ref_opt ::= tags_def", - /* 378 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 379 */ "stream_options ::=", - /* 380 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 381 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 382 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 383 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 384 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 385 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 386 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 387 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 388 */ "subtable_opt ::=", - /* 389 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 390 */ "ignore_opt ::=", - /* 391 */ "ignore_opt ::= IGNORE UNTREATED", - /* 392 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 393 */ "cmd ::= KILL QUERY NK_STRING", - /* 394 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 395 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 396 */ "cmd ::= BALANCE VGROUP", - /* 397 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 398 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 399 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 400 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 401 */ "on_vgroup_id ::=", - /* 402 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 403 */ "dnode_list ::= DNODE NK_INTEGER", - /* 404 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 405 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 406 */ "cmd ::= query_or_subquery", - /* 407 */ "cmd ::= insert_query", - /* 408 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 409 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 410 */ "tags_literal ::= NK_INTEGER", - /* 411 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 412 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 413 */ "tags_literal ::= NK_FLOAT", - /* 414 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 415 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 416 */ "tags_literal ::= NK_BIN", - /* 417 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 418 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 419 */ "tags_literal ::= NK_HEX", - /* 420 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 421 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 422 */ "tags_literal ::= NK_STRING", - /* 423 */ "tags_literal ::= NK_BOOL", - /* 424 */ "tags_literal ::= NULL", - /* 425 */ "tags_literal ::= literal_func", - /* 426 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 427 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 428 */ "tags_literal_list ::= tags_literal", - /* 429 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 430 */ "literal ::= NK_INTEGER", - /* 431 */ "literal ::= NK_FLOAT", - /* 432 */ "literal ::= NK_STRING", - /* 433 */ "literal ::= NK_BOOL", - /* 434 */ "literal ::= TIMESTAMP NK_STRING", - /* 435 */ "literal ::= duration_literal", - /* 436 */ "literal ::= NULL", - /* 437 */ "literal ::= NK_QUESTION", - /* 438 */ "duration_literal ::= NK_VARIABLE", - /* 439 */ "signed ::= NK_INTEGER", - /* 440 */ "signed ::= NK_PLUS NK_INTEGER", - /* 441 */ "signed ::= NK_MINUS NK_INTEGER", - /* 442 */ "signed ::= NK_FLOAT", - /* 443 */ "signed ::= NK_PLUS NK_FLOAT", - /* 444 */ "signed ::= NK_MINUS NK_FLOAT", - /* 445 */ "signed_literal ::= signed", - /* 446 */ "signed_literal ::= NK_STRING", - /* 447 */ "signed_literal ::= NK_BOOL", - /* 448 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 449 */ "signed_literal ::= duration_literal", - /* 450 */ "signed_literal ::= NULL", - /* 451 */ "signed_literal ::= literal_func", - /* 452 */ "signed_literal ::= NK_QUESTION", - /* 453 */ "literal_list ::= signed_literal", - /* 454 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 455 */ "db_name ::= NK_ID", - /* 456 */ "table_name ::= NK_ID", - /* 457 */ "column_name ::= NK_ID", - /* 458 */ "function_name ::= NK_ID", - /* 459 */ "view_name ::= NK_ID", - /* 460 */ "table_alias ::= NK_ID", - /* 461 */ "column_alias ::= NK_ID", - /* 462 */ "column_alias ::= NK_ALIAS", - /* 463 */ "user_name ::= NK_ID", - /* 464 */ "topic_name ::= NK_ID", - /* 465 */ "stream_name ::= NK_ID", - /* 466 */ "cgroup_name ::= NK_ID", - /* 467 */ "index_name ::= NK_ID", - /* 468 */ "expr_or_subquery ::= expression", - /* 469 */ "expression ::= literal", - /* 470 */ "expression ::= pseudo_column", - /* 471 */ "expression ::= column_reference", - /* 472 */ "expression ::= function_expression", - /* 473 */ "expression ::= case_when_expression", - /* 474 */ "expression ::= NK_LP expression NK_RP", - /* 475 */ "expression ::= NK_PLUS expr_or_subquery", - /* 476 */ "expression ::= NK_MINUS expr_or_subquery", - /* 477 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 478 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 479 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 480 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 481 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 482 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 483 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 484 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 485 */ "expression_list ::= expr_or_subquery", - /* 486 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 487 */ "column_reference ::= column_name", - /* 488 */ "column_reference ::= table_name NK_DOT column_name", - /* 489 */ "column_reference ::= NK_ALIAS", - /* 490 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 491 */ "pseudo_column ::= ROWTS", - /* 492 */ "pseudo_column ::= TBNAME", - /* 493 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 494 */ "pseudo_column ::= QSTART", - /* 495 */ "pseudo_column ::= QEND", - /* 496 */ "pseudo_column ::= QDURATION", - /* 497 */ "pseudo_column ::= WSTART", - /* 498 */ "pseudo_column ::= WEND", - /* 499 */ "pseudo_column ::= WDURATION", - /* 500 */ "pseudo_column ::= IROWTS", - /* 501 */ "pseudo_column ::= ISFILLED", - /* 502 */ "pseudo_column ::= QTAGS", - /* 503 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 504 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 505 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 506 */ "function_expression ::= literal_func", - /* 507 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 508 */ "literal_func ::= NOW", - /* 509 */ "literal_func ::= TODAY", - /* 510 */ "noarg_func ::= NOW", - /* 511 */ "noarg_func ::= TODAY", - /* 512 */ "noarg_func ::= TIMEZONE", - /* 513 */ "noarg_func ::= DATABASE", - /* 514 */ "noarg_func ::= CLIENT_VERSION", - /* 515 */ "noarg_func ::= SERVER_VERSION", - /* 516 */ "noarg_func ::= SERVER_STATUS", - /* 517 */ "noarg_func ::= CURRENT_USER", - /* 518 */ "noarg_func ::= USER", - /* 519 */ "star_func ::= COUNT", - /* 520 */ "star_func ::= FIRST", - /* 521 */ "star_func ::= LAST", - /* 522 */ "star_func ::= LAST_ROW", - /* 523 */ "star_func_para_list ::= NK_STAR", - /* 524 */ "star_func_para_list ::= other_para_list", - /* 525 */ "other_para_list ::= star_func_para", - /* 526 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 527 */ "star_func_para ::= expr_or_subquery", - /* 528 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 529 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 530 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 531 */ "when_then_list ::= when_then_expr", - /* 532 */ "when_then_list ::= when_then_list when_then_expr", - /* 533 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 534 */ "case_when_else_opt ::=", - /* 535 */ "case_when_else_opt ::= ELSE common_expression", - /* 536 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 537 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 538 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 539 */ "predicate ::= expr_or_subquery IS NULL", - /* 540 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 541 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 542 */ "compare_op ::= NK_LT", - /* 543 */ "compare_op ::= NK_GT", - /* 544 */ "compare_op ::= NK_LE", - /* 545 */ "compare_op ::= NK_GE", - /* 546 */ "compare_op ::= NK_NE", - /* 547 */ "compare_op ::= NK_EQ", - /* 548 */ "compare_op ::= LIKE", - /* 549 */ "compare_op ::= NOT LIKE", - /* 550 */ "compare_op ::= MATCH", - /* 551 */ "compare_op ::= NMATCH", - /* 552 */ "compare_op ::= CONTAINS", - /* 553 */ "in_op ::= IN", - /* 554 */ "in_op ::= NOT IN", - /* 555 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 556 */ "boolean_value_expression ::= boolean_primary", - /* 557 */ "boolean_value_expression ::= NOT boolean_primary", - /* 558 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 559 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 560 */ "boolean_primary ::= predicate", - /* 561 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 562 */ "common_expression ::= expr_or_subquery", - /* 563 */ "common_expression ::= boolean_value_expression", - /* 564 */ "from_clause_opt ::=", - /* 565 */ "from_clause_opt ::= FROM table_reference_list", - /* 566 */ "table_reference_list ::= table_reference", - /* 567 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 568 */ "table_reference ::= table_primary", - /* 569 */ "table_reference ::= joined_table", - /* 570 */ "table_primary ::= table_name alias_opt", - /* 571 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 572 */ "table_primary ::= subquery alias_opt", - /* 573 */ "table_primary ::= parenthesized_joined_table", - /* 574 */ "alias_opt ::=", - /* 575 */ "alias_opt ::= table_alias", - /* 576 */ "alias_opt ::= AS table_alias", - /* 577 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 578 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 579 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 580 */ "join_type ::=", - /* 581 */ "join_type ::= INNER", - /* 582 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 583 */ "hint_list ::=", - /* 584 */ "hint_list ::= NK_HINT", - /* 585 */ "tag_mode_opt ::=", - /* 586 */ "tag_mode_opt ::= TAGS", - /* 587 */ "set_quantifier_opt ::=", - /* 588 */ "set_quantifier_opt ::= DISTINCT", - /* 589 */ "set_quantifier_opt ::= ALL", - /* 590 */ "select_list ::= select_item", - /* 591 */ "select_list ::= select_list NK_COMMA select_item", - /* 592 */ "select_item ::= NK_STAR", - /* 593 */ "select_item ::= common_expression", - /* 594 */ "select_item ::= common_expression column_alias", - /* 595 */ "select_item ::= common_expression AS column_alias", - /* 596 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 597 */ "where_clause_opt ::=", - /* 598 */ "where_clause_opt ::= WHERE search_condition", - /* 599 */ "partition_by_clause_opt ::=", - /* 600 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 601 */ "partition_list ::= partition_item", - /* 602 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 603 */ "partition_item ::= expr_or_subquery", - /* 604 */ "partition_item ::= expr_or_subquery column_alias", - /* 605 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 606 */ "twindow_clause_opt ::=", - /* 607 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 608 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 609 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 610 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 611 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 612 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 613 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 614 */ "sliding_opt ::=", - /* 615 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 616 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 617 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 618 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 619 */ "fill_opt ::=", - /* 620 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 621 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 622 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 623 */ "fill_mode ::= NONE", - /* 624 */ "fill_mode ::= PREV", - /* 625 */ "fill_mode ::= NULL", - /* 626 */ "fill_mode ::= NULL_F", - /* 627 */ "fill_mode ::= LINEAR", - /* 628 */ "fill_mode ::= NEXT", - /* 629 */ "group_by_clause_opt ::=", - /* 630 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 631 */ "group_by_list ::= expr_or_subquery", - /* 632 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 633 */ "having_clause_opt ::=", - /* 634 */ "having_clause_opt ::= HAVING search_condition", - /* 635 */ "range_opt ::=", - /* 636 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 637 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 638 */ "every_opt ::=", - /* 639 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 640 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 641 */ "query_simple ::= query_specification", - /* 642 */ "query_simple ::= union_query_expression", - /* 643 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 644 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 645 */ "query_simple_or_subquery ::= query_simple", - /* 646 */ "query_simple_or_subquery ::= subquery", - /* 647 */ "query_or_subquery ::= query_expression", - /* 648 */ "query_or_subquery ::= subquery", - /* 649 */ "order_by_clause_opt ::=", - /* 650 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 651 */ "slimit_clause_opt ::=", - /* 652 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 653 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 654 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 655 */ "limit_clause_opt ::=", - /* 656 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 657 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 658 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 659 */ "subquery ::= NK_LP query_expression NK_RP", - /* 660 */ "subquery ::= NK_LP subquery NK_RP", - /* 661 */ "search_condition ::= common_expression", - /* 662 */ "sort_specification_list ::= sort_specification", - /* 663 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 664 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 665 */ "ordering_specification_opt ::=", - /* 666 */ "ordering_specification_opt ::= ASC", - /* 667 */ "ordering_specification_opt ::= DESC", - /* 668 */ "null_ordering_opt ::=", - /* 669 */ "null_ordering_opt ::= NULLS FIRST", - /* 670 */ "null_ordering_opt ::= NULLS LAST", + /* 254 */ "cmd ::= SHOW ARBGROUPS", + /* 255 */ "cmd ::= SHOW FUNCTIONS", + /* 256 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 257 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 258 */ "cmd ::= SHOW STREAMS", + /* 259 */ "cmd ::= SHOW ACCOUNTS", + /* 260 */ "cmd ::= SHOW APPS", + /* 261 */ "cmd ::= SHOW CONNECTIONS", + /* 262 */ "cmd ::= SHOW LICENCES", + /* 263 */ "cmd ::= SHOW GRANTS", + /* 264 */ "cmd ::= SHOW GRANTS FULL", + /* 265 */ "cmd ::= SHOW GRANTS LOGS", + /* 266 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 267 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 268 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 269 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 270 */ "cmd ::= SHOW QUERIES", + /* 271 */ "cmd ::= SHOW SCORES", + /* 272 */ "cmd ::= SHOW TOPICS", + /* 273 */ "cmd ::= SHOW VARIABLES", + /* 274 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 275 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 276 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 277 */ "cmd ::= SHOW BNODES", + /* 278 */ "cmd ::= SHOW SNODES", + /* 279 */ "cmd ::= SHOW CLUSTER", + /* 280 */ "cmd ::= SHOW TRANSACTIONS", + /* 281 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 282 */ "cmd ::= SHOW CONSUMERS", + /* 283 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 284 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 285 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 286 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 287 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 288 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 289 */ "cmd ::= SHOW VNODES", + /* 290 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 291 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 292 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 293 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 294 */ "cmd ::= SHOW COMPACTS", + /* 295 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 296 */ "table_kind_db_name_cond_opt ::=", + /* 297 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 298 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 299 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 300 */ "table_kind ::= NORMAL", + /* 301 */ "table_kind ::= CHILD", + /* 302 */ "db_name_cond_opt ::=", + /* 303 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 304 */ "like_pattern_opt ::=", + /* 305 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 306 */ "table_name_cond ::= table_name", + /* 307 */ "from_db_opt ::=", + /* 308 */ "from_db_opt ::= FROM db_name", + /* 309 */ "tag_list_opt ::=", + /* 310 */ "tag_list_opt ::= tag_item", + /* 311 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 312 */ "tag_item ::= TBNAME", + /* 313 */ "tag_item ::= QTAGS", + /* 314 */ "tag_item ::= column_name", + /* 315 */ "tag_item ::= column_name column_alias", + /* 316 */ "tag_item ::= column_name AS column_alias", + /* 317 */ "db_kind_opt ::=", + /* 318 */ "db_kind_opt ::= USER", + /* 319 */ "db_kind_opt ::= SYSTEM", + /* 320 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 321 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 322 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 323 */ "full_index_name ::= index_name", + /* 324 */ "full_index_name ::= db_name NK_DOT index_name", + /* 325 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 326 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 327 */ "func_list ::= func", + /* 328 */ "func_list ::= func_list NK_COMMA func", + /* 329 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 330 */ "sma_func_name ::= function_name", + /* 331 */ "sma_func_name ::= COUNT", + /* 332 */ "sma_func_name ::= FIRST", + /* 333 */ "sma_func_name ::= LAST", + /* 334 */ "sma_func_name ::= LAST_ROW", + /* 335 */ "sma_stream_opt ::=", + /* 336 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 337 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 338 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 339 */ "with_meta ::= AS", + /* 340 */ "with_meta ::= WITH META AS", + /* 341 */ "with_meta ::= ONLY META AS", + /* 342 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 343 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 344 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 345 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 346 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 347 */ "cmd ::= DESC full_table_name", + /* 348 */ "cmd ::= DESCRIBE full_table_name", + /* 349 */ "cmd ::= RESET QUERY CACHE", + /* 350 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 351 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 352 */ "analyze_opt ::=", + /* 353 */ "analyze_opt ::= ANALYZE", + /* 354 */ "explain_options ::=", + /* 355 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 356 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 357 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 358 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 359 */ "agg_func_opt ::=", + /* 360 */ "agg_func_opt ::= AGGREGATE", + /* 361 */ "bufsize_opt ::=", + /* 362 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 363 */ "language_opt ::=", + /* 364 */ "language_opt ::= LANGUAGE NK_STRING", + /* 365 */ "or_replace_opt ::=", + /* 366 */ "or_replace_opt ::= OR REPLACE", + /* 367 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 368 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 369 */ "full_view_name ::= view_name", + /* 370 */ "full_view_name ::= db_name NK_DOT view_name", + /* 371 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", + /* 372 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 373 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 374 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 375 */ "col_list_opt ::=", + /* 376 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 377 */ "tag_def_or_ref_opt ::=", + /* 378 */ "tag_def_or_ref_opt ::= tags_def", + /* 379 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 380 */ "stream_options ::=", + /* 381 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 382 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 383 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 384 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 385 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 386 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 387 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 388 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 389 */ "subtable_opt ::=", + /* 390 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 391 */ "ignore_opt ::=", + /* 392 */ "ignore_opt ::= IGNORE UNTREATED", + /* 393 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 394 */ "cmd ::= KILL QUERY NK_STRING", + /* 395 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 396 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 397 */ "cmd ::= BALANCE VGROUP", + /* 398 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 399 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 400 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 401 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 402 */ "on_vgroup_id ::=", + /* 403 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 404 */ "dnode_list ::= DNODE NK_INTEGER", + /* 405 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 406 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 407 */ "cmd ::= query_or_subquery", + /* 408 */ "cmd ::= insert_query", + /* 409 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 410 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 411 */ "tags_literal ::= NK_INTEGER", + /* 412 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 413 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 414 */ "tags_literal ::= NK_FLOAT", + /* 415 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 416 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 417 */ "tags_literal ::= NK_BIN", + /* 418 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 419 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 420 */ "tags_literal ::= NK_HEX", + /* 421 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 422 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 423 */ "tags_literal ::= NK_STRING", + /* 424 */ "tags_literal ::= NK_BOOL", + /* 425 */ "tags_literal ::= NULL", + /* 426 */ "tags_literal ::= literal_func", + /* 427 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 428 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 429 */ "tags_literal_list ::= tags_literal", + /* 430 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 431 */ "literal ::= NK_INTEGER", + /* 432 */ "literal ::= NK_FLOAT", + /* 433 */ "literal ::= NK_STRING", + /* 434 */ "literal ::= NK_BOOL", + /* 435 */ "literal ::= TIMESTAMP NK_STRING", + /* 436 */ "literal ::= duration_literal", + /* 437 */ "literal ::= NULL", + /* 438 */ "literal ::= NK_QUESTION", + /* 439 */ "duration_literal ::= NK_VARIABLE", + /* 440 */ "signed ::= NK_INTEGER", + /* 441 */ "signed ::= NK_PLUS NK_INTEGER", + /* 442 */ "signed ::= NK_MINUS NK_INTEGER", + /* 443 */ "signed ::= NK_FLOAT", + /* 444 */ "signed ::= NK_PLUS NK_FLOAT", + /* 445 */ "signed ::= NK_MINUS NK_FLOAT", + /* 446 */ "signed_literal ::= signed", + /* 447 */ "signed_literal ::= NK_STRING", + /* 448 */ "signed_literal ::= NK_BOOL", + /* 449 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 450 */ "signed_literal ::= duration_literal", + /* 451 */ "signed_literal ::= NULL", + /* 452 */ "signed_literal ::= literal_func", + /* 453 */ "signed_literal ::= NK_QUESTION", + /* 454 */ "literal_list ::= signed_literal", + /* 455 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 456 */ "db_name ::= NK_ID", + /* 457 */ "table_name ::= NK_ID", + /* 458 */ "column_name ::= NK_ID", + /* 459 */ "function_name ::= NK_ID", + /* 460 */ "view_name ::= NK_ID", + /* 461 */ "table_alias ::= NK_ID", + /* 462 */ "column_alias ::= NK_ID", + /* 463 */ "column_alias ::= NK_ALIAS", + /* 464 */ "user_name ::= NK_ID", + /* 465 */ "topic_name ::= NK_ID", + /* 466 */ "stream_name ::= NK_ID", + /* 467 */ "cgroup_name ::= NK_ID", + /* 468 */ "index_name ::= NK_ID", + /* 469 */ "expr_or_subquery ::= expression", + /* 470 */ "expression ::= literal", + /* 471 */ "expression ::= pseudo_column", + /* 472 */ "expression ::= column_reference", + /* 473 */ "expression ::= function_expression", + /* 474 */ "expression ::= case_when_expression", + /* 475 */ "expression ::= NK_LP expression NK_RP", + /* 476 */ "expression ::= NK_PLUS expr_or_subquery", + /* 477 */ "expression ::= NK_MINUS expr_or_subquery", + /* 478 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 479 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 480 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 481 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 482 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 483 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 484 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 485 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 486 */ "expression_list ::= expr_or_subquery", + /* 487 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 488 */ "column_reference ::= column_name", + /* 489 */ "column_reference ::= table_name NK_DOT column_name", + /* 490 */ "column_reference ::= NK_ALIAS", + /* 491 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 492 */ "pseudo_column ::= ROWTS", + /* 493 */ "pseudo_column ::= TBNAME", + /* 494 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 495 */ "pseudo_column ::= QSTART", + /* 496 */ "pseudo_column ::= QEND", + /* 497 */ "pseudo_column ::= QDURATION", + /* 498 */ "pseudo_column ::= WSTART", + /* 499 */ "pseudo_column ::= WEND", + /* 500 */ "pseudo_column ::= WDURATION", + /* 501 */ "pseudo_column ::= IROWTS", + /* 502 */ "pseudo_column ::= ISFILLED", + /* 503 */ "pseudo_column ::= QTAGS", + /* 504 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 505 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 506 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 507 */ "function_expression ::= literal_func", + /* 508 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 509 */ "literal_func ::= NOW", + /* 510 */ "literal_func ::= TODAY", + /* 511 */ "noarg_func ::= NOW", + /* 512 */ "noarg_func ::= TODAY", + /* 513 */ "noarg_func ::= TIMEZONE", + /* 514 */ "noarg_func ::= DATABASE", + /* 515 */ "noarg_func ::= CLIENT_VERSION", + /* 516 */ "noarg_func ::= SERVER_VERSION", + /* 517 */ "noarg_func ::= SERVER_STATUS", + /* 518 */ "noarg_func ::= CURRENT_USER", + /* 519 */ "noarg_func ::= USER", + /* 520 */ "star_func ::= COUNT", + /* 521 */ "star_func ::= FIRST", + /* 522 */ "star_func ::= LAST", + /* 523 */ "star_func ::= LAST_ROW", + /* 524 */ "star_func_para_list ::= NK_STAR", + /* 525 */ "star_func_para_list ::= other_para_list", + /* 526 */ "other_para_list ::= star_func_para", + /* 527 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 528 */ "star_func_para ::= expr_or_subquery", + /* 529 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 530 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 531 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 532 */ "when_then_list ::= when_then_expr", + /* 533 */ "when_then_list ::= when_then_list when_then_expr", + /* 534 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 535 */ "case_when_else_opt ::=", + /* 536 */ "case_when_else_opt ::= ELSE common_expression", + /* 537 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 538 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 539 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 540 */ "predicate ::= expr_or_subquery IS NULL", + /* 541 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 542 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 543 */ "compare_op ::= NK_LT", + /* 544 */ "compare_op ::= NK_GT", + /* 545 */ "compare_op ::= NK_LE", + /* 546 */ "compare_op ::= NK_GE", + /* 547 */ "compare_op ::= NK_NE", + /* 548 */ "compare_op ::= NK_EQ", + /* 549 */ "compare_op ::= LIKE", + /* 550 */ "compare_op ::= NOT LIKE", + /* 551 */ "compare_op ::= MATCH", + /* 552 */ "compare_op ::= NMATCH", + /* 553 */ "compare_op ::= CONTAINS", + /* 554 */ "in_op ::= IN", + /* 555 */ "in_op ::= NOT IN", + /* 556 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 557 */ "boolean_value_expression ::= boolean_primary", + /* 558 */ "boolean_value_expression ::= NOT boolean_primary", + /* 559 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 560 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 561 */ "boolean_primary ::= predicate", + /* 562 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 563 */ "common_expression ::= expr_or_subquery", + /* 564 */ "common_expression ::= boolean_value_expression", + /* 565 */ "from_clause_opt ::=", + /* 566 */ "from_clause_opt ::= FROM table_reference_list", + /* 567 */ "table_reference_list ::= table_reference", + /* 568 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 569 */ "table_reference ::= table_primary", + /* 570 */ "table_reference ::= joined_table", + /* 571 */ "table_primary ::= table_name alias_opt", + /* 572 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 573 */ "table_primary ::= subquery alias_opt", + /* 574 */ "table_primary ::= parenthesized_joined_table", + /* 575 */ "alias_opt ::=", + /* 576 */ "alias_opt ::= table_alias", + /* 577 */ "alias_opt ::= AS table_alias", + /* 578 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 579 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 580 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 581 */ "join_type ::=", + /* 582 */ "join_type ::= INNER", + /* 583 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 584 */ "hint_list ::=", + /* 585 */ "hint_list ::= NK_HINT", + /* 586 */ "tag_mode_opt ::=", + /* 587 */ "tag_mode_opt ::= TAGS", + /* 588 */ "set_quantifier_opt ::=", + /* 589 */ "set_quantifier_opt ::= DISTINCT", + /* 590 */ "set_quantifier_opt ::= ALL", + /* 591 */ "select_list ::= select_item", + /* 592 */ "select_list ::= select_list NK_COMMA select_item", + /* 593 */ "select_item ::= NK_STAR", + /* 594 */ "select_item ::= common_expression", + /* 595 */ "select_item ::= common_expression column_alias", + /* 596 */ "select_item ::= common_expression AS column_alias", + /* 597 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 598 */ "where_clause_opt ::=", + /* 599 */ "where_clause_opt ::= WHERE search_condition", + /* 600 */ "partition_by_clause_opt ::=", + /* 601 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 602 */ "partition_list ::= partition_item", + /* 603 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 604 */ "partition_item ::= expr_or_subquery", + /* 605 */ "partition_item ::= expr_or_subquery column_alias", + /* 606 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 607 */ "twindow_clause_opt ::=", + /* 608 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 609 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 610 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 611 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 612 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 613 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 614 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 615 */ "sliding_opt ::=", + /* 616 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 617 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 618 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 619 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 620 */ "fill_opt ::=", + /* 621 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 622 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 623 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 624 */ "fill_mode ::= NONE", + /* 625 */ "fill_mode ::= PREV", + /* 626 */ "fill_mode ::= NULL", + /* 627 */ "fill_mode ::= NULL_F", + /* 628 */ "fill_mode ::= LINEAR", + /* 629 */ "fill_mode ::= NEXT", + /* 630 */ "group_by_clause_opt ::=", + /* 631 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 632 */ "group_by_list ::= expr_or_subquery", + /* 633 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 634 */ "having_clause_opt ::=", + /* 635 */ "having_clause_opt ::= HAVING search_condition", + /* 636 */ "range_opt ::=", + /* 637 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 638 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 639 */ "every_opt ::=", + /* 640 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 641 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 642 */ "query_simple ::= query_specification", + /* 643 */ "query_simple ::= union_query_expression", + /* 644 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 645 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 646 */ "query_simple_or_subquery ::= query_simple", + /* 647 */ "query_simple_or_subquery ::= subquery", + /* 648 */ "query_or_subquery ::= query_expression", + /* 649 */ "query_or_subquery ::= subquery", + /* 650 */ "order_by_clause_opt ::=", + /* 651 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 652 */ "slimit_clause_opt ::=", + /* 653 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 654 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 655 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 656 */ "limit_clause_opt ::=", + /* 657 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 658 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 659 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 660 */ "subquery ::= NK_LP query_expression NK_RP", + /* 661 */ "subquery ::= NK_LP subquery NK_RP", + /* 662 */ "search_condition ::= common_expression", + /* 663 */ "sort_specification_list ::= sort_specification", + /* 664 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 665 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 666 */ "ordering_specification_opt ::=", + /* 667 */ "ordering_specification_opt ::= ASC", + /* 668 */ "ordering_specification_opt ::= DESC", + /* 669 */ "null_ordering_opt ::=", + /* 670 */ "null_ordering_opt ::= NULLS FIRST", + /* 671 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2861,233 +2898,233 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 354: /* cmd */ - case 357: /* literal */ - case 366: /* with_opt */ - case 372: /* search_condition */ - case 377: /* db_options */ - case 379: /* alter_db_options */ - case 381: /* start_opt */ - case 382: /* end_opt */ - case 386: /* signed */ - case 388: /* retention */ - case 389: /* full_table_name */ - case 392: /* table_options */ - case 396: /* alter_table_clause */ - case 397: /* alter_table_options */ - case 400: /* tags_literal */ - case 401: /* create_subtable_clause */ - case 404: /* drop_table_clause */ - case 406: /* column_def */ - case 410: /* duration_literal */ - case 411: /* rollup_func_name */ - case 413: /* col_name */ - case 416: /* like_pattern_opt */ - case 417: /* db_name_cond_opt */ - case 418: /* table_name_cond */ - case 419: /* from_db_opt */ - case 422: /* tag_item */ - case 424: /* index_options */ - case 425: /* full_index_name */ - case 428: /* sliding_opt */ - case 429: /* sma_stream_opt */ - case 430: /* func */ - case 434: /* query_or_subquery */ - case 435: /* where_clause_opt */ - case 438: /* explain_options */ - case 439: /* insert_query */ - case 444: /* full_view_name */ - case 447: /* stream_options */ - case 450: /* subtable_opt */ - case 452: /* expression */ - case 455: /* literal_func */ - case 456: /* signed_literal */ - case 459: /* expr_or_subquery */ - case 460: /* pseudo_column */ - case 461: /* column_reference */ - case 462: /* function_expression */ - case 463: /* case_when_expression */ - case 468: /* star_func_para */ - case 470: /* case_when_else_opt */ - case 471: /* common_expression */ - case 472: /* when_then_expr */ - case 473: /* predicate */ - case 476: /* in_predicate_value */ - case 477: /* boolean_value_expression */ - case 478: /* boolean_primary */ - case 479: /* from_clause_opt */ - case 480: /* table_reference_list */ - case 481: /* table_reference */ - case 482: /* table_primary */ - case 483: /* joined_table */ - case 485: /* subquery */ - case 486: /* parenthesized_joined_table */ - case 488: /* query_specification */ - case 494: /* range_opt */ - case 495: /* every_opt */ - case 496: /* fill_opt */ - case 497: /* twindow_clause_opt */ - case 499: /* having_clause_opt */ - case 500: /* select_item */ - case 502: /* partition_item */ - case 503: /* interval_sliding_duration_literal */ - case 506: /* query_expression */ - case 507: /* query_simple */ - case 509: /* slimit_clause_opt */ - case 510: /* limit_clause_opt */ - case 511: /* union_query_expression */ - case 512: /* query_simple_or_subquery */ - case 514: /* sort_specification */ + case 355: /* cmd */ + case 358: /* literal */ + case 367: /* with_opt */ + case 373: /* search_condition */ + case 378: /* db_options */ + case 380: /* alter_db_options */ + case 382: /* start_opt */ + case 383: /* end_opt */ + case 387: /* signed */ + case 389: /* retention */ + case 390: /* full_table_name */ + case 393: /* table_options */ + case 397: /* alter_table_clause */ + case 398: /* alter_table_options */ + case 401: /* tags_literal */ + case 402: /* create_subtable_clause */ + case 405: /* drop_table_clause */ + case 407: /* column_def */ + case 411: /* duration_literal */ + case 412: /* rollup_func_name */ + case 414: /* col_name */ + case 417: /* like_pattern_opt */ + case 418: /* db_name_cond_opt */ + case 419: /* table_name_cond */ + case 420: /* from_db_opt */ + case 423: /* tag_item */ + case 425: /* index_options */ + case 426: /* full_index_name */ + case 429: /* sliding_opt */ + case 430: /* sma_stream_opt */ + case 431: /* func */ + case 435: /* query_or_subquery */ + case 436: /* where_clause_opt */ + case 439: /* explain_options */ + case 440: /* insert_query */ + case 445: /* full_view_name */ + case 448: /* stream_options */ + case 451: /* subtable_opt */ + case 453: /* expression */ + case 456: /* literal_func */ + case 457: /* signed_literal */ + case 460: /* expr_or_subquery */ + case 461: /* pseudo_column */ + case 462: /* column_reference */ + case 463: /* function_expression */ + case 464: /* case_when_expression */ + case 469: /* star_func_para */ + case 471: /* case_when_else_opt */ + case 472: /* common_expression */ + case 473: /* when_then_expr */ + case 474: /* predicate */ + case 477: /* in_predicate_value */ + case 478: /* boolean_value_expression */ + case 479: /* boolean_primary */ + case 480: /* from_clause_opt */ + case 481: /* table_reference_list */ + case 482: /* table_reference */ + case 483: /* table_primary */ + case 484: /* joined_table */ + case 486: /* subquery */ + case 487: /* parenthesized_joined_table */ + case 489: /* query_specification */ + case 495: /* range_opt */ + case 496: /* every_opt */ + case 497: /* fill_opt */ + case 498: /* twindow_clause_opt */ + case 500: /* having_clause_opt */ + case 501: /* select_item */ + case 503: /* partition_item */ + case 504: /* interval_sliding_duration_literal */ + case 507: /* query_expression */ + case 508: /* query_simple */ + case 510: /* slimit_clause_opt */ + case 511: /* limit_clause_opt */ + case 512: /* union_query_expression */ + case 513: /* query_simple_or_subquery */ + case 515: /* sort_specification */ { - nodesDestroyNode((yypminor->yy718)); + nodesDestroyNode((yypminor->yy896)); } break; - case 355: /* account_options */ - case 356: /* alter_account_options */ - case 358: /* alter_account_option */ - case 380: /* speed_opt */ - case 433: /* with_meta */ - case 442: /* bufsize_opt */ + case 356: /* account_options */ + case 357: /* alter_account_options */ + case 359: /* alter_account_option */ + case 381: /* speed_opt */ + case 434: /* with_meta */ + case 443: /* bufsize_opt */ { } break; - case 359: /* ip_range_list */ - case 360: /* white_list */ - case 361: /* white_list_opt */ - case 383: /* integer_list */ - case 384: /* variable_list */ - case 385: /* retention_list */ - case 390: /* column_def_list */ - case 391: /* tags_def_opt */ - case 393: /* multi_create_clause */ - case 394: /* tags_def */ - case 395: /* multi_drop_clause */ - case 402: /* specific_cols_opt */ - case 403: /* tags_literal_list */ - case 405: /* col_name_list */ - case 407: /* duration_list */ - case 408: /* rollup_func_list */ - case 420: /* tag_list_opt */ - case 427: /* func_list */ - case 432: /* expression_list */ - case 448: /* col_list_opt */ - case 449: /* tag_def_or_ref_opt */ - case 454: /* dnode_list */ - case 457: /* literal_list */ - case 465: /* star_func_para_list */ - case 467: /* other_para_list */ - case 469: /* when_then_list */ - case 489: /* hint_list */ - case 492: /* select_list */ - case 493: /* partition_by_clause_opt */ - case 498: /* group_by_clause_opt */ - case 501: /* partition_list */ - case 505: /* group_by_list */ - case 508: /* order_by_clause_opt */ - case 513: /* sort_specification_list */ + case 360: /* ip_range_list */ + case 361: /* white_list */ + case 362: /* white_list_opt */ + case 384: /* integer_list */ + case 385: /* variable_list */ + case 386: /* retention_list */ + case 391: /* column_def_list */ + case 392: /* tags_def_opt */ + case 394: /* multi_create_clause */ + case 395: /* tags_def */ + case 396: /* multi_drop_clause */ + case 403: /* specific_cols_opt */ + case 404: /* tags_literal_list */ + case 406: /* col_name_list */ + case 408: /* duration_list */ + case 409: /* rollup_func_list */ + case 421: /* tag_list_opt */ + case 428: /* func_list */ + case 433: /* expression_list */ + case 449: /* col_list_opt */ + case 450: /* tag_def_or_ref_opt */ + case 455: /* dnode_list */ + case 458: /* literal_list */ + case 466: /* star_func_para_list */ + case 468: /* other_para_list */ + case 470: /* when_then_list */ + case 490: /* hint_list */ + case 493: /* select_list */ + case 494: /* partition_by_clause_opt */ + case 499: /* group_by_clause_opt */ + case 502: /* partition_list */ + case 506: /* group_by_list */ + case 509: /* order_by_clause_opt */ + case 514: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy552)); + nodesDestroyList((yypminor->yy404)); } break; - case 362: /* user_name */ - case 369: /* db_name */ - case 370: /* table_name */ - case 371: /* topic_name */ - case 373: /* dnode_endpoint */ - case 398: /* column_name */ - case 412: /* function_name */ - case 423: /* column_alias */ - case 426: /* index_name */ - case 431: /* sma_func_name */ - case 436: /* cgroup_name */ - case 443: /* language_opt */ - case 445: /* view_name */ - case 446: /* stream_name */ - case 453: /* on_vgroup_id */ - case 458: /* table_alias */ - case 464: /* star_func */ - case 466: /* noarg_func */ - case 484: /* alias_opt */ + case 363: /* user_name */ + case 370: /* db_name */ + case 371: /* table_name */ + case 372: /* topic_name */ + case 374: /* dnode_endpoint */ + case 399: /* column_name */ + case 413: /* function_name */ + case 424: /* column_alias */ + case 427: /* index_name */ + case 432: /* sma_func_name */ + case 437: /* cgroup_name */ + case 444: /* language_opt */ + case 446: /* view_name */ + case 447: /* stream_name */ + case 454: /* on_vgroup_id */ + case 459: /* table_alias */ + case 465: /* star_func */ + case 467: /* noarg_func */ + case 485: /* alias_opt */ { } break; - case 363: /* sysinfo_opt */ + case 364: /* sysinfo_opt */ { } break; - case 364: /* privileges */ - case 367: /* priv_type_list */ - case 368: /* priv_type */ + case 365: /* privileges */ + case 368: /* priv_type_list */ + case 369: /* priv_type */ { } break; - case 365: /* priv_level */ + case 366: /* priv_level */ { } break; - case 374: /* force_opt */ - case 375: /* unsafe_opt */ - case 376: /* not_exists_opt */ - case 378: /* exists_opt */ - case 437: /* analyze_opt */ - case 440: /* or_replace_opt */ - case 441: /* agg_func_opt */ - case 451: /* ignore_opt */ - case 490: /* set_quantifier_opt */ - case 491: /* tag_mode_opt */ + case 375: /* force_opt */ + case 376: /* unsafe_opt */ + case 377: /* not_exists_opt */ + case 379: /* exists_opt */ + case 438: /* analyze_opt */ + case 441: /* or_replace_opt */ + case 442: /* agg_func_opt */ + case 452: /* ignore_opt */ + case 491: /* set_quantifier_opt */ + case 492: /* tag_mode_opt */ { } break; - case 387: /* alter_db_option */ - case 409: /* alter_table_option */ + case 388: /* alter_db_option */ + case 410: /* alter_table_option */ { } break; - case 399: /* type_name */ + case 400: /* type_name */ { } break; - case 414: /* db_kind_opt */ - case 421: /* table_kind */ + case 415: /* db_kind_opt */ + case 422: /* table_kind */ { } break; - case 415: /* table_kind_db_name_cond_opt */ + case 416: /* table_kind_db_name_cond_opt */ { } break; - case 474: /* compare_op */ - case 475: /* in_op */ + case 475: /* compare_op */ + case 476: /* in_op */ { } break; - case 487: /* join_type */ + case 488: /* join_type */ { } break; - case 504: /* fill_mode */ + case 505: /* fill_mode */ { } break; - case 515: /* ordering_specification_opt */ + case 516: /* ordering_specification_opt */ { } break; - case 516: /* null_ordering_opt */ + case 517: /* null_ordering_opt */ { } @@ -3378,677 +3415,678 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 354, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 354, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 355, /* (2) account_options ::= */ - 355, /* (3) account_options ::= account_options PPS literal */ - 355, /* (4) account_options ::= account_options TSERIES literal */ - 355, /* (5) account_options ::= account_options STORAGE literal */ - 355, /* (6) account_options ::= account_options STREAMS literal */ - 355, /* (7) account_options ::= account_options QTIME literal */ - 355, /* (8) account_options ::= account_options DBS literal */ - 355, /* (9) account_options ::= account_options USERS literal */ - 355, /* (10) account_options ::= account_options CONNS literal */ - 355, /* (11) account_options ::= account_options STATE literal */ - 356, /* (12) alter_account_options ::= alter_account_option */ - 356, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 358, /* (14) alter_account_option ::= PASS literal */ - 358, /* (15) alter_account_option ::= PPS literal */ - 358, /* (16) alter_account_option ::= TSERIES literal */ - 358, /* (17) alter_account_option ::= STORAGE literal */ - 358, /* (18) alter_account_option ::= STREAMS literal */ - 358, /* (19) alter_account_option ::= QTIME literal */ - 358, /* (20) alter_account_option ::= DBS literal */ - 358, /* (21) alter_account_option ::= USERS literal */ - 358, /* (22) alter_account_option ::= CONNS literal */ - 358, /* (23) alter_account_option ::= STATE literal */ - 359, /* (24) ip_range_list ::= NK_STRING */ - 359, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 360, /* (26) white_list ::= HOST ip_range_list */ - 361, /* (27) white_list_opt ::= */ - 361, /* (28) white_list_opt ::= white_list */ - 354, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 354, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 354, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 354, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 354, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 354, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 354, /* (35) cmd ::= DROP USER user_name */ - 363, /* (36) sysinfo_opt ::= */ - 363, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 354, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 354, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 364, /* (40) privileges ::= ALL */ - 364, /* (41) privileges ::= priv_type_list */ - 364, /* (42) privileges ::= SUBSCRIBE */ - 367, /* (43) priv_type_list ::= priv_type */ - 367, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 368, /* (45) priv_type ::= READ */ - 368, /* (46) priv_type ::= WRITE */ - 368, /* (47) priv_type ::= ALTER */ - 365, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 365, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 365, /* (50) priv_level ::= db_name NK_DOT table_name */ - 365, /* (51) priv_level ::= topic_name */ - 366, /* (52) with_opt ::= */ - 366, /* (53) with_opt ::= WITH search_condition */ - 354, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 354, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 354, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 354, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 354, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 354, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 354, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 354, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 354, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 354, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 354, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 373, /* (65) dnode_endpoint ::= NK_STRING */ - 373, /* (66) dnode_endpoint ::= NK_ID */ - 373, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 374, /* (68) force_opt ::= */ - 374, /* (69) force_opt ::= FORCE */ - 375, /* (70) unsafe_opt ::= UNSAFE */ - 354, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ - 354, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 354, /* (73) cmd ::= ALTER LOCAL NK_STRING */ - 354, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 354, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 354, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 354, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 354, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 354, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 354, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 354, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 354, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 354, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 354, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 354, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 354, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 354, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ - 354, /* (88) cmd ::= USE db_name */ - 354, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ - 354, /* (90) cmd ::= FLUSH DATABASE db_name */ - 354, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ - 354, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 376, /* (93) not_exists_opt ::= IF NOT EXISTS */ - 376, /* (94) not_exists_opt ::= */ - 378, /* (95) exists_opt ::= IF EXISTS */ - 378, /* (96) exists_opt ::= */ - 377, /* (97) db_options ::= */ - 377, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ - 377, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ - 377, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ - 377, /* (101) db_options ::= db_options COMP NK_INTEGER */ - 377, /* (102) db_options ::= db_options DURATION NK_INTEGER */ - 377, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ - 377, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ - 377, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ - 377, /* (106) db_options ::= db_options KEEP integer_list */ - 377, /* (107) db_options ::= db_options KEEP variable_list */ - 377, /* (108) db_options ::= db_options PAGES NK_INTEGER */ - 377, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ - 377, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 377, /* (111) db_options ::= db_options PRECISION NK_STRING */ - 377, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ - 377, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ - 377, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 377, /* (115) db_options ::= db_options RETENTIONS retention_list */ - 377, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 377, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 377, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 377, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 377, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 377, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 377, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 377, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 377, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 377, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 377, /* (126) db_options ::= db_options TABLE_PREFIX signed */ - 377, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ - 377, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 379, /* (129) alter_db_options ::= alter_db_option */ - 379, /* (130) alter_db_options ::= alter_db_options alter_db_option */ - 387, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ - 387, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ - 387, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ - 387, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 387, /* (135) alter_db_option ::= KEEP integer_list */ - 387, /* (136) alter_db_option ::= KEEP variable_list */ - 387, /* (137) alter_db_option ::= PAGES NK_INTEGER */ - 387, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ - 387, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 387, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 387, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ - 387, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 387, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 387, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 387, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 387, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 383, /* (147) integer_list ::= NK_INTEGER */ - 383, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 384, /* (149) variable_list ::= NK_VARIABLE */ - 384, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 385, /* (151) retention_list ::= retention */ - 385, /* (152) retention_list ::= retention_list NK_COMMA retention */ - 388, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 388, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 380, /* (155) speed_opt ::= */ - 380, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ - 381, /* (157) start_opt ::= */ - 381, /* (158) start_opt ::= START WITH NK_INTEGER */ - 381, /* (159) start_opt ::= START WITH NK_STRING */ - 381, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 382, /* (161) end_opt ::= */ - 382, /* (162) end_opt ::= END WITH NK_INTEGER */ - 382, /* (163) end_opt ::= END WITH NK_STRING */ - 382, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 354, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 354, /* (166) cmd ::= CREATE TABLE multi_create_clause */ - 354, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 354, /* (168) cmd ::= DROP TABLE multi_drop_clause */ - 354, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ - 354, /* (170) cmd ::= ALTER TABLE alter_table_clause */ - 354, /* (171) cmd ::= ALTER STABLE alter_table_clause */ - 396, /* (172) alter_table_clause ::= full_table_name alter_table_options */ - 396, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 396, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 396, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 396, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 396, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 396, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ - 396, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 396, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 396, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 393, /* (182) multi_create_clause ::= create_subtable_clause */ - 393, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 401, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 395, /* (185) multi_drop_clause ::= drop_table_clause */ - 395, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 404, /* (187) drop_table_clause ::= exists_opt full_table_name */ - 402, /* (188) specific_cols_opt ::= */ - 402, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 389, /* (190) full_table_name ::= table_name */ - 389, /* (191) full_table_name ::= db_name NK_DOT table_name */ - 390, /* (192) column_def_list ::= column_def */ - 390, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ - 406, /* (194) column_def ::= column_name type_name */ - 406, /* (195) column_def ::= column_name type_name PRIMARY KEY */ - 399, /* (196) type_name ::= BOOL */ - 399, /* (197) type_name ::= TINYINT */ - 399, /* (198) type_name ::= SMALLINT */ - 399, /* (199) type_name ::= INT */ - 399, /* (200) type_name ::= INTEGER */ - 399, /* (201) type_name ::= BIGINT */ - 399, /* (202) type_name ::= FLOAT */ - 399, /* (203) type_name ::= DOUBLE */ - 399, /* (204) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 399, /* (205) type_name ::= TIMESTAMP */ - 399, /* (206) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 399, /* (207) type_name ::= TINYINT UNSIGNED */ - 399, /* (208) type_name ::= SMALLINT UNSIGNED */ - 399, /* (209) type_name ::= INT UNSIGNED */ - 399, /* (210) type_name ::= BIGINT UNSIGNED */ - 399, /* (211) type_name ::= JSON */ - 399, /* (212) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 399, /* (213) type_name ::= MEDIUMBLOB */ - 399, /* (214) type_name ::= BLOB */ - 399, /* (215) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 399, /* (216) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 399, /* (217) type_name ::= DECIMAL */ - 399, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 399, /* (219) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 391, /* (220) tags_def_opt ::= */ - 391, /* (221) tags_def_opt ::= tags_def */ - 394, /* (222) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 392, /* (223) table_options ::= */ - 392, /* (224) table_options ::= table_options COMMENT NK_STRING */ - 392, /* (225) table_options ::= table_options MAX_DELAY duration_list */ - 392, /* (226) table_options ::= table_options WATERMARK duration_list */ - 392, /* (227) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 392, /* (228) table_options ::= table_options TTL NK_INTEGER */ - 392, /* (229) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 392, /* (230) table_options ::= table_options DELETE_MARK duration_list */ - 397, /* (231) alter_table_options ::= alter_table_option */ - 397, /* (232) alter_table_options ::= alter_table_options alter_table_option */ - 409, /* (233) alter_table_option ::= COMMENT NK_STRING */ - 409, /* (234) alter_table_option ::= TTL NK_INTEGER */ - 407, /* (235) duration_list ::= duration_literal */ - 407, /* (236) duration_list ::= duration_list NK_COMMA duration_literal */ - 408, /* (237) rollup_func_list ::= rollup_func_name */ - 408, /* (238) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 411, /* (239) rollup_func_name ::= function_name */ - 411, /* (240) rollup_func_name ::= FIRST */ - 411, /* (241) rollup_func_name ::= LAST */ - 405, /* (242) col_name_list ::= col_name */ - 405, /* (243) col_name_list ::= col_name_list NK_COMMA col_name */ - 413, /* (244) col_name ::= column_name */ - 354, /* (245) cmd ::= SHOW DNODES */ - 354, /* (246) cmd ::= SHOW USERS */ - 354, /* (247) cmd ::= SHOW USER PRIVILEGES */ - 354, /* (248) cmd ::= SHOW db_kind_opt DATABASES */ - 354, /* (249) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 354, /* (250) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 354, /* (251) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 354, /* (252) cmd ::= SHOW MNODES */ - 354, /* (253) cmd ::= SHOW QNODES */ - 354, /* (254) cmd ::= SHOW FUNCTIONS */ - 354, /* (255) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 354, /* (256) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 354, /* (257) cmd ::= SHOW STREAMS */ - 354, /* (258) cmd ::= SHOW ACCOUNTS */ - 354, /* (259) cmd ::= SHOW APPS */ - 354, /* (260) cmd ::= SHOW CONNECTIONS */ - 354, /* (261) cmd ::= SHOW LICENCES */ - 354, /* (262) cmd ::= SHOW GRANTS */ - 354, /* (263) cmd ::= SHOW GRANTS FULL */ - 354, /* (264) cmd ::= SHOW GRANTS LOGS */ - 354, /* (265) cmd ::= SHOW CLUSTER MACHINES */ - 354, /* (266) cmd ::= SHOW CREATE DATABASE db_name */ - 354, /* (267) cmd ::= SHOW CREATE TABLE full_table_name */ - 354, /* (268) cmd ::= SHOW CREATE STABLE full_table_name */ - 354, /* (269) cmd ::= SHOW QUERIES */ - 354, /* (270) cmd ::= SHOW SCORES */ - 354, /* (271) cmd ::= SHOW TOPICS */ - 354, /* (272) cmd ::= SHOW VARIABLES */ - 354, /* (273) cmd ::= SHOW CLUSTER VARIABLES */ - 354, /* (274) cmd ::= SHOW LOCAL VARIABLES */ - 354, /* (275) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 354, /* (276) cmd ::= SHOW BNODES */ - 354, /* (277) cmd ::= SHOW SNODES */ - 354, /* (278) cmd ::= SHOW CLUSTER */ - 354, /* (279) cmd ::= SHOW TRANSACTIONS */ - 354, /* (280) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 354, /* (281) cmd ::= SHOW CONSUMERS */ - 354, /* (282) cmd ::= SHOW SUBSCRIPTIONS */ - 354, /* (283) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 354, /* (284) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 354, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 354, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 354, /* (287) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 354, /* (288) cmd ::= SHOW VNODES */ - 354, /* (289) cmd ::= SHOW db_name_cond_opt ALIVE */ - 354, /* (290) cmd ::= SHOW CLUSTER ALIVE */ - 354, /* (291) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 354, /* (292) cmd ::= SHOW CREATE VIEW full_table_name */ - 354, /* (293) cmd ::= SHOW COMPACTS */ - 354, /* (294) cmd ::= SHOW COMPACT NK_INTEGER */ - 415, /* (295) table_kind_db_name_cond_opt ::= */ - 415, /* (296) table_kind_db_name_cond_opt ::= table_kind */ - 415, /* (297) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 415, /* (298) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 421, /* (299) table_kind ::= NORMAL */ - 421, /* (300) table_kind ::= CHILD */ - 417, /* (301) db_name_cond_opt ::= */ - 417, /* (302) db_name_cond_opt ::= db_name NK_DOT */ - 416, /* (303) like_pattern_opt ::= */ - 416, /* (304) like_pattern_opt ::= LIKE NK_STRING */ - 418, /* (305) table_name_cond ::= table_name */ - 419, /* (306) from_db_opt ::= */ - 419, /* (307) from_db_opt ::= FROM db_name */ - 420, /* (308) tag_list_opt ::= */ - 420, /* (309) tag_list_opt ::= tag_item */ - 420, /* (310) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 422, /* (311) tag_item ::= TBNAME */ - 422, /* (312) tag_item ::= QTAGS */ - 422, /* (313) tag_item ::= column_name */ - 422, /* (314) tag_item ::= column_name column_alias */ - 422, /* (315) tag_item ::= column_name AS column_alias */ - 414, /* (316) db_kind_opt ::= */ - 414, /* (317) db_kind_opt ::= USER */ - 414, /* (318) db_kind_opt ::= SYSTEM */ - 354, /* (319) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 354, /* (320) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 354, /* (321) cmd ::= DROP INDEX exists_opt full_index_name */ - 425, /* (322) full_index_name ::= index_name */ - 425, /* (323) full_index_name ::= db_name NK_DOT index_name */ - 424, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 424, /* (325) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 427, /* (326) func_list ::= func */ - 427, /* (327) func_list ::= func_list NK_COMMA func */ - 430, /* (328) func ::= sma_func_name NK_LP expression_list NK_RP */ - 431, /* (329) sma_func_name ::= function_name */ - 431, /* (330) sma_func_name ::= COUNT */ - 431, /* (331) sma_func_name ::= FIRST */ - 431, /* (332) sma_func_name ::= LAST */ - 431, /* (333) sma_func_name ::= LAST_ROW */ - 429, /* (334) sma_stream_opt ::= */ - 429, /* (335) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 429, /* (336) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 429, /* (337) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 433, /* (338) with_meta ::= AS */ - 433, /* (339) with_meta ::= WITH META AS */ - 433, /* (340) with_meta ::= ONLY META AS */ - 354, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 354, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 354, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 354, /* (344) cmd ::= DROP TOPIC exists_opt topic_name */ - 354, /* (345) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 354, /* (346) cmd ::= DESC full_table_name */ - 354, /* (347) cmd ::= DESCRIBE full_table_name */ - 354, /* (348) cmd ::= RESET QUERY CACHE */ - 354, /* (349) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 354, /* (350) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 437, /* (351) analyze_opt ::= */ - 437, /* (352) analyze_opt ::= ANALYZE */ - 438, /* (353) explain_options ::= */ - 438, /* (354) explain_options ::= explain_options VERBOSE NK_BOOL */ - 438, /* (355) explain_options ::= explain_options RATIO NK_FLOAT */ - 354, /* (356) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 354, /* (357) cmd ::= DROP FUNCTION exists_opt function_name */ - 441, /* (358) agg_func_opt ::= */ - 441, /* (359) agg_func_opt ::= AGGREGATE */ - 442, /* (360) bufsize_opt ::= */ - 442, /* (361) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 443, /* (362) language_opt ::= */ - 443, /* (363) language_opt ::= LANGUAGE NK_STRING */ - 440, /* (364) or_replace_opt ::= */ - 440, /* (365) or_replace_opt ::= OR REPLACE */ - 354, /* (366) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 354, /* (367) cmd ::= DROP VIEW exists_opt full_view_name */ - 444, /* (368) full_view_name ::= view_name */ - 444, /* (369) full_view_name ::= db_name NK_DOT view_name */ - 354, /* (370) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 354, /* (371) cmd ::= DROP STREAM exists_opt stream_name */ - 354, /* (372) cmd ::= PAUSE STREAM exists_opt stream_name */ - 354, /* (373) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 448, /* (374) col_list_opt ::= */ - 448, /* (375) col_list_opt ::= NK_LP col_name_list NK_RP */ - 449, /* (376) tag_def_or_ref_opt ::= */ - 449, /* (377) tag_def_or_ref_opt ::= tags_def */ - 449, /* (378) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 447, /* (379) stream_options ::= */ - 447, /* (380) stream_options ::= stream_options TRIGGER AT_ONCE */ - 447, /* (381) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 447, /* (382) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 447, /* (383) stream_options ::= stream_options WATERMARK duration_literal */ - 447, /* (384) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 447, /* (385) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 447, /* (386) stream_options ::= stream_options DELETE_MARK duration_literal */ - 447, /* (387) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 450, /* (388) subtable_opt ::= */ - 450, /* (389) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 451, /* (390) ignore_opt ::= */ - 451, /* (391) ignore_opt ::= IGNORE UNTREATED */ - 354, /* (392) cmd ::= KILL CONNECTION NK_INTEGER */ - 354, /* (393) cmd ::= KILL QUERY NK_STRING */ - 354, /* (394) cmd ::= KILL TRANSACTION NK_INTEGER */ - 354, /* (395) cmd ::= KILL COMPACT NK_INTEGER */ - 354, /* (396) cmd ::= BALANCE VGROUP */ - 354, /* (397) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 354, /* (398) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 354, /* (399) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 354, /* (400) cmd ::= SPLIT VGROUP NK_INTEGER */ - 453, /* (401) on_vgroup_id ::= */ - 453, /* (402) on_vgroup_id ::= ON NK_INTEGER */ - 454, /* (403) dnode_list ::= DNODE NK_INTEGER */ - 454, /* (404) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 354, /* (405) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 354, /* (406) cmd ::= query_or_subquery */ - 354, /* (407) cmd ::= insert_query */ - 439, /* (408) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 439, /* (409) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 400, /* (410) tags_literal ::= NK_INTEGER */ - 400, /* (411) tags_literal ::= NK_PLUS NK_INTEGER */ - 400, /* (412) tags_literal ::= NK_MINUS NK_INTEGER */ - 400, /* (413) tags_literal ::= NK_FLOAT */ - 400, /* (414) tags_literal ::= NK_PLUS NK_FLOAT */ - 400, /* (415) tags_literal ::= NK_MINUS NK_FLOAT */ - 400, /* (416) tags_literal ::= NK_BIN */ - 400, /* (417) tags_literal ::= NK_PLUS NK_BIN */ - 400, /* (418) tags_literal ::= NK_MINUS NK_BIN */ - 400, /* (419) tags_literal ::= NK_HEX */ - 400, /* (420) tags_literal ::= NK_PLUS NK_HEX */ - 400, /* (421) tags_literal ::= NK_MINUS NK_HEX */ - 400, /* (422) tags_literal ::= NK_STRING */ - 400, /* (423) tags_literal ::= NK_BOOL */ - 400, /* (424) tags_literal ::= NULL */ - 400, /* (425) tags_literal ::= literal_func */ - 400, /* (426) tags_literal ::= literal_func NK_PLUS duration_literal */ - 400, /* (427) tags_literal ::= literal_func NK_MINUS duration_literal */ - 403, /* (428) tags_literal_list ::= tags_literal */ - 403, /* (429) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 357, /* (430) literal ::= NK_INTEGER */ - 357, /* (431) literal ::= NK_FLOAT */ - 357, /* (432) literal ::= NK_STRING */ - 357, /* (433) literal ::= NK_BOOL */ - 357, /* (434) literal ::= TIMESTAMP NK_STRING */ - 357, /* (435) literal ::= duration_literal */ - 357, /* (436) literal ::= NULL */ - 357, /* (437) literal ::= NK_QUESTION */ - 410, /* (438) duration_literal ::= NK_VARIABLE */ - 386, /* (439) signed ::= NK_INTEGER */ - 386, /* (440) signed ::= NK_PLUS NK_INTEGER */ - 386, /* (441) signed ::= NK_MINUS NK_INTEGER */ - 386, /* (442) signed ::= NK_FLOAT */ - 386, /* (443) signed ::= NK_PLUS NK_FLOAT */ - 386, /* (444) signed ::= NK_MINUS NK_FLOAT */ - 456, /* (445) signed_literal ::= signed */ - 456, /* (446) signed_literal ::= NK_STRING */ - 456, /* (447) signed_literal ::= NK_BOOL */ - 456, /* (448) signed_literal ::= TIMESTAMP NK_STRING */ - 456, /* (449) signed_literal ::= duration_literal */ - 456, /* (450) signed_literal ::= NULL */ - 456, /* (451) signed_literal ::= literal_func */ - 456, /* (452) signed_literal ::= NK_QUESTION */ - 457, /* (453) literal_list ::= signed_literal */ - 457, /* (454) literal_list ::= literal_list NK_COMMA signed_literal */ - 369, /* (455) db_name ::= NK_ID */ - 370, /* (456) table_name ::= NK_ID */ - 398, /* (457) column_name ::= NK_ID */ - 412, /* (458) function_name ::= NK_ID */ - 445, /* (459) view_name ::= NK_ID */ - 458, /* (460) table_alias ::= NK_ID */ - 423, /* (461) column_alias ::= NK_ID */ - 423, /* (462) column_alias ::= NK_ALIAS */ - 362, /* (463) user_name ::= NK_ID */ - 371, /* (464) topic_name ::= NK_ID */ - 446, /* (465) stream_name ::= NK_ID */ - 436, /* (466) cgroup_name ::= NK_ID */ - 426, /* (467) index_name ::= NK_ID */ - 459, /* (468) expr_or_subquery ::= expression */ - 452, /* (469) expression ::= literal */ - 452, /* (470) expression ::= pseudo_column */ - 452, /* (471) expression ::= column_reference */ - 452, /* (472) expression ::= function_expression */ - 452, /* (473) expression ::= case_when_expression */ - 452, /* (474) expression ::= NK_LP expression NK_RP */ - 452, /* (475) expression ::= NK_PLUS expr_or_subquery */ - 452, /* (476) expression ::= NK_MINUS expr_or_subquery */ - 452, /* (477) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 452, /* (478) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 452, /* (479) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 452, /* (480) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 452, /* (481) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 452, /* (482) expression ::= column_reference NK_ARROW NK_STRING */ - 452, /* (483) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 452, /* (484) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 432, /* (485) expression_list ::= expr_or_subquery */ - 432, /* (486) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 461, /* (487) column_reference ::= column_name */ - 461, /* (488) column_reference ::= table_name NK_DOT column_name */ - 461, /* (489) column_reference ::= NK_ALIAS */ - 461, /* (490) column_reference ::= table_name NK_DOT NK_ALIAS */ - 460, /* (491) pseudo_column ::= ROWTS */ - 460, /* (492) pseudo_column ::= TBNAME */ - 460, /* (493) pseudo_column ::= table_name NK_DOT TBNAME */ - 460, /* (494) pseudo_column ::= QSTART */ - 460, /* (495) pseudo_column ::= QEND */ - 460, /* (496) pseudo_column ::= QDURATION */ - 460, /* (497) pseudo_column ::= WSTART */ - 460, /* (498) pseudo_column ::= WEND */ - 460, /* (499) pseudo_column ::= WDURATION */ - 460, /* (500) pseudo_column ::= IROWTS */ - 460, /* (501) pseudo_column ::= ISFILLED */ - 460, /* (502) pseudo_column ::= QTAGS */ - 462, /* (503) function_expression ::= function_name NK_LP expression_list NK_RP */ - 462, /* (504) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 462, /* (505) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 462, /* (506) function_expression ::= literal_func */ - 455, /* (507) literal_func ::= noarg_func NK_LP NK_RP */ - 455, /* (508) literal_func ::= NOW */ - 455, /* (509) literal_func ::= TODAY */ - 466, /* (510) noarg_func ::= NOW */ - 466, /* (511) noarg_func ::= TODAY */ - 466, /* (512) noarg_func ::= TIMEZONE */ - 466, /* (513) noarg_func ::= DATABASE */ - 466, /* (514) noarg_func ::= CLIENT_VERSION */ - 466, /* (515) noarg_func ::= SERVER_VERSION */ - 466, /* (516) noarg_func ::= SERVER_STATUS */ - 466, /* (517) noarg_func ::= CURRENT_USER */ - 466, /* (518) noarg_func ::= USER */ - 464, /* (519) star_func ::= COUNT */ - 464, /* (520) star_func ::= FIRST */ - 464, /* (521) star_func ::= LAST */ - 464, /* (522) star_func ::= LAST_ROW */ - 465, /* (523) star_func_para_list ::= NK_STAR */ - 465, /* (524) star_func_para_list ::= other_para_list */ - 467, /* (525) other_para_list ::= star_func_para */ - 467, /* (526) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 468, /* (527) star_func_para ::= expr_or_subquery */ - 468, /* (528) star_func_para ::= table_name NK_DOT NK_STAR */ - 463, /* (529) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 463, /* (530) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 469, /* (531) when_then_list ::= when_then_expr */ - 469, /* (532) when_then_list ::= when_then_list when_then_expr */ - 472, /* (533) when_then_expr ::= WHEN common_expression THEN common_expression */ - 470, /* (534) case_when_else_opt ::= */ - 470, /* (535) case_when_else_opt ::= ELSE common_expression */ - 473, /* (536) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 473, /* (537) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 473, /* (538) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 473, /* (539) predicate ::= expr_or_subquery IS NULL */ - 473, /* (540) predicate ::= expr_or_subquery IS NOT NULL */ - 473, /* (541) predicate ::= expr_or_subquery in_op in_predicate_value */ - 474, /* (542) compare_op ::= NK_LT */ - 474, /* (543) compare_op ::= NK_GT */ - 474, /* (544) compare_op ::= NK_LE */ - 474, /* (545) compare_op ::= NK_GE */ - 474, /* (546) compare_op ::= NK_NE */ - 474, /* (547) compare_op ::= NK_EQ */ - 474, /* (548) compare_op ::= LIKE */ - 474, /* (549) compare_op ::= NOT LIKE */ - 474, /* (550) compare_op ::= MATCH */ - 474, /* (551) compare_op ::= NMATCH */ - 474, /* (552) compare_op ::= CONTAINS */ - 475, /* (553) in_op ::= IN */ - 475, /* (554) in_op ::= NOT IN */ - 476, /* (555) in_predicate_value ::= NK_LP literal_list NK_RP */ - 477, /* (556) boolean_value_expression ::= boolean_primary */ - 477, /* (557) boolean_value_expression ::= NOT boolean_primary */ - 477, /* (558) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 477, /* (559) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 478, /* (560) boolean_primary ::= predicate */ - 478, /* (561) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 471, /* (562) common_expression ::= expr_or_subquery */ - 471, /* (563) common_expression ::= boolean_value_expression */ - 479, /* (564) from_clause_opt ::= */ - 479, /* (565) from_clause_opt ::= FROM table_reference_list */ - 480, /* (566) table_reference_list ::= table_reference */ - 480, /* (567) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 481, /* (568) table_reference ::= table_primary */ - 481, /* (569) table_reference ::= joined_table */ - 482, /* (570) table_primary ::= table_name alias_opt */ - 482, /* (571) table_primary ::= db_name NK_DOT table_name alias_opt */ - 482, /* (572) table_primary ::= subquery alias_opt */ - 482, /* (573) table_primary ::= parenthesized_joined_table */ - 484, /* (574) alias_opt ::= */ - 484, /* (575) alias_opt ::= table_alias */ - 484, /* (576) alias_opt ::= AS table_alias */ - 486, /* (577) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 486, /* (578) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 483, /* (579) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 487, /* (580) join_type ::= */ - 487, /* (581) join_type ::= INNER */ - 488, /* (582) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 489, /* (583) hint_list ::= */ - 489, /* (584) hint_list ::= NK_HINT */ - 491, /* (585) tag_mode_opt ::= */ - 491, /* (586) tag_mode_opt ::= TAGS */ - 490, /* (587) set_quantifier_opt ::= */ - 490, /* (588) set_quantifier_opt ::= DISTINCT */ - 490, /* (589) set_quantifier_opt ::= ALL */ - 492, /* (590) select_list ::= select_item */ - 492, /* (591) select_list ::= select_list NK_COMMA select_item */ - 500, /* (592) select_item ::= NK_STAR */ - 500, /* (593) select_item ::= common_expression */ - 500, /* (594) select_item ::= common_expression column_alias */ - 500, /* (595) select_item ::= common_expression AS column_alias */ - 500, /* (596) select_item ::= table_name NK_DOT NK_STAR */ - 435, /* (597) where_clause_opt ::= */ - 435, /* (598) where_clause_opt ::= WHERE search_condition */ - 493, /* (599) partition_by_clause_opt ::= */ - 493, /* (600) partition_by_clause_opt ::= PARTITION BY partition_list */ - 501, /* (601) partition_list ::= partition_item */ - 501, /* (602) partition_list ::= partition_list NK_COMMA partition_item */ - 502, /* (603) partition_item ::= expr_or_subquery */ - 502, /* (604) partition_item ::= expr_or_subquery column_alias */ - 502, /* (605) partition_item ::= expr_or_subquery AS column_alias */ - 497, /* (606) twindow_clause_opt ::= */ - 497, /* (607) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 497, /* (608) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 497, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 497, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 497, /* (611) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 497, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 497, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 428, /* (614) sliding_opt ::= */ - 428, /* (615) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 503, /* (616) interval_sliding_duration_literal ::= NK_VARIABLE */ - 503, /* (617) interval_sliding_duration_literal ::= NK_STRING */ - 503, /* (618) interval_sliding_duration_literal ::= NK_INTEGER */ - 496, /* (619) fill_opt ::= */ - 496, /* (620) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 496, /* (621) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 496, /* (622) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 504, /* (623) fill_mode ::= NONE */ - 504, /* (624) fill_mode ::= PREV */ - 504, /* (625) fill_mode ::= NULL */ - 504, /* (626) fill_mode ::= NULL_F */ - 504, /* (627) fill_mode ::= LINEAR */ - 504, /* (628) fill_mode ::= NEXT */ - 498, /* (629) group_by_clause_opt ::= */ - 498, /* (630) group_by_clause_opt ::= GROUP BY group_by_list */ - 505, /* (631) group_by_list ::= expr_or_subquery */ - 505, /* (632) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 499, /* (633) having_clause_opt ::= */ - 499, /* (634) having_clause_opt ::= HAVING search_condition */ - 494, /* (635) range_opt ::= */ - 494, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 494, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 495, /* (638) every_opt ::= */ - 495, /* (639) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 506, /* (640) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 507, /* (641) query_simple ::= query_specification */ - 507, /* (642) query_simple ::= union_query_expression */ - 511, /* (643) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 511, /* (644) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 512, /* (645) query_simple_or_subquery ::= query_simple */ - 512, /* (646) query_simple_or_subquery ::= subquery */ - 434, /* (647) query_or_subquery ::= query_expression */ - 434, /* (648) query_or_subquery ::= subquery */ - 508, /* (649) order_by_clause_opt ::= */ - 508, /* (650) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 509, /* (651) slimit_clause_opt ::= */ - 509, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 509, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 509, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 510, /* (655) limit_clause_opt ::= */ - 510, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER */ - 510, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 510, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 485, /* (659) subquery ::= NK_LP query_expression NK_RP */ - 485, /* (660) subquery ::= NK_LP subquery NK_RP */ - 372, /* (661) search_condition ::= common_expression */ - 513, /* (662) sort_specification_list ::= sort_specification */ - 513, /* (663) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 514, /* (664) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 515, /* (665) ordering_specification_opt ::= */ - 515, /* (666) ordering_specification_opt ::= ASC */ - 515, /* (667) ordering_specification_opt ::= DESC */ - 516, /* (668) null_ordering_opt ::= */ - 516, /* (669) null_ordering_opt ::= NULLS FIRST */ - 516, /* (670) null_ordering_opt ::= NULLS LAST */ + 355, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 355, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 356, /* (2) account_options ::= */ + 356, /* (3) account_options ::= account_options PPS literal */ + 356, /* (4) account_options ::= account_options TSERIES literal */ + 356, /* (5) account_options ::= account_options STORAGE literal */ + 356, /* (6) account_options ::= account_options STREAMS literal */ + 356, /* (7) account_options ::= account_options QTIME literal */ + 356, /* (8) account_options ::= account_options DBS literal */ + 356, /* (9) account_options ::= account_options USERS literal */ + 356, /* (10) account_options ::= account_options CONNS literal */ + 356, /* (11) account_options ::= account_options STATE literal */ + 357, /* (12) alter_account_options ::= alter_account_option */ + 357, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 359, /* (14) alter_account_option ::= PASS literal */ + 359, /* (15) alter_account_option ::= PPS literal */ + 359, /* (16) alter_account_option ::= TSERIES literal */ + 359, /* (17) alter_account_option ::= STORAGE literal */ + 359, /* (18) alter_account_option ::= STREAMS literal */ + 359, /* (19) alter_account_option ::= QTIME literal */ + 359, /* (20) alter_account_option ::= DBS literal */ + 359, /* (21) alter_account_option ::= USERS literal */ + 359, /* (22) alter_account_option ::= CONNS literal */ + 359, /* (23) alter_account_option ::= STATE literal */ + 360, /* (24) ip_range_list ::= NK_STRING */ + 360, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 361, /* (26) white_list ::= HOST ip_range_list */ + 362, /* (27) white_list_opt ::= */ + 362, /* (28) white_list_opt ::= white_list */ + 355, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 355, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 355, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 355, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 355, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 355, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 355, /* (35) cmd ::= DROP USER user_name */ + 364, /* (36) sysinfo_opt ::= */ + 364, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 355, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 355, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 365, /* (40) privileges ::= ALL */ + 365, /* (41) privileges ::= priv_type_list */ + 365, /* (42) privileges ::= SUBSCRIBE */ + 368, /* (43) priv_type_list ::= priv_type */ + 368, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 369, /* (45) priv_type ::= READ */ + 369, /* (46) priv_type ::= WRITE */ + 369, /* (47) priv_type ::= ALTER */ + 366, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 366, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 366, /* (50) priv_level ::= db_name NK_DOT table_name */ + 366, /* (51) priv_level ::= topic_name */ + 367, /* (52) with_opt ::= */ + 367, /* (53) with_opt ::= WITH search_condition */ + 355, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 355, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 355, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 355, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 355, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 355, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 355, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 355, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 355, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 355, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 355, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 374, /* (65) dnode_endpoint ::= NK_STRING */ + 374, /* (66) dnode_endpoint ::= NK_ID */ + 374, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 375, /* (68) force_opt ::= */ + 375, /* (69) force_opt ::= FORCE */ + 376, /* (70) unsafe_opt ::= UNSAFE */ + 355, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ + 355, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 355, /* (73) cmd ::= ALTER LOCAL NK_STRING */ + 355, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 355, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 355, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 355, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 355, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 355, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 355, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 355, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 355, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 355, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 355, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 355, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 355, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 355, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ + 355, /* (88) cmd ::= USE db_name */ + 355, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ + 355, /* (90) cmd ::= FLUSH DATABASE db_name */ + 355, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ + 355, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 377, /* (93) not_exists_opt ::= IF NOT EXISTS */ + 377, /* (94) not_exists_opt ::= */ + 379, /* (95) exists_opt ::= IF EXISTS */ + 379, /* (96) exists_opt ::= */ + 378, /* (97) db_options ::= */ + 378, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ + 378, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ + 378, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ + 378, /* (101) db_options ::= db_options COMP NK_INTEGER */ + 378, /* (102) db_options ::= db_options DURATION NK_INTEGER */ + 378, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ + 378, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ + 378, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ + 378, /* (106) db_options ::= db_options KEEP integer_list */ + 378, /* (107) db_options ::= db_options KEEP variable_list */ + 378, /* (108) db_options ::= db_options PAGES NK_INTEGER */ + 378, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ + 378, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 378, /* (111) db_options ::= db_options PRECISION NK_STRING */ + 378, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ + 378, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ + 378, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 378, /* (115) db_options ::= db_options RETENTIONS retention_list */ + 378, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 378, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 378, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 378, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 378, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 378, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 378, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 378, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 378, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 378, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 378, /* (126) db_options ::= db_options TABLE_PREFIX signed */ + 378, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ + 378, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 380, /* (129) alter_db_options ::= alter_db_option */ + 380, /* (130) alter_db_options ::= alter_db_options alter_db_option */ + 388, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ + 388, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ + 388, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ + 388, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 388, /* (135) alter_db_option ::= KEEP integer_list */ + 388, /* (136) alter_db_option ::= KEEP variable_list */ + 388, /* (137) alter_db_option ::= PAGES NK_INTEGER */ + 388, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ + 388, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 388, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 388, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ + 388, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 388, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 388, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 388, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 388, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 384, /* (147) integer_list ::= NK_INTEGER */ + 384, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 385, /* (149) variable_list ::= NK_VARIABLE */ + 385, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 386, /* (151) retention_list ::= retention */ + 386, /* (152) retention_list ::= retention_list NK_COMMA retention */ + 389, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 389, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 381, /* (155) speed_opt ::= */ + 381, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ + 382, /* (157) start_opt ::= */ + 382, /* (158) start_opt ::= START WITH NK_INTEGER */ + 382, /* (159) start_opt ::= START WITH NK_STRING */ + 382, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 383, /* (161) end_opt ::= */ + 383, /* (162) end_opt ::= END WITH NK_INTEGER */ + 383, /* (163) end_opt ::= END WITH NK_STRING */ + 383, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 355, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 355, /* (166) cmd ::= CREATE TABLE multi_create_clause */ + 355, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 355, /* (168) cmd ::= DROP TABLE multi_drop_clause */ + 355, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ + 355, /* (170) cmd ::= ALTER TABLE alter_table_clause */ + 355, /* (171) cmd ::= ALTER STABLE alter_table_clause */ + 397, /* (172) alter_table_clause ::= full_table_name alter_table_options */ + 397, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 397, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 397, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 397, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 397, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 397, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ + 397, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 397, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 397, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 394, /* (182) multi_create_clause ::= create_subtable_clause */ + 394, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 402, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 396, /* (185) multi_drop_clause ::= drop_table_clause */ + 396, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 405, /* (187) drop_table_clause ::= exists_opt full_table_name */ + 403, /* (188) specific_cols_opt ::= */ + 403, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 390, /* (190) full_table_name ::= table_name */ + 390, /* (191) full_table_name ::= db_name NK_DOT table_name */ + 391, /* (192) column_def_list ::= column_def */ + 391, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ + 407, /* (194) column_def ::= column_name type_name */ + 407, /* (195) column_def ::= column_name type_name PRIMARY KEY */ + 400, /* (196) type_name ::= BOOL */ + 400, /* (197) type_name ::= TINYINT */ + 400, /* (198) type_name ::= SMALLINT */ + 400, /* (199) type_name ::= INT */ + 400, /* (200) type_name ::= INTEGER */ + 400, /* (201) type_name ::= BIGINT */ + 400, /* (202) type_name ::= FLOAT */ + 400, /* (203) type_name ::= DOUBLE */ + 400, /* (204) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 400, /* (205) type_name ::= TIMESTAMP */ + 400, /* (206) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 400, /* (207) type_name ::= TINYINT UNSIGNED */ + 400, /* (208) type_name ::= SMALLINT UNSIGNED */ + 400, /* (209) type_name ::= INT UNSIGNED */ + 400, /* (210) type_name ::= BIGINT UNSIGNED */ + 400, /* (211) type_name ::= JSON */ + 400, /* (212) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 400, /* (213) type_name ::= MEDIUMBLOB */ + 400, /* (214) type_name ::= BLOB */ + 400, /* (215) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 400, /* (216) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 400, /* (217) type_name ::= DECIMAL */ + 400, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 400, /* (219) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 392, /* (220) tags_def_opt ::= */ + 392, /* (221) tags_def_opt ::= tags_def */ + 395, /* (222) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 393, /* (223) table_options ::= */ + 393, /* (224) table_options ::= table_options COMMENT NK_STRING */ + 393, /* (225) table_options ::= table_options MAX_DELAY duration_list */ + 393, /* (226) table_options ::= table_options WATERMARK duration_list */ + 393, /* (227) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 393, /* (228) table_options ::= table_options TTL NK_INTEGER */ + 393, /* (229) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 393, /* (230) table_options ::= table_options DELETE_MARK duration_list */ + 398, /* (231) alter_table_options ::= alter_table_option */ + 398, /* (232) alter_table_options ::= alter_table_options alter_table_option */ + 410, /* (233) alter_table_option ::= COMMENT NK_STRING */ + 410, /* (234) alter_table_option ::= TTL NK_INTEGER */ + 408, /* (235) duration_list ::= duration_literal */ + 408, /* (236) duration_list ::= duration_list NK_COMMA duration_literal */ + 409, /* (237) rollup_func_list ::= rollup_func_name */ + 409, /* (238) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 412, /* (239) rollup_func_name ::= function_name */ + 412, /* (240) rollup_func_name ::= FIRST */ + 412, /* (241) rollup_func_name ::= LAST */ + 406, /* (242) col_name_list ::= col_name */ + 406, /* (243) col_name_list ::= col_name_list NK_COMMA col_name */ + 414, /* (244) col_name ::= column_name */ + 355, /* (245) cmd ::= SHOW DNODES */ + 355, /* (246) cmd ::= SHOW USERS */ + 355, /* (247) cmd ::= SHOW USER PRIVILEGES */ + 355, /* (248) cmd ::= SHOW db_kind_opt DATABASES */ + 355, /* (249) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 355, /* (250) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 355, /* (251) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 355, /* (252) cmd ::= SHOW MNODES */ + 355, /* (253) cmd ::= SHOW QNODES */ + 355, /* (254) cmd ::= SHOW ARBGROUPS */ + 355, /* (255) cmd ::= SHOW FUNCTIONS */ + 355, /* (256) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 355, /* (257) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 355, /* (258) cmd ::= SHOW STREAMS */ + 355, /* (259) cmd ::= SHOW ACCOUNTS */ + 355, /* (260) cmd ::= SHOW APPS */ + 355, /* (261) cmd ::= SHOW CONNECTIONS */ + 355, /* (262) cmd ::= SHOW LICENCES */ + 355, /* (263) cmd ::= SHOW GRANTS */ + 355, /* (264) cmd ::= SHOW GRANTS FULL */ + 355, /* (265) cmd ::= SHOW GRANTS LOGS */ + 355, /* (266) cmd ::= SHOW CLUSTER MACHINES */ + 355, /* (267) cmd ::= SHOW CREATE DATABASE db_name */ + 355, /* (268) cmd ::= SHOW CREATE TABLE full_table_name */ + 355, /* (269) cmd ::= SHOW CREATE STABLE full_table_name */ + 355, /* (270) cmd ::= SHOW QUERIES */ + 355, /* (271) cmd ::= SHOW SCORES */ + 355, /* (272) cmd ::= SHOW TOPICS */ + 355, /* (273) cmd ::= SHOW VARIABLES */ + 355, /* (274) cmd ::= SHOW CLUSTER VARIABLES */ + 355, /* (275) cmd ::= SHOW LOCAL VARIABLES */ + 355, /* (276) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 355, /* (277) cmd ::= SHOW BNODES */ + 355, /* (278) cmd ::= SHOW SNODES */ + 355, /* (279) cmd ::= SHOW CLUSTER */ + 355, /* (280) cmd ::= SHOW TRANSACTIONS */ + 355, /* (281) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 355, /* (282) cmd ::= SHOW CONSUMERS */ + 355, /* (283) cmd ::= SHOW SUBSCRIPTIONS */ + 355, /* (284) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 355, /* (285) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 355, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 355, /* (287) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 355, /* (288) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 355, /* (289) cmd ::= SHOW VNODES */ + 355, /* (290) cmd ::= SHOW db_name_cond_opt ALIVE */ + 355, /* (291) cmd ::= SHOW CLUSTER ALIVE */ + 355, /* (292) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 355, /* (293) cmd ::= SHOW CREATE VIEW full_table_name */ + 355, /* (294) cmd ::= SHOW COMPACTS */ + 355, /* (295) cmd ::= SHOW COMPACT NK_INTEGER */ + 416, /* (296) table_kind_db_name_cond_opt ::= */ + 416, /* (297) table_kind_db_name_cond_opt ::= table_kind */ + 416, /* (298) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 416, /* (299) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 422, /* (300) table_kind ::= NORMAL */ + 422, /* (301) table_kind ::= CHILD */ + 418, /* (302) db_name_cond_opt ::= */ + 418, /* (303) db_name_cond_opt ::= db_name NK_DOT */ + 417, /* (304) like_pattern_opt ::= */ + 417, /* (305) like_pattern_opt ::= LIKE NK_STRING */ + 419, /* (306) table_name_cond ::= table_name */ + 420, /* (307) from_db_opt ::= */ + 420, /* (308) from_db_opt ::= FROM db_name */ + 421, /* (309) tag_list_opt ::= */ + 421, /* (310) tag_list_opt ::= tag_item */ + 421, /* (311) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 423, /* (312) tag_item ::= TBNAME */ + 423, /* (313) tag_item ::= QTAGS */ + 423, /* (314) tag_item ::= column_name */ + 423, /* (315) tag_item ::= column_name column_alias */ + 423, /* (316) tag_item ::= column_name AS column_alias */ + 415, /* (317) db_kind_opt ::= */ + 415, /* (318) db_kind_opt ::= USER */ + 415, /* (319) db_kind_opt ::= SYSTEM */ + 355, /* (320) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 355, /* (321) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 355, /* (322) cmd ::= DROP INDEX exists_opt full_index_name */ + 426, /* (323) full_index_name ::= index_name */ + 426, /* (324) full_index_name ::= db_name NK_DOT index_name */ + 425, /* (325) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 425, /* (326) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + 428, /* (327) func_list ::= func */ + 428, /* (328) func_list ::= func_list NK_COMMA func */ + 431, /* (329) func ::= sma_func_name NK_LP expression_list NK_RP */ + 432, /* (330) sma_func_name ::= function_name */ + 432, /* (331) sma_func_name ::= COUNT */ + 432, /* (332) sma_func_name ::= FIRST */ + 432, /* (333) sma_func_name ::= LAST */ + 432, /* (334) sma_func_name ::= LAST_ROW */ + 430, /* (335) sma_stream_opt ::= */ + 430, /* (336) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 430, /* (337) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 430, /* (338) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 434, /* (339) with_meta ::= AS */ + 434, /* (340) with_meta ::= WITH META AS */ + 434, /* (341) with_meta ::= ONLY META AS */ + 355, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 355, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 355, /* (344) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 355, /* (345) cmd ::= DROP TOPIC exists_opt topic_name */ + 355, /* (346) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 355, /* (347) cmd ::= DESC full_table_name */ + 355, /* (348) cmd ::= DESCRIBE full_table_name */ + 355, /* (349) cmd ::= RESET QUERY CACHE */ + 355, /* (350) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 355, /* (351) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 438, /* (352) analyze_opt ::= */ + 438, /* (353) analyze_opt ::= ANALYZE */ + 439, /* (354) explain_options ::= */ + 439, /* (355) explain_options ::= explain_options VERBOSE NK_BOOL */ + 439, /* (356) explain_options ::= explain_options RATIO NK_FLOAT */ + 355, /* (357) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 355, /* (358) cmd ::= DROP FUNCTION exists_opt function_name */ + 442, /* (359) agg_func_opt ::= */ + 442, /* (360) agg_func_opt ::= AGGREGATE */ + 443, /* (361) bufsize_opt ::= */ + 443, /* (362) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 444, /* (363) language_opt ::= */ + 444, /* (364) language_opt ::= LANGUAGE NK_STRING */ + 441, /* (365) or_replace_opt ::= */ + 441, /* (366) or_replace_opt ::= OR REPLACE */ + 355, /* (367) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 355, /* (368) cmd ::= DROP VIEW exists_opt full_view_name */ + 445, /* (369) full_view_name ::= view_name */ + 445, /* (370) full_view_name ::= db_name NK_DOT view_name */ + 355, /* (371) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 355, /* (372) cmd ::= DROP STREAM exists_opt stream_name */ + 355, /* (373) cmd ::= PAUSE STREAM exists_opt stream_name */ + 355, /* (374) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 449, /* (375) col_list_opt ::= */ + 449, /* (376) col_list_opt ::= NK_LP col_name_list NK_RP */ + 450, /* (377) tag_def_or_ref_opt ::= */ + 450, /* (378) tag_def_or_ref_opt ::= tags_def */ + 450, /* (379) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 448, /* (380) stream_options ::= */ + 448, /* (381) stream_options ::= stream_options TRIGGER AT_ONCE */ + 448, /* (382) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 448, /* (383) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 448, /* (384) stream_options ::= stream_options WATERMARK duration_literal */ + 448, /* (385) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 448, /* (386) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 448, /* (387) stream_options ::= stream_options DELETE_MARK duration_literal */ + 448, /* (388) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 451, /* (389) subtable_opt ::= */ + 451, /* (390) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 452, /* (391) ignore_opt ::= */ + 452, /* (392) ignore_opt ::= IGNORE UNTREATED */ + 355, /* (393) cmd ::= KILL CONNECTION NK_INTEGER */ + 355, /* (394) cmd ::= KILL QUERY NK_STRING */ + 355, /* (395) cmd ::= KILL TRANSACTION NK_INTEGER */ + 355, /* (396) cmd ::= KILL COMPACT NK_INTEGER */ + 355, /* (397) cmd ::= BALANCE VGROUP */ + 355, /* (398) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 355, /* (399) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 355, /* (400) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 355, /* (401) cmd ::= SPLIT VGROUP NK_INTEGER */ + 454, /* (402) on_vgroup_id ::= */ + 454, /* (403) on_vgroup_id ::= ON NK_INTEGER */ + 455, /* (404) dnode_list ::= DNODE NK_INTEGER */ + 455, /* (405) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 355, /* (406) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 355, /* (407) cmd ::= query_or_subquery */ + 355, /* (408) cmd ::= insert_query */ + 440, /* (409) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 440, /* (410) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 401, /* (411) tags_literal ::= NK_INTEGER */ + 401, /* (412) tags_literal ::= NK_PLUS NK_INTEGER */ + 401, /* (413) tags_literal ::= NK_MINUS NK_INTEGER */ + 401, /* (414) tags_literal ::= NK_FLOAT */ + 401, /* (415) tags_literal ::= NK_PLUS NK_FLOAT */ + 401, /* (416) tags_literal ::= NK_MINUS NK_FLOAT */ + 401, /* (417) tags_literal ::= NK_BIN */ + 401, /* (418) tags_literal ::= NK_PLUS NK_BIN */ + 401, /* (419) tags_literal ::= NK_MINUS NK_BIN */ + 401, /* (420) tags_literal ::= NK_HEX */ + 401, /* (421) tags_literal ::= NK_PLUS NK_HEX */ + 401, /* (422) tags_literal ::= NK_MINUS NK_HEX */ + 401, /* (423) tags_literal ::= NK_STRING */ + 401, /* (424) tags_literal ::= NK_BOOL */ + 401, /* (425) tags_literal ::= NULL */ + 401, /* (426) tags_literal ::= literal_func */ + 401, /* (427) tags_literal ::= literal_func NK_PLUS duration_literal */ + 401, /* (428) tags_literal ::= literal_func NK_MINUS duration_literal */ + 404, /* (429) tags_literal_list ::= tags_literal */ + 404, /* (430) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 358, /* (431) literal ::= NK_INTEGER */ + 358, /* (432) literal ::= NK_FLOAT */ + 358, /* (433) literal ::= NK_STRING */ + 358, /* (434) literal ::= NK_BOOL */ + 358, /* (435) literal ::= TIMESTAMP NK_STRING */ + 358, /* (436) literal ::= duration_literal */ + 358, /* (437) literal ::= NULL */ + 358, /* (438) literal ::= NK_QUESTION */ + 411, /* (439) duration_literal ::= NK_VARIABLE */ + 387, /* (440) signed ::= NK_INTEGER */ + 387, /* (441) signed ::= NK_PLUS NK_INTEGER */ + 387, /* (442) signed ::= NK_MINUS NK_INTEGER */ + 387, /* (443) signed ::= NK_FLOAT */ + 387, /* (444) signed ::= NK_PLUS NK_FLOAT */ + 387, /* (445) signed ::= NK_MINUS NK_FLOAT */ + 457, /* (446) signed_literal ::= signed */ + 457, /* (447) signed_literal ::= NK_STRING */ + 457, /* (448) signed_literal ::= NK_BOOL */ + 457, /* (449) signed_literal ::= TIMESTAMP NK_STRING */ + 457, /* (450) signed_literal ::= duration_literal */ + 457, /* (451) signed_literal ::= NULL */ + 457, /* (452) signed_literal ::= literal_func */ + 457, /* (453) signed_literal ::= NK_QUESTION */ + 458, /* (454) literal_list ::= signed_literal */ + 458, /* (455) literal_list ::= literal_list NK_COMMA signed_literal */ + 370, /* (456) db_name ::= NK_ID */ + 371, /* (457) table_name ::= NK_ID */ + 399, /* (458) column_name ::= NK_ID */ + 413, /* (459) function_name ::= NK_ID */ + 446, /* (460) view_name ::= NK_ID */ + 459, /* (461) table_alias ::= NK_ID */ + 424, /* (462) column_alias ::= NK_ID */ + 424, /* (463) column_alias ::= NK_ALIAS */ + 363, /* (464) user_name ::= NK_ID */ + 372, /* (465) topic_name ::= NK_ID */ + 447, /* (466) stream_name ::= NK_ID */ + 437, /* (467) cgroup_name ::= NK_ID */ + 427, /* (468) index_name ::= NK_ID */ + 460, /* (469) expr_or_subquery ::= expression */ + 453, /* (470) expression ::= literal */ + 453, /* (471) expression ::= pseudo_column */ + 453, /* (472) expression ::= column_reference */ + 453, /* (473) expression ::= function_expression */ + 453, /* (474) expression ::= case_when_expression */ + 453, /* (475) expression ::= NK_LP expression NK_RP */ + 453, /* (476) expression ::= NK_PLUS expr_or_subquery */ + 453, /* (477) expression ::= NK_MINUS expr_or_subquery */ + 453, /* (478) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 453, /* (479) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 453, /* (480) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 453, /* (481) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 453, /* (482) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 453, /* (483) expression ::= column_reference NK_ARROW NK_STRING */ + 453, /* (484) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 453, /* (485) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 433, /* (486) expression_list ::= expr_or_subquery */ + 433, /* (487) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 462, /* (488) column_reference ::= column_name */ + 462, /* (489) column_reference ::= table_name NK_DOT column_name */ + 462, /* (490) column_reference ::= NK_ALIAS */ + 462, /* (491) column_reference ::= table_name NK_DOT NK_ALIAS */ + 461, /* (492) pseudo_column ::= ROWTS */ + 461, /* (493) pseudo_column ::= TBNAME */ + 461, /* (494) pseudo_column ::= table_name NK_DOT TBNAME */ + 461, /* (495) pseudo_column ::= QSTART */ + 461, /* (496) pseudo_column ::= QEND */ + 461, /* (497) pseudo_column ::= QDURATION */ + 461, /* (498) pseudo_column ::= WSTART */ + 461, /* (499) pseudo_column ::= WEND */ + 461, /* (500) pseudo_column ::= WDURATION */ + 461, /* (501) pseudo_column ::= IROWTS */ + 461, /* (502) pseudo_column ::= ISFILLED */ + 461, /* (503) pseudo_column ::= QTAGS */ + 463, /* (504) function_expression ::= function_name NK_LP expression_list NK_RP */ + 463, /* (505) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 463, /* (506) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 463, /* (507) function_expression ::= literal_func */ + 456, /* (508) literal_func ::= noarg_func NK_LP NK_RP */ + 456, /* (509) literal_func ::= NOW */ + 456, /* (510) literal_func ::= TODAY */ + 467, /* (511) noarg_func ::= NOW */ + 467, /* (512) noarg_func ::= TODAY */ + 467, /* (513) noarg_func ::= TIMEZONE */ + 467, /* (514) noarg_func ::= DATABASE */ + 467, /* (515) noarg_func ::= CLIENT_VERSION */ + 467, /* (516) noarg_func ::= SERVER_VERSION */ + 467, /* (517) noarg_func ::= SERVER_STATUS */ + 467, /* (518) noarg_func ::= CURRENT_USER */ + 467, /* (519) noarg_func ::= USER */ + 465, /* (520) star_func ::= COUNT */ + 465, /* (521) star_func ::= FIRST */ + 465, /* (522) star_func ::= LAST */ + 465, /* (523) star_func ::= LAST_ROW */ + 466, /* (524) star_func_para_list ::= NK_STAR */ + 466, /* (525) star_func_para_list ::= other_para_list */ + 468, /* (526) other_para_list ::= star_func_para */ + 468, /* (527) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 469, /* (528) star_func_para ::= expr_or_subquery */ + 469, /* (529) star_func_para ::= table_name NK_DOT NK_STAR */ + 464, /* (530) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 464, /* (531) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 470, /* (532) when_then_list ::= when_then_expr */ + 470, /* (533) when_then_list ::= when_then_list when_then_expr */ + 473, /* (534) when_then_expr ::= WHEN common_expression THEN common_expression */ + 471, /* (535) case_when_else_opt ::= */ + 471, /* (536) case_when_else_opt ::= ELSE common_expression */ + 474, /* (537) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 474, /* (538) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 474, /* (539) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 474, /* (540) predicate ::= expr_or_subquery IS NULL */ + 474, /* (541) predicate ::= expr_or_subquery IS NOT NULL */ + 474, /* (542) predicate ::= expr_or_subquery in_op in_predicate_value */ + 475, /* (543) compare_op ::= NK_LT */ + 475, /* (544) compare_op ::= NK_GT */ + 475, /* (545) compare_op ::= NK_LE */ + 475, /* (546) compare_op ::= NK_GE */ + 475, /* (547) compare_op ::= NK_NE */ + 475, /* (548) compare_op ::= NK_EQ */ + 475, /* (549) compare_op ::= LIKE */ + 475, /* (550) compare_op ::= NOT LIKE */ + 475, /* (551) compare_op ::= MATCH */ + 475, /* (552) compare_op ::= NMATCH */ + 475, /* (553) compare_op ::= CONTAINS */ + 476, /* (554) in_op ::= IN */ + 476, /* (555) in_op ::= NOT IN */ + 477, /* (556) in_predicate_value ::= NK_LP literal_list NK_RP */ + 478, /* (557) boolean_value_expression ::= boolean_primary */ + 478, /* (558) boolean_value_expression ::= NOT boolean_primary */ + 478, /* (559) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 478, /* (560) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 479, /* (561) boolean_primary ::= predicate */ + 479, /* (562) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 472, /* (563) common_expression ::= expr_or_subquery */ + 472, /* (564) common_expression ::= boolean_value_expression */ + 480, /* (565) from_clause_opt ::= */ + 480, /* (566) from_clause_opt ::= FROM table_reference_list */ + 481, /* (567) table_reference_list ::= table_reference */ + 481, /* (568) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 482, /* (569) table_reference ::= table_primary */ + 482, /* (570) table_reference ::= joined_table */ + 483, /* (571) table_primary ::= table_name alias_opt */ + 483, /* (572) table_primary ::= db_name NK_DOT table_name alias_opt */ + 483, /* (573) table_primary ::= subquery alias_opt */ + 483, /* (574) table_primary ::= parenthesized_joined_table */ + 485, /* (575) alias_opt ::= */ + 485, /* (576) alias_opt ::= table_alias */ + 485, /* (577) alias_opt ::= AS table_alias */ + 487, /* (578) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 487, /* (579) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 484, /* (580) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 488, /* (581) join_type ::= */ + 488, /* (582) join_type ::= INNER */ + 489, /* (583) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 490, /* (584) hint_list ::= */ + 490, /* (585) hint_list ::= NK_HINT */ + 492, /* (586) tag_mode_opt ::= */ + 492, /* (587) tag_mode_opt ::= TAGS */ + 491, /* (588) set_quantifier_opt ::= */ + 491, /* (589) set_quantifier_opt ::= DISTINCT */ + 491, /* (590) set_quantifier_opt ::= ALL */ + 493, /* (591) select_list ::= select_item */ + 493, /* (592) select_list ::= select_list NK_COMMA select_item */ + 501, /* (593) select_item ::= NK_STAR */ + 501, /* (594) select_item ::= common_expression */ + 501, /* (595) select_item ::= common_expression column_alias */ + 501, /* (596) select_item ::= common_expression AS column_alias */ + 501, /* (597) select_item ::= table_name NK_DOT NK_STAR */ + 436, /* (598) where_clause_opt ::= */ + 436, /* (599) where_clause_opt ::= WHERE search_condition */ + 494, /* (600) partition_by_clause_opt ::= */ + 494, /* (601) partition_by_clause_opt ::= PARTITION BY partition_list */ + 502, /* (602) partition_list ::= partition_item */ + 502, /* (603) partition_list ::= partition_list NK_COMMA partition_item */ + 503, /* (604) partition_item ::= expr_or_subquery */ + 503, /* (605) partition_item ::= expr_or_subquery column_alias */ + 503, /* (606) partition_item ::= expr_or_subquery AS column_alias */ + 498, /* (607) twindow_clause_opt ::= */ + 498, /* (608) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 498, /* (609) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 498, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 498, /* (611) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 498, /* (612) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 498, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 498, /* (614) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 429, /* (615) sliding_opt ::= */ + 429, /* (616) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 504, /* (617) interval_sliding_duration_literal ::= NK_VARIABLE */ + 504, /* (618) interval_sliding_duration_literal ::= NK_STRING */ + 504, /* (619) interval_sliding_duration_literal ::= NK_INTEGER */ + 497, /* (620) fill_opt ::= */ + 497, /* (621) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 497, /* (622) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 497, /* (623) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 505, /* (624) fill_mode ::= NONE */ + 505, /* (625) fill_mode ::= PREV */ + 505, /* (626) fill_mode ::= NULL */ + 505, /* (627) fill_mode ::= NULL_F */ + 505, /* (628) fill_mode ::= LINEAR */ + 505, /* (629) fill_mode ::= NEXT */ + 499, /* (630) group_by_clause_opt ::= */ + 499, /* (631) group_by_clause_opt ::= GROUP BY group_by_list */ + 506, /* (632) group_by_list ::= expr_or_subquery */ + 506, /* (633) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 500, /* (634) having_clause_opt ::= */ + 500, /* (635) having_clause_opt ::= HAVING search_condition */ + 495, /* (636) range_opt ::= */ + 495, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 495, /* (638) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 496, /* (639) every_opt ::= */ + 496, /* (640) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 507, /* (641) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 508, /* (642) query_simple ::= query_specification */ + 508, /* (643) query_simple ::= union_query_expression */ + 512, /* (644) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 512, /* (645) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 513, /* (646) query_simple_or_subquery ::= query_simple */ + 513, /* (647) query_simple_or_subquery ::= subquery */ + 435, /* (648) query_or_subquery ::= query_expression */ + 435, /* (649) query_or_subquery ::= subquery */ + 509, /* (650) order_by_clause_opt ::= */ + 509, /* (651) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 510, /* (652) slimit_clause_opt ::= */ + 510, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 510, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 510, /* (655) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 511, /* (656) limit_clause_opt ::= */ + 511, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER */ + 511, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 511, /* (659) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 486, /* (660) subquery ::= NK_LP query_expression NK_RP */ + 486, /* (661) subquery ::= NK_LP subquery NK_RP */ + 373, /* (662) search_condition ::= common_expression */ + 514, /* (663) sort_specification_list ::= sort_specification */ + 514, /* (664) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 515, /* (665) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 516, /* (666) ordering_specification_opt ::= */ + 516, /* (667) ordering_specification_opt ::= ASC */ + 516, /* (668) ordering_specification_opt ::= DESC */ + 517, /* (669) null_ordering_opt ::= */ + 517, /* (670) null_ordering_opt ::= NULLS FIRST */ + 517, /* (671) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4308,423 +4346,424 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (251) cmd ::= SHOW db_name_cond_opt VGROUPS */ -2, /* (252) cmd ::= SHOW MNODES */ -2, /* (253) cmd ::= SHOW QNODES */ - -2, /* (254) cmd ::= SHOW FUNCTIONS */ - -5, /* (255) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (256) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (257) cmd ::= SHOW STREAMS */ - -2, /* (258) cmd ::= SHOW ACCOUNTS */ - -2, /* (259) cmd ::= SHOW APPS */ - -2, /* (260) cmd ::= SHOW CONNECTIONS */ - -2, /* (261) cmd ::= SHOW LICENCES */ - -2, /* (262) cmd ::= SHOW GRANTS */ - -3, /* (263) cmd ::= SHOW GRANTS FULL */ - -3, /* (264) cmd ::= SHOW GRANTS LOGS */ - -3, /* (265) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (266) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (267) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (268) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (269) cmd ::= SHOW QUERIES */ - -2, /* (270) cmd ::= SHOW SCORES */ - -2, /* (271) cmd ::= SHOW TOPICS */ - -2, /* (272) cmd ::= SHOW VARIABLES */ - -3, /* (273) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (274) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (275) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (276) cmd ::= SHOW BNODES */ - -2, /* (277) cmd ::= SHOW SNODES */ - -2, /* (278) cmd ::= SHOW CLUSTER */ - -2, /* (279) cmd ::= SHOW TRANSACTIONS */ - -4, /* (280) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (281) cmd ::= SHOW CONSUMERS */ - -2, /* (282) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (283) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (284) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (287) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (288) cmd ::= SHOW VNODES */ - -3, /* (289) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (290) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (291) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (292) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (293) cmd ::= SHOW COMPACTS */ - -3, /* (294) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (295) table_kind_db_name_cond_opt ::= */ - -1, /* (296) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (297) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (298) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (299) table_kind ::= NORMAL */ - -1, /* (300) table_kind ::= CHILD */ - 0, /* (301) db_name_cond_opt ::= */ - -2, /* (302) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (303) like_pattern_opt ::= */ - -2, /* (304) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (305) table_name_cond ::= table_name */ - 0, /* (306) from_db_opt ::= */ - -2, /* (307) from_db_opt ::= FROM db_name */ - 0, /* (308) tag_list_opt ::= */ - -1, /* (309) tag_list_opt ::= tag_item */ - -3, /* (310) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (311) tag_item ::= TBNAME */ - -1, /* (312) tag_item ::= QTAGS */ - -1, /* (313) tag_item ::= column_name */ - -2, /* (314) tag_item ::= column_name column_alias */ - -3, /* (315) tag_item ::= column_name AS column_alias */ - 0, /* (316) db_kind_opt ::= */ - -1, /* (317) db_kind_opt ::= USER */ - -1, /* (318) db_kind_opt ::= SYSTEM */ - -8, /* (319) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (320) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (321) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (322) full_index_name ::= index_name */ - -3, /* (323) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (325) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (326) func_list ::= func */ - -3, /* (327) func_list ::= func_list NK_COMMA func */ - -4, /* (328) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (329) sma_func_name ::= function_name */ - -1, /* (330) sma_func_name ::= COUNT */ - -1, /* (331) sma_func_name ::= FIRST */ - -1, /* (332) sma_func_name ::= LAST */ - -1, /* (333) sma_func_name ::= LAST_ROW */ - 0, /* (334) sma_stream_opt ::= */ - -3, /* (335) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (336) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (337) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (338) with_meta ::= AS */ - -3, /* (339) with_meta ::= WITH META AS */ - -3, /* (340) with_meta ::= ONLY META AS */ - -6, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (344) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (345) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (346) cmd ::= DESC full_table_name */ - -2, /* (347) cmd ::= DESCRIBE full_table_name */ - -3, /* (348) cmd ::= RESET QUERY CACHE */ - -4, /* (349) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (350) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (351) analyze_opt ::= */ - -1, /* (352) analyze_opt ::= ANALYZE */ - 0, /* (353) explain_options ::= */ - -3, /* (354) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (355) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (356) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (357) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (358) agg_func_opt ::= */ - -1, /* (359) agg_func_opt ::= AGGREGATE */ - 0, /* (360) bufsize_opt ::= */ - -2, /* (361) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (362) language_opt ::= */ - -2, /* (363) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (364) or_replace_opt ::= */ - -2, /* (365) or_replace_opt ::= OR REPLACE */ - -6, /* (366) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (367) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (368) full_view_name ::= view_name */ - -3, /* (369) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (370) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (371) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (372) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (373) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (374) col_list_opt ::= */ - -3, /* (375) col_list_opt ::= NK_LP col_name_list NK_RP */ - 0, /* (376) tag_def_or_ref_opt ::= */ - -1, /* (377) tag_def_or_ref_opt ::= tags_def */ - -4, /* (378) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 0, /* (379) stream_options ::= */ - -3, /* (380) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (381) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (382) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (383) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (384) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (385) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (386) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (387) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (388) subtable_opt ::= */ - -4, /* (389) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (390) ignore_opt ::= */ - -2, /* (391) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (392) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (393) cmd ::= KILL QUERY NK_STRING */ - -3, /* (394) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (395) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (396) cmd ::= BALANCE VGROUP */ - -4, /* (397) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -4, /* (398) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (399) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (400) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (401) on_vgroup_id ::= */ - -2, /* (402) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (403) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (404) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (405) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (406) cmd ::= query_or_subquery */ - -1, /* (407) cmd ::= insert_query */ - -7, /* (408) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (409) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (410) tags_literal ::= NK_INTEGER */ - -2, /* (411) tags_literal ::= NK_PLUS NK_INTEGER */ - -2, /* (412) tags_literal ::= NK_MINUS NK_INTEGER */ - -1, /* (413) tags_literal ::= NK_FLOAT */ - -2, /* (414) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (415) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (416) tags_literal ::= NK_BIN */ - -2, /* (417) tags_literal ::= NK_PLUS NK_BIN */ - -2, /* (418) tags_literal ::= NK_MINUS NK_BIN */ - -1, /* (419) tags_literal ::= NK_HEX */ - -2, /* (420) tags_literal ::= NK_PLUS NK_HEX */ - -2, /* (421) tags_literal ::= NK_MINUS NK_HEX */ - -1, /* (422) tags_literal ::= NK_STRING */ - -1, /* (423) tags_literal ::= NK_BOOL */ - -1, /* (424) tags_literal ::= NULL */ - -1, /* (425) tags_literal ::= literal_func */ - -3, /* (426) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (427) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (428) tags_literal_list ::= tags_literal */ - -3, /* (429) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (430) literal ::= NK_INTEGER */ - -1, /* (431) literal ::= NK_FLOAT */ - -1, /* (432) literal ::= NK_STRING */ - -1, /* (433) literal ::= NK_BOOL */ - -2, /* (434) literal ::= TIMESTAMP NK_STRING */ - -1, /* (435) literal ::= duration_literal */ - -1, /* (436) literal ::= NULL */ - -1, /* (437) literal ::= NK_QUESTION */ - -1, /* (438) duration_literal ::= NK_VARIABLE */ - -1, /* (439) signed ::= NK_INTEGER */ - -2, /* (440) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (441) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (442) signed ::= NK_FLOAT */ - -2, /* (443) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (444) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (445) signed_literal ::= signed */ - -1, /* (446) signed_literal ::= NK_STRING */ - -1, /* (447) signed_literal ::= NK_BOOL */ - -2, /* (448) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (449) signed_literal ::= duration_literal */ - -1, /* (450) signed_literal ::= NULL */ - -1, /* (451) signed_literal ::= literal_func */ - -1, /* (452) signed_literal ::= NK_QUESTION */ - -1, /* (453) literal_list ::= signed_literal */ - -3, /* (454) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (455) db_name ::= NK_ID */ - -1, /* (456) table_name ::= NK_ID */ - -1, /* (457) column_name ::= NK_ID */ - -1, /* (458) function_name ::= NK_ID */ - -1, /* (459) view_name ::= NK_ID */ - -1, /* (460) table_alias ::= NK_ID */ - -1, /* (461) column_alias ::= NK_ID */ - -1, /* (462) column_alias ::= NK_ALIAS */ - -1, /* (463) user_name ::= NK_ID */ - -1, /* (464) topic_name ::= NK_ID */ - -1, /* (465) stream_name ::= NK_ID */ - -1, /* (466) cgroup_name ::= NK_ID */ - -1, /* (467) index_name ::= NK_ID */ - -1, /* (468) expr_or_subquery ::= expression */ - -1, /* (469) expression ::= literal */ - -1, /* (470) expression ::= pseudo_column */ - -1, /* (471) expression ::= column_reference */ - -1, /* (472) expression ::= function_expression */ - -1, /* (473) expression ::= case_when_expression */ - -3, /* (474) expression ::= NK_LP expression NK_RP */ - -2, /* (475) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (476) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (477) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (478) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (479) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (480) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (481) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (482) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (483) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (484) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (485) expression_list ::= expr_or_subquery */ - -3, /* (486) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (487) column_reference ::= column_name */ - -3, /* (488) column_reference ::= table_name NK_DOT column_name */ - -1, /* (489) column_reference ::= NK_ALIAS */ - -3, /* (490) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (491) pseudo_column ::= ROWTS */ - -1, /* (492) pseudo_column ::= TBNAME */ - -3, /* (493) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (494) pseudo_column ::= QSTART */ - -1, /* (495) pseudo_column ::= QEND */ - -1, /* (496) pseudo_column ::= QDURATION */ - -1, /* (497) pseudo_column ::= WSTART */ - -1, /* (498) pseudo_column ::= WEND */ - -1, /* (499) pseudo_column ::= WDURATION */ - -1, /* (500) pseudo_column ::= IROWTS */ - -1, /* (501) pseudo_column ::= ISFILLED */ - -1, /* (502) pseudo_column ::= QTAGS */ - -4, /* (503) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (504) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (505) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (506) function_expression ::= literal_func */ - -3, /* (507) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (508) literal_func ::= NOW */ - -1, /* (509) literal_func ::= TODAY */ - -1, /* (510) noarg_func ::= NOW */ - -1, /* (511) noarg_func ::= TODAY */ - -1, /* (512) noarg_func ::= TIMEZONE */ - -1, /* (513) noarg_func ::= DATABASE */ - -1, /* (514) noarg_func ::= CLIENT_VERSION */ - -1, /* (515) noarg_func ::= SERVER_VERSION */ - -1, /* (516) noarg_func ::= SERVER_STATUS */ - -1, /* (517) noarg_func ::= CURRENT_USER */ - -1, /* (518) noarg_func ::= USER */ - -1, /* (519) star_func ::= COUNT */ - -1, /* (520) star_func ::= FIRST */ - -1, /* (521) star_func ::= LAST */ - -1, /* (522) star_func ::= LAST_ROW */ - -1, /* (523) star_func_para_list ::= NK_STAR */ - -1, /* (524) star_func_para_list ::= other_para_list */ - -1, /* (525) other_para_list ::= star_func_para */ - -3, /* (526) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (527) star_func_para ::= expr_or_subquery */ - -3, /* (528) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (529) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (530) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (531) when_then_list ::= when_then_expr */ - -2, /* (532) when_then_list ::= when_then_list when_then_expr */ - -4, /* (533) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (534) case_when_else_opt ::= */ - -2, /* (535) case_when_else_opt ::= ELSE common_expression */ - -3, /* (536) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (537) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (538) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (539) predicate ::= expr_or_subquery IS NULL */ - -4, /* (540) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (541) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (542) compare_op ::= NK_LT */ - -1, /* (543) compare_op ::= NK_GT */ - -1, /* (544) compare_op ::= NK_LE */ - -1, /* (545) compare_op ::= NK_GE */ - -1, /* (546) compare_op ::= NK_NE */ - -1, /* (547) compare_op ::= NK_EQ */ - -1, /* (548) compare_op ::= LIKE */ - -2, /* (549) compare_op ::= NOT LIKE */ - -1, /* (550) compare_op ::= MATCH */ - -1, /* (551) compare_op ::= NMATCH */ - -1, /* (552) compare_op ::= CONTAINS */ - -1, /* (553) in_op ::= IN */ - -2, /* (554) in_op ::= NOT IN */ - -3, /* (555) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (556) boolean_value_expression ::= boolean_primary */ - -2, /* (557) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (558) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (559) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (560) boolean_primary ::= predicate */ - -3, /* (561) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (562) common_expression ::= expr_or_subquery */ - -1, /* (563) common_expression ::= boolean_value_expression */ - 0, /* (564) from_clause_opt ::= */ - -2, /* (565) from_clause_opt ::= FROM table_reference_list */ - -1, /* (566) table_reference_list ::= table_reference */ - -3, /* (567) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (568) table_reference ::= table_primary */ - -1, /* (569) table_reference ::= joined_table */ - -2, /* (570) table_primary ::= table_name alias_opt */ - -4, /* (571) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (572) table_primary ::= subquery alias_opt */ - -1, /* (573) table_primary ::= parenthesized_joined_table */ - 0, /* (574) alias_opt ::= */ - -1, /* (575) alias_opt ::= table_alias */ - -2, /* (576) alias_opt ::= AS table_alias */ - -3, /* (577) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (578) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -6, /* (579) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (580) join_type ::= */ - -1, /* (581) join_type ::= INNER */ - -14, /* (582) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (583) hint_list ::= */ - -1, /* (584) hint_list ::= NK_HINT */ - 0, /* (585) tag_mode_opt ::= */ - -1, /* (586) tag_mode_opt ::= TAGS */ - 0, /* (587) set_quantifier_opt ::= */ - -1, /* (588) set_quantifier_opt ::= DISTINCT */ - -1, /* (589) set_quantifier_opt ::= ALL */ - -1, /* (590) select_list ::= select_item */ - -3, /* (591) select_list ::= select_list NK_COMMA select_item */ - -1, /* (592) select_item ::= NK_STAR */ - -1, /* (593) select_item ::= common_expression */ - -2, /* (594) select_item ::= common_expression column_alias */ - -3, /* (595) select_item ::= common_expression AS column_alias */ - -3, /* (596) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (597) where_clause_opt ::= */ - -2, /* (598) where_clause_opt ::= WHERE search_condition */ - 0, /* (599) partition_by_clause_opt ::= */ - -3, /* (600) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (601) partition_list ::= partition_item */ - -3, /* (602) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (603) partition_item ::= expr_or_subquery */ - -2, /* (604) partition_item ::= expr_or_subquery column_alias */ - -3, /* (605) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (606) twindow_clause_opt ::= */ - -6, /* (607) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (608) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (611) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (614) sliding_opt ::= */ - -4, /* (615) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (616) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (617) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (618) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (619) fill_opt ::= */ - -4, /* (620) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (621) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (622) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (623) fill_mode ::= NONE */ - -1, /* (624) fill_mode ::= PREV */ - -1, /* (625) fill_mode ::= NULL */ - -1, /* (626) fill_mode ::= NULL_F */ - -1, /* (627) fill_mode ::= LINEAR */ - -1, /* (628) fill_mode ::= NEXT */ - 0, /* (629) group_by_clause_opt ::= */ - -3, /* (630) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (631) group_by_list ::= expr_or_subquery */ - -3, /* (632) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (633) having_clause_opt ::= */ - -2, /* (634) having_clause_opt ::= HAVING search_condition */ - 0, /* (635) range_opt ::= */ - -6, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (638) every_opt ::= */ - -4, /* (639) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (640) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (641) query_simple ::= query_specification */ - -1, /* (642) query_simple ::= union_query_expression */ - -4, /* (643) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (644) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (645) query_simple_or_subquery ::= query_simple */ - -1, /* (646) query_simple_or_subquery ::= subquery */ - -1, /* (647) query_or_subquery ::= query_expression */ - -1, /* (648) query_or_subquery ::= subquery */ - 0, /* (649) order_by_clause_opt ::= */ - -3, /* (650) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (651) slimit_clause_opt ::= */ - -2, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (655) limit_clause_opt ::= */ - -2, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (659) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (660) subquery ::= NK_LP subquery NK_RP */ - -1, /* (661) search_condition ::= common_expression */ - -1, /* (662) sort_specification_list ::= sort_specification */ - -3, /* (663) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (664) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (665) ordering_specification_opt ::= */ - -1, /* (666) ordering_specification_opt ::= ASC */ - -1, /* (667) ordering_specification_opt ::= DESC */ - 0, /* (668) null_ordering_opt ::= */ - -2, /* (669) null_ordering_opt ::= NULLS FIRST */ - -2, /* (670) null_ordering_opt ::= NULLS LAST */ + -2, /* (254) cmd ::= SHOW ARBGROUPS */ + -2, /* (255) cmd ::= SHOW FUNCTIONS */ + -5, /* (256) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (257) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (258) cmd ::= SHOW STREAMS */ + -2, /* (259) cmd ::= SHOW ACCOUNTS */ + -2, /* (260) cmd ::= SHOW APPS */ + -2, /* (261) cmd ::= SHOW CONNECTIONS */ + -2, /* (262) cmd ::= SHOW LICENCES */ + -2, /* (263) cmd ::= SHOW GRANTS */ + -3, /* (264) cmd ::= SHOW GRANTS FULL */ + -3, /* (265) cmd ::= SHOW GRANTS LOGS */ + -3, /* (266) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (267) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (268) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (269) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (270) cmd ::= SHOW QUERIES */ + -2, /* (271) cmd ::= SHOW SCORES */ + -2, /* (272) cmd ::= SHOW TOPICS */ + -2, /* (273) cmd ::= SHOW VARIABLES */ + -3, /* (274) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (275) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (276) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (277) cmd ::= SHOW BNODES */ + -2, /* (278) cmd ::= SHOW SNODES */ + -2, /* (279) cmd ::= SHOW CLUSTER */ + -2, /* (280) cmd ::= SHOW TRANSACTIONS */ + -4, /* (281) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (282) cmd ::= SHOW CONSUMERS */ + -2, /* (283) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (284) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (285) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (287) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (288) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (289) cmd ::= SHOW VNODES */ + -3, /* (290) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (291) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (292) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (293) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (294) cmd ::= SHOW COMPACTS */ + -3, /* (295) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (296) table_kind_db_name_cond_opt ::= */ + -1, /* (297) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (298) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (299) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (300) table_kind ::= NORMAL */ + -1, /* (301) table_kind ::= CHILD */ + 0, /* (302) db_name_cond_opt ::= */ + -2, /* (303) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (304) like_pattern_opt ::= */ + -2, /* (305) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (306) table_name_cond ::= table_name */ + 0, /* (307) from_db_opt ::= */ + -2, /* (308) from_db_opt ::= FROM db_name */ + 0, /* (309) tag_list_opt ::= */ + -1, /* (310) tag_list_opt ::= tag_item */ + -3, /* (311) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (312) tag_item ::= TBNAME */ + -1, /* (313) tag_item ::= QTAGS */ + -1, /* (314) tag_item ::= column_name */ + -2, /* (315) tag_item ::= column_name column_alias */ + -3, /* (316) tag_item ::= column_name AS column_alias */ + 0, /* (317) db_kind_opt ::= */ + -1, /* (318) db_kind_opt ::= USER */ + -1, /* (319) db_kind_opt ::= SYSTEM */ + -8, /* (320) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (321) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (322) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (323) full_index_name ::= index_name */ + -3, /* (324) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (325) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (326) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + -1, /* (327) func_list ::= func */ + -3, /* (328) func_list ::= func_list NK_COMMA func */ + -4, /* (329) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (330) sma_func_name ::= function_name */ + -1, /* (331) sma_func_name ::= COUNT */ + -1, /* (332) sma_func_name ::= FIRST */ + -1, /* (333) sma_func_name ::= LAST */ + -1, /* (334) sma_func_name ::= LAST_ROW */ + 0, /* (335) sma_stream_opt ::= */ + -3, /* (336) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (337) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (338) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (339) with_meta ::= AS */ + -3, /* (340) with_meta ::= WITH META AS */ + -3, /* (341) with_meta ::= ONLY META AS */ + -6, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (344) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (345) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (346) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (347) cmd ::= DESC full_table_name */ + -2, /* (348) cmd ::= DESCRIBE full_table_name */ + -3, /* (349) cmd ::= RESET QUERY CACHE */ + -4, /* (350) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (351) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (352) analyze_opt ::= */ + -1, /* (353) analyze_opt ::= ANALYZE */ + 0, /* (354) explain_options ::= */ + -3, /* (355) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (356) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (357) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (358) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (359) agg_func_opt ::= */ + -1, /* (360) agg_func_opt ::= AGGREGATE */ + 0, /* (361) bufsize_opt ::= */ + -2, /* (362) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (363) language_opt ::= */ + -2, /* (364) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (365) or_replace_opt ::= */ + -2, /* (366) or_replace_opt ::= OR REPLACE */ + -6, /* (367) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (368) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (369) full_view_name ::= view_name */ + -3, /* (370) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (371) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (372) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (373) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (374) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (375) col_list_opt ::= */ + -3, /* (376) col_list_opt ::= NK_LP col_name_list NK_RP */ + 0, /* (377) tag_def_or_ref_opt ::= */ + -1, /* (378) tag_def_or_ref_opt ::= tags_def */ + -4, /* (379) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 0, /* (380) stream_options ::= */ + -3, /* (381) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (382) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (383) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (384) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (385) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (386) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (387) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (388) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (389) subtable_opt ::= */ + -4, /* (390) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (391) ignore_opt ::= */ + -2, /* (392) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (393) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (394) cmd ::= KILL QUERY NK_STRING */ + -3, /* (395) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (396) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (397) cmd ::= BALANCE VGROUP */ + -4, /* (398) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -4, /* (399) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (400) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (401) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (402) on_vgroup_id ::= */ + -2, /* (403) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (404) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (405) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (406) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (407) cmd ::= query_or_subquery */ + -1, /* (408) cmd ::= insert_query */ + -7, /* (409) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (410) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (411) tags_literal ::= NK_INTEGER */ + -2, /* (412) tags_literal ::= NK_PLUS NK_INTEGER */ + -2, /* (413) tags_literal ::= NK_MINUS NK_INTEGER */ + -1, /* (414) tags_literal ::= NK_FLOAT */ + -2, /* (415) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (416) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (417) tags_literal ::= NK_BIN */ + -2, /* (418) tags_literal ::= NK_PLUS NK_BIN */ + -2, /* (419) tags_literal ::= NK_MINUS NK_BIN */ + -1, /* (420) tags_literal ::= NK_HEX */ + -2, /* (421) tags_literal ::= NK_PLUS NK_HEX */ + -2, /* (422) tags_literal ::= NK_MINUS NK_HEX */ + -1, /* (423) tags_literal ::= NK_STRING */ + -1, /* (424) tags_literal ::= NK_BOOL */ + -1, /* (425) tags_literal ::= NULL */ + -1, /* (426) tags_literal ::= literal_func */ + -3, /* (427) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (428) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (429) tags_literal_list ::= tags_literal */ + -3, /* (430) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (431) literal ::= NK_INTEGER */ + -1, /* (432) literal ::= NK_FLOAT */ + -1, /* (433) literal ::= NK_STRING */ + -1, /* (434) literal ::= NK_BOOL */ + -2, /* (435) literal ::= TIMESTAMP NK_STRING */ + -1, /* (436) literal ::= duration_literal */ + -1, /* (437) literal ::= NULL */ + -1, /* (438) literal ::= NK_QUESTION */ + -1, /* (439) duration_literal ::= NK_VARIABLE */ + -1, /* (440) signed ::= NK_INTEGER */ + -2, /* (441) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (442) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (443) signed ::= NK_FLOAT */ + -2, /* (444) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (445) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (446) signed_literal ::= signed */ + -1, /* (447) signed_literal ::= NK_STRING */ + -1, /* (448) signed_literal ::= NK_BOOL */ + -2, /* (449) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (450) signed_literal ::= duration_literal */ + -1, /* (451) signed_literal ::= NULL */ + -1, /* (452) signed_literal ::= literal_func */ + -1, /* (453) signed_literal ::= NK_QUESTION */ + -1, /* (454) literal_list ::= signed_literal */ + -3, /* (455) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (456) db_name ::= NK_ID */ + -1, /* (457) table_name ::= NK_ID */ + -1, /* (458) column_name ::= NK_ID */ + -1, /* (459) function_name ::= NK_ID */ + -1, /* (460) view_name ::= NK_ID */ + -1, /* (461) table_alias ::= NK_ID */ + -1, /* (462) column_alias ::= NK_ID */ + -1, /* (463) column_alias ::= NK_ALIAS */ + -1, /* (464) user_name ::= NK_ID */ + -1, /* (465) topic_name ::= NK_ID */ + -1, /* (466) stream_name ::= NK_ID */ + -1, /* (467) cgroup_name ::= NK_ID */ + -1, /* (468) index_name ::= NK_ID */ + -1, /* (469) expr_or_subquery ::= expression */ + -1, /* (470) expression ::= literal */ + -1, /* (471) expression ::= pseudo_column */ + -1, /* (472) expression ::= column_reference */ + -1, /* (473) expression ::= function_expression */ + -1, /* (474) expression ::= case_when_expression */ + -3, /* (475) expression ::= NK_LP expression NK_RP */ + -2, /* (476) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (477) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (478) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (479) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (480) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (481) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (482) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (483) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (484) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (485) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (486) expression_list ::= expr_or_subquery */ + -3, /* (487) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (488) column_reference ::= column_name */ + -3, /* (489) column_reference ::= table_name NK_DOT column_name */ + -1, /* (490) column_reference ::= NK_ALIAS */ + -3, /* (491) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (492) pseudo_column ::= ROWTS */ + -1, /* (493) pseudo_column ::= TBNAME */ + -3, /* (494) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (495) pseudo_column ::= QSTART */ + -1, /* (496) pseudo_column ::= QEND */ + -1, /* (497) pseudo_column ::= QDURATION */ + -1, /* (498) pseudo_column ::= WSTART */ + -1, /* (499) pseudo_column ::= WEND */ + -1, /* (500) pseudo_column ::= WDURATION */ + -1, /* (501) pseudo_column ::= IROWTS */ + -1, /* (502) pseudo_column ::= ISFILLED */ + -1, /* (503) pseudo_column ::= QTAGS */ + -4, /* (504) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (505) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (506) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (507) function_expression ::= literal_func */ + -3, /* (508) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (509) literal_func ::= NOW */ + -1, /* (510) literal_func ::= TODAY */ + -1, /* (511) noarg_func ::= NOW */ + -1, /* (512) noarg_func ::= TODAY */ + -1, /* (513) noarg_func ::= TIMEZONE */ + -1, /* (514) noarg_func ::= DATABASE */ + -1, /* (515) noarg_func ::= CLIENT_VERSION */ + -1, /* (516) noarg_func ::= SERVER_VERSION */ + -1, /* (517) noarg_func ::= SERVER_STATUS */ + -1, /* (518) noarg_func ::= CURRENT_USER */ + -1, /* (519) noarg_func ::= USER */ + -1, /* (520) star_func ::= COUNT */ + -1, /* (521) star_func ::= FIRST */ + -1, /* (522) star_func ::= LAST */ + -1, /* (523) star_func ::= LAST_ROW */ + -1, /* (524) star_func_para_list ::= NK_STAR */ + -1, /* (525) star_func_para_list ::= other_para_list */ + -1, /* (526) other_para_list ::= star_func_para */ + -3, /* (527) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (528) star_func_para ::= expr_or_subquery */ + -3, /* (529) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (530) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (531) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (532) when_then_list ::= when_then_expr */ + -2, /* (533) when_then_list ::= when_then_list when_then_expr */ + -4, /* (534) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (535) case_when_else_opt ::= */ + -2, /* (536) case_when_else_opt ::= ELSE common_expression */ + -3, /* (537) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (538) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (539) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (540) predicate ::= expr_or_subquery IS NULL */ + -4, /* (541) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (542) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (543) compare_op ::= NK_LT */ + -1, /* (544) compare_op ::= NK_GT */ + -1, /* (545) compare_op ::= NK_LE */ + -1, /* (546) compare_op ::= NK_GE */ + -1, /* (547) compare_op ::= NK_NE */ + -1, /* (548) compare_op ::= NK_EQ */ + -1, /* (549) compare_op ::= LIKE */ + -2, /* (550) compare_op ::= NOT LIKE */ + -1, /* (551) compare_op ::= MATCH */ + -1, /* (552) compare_op ::= NMATCH */ + -1, /* (553) compare_op ::= CONTAINS */ + -1, /* (554) in_op ::= IN */ + -2, /* (555) in_op ::= NOT IN */ + -3, /* (556) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (557) boolean_value_expression ::= boolean_primary */ + -2, /* (558) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (559) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (560) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (561) boolean_primary ::= predicate */ + -3, /* (562) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (563) common_expression ::= expr_or_subquery */ + -1, /* (564) common_expression ::= boolean_value_expression */ + 0, /* (565) from_clause_opt ::= */ + -2, /* (566) from_clause_opt ::= FROM table_reference_list */ + -1, /* (567) table_reference_list ::= table_reference */ + -3, /* (568) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (569) table_reference ::= table_primary */ + -1, /* (570) table_reference ::= joined_table */ + -2, /* (571) table_primary ::= table_name alias_opt */ + -4, /* (572) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (573) table_primary ::= subquery alias_opt */ + -1, /* (574) table_primary ::= parenthesized_joined_table */ + 0, /* (575) alias_opt ::= */ + -1, /* (576) alias_opt ::= table_alias */ + -2, /* (577) alias_opt ::= AS table_alias */ + -3, /* (578) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (579) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -6, /* (580) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (581) join_type ::= */ + -1, /* (582) join_type ::= INNER */ + -14, /* (583) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (584) hint_list ::= */ + -1, /* (585) hint_list ::= NK_HINT */ + 0, /* (586) tag_mode_opt ::= */ + -1, /* (587) tag_mode_opt ::= TAGS */ + 0, /* (588) set_quantifier_opt ::= */ + -1, /* (589) set_quantifier_opt ::= DISTINCT */ + -1, /* (590) set_quantifier_opt ::= ALL */ + -1, /* (591) select_list ::= select_item */ + -3, /* (592) select_list ::= select_list NK_COMMA select_item */ + -1, /* (593) select_item ::= NK_STAR */ + -1, /* (594) select_item ::= common_expression */ + -2, /* (595) select_item ::= common_expression column_alias */ + -3, /* (596) select_item ::= common_expression AS column_alias */ + -3, /* (597) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (598) where_clause_opt ::= */ + -2, /* (599) where_clause_opt ::= WHERE search_condition */ + 0, /* (600) partition_by_clause_opt ::= */ + -3, /* (601) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (602) partition_list ::= partition_item */ + -3, /* (603) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (604) partition_item ::= expr_or_subquery */ + -2, /* (605) partition_item ::= expr_or_subquery column_alias */ + -3, /* (606) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (607) twindow_clause_opt ::= */ + -6, /* (608) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (609) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (611) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (612) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (614) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (615) sliding_opt ::= */ + -4, /* (616) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (617) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (618) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (619) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (620) fill_opt ::= */ + -4, /* (621) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (622) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (623) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (624) fill_mode ::= NONE */ + -1, /* (625) fill_mode ::= PREV */ + -1, /* (626) fill_mode ::= NULL */ + -1, /* (627) fill_mode ::= NULL_F */ + -1, /* (628) fill_mode ::= LINEAR */ + -1, /* (629) fill_mode ::= NEXT */ + 0, /* (630) group_by_clause_opt ::= */ + -3, /* (631) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (632) group_by_list ::= expr_or_subquery */ + -3, /* (633) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (634) having_clause_opt ::= */ + -2, /* (635) having_clause_opt ::= HAVING search_condition */ + 0, /* (636) range_opt ::= */ + -6, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (638) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (639) every_opt ::= */ + -4, /* (640) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (641) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (642) query_simple ::= query_specification */ + -1, /* (643) query_simple ::= union_query_expression */ + -4, /* (644) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (645) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (646) query_simple_or_subquery ::= query_simple */ + -1, /* (647) query_simple_or_subquery ::= subquery */ + -1, /* (648) query_or_subquery ::= query_expression */ + -1, /* (649) query_or_subquery ::= subquery */ + 0, /* (650) order_by_clause_opt ::= */ + -3, /* (651) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (652) slimit_clause_opt ::= */ + -2, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (655) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (656) limit_clause_opt ::= */ + -2, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (659) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (660) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (661) subquery ::= NK_LP subquery NK_RP */ + -1, /* (662) search_condition ::= common_expression */ + -1, /* (663) sort_specification_list ::= sort_specification */ + -3, /* (664) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (665) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (666) ordering_specification_opt ::= */ + -1, /* (667) ordering_specification_opt ::= ASC */ + -1, /* (668) ordering_specification_opt ::= DESC */ + 0, /* (669) null_ordering_opt ::= */ + -2, /* (670) null_ordering_opt ::= NULLS FIRST */ + -2, /* (671) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4816,11 +4855,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,355,&yymsp[0].minor); + yy_destructor(yypParser,356,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,356,&yymsp[0].minor); + yy_destructor(yypParser,357,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -4834,20 +4873,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,355,&yymsp[-2].minor); +{ yy_destructor(yypParser,356,&yymsp[-2].minor); { } - yy_destructor(yypParser,357,&yymsp[0].minor); + yy_destructor(yypParser,358,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,358,&yymsp[0].minor); +{ yy_destructor(yypParser,359,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,356,&yymsp[-1].minor); +{ yy_destructor(yypParser,357,&yymsp[-1].minor); { } - yy_destructor(yypParser,358,&yymsp[0].minor); + yy_destructor(yypParser,359,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4861,154 +4900,154 @@ 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,357,&yymsp[0].minor); + yy_destructor(yypParser,358,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy552 = yylhsminor.yy552; +{ yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy552 = yymsp[0].minor.yy552; } +{ yymsp[-1].minor.yy404 = yymsp[0].minor.yy404; } break; case 27: /* white_list_opt ::= */ case 188: /* specific_cols_opt ::= */ yytestcase(yyruleno==188); case 220: /* tags_def_opt ::= */ yytestcase(yyruleno==220); - case 308: /* tag_list_opt ::= */ yytestcase(yyruleno==308); - case 374: /* col_list_opt ::= */ yytestcase(yyruleno==374); - case 376: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==376); - case 599: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==599); - case 629: /* group_by_clause_opt ::= */ yytestcase(yyruleno==629); - case 649: /* order_by_clause_opt ::= */ yytestcase(yyruleno==649); -{ yymsp[1].minor.yy552 = NULL; } + case 309: /* tag_list_opt ::= */ yytestcase(yyruleno==309); + case 375: /* col_list_opt ::= */ yytestcase(yyruleno==375); + case 377: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==377); + case 600: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==600); + case 630: /* group_by_clause_opt ::= */ yytestcase(yyruleno==630); + case 650: /* order_by_clause_opt ::= */ yytestcase(yyruleno==650); +{ yymsp[1].minor.yy404 = NULL; } break; case 28: /* white_list_opt ::= white_list */ case 221: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==221); - case 377: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==377); - case 524: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==524); -{ yylhsminor.yy552 = yymsp[0].minor.yy552; } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 378: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==378); + case 525: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==525); +{ yylhsminor.yy404 = yymsp[0].minor.yy404; } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy965, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy883); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy552); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy701, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy915); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy404); } break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy701, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy701, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy701, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy552); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy701, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy404); } break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy552); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy701, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy404); } break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy965); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy701); } break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy883 = 1; } +{ yymsp[1].minor.yy915 = 1; } break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy883 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy915 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy525, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy965, yymsp[-2].minor.yy718); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy949, &yymsp[-3].minor.yy21, &yymsp[0].minor.yy701, yymsp[-2].minor.yy896); } break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy525, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy965, yymsp[-2].minor.yy718); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy949, &yymsp[-3].minor.yy21, &yymsp[0].minor.yy701, yymsp[-2].minor.yy896); } break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_ALL; } break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy525 = yymsp[0].minor.yy525; } - yymsp[0].minor.yy525 = yylhsminor.yy525; +{ yylhsminor.yy949 = yymsp[0].minor.yy949; } + yymsp[0].minor.yy949 = yylhsminor.yy949; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy525 = yymsp[-2].minor.yy525 | yymsp[0].minor.yy525; } - yymsp[-2].minor.yy525 = yylhsminor.yy525; +{ yylhsminor.yy949 = yymsp[-2].minor.yy949 | yymsp[0].minor.yy949; } + yymsp[-2].minor.yy949 = yylhsminor.yy949; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_READ; } break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_WRITE; } break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALTER; } +{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_ALTER; } break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy665.first = yymsp[-2].minor.yy0; yylhsminor.yy665.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy665 = yylhsminor.yy665; +{ yylhsminor.yy21.first = yymsp[-2].minor.yy0; yylhsminor.yy21.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy21 = yylhsminor.yy21; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy665.first = yymsp[-2].minor.yy965; yylhsminor.yy665.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy665 = yylhsminor.yy665; +{ yylhsminor.yy21.first = yymsp[-2].minor.yy701; yylhsminor.yy21.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy21 = yylhsminor.yy21; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy665.first = yymsp[-2].minor.yy965; yylhsminor.yy665.second = yymsp[0].minor.yy965; } - yymsp[-2].minor.yy665 = yylhsminor.yy665; +{ yylhsminor.yy21.first = yymsp[-2].minor.yy701; yylhsminor.yy21.second = yymsp[0].minor.yy701; } + yymsp[-2].minor.yy21 = yylhsminor.yy21; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy665.first = yymsp[0].minor.yy965; yylhsminor.yy665.second = nil_token; } - yymsp[0].minor.yy665 = yylhsminor.yy665; +{ yylhsminor.yy21.first = yymsp[0].minor.yy701; yylhsminor.yy21.second = nil_token; } + yymsp[0].minor.yy21 = yylhsminor.yy21; break; case 52: /* with_opt ::= */ case 157: /* start_opt ::= */ yytestcase(yyruleno==157); case 161: /* end_opt ::= */ yytestcase(yyruleno==161); - case 303: /* like_pattern_opt ::= */ yytestcase(yyruleno==303); - case 388: /* subtable_opt ::= */ yytestcase(yyruleno==388); - case 534: /* case_when_else_opt ::= */ yytestcase(yyruleno==534); - case 564: /* from_clause_opt ::= */ yytestcase(yyruleno==564); - case 597: /* where_clause_opt ::= */ yytestcase(yyruleno==597); - case 606: /* twindow_clause_opt ::= */ yytestcase(yyruleno==606); - case 614: /* sliding_opt ::= */ yytestcase(yyruleno==614); - case 619: /* fill_opt ::= */ yytestcase(yyruleno==619); - case 633: /* having_clause_opt ::= */ yytestcase(yyruleno==633); - case 635: /* range_opt ::= */ yytestcase(yyruleno==635); - case 638: /* every_opt ::= */ yytestcase(yyruleno==638); - case 651: /* slimit_clause_opt ::= */ yytestcase(yyruleno==651); - case 655: /* limit_clause_opt ::= */ yytestcase(yyruleno==655); -{ yymsp[1].minor.yy718 = NULL; } + case 304: /* like_pattern_opt ::= */ yytestcase(yyruleno==304); + case 389: /* subtable_opt ::= */ yytestcase(yyruleno==389); + case 535: /* case_when_else_opt ::= */ yytestcase(yyruleno==535); + case 565: /* from_clause_opt ::= */ yytestcase(yyruleno==565); + case 598: /* where_clause_opt ::= */ yytestcase(yyruleno==598); + case 607: /* twindow_clause_opt ::= */ yytestcase(yyruleno==607); + case 615: /* sliding_opt ::= */ yytestcase(yyruleno==615); + case 620: /* fill_opt ::= */ yytestcase(yyruleno==620); + case 634: /* having_clause_opt ::= */ yytestcase(yyruleno==634); + case 636: /* range_opt ::= */ yytestcase(yyruleno==636); + case 639: /* every_opt ::= */ yytestcase(yyruleno==639); + case 652: /* slimit_clause_opt ::= */ yytestcase(yyruleno==652); + case 656: /* limit_clause_opt ::= */ yytestcase(yyruleno==656); +{ yymsp[1].minor.yy896 = NULL; } break; case 53: /* with_opt ::= WITH search_condition */ - case 565: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==565); - case 598: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==598); - case 634: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==634); -{ yymsp[-1].minor.yy718 = yymsp[0].minor.yy718; } + case 566: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==566); + case 599: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==599); + case 635: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==635); +{ yymsp[-1].minor.yy896 = yymsp[0].minor.yy896; } break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy965, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy701, NULL); } break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0); } break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy559, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy733, false); } break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy559, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy701, yymsp[0].minor.yy733, false); } break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy559); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy733); } break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy965, false, yymsp[0].minor.yy559); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy701, false, yymsp[0].minor.yy733); } break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -5028,57 +5067,57 @@ static YYACTIONTYPE yy_reduce( case 65: /* dnode_endpoint ::= NK_STRING */ case 66: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==66); case 67: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==67); - case 330: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==330); - case 331: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==331); - case 332: /* sma_func_name ::= LAST */ yytestcase(yyruleno==332); - case 333: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==333); - case 455: /* db_name ::= NK_ID */ yytestcase(yyruleno==455); - case 456: /* table_name ::= NK_ID */ yytestcase(yyruleno==456); - case 457: /* column_name ::= NK_ID */ yytestcase(yyruleno==457); - case 458: /* function_name ::= NK_ID */ yytestcase(yyruleno==458); - case 459: /* view_name ::= NK_ID */ yytestcase(yyruleno==459); - case 460: /* table_alias ::= NK_ID */ yytestcase(yyruleno==460); - case 461: /* column_alias ::= NK_ID */ yytestcase(yyruleno==461); - case 462: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==462); - case 463: /* user_name ::= NK_ID */ yytestcase(yyruleno==463); - case 464: /* topic_name ::= NK_ID */ yytestcase(yyruleno==464); - case 465: /* stream_name ::= NK_ID */ yytestcase(yyruleno==465); - case 466: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==466); - case 467: /* index_name ::= NK_ID */ yytestcase(yyruleno==467); - case 510: /* noarg_func ::= NOW */ yytestcase(yyruleno==510); - case 511: /* noarg_func ::= TODAY */ yytestcase(yyruleno==511); - case 512: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==512); - case 513: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==513); - case 514: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==514); - case 515: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==515); - case 516: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==516); - case 517: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==517); - case 518: /* noarg_func ::= USER */ yytestcase(yyruleno==518); - case 519: /* star_func ::= COUNT */ yytestcase(yyruleno==519); - case 520: /* star_func ::= FIRST */ yytestcase(yyruleno==520); - case 521: /* star_func ::= LAST */ yytestcase(yyruleno==521); - case 522: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==522); -{ yylhsminor.yy965 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy965 = yylhsminor.yy965; + case 331: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==331); + case 332: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==332); + case 333: /* sma_func_name ::= LAST */ yytestcase(yyruleno==333); + case 334: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==334); + case 456: /* db_name ::= NK_ID */ yytestcase(yyruleno==456); + case 457: /* table_name ::= NK_ID */ yytestcase(yyruleno==457); + case 458: /* column_name ::= NK_ID */ yytestcase(yyruleno==458); + case 459: /* function_name ::= NK_ID */ yytestcase(yyruleno==459); + case 460: /* view_name ::= NK_ID */ yytestcase(yyruleno==460); + case 461: /* table_alias ::= NK_ID */ yytestcase(yyruleno==461); + case 462: /* column_alias ::= NK_ID */ yytestcase(yyruleno==462); + case 463: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==463); + case 464: /* user_name ::= NK_ID */ yytestcase(yyruleno==464); + case 465: /* topic_name ::= NK_ID */ yytestcase(yyruleno==465); + case 466: /* stream_name ::= NK_ID */ yytestcase(yyruleno==466); + case 467: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==467); + case 468: /* index_name ::= NK_ID */ yytestcase(yyruleno==468); + case 511: /* noarg_func ::= NOW */ yytestcase(yyruleno==511); + case 512: /* noarg_func ::= TODAY */ yytestcase(yyruleno==512); + case 513: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==513); + case 514: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==514); + case 515: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==515); + case 516: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==516); + case 517: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==517); + case 518: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==518); + case 519: /* noarg_func ::= USER */ yytestcase(yyruleno==519); + case 520: /* star_func ::= COUNT */ yytestcase(yyruleno==520); + case 521: /* star_func ::= FIRST */ yytestcase(yyruleno==521); + case 522: /* star_func ::= LAST */ yytestcase(yyruleno==522); + case 523: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==523); +{ yylhsminor.yy701 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy701 = yylhsminor.yy701; break; case 68: /* force_opt ::= */ case 94: /* not_exists_opt ::= */ yytestcase(yyruleno==94); case 96: /* exists_opt ::= */ yytestcase(yyruleno==96); - case 351: /* analyze_opt ::= */ yytestcase(yyruleno==351); - case 358: /* agg_func_opt ::= */ yytestcase(yyruleno==358); - case 364: /* or_replace_opt ::= */ yytestcase(yyruleno==364); - case 390: /* ignore_opt ::= */ yytestcase(yyruleno==390); - case 585: /* tag_mode_opt ::= */ yytestcase(yyruleno==585); - case 587: /* set_quantifier_opt ::= */ yytestcase(yyruleno==587); -{ yymsp[1].minor.yy559 = false; } + case 352: /* analyze_opt ::= */ yytestcase(yyruleno==352); + case 359: /* agg_func_opt ::= */ yytestcase(yyruleno==359); + case 365: /* or_replace_opt ::= */ yytestcase(yyruleno==365); + case 391: /* ignore_opt ::= */ yytestcase(yyruleno==391); + case 586: /* tag_mode_opt ::= */ yytestcase(yyruleno==586); + case 588: /* set_quantifier_opt ::= */ yytestcase(yyruleno==588); +{ yymsp[1].minor.yy733 = false; } break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); - case 352: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==352); - case 359: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==359); - case 586: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==586); - case 588: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==588); -{ yymsp[0].minor.yy559 = true; } + case 353: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==353); + case 360: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==360); + case 587: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==587); + case 589: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==589); +{ yymsp[0].minor.yy733 = true; } break; case 71: /* cmd ::= ALTER CLUSTER NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -5126,241 +5165,241 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy559, &yymsp[-1].minor.yy965, yymsp[0].minor.yy718); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy733, &yymsp[-1].minor.yy701, yymsp[0].minor.yy896); } break; case 87: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; case 88: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy701); } break; case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy718); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy701, yymsp[0].minor.yy896); } break; case 90: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy701); } break; case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy134); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy701, yymsp[0].minor.yy396); } break; case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy965, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy701, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; case 93: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy559 = true; } +{ yymsp[-2].minor.yy733 = true; } break; case 95: /* exists_opt ::= IF EXISTS */ - case 365: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==365); - case 391: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==391); -{ yymsp[-1].minor.yy559 = true; } + case 366: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==366); + case 392: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==392); +{ yymsp[-1].minor.yy733 = true; } break; case 97: /* db_options ::= */ -{ yymsp[1].minor.yy718 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy896 = createDefaultDatabaseOptions(pCxt); } break; case 98: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 101: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 102: /* db_options ::= db_options DURATION NK_INTEGER */ case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103); -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 105: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 106: /* db_options ::= db_options KEEP integer_list */ case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107); -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_KEEP, yymsp[0].minor.yy552); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_KEEP, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 108: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 111: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 112: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 115: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_RETENTIONS, yymsp[0].minor.yy552); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_RETENTIONS, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 120: /* db_options ::= db_options WAL_RETENTION_PERIOD 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.yy718 = setDatabaseOption(pCxt, yymsp[-3].minor.yy718, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-3].minor.yy896, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 122: /* db_options ::= db_options WAL_RETENTION_SIZE 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.yy718 = setDatabaseOption(pCxt, yymsp[-3].minor.yy718, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-3].minor.yy896, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 126: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy718); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy896); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 127: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy718); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy896); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setDatabaseOption(pCxt, yymsp[-2].minor.yy896, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 129: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy718 = createAlterDatabaseOptions(pCxt); yylhsminor.yy718 = setAlterDatabaseOption(pCxt, yylhsminor.yy718, &yymsp[0].minor.yy959); } - yymsp[0].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterDatabaseOptions(pCxt); yylhsminor.yy896 = setAlterDatabaseOption(pCxt, yylhsminor.yy896, &yymsp[0].minor.yy529); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 130: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy718 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy718, &yymsp[0].minor.yy959); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy896, &yymsp[0].minor.yy529); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; case 131: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 135: /* alter_db_option ::= KEEP integer_list */ case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136); -{ yymsp[-1].minor.yy959.type = DB_OPTION_KEEP; yymsp[-1].minor.yy959.pList = yymsp[0].minor.yy552; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP; yymsp[-1].minor.yy529.pList = yymsp[0].minor.yy404; } break; case 137: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_PAGES; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_PAGES; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 138: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 141: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD 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; - yymsp[-2].minor.yy959.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy959.val = t; + yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy529.val = t; } break; case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 145: /* alter_db_option ::= WAL_RETENTION_SIZE 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; - yymsp[-2].minor.yy959.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy959.val = t; + yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy529.val = t; } break; case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 147: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy552 = yylhsminor.yy552; +{ yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 404: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==404); -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; + case 405: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==405); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 149: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy552 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy552 = yylhsminor.yy552; +{ yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 151: /* retention_list ::= retention */ case 182: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==182); @@ -5368,296 +5407,296 @@ static YYACTIONTYPE yy_reduce( case 192: /* column_def_list ::= column_def */ yytestcase(yyruleno==192); case 237: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==237); case 242: /* col_name_list ::= col_name */ yytestcase(yyruleno==242); - case 309: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==309); - case 326: /* func_list ::= func */ yytestcase(yyruleno==326); - case 428: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==428); - case 453: /* literal_list ::= signed_literal */ yytestcase(yyruleno==453); - case 525: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==525); - case 531: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==531); - case 590: /* select_list ::= select_item */ yytestcase(yyruleno==590); - case 601: /* partition_list ::= partition_item */ yytestcase(yyruleno==601); - case 662: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==662); -{ yylhsminor.yy552 = createNodeList(pCxt, yymsp[0].minor.yy718); } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 310: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==310); + case 327: /* func_list ::= func */ yytestcase(yyruleno==327); + case 429: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==429); + case 454: /* literal_list ::= signed_literal */ yytestcase(yyruleno==454); + case 526: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==526); + case 532: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==532); + case 591: /* select_list ::= select_item */ yytestcase(yyruleno==591); + case 602: /* partition_list ::= partition_item */ yytestcase(yyruleno==602); + case 663: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==663); +{ yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy896); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 152: /* retention_list ::= retention_list NK_COMMA retention */ case 186: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==186); case 193: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==193); case 238: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==238); case 243: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==243); - case 310: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==310); - case 327: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==327); - case 429: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==429); - case 454: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==454); - case 526: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==526); - case 591: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==591); - case 602: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==602); - case 663: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==663); -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; + case 311: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==311); + case 328: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==328); + case 430: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==430); + case 455: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==455); + case 527: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==527); + case 592: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==592); + case 603: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==603); + case 664: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==664); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy896); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154); -{ yylhsminor.yy718 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 155: /* speed_opt ::= */ - case 360: /* bufsize_opt ::= */ yytestcase(yyruleno==360); -{ yymsp[1].minor.yy134 = 0; } + case 361: /* bufsize_opt ::= */ yytestcase(yyruleno==361); +{ yymsp[1].minor.yy396 = 0; } break; case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 361: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==361); -{ yymsp[-1].minor.yy134 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 362: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==362); +{ yymsp[-1].minor.yy396 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 158: /* start_opt ::= START WITH NK_INTEGER */ case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162); -{ yymsp[-2].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 159: /* start_opt ::= START WITH NK_STRING */ case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163); -{ yymsp[-2].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 160: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 164: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==164); -{ yymsp[-3].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-3].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 165: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 167: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==167); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy559, yymsp[-5].minor.yy718, yymsp[-3].minor.yy552, yymsp[-1].minor.yy552, yymsp[0].minor.yy718); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy733, yymsp[-5].minor.yy896, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy896); } break; case 166: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy552); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 168: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy552); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy733, yymsp[0].minor.yy896); } break; case 170: /* cmd ::= ALTER TABLE alter_table_clause */ - case 406: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==406); - case 407: /* cmd ::= insert_query */ yytestcase(yyruleno==407); -{ pCxt->pRootNode = yymsp[0].minor.yy718; } + case 407: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==407); + case 408: /* cmd ::= insert_query */ yytestcase(yyruleno==408); +{ pCxt->pRootNode = yymsp[0].minor.yy896; } break; case 171: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy718); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy896); } break; case 172: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy718 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy701, yymsp[0].minor.yy504); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy718 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy718, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy965); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy896, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy701); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy701, yymsp[0].minor.yy504); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy718 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy701, yymsp[0].minor.yy504); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy718 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy718, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy965); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy896, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy701); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy701, yymsp[0].minor.yy504); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy718 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy896, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy718 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy718, &yymsp[-2].minor.yy965, yymsp[0].minor.yy718); } - yymsp[-5].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy896, &yymsp[-2].minor.yy701, yymsp[0].minor.yy896); } + yymsp[-5].minor.yy896 = yylhsminor.yy896; break; case 183: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 532: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==532); -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-1].minor.yy552, yymsp[0].minor.yy718); } - yymsp[-1].minor.yy552 = yylhsminor.yy552; + case 533: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==533); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy896); } + yymsp[-1].minor.yy404 = yylhsminor.yy404; break; case 184: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -{ yylhsminor.yy718 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy559, yymsp[-8].minor.yy718, yymsp[-6].minor.yy718, yymsp[-5].minor.yy552, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } - yymsp[-9].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy733, yymsp[-8].minor.yy896, yymsp[-6].minor.yy896, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy896); } + yymsp[-9].minor.yy896 = yylhsminor.yy896; break; case 187: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy718 = createDropTableClause(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createDropTableClause(pCxt, yymsp[-1].minor.yy733, yymsp[0].minor.yy896); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; case 189: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 375: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==375); -{ yymsp[-2].minor.yy552 = yymsp[-1].minor.yy552; } + case 376: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==376); +{ yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } break; case 190: /* full_table_name ::= table_name */ -{ yylhsminor.yy718 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy965, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy701, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 191: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy718 = createRealTableNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965, NULL); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createRealTableNode(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701, NULL); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 194: /* column_def ::= column_name type_name */ -{ yylhsminor.yy718 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224, NULL, false); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy701, yymsp[0].minor.yy504, NULL, false); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; case 195: /* column_def ::= column_name type_name PRIMARY KEY */ -{ yylhsminor.yy718 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy965, yymsp[-2].minor.yy224, NULL, true); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy701, yymsp[-2].minor.yy504, NULL, true); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; case 196: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 197: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 198: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 199: /* type_name ::= INT */ case 200: /* type_name ::= INTEGER */ yytestcase(yyruleno==200); -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_INT); } break; case 201: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 202: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 203: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 204: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy504 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 205: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 206: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy504 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 207: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy504 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 208: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy504 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 209: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy504 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 210: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy504 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 211: /* type_name ::= JSON */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 212: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy504 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 213: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 214: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 215: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy504 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 216: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy504 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; case 217: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy504 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 218: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy504 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 219: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy504 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 222: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 378: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==378); -{ yymsp[-3].minor.yy552 = yymsp[-1].minor.yy552; } + case 379: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==379); +{ yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } break; case 223: /* table_options ::= */ -{ yymsp[1].minor.yy718 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy896 = createDefaultTableOptions(pCxt); } break; case 224: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-2].minor.yy896, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 225: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy552); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-2].minor.yy896, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 226: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy552); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-2].minor.yy896, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 227: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-4].minor.yy718, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy552); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-4].minor.yy896, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 228: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-2].minor.yy896, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 229: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-4].minor.yy718, TABLE_OPTION_SMA, yymsp[-1].minor.yy552); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-4].minor.yy896, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; case 230: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy552); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-2].minor.yy896, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; case 231: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy718 = createAlterTableOptions(pCxt); yylhsminor.yy718 = setTableOption(pCxt, yylhsminor.yy718, yymsp[0].minor.yy959.type, &yymsp[0].minor.yy959.val); } - yymsp[0].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createAlterTableOptions(pCxt); yylhsminor.yy896 = setTableOption(pCxt, yylhsminor.yy896, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 232: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy959.type, &yymsp[0].minor.yy959.val); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = setTableOption(pCxt, yymsp[-1].minor.yy896, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; case 233: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy959.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 234: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy959.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy529.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } break; case 235: /* duration_list ::= duration_literal */ - case 485: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==485); -{ yylhsminor.yy552 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 486: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==486); +{ yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 236: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 486: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==486); -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; + case 487: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==487); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 239: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[0].minor.yy965, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; +{ yylhsminor.yy896 = createFunctionNode(pCxt, &yymsp[0].minor.yy701, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 240: /* rollup_func_name ::= FIRST */ case 241: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==241); - case 312: /* tag_item ::= QTAGS */ yytestcase(yyruleno==312); -{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 313: /* tag_item ::= QTAGS */ yytestcase(yyruleno==313); +{ yylhsminor.yy896 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 244: /* col_name ::= column_name */ - case 313: /* tag_item ::= column_name */ yytestcase(yyruleno==313); -{ yylhsminor.yy718 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy965); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 314: /* tag_item ::= column_name */ yytestcase(yyruleno==314); +{ yylhsminor.yy896 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy701); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; case 245: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -5671,19 +5710,19 @@ static YYACTIONTYPE yy_reduce( case 248: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy101); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy705); } break; case 249: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy91, yymsp[0].minor.yy718, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy989, yymsp[0].minor.yy896, OP_TYPE_LIKE); } break; case 250: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy896, yymsp[0].minor.yy896, OP_TYPE_LIKE); } break; case 251: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy718, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy896, NULL, OP_TYPE_LIKE); } break; case 252: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -5691,1026 +5730,1029 @@ static YYACTIONTYPE yy_reduce( case 253: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 254: /* cmd ::= SHOW FUNCTIONS */ + case 254: /* cmd ::= SHOW ARBGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } + break; + case 255: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 255: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy718, yymsp[-1].minor.yy718, OP_TYPE_EQUAL); } + case 256: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy896, yymsp[-1].minor.yy896, OP_TYPE_EQUAL); } break; - case 256: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), OP_TYPE_EQUAL); } + case 257: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy701), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy701), OP_TYPE_EQUAL); } break; - case 257: /* cmd ::= SHOW STREAMS */ + case 258: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 258: /* cmd ::= SHOW ACCOUNTS */ + case 259: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 259: /* cmd ::= SHOW APPS */ + case 260: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 260: /* cmd ::= SHOW CONNECTIONS */ + case 261: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 261: /* cmd ::= SHOW LICENCES */ - case 262: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==262); + case 262: /* cmd ::= SHOW LICENCES */ + case 263: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==263); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 263: /* cmd ::= SHOW GRANTS FULL */ + case 264: /* cmd ::= SHOW GRANTS FULL */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } break; - case 264: /* cmd ::= SHOW GRANTS LOGS */ + case 265: /* cmd ::= SHOW GRANTS LOGS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } break; - case 265: /* cmd ::= SHOW CLUSTER MACHINES */ + case 266: /* cmd ::= SHOW CLUSTER MACHINES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } break; - case 266: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } + case 267: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy701); } break; - case 267: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy718); } + case 268: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy896); } break; - case 268: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy718); } + case 269: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy896); } break; - case 269: /* cmd ::= SHOW QUERIES */ + case 270: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 270: /* cmd ::= SHOW SCORES */ + case 271: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 271: /* cmd ::= SHOW TOPICS */ + case 272: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 272: /* cmd ::= SHOW VARIABLES */ - case 273: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==273); + case 273: /* cmd ::= SHOW VARIABLES */ + case 274: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==274); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 274: /* cmd ::= SHOW LOCAL VARIABLES */ + case 275: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 275: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy718); } + case 276: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy896); } break; - case 276: /* cmd ::= SHOW BNODES */ + case 277: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 277: /* cmd ::= SHOW SNODES */ + case 278: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 278: /* cmd ::= SHOW CLUSTER */ + case 279: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 279: /* cmd ::= SHOW TRANSACTIONS */ + case 280: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 280: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy718); } + case 281: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy896); } break; - case 281: /* cmd ::= SHOW CONSUMERS */ + case 282: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 282: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 283: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 283: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy718, yymsp[-1].minor.yy718, OP_TYPE_EQUAL); } + case 284: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy896, yymsp[-1].minor.yy896, OP_TYPE_EQUAL); } break; - case 284: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), OP_TYPE_EQUAL); } + case 285: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy701), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy701), OP_TYPE_EQUAL); } break; - case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718, yymsp[-3].minor.yy552); } + case 286: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy896, yymsp[0].minor.yy896, yymsp[-3].minor.yy404); } break; - case 286: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), yymsp[-4].minor.yy552); } + case 287: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy701), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy701), yymsp[-4].minor.yy404); } break; - case 287: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 288: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 288: /* cmd ::= SHOW VNODES */ + case 289: /* cmd ::= SHOW VNODES */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; - case 289: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy718, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 290: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy896, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 290: /* cmd ::= SHOW CLUSTER ALIVE */ + case 291: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 291: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, OP_TYPE_LIKE); } + case 292: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy896, yymsp[0].minor.yy896, OP_TYPE_LIKE); } break; - case 292: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy718); } + case 293: /* cmd ::= SHOW CREATE VIEW full_table_name */ +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy896); } break; - case 293: /* cmd ::= SHOW COMPACTS */ + case 294: /* cmd ::= SHOW COMPACTS */ { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } break; - case 294: /* cmd ::= SHOW COMPACT NK_INTEGER */ + case 295: /* cmd ::= SHOW COMPACT NK_INTEGER */ { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 295: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy91.kind = SHOW_KIND_ALL; yymsp[1].minor.yy91.dbName = nil_token; } + case 296: /* table_kind_db_name_cond_opt ::= */ +{ yymsp[1].minor.yy989.kind = SHOW_KIND_ALL; yymsp[1].minor.yy989.dbName = nil_token; } break; - case 296: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy91.kind = yymsp[0].minor.yy101; yylhsminor.yy91.dbName = nil_token; } - yymsp[0].minor.yy91 = yylhsminor.yy91; + case 297: /* table_kind_db_name_cond_opt ::= table_kind */ +{ yylhsminor.yy989.kind = yymsp[0].minor.yy705; yylhsminor.yy989.dbName = nil_token; } + yymsp[0].minor.yy989 = yylhsminor.yy989; break; - case 297: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy91.kind = SHOW_KIND_ALL; yylhsminor.yy91.dbName = yymsp[-1].minor.yy965; } - yymsp[-1].minor.yy91 = yylhsminor.yy91; + case 298: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy989.kind = SHOW_KIND_ALL; yylhsminor.yy989.dbName = yymsp[-1].minor.yy701; } + yymsp[-1].minor.yy989 = yylhsminor.yy989; break; - case 298: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy91.kind = yymsp[-2].minor.yy101; yylhsminor.yy91.dbName = yymsp[-1].minor.yy965; } - yymsp[-2].minor.yy91 = yylhsminor.yy91; + case 299: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +{ yylhsminor.yy989.kind = yymsp[-2].minor.yy705; yylhsminor.yy989.dbName = yymsp[-1].minor.yy701; } + yymsp[-2].minor.yy989 = yylhsminor.yy989; break; - case 299: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy101 = SHOW_KIND_TABLES_NORMAL; } + case 300: /* table_kind ::= NORMAL */ +{ yymsp[0].minor.yy705 = SHOW_KIND_TABLES_NORMAL; } break; - case 300: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy101 = SHOW_KIND_TABLES_CHILD; } + case 301: /* table_kind ::= CHILD */ +{ yymsp[0].minor.yy705 = SHOW_KIND_TABLES_CHILD; } break; - case 301: /* db_name_cond_opt ::= */ - case 306: /* from_db_opt ::= */ yytestcase(yyruleno==306); -{ yymsp[1].minor.yy718 = createDefaultDatabaseCondValue(pCxt); } + case 302: /* db_name_cond_opt ::= */ + case 307: /* from_db_opt ::= */ yytestcase(yyruleno==307); +{ yymsp[1].minor.yy896 = createDefaultDatabaseCondValue(pCxt); } break; - case 302: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy718 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy965); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 303: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy896 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy701); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 304: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 305: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 305: /* table_name_cond ::= table_name */ -{ yylhsminor.yy718 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 306: /* table_name_cond ::= table_name */ +{ yylhsminor.yy896 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy701); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 307: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy718 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965); } + case 308: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy896 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy701); } break; - case 311: /* tag_item ::= TBNAME */ -{ yylhsminor.yy718 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 312: /* tag_item ::= TBNAME */ +{ yylhsminor.yy896 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 314: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy718 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy965), &yymsp[0].minor.yy965); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 315: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy896 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy701), &yymsp[0].minor.yy701); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 315: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy718 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy965), &yymsp[0].minor.yy965); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 316: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy896 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy701), &yymsp[0].minor.yy701); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 316: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy101 = SHOW_KIND_ALL; } + case 317: /* db_kind_opt ::= */ +{ yymsp[1].minor.yy705 = SHOW_KIND_ALL; } break; - case 317: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy101 = SHOW_KIND_DATABASES_USER; } + case 318: /* db_kind_opt ::= USER */ +{ yymsp[0].minor.yy705 = SHOW_KIND_DATABASES_USER; } break; - case 318: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy101 = SHOW_KIND_DATABASES_SYSTEM; } + case 319: /* db_kind_opt ::= SYSTEM */ +{ yymsp[0].minor.yy705 = SHOW_KIND_DATABASES_SYSTEM; } break; - case 319: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy559, yymsp[-3].minor.yy718, yymsp[-1].minor.yy718, NULL, yymsp[0].minor.yy718); } + case 320: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy733, yymsp[-3].minor.yy896, yymsp[-1].minor.yy896, NULL, yymsp[0].minor.yy896); } break; - case 320: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy559, yymsp[-5].minor.yy718, yymsp[-3].minor.yy718, yymsp[-1].minor.yy552, NULL); } + case 321: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy733, yymsp[-5].minor.yy896, yymsp[-3].minor.yy896, yymsp[-1].minor.yy404, NULL); } break; - case 321: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } + case 322: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy733, yymsp[0].minor.yy896); } break; - case 322: /* full_index_name ::= index_name */ -{ yylhsminor.yy718 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy965); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 323: /* full_index_name ::= index_name */ +{ yylhsminor.yy896 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy701); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 323: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy718 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 324: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy896 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 324: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy718 = createIndexOption(pCxt, yymsp[-7].minor.yy552, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 325: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy896 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), NULL, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 325: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy718 = createIndexOption(pCxt, yymsp[-9].minor.yy552, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 326: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-11].minor.yy896 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy896), releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 328: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[-3].minor.yy965, yymsp[-1].minor.yy552); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 329: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy896 = createFunctionNode(pCxt, &yymsp[-3].minor.yy701, yymsp[-1].minor.yy404); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 329: /* sma_func_name ::= function_name */ - case 575: /* alias_opt ::= table_alias */ yytestcase(yyruleno==575); -{ yylhsminor.yy965 = yymsp[0].minor.yy965; } - yymsp[0].minor.yy965 = yylhsminor.yy965; + case 330: /* sma_func_name ::= function_name */ + case 576: /* alias_opt ::= table_alias */ yytestcase(yyruleno==576); +{ yylhsminor.yy701 = yymsp[0].minor.yy701; } + yymsp[0].minor.yy701 = yylhsminor.yy701; break; - case 334: /* sma_stream_opt ::= */ - case 379: /* stream_options ::= */ yytestcase(yyruleno==379); -{ yymsp[1].minor.yy718 = createStreamOptions(pCxt); } + case 335: /* sma_stream_opt ::= */ + case 380: /* stream_options ::= */ yytestcase(yyruleno==380); +{ yymsp[1].minor.yy896 = createStreamOptions(pCxt); } break; - case 335: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 336: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy896)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy896); yylhsminor.yy896 = yymsp[-2].minor.yy896; } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 336: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 337: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy896)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy896); yylhsminor.yy896 = yymsp[-2].minor.yy896; } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 337: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 338: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy896)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy896); yylhsminor.yy896 = yymsp[-2].minor.yy896; } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 338: /* with_meta ::= AS */ -{ yymsp[0].minor.yy134 = 0; } + case 339: /* with_meta ::= AS */ +{ yymsp[0].minor.yy396 = 0; } break; - case 339: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy134 = 1; } + case 340: /* with_meta ::= WITH META AS */ +{ yymsp[-2].minor.yy396 = 1; } break; - case 340: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy134 = 2; } + case 341: /* with_meta ::= ONLY META AS */ +{ yymsp[-2].minor.yy396 = 2; } break; - case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy559, &yymsp[-2].minor.yy965, yymsp[0].minor.yy718); } + case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy733, &yymsp[-2].minor.yy701, yymsp[0].minor.yy896); } break; - case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy559, &yymsp[-3].minor.yy965, &yymsp[0].minor.yy965, yymsp[-2].minor.yy134); } + case 343: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy733, &yymsp[-3].minor.yy701, &yymsp[0].minor.yy701, yymsp[-2].minor.yy396); } break; - case 343: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy559, &yymsp[-4].minor.yy965, yymsp[-1].minor.yy718, yymsp[-3].minor.yy134, yymsp[0].minor.yy718); } + case 344: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy733, &yymsp[-4].minor.yy701, yymsp[-1].minor.yy896, yymsp[-3].minor.yy396, yymsp[0].minor.yy896); } break; - case 344: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } + case 345: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; - case 345: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy559, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } + case 346: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy733, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701); } break; - case 346: /* cmd ::= DESC full_table_name */ - case 347: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==347); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy718); } + case 347: /* cmd ::= DESC full_table_name */ + case 348: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==348); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy896); } break; - case 348: /* cmd ::= RESET QUERY CACHE */ + case 349: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 349: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 350: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==350); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy559, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 350: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 351: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==351); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy733, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 353: /* explain_options ::= */ -{ yymsp[1].minor.yy718 = createDefaultExplainOptions(pCxt); } + case 354: /* explain_options ::= */ +{ yymsp[1].minor.yy896 = createDefaultExplainOptions(pCxt); } break; - case 354: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy718 = setExplainVerbose(pCxt, yymsp[-2].minor.yy718, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 355: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy896 = setExplainVerbose(pCxt, yymsp[-2].minor.yy896, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 355: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy718 = setExplainRatio(pCxt, yymsp[-2].minor.yy718, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 356: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy896 = setExplainRatio(pCxt, yymsp[-2].minor.yy896, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 356: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy559, yymsp[-9].minor.yy559, &yymsp[-6].minor.yy965, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy224, yymsp[-1].minor.yy134, &yymsp[0].minor.yy965, yymsp[-10].minor.yy559); } + case 357: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy733, yymsp[-9].minor.yy733, &yymsp[-6].minor.yy701, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy504, yymsp[-1].minor.yy396, &yymsp[0].minor.yy701, yymsp[-10].minor.yy733); } break; - case 357: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } + case 358: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; - case 362: /* language_opt ::= */ - case 401: /* on_vgroup_id ::= */ yytestcase(yyruleno==401); -{ yymsp[1].minor.yy965 = nil_token; } + case 363: /* language_opt ::= */ + case 402: /* on_vgroup_id ::= */ yytestcase(yyruleno==402); +{ yymsp[1].minor.yy701 = nil_token; } break; - case 363: /* language_opt ::= LANGUAGE NK_STRING */ - case 402: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==402); -{ yymsp[-1].minor.yy965 = yymsp[0].minor.yy0; } + case 364: /* language_opt ::= LANGUAGE NK_STRING */ + case 403: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==403); +{ yymsp[-1].minor.yy701 = yymsp[0].minor.yy0; } break; - case 366: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy559, yymsp[-2].minor.yy718, &yymsp[-1].minor.yy0, yymsp[0].minor.yy718); } + case 367: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy733, yymsp[-2].minor.yy896, &yymsp[-1].minor.yy0, yymsp[0].minor.yy896); } break; - case 367: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } + case 368: /* cmd ::= DROP VIEW exists_opt full_view_name */ +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy733, yymsp[0].minor.yy896); } break; - case 368: /* full_view_name ::= view_name */ -{ yylhsminor.yy718 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy965); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 369: /* full_view_name ::= view_name */ +{ yylhsminor.yy896 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy701); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 369: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy718 = createViewNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 370: /* full_view_name ::= db_name NK_DOT view_name */ +{ yylhsminor.yy896 = createViewNode(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 370: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy559, &yymsp[-8].minor.yy965, yymsp[-5].minor.yy718, yymsp[-7].minor.yy718, yymsp[-3].minor.yy552, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, yymsp[-4].minor.yy552); } + case 371: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy733, &yymsp[-8].minor.yy701, yymsp[-5].minor.yy896, yymsp[-7].minor.yy896, yymsp[-3].minor.yy404, yymsp[-2].minor.yy896, yymsp[0].minor.yy896, yymsp[-4].minor.yy404); } break; - case 371: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } + case 372: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; - case 372: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } + case 373: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; - case 373: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy559, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } + case 374: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy733, yymsp[-1].minor.yy733, &yymsp[0].minor.yy701); } break; - case 380: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 381: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==381); -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 381: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 382: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==382); +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-2].minor.yy896, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 382: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 383: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-3].minor.yy896, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 383: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 384: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-2].minor.yy896, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 384: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 385: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-3].minor.yy896, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 385: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 386: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-2].minor.yy896, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 386: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 387: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-2].minor.yy896, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 387: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 388: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy896 = setStreamOptions(pCxt, yymsp[-3].minor.yy896, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 389: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 615: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==615); - case 639: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==639); -{ yymsp[-3].minor.yy718 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy718); } + case 390: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 616: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==616); + case 640: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==640); +{ yymsp[-3].minor.yy896 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy896); } break; - case 392: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 393: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 393: /* cmd ::= KILL QUERY NK_STRING */ + case 394: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 394: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 395: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 395: /* cmd ::= KILL COMPACT NK_INTEGER */ + case 396: /* cmd ::= KILL COMPACT NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } break; - case 396: /* cmd ::= BALANCE VGROUP */ + case 397: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 397: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy965); } + case 398: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy701); } break; - case 398: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 399: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 399: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy552); } + case 400: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } break; - case 400: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 401: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 403: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 404: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 405: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 406: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 408: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy718 = createInsertStmt(pCxt, yymsp[-4].minor.yy718, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } + case 409: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy896 = createInsertStmt(pCxt, yymsp[-4].minor.yy896, yymsp[-2].minor.yy404, yymsp[0].minor.yy896); } break; - case 409: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy718 = createInsertStmt(pCxt, yymsp[-1].minor.yy718, NULL, yymsp[0].minor.yy718); } + case 410: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy896 = createInsertStmt(pCxt, yymsp[-1].minor.yy896, NULL, yymsp[0].minor.yy896); } break; - case 410: /* tags_literal ::= NK_INTEGER */ - case 416: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==416); - case 419: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==419); -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 411: /* tags_literal ::= NK_INTEGER */ + case 417: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==417); + case 420: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==420); +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 411: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 412: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==412); - case 417: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==417); - case 418: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==418); - case 420: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==420); - case 421: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==421); + case 412: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 413: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==413); + case 418: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==418); + case 419: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==419); + case 421: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==421); + case 422: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==422); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 413: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 414: /* tags_literal ::= NK_FLOAT */ +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 414: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 415: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==415); + case 415: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 416: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==416); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 422: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 423: /* tags_literal ::= NK_STRING */ +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 423: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 424: /* tags_literal ::= NK_BOOL */ +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 424: /* tags_literal ::= NULL */ -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 425: /* tags_literal ::= NULL */ +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 425: /* tags_literal ::= literal_func */ -{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy718); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 426: /* tags_literal ::= literal_func */ +{ yylhsminor.yy896 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy896); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 426: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 427: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==427); + case 427: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 428: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==428); { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); l.n = (r.z + r.n) - l.z; - yylhsminor.yy718 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); + yylhsminor.yy896 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy896, yymsp[0].minor.yy896); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 430: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 431: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 431: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 432: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 432: /* literal ::= NK_STRING */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 433: /* literal ::= NK_STRING */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 433: /* literal ::= NK_BOOL */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 434: /* literal ::= NK_BOOL */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 434: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 435: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 435: /* literal ::= duration_literal */ - case 445: /* signed_literal ::= signed */ yytestcase(yyruleno==445); - case 468: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==468); - case 469: /* expression ::= literal */ yytestcase(yyruleno==469); - case 471: /* expression ::= column_reference */ yytestcase(yyruleno==471); - case 472: /* expression ::= function_expression */ yytestcase(yyruleno==472); - case 473: /* expression ::= case_when_expression */ yytestcase(yyruleno==473); - case 506: /* function_expression ::= literal_func */ yytestcase(yyruleno==506); - case 556: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==556); - case 560: /* boolean_primary ::= predicate */ yytestcase(yyruleno==560); - case 562: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==562); - case 563: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==563); - case 566: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==566); - case 568: /* table_reference ::= table_primary */ yytestcase(yyruleno==568); - case 569: /* table_reference ::= joined_table */ yytestcase(yyruleno==569); - case 573: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==573); - case 641: /* query_simple ::= query_specification */ yytestcase(yyruleno==641); - case 642: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==642); - case 645: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==645); - case 647: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==647); -{ yylhsminor.yy718 = yymsp[0].minor.yy718; } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 436: /* literal ::= duration_literal */ + case 446: /* signed_literal ::= signed */ yytestcase(yyruleno==446); + case 469: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==469); + case 470: /* expression ::= literal */ yytestcase(yyruleno==470); + case 472: /* expression ::= column_reference */ yytestcase(yyruleno==472); + case 473: /* expression ::= function_expression */ yytestcase(yyruleno==473); + case 474: /* expression ::= case_when_expression */ yytestcase(yyruleno==474); + case 507: /* function_expression ::= literal_func */ yytestcase(yyruleno==507); + case 557: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==557); + case 561: /* boolean_primary ::= predicate */ yytestcase(yyruleno==561); + case 563: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==563); + case 564: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==564); + case 567: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==567); + case 569: /* table_reference ::= table_primary */ yytestcase(yyruleno==569); + case 570: /* table_reference ::= joined_table */ yytestcase(yyruleno==570); + case 574: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==574); + case 642: /* query_simple ::= query_specification */ yytestcase(yyruleno==642); + case 643: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==643); + case 646: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==646); + case 648: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==648); +{ yylhsminor.yy896 = yymsp[0].minor.yy896; } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 436: /* literal ::= NULL */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 437: /* literal ::= NULL */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 437: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 438: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 438: /* duration_literal ::= NK_VARIABLE */ - case 616: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==616); - case 617: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==617); - case 618: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==618); -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 439: /* duration_literal ::= NK_VARIABLE */ + case 617: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==617); + case 618: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==618); + case 619: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==619); +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 439: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 440: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 440: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 441: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 441: /* signed ::= NK_MINUS NK_INTEGER */ + case 442: /* 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.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 442: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 443: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 443: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 444: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 444: /* signed ::= NK_MINUS NK_FLOAT */ + case 445: /* 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.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 446: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 447: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 447: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 448: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 448: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 449: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 449: /* signed_literal ::= duration_literal */ - case 451: /* signed_literal ::= literal_func */ yytestcase(yyruleno==451); - case 527: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==527); - case 593: /* select_item ::= common_expression */ yytestcase(yyruleno==593); - case 603: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==603); - case 646: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==646); - case 648: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==648); - case 661: /* search_condition ::= common_expression */ yytestcase(yyruleno==661); -{ yylhsminor.yy718 = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 450: /* signed_literal ::= duration_literal */ + case 452: /* signed_literal ::= literal_func */ yytestcase(yyruleno==452); + case 528: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==528); + case 594: /* select_item ::= common_expression */ yytestcase(yyruleno==594); + case 604: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==604); + case 647: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==647); + case 649: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==649); + case 662: /* search_condition ::= common_expression */ yytestcase(yyruleno==662); +{ yylhsminor.yy896 = releaseRawExprNode(pCxt, yymsp[0].minor.yy896); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 450: /* signed_literal ::= NULL */ -{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 451: /* signed_literal ::= NULL */ +{ yylhsminor.yy896 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 452: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy718 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 453: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy896 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 470: /* expression ::= pseudo_column */ -{ yylhsminor.yy718 = yymsp[0].minor.yy718; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy718, true); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 471: /* expression ::= pseudo_column */ +{ yylhsminor.yy896 = yymsp[0].minor.yy896; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy896, true); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 474: /* expression ::= NK_LP expression NK_RP */ - case 561: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==561); - case 660: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==660); -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 475: /* expression ::= NK_LP expression NK_RP */ + case 562: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==562); + case 661: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==661); +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy896)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 475: /* expression ::= NK_PLUS expr_or_subquery */ + case 476: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 476: /* expression ::= NK_MINUS expr_or_subquery */ + case 477: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy718), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy896), NULL)); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 477: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 478: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 478: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 479: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 479: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 480: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 480: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 481: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 481: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 482: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 482: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 483: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 483: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 484: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 484: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 485: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 487: /* column_reference ::= column_name */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy965, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy965)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 488: /* column_reference ::= column_name */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy701, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy701)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 488: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965, createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 489: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701, createColumnNode(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy701)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 489: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 490: /* column_reference ::= NK_ALIAS */ +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 490: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 491: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 491: /* pseudo_column ::= ROWTS */ - case 492: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==492); - case 494: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==494); - case 495: /* pseudo_column ::= QEND */ yytestcase(yyruleno==495); - case 496: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==496); - case 497: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==497); - case 498: /* pseudo_column ::= WEND */ yytestcase(yyruleno==498); - case 499: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==499); - case 500: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==500); - case 501: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==501); - case 502: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==502); - case 508: /* literal_func ::= NOW */ yytestcase(yyruleno==508); - case 509: /* literal_func ::= TODAY */ yytestcase(yyruleno==509); -{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 492: /* pseudo_column ::= ROWTS */ + case 493: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==493); + case 495: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==495); + case 496: /* pseudo_column ::= QEND */ yytestcase(yyruleno==496); + case 497: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==497); + case 498: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==498); + case 499: /* pseudo_column ::= WEND */ yytestcase(yyruleno==499); + case 500: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==500); + case 501: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==501); + case 502: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==502); + case 503: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==503); + case 509: /* literal_func ::= NOW */ yytestcase(yyruleno==509); + case 510: /* literal_func ::= TODAY */ yytestcase(yyruleno==510); +{ yylhsminor.yy896 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 493: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy965)))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 494: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy701)))); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 503: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 504: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==504); -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy965, yymsp[-1].minor.yy552)); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 504: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 505: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==505); +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy701, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy701, yymsp[-1].minor.yy404)); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 505: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy224)); } - yymsp[-5].minor.yy718 = yylhsminor.yy718; + case 506: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), yymsp[-1].minor.yy504)); } + yymsp[-5].minor.yy896 = yylhsminor.yy896; break; - case 507: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy965, NULL)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 508: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy701, NULL)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 523: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy552 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 524: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 528: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 596: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==596); -{ yylhsminor.yy718 = createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 529: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 597: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==597); +{ yylhsminor.yy896 = createColumnNode(pCxt, &yymsp[-2].minor.yy701, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 529: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy552, yymsp[-1].minor.yy718)); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 530: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy896)); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 530: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-2].minor.yy552, yymsp[-1].minor.yy718)); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; + case 531: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), yymsp[-2].minor.yy404, yymsp[-1].minor.yy896)); } + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; - case 533: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy718 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } + case 534: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy896 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896)); } break; - case 535: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy718 = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); } + case 536: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy896 = releaseRawExprNode(pCxt, yymsp[0].minor.yy896); } break; - case 536: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 541: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==541); + case 537: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 542: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==542); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy810, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy884, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 537: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 538: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy718), releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy896), releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-4].minor.yy718 = yylhsminor.yy718; + yymsp[-4].minor.yy896 = yylhsminor.yy896; break; - case 538: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 539: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy896), releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-5].minor.yy718 = yylhsminor.yy718; + yymsp[-5].minor.yy896 = yylhsminor.yy896; break; - case 539: /* predicate ::= expr_or_subquery IS NULL */ + case 540: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), NULL)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 540: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 541: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), NULL)); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 542: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy810 = OP_TYPE_LOWER_THAN; } + case 543: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy884 = OP_TYPE_LOWER_THAN; } break; - case 543: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy810 = OP_TYPE_GREATER_THAN; } + case 544: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy884 = OP_TYPE_GREATER_THAN; } break; - case 544: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy810 = OP_TYPE_LOWER_EQUAL; } + case 545: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy884 = OP_TYPE_LOWER_EQUAL; } break; - case 545: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy810 = OP_TYPE_GREATER_EQUAL; } + case 546: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy884 = OP_TYPE_GREATER_EQUAL; } break; - case 546: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy810 = OP_TYPE_NOT_EQUAL; } + case 547: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy884 = OP_TYPE_NOT_EQUAL; } break; - case 547: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy810 = OP_TYPE_EQUAL; } + case 548: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy884 = OP_TYPE_EQUAL; } break; - case 548: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy810 = OP_TYPE_LIKE; } + case 549: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy884 = OP_TYPE_LIKE; } break; - case 549: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy810 = OP_TYPE_NOT_LIKE; } + case 550: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy884 = OP_TYPE_NOT_LIKE; } break; - case 550: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy810 = OP_TYPE_MATCH; } + case 551: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy884 = OP_TYPE_MATCH; } break; - case 551: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy810 = OP_TYPE_NMATCH; } + case 552: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy884 = OP_TYPE_NMATCH; } break; - case 552: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy810 = OP_TYPE_JSON_CONTAINS; } + case 553: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy884 = OP_TYPE_JSON_CONTAINS; } break; - case 553: /* in_op ::= IN */ -{ yymsp[0].minor.yy810 = OP_TYPE_IN; } + case 554: /* in_op ::= IN */ +{ yymsp[0].minor.yy884 = OP_TYPE_IN; } break; - case 554: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy810 = OP_TYPE_NOT_IN; } + case 555: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy884 = OP_TYPE_NOT_IN; } break; - case 555: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 556: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 557: /* boolean_value_expression ::= NOT boolean_primary */ + case 558: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy718), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy896), NULL)); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 558: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 559: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 559: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 560: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); - yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy896); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy896); + yylhsminor.yy896 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 567: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy718 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, NULL); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 568: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy896 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy896, yymsp[0].minor.yy896, NULL); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 570: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy718 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 571: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy896 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 571: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy718 = createRealTableNode(pCxt, &yymsp[-3].minor.yy965, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 572: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy896 = createRealTableNode(pCxt, &yymsp[-3].minor.yy701, &yymsp[-1].minor.yy701, &yymsp[0].minor.yy701); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 572: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy718 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718), &yymsp[0].minor.yy965); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 573: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy896 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy896), &yymsp[0].minor.yy701); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 574: /* alias_opt ::= */ -{ yymsp[1].minor.yy965 = nil_token; } + case 575: /* alias_opt ::= */ +{ yymsp[1].minor.yy701 = nil_token; } break; - case 576: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy965 = yymsp[0].minor.yy965; } + case 577: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy701 = yymsp[0].minor.yy701; } break; - case 577: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 578: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==578); -{ yymsp[-2].minor.yy718 = yymsp[-1].minor.yy718; } + case 578: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 579: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==579); +{ yymsp[-2].minor.yy896 = yymsp[-1].minor.yy896; } break; - case 579: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy718 = createJoinTableNode(pCxt, yymsp[-4].minor.yy992, yymsp[-5].minor.yy718, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); } - yymsp[-5].minor.yy718 = yylhsminor.yy718; + case 580: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy896 = createJoinTableNode(pCxt, yymsp[-4].minor.yy680, yymsp[-5].minor.yy896, yymsp[-2].minor.yy896, yymsp[0].minor.yy896); } + yymsp[-5].minor.yy896 = yylhsminor.yy896; break; - case 580: /* join_type ::= */ -{ yymsp[1].minor.yy992 = JOIN_TYPE_INNER; } + case 581: /* join_type ::= */ +{ yymsp[1].minor.yy680 = JOIN_TYPE_INNER; } break; - case 581: /* join_type ::= INNER */ -{ yymsp[0].minor.yy992 = JOIN_TYPE_INNER; } + case 582: /* join_type ::= INNER */ +{ yymsp[0].minor.yy680 = JOIN_TYPE_INNER; } break; - case 582: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 583: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-13].minor.yy718 = createSelectStmt(pCxt, yymsp[-11].minor.yy559, yymsp[-9].minor.yy552, yymsp[-8].minor.yy718, yymsp[-12].minor.yy552); - yymsp[-13].minor.yy718 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy718, yymsp[-10].minor.yy559); - yymsp[-13].minor.yy718 = addWhereClause(pCxt, yymsp[-13].minor.yy718, yymsp[-7].minor.yy718); - yymsp[-13].minor.yy718 = addPartitionByClause(pCxt, yymsp[-13].minor.yy718, yymsp[-6].minor.yy552); - yymsp[-13].minor.yy718 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy718, yymsp[-2].minor.yy718); - yymsp[-13].minor.yy718 = addGroupByClause(pCxt, yymsp[-13].minor.yy718, yymsp[-1].minor.yy552); - yymsp[-13].minor.yy718 = addHavingClause(pCxt, yymsp[-13].minor.yy718, yymsp[0].minor.yy718); - yymsp[-13].minor.yy718 = addRangeClause(pCxt, yymsp[-13].minor.yy718, yymsp[-5].minor.yy718); - yymsp[-13].minor.yy718 = addEveryClause(pCxt, yymsp[-13].minor.yy718, yymsp[-4].minor.yy718); - yymsp[-13].minor.yy718 = addFillClause(pCxt, yymsp[-13].minor.yy718, yymsp[-3].minor.yy718); + yymsp[-13].minor.yy896 = createSelectStmt(pCxt, yymsp[-11].minor.yy733, yymsp[-9].minor.yy404, yymsp[-8].minor.yy896, yymsp[-12].minor.yy404); + yymsp[-13].minor.yy896 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy896, yymsp[-10].minor.yy733); + yymsp[-13].minor.yy896 = addWhereClause(pCxt, yymsp[-13].minor.yy896, yymsp[-7].minor.yy896); + yymsp[-13].minor.yy896 = addPartitionByClause(pCxt, yymsp[-13].minor.yy896, yymsp[-6].minor.yy404); + yymsp[-13].minor.yy896 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy896, yymsp[-2].minor.yy896); + yymsp[-13].minor.yy896 = addGroupByClause(pCxt, yymsp[-13].minor.yy896, yymsp[-1].minor.yy404); + yymsp[-13].minor.yy896 = addHavingClause(pCxt, yymsp[-13].minor.yy896, yymsp[0].minor.yy896); + yymsp[-13].minor.yy896 = addRangeClause(pCxt, yymsp[-13].minor.yy896, yymsp[-5].minor.yy896); + yymsp[-13].minor.yy896 = addEveryClause(pCxt, yymsp[-13].minor.yy896, yymsp[-4].minor.yy896); + yymsp[-13].minor.yy896 = addFillClause(pCxt, yymsp[-13].minor.yy896, yymsp[-3].minor.yy896); } break; - case 583: /* hint_list ::= */ -{ yymsp[1].minor.yy552 = createHintNodeList(pCxt, NULL); } + case 584: /* hint_list ::= */ +{ yymsp[1].minor.yy404 = createHintNodeList(pCxt, NULL); } break; - case 584: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy552 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 585: /* hint_list ::= NK_HINT */ +{ yylhsminor.yy404 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 589: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy559 = false; } + case 590: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy733 = false; } break; - case 592: /* select_item ::= NK_STAR */ -{ yylhsminor.yy718 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy718 = yylhsminor.yy718; + case 593: /* select_item ::= NK_STAR */ +{ yylhsminor.yy896 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy896 = yylhsminor.yy896; break; - case 594: /* select_item ::= common_expression column_alias */ - case 604: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==604); -{ yylhsminor.yy718 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718), &yymsp[0].minor.yy965); } - yymsp[-1].minor.yy718 = yylhsminor.yy718; + case 595: /* select_item ::= common_expression column_alias */ + case 605: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==605); +{ yylhsminor.yy896 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy896), &yymsp[0].minor.yy701); } + yymsp[-1].minor.yy896 = yylhsminor.yy896; break; - case 595: /* select_item ::= common_expression AS column_alias */ - case 605: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==605); -{ yylhsminor.yy718 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), &yymsp[0].minor.yy965); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 596: /* select_item ::= common_expression AS column_alias */ + case 606: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==606); +{ yylhsminor.yy896 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), &yymsp[0].minor.yy701); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 600: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 630: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==630); - case 650: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==650); -{ yymsp[-2].minor.yy552 = yymsp[0].minor.yy552; } + case 601: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 631: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==631); + case 651: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==651); +{ yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } break; - case 607: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy718 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } + case 608: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy896 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), releaseRawExprNode(pCxt, yymsp[-1].minor.yy896)); } break; - case 608: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy718 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } + case 609: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy896 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy896)); } break; - case 609: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy718 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 610: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy896 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), NULL, yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 610: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy718 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } + case 611: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy896 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy896), releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), yymsp[-1].minor.yy896, yymsp[0].minor.yy896); } break; - case 611: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy718 = createEventWindowNode(pCxt, yymsp[-3].minor.yy718, yymsp[0].minor.yy718); } + case 612: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy896 = createEventWindowNode(pCxt, yymsp[-3].minor.yy896, yymsp[0].minor.yy896); } break; - case 612: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy718 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 613: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy896 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 613: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy718 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 614: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy896 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 620: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy718 = createFillNode(pCxt, yymsp[-1].minor.yy206, NULL); } + case 621: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy896 = createFillNode(pCxt, yymsp[-1].minor.yy466, NULL); } break; - case 621: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy718 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } + case 622: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy896 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 622: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy718 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } + case 623: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy896 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 623: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy206 = FILL_MODE_NONE; } + case 624: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy466 = FILL_MODE_NONE; } break; - case 624: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy206 = FILL_MODE_PREV; } + case 625: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy466 = FILL_MODE_PREV; } break; - case 625: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy206 = FILL_MODE_NULL; } + case 626: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy466 = FILL_MODE_NULL; } break; - case 626: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy206 = FILL_MODE_NULL_F; } + case 627: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy466 = FILL_MODE_NULL_F; } break; - case 627: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy206 = FILL_MODE_LINEAR; } + case 628: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy466 = FILL_MODE_LINEAR; } break; - case 628: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy206 = FILL_MODE_NEXT; } + case 629: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy466 = FILL_MODE_NEXT; } break; - case 631: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy552 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[0].minor.yy552 = yylhsminor.yy552; + case 632: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 632: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy552 = yylhsminor.yy552; + case 633: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy896))); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 636: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy718 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } + case 637: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy896 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy896), releaseRawExprNode(pCxt, yymsp[-1].minor.yy896)); } break; - case 637: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy718 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } + case 638: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy896 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy896)); } break; - case 640: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 641: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy718 = addOrderByClause(pCxt, yymsp[-3].minor.yy718, yymsp[-2].minor.yy552); - yylhsminor.yy718 = addSlimitClause(pCxt, yylhsminor.yy718, yymsp[-1].minor.yy718); - yylhsminor.yy718 = addLimitClause(pCxt, yylhsminor.yy718, yymsp[0].minor.yy718); + yylhsminor.yy896 = addOrderByClause(pCxt, yymsp[-3].minor.yy896, yymsp[-2].minor.yy404); + yylhsminor.yy896 = addSlimitClause(pCxt, yylhsminor.yy896, yymsp[-1].minor.yy896); + yylhsminor.yy896 = addLimitClause(pCxt, yylhsminor.yy896, yymsp[0].minor.yy896); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 643: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy718 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy718, yymsp[0].minor.yy718); } - yymsp[-3].minor.yy718 = yylhsminor.yy718; + case 644: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy896 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy896, yymsp[0].minor.yy896); } + yymsp[-3].minor.yy896 = yylhsminor.yy896; break; - case 644: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy718 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 645: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy896 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy896, yymsp[0].minor.yy896); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 652: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 656: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==656); -{ yymsp[-1].minor.yy718 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 653: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 657: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==657); +{ yymsp[-1].minor.yy896 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 653: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 657: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==657); -{ yymsp[-3].minor.yy718 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 654: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 658: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==658); +{ yymsp[-3].minor.yy896 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 654: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 658: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==658); -{ yymsp[-3].minor.yy718 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 655: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 659: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==659); +{ yymsp[-3].minor.yy896 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 659: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy718); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 660: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy896 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy896); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 664: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy718 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), yymsp[-1].minor.yy576, yymsp[0].minor.yy345); } - yymsp[-2].minor.yy718 = yylhsminor.yy718; + case 665: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy896 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy896), yymsp[-1].minor.yy918, yymsp[0].minor.yy669); } + yymsp[-2].minor.yy896 = yylhsminor.yy896; break; - case 665: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy576 = ORDER_ASC; } + case 666: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy918 = ORDER_ASC; } break; - case 666: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy576 = ORDER_ASC; } + case 667: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy918 = ORDER_ASC; } break; - case 667: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy576 = ORDER_DESC; } + case 668: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy918 = ORDER_DESC; } break; - case 668: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy345 = NULL_ORDER_DEFAULT; } + case 669: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy669 = NULL_ORDER_DEFAULT; } break; - case 669: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy345 = NULL_ORDER_FIRST; } + case 670: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy669 = NULL_ORDER_FIRST; } break; - case 670: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy345 = NULL_ORDER_LAST; } + case 671: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy669 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parAlterToBalanceTest.cpp b/source/libs/parser/test/parAlterToBalanceTest.cpp index bac5574f18..84be1e92d0 100644 --- a/source/libs/parser/test/parAlterToBalanceTest.cpp +++ b/source/libs/parser/test/parAlterToBalanceTest.cpp @@ -337,7 +337,7 @@ TEST_F(ParserInitialATest, alterDatabaseSemanticCheck) { run("ALTER DATABASE test PAGES 63", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 0", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 3", TSDB_CODE_PAR_INVALID_DB_OPTION); - run("ALTER DATABASE test REPLICA 2", TSDB_CODE_PAR_INVALID_DB_OPTION); + //run("ALTER DATABASE test REPLICA 2", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test STT_TRIGGER 0", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test STT_TRIGGER 17", TSDB_CODE_PAR_INVALID_DB_OPTION); // Regardless of the specific sentence diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 793f8914dc..1e2f3c53af 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2096,6 +2096,13 @@ static bool eliminateProjOptMayBeOptimized(SLogicNode* pNode) { TSDB_SUPER_TABLE == ((SScanLogicNode*)nodesListGetNode(pNode->pChildren, 0))->tableType)) { return false; } + + if (QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL == nodeType(nodesListGetNode(pNode->pChildren, 0))) { + SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pNode->pChildren, 0); + if(LIST_LENGTH(pChild->pTargets) != LIST_LENGTH(pNode->pTargets)) { + return false; + } + } SProjectLogicNode* pProjectNode = (SProjectLogicNode*)pNode; if (NULL != pProjectNode->node.pLimit || NULL != pProjectNode->node.pSlimit || diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index a072ee1f6f..5f6440c06d 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -1128,7 +1128,11 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) { } if ((*pTask)->exec.pWalReader != NULL) { - entry.processedVer = (*pTask)->chkInfo.nextProcessVer - 1; + entry.processedVer = walReaderGetCurrentVer((*pTask)->exec.pWalReader) - 1; + if (entry.processedVer < 0) { + entry.processedVer = (*pTask)->chkInfo.processedVer; + } + walReaderValidVersionRange((*pTask)->exec.pWalReader, &entry.verStart, &entry.verEnd); } diff --git a/source/libs/sync/inc/syncCommit.h b/source/libs/sync/inc/syncCommit.h index 07b4702b1b..e6b54ea86b 100644 --- a/source/libs/sync/inc/syncCommit.h +++ b/source/libs/sync/inc/syncCommit.h @@ -53,6 +53,8 @@ bool syncNodeAgreedUpon(SSyncNode* pNode, SyncIndex index); int64_t syncNodeUpdateCommitIndex(SSyncNode* ths, SyncIndex commitIndex); int64_t syncNodeCheckCommitIndex(SSyncNode* ths, SyncIndex indexLikely); +int64_t syncNodeUpdateAssignedCommitIndex(SSyncNode* ths, SyncIndex assignedCommitIndex); + #ifdef __cplusplus } #endif diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 637c18e97d..3d8588a55a 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -160,6 +160,13 @@ typedef struct SSyncNode { SSyncLogStore* pLogStore; SyncIndex commitIndex; + // assigned leader log vars + SyncIndex assignedCommitIndex; + + SyncTerm arbTerm; + TdThreadMutex arbTokenMutex; + char arbToken[TSDB_ARB_TOKEN_SIZE]; + // timer ms init int32_t pingBaseLine; int32_t electBaseLine; @@ -219,6 +226,7 @@ typedef struct SSyncNode { int32_t electNum; int32_t becomeLeaderNum; + int32_t becomeAssignedLeaderNum; int32_t configChangeNum; int32_t hbSlowNum; int32_t hbrSlowNum; @@ -282,10 +290,12 @@ void syncNodeStepDown(SSyncNode* pSyncNode, SyncTerm newTerm); void syncNodeBecomeFollower(SSyncNode* pSyncNode, const char* debugStr); void syncNodeBecomeLearner(SSyncNode* pSyncNode, const char* debugStr); void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr); +void syncNodeBecomeAssignedLeader(SSyncNode* pSyncNode); void syncNodeCandidate2Leader(SSyncNode* pSyncNode); void syncNodeFollower2Candidate(SSyncNode* pSyncNode); void syncNodeLeader2Follower(SSyncNode* pSyncNode); void syncNodeCandidate2Follower(SSyncNode* pSyncNode); +int32_t syncNodeAssignedLeader2Leader(SSyncNode* pSyncNode); // raft vote -------------- void syncNodeVoteForTerm(SSyncNode* pSyncNode, SyncTerm term, SRaftId* pRaftId); diff --git a/source/libs/sync/inc/syncUtil.h b/source/libs/sync/inc/syncUtil.h index 39c679a2ad..a550ae8fbb 100644 --- a/source/libs/sync/inc/syncUtil.h +++ b/source/libs/sync/inc/syncUtil.h @@ -78,6 +78,8 @@ void syncUtilMsgHtoN(void* msg); bool syncUtilUserPreCommit(tmsg_t msgType); bool syncUtilUserRollback(tmsg_t msgType); +void syncUtilGenerateArbToken(int32_t nodeId, int32_t groupId, char* buf); + void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...); void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dflag, SSyncSnapshotSender* pSender, const char* format, ...); diff --git a/source/libs/sync/src/syncAppendEntriesReply.c b/source/libs/sync/src/syncAppendEntriesReply.c index 7c343c0e5d..ede4dc07e1 100644 --- a/source/libs/sync/src/syncAppendEntriesReply.c +++ b/source/libs/sync/src/syncAppendEntriesReply.c @@ -55,7 +55,7 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { return 0; } - if (ths->state == TAOS_SYNC_STATE_LEADER) { + if (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (pMsg->term > raftStoreGetTerm(ths)) { syncLogRecvAppendEntriesReply(ths, pMsg, "error term"); syncNodeStepDown(ths, pMsg->term); @@ -76,7 +76,27 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { // commit if needed SyncIndex indexLikely = TMIN(pMsg->matchIndex, ths->pLogBuf->matchIndex); SyncIndex commitIndex = syncNodeCheckCommitIndex(ths, indexLikely); - (void)syncLogBufferCommit(ths->pLogBuf, ths, commitIndex); + if (ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + if (commitIndex >= ths->assignedCommitIndex) { + terrno = TSDB_CODE_SUCCESS; + raftStoreNextTerm(ths); + if (terrno != TSDB_CODE_SUCCESS) { + sError("vgId:%d, failed to update term, reason:%s", ths->vgId, tstrerror(terrno)); + return -1; + } + if (syncNodeAssignedLeader2Leader(ths) != 0) { + sError("vgId:%d, failed to change state from assigned leader to leader", ths->vgId); + return -1; + } + + taosThreadMutexLock(&ths->arbTokenMutex); + syncUtilGenerateArbToken(ths->myNodeInfo.nodeId, ths->vgId, ths->arbToken); + sInfo("vgId:%d, assigned leader to leader, arbToken:%s", ths->vgId, ths->arbToken); + taosThreadMutexUnlock(&ths->arbTokenMutex); + } + } else { + (void)syncLogBufferCommit(ths->pLogBuf, ths, commitIndex); + } } // replicate log diff --git a/source/libs/sync/src/syncCommit.c b/source/libs/sync/src/syncCommit.c index 47e4049c73..3c401a978b 100644 --- a/source/libs/sync/src/syncCommit.c +++ b/source/libs/sync/src/syncCommit.c @@ -88,3 +88,11 @@ int64_t syncNodeCheckCommitIndex(SSyncNode* ths, SyncIndex indexLikely) { } return ths->commitIndex; } + +int64_t syncNodeUpdateAssignedCommitIndex(SSyncNode* ths, SyncIndex assignedCommitIndex) { + SyncIndex lastVer = ths->pLogStore->syncLogLastIndex(ths->pLogStore); + assignedCommitIndex = TMAX(assignedCommitIndex, ths->assignedCommitIndex); + ths->assignedCommitIndex = TMIN(assignedCommitIndex, lastVer); + ths->pLogStore->syncLogUpdateCommitIndex(ths->pLogStore, ths->assignedCommitIndex); + return ths->commitIndex; +} diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 7ff6116137..da18bbdea2 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -173,7 +173,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { syncNodeUpdateNewConfigIndex(pSyncNode, pNewCfg); syncNodeDoConfigChange(pSyncNode, pNewCfg, pNewCfg->lastIndex); - if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state == TAOS_SYNC_STATE_LEADER || pSyncNode->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { syncNodeStopHeartbeatTimer(pSyncNode); for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { @@ -235,6 +235,9 @@ int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg) { case TDMT_SYNC_FORCE_FOLLOWER: code = syncForceBecomeFollower(pSyncNode, pMsg); break; + case TDMT_SYNC_SET_ASSIGNED_LEADER: + code = syncBecomeAssignedLeader(pSyncNode, pMsg); + break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; code = -1; @@ -271,6 +274,86 @@ int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg) { return 0; } +int32_t syncBecomeAssignedLeader(SSyncNode* ths, SRpcMsg* pRpcMsg) { + int32_t ret = -1; + + SVArbSetAssignedLeaderReq req = {0}; + if (tDeserializeSVArbSetAssignedLeaderReq((char*)pRpcMsg->pCont + sizeof(SMsgHead), pRpcMsg->contLen, &req) != 0) { + sError("vgId:%d, failed to deserialize SVArbSetAssignedLeaderReq", ths->vgId); + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + int32_t errcode = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + + if (ths->arbTerm > req.arbTerm) { + sInfo("vgId:%d, skip to set assigned leader, msg with lower term, local:%" PRId64 "msg:%" PRId64, ths->vgId, + ths->arbTerm, req.arbTerm); + goto _OVER; + } + + ths->arbTerm = TMAX(req.arbTerm, ths->arbTerm); + + if (strncmp(req.memberToken, ths->arbToken, TSDB_ARB_TOKEN_SIZE) == 0) { + if (ths->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { + raftStoreNextTerm(ths); + if (terrno != TSDB_CODE_SUCCESS) { + sError("vgId:%d, failed to set next term since:%s", ths->vgId, terrstr()); + goto _OVER; + } + syncNodeBecomeAssignedLeader(ths); + + if (syncNodeAppendNoop(ths) < 0) { + sError("vgId:%d, assigned leader failed to append noop entry since %s", ths->vgId, terrstr()); + } + } + errcode = TSDB_CODE_SUCCESS; + } else { + sInfo("vgId:%d, skip to set assigned leader, token mismatch, local:%s, msg:%s", ths->vgId, ths->arbToken, + req.memberToken); + goto _OVER; + } + + SVArbSetAssignedLeaderRsp rsp = {0}; + rsp.arbToken = req.arbToken; + rsp.memberToken = req.memberToken; + rsp.vgId = ths->vgId; + + int32_t contLen = tSerializeSVArbSetAssignedLeaderRsp(NULL, 0, &rsp); + if (contLen <= 0) { + sError("vgId:%d, failed to serialize SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + void* pHead = rpcMallocCont(contLen); + if (!pHead) { + sError("vgId:%d, failed to malloc memory for SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + if (tSerializeSVArbSetAssignedLeaderRsp(pHead, contLen, &rsp) <= 0) { + sError("vgId:%d, failed to serialize SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pHead); + goto _OVER; + } + + SRpcMsg rspMsg = { + .code = errcode, + .pCont = pHead, + .contLen = contLen, + .info = pRpcMsg->info, + }; + + tmsgSendRsp(&rspMsg); + + ret = 0; + +_OVER: + tFreeSVArbSetAssignedLeaderReq(&req); + return ret; +} + int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) { SSyncNode* pNode = syncNodeAcquire(rid); if (pNode == NULL) return -1; @@ -342,7 +425,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) { if (pSyncNode->totalReplicaNum > 1) { if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_FOLLOWER && - pSyncNode->state != TAOS_SYNC_STATE_LEARNER) { + pSyncNode->state != TAOS_SYNC_STATE_LEARNER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { sNTrace(pSyncNode, "new-snapshot-index:%" PRId64 " candidate or unknown state, do not delete wal", lastApplyIndex); syncNodeRelease(pSyncNode); @@ -434,7 +517,7 @@ bool syncNodeIsReadyForRead(SSyncNode* pSyncNode) { return false; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; return false; } @@ -562,6 +645,55 @@ SSyncState syncGetState(int64_t rid) { return state; } +int32_t syncGetArbToken(int64_t rid, char* outToken) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + memset(outToken, 0, TSDB_ARB_TOKEN_SIZE); + taosThreadMutexLock(&pSyncNode->arbTokenMutex); + strncpy(outToken, pSyncNode->arbToken, TSDB_ARB_TOKEN_SIZE); + taosThreadMutexUnlock(&pSyncNode->arbTokenMutex); + + terrno = TSDB_CODE_SUCCESS; + syncNodeRelease(pSyncNode); + return 0; +} + +int32_t syncGetAssignedLogSynced(int64_t rid) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + terrno = TSDB_CODE_VND_ARB_NOT_SYNCED; + syncNodeRelease(pSyncNode); + return 0; + } + + bool isSync = pSyncNode->commitIndex >= pSyncNode->assignedCommitIndex; + terrno = (isSync ? TSDB_CODE_SUCCESS : TSDB_CODE_VND_ARB_NOT_SYNCED); + + syncNodeRelease(pSyncNode); + return 0; +} + +int32_t syncUpdateArbTerm(int64_t rid, SyncTerm arbTerm) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + pSyncNode->arbTerm = TMAX(arbTerm, pSyncNode->arbTerm); + syncNodeRelease(pSyncNode); + return 0; +} + SyncIndex syncNodeGetSnapshotConfigIndex(SSyncNode* pSyncNode, SyncIndex snapshotLastApplyIndex) { ASSERT(pSyncNode->raftCfg.configIndexCount >= 1); SyncIndex lastIndex = (pSyncNode->raftCfg.configIndexArr)[0]; @@ -668,8 +800,21 @@ ESyncRole syncGetRole(int64_t rid) { return role; } +int64_t syncGetTerm(int64_t rid) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + sError("sync Node Acquire error since %d", errno); + return -1; + } + + int64_t term = raftStoreGetTerm(pSyncNode); + + syncNodeRelease(pSyncNode); + return term; +} + int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; sNWarn(pSyncNode, "sync propose not leader, type:%s", TMSG_INFO(pMsg->msgType)); return -1; @@ -683,7 +828,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_ } // heartbeat timeout - if (syncNodeHeartbeatReplyTimeout(pSyncNode)) { + if (pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER && syncNodeHeartbeatReplyTimeout(pSyncNode)) { terrno = TSDB_CODE_SYN_PROPOSE_NOT_READY; sNError(pSyncNode, "failed to sync propose since heartbeat timeout, type:%s, last:%" PRId64 ", cmt:%" PRId64, TMSG_INFO(pMsg->msgType), syncNodeGetLastIndex(pSyncNode), pSyncNode->commitIndex); @@ -916,6 +1061,11 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { goto _error; } + pSyncNode->arbTerm = -1; + taosThreadMutexInit(&pSyncNode->arbTokenMutex, NULL); + syncUtilGenerateArbToken(pSyncNode->myNodeInfo.nodeId, pSyncInfo->vgId, pSyncNode->arbToken); + sInfo("vgId:%d, arb token:%s", pSyncNode->vgId, pSyncNode->arbToken); + // init peersNum, peers, peersId pSyncNode->peersNum = pSyncNode->raftCfg.cfg.totalReplicaNum - 1; int32_t j = 0; @@ -1064,9 +1214,9 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { pSyncNode->heartbeatTimerMS = pSyncNode->hbBaseLine; atomic_store_64(&pSyncNode->heartbeatTimerLogicClock, 0); atomic_store_64(&pSyncNode->heartbeatTimerLogicClockUser, 0); -#ifdef BUILD_NO_CALL +#ifdef BUILD_NO_CALL pSyncNode->FpHeartbeatTimerCB = syncNodeEqHeartbeatTimer; -#endif +#endif pSyncNode->heartbeatTimerCounter = 0; // init peer heartbeat timer @@ -1138,6 +1288,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { pSyncNode->isStart = true; pSyncNode->electNum = 0; pSyncNode->becomeLeaderNum = 0; + pSyncNode->becomeAssignedLeaderNum = 0; pSyncNode->configChangeNum = 0; pSyncNode->hbSlowNum = 0; pSyncNode->hbrSlowNum = 0; @@ -1305,6 +1456,8 @@ void syncNodeClose(SSyncNode* pSyncNode) { syncLogBufferDestroy(pSyncNode->pLogBuf); pSyncNode->pLogBuf = NULL; + taosThreadMutexDestroy(&pSyncNode->arbTokenMutex); + for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { if (pSyncNode->senders[i] != NULL) { sDebug("vgId:%d, snapshot sender destroy while close, data:%p", pSyncNode->vgId, pSyncNode->senders[i]); @@ -1906,6 +2059,66 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { sNInfo(pSyncNode, "become leader %s", debugStr); } +void syncNodeBecomeAssignedLeader(SSyncNode* pSyncNode) { + pSyncNode->becomeAssignedLeaderNum++; + pSyncNode->hbrSlowNum = 0; + + // reset restoreFinish + //pSyncNode->restoreFinish = false; + + // state change + pSyncNode->state = TAOS_SYNC_STATE_ASSIGNED_LEADER; + pSyncNode->roleTimeMs = taosGetTimestampMs(); + + // set leader cache + pSyncNode->leaderCache = pSyncNode->myRaftId; + + for (int32_t i = 0; i < pSyncNode->pNextIndex->replicaNum; ++i) { + SyncIndex lastIndex; + SyncTerm lastTerm; + int32_t code = syncNodeGetLastIndexTerm(pSyncNode, &lastIndex, &lastTerm); + ASSERT(code == 0); + pSyncNode->pNextIndex->index[i] = lastIndex + 1; + } + + for (int32_t i = 0; i < pSyncNode->pMatchIndex->replicaNum; ++i) { + // maybe overwrite myself, no harm + // just do it! + pSyncNode->pMatchIndex->index[i] = SYNC_INDEX_INVALID; + } + + // init peer mgr + syncNodePeerStateInit(pSyncNode); + + // close receiver + if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + snapshotReceiverStop(pSyncNode->pNewNodeReceiver); + } + + // stop elect timer + syncNodeStopElectTimer(pSyncNode); + + // start heartbeat timer + syncNodeStartHeartbeatTimer(pSyncNode); + + // send heartbeat right now + syncNodeHeartbeatPeers(pSyncNode); + + // call back + if (pSyncNode->pFsm != NULL && pSyncNode->pFsm->FpBecomeAssignedLeaderCb != NULL) { + pSyncNode->pFsm->FpBecomeAssignedLeaderCb(pSyncNode->pFsm); + } + + // min match index + pSyncNode->minMatchIndex = SYNC_INDEX_INVALID; + + // reset log buffer + syncLogBufferReset(pSyncNode->pLogBuf, pSyncNode); + + // trace log + sNInfo(pSyncNode, "become assigned leader"); +} + void syncNodeCandidate2Leader(SSyncNode* pSyncNode) { ASSERT(pSyncNode->state == TAOS_SYNC_STATE_CANDIDATE); bool granted = voteGrantedMajority(pSyncNode->pVotesGranted); @@ -1972,6 +2185,24 @@ void syncNodeCandidate2Follower(SSyncNode* pSyncNode) { } #endif +int32_t syncNodeAssignedLeader2Leader(SSyncNode* pSyncNode) { + ASSERT(pSyncNode->state == TAOS_SYNC_STATE_ASSIGNED_LEADER); + syncNodeBecomeLeader(pSyncNode, "assigned leader to leader"); + + sNTrace(pSyncNode, "assigned leader to leader"); + + int32_t ret = syncNodeAppendNoop(pSyncNode); + if (ret < 0) { + sError("vgId:%d, failed to append noop entry since %s", pSyncNode->vgId, terrstr()); + } + + SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); + sInfo("vgId:%d, become leader from assigned leader. term:%" PRId64 ", commit index:%" PRId64 + "assigned commit index:%" PRId64 ", last index:%" PRId64, + pSyncNode->vgId, raftStoreGetTerm(pSyncNode), pSyncNode->commitIndex, pSyncNode->assignedCommitIndex, lastIndex); + return 0; +} + // just called by syncNodeVoteForSelf // need assert void syncNodeVoteForTerm(SSyncNode* pSyncNode, SyncTerm term, SRaftId* pRaftId) { @@ -2291,7 +2522,7 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) { return; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { syncNodeRelease(pSyncNode); syncHbTimerDataRelease(pData); sError("vgId:%d, hb timer sync node not leader", pSyncNode->vgId); @@ -2426,7 +2657,8 @@ int32_t syncNodeCheckChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry) { SSyncCfg cfg = {0}; syncBuildConfigFromReq(&req, &cfg); - if (cfg.totalReplicaNum >= 1 && ths->state == TAOS_SYNC_STATE_LEADER) { + if (cfg.totalReplicaNum >= 1 && + (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER)) { bool incfg = false; for (int32_t j = 0; j < cfg.totalReplicaNum; ++j) { if (strcmp(ths->myNodeInfo.nodeFqdn, cfg.nodeInfo[j].nodeFqdn) == 0 && @@ -2934,6 +3166,16 @@ _out:; ths->vgId, pEntry->index, pEntry->term, ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex); + if (code == 0 && ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + (void)syncNodeUpdateAssignedCommitIndex(ths, matchIndex); + + if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE && + syncLogBufferCommit(ths->pLogBuf, ths, ths->assignedCommitIndex) < 0) { + sError("vgId:%d, failed to commit until commitIndex:%" PRId64 "", ths->vgId, ths->commitIndex); + code = -1; + } + } + // multi replica if (ths->replicaNum > 1) { return code; @@ -3080,7 +3322,8 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { currentTerm = pMsg->term; } - if (pMsg->term == currentTerm && ths->state != TAOS_SYNC_STATE_LEADER) { + if (pMsg->term == currentTerm && + (ths->state != TAOS_SYNC_STATE_LEADER && ths->state != TAOS_SYNC_STATE_ASSIGNED_LEADER)) { syncIndexMgrSetRecvTime(ths->pNextIndex, &(pMsg->srcId), tsMs); resetElect = true; @@ -3109,7 +3352,8 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } } - if (pMsg->term >= currentTerm && ths->state == TAOS_SYNC_STATE_LEADER) { + if (pMsg->term >= currentTerm && + (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER)) { SRpcMsg rpcMsgLocalCmd = {0}; (void)syncBuildLocalCmd(&rpcMsgLocalCmd, ths->vgId); @@ -3239,7 +3483,7 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn return -1; } - if (ths->state == TAOS_SYNC_STATE_LEADER) { + if (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (pRetIndex) { (*pRetIndex) = index; } @@ -3288,6 +3532,8 @@ const char* syncStr(ESyncState state) { return "offline"; case TAOS_SYNC_STATE_LEARNER: return "learner"; + case TAOS_SYNC_STATE_ASSIGNED_LEADER: + return "assigned leader"; default: return "unknown"; } diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 70bdd4a837..d40fff447f 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -484,7 +484,7 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p taosMsleep(1); goto _out; } - + if(pEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE){ if(pNode->pLogBuf->commitIndex == pEntry->index -1){ sInfo("vgId:%d, to change config at %s. " @@ -492,7 +492,7 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p "node, restore:%d, commitIndex:%" PRId64 ", " "cond: (pre entry index:%" PRId64 "== buf commit index:%" PRId64 ")", pNode->vgId, str, - pEntry->index, pEntry->term, + pEntry->index, pEntry->term, pNode->restoreFinish, pNode->commitIndex, pEntry->index - 1, pNode->pLogBuf->commitIndex); if(syncNodeChangeConfig(pNode, pEntry, str) != 0){ @@ -507,9 +507,9 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p "node, commitIndex:%" PRId64 ", pBuf: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " "cond:( pre entry index:%" PRId64" != buf commit index:%" PRId64 ")", pNode->vgId, str, - pEntry->index, pEntry->term, + pEntry->index, pEntry->term, pNode->commitIndex, pNode->pLogBuf->startIndex, pNode->pLogBuf->commitIndex, - pNode->pLogBuf->matchIndex, pNode->pLogBuf->endIndex, + pNode->pLogBuf->matchIndex, pNode->pLogBuf->endIndex, pEntry->index - 1, pNode->pLogBuf->commitIndex); } } @@ -653,8 +653,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm "current entry, index:%" PRId64 ", term:%" PRId64", " "node, role:%d, current term:%" PRId64 ", restore:%d, " "cond, next entry index:%" PRId64 ", msgType:%s", - vgId, - pEntry->index, pEntry->term, + vgId, + pEntry->index, pEntry->term, role, currentTerm, pNode->restoreFinish, pNextEntry->index, TMSG_INFO(pNextEntry->originalRpcType)); @@ -685,12 +685,12 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm syncEntryDestroy(pNextEntry); pNextEntry = NULL; } - } - + } + if (!inBuf) { syncEntryDestroy(pEntry); pEntry = NULL; - } + } } // recycle diff --git a/source/libs/sync/src/syncReplication.c b/source/libs/sync/src/syncReplication.c index 2c7fc70ae9..9312719be7 100644 --- a/source/libs/sync/src/syncReplication.c +++ b/source/libs/sync/src/syncReplication.c @@ -64,7 +64,8 @@ int32_t syncNodeReplicate(SSyncNode* pNode) { } int32_t syncNodeReplicateWithoutLock(SSyncNode* pNode) { - if (pNode->state != TAOS_SYNC_STATE_LEADER || pNode->raftCfg.cfg.totalReplicaNum == 1) { + if ((pNode->state != TAOS_SYNC_STATE_LEADER && pNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) || + pNode->raftCfg.cfg.totalReplicaNum == 1) { return -1; } for (int32_t i = 0; i < pNode->totalReplicaNum; i++) { diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index d9c8bb21ac..5c1f8739bd 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -1242,7 +1242,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, SRpcMsg *pRpcMsg) { goto _ERROR; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { sSError(pSender, "snapshot sender not leader"); terrno = TSDB_CODE_SYN_NOT_LEADER; goto _ERROR; diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index a57dfbee53..dbbd914041 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -77,7 +77,8 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { for (int i = 0; i < ths->peersNum; ++i) { SSyncSnapshotSender* pSender = syncNodeGetSnapshotSender(ths, &(ths->peersId[i])); if (pSender != NULL) { - if (ths->isStart && ths->state == TAOS_SYNC_STATE_LEADER && pSender->start) { + if (ths->isStart && (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) && + pSender->start) { int64_t elapsedMs = timeNow - pSender->lastSendTime; if (elapsedMs < SYNC_SNAP_RESEND_MS) { continue; diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 2ce56af946..93a06ddf30 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -44,7 +44,7 @@ void syncUtilNodeInfo2EpSet(const SNodeInfo* pInfo, SEpSet* pEpSet) { bool syncUtilNodeInfo2RaftId(const SNodeInfo* pInfo, SyncGroupId vgId, SRaftId* raftId) { uint32_t ipv4 = 0xFFFFFFFF; sDebug("vgId:%d, start to resolve sync addr fqdn in %d seconds, " - "dnode:%d cluster:%" PRId64 " fqdn:%s port:%u ", + "dnode:%d cluster:%" PRId64 " fqdn:%s port:%u ", vgId, tsResolveFQDNRetryTime, pInfo->nodeId, pInfo->clusterId, pInfo->nodeFqdn, pInfo->nodePort); for(int i = 0; i < tsResolveFQDNRetryTime; i++){ @@ -57,7 +57,7 @@ bool syncUtilNodeInfo2RaftId(const SNodeInfo* pInfo, SyncGroupId vgId, SRaftId* break; } } - + if (ipv4 == 0xFFFFFFFF || ipv4 == 1) { sError("failed to resolve ipv4 addr, fqdn:%s", pInfo->nodeFqdn); terrno = TSDB_CODE_TSC_INVALID_FQDN; @@ -103,6 +103,13 @@ bool syncUtilUserPreCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && bool syncUtilUserRollback(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } +void syncUtilGenerateArbToken(int32_t nodeId, int32_t groupId, char* buf) { + memset(buf, 0, TSDB_ARB_TOKEN_SIZE); + int32_t randVal = taosSafeRand() % 1000; + int64_t currentMs = taosGetTimestampMs(); + snprintf(buf, TSDB_ARB_TOKEN_SIZE, "d%d#g%d#%" PRId64 "#%d", nodeId, groupId, currentMs, randVal); +} + // for leader static void syncHearbeatReplyTime2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; @@ -221,19 +228,22 @@ void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNo SyncIndex appliedIndex = pNode->pFsm->FpAppliedIndexCb(pNode->pFsm); if (pNode != NULL) { - taosPrintLog(flags, level, dflag, - "vgId:%d, %s, sync:%s, term:%" PRIu64 ", commit-index:%" PRId64 ", applied-index:%" PRId64 - ", first-ver:%" PRId64 ", last-ver:%" PRId64 ", min:%" PRId64 ", snap:%" PRId64 ", snap-term:%" PRIu64 - ", elect-times:%d, as-leader-times:%d, cfg-ch-times:%d, hb-slow:%d, hbr-slow:%d, " - "aq-items:%d, snaping:%" PRId64 ", replicas:%d, last-cfg:%" PRId64 - ", chging:%d, restore:%d, quorum:%d, elect-lc-timer:%" PRId64 ", hb:%" PRId64 - ", buffer:%s, repl-mgrs:%s, members:%s, hb:%s, hb-reply:%s", - pNode->vgId, eventLog, syncStr(pNode->state), currentTerm, pNode->commitIndex, appliedIndex, - logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm, - pNode->electNum, pNode->becomeLeaderNum, pNode->configChangeNum, pNode->hbSlowNum, pNode->hbrSlowNum, - aqItems, pNode->snapshottingIndex, pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, - pNode->restoreFinish, syncNodeDynamicQuorum(pNode), pNode->electTimerLogicClock, - pNode->heartbeatTimerLogicClockUser, bufferStatesStr, replMgrStatesStr, cfgStr, hbTimeStr, hbrTimeStr); + taosPrintLog( + flags, level, dflag, + "vgId:%d, %s, sync:%s, term:%" PRIu64 ", commit-index:%" PRId64 ", assigned-index:%" PRId64 + ", applied-index:%" PRId64 ", first-ver:%" PRId64 ", last-ver:%" PRId64 ", min:%" PRId64 ", snap:%" PRId64 + ", snap-term:%" PRIu64 + ", elect-times:%d, as-leader-times:%d, as-assigned-leader-times:%d, cfg-ch-times:%d, hb-slow:%d, hbr-slow:%d, " + "aq-items:%d, snaping:%" PRId64 ", replicas:%d, last-cfg:%" PRId64 + ", chging:%d, restore:%d, quorum:%d, elect-lc-timer:%" PRId64 ", hb:%" PRId64 + ", buffer:%s, repl-mgrs:%s, members:%s, hb:%s, hb-reply:%s", + pNode->vgId, eventLog, syncStr(pNode->state), currentTerm, pNode->commitIndex, pNode->assignedCommitIndex, + appliedIndex, logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, + snapshot.lastApplyTerm, pNode->electNum, pNode->becomeLeaderNum, pNode->becomeAssignedLeaderNum, + pNode->configChangeNum, pNode->hbSlowNum, pNode->hbrSlowNum, aqItems, pNode->snapshottingIndex, + pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, pNode->restoreFinish, + syncNodeDynamicQuorum(pNode), pNode->electTimerLogicClock, pNode->heartbeatTimerLogicClockUser, bufferStatesStr, + replMgrStatesStr, cfgStr, hbTimeStr, hbrTimeStr); } } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 1a1a8c1848..6df9bf0e16 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -254,6 +254,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_SNODE_ALREADY_EXIST, "Snode can only be cre TAOS_DEFINE_ERROR(TSDB_CODE_MND_SNODE_NOT_EXIST, "Snode not there") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_FEW_MNODES, "The replica of mnode cannot less than 1") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_MNODES, "The replica of mnode cannot exceed 3") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARBGROUP_ALREADY_EXIST, "Arbitrator group already exists") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARBGROUP_NOT_EXIST, "Arbitrator group not there") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARB_TOKEN_MISMATCH, "Arbitrator token mismatch") // mnode-dnode-part2 TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_DNODES, "Too many dnodes") @@ -368,6 +371,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NOT_CATCH_UP, "Vnode didn't catch up TAOS_DEFINE_ERROR(TSDB_CODE_VND_ALREADY_IS_VOTER, "Vnode already is a voter") TAOS_DEFINE_ERROR(TSDB_CODE_VND_DIR_ALREADY_EXIST, "Vnode directory already exist") TAOS_DEFINE_ERROR(TSDB_CODE_VND_META_DATA_UNSAFE_DELETE, "Single replica vnode data will lost permanently after this operation, if you make sure this, please use drop dnode unsafe to execute") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_ARB_NOT_SYNCED, "Vgroup peer is not synced") // tsdb TAOS_DEFINE_ERROR(TSDB_CODE_TDB_INVALID_TABLE_ID, "Invalid table ID") @@ -709,7 +713,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TMQ_REPLAY_NOT_SUPPORT, "Replay is disabled TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_NOT_EXIST, "Stream task not exist") TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_EXEC_CANCELLED, "Stream task exec cancelled") TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_INVALID_STATETRANS, "Invalid task state to handle event") -TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_IVLD_STATUS,"Invalid task status to proceed") +TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_IVLD_STATUS, "Invalid task status to proceed") // TDLite TAOS_DEFINE_ERROR(TSDB_CODE_TDLITE_IVLD_OPEN_FLAGS, "Invalid TDLite open flags") diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index eae02125d2..16ca1b64c3 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -41,6 +41,12 @@ #define LOG_BUF_SIZE(x) ((x)->buffSize) #define LOG_BUF_MUTEX(x) ((x)->buffMutex) +#ifdef TD_ENTERPRISE +#define LOG_EDITION_FLG ("E") +#else +#define LOG_EDITION_FLG ("C") +#endif + typedef struct { char *buffer; int32_t buffStart; @@ -490,8 +496,9 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) { time_t curTime = timeSecs.tv_sec; ptm = taosLocalTime(&curTime, &Tm, NULL); - return sprintf(buffer, "%02d/%02d %02d:%02d:%02d.%06d %08" PRId64 " %s", ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, - ptm->tm_min, ptm->tm_sec, (int32_t)timeSecs.tv_usec, taosGetSelfPthreadId(), flags); + return sprintf(buffer, "%02d/%02d %02d:%02d:%02d.%06d %08" PRId64 " %s %s", ptm->tm_mon + 1, ptm->tm_mday, + ptm->tm_hour, ptm->tm_min, ptm->tm_sec, (int32_t)timeSecs.tv_usec, taosGetSelfPthreadId(), + LOG_EDITION_FLG, flags); } static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *buffer, int32_t len) { diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index 09b34a97d0..60899bc1c8 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -1,4 +1,4 @@ -import sys +import sys from util.log import * from util.cases import * from util.sql import * @@ -9,14 +9,14 @@ class TDTestCase: def caseDescription(self): ''' case1: [TD-21890] table count scan test case - ''' + ''' return - + def init(self, conn, logSql, replicaVer=1): tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor(), True) self._conn = conn - + def restartTaosd(self, index=1, dbname="db"): tdDnodes.stop(index) tdDnodes.startWithoutSleep(index) @@ -65,7 +65,7 @@ class TDTestCase: tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 29) + tdSql.checkData(0, 0, 30) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 3) @@ -77,7 +77,7 @@ class TDTestCase: tdSql.query('select count(1) v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 29) + tdSql.checkData(0, 0, 30) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -93,7 +93,7 @@ class TDTestCase: tdSql.checkData(1, 1, 'performance_schema') tdSql.checkData(0, 0, 3) tdSql.checkData(0, 1, 'tbl_count') - tdSql.checkData(2, 0, 29) + tdSql.checkData(2, 0, 30) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -106,7 +106,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 37) + tdSql.checkData(0, 0, 38) tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') @@ -189,7 +189,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 29) + tdSql.checkData(3, 0, 30) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -204,7 +204,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 29) + tdSql.checkData(3, 0, 30) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -215,7 +215,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'tbl_count') tdSql.checkData(1, 0, 5) tdSql.checkData(1, 1, 'performance_schema') - tdSql.checkData(2, 0, 29) + tdSql.checkData(2, 0, 30) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -228,7 +228,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 38) + tdSql.checkData(0, 0, 39) tdSql.execute('drop database tbl_count') diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 851fe2679b..2402f6a94a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -591,6 +591,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4348-td-27939.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/backslash_g.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/test_ts4467.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/geometry.py ,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index 92074161b6..d1ffaaca92 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -115,13 +115,17 @@ class TDSql: else: tdLog.info("sql:%s, check passed, no ErrInfo occurred" % (sql)) - def error(self, sql, expectedErrno = None, expectErrInfo = None, fullMatched = True): + def error(self, sql, expectedErrno = None, expectErrInfo = None, fullMatched = True, show = False): caller = inspect.getframeinfo(inspect.stack()[1][0]) expectErrNotOccured = True + if show: + tdLog.info("sql:%s" % (sql)) + try: self.cursor.execute(sql) except BaseException as e: + tdLog.info("err:%s" % (e)) expectErrNotOccured = False self.errno = e.errno error_info = repr(e) @@ -161,7 +165,10 @@ class TDSql: return self.error_info - def query(self, sql, row_tag=None, queryTimes=10, count_expected_res=None): + def query(self, sql, row_tag=None, queryTimes=10, count_expected_res=None, show = False): + if show: + tdLog.info("sql:%s" % (sql)) + self.sql = sql i=1 while i <= queryTimes: diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index abba824e82..71aa763662 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -362,7 +362,7 @@ if $data4_db != 1 then return -1 endi sql drop database db -sql_error create database db REPLICA 2 +#sql_error create database db REPLICA 2 sql_error create database db REPLICA 0 sql_error create database db REPLICA -1 sql_error create database db REPLICA 4 diff --git a/tests/script/tsim/query/sys_tbname.sim b/tests/script/tsim/query/sys_tbname.sim index 9069ad949c..65f96ebc66 100644 --- a/tests/script/tsim/query/sys_tbname.sim +++ b/tests/script/tsim/query/sys_tbname.sim @@ -52,13 +52,13 @@ if $data00 != @ins_stables@ then endi sql select * from information_schema.ins_tables where table_name=''; -if $rows != 0 then +if $rows != 0 then return -1 endi sql select tbname from information_schema.ins_tables; print $rows $data00 -if $rows != 38 then +if $rows != 39 then return -1 endi if $data00 != @ins_tables@ then diff --git a/tests/script/tsim/query/tableCount.sim b/tests/script/tsim/query/tableCount.sim index 573e134133..b8ffc3a41d 100644 --- a/tests/script/tsim/query/tableCount.sim +++ b/tests/script/tsim/query/tableCount.sim @@ -36,7 +36,7 @@ sql create table tba2 using sta tags(2, 2, 2); sql create table tbb1 using stb tags(4, 4, 4); sql create table tbb2 using stb tags(5, 5, 5); sql create table tbb3 using stb tags(6, 6, 6); - + sql select count(table_name) from information_schema.ins_tables group by stable_name; if $rows != 3 then return -1 @@ -53,7 +53,7 @@ sql select stable_name,count(table_name) from information_schema.ins_tables grou if $rows != 3 then return -1 endi -if $data01 != 35 then +if $data01 != 36 then return -1 endi if $data11 != 10 then @@ -72,7 +72,7 @@ endi if $data11 != 5 then return -1 endi -if $data21 != 29 then +if $data21 != 30 then return -1 endi if $data31 != 5 then @@ -97,7 +97,7 @@ endi if $data42 != 3 then return -1 endi -if $data52 != 29 then +if $data52 != 30 then return -1 endi if $data62 != 5 then diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index a7995762d8..63718417b4 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -19,6 +19,8 @@ from util.common import * from util.sqlset import * class TDTestCase: + updatecfgDict = {'qDebugFlag':135 , 'mDebugFlag':135} + def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug("start to execute %s" % __file__) @@ -58,7 +60,7 @@ class TDTestCase: self.ins_list = ['ins_dnodes','ins_mnodes','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views', - 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines'] + 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups'] self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] def insert_data(self,column_dict,tbname,row_num): insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str) diff --git a/tests/system-test/1-insert/insert_column_value.py b/tests/system-test/1-insert/insert_column_value.py index 49b77f4199..fcb83e2f97 100644 --- a/tests/system-test/1-insert/insert_column_value.py +++ b/tests/system-test/1-insert/insert_column_value.py @@ -1,5 +1,6 @@ -import datetime +import datetime, time from enum import Enum +import binascii from util.log import * from util.sql import * from util.cases import * @@ -45,24 +46,56 @@ class TDTestCase: tdSql.init(conn.cursor()) tdSql.execute(f'drop database if exists db') tdSql.execute(f'create database if not exists db vgroups 1') + tdLog.printNoPrefix("create table") + self.__create_tb() def __create_tb(self, dbname="db"): - CREATE_STB_LIST = [ f"create table {dbname}.stb_vc (ts timestamp, c0 binary(50), c1 varchar(50)) tags(t0 varchar(50), t1 binary(50));", + CREATE_STB_LIST = [ f"create table {dbname}.stb_vc (ts timestamp, c0 varchar(50), c1 varchar(50)) tags(t0 varchar(50), t1 varchar(50));", f"create table {dbname}.stb_nc (ts timestamp, c0 nchar(50), c1 nchar(50)) tags(t0 nchar(50), t1 nchar(50));", + f"create table {dbname}.stb_bi (ts timestamp, c0 binary(50), c1 binary(50)) tags(t0 binary(50), t1 binary(50));", f"create table {dbname}.stb_ts (ts timestamp, c0 timestamp, c1 timestamp) tags(t0 timestamp, t1 timestamp);", f"create table {dbname}.stb_bo (ts timestamp, c0 bool, c1 bool) tags(t0 bool, t1 bool);", f"create table {dbname}.stb_vb (ts timestamp, c0 varbinary(50), c1 varbinary(50)) tags(t0 varbinary(50), t1 varbinary(50));", - f"create table {dbname}.stb_in (ts timestamp, c0 int, c1 smallint) tags(t0 bigint, t1 tinyint);", - f"create table {dbname}.stb_ui (ts timestamp, c0 int unsigned, c1 smallint unsigned) tags(t0 bigint unsigned, t1 tinyint unsigned);", + f"create table {dbname}.stb_in (ts timestamp, c0 int, c1 int) tags(t0 int, t1 int);", + f"create table {dbname}.stb_ui (ts timestamp, c0 int unsigned, c1 int unsigned) tags(t0 int unsigned, t1 int unsigned);", + f"create table {dbname}.stb_bin (ts timestamp, c0 bigint, c1 bigint) tags(t0 bigint, t1 bigint);", + f"create table {dbname}.stb_bui (ts timestamp, c0 bigint unsigned, c1 bigint unsigned) tags(t0 bigint unsigned, t1 bigint unsigned);", + f"create table {dbname}.stb_sin (ts timestamp, c0 smallint, c1 smallint) tags(t0 smallint, t1 smallint);", + f"create table {dbname}.stb_sui (ts timestamp, c0 smallint unsigned, c1 smallint unsigned) tags(t0 smallint unsigned, t1 smallint unsigned);", + f"create table {dbname}.stb_tin (ts timestamp, c0 tinyint, c1 tinyint) tags(t0 tinyint, t1 tinyint);", + f"create table {dbname}.stb_tui (ts timestamp, c0 tinyint unsigned, c1 tinyint unsigned) tags(t0 tinyint unsigned, t1 tinyint unsigned);", f"create table {dbname}.stb_fl (ts timestamp, c0 float, c1 float) tags(t0 float, t1 float);", - f"create table {dbname}.stb_db (ts timestamp, c0 float, c1 float) tags(t0 float, t1 float);", + f"create table {dbname}.stb_db (ts timestamp, c0 double, c1 double) tags(t0 double, t1 double);", f"create table {dbname}.stb_ge (ts timestamp, c0 geometry(512), c1 geometry(512)) tags(t0 geometry(512), t1 geometry(512));", - f"create table {dbname}.stb_js (ts timestamp, c0 int) tags(t0 json);" ] + f"create table {dbname}.stb_js (ts timestamp, c0 int) tags(t0 json);"] + + CREATE_NTB_LIST = [ f"create table {dbname}.ntb_vc (ts timestamp, c0 binary(50), c1 varchar(50));", + f"create table {dbname}.ntb_nc (ts timestamp, c0 nchar(50), c1 nchar(50));", + f"create table {dbname}.ntb_bi (ts timestamp, c0 binary(50), c1 binary(50));", + f"create table {dbname}.ntb_ts (ts timestamp, c0 timestamp, c1 timestamp);", + f"create table {dbname}.ntb_bo (ts timestamp, c0 bool, c1 bool);", + f"create table {dbname}.ntb_vb (ts timestamp, c0 varbinary(50), c1 varbinary(50));", + f"create table {dbname}.ntb_in (ts timestamp, c0 int, c1 int);", + f"create table {dbname}.ntb_ui (ts timestamp, c0 int unsigned, c1 int unsigned);", + f"create table {dbname}.ntb_bin (ts timestamp, c0 bigint, c1 bigint);", + f"create table {dbname}.ntb_bui (ts timestamp, c0 bigint unsigned, c1 bigint unsigned);", + f"create table {dbname}.ntb_sin (ts timestamp, c0 smallint, c1 smallint);", + f"create table {dbname}.ntb_sui (ts timestamp, c0 smallint unsigned, c1 smallint unsigned);", + f"create table {dbname}.ntb_tin (ts timestamp, c0 tinyint, c1 tinyint);", + f"create table {dbname}.ntb_tui (ts timestamp, c0 tinyint unsigned, c1 tinyint unsigned);", + f"create table {dbname}.ntb_fl (ts timestamp, c0 float, c1 float);", + f"create table {dbname}.ntb_db (ts timestamp, c0 double, c1 double);", + f"create table {dbname}.ntb_ge (ts timestamp, c0 geometry(512), c1 geometry(512));"] for _stb in CREATE_STB_LIST: tdSql.execute(_stb) tdSql.query(f'show {dbname}.stables') tdSql.checkRows(len(CREATE_STB_LIST)) + for _stb in CREATE_NTB_LIST: + tdSql.execute(_stb) + tdSql.query(f'show {dbname}.tables') + tdSql.checkRows(len(CREATE_NTB_LIST)) + def _query_check_varchar(self, result, okv, nv, row = 0, col = 0): for i in range(row): for j in range(1, col): @@ -146,25 +179,62 @@ class TDTestCase: check_result = True tdSql.checkEqual(check_result, True) + def _query_check_varbinary(self, result, okv, nv, row = 0, col = 0): + tdLog.info(f'[okv={okv}, nv={nv}') + for i in range(row): + for j in range(1, col): + check_result = False + if result[i][j]: + check_item = result[i][j].decode('utf-8') + else: + check_item = '' + # new_nv = None - def _query_check(self, dbname="db", stbname="", ctbname="", nRows = 0, okv = None, nv = None, dtype = TDDataType.NULL): + if nv[0:1] == '\'' or nv[0:1] == '\"': + nv = nv[1:-1] + if okv[0:1] == '\'' or okv[0:1] == '\"': + okv = okv[1:-1] + + # if nv[0:2] == '\\x' or nv[0:2] == '\\X': + # nv = nv[1:] + # elif nv == '' or nv =="": + # new_nv = nv + # elif nv.isspace(): + # new_nv = nv + # else: + # hex_text = binascii.hexlify(nv.encode()) + # new_nv = '/x' + hex_text.decode().upper() + # tdLog.info(f"okv={okv}, nv={nv}, check_item={check_item}") + if check_item == None: + check_item = 'null' + if check_item in okv or check_item in nv: + check_result = True + tdSql.checkEqual(check_result, True) + + def _query_check(self, dbname="db", stbname="", ctbname="", ntbname="",nRows = 0, okv = None, nv = None, dtype = TDDataType.NULL): result = None - if dtype != TDDataType.GEOMETRY: # geometry query by py connector need to be supported - tdSql.query(f'select * from {dbname}.{stbname}') + if stbname: + if dtype != TDDataType.GEOMETRY: # geometry query by py connector need to be supported + tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.checkRows(nRows) + result = tdSql.queryResult + else: + tdSql.query(f'select * from {dbname}.{ntbname}') tdSql.checkRows(nRows) result = tdSql.queryResult + - if dtype == TDDataType.VARCHAR or dtype == TDDataType.NCHAR: + if dtype == TDDataType.VARCHAR or dtype == TDDataType.NCHAR or dtype == TDDataType.BINARY: self._query_check_varchar(result, okv, nv, nRows, 4) elif dtype == TDDataType.TIMESTAMP: self._query_check_timestamp(result, okv, nv, nRows, 4) elif dtype == TDDataType.BOOL: self._query_check_bool(result, okv, nv, nRows, 4) elif dtype == TDDataType.VARBINARY: - pass - elif dtype == TDDataType.INT: + self._query_check_varbinary(result, okv, nv, nRows, 4) + elif dtype == TDDataType.INT or dtype == TDDataType.BIGINT or dtype == TDDataType.SMALLINT or dtype == TDDataType.TINYINT: self._query_check_int(result, okv, nv, nRows, 4) - elif dtype == TDDataType.UINT: + elif dtype == TDDataType.UINT or dtype == TDDataType.UBIGINT or dtype == TDDataType.USMALLINT or dtype == TDDataType.UTINYINT: self._query_check_int(result, okv, nv, nRows, 4) elif dtype == TDDataType.FLOAT or dtype == TDDataType.DOUBLE: self._query_check_int(result, okv, nv, nRows, 4) @@ -176,75 +246,138 @@ class TDTestCase: if ctbname != "": tdSql.execute(f'drop table {dbname}.{ctbname}') - def __insert_query_common(self, dbname="db", stbname="", ctbname="", oklist=[], kolist=[], okv=None, dtype = TDDataType.NULL): - tdLog.info(f'{dbname}.{stbname} {ctbname}, oklist:%d, kolist:%d'%(len(oklist), len(kolist))) - tdSql.checkEqual(34, len(oklist) + len(kolist)) + def __insert_query_common(self, dbname="db", stbname="", ctbname="", ntbname="", oklist=[], kolist=[], okv=None, dtype = TDDataType.NULL): + tdLog.info(f'[Begin]{dbname}.{stbname} {ctbname}, oklist:%d, kolist:%d, TDDataType:%s'%(len(oklist), len(kolist), dtype)) + # tdSql.checkEqual(34, len(oklist) + len(kolist)) for _l in kolist: for _e in _l: - tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) - tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s)' %(_e)) - tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s)' %(_e, _e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s) values(now, {okv}, {okv})' %(_e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv}) values(now, {okv}, {okv})' %(_e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, {okv})' %(_e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, %s)' %(_e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, %s)' %(_e, _e)) - tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, {okv})') - self._query_check(dbname,stbname, "", 1, okv, _e, dtype) - tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}') - tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) - tdSql.error(f'alter table {dbname}.{ctbname} set tag t1 = %s' %(_e)) + # tdLog.info(f'[ko:verify value "{_e}"]') + # create sub-table manually, check tag + tdLog.info('[ko:create sub-table manually, check tag]') + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e), show=True) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s)' %(_e), show=True) + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s)' %(_e, _e), show=True) + + # create sub-table automatically, check tag + tdLog.info('[ko:create sub-table automatically, check tag]') + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s) values(now, {okv}, {okv})' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv}) values(now, {okv}, {okv})' %(_e), show=True) + + # create sub-table automatically, check value + tdLog.info('[ko:create sub-table automatically, check value]') + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, {okv})' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, %s)' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, %s, %s)' %(_e, _e), show=True) + + # check alter table tag + tdLog.info('[ko:check alter table tag]') + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, {okv}) values(now, {okv}, {okv})', show=True) + # self._query_check(dbname,stbname, "", None, 1, okv, _e, dtype) + # tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}', show=True) + tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e), show=True) + tdSql.error(f'alter table {dbname}.{ctbname} set tag t1 = %s' %(_e), show=True) tdSql.execute(f'drop table {dbname}.{ctbname}') + + # insert into value by supper-table, check tag & value + tdLog.info('[ko:insert into value by supper-table, check tag & value]') + tdSql.error(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_1", %s, {okv}, now, {okv}, {okv})' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_2", {okv},{okv}, now + 1s, {okv}, %s)' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_3", %s, %s, now + 2s, %s, %s)' %(_e, _e, _e, _e), show=True) + + # insert into normal table, check value + tdLog.info('[ko:insert into normal table, check value]') + tdSql.error(f'insert into {dbname}.{ntbname} values(now, %s, {okv})' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ntbname} values(now, {okv}, %s)' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ntbname} values(now, %s, %s)' %(_e, _e), show=True) + for _l in oklist: for _e in _l: - tdLog.info(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) - tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv})' %(_e)) - tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 0s, %s, {okv})' %(_e)) - tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 1s, {okv}, %s)' %(_e)) - tdSql.execute(f'insert into {dbname}.{ctbname} values(now + 2s, %s, %s)' %(_e, _e)) - tdLog.info(f'insert into {dbname}.{ctbname} values(now + 0s, %s, {okv})' %(_e)) - tdLog.info(f'insert into {dbname}.{ctbname} values(now + 1s, {okv}, %s)' %(_e)) - tdLog.info(f'insert into {dbname}.{ctbname} values(now + 2s, %s, %s)' %(_e, _e)) - tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) - tdSql.execute(f'alter table {dbname}.{ctbname} set tag t1 = %s' %(_e)) - self._query_check(dbname,stbname, ctbname, 3, okv, _e, dtype) - tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s)' %(_e, _e)) - tdSql.execute(f'insert into {dbname}.{ctbname} values(now, %s, %s)' %(_e, _e)) - self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) - tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, {okv}) values(now, %s, {okv})' %(_e, _e)) - self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) - tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}, %s) values(now, {okv}, %s)' %(_e, _e)) - self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) - tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s, %s) values(now, %s, %s)' %(_e, _e, _e, _e)) - self._query_check(dbname,stbname, ctbname, 1, okv, _e, dtype) + tdLog.info(f'[ok:verify value "{_e}"]') + # 1. create sub-table manually, check tag + tdLog.info('[ok:create sub-table manually, check tag]') + tdSql.execute(f'create table {dbname}.{ctbname}_1 using {dbname}.{stbname} tags({_e}, {okv})', show=True) + tdSql.execute(f'create table {dbname}.{ctbname}_2 using {dbname}.{stbname} tags({okv}, %s)' %(_e), show=True) + tdSql.execute(f'create table {dbname}.{ctbname}_3 using {dbname}.{stbname} tags(%s, %s)' %(_e, _e), show=True) + + + # 1.1 insert into sub-table, check value + tdLog.info('[ok:insert into sub-table, check value]') + tdSql.execute(f'insert into {dbname}.{ctbname}_1 values(now + 0s, %s, {okv})' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname}_2 values(now + 1s, {okv}, %s)' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname}_3 values(now + 2s, %s, %s)' %(_e, _e), show=True) + + # 1.2 check alter table tag + tdLog.info('[ok:check alter table tag]') + tdSql.execute(f'alter table {dbname}.{ctbname}_1 set tag t1 = %s' %(_e), show=True) + tdSql.execute(f'alter table {dbname}.{ctbname}_2 set tag t0 = %s' %(_e), show=True) + + # 1.3 check table data + tdLog.info('[ok:check table data]') + self._query_check(dbname, stbname, f'{ctbname}_1', None, 3, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_2', None, 2, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_3', None, 1, okv, _e, dtype) + + # 2. insert into value by creating sub-table automatically, check tag & value + tdLog.info('[ok:insert into value by creating sub-table automatically, check tag & value]') + tdSql.execute(f'insert into {dbname}.{ctbname}_1 using {dbname}.{stbname} tags(%s, {okv}) values(now, %s, {okv})' %(_e, _e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname}_2 using {dbname}.{stbname} tags({okv}, %s) values(now + 1s, {okv}, %s)' %(_e, _e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname}_3 using {dbname}.{stbname} tags(%s, %s) values(now + 2s, %s, %s)' %(_e, _e, _e, _e), show=True) + + self._query_check(dbname, stbname, f'{ctbname}_1', None, 3, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_2', None, 2, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_3', None, 1, okv, _e, dtype) + + # 3. insert into value by supper-table, check tag & value + tdLog.info('[ok:insert into value by supper-table, check tag & value]') + tdSql.execute(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_1", %s, {okv}, now, %s, {okv})' %(_e, _e), show=True) + tdSql.execute(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_2", {okv}, %s, now + 1s, {okv}, %s)' %(_e, _e), show=True) + tdSql.execute(f'insert into {dbname}.{stbname}(tbname, t0, t1, ts, c0, c1) values("{ctbname}_3", %s, %s, now + 2s, %s, %s)' %(_e, _e, _e, _e), show=True) + + self._query_check(dbname, stbname, f'{ctbname}_1', None, 3, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_2', None, 2, okv, _e, dtype) + self._query_check(dbname, stbname, f'{ctbname}_3', None, 1, okv, _e, dtype) + + # 4. insert value into normal table + tdLog.info('[ok:insert value into normal table]') + tdSql.execute(f'insert into {dbname}.{ntbname} values(now, %s, {okv})' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ntbname} values(now + 1s, {okv}, %s)' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ntbname} values(now + 2s, %s, %s)' %(_e, _e), show=True) + + if dtype != TDDataType.GEOMETRY: + # self._query_check(dbname, None, None, ntbname, 3, okv, _e, dtype) + tdSql.query(f'select * from {dbname}.{ntbname}') + tdSql.checkRows(3) + tdSql.query(f'delete from {dbname}.{ntbname}') def __insert_query_json(self, dbname="db", stbname="", ctbname="", oklist=[], kolist=[], okv=None): tdLog.info(f'{dbname}.{stbname} {ctbname}, oklist:%d, kolist:%d'%(len(oklist), len(kolist))) - tdSql.checkEqual(34, len(oklist) + len(kolist)) + # tdSql.checkEqual(34, len(oklist) + len(kolist)) for _l in kolist: for _e in _l: - tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e)) - tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s) values(now, 1)' %(_e)) - tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}) values(now, 1)') - tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.error(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e), show=True) + tdSql.error(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags(%s) values(now, 1)' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname} using {dbname}.{stbname} tags({okv}) values(now, 1)', show=True) + tdSql.query(f'select * from {dbname}.{stbname}', show=True) tdSql.checkRows(1) - tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}') - tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) - tdSql.execute(f'drop table {dbname}.{ctbname}') + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = {okv}', show=True) + tdSql.error(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e), show=True) + tdSql.execute(f'drop table {dbname}.{ctbname}', show=True) for _l in oklist: for _e in _l: - tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e)) - tdSql.execute(f'insert into {dbname}.{ctbname} values(now, 1)') - tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e)) - tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.execute(f'create table {dbname}.{ctbname} using {dbname}.{stbname} tags(%s)' %(_e), show=True) + tdSql.execute(f'insert into {dbname}.{ctbname} values(now, 1)', show=True) + tdSql.execute(f'alter table {dbname}.{ctbname} set tag t0 = %s' %(_e), show=True) + tdSql.query(f'select * from {dbname}.{stbname}', show=True) tdSql.checkRows(1) - tdSql.execute(f'drop table {dbname}.{ctbname}') - + tdSql.execute(f'drop table {dbname}.{ctbname}', show=True) + def __insert_query_exec(self): STR_EMPTY = ['\'\'', "\"\"", '\' \'', "\" \""] - STR_INTEGER_P = ["\"42\"", '\'+42\'', '\'+0\'', '\'-0\'', '\'0x2A\'', '\'-0X0\'', '\'+0x0\'', '\'0B00101010\'', '\'-0b00\''] + STR_CHINESE = ['\'年年岁岁,花相似\''] + STR_CHINESE_ILLEGAL = ['\'洛阳城东桃李花,飞来飞去落谁家。幽闺女儿爱颜色,坐见落花长叹息。今岁花开君不待。明年花开复谁在。故人不共洛阳东,今来空对落花风。年年岁岁花相似,岁岁年年人不同\''] + STR_INTEGER_P = ["\"42\"", '\'+42\'', '\'+0\'', '\'1\'','\'-0\'', '\'0x2A\'', '\'-0X0\'', '\'+0x0\'', '\'0B00101010\'', '\'-0b00\''] STR_INTEGER_M = ['\'-128\'', '\'-0X1\'', '\"-0x34\"', '\'-0b01\'', '\'-0B00101010\''] STR_FLOAT_P = ['\'42.1\'', "\"+0.003\"", "\'-0.0\'"] STR_FLOAT_M = ["\"-32.001\""] @@ -259,18 +392,32 @@ class TDTestCase: STR_TSKP_MISC = ['\'now()+1s\'', '\' now()\'', '\'now( )\'', '\'today() \'', '\'today())\'', '\'today()+1m\'', '\'today()-1w\''] STR_BOOL = ['\'true\'', '\'false\'', '\'TRUE\'', '\'FALSE\'', '\'tRuE\'', '\'falsE\''] STR_TS = ["\"2024-02-01 00:00:01.001-08:00\"", "\'2024-02-01T00:00:01.001+09:00\'", "\"2024-02-01\"", "\'2024-02-02 00:00:01\'", "\'2024-02-02 00:00:01.009\'"] - STR_VARBIN = ['\'\\x12\'', '\'\\x13\'', '\' \\x14 \'', '\'\\x12ab\''] + STR_TS_ILLEGAL = ["\"2023-2024-02-01 00:00:01.001-08:00\"", "\'2024-02-01T99:00:01.001+09:00\'", "\"2024-02-31\"", "\'2024-02-02 00:88:01\'", "\'2024-02-02 00:00:77.009\'"] + STR_VARBIN = ["\'\x12\'", "\'\x13\'", "\' \x14 \'", "\'\x12ab\'"] STR_JSON_O = ['\'{\"k1\":\"v1\"}\'', '\' {} \''] - STR_JSON_A = ['\'[]\''] - STR_GEO = ['\' POINT(1.0 1.0)\'', '\'LINESTRING(1.00 +2.0, 2.1 -3.2, 5.00 5.01) \'', '\'POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))\'' ] + STR_JSON_A = ['\'[]\'', '\"{\'k1\': \'v1\',\'k2\'}\"', '\"{\'k1\': \'v1\'}}\"'] + STR_GEO = ["\' POINT(1.0 1.0)\'", "\'LINESTRING(1.00 +2.0, 2.1 -3.2, 5.00 5.01) \'", "\'POLYGON((1.0 1.0, -2.0 +2.0, 1.0 1.0))\'" ] + STR_GEO_ILLEGAL = ['\' POINT(1.0)\'', '\'LINESTRING(1.00 +2.0, -3.2, 5.00 5.01) \'', '\'POLYGON((-2.0 +2.0, 1.0 1.0))\'' ] STR_NULL = ['\'NuLl\'', '\'null\'', '\'NULL\''] + STR_NONE = ['\'NoNe\'', '\'none\'', '\'NONE\''] + STR_BINARY = ["\'\x7f8290\'", "\'\X7f8290\'", "\'x7f8290\'", "\'\\x\'"] # bug TD-29193 + STR_BINARY_ILLEGAL = ["\'\\x7f829\'"] RAW_INTEGER_P = [' 42 ', '+042 ', ' +0', '0 ', '-0', '0', ' 0X2A', ' -0x0 ', '+0x0 ', ' 0B00101010', ' -0b00'] RAW_INTEGER_M = [' -42 ', ' -0128',' -0x1', ' -0X2A', '-0b01 ', ' -0B00101010 '] + RAW_INTEGER_INT_BOUNDARY_ILLEGAL =['2147483648', '-2147483649'] + RAW_INTEGER_UINT_BOUNDARY_ILLEGAL =['4294967296', '-1'] + RAW_INTEGER_BINT_BOUNDARY_ILLEGAL =['9223372036854775808', '-9223372036854775809'] + RAW_INTEGER_UBINT_BOUNDARY_ILLEGAL =['18446744073709551616', '-1'] + RAW_INTEGER_SINT_BOUNDARY_ILLEGAL =['32768', '-32769'] + RAW_INTEGER_USINT_BOUNDARY_ILLEGAL =['65536', '-1'] + RAW_INTEGER_TINT_BOUNDARY_ILLEGAL =['128', '-129'] + RAW_INTEGER_UTINT_BOUNDARY_ILLEGAL =['256', '-1'] RAW_FLOAT_P = [' 123.012', ' 0.0', ' +0.0', ' -0.0 '] RAW_FLOAT_M = ['-128.001 '] RAW_FLOAT_E_P = [' 1e-100', ' +0.1E+2', ' -0.1E-10'] RAW_FLOAT_E_M = [" -1E2 "] + RAW_FLOAT_E_M_SPE = ["-1e-100"] RAW_MISC = ['123abc', "123c", '-123d', '+', '-', ' *', ' /', '% ', '&', "|", "^", "&&", "||", "!", " =", ' None ', 'NONE', 'now+1 s', 'now-1','now-1y','now+2 d', 'today+1 s', 'today-1','today-1y','today+2 d', 'now()+1 s', 'now()-1','now()-1y','now()+2 d', 'today()+1 s', 'today()-1','today()-1y','today()+2 d'] RAW_OPTR = ['1*10', '1+2', '-2-0','1%2', '2/0', '1&31'] @@ -280,68 +427,97 @@ class TDTestCase: RAW_TSKP_OPTR = [' noW ( ) + 1s', 'nOw( ) + 2D', 'NOW () + 000s', ' today()+1M', 'today( ) - 1w ', 'TodaY ( ) - 1U '] RAW_BOOL = ['true', 'false', ' TRUE ', 'FALSE ', ' tRuE', ' falsE '] RAW_NULL = ['NuLl', 'null ', ' NULL', ' NULL '] + RAW_NONE = ['None', 'none ', ' NoNe', ' NONE '] + RAW_BINARY_ILLEGAL = ['\\x7f8290', '\\X7f8290', 'x7f8290', '\\x', '\\x7f829'] OK_VC = [STR_EMPTY, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, - RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_NULL] - KO_VC = [RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_NULL, STR_CHINESE, STR_NONE] + KO_VC = [RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_CHINESE_ILLEGAL, RAW_NONE] OK_NC = OK_VC KO_NC = KO_VC + OK_BI = OK_VC + KO_BI = KO_VC OK_TS = [STR_TSK, STR_INTEGER_P, STR_INTEGER_M, STR_TSKP, STR_TS, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_TSK, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, RAW_NULL] KO_TS = [STR_EMPTY, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK_MISC, STR_TSKP_MISC, STR_BOOL, STR_VARBIN, - STR_JSON_O, STR_JSON_A, STR_GEO, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_BOOL] + STR_JSON_O, STR_JSON_A, STR_GEO, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_BOOL, STR_CHINESE, STR_NONE, STR_TS_ILLEGAL, + STR_BINARY, RAW_NONE] OK_BO = [STR_BOOL, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M,RAW_BOOL, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] KO_BO = [STR_EMPTY, STR_TSK, STR_TSKP, STR_TS, STR_MISC, STR_OPTR, STR_TSK_MISC, STR_TSKP_MISC, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, - RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, RAW_MISC, RAW_OPTR] + RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, RAW_MISC, RAW_OPTR, STR_CHINESE, STR_NONE, STR_BINARY, RAW_NONE] OK_VB = [STR_EMPTY, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, - STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, STR_NULL, RAW_NULL] - KO_VB = [RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, STR_NULL, RAW_NULL, STR_CHINESE, STR_NONE, STR_BINARY] + KO_VB = [RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, + STR_BINARY_ILLEGAL, STR_BINARY_ILLEGAL, RAW_BINARY_ILLEGAL, RAW_NONE] OK_IN = [STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_NULL, RAW_INTEGER_P, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] - KO_IN = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, - RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] - OK_UI = [STR_INTEGER_P, STR_FLOAT_P, STR_FLOAT_E_P, STR_NULL, RAW_INTEGER_P, RAW_FLOAT_P, RAW_FLOAT_E_P, RAW_NULL] - KO_UI = [STR_EMPTY, STR_MISC, STR_INTEGER_M, STR_FLOAT_M, STR_FLOAT_E_M, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, - STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, RAW_BOOL, RAW_INTEGER_M, RAW_FLOAT_M, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + BASE_KO_IN = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, + RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_CHINESE, STR_NONE, STR_BINARY, RAW_NONE] + KO_IN = BASE_KO_IN + [RAW_INTEGER_INT_BOUNDARY_ILLEGAL] + OK_BIN = OK_IN + KO_BIN = BASE_KO_IN + [RAW_INTEGER_BINT_BOUNDARY_ILLEGAL] + OK_SIN = OK_IN + KO_SIN = BASE_KO_IN + [RAW_INTEGER_SINT_BOUNDARY_ILLEGAL] + OK_TIN = OK_IN + KO_TIN = BASE_KO_IN + [RAW_INTEGER_TINT_BOUNDARY_ILLEGAL] + OK_UI = [STR_INTEGER_P, STR_FLOAT_P, STR_FLOAT_E_P, STR_NULL, RAW_INTEGER_P, RAW_FLOAT_P, RAW_FLOAT_E_P, RAW_NULL, RAW_FLOAT_E_M_SPE] + BASE_KO_UI = [STR_EMPTY, STR_MISC, STR_INTEGER_M, STR_FLOAT_M, STR_FLOAT_E_M, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, + STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, RAW_BOOL, RAW_INTEGER_M, RAW_FLOAT_M, RAW_FLOAT_E_M, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, + STR_CHINESE, STR_NONE, RAW_NONE] + KO_UI = BASE_KO_UI + [RAW_INTEGER_UINT_BOUNDARY_ILLEGAL] + OK_UBINT = OK_UI + KO_UBINT = BASE_KO_UI + [RAW_INTEGER_UBINT_BOUNDARY_ILLEGAL] + OK_USINT = OK_UI + KO_USINT = BASE_KO_UI + [RAW_INTEGER_USINT_BOUNDARY_ILLEGAL] + OK_UTINT = OK_UI + KO_UTINT = BASE_KO_UI + [RAW_INTEGER_UTINT_BOUNDARY_ILLEGAL] OK_FL = [RAW_INTEGER_P, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, STR_NULL, RAW_INTEGER_M, RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, RAW_NULL] KO_FL = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_VARBIN, STR_JSON_O, STR_JSON_A, STR_GEO, RAW_TSK, - RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR] + RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_CHINESE, STR_NONE, STR_BINARY, RAW_NONE] OK_DB = OK_FL KO_DB = KO_FL OK_GE = [STR_GEO, STR_NULL, RAW_NULL] KO_GE = [STR_EMPTY, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_JSON_O, STR_JSON_A, STR_VARBIN, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, RAW_INTEGER_P, RAW_INTEGER_M, - RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M] + RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, STR_CHINESE, STR_NONE, STR_BINARY, STR_GEO_ILLEGAL, RAW_NONE] OK_JS = [STR_EMPTY, STR_JSON_O, STR_NULL, RAW_NULL] KO_JS = [STR_JSON_A, STR_MISC, STR_OPTR, STR_TSK, STR_TSK_MISC, STR_TSKP, STR_TSKP_MISC, STR_BOOL, STR_TS, STR_GEO, STR_VARBIN, RAW_TSK, RAW_BOOL, RAW_MISC, RAW_OPTR, RAW_TSK_OPTR, RAW_TSKP, RAW_TSKP_OPTR, STR_INTEGER_P, STR_INTEGER_M, STR_FLOAT_P, STR_FLOAT_M, STR_FLOAT_E_P, STR_FLOAT_E_M, RAW_INTEGER_P, RAW_INTEGER_M, - RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M] + RAW_FLOAT_P, RAW_FLOAT_M, RAW_FLOAT_E_P, RAW_FLOAT_E_M, STR_CHINESE, STR_NONE, STR_BINARY, RAW_NONE] + TEST = [["' POINT(1.0 1.0)'"]] PARAM_LIST = [ - ["db", "stb_vc", "ctb_vc", OK_VC, KO_VC, "\'vc\'", TDDataType.VARCHAR], - ["db", "stb_nc", "ctb_nc", OK_NC, KO_NC, "\'nc\'", TDDataType.NCHAR], - ["db", "stb_ts", "ctb_ts", OK_TS, KO_TS, "now", TDDataType.TIMESTAMP], - ["db", "stb_bo", "ctb_bo", OK_BO, KO_BO, "true", TDDataType.BOOL], - ["db", "stb_vb", "ctb_vb", OK_VB, KO_VB, "\'\\x12\'", TDDataType.VARBINARY], - ["db", "stb_in", "ctb_in", OK_IN, KO_IN, "-1", TDDataType.UINT], - ["db", "stb_ui", "ctb_ui", OK_UI, KO_UI, "1", TDDataType.UINT], - ["db", "stb_fl", "ctb_fl", OK_FL, KO_FL, "1.0", TDDataType.FLOAT], - ["db", "stb_db", "ctb_db", OK_DB, KO_DB, "1.0", TDDataType.DOUBLE], - ["db", "stb_ge", "ctb_ge", OK_GE, KO_GE, "\'POINT(1.0 1.0)\'", TDDataType.GEOMETRY] + ["db", "stb_vc", "ctb_vc", "ntb_vc", OK_VC, KO_VC, "\'vc\'", TDDataType.VARCHAR], + ["db", "stb_nc", "ctb_nc", "ntb_nc", OK_NC, KO_NC, "\'nc\'", TDDataType.NCHAR], + ["db", "stb_bi", "ctb_bi", "ntb_bi", OK_BI, KO_BI, "\'bi\'", TDDataType.BINARY], + ["db", "stb_ts", "ctb_ts", "ntb_ts", OK_TS, KO_TS, "now", TDDataType.TIMESTAMP], + ["db", "stb_bo", "ctb_bo", "ntb_bo", OK_BO, KO_BO, "true", TDDataType.BOOL], + ["db", "stb_vb", "ctb_vb", "ntb_vb", OK_VB, KO_VB, "'hello'", TDDataType.VARBINARY], + + ["db", "stb_in", "ctb_in", "ntb_in", OK_IN, KO_IN, "-1", TDDataType.INT], + ["db", "stb_ui", "ctb_ui", "ntb_ui", OK_UI, KO_UI, "1", TDDataType.UINT], + ["db", "stb_bin", "ctb_bin", "ntb_bin", OK_BIN, KO_BIN, "-1", TDDataType.BIGINT], + ["db", "stb_bui", "ctb_bui", "ntb_bui", OK_UBINT, KO_UBINT, "1", TDDataType.UBIGINT], + ["db", "stb_sin", "ctb_sin", "ntb_sin", OK_SIN, KO_SIN, "-1", TDDataType.SMALLINT], + ["db", "stb_sui", "ctb_sui", "ntb_sui", OK_USINT, KO_USINT, "1", TDDataType.USMALLINT], + ["db", "stb_tin", "ctb_tin", "ntb_tin", OK_TIN, KO_TIN, "-1", TDDataType.TINYINT], + ["db", "stb_tui", "ctb_tui", "ntb_tui", OK_UTINT, KO_UTINT, "1", TDDataType.UTINYINT], + + ["db", "stb_fl", "ctb_fl", "ntb_fl", OK_FL, KO_FL, "1.0", TDDataType.FLOAT], + ["db", "stb_db", "ctb_db", "ntb_db", OK_DB, KO_DB, "1.0", TDDataType.DOUBLE], + ["db", "stb_ge", "ctb_ge", "ntb_ge", TEST, KO_GE, "\'POINT(100.0 100.0)\'", TDDataType.GEOMETRY] ] # check with common function for _pl in PARAM_LIST: - self.__insert_query_common(_pl[0], _pl[1], _pl[2], _pl[3], _pl[4], _pl[5], _pl[6]) + self.__insert_query_common(_pl[0], _pl[1], _pl[2], _pl[3], _pl[4], _pl[5], _pl[6], _pl[7]) # check json self.__insert_query_json("db", "stb_js", "ctb_js", OK_JS, KO_JS, "\'{\"k1\":\"v1\",\"k2\":\"v2\"}\'") def run(self): - tdLog.printNoPrefix("==========step1:create table") - self.__create_tb() self.__insert_query_exec() diff --git a/tests/system-test/2-query/geometry.py b/tests/system-test/2-query/geometry.py index e430b62fb2..057795743d 100644 --- a/tests/system-test/2-query/geometry.py +++ b/tests/system-test/2-query/geometry.py @@ -171,6 +171,25 @@ class TDTestCase: for i in range(tdSql.queryRows): tdSql.checkData(i, 0, expectedResults[5][i+1]) + def test_td28365(self): + # verify TD-28365 + tdSql.execute("create database db2;") + tdSql.execute("use db2;") + tdSql.execute("create table st (ts timestamp, c1 int) tags(id int, location geometry(512));") + tdSql.execute("create table ct1 using st tags(1, 'POINT (3.000000 6.000000)')") + tdSql.execute("insert into ct1 values(now, 1)") + tdSql.execute("create table ct2 using st tags(2, 'LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)')") + tdSql.execute("insert into ct2 values(now, 2)") + tdSql.execute("create table ct3 using st tags(3, 'POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))')") + tdSql.execute("insert into ct3 values(now, 3)") + tdSql.query("select ST_AsText(location) from st order by location;") + tdSql.checkEqual(tdSql.queryRows, 3) + tdLog.debug(tdSql.queryResult) + # check geometry data + tdSql.checkEqual(tdSql.queryResult[0][0], "POINT (3.000000 6.000000)") + tdSql.checkEqual(tdSql.queryResult[1][0], "LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)") + tdSql.checkEqual(tdSql.queryResult[2][0], "POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))") + def run(self): tdSql.prepare() @@ -248,6 +267,7 @@ class TDTestCase: [1, self.point] # in where clause ] self.geomRelationFunc_test('ST_ContainsProperly', expectedResults) + self.test_td28365() def stop(self): tdSql.close()