diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx index 7dd06c9ca2..8e7bbf22e9 100644 --- a/docs/en/07-develop/07-tmq.mdx +++ b/docs/en/07-develop/07-tmq.mdx @@ -372,7 +372,7 @@ tmq_conf_set(conf, "auto.commit.interval.ms", "1000"); tmq_conf_set(conf, "group.id", "cgrpName"); tmq_conf_set(conf, "td.connect.user", "root"); tmq_conf_set(conf, "td.connect.pass", "taosdata"); -tmq_conf_set(conf, "auto.offset.reset", "earliest"); +tmq_conf_set(conf, "auto.offset.reset", "latest"); tmq_conf_set(conf, "msg.with.table.name", "true"); tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); @@ -402,7 +402,7 @@ properties.setProperty("group.id", "cgrpName"); properties.setProperty("bootstrap.servers", "127.0.0.1:6030"); properties.setProperty("td.connect.user", "root"); properties.setProperty("td.connect.pass", "taosdata"); -properties.setProperty("auto.offset.reset", "earliest"); +properties.setProperty("auto.offset.reset", "latest"); properties.setProperty("msg.with.table.name", "true"); properties.setProperty("value.deserializer", "com.taos.example.MetersDeserializer"); @@ -442,7 +442,7 @@ consumer, err := NewConsumer(conf) let mut dsn: Dsn = "taos://".parse()?; dsn.set("group.id", "group1"); dsn.set("client.id", "test"); -dsn.set("auto.offset.reset", "earliest"); +dsn.set("auto.offset.reset", "latest"); let tmq = TmqBuilder::from_dsn(dsn)?; @@ -468,7 +468,7 @@ consumer = Consumer( "td.connect.ip": "127.0.0.1", "td.connect.user": "root", "td.connect.pass": "taosdata", - "auto.offset.reset": "earliest", + "auto.offset.reset": "latest", "msg.with.table.name": "true", } ) @@ -488,7 +488,7 @@ let consumer = taos.consumer({ 'group.id': 'tg2', 'td.connect.user': 'root', 'td.connect.pass': 'taosdata', - 'auto.offset.reset','earliest', + 'auto.offset.reset','latest', 'msg.with.table.name': 'true', 'td.connect.ip','127.0.0.1', 'td.connect.port','6030' diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx index 85bc67d0fd..fd43dd67fa 100644 --- a/docs/en/14-reference/03-connector/04-java.mdx +++ b/docs/en/14-reference/03-connector/04-java.mdx @@ -1093,7 +1093,7 @@ TaosConsumer consumer = new TaosConsumer<>(config); - httpConnectTimeout: WebSocket connection timeout in milliseconds, the default value is 5000 ms. It only takes effect when using WebSocket type. - messageWaitTimeout: socket timeout in milliseconds, the default value is 10000 ms. It only takes effect when using WebSocket type. - httpPoolSize: Maximum number of concurrent requests on the a connection。It only takes effect when using WebSocket type. -- For more information, see [Consumer Parameters](../../../develop/tmq). +- For more information, see [Consumer Parameters](../../../develop/tmq). Note that the default value of auto.offset.reset in data subscription on the TDengine server has changed since version 3.2.0.0. #### Subscribe to consume data @@ -1193,7 +1193,7 @@ public abstract class ConsumerLoop { config.setProperty("bootstrap.servers", "localhost:6030"); config.setProperty("td.connect.user", "root"); config.setProperty("td.connect.pass", "taosdata"); - config.setProperty("auto.offset.reset", "earliest"); + config.setProperty("auto.offset.reset", "latest"); config.setProperty("msg.with.table.name", "true"); config.setProperty("enable.auto.commit", "true"); config.setProperty("auto.commit.interval.ms", "1000"); @@ -1276,7 +1276,7 @@ public abstract class ConsumerLoop { config.setProperty("bootstrap.servers", "localhost:6041"); config.setProperty("td.connect.user", "root"); config.setProperty("td.connect.pass", "taosdata"); - config.setProperty("auto.offset.reset", "earliest"); + config.setProperty("auto.offset.reset", "latest"); config.setProperty("msg.with.table.name", "true"); config.setProperty("enable.auto.commit", "true"); config.setProperty("auto.commit.interval.ms", "1000"); diff --git a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java index 3c5d2867e2..8162c30ff6 100644 --- a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java +++ b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java @@ -66,7 +66,6 @@ public class SubscribeDemo { properties.setProperty(TMQConstants.VALUE_DESERIALIZER, "com.taos.example.MetersDeserializer"); properties.setProperty(TMQConstants.VALUE_DESERIALIZER_ENCODING, "UTF-8"); - properties.setProperty(TMQConstants.EXPERIMENTAL_SNAPSHOT_ENABLE, "true"); // poll data try (TaosConsumer consumer = new TaosConsumer<>(properties)) { diff --git a/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java b/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java index 03f7e3a11e..7df15f1af6 100644 --- a/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java +++ b/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java @@ -66,7 +66,6 @@ public class WebsocketSubscribeDemo { properties.setProperty(TMQConstants.VALUE_DESERIALIZER, "com.taos.example.MetersDeserializer"); properties.setProperty(TMQConstants.VALUE_DESERIALIZER_ENCODING, "UTF-8"); - properties.setProperty(TMQConstants.EXPERIMENTAL_SNAPSHOT_ENABLE, "true"); // poll data try (TaosConsumer consumer = new TaosConsumer<>(properties)) { diff --git a/docs/examples/python/tmq_assignment_example.py b/docs/examples/python/tmq_assignment_example.py index 41737e3fc4..c370db47a5 100644 --- a/docs/examples/python/tmq_assignment_example.py +++ b/docs/examples/python/tmq_assignment_example.py @@ -23,9 +23,6 @@ def taos_get_assignment_and_seek_demo(): consumer = Consumer( { "group.id": "0", - # should disable snapshot, - # otherwise it will cause invalid params error - "experimental.snapshot.enable": "false", } ) consumer.subscribe(["tmq_assignment_demo_topic"]) diff --git a/docs/examples/python/tmq_websocket_assgnment_example.py b/docs/examples/python/tmq_websocket_assgnment_example.py index 0f8e4a2804..a180ef840e 100644 --- a/docs/examples/python/tmq_websocket_assgnment_example.py +++ b/docs/examples/python/tmq_websocket_assgnment_example.py @@ -21,9 +21,6 @@ def taosws_get_assignment_and_seek_demo(): prepare() consumer = taosws.Consumer(conf={ "td.connect.websocket.scheme": "ws", - # should disable snapshot, - # otherwise it will cause invalid params error - "experimental.snapshot.enable": "false", "group.id": "0", }) consumer.subscribe(["tmq_assignment_demo_topic"]) diff --git a/docs/zh/07-develop/07-tmq.md b/docs/zh/07-develop/07-tmq.mdx similarity index 99% rename from docs/zh/07-develop/07-tmq.md rename to docs/zh/07-develop/07-tmq.mdx index a542c844fe..d3b27fedc3 100644 --- a/docs/zh/07-develop/07-tmq.md +++ b/docs/zh/07-develop/07-tmq.mdx @@ -371,7 +371,7 @@ tmq_conf_set(conf, "auto.commit.interval.ms", "1000"); tmq_conf_set(conf, "group.id", "cgrpName"); tmq_conf_set(conf, "td.connect.user", "root"); tmq_conf_set(conf, "td.connect.pass", "taosdata"); -tmq_conf_set(conf, "auto.offset.reset", "earliest"); +tmq_conf_set(conf, "auto.offset.reset", "latest"); tmq_conf_set(conf, "msg.with.table.name", "true"); tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); @@ -401,7 +401,7 @@ properties.setProperty("group.id", "cgrpName"); properties.setProperty("bootstrap.servers", "127.0.0.1:6030"); properties.setProperty("td.connect.user", "root"); properties.setProperty("td.connect.pass", "taosdata"); -properties.setProperty("auto.offset.reset", "earliest"); +properties.setProperty("auto.offset.reset", "latest"); properties.setProperty("msg.with.table.name", "true"); properties.setProperty("value.deserializer", "com.taos.example.MetersDeserializer"); @@ -441,7 +441,7 @@ consumer, err := NewConsumer(conf) let mut dsn: Dsn = "taos://".parse()?; dsn.set("group.id", "group1"); dsn.set("client.id", "test"); -dsn.set("auto.offset.reset", "earliest"); +dsn.set("auto.offset.reset", "latest"); let tmq = TmqBuilder::from_dsn(dsn)?; @@ -469,7 +469,7 @@ consumer = Consumer( "td.connect.ip": "127.0.0.1", "td.connect.user": "root", "td.connect.pass": "taosdata", - "auto.offset.reset": "earliest", + "auto.offset.reset": "latest", "msg.with.table.name": "true", } ) @@ -489,7 +489,7 @@ let consumer = taos.consumer({ 'group.id': 'tg2', 'td.connect.user': 'root', 'td.connect.pass': 'taosdata', - 'auto.offset.reset','earliest', + 'auto.offset.reset','latest', 'msg.with.table.name': 'true', 'td.connect.ip','127.0.0.1', 'td.connect.port','6030' diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx index 7b6db8ee69..237e3ef8f9 100644 --- a/docs/zh/08-connector/14-java.mdx +++ b/docs/zh/08-connector/14-java.mdx @@ -1095,7 +1095,8 @@ TaosConsumer consumer = new TaosConsumer<>(config); - httpConnectTimeout: 创建连接超时参数,单位 ms,默认为 5000 ms。仅在 WebSocket 连接下有效。 - messageWaitTimeout: 数据传输超时参数,单位 ms,默认为 10000 ms。仅在 WebSocket 连接下有效。 - httpPoolSize: 同一个连接下最大并行请求数。仅在 WebSocket 连接下有效。 - 其他参数请参考:[Consumer 参数列表](../../develop/tmq#创建-consumer-以及consumer-group) + 其他参数请参考:[Consumer 参数列表](../../develop/tmq#创建-consumer-以及consumer-group), 注意TDengine服务端自3.2.0.0版本开始消息订阅中的auto.offset.reset默认值发生变化。 + #### 订阅消费数据 @@ -1193,7 +1194,7 @@ public abstract class ConsumerLoop { config.setProperty("bootstrap.servers", "localhost:6030"); config.setProperty("td.connect.user", "root"); config.setProperty("td.connect.pass", "taosdata"); - config.setProperty("auto.offset.reset", "earliest"); + config.setProperty("auto.offset.reset", "latest"); config.setProperty("msg.with.table.name", "true"); config.setProperty("enable.auto.commit", "true"); config.setProperty("auto.commit.interval.ms", "1000"); @@ -1201,7 +1202,6 @@ public abstract class ConsumerLoop { config.setProperty("client.id", "1"); config.setProperty("value.deserializer", "com.taosdata.jdbc.tmq.ConsumerTest.ConsumerLoop$ResultDeserializer"); config.setProperty("value.deserializer.encoding", "UTF-8"); - config.setProperty("experimental.snapshot.enable", "true"); this.consumer = new TaosConsumer<>(config); this.topics = Collections.singletonList("topic_speed"); @@ -1279,7 +1279,7 @@ public abstract class ConsumerLoop { config.setProperty("bootstrap.servers", "localhost:6041"); config.setProperty("td.connect.user", "root"); config.setProperty("td.connect.pass", "taosdata"); - config.setProperty("auto.offset.reset", "earliest"); + config.setProperty("auto.offset.reset", "latest"); config.setProperty("msg.with.table.name", "true"); config.setProperty("enable.auto.commit", "true"); config.setProperty("auto.commit.interval.ms", "1000"); @@ -1287,7 +1287,6 @@ public abstract class ConsumerLoop { config.setProperty("client.id", "1"); config.setProperty("value.deserializer", "com.taosdata.jdbc.tmq.ConsumerTest.ConsumerLoop$ResultDeserializer"); config.setProperty("value.deserializer.encoding", "UTF-8"); - config.setProperty("experimental.snapshot.enable", "true"); this.consumer = new TaosConsumer<>(config); this.topics = Collections.singletonList("topic_speed"); diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 6f4f15d1e8..72aab9adf0 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -55,8 +55,8 @@ typedef struct SSessionKey { } SSessionKey; typedef struct SVersionRange { - uint64_t minVer; - uint64_t maxVer; + int64_t minVer; + int64_t maxVer; } SVersionRange; static inline int winKeyCmprImpl(const void* pKey1, const void* pKey2) { diff --git a/include/common/tgrant.h b/include/common/tgrant.h index edbc74bf18..cfc6c13c48 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -52,9 +52,9 @@ typedef enum { int32_t grantCheck(EGrantType grant); #ifndef TD_GRANT_OPTIMIZE -int32_t grantAlterActiveCode(const char* old, const char* new, char* out, int8_t type); +int32_t grantAlterActiveCode(const char* old, const char* newer, char* out, int8_t type); #else -int32_t grantAlterActiveCode(int32_t did, const char* old, const char* new, char* out, int8_t type); +int32_t grantAlterActiveCode(int32_t did, const char* old, const char* newer, char* out, int8_t type); #endif #ifndef GRANTS_CFG @@ -114,4 +114,4 @@ int32_t grantAlterActiveCode(int32_t did, const char* old, const char* new, char } #endif -#endif /*_TD_COMMON_GRANT_H_*/ \ No newline at end of file +#endif /*_TD_COMMON_GRANT_H_*/ diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index cc343b89f5..4eb8328caa 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -302,8 +302,8 @@ enum { // WARN: new msg should be appended to segment tail TD_DEF_MSG_TYPE(TDMT_SYNC_HEARTBEAT, "sync-heartbeat", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_HEARTBEAT_REPLY, "sync-heartbeat-reply", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_LOCAL_CMD, "sync-local-cmd", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SYNC_PRE_SNAPSHOT, "sync-pre-snapshot", NULL, NULL) // no longer used - TD_DEF_MSG_TYPE(TDMT_SYNC_PRE_SNAPSHOT_REPLY, "sync-pre-snapshot-reply", NULL, NULL) // no longer used + TD_DEF_MSG_TYPE(TDMT_SYNC_PREP_SNAPSHOT, "sync-prep-snapshot", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SYNC_PREP_SNAPSHOT_REPLY, "sync-prep-snapshot-reply", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_FORCE_FOLLOWER, "sync-force-become-follower", NULL, NULL) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index d4fc377375..82ebce2ca8 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -366,9 +366,6 @@ - - - #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 #define TK_NK_ILLEGAL 602 diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index f69afbd71b..ad525a2aa7 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -36,8 +36,7 @@ extern "C" { #define SYNC_DEL_WAL_MS (1000 * 60) #define SYNC_ADD_QUORUM_COUNT 3 #define SYNC_VNODE_LOG_RETENTION (TSDB_SYNC_LOG_BUFFER_RETENTION + 1) -#define SNAPSHOT_MAX_CLOCK_SKEW_MS 1000 * 10 -#define SNAPSHOT_WAIT_MS 1000 * 30 +#define SNAPSHOT_WAIT_MS 1000 * 5 #define SYNC_MAX_RETRY_BACKOFF 5 #define SYNC_LOG_REPL_RETRY_WAIT_MS 100 @@ -87,6 +86,11 @@ typedef enum { TAOS_SYNC_ROLE_ERROR = 2, } ESyncRole; +typedef enum { + SYNC_FSM_STATE_COMPLETE = 0, + SYNC_FSM_STATE_INCOMPLETE, +} ESyncFsmState; + typedef struct SNodeInfo { int64_t clusterId; int32_t nodeId; @@ -95,6 +99,12 @@ typedef struct SNodeInfo { ESyncRole nodeRole; } SNodeInfo; +typedef struct SSyncTLV { + int32_t typ; + int32_t len; + char val[]; +} SSyncTLV; + typedef struct SSyncCfg { int32_t totalReplicaNum; int32_t replicaNum; @@ -139,10 +149,13 @@ typedef struct SReConfigCbMeta { typedef struct SSnapshotParam { SyncIndex start; SyncIndex end; + SSyncTLV* data; } SSnapshotParam; typedef struct SSnapshot { - void* data; + int32_t type; + SSyncTLV* data; + ESyncFsmState state; SyncIndex lastApplyIndex; SyncTerm lastApplyTerm; SyncIndex lastConfigIndex; @@ -171,7 +184,7 @@ typedef struct SSyncFSM { void (*FpBecomeLearnerCb)(const struct SSyncFSM* pFsm); int32_t (*FpGetSnapshot)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot, void* pReaderParam, void** ppReader); - void (*FpGetSnapshotInfo)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot); + int32_t (*FpGetSnapshotInfo)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot); int32_t (*FpSnapshotStartRead)(const struct SSyncFSM* pFsm, void* pReaderParam, void** ppReader); void (*FpSnapshotStopRead)(const struct SSyncFSM* pFsm, void* pReader); diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index 83dbf2c4af..accb7e6f24 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -163,6 +163,7 @@ int rpcReleaseHandle(void *handle, int8_t type); // just release conn to rpc in // These functions will not be called in the child process int rpcSendRequestWithCtx(void *thandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t *rid, SRpcCtx *ctx); int rpcSendRecv(void *shandle, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp); +int rpcSendRecvWithTimeout(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp, int32_t timeoutMs); int rpcSetDefaultAddr(void *thandle, const char *ip, const char *fqdn); void *rpcAllocHandle(); void rpcSetIpWhite(void *thandl, void *arg); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 0885802ee8..4c87bd31bf 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -565,7 +565,7 @@ int32_t* taosGetErrno(); // #define TSDB_CODE_SYN_TOO_MANY_FWDINFO TAOS_DEF_ERROR_CODE(0, 0x0904) // 2.x // #define TSDB_CODE_SYN_MISMATCHED_PROTOCOL TAOS_DEF_ERROR_CODE(0, 0x0905) // 2.x // #define TSDB_CODE_SYN_MISMATCHED_CLUSTERID TAOS_DEF_ERROR_CODE(0, 0x0906) // 2.x -// #define TSDB_CODE_SYN_MISMATCHED_SIGNATURE TAOS_DEF_ERROR_CODE(0, 0x0907) // 2.x +#define TSDB_CODE_SYN_MISMATCHED_SIGNATURE TAOS_DEF_ERROR_CODE(0, 0x0907) // #define TSDB_CODE_SYN_INVALID_CHECKSUM TAOS_DEF_ERROR_CODE(0, 0x0908) // 2.x // #define TSDB_CODE_SYN_INVALID_MSGLEN TAOS_DEF_ERROR_CODE(0, 0x0909) // 2.x // #define TSDB_CODE_SYN_INVALID_MSGTYPE TAOS_DEF_ERROR_CODE(0, 0x090A) // 2.x diff --git a/include/util/tdef.h b/include/util/tdef.h index 8f0d2c6162..2dfbde6638 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -252,7 +252,7 @@ typedef enum ELogicConditionType { #define TSDB_PASSWORD_LEN 32 #define TSDB_USET_PASSWORD_LEN 129 #define TSDB_VERSION_LEN 32 -#define TSDB_LABEL_LEN 8 +#define TSDB_LABEL_LEN 12 #define TSDB_JOB_STATUS_LEN 32 #define TSDB_CLUSTER_ID_LEN 40 diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c index 425218f0e1..723298f256 100644 --- a/source/common/src/ttime.c +++ b/source/common/src/ttime.c @@ -665,6 +665,9 @@ int32_t parseNatualDuration(const char* token, int32_t tokenLen, int64_t* durati if (*unit == 'n' || *unit == 'y') { return 0; } + if(isdigit(*unit)) { + *unit = getPrecisionUnit(timePrecision); + } return getDuration(*duration, *unit, duration, timePrecision); } diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index c7af552da4..991f17f326 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -160,7 +160,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { SEpSet epSet = {0}; dmGetMnodeEpSet(pMgmt->pData, &epSet); - rpcSendRecv(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, &rpcRsp); + rpcSendRecvWithTimeout(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, &rpcRsp, 5000); if (rpcRsp.code != 0) { dmRotateMnodeEpSet(pMgmt->pData); char tbuf[256]; diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 24acacc621..c7ba0187f3 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -241,7 +241,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_BATCH, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_FORCE_FOLLOWER_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -249,7 +249,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT_REPLY, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER; code = 0; diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index cddf132bce..34f2b5c446 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -56,6 +56,7 @@ typedef struct { int32_t vgVersion; int32_t refCount; int8_t dropped; + int8_t failed; int8_t disable; int32_t diskPrimary; int32_t toVgId; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 0e17d2b75f..cc542f51ce 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -30,9 +30,11 @@ void vmGetVnodeLoads(SVnodeMgmt *pMgmt, SMonVloadInfo *pInfo, bool isReset) { if (ppVnode == NULL || *ppVnode == NULL) continue; SVnodeObj *pVnode = *ppVnode; - SVnodeLoad vload = {0}; - vnodeGetLoad(pVnode->pImpl, &vload); - if (isReset) vnodeResetLoad(pVnode->pImpl, &vload); + SVnodeLoad vload = {.vgId = pVnode->vgId}; + if (!pVnode->failed) { + vnodeGetLoad(pVnode->pImpl, &vload); + if (isReset) vnodeResetLoad(pVnode->pImpl, &vload); + } taosArrayPush(pInfo->pVloads, &vload); pIter = taosHashIterate(pMgmt->hash, pIter); } @@ -52,9 +54,11 @@ void vmGetVnodeLoadsLite(SVnodeMgmt *pMgmt, SMonVloadInfo *pInfo) { if (ppVnode == NULL || *ppVnode == NULL) continue; SVnodeObj *pVnode = *ppVnode; - SVnodeLoadLite vload = {0}; - if (vnodeGetLoadLite(pVnode->pImpl, &vload) == 0) { - taosArrayPush(pInfo->pVloads, &vload); + if (!pVnode->failed) { + SVnodeLoadLite vload = {0}; + if (vnodeGetLoadLite(pVnode->pImpl, &vload) == 0) { + taosArrayPush(pInfo->pVloads, &vload); + } } pIter = taosHashIterate(pMgmt->hash, pIter); } @@ -278,7 +282,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { vmGenerateWrapperCfg(pMgmt, &req, &wrapperCfg); SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); - if (pVnode != NULL) { + if (pVnode != NULL && !pVnode->failed) { dError("vgId:%d, already exist", req.vgId); tFreeSCreateVnodeReq(&req); vmReleaseVnode(pMgmt, pVnode); @@ -287,7 +291,9 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return 0; } - wrapperCfg.diskPrimary = vmAllocPrimaryDisk(pMgmt, vnodeCfg.vgId); + ASSERT(pVnode == NULL || pVnode->failed); + + wrapperCfg.diskPrimary = pVnode ? pVnode->diskPrimary : vmAllocPrimaryDisk(pMgmt, vnodeCfg.vgId); int32_t diskPrimary = wrapperCfg.diskPrimary; snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, vnodeCfg.vgId); @@ -299,7 +305,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { goto _OVER; } - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode since %s", req.vgId, terrstr()); code = terrno; @@ -364,9 +370,10 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { TMSG_INFO(pMsg->msgType)); SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); - if (pVnode == NULL) { + if (pVnode == NULL || pVnode->failed) { dError("vgId:%d, failed to alter vnode type since %s", req.vgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; + if (pVnode) vmReleaseVnode(pMgmt, pVnode); return -1; } @@ -445,7 +452,7 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, false); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; @@ -481,9 +488,10 @@ int32_t vmProcessCheckLearnCatchupReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { req.vgId, TMSG_INFO(pMsg->msgType)); SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); - if (pVnode == NULL) { + if (pVnode == NULL || pVnode->failed) { dError("vgId:%d, failed to alter vnode type since %s", req.vgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; + if (pVnode) vmReleaseVnode(pMgmt, pVnode); return -1; } @@ -523,9 +531,10 @@ int32_t vmProcessDisableVnodeWriteReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { dInfo("vgId:%d, vnode write disable:%d", req.vgId, req.disable); SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); - if (pVnode == NULL) { + if (pVnode == NULL || pVnode->failed) { dError("vgId:%d, failed to disable write since %s", req.vgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; + if (pVnode) vmReleaseVnode(pMgmt, pVnode); return -1; } @@ -555,9 +564,10 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { dInfo("vgId:%d, start to alter vnode hashrange:[%u, %u], dstVgId:%d", req.srcVgId, req.hashBegin, req.hashEnd, req.dstVgId); pVnode = vmAcquireVnode(pMgmt, srcVgId); - if (pVnode == NULL) { + if (pVnode == NULL || pVnode->failed) { dError("vgId:%d, failed to alter hashrange since %s", srcVgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; + if (pVnode) vmReleaseVnode(pMgmt, pVnode); return -1; } @@ -592,7 +602,7 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, open vnode", dstVgId); - SVnode *pImpl = vnodeOpen(dstPath, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(dstPath, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, false); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", dstVgId, dstPath, terrstr()); @@ -669,9 +679,10 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } SVnodeObj *pVnode = vmAcquireVnode(pMgmt, vgId); - if (pVnode == NULL) { + if (pVnode == NULL || pVnode->failed) { dError("vgId:%d, failed to alter replica since %s", vgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; + if (pVnode) vmReleaseVnode(pMgmt, pVnode); return -1; } @@ -696,7 +707,7 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, false); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; @@ -848,14 +859,14 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_BATCH, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_FORCE_FOLLOWER, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; code = 0; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 963bfa3197..d2093ff77c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -112,6 +112,7 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) { pVnode->diskPrimary = pCfg->diskPrimary; pVnode->refCount = 0; pVnode->dropped = 0; + pVnode->failed = 0; pVnode->path = taosStrdup(pCfg->path); pVnode->pImpl = pImpl; @@ -121,11 +122,15 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) { return -1; } - if (vmAllocQueue(pMgmt, pVnode) != 0) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - taosMemoryFree(pVnode->path); - taosMemoryFree(pVnode); - return -1; + if (pImpl) { + if (vmAllocQueue(pMgmt, pVnode) != 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + taosMemoryFree(pVnode->path); + taosMemoryFree(pVnode); + return -1; + } + } else { + pVnode->failed = 1; } taosThreadRwlockWrlock(&pMgmt->lock); @@ -267,12 +272,14 @@ static void *vmOpenVnodeInThread(void *param) { int32_t diskPrimary = pCfg->diskPrimary; snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pCfg->vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, false); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode by thread:%d since %s", pCfg->vgId, pThread->threadIndex, terrstr()); - pThread->failed++; - continue; + if (terrno != TSDB_CODE_NEED_RETRY) { + pThread->failed++; + continue; + } } if (vmOpenVnode(pMgmt, pCfg, pImpl) != 0) { @@ -379,6 +386,7 @@ static void *vmCloseVnodeInThread(void *param) { for (int32_t v = 0; v < pThread->vnodeNum; ++v) { SVnodeObj *pVnode = pThread->ppVnodes[v]; + if (pVnode->failed) continue; char stepDesc[TSDB_STEP_DESC_LEN] = {0}; snprintf(stepDesc, TSDB_STEP_DESC_LEN, "vgId:%d, start to close, %d of %d have been closed", pVnode->vgId, @@ -473,7 +481,9 @@ static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) { if (ppVnodes != NULL) { for (int32_t i = 0; i < numOfVnodes; ++i) { SVnodeObj *pVnode = ppVnodes[i]; - vnodeSyncCheckTimeout(pVnode->pImpl); + if (!pVnode->failed) { + vnodeSyncCheckTimeout(pVnode->pImpl); + } vmReleaseVnode(pMgmt, pVnode); } taosMemoryFree(ppVnodes); @@ -605,6 +615,12 @@ static void *vmRestoreVnodeInThread(void *param) { for (int32_t v = 0; v < pThread->vnodeNum; ++v) { SVnodeObj *pVnode = pThread->ppVnodes[v]; + if (pVnode->failed) { + dError("vgId:%d, skip restoring vnode in failure mode.", pVnode->vgId); + continue; + } + + ASSERT(pVnode->pImpl); char stepDesc[TSDB_STEP_DESC_LEN] = {0}; snprintf(stepDesc, TSDB_STEP_DESC_LEN, "vgId:%d, start to restore, %d of %d have been restored", pVnode->vgId, diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index 696107ca90..4b18ec4fb0 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -187,9 +187,9 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp pHead->vgId = ntohl(pHead->vgId); SVnodeObj *pVnode = vmAcquireVnode(pMgmt, pHead->vgId); - if (pVnode == NULL) { - dGWarn("vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d", pHead->vgId, pMsg, - terrstr(), TMSG_INFO(pMsg->msgType), qtype, pHead->contLen); + if (pVnode == NULL || pVnode->failed) { + dGDebug("vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d", pHead->vgId, pMsg, + terrstr(), TMSG_INFO(pMsg->msgType), qtype, pHead->contLen); terrno = (terrno != 0) ? terrno : -1; return terrno; } @@ -316,7 +316,7 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { int32_t vmGetQueueSize(SVnodeMgmt *pMgmt, int32_t vgId, EQueueType qtype) { int32_t size = -1; SVnodeObj *pVnode = vmAcquireVnode(pMgmt, vgId); - if (pVnode != NULL) { + if (pVnode != NULL && !pVnode->failed) { switch (qtype) { case WRITE_QUEUE: size = taosQueueItemSize(pVnode->pWriteW.queue); @@ -339,8 +339,8 @@ int32_t vmGetQueueSize(SVnodeMgmt *pMgmt, int32_t vgId, EQueueType qtype) { default: break; } - vmReleaseVnode(pMgmt, pVnode); } + if (pVnode) vmReleaseVnode(pMgmt, pVnode); if (size < 0) { dTrace("vgId:%d, can't get size from queue since %s, qtype:%d", vgId, terrstr(), qtype); size = 0; diff --git a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h index 3cf7a360f9..20789772e5 100644 --- a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h +++ b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h @@ -115,7 +115,9 @@ int32_t dmRunDnode(SDnode *pDnode); int32_t dmInitServer(SDnode *pDnode); void dmCleanupServer(SDnode *pDnode); int32_t dmInitClient(SDnode *pDnode); +int32_t dmInitStatusClient(SDnode *pDnode); void dmCleanupClient(SDnode *pDnode); +void dmCleanupStatusClient(SDnode *pDnode); SMsgCb dmGetMsgcb(SDnode *pDnode); int32_t dmInitMsgHandle(SDnode *pDnode); int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg); diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 15697dc448..5164d60ba6 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -20,8 +20,8 @@ #include "qworker.h" #include "tstream.h" #ifdef TD_TSZ -#include "tglobal.h" #include "tcompression.h" +#include "tglobal.h" #endif int32_t dmInitDnode(SDnode *pDnode) { @@ -66,7 +66,7 @@ int32_t dmInitDnode(SDnode *pDnode) { goto _OVER; } - if(dmInitModule(pDnode) != 0) { + if (dmInitModule(pDnode) != 0) { goto _OVER; } @@ -91,6 +91,7 @@ void dmCleanupDnode(SDnode *pDnode) { if (pDnode == NULL) return; dmCleanupClient(pDnode); + dmCleanupStatusClient(pDnode); dmCleanupServer(pDnode); dmClearVars(pDnode); rpcCleanup(); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index dc48ff71f8..ce6b21dd56 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -358,6 +358,50 @@ int32_t dmInitClient(SDnode *pDnode) { dDebug("dnode rpc client is initialized"); return 0; } +int32_t dmInitStatusClient(SDnode *pDnode) { + SDnodeTrans *pTrans = &pDnode->trans; + + SRpcInit rpcInit = {0}; + rpcInit.label = "DND-STATUS"; + rpcInit.numOfThreads = 1; + rpcInit.cfp = (RpcCfp)dmProcessRpcMsg; + rpcInit.sessions = 1024; + rpcInit.connType = TAOS_CONN_CLIENT; + rpcInit.user = TSDB_DEFAULT_USER; + rpcInit.idleTime = tsShellActivityTimer * 1000; + rpcInit.parent = pDnode; + rpcInit.rfp = rpcRfp; + rpcInit.compressSize = tsCompressMsgSize; + + rpcInit.retryMinInterval = tsRedirectPeriod; + rpcInit.retryStepFactor = tsRedirectFactor; + rpcInit.retryMaxInterval = tsRedirectMaxPeriod; + rpcInit.retryMaxTimeout = tsMaxRetryWaitTime; + + rpcInit.failFastInterval = 5000; // interval threshold(ms) + rpcInit.failFastThreshold = 3; // failed threshold + rpcInit.ffp = dmFailFastFp; + + int32_t connLimitNum = 100; + connLimitNum = TMAX(connLimitNum, 10); + connLimitNum = TMIN(connLimitNum, 500); + + rpcInit.connLimitNum = connLimitNum; + rpcInit.connLimitLock = 1; + rpcInit.supportBatch = 1; + rpcInit.batchSize = 8 * 1024; + rpcInit.timeToGetConn = tsTimeToGetAvailableConn; + taosVersionStrToInt(version, &(rpcInit.compatibilityVer)); + + // pTrans->statusClientRpc = rpcOpen(&rpcInit); + // if (pTrans->statusClientRpc == NULL) { + // dError("failed to init dnode rpc status client"); + // return -1; + // } + + dDebug("dnode rpc status client is initialized"); + return 0; +} void dmCleanupClient(SDnode *pDnode) { SDnodeTrans *pTrans = &pDnode->trans; @@ -367,6 +411,14 @@ void dmCleanupClient(SDnode *pDnode) { dDebug("dnode rpc client is closed"); } } +void dmCleanupStatusClient(SDnode *pDnode) { + SDnodeTrans *pTrans = &pDnode->trans; + // if (pTrans->statusClientRpc) { + // rpcClose(pTrans->statusClientRpc); + // pTrans->statusClientRpc = NULL; + // dDebug("dnode rpc status client is closed"); + // } +} int32_t dmInitServer(SDnode *pDnode) { SDnodeTrans *pTrans = &pDnode->trans; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index f252fbc5d2..1b21d4a017 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -858,22 +858,10 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat } return 0; } -static int32_t mndGenIdxNameForFirstTag(char *fullname, char *dbname, char *tagname) { - char randStr[TSDB_COL_NAME_LEN] = {0}; - int32_t left = TSDB_COL_NAME_LEN - strlen(tagname) - 1; - if (left <= 1) { - sprintf(fullname, "%s.%s", dbname, tagname); - } else { - int8_t start = left < 8 ? 0 : 8; - int8_t end = left >= 24 ? 24 : left - 1; - // gen rand str len [base:end] - // note: ignore rand performance issues - int64_t len = taosRand() % (end - start + 1) + start; - taosRandStr2(randStr, len); - sprintf(fullname, "%s.%s_%s", dbname, tagname, randStr); - } - - return 0; +static int32_t mndGenIdxNameForFirstTag(char *fullname, char *dbname, char *stbname, char *tagname) { + SName name = {0}; + tNameFromString(&name, stbname, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); + return snprintf(fullname, TSDB_INDEX_FNAME_LEN, "%s.%s_%s", dbname, tagname, tNameGetTableName(&name)); } static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCreate, SDbObj *pDb) { @@ -889,7 +877,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea if (mndBuildStbFromReq(pMnode, &stbObj, pCreate, pDb) != 0) goto _OVER; SSchema *pSchema = &(stbObj.pTags[0]); - mndGenIdxNameForFirstTag(fullIdxName, pDb->name, pSchema->name); + mndGenIdxNameForFirstTag(fullIdxName, pDb->name, stbObj.name, pSchema->name); SSIdx idx = {0}; if (mndAcquireGlobalIdx(pMnode, fullIdxName, SDB_IDX, &idx) == 0 && idx.pIdx != NULL) { terrno = TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 5759737a6a..7f6a0397ad 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -286,9 +286,10 @@ int32_t mndSyncGetSnapshot(const SSyncFSM *pFsm, SSnapshot *pSnapshot, void *pRe return 0; } -static void mndSyncGetSnapshotInfo(const SSyncFSM *pFsm, SSnapshot *pSnapshot) { +static int32_t mndSyncGetSnapshotInfo(const SSyncFSM *pFsm, SSnapshot *pSnapshot) { SMnode *pMnode = pFsm->data; sdbGetCommitInfo(pMnode->pSdb, &pSnapshot->lastApplyIndex, &pSnapshot->lastApplyTerm, &pSnapshot->lastConfigIndex); + return 0; } void mndRestoreFinish(const SSyncFSM *pFsm, const SyncIndex commitIdx) { diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index c40e2657f9..6a0c991be4 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -58,7 +58,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t srcVgId, int32_t dstVgId, int32_t diskPrimary, STfs *pTfs); void vnodeDestroy(int32_t vgId, const char *path, STfs *pTfs); -SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb); +SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb, bool force); void vnodePreClose(SVnode *pVnode); void vnodePostClose(SVnode *pVnode); void vnodeSyncCheckTimeout(SVnode *pVnode); @@ -69,7 +69,7 @@ int32_t vnodeBegin(SVnode *pVnode); int32_t vnodeStart(SVnode *pVnode); void vnodeStop(SVnode *pVnode); int64_t vnodeGetSyncHandle(SVnode *pVnode); -void vnodeGetSnapshot(SVnode *pVnode, SSnapshot *pSnapshot); +int32_t vnodeGetSnapshot(SVnode *pVnode, SSnapshot *pSnapshot); void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t *numOfTables, int64_t *numOfNormalTables); int32_t vnodeProcessCreateTSma(SVnode *pVnode, void *pCont, uint32_t contLen); int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList); @@ -259,11 +259,11 @@ int32_t vnodeEnqueueStreamMsg(SVnode *pVnode, SRpcMsg *pMsg); int32_t smaGetTSmaDays(SVnodeCfg *pCfg, void *pCont, uint32_t contLen, int32_t *days); // SVSnapReader -int32_t vnodeSnapReaderOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapReader **ppReader); +int32_t vnodeSnapReaderOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapReader **ppReader); void vnodeSnapReaderClose(SVSnapReader *pReader); int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData); // SVSnapWriter -int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWriter **ppWriter); +int32_t vnodeSnapWriterOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapWriter **ppWriter); int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *pSnapshot); int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData); diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index e83f47f7b6..79112babc3 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -263,6 +263,7 @@ int32_t tsdbFSRollback(STsdb *pTsdb); int32_t tsdbFSPrepareCommit(STsdb *pTsdb, STsdbFS *pFS); int32_t tsdbFSRef(STsdb *pTsdb, STsdbFS *pFS); void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS); +void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t); int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet); int32_t tsdbFSUpsertDelFile(STsdbFS *pFS, SDelFile *pDelFile); @@ -672,6 +673,42 @@ struct SDelFWriter { typedef struct STFileSet STFileSet; typedef TARRAY2(STFileSet *) TFileSetArray; +typedef struct STSnapRange STSnapRange; +typedef TARRAY2(STSnapRange *) TSnapRangeArray; // disjoint snap ranges + +// util +int32_t tSerializeSnapRangeArray(void *buf, int32_t bufLen, TSnapRangeArray *pSnapR); +int32_t tDeserializeSnapRangeArray(void *buf, int32_t bufLen, TSnapRangeArray *pSnapR); +void tsdbSnapRangeArrayDestroy(TSnapRangeArray **ppSnap); +SHashObj *tsdbGetSnapRangeHash(TSnapRangeArray *pRanges); + +// snap partition list +typedef TARRAY2(SVersionRange) SVerRangeList; +typedef struct STsdbSnapPartition STsdbSnapPartition; +typedef TARRAY2(STsdbSnapPartition *) STsdbSnapPartList; +// util +STsdbSnapPartList *tsdbSnapPartListCreate(); +void tsdbSnapPartListDestroy(STsdbSnapPartList **ppList); +int32_t tSerializeTsdbSnapPartList(void *buf, int32_t bufLen, STsdbSnapPartList *pList); +int32_t tDeserializeTsdbSnapPartList(void *buf, int32_t bufLen, STsdbSnapPartList *pList); +int32_t tsdbSnapPartListToRangeDiff(STsdbSnapPartList *pList, TSnapRangeArray **ppRanges); + +enum { + TSDB_SNAP_RANGE_TYP_HEAD = 0, + TSDB_SNAP_RANGE_TYP_DATA, + TSDB_SNAP_RANGE_TYP_SMA, + TSDB_SNAP_RANGE_TYP_TOMB, + TSDB_SNAP_RANGE_TYP_STT, + TSDB_SNAP_RANGE_TYP_MAX, +}; + +struct STsdbSnapPartition { + int64_t fid; + int8_t stat; + SVerRangeList verRanges[TSDB_SNAP_RANGE_TYP_MAX]; +}; + +// snap read struct STsdbReadSnap { SMemTable *pMem; SQueryNode *pNode; @@ -989,6 +1026,15 @@ struct STsdbFilterInfo { TABLEID tbid; }; +typedef enum { + TSDB_FS_STATE_NORMAL = 0, + TSDB_FS_STATE_INCOMPLETE, +} ETsdbFsState; + +// utils +ETsdbFsState tsdbSnapGetFsState(SVnode *pVnode); +int32_t tsdbSnapGetDetails(SVnode *pVnode, SSnapshot *pSnap); + #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 823e9d57f6..12e273c32d 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -202,7 +202,7 @@ typedef struct SMetaInfo { int32_t metaGetInfo(SMeta* pMeta, int64_t uid, SMetaInfo* pInfo, SMetaReader* pReader); // tsdb -int tsdbOpen(SVnode* pVnode, STsdb** ppTsdb, const char* dir, STsdbKeepCfg* pKeepCfg, int8_t rollback); +int tsdbOpen(SVnode* pVnode, STsdb** ppTsdb, const char* dir, STsdbKeepCfg* pKeepCfg, int8_t rollback, bool force); int tsdbClose(STsdb** pTsdb); int32_t tsdbBegin(STsdb* pTsdb); // int32_t tsdbPrepareCommit(STsdb* pTsdb); @@ -267,7 +267,7 @@ int32_t tqProcessTaskScanHistoryFinishRsp(STQ* pTq, SRpcMsg* pMsg); // sma int32_t smaInit(); void smaCleanUp(); -int32_t smaOpen(SVnode* pVnode, int8_t rollback); +int32_t smaOpen(SVnode* pVnode, int8_t rollback, bool force); int32_t smaClose(SSma* pSma); int32_t smaBegin(SSma* pSma); int32_t smaPrepareAsyncCommit(SSma* pSma); @@ -295,11 +295,12 @@ int32_t metaSnapWriterOpen(SMeta* pMeta, int64_t sver, int64_t ever, SMetaSnapWr int32_t metaSnapWrite(SMetaSnapWriter* pWriter, uint8_t* pData, uint32_t nData); int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback); // STsdbSnapReader ======================================== -int32_t tsdbSnapReaderOpen(STsdb* pTsdb, int64_t sver, int64_t ever, int8_t type, STsdbSnapReader** ppReader); +int32_t tsdbSnapReaderOpen(STsdb* pTsdb, int64_t sver, int64_t ever, int8_t type, void* pRanges, + STsdbSnapReader** ppReader); int32_t tsdbSnapReaderClose(STsdbSnapReader** ppReader); int32_t tsdbSnapRead(STsdbSnapReader* pReader, uint8_t** ppData); // STsdbSnapWriter ======================================== -int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWriter** ppWriter); +int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, void* pRanges, STsdbSnapWriter** ppWriter); int32_t tsdbSnapWrite(STsdbSnapWriter* pWriter, SSnapDataHdr* pHdr); int32_t tsdbSnapWriterPrepareClose(STsdbSnapWriter* pWriter); int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback); @@ -356,8 +357,9 @@ int32_t rsmaSnapReaderOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapRead int32_t rsmaSnapReaderClose(SRSmaSnapReader** ppReader); int32_t rsmaSnapRead(SRSmaSnapReader* pReader, uint8_t** ppData); // SRSmaSnapWriter ======================================== -int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapWriter** ppWriter); +int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, void** ppRanges, SRSmaSnapWriter** ppWriter); int32_t rsmaSnapWrite(SRSmaSnapWriter* pWriter, uint8_t* pData, uint32_t nData); +int32_t rsmaSnapWriterPrepareClose(SRSmaSnapWriter* pWriter); int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback); typedef struct { @@ -497,6 +499,7 @@ struct SSma { #define SMA_RSMA_TSDB0(s) ((s)->pVnode->pTsdb) #define SMA_RSMA_TSDB1(s) ((s)->pRSmaTsdb[TSDB_RETENTION_L0]) #define SMA_RSMA_TSDB2(s) ((s)->pRSmaTsdb[TSDB_RETENTION_L1]) +#define SMA_RSMA_GET_TSDB(pVnode, level) ((level == 0) ? pVnode->pTsdb : pVnode->pSma->pRSmaTsdb[level - 1]) // sma void smaHandleRes(void* pVnode, int64_t smaId, const SArray* data); diff --git a/source/dnode/vnode/src/sma/smaOpen.c b/source/dnode/vnode/src/sma/smaOpen.c index 09929d138e..49f25c0b0a 100644 --- a/source/dnode/vnode/src/sma/smaOpen.c +++ b/source/dnode/vnode/src/sma/smaOpen.c @@ -30,7 +30,7 @@ static int32_t rsmaRestore(SSma *pSma); pKeepCfg->keepTimeOffset = 0; \ } while (0) -#define SMA_OPEN_RSMA_IMPL(v, l) \ +#define SMA_OPEN_RSMA_IMPL(v, l, force) \ do { \ SRetention *r = (SRetention *)VND_RETENTIONS(v) + l; \ if (!RETENTION_VALID(r)) { \ @@ -42,7 +42,7 @@ static int32_t rsmaRestore(SSma *pSma); } \ code = smaSetKeepCfg(v, &keepCfg, pCfg, TSDB_TYPE_RSMA_L##l); \ TSDB_CHECK_CODE(code, lino, _exit); \ - if (tsdbOpen(v, &SMA_RSMA_TSDB##l(pSma), VNODE_RSMA##l##_DIR, &keepCfg, rollback) < 0) { \ + if (tsdbOpen(v, &SMA_RSMA_TSDB##l(pSma), VNODE_RSMA##l##_DIR, &keepCfg, rollback, force) < 0) { \ code = terrno; \ TSDB_CHECK_CODE(code, lino, _exit); \ } \ @@ -118,7 +118,7 @@ int smaSetKeepCfg(SVnode *pVnode, STsdbKeepCfg *pKeepCfg, STsdbCfg *pCfg, int ty return terrno; } -int32_t smaOpen(SVnode *pVnode, int8_t rollback) { +int32_t smaOpen(SVnode *pVnode, int8_t rollback, bool force) { int32_t code = 0; int32_t lino = 0; STsdbCfg *pCfg = &pVnode->config.tsdbCfg; @@ -139,11 +139,11 @@ int32_t smaOpen(SVnode *pVnode, int8_t rollback) { STsdbKeepCfg keepCfg = {0}; for (int32_t i = 0; i < TSDB_RETENTION_MAX; ++i) { if (i == TSDB_RETENTION_L0) { - SMA_OPEN_RSMA_IMPL(pVnode, 0); + SMA_OPEN_RSMA_IMPL(pVnode, 0, force); } else if (i == TSDB_RETENTION_L1) { - SMA_OPEN_RSMA_IMPL(pVnode, 1); + SMA_OPEN_RSMA_IMPL(pVnode, 1, force); } else if (i == TSDB_RETENTION_L2) { - SMA_OPEN_RSMA_IMPL(pVnode, 2); + SMA_OPEN_RSMA_IMPL(pVnode, 2, force); } } diff --git a/source/dnode/vnode/src/sma/smaSnapshot.c b/source/dnode/vnode/src/sma/smaSnapshot.c index e01a33936b..c93d9a7de6 100644 --- a/source/dnode/vnode/src/sma/smaSnapshot.c +++ b/source/dnode/vnode/src/sma/smaSnapshot.c @@ -48,7 +48,7 @@ int32_t rsmaSnapReaderOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapRead // open rsma1/rsma2 for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { if (pSma->pRSmaTsdb[i]) { - code = tsdbSnapReaderOpen(pSma->pRSmaTsdb[i], sver, ever, i == 0 ? SNAP_DATA_RSMA1 : SNAP_DATA_RSMA2, + code = tsdbSnapReaderOpen(pSma->pRSmaTsdb[i], sver, ever, (i == 0 ? SNAP_DATA_RSMA1 : SNAP_DATA_RSMA2), NULL, &pReader->pDataReader[i]); TSDB_CHECK_CODE(code, lino, _exit); } @@ -128,7 +128,7 @@ struct SRSmaSnapWriter { STsdbSnapWriter* pDataWriter[TSDB_RETENTION_L2]; }; -int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapWriter** ppWriter) { +int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, void** ppRanges, SRSmaSnapWriter** ppWriter) { int32_t code = 0; int32_t lino = 0; SVnode* pVnode = pSma->pVnode; @@ -147,7 +147,7 @@ int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRSmaSnapWrit // rsma1/rsma2 for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { if (pSma->pRSmaTsdb[i]) { - code = tsdbSnapWriterOpen(pSma->pRSmaTsdb[i], sver, ever, &pWriter->pDataWriter[i]); + code = tsdbSnapWriterOpen(pSma->pRSmaTsdb[i], sver, ever, ((void**)ppRanges)[i], &pWriter->pDataWriter[i]); TSDB_CHECK_CODE(code, lino, _exit); } } @@ -165,6 +165,21 @@ _exit: return code; } +int32_t rsmaSnapWriterPrepareClose(SRSmaSnapWriter* pWriter) { + int32_t code = 0; + for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { + if (pWriter->pDataWriter[i]) { + code = tsdbSnapWriterPrepareClose(pWriter->pDataWriter[i]); + if (code) { + smaError("vgId:%d, failed to prepare close tsdbSnapWriter since %s. i: %d", SMA_VID(pWriter->pSma), terrstr(), + i); + return -1; + } + } + } + return code; +} + int32_t rsmaSnapWriterClose(SRSmaSnapWriter** ppWriter, int8_t rollback) { int32_t code = 0; int32_t lino = 0; diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 98464d082c..a5832d3c66 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -1200,6 +1200,9 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) { pStreamTask->status.taskStatus = TASK_STATUS__HALT; nextProcessedVer = walReaderGetCurrentVer(pStreamTask->exec.pWalReader); + if (nextProcessedVer == -1) { + nextProcessedVer = pStreamTask->dataRange.range.maxVer + 1; + } tqDebug("s-task:%s level:%d nextProcessedVer:%" PRId64 ", sched-status:%d is halt by fill-history task:%s", pStreamTask->id.idStr, pStreamTask->info.taskLevel, nextProcessedVer, pStreamTask->status.schedStatus, @@ -1975,4 +1978,4 @@ int32_t tqProcessTaskResetReq(STQ* pTq, SRpcMsg* pMsg) { streamMetaReleaseTask(pMeta, pTask); return TSDB_CODE_SUCCESS; -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c index 6e4cb517ff..df6b85a889 100644 --- a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c +++ b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c @@ -15,10 +15,6 @@ #include "tsdbDataFileRW.h" -extern int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize, - TTombBlkArray *tombBlkArray, uint8_t **bufArr); -extern int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize); - // SDataFileReader ============================================= struct SDataFileReader { SDataFileReaderConfig config[1]; @@ -491,6 +487,9 @@ struct SDataFileWriter { int32_t tombBlkArrayIdx; STombBlock tombBlock[1]; int32_t tombBlockIdx; + // range + SVersionRange range; + SVersionRange tombRange; } ctx[1]; STFile files[TSDB_FTYPE_MAX]; @@ -589,6 +588,8 @@ static int32_t tsdbDataFileWriterDoOpen(SDataFileWriter *writer) { .fid = writer->config->fid, .cid = writer->config->cid, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; // .data @@ -602,6 +603,8 @@ static int32_t tsdbDataFileWriterDoOpen(SDataFileWriter *writer) { .fid = writer->config->fid, .cid = writer->config->cid, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; } @@ -616,6 +619,8 @@ static int32_t tsdbDataFileWriterDoOpen(SDataFileWriter *writer) { .fid = writer->config->fid, .cid = writer->config->cid, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; } @@ -627,8 +632,14 @@ static int32_t tsdbDataFileWriterDoOpen(SDataFileWriter *writer) { .fid = writer->config->fid, .cid = writer->config->cid, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; + // range + writer->ctx->range = (SVersionRange){.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; + writer->ctx->tombRange = (SVersionRange){.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; + writer->ctx->opened = true; _exit: @@ -638,8 +649,14 @@ _exit: return code; } +int32_t tsdbWriterUpdVerRange(SVersionRange *range, int64_t minVer, int64_t maxVer) { + range->minVer = TMIN(range->minVer, minVer); + range->maxVer = TMAX(range->maxVer, maxVer); + return 0; +} + int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAlg, int64_t *fileSize, - TBrinBlkArray *brinBlkArray, uint8_t **bufArr) { + TBrinBlkArray *brinBlkArray, uint8_t **bufArr, SVersionRange *range) { if (BRIN_BLOCK_SIZE(brinBlock) == 0) return 0; int32_t code; @@ -678,6 +695,8 @@ int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAl } } + tsdbWriterUpdVerRange(range, brinBlk->minVer, brinBlk->maxVer); + // write to file for (int32_t i = 0; i < ARRAY_SIZE(brinBlock->dataArr1); i++) { code = tsdbCmprData((uint8_t *)TARRAY2_DATA(brinBlock->dataArr1 + i), TARRAY2_DATA_LEN(brinBlock->dataArr1 + i), @@ -728,7 +747,8 @@ static int32_t tsdbDataFileWriteBrinBlock(SDataFileWriter *writer) { int32_t lino = 0; code = tsdbFileWriteBrinBlock(writer->fd[TSDB_FTYPE_HEAD], writer->brinBlock, writer->config->cmprAlg, - &writer->files[TSDB_FTYPE_HEAD].size, writer->brinBlkArray, writer->config->bufArr); + &writer->files[TSDB_FTYPE_HEAD].size, writer->brinBlkArray, writer->config->bufArr, + &writer->ctx->range); TSDB_CHECK_CODE(code, lino, _exit); _exit: @@ -795,6 +815,8 @@ static int32_t tsdbDataFileDoWriteBlockData(SDataFileWriter *writer, SBlockData } } + tsdbWriterUpdVerRange(&writer->ctx->range, record->minVer, record->maxVer); + // to .data file int32_t sizeArr[5] = {0}; @@ -1143,6 +1165,64 @@ int32_t tsdbFileWriteHeadFooter(STsdbFD *fd, int64_t *fileSize, const SHeadFoote return 0; } +int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize, + TTombBlkArray *tombBlkArray, uint8_t **bufArr, SVersionRange *range) { + int32_t code; + + if (TOMB_BLOCK_SIZE(tombBlock) == 0) return 0; + + STombBlk tombBlk[1] = {{ + .dp[0] = + { + .offset = *fileSize, + .size = 0, + }, + .minTbid = + { + .suid = TARRAY2_FIRST(tombBlock->suid), + .uid = TARRAY2_FIRST(tombBlock->uid), + }, + .maxTbid = + { + .suid = TARRAY2_LAST(tombBlock->suid), + .uid = TARRAY2_LAST(tombBlock->uid), + }, + .minVer = TARRAY2_FIRST(tombBlock->version), + .maxVer = TARRAY2_FIRST(tombBlock->version), + .numRec = TOMB_BLOCK_SIZE(tombBlock), + .cmprAlg = cmprAlg, + }}; + + for (int32_t i = 1; i < TOMB_BLOCK_SIZE(tombBlock); i++) { + if (tombBlk->minVer > TARRAY2_GET(tombBlock->version, i)) { + tombBlk->minVer = TARRAY2_GET(tombBlock->version, i); + } + if (tombBlk->maxVer < TARRAY2_GET(tombBlock->version, i)) { + tombBlk->maxVer = TARRAY2_GET(tombBlock->version, i); + } + } + + tsdbWriterUpdVerRange(range, tombBlk->minVer, tombBlk->maxVer); + + for (int32_t i = 0; i < ARRAY_SIZE(tombBlock->dataArr); i++) { + code = tsdbCmprData((uint8_t *)TARRAY2_DATA(&tombBlock->dataArr[i]), TARRAY2_DATA_LEN(&tombBlock->dataArr[i]), + TSDB_DATA_TYPE_BIGINT, tombBlk->cmprAlg, &bufArr[0], 0, &tombBlk->size[i], &bufArr[1]); + if (code) return code; + + code = tsdbWriteFile(fd, *fileSize, bufArr[0], tombBlk->size[i]); + if (code) return code; + + tombBlk->dp->size += tombBlk->size[i]; + *fileSize += tombBlk->size[i]; + } + + code = TARRAY2_APPEND_PTR(tombBlkArray, tombBlk); + if (code) return code; + + tTombBlockClear(tombBlock); + return 0; +} + static int32_t tsdbDataFileWriteHeadFooter(SDataFileWriter *writer) { int32_t code = 0; int32_t lino = 0; @@ -1164,7 +1244,8 @@ static int32_t tsdbDataFileDoWriteTombBlock(SDataFileWriter *writer) { int32_t lino = 0; code = tsdbFileWriteTombBlock(writer->fd[TSDB_FTYPE_TOMB], writer->tombBlock, writer->config->cmprAlg, - &writer->files[TSDB_FTYPE_TOMB].size, writer->tombBlkArray, writer->config->bufArr); + &writer->files[TSDB_FTYPE_TOMB].size, writer->tombBlkArray, writer->config->bufArr, + &writer->ctx->tombRange); TSDB_CHECK_CODE(code, lino, _exit); _exit: @@ -1174,6 +1255,21 @@ _exit: return code; } +int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize) { + ptr->size = TARRAY2_DATA_LEN(tombBlkArray); + if (ptr->size > 0) { + ptr->offset = *fileSize; + + int32_t code = tsdbWriteFile(fd, *fileSize, (const uint8_t *)TARRAY2_DATA(tombBlkArray), ptr->size); + if (code) { + return code; + } + + *fileSize += ptr->size; + } + return 0; +} + static int32_t tsdbDataFileDoWriteTombBlk(SDataFileWriter *writer) { ASSERT(TARRAY2_SIZE(writer->tombBlkArray) > 0); @@ -1306,6 +1402,12 @@ _exit: return code; } +int32_t tsdbTFileUpdVerRange(STFile *f, SVersionRange range) { + f->minVer = TMIN(f->minVer, range.minVer); + f->maxVer = TMAX(f->maxVer, range.maxVer); + return 0; +} + static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArray *opArr) { int32_t code = 0; int32_t lino = 0; @@ -1334,6 +1436,8 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr code = tsdbDataFileWriteHeadFooter(writer); TSDB_CHECK_CODE(code, lino, _exit); + SVersionRange ofRange = {.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; + // .head ftype = TSDB_FTYPE_HEAD; if (writer->config->files[ftype].exist) { @@ -1342,6 +1446,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .of = writer->config->files[ftype].file, }; + ofRange = (SVersionRange){.minVer = op.of.minVer, .maxVer = op.of.maxVer}; code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1350,6 +1455,8 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, ofRange); + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); @@ -1361,6 +1468,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } else if (writer->config->files[ftype].file.size != writer->files[ftype].size) { @@ -1370,6 +1478,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .of = writer->config->files[ftype].file, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1382,6 +1491,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } else if (writer->config->files[ftype].file.size != writer->files[ftype].size) { @@ -1391,6 +1501,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .of = writer->config->files[ftype].file, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1415,6 +1526,8 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr code = tsdbDataFileWriteTombFooter(writer); TSDB_CHECK_CODE(code, lino, _exit); + SVersionRange ofRange = (SVersionRange){.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; + ftype = TSDB_FTYPE_TOMB; if (writer->config->files[ftype].exist) { op = (STFileOp){ @@ -1422,6 +1535,7 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .of = writer->config->files[ftype].file, }; + ofRange = (SVersionRange){.minVer = op.of.minVer, .maxVer = op.of.maxVer}; code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1430,6 +1544,8 @@ static int32_t tsdbDataFileWriterCloseCommit(SDataFileWriter *writer, TFileOpArr .fid = writer->config->fid, .nf = writer->files[ftype], }; + tsdbTFileUpdVerRange(&op.nf, ofRange); + tsdbTFileUpdVerRange(&op.nf, writer->ctx->tombRange); code = TARRAY2_APPEND(opArr, op); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1598,6 +1714,7 @@ int32_t tsdbDataFileWriteBlockData(SDataFileWriter *writer, SBlockData *bData) { ) { code = tsdbDataFileDoWriteBlockData(writer, bData); TSDB_CHECK_CODE(code, lino, _exit); + } else { for (int32_t i = 0; i < bData->nRow; ++i) { TSDBROW row[1] = {tsdbRowFromBlockData(bData, i)}; diff --git a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.h b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.h index 827b58fb4a..c4aed6e787 100644 --- a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.h +++ b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.h @@ -95,10 +95,25 @@ int32_t tsdbDataFileWriteRow(SDataFileWriter *writer, SRowInfo *row); int32_t tsdbDataFileWriteBlockData(SDataFileWriter *writer, SBlockData *bData); int32_t tsdbDataFileFlush(SDataFileWriter *writer); +// head +int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAlg, int64_t *fileSize, + TBrinBlkArray *brinBlkArray, uint8_t **bufArr, SVersionRange *range); +int32_t tsdbFileWriteBrinBlk(STsdbFD *fd, TBrinBlkArray *brinBlkArray, SFDataPtr *ptr, int64_t *fileSize); +int32_t tsdbFileWriteHeadFooter(STsdbFD *fd, int64_t *fileSize, const SHeadFooter *footer); + +// tomb int32_t tsdbDataFileWriteTombRecord(SDataFileWriter *writer, const STombRecord *record); +int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize, + TTombBlkArray *tombBlkArray, uint8_t **bufArr, SVersionRange *range); +int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize); +int32_t tsdbFileWriteTombFooter(STsdbFD *fd, const STombFooter *footer, int64_t *fileSize); + +// utils +int32_t tsdbWriterUpdVerRange(SVersionRange *range, int64_t minVer, int64_t maxVer); +int32_t tsdbTFileUpdVerRange(STFile *f, SVersionRange range); #ifdef __cplusplus } #endif -#endif /*_TSDB_DATA_FILE_RW_H*/ \ No newline at end of file +#endif /*_TSDB_DATA_FILE_RW_H*/ diff --git a/source/dnode/vnode/src/tsdb/tsdbFS2.c b/source/dnode/vnode/src/tsdb/tsdbFS2.c index afe6ef6e1a..93a16b5502 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS2.c @@ -38,13 +38,6 @@ typedef struct { STFileHashEntry **buckets; } STFileHash; -enum { - TSDB_FS_STATE_NONE = 0, - TSDB_FS_STATE_OPEN, - TSDB_FS_STATE_EDIT, - TSDB_FS_STATE_CLOSE, -}; - static const char *gCurrentFname[] = { [TSDB_FCURRENT] = "current.json", [TSDB_FCURRENT_C] = "current.c.json", @@ -57,7 +50,7 @@ static int32_t create_fs(STsdb *pTsdb, STFileSystem **fs) { fs[0]->tsdb = pTsdb; tsem_init(&fs[0]->canEdit, 0, 1); - fs[0]->state = TSDB_FS_STATE_NONE; + fs[0]->fsstate = TSDB_FS_STATE_NORMAL; fs[0]->neid = 0; TARRAY2_INIT(fs[0]->fSetArr); TARRAY2_INIT(fs[0]->fSetArrTmp); @@ -258,14 +251,6 @@ _exit: return code; } -static bool is_same_file(const STFile *f1, const STFile f2) { - if (f1->type != f2.type) return false; - if (f1->did.level != f2.did.level) return false; - if (f1->did.id != f2.did.id) return false; - if (f1->cid != f2.cid) return false; - return true; -} - static int32_t apply_commit(STFileSystem *fs) { int32_t code = 0; TFileSetArray *fsetArray1 = fs->fSetArr; @@ -504,6 +489,7 @@ static void tsdbFSDestroyFileObjHash(STFileHash *hash) { static int32_t tsdbFSDoSanAndFix(STFileSystem *fs) { int32_t code = 0; int32_t lino = 0; + int32_t corrupt = false; { // scan each file STFileSet *fset = NULL; @@ -511,8 +497,12 @@ static int32_t tsdbFSDoSanAndFix(STFileSystem *fs) { // data file for (int32_t ftype = 0; ftype < TSDB_FTYPE_MAX; ftype++) { if (fset->farr[ftype] == NULL) continue; - code = tsdbFSDoScanAndFixFile(fs, fset->farr[ftype]); - TSDB_CHECK_CODE(code, lino, _exit); + STFileObj *fobj = fset->farr[ftype]; + code = tsdbFSDoScanAndFixFile(fs, fobj); + if (code) { + fset->maxVerValid = (fobj->f->minVer <= fobj->f->maxVer) ? TMIN(fset->maxVerValid, fobj->f->minVer - 1) : -1; + corrupt = true; + } } // stt file @@ -521,12 +511,22 @@ static int32_t tsdbFSDoSanAndFix(STFileSystem *fs) { STFileObj *fobj; TARRAY2_FOREACH(lvl->fobjArr, fobj) { code = tsdbFSDoScanAndFixFile(fs, fobj); - TSDB_CHECK_CODE(code, lino, _exit); + if (code) { + fset->maxVerValid = (fobj->f->minVer <= fobj->f->maxVer) ? TMIN(fset->maxVerValid, fobj->f->minVer - 1) : -1; + corrupt = true; + } } } } } + if (corrupt) { + tsdbError("vgId:%d, not to clear dangling files due to fset incompleteness", TD_VID(fs->tsdb->pVnode)); + fs->fsstate = TSDB_FS_STATE_INCOMPLETE; + code = 0; + goto _exit; + } + { // clear unreferenced files STfsDir *dir = tfsOpendir(fs->tsdb->pVnode->pTfs, fs->tsdb->path); if (dir == NULL) { @@ -961,6 +961,13 @@ int32_t tsdbFSDestroyCopySnapshot(TFileSetArray **fsetArr) { } int32_t tsdbFSCreateRefSnapshot(STFileSystem *fs, TFileSetArray **fsetArr) { + taosThreadRwlockRdlock(&fs->tsdb->rwLock); + int32_t code = tsdbFSCreateRefSnapshotWithoutLock(fs, fsetArr); + taosThreadRwlockUnlock(&fs->tsdb->rwLock); + return code; +} + +int32_t tsdbFSCreateRefSnapshotWithoutLock(STFileSystem *fs, TFileSetArray **fsetArr) { int32_t code = 0; STFileSet *fset, *fset1; @@ -991,6 +998,142 @@ int32_t tsdbFSDestroyRefSnapshot(TFileSetArray **fsetArr) { return 0; } +int32_t tsdbFSCreateCopyRangedSnapshot(STFileSystem *fs, TSnapRangeArray *pRanges, TFileSetArray **fsetArr, + TFileOpArray *fopArr) { + int32_t code = 0; + STFileSet *fset; + STFileSet *fset1; + SHashObj *pHash = NULL; + + fsetArr[0] = taosMemoryMalloc(sizeof(TFileSetArray)); + if (fsetArr == NULL) return TSDB_CODE_OUT_OF_MEMORY; + TARRAY2_INIT(fsetArr[0]); + + if (pRanges) { + pHash = tsdbGetSnapRangeHash(pRanges); + if (pHash == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _out; + } + } + + taosThreadRwlockRdlock(&fs->tsdb->rwLock); + TARRAY2_FOREACH(fs->fSetArr, fset) { + int64_t ever = VERSION_MAX; + if (pHash) { + int32_t fid = fset->fid; + STSnapRange *u = taosHashGet(pHash, &fid, sizeof(fid)); + if (u) { + ever = u->sver - 1; + } + } + + code = tsdbTFileSetFilteredInitDup(fs->tsdb, fset, ever, &fset1, fopArr); + if (code) break; + + code = TARRAY2_APPEND(fsetArr[0], fset1); + if (code) break; + } + taosThreadRwlockUnlock(&fs->tsdb->rwLock); + +_out: + if (code) { + TARRAY2_DESTROY(fsetArr[0], tsdbTFileSetClear); + taosMemoryFree(fsetArr[0]); + fsetArr[0] = NULL; + } + if (pHash) { + taosHashCleanup(pHash); + pHash = NULL; + } + return code; +} + +SHashObj *tsdbGetSnapRangeHash(TSnapRangeArray *pRanges) { + int32_t capacity = TARRAY2_SIZE(pRanges) * 2; + SHashObj *pHash = taosHashInit(capacity, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_ENTRY_LOCK); + if (pHash == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + for (int32_t i = 0; i < TARRAY2_SIZE(pRanges); i++) { + STSnapRange *u = TARRAY2_GET(pRanges, i); + int32_t fid = u->fid; + int32_t code = taosHashPut(pHash, &fid, sizeof(fid), u, sizeof(*u)); + ASSERT(code == 0); + tsdbDebug("range diff hash fid:%d, sver:%" PRId64 ", ever:%" PRId64, u->fid, u->sver, u->ever); + } + return pHash; +} + +int32_t tsdbFSCreateRefRangedSnapshot(STFileSystem *fs, int64_t sver, int64_t ever, TSnapRangeArray *pRanges, + TSnapRangeArray **fsrArr) { + int32_t code = 0; + STFileSet *fset; + STSnapRange *fsr1 = NULL; + SHashObj *pHash = NULL; + + fsrArr[0] = taosMemoryCalloc(1, sizeof(*fsrArr[0])); + if (fsrArr[0] == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _out; + } + + tsdbInfo("pRanges size:%d", (pRanges == NULL ? 0 : TARRAY2_SIZE(pRanges))); + if (pRanges) { + pHash = tsdbGetSnapRangeHash(pRanges); + if (pHash == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _out; + } + } + + taosThreadRwlockRdlock(&fs->tsdb->rwLock); + TARRAY2_FOREACH(fs->fSetArr, fset) { + int64_t sver1 = sver; + int64_t ever1 = ever; + + if (pHash) { + int32_t fid = fset->fid; + STSnapRange *u = taosHashGet(pHash, &fid, sizeof(fid)); + if (u) { + sver1 = u->sver; + tsdbDebug("range hash get fid:%d, sver:%" PRId64 ", ever:%" PRId64, u->fid, u->sver, u->ever); + } + } + + if (sver1 > ever1) { + tsdbDebug("skip fid:%d, sver:%" PRId64 ", ever:%" PRId64, fset->fid, sver1, ever1); + continue; + } + + tsdbDebug("fsrArr:%p, fid:%d, sver:%" PRId64 ", ever:%" PRId64, fsrArr, fset->fid, sver1, ever1); + + code = tsdbTSnapRangeInitRef(fs->tsdb, fset, sver1, ever1, &fsr1); + if (code) break; + + code = TARRAY2_APPEND(fsrArr[0], fsr1); + if (code) break; + + fsr1 = NULL; + } + taosThreadRwlockUnlock(&fs->tsdb->rwLock); + + if (code) { + tsdbTSnapRangeClear(&fsr1); + TARRAY2_DESTROY(fsrArr[0], tsdbTSnapRangeClear); + fsrArr[0] = NULL; + } + +_out: + if (pHash) { + taosHashCleanup(pHash); + pHash = NULL; + } + return code; +} + const char *gFSBgTaskName[] = {NULL, "MERGE", "RETENTION", "COMPACT"}; static int32_t tsdbFSRunBgTask(void *arg) { @@ -1148,4 +1291,4 @@ int32_t tsdbFSEnableBgTask(STFileSystem *fs) { fs->stop = false; taosThreadMutexUnlock(fs->mutex); return 0; -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/tsdb/tsdbFS2.h b/source/dnode/vnode/src/tsdb/tsdbFS2.h index b0f42a0c48..31b98e5656 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS2.h +++ b/source/dnode/vnode/src/tsdb/tsdbFS2.h @@ -52,7 +52,15 @@ int32_t tsdbCloseFS(STFileSystem **fs); int32_t tsdbFSCreateCopySnapshot(STFileSystem *fs, TFileSetArray **fsetArr); int32_t tsdbFSDestroyCopySnapshot(TFileSetArray **fsetArr); int32_t tsdbFSCreateRefSnapshot(STFileSystem *fs, TFileSetArray **fsetArr); +int32_t tsdbFSCreateRefSnapshotWithoutLock(STFileSystem *fs, TFileSetArray **fsetArr); int32_t tsdbFSDestroyRefSnapshot(TFileSetArray **fsetArr); + +int32_t tsdbFSCreateCopyRangedSnapshot(STFileSystem *fs, TSnapRangeArray *pExclude, TFileSetArray **fsetArr, + TFileOpArray *fopArr); +int32_t tsdbFSDestroyCopyRangedSnapshot(TFileSetArray **fsetArr, TFileOpArray *fopArr); +int32_t tsdbFSCreateRefRangedSnapshot(STFileSystem *fs, int64_t sver, int64_t ever, TSnapRangeArray *pRanges, + TSnapRangeArray **fsrArr); +int32_t tsdbFSDestroyRefRangedSnapshot(TSnapRangeArray **fsrArr); // txn int64_t tsdbFSAllocEid(STFileSystem *fs); int32_t tsdbFSEditBegin(STFileSystem *fs, const TFileOpArray *opArray, EFEditT etype); @@ -68,6 +76,9 @@ int32_t tsdbFSEnableBgTask(STFileSystem *fs); // other int32_t tsdbFSGetFSet(STFileSystem *fs, int32_t fid, STFileSet **fset); int32_t tsdbFSCheckCommit(STFileSystem *fs); +// utils +int32_t save_fs(const TFileSetArray *arr, const char *fname); +int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype); struct STFSBgTask { EFSBgTaskT type; @@ -91,7 +102,7 @@ struct STFSBgTask { struct STFileSystem { STsdb *tsdb; tsem_t canEdit; - int32_t state; + int32_t fsstate; int64_t neid; EFEditT etype; TFileSetArray fSetArr[1]; diff --git a/source/dnode/vnode/src/tsdb/tsdbFSet2.c b/source/dnode/vnode/src/tsdb/tsdbFSet2.c index cd47a54973..620fcb3a47 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSet2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFSet2.c @@ -65,6 +65,34 @@ static int32_t tsdbSttLvlInitRef(STsdb *pTsdb, const SSttLvl *lvl1, SSttLvl **lv return 0; } +static int32_t tsdbSttLvlFilteredInitEx(STsdb *pTsdb, const SSttLvl *lvl1, int64_t ever, SSttLvl **lvl, + TFileOpArray *fopArr) { + int32_t code = tsdbSttLvlInit(lvl1->level, lvl); + if (code) return code; + + const STFileObj *fobj1; + TARRAY2_FOREACH(lvl1->fobjArr, fobj1) { + if (fobj1->f->maxVer <= ever) { + STFileObj *fobj; + code = tsdbTFileObjInit(pTsdb, fobj1->f, &fobj); + if (code) { + tsdbSttLvlClear(lvl); + return code; + } + + TARRAY2_APPEND(lvl[0]->fobjArr, fobj); + } else { + STFileOp op = { + .optype = TSDB_FOP_REMOVE, + .fid = fobj1->f->fid, + .of = fobj1->f[0], + }; + TARRAY2_APPEND(fopArr, op); + } + } + return 0; +} + static void tsdbSttLvlRemoveFObj(void *data) { tsdbTFileObjRemove(*(STFileObj **)data); } static void tsdbSttLvlRemove(SSttLvl **lvl) { TARRAY2_DESTROY(lvl[0]->fobjArr, tsdbSttLvlRemoveFObj); @@ -424,6 +452,7 @@ int32_t tsdbTFileSetInit(int32_t fid, STFileSet **fset) { if (fset[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY; fset[0]->fid = fid; + fset[0]->maxVerValid = VERSION_MAX; TARRAY2_INIT(fset[0]->lvlArr); return 0; } @@ -458,6 +487,61 @@ int32_t tsdbTFileSetInitDup(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fs return 0; } +int32_t tsdbTFileSetFilteredInitDup(STsdb *pTsdb, const STFileSet *fset1, int64_t ever, STFileSet **fset, + TFileOpArray *fopArr) { + int32_t code = tsdbTFileSetInit(fset1->fid, fset); + if (code) return code; + + for (int32_t ftype = TSDB_FTYPE_MIN; ftype < TSDB_FTYPE_MAX; ++ftype) { + if (fset1->farr[ftype] == NULL) continue; + STFileObj *fobj = fset1->farr[ftype]; + if (fobj->f->maxVer <= ever) { + code = tsdbTFileObjInit(pTsdb, fobj->f, &fset[0]->farr[ftype]); + if (code) { + tsdbTFileSetClear(fset); + return code; + } + } else { + STFileOp op = { + .optype = TSDB_FOP_REMOVE, + .fid = fobj->f->fid, + .of = fobj->f[0], + }; + TARRAY2_APPEND(fopArr, op); + } + } + + const SSttLvl *lvl1; + TARRAY2_FOREACH(fset1->lvlArr, lvl1) { + SSttLvl *lvl; + code = tsdbSttLvlFilteredInitEx(pTsdb, lvl1, ever, &lvl, fopArr); + if (code) { + tsdbTFileSetClear(fset); + return code; + } + + code = TARRAY2_APPEND(fset[0]->lvlArr, lvl); + if (code) return code; + } + + return 0; +} + +int32_t tsdbTSnapRangeInitRef(STsdb *pTsdb, const STFileSet *fset1, int64_t sver, int64_t ever, STSnapRange **fsr) { + fsr[0] = taosMemoryCalloc(1, sizeof(*fsr[0])); + if (fsr[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY; + fsr[0]->fid = fset1->fid; + fsr[0]->sver = sver; + fsr[0]->ever = ever; + + int32_t code = tsdbTFileSetInitRef(pTsdb, fset1, &fsr[0]->fset); + if (code) { + taosMemoryFree(fsr[0]); + fsr[0] = NULL; + } + return code; +} + int32_t tsdbTFileSetInitRef(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fset) { int32_t code = tsdbTFileSetInit(fset1->fid, fset); if (code) return code; @@ -485,6 +569,15 @@ int32_t tsdbTFileSetInitRef(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fs return 0; } +int32_t tsdbTSnapRangeClear(STSnapRange **fsr) { + if (!fsr[0]) return 0; + + tsdbTFileSetClear(&fsr[0]->fset); + taosMemoryFree(fsr[0]); + fsr[0] = NULL; + return 0; +} + int32_t tsdbTFileSetClear(STFileSet **fset) { if (!fset[0]) return 0; @@ -545,4 +638,4 @@ bool tsdbTFileSetIsEmpty(const STFileSet *fset) { if (fset->farr[ftype] != NULL) return false; } return TARRAY2_SIZE(fset->lvlArr) == 0; -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/tsdb/tsdbFSet2.h b/source/dnode/vnode/src/tsdb/tsdbFSet2.h index d7b3c1fc8c..ea0f99f68e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSet2.h +++ b/source/dnode/vnode/src/tsdb/tsdbFSet2.h @@ -45,6 +45,13 @@ int32_t tsdbTFileSetInitDup(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fs int32_t tsdbTFileSetInitRef(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fset); int32_t tsdbTFileSetClear(STFileSet **fset); int32_t tsdbTFileSetRemove(STFileSet **fset); + +int32_t tsdbTFileSetFilteredInitDup(STsdb *pTsdb, const STFileSet *fset1, int64_t ever, STFileSet **fset, + TFileOpArray *fopArr); + +int32_t tsdbTSnapRangeInitRef(STsdb *pTsdb, const STFileSet *fset1, int64_t sver, int64_t ever, STSnapRange **fsr); +int32_t tsdbTSnapRangeClear(STSnapRange **fsr); + // to/from json int32_t tsdbTFileSetToJson(const STFileSet *fset, cJSON *json); int32_t tsdbJsonToTFileSet(STsdb *pTsdb, const cJSON *json, STFileSet **fset); @@ -59,6 +66,9 @@ int64_t tsdbTFileSetMaxCid(const STFileSet *fset); SSttLvl *tsdbTFileSetGetSttLvl(STFileSet *fset, int32_t level); // is empty bool tsdbTFileSetIsEmpty(const STFileSet *fset); +// stt +int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl); +int32_t tsdbSttLvlClear(SSttLvl **lvl); struct STFileOp { tsdb_fop_t optype; @@ -74,12 +84,20 @@ struct SSttLvl { struct STFileSet { int32_t fid; + int64_t maxVerValid; STFileObj *farr[TSDB_FTYPE_MAX]; // file array TSttLvlArray lvlArr[1]; // level array }; +struct STSnapRange { + int32_t fid; + int64_t sver; + int64_t ever; + STFileSet *fset; +}; + #ifdef __cplusplus } #endif -#endif /*_TSDB_FILE_SET2_H*/ \ No newline at end of file +#endif /*_TSDB_FILE_SET2_H*/ diff --git a/source/dnode/vnode/src/tsdb/tsdbFSetRW.c b/source/dnode/vnode/src/tsdb/tsdbFSetRW.c index 83ae8c2429..e6b3cf8f54 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSetRW.c +++ b/source/dnode/vnode/src/tsdb/tsdbFSetRW.c @@ -292,4 +292,4 @@ _exit: TSDB_ERROR_LOG(TD_VID(writer->config->tsdb->pVnode), lino, code); } return code; -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/tsdb/tsdbFSetRW.h b/source/dnode/vnode/src/tsdb/tsdbFSetRW.h index b5710407cf..0a8049cded 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSetRW.h +++ b/source/dnode/vnode/src/tsdb/tsdbFSetRW.h @@ -52,4 +52,4 @@ int32_t tsdbFSetWriteTombRecord(SFSetWriter *writer, const STombRecord *tombReco } #endif -#endif /*_TSDB_FSET_RW_H*/ \ No newline at end of file +#endif /*_TSDB_FSET_RW_H*/ diff --git a/source/dnode/vnode/src/tsdb/tsdbFile2.c b/source/dnode/vnode/src/tsdb/tsdbFile2.c index 3d8964d41b..963c5bad34 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFile2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFile2.c @@ -76,6 +76,17 @@ static int32_t tfile_to_json(const STFile *file, cJSON *json) { return TSDB_CODE_OUT_OF_MEMORY; } + if (file->minVer <= file->maxVer) { + /* minVer */ + if (cJSON_AddNumberToObject(json, "minVer", file->minVer) == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + /* maxVer */ + if (cJSON_AddNumberToObject(json, "maxVer", file->maxVer) == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + } return 0; } @@ -122,6 +133,19 @@ static int32_t tfile_from_json(const cJSON *json, STFile *file) { return TSDB_CODE_FILE_CORRUPTED; } + /* minVer */ + file->minVer = VERSION_MAX; + item = cJSON_GetObjectItem(json, "minVer"); + if (cJSON_IsNumber(item)) { + file->minVer = item->valuedouble; + } + + /* maxVer */ + file->maxVer = VERSION_MIN; + item = cJSON_GetObjectItem(json, "maxVer"); + if (cJSON_IsNumber(item)) { + file->maxVer = item->valuedouble; + } return 0; } @@ -296,4 +320,4 @@ int32_t tsdbTFileObjCmpr(const STFileObj **fobj1, const STFileObj **fobj2) { } else { return 0; } -} \ No newline at end of file +} diff --git a/source/dnode/vnode/src/tsdb/tsdbFile2.h b/source/dnode/vnode/src/tsdb/tsdbFile2.h index 11d08e45e6..33d8ac5478 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFile2.h +++ b/source/dnode/vnode/src/tsdb/tsdbFile2.h @@ -61,6 +61,8 @@ struct STFile { int32_t fid; // file id int64_t cid; // commit id int64_t size; + int64_t minVer; + int64_t maxVer; union { struct { int32_t level; @@ -80,4 +82,4 @@ struct STFileObj { } #endif -#endif /*_TSDB_FILE_H*/ \ No newline at end of file +#endif /*_TSDB_FILE_H*/ diff --git a/source/dnode/vnode/src/tsdb/tsdbMerge.c b/source/dnode/vnode/src/tsdb/tsdbMerge.c index 42a8b5bb3f..e659cedba3 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMerge.c +++ b/source/dnode/vnode/src/tsdb/tsdbMerge.c @@ -313,6 +313,7 @@ static int32_t tsdbMergeFileSetBeginOpenWriter(SMerger *merger) { if (merger->ctx->fset->farr[ftype]) { config.files[ftype].exist = true; config.files[ftype].file = merger->ctx->fset->farr[ftype]->f[0]; + } else { config.files[ftype].exist = false; } diff --git a/source/dnode/vnode/src/tsdb/tsdbOpen.c b/source/dnode/vnode/src/tsdb/tsdbOpen.c index b060edbd91..6dd66c7a40 100644 --- a/source/dnode/vnode/src/tsdb/tsdbOpen.c +++ b/source/dnode/vnode/src/tsdb/tsdbOpen.c @@ -35,7 +35,7 @@ int32_t tsdbSetKeepCfg(STsdb *pTsdb, STsdbCfg *pCfg) { * @param dir * @return int */ -int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKeepCfg, int8_t rollback) { +int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKeepCfg, int8_t rollback, bool force) { STsdb *pTsdb = NULL; int slen = 0; @@ -72,6 +72,11 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee goto _err; } + if (pTsdb->pFS->fsstate == TSDB_FS_STATE_INCOMPLETE && force == false) { + terrno = TSDB_CODE_NEED_RETRY; + goto _err; + } + if (tsdbOpenCache(pTsdb) < 0) { goto _err; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index 1139524cb3..65cebf0ca0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -2670,6 +2670,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { STableBlockScanInfo* pScanInfo = NULL; SFileDataBlockInfo* pBlockInfo = getCurrentBlockInfo(pBlockIter); SLastBlockReader* pLastBlockReader = pReader->status.fileIter.pLastBlockReader; + bool asc = ASCENDING_TRAVERSE(pReader->info.order); if (pReader->pIgnoreTables && taosHashGet(*pReader->pIgnoreTables, &pBlockInfo->uid, sizeof(pBlockInfo->uid))) { setBlockAllDumped(&pStatus->fBlockDumpInfo, pBlockInfo->record.lastKey, pReader->info.order); @@ -2705,8 +2706,8 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { } else { bool bHasDataInLastBlock = hasDataInLastBlock(pLastBlockReader); int64_t tsLast = bHasDataInLastBlock ? getCurrentKeyInLastBlock(pLastBlockReader) : INT64_MIN; - if (!bHasDataInLastBlock || ((ASCENDING_TRAVERSE(pReader->info.order) && pBlockInfo->record.lastKey < tsLast) || - (!ASCENDING_TRAVERSE(pReader->info.order) && pBlockInfo->record.firstKey > tsLast))) { + if (!bHasDataInLastBlock || + ((asc && pBlockInfo->record.lastKey < tsLast) || (!asc && pBlockInfo->record.firstKey > tsLast))) { // whole block is required, return it directly SDataBlockInfo* pInfo = &pReader->resBlockInfo.pResBlock->info; pInfo->rows = pBlockInfo->record.numRow; @@ -2728,26 +2729,28 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { tBlockDataReset(pBData); SSDataBlock* pResBlock = pReader->resBlockInfo.pResBlock; - tsdbDebug("load data in last block firstly %s", pReader->idStr); + tsdbDebug("load data in last block firstly %s", pReader->idStr); int64_t st = taosGetTimestampUs(); - while (1) { - bool hasBlockLData = hasDataInLastBlock(pLastBlockReader); - - // no data in last block and block, no need to proceed. - if (hasBlockLData == false) { - break; - } - + // no data in last block, no need to proceed. + while (hasDataInLastBlock(pLastBlockReader)) { code = buildComposedDataBlockImpl(pReader, pScanInfo, &pReader->status.fileBlockData, pLastBlockReader); - if (code) { + if (code != TSDB_CODE_SUCCESS) { return code; } if (pResBlock->info.rows >= pReader->resBlockInfo.capacity) { break; } + + // data in stt now overlaps with current active file data block, need to composed with file data block. + int64_t keyInStt = getCurrentKeyInLastBlock(pLastBlockReader); + if ((keyInStt >= pBlockInfo->record.firstKey && asc) || (keyInStt <= pBlockInfo->record.lastKey && (!asc))) { + tsdbDebug("%p keyInStt:%" PRId64 ", overlap with file block, brange:%" PRId64 "-%" PRId64 " %s", pReader, + keyInStt, pBlockInfo->record.firstKey, pBlockInfo->record.lastKey, pReader->idStr); + break; + } } double el = (taosGetTimestampUs() - st) / 1000.0; @@ -2760,7 +2763,6 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { pResBlock->info.rows, el, pReader->idStr); } } - } return (pReader->code != TSDB_CODE_SUCCESS) ? pReader->code : code; @@ -4947,7 +4949,7 @@ int32_t tsdbTakeReadSnap2(STsdbReader* pReader, _query_reseek_func_t reseek, STs } // fs - code = tsdbFSCreateRefSnapshot(pTsdb->pFS, &pSnap->pfSetArray); + code = tsdbFSCreateRefSnapshotWithoutLock(pTsdb->pFS, &pSnap->pfSetArray); // unlock taosThreadRwlockUnlock(&pTsdb->rwLock); diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c index c3b1a18fd8..f2665dcf26 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRetention.c +++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c @@ -151,6 +151,8 @@ static int32_t tsdbDoMigrateFileObj(SRTNer *rtner, const STFileObj *fobj, const .type = fobj->f->type, .did = did[0], .fid = fobj->f->fid, + .minVer = fobj->f->minVer, + .maxVer = fobj->f->maxVer, .cid = fobj->f->cid, .size = fobj->f->size, .stt[0] = @@ -198,6 +200,8 @@ static int32_t tsdbMigrateDataFileS3(SRTNer *rtner, const STFileObj *fobj, const .type = fobj->f->type, .did = did[0], .fid = fobj->f->fid, + .minVer = fobj->f->minVer, + .maxVer = fobj->f->maxVer, .cid = fobj->f->cid, .size = fobj->f->size, .stt[0] = diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index e4011ca400..3b4827a6be 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -32,12 +32,12 @@ struct STsdbSnapReader { uint8_t* aBuf[5]; SSkmInfo skmTb[1]; - TFileSetArray* fsetArr; + TSnapRangeArray* fsrArr; // context struct { - int32_t fsetArrIdx; - STFileSet* fset; + int32_t fsrArrIdx; + STSnapRange* fsr; bool isDataDone; bool isTombDone; } ctx[1]; @@ -72,10 +72,10 @@ static int32_t tsdbSnapReadFileSetOpenReader(STsdbSnapReader* reader) { }; bool hasDataFile = false; for (int32_t ftype = 0; ftype < TSDB_FTYPE_MAX; ftype++) { - if (reader->ctx->fset->farr[ftype] != NULL) { + if (reader->ctx->fsr->fset->farr[ftype] != NULL) { hasDataFile = true; config.files[ftype].exist = true; - config.files[ftype].file = reader->ctx->fset->farr[ftype]->f[0]; + config.files[ftype].file = reader->ctx->fsr->fset->farr[ftype]->f[0]; } } @@ -86,7 +86,7 @@ static int32_t tsdbSnapReadFileSetOpenReader(STsdbSnapReader* reader) { // stt SSttLvl* lvl; - TARRAY2_FOREACH(reader->ctx->fset->lvlArr, lvl) { + TARRAY2_FOREACH(reader->ctx->fsr->fset->lvlArr, lvl) { STFileObj* fobj; TARRAY2_FOREACH(lvl->fobjArr, fobj) { SSttFileReader* sttReader; @@ -138,8 +138,8 @@ static int32_t tsdbSnapReadFileSetOpenIter(STsdbSnapReader* reader) { STsdbIter* iter; STsdbIterConfig config = { .filterByVersion = true, - .verRange[0] = reader->sver, - .verRange[1] = reader->ever, + .verRange[0] = reader->ctx->fsr->sver, + .verRange[1] = reader->ctx->fsr->ever, }; // data file @@ -211,14 +211,14 @@ static int32_t tsdbSnapReadFileSetCloseIter(STsdbSnapReader* reader) { return 0; } -static int32_t tsdbSnapReadFileSetBegin(STsdbSnapReader* reader) { +static int32_t tsdbSnapReadRangeBegin(STsdbSnapReader* reader) { int32_t code = 0; int32_t lino = 0; - ASSERT(reader->ctx->fset == NULL); + ASSERT(reader->ctx->fsr == NULL); - if (reader->ctx->fsetArrIdx < TARRAY2_SIZE(reader->fsetArr)) { - reader->ctx->fset = TARRAY2_GET(reader->fsetArr, reader->ctx->fsetArrIdx++); + if (reader->ctx->fsrArrIdx < TARRAY2_SIZE(reader->fsrArr)) { + reader->ctx->fsr = TARRAY2_GET(reader->fsrArr, reader->ctx->fsrArrIdx++); reader->ctx->isDataDone = false; reader->ctx->isTombDone = false; @@ -236,10 +236,10 @@ _exit: return code; } -static int32_t tsdbSnapReadFileSetEnd(STsdbSnapReader* reader) { +static int32_t tsdbSnapReadRangeEnd(STsdbSnapReader* reader) { tsdbSnapReadFileSetCloseIter(reader); tsdbSnapReadFileSetCloseReader(reader); - reader->ctx->fset = NULL; + reader->ctx->fsr = NULL; return 0; } @@ -412,7 +412,8 @@ _exit: return code; } -int32_t tsdbSnapReaderOpen(STsdb* tsdb, int64_t sver, int64_t ever, int8_t type, STsdbSnapReader** reader) { +int32_t tsdbSnapReaderOpen(STsdb* tsdb, int64_t sver, int64_t ever, int8_t type, void* pRanges, + STsdbSnapReader** reader) { int32_t code = 0; int32_t lino = 0; @@ -424,22 +425,19 @@ int32_t tsdbSnapReaderOpen(STsdb* tsdb, int64_t sver, int64_t ever, int8_t type, reader[0]->ever = ever; reader[0]->type = type; - taosThreadRwlockRdlock(&tsdb->rwLock); - code = tsdbFSCreateRefSnapshot(tsdb->pFS, &reader[0]->fsetArr); - taosThreadRwlockUnlock(&tsdb->rwLock); - + code = tsdbFSCreateRefRangedSnapshot(tsdb->pFS, sver, ever, (TSnapRangeArray*)pRanges, &reader[0]->fsrArr); TSDB_CHECK_CODE(code, lino, _exit); _exit: if (code) { tsdbError("vgId:%d %s failed at line %d since %s, sver:%" PRId64 " ever:%" PRId64 " type:%d", TD_VID(tsdb->pVnode), __func__, lino, tstrerror(code), sver, ever, type); - tsdbFSDestroyRefSnapshot(&reader[0]->fsetArr); + tsdbSnapRangeArrayDestroy(&reader[0]->fsrArr); taosMemoryFree(reader[0]); reader[0] = NULL; } else { - tsdbInfo("vgId:%d %s done, sver:%" PRId64 " ever:%" PRId64 " type:%d", TD_VID(tsdb->pVnode), __func__, sver, ever, - type); + tsdbInfo("vgId:%d tsdb snapshot reader opened. sver:%" PRId64 " ever:%" PRId64 " type:%d", TD_VID(tsdb->pVnode), + sver, ever, type); } return code; } @@ -462,7 +460,7 @@ int32_t tsdbSnapReaderClose(STsdbSnapReader** reader) { TARRAY2_DESTROY(reader[0]->sttReaderArr, tsdbSttFileReaderClose); tsdbDataFileReaderClose(&reader[0]->dataReader); - tsdbFSDestroyRefSnapshot(&reader[0]->fsetArr); + tsdbSnapRangeArrayDestroy(&reader[0]->fsrArr); tDestroyTSchema(reader[0]->skmTb->pTSchema); for (int32_t i = 0; i < ARRAY_SIZE(reader[0]->aBuf); ++i) { @@ -488,11 +486,11 @@ int32_t tsdbSnapRead(STsdbSnapReader* reader, uint8_t** data) { data[0] = NULL; for (;;) { - if (reader->ctx->fset == NULL) { - code = tsdbSnapReadFileSetBegin(reader); + if (reader->ctx->fsr == NULL) { + code = tsdbSnapReadRangeBegin(reader); TSDB_CHECK_CODE(code, lino, _exit); - if (reader->ctx->fset == NULL) { + if (reader->ctx->fsr == NULL) { break; } } @@ -517,7 +515,7 @@ int32_t tsdbSnapRead(STsdbSnapReader* reader, uint8_t** data) { } } - code = tsdbSnapReadFileSetEnd(reader); + code = tsdbSnapReadRangeEnd(reader); TSDB_CHECK_CODE(code, lino, _exit); } @@ -1030,7 +1028,7 @@ _exit: return code; } -int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWriter** writer) { +int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, void* pRanges, STsdbSnapWriter** writer) { int32_t code = 0; int32_t lino = 0; @@ -1054,7 +1052,7 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWr writer[0]->compactVersion = INT64_MAX; writer[0]->now = taosGetTimestampMs(); - code = tsdbFSCreateCopySnapshot(pTsdb->pFS, &writer[0]->fsetArr); + code = tsdbFSCreateCopyRangedSnapshot(pTsdb->pFS, (TSnapRangeArray*)pRanges, &writer[0]->fsetArr, writer[0]->fopArr); TSDB_CHECK_CODE(code, lino, _exit); _exit: @@ -1105,6 +1103,8 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** writer, int8_t rollback) { TSDB_CHECK_CODE(code, lino, _exit); } + writer[0]->tsdb->pFS->fsstate = TSDB_FS_STATE_NORMAL; + taosThreadRwlockUnlock(&writer[0]->tsdb->rwLock); } tsdbFSEnableBgTask(tsdb->pFS); @@ -1159,3 +1159,438 @@ _exit: } return code; } + +// snap part +static int32_t tsdbSnapPartCmprFn(STsdbSnapPartition* x, STsdbSnapPartition* y) { + if (x->fid < y->fid) return -1; + if (x->fid > y->fid) return 1; + return 0; +} + +static int32_t tVersionRangeCmprFn(SVersionRange* x, SVersionRange* y) { + if (x->minVer < y->minVer) return -1; + if (x->minVer > y->minVer) return 1; + if (x->maxVer < y->maxVer) return -1; + if (x->maxVer > y->maxVer) return 1; + return 0; +} + +static int32_t tsdbSnapRangeCmprFn(STSnapRange* x, STSnapRange* y) { + if (x->fid < y->fid) return -1; + if (x->fid > y->fid) return 1; + return 0; +} + +STsdbSnapPartition* tsdbSnapPartitionCreate() { + STsdbSnapPartition* pSP = taosMemoryCalloc(1, sizeof(STsdbSnapPartition)); + if (pSP == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + for (int32_t i = 0; i < TSDB_SNAP_RANGE_TYP_MAX; i++) { + TARRAY2_INIT(&pSP->verRanges[i]); + } + return pSP; +} + +void tsdbSnapPartitionClear(STsdbSnapPartition** ppSP) { + if (ppSP == NULL || ppSP[0] == NULL) { + return; + } + for (int32_t i = 0; i < TSDB_SNAP_RANGE_TYP_MAX; i++) { + TARRAY2_DESTROY(&ppSP[0]->verRanges[i], NULL); + } + taosMemoryFree(ppSP[0]); + ppSP[0] = NULL; +} + +static int32_t tsdbFTypeToSRangeTyp(tsdb_ftype_t ftype) { + switch (ftype) { + case TSDB_FTYPE_HEAD: + return TSDB_SNAP_RANGE_TYP_HEAD; + case TSDB_FTYPE_DATA: + return TSDB_SNAP_RANGE_TYP_DATA; + case TSDB_FTYPE_SMA: + return TSDB_SNAP_RANGE_TYP_SMA; + case TSDB_FTYPE_TOMB: + return TSDB_SNAP_RANGE_TYP_TOMB; + case TSDB_FTYPE_STT: + return TSDB_SNAP_RANGE_TYP_STT; + } + return TSDB_SNAP_RANGE_TYP_MAX; +} + +static int32_t tsdbTFileSetToSnapPart(STFileSet* fset, STsdbSnapPartition** ppSP) { + STsdbSnapPartition* p = tsdbSnapPartitionCreate(); + if (p == NULL) { + goto _err; + } + + p->fid = fset->fid; + + int32_t code = 0; + int32_t typ = 0; + int32_t corrupt = false; + int32_t count = 0; + for (int32_t ftype = TSDB_FTYPE_MIN; ftype < TSDB_FTYPE_MAX; ++ftype) { + if (fset->farr[ftype] == NULL) continue; + typ = tsdbFTypeToSRangeTyp(ftype); + ASSERT(typ < TSDB_SNAP_RANGE_TYP_MAX); + STFile* f = fset->farr[ftype]->f; + if (f->maxVer > fset->maxVerValid) { + corrupt = true; + tsdbError("skip incomplete data file: fid:%d, maxVerValid:%" PRId64 ", minVer:%" PRId64 ", maxVer:%" PRId64 + ", ftype: %d", + fset->fid, fset->maxVerValid, f->minVer, f->maxVer, ftype); + continue; + } + count++; + SVersionRange vr = {.minVer = f->minVer, .maxVer = f->maxVer}; + code = TARRAY2_SORT_INSERT(&p->verRanges[typ], vr, tVersionRangeCmprFn); + ASSERT(code == 0); + } + + typ = TSDB_SNAP_RANGE_TYP_STT; + const SSttLvl* lvl; + TARRAY2_FOREACH(fset->lvlArr, lvl) { + STFileObj* fobj; + TARRAY2_FOREACH(lvl->fobjArr, fobj) { + STFile* f = fobj->f; + if (f->maxVer > fset->maxVerValid) { + corrupt = true; + tsdbError("skip incomplete stt file.fid:%d, maxVerValid:%" PRId64 ", minVer:%" PRId64 ", maxVer:%" PRId64 + ", ftype: %d", + fset->fid, fset->maxVerValid, f->minVer, f->maxVer, typ); + continue; + } + count++; + SVersionRange vr = {.minVer = f->minVer, .maxVer = f->maxVer}; + code = TARRAY2_SORT_INSERT(&p->verRanges[typ], vr, tVersionRangeCmprFn); + ASSERT(code == 0); + } + } + if (corrupt && count == 0) { + SVersionRange vr = {.minVer = VERSION_MIN, .maxVer = fset->maxVerValid}; + code = TARRAY2_SORT_INSERT(&p->verRanges[typ], vr, tVersionRangeCmprFn); + ASSERT(code == 0); + } + ppSP[0] = p; + return 0; + +_err: + tsdbSnapPartitionClear(&p); + return -1; +} + +STsdbSnapPartList* tsdbSnapPartListCreate() { + STsdbSnapPartList* pList = taosMemoryCalloc(1, sizeof(STsdbSnapPartList)); + if (pList == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + TARRAY2_INIT(pList); + return pList; +} + +static STsdbSnapPartList* tsdbGetSnapPartList(STFileSystem* fs) { + STsdbSnapPartList* pList = tsdbSnapPartListCreate(); + if (pList == NULL) { + return NULL; + } + + int32_t code = 0; + taosThreadRwlockRdlock(&fs->tsdb->rwLock); + STFileSet* fset; + TARRAY2_FOREACH(fs->fSetArr, fset) { + STsdbSnapPartition* pItem = NULL; + if (tsdbTFileSetToSnapPart(fset, &pItem) < 0) { + code = -1; + break; + } + ASSERT(pItem != NULL); + code = TARRAY2_SORT_INSERT(pList, pItem, tsdbSnapPartCmprFn); + ASSERT(code == 0); + } + taosThreadRwlockUnlock(&fs->tsdb->rwLock); + + if (code) { + TARRAY2_DESTROY(pList, tsdbSnapPartitionClear); + taosMemoryFree(pList); + pList = NULL; + } + return pList; +} + +int32_t tTsdbSnapPartListDataLenCalc(STsdbSnapPartList* pList) { + int32_t hdrLen = sizeof(int32_t); + int32_t datLen = 0; + + int8_t msgVer = 1; + int32_t len = TARRAY2_SIZE(pList); + hdrLen += sizeof(msgVer); + hdrLen += sizeof(len); + datLen += hdrLen; + + for (int32_t u = 0; u < len; u++) { + STsdbSnapPartition* p = TARRAY2_GET(pList, u); + int32_t typMax = TSDB_SNAP_RANGE_TYP_MAX; + int32_t uItem = 0; + uItem += sizeof(STsdbSnapPartition); + uItem += sizeof(typMax); + + for (int32_t i = 0; i < typMax; i++) { + int32_t iLen = TARRAY2_SIZE(&p->verRanges[i]); + int32_t jItem = 0; + jItem += sizeof(SVersionRange); + jItem += sizeof(int64_t); + uItem += sizeof(iLen) + jItem * iLen; + } + datLen += uItem; + } + return datLen; +} + +int32_t tSerializeTsdbSnapPartList(void* buf, int32_t bufLen, STsdbSnapPartList* pList) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + int8_t reserved8 = 0; + int16_t reserved16 = 0; + int64_t reserved64 = 0; + + int8_t msgVer = 1; + int32_t len = TARRAY2_SIZE(pList); + + if (tStartEncode(&encoder) < 0) goto _err; + if (tEncodeI8(&encoder, msgVer) < 0) goto _err; + if (tEncodeI32(&encoder, len) < 0) goto _err; + + for (int32_t u = 0; u < len; u++) { + STsdbSnapPartition* p = TARRAY2_GET(pList, u); + if (tEncodeI64(&encoder, p->fid) < 0) goto _err; + if (tEncodeI8(&encoder, p->stat) < 0) goto _err; + if (tEncodeI8(&encoder, reserved8) < 0) goto _err; + if (tEncodeI16(&encoder, reserved16) < 0) goto _err; + + int32_t typMax = TSDB_SNAP_RANGE_TYP_MAX; + if (tEncodeI32(&encoder, typMax) < 0) goto _err; + + for (int32_t i = 0; i < typMax; i++) { + SVerRangeList* iList = &p->verRanges[i]; + int32_t iLen = TARRAY2_SIZE(iList); + + if (tEncodeI32(&encoder, iLen) < 0) goto _err; + for (int32_t j = 0; j < iLen; j++) { + SVersionRange r = TARRAY2_GET(iList, j); + if (tEncodeI64(&encoder, r.minVer) < 0) goto _err; + if (tEncodeI64(&encoder, r.maxVer) < 0) goto _err; + if (tEncodeI64(&encoder, reserved64) < 0) goto _err; + } + } + } + + tEndEncode(&encoder); + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; + +_err: + tEncoderClear(&encoder); + return -1; +} + +int32_t tDeserializeTsdbSnapPartList(void* buf, int32_t bufLen, STsdbSnapPartList* pList) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + int8_t reserved8 = 0; + int16_t reserved16 = 0; + int64_t reserved64 = 0; + + STsdbSnapPartition* p = NULL; + + int8_t msgVer = 0; + int32_t len = 0; + if (tStartDecode(&decoder) < 0) goto _err; + if (tDecodeI8(&decoder, &msgVer) < 0) goto _err; + if (tDecodeI32(&decoder, &len) < 0) goto _err; + + for (int32_t u = 0; u < len; u++) { + p = tsdbSnapPartitionCreate(); + if (p == NULL) goto _err; + if (tDecodeI64(&decoder, &p->fid) < 0) goto _err; + if (tDecodeI8(&decoder, &p->stat) < 0) goto _err; + if (tDecodeI8(&decoder, &reserved8) < 0) goto _err; + if (tDecodeI16(&decoder, &reserved16) < 0) goto _err; + + int32_t typMax = 0; + if (tDecodeI32(&decoder, &typMax) < 0) goto _err; + + for (int32_t i = 0; i < typMax; i++) { + SVerRangeList* iList = &p->verRanges[i]; + int32_t iLen = 0; + if (tDecodeI32(&decoder, &iLen) < 0) goto _err; + for (int32_t j = 0; j < iLen; j++) { + SVersionRange r = {0}; + if (tDecodeI64(&decoder, &r.minVer) < 0) goto _err; + if (tDecodeI64(&decoder, &r.maxVer) < 0) goto _err; + if (tDecodeI64(&decoder, &reserved64) < 0) goto _err; + TARRAY2_APPEND(iList, r); + } + } + TARRAY2_APPEND(pList, p); + p = NULL; + } + + tEndDecode(&decoder); + tDecoderClear(&decoder); + return 0; + +_err: + if (p) { + tsdbSnapPartitionClear(&p); + } + tDecoderClear(&decoder); + return -1; +} + +int32_t tsdbSnapPartListToRangeDiff(STsdbSnapPartList* pList, TSnapRangeArray** ppRanges) { + TSnapRangeArray* pDiff = taosMemoryCalloc(1, sizeof(TSnapRangeArray)); + if (pDiff == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } + TARRAY2_INIT(pDiff); + + STsdbSnapPartition* part; + TARRAY2_FOREACH(pList, part) { + STSnapRange* r = taosMemoryCalloc(1, sizeof(STSnapRange)); + if (r == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } + int64_t maxVerValid = -1; + int32_t typMax = TSDB_SNAP_RANGE_TYP_MAX; + for (int32_t i = 0; i < typMax; i++) { + SVerRangeList* iList = &part->verRanges[i]; + SVersionRange vr = {0}; + TARRAY2_FOREACH(iList, vr) { + if (vr.maxVer < vr.minVer) { + continue; + } + maxVerValid = TMAX(maxVerValid, vr.maxVer); + } + } + r->fid = part->fid; + r->sver = maxVerValid + 1; + r->ever = VERSION_MAX; + tsdbDebug("range diff fid:%" PRId64 ", sver:%" PRId64 ", ever:%" PRId64, part->fid, r->sver, r->ever); + int32_t code = TARRAY2_SORT_INSERT(pDiff, r, tsdbSnapRangeCmprFn); + ASSERT(code == 0); + } + ppRanges[0] = pDiff; + + tsdbInfo("pDiff size:%d", TARRAY2_SIZE(pDiff)); + return 0; + +_err: + if (pDiff) { + tsdbSnapRangeArrayDestroy(&pDiff); + } + return -1; +} + +void tsdbSnapRangeArrayDestroy(TSnapRangeArray** ppSnap) { + if (ppSnap && ppSnap[0]) { + TARRAY2_DESTROY(ppSnap[0], tsdbTSnapRangeClear); + taosMemoryFree(ppSnap[0]); + ppSnap[0] = NULL; + } +} + +void tsdbSnapPartListDestroy(STsdbSnapPartList** ppList) { + if (ppList == NULL || ppList[0] == NULL) return; + + TARRAY2_DESTROY(ppList[0], tsdbSnapPartitionClear); + taosMemoryFree(ppList[0]); + ppList[0] = NULL; +} + +ETsdbFsState tsdbSnapGetFsState(SVnode* pVnode) { + if (!VND_IS_RSMA(pVnode)) { + return pVnode->pTsdb->pFS->fsstate; + } + for (int32_t lvl = 0; lvl < TSDB_RETENTION_MAX; ++lvl) { + if (SMA_RSMA_GET_TSDB(pVnode, lvl)->pFS->fsstate != TSDB_FS_STATE_NORMAL) { + return TSDB_FS_STATE_INCOMPLETE; + } + } + return TSDB_FS_STATE_NORMAL; +} + +int32_t tsdbSnapGetDetails(SVnode* pVnode, SSnapshot* pSnap) { + int code = -1; + int32_t tsdbMaxCnt = (!VND_IS_RSMA(pVnode) ? 1 : TSDB_RETENTION_MAX); + int32_t subTyps[TSDB_RETENTION_MAX] = {SNAP_DATA_TSDB, SNAP_DATA_RSMA1, SNAP_DATA_RSMA2}; + STsdbSnapPartList* pLists[TSDB_RETENTION_MAX] = {0}; + + for (int32_t j = 0; j < tsdbMaxCnt; ++j) { + STsdb* pTsdb = SMA_RSMA_GET_TSDB(pVnode, j); + pLists[j] = tsdbGetSnapPartList(pTsdb->pFS); + if (pLists[j] == NULL) goto _out; + } + + // estimate bufLen and prepare + int32_t bufLen = sizeof(SSyncTLV); // typ: TDMT_SYNC_PREP_SNAPSHOT or TDMT_SYNC_PREP_SNAPSOT_REPLY + for (int32_t j = 0; j < tsdbMaxCnt; ++j) { + bufLen += sizeof(SSyncTLV); // subTyps[j] + bufLen += tTsdbSnapPartListDataLenCalc(pLists[j]); + } + + tsdbInfo("vgId:%d, allocate %d bytes for data of snapshot info.", TD_VID(pVnode), bufLen); + + void* data = taosMemoryRealloc(pSnap->data, bufLen); + if (data == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + tsdbError("vgId:%d, failed to realloc memory for data of snapshot info. bytes:%d", TD_VID(pVnode), bufLen); + goto _out; + } + pSnap->data = data; + + // header + SSyncTLV* head = data; + head->len = 0; + head->typ = pSnap->type; + int32_t offset = sizeof(SSyncTLV); + int32_t tlen = 0; + + // fill snapshot info + for (int32_t j = 0; j < tsdbMaxCnt; ++j) { + if (pSnap->type == TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + } + + // subHead + SSyncTLV* subHead = (void*)((char*)data + offset); + subHead->typ = subTyps[j]; + ASSERT(subHead->val == (char*)data + offset + sizeof(SSyncTLV)); + + if ((tlen = tSerializeTsdbSnapPartList(subHead->val, bufLen - offset - sizeof(SSyncTLV), pLists[j])) < 0) { + tsdbError("vgId:%d, failed to serialize snap partition list of tsdb %d since %s", TD_VID(pVnode), j, terrstr()); + goto _out; + } + subHead->len = tlen; + offset += sizeof(SSyncTLV) + tlen; + } + + head->len = offset - sizeof(SSyncTLV); + ASSERT(offset <= bufLen); + code = 0; + +_out: + for (int32_t j = 0; j < tsdbMaxCnt; ++j) { + if (pLists[j] == NULL) continue; + tsdbSnapPartListDestroy(&pLists[j]); + } + + return code; +} diff --git a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c index fa8d2d5ba4..7c3b185e20 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c +++ b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c @@ -14,6 +14,7 @@ */ #include "tsdbSttFileRW.h" +#include "tsdbDataFileRW.h" // SSttFReader ============================================================ struct SSttFileReader { @@ -383,6 +384,8 @@ struct SSttFileWriter { struct { bool opened; TABLEID tbid[1]; + // range + SVersionRange range; } ctx[1]; // file STsdbFD *fd; @@ -401,8 +404,8 @@ struct SSttFileWriter { uint8_t *bufArr[5]; }; -int32_t tsdbFileDoWriteBlockData(STsdbFD *fd, SBlockData *blockData, int8_t cmprAlg, int64_t *fileSize, - TSttBlkArray *sttBlkArray, uint8_t **bufArr) { +static int32_t tsdbFileDoWriteSttBlockData(STsdbFD *fd, SBlockData *blockData, int8_t cmprAlg, int64_t *fileSize, + TSttBlkArray *sttBlkArray, uint8_t **bufArr, SVersionRange *range) { if (blockData->nRow == 0) return 0; int32_t code = 0; @@ -425,6 +428,8 @@ int32_t tsdbFileDoWriteBlockData(STsdbFD *fd, SBlockData *blockData, int8_t cmpr if (sttBlk->maxVer < blockData->aVersion[iRow]) sttBlk->maxVer = blockData->aVersion[iRow]; } + tsdbWriterUpdVerRange(range, sttBlk->minVer, sttBlk->maxVer); + int32_t sizeArr[5] = {0}; code = tCmprBlockData(blockData, cmprAlg, NULL, NULL, bufArr, sizeArr); if (code) return code; @@ -455,8 +460,8 @@ static int32_t tsdbSttFileDoWriteBlockData(SSttFileWriter *writer) { int32_t code = 0; int32_t lino = 0; - code = tsdbFileDoWriteBlockData(writer->fd, writer->blockData, writer->config->cmprAlg, &writer->file->size, - writer->sttBlkArray, writer->config->bufArr); + code = tsdbFileDoWriteSttBlockData(writer->fd, writer->blockData, writer->config->cmprAlg, &writer->file->size, + writer->sttBlkArray, writer->config->bufArr, &writer->ctx->range); TSDB_CHECK_CODE(code, lino, _exit); _exit: @@ -517,62 +522,6 @@ _exit: return code; } -int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize, - TTombBlkArray *tombBlkArray, uint8_t **bufArr) { - int32_t code; - - if (TOMB_BLOCK_SIZE(tombBlock) == 0) return 0; - - STombBlk tombBlk[1] = {{ - .dp[0] = - { - .offset = *fileSize, - .size = 0, - }, - .minTbid = - { - .suid = TARRAY2_FIRST(tombBlock->suid), - .uid = TARRAY2_FIRST(tombBlock->uid), - }, - .maxTbid = - { - .suid = TARRAY2_LAST(tombBlock->suid), - .uid = TARRAY2_LAST(tombBlock->uid), - }, - .minVer = TARRAY2_FIRST(tombBlock->version), - .maxVer = TARRAY2_FIRST(tombBlock->version), - .numRec = TOMB_BLOCK_SIZE(tombBlock), - .cmprAlg = cmprAlg, - }}; - - for (int32_t i = 1; i < TOMB_BLOCK_SIZE(tombBlock); i++) { - if (tombBlk->minVer > TARRAY2_GET(tombBlock->version, i)) { - tombBlk->minVer = TARRAY2_GET(tombBlock->version, i); - } - if (tombBlk->maxVer < TARRAY2_GET(tombBlock->version, i)) { - tombBlk->maxVer = TARRAY2_GET(tombBlock->version, i); - } - } - - for (int32_t i = 0; i < ARRAY_SIZE(tombBlock->dataArr); i++) { - code = tsdbCmprData((uint8_t *)TARRAY2_DATA(&tombBlock->dataArr[i]), TARRAY2_DATA_LEN(&tombBlock->dataArr[i]), - TSDB_DATA_TYPE_BIGINT, tombBlk->cmprAlg, &bufArr[0], 0, &tombBlk->size[i], &bufArr[1]); - if (code) return code; - - code = tsdbWriteFile(fd, *fileSize, bufArr[0], tombBlk->size[i]); - if (code) return code; - - tombBlk->dp->size += tombBlk->size[i]; - *fileSize += tombBlk->size[i]; - } - - code = TARRAY2_APPEND_PTR(tombBlkArray, tombBlk); - if (code) return code; - - tTombBlockClear(tombBlock); - return 0; -} - static int32_t tsdbSttFileDoWriteTombBlock(SSttFileWriter *writer) { if (TOMB_BLOCK_SIZE(writer->tombBlock) == 0) return 0; @@ -580,7 +529,7 @@ static int32_t tsdbSttFileDoWriteTombBlock(SSttFileWriter *writer) { int32_t lino = 0; code = tsdbFileWriteTombBlock(writer->fd, writer->tombBlock, writer->config->cmprAlg, &writer->file->size, - writer->tombBlkArray, writer->config->bufArr); + writer->tombBlkArray, writer->config->bufArr, &writer->ctx->range); TSDB_CHECK_CODE(code, lino, _exit); _exit: @@ -639,21 +588,6 @@ _exit: return code; } -int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize) { - ptr->size = TARRAY2_DATA_LEN(tombBlkArray); - if (ptr->size > 0) { - ptr->offset = *fileSize; - - int32_t code = tsdbWriteFile(fd, *fileSize, (const uint8_t *)TARRAY2_DATA(tombBlkArray), ptr->size); - if (code) { - return code; - } - - *fileSize += ptr->size; - } - return 0; -} - static int32_t tsdbSttFileDoWriteTombBlk(SSttFileWriter *writer) { int32_t code = 0; int32_t lino = 0; @@ -694,6 +628,8 @@ static int32_t tsdbSttFWriterDoOpen(SSttFileWriter *writer) { .fid = writer->config->fid, .cid = writer->config->cid, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, .stt[0] = { .level = writer->config->level, @@ -713,6 +649,9 @@ static int32_t tsdbSttFWriterDoOpen(SSttFileWriter *writer) { TSDB_CHECK_CODE(code, lino, _exit); writer->file->size += sizeof(hdr); + // range + writer->ctx->range = (SVersionRange){.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; + writer->ctx->opened = true; _exit: @@ -782,6 +721,7 @@ static int32_t tsdbSttFWriterCloseCommit(SSttFileWriter *writer, TFileOpArray *o .fid = writer->config->fid, .nf = writer->file[0], }; + tsdbTFileUpdVerRange(&op.nf, writer->ctx->range); code = TARRAY2_APPEND(opArray, op); TSDB_CHECK_CODE(code, lino, _exit); diff --git a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.h b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.h index 242b55795c..0051a6cd92 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.h +++ b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.h @@ -71,6 +71,9 @@ int32_t tsdbSttFileWriteBlockData(SSttFileWriter *writer, SBlockData *pBlockData int32_t tsdbSttFileWriteTombRecord(SSttFileWriter *writer, const STombRecord *record); bool tsdbSttFileWriterIsOpened(SSttFileWriter *writer); +int32_t tsdbFileWriteSttBlk(STsdbFD *fd, const TSttBlkArray *sttBlkArray, SFDataPtr *ptr, int64_t *fileSize); +int32_t tsdbFileWriteSttFooter(STsdbFD *fd, const SSttFooter *footer, int64_t *fileSize); + struct SSttFileWriterConfig { STsdb *tsdb; int32_t maxRow; @@ -90,4 +93,4 @@ struct SSttFileWriterConfig { } #endif -#endif /*_TSDB_STT_FILE_RW_H*/ \ No newline at end of file +#endif /*_TSDB_STT_FILE_RW_H*/ diff --git a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c index 0884c32385..876c0df4a0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c +++ b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c @@ -16,24 +16,15 @@ #include "tsdbUpgrade.h" // old -extern void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t); -extern int32_t tsdbReadDataBlockEx(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData *pBlockData); +#include "tsdb.h" +// extern void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t); // new -extern int32_t save_fs(const TFileSetArray *arr, const char *fname); -extern int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype); -extern int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, int8_t cmprAlg, int64_t *fileSize, - TBrinBlkArray *brinBlkArray, uint8_t **bufArr); -extern int32_t tsdbFileWriteBrinBlk(STsdbFD *fd, TBrinBlkArray *brinBlkArray, SFDataPtr *ptr, int64_t *fileSize); -extern int32_t tsdbFileWriteHeadFooter(STsdbFD *fd, int64_t *fileSize, const SHeadFooter *footer); -extern int32_t tsdbSttLvlInit(int32_t level, SSttLvl **lvl); -extern int32_t tsdbSttLvlClear(SSttLvl **lvl); -extern int32_t tsdbFileWriteSttBlk(STsdbFD *fd, const TSttBlkArray *sttBlkArray, SFDataPtr *ptr, int64_t *fileSize); -extern int32_t tsdbFileWriteSttFooter(STsdbFD *fd, const SSttFooter *footer, int64_t *fileSize); -extern int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAlg, int64_t *fileSize, - TTombBlkArray *tombBlkArray, uint8_t **bufArr); -extern int32_t tsdbFileWriteTombBlk(STsdbFD *fd, const TTombBlkArray *tombBlkArray, SFDataPtr *ptr, int64_t *fileSize); -extern int32_t tsdbFileWriteTombFooter(STsdbFD *fd, const STombFooter *footer, int64_t *fileSize); +#include "tsdbDataFileRW.h" +#include "tsdbFS2.h" +#include "tsdbSttFileRW.h" +// extern int32_t save_fs(const TFileSetArray *arr, const char *fname); +// extern int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype); static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *reader, STFileSet *fset) { int32_t code = 0; @@ -78,6 +69,8 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader * .fid = fset->fid, .cid = pDFileSet->pHeadF->commitID, .size = pDFileSet->pHeadF->size, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, &fset->farr[TSDB_FTYPE_HEAD]); @@ -127,16 +120,18 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader * TSDB_CHECK_CODE(code, lino, _exit); if (BRIN_BLOCK_SIZE(ctx->brinBlock) >= ctx->maxRow) { + SVersionRange range = {.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; code = tsdbFileWriteBrinBlock(ctx->fd, ctx->brinBlock, ctx->cmprAlg, &fset->farr[TSDB_FTYPE_HEAD]->f->size, - ctx->brinBlkArray, ctx->bufArr); + ctx->brinBlkArray, ctx->bufArr, &range); TSDB_CHECK_CODE(code, lino, _exit); } } } if (BRIN_BLOCK_SIZE(ctx->brinBlock) > 0) { + SVersionRange range = {.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; code = tsdbFileWriteBrinBlock(ctx->fd, ctx->brinBlock, ctx->cmprAlg, &fset->farr[TSDB_FTYPE_HEAD]->f->size, - ctx->brinBlkArray, ctx->bufArr); + ctx->brinBlkArray, ctx->bufArr, &range); TSDB_CHECK_CODE(code, lino, _exit); } @@ -182,6 +177,8 @@ static int32_t tsdbUpgradeData(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader * .fid = fset->fid, .cid = pDFileSet->pDataF->commitID, .size = pDFileSet->pDataF->size, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, &fset->farr[TSDB_FTYPE_DATA]); @@ -208,6 +205,8 @@ static int32_t tsdbUpgradeSma(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *r .fid = fset->fid, .cid = pDFileSet->pSmaF->commitID, .size = pDFileSet->pSmaF->size, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, &fset->farr[TSDB_FTYPE_SMA]); @@ -253,6 +252,8 @@ static int32_t tsdbUpgradeSttFile(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReade .fid = fset->fid, .cid = pSttF->commitID, .size = pSttF->size, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, &fobj); TSDB_CHECK_CODE(code, lino, _exit1); @@ -382,6 +383,8 @@ static int32_t tsdbUpgradeOpenTombFile(STsdb *tsdb, STFileSet *fset, STsdbFD **f .fid = fset->fid, .cid = 0, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, fobj); @@ -398,6 +401,8 @@ static int32_t tsdbUpgradeOpenTombFile(STsdb *tsdb, STFileSet *fset, STsdbFD **f .fid = fset->fid, .cid = 0, .size = 0, + .minVer = VERSION_MAX, + .maxVer = VERSION_MIN, }; code = tsdbTFileObjInit(tsdb, &file, fobj); @@ -481,8 +486,9 @@ static int32_t tsdbDumpTombDataToFSet(STsdb *tsdb, SDelFReader *reader, SArray * code = tsdbUpgradeOpenTombFile(tsdb, fset, &ctx->fd, &ctx->fobj, &ctx->toStt); TSDB_CHECK_CODE(code, lino, _exit); } + SVersionRange tombRange = {.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; code = tsdbFileWriteTombBlock(ctx->fd, ctx->tombBlock, ctx->cmprAlg, &ctx->fobj->f->size, ctx->tombBlkArray, - ctx->bufArr); + ctx->bufArr, &tombRange); TSDB_CHECK_CODE(code, lino, _exit); } } @@ -493,8 +499,9 @@ static int32_t tsdbDumpTombDataToFSet(STsdb *tsdb, SDelFReader *reader, SArray * code = tsdbUpgradeOpenTombFile(tsdb, fset, &ctx->fd, &ctx->fobj, &ctx->toStt); TSDB_CHECK_CODE(code, lino, _exit); } + SVersionRange tombRange = {.minVer = VERSION_MAX, .maxVer = VERSION_MIN}; code = tsdbFileWriteTombBlock(ctx->fd, ctx->tombBlock, ctx->cmprAlg, &ctx->fobj->f->size, ctx->tombBlkArray, - ctx->bufArr); + ctx->bufArr, &tombRange); TSDB_CHECK_CODE(code, lino, _exit); } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 136168c5cc..50ca2f5d03 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -285,6 +285,7 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) { int32_t code = 0; int32_t lino = 0; char dir[TSDB_FILENAME_LEN] = {0}; + int64_t lastCommitted = pInfo->info.state.committed; tsem_wait(&pVnode->canCommit); diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index db94f32459..3bdecee79b 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -13,6 +13,8 @@ * along with this program. If not, see . */ +#include "sync.h" +#include "tsdb.h" #include "vnd.h" #include "vndCos.h" @@ -62,6 +64,13 @@ int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs info.state.applied = -1; info.state.commitID = 0; + SVnodeInfo oldInfo = {0}; + oldInfo.config = vnodeCfgDefault; + if (vnodeLoadInfo(dir, &oldInfo) == 0) { + vWarn("vgId:%d, vnode config info already exists at %s.", oldInfo.config.vgId, dir); + return (oldInfo.config.dbId == info.config.dbId) ? 0 : -1; + } + vInfo("vgId:%d, save config while create", info.config.vgId); if (vnodeSaveInfo(dir, &info) < 0 || vnodeCommitInfo(dir) < 0) { vError("vgId:%d, failed to save vnode config since %s", pCfg ? pCfg->vgId : 0, tstrerror(terrno)); @@ -321,12 +330,13 @@ static int32_t vnodeCheckDisk(int32_t diskPrimary, STfs *pTfs) { return 0; } -SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb) { +SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb, bool force) { SVnode *pVnode = NULL; SVnodeInfo info = {0}; char dir[TSDB_FILENAME_LEN] = {0}; char tdir[TSDB_FILENAME_LEN * 2] = {0}; int32_t ret = 0; + terrno = TSDB_CODE_SUCCESS; if (vnodeCheckDisk(diskPrimary, pTfs)) { vError("failed to open vnode from %s since %s. diskPrimary:%d", path, terrstr(), diskPrimary); @@ -340,9 +350,14 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC ret = vnodeLoadInfo(dir, &info); if (ret < 0) { vError("failed to open vnode from %s since %s", path, tstrerror(terrno)); + terrno = TSDB_CODE_NEED_RETRY; return NULL; } + if (vnodeMkDir(pTfs, path)) { + vError("vgId:%d, failed to prepare vnode dir since %s, path: %s", info.config.vgId, strerror(errno), path); + return NULL; + } // save vnode info on dnode ep changed bool updated = false; SSyncCfg *pCfg = &info.config.syncCfg; @@ -404,7 +419,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC } // open tsdb - if (!VND_IS_RSMA(pVnode) && tsdbOpen(pVnode, &VND_TSDB(pVnode), VNODE_TSDB_DIR, NULL, rollback) < 0) { + if (!VND_IS_RSMA(pVnode) && tsdbOpen(pVnode, &VND_TSDB(pVnode), VNODE_TSDB_DIR, NULL, rollback, force) < 0) { vError("vgId:%d, failed to open vnode tsdb since %s", TD_VID(pVnode), tstrerror(terrno)); goto _err; } @@ -438,7 +453,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC } // open sma - if (smaOpen(pVnode, rollback)) { + if (smaOpen(pVnode, rollback, force)) { vError("vgId:%d, failed to open vnode sma since %s", TD_VID(pVnode), tstrerror(terrno)); goto _err; } @@ -508,7 +523,10 @@ void vnodeClose(SVnode *pVnode) { } // start the sync timer after the queue is ready -int32_t vnodeStart(SVnode *pVnode) { return vnodeSyncStart(pVnode); } +int32_t vnodeStart(SVnode *pVnode) { + ASSERT(pVnode); + return vnodeSyncStart(pVnode); +} int32_t vnodeIsCatchUp(SVnode *pVnode) { return syncIsCatchUp(pVnode->sync); } @@ -517,10 +535,3 @@ ESyncRole vnodeGetRole(SVnode *pVnode) { return syncGetRole(pVnode->sync); } void vnodeStop(SVnode *pVnode) {} int64_t vnodeGetSyncHandle(SVnode *pVnode) { return pVnode->sync; } - -void vnodeGetSnapshot(SVnode *pVnode, SSnapshot *pSnapshot) { - pSnapshot->data = NULL; - pSnapshot->lastApplyIndex = pVnode->state.committed; - pSnapshot->lastApplyTerm = pVnode->state.commitTerm; - pSnapshot->lastConfigIndex = -1; -} diff --git a/source/dnode/vnode/src/vnd/vnodeSnapshot.c b/source/dnode/vnode/src/vnd/vnodeSnapshot.c index 3abcf79839..87b407efcb 100644 --- a/source/dnode/vnode/src/vnd/vnodeSnapshot.c +++ b/source/dnode/vnode/src/vnd/vnodeSnapshot.c @@ -14,6 +14,7 @@ */ #include "vnd.h" +#include "tsdb.h" // SVSnapReader ======================================================== struct SVSnapReader { @@ -28,6 +29,7 @@ struct SVSnapReader { SMetaSnapReader *pMetaReader; // tsdb int8_t tsdbDone; + TSnapRangeArray *pRanges; STsdbSnapReader *pTsdbReader; // tq int8_t tqHandleDone; @@ -43,11 +45,84 @@ struct SVSnapReader { SStreamStateReader *pStreamStateReader; // rsma int8_t rsmaDone; + TSnapRangeArray *pRsmaRanges[TSDB_RETENTION_L2]; SRSmaSnapReader *pRsmaReader; }; -int32_t vnodeSnapReaderOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapReader **ppReader) { +static int32_t vnodeExtractSnapInfoDiff(void *buf, int32_t bufLen, TSnapRangeArray **ppRanges) { + int32_t code = -1; + STsdbSnapPartList *pList = tsdbSnapPartListCreate(); + if (pList == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _out; + } + if (tDeserializeTsdbSnapPartList(buf, bufLen, pList) < 0) { + terrno = TSDB_CODE_INVALID_DATA_FMT; + goto _out; + } + if (tsdbSnapPartListToRangeDiff(pList, ppRanges) < 0) { + goto _out; + } + code = 0; +_out: + tsdbSnapPartListDestroy(&pList); + return code; +} + +static TSnapRangeArray **vnodeSnapReaderGetTsdbRanges(SVSnapReader *pReader, int32_t tsdbTyp) { + ASSERTS(sizeof(pReader->pRsmaRanges) / sizeof(pReader->pRsmaRanges[0]) == 2, "Unexpected array size"); + switch (tsdbTyp) { + case SNAP_DATA_TSDB: + return &pReader->pRanges; + case SNAP_DATA_RSMA1: + return &pReader->pRsmaRanges[0]; + case SNAP_DATA_RSMA2: + return &pReader->pRsmaRanges[1]; + default: + return NULL; + } +} + +static int32_t vnodeSnapReaderDoSnapInfo(SVSnapReader *pReader, SSnapshotParam *pParam) { + SVnode *pVnode = pReader->pVnode; + int32_t code = -1; + + if (pParam->data) { + SSyncTLV *datHead = (void *)pParam->data; + if (datHead->typ != TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + terrno = TSDB_CODE_INVALID_DATA_FMT; + goto _out; + } + + TSnapRangeArray **ppRanges = NULL; + int32_t offset = 0; + + while (offset + sizeof(SSyncTLV) < datHead->len) { + SSyncTLV *subField = (void *)(datHead->val + offset); + offset += sizeof(SSyncTLV) + subField->len; + void *buf = subField->val; + int32_t bufLen = subField->len; + ppRanges = vnodeSnapReaderGetTsdbRanges(pReader, subField->typ); + if (ppRanges == NULL) { + vError("vgId:%d, unexpected subfield type in data of snapshot param. subtyp:%d", TD_VID(pVnode), subField->typ); + goto _out; + } + if (vnodeExtractSnapInfoDiff(buf, bufLen, ppRanges) < 0) { + vError("vgId:%d, failed to get range diff since %s", TD_VID(pVnode), terrstr()); + goto _out; + } + } + } + + code = 0; +_out: + return code; +} + +int32_t vnodeSnapReaderOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapReader **ppReader) { int32_t code = 0; + int64_t sver = pParam->start; + int64_t ever = pParam->end; SVSnapReader *pReader = NULL; pReader = (SVSnapReader *)taosMemoryCalloc(1, sizeof(*pReader)); @@ -59,6 +134,11 @@ int32_t vnodeSnapReaderOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapRe pReader->sver = sver; pReader->ever = ever; + // snapshot info + if (vnodeSnapReaderDoSnapInfo(pReader, pParam) < 0) { + goto _err; + } + vInfo("vgId:%d, vnode snapshot reader opened, sver:%" PRId64 " ever:%" PRId64, TD_VID(pVnode), sver, ever); *ppReader = pReader; return code; @@ -69,8 +149,19 @@ _err: return code; } +static void vnodeSnapReaderDestroyTsdbRanges(SVSnapReader *pReader) { + int32_t tsdbTyps[TSDB_RETENTION_MAX] = {SNAP_DATA_TSDB, SNAP_DATA_RSMA1, SNAP_DATA_RSMA2}; + for (int32_t j = 0; j < TSDB_RETENTION_MAX; ++j) { + TSnapRangeArray **ppRanges = vnodeSnapReaderGetTsdbRanges(pReader, tsdbTyps[j]); + if (ppRanges == NULL) continue; + tsdbSnapRangeArrayDestroy(ppRanges); + } +} + void vnodeSnapReaderClose(SVSnapReader *pReader) { vInfo("vgId:%d, close vnode snapshot reader", TD_VID(pReader->pVnode)); + vnodeSnapReaderDestroyTsdbRanges(pReader); + if (pReader->pRsmaReader) { rsmaSnapReaderClose(&pReader->pRsmaReader); } @@ -175,7 +266,7 @@ int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData) if (!pReader->tsdbDone) { // open if not if (pReader->pTsdbReader == NULL) { - code = tsdbSnapReaderOpen(pReader->pVnode->pTsdb, pReader->sver, pReader->ever, SNAP_DATA_TSDB, + code = tsdbSnapReaderOpen(pReader->pVnode->pTsdb, pReader->sver, pReader->ever, SNAP_DATA_TSDB, pReader->pRanges, &pReader->pTsdbReader); if (code) goto _err; } @@ -364,6 +455,7 @@ struct SVSnapWriter { // meta SMetaSnapWriter *pMetaSnapWriter; // tsdb + TSnapRangeArray *pRanges; STsdbSnapWriter *pTsdbSnapWriter; // tq STqSnapWriter *pTqSnapWriter; @@ -373,12 +465,65 @@ struct SVSnapWriter { SStreamTaskWriter *pStreamTaskWriter; SStreamStateWriter *pStreamStateWriter; // rsma + TSnapRangeArray *pRsmaRanges[TSDB_RETENTION_L2]; SRSmaSnapWriter *pRsmaSnapWriter; }; -int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWriter **ppWriter) { +TSnapRangeArray **vnodeSnapWriterGetTsdbRanges(SVSnapWriter *pWriter, int32_t tsdbTyp) { + ASSERTS(sizeof(pWriter->pRsmaRanges) / sizeof(pWriter->pRsmaRanges[0]) == 2, "Unexpected array size"); + switch (tsdbTyp) { + case SNAP_DATA_TSDB: + return &pWriter->pRanges; + case SNAP_DATA_RSMA1: + return &pWriter->pRsmaRanges[0]; + case SNAP_DATA_RSMA2: + return &pWriter->pRsmaRanges[1]; + default: + return NULL; + } +} + +static int32_t vnodeSnapWriterDoSnapInfo(SVSnapWriter *pWriter, SSnapshotParam *pParam) { + SVnode *pVnode = pWriter->pVnode; + int32_t code = -1; + + if (pParam->data) { + SSyncTLV *datHead = (void *)pParam->data; + if (datHead->typ != TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + terrno = TSDB_CODE_INVALID_DATA_FMT; + goto _out; + } + + TSnapRangeArray **ppRanges = NULL; + int32_t offset = 0; + + while (offset + sizeof(SSyncTLV) < datHead->len) { + SSyncTLV *subField = (void *)(datHead->val + offset); + offset += sizeof(SSyncTLV) + subField->len; + void *buf = subField->val; + int32_t bufLen = subField->len; + ppRanges = vnodeSnapWriterGetTsdbRanges(pWriter, subField->typ); + if (ppRanges == NULL) { + vError("vgId:%d, unexpected subfield type in data of snapshot param. subtyp:%d", TD_VID(pVnode), subField->typ); + goto _out; + } + if (vnodeExtractSnapInfoDiff(buf, bufLen, ppRanges) < 0) { + vError("vgId:%d, failed to get range diff since %s", TD_VID(pVnode), terrstr()); + goto _out; + } + } + } + + code = 0; +_out: + return code; +} + +int32_t vnodeSnapWriterOpen(SVnode *pVnode, SSnapshotParam *pParam, SVSnapWriter **ppWriter) { int32_t code = 0; SVSnapWriter *pWriter = NULL; + int64_t sver = pParam->start; + int64_t ever = pParam->end; // commit memory data vnodeAsyncCommit(pVnode); @@ -397,6 +542,11 @@ int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWr // inc commit ID pWriter->commitID = ++pVnode->state.commitID; + // snapshot info + if (vnodeSnapWriterDoSnapInfo(pWriter, pParam) < 0) { + goto _err; + } + vInfo("vgId:%d, vnode snapshot writer opened, sver:%" PRId64 " ever:%" PRId64 " commit id:%" PRId64, TD_VID(pVnode), sver, ever, pWriter->commitID); *ppWriter = pWriter; @@ -408,15 +558,30 @@ _err: return code; } +static void vnodeSnapWriterDestroyTsdbRanges(SVSnapWriter *pWriter) { + int32_t tsdbTyps[TSDB_RETENTION_MAX] = {SNAP_DATA_TSDB, SNAP_DATA_RSMA1, SNAP_DATA_RSMA2}; + for (int32_t j = 0; j < TSDB_RETENTION_MAX; ++j) { + TSnapRangeArray **ppRanges = vnodeSnapWriterGetTsdbRanges(pWriter, tsdbTyps[j]); + if (ppRanges == NULL) continue; + tsdbSnapRangeArrayDestroy(ppRanges); + } +} + int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *pSnapshot) { int32_t code = 0; SVnode *pVnode = pWriter->pVnode; + vnodeSnapWriterDestroyTsdbRanges(pWriter); + // prepare if (pWriter->pTsdbSnapWriter) { tsdbSnapWriterPrepareClose(pWriter->pTsdbSnapWriter); } + if (pWriter->pRsmaSnapWriter) { + rsmaSnapWriterPrepareClose(pWriter->pRsmaSnapWriter); + } + // commit json if (!rollback) { pWriter->info.state.committed = pWriter->ever; @@ -430,7 +595,9 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot * char dir[TSDB_FILENAME_LEN] = {0}; vnodeGetPrimaryDir(pVnode->path, pVnode->diskPrimary, pVnode->pTfs, dir, TSDB_FILENAME_LEN); - vnodeCommitInfo(dir); + code = vnodeCommitInfo(dir); + if (code) goto _exit; + } else { vnodeRollback(pWriter->pVnode); } @@ -561,7 +728,8 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) { case SNAP_DATA_DEL: { // tsdb if (pWriter->pTsdbSnapWriter == NULL) { - code = tsdbSnapWriterOpen(pVnode->pTsdb, pWriter->sver, pWriter->ever, &pWriter->pTsdbSnapWriter); + code = tsdbSnapWriterOpen(pVnode->pTsdb, pWriter->sver, pWriter->ever, pWriter->pRanges, + &pWriter->pTsdbSnapWriter); if (code) goto _err; } @@ -621,7 +789,8 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) { case SNAP_DATA_QTASK: { // rsma1/rsma2/qtask for rsma if (pWriter->pRsmaSnapWriter == NULL) { - code = rsmaSnapWriterOpen(pVnode->pSma, pWriter->sver, pWriter->ever, &pWriter->pRsmaSnapWriter); + code = rsmaSnapWriterOpen(pVnode->pSma, pWriter->sver, pWriter->ever, (void **)pWriter->pRsmaRanges, + &pWriter->pRsmaSnapWriter); if (code) goto _err; } diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index a6c743c87d..6c03ed68e9 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -15,6 +15,8 @@ #define _DEFAULT_SOURCE #include "tq.h" +#include "sync.h" +#include "tsdb.h" #include "vnd.h" #define BATCH_ENABLE 0 @@ -416,8 +418,8 @@ static int32_t vnodeSyncSendMsg(const SEpSet *pEpSet, SRpcMsg *pMsg) { return code; } -static void vnodeSyncGetSnapshotInfo(const SSyncFSM *pFsm, SSnapshot *pSnapshot) { - vnodeGetSnapshot(pFsm->data, pSnapshot); +static int32_t vnodeSyncGetSnapshotInfo(const SSyncFSM *pFsm, SSnapshot *pSnapshot) { + return vnodeGetSnapshot(pFsm->data, pSnapshot); } static int32_t vnodeSyncApplyMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta *pMeta) { @@ -475,8 +477,7 @@ static void vnodeSyncRollBackMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, SFsmCbMeta static int32_t vnodeSnapshotStartRead(const SSyncFSM *pFsm, void *pParam, void **ppReader) { SVnode *pVnode = pFsm->data; - SSnapshotParam *pSnapshotParam = pParam; - int32_t code = vnodeSnapReaderOpen(pVnode, pSnapshotParam->start, pSnapshotParam->end, (SVSnapReader **)ppReader); + int32_t code = vnodeSnapReaderOpen(pVnode, (SSnapshotParam *)pParam, (SVSnapReader **)ppReader); return code; } @@ -492,8 +493,7 @@ static int32_t vnodeSnapshotDoRead(const SSyncFSM *pFsm, void *pReader, void **p } static int32_t vnodeSnapshotStartWrite(const SSyncFSM *pFsm, void *pParam, void **ppWriter) { - SVnode *pVnode = pFsm->data; - SSnapshotParam *pSnapshotParam = pParam; + SVnode *pVnode = pFsm->data; do { int32_t itemSize = tmsgGetQueueSize(&pVnode->msgCb, pVnode->config.vgId, APPLY_QUEUE); @@ -506,7 +506,7 @@ static int32_t vnodeSnapshotStartWrite(const SSyncFSM *pFsm, void *pParam, void } } while (true); - int32_t code = vnodeSnapWriterOpen(pVnode, pSnapshotParam->start, pSnapshotParam->end, (SVSnapWriter **)ppWriter); + int32_t code = vnodeSnapWriterOpen(pVnode, (SSnapshotParam *)pParam, (SVSnapWriter **)ppWriter); return code; } @@ -642,6 +642,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) { pFsm->FpAppliedIndexCb = vnodeSyncAppliedIndex; pFsm->FpPreCommitCb = vnodeSyncPreCommitMsg; pFsm->FpRollBackCb = vnodeSyncRollBackMsg; + pFsm->FpGetSnapshot = NULL; pFsm->FpGetSnapshotInfo = vnodeSyncGetSnapshotInfo; pFsm->FpRestoreFinishCb = vnodeRestoreFinish; pFsm->FpLeaderTransferCb = NULL; @@ -784,3 +785,20 @@ bool vnodeIsLeader(SVnode *pVnode) { return true; } + +int32_t vnodeGetSnapshot(SVnode *pVnode, SSnapshot *pSnap) { + int code = 0; + pSnap->lastApplyIndex = pVnode->state.committed; + pSnap->lastApplyTerm = pVnode->state.commitTerm; + pSnap->lastConfigIndex = -1; + pSnap->state = SYNC_FSM_STATE_COMPLETE; + + if (tsdbSnapGetFsState(pVnode) != TSDB_FS_STATE_NORMAL) { + pSnap->state = SYNC_FSM_STATE_INCOMPLETE; + } + + if (pSnap->type == TDMT_SYNC_PREP_SNAPSHOT || pSnap->type == TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + code = tsdbSnapGetDetails(pVnode, pSnap); + } + return code; +} diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index c6b6648376..87b03469ce 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -1134,19 +1134,24 @@ partition_item(A) ::= expr_or_subquery(B) column_alias(C). partition_item(A) ::= expr_or_subquery(B) AS column_alias(C). { A = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, B), &C); } twindow_clause_opt(A) ::= . { A = NULL; } -twindow_clause_opt(A) ::= - SESSION NK_LP column_reference(B) NK_COMMA duration_literal(C) NK_RP. { A = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C)); } +twindow_clause_opt(A) ::= SESSION NK_LP column_reference(B) NK_COMMA + interval_sliding_duration_literal(C) NK_RP. { A = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C)); } twindow_clause_opt(A) ::= STATE_WINDOW NK_LP expr_or_subquery(B) NK_RP. { A = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, B)); } +twindow_clause_opt(A) ::= INTERVAL NK_LP interval_sliding_duration_literal(B) + NK_RP sliding_opt(C) fill_opt(D). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), NULL, C, D); } twindow_clause_opt(A) ::= - INTERVAL NK_LP duration_literal(B) NK_RP sliding_opt(C) fill_opt(D). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), NULL, C, D); } -twindow_clause_opt(A) ::= - INTERVAL NK_LP duration_literal(B) NK_COMMA duration_literal(C) NK_RP + INTERVAL NK_LP interval_sliding_duration_literal(B) NK_COMMA + interval_sliding_duration_literal(C) NK_RP sliding_opt(D) fill_opt(E). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C), D, E); } twindow_clause_opt(A) ::= EVENT_WINDOW START WITH search_condition(B) END WITH search_condition(C). { A = createEventWindowNode(pCxt, B, C); } sliding_opt(A) ::= . { A = NULL; } -sliding_opt(A) ::= SLIDING NK_LP duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } +sliding_opt(A) ::= SLIDING NK_LP interval_sliding_duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } + +interval_sliding_duration_literal(A) ::= NK_VARIABLE(B). { A = createRawExprNode(pCxt, &B, createDurationValueNode(pCxt, &B)); } +interval_sliding_duration_literal(A) ::= NK_STRING(B). { A = createRawExprNode(pCxt, &B, createDurationValueNode(pCxt, &B)); } +interval_sliding_duration_literal(A) ::= NK_INTEGER(B). { A = createRawExprNode(pCxt, &B, createDurationValueNode(pCxt, &B)); } fill_opt(A) ::= . { A = NULL; } fill_opt(A) ::= FILL NK_LP fill_mode(B) NK_RP. { A = createFillNode(pCxt, B, NULL); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 715a28082a..410db11a20 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -509,7 +509,40 @@ SNode* createDurationValueNode(SAstCreateContext* pCxt, const SToken* pLiteral) CHECK_PARSER_STATUS(pCxt); SValueNode* val = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); CHECK_OUT_OF_MEM(val); - val->literal = strndup(pLiteral->z, pLiteral->n); + if (pLiteral->type == TK_NK_STRING) { + // like '100s' or "100d" + // check format: ^[0-9]+[smwbauhdny]$' + if (pLiteral->n < 4) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, pLiteral->z); + return NULL; + } + char unit = pLiteral->z[pLiteral->n - 2]; + switch (unit) { + case 'a': + case 'b': + case 'd': + case 'h': + case 'm': + case 's': + case 'u': + case 'w': + case 'y': + case 'n': + break; + default: + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, pLiteral->z); + return NULL; + } + for (uint32_t i = 1; i < pLiteral->n - 2; ++i) { + if (!isdigit(pLiteral->z[i])) { + pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, pLiteral->z); + return NULL; + } + } + val->literal = strndup(pLiteral->z + 1, pLiteral->n - 2); + } else { + val->literal = strndup(pLiteral->z, pLiteral->n); + } CHECK_OUT_OF_MEM(val->literal); val->isDuration = true; val->translate = false; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 180ccd7798..63d25bd1d8 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3383,10 +3383,11 @@ static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjection } static int32_t translateProjectionList(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (pSelect->isSubquery) { - return checkProjectAlias(pCxt, pSelect->pProjectionList, NULL); + if (!pSelect->isSubquery) { + return rewriteProjectAlias(pSelect->pProjectionList); + } else { + return TSDB_CODE_SUCCESS; } - return rewriteProjectAlias(pSelect->pProjectionList); } static int32_t translateSelectList(STranslateContext* pCxt, SSelectStmt* pSelect) { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 512aa06351..6c1f9166d5 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 505 +#define YYNOCODE 506 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EJoinType yy42; - SToken yy129; - bool yy137; - EOrder yy178; - SShowTablesOption yy217; - EFillMode yy264; - int8_t yy313; - SAlterOption yy335; - SNode* yy452; - int64_t yy479; - int32_t yy710; - EShowKind yy749; - EOperatorType yy750; - STokenPair yy767; - SDataType yy794; - ENullOrder yy807; - SNodeList* yy844; + EFillMode yy30; + int64_t yy41; + STokenPair yy49; + int32_t yy156; + SAlterOption yy189; + SNodeList* yy332; + EJoinType yy333; + EOperatorType yy436; + SNode* yy476; + SToken yy481; + EShowKind yy585; + SShowTablesOption yy729; + int8_t yy751; + SDataType yy752; + EOrder yy906; + ENullOrder yy961; + bool yy977; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -143,17 +143,17 @@ typedef union { #define ParseCTX_STORE #define YYFALLBACK 1 #define YYNSTATE 833 -#define YYNRULE 632 -#define YYNRULE_WITH_ACTION 632 +#define YYNRULE 635 +#define YYNRULE_WITH_ACTION 635 #define YYNTOKEN 345 #define YY_MAX_SHIFT 832 -#define YY_MIN_SHIFTREDUCE 1228 -#define YY_MAX_SHIFTREDUCE 1859 -#define YY_ERROR_ACTION 1860 -#define YY_ACCEPT_ACTION 1861 -#define YY_NO_ACTION 1862 -#define YY_MIN_REDUCE 1863 -#define YY_MAX_REDUCE 2494 +#define YY_MIN_SHIFTREDUCE 1231 +#define YY_MAX_SHIFTREDUCE 1865 +#define YY_ERROR_ACTION 1866 +#define YY_ACCEPT_ACTION 1867 +#define YY_NO_ACTION 1868 +#define YY_MIN_REDUCE 1869 +#define YY_MAX_REDUCE 2503 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -220,609 +220,610 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2986) +#define YY_ACTTAB_COUNT (2992) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 38, 319, 418, 469, 2103, 556, 720, 2050, 557, 1906, - /* 10 */ 168, 396, 48, 46, 1786, 424, 423, 397, 2052, 2101, - /* 20 */ 415, 1655, 1630, 41, 40, 2101, 137, 47, 45, 44, - /* 30 */ 43, 42, 34, 599, 719, 1712, 1947, 1628, 41, 40, - /* 40 */ 1637, 2103, 47, 45, 44, 43, 42, 2301, 523, 521, - /* 50 */ 2404, 364, 2103, 173, 634, 208, 706, 699, 146, 381, - /* 60 */ 702, 1990, 68, 187, 1707, 1864, 1294, 2101, 1293, 632, - /* 70 */ 19, 630, 261, 260, 41, 40, 2401, 1636, 47, 45, - /* 80 */ 44, 43, 42, 142, 719, 383, 127, 2163, 2319, 126, - /* 90 */ 125, 124, 123, 122, 121, 120, 119, 118, 645, 30, - /* 100 */ 2268, 1295, 736, 829, 475, 2159, 15, 561, 804, 803, + /* 0 */ 173, 409, 462, 418, 2267, 720, 2056, 461, 1996, 171, + /* 10 */ 1997, 168, 48, 46, 1789, 424, 423, 2058, 397, 2058, + /* 20 */ 415, 2478, 1633, 41, 40, 137, 2107, 47, 45, 44, + /* 30 */ 43, 42, 599, 1659, 1892, 1715, 1953, 1631, 41, 40, + /* 40 */ 1640, 2109, 47, 45, 44, 43, 42, 2307, 396, 720, + /* 50 */ 2056, 2109, 662, 469, 662, 2474, 2107, 2474, 381, 1658, + /* 60 */ 702, 38, 319, 30, 1710, 1870, 2107, 719, 556, 203, + /* 70 */ 19, 557, 1912, 2480, 198, 2480, 198, 1639, 2475, 688, + /* 80 */ 2475, 688, 699, 146, 720, 2056, 127, 2274, 2325, 126, + /* 90 */ 125, 124, 123, 122, 121, 120, 119, 118, 523, 521, + /* 100 */ 2274, 364, 736, 829, 56, 212, 15, 561, 804, 803, /* 110 */ 802, 801, 427, 558, 800, 799, 150, 794, 793, 792, /* 120 */ 791, 790, 789, 788, 162, 784, 783, 782, 426, 425, - /* 130 */ 779, 778, 777, 181, 180, 776, 1886, 687, 481, 2159, - /* 140 */ 2465, 2300, 1714, 1715, 2336, 573, 572, 114, 2302, 740, - /* 150 */ 2304, 2305, 735, 210, 730, 509, 2159, 686, 194, 191, - /* 160 */ 2183, 2389, 2466, 688, 63, 411, 2385, 298, 2397, 698, - /* 170 */ 51, 138, 697, 1826, 2465, 408, 1687, 1697, 2180, 707, - /* 180 */ 196, 576, 553, 1713, 1716, 2278, 719, 213, 2419, 2268, - /* 190 */ 551, 686, 194, 547, 543, 2026, 2466, 688, 1631, 2286, - /* 200 */ 1629, 574, 2176, 1640, 218, 1856, 2404, 41, 40, 2282, - /* 210 */ 682, 47, 45, 44, 43, 42, 2097, 2098, 127, 63, - /* 220 */ 1655, 126, 125, 124, 123, 122, 121, 120, 119, 118, - /* 230 */ 1634, 1635, 2400, 1686, 1689, 1690, 1691, 1692, 1693, 1694, - /* 240 */ 1695, 1696, 732, 728, 1705, 1706, 1708, 1709, 1710, 1711, - /* 250 */ 2, 48, 46, 2284, 412, 677, 363, 2469, 1653, 415, - /* 260 */ 174, 1630, 1875, 730, 775, 507, 2301, 564, 526, 375, - /* 270 */ 557, 1906, 51, 525, 1712, 98, 1628, 41, 40, 737, - /* 280 */ 775, 47, 45, 44, 43, 42, 264, 36, 1885, 489, - /* 290 */ 263, 527, 1268, 41, 40, 2103, 491, 47, 45, 44, - /* 300 */ 43, 42, 405, 1707, 409, 1578, 63, 2319, 1855, 19, - /* 310 */ 2101, 1275, 171, 1741, 420, 325, 1636, 2096, 2098, 2268, - /* 320 */ 2052, 736, 41, 40, 2301, 302, 47, 45, 44, 43, - /* 330 */ 42, 618, 617, 616, 1270, 1273, 1274, 702, 608, 143, - /* 340 */ 612, 2268, 829, 384, 611, 15, 683, 678, 671, 610, - /* 350 */ 615, 391, 390, 643, 477, 609, 97, 1884, 605, 370, - /* 360 */ 2300, 112, 395, 2336, 636, 2319, 175, 2302, 740, 2304, - /* 370 */ 2305, 735, 1656, 730, 1742, 171, 1825, 2268, 147, 736, - /* 380 */ 302, 1714, 1715, 2053, 2170, 2149, 2042, 514, 513, 512, + /* 130 */ 779, 778, 777, 181, 180, 776, 687, 1832, 174, 2474, + /* 140 */ 1881, 2306, 1717, 1718, 2342, 219, 719, 114, 2308, 740, + /* 150 */ 2310, 2311, 735, 51, 730, 1467, 1468, 686, 198, 195, + /* 160 */ 106, 2395, 2475, 688, 127, 411, 2391, 126, 125, 124, + /* 170 */ 123, 122, 121, 120, 119, 118, 1690, 1700, 564, 418, + /* 180 */ 200, 557, 1912, 1716, 1719, 2049, 89, 171, 2425, 88, + /* 190 */ 699, 146, 299, 2403, 698, 2058, 138, 697, 1634, 2474, + /* 200 */ 1632, 677, 719, 1643, 193, 1862, 420, 41, 40, 2102, + /* 210 */ 2104, 47, 45, 44, 43, 42, 2096, 686, 198, 576, + /* 220 */ 41, 40, 2475, 688, 47, 45, 44, 43, 42, 681, + /* 230 */ 1637, 1638, 51, 1689, 1692, 1693, 1694, 1695, 1696, 1697, + /* 240 */ 1698, 1699, 732, 728, 1708, 1709, 1711, 1712, 1713, 1714, + /* 250 */ 2, 48, 46, 87, 421, 68, 363, 2325, 1656, 415, + /* 260 */ 1658, 1633, 171, 517, 148, 507, 2307, 2366, 526, 375, + /* 270 */ 2058, 475, 2165, 525, 1715, 1661, 1631, 41, 40, 737, + /* 280 */ 2109, 47, 45, 44, 43, 42, 268, 405, 191, 489, + /* 290 */ 267, 527, 683, 678, 671, 2107, 491, 98, 112, 701, + /* 300 */ 196, 2403, 2404, 1710, 144, 2408, 690, 2325, 1861, 19, + /* 310 */ 383, 634, 2169, 1744, 303, 147, 1639, 2189, 680, 2274, + /* 320 */ 214, 736, 1891, 2048, 2307, 223, 632, 1581, 630, 265, + /* 330 */ 264, 618, 617, 616, 645, 2187, 707, 702, 608, 143, + /* 340 */ 612, 63, 829, 384, 611, 15, 63, 516, 515, 610, + /* 350 */ 615, 391, 390, 1658, 477, 609, 97, 63, 605, 370, + /* 360 */ 2306, 158, 395, 2342, 636, 2325, 175, 2308, 740, 2310, + /* 370 */ 2311, 735, 1659, 730, 1745, 2274, 1831, 2274, 94, 736, + /* 380 */ 1793, 1717, 1718, 643, 2176, 2155, 1658, 514, 513, 512, /* 390 */ 511, 506, 505, 504, 503, 502, 497, 496, 495, 494, - /* 400 */ 367, 486, 485, 484, 2404, 479, 478, 382, 663, 2430, - /* 410 */ 2268, 1518, 1519, 699, 146, 1687, 1697, 1537, 2300, 1297, - /* 420 */ 1298, 2336, 1713, 1716, 114, 2302, 740, 2304, 2305, 735, - /* 430 */ 2399, 730, 1656, 302, 1861, 1655, 191, 1631, 2389, 1629, - /* 440 */ 41, 40, 411, 2385, 47, 45, 44, 43, 42, 2470, - /* 450 */ 699, 146, 1659, 37, 413, 1736, 1737, 1738, 1739, 1740, - /* 460 */ 1744, 1745, 1746, 1747, 1636, 2420, 1658, 302, 681, 1634, - /* 470 */ 1635, 9, 1686, 1689, 1690, 1691, 1692, 1693, 1694, 1695, - /* 480 */ 1696, 732, 728, 1705, 1706, 1708, 1709, 1710, 1711, 2, - /* 490 */ 12, 48, 46, 2301, 1550, 1551, 2319, 310, 311, 415, - /* 500 */ 12, 1630, 309, 699, 146, 1275, 737, 47, 45, 44, - /* 510 */ 43, 42, 687, 430, 1712, 2465, 1628, 1294, 429, 1293, - /* 520 */ 720, 2050, 701, 192, 2397, 2398, 2301, 144, 2402, 1273, - /* 530 */ 1274, 786, 686, 194, 2319, 1549, 1552, 2466, 688, 737, - /* 540 */ 137, 1916, 690, 1707, 1863, 1790, 2268, 604, 736, 19, - /* 550 */ 63, 1655, 1295, 1849, 1464, 1465, 1636, 680, 720, 2050, - /* 560 */ 193, 2397, 2398, 662, 144, 2402, 2465, 2319, 136, 135, - /* 570 */ 134, 133, 132, 131, 130, 129, 128, 187, 199, 2268, - /* 580 */ 517, 736, 829, 2471, 194, 15, 52, 2300, 2466, 688, - /* 590 */ 2336, 1530, 1531, 114, 2302, 740, 2304, 2305, 735, 462, - /* 600 */ 730, 2164, 1722, 149, 461, 155, 2360, 2389, 1655, 766, - /* 610 */ 278, 411, 2385, 195, 2397, 2398, 2183, 144, 2402, 1883, - /* 620 */ 2300, 1714, 1715, 2336, 300, 1658, 114, 2302, 740, 2304, - /* 630 */ 2305, 735, 2027, 730, 2181, 707, 189, 215, 2485, 190, - /* 640 */ 2389, 460, 219, 459, 411, 2385, 720, 2050, 2090, 662, - /* 650 */ 1891, 824, 2465, 41, 40, 1687, 1697, 47, 45, 44, - /* 660 */ 43, 42, 1713, 1716, 516, 515, 56, 646, 2039, 2471, - /* 670 */ 194, 1429, 2268, 458, 2466, 688, 229, 1631, 89, 1629, - /* 680 */ 559, 88, 1914, 720, 2050, 1420, 765, 764, 763, 1424, - /* 690 */ 762, 1426, 1427, 761, 758, 1775, 1435, 755, 1437, 1438, - /* 700 */ 752, 749, 746, 466, 44, 43, 42, 1688, 1814, 1634, - /* 710 */ 1635, 302, 1686, 1689, 1690, 1691, 1692, 1693, 1694, 1695, - /* 720 */ 1696, 732, 728, 1705, 1706, 1708, 1709, 1710, 1711, 2, - /* 730 */ 48, 46, 1717, 2301, 720, 2050, 1630, 1882, 415, 265, - /* 740 */ 1630, 566, 2222, 720, 2050, 87, 737, 302, 2427, 94, - /* 750 */ 2035, 1628, 1802, 1712, 467, 1628, 674, 673, 1812, 1813, - /* 760 */ 1815, 1816, 1817, 483, 1688, 2301, 385, 773, 160, 159, - /* 770 */ 770, 769, 768, 157, 2319, 2045, 2134, 2103, 737, 2261, - /* 780 */ 2440, 231, 1707, 300, 410, 559, 2268, 1914, 736, 2231, - /* 790 */ 2268, 1636, 2101, 720, 2050, 1636, 773, 160, 159, 770, - /* 800 */ 769, 768, 157, 2301, 41, 40, 2319, 646, 47, 45, - /* 810 */ 44, 43, 42, 498, 1599, 1600, 737, 829, 2268, 1277, - /* 820 */ 736, 829, 720, 2050, 49, 1654, 623, 2300, 106, 662, - /* 830 */ 2336, 1373, 2465, 114, 2302, 740, 2304, 2305, 735, 1881, - /* 840 */ 730, 635, 499, 266, 2319, 2485, 1880, 2389, 450, 2471, - /* 850 */ 194, 411, 2385, 2043, 2466, 688, 2268, 262, 736, 2300, - /* 860 */ 1714, 1715, 2336, 2037, 2278, 114, 2302, 740, 2304, 2305, - /* 870 */ 735, 1375, 730, 626, 1659, 452, 448, 2485, 2041, 2389, - /* 880 */ 620, 648, 2222, 411, 2385, 12, 259, 10, 2282, 720, - /* 890 */ 2050, 2249, 2268, 2033, 1687, 1697, 1743, 2300, 2103, 2268, - /* 900 */ 2336, 1713, 1716, 114, 2302, 740, 2304, 2305, 735, 500, - /* 910 */ 730, 2025, 1631, 715, 1629, 2364, 1631, 2389, 1629, 2278, - /* 920 */ 418, 411, 2385, 1879, 2103, 1384, 1388, 72, 171, 1659, - /* 930 */ 71, 419, 2284, 2287, 661, 2103, 2052, 493, 2262, 2101, - /* 940 */ 1383, 1387, 730, 2282, 1634, 1635, 492, 1878, 1634, 1635, - /* 950 */ 2102, 1686, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, - /* 960 */ 732, 728, 1705, 1706, 1708, 1709, 1710, 1711, 2, 48, - /* 970 */ 46, 2301, 1877, 1783, 170, 35, 2268, 415, 1874, 1630, - /* 980 */ 148, 720, 2050, 2360, 737, 1748, 669, 2284, 662, 1991, - /* 990 */ 2470, 2465, 1712, 2465, 1628, 389, 388, 730, 720, 2050, - /* 1000 */ 2268, 575, 2470, 694, 2301, 2465, 528, 530, 2471, 194, - /* 1010 */ 691, 2469, 2319, 2466, 688, 2466, 2468, 737, 2047, 2458, - /* 1020 */ 722, 1707, 2361, 2469, 2268, 2268, 736, 2466, 2467, 14, - /* 1030 */ 13, 2268, 211, 1873, 1636, 720, 2050, 767, 720, 2050, - /* 1040 */ 2094, 720, 2050, 2409, 1775, 2319, 773, 160, 159, 770, - /* 1050 */ 769, 768, 157, 595, 594, 267, 1655, 2268, 275, 736, - /* 1060 */ 829, 705, 61, 49, 1872, 2300, 387, 386, 2336, 601, - /* 1070 */ 659, 114, 2302, 740, 2304, 2305, 735, 1871, 730, 1950, - /* 1080 */ 421, 614, 613, 2485, 1870, 2389, 2268, 277, 171, 411, - /* 1090 */ 2385, 603, 720, 2050, 1869, 602, 2052, 1868, 2300, 1714, - /* 1100 */ 1715, 2336, 2054, 1867, 114, 2302, 740, 2304, 2305, 735, - /* 1110 */ 1866, 730, 314, 597, 596, 201, 2485, 2268, 2389, 720, - /* 1120 */ 2050, 727, 411, 2385, 720, 2050, 720, 2050, 720, 2050, - /* 1130 */ 2268, 798, 796, 1687, 1697, 1755, 724, 2268, 2361, 717, - /* 1140 */ 1713, 1716, 94, 158, 718, 603, 320, 2268, 422, 602, - /* 1150 */ 2268, 618, 617, 616, 3, 1631, 2268, 1629, 608, 143, - /* 1160 */ 612, 76, 334, 2268, 611, 2080, 54, 1917, 2046, 610, - /* 1170 */ 615, 391, 390, 771, 139, 609, 2094, 641, 605, 772, - /* 1180 */ 787, 2252, 2094, 2012, 2144, 1639, 85, 1634, 1635, 2028, - /* 1190 */ 1686, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 732, - /* 1200 */ 728, 1705, 1706, 1708, 1709, 1710, 1711, 2, 48, 46, - /* 1210 */ 2301, 86, 1688, 1934, 276, 158, 415, 55, 1630, 822, - /* 1220 */ 158, 252, 151, 737, 250, 2408, 473, 662, 1858, 1859, - /* 1230 */ 2465, 1712, 437, 1628, 1925, 619, 424, 423, 1782, 254, - /* 1240 */ 256, 258, 253, 255, 257, 606, 1644, 2471, 194, 1923, - /* 1250 */ 607, 2319, 2466, 688, 1638, 638, 621, 637, 99, 1712, - /* 1260 */ 1707, 1637, 695, 2268, 272, 736, 647, 692, 2289, 1370, - /* 1270 */ 731, 624, 50, 1636, 1368, 50, 14, 13, 282, 158, - /* 1280 */ 703, 1733, 780, 1876, 50, 307, 75, 156, 1707, 1594, - /* 1290 */ 158, 66, 50, 50, 1597, 2433, 111, 141, 295, 829, - /* 1300 */ 744, 1636, 15, 156, 2300, 108, 1347, 2336, 781, 158, - /* 1310 */ 114, 2302, 740, 2304, 2305, 735, 662, 730, 140, 2465, - /* 1320 */ 675, 172, 2485, 156, 2389, 2291, 341, 726, 411, 2385, - /* 1330 */ 662, 289, 1345, 2465, 1907, 1988, 2471, 194, 1714, 1715, - /* 1340 */ 1987, 2466, 688, 338, 74, 1328, 1811, 73, 1642, 1810, - /* 1350 */ 2471, 194, 284, 704, 2320, 2466, 688, 365, 1547, 312, - /* 1360 */ 712, 316, 398, 428, 1414, 1749, 1698, 333, 227, 538, - /* 1370 */ 536, 533, 1687, 1697, 1442, 2168, 1913, 1446, 2091, 1713, - /* 1380 */ 1716, 655, 2423, 1453, 700, 1329, 297, 294, 5, 301, - /* 1390 */ 436, 431, 1451, 379, 1631, 444, 1629, 161, 445, 1662, - /* 1400 */ 454, 453, 203, 202, 205, 1571, 328, 456, 1653, 63, - /* 1410 */ 470, 1654, 217, 474, 476, 1659, 2169, 1641, 480, 482, - /* 1420 */ 487, 501, 1645, 519, 1640, 508, 1634, 1635, 2161, 1686, - /* 1430 */ 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 732, 728, - /* 1440 */ 1705, 1706, 1708, 1709, 1710, 1711, 2, 64, 2301, 510, - /* 1450 */ 518, 520, 531, 532, 1648, 1650, 529, 221, 222, 535, - /* 1460 */ 534, 737, 224, 537, 539, 1660, 554, 728, 1705, 1706, - /* 1470 */ 1708, 1709, 1710, 1711, 4, 562, 555, 563, 565, 1656, - /* 1480 */ 232, 567, 1661, 2301, 91, 235, 568, 1663, 569, 2319, - /* 1490 */ 571, 1664, 238, 83, 82, 465, 737, 577, 207, 2177, - /* 1500 */ 598, 2268, 240, 736, 627, 92, 2301, 93, 245, 116, - /* 1510 */ 628, 457, 455, 360, 600, 2040, 249, 640, 2036, 737, - /* 1520 */ 96, 642, 366, 251, 2319, 446, 329, 152, 443, 439, - /* 1530 */ 435, 432, 458, 164, 165, 2038, 2268, 268, 736, 1657, - /* 1540 */ 2034, 2301, 2300, 166, 167, 2336, 650, 2319, 114, 2302, - /* 1550 */ 740, 2304, 2305, 735, 737, 730, 676, 2240, 2237, 2268, - /* 1560 */ 2362, 736, 2389, 2236, 649, 273, 411, 2385, 654, 666, - /* 1570 */ 302, 657, 2439, 710, 271, 2223, 651, 2300, 2438, 8, - /* 1580 */ 2336, 672, 2319, 114, 2302, 740, 2304, 2305, 735, 656, - /* 1590 */ 730, 2424, 2434, 280, 2268, 723, 736, 2389, 283, 685, - /* 1600 */ 2300, 411, 2385, 2336, 401, 679, 115, 2302, 740, 2304, - /* 1610 */ 2305, 735, 667, 730, 665, 664, 293, 402, 2488, 1658, - /* 1620 */ 2389, 696, 693, 1775, 2388, 2385, 145, 1780, 1778, 303, - /* 1630 */ 2405, 153, 708, 184, 330, 2300, 709, 2301, 2336, 644, - /* 1640 */ 2411, 115, 2302, 740, 2304, 2305, 735, 290, 730, 331, - /* 1650 */ 737, 2191, 1, 288, 179, 2389, 291, 832, 292, 725, - /* 1660 */ 2385, 713, 2190, 2301, 197, 154, 332, 2189, 105, 2464, - /* 1670 */ 714, 2051, 296, 327, 407, 62, 734, 2370, 2319, 107, - /* 1680 */ 742, 2095, 335, 2013, 323, 1252, 826, 823, 163, 186, - /* 1690 */ 2268, 828, 736, 359, 371, 344, 53, 820, 816, 812, - /* 1700 */ 808, 358, 324, 372, 2319, 337, 2301, 348, 339, 2260, - /* 1710 */ 2259, 2258, 80, 2253, 434, 433, 2268, 1621, 736, 737, - /* 1720 */ 1622, 200, 438, 2251, 440, 441, 442, 1620, 2250, 380, - /* 1730 */ 2248, 738, 447, 2247, 2336, 2246, 449, 115, 2302, 740, - /* 1740 */ 2304, 2305, 735, 113, 730, 451, 317, 2319, 1610, 2227, - /* 1750 */ 204, 2389, 2226, 206, 1574, 374, 2385, 2300, 81, 2268, - /* 1760 */ 2336, 736, 1573, 356, 2302, 740, 2304, 2305, 735, 733, - /* 1770 */ 730, 721, 2354, 2301, 2204, 2203, 2202, 463, 716, 464, - /* 1780 */ 2201, 2200, 2151, 468, 2143, 1517, 737, 471, 472, 2140, - /* 1790 */ 209, 2139, 84, 2138, 2137, 2142, 2141, 212, 2136, 2135, - /* 1800 */ 2300, 2133, 2132, 2336, 2131, 214, 176, 2302, 740, 2304, - /* 1810 */ 2305, 735, 2130, 730, 2319, 488, 2301, 490, 305, 2146, - /* 1820 */ 2129, 2128, 2127, 2126, 2125, 304, 2268, 2148, 736, 737, - /* 1830 */ 90, 216, 2114, 2113, 2112, 2111, 2147, 2145, 2301, 2124, - /* 1840 */ 2123, 2122, 2121, 2120, 269, 2119, 2118, 2117, 2116, 2115, - /* 1850 */ 2110, 737, 2109, 1523, 2108, 2107, 2106, 2319, 522, 689, - /* 1860 */ 2486, 524, 220, 2105, 2104, 368, 1385, 2300, 369, 2268, - /* 1870 */ 2336, 736, 1953, 115, 2302, 740, 2304, 2305, 735, 2319, - /* 1880 */ 730, 2301, 1389, 1952, 399, 1951, 1949, 2389, 1381, 223, - /* 1890 */ 225, 2268, 2386, 736, 737, 540, 2301, 1946, 1945, 542, - /* 1900 */ 1938, 546, 226, 544, 541, 548, 1927, 550, 552, 737, - /* 1910 */ 2300, 2301, 545, 2336, 1902, 228, 175, 2302, 740, 2304, - /* 1920 */ 2305, 735, 2319, 730, 737, 549, 78, 400, 2288, 182, - /* 1930 */ 188, 1276, 2300, 1901, 2268, 2336, 736, 2319, 357, 2302, - /* 1940 */ 740, 2304, 2305, 735, 230, 730, 79, 2225, 560, 2268, - /* 1950 */ 2221, 736, 2319, 2211, 2199, 237, 239, 2198, 242, 2431, - /* 1960 */ 2175, 2029, 1321, 1948, 2268, 1944, 736, 578, 580, 579, - /* 1970 */ 1942, 582, 583, 584, 1940, 2300, 586, 588, 2336, 587, - /* 1980 */ 1937, 357, 2302, 740, 2304, 2305, 735, 591, 730, 590, - /* 1990 */ 2300, 2301, 1922, 2336, 65, 1458, 350, 2302, 740, 2304, - /* 2000 */ 2305, 735, 1920, 730, 737, 2300, 592, 1921, 2336, 2301, - /* 2010 */ 1919, 176, 2302, 740, 2304, 2305, 735, 1898, 730, 2031, - /* 2020 */ 248, 1457, 734, 1372, 1371, 2301, 2030, 1369, 1367, 247, - /* 2030 */ 1366, 1358, 2319, 1365, 1364, 1363, 795, 406, 737, 797, - /* 2040 */ 1935, 684, 392, 1926, 2268, 178, 736, 393, 1360, 1359, - /* 2050 */ 2319, 1357, 1924, 593, 589, 585, 581, 622, 246, 394, - /* 2060 */ 1897, 625, 2268, 1896, 736, 2487, 2319, 1895, 629, 1894, - /* 2070 */ 631, 414, 1893, 633, 117, 1608, 1604, 29, 2268, 1606, - /* 2080 */ 736, 1603, 2224, 57, 69, 2300, 2220, 1584, 2336, 58, - /* 2090 */ 270, 357, 2302, 740, 2304, 2305, 735, 1582, 730, 95, - /* 2100 */ 2210, 1580, 244, 2300, 2301, 652, 2336, 653, 169, 356, - /* 2110 */ 2302, 740, 2304, 2305, 735, 2197, 730, 737, 2355, 2300, - /* 2120 */ 2196, 274, 2336, 1559, 2470, 357, 2302, 740, 2304, 2305, - /* 2130 */ 735, 658, 730, 1558, 660, 2301, 31, 20, 279, 17, - /* 2140 */ 6, 1828, 7, 281, 21, 2319, 22, 286, 737, 668, - /* 2150 */ 416, 670, 33, 1809, 177, 287, 285, 2268, 2289, 736, - /* 2160 */ 1801, 32, 100, 67, 23, 1848, 234, 24, 1849, 1843, - /* 2170 */ 1842, 299, 403, 1847, 243, 236, 2319, 1846, 2301, 404, - /* 2180 */ 1772, 241, 570, 1771, 18, 59, 60, 183, 2268, 2195, - /* 2190 */ 736, 737, 2174, 101, 102, 25, 2173, 308, 2300, 313, - /* 2200 */ 233, 2336, 306, 1807, 357, 2302, 740, 2304, 2305, 735, - /* 2210 */ 711, 730, 103, 70, 104, 315, 108, 318, 26, 2319, - /* 2220 */ 1724, 11, 13, 2339, 1646, 1734, 185, 1723, 198, 639, - /* 2230 */ 729, 2268, 2336, 736, 1702, 352, 2302, 740, 2304, 2305, - /* 2240 */ 735, 1679, 730, 2301, 1700, 39, 741, 739, 1699, 16, - /* 2250 */ 27, 743, 1671, 28, 417, 1443, 737, 745, 2301, 747, - /* 2260 */ 750, 1440, 748, 753, 1439, 751, 756, 759, 1436, 754, - /* 2270 */ 757, 737, 2300, 2301, 1430, 2336, 1428, 760, 342, 2302, - /* 2280 */ 740, 2304, 2305, 735, 2319, 730, 737, 109, 321, 1434, - /* 2290 */ 110, 1452, 1433, 1432, 77, 1448, 2268, 774, 736, 2319, - /* 2300 */ 1431, 1354, 1319, 1351, 1350, 1349, 1348, 1346, 1344, 1343, - /* 2310 */ 785, 2268, 1342, 736, 2319, 1379, 322, 1340, 1339, 1338, - /* 2320 */ 1337, 1336, 1335, 1334, 1376, 1374, 2268, 1331, 736, 1330, - /* 2330 */ 1327, 1326, 1325, 1324, 1943, 1941, 805, 2300, 806, 807, - /* 2340 */ 2336, 809, 810, 340, 2302, 740, 2304, 2305, 735, 811, - /* 2350 */ 730, 1939, 2300, 2301, 813, 2336, 814, 815, 343, 2302, - /* 2360 */ 740, 2304, 2305, 735, 1936, 730, 737, 2300, 817, 818, - /* 2370 */ 2336, 2301, 819, 349, 2302, 740, 2304, 2305, 735, 1918, - /* 2380 */ 730, 1892, 821, 1265, 737, 1253, 2301, 825, 326, 827, - /* 2390 */ 1862, 1632, 336, 830, 2319, 831, 1862, 1862, 1862, 737, - /* 2400 */ 1862, 1862, 1862, 1862, 1862, 1862, 2268, 1862, 736, 1862, - /* 2410 */ 1862, 1862, 2319, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2420 */ 1862, 1862, 1862, 1862, 2268, 1862, 736, 2319, 1862, 2301, - /* 2430 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 2268, - /* 2440 */ 1862, 736, 737, 1862, 1862, 1862, 1862, 2300, 1862, 1862, - /* 2450 */ 2336, 2301, 1862, 353, 2302, 740, 2304, 2305, 735, 1862, - /* 2460 */ 730, 1862, 1862, 1862, 737, 2300, 2301, 1862, 2336, 1862, - /* 2470 */ 2319, 345, 2302, 740, 2304, 2305, 735, 1862, 730, 737, - /* 2480 */ 2300, 1862, 2268, 2336, 736, 1862, 354, 2302, 740, 2304, - /* 2490 */ 2305, 735, 2319, 730, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2500 */ 1862, 1862, 1862, 1862, 2268, 1862, 736, 2319, 1862, 1862, - /* 2510 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 2268, - /* 2520 */ 1862, 736, 1862, 2300, 2301, 1862, 2336, 1862, 1862, 346, - /* 2530 */ 2302, 740, 2304, 2305, 735, 1862, 730, 737, 1862, 1862, - /* 2540 */ 1862, 1862, 1862, 1862, 1862, 2300, 1862, 1862, 2336, 2301, - /* 2550 */ 1862, 355, 2302, 740, 2304, 2305, 735, 1862, 730, 1862, - /* 2560 */ 2300, 1862, 737, 2336, 1862, 2319, 347, 2302, 740, 2304, - /* 2570 */ 2305, 735, 1862, 730, 1862, 1862, 1862, 2268, 1862, 736, - /* 2580 */ 1862, 2301, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2590 */ 2319, 1862, 1862, 1862, 737, 1862, 1862, 1862, 1862, 1862, - /* 2600 */ 1862, 1862, 2268, 1862, 736, 1862, 1862, 2301, 1862, 1862, - /* 2610 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 2300, 1862, - /* 2620 */ 737, 2336, 2319, 1862, 361, 2302, 740, 2304, 2305, 735, - /* 2630 */ 1862, 730, 1862, 1862, 2268, 1862, 736, 1862, 1862, 1862, - /* 2640 */ 1862, 1862, 1862, 2300, 1862, 1862, 2336, 1862, 2319, 362, - /* 2650 */ 2302, 740, 2304, 2305, 735, 1862, 730, 1862, 1862, 1862, - /* 2660 */ 2268, 1862, 736, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2670 */ 1862, 1862, 1862, 1862, 1862, 2300, 1862, 2301, 2336, 1862, - /* 2680 */ 1862, 2313, 2302, 740, 2304, 2305, 735, 1862, 730, 1862, - /* 2690 */ 737, 1862, 2301, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2700 */ 1862, 2300, 1862, 1862, 2336, 737, 1862, 2312, 2302, 740, - /* 2710 */ 2304, 2305, 735, 1862, 730, 2301, 1862, 1862, 2319, 1862, - /* 2720 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 737, 1862, - /* 2730 */ 2268, 1862, 736, 2319, 1862, 2301, 1862, 1862, 1862, 1862, - /* 2740 */ 1862, 1862, 1862, 1862, 1862, 2268, 1862, 736, 737, 1862, - /* 2750 */ 1862, 1862, 1862, 1862, 1862, 1862, 2319, 1862, 1862, 1862, - /* 2760 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 2268, 1862, - /* 2770 */ 736, 2300, 1862, 1862, 2336, 1862, 2319, 2311, 2302, 740, - /* 2780 */ 2304, 2305, 735, 1862, 730, 1862, 2300, 1862, 2268, 2336, - /* 2790 */ 736, 1862, 376, 2302, 740, 2304, 2305, 735, 1862, 730, - /* 2800 */ 2301, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 2300, - /* 2810 */ 1862, 1862, 2336, 737, 1862, 377, 2302, 740, 2304, 2305, - /* 2820 */ 735, 2301, 730, 1862, 1862, 1862, 1862, 1862, 1862, 2300, - /* 2830 */ 1862, 1862, 2336, 1862, 737, 373, 2302, 740, 2304, 2305, - /* 2840 */ 735, 2319, 730, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2850 */ 1862, 1862, 1862, 2268, 1862, 736, 1862, 1862, 1862, 1862, - /* 2860 */ 1862, 1862, 2319, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2870 */ 1862, 1862, 1862, 1862, 2268, 1862, 736, 1862, 2301, 1862, - /* 2880 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2890 */ 1862, 737, 1862, 1862, 2300, 1862, 1862, 2336, 1862, 1862, - /* 2900 */ 378, 2302, 740, 2304, 2305, 735, 1862, 730, 1862, 1862, - /* 2910 */ 1862, 1862, 1862, 1862, 1862, 738, 1862, 1862, 2336, 2319, - /* 2920 */ 1862, 352, 2302, 740, 2304, 2305, 735, 1862, 730, 1862, - /* 2930 */ 1862, 2268, 1862, 736, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2940 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2950 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2960 */ 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, - /* 2970 */ 1862, 1862, 2300, 1862, 1862, 2336, 1862, 1862, 351, 2302, - /* 2980 */ 740, 2304, 2305, 735, 1862, 730, + /* 400 */ 367, 486, 485, 484, 2052, 479, 478, 382, 663, 2436, + /* 410 */ 603, 1521, 1522, 2479, 602, 1690, 1700, 1540, 2306, 481, + /* 420 */ 2165, 2342, 1716, 1719, 114, 2308, 740, 2310, 2311, 735, + /* 430 */ 1661, 730, 460, 301, 459, 55, 195, 1634, 2395, 1632, + /* 440 */ 41, 40, 411, 2391, 47, 45, 44, 43, 42, 699, + /* 450 */ 146, 9, 1662, 37, 413, 1739, 1740, 1741, 1742, 1743, + /* 460 */ 1747, 1748, 1749, 1750, 458, 2426, 389, 388, 217, 1637, + /* 470 */ 1638, 1820, 1689, 1692, 1693, 1694, 1695, 1696, 1697, 1698, + /* 480 */ 1699, 732, 728, 1708, 1709, 1711, 1712, 1713, 1714, 2, + /* 490 */ 12, 48, 46, 2307, 1553, 1554, 1633, 1387, 623, 415, + /* 500 */ 1890, 1633, 303, 191, 699, 146, 737, 303, 1278, 1533, + /* 510 */ 1534, 1631, 1386, 635, 1715, 572, 1631, 1855, 303, 674, + /* 520 */ 673, 1818, 1819, 1821, 1822, 1823, 2307, 2170, 2479, 266, + /* 530 */ 682, 2474, 1276, 1277, 2325, 1552, 1555, 387, 386, 737, + /* 540 */ 601, 1922, 1691, 1710, 1869, 626, 2274, 775, 736, 19, + /* 550 */ 2478, 1639, 620, 2274, 2475, 2477, 1639, 1786, 263, 197, + /* 560 */ 2403, 2404, 603, 144, 2408, 2189, 602, 2325, 136, 135, + /* 570 */ 134, 133, 132, 131, 130, 129, 128, 829, 528, 2274, + /* 580 */ 408, 736, 829, 2186, 707, 15, 63, 2306, 301, 52, + /* 590 */ 2342, 94, 2150, 114, 2308, 740, 2310, 2311, 735, 72, + /* 600 */ 730, 334, 71, 149, 2086, 155, 2366, 2395, 385, 450, + /* 610 */ 282, 411, 2391, 12, 199, 2403, 2404, 2051, 144, 2408, + /* 620 */ 2306, 1717, 1718, 2342, 509, 2165, 114, 2308, 740, 2310, + /* 630 */ 2311, 735, 2033, 730, 473, 233, 452, 448, 2494, 559, + /* 640 */ 2395, 1920, 41, 40, 411, 2391, 47, 45, 44, 43, + /* 650 */ 42, 1639, 2410, 41, 40, 1690, 1700, 47, 45, 44, + /* 660 */ 43, 42, 1716, 1719, 1271, 766, 47, 45, 44, 43, + /* 670 */ 42, 1432, 1634, 222, 1632, 1778, 235, 1634, 2407, 1632, + /* 680 */ 559, 767, 1920, 1278, 2100, 1423, 765, 764, 763, 1427, + /* 690 */ 762, 1429, 1430, 761, 758, 171, 1438, 755, 1440, 1441, + /* 700 */ 752, 749, 746, 2059, 1637, 1638, 1273, 1276, 1277, 1637, + /* 710 */ 1638, 1889, 1689, 1692, 1693, 1694, 1695, 1696, 1697, 1698, + /* 720 */ 1699, 732, 728, 1708, 1709, 1711, 1712, 1713, 1714, 2, + /* 730 */ 48, 46, 1720, 2307, 720, 2056, 1725, 2109, 415, 1888, + /* 740 */ 1633, 1805, 1658, 1376, 410, 325, 737, 303, 2433, 1297, + /* 750 */ 303, 1296, 2107, 1715, 466, 1631, 773, 160, 159, 770, + /* 760 */ 769, 768, 157, 2284, 2274, 2307, 142, 773, 160, 159, + /* 770 */ 770, 769, 768, 157, 2325, 2103, 2104, 2292, 737, 1297, + /* 780 */ 2446, 1296, 1710, 1378, 1298, 553, 2274, 2288, 736, 2031, + /* 790 */ 1887, 771, 2274, 551, 2100, 1639, 547, 543, 34, 720, + /* 800 */ 2056, 1746, 1886, 2307, 41, 40, 2325, 573, 47, 45, + /* 810 */ 44, 43, 42, 2255, 1298, 2140, 737, 646, 2274, 137, + /* 820 */ 736, 829, 1785, 170, 49, 1885, 604, 2306, 720, 2056, + /* 830 */ 2342, 2290, 412, 114, 2308, 740, 2310, 2311, 735, 1658, + /* 840 */ 730, 730, 2109, 2274, 2325, 2494, 1884, 2395, 467, 419, + /* 850 */ 2410, 411, 2391, 720, 2056, 2274, 2274, 2107, 736, 2306, + /* 860 */ 1717, 1718, 2342, 574, 2182, 114, 2308, 740, 2310, 2311, + /* 870 */ 735, 772, 730, 483, 2100, 36, 2406, 2494, 2274, 2395, + /* 880 */ 35, 41, 40, 411, 2391, 47, 45, 44, 43, 42, + /* 890 */ 1751, 566, 2228, 786, 1690, 1700, 2237, 2306, 1691, 2274, + /* 900 */ 2342, 1716, 1719, 114, 2308, 740, 2310, 2311, 735, 2479, + /* 910 */ 730, 787, 2474, 661, 2018, 2370, 1634, 2395, 1632, 2284, + /* 920 */ 687, 411, 2391, 2474, 773, 160, 159, 770, 769, 768, + /* 930 */ 157, 2478, 2032, 2047, 280, 2475, 2476, 1883, 2268, 1300, + /* 940 */ 1301, 686, 198, 2288, 1662, 1880, 2475, 688, 1637, 1638, + /* 950 */ 270, 1689, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, + /* 960 */ 732, 728, 1708, 1709, 1711, 1712, 1713, 1714, 2, 48, + /* 970 */ 46, 2307, 646, 720, 2056, 2284, 493, 415, 99, 1633, + /* 980 */ 720, 2056, 720, 2056, 737, 492, 669, 2290, 662, 2293, + /* 990 */ 2274, 2474, 1715, 498, 1631, 1691, 1812, 730, 2274, 2288, + /* 1000 */ 499, 775, 500, 1391, 2307, 595, 594, 720, 2056, 2480, + /* 1010 */ 198, 1813, 2325, 1879, 2475, 688, 694, 737, 1390, 2467, + /* 1020 */ 606, 1710, 720, 2056, 2274, 2109, 736, 575, 720, 2056, + /* 1030 */ 720, 2056, 720, 2056, 1639, 720, 2056, 205, 720, 2056, + /* 1040 */ 706, 61, 2053, 2290, 1373, 2325, 648, 2228, 271, 659, + /* 1050 */ 279, 1811, 705, 730, 269, 314, 2410, 2274, 717, 736, + /* 1060 */ 829, 720, 2056, 49, 1662, 2306, 2274, 641, 2342, 614, + /* 1070 */ 613, 114, 2308, 740, 2310, 2311, 735, 256, 730, 1956, + /* 1080 */ 254, 718, 2405, 2494, 530, 2395, 310, 311, 1280, 411, + /* 1090 */ 2391, 309, 720, 2056, 1657, 720, 2056, 1878, 2306, 1717, + /* 1100 */ 1718, 2342, 215, 1877, 114, 2308, 740, 2310, 2311, 735, + /* 1110 */ 1876, 730, 320, 14, 13, 422, 2494, 662, 2395, 691, + /* 1120 */ 2474, 1875, 411, 2391, 44, 43, 42, 1874, 1873, 1602, + /* 1130 */ 1603, 1872, 2258, 1690, 1700, 597, 596, 3, 2480, 198, + /* 1140 */ 1716, 1719, 139, 2475, 688, 722, 12, 2367, 10, 54, + /* 1150 */ 2274, 618, 617, 616, 85, 1634, 2274, 1632, 608, 143, + /* 1160 */ 612, 798, 796, 2274, 611, 76, 724, 2109, 2367, 610, + /* 1170 */ 615, 391, 390, 158, 2274, 609, 1897, 824, 605, 2034, + /* 1180 */ 2274, 2274, 715, 437, 2274, 2415, 1778, 1637, 1638, 607, + /* 1190 */ 1689, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 732, + /* 1200 */ 728, 1708, 1709, 1711, 1712, 1713, 1714, 2, 48, 46, + /* 1210 */ 2307, 2109, 151, 1371, 647, 86, 415, 258, 1633, 1758, + /* 1220 */ 257, 1940, 281, 737, 260, 2414, 2108, 259, 1931, 1864, + /* 1230 */ 1865, 1715, 262, 1631, 1929, 261, 424, 423, 638, 727, + /* 1240 */ 637, 2295, 158, 619, 50, 50, 1647, 1597, 111, 183, + /* 1250 */ 621, 2325, 1867, 14, 13, 1642, 624, 108, 158, 1715, + /* 1260 */ 1710, 1640, 2045, 2274, 662, 736, 50, 2474, 308, 1331, + /* 1270 */ 780, 75, 156, 1639, 158, 695, 66, 50, 50, 744, + /* 1280 */ 156, 781, 2041, 2043, 703, 2480, 198, 1641, 1710, 2039, + /* 1290 */ 2475, 688, 158, 140, 1350, 2060, 276, 194, 2297, 829, + /* 1300 */ 156, 1639, 15, 731, 2306, 1348, 1923, 2342, 1882, 1332, + /* 1310 */ 114, 2308, 740, 2310, 2311, 735, 1600, 730, 1817, 1816, + /* 1320 */ 675, 172, 2494, 287, 2395, 2439, 341, 726, 411, 2391, + /* 1330 */ 296, 430, 704, 141, 662, 290, 429, 2474, 1717, 1718, + /* 1340 */ 1550, 1994, 312, 338, 74, 712, 316, 73, 1417, 1993, + /* 1350 */ 1752, 1701, 333, 1445, 1449, 2480, 198, 365, 822, 1913, + /* 1360 */ 2475, 688, 2326, 672, 398, 428, 1456, 1454, 231, 538, + /* 1370 */ 536, 533, 1690, 1700, 161, 2174, 692, 401, 679, 1716, + /* 1380 */ 1719, 662, 709, 1919, 2474, 2097, 655, 295, 700, 2429, + /* 1390 */ 5, 298, 431, 302, 1634, 436, 1632, 379, 444, 1736, + /* 1400 */ 1665, 445, 2480, 198, 453, 207, 454, 2475, 688, 63, + /* 1410 */ 209, 1574, 206, 456, 328, 1656, 470, 1657, 1645, 474, + /* 1420 */ 221, 476, 1648, 1662, 1643, 480, 1637, 1638, 2175, 1689, + /* 1430 */ 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 732, 728, + /* 1440 */ 1708, 1709, 1711, 1712, 1713, 1714, 2, 64, 2307, 482, + /* 1450 */ 1644, 519, 487, 501, 1651, 1653, 508, 2167, 510, 518, + /* 1460 */ 520, 737, 532, 531, 529, 226, 225, 728, 1708, 1709, + /* 1470 */ 1711, 1712, 1713, 1714, 534, 1663, 228, 535, 537, 539, + /* 1480 */ 554, 4, 555, 2307, 562, 563, 565, 1659, 567, 2325, + /* 1490 */ 236, 91, 1664, 83, 82, 465, 737, 1666, 211, 239, + /* 1500 */ 568, 2274, 569, 736, 1667, 242, 2307, 571, 244, 2183, + /* 1510 */ 92, 457, 455, 93, 577, 249, 598, 627, 600, 737, + /* 1520 */ 116, 628, 366, 2046, 2325, 446, 253, 2246, 443, 439, + /* 1530 */ 435, 432, 458, 360, 2243, 640, 2274, 2042, 736, 255, + /* 1540 */ 164, 2307, 2306, 642, 165, 2342, 2044, 2325, 114, 2308, + /* 1550 */ 740, 2310, 2311, 735, 737, 730, 2040, 166, 96, 2274, + /* 1560 */ 2368, 736, 2395, 167, 272, 2242, 411, 2391, 1660, 650, + /* 1570 */ 303, 649, 277, 657, 654, 2430, 2440, 2306, 666, 275, + /* 1580 */ 2342, 152, 2325, 114, 2308, 740, 2310, 2311, 735, 329, + /* 1590 */ 730, 2229, 651, 676, 2274, 723, 736, 2395, 656, 2445, + /* 1600 */ 2306, 411, 2391, 2342, 710, 284, 115, 2308, 740, 2310, + /* 1610 */ 2311, 735, 8, 730, 286, 685, 667, 665, 664, 294, + /* 1620 */ 2395, 696, 2497, 2473, 2394, 2391, 402, 693, 1661, 1778, + /* 1630 */ 145, 2411, 1783, 187, 2444, 2306, 330, 2307, 2342, 644, + /* 1640 */ 2417, 115, 2308, 740, 2310, 2311, 735, 1781, 730, 304, + /* 1650 */ 737, 153, 289, 154, 708, 2395, 291, 832, 292, 725, + /* 1660 */ 2391, 331, 2197, 2307, 293, 1, 179, 201, 713, 714, + /* 1670 */ 332, 2196, 105, 327, 2195, 407, 734, 62, 2325, 2376, + /* 1680 */ 2057, 297, 107, 742, 2101, 335, 2019, 323, 1255, 190, + /* 1690 */ 2274, 826, 736, 823, 163, 828, 344, 820, 816, 812, + /* 1700 */ 808, 359, 324, 53, 2325, 358, 2307, 371, 372, 348, + /* 1710 */ 339, 337, 2266, 2265, 2264, 80, 2274, 2259, 736, 737, + /* 1720 */ 433, 434, 1624, 1625, 204, 438, 2257, 440, 441, 442, + /* 1730 */ 1623, 738, 2256, 380, 2342, 2254, 447, 115, 2308, 740, + /* 1740 */ 2310, 2311, 735, 113, 730, 2253, 317, 2325, 2252, 449, + /* 1750 */ 1613, 2395, 451, 2233, 2232, 374, 2391, 2306, 208, 2274, + /* 1760 */ 2342, 736, 210, 356, 2308, 740, 2310, 2311, 735, 733, + /* 1770 */ 730, 721, 2360, 2307, 81, 1577, 1576, 2210, 716, 2209, + /* 1780 */ 2208, 463, 464, 2207, 2206, 468, 737, 2157, 1520, 2149, + /* 1790 */ 2146, 472, 471, 213, 2145, 84, 2144, 2143, 2148, 2147, + /* 1800 */ 2306, 216, 2142, 2342, 2307, 2141, 176, 2308, 740, 2310, + /* 1810 */ 2311, 735, 2139, 730, 2325, 218, 2136, 737, 306, 2138, + /* 1820 */ 2137, 490, 488, 2152, 2135, 305, 2274, 2134, 736, 2133, + /* 1830 */ 2132, 2131, 2154, 2130, 2129, 2128, 2127, 2126, 2307, 2125, + /* 1840 */ 2124, 2123, 2122, 2121, 273, 2325, 2120, 2119, 90, 220, + /* 1850 */ 2118, 737, 2117, 2153, 2151, 2116, 2115, 2274, 224, 736, + /* 1860 */ 689, 2495, 2114, 2113, 522, 2112, 1526, 2306, 524, 2111, + /* 1870 */ 2342, 2110, 368, 115, 2308, 740, 2310, 2311, 735, 2325, + /* 1880 */ 730, 2307, 1388, 1392, 399, 1959, 1384, 2395, 369, 227, + /* 1890 */ 1958, 2274, 2392, 736, 737, 1957, 1955, 1952, 2306, 542, + /* 1900 */ 1951, 2342, 1944, 2307, 175, 2308, 740, 2310, 2311, 735, + /* 1910 */ 540, 730, 229, 544, 546, 230, 737, 541, 545, 548, + /* 1920 */ 550, 549, 2325, 1933, 552, 1908, 232, 400, 78, 1279, + /* 1930 */ 1907, 182, 2306, 2294, 2274, 2342, 736, 192, 357, 2308, + /* 1940 */ 740, 2310, 2311, 735, 2325, 730, 234, 2437, 560, 79, + /* 1950 */ 2231, 2227, 2217, 2205, 241, 243, 2274, 246, 736, 2204, + /* 1960 */ 2307, 2181, 2035, 1324, 1954, 1950, 578, 579, 580, 1948, + /* 1970 */ 582, 583, 1946, 737, 584, 2306, 586, 588, 2342, 587, + /* 1980 */ 1943, 357, 2308, 740, 2310, 2311, 735, 591, 730, 592, + /* 1990 */ 1928, 590, 1926, 1927, 1925, 1904, 2037, 2306, 1460, 2036, + /* 2000 */ 2342, 2325, 1941, 350, 2308, 740, 2310, 2311, 735, 1932, + /* 2010 */ 730, 1461, 1375, 2274, 1374, 736, 622, 252, 65, 1372, + /* 2020 */ 1370, 1369, 1368, 1367, 1366, 2307, 1363, 1361, 1362, 392, + /* 2030 */ 795, 797, 393, 1930, 394, 1903, 1902, 1360, 737, 1901, + /* 2040 */ 625, 629, 1900, 631, 1899, 633, 117, 1611, 1607, 684, + /* 2050 */ 1609, 29, 1606, 2230, 2306, 2307, 2226, 2342, 2216, 1583, + /* 2060 */ 176, 2308, 740, 2310, 2311, 735, 2325, 730, 734, 57, + /* 2070 */ 274, 406, 69, 1587, 1585, 169, 652, 2203, 2274, 58, + /* 2080 */ 736, 2202, 2479, 17, 653, 1834, 288, 1562, 20, 1561, + /* 2090 */ 2307, 278, 21, 6, 31, 7, 2325, 22, 658, 660, + /* 2100 */ 185, 33, 67, 737, 24, 2201, 2295, 283, 2274, 300, + /* 2110 */ 736, 1849, 668, 1848, 186, 2496, 60, 23, 670, 2306, + /* 2120 */ 2307, 403, 2342, 1853, 285, 357, 2308, 740, 2310, 2311, + /* 2130 */ 735, 2325, 730, 737, 1815, 177, 414, 184, 32, 1852, + /* 2140 */ 404, 1804, 59, 2274, 100, 736, 102, 1854, 1855, 2306, + /* 2150 */ 2180, 18, 2342, 1775, 1774, 356, 2308, 740, 2310, 2311, + /* 2160 */ 735, 2325, 730, 2307, 2361, 103, 416, 101, 25, 2179, + /* 2170 */ 307, 318, 188, 2274, 26, 736, 737, 1810, 13, 313, + /* 2180 */ 1649, 70, 1727, 11, 2306, 1737, 104, 2342, 2345, 1726, + /* 2190 */ 357, 2308, 740, 2310, 2311, 735, 1705, 730, 729, 315, + /* 2200 */ 711, 1703, 108, 39, 2325, 1702, 2307, 16, 189, 202, + /* 2210 */ 1682, 741, 27, 739, 2306, 1674, 2274, 2342, 736, 737, + /* 2220 */ 357, 2308, 740, 2310, 2311, 735, 251, 730, 2307, 743, + /* 2230 */ 28, 417, 1446, 745, 747, 1443, 748, 750, 1442, 751, + /* 2240 */ 753, 737, 178, 1439, 754, 756, 1433, 2325, 757, 759, + /* 2250 */ 593, 589, 585, 581, 1431, 250, 321, 639, 760, 2274, + /* 2260 */ 2342, 736, 1437, 352, 2308, 740, 2310, 2311, 735, 2325, + /* 2270 */ 730, 1436, 1435, 109, 110, 1434, 1455, 77, 1451, 1382, + /* 2280 */ 1322, 2274, 1357, 736, 774, 1354, 1353, 1352, 1351, 1349, + /* 2290 */ 1347, 1346, 1345, 785, 322, 1340, 95, 1343, 1379, 248, + /* 2300 */ 2306, 1342, 1341, 2342, 1339, 2307, 342, 2308, 740, 2310, + /* 2310 */ 2311, 735, 1338, 730, 1337, 1377, 1334, 1333, 737, 1330, + /* 2320 */ 1329, 1328, 2306, 1327, 1949, 2342, 805, 2307, 340, 2308, + /* 2330 */ 740, 2310, 2311, 735, 807, 730, 806, 1947, 809, 810, + /* 2340 */ 737, 1945, 811, 813, 814, 815, 2325, 1942, 817, 818, + /* 2350 */ 819, 1924, 821, 1268, 1898, 1256, 825, 326, 2274, 827, + /* 2360 */ 736, 1635, 2307, 238, 336, 830, 831, 1868, 2325, 1868, + /* 2370 */ 1868, 247, 240, 1868, 1868, 737, 1868, 1868, 245, 570, + /* 2380 */ 2274, 1868, 736, 1868, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2390 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 237, 2307, 2306, + /* 2400 */ 1868, 1868, 2342, 2325, 1868, 343, 2308, 740, 2310, 2311, + /* 2410 */ 735, 737, 730, 1868, 1868, 2274, 1868, 736, 1868, 1868, + /* 2420 */ 2307, 2306, 1868, 1868, 2342, 1868, 1868, 349, 2308, 740, + /* 2430 */ 2310, 2311, 735, 737, 730, 1868, 1868, 1868, 1868, 2325, + /* 2440 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2450 */ 1868, 2274, 1868, 736, 1868, 1868, 2306, 1868, 1868, 2342, + /* 2460 */ 1868, 2325, 353, 2308, 740, 2310, 2311, 735, 1868, 730, + /* 2470 */ 1868, 1868, 1868, 2274, 1868, 736, 1868, 2307, 1868, 1868, + /* 2480 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2490 */ 737, 1868, 2306, 1868, 2307, 2342, 1868, 1868, 345, 2308, + /* 2500 */ 740, 2310, 2311, 735, 1868, 730, 1868, 737, 1868, 1868, + /* 2510 */ 1868, 1868, 1868, 2307, 2306, 1868, 1868, 2342, 2325, 1868, + /* 2520 */ 354, 2308, 740, 2310, 2311, 735, 737, 730, 1868, 1868, + /* 2530 */ 2274, 1868, 736, 1868, 1868, 2325, 1868, 1868, 1868, 1868, + /* 2540 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 2274, 1868, 736, + /* 2550 */ 1868, 1868, 1868, 1868, 2325, 1868, 1868, 1868, 1868, 1868, + /* 2560 */ 1868, 1868, 1868, 1868, 1868, 1868, 2274, 1868, 736, 1868, + /* 2570 */ 2307, 2306, 1868, 1868, 2342, 1868, 1868, 346, 2308, 740, + /* 2580 */ 2310, 2311, 735, 737, 730, 1868, 1868, 1868, 2306, 1868, + /* 2590 */ 2307, 2342, 1868, 1868, 355, 2308, 740, 2310, 2311, 735, + /* 2600 */ 1868, 730, 1868, 737, 1868, 1868, 2307, 2306, 1868, 1868, + /* 2610 */ 2342, 2325, 1868, 347, 2308, 740, 2310, 2311, 735, 737, + /* 2620 */ 730, 1868, 1868, 2274, 1868, 736, 1868, 1868, 1868, 1868, + /* 2630 */ 1868, 2325, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2640 */ 1868, 1868, 1868, 2274, 1868, 736, 1868, 2325, 1868, 1868, + /* 2650 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 2274, + /* 2660 */ 1868, 736, 1868, 1868, 2306, 1868, 1868, 2342, 1868, 1868, + /* 2670 */ 361, 2308, 740, 2310, 2311, 735, 2307, 730, 1868, 1868, + /* 2680 */ 1868, 1868, 1868, 1868, 2306, 1868, 1868, 2342, 1868, 737, + /* 2690 */ 362, 2308, 740, 2310, 2311, 735, 1868, 730, 1868, 1868, + /* 2700 */ 2306, 1868, 1868, 2342, 1868, 1868, 2319, 2308, 740, 2310, + /* 2710 */ 2311, 735, 2307, 730, 1868, 1868, 1868, 2325, 1868, 1868, + /* 2720 */ 1868, 1868, 1868, 1868, 1868, 737, 1868, 1868, 1868, 2274, + /* 2730 */ 1868, 736, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2740 */ 1868, 1868, 1868, 1868, 1868, 1868, 2307, 1868, 1868, 1868, + /* 2750 */ 1868, 1868, 1868, 2325, 1868, 1868, 1868, 1868, 1868, 737, + /* 2760 */ 1868, 1868, 1868, 1868, 1868, 2274, 1868, 736, 1868, 2307, + /* 2770 */ 2306, 1868, 1868, 2342, 1868, 1868, 2318, 2308, 740, 2310, + /* 2780 */ 2311, 735, 737, 730, 1868, 1868, 1868, 2325, 1868, 1868, + /* 2790 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 2274, + /* 2800 */ 1868, 736, 1868, 1868, 1868, 1868, 2306, 1868, 1868, 2342, + /* 2810 */ 2325, 1868, 2317, 2308, 740, 2310, 2311, 735, 1868, 730, + /* 2820 */ 1868, 1868, 2274, 1868, 736, 1868, 2307, 1868, 1868, 1868, + /* 2830 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 737, + /* 2840 */ 2306, 2307, 1868, 2342, 1868, 1868, 376, 2308, 740, 2310, + /* 2850 */ 2311, 735, 1868, 730, 737, 1868, 1868, 1868, 1868, 1868, + /* 2860 */ 1868, 1868, 2307, 2306, 1868, 1868, 2342, 2325, 1868, 377, + /* 2870 */ 2308, 740, 2310, 2311, 735, 737, 730, 1868, 1868, 2274, + /* 2880 */ 1868, 736, 2325, 1868, 2307, 1868, 1868, 1868, 1868, 1868, + /* 2890 */ 1868, 1868, 1868, 1868, 2274, 1868, 736, 737, 1868, 1868, + /* 2900 */ 1868, 1868, 1868, 2325, 1868, 1868, 1868, 1868, 1868, 1868, + /* 2910 */ 1868, 1868, 1868, 1868, 1868, 2274, 1868, 736, 1868, 1868, + /* 2920 */ 2306, 1868, 1868, 2342, 1868, 2325, 373, 2308, 740, 2310, + /* 2930 */ 2311, 735, 1868, 730, 1868, 2306, 1868, 2274, 2342, 736, + /* 2940 */ 1868, 378, 2308, 740, 2310, 2311, 735, 1868, 730, 1868, + /* 2950 */ 1868, 1868, 1868, 1868, 1868, 1868, 738, 1868, 1868, 2342, + /* 2960 */ 1868, 1868, 352, 2308, 740, 2310, 2311, 735, 1868, 730, + /* 2970 */ 1868, 1868, 1868, 1868, 1868, 1868, 1868, 1868, 2306, 1868, + /* 2980 */ 1868, 2342, 1868, 1868, 351, 2308, 740, 2310, 2311, 735, + /* 2990 */ 1868, 730, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 463, 464, 381, 360, 389, 355, 360, 361, 358, 359, - /* 10 */ 389, 396, 12, 13, 14, 12, 13, 396, 397, 404, - /* 20 */ 20, 20, 22, 8, 9, 404, 380, 12, 13, 14, - /* 30 */ 15, 16, 2, 387, 20, 35, 0, 37, 8, 9, - /* 40 */ 37, 389, 12, 13, 14, 15, 16, 348, 405, 406, - /* 50 */ 447, 408, 389, 370, 21, 412, 404, 360, 361, 396, - /* 60 */ 361, 378, 4, 389, 64, 0, 20, 404, 22, 36, - /* 70 */ 70, 38, 39, 40, 8, 9, 473, 77, 12, 13, - /* 80 */ 14, 15, 16, 37, 20, 411, 21, 413, 389, 24, - /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 20, 33, - /* 100 */ 401, 55, 403, 103, 360, 361, 106, 14, 72, 73, + /* 0 */ 370, 381, 424, 381, 424, 360, 361, 429, 378, 389, + /* 10 */ 378, 389, 12, 13, 14, 12, 13, 397, 396, 397, + /* 20 */ 20, 3, 22, 8, 9, 380, 404, 12, 13, 14, + /* 30 */ 15, 16, 387, 20, 348, 35, 0, 37, 8, 9, + /* 40 */ 37, 389, 12, 13, 14, 15, 16, 348, 396, 360, + /* 50 */ 361, 389, 474, 360, 474, 477, 404, 477, 396, 20, + /* 60 */ 361, 463, 464, 33, 64, 0, 404, 20, 355, 380, + /* 70 */ 70, 358, 359, 495, 496, 495, 496, 77, 500, 501, + /* 80 */ 500, 501, 360, 361, 360, 361, 21, 401, 389, 24, + /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 405, 406, + /* 100 */ 401, 408, 403, 103, 380, 412, 106, 14, 72, 73, /* 110 */ 74, 75, 76, 20, 78, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 348, 474, 360, 361, - /* 140 */ 477, 442, 142, 143, 445, 360, 20, 448, 449, 450, - /* 150 */ 451, 452, 453, 409, 455, 360, 361, 494, 495, 460, - /* 160 */ 403, 462, 499, 500, 106, 466, 467, 470, 471, 472, - /* 170 */ 106, 474, 475, 107, 477, 418, 176, 177, 421, 422, - /* 180 */ 481, 69, 51, 183, 184, 377, 20, 409, 489, 401, - /* 190 */ 59, 494, 495, 62, 63, 0, 499, 500, 198, 391, - /* 200 */ 200, 416, 417, 200, 409, 190, 447, 8, 9, 401, - /* 210 */ 20, 12, 13, 14, 15, 16, 402, 403, 21, 106, - /* 220 */ 20, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 230 */ 230, 231, 473, 233, 234, 235, 236, 237, 238, 239, + /* 130 */ 94, 95, 96, 97, 98, 99, 474, 107, 347, 477, + /* 140 */ 349, 442, 142, 143, 445, 64, 20, 448, 449, 450, + /* 150 */ 451, 452, 453, 106, 455, 142, 143, 495, 496, 460, + /* 160 */ 367, 462, 500, 501, 21, 466, 467, 24, 25, 26, + /* 170 */ 27, 28, 29, 30, 31, 32, 176, 177, 355, 381, + /* 180 */ 481, 358, 359, 183, 184, 392, 105, 389, 489, 108, + /* 190 */ 360, 361, 470, 471, 472, 397, 474, 475, 198, 477, + /* 200 */ 200, 182, 20, 200, 388, 190, 399, 8, 9, 402, + /* 210 */ 403, 12, 13, 14, 15, 16, 400, 495, 496, 69, + /* 220 */ 8, 9, 500, 501, 12, 13, 14, 15, 16, 361, + /* 230 */ 230, 231, 106, 233, 234, 235, 236, 237, 238, 239, /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 12, 13, 445, 446, 182, 18, 3, 20, 20, - /* 260 */ 347, 22, 349, 455, 69, 27, 348, 355, 30, 70, - /* 270 */ 358, 359, 106, 35, 35, 172, 37, 8, 9, 361, - /* 280 */ 69, 12, 13, 14, 15, 16, 137, 2, 348, 51, - /* 290 */ 141, 53, 4, 8, 9, 389, 58, 12, 13, 14, - /* 300 */ 15, 16, 396, 64, 381, 202, 106, 389, 293, 70, - /* 310 */ 404, 23, 389, 114, 399, 34, 77, 402, 403, 401, - /* 320 */ 397, 403, 8, 9, 348, 267, 12, 13, 14, 15, - /* 330 */ 16, 72, 73, 74, 46, 47, 48, 361, 79, 80, - /* 340 */ 81, 401, 103, 105, 85, 106, 273, 274, 275, 90, - /* 350 */ 91, 92, 93, 116, 116, 96, 207, 348, 99, 210, - /* 360 */ 442, 367, 213, 445, 215, 389, 448, 449, 450, 451, - /* 370 */ 452, 453, 20, 455, 175, 389, 107, 401, 384, 403, - /* 380 */ 267, 142, 143, 397, 146, 147, 392, 149, 150, 151, + /* 250 */ 250, 12, 13, 172, 381, 4, 18, 389, 20, 20, + /* 260 */ 20, 22, 389, 86, 458, 27, 348, 461, 30, 70, + /* 270 */ 397, 360, 361, 35, 35, 20, 37, 8, 9, 361, + /* 280 */ 389, 12, 13, 14, 15, 16, 137, 396, 389, 51, + /* 290 */ 141, 53, 273, 274, 275, 404, 58, 172, 367, 469, + /* 300 */ 470, 471, 472, 64, 474, 475, 288, 389, 293, 70, + /* 310 */ 411, 21, 413, 114, 267, 384, 77, 403, 450, 401, + /* 320 */ 409, 403, 348, 392, 348, 148, 36, 202, 38, 39, + /* 330 */ 40, 72, 73, 74, 20, 421, 422, 361, 79, 80, + /* 340 */ 81, 106, 103, 105, 85, 106, 106, 170, 171, 90, + /* 350 */ 91, 92, 93, 20, 116, 96, 207, 106, 99, 210, + /* 360 */ 442, 33, 213, 445, 215, 389, 448, 449, 450, 451, + /* 370 */ 452, 453, 20, 455, 175, 401, 107, 401, 369, 403, + /* 380 */ 14, 142, 143, 116, 146, 147, 20, 149, 150, 151, /* 390 */ 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - /* 400 */ 162, 163, 164, 165, 447, 167, 168, 169, 490, 491, - /* 410 */ 401, 173, 174, 360, 361, 176, 177, 179, 442, 56, - /* 420 */ 57, 445, 183, 184, 448, 449, 450, 451, 452, 453, - /* 430 */ 473, 455, 20, 267, 345, 20, 460, 198, 462, 200, - /* 440 */ 8, 9, 466, 467, 12, 13, 14, 15, 16, 3, - /* 450 */ 360, 361, 20, 254, 255, 256, 257, 258, 259, 260, - /* 460 */ 261, 262, 263, 264, 77, 489, 20, 267, 361, 230, - /* 470 */ 231, 42, 233, 234, 235, 236, 237, 238, 239, 240, + /* 400 */ 162, 163, 164, 165, 395, 167, 168, 169, 490, 491, + /* 410 */ 135, 173, 174, 3, 139, 176, 177, 179, 442, 360, + /* 420 */ 361, 445, 183, 184, 448, 449, 450, 451, 452, 453, + /* 430 */ 20, 455, 197, 178, 199, 107, 460, 198, 462, 200, + /* 440 */ 8, 9, 466, 467, 12, 13, 14, 15, 16, 360, + /* 450 */ 361, 42, 20, 254, 255, 256, 257, 258, 259, 260, + /* 460 */ 261, 262, 263, 264, 229, 489, 39, 40, 409, 230, + /* 470 */ 231, 230, 233, 234, 235, 236, 237, 238, 239, 240, /* 480 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 490 */ 251, 12, 13, 348, 142, 143, 389, 136, 137, 20, - /* 500 */ 251, 22, 141, 360, 361, 23, 361, 12, 13, 14, - /* 510 */ 15, 16, 474, 424, 35, 477, 37, 20, 429, 22, - /* 520 */ 360, 361, 469, 470, 471, 472, 348, 474, 475, 47, - /* 530 */ 48, 77, 494, 495, 389, 183, 184, 499, 500, 361, - /* 540 */ 380, 363, 288, 64, 0, 14, 401, 387, 403, 70, - /* 550 */ 106, 20, 55, 107, 142, 143, 77, 450, 360, 361, - /* 560 */ 470, 471, 472, 474, 474, 475, 477, 389, 24, 25, - /* 570 */ 26, 27, 28, 29, 30, 31, 32, 389, 380, 401, - /* 580 */ 86, 403, 103, 494, 495, 106, 106, 442, 499, 500, - /* 590 */ 445, 176, 177, 448, 449, 450, 451, 452, 453, 424, - /* 600 */ 455, 413, 14, 458, 429, 460, 461, 462, 20, 116, - /* 610 */ 178, 466, 467, 470, 471, 472, 403, 474, 475, 348, - /* 620 */ 442, 142, 143, 445, 178, 20, 448, 449, 450, 451, - /* 630 */ 452, 453, 0, 455, 421, 422, 388, 64, 460, 430, - /* 640 */ 462, 197, 148, 199, 466, 467, 360, 361, 400, 474, - /* 650 */ 351, 352, 477, 8, 9, 176, 177, 12, 13, 14, - /* 660 */ 15, 16, 183, 184, 170, 171, 380, 360, 390, 494, - /* 670 */ 495, 103, 401, 229, 499, 500, 356, 198, 105, 200, - /* 680 */ 360, 108, 362, 360, 361, 117, 118, 119, 120, 121, - /* 690 */ 122, 123, 124, 125, 126, 266, 128, 129, 130, 131, - /* 700 */ 132, 133, 134, 380, 14, 15, 16, 176, 230, 230, - /* 710 */ 231, 267, 233, 234, 235, 236, 237, 238, 239, 240, + /* 490 */ 251, 12, 13, 348, 142, 143, 22, 22, 4, 20, + /* 500 */ 348, 22, 267, 389, 360, 361, 361, 267, 23, 176, + /* 510 */ 177, 37, 37, 19, 35, 20, 37, 107, 267, 278, + /* 520 */ 279, 280, 281, 282, 283, 284, 348, 413, 474, 35, + /* 530 */ 20, 477, 47, 48, 389, 183, 184, 110, 111, 361, + /* 540 */ 113, 363, 176, 64, 0, 51, 401, 69, 403, 70, + /* 550 */ 496, 77, 58, 401, 500, 501, 77, 4, 64, 470, + /* 560 */ 471, 472, 135, 474, 475, 403, 139, 389, 24, 25, + /* 570 */ 26, 27, 28, 29, 30, 31, 32, 103, 103, 401, + /* 580 */ 418, 403, 103, 421, 422, 106, 106, 442, 178, 106, + /* 590 */ 445, 369, 0, 448, 449, 450, 451, 452, 453, 105, + /* 600 */ 455, 382, 108, 458, 385, 460, 461, 462, 386, 193, + /* 610 */ 178, 466, 467, 251, 470, 471, 472, 395, 474, 475, + /* 620 */ 442, 142, 143, 445, 360, 361, 448, 449, 450, 451, + /* 630 */ 452, 453, 0, 455, 42, 356, 220, 221, 460, 360, + /* 640 */ 462, 362, 8, 9, 466, 467, 12, 13, 14, 15, + /* 650 */ 16, 77, 447, 8, 9, 176, 177, 12, 13, 14, + /* 660 */ 15, 16, 183, 184, 4, 116, 12, 13, 14, 15, + /* 670 */ 16, 103, 198, 409, 200, 266, 356, 198, 473, 200, + /* 680 */ 360, 398, 362, 23, 401, 117, 118, 119, 120, 121, + /* 690 */ 122, 123, 124, 125, 126, 389, 128, 129, 130, 131, + /* 700 */ 132, 133, 134, 397, 230, 231, 46, 47, 48, 230, + /* 710 */ 231, 348, 233, 234, 235, 236, 237, 238, 239, 240, /* 720 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 730 */ 12, 13, 14, 348, 360, 361, 22, 348, 20, 136, - /* 740 */ 22, 434, 435, 360, 361, 172, 361, 267, 363, 369, - /* 750 */ 390, 37, 107, 35, 380, 37, 278, 279, 280, 281, - /* 760 */ 282, 283, 284, 380, 176, 348, 386, 135, 136, 137, - /* 770 */ 138, 139, 140, 141, 389, 395, 0, 389, 361, 424, - /* 780 */ 363, 356, 64, 178, 396, 360, 401, 362, 403, 385, - /* 790 */ 401, 77, 404, 360, 361, 77, 135, 136, 137, 138, - /* 800 */ 139, 140, 141, 348, 8, 9, 389, 360, 12, 13, - /* 810 */ 14, 15, 16, 380, 211, 212, 361, 103, 401, 14, - /* 820 */ 403, 103, 360, 361, 106, 20, 4, 442, 367, 474, - /* 830 */ 445, 37, 477, 448, 449, 450, 451, 452, 453, 348, - /* 840 */ 455, 19, 380, 439, 389, 460, 348, 462, 193, 494, - /* 850 */ 495, 466, 467, 392, 499, 500, 401, 35, 403, 442, - /* 860 */ 142, 143, 445, 390, 377, 448, 449, 450, 451, 452, - /* 870 */ 453, 77, 455, 51, 20, 220, 221, 460, 391, 462, - /* 880 */ 58, 434, 435, 466, 467, 251, 64, 253, 401, 360, - /* 890 */ 361, 0, 401, 390, 176, 177, 175, 442, 389, 401, - /* 900 */ 445, 183, 184, 448, 449, 450, 451, 452, 453, 380, - /* 910 */ 455, 0, 198, 404, 200, 460, 198, 462, 200, 377, - /* 920 */ 381, 466, 467, 348, 389, 22, 22, 105, 389, 20, - /* 930 */ 108, 396, 445, 391, 50, 389, 397, 161, 424, 404, - /* 940 */ 37, 37, 455, 401, 230, 231, 170, 348, 230, 231, - /* 950 */ 404, 233, 234, 235, 236, 237, 238, 239, 240, 241, + /* 730 */ 12, 13, 14, 348, 360, 361, 14, 389, 20, 348, + /* 740 */ 22, 107, 20, 37, 396, 34, 361, 267, 363, 20, + /* 750 */ 267, 22, 404, 35, 380, 37, 135, 136, 137, 138, + /* 760 */ 139, 140, 141, 377, 401, 348, 37, 135, 136, 137, + /* 770 */ 138, 139, 140, 141, 389, 402, 403, 391, 361, 20, + /* 780 */ 363, 22, 64, 77, 55, 51, 401, 401, 403, 0, + /* 790 */ 348, 398, 401, 59, 401, 77, 62, 63, 2, 360, + /* 800 */ 361, 175, 348, 348, 8, 9, 389, 360, 12, 13, + /* 810 */ 14, 15, 16, 0, 55, 0, 361, 360, 401, 380, + /* 820 */ 403, 103, 269, 178, 106, 348, 387, 442, 360, 361, + /* 830 */ 445, 445, 446, 448, 449, 450, 451, 452, 453, 20, + /* 840 */ 455, 455, 389, 401, 389, 460, 348, 462, 380, 396, + /* 850 */ 447, 466, 467, 360, 361, 401, 401, 404, 403, 442, + /* 860 */ 142, 143, 445, 416, 417, 448, 449, 450, 451, 452, + /* 870 */ 453, 398, 455, 380, 401, 2, 473, 460, 401, 462, + /* 880 */ 254, 8, 9, 466, 467, 12, 13, 14, 15, 16, + /* 890 */ 264, 434, 435, 77, 176, 177, 385, 442, 176, 401, + /* 900 */ 445, 183, 184, 448, 449, 450, 451, 452, 453, 474, + /* 910 */ 455, 376, 477, 50, 379, 460, 198, 462, 200, 377, + /* 920 */ 474, 466, 467, 477, 135, 136, 137, 138, 139, 140, + /* 930 */ 141, 496, 0, 391, 64, 500, 501, 348, 424, 56, + /* 940 */ 57, 495, 496, 401, 20, 348, 500, 501, 230, 231, + /* 950 */ 439, 233, 234, 235, 236, 237, 238, 239, 240, 241, /* 960 */ 242, 243, 244, 245, 246, 247, 248, 249, 250, 12, - /* 970 */ 13, 348, 348, 4, 178, 254, 401, 20, 348, 22, - /* 980 */ 458, 360, 361, 461, 361, 264, 363, 445, 474, 378, - /* 990 */ 474, 477, 35, 477, 37, 39, 40, 455, 360, 361, - /* 1000 */ 401, 380, 474, 33, 348, 477, 103, 103, 494, 495, - /* 1010 */ 33, 495, 389, 499, 500, 499, 500, 361, 380, 363, - /* 1020 */ 459, 64, 461, 495, 401, 401, 403, 499, 500, 1, - /* 1030 */ 2, 401, 178, 348, 77, 360, 361, 398, 360, 361, - /* 1040 */ 401, 360, 361, 265, 266, 389, 135, 136, 137, 138, - /* 1050 */ 139, 140, 141, 365, 366, 380, 20, 401, 380, 403, - /* 1060 */ 103, 380, 178, 106, 348, 442, 110, 111, 445, 113, - /* 1070 */ 186, 448, 449, 450, 451, 452, 453, 348, 455, 0, - /* 1080 */ 381, 374, 375, 460, 348, 462, 401, 178, 389, 466, - /* 1090 */ 467, 135, 360, 361, 348, 139, 397, 348, 442, 142, - /* 1100 */ 143, 445, 390, 348, 448, 449, 450, 451, 452, 453, - /* 1110 */ 348, 455, 380, 365, 366, 224, 460, 401, 462, 360, - /* 1120 */ 361, 70, 466, 467, 360, 361, 360, 361, 360, 361, - /* 1130 */ 401, 374, 375, 176, 177, 107, 459, 401, 461, 380, - /* 1140 */ 183, 184, 369, 33, 380, 135, 380, 401, 380, 139, - /* 1150 */ 401, 72, 73, 74, 33, 198, 401, 200, 79, 80, - /* 1160 */ 81, 116, 382, 401, 85, 385, 45, 0, 395, 90, - /* 1170 */ 91, 92, 93, 398, 33, 96, 401, 424, 99, 398, - /* 1180 */ 376, 0, 401, 379, 0, 37, 45, 230, 231, 0, + /* 970 */ 13, 348, 360, 360, 361, 377, 161, 20, 108, 22, + /* 980 */ 360, 361, 360, 361, 361, 170, 363, 445, 474, 391, + /* 990 */ 401, 477, 35, 380, 37, 176, 22, 455, 401, 401, + /* 1000 */ 380, 69, 380, 22, 348, 365, 366, 360, 361, 495, + /* 1010 */ 496, 37, 389, 348, 500, 501, 33, 361, 37, 363, + /* 1020 */ 13, 64, 360, 361, 401, 389, 403, 380, 360, 361, + /* 1030 */ 360, 361, 360, 361, 77, 360, 361, 224, 360, 361, + /* 1040 */ 404, 178, 380, 445, 37, 389, 434, 435, 380, 186, + /* 1050 */ 380, 77, 380, 455, 136, 380, 447, 401, 380, 403, + /* 1060 */ 103, 360, 361, 106, 20, 442, 401, 424, 445, 374, + /* 1070 */ 375, 448, 449, 450, 451, 452, 453, 109, 455, 0, + /* 1080 */ 112, 380, 473, 460, 103, 462, 136, 137, 14, 466, + /* 1090 */ 467, 141, 360, 361, 20, 360, 361, 348, 442, 142, + /* 1100 */ 143, 445, 178, 348, 448, 449, 450, 451, 452, 453, + /* 1110 */ 348, 455, 380, 1, 2, 380, 460, 474, 462, 33, + /* 1120 */ 477, 348, 466, 467, 14, 15, 16, 348, 348, 211, + /* 1130 */ 212, 348, 0, 176, 177, 365, 366, 33, 495, 496, + /* 1140 */ 183, 184, 33, 500, 501, 459, 251, 461, 253, 45, + /* 1150 */ 401, 72, 73, 74, 45, 198, 401, 200, 79, 80, + /* 1160 */ 81, 374, 375, 401, 85, 116, 459, 389, 461, 90, + /* 1170 */ 91, 92, 93, 33, 401, 96, 351, 352, 99, 0, + /* 1180 */ 401, 401, 404, 51, 401, 265, 266, 230, 231, 13, /* 1190 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, /* 1200 */ 243, 244, 245, 246, 247, 248, 249, 250, 12, 13, - /* 1210 */ 348, 166, 176, 0, 64, 33, 20, 107, 22, 52, - /* 1220 */ 33, 109, 33, 361, 112, 363, 42, 474, 142, 143, - /* 1230 */ 477, 35, 51, 37, 0, 22, 12, 13, 269, 109, - /* 1240 */ 109, 109, 112, 112, 112, 13, 22, 494, 495, 0, - /* 1250 */ 13, 389, 499, 500, 37, 214, 22, 216, 108, 35, - /* 1260 */ 64, 37, 292, 401, 390, 403, 424, 290, 49, 37, - /* 1270 */ 390, 22, 33, 77, 37, 33, 1, 2, 33, 33, - /* 1280 */ 424, 230, 13, 349, 33, 33, 33, 33, 64, 107, - /* 1290 */ 33, 33, 33, 33, 107, 414, 106, 364, 503, 103, - /* 1300 */ 33, 77, 106, 33, 442, 115, 37, 445, 13, 33, - /* 1310 */ 448, 449, 450, 451, 452, 453, 474, 455, 33, 477, - /* 1320 */ 492, 18, 460, 33, 462, 106, 23, 103, 466, 467, - /* 1330 */ 474, 486, 37, 477, 359, 377, 494, 495, 142, 143, - /* 1340 */ 377, 499, 500, 40, 41, 37, 107, 44, 200, 107, - /* 1350 */ 494, 495, 107, 107, 389, 499, 500, 54, 107, 107, - /* 1360 */ 107, 107, 423, 364, 107, 107, 107, 107, 65, 66, - /* 1370 */ 67, 68, 176, 177, 107, 414, 361, 107, 400, 183, - /* 1380 */ 184, 431, 414, 107, 476, 77, 496, 468, 270, 479, - /* 1390 */ 51, 425, 107, 444, 198, 42, 200, 107, 443, 20, - /* 1400 */ 436, 213, 369, 441, 369, 196, 427, 436, 20, 106, - /* 1410 */ 360, 20, 45, 361, 410, 20, 414, 200, 361, 410, - /* 1420 */ 407, 360, 198, 175, 200, 361, 230, 231, 360, 233, + /* 1210 */ 348, 389, 33, 37, 424, 166, 20, 109, 22, 107, + /* 1220 */ 112, 0, 178, 361, 109, 363, 404, 112, 0, 142, + /* 1230 */ 143, 35, 109, 37, 0, 112, 12, 13, 214, 70, + /* 1240 */ 216, 49, 33, 22, 33, 33, 22, 107, 106, 33, + /* 1250 */ 22, 389, 345, 1, 2, 37, 22, 115, 33, 35, + /* 1260 */ 64, 37, 390, 401, 474, 403, 33, 477, 33, 37, + /* 1270 */ 13, 33, 33, 77, 33, 292, 33, 33, 33, 33, + /* 1280 */ 33, 13, 390, 390, 424, 495, 496, 37, 64, 390, + /* 1290 */ 500, 501, 33, 33, 37, 390, 390, 430, 106, 103, + /* 1300 */ 33, 77, 106, 390, 442, 37, 0, 445, 349, 77, + /* 1310 */ 448, 449, 450, 451, 452, 453, 107, 455, 107, 107, + /* 1320 */ 493, 18, 460, 107, 462, 414, 23, 103, 466, 467, + /* 1330 */ 504, 424, 107, 364, 474, 486, 429, 477, 142, 143, + /* 1340 */ 107, 377, 107, 40, 41, 107, 107, 44, 107, 377, + /* 1350 */ 107, 107, 107, 107, 107, 495, 496, 54, 52, 359, + /* 1360 */ 500, 501, 389, 492, 423, 364, 107, 107, 65, 66, + /* 1370 */ 67, 68, 176, 177, 107, 414, 290, 492, 492, 183, + /* 1380 */ 184, 474, 492, 361, 477, 400, 431, 468, 476, 414, + /* 1390 */ 270, 497, 425, 479, 198, 51, 200, 444, 42, 230, + /* 1400 */ 20, 443, 495, 496, 213, 369, 436, 500, 501, 106, + /* 1410 */ 369, 196, 441, 436, 427, 20, 360, 20, 200, 361, + /* 1420 */ 45, 410, 198, 20, 200, 361, 230, 231, 414, 233, /* 1430 */ 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, /* 1440 */ 244, 245, 246, 247, 248, 249, 250, 144, 348, 410, - /* 1450 */ 407, 407, 104, 373, 230, 231, 102, 372, 360, 371, - /* 1460 */ 101, 361, 360, 360, 360, 20, 353, 243, 244, 245, - /* 1470 */ 246, 247, 248, 249, 50, 353, 357, 357, 436, 20, - /* 1480 */ 369, 403, 20, 348, 369, 369, 362, 20, 426, 389, - /* 1490 */ 362, 20, 369, 190, 191, 192, 361, 360, 195, 417, - /* 1500 */ 353, 401, 369, 403, 351, 369, 348, 369, 369, 360, - /* 1510 */ 351, 208, 209, 353, 389, 389, 389, 217, 389, 361, - /* 1520 */ 106, 440, 219, 389, 389, 222, 436, 438, 225, 226, - /* 1530 */ 227, 228, 229, 389, 389, 389, 401, 367, 403, 20, - /* 1540 */ 389, 348, 442, 389, 389, 445, 204, 389, 448, 449, - /* 1550 */ 450, 451, 452, 453, 361, 455, 277, 401, 401, 401, - /* 1560 */ 460, 403, 462, 401, 203, 367, 466, 467, 403, 401, - /* 1570 */ 267, 360, 485, 276, 432, 435, 433, 442, 485, 285, - /* 1580 */ 445, 401, 389, 448, 449, 450, 451, 452, 453, 425, - /* 1590 */ 455, 414, 414, 419, 401, 460, 403, 462, 419, 189, - /* 1600 */ 442, 466, 467, 445, 401, 401, 448, 449, 450, 451, - /* 1610 */ 452, 453, 287, 455, 286, 271, 425, 294, 504, 20, - /* 1620 */ 462, 291, 289, 266, 466, 467, 361, 116, 268, 367, - /* 1630 */ 447, 367, 401, 362, 419, 442, 401, 348, 445, 1, - /* 1640 */ 488, 448, 449, 450, 451, 452, 453, 484, 455, 419, - /* 1650 */ 361, 401, 480, 487, 485, 462, 483, 19, 482, 466, - /* 1660 */ 467, 181, 401, 348, 478, 367, 385, 401, 367, 498, - /* 1670 */ 415, 361, 497, 35, 401, 106, 361, 465, 389, 106, - /* 1680 */ 393, 401, 360, 379, 367, 22, 350, 38, 354, 51, - /* 1690 */ 401, 353, 403, 437, 420, 383, 428, 59, 60, 61, - /* 1700 */ 62, 383, 64, 420, 389, 368, 348, 383, 346, 0, - /* 1710 */ 0, 0, 45, 0, 223, 37, 401, 37, 403, 361, - /* 1720 */ 37, 37, 223, 0, 37, 37, 223, 37, 0, 223, - /* 1730 */ 0, 442, 37, 0, 445, 0, 22, 448, 449, 450, - /* 1740 */ 451, 452, 453, 105, 455, 37, 108, 389, 218, 0, - /* 1750 */ 206, 462, 0, 206, 200, 466, 467, 442, 207, 401, - /* 1760 */ 445, 403, 198, 448, 449, 450, 451, 452, 453, 454, - /* 1770 */ 455, 456, 457, 348, 0, 0, 0, 194, 140, 193, - /* 1780 */ 0, 0, 147, 49, 0, 49, 361, 37, 51, 0, - /* 1790 */ 49, 0, 45, 0, 0, 0, 0, 49, 0, 0, - /* 1800 */ 442, 0, 0, 445, 0, 161, 448, 449, 450, 451, - /* 1810 */ 452, 453, 0, 455, 389, 37, 348, 161, 180, 0, - /* 1820 */ 0, 0, 0, 0, 0, 187, 401, 0, 403, 361, - /* 1830 */ 45, 49, 0, 0, 0, 0, 0, 0, 348, 0, - /* 1840 */ 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, - /* 1850 */ 0, 361, 0, 22, 0, 0, 0, 389, 146, 501, - /* 1860 */ 502, 145, 147, 0, 0, 50, 22, 442, 50, 401, - /* 1870 */ 445, 403, 0, 448, 449, 450, 451, 452, 453, 389, - /* 1880 */ 455, 348, 22, 0, 394, 0, 0, 462, 37, 64, - /* 1890 */ 64, 401, 467, 403, 361, 37, 348, 0, 0, 42, - /* 1900 */ 0, 42, 64, 37, 51, 37, 0, 42, 37, 361, - /* 1910 */ 442, 348, 51, 445, 0, 45, 448, 449, 450, 451, - /* 1920 */ 452, 453, 389, 455, 361, 51, 42, 394, 49, 33, - /* 1930 */ 49, 14, 442, 0, 401, 445, 403, 389, 448, 449, - /* 1940 */ 450, 451, 452, 453, 43, 455, 42, 0, 49, 401, - /* 1950 */ 0, 403, 389, 0, 0, 42, 189, 0, 49, 491, - /* 1960 */ 0, 0, 71, 0, 401, 0, 403, 37, 42, 51, - /* 1970 */ 0, 37, 51, 42, 0, 442, 37, 42, 445, 51, - /* 1980 */ 0, 448, 449, 450, 451, 452, 453, 51, 455, 37, - /* 1990 */ 442, 348, 0, 445, 114, 37, 448, 449, 450, 451, - /* 2000 */ 452, 453, 0, 455, 361, 442, 42, 0, 445, 348, - /* 2010 */ 0, 448, 449, 450, 451, 452, 453, 0, 455, 0, - /* 2020 */ 112, 22, 361, 37, 37, 348, 0, 37, 37, 35, - /* 2030 */ 37, 22, 389, 37, 37, 37, 33, 394, 361, 33, - /* 2040 */ 0, 493, 22, 0, 401, 51, 403, 22, 37, 37, - /* 2050 */ 389, 37, 0, 59, 60, 61, 62, 53, 64, 22, - /* 2060 */ 0, 37, 401, 0, 403, 502, 389, 0, 37, 0, - /* 2070 */ 37, 394, 0, 22, 20, 107, 37, 106, 401, 37, - /* 2080 */ 403, 37, 0, 178, 106, 442, 0, 205, 445, 178, - /* 2090 */ 49, 448, 449, 450, 451, 452, 453, 22, 455, 105, - /* 2100 */ 0, 37, 108, 442, 348, 22, 445, 178, 201, 448, - /* 2110 */ 449, 450, 451, 452, 453, 0, 455, 361, 457, 442, - /* 2120 */ 0, 181, 445, 178, 3, 448, 449, 450, 451, 452, - /* 2130 */ 453, 185, 455, 178, 185, 348, 106, 33, 106, 272, - /* 2140 */ 50, 107, 50, 107, 33, 389, 33, 33, 361, 104, - /* 2150 */ 394, 102, 33, 107, 106, 49, 106, 401, 49, 403, - /* 2160 */ 107, 106, 106, 3, 272, 107, 172, 33, 107, 37, - /* 2170 */ 37, 49, 37, 37, 180, 181, 389, 37, 348, 37, - /* 2180 */ 107, 187, 188, 107, 272, 265, 33, 49, 401, 0, - /* 2190 */ 403, 361, 0, 106, 42, 106, 0, 106, 442, 106, - /* 2200 */ 206, 445, 107, 107, 448, 449, 450, 451, 452, 453, - /* 2210 */ 182, 455, 42, 106, 106, 180, 115, 49, 33, 389, - /* 2220 */ 104, 252, 2, 106, 22, 230, 49, 104, 49, 442, - /* 2230 */ 106, 401, 445, 403, 107, 448, 449, 450, 451, 452, - /* 2240 */ 453, 22, 455, 348, 107, 106, 116, 232, 107, 106, - /* 2250 */ 106, 37, 107, 106, 37, 107, 361, 106, 348, 37, - /* 2260 */ 37, 107, 106, 37, 107, 106, 37, 37, 107, 106, - /* 2270 */ 106, 361, 442, 348, 107, 445, 107, 106, 448, 449, - /* 2280 */ 450, 451, 452, 453, 389, 455, 361, 106, 33, 127, - /* 2290 */ 106, 37, 127, 127, 106, 22, 401, 70, 403, 389, - /* 2300 */ 127, 37, 71, 37, 37, 37, 37, 37, 37, 37, - /* 2310 */ 100, 401, 37, 403, 389, 77, 33, 37, 37, 37, - /* 2320 */ 22, 37, 37, 37, 77, 37, 401, 37, 403, 37, - /* 2330 */ 37, 37, 22, 37, 0, 0, 37, 442, 51, 42, - /* 2340 */ 445, 37, 51, 448, 449, 450, 451, 452, 453, 42, - /* 2350 */ 455, 0, 442, 348, 37, 445, 51, 42, 448, 449, - /* 2360 */ 450, 451, 452, 453, 0, 455, 361, 442, 37, 51, - /* 2370 */ 445, 348, 42, 448, 449, 450, 451, 452, 453, 0, - /* 2380 */ 455, 0, 37, 37, 361, 22, 348, 33, 22, 21, - /* 2390 */ 505, 22, 22, 21, 389, 20, 505, 505, 505, 361, - /* 2400 */ 505, 505, 505, 505, 505, 505, 401, 505, 403, 505, - /* 2410 */ 505, 505, 389, 505, 505, 505, 505, 505, 505, 505, - /* 2420 */ 505, 505, 505, 505, 401, 505, 403, 389, 505, 348, - /* 2430 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 401, - /* 2440 */ 505, 403, 361, 505, 505, 505, 505, 442, 505, 505, - /* 2450 */ 445, 348, 505, 448, 449, 450, 451, 452, 453, 505, - /* 2460 */ 455, 505, 505, 505, 361, 442, 348, 505, 445, 505, - /* 2470 */ 389, 448, 449, 450, 451, 452, 453, 505, 455, 361, - /* 2480 */ 442, 505, 401, 445, 403, 505, 448, 449, 450, 451, - /* 2490 */ 452, 453, 389, 455, 505, 505, 505, 505, 505, 505, - /* 2500 */ 505, 505, 505, 505, 401, 505, 403, 389, 505, 505, - /* 2510 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 401, - /* 2520 */ 505, 403, 505, 442, 348, 505, 445, 505, 505, 448, - /* 2530 */ 449, 450, 451, 452, 453, 505, 455, 361, 505, 505, - /* 2540 */ 505, 505, 505, 505, 505, 442, 505, 505, 445, 348, - /* 2550 */ 505, 448, 449, 450, 451, 452, 453, 505, 455, 505, - /* 2560 */ 442, 505, 361, 445, 505, 389, 448, 449, 450, 451, - /* 2570 */ 452, 453, 505, 455, 505, 505, 505, 401, 505, 403, - /* 2580 */ 505, 348, 505, 505, 505, 505, 505, 505, 505, 505, - /* 2590 */ 389, 505, 505, 505, 361, 505, 505, 505, 505, 505, - /* 2600 */ 505, 505, 401, 505, 403, 505, 505, 348, 505, 505, - /* 2610 */ 505, 505, 505, 505, 505, 505, 505, 505, 442, 505, - /* 2620 */ 361, 445, 389, 505, 448, 449, 450, 451, 452, 453, - /* 2630 */ 505, 455, 505, 505, 401, 505, 403, 505, 505, 505, - /* 2640 */ 505, 505, 505, 442, 505, 505, 445, 505, 389, 448, - /* 2650 */ 449, 450, 451, 452, 453, 505, 455, 505, 505, 505, - /* 2660 */ 401, 505, 403, 505, 505, 505, 505, 505, 505, 505, - /* 2670 */ 505, 505, 505, 505, 505, 442, 505, 348, 445, 505, - /* 2680 */ 505, 448, 449, 450, 451, 452, 453, 505, 455, 505, - /* 2690 */ 361, 505, 348, 505, 505, 505, 505, 505, 505, 505, - /* 2700 */ 505, 442, 505, 505, 445, 361, 505, 448, 449, 450, - /* 2710 */ 451, 452, 453, 505, 455, 348, 505, 505, 389, 505, - /* 2720 */ 505, 505, 505, 505, 505, 505, 505, 505, 361, 505, - /* 2730 */ 401, 505, 403, 389, 505, 348, 505, 505, 505, 505, - /* 2740 */ 505, 505, 505, 505, 505, 401, 505, 403, 361, 505, - /* 2750 */ 505, 505, 505, 505, 505, 505, 389, 505, 505, 505, - /* 2760 */ 505, 505, 505, 505, 505, 505, 505, 505, 401, 505, - /* 2770 */ 403, 442, 505, 505, 445, 505, 389, 448, 449, 450, - /* 2780 */ 451, 452, 453, 505, 455, 505, 442, 505, 401, 445, - /* 2790 */ 403, 505, 448, 449, 450, 451, 452, 453, 505, 455, - /* 2800 */ 348, 505, 505, 505, 505, 505, 505, 505, 505, 442, - /* 2810 */ 505, 505, 445, 361, 505, 448, 449, 450, 451, 452, - /* 2820 */ 453, 348, 455, 505, 505, 505, 505, 505, 505, 442, - /* 2830 */ 505, 505, 445, 505, 361, 448, 449, 450, 451, 452, - /* 2840 */ 453, 389, 455, 505, 505, 505, 505, 505, 505, 505, - /* 2850 */ 505, 505, 505, 401, 505, 403, 505, 505, 505, 505, - /* 2860 */ 505, 505, 389, 505, 505, 505, 505, 505, 505, 505, - /* 2870 */ 505, 505, 505, 505, 401, 505, 403, 505, 348, 505, - /* 2880 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - /* 2890 */ 505, 361, 505, 505, 442, 505, 505, 445, 505, 505, - /* 2900 */ 448, 449, 450, 451, 452, 453, 505, 455, 505, 505, - /* 2910 */ 505, 505, 505, 505, 505, 442, 505, 505, 445, 389, - /* 2920 */ 505, 448, 449, 450, 451, 452, 453, 505, 455, 505, - /* 2930 */ 505, 401, 505, 403, 505, 505, 505, 505, 505, 505, - /* 2940 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - /* 2950 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - /* 2960 */ 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - /* 2970 */ 505, 505, 442, 505, 505, 445, 505, 505, 448, 449, - /* 2980 */ 450, 451, 452, 453, 505, 455, 345, 345, 345, 345, - /* 2990 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + /* 1450 */ 200, 175, 407, 360, 230, 231, 361, 360, 410, 407, + /* 1460 */ 407, 361, 373, 104, 102, 360, 372, 243, 244, 245, + /* 1470 */ 246, 247, 248, 249, 101, 20, 360, 371, 360, 360, + /* 1480 */ 353, 50, 357, 348, 353, 357, 436, 20, 403, 389, + /* 1490 */ 369, 369, 20, 190, 191, 192, 361, 20, 195, 369, + /* 1500 */ 362, 401, 426, 403, 20, 369, 348, 362, 369, 417, + /* 1510 */ 369, 208, 209, 369, 360, 369, 353, 351, 389, 361, + /* 1520 */ 360, 351, 219, 389, 389, 222, 389, 401, 225, 226, + /* 1530 */ 227, 228, 229, 353, 401, 217, 401, 389, 403, 389, + /* 1540 */ 389, 348, 442, 440, 389, 445, 389, 389, 448, 449, + /* 1550 */ 450, 451, 452, 453, 361, 455, 389, 389, 106, 401, + /* 1560 */ 460, 403, 462, 389, 367, 401, 466, 467, 20, 204, + /* 1570 */ 267, 203, 367, 360, 403, 414, 414, 442, 401, 432, + /* 1580 */ 445, 438, 389, 448, 449, 450, 451, 452, 453, 436, + /* 1590 */ 455, 435, 433, 277, 401, 460, 403, 462, 425, 485, + /* 1600 */ 442, 466, 467, 445, 276, 419, 448, 449, 450, 451, + /* 1610 */ 452, 453, 285, 455, 419, 189, 287, 286, 271, 425, + /* 1620 */ 462, 291, 505, 499, 466, 467, 294, 289, 20, 266, + /* 1630 */ 361, 447, 116, 362, 485, 442, 419, 348, 445, 1, + /* 1640 */ 488, 448, 449, 450, 451, 452, 453, 268, 455, 367, + /* 1650 */ 361, 367, 487, 367, 401, 462, 484, 19, 483, 466, + /* 1660 */ 467, 419, 401, 348, 482, 480, 485, 478, 181, 415, + /* 1670 */ 385, 401, 367, 35, 401, 401, 361, 106, 389, 465, + /* 1680 */ 361, 498, 106, 393, 401, 360, 379, 367, 22, 51, + /* 1690 */ 401, 350, 403, 38, 354, 353, 383, 59, 60, 61, + /* 1700 */ 62, 437, 64, 428, 389, 383, 348, 420, 420, 383, + /* 1710 */ 346, 368, 0, 0, 0, 45, 401, 0, 403, 361, + /* 1720 */ 37, 223, 37, 37, 37, 223, 0, 37, 37, 223, + /* 1730 */ 37, 442, 0, 223, 445, 0, 37, 448, 449, 450, + /* 1740 */ 451, 452, 453, 105, 455, 0, 108, 389, 0, 22, + /* 1750 */ 218, 462, 37, 0, 0, 466, 467, 442, 206, 401, + /* 1760 */ 445, 403, 206, 448, 449, 450, 451, 452, 453, 454, + /* 1770 */ 455, 456, 457, 348, 207, 200, 198, 0, 140, 0, + /* 1780 */ 0, 194, 193, 0, 0, 49, 361, 147, 49, 0, + /* 1790 */ 0, 51, 37, 49, 0, 45, 0, 0, 0, 0, + /* 1800 */ 442, 49, 0, 445, 348, 0, 448, 449, 450, 451, + /* 1810 */ 452, 453, 0, 455, 389, 161, 0, 361, 180, 0, + /* 1820 */ 0, 161, 37, 0, 0, 187, 401, 0, 403, 0, + /* 1830 */ 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, + /* 1840 */ 0, 0, 0, 0, 206, 389, 0, 0, 45, 49, + /* 1850 */ 0, 361, 0, 0, 0, 0, 0, 401, 147, 403, + /* 1860 */ 502, 503, 0, 0, 146, 0, 22, 442, 145, 0, + /* 1870 */ 445, 0, 50, 448, 449, 450, 451, 452, 453, 389, + /* 1880 */ 455, 348, 22, 22, 394, 0, 37, 462, 50, 64, + /* 1890 */ 0, 401, 467, 403, 361, 0, 0, 0, 442, 42, + /* 1900 */ 0, 445, 0, 348, 448, 449, 450, 451, 452, 453, + /* 1910 */ 37, 455, 64, 37, 42, 64, 361, 51, 51, 37, + /* 1920 */ 42, 51, 389, 0, 37, 0, 45, 394, 42, 14, + /* 1930 */ 0, 33, 442, 49, 401, 445, 403, 49, 448, 449, + /* 1940 */ 450, 451, 452, 453, 389, 455, 43, 491, 49, 42, + /* 1950 */ 0, 0, 0, 0, 42, 189, 401, 49, 403, 0, + /* 1960 */ 348, 0, 0, 71, 0, 0, 37, 51, 42, 0, + /* 1970 */ 37, 51, 0, 361, 42, 442, 37, 42, 445, 51, + /* 1980 */ 0, 448, 449, 450, 451, 452, 453, 51, 455, 42, + /* 1990 */ 0, 37, 0, 0, 0, 0, 0, 442, 22, 0, + /* 2000 */ 445, 389, 0, 448, 449, 450, 451, 452, 453, 0, + /* 2010 */ 455, 37, 37, 401, 37, 403, 53, 112, 114, 37, + /* 2020 */ 37, 37, 37, 37, 37, 348, 37, 22, 37, 22, + /* 2030 */ 33, 33, 22, 0, 22, 0, 0, 37, 361, 0, + /* 2040 */ 37, 37, 0, 37, 0, 22, 20, 107, 37, 494, + /* 2050 */ 37, 106, 37, 0, 442, 348, 0, 445, 0, 37, + /* 2060 */ 448, 449, 450, 451, 452, 453, 389, 455, 361, 178, + /* 2070 */ 49, 394, 106, 205, 22, 201, 22, 0, 401, 178, + /* 2080 */ 403, 0, 3, 272, 178, 107, 49, 178, 33, 178, + /* 2090 */ 348, 181, 33, 50, 106, 50, 389, 33, 185, 185, + /* 2100 */ 33, 33, 3, 361, 33, 0, 49, 106, 401, 49, + /* 2110 */ 403, 37, 104, 37, 49, 503, 33, 272, 102, 442, + /* 2120 */ 348, 37, 445, 37, 107, 448, 449, 450, 451, 452, + /* 2130 */ 453, 389, 455, 361, 107, 106, 394, 106, 106, 37, + /* 2140 */ 37, 107, 265, 401, 106, 403, 42, 107, 107, 442, + /* 2150 */ 0, 272, 445, 107, 107, 448, 449, 450, 451, 452, + /* 2160 */ 453, 389, 455, 348, 457, 42, 394, 106, 106, 0, + /* 2170 */ 107, 49, 106, 401, 33, 403, 361, 107, 2, 106, + /* 2180 */ 22, 106, 104, 252, 442, 230, 106, 445, 106, 104, + /* 2190 */ 448, 449, 450, 451, 452, 453, 107, 455, 106, 180, + /* 2200 */ 182, 107, 115, 106, 389, 107, 348, 106, 49, 49, + /* 2210 */ 22, 116, 106, 232, 442, 107, 401, 445, 403, 361, + /* 2220 */ 448, 449, 450, 451, 452, 453, 35, 455, 348, 37, + /* 2230 */ 106, 37, 107, 106, 37, 107, 106, 37, 107, 106, + /* 2240 */ 37, 361, 51, 107, 106, 37, 107, 389, 106, 37, + /* 2250 */ 59, 60, 61, 62, 107, 64, 33, 442, 106, 401, + /* 2260 */ 445, 403, 127, 448, 449, 450, 451, 452, 453, 389, + /* 2270 */ 455, 127, 127, 106, 106, 127, 37, 106, 22, 77, + /* 2280 */ 71, 401, 37, 403, 70, 37, 37, 37, 37, 37, + /* 2290 */ 37, 37, 37, 100, 33, 22, 105, 37, 77, 108, + /* 2300 */ 442, 37, 37, 445, 37, 348, 448, 449, 450, 451, + /* 2310 */ 452, 453, 37, 455, 37, 37, 37, 37, 361, 37, + /* 2320 */ 37, 22, 442, 37, 0, 445, 37, 348, 448, 449, + /* 2330 */ 450, 451, 452, 453, 42, 455, 51, 0, 37, 51, + /* 2340 */ 361, 0, 42, 37, 51, 42, 389, 0, 37, 51, + /* 2350 */ 42, 0, 37, 37, 0, 22, 33, 22, 401, 21, + /* 2360 */ 403, 22, 348, 172, 22, 21, 20, 506, 389, 506, + /* 2370 */ 506, 180, 181, 506, 506, 361, 506, 506, 187, 188, + /* 2380 */ 401, 506, 403, 506, 506, 506, 506, 506, 506, 506, + /* 2390 */ 506, 506, 506, 506, 506, 506, 506, 206, 348, 442, + /* 2400 */ 506, 506, 445, 389, 506, 448, 449, 450, 451, 452, + /* 2410 */ 453, 361, 455, 506, 506, 401, 506, 403, 506, 506, + /* 2420 */ 348, 442, 506, 506, 445, 506, 506, 448, 449, 450, + /* 2430 */ 451, 452, 453, 361, 455, 506, 506, 506, 506, 389, + /* 2440 */ 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, + /* 2450 */ 506, 401, 506, 403, 506, 506, 442, 506, 506, 445, + /* 2460 */ 506, 389, 448, 449, 450, 451, 452, 453, 506, 455, + /* 2470 */ 506, 506, 506, 401, 506, 403, 506, 348, 506, 506, + /* 2480 */ 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, + /* 2490 */ 361, 506, 442, 506, 348, 445, 506, 506, 448, 449, + /* 2500 */ 450, 451, 452, 453, 506, 455, 506, 361, 506, 506, + /* 2510 */ 506, 506, 506, 348, 442, 506, 506, 445, 389, 506, + /* 2520 */ 448, 449, 450, 451, 452, 453, 361, 455, 506, 506, + /* 2530 */ 401, 506, 403, 506, 506, 389, 506, 506, 506, 506, + /* 2540 */ 506, 506, 506, 506, 506, 506, 506, 401, 506, 403, + /* 2550 */ 506, 506, 506, 506, 389, 506, 506, 506, 506, 506, + /* 2560 */ 506, 506, 506, 506, 506, 506, 401, 506, 403, 506, + /* 2570 */ 348, 442, 506, 506, 445, 506, 506, 448, 449, 450, + /* 2580 */ 451, 452, 453, 361, 455, 506, 506, 506, 442, 506, + /* 2590 */ 348, 445, 506, 506, 448, 449, 450, 451, 452, 453, + /* 2600 */ 506, 455, 506, 361, 506, 506, 348, 442, 506, 506, + /* 2610 */ 445, 389, 506, 448, 449, 450, 451, 452, 453, 361, + /* 2620 */ 455, 506, 506, 401, 506, 403, 506, 506, 506, 506, + /* 2630 */ 506, 389, 506, 506, 506, 506, 506, 506, 506, 506, + /* 2640 */ 506, 506, 506, 401, 506, 403, 506, 389, 506, 506, + /* 2650 */ 506, 506, 506, 506, 506, 506, 506, 506, 506, 401, + /* 2660 */ 506, 403, 506, 506, 442, 506, 506, 445, 506, 506, + /* 2670 */ 448, 449, 450, 451, 452, 453, 348, 455, 506, 506, + /* 2680 */ 506, 506, 506, 506, 442, 506, 506, 445, 506, 361, + /* 2690 */ 448, 449, 450, 451, 452, 453, 506, 455, 506, 506, + /* 2700 */ 442, 506, 506, 445, 506, 506, 448, 449, 450, 451, + /* 2710 */ 452, 453, 348, 455, 506, 506, 506, 389, 506, 506, + /* 2720 */ 506, 506, 506, 506, 506, 361, 506, 506, 506, 401, + /* 2730 */ 506, 403, 506, 506, 506, 506, 506, 506, 506, 506, + /* 2740 */ 506, 506, 506, 506, 506, 506, 348, 506, 506, 506, + /* 2750 */ 506, 506, 506, 389, 506, 506, 506, 506, 506, 361, + /* 2760 */ 506, 506, 506, 506, 506, 401, 506, 403, 506, 348, + /* 2770 */ 442, 506, 506, 445, 506, 506, 448, 449, 450, 451, + /* 2780 */ 452, 453, 361, 455, 506, 506, 506, 389, 506, 506, + /* 2790 */ 506, 506, 506, 506, 506, 506, 506, 506, 506, 401, + /* 2800 */ 506, 403, 506, 506, 506, 506, 442, 506, 506, 445, + /* 2810 */ 389, 506, 448, 449, 450, 451, 452, 453, 506, 455, + /* 2820 */ 506, 506, 401, 506, 403, 506, 348, 506, 506, 506, + /* 2830 */ 506, 506, 506, 506, 506, 506, 506, 506, 506, 361, + /* 2840 */ 442, 348, 506, 445, 506, 506, 448, 449, 450, 451, + /* 2850 */ 452, 453, 506, 455, 361, 506, 506, 506, 506, 506, + /* 2860 */ 506, 506, 348, 442, 506, 506, 445, 389, 506, 448, + /* 2870 */ 449, 450, 451, 452, 453, 361, 455, 506, 506, 401, + /* 2880 */ 506, 403, 389, 506, 348, 506, 506, 506, 506, 506, + /* 2890 */ 506, 506, 506, 506, 401, 506, 403, 361, 506, 506, + /* 2900 */ 506, 506, 506, 389, 506, 506, 506, 506, 506, 506, + /* 2910 */ 506, 506, 506, 506, 506, 401, 506, 403, 506, 506, + /* 2920 */ 442, 506, 506, 445, 506, 389, 448, 449, 450, 451, + /* 2930 */ 452, 453, 506, 455, 506, 442, 506, 401, 445, 403, + /* 2940 */ 506, 448, 449, 450, 451, 452, 453, 506, 455, 506, + /* 2950 */ 506, 506, 506, 506, 506, 506, 442, 506, 506, 445, + /* 2960 */ 506, 506, 448, 449, 450, 451, 452, 453, 506, 455, + /* 2970 */ 506, 506, 506, 506, 506, 506, 506, 506, 442, 506, + /* 2980 */ 506, 445, 506, 506, 448, 449, 450, 451, 452, 453, + /* 2990 */ 506, 455, 345, 345, 345, 345, 345, 345, 345, 345, /* 3000 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, /* 3010 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, /* 3020 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, @@ -856,221 +857,221 @@ static const YYCODETYPE yy_lookahead[] = { /* 3300 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, /* 3310 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, /* 3320 */ 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, - /* 3330 */ 345, + /* 3330 */ 345, 345, 345, 345, 345, 345, 345, }; #define YY_SHIFT_COUNT (832) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2381) +#define YY_SHIFT_MAX (2354) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1303, 0, 239, 0, 479, 479, 479, 479, 479, 479, /* 10 */ 479, 479, 479, 479, 479, 479, 718, 957, 957, 1196, /* 20 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957, /* 30 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957, /* 40 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957, - /* 50 */ 957, 166, 200, 444, 64, 113, 480, 113, 113, 64, - /* 60 */ 64, 113, 1224, 113, 238, 1224, 1224, 58, 113, 1, - /* 70 */ 352, 14, 14, 288, 288, 352, 415, 412, 93, 93, - /* 80 */ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - /* 90 */ 14, 78, 126, 14, 14, 112, 1, 14, 78, 14, - /* 100 */ 190, 1, 14, 14, 1, 14, 14, 1, 14, 1, - /* 110 */ 1, 1, 14, 211, 199, 199, 259, 197, 714, 714, - /* 120 */ 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, - /* 130 */ 714, 714, 714, 714, 714, 714, 714, 956, 446, 415, - /* 140 */ 412, 363, 363, 794, 605, 605, 605, 195, 634, 634, - /* 150 */ 794, 112, 237, 1, 1, 249, 1, 387, 1, 387, - /* 160 */ 387, 493, 454, 281, 568, 568, 568, 568, 568, 568, - /* 170 */ 568, 568, 1638, 1079, 65, 432, 15, 478, 46, 73, - /* 180 */ 3, 3, 482, 531, 884, 588, 497, 854, 805, 1010, - /* 190 */ 103, 909, 778, 429, 254, 778, 1121, 969, 1036, 1118, - /* 200 */ 1339, 1353, 1379, 1188, 112, 1379, 112, 1209, 1388, 1391, - /* 210 */ 1367, 1395, 1391, 1367, 1248, 1388, 1391, 1388, 1367, 1248, - /* 220 */ 1248, 1348, 1354, 1388, 1359, 1388, 1388, 1388, 1445, 1424, - /* 230 */ 1445, 1424, 1379, 112, 112, 1459, 112, 1462, 1467, 112, - /* 240 */ 1462, 112, 1471, 112, 112, 1388, 112, 1445, 1, 1, - /* 250 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1388, - /* 260 */ 281, 281, 1445, 387, 387, 387, 1300, 1414, 1379, 211, - /* 270 */ 1519, 1342, 1361, 1459, 211, 1118, 1388, 1395, 1395, 387, - /* 280 */ 1279, 1297, 387, 1279, 1297, 387, 387, 1, 1294, 1410, - /* 290 */ 1279, 1325, 1328, 1344, 1118, 1323, 1330, 1333, 1357, 1391, - /* 300 */ 1599, 1511, 1360, 1462, 211, 211, 1297, 387, 387, 387, - /* 310 */ 387, 387, 1297, 387, 1480, 211, 493, 211, 1391, 1569, - /* 320 */ 1573, 387, 454, 1388, 211, 1663, 1649, 1445, 2986, 2986, - /* 330 */ 2986, 2986, 2986, 2986, 2986, 2986, 2986, 36, 1994, 544, - /* 340 */ 66, 822, 269, 645, 632, 30, 285, 796, 911, 314, - /* 350 */ 314, 314, 314, 314, 314, 314, 314, 314, 661, 149, - /* 360 */ 33, 495, 495, 573, 494, 131, 655, 776, 903, 904, - /* 370 */ 603, 361, 361, 690, 1028, 721, 690, 690, 690, 1181, - /* 380 */ 891, 1110, 1184, 1141, 1045, 1189, 1112, 1130, 1131, 1132, - /* 390 */ 1232, 1237, 1213, 1234, 1249, 1041, 1182, 1187, 1150, 1239, - /* 400 */ 1242, 1245, 1086, 977, 970, 1246, 1251, 1252, 1253, 1254, - /* 410 */ 1257, 1275, 1258, 1051, 1259, 1219, 1260, 1267, 1270, 1276, - /* 420 */ 1285, 1290, 1190, 1148, 1217, 1269, 1295, 1308, 1167, 1709, - /* 430 */ 1710, 1711, 1667, 1713, 1678, 1491, 1680, 1683, 1684, 1499, - /* 440 */ 1723, 1687, 1688, 1503, 1690, 1728, 1506, 1730, 1695, 1733, - /* 450 */ 1714, 1735, 1708, 1530, 1749, 1544, 1752, 1547, 1551, 1554, - /* 460 */ 1564, 1774, 1775, 1776, 1583, 1586, 1780, 1781, 1635, 1734, - /* 470 */ 1736, 1784, 1750, 1737, 1789, 1741, 1791, 1747, 1793, 1794, - /* 480 */ 1795, 1748, 1796, 1798, 1799, 1801, 1802, 1804, 1644, 1778, - /* 490 */ 1812, 1656, 1819, 1820, 1821, 1822, 1823, 1824, 1827, 1839, - /* 500 */ 1840, 1841, 1842, 1843, 1845, 1846, 1847, 1848, 1849, 1782, - /* 510 */ 1832, 1785, 1833, 1834, 1835, 1836, 1837, 1850, 1852, 1831, - /* 520 */ 1854, 1715, 1855, 1712, 1856, 1716, 1863, 1864, 1844, 1815, - /* 530 */ 1860, 1818, 1872, 1825, 1851, 1883, 1826, 1885, 1838, 1886, - /* 540 */ 1897, 1858, 1853, 1857, 1898, 1866, 1861, 1859, 1900, 1868, - /* 550 */ 1874, 1865, 1906, 1871, 1914, 1870, 1884, 1896, 1879, 1881, - /* 560 */ 1917, 1899, 1933, 1901, 1904, 1947, 1950, 1953, 1954, 1913, - /* 570 */ 1767, 1957, 1879, 1909, 1960, 1961, 1891, 1963, 1965, 1930, - /* 580 */ 1918, 1926, 1970, 1934, 1921, 1931, 1974, 1939, 1928, 1935, - /* 590 */ 1980, 1952, 1936, 1964, 1992, 2002, 2007, 2010, 2017, 2019, - /* 600 */ 1880, 1908, 1958, 1999, 2026, 1986, 1987, 1990, 1991, 1993, - /* 610 */ 1996, 1997, 1998, 2003, 2006, 2011, 2012, 2009, 2014, 2040, - /* 620 */ 2020, 2043, 2025, 2004, 2052, 2037, 2024, 2060, 2063, 2067, - /* 630 */ 2031, 2069, 2033, 2072, 2051, 2054, 2039, 2042, 2044, 1968, - /* 640 */ 1971, 2082, 1905, 1978, 1882, 1879, 2041, 2086, 1911, 2064, - /* 650 */ 2075, 2100, 1907, 2083, 1929, 1940, 2115, 2120, 1945, 1946, - /* 660 */ 1955, 1949, 2121, 2104, 1867, 2030, 2034, 2032, 2090, 2045, - /* 670 */ 2092, 2049, 2036, 2111, 2113, 2046, 2048, 2050, 2055, 2053, - /* 680 */ 2114, 2106, 2109, 2056, 2119, 1892, 2058, 2061, 2160, 2134, - /* 690 */ 1912, 2132, 2133, 2135, 2136, 2140, 2142, 2073, 2076, 2122, - /* 700 */ 1920, 2153, 2138, 2189, 2192, 2087, 2152, 2089, 2095, 2096, - /* 710 */ 2091, 2093, 2028, 2107, 2196, 2170, 2035, 2108, 2101, 1879, - /* 720 */ 2168, 2185, 2116, 1969, 2123, 2220, 2202, 1995, 2117, 2127, - /* 730 */ 2124, 2137, 2139, 2141, 2177, 2143, 2144, 2179, 2145, 2219, - /* 740 */ 2015, 2147, 2130, 2148, 2214, 2217, 2151, 2154, 2222, 2156, - /* 750 */ 2157, 2223, 2159, 2161, 2226, 2163, 2167, 2229, 2164, 2169, - /* 760 */ 2230, 2171, 2162, 2165, 2166, 2173, 2181, 2255, 2184, 2254, - /* 770 */ 2188, 2255, 2255, 2273, 2231, 2227, 2264, 2266, 2267, 2268, - /* 780 */ 2269, 2270, 2271, 2272, 2275, 2238, 2210, 2283, 2280, 2281, - /* 790 */ 2282, 2298, 2284, 2285, 2286, 2247, 2003, 2288, 2006, 2290, - /* 800 */ 2292, 2293, 2294, 2310, 2296, 2334, 2299, 2287, 2297, 2335, - /* 810 */ 2304, 2291, 2307, 2351, 2317, 2305, 2315, 2364, 2331, 2318, - /* 820 */ 2330, 2379, 2345, 2346, 2381, 2363, 2354, 2366, 2368, 2369, - /* 830 */ 2370, 2372, 2375, + /* 50 */ 957, 47, 240, 235, 126, 480, 483, 480, 480, 126, + /* 60 */ 126, 480, 1224, 480, 238, 1224, 1224, 251, 480, 39, + /* 70 */ 352, 182, 182, 660, 660, 352, 333, 13, 93, 93, + /* 80 */ 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + /* 90 */ 182, 314, 495, 182, 182, 150, 39, 182, 314, 182, + /* 100 */ 510, 39, 182, 182, 39, 182, 182, 39, 182, 39, + /* 110 */ 39, 39, 182, 478, 199, 199, 259, 143, 474, 474, + /* 120 */ 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, + /* 130 */ 474, 474, 474, 474, 474, 474, 474, 427, 410, 333, + /* 140 */ 13, 883, 883, 706, 255, 255, 255, 932, 895, 895, + /* 150 */ 706, 150, 267, 39, 39, 362, 39, 574, 39, 574, + /* 160 */ 574, 549, 816, 711, 568, 568, 568, 568, 568, 568, + /* 170 */ 568, 568, 1638, 1079, 65, 432, 15, 241, 729, 19, + /* 180 */ 3, 3, 485, 974, 974, 974, 366, 863, 974, 722, + /* 190 */ 759, 924, 1074, 275, 125, 1044, 920, 409, 18, 920, + /* 200 */ 1104, 553, 819, 1120, 1344, 1356, 1380, 1191, 150, 1380, + /* 210 */ 150, 1215, 1395, 1397, 1375, 1403, 1397, 1375, 1276, 1395, + /* 220 */ 1397, 1395, 1375, 1276, 1276, 1359, 1362, 1395, 1373, 1395, + /* 230 */ 1395, 1395, 1455, 1431, 1455, 1431, 1380, 150, 150, 1467, + /* 240 */ 150, 1472, 1477, 150, 1472, 150, 1484, 150, 150, 1395, + /* 250 */ 150, 1455, 39, 39, 39, 39, 39, 39, 39, 39, + /* 260 */ 39, 39, 39, 1395, 711, 711, 1455, 574, 574, 574, + /* 270 */ 1318, 1452, 1380, 478, 1548, 1365, 1368, 1467, 478, 1120, + /* 280 */ 1395, 1403, 1403, 574, 1316, 1328, 1316, 1328, 39, 1327, + /* 290 */ 1426, 1316, 1329, 1331, 1347, 1120, 1332, 1330, 1338, 1363, + /* 300 */ 1397, 1608, 1516, 1379, 1472, 478, 478, 1328, 574, 574, + /* 310 */ 574, 574, 1328, 574, 1487, 478, 549, 478, 1397, 1571, + /* 320 */ 1576, 574, 816, 1395, 478, 1666, 1655, 1455, 2992, 2992, + /* 330 */ 2992, 2992, 2992, 2992, 2992, 2992, 2992, 36, 2191, 544, + /* 340 */ 30, 494, 269, 634, 632, 796, 873, 645, 789, 212, + /* 350 */ 212, 212, 212, 212, 212, 212, 212, 212, 621, 149, + /* 360 */ 290, 654, 654, 81, 177, 734, 416, 815, 475, 981, + /* 370 */ 918, 950, 950, 1110, 1112, 626, 1110, 1110, 1110, 1132, + /* 380 */ 813, 328, 592, 1109, 1049, 1179, 968, 1108, 1115, 1123, + /* 390 */ 1007, 1176, 1221, 1228, 1234, 1024, 1140, 1209, 870, 1211, + /* 400 */ 1212, 1216, 1087, 1086, 983, 1225, 1233, 1235, 1238, 1239, + /* 410 */ 1241, 1252, 1243, 1169, 1244, 1192, 1245, 1246, 1247, 1259, + /* 420 */ 1260, 1267, 1142, 1218, 1250, 1257, 1268, 1232, 1306, 1712, + /* 430 */ 1713, 1714, 1670, 1717, 1683, 1498, 1685, 1686, 1687, 1502, + /* 440 */ 1726, 1690, 1691, 1506, 1693, 1732, 1510, 1735, 1699, 1745, + /* 450 */ 1727, 1748, 1715, 1532, 1753, 1552, 1754, 1556, 1567, 1575, + /* 460 */ 1578, 1777, 1779, 1780, 1587, 1589, 1783, 1784, 1640, 1736, + /* 470 */ 1739, 1789, 1755, 1740, 1790, 1744, 1794, 1750, 1796, 1797, + /* 480 */ 1798, 1752, 1799, 1802, 1805, 1812, 1819, 1820, 1654, 1785, + /* 490 */ 1816, 1660, 1823, 1824, 1827, 1829, 1830, 1831, 1832, 1833, + /* 500 */ 1834, 1835, 1836, 1837, 1839, 1840, 1841, 1842, 1843, 1800, + /* 510 */ 1846, 1803, 1847, 1850, 1852, 1853, 1854, 1855, 1856, 1844, + /* 520 */ 1862, 1711, 1863, 1718, 1865, 1723, 1869, 1871, 1860, 1822, + /* 530 */ 1861, 1838, 1885, 1825, 1849, 1890, 1848, 1895, 1851, 1896, + /* 540 */ 1897, 1873, 1866, 1857, 1900, 1876, 1867, 1872, 1902, 1882, + /* 550 */ 1870, 1878, 1923, 1887, 1925, 1881, 1886, 1898, 1884, 1888, + /* 560 */ 1915, 1899, 1930, 1903, 1907, 1950, 1951, 1952, 1953, 1912, + /* 570 */ 1766, 1959, 1884, 1908, 1961, 1962, 1892, 1964, 1965, 1929, + /* 580 */ 1916, 1926, 1969, 1933, 1920, 1932, 1972, 1939, 1928, 1935, + /* 590 */ 1980, 1954, 1936, 1947, 1990, 1992, 1993, 1994, 1995, 1996, + /* 600 */ 1904, 1905, 1974, 1976, 1999, 1975, 1977, 1982, 1983, 1984, + /* 610 */ 1985, 1986, 1987, 1997, 1998, 1989, 1991, 2005, 2000, 2002, + /* 620 */ 2007, 2009, 2010, 1963, 2033, 2012, 2003, 2035, 2036, 2039, + /* 630 */ 2004, 2042, 2006, 2044, 2023, 2026, 2011, 2013, 2015, 1940, + /* 640 */ 1945, 2053, 1891, 1966, 1868, 1884, 2021, 2056, 1901, 2022, + /* 650 */ 2052, 2058, 1874, 2054, 1906, 1910, 2077, 2081, 1909, 1913, + /* 660 */ 1911, 1914, 2079, 2055, 1811, 1988, 1978, 2001, 2043, 2008, + /* 670 */ 2045, 2016, 2017, 2059, 2064, 2027, 2029, 2031, 2032, 2034, + /* 680 */ 2067, 2037, 2057, 2038, 2068, 1845, 2040, 2041, 2099, 2071, + /* 690 */ 1879, 2074, 2076, 2084, 2086, 2102, 2103, 2046, 2047, 2060, + /* 700 */ 1877, 2083, 2065, 2105, 2150, 2061, 2104, 2062, 2063, 2070, + /* 710 */ 2066, 2073, 2018, 2075, 2169, 2123, 2019, 2080, 2087, 1884, + /* 720 */ 2122, 2141, 2078, 1931, 2085, 2176, 2158, 1955, 2082, 2089, + /* 730 */ 2092, 2094, 2097, 2098, 2159, 2101, 2106, 2160, 2108, 2188, + /* 740 */ 1981, 2124, 2095, 2125, 2192, 2194, 2127, 2128, 2197, 2130, + /* 750 */ 2131, 2200, 2133, 2136, 2203, 2138, 2139, 2208, 2142, 2147, + /* 760 */ 2212, 2152, 2135, 2144, 2145, 2148, 2167, 2223, 2168, 2239, + /* 770 */ 2171, 2223, 2223, 2256, 2209, 2214, 2245, 2248, 2249, 2250, + /* 780 */ 2251, 2252, 2253, 2254, 2255, 2202, 2193, 2261, 2260, 2264, + /* 790 */ 2265, 2273, 2267, 2275, 2277, 2221, 1997, 2278, 1998, 2279, + /* 800 */ 2280, 2282, 2283, 2299, 2286, 2324, 2289, 2285, 2292, 2337, + /* 810 */ 2301, 2288, 2300, 2341, 2306, 2293, 2303, 2347, 2311, 2298, + /* 820 */ 2308, 2351, 2315, 2316, 2354, 2333, 2323, 2335, 2338, 2339, + /* 830 */ 2342, 2344, 2346, }; #define YY_REDUCE_COUNT (336) -#define YY_REDUCE_MIN (-463) -#define YY_REDUCE_MAX (2530) +#define YY_REDUCE_MIN (-422) +#define YY_REDUCE_MAX (2536) static const short yy_reduce_ofst[] = { - /* 0 */ 89, -301, 145, -24, 178, 385, 417, 623, 656, 862, + /* 0 */ 907, -301, 145, -24, 178, 385, 417, 623, 656, 862, /* 10 */ 455, 1100, 1135, 1158, 1193, 1289, 1315, -82, 1358, 1425, - /* 20 */ 1468, 1490, 1533, 1548, 1563, 1643, 1661, 1677, 1756, 1787, - /* 30 */ 1830, 1895, 1910, 1925, 2005, 2023, 2038, 2081, 2103, 2118, - /* 40 */ 2176, 2201, 2233, 2259, 2329, 2344, 2367, 2387, 2452, 2473, - /* 50 */ 2530, -303, -337, 175, 53, 355, 514, 753, 842, 90, - /* 60 */ 143, 856, -192, 38, -357, 487, 542, 516, 528, -379, - /* 70 */ -243, -354, 160, -350, -88, 213, -326, -85, 320, 425, - /* 80 */ 198, 286, 323, 374, -256, -222, 383, 433, 462, 529, - /* 90 */ -205, 307, -215, 621, 638, 380, -385, 675, 447, 678, - /* 100 */ 107, -94, 681, 732, -77, 759, 764, 388, 766, 539, - /* 110 */ 535, 699, 768, -6, -463, -463, -317, -87, -212, -60, - /* 120 */ 9, 271, 389, 491, 498, 575, 599, 624, 630, 685, - /* 130 */ 716, 729, 736, 746, 749, 755, 762, 248, -397, 188, - /* 140 */ -186, 688, 748, 707, -397, -241, -43, 461, 561, 677, - /* 150 */ 757, 773, 404, -348, 509, 522, -14, 639, 546, 775, - /* 160 */ 781, 780, 804, 299, 278, 360, 473, 503, 712, 874, - /* 170 */ 880, 712, 209, 611, 934, 881, 795, 828, 933, 845, - /* 180 */ 958, 963, 975, 965, 939, 965, 999, 961, 1015, 978, - /* 190 */ 950, 968, 908, 908, 890, 908, 919, 910, 965, 966, - /* 200 */ 949, 955, 964, 962, 1033, 971, 1035, 979, 1050, 1052, - /* 210 */ 1004, 1002, 1057, 1009, 1013, 1061, 1064, 1068, 1039, 1043, - /* 220 */ 1044, 1080, 1085, 1098, 1088, 1102, 1103, 1104, 1113, 1119, - /* 230 */ 1122, 1120, 1042, 1111, 1115, 1078, 1116, 1124, 1062, 1123, - /* 240 */ 1128, 1133, 1082, 1136, 1138, 1137, 1139, 1147, 1125, 1126, - /* 250 */ 1127, 1129, 1134, 1144, 1145, 1146, 1151, 1154, 1155, 1149, - /* 260 */ 1153, 1159, 1160, 1156, 1157, 1162, 1081, 1089, 1090, 1170, - /* 270 */ 1140, 1143, 1142, 1165, 1198, 1164, 1211, 1177, 1178, 1168, - /* 280 */ 1087, 1174, 1180, 1093, 1179, 1203, 1204, 965, 1152, 1166, - /* 290 */ 1169, 1163, 1173, 1176, 1191, 1114, 1171, 1175, 908, 1265, - /* 300 */ 1183, 1172, 1186, 1271, 1262, 1264, 1215, 1231, 1235, 1250, - /* 310 */ 1261, 1266, 1230, 1273, 1255, 1298, 1281, 1301, 1310, 1212, - /* 320 */ 1287, 1280, 1304, 1322, 1317, 1336, 1334, 1338, 1268, 1256, - /* 330 */ 1274, 1283, 1312, 1318, 1324, 1337, 1362, + /* 20 */ 1456, 1490, 1533, 1555, 1612, 1677, 1707, 1742, 1772, 1815, + /* 30 */ 1858, 1880, 1957, 1979, 2014, 2050, 2072, 2129, 2146, 2165, + /* 40 */ 2222, 2242, 2258, 2328, 2364, 2398, 2421, 2478, 2493, 2514, + /* 50 */ 2536, -278, -338, -422, -170, -420, 514, 643, 790, 89, + /* 60 */ 144, 860, 386, 446, -307, 542, 598, 54, 435, -378, + /* 70 */ 162, -355, 439, -287, -177, -86, -101, -193, 279, 320, + /* 80 */ -311, -276, 374, 468, -89, 59, 493, 613, 620, 622, + /* 90 */ 264, 457, 447, 647, 662, 222, -348, 668, 612, 670, + /* 100 */ -132, -109, 672, 675, -380, 678, 701, 348, 732, -202, + /* 110 */ 453, -127, 735, -69, -402, -402, -370, -209, -314, -26, + /* 120 */ 152, 363, 391, 442, 454, 477, 498, 589, 597, 665, + /* 130 */ 749, 755, 762, 773, 779, 780, 783, -184, 205, 114, + /* 140 */ 373, 640, 770, 695, 205, 403, 609, -207, 686, 707, + /* 150 */ 787, 9, 511, 636, 778, -194, 306, 283, 822, 393, + /* 160 */ 473, 219, 535, 825, 872, 892, 893, 899, 905, 906, + /* 170 */ 913, 905, 867, -368, 959, 911, 826, 827, 969, 849, + /* 180 */ 964, 972, 1000, 871, 885, 886, 973, 941, 890, 973, + /* 190 */ 1001, 961, 1022, 985, 955, 975, 912, 912, 894, 912, + /* 200 */ 919, 914, 973, 967, 953, 958, 970, 971, 1036, 977, + /* 210 */ 1041, 987, 1056, 1058, 1011, 1014, 1064, 1039, 1045, 1093, + /* 220 */ 1095, 1097, 1048, 1052, 1053, 1089, 1094, 1105, 1106, 1116, + /* 230 */ 1118, 1119, 1127, 1125, 1131, 1128, 1050, 1121, 1122, 1085, + /* 240 */ 1130, 1138, 1076, 1136, 1145, 1139, 1092, 1141, 1144, 1154, + /* 250 */ 1146, 1163, 1129, 1134, 1137, 1148, 1150, 1151, 1155, 1157, + /* 260 */ 1167, 1168, 1174, 1160, 1166, 1170, 1180, 1126, 1133, 1164, + /* 270 */ 1103, 1143, 1153, 1197, 1156, 1159, 1147, 1171, 1205, 1173, + /* 280 */ 1213, 1161, 1162, 1177, 1114, 1186, 1149, 1195, 973, 1152, + /* 290 */ 1165, 1181, 1172, 1175, 1182, 1194, 1117, 1124, 1183, 912, + /* 300 */ 1269, 1184, 1185, 1189, 1271, 1282, 1284, 1217, 1253, 1261, + /* 310 */ 1270, 1273, 1242, 1274, 1254, 1286, 1285, 1305, 1319, 1214, + /* 320 */ 1290, 1283, 1307, 1325, 1320, 1341, 1340, 1342, 1275, 1264, + /* 330 */ 1287, 1288, 1313, 1322, 1326, 1343, 1364, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 10 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 20 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 30 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 40 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 50 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 60 */ 1860, 2192, 1860, 1860, 2155, 1860, 1860, 1860, 1860, 1860, - /* 70 */ 1860, 1860, 1860, 1860, 1860, 1860, 2162, 1860, 1860, 1860, - /* 80 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 90 */ 1860, 1860, 1860, 1860, 1860, 1957, 1860, 1860, 1860, 1860, - /* 100 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 110 */ 1860, 1860, 1860, 1955, 2391, 1860, 1860, 1860, 1860, 1860, - /* 120 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 130 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2403, 1860, - /* 140 */ 1860, 1931, 1931, 1860, 2403, 2403, 2403, 1955, 2363, 2363, - /* 150 */ 1860, 1957, 2230, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 160 */ 1860, 2079, 1860, 1890, 1860, 1860, 1860, 1860, 2103, 1860, - /* 170 */ 1860, 1860, 2218, 1860, 1860, 2432, 2489, 1860, 1860, 2435, - /* 180 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2167, 1860, 2032, - /* 190 */ 2212, 2422, 2395, 2409, 2473, 2396, 2393, 2416, 1860, 2426, - /* 200 */ 1860, 2254, 1860, 2244, 1957, 1860, 1957, 2205, 2150, 1860, - /* 210 */ 2160, 1860, 1860, 2160, 2157, 1860, 1860, 1860, 2160, 2157, - /* 220 */ 2157, 2021, 2017, 1860, 2015, 1860, 1860, 1860, 1860, 1915, - /* 230 */ 1860, 1915, 1860, 1957, 1957, 1860, 1957, 1860, 1860, 1957, - /* 240 */ 1860, 1957, 1860, 1957, 1957, 1860, 1957, 1860, 1860, 1860, - /* 250 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 260 */ 1860, 1860, 1860, 1860, 1860, 1860, 2242, 2228, 1860, 1955, - /* 270 */ 1860, 2216, 2214, 1860, 1955, 2426, 1860, 1860, 1860, 1860, - /* 280 */ 2443, 2441, 1860, 2443, 2441, 1860, 1860, 1860, 2457, 2453, - /* 290 */ 2443, 2462, 2459, 2428, 2426, 2492, 2479, 2475, 2409, 1860, - /* 300 */ 1860, 2414, 2412, 1860, 1955, 1955, 2441, 1860, 1860, 1860, - /* 310 */ 1860, 1860, 2441, 1860, 1860, 1955, 1860, 1955, 1860, 1860, - /* 320 */ 2048, 1860, 1860, 1860, 1955, 1860, 1899, 1860, 2207, 2233, - /* 330 */ 2188, 2188, 2082, 2082, 2082, 1958, 1865, 1860, 1860, 1860, - /* 340 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2456, - /* 350 */ 2455, 2318, 1860, 2367, 2366, 2365, 2356, 2317, 2044, 1860, - /* 360 */ 1860, 2316, 2315, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 370 */ 1860, 2179, 2178, 2309, 1860, 1860, 2310, 2308, 2307, 1860, - /* 380 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 390 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 400 */ 1860, 1860, 1860, 2476, 2480, 1860, 1860, 1860, 1860, 1860, - /* 410 */ 1860, 2392, 1860, 1860, 1860, 2290, 1860, 1860, 1860, 1860, - /* 420 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 430 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 440 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 450 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 460 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2156, 1860, - /* 470 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 480 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 490 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 500 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 510 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 520 */ 1860, 1860, 1860, 1860, 1860, 2171, 1860, 1860, 1860, 1860, - /* 530 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 540 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 550 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1904, 2296, 1860, - /* 560 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 570 */ 1860, 1860, 2299, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 580 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 590 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 600 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 610 */ 1860, 1860, 1860, 1997, 1996, 1860, 1860, 1860, 1860, 1860, - /* 620 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 630 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2300, - /* 640 */ 1860, 1860, 1860, 1860, 1860, 2292, 1860, 1860, 1860, 1860, - /* 650 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 660 */ 1860, 1860, 2472, 2429, 1860, 1860, 1860, 1860, 1860, 1860, - /* 670 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 680 */ 1860, 1860, 2290, 1860, 2454, 1860, 1860, 2470, 1860, 2474, - /* 690 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2402, 2398, 1860, - /* 700 */ 1860, 2394, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 710 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2289, - /* 720 */ 1860, 2353, 1860, 1860, 1860, 2387, 1860, 1860, 2338, 1860, - /* 730 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 2300, 1860, - /* 740 */ 2303, 1860, 1860, 1860, 1860, 1860, 2076, 1860, 1860, 1860, - /* 750 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 760 */ 1860, 1860, 2060, 2058, 2057, 2056, 1860, 2089, 1860, 1860, - /* 770 */ 1860, 2085, 2084, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 780 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1976, 1860, 1860, - /* 790 */ 1860, 1860, 1860, 1860, 1860, 1860, 1968, 1860, 1967, 1860, - /* 800 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 810 */ 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860, - /* 820 */ 1860, 1860, 1860, 1860, 1860, 1860, 1889, 1860, 1860, 1860, - /* 830 */ 1860, 1860, 1860, + /* 0 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 10 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 20 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 30 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 40 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 50 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 60 */ 1866, 2198, 1866, 1866, 2161, 1866, 1866, 1866, 1866, 1866, + /* 70 */ 1866, 1866, 1866, 1866, 1866, 1866, 2168, 1866, 1866, 1866, + /* 80 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 90 */ 1866, 1866, 1866, 1866, 1866, 1963, 1866, 1866, 1866, 1866, + /* 100 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 110 */ 1866, 1866, 1866, 1961, 2397, 1866, 1866, 1866, 1866, 1866, + /* 120 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 130 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2409, 1866, + /* 140 */ 1866, 1937, 1937, 1866, 2409, 2409, 2409, 1961, 2369, 2369, + /* 150 */ 1866, 1963, 2236, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 160 */ 1866, 2085, 1866, 1896, 1866, 1866, 1866, 1866, 2109, 1866, + /* 170 */ 1866, 1866, 2224, 1866, 1866, 2438, 2498, 1866, 1866, 2441, + /* 180 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 190 */ 1866, 2173, 1866, 2038, 2218, 2428, 2401, 2415, 2482, 2402, + /* 200 */ 2399, 2422, 1866, 2432, 1866, 2260, 1866, 2250, 1963, 1866, + /* 210 */ 1963, 2211, 2156, 1866, 2166, 1866, 1866, 2166, 2163, 1866, + /* 220 */ 1866, 1866, 2166, 2163, 2163, 2027, 2023, 1866, 2021, 1866, + /* 230 */ 1866, 1866, 1866, 1921, 1866, 1921, 1866, 1963, 1963, 1866, + /* 240 */ 1963, 1866, 1866, 1963, 1866, 1963, 1866, 1963, 1963, 1866, + /* 250 */ 1963, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 260 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 270 */ 2248, 2234, 1866, 1961, 1866, 2222, 2220, 1866, 1961, 2432, + /* 280 */ 1866, 1866, 1866, 1866, 2452, 2447, 2452, 2447, 1866, 2466, + /* 290 */ 2462, 2452, 2471, 2468, 2434, 2432, 2501, 2488, 2484, 2415, + /* 300 */ 1866, 1866, 2420, 2418, 1866, 1961, 1961, 2447, 1866, 1866, + /* 310 */ 1866, 1866, 2447, 1866, 1866, 1961, 1866, 1961, 1866, 1866, + /* 320 */ 2054, 1866, 1866, 1866, 1961, 1866, 1905, 1866, 2213, 2239, + /* 330 */ 2194, 2194, 2088, 2088, 2088, 1964, 1871, 1866, 1866, 1866, + /* 340 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2465, + /* 350 */ 2464, 2324, 1866, 2373, 2372, 2371, 2362, 2323, 2050, 1866, + /* 360 */ 1866, 2322, 2321, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 370 */ 1866, 2185, 2184, 2315, 1866, 1866, 2316, 2314, 2313, 1866, + /* 380 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 390 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 400 */ 1866, 1866, 1866, 2485, 2489, 1866, 1866, 1866, 1866, 1866, + /* 410 */ 1866, 2398, 1866, 1866, 1866, 2296, 1866, 1866, 1866, 1866, + /* 420 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 430 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 440 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 450 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 460 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2162, 1866, + /* 470 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 480 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 490 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 500 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 510 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 520 */ 1866, 1866, 1866, 1866, 1866, 2177, 1866, 1866, 1866, 1866, + /* 530 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 540 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 550 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1910, 2302, 1866, + /* 560 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 570 */ 1866, 1866, 2305, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 580 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 590 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 600 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 610 */ 1866, 1866, 1866, 2003, 2002, 1866, 1866, 1866, 1866, 1866, + /* 620 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 630 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2306, + /* 640 */ 1866, 1866, 1866, 1866, 1866, 2298, 1866, 1866, 1866, 1866, + /* 650 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 660 */ 1866, 1866, 2481, 2435, 1866, 1866, 1866, 1866, 1866, 1866, + /* 670 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 680 */ 1866, 1866, 2296, 1866, 2463, 1866, 1866, 2479, 1866, 2483, + /* 690 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2408, 2404, 1866, + /* 700 */ 1866, 2400, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 710 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2295, + /* 720 */ 1866, 2359, 1866, 1866, 1866, 2393, 1866, 1866, 2344, 1866, + /* 730 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 2306, 1866, + /* 740 */ 2309, 1866, 1866, 1866, 1866, 1866, 2082, 1866, 1866, 1866, + /* 750 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 760 */ 1866, 1866, 2066, 2064, 2063, 2062, 1866, 2095, 1866, 1866, + /* 770 */ 1866, 2091, 2090, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 780 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1982, 1866, 1866, + /* 790 */ 1866, 1866, 1866, 1866, 1866, 1866, 1974, 1866, 1973, 1866, + /* 800 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 810 */ 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, 1866, + /* 820 */ 1866, 1866, 1866, 1866, 1866, 1866, 1895, 1866, 1866, 1866, + /* 830 */ 1866, 1866, 1866, }; /********** End of lemon-generated parsing tables *****************************/ @@ -2014,19 +2015,20 @@ static const char *const yyTokenName[] = { /* 489 */ "select_item", /* 490 */ "partition_list", /* 491 */ "partition_item", - /* 492 */ "fill_mode", - /* 493 */ "group_by_list", - /* 494 */ "query_expression", - /* 495 */ "query_simple", - /* 496 */ "order_by_clause_opt", - /* 497 */ "slimit_clause_opt", - /* 498 */ "limit_clause_opt", - /* 499 */ "union_query_expression", - /* 500 */ "query_simple_or_subquery", - /* 501 */ "sort_specification_list", - /* 502 */ "sort_specification", - /* 503 */ "ordering_specification_opt", - /* 504 */ "null_ordering_opt", + /* 492 */ "interval_sliding_duration_literal", + /* 493 */ "fill_mode", + /* 494 */ "group_by_list", + /* 495 */ "query_expression", + /* 496 */ "query_simple", + /* 497 */ "order_by_clause_opt", + /* 498 */ "slimit_clause_opt", + /* 499 */ "limit_clause_opt", + /* 500 */ "union_query_expression", + /* 501 */ "query_simple_or_subquery", + /* 502 */ "sort_specification_list", + /* 503 */ "sort_specification", + /* 504 */ "ordering_specification_opt", + /* 505 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2607,65 +2609,68 @@ static const char *const yyRuleName[] = { /* 570 */ "partition_item ::= expr_or_subquery column_alias", /* 571 */ "partition_item ::= expr_or_subquery AS column_alias", /* 572 */ "twindow_clause_opt ::=", - /* 573 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 573 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", /* 574 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 575 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 576 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 575 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 576 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", /* 577 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", /* 578 */ "sliding_opt ::=", - /* 579 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 580 */ "fill_opt ::=", - /* 581 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 582 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 583 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 584 */ "fill_mode ::= NONE", - /* 585 */ "fill_mode ::= PREV", - /* 586 */ "fill_mode ::= NULL", - /* 587 */ "fill_mode ::= NULL_F", - /* 588 */ "fill_mode ::= LINEAR", - /* 589 */ "fill_mode ::= NEXT", - /* 590 */ "group_by_clause_opt ::=", - /* 591 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 592 */ "group_by_list ::= expr_or_subquery", - /* 593 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 594 */ "having_clause_opt ::=", - /* 595 */ "having_clause_opt ::= HAVING search_condition", - /* 596 */ "range_opt ::=", - /* 597 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 598 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 599 */ "every_opt ::=", - /* 600 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 601 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 602 */ "query_simple ::= query_specification", - /* 603 */ "query_simple ::= union_query_expression", - /* 604 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 605 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 606 */ "query_simple_or_subquery ::= query_simple", - /* 607 */ "query_simple_or_subquery ::= subquery", - /* 608 */ "query_or_subquery ::= query_expression", - /* 609 */ "query_or_subquery ::= subquery", - /* 610 */ "order_by_clause_opt ::=", - /* 611 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 612 */ "slimit_clause_opt ::=", - /* 613 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 614 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 615 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 616 */ "limit_clause_opt ::=", - /* 617 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 618 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 619 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 620 */ "subquery ::= NK_LP query_expression NK_RP", - /* 621 */ "subquery ::= NK_LP subquery NK_RP", - /* 622 */ "search_condition ::= common_expression", - /* 623 */ "sort_specification_list ::= sort_specification", - /* 624 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 625 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 626 */ "ordering_specification_opt ::=", - /* 627 */ "ordering_specification_opt ::= ASC", - /* 628 */ "ordering_specification_opt ::= DESC", - /* 629 */ "null_ordering_opt ::=", - /* 630 */ "null_ordering_opt ::= NULLS FIRST", - /* 631 */ "null_ordering_opt ::= NULLS LAST", + /* 579 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 580 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 581 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 582 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 583 */ "fill_opt ::=", + /* 584 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 585 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 586 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 587 */ "fill_mode ::= NONE", + /* 588 */ "fill_mode ::= PREV", + /* 589 */ "fill_mode ::= NULL", + /* 590 */ "fill_mode ::= NULL_F", + /* 591 */ "fill_mode ::= LINEAR", + /* 592 */ "fill_mode ::= NEXT", + /* 593 */ "group_by_clause_opt ::=", + /* 594 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 595 */ "group_by_list ::= expr_or_subquery", + /* 596 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 597 */ "having_clause_opt ::=", + /* 598 */ "having_clause_opt ::= HAVING search_condition", + /* 599 */ "range_opt ::=", + /* 600 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 601 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 602 */ "every_opt ::=", + /* 603 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 604 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 605 */ "query_simple ::= query_specification", + /* 606 */ "query_simple ::= union_query_expression", + /* 607 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 608 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 609 */ "query_simple_or_subquery ::= query_simple", + /* 610 */ "query_simple_or_subquery ::= subquery", + /* 611 */ "query_or_subquery ::= query_expression", + /* 612 */ "query_or_subquery ::= subquery", + /* 613 */ "order_by_clause_opt ::=", + /* 614 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 615 */ "slimit_clause_opt ::=", + /* 616 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 617 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 618 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 619 */ "limit_clause_opt ::=", + /* 620 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 621 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 622 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 623 */ "subquery ::= NK_LP query_expression NK_RP", + /* 624 */ "subquery ::= NK_LP subquery NK_RP", + /* 625 */ "search_condition ::= common_expression", + /* 626 */ "sort_specification_list ::= sort_specification", + /* 627 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 628 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 629 */ "ordering_specification_opt ::=", + /* 630 */ "ordering_specification_opt ::= ASC", + /* 631 */ "ordering_specification_opt ::= DESC", + /* 632 */ "null_ordering_opt ::=", + /* 633 */ "null_ordering_opt ::= NULLS FIRST", + /* 634 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2860,15 +2865,16 @@ static void yy_destructor( case 488: /* having_clause_opt */ case 489: /* select_item */ case 491: /* partition_item */ - case 494: /* query_expression */ - case 495: /* query_simple */ - case 497: /* slimit_clause_opt */ - case 498: /* limit_clause_opt */ - case 499: /* union_query_expression */ - case 500: /* query_simple_or_subquery */ - case 502: /* sort_specification */ + case 492: /* interval_sliding_duration_literal */ + case 495: /* query_expression */ + case 496: /* query_simple */ + case 498: /* slimit_clause_opt */ + case 499: /* limit_clause_opt */ + case 500: /* union_query_expression */ + case 501: /* query_simple_or_subquery */ + case 503: /* sort_specification */ { - nodesDestroyNode((yypminor->yy452)); + nodesDestroyNode((yypminor->yy476)); } break; case 346: /* account_options */ @@ -2911,11 +2917,11 @@ static void yy_destructor( case 482: /* partition_by_clause_opt */ case 487: /* group_by_clause_opt */ case 490: /* partition_list */ - case 493: /* group_by_list */ - case 496: /* order_by_clause_opt */ - case 501: /* sort_specification_list */ + case 494: /* group_by_list */ + case 497: /* order_by_clause_opt */ + case 502: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy844)); + nodesDestroyList((yypminor->yy332)); } break; case 353: /* user_name */ @@ -3005,17 +3011,17 @@ static void yy_destructor( } break; - case 492: /* fill_mode */ + case 493: /* fill_mode */ { } break; - case 503: /* ordering_specification_opt */ + case 504: /* ordering_specification_opt */ { } break; - case 504: /* null_ordering_opt */ + case 505: /* null_ordering_opt */ { } @@ -3879,65 +3885,68 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 491, /* (570) partition_item ::= expr_or_subquery column_alias */ 491, /* (571) partition_item ::= expr_or_subquery AS column_alias */ 486, /* (572) twindow_clause_opt ::= */ - 486, /* (573) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + 486, /* (573) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ 486, /* (574) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 486, /* (575) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - 486, /* (576) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + 486, /* (575) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 486, /* (576) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ 486, /* (577) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ 419, /* (578) sliding_opt ::= */ - 419, /* (579) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 485, /* (580) fill_opt ::= */ - 485, /* (581) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 485, /* (582) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 485, /* (583) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 492, /* (584) fill_mode ::= NONE */ - 492, /* (585) fill_mode ::= PREV */ - 492, /* (586) fill_mode ::= NULL */ - 492, /* (587) fill_mode ::= NULL_F */ - 492, /* (588) fill_mode ::= LINEAR */ - 492, /* (589) fill_mode ::= NEXT */ - 487, /* (590) group_by_clause_opt ::= */ - 487, /* (591) group_by_clause_opt ::= GROUP BY group_by_list */ - 493, /* (592) group_by_list ::= expr_or_subquery */ - 493, /* (593) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 488, /* (594) having_clause_opt ::= */ - 488, /* (595) having_clause_opt ::= HAVING search_condition */ - 483, /* (596) range_opt ::= */ - 483, /* (597) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 483, /* (598) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 484, /* (599) every_opt ::= */ - 484, /* (600) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 494, /* (601) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 495, /* (602) query_simple ::= query_specification */ - 495, /* (603) query_simple ::= union_query_expression */ - 499, /* (604) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 499, /* (605) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 500, /* (606) query_simple_or_subquery ::= query_simple */ - 500, /* (607) query_simple_or_subquery ::= subquery */ - 424, /* (608) query_or_subquery ::= query_expression */ - 424, /* (609) query_or_subquery ::= subquery */ - 496, /* (610) order_by_clause_opt ::= */ - 496, /* (611) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 497, /* (612) slimit_clause_opt ::= */ - 497, /* (613) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 497, /* (614) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 497, /* (615) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 498, /* (616) limit_clause_opt ::= */ - 498, /* (617) limit_clause_opt ::= LIMIT NK_INTEGER */ - 498, /* (618) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 498, /* (619) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 474, /* (620) subquery ::= NK_LP query_expression NK_RP */ - 474, /* (621) subquery ::= NK_LP subquery NK_RP */ - 363, /* (622) search_condition ::= common_expression */ - 501, /* (623) sort_specification_list ::= sort_specification */ - 501, /* (624) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 502, /* (625) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 503, /* (626) ordering_specification_opt ::= */ - 503, /* (627) ordering_specification_opt ::= ASC */ - 503, /* (628) ordering_specification_opt ::= DESC */ - 504, /* (629) null_ordering_opt ::= */ - 504, /* (630) null_ordering_opt ::= NULLS FIRST */ - 504, /* (631) null_ordering_opt ::= NULLS LAST */ + 419, /* (579) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 492, /* (580) interval_sliding_duration_literal ::= NK_VARIABLE */ + 492, /* (581) interval_sliding_duration_literal ::= NK_STRING */ + 492, /* (582) interval_sliding_duration_literal ::= NK_INTEGER */ + 485, /* (583) fill_opt ::= */ + 485, /* (584) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 485, /* (585) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 485, /* (586) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 493, /* (587) fill_mode ::= NONE */ + 493, /* (588) fill_mode ::= PREV */ + 493, /* (589) fill_mode ::= NULL */ + 493, /* (590) fill_mode ::= NULL_F */ + 493, /* (591) fill_mode ::= LINEAR */ + 493, /* (592) fill_mode ::= NEXT */ + 487, /* (593) group_by_clause_opt ::= */ + 487, /* (594) group_by_clause_opt ::= GROUP BY group_by_list */ + 494, /* (595) group_by_list ::= expr_or_subquery */ + 494, /* (596) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 488, /* (597) having_clause_opt ::= */ + 488, /* (598) having_clause_opt ::= HAVING search_condition */ + 483, /* (599) range_opt ::= */ + 483, /* (600) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 483, /* (601) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 484, /* (602) every_opt ::= */ + 484, /* (603) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 495, /* (604) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 496, /* (605) query_simple ::= query_specification */ + 496, /* (606) query_simple ::= union_query_expression */ + 500, /* (607) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 500, /* (608) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 501, /* (609) query_simple_or_subquery ::= query_simple */ + 501, /* (610) query_simple_or_subquery ::= subquery */ + 424, /* (611) query_or_subquery ::= query_expression */ + 424, /* (612) query_or_subquery ::= subquery */ + 497, /* (613) order_by_clause_opt ::= */ + 497, /* (614) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 498, /* (615) slimit_clause_opt ::= */ + 498, /* (616) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 498, /* (617) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 498, /* (618) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 499, /* (619) limit_clause_opt ::= */ + 499, /* (620) limit_clause_opt ::= LIMIT NK_INTEGER */ + 499, /* (621) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 499, /* (622) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 474, /* (623) subquery ::= NK_LP query_expression NK_RP */ + 474, /* (624) subquery ::= NK_LP subquery NK_RP */ + 363, /* (625) search_condition ::= common_expression */ + 502, /* (626) sort_specification_list ::= sort_specification */ + 502, /* (627) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 503, /* (628) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 504, /* (629) ordering_specification_opt ::= */ + 504, /* (630) ordering_specification_opt ::= ASC */ + 504, /* (631) ordering_specification_opt ::= DESC */ + 505, /* (632) null_ordering_opt ::= */ + 505, /* (633) null_ordering_opt ::= NULLS FIRST */ + 505, /* (634) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4516,65 +4525,68 @@ static const signed char yyRuleInfoNRhs[] = { -2, /* (570) partition_item ::= expr_or_subquery column_alias */ -3, /* (571) partition_item ::= expr_or_subquery AS column_alias */ 0, /* (572) twindow_clause_opt ::= */ - -6, /* (573) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + -6, /* (573) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -4, /* (574) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (575) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (576) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + -6, /* (575) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (576) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -7, /* (577) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ 0, /* (578) sliding_opt ::= */ - -4, /* (579) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 0, /* (580) fill_opt ::= */ - -4, /* (581) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (582) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (583) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (584) fill_mode ::= NONE */ - -1, /* (585) fill_mode ::= PREV */ - -1, /* (586) fill_mode ::= NULL */ - -1, /* (587) fill_mode ::= NULL_F */ - -1, /* (588) fill_mode ::= LINEAR */ - -1, /* (589) fill_mode ::= NEXT */ - 0, /* (590) group_by_clause_opt ::= */ - -3, /* (591) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (592) group_by_list ::= expr_or_subquery */ - -3, /* (593) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (594) having_clause_opt ::= */ - -2, /* (595) having_clause_opt ::= HAVING search_condition */ - 0, /* (596) range_opt ::= */ - -6, /* (597) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (598) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (599) every_opt ::= */ - -4, /* (600) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (601) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (602) query_simple ::= query_specification */ - -1, /* (603) query_simple ::= union_query_expression */ - -4, /* (604) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (605) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (606) query_simple_or_subquery ::= query_simple */ - -1, /* (607) query_simple_or_subquery ::= subquery */ - -1, /* (608) query_or_subquery ::= query_expression */ - -1, /* (609) query_or_subquery ::= subquery */ - 0, /* (610) order_by_clause_opt ::= */ - -3, /* (611) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (612) slimit_clause_opt ::= */ - -2, /* (613) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (614) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (615) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (616) limit_clause_opt ::= */ - -2, /* (617) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (618) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (619) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (620) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (621) subquery ::= NK_LP subquery NK_RP */ - -1, /* (622) search_condition ::= common_expression */ - -1, /* (623) sort_specification_list ::= sort_specification */ - -3, /* (624) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (625) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (626) ordering_specification_opt ::= */ - -1, /* (627) ordering_specification_opt ::= ASC */ - -1, /* (628) ordering_specification_opt ::= DESC */ - 0, /* (629) null_ordering_opt ::= */ - -2, /* (630) null_ordering_opt ::= NULLS FIRST */ - -2, /* (631) null_ordering_opt ::= NULLS LAST */ + -4, /* (579) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (580) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (581) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (582) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (583) fill_opt ::= */ + -4, /* (584) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (585) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (586) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (587) fill_mode ::= NONE */ + -1, /* (588) fill_mode ::= PREV */ + -1, /* (589) fill_mode ::= NULL */ + -1, /* (590) fill_mode ::= NULL_F */ + -1, /* (591) fill_mode ::= LINEAR */ + -1, /* (592) fill_mode ::= NEXT */ + 0, /* (593) group_by_clause_opt ::= */ + -3, /* (594) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (595) group_by_list ::= expr_or_subquery */ + -3, /* (596) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (597) having_clause_opt ::= */ + -2, /* (598) having_clause_opt ::= HAVING search_condition */ + 0, /* (599) range_opt ::= */ + -6, /* (600) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (601) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (602) every_opt ::= */ + -4, /* (603) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (604) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (605) query_simple ::= query_specification */ + -1, /* (606) query_simple ::= union_query_expression */ + -4, /* (607) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (608) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (609) query_simple_or_subquery ::= query_simple */ + -1, /* (610) query_simple_or_subquery ::= subquery */ + -1, /* (611) query_or_subquery ::= query_expression */ + -1, /* (612) query_or_subquery ::= subquery */ + 0, /* (613) order_by_clause_opt ::= */ + -3, /* (614) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (615) slimit_clause_opt ::= */ + -2, /* (616) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (617) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (618) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (619) limit_clause_opt ::= */ + -2, /* (620) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (621) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (622) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (623) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (624) subquery ::= NK_LP subquery NK_RP */ + -1, /* (625) search_condition ::= common_expression */ + -1, /* (626) sort_specification_list ::= sort_specification */ + -3, /* (627) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (628) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (629) ordering_specification_opt ::= */ + -1, /* (630) ordering_specification_opt ::= ASC */ + -1, /* (631) ordering_specification_opt ::= DESC */ + 0, /* (632) null_ordering_opt ::= */ + -2, /* (633) null_ordering_opt ::= NULLS FIRST */ + -2, /* (634) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4714,15 +4726,15 @@ static YYACTIONTYPE yy_reduce( yy_destructor(yypParser,348,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy844 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy844 = yymsp[0].minor.yy844; } +{ yymsp[-1].minor.yy332 = yymsp[0].minor.yy332; } break; case 27: /* white_list_opt ::= */ case 185: /* specific_cols_opt ::= */ yytestcase(yyruleno==185); @@ -4731,92 +4743,92 @@ static YYACTIONTYPE yy_reduce( case 365: /* col_list_opt ::= */ yytestcase(yyruleno==365); case 367: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==367); case 565: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==565); - case 590: /* group_by_clause_opt ::= */ yytestcase(yyruleno==590); - case 610: /* order_by_clause_opt ::= */ yytestcase(yyruleno==610); -{ yymsp[1].minor.yy844 = NULL; } + case 593: /* group_by_clause_opt ::= */ yytestcase(yyruleno==593); + case 613: /* order_by_clause_opt ::= */ yytestcase(yyruleno==613); +{ yymsp[1].minor.yy332 = NULL; } break; case 28: /* white_list_opt ::= white_list */ case 217: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==217); case 368: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==368); case 490: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==490); -{ yylhsminor.yy844 = yymsp[0].minor.yy844; } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = yymsp[0].minor.yy332; } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy129, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy313); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy844); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy481, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy751); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy332); } break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy481, 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.yy129, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy481, 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.yy129, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy481, 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.yy129, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy844); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy481, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy332); } break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy844); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy481, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy332); } break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy481); } break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy313 = 1; } +{ yymsp[1].minor.yy751 = 1; } break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy313 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy751 = 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.yy479, &yymsp[-3].minor.yy767, &yymsp[0].minor.yy129, yymsp[-2].minor.yy452); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy41, &yymsp[-3].minor.yy49, &yymsp[0].minor.yy481, yymsp[-2].minor.yy476); } break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy479, &yymsp[-3].minor.yy767, &yymsp[0].minor.yy129, yymsp[-2].minor.yy452); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy41, &yymsp[-3].minor.yy49, &yymsp[0].minor.yy481, yymsp[-2].minor.yy476); } break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy479 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy41 = PRIVILEGE_TYPE_ALL; } break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy479 = yymsp[0].minor.yy479; } - yymsp[0].minor.yy479 = yylhsminor.yy479; +{ yylhsminor.yy41 = yymsp[0].minor.yy41; } + yymsp[0].minor.yy41 = yylhsminor.yy41; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy479 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy41 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy479 = yymsp[-2].minor.yy479 | yymsp[0].minor.yy479; } - yymsp[-2].minor.yy479 = yylhsminor.yy479; +{ yylhsminor.yy41 = yymsp[-2].minor.yy41 | yymsp[0].minor.yy41; } + yymsp[-2].minor.yy41 = yylhsminor.yy41; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy479 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy41 = PRIVILEGE_TYPE_READ; } break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy479 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy41 = PRIVILEGE_TYPE_WRITE; } break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy479 = PRIVILEGE_TYPE_ALTER; } +{ yymsp[0].minor.yy41 = PRIVILEGE_TYPE_ALTER; } break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy767.first = yymsp[-2].minor.yy0; yylhsminor.yy767.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy767 = yylhsminor.yy767; +{ yylhsminor.yy49.first = yymsp[-2].minor.yy0; yylhsminor.yy49.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy49 = yylhsminor.yy49; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy767.first = yymsp[-2].minor.yy129; yylhsminor.yy767.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy767 = yylhsminor.yy767; +{ yylhsminor.yy49.first = yymsp[-2].minor.yy481; yylhsminor.yy49.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy49 = yylhsminor.yy49; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy767.first = yymsp[-2].minor.yy129; yylhsminor.yy767.second = yymsp[0].minor.yy129; } - yymsp[-2].minor.yy767 = yylhsminor.yy767; +{ yylhsminor.yy49.first = yymsp[-2].minor.yy481; yylhsminor.yy49.second = yymsp[0].minor.yy481; } + yymsp[-2].minor.yy49 = yylhsminor.yy49; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy767.first = yymsp[0].minor.yy129; yylhsminor.yy767.second = nil_token; } - yymsp[0].minor.yy767 = yylhsminor.yy767; +{ yylhsminor.yy49.first = yymsp[0].minor.yy481; yylhsminor.yy49.second = nil_token; } + yymsp[0].minor.yy49 = yylhsminor.yy49; break; case 52: /* with_opt ::= */ case 154: /* start_opt ::= */ yytestcase(yyruleno==154); @@ -4828,37 +4840,37 @@ static YYACTIONTYPE yy_reduce( case 563: /* where_clause_opt ::= */ yytestcase(yyruleno==563); case 572: /* twindow_clause_opt ::= */ yytestcase(yyruleno==572); case 578: /* sliding_opt ::= */ yytestcase(yyruleno==578); - case 580: /* fill_opt ::= */ yytestcase(yyruleno==580); - case 594: /* having_clause_opt ::= */ yytestcase(yyruleno==594); - case 596: /* range_opt ::= */ yytestcase(yyruleno==596); - case 599: /* every_opt ::= */ yytestcase(yyruleno==599); - case 612: /* slimit_clause_opt ::= */ yytestcase(yyruleno==612); - case 616: /* limit_clause_opt ::= */ yytestcase(yyruleno==616); -{ yymsp[1].minor.yy452 = NULL; } + case 583: /* fill_opt ::= */ yytestcase(yyruleno==583); + case 597: /* having_clause_opt ::= */ yytestcase(yyruleno==597); + case 599: /* range_opt ::= */ yytestcase(yyruleno==599); + case 602: /* every_opt ::= */ yytestcase(yyruleno==602); + case 615: /* slimit_clause_opt ::= */ yytestcase(yyruleno==615); + case 619: /* limit_clause_opt ::= */ yytestcase(yyruleno==619); +{ yymsp[1].minor.yy476 = NULL; } break; case 53: /* with_opt ::= WITH search_condition */ case 531: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==531); case 564: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==564); - case 595: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==595); -{ yymsp[-1].minor.yy452 = yymsp[0].minor.yy452; } + case 598: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==598); +{ yymsp[-1].minor.yy476 = yymsp[0].minor.yy476; } break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy481, NULL); } break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy481, &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.yy137, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy977, false); } break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy137, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy481, yymsp[0].minor.yy977, false); } break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy137); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy977); } break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy129, false, yymsp[0].minor.yy137); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy481, false, yymsp[0].minor.yy977); } break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -4907,8 +4919,8 @@ static YYACTIONTYPE yy_reduce( case 486: /* star_func ::= FIRST */ yytestcase(yyruleno==486); case 487: /* star_func ::= LAST */ yytestcase(yyruleno==487); case 488: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==488); -{ yylhsminor.yy129 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy129 = yylhsminor.yy129; +{ yylhsminor.yy481 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy481 = yylhsminor.yy481; break; case 68: /* force_opt ::= */ case 92: /* not_exists_opt ::= */ yytestcase(yyruleno==92); @@ -4919,7 +4931,7 @@ static YYACTIONTYPE yy_reduce( case 381: /* ignore_opt ::= */ yytestcase(yyruleno==381); case 551: /* tag_mode_opt ::= */ yytestcase(yyruleno==551); case 553: /* set_quantifier_opt ::= */ yytestcase(yyruleno==553); -{ yymsp[1].minor.yy137 = false; } +{ yymsp[1].minor.yy977 = false; } break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); @@ -4927,7 +4939,7 @@ static YYACTIONTYPE yy_reduce( case 350: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==350); case 552: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==552); case 554: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==554); -{ yymsp[0].minor.yy137 = true; } +{ yymsp[0].minor.yy977 = true; } break; case 71: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -4969,241 +4981,241 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; case 84: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy137, &yymsp[-1].minor.yy129, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy977, &yymsp[-1].minor.yy481, yymsp[0].minor.yy476); } break; case 85: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 86: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy481); } break; case 87: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy481, yymsp[0].minor.yy476); } break; case 88: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy481); } break; case 89: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy710); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy481, yymsp[0].minor.yy156); } break; case 90: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy129, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy481, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 91: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy137 = true; } +{ yymsp[-2].minor.yy977 = true; } break; case 93: /* exists_opt ::= IF EXISTS */ case 356: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==356); case 382: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==382); -{ yymsp[-1].minor.yy137 = true; } +{ yymsp[-1].minor.yy977 = true; } break; case 95: /* db_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy476 = createDefaultDatabaseOptions(pCxt); } break; case 96: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 97: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 98: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 99: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 100: /* db_options ::= db_options DURATION NK_INTEGER */ case 101: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==101); -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 102: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 103: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 104: /* db_options ::= db_options KEEP integer_list */ case 105: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==105); -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP, yymsp[0].minor.yy844); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_KEEP, yymsp[0].minor.yy332); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 106: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 107: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 108: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 109: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 110: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 111: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 112: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 113: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_RETENTIONS, yymsp[0].minor.yy844); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_RETENTIONS, yymsp[0].minor.yy332); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 114: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 115: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 116: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 117: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 118: /* 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.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-3].minor.yy476, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 119: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 120: /* 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.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-3].minor.yy476, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 121: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 122: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 123: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 124: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy476); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 125: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy476); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 126: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setDatabaseOption(pCxt, yymsp[-2].minor.yy476, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 127: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy452 = createAlterDatabaseOptions(pCxt); yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yylhsminor.yy452, &yymsp[0].minor.yy335); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterDatabaseOptions(pCxt); yylhsminor.yy476 = setAlterDatabaseOption(pCxt, yylhsminor.yy476, &yymsp[0].minor.yy189); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 128: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy452, &yymsp[0].minor.yy335); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy476, &yymsp[0].minor.yy189); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 129: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 130: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 131: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 133: /* alter_db_option ::= KEEP integer_list */ case 134: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==134); -{ yymsp[-1].minor.yy335.type = DB_OPTION_KEEP; yymsp[-1].minor.yy335.pList = yymsp[0].minor.yy844; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_KEEP; yymsp[-1].minor.yy189.pList = yymsp[0].minor.yy332; } break; case 135: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_PAGES; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_PAGES; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 136: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 137: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_WAL; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_WAL; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 138: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 139: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 140: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 141: /* 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.yy335.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy335.val = t; + yymsp[-2].minor.yy189.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy189.val = t; } break; case 142: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 143: /* 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.yy335.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy335.val = t; + yymsp[-2].minor.yy189.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy189.val = t; } break; case 144: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 145: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy844 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 146: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 394: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==394); -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; case 147: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy844 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 148: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; case 149: /* retention_list ::= retention */ case 179: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==179); @@ -5218,9 +5230,9 @@ static YYACTIONTYPE yy_reduce( case 497: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==497); case 556: /* select_list ::= select_item */ yytestcase(yyruleno==556); case 567: /* partition_list ::= partition_item */ yytestcase(yyruleno==567); - case 623: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==623); -{ yylhsminor.yy844 = createNodeList(pCxt, yymsp[0].minor.yy452); } - yymsp[0].minor.yy844 = yylhsminor.yy844; + case 626: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==626); +{ yylhsminor.yy332 = createNodeList(pCxt, yymsp[0].minor.yy476); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 150: /* retention_list ::= retention_list NK_COMMA retention */ case 183: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==183); @@ -5233,267 +5245,267 @@ static YYACTIONTYPE yy_reduce( case 492: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==492); case 557: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==557); case 568: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==568); - case 624: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==624); -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; + case 627: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==627); +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, yymsp[0].minor.yy476); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; case 151: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy452 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 152: /* speed_opt ::= */ case 351: /* bufsize_opt ::= */ yytestcase(yyruleno==351); -{ yymsp[1].minor.yy710 = 0; } +{ yymsp[1].minor.yy156 = 0; } break; case 153: /* speed_opt ::= BWLIMIT NK_INTEGER */ case 352: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==352); -{ yymsp[-1].minor.yy710 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy156 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 155: /* start_opt ::= START WITH NK_INTEGER */ case 159: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==159); -{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 156: /* start_opt ::= START WITH NK_STRING */ case 160: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==160); -{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 157: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 161: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==161); -{ yymsp[-3].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-3].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 162: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 164: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==164); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy137, yymsp[-5].minor.yy452, yymsp[-3].minor.yy844, yymsp[-1].minor.yy844, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy977, yymsp[-5].minor.yy476, yymsp[-3].minor.yy332, yymsp[-1].minor.yy332, yymsp[0].minor.yy476); } break; case 163: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy844); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy332); } break; case 165: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy844); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy332); } break; case 166: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy977, yymsp[0].minor.yy476); } break; case 167: /* cmd ::= ALTER TABLE alter_table_clause */ case 396: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==396); case 397: /* cmd ::= insert_query */ yytestcase(yyruleno==397); -{ pCxt->pRootNode = yymsp[0].minor.yy452; } +{ pCxt->pRootNode = yymsp[0].minor.yy476; } break; case 168: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy452); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy476); } break; case 169: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy452 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 170: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy129, yymsp[0].minor.yy794); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy481, yymsp[0].minor.yy752); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 171: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy476, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy481); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 172: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy794); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy481, yymsp[0].minor.yy752); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 173: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 174: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy129, yymsp[0].minor.yy794); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy481, yymsp[0].minor.yy752); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 175: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy476, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy481); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 176: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy794); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy481, yymsp[0].minor.yy752); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 177: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy476, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 178: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy452 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy452, &yymsp[-2].minor.yy129, yymsp[0].minor.yy452); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy476, &yymsp[-2].minor.yy481, yymsp[0].minor.yy476); } + yymsp[-5].minor.yy476 = yylhsminor.yy476; break; case 180: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 498: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==498); -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-1].minor.yy844, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-1].minor.yy332, yymsp[0].minor.yy476); } + yymsp[-1].minor.yy332 = yylhsminor.yy332; break; case 181: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy452 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy137, yymsp[-8].minor.yy452, yymsp[-6].minor.yy452, yymsp[-5].minor.yy844, yymsp[-2].minor.yy844, yymsp[0].minor.yy452); } - yymsp[-9].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy977, yymsp[-8].minor.yy476, yymsp[-6].minor.yy476, yymsp[-5].minor.yy332, yymsp[-2].minor.yy332, yymsp[0].minor.yy476); } + yymsp[-9].minor.yy476 = yylhsminor.yy476; break; case 184: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy452 = createDropTableClause(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createDropTableClause(pCxt, yymsp[-1].minor.yy977, yymsp[0].minor.yy476); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 186: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ case 366: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==366); -{ yymsp[-2].minor.yy844 = yymsp[-1].minor.yy844; } +{ yymsp[-2].minor.yy332 = yymsp[-1].minor.yy332; } break; case 187: /* full_table_name ::= table_name */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy481, NULL); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 188: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNode(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481, NULL); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 191: /* column_def ::= column_name type_name */ -{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy794, NULL); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy481, yymsp[0].minor.yy752, NULL); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 192: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 193: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 194: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 195: /* type_name ::= INT */ case 196: /* type_name ::= INTEGER */ yytestcase(yyruleno==196); -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_INT); } break; case 197: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 198: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 199: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 200: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy752 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 201: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 202: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy752 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 203: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy752 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 204: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy752 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 205: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy752 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 206: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy794 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy752 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 207: /* type_name ::= JSON */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 208: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy752 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 209: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 210: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 211: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy752 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 212: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy752 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; case 213: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy752 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 214: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy752 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 215: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy794 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy752 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 218: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ case 369: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==369); -{ yymsp[-3].minor.yy844 = yymsp[-1].minor.yy844; } +{ yymsp[-3].minor.yy332 = yymsp[-1].minor.yy332; } break; case 219: /* table_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy476 = createDefaultTableOptions(pCxt); } break; case 220: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-2].minor.yy476, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 221: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy844); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-2].minor.yy476, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy332); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 222: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy844); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-2].minor.yy476, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy332); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 223: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy844); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-4].minor.yy476, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy332); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 224: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-2].minor.yy476, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 225: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_SMA, yymsp[-1].minor.yy844); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-4].minor.yy476, TABLE_OPTION_SMA, yymsp[-1].minor.yy332); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 226: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy844); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-2].minor.yy476, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy332); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 227: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy452 = createAlterTableOptions(pCxt); yylhsminor.yy452 = setTableOption(pCxt, yylhsminor.yy452, yymsp[0].minor.yy335.type, &yymsp[0].minor.yy335.val); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createAlterTableOptions(pCxt); yylhsminor.yy476 = setTableOption(pCxt, yylhsminor.yy476, yymsp[0].minor.yy189.type, &yymsp[0].minor.yy189.val); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 228: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy335.type, &yymsp[0].minor.yy335.val); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setTableOption(pCxt, yymsp[-1].minor.yy476, yymsp[0].minor.yy189.type, &yymsp[0].minor.yy189.val); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 229: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy335.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 230: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy335.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy335.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy189.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } break; case 231: /* duration_list ::= duration_literal */ case 454: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==454); -{ yylhsminor.yy844 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 232: /* duration_list ::= duration_list NK_COMMA duration_literal */ case 455: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==455); -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; case 235: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createFunctionNode(pCxt, &yymsp[0].minor.yy481, NULL); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 236: /* rollup_func_name ::= FIRST */ case 237: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==237); case 303: /* tag_item ::= QTAGS */ yytestcase(yyruleno==303); -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 240: /* col_name ::= column_name */ case 304: /* tag_item ::= column_name */ yytestcase(yyruleno==304); -{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy481); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 241: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -5507,19 +5519,19 @@ static YYACTIONTYPE yy_reduce( case 244: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy749); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy585); } break; case 245: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy217, yymsp[0].minor.yy452, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy729, yymsp[0].minor.yy476, OP_TYPE_LIKE); } break; case 246: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy476, yymsp[0].minor.yy476, OP_TYPE_LIKE); } break; case 247: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy452, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy476, NULL, OP_TYPE_LIKE); } break; case 248: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -5531,10 +5543,10 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 251: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy476, yymsp[-1].minor.yy476, OP_TYPE_EQUAL); } break; case 252: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy129), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129), OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy481), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy481), OP_TYPE_EQUAL); } break; case 253: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -5553,13 +5565,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; case 259: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy481); } break; case 260: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy476); } break; case 261: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy476); } break; case 262: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -5578,7 +5590,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; case 268: /* 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.yy452); } +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy476); } break; case 269: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } @@ -5593,7 +5605,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 273: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy476); } break; case 274: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -5602,16 +5614,16 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 276: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy476, yymsp[-1].minor.yy476, OP_TYPE_EQUAL); } break; case 277: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy129), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129), OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy481), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy481), OP_TYPE_EQUAL); } break; case 278: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452, yymsp[-3].minor.yy844); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy476, yymsp[0].minor.yy476, yymsp[-3].minor.yy332); } break; case 279: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy129), yymsp[-4].minor.yy844); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy481), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy481), yymsp[-4].minor.yy332); } break; case 280: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } @@ -5620,244 +5632,244 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; case 282: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy452, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy476, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; case 283: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; case 284: /* cmd ::= SHOW db_name_cond_opt VIEWS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-1].minor.yy452, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-1].minor.yy476, NULL, OP_TYPE_LIKE); } break; case 285: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy476); } break; case 286: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy217.kind = SHOW_KIND_ALL; yymsp[1].minor.yy217.dbName = nil_token; } +{ yymsp[1].minor.yy729.kind = SHOW_KIND_ALL; yymsp[1].minor.yy729.dbName = nil_token; } break; case 287: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy217.kind = yymsp[0].minor.yy749; yylhsminor.yy217.dbName = nil_token; } - yymsp[0].minor.yy217 = yylhsminor.yy217; +{ yylhsminor.yy729.kind = yymsp[0].minor.yy585; yylhsminor.yy729.dbName = nil_token; } + yymsp[0].minor.yy729 = yylhsminor.yy729; break; case 288: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy217.kind = SHOW_KIND_ALL; yylhsminor.yy217.dbName = yymsp[-1].minor.yy129; } - yymsp[-1].minor.yy217 = yylhsminor.yy217; +{ yylhsminor.yy729.kind = SHOW_KIND_ALL; yylhsminor.yy729.dbName = yymsp[-1].minor.yy481; } + yymsp[-1].minor.yy729 = yylhsminor.yy729; break; case 289: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy217.kind = yymsp[-2].minor.yy749; yylhsminor.yy217.dbName = yymsp[-1].minor.yy129; } - yymsp[-2].minor.yy217 = yylhsminor.yy217; +{ yylhsminor.yy729.kind = yymsp[-2].minor.yy585; yylhsminor.yy729.dbName = yymsp[-1].minor.yy481; } + yymsp[-2].minor.yy729 = yylhsminor.yy729; break; case 290: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy749 = SHOW_KIND_TABLES_NORMAL; } +{ yymsp[0].minor.yy585 = SHOW_KIND_TABLES_NORMAL; } break; case 291: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy749 = SHOW_KIND_TABLES_CHILD; } +{ yymsp[0].minor.yy585 = SHOW_KIND_TABLES_CHILD; } break; case 292: /* db_name_cond_opt ::= */ case 297: /* from_db_opt ::= */ yytestcase(yyruleno==297); -{ yymsp[1].minor.yy452 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy476 = createDefaultDatabaseCondValue(pCxt); } break; case 293: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy129); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy481); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 295: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 296: /* table_name_cond ::= table_name */ -{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy481); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 298: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129); } +{ yymsp[-1].minor.yy476 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy481); } break; case 302: /* tag_item ::= TBNAME */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 305: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy129), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy481), &yymsp[0].minor.yy481); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 306: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy129), &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy481), &yymsp[0].minor.yy481); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 307: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy749 = SHOW_KIND_ALL; } +{ yymsp[1].minor.yy585 = SHOW_KIND_ALL; } break; case 308: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy749 = SHOW_KIND_DATABASES_USER; } +{ yymsp[0].minor.yy585 = SHOW_KIND_DATABASES_USER; } break; case 309: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy749 = SHOW_KIND_DATABASES_SYSTEM; } +{ yymsp[0].minor.yy585 = SHOW_KIND_DATABASES_SYSTEM; } break; case 310: /* 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.yy137, yymsp[-3].minor.yy452, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy977, yymsp[-3].minor.yy476, yymsp[-1].minor.yy476, NULL, yymsp[0].minor.yy476); } break; case 311: /* 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.yy137, yymsp[-5].minor.yy452, yymsp[-3].minor.yy452, yymsp[-1].minor.yy844, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy977, yymsp[-5].minor.yy476, yymsp[-3].minor.yy476, yymsp[-1].minor.yy332, NULL); } break; case 312: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy977, yymsp[0].minor.yy476); } break; case 313: /* full_index_name ::= index_name */ -{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy481); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 314: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 315: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy452 = createIndexOption(pCxt, yymsp[-7].minor.yy844, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } +{ yymsp[-9].minor.yy476 = createIndexOption(pCxt, yymsp[-7].minor.yy332, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), NULL, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 316: /* 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.yy452 = createIndexOption(pCxt, yymsp[-9].minor.yy844, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } +{ yymsp[-11].minor.yy476 = createIndexOption(pCxt, yymsp[-9].minor.yy332, releaseRawExprNode(pCxt, yymsp[-5].minor.yy476), releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 319: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy844); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createFunctionNode(pCxt, &yymsp[-3].minor.yy481, yymsp[-1].minor.yy332); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 320: /* sma_func_name ::= function_name */ case 541: /* alias_opt ::= table_alias */ yytestcase(yyruleno==541); -{ yylhsminor.yy129 = yymsp[0].minor.yy129; } - yymsp[0].minor.yy129 = yylhsminor.yy129; +{ yylhsminor.yy481 = yymsp[0].minor.yy481; } + yymsp[0].minor.yy481 = yylhsminor.yy481; break; case 325: /* sma_stream_opt ::= */ case 370: /* stream_options ::= */ yytestcase(yyruleno==370); -{ yymsp[1].minor.yy452 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy476 = createStreamOptions(pCxt); } break; case 326: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ ((SStreamOptions*)yymsp[-2].minor.yy476)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy476); yylhsminor.yy476 = yymsp[-2].minor.yy476; } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 327: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ ((SStreamOptions*)yymsp[-2].minor.yy476)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy476); yylhsminor.yy476 = yymsp[-2].minor.yy476; } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 328: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ ((SStreamOptions*)yymsp[-2].minor.yy476)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy476); yylhsminor.yy476 = yymsp[-2].minor.yy476; } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 329: /* with_meta ::= AS */ -{ yymsp[0].minor.yy710 = 0; } +{ yymsp[0].minor.yy156 = 0; } break; case 330: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy710 = 1; } +{ yymsp[-2].minor.yy156 = 1; } break; case 331: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy710 = 2; } +{ yymsp[-2].minor.yy156 = 2; } break; case 332: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy137, &yymsp[-2].minor.yy129, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy977, &yymsp[-2].minor.yy481, yymsp[0].minor.yy476); } break; case 333: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy137, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy129, yymsp[-2].minor.yy710); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy977, &yymsp[-3].minor.yy481, &yymsp[0].minor.yy481, yymsp[-2].minor.yy156); } break; case 334: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy137, &yymsp[-4].minor.yy129, yymsp[-1].minor.yy452, yymsp[-3].minor.yy710, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy977, &yymsp[-4].minor.yy481, yymsp[-1].minor.yy476, yymsp[-3].minor.yy156, yymsp[0].minor.yy476); } break; case 335: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 336: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy137, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy977, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481); } break; case 337: /* cmd ::= DESC full_table_name */ case 338: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==338); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy476); } break; case 339: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 340: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ case 341: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==341); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy137, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy977, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 344: /* explain_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy476 = createDefaultExplainOptions(pCxt); } break; case 345: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy452 = setExplainVerbose(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setExplainVerbose(pCxt, yymsp[-2].minor.yy476, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 346: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy452 = setExplainRatio(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setExplainRatio(pCxt, yymsp[-2].minor.yy476, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 347: /* 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.yy137, yymsp[-9].minor.yy137, &yymsp[-6].minor.yy129, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy794, yymsp[-1].minor.yy710, &yymsp[0].minor.yy129, yymsp[-10].minor.yy137); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy977, yymsp[-9].minor.yy977, &yymsp[-6].minor.yy481, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy752, yymsp[-1].minor.yy156, &yymsp[0].minor.yy481, yymsp[-10].minor.yy977); } break; case 348: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 353: /* language_opt ::= */ case 391: /* on_vgroup_id ::= */ yytestcase(yyruleno==391); -{ yymsp[1].minor.yy129 = nil_token; } +{ yymsp[1].minor.yy481 = nil_token; } break; case 354: /* language_opt ::= LANGUAGE NK_STRING */ case 392: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==392); -{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy481 = yymsp[0].minor.yy0; } break; case 357: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy137, yymsp[-2].minor.yy452, &yymsp[-1].minor.yy0, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy977, yymsp[-2].minor.yy476, &yymsp[-1].minor.yy0, yymsp[0].minor.yy476); } break; case 358: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy977, yymsp[0].minor.yy476); } break; case 359: /* full_view_name ::= view_name */ -{ yylhsminor.yy452 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy481); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 360: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy452 = createViewNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createViewNode(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 361: /* 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.yy137, &yymsp[-8].minor.yy129, yymsp[-5].minor.yy452, yymsp[-7].minor.yy452, yymsp[-3].minor.yy844, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, yymsp[-4].minor.yy844); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy977, &yymsp[-8].minor.yy481, yymsp[-5].minor.yy476, yymsp[-7].minor.yy476, yymsp[-3].minor.yy332, yymsp[-2].minor.yy476, yymsp[0].minor.yy476, yymsp[-4].minor.yy332); } break; case 362: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 363: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 364: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy137, yymsp[-1].minor.yy137, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy977, yymsp[-1].minor.yy977, &yymsp[0].minor.yy481); } break; case 371: /* stream_options ::= stream_options TRIGGER AT_ONCE */ case 372: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==372); -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-2].minor.yy476, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 373: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-3].minor.yy476, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 374: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-2].minor.yy476, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 375: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-3].minor.yy476, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 376: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-2].minor.yy476, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 377: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-2].minor.yy476, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 378: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setStreamOptions(pCxt, yymsp[-3].minor.yy476, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 380: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 579: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==579); - case 600: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==600); -{ yymsp[-3].minor.yy452 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy452); } + case 579: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==579); + case 603: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==603); +{ yymsp[-3].minor.yy476 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy476); } break; case 383: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } @@ -5872,48 +5884,48 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; case 387: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy481); } break; case 388: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; case 389: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy844); } +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy332); } break; case 390: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; case 393: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy844 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +{ yymsp[-1].minor.yy332 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 395: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 398: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy452 = createInsertStmt(pCxt, yymsp[-4].minor.yy452, yymsp[-2].minor.yy844, yymsp[0].minor.yy452); } +{ yymsp[-6].minor.yy476 = createInsertStmt(pCxt, yymsp[-4].minor.yy476, yymsp[-2].minor.yy332, yymsp[0].minor.yy476); } break; case 399: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy452 = createInsertStmt(pCxt, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); } +{ yymsp[-3].minor.yy476 = createInsertStmt(pCxt, yymsp[-1].minor.yy476, NULL, yymsp[0].minor.yy476); } break; case 400: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 401: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 402: /* literal ::= NK_STRING */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 403: /* literal ::= NK_BOOL */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 404: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 405: /* literal ::= duration_literal */ case 415: /* signed_literal ::= signed */ yytestcase(yyruleno==415); @@ -5931,179 +5943,182 @@ static YYACTIONTYPE yy_reduce( case 534: /* table_reference ::= table_primary */ yytestcase(yyruleno==534); case 535: /* table_reference ::= joined_table */ yytestcase(yyruleno==535); case 539: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==539); - case 602: /* query_simple ::= query_specification */ yytestcase(yyruleno==602); - case 603: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==603); - case 606: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==606); - case 608: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==608); -{ yylhsminor.yy452 = yymsp[0].minor.yy452; } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 605: /* query_simple ::= query_specification */ yytestcase(yyruleno==605); + case 606: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==606); + case 609: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==609); + case 611: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==611); +{ yylhsminor.yy476 = yymsp[0].minor.yy476; } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 406: /* literal ::= NULL */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 407: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 408: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 580: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==580); + case 581: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==581); + case 582: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==582); +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 409: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 410: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; case 411: /* 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.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 412: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 413: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; case 414: /* 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.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 416: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 417: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 418: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 419: /* signed_literal ::= duration_literal */ case 421: /* signed_literal ::= literal_func */ yytestcase(yyruleno==421); case 493: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==493); case 559: /* select_item ::= common_expression */ yytestcase(yyruleno==559); case 569: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==569); - case 607: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==607); - case 609: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==609); - case 622: /* search_condition ::= common_expression */ yytestcase(yyruleno==622); -{ yylhsminor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 610: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==610); + case 612: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==612); + case 625: /* search_condition ::= common_expression */ yytestcase(yyruleno==625); +{ yylhsminor.yy476 = releaseRawExprNode(pCxt, yymsp[0].minor.yy476); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 420: /* signed_literal ::= NULL */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 422: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy452 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 439: /* expression ::= pseudo_column */ -{ yylhsminor.yy452 = yymsp[0].minor.yy452; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy452, true); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = yymsp[0].minor.yy476; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy476, true); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 443: /* expression ::= NK_LP expression NK_RP */ case 527: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==527); - case 621: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==621); -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 624: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==624); +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy476)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 444: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 445: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy476), NULL)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 446: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 447: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 448: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 449: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 450: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 451: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 452: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 453: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 456: /* column_reference ::= column_name */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy481, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy481)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 457: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481, createColumnNode(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy481)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 458: /* pseudo_column ::= ROWTS */ case 459: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==459); @@ -6117,342 +6132,342 @@ static YYACTIONTYPE yy_reduce( case 468: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==468); case 469: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==469); case 475: /* literal_func ::= NOW */ yytestcase(yyruleno==475); -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 460: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy129)))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy481)))); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 470: /* function_expression ::= function_name NK_LP expression_list NK_RP */ case 471: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==471); -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy844)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy481, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy481, yymsp[-1].minor.yy332)); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 472: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy794)); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), yymsp[-1].minor.yy752)); } + yymsp[-5].minor.yy476 = yylhsminor.yy476; break; case 474: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy129, NULL)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy481, NULL)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 489: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy844 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 494: /* star_func_para ::= table_name NK_DOT NK_STAR */ case 562: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==562); -{ yylhsminor.yy452 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createColumnNode(pCxt, &yymsp[-2].minor.yy481, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 495: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy844, yymsp[-1].minor.yy452)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy332, yymsp[-1].minor.yy476)); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 496: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-2].minor.yy844, yymsp[-1].minor.yy452)); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), yymsp[-2].minor.yy332, yymsp[-1].minor.yy476)); } + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 499: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy452 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } +{ yymsp[-3].minor.yy476 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476)); } break; case 501: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); } +{ yymsp[-1].minor.yy476 = releaseRawExprNode(pCxt, yymsp[0].minor.yy476); } break; case 502: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ case 507: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==507); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy750, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy436, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 503: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy476), releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + yymsp[-4].minor.yy476 = yylhsminor.yy476; break; case 504: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy476), releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; + yymsp[-5].minor.yy476 = yylhsminor.yy476; break; case 505: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), NULL)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 506: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), NULL)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 508: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy750 = OP_TYPE_LOWER_THAN; } +{ yymsp[0].minor.yy436 = OP_TYPE_LOWER_THAN; } break; case 509: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy750 = OP_TYPE_GREATER_THAN; } +{ yymsp[0].minor.yy436 = OP_TYPE_GREATER_THAN; } break; case 510: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy750 = OP_TYPE_LOWER_EQUAL; } +{ yymsp[0].minor.yy436 = OP_TYPE_LOWER_EQUAL; } break; case 511: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy750 = OP_TYPE_GREATER_EQUAL; } +{ yymsp[0].minor.yy436 = OP_TYPE_GREATER_EQUAL; } break; case 512: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy750 = OP_TYPE_NOT_EQUAL; } +{ yymsp[0].minor.yy436 = OP_TYPE_NOT_EQUAL; } break; case 513: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy750 = OP_TYPE_EQUAL; } +{ yymsp[0].minor.yy436 = OP_TYPE_EQUAL; } break; case 514: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy750 = OP_TYPE_LIKE; } +{ yymsp[0].minor.yy436 = OP_TYPE_LIKE; } break; case 515: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy750 = OP_TYPE_NOT_LIKE; } +{ yymsp[-1].minor.yy436 = OP_TYPE_NOT_LIKE; } break; case 516: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy750 = OP_TYPE_MATCH; } +{ yymsp[0].minor.yy436 = OP_TYPE_MATCH; } break; case 517: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy750 = OP_TYPE_NMATCH; } +{ yymsp[0].minor.yy436 = OP_TYPE_NMATCH; } break; case 518: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy750 = OP_TYPE_JSON_CONTAINS; } +{ yymsp[0].minor.yy436 = OP_TYPE_JSON_CONTAINS; } break; case 519: /* in_op ::= IN */ -{ yymsp[0].minor.yy750 = OP_TYPE_IN; } +{ yymsp[0].minor.yy436 = OP_TYPE_IN; } break; case 520: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy750 = OP_TYPE_NOT_IN; } +{ yymsp[-1].minor.yy436 = OP_TYPE_NOT_IN; } break; case 521: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy844)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy332)); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 523: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy476), NULL)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 524: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 525: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy476); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy476); + yylhsminor.yy476 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 533: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy452 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy476, yymsp[0].minor.yy476, NULL); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 536: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 537: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createRealTableNode(pCxt, &yymsp[-3].minor.yy481, &yymsp[-1].minor.yy481, &yymsp[0].minor.yy481); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; case 538: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy452 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy476), &yymsp[0].minor.yy481); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 540: /* alias_opt ::= */ -{ yymsp[1].minor.yy129 = nil_token; } +{ yymsp[1].minor.yy481 = nil_token; } break; case 542: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; } +{ yymsp[-1].minor.yy481 = yymsp[0].minor.yy481; } break; case 543: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ case 544: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==544); -{ yymsp[-2].minor.yy452 = yymsp[-1].minor.yy452; } +{ yymsp[-2].minor.yy476 = yymsp[-1].minor.yy476; } break; case 545: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy452 = createJoinTableNode(pCxt, yymsp[-4].minor.yy42, yymsp[-5].minor.yy452, yymsp[-2].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createJoinTableNode(pCxt, yymsp[-4].minor.yy333, yymsp[-5].minor.yy476, yymsp[-2].minor.yy476, yymsp[0].minor.yy476); } + yymsp[-5].minor.yy476 = yylhsminor.yy476; break; case 546: /* join_type ::= */ -{ yymsp[1].minor.yy42 = JOIN_TYPE_INNER; } +{ yymsp[1].minor.yy333 = JOIN_TYPE_INNER; } break; case 547: /* join_type ::= INNER */ -{ yymsp[0].minor.yy42 = JOIN_TYPE_INNER; } +{ yymsp[0].minor.yy333 = JOIN_TYPE_INNER; } break; case 548: /* 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.yy452 = createSelectStmt(pCxt, yymsp[-11].minor.yy137, yymsp[-9].minor.yy844, yymsp[-8].minor.yy452, yymsp[-12].minor.yy844); - yymsp[-13].minor.yy452 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy452, yymsp[-10].minor.yy137); - yymsp[-13].minor.yy452 = addWhereClause(pCxt, yymsp[-13].minor.yy452, yymsp[-7].minor.yy452); - yymsp[-13].minor.yy452 = addPartitionByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-6].minor.yy844); - yymsp[-13].minor.yy452 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy452, yymsp[-2].minor.yy452); - yymsp[-13].minor.yy452 = addGroupByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-1].minor.yy844); - yymsp[-13].minor.yy452 = addHavingClause(pCxt, yymsp[-13].minor.yy452, yymsp[0].minor.yy452); - yymsp[-13].minor.yy452 = addRangeClause(pCxt, yymsp[-13].minor.yy452, yymsp[-5].minor.yy452); - yymsp[-13].minor.yy452 = addEveryClause(pCxt, yymsp[-13].minor.yy452, yymsp[-4].minor.yy452); - yymsp[-13].minor.yy452 = addFillClause(pCxt, yymsp[-13].minor.yy452, yymsp[-3].minor.yy452); + yymsp[-13].minor.yy476 = createSelectStmt(pCxt, yymsp[-11].minor.yy977, yymsp[-9].minor.yy332, yymsp[-8].minor.yy476, yymsp[-12].minor.yy332); + yymsp[-13].minor.yy476 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy476, yymsp[-10].minor.yy977); + yymsp[-13].minor.yy476 = addWhereClause(pCxt, yymsp[-13].minor.yy476, yymsp[-7].minor.yy476); + yymsp[-13].minor.yy476 = addPartitionByClause(pCxt, yymsp[-13].minor.yy476, yymsp[-6].minor.yy332); + yymsp[-13].minor.yy476 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy476, yymsp[-2].minor.yy476); + yymsp[-13].minor.yy476 = addGroupByClause(pCxt, yymsp[-13].minor.yy476, yymsp[-1].minor.yy332); + yymsp[-13].minor.yy476 = addHavingClause(pCxt, yymsp[-13].minor.yy476, yymsp[0].minor.yy476); + yymsp[-13].minor.yy476 = addRangeClause(pCxt, yymsp[-13].minor.yy476, yymsp[-5].minor.yy476); + yymsp[-13].minor.yy476 = addEveryClause(pCxt, yymsp[-13].minor.yy476, yymsp[-4].minor.yy476); + yymsp[-13].minor.yy476 = addFillClause(pCxt, yymsp[-13].minor.yy476, yymsp[-3].minor.yy476); } break; case 549: /* hint_list ::= */ -{ yymsp[1].minor.yy844 = createHintNodeList(pCxt, NULL); } +{ yymsp[1].minor.yy332 = createHintNodeList(pCxt, NULL); } break; case 550: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy844 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy844 = yylhsminor.yy844; +{ yylhsminor.yy332 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; case 555: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy137 = false; } +{ yymsp[0].minor.yy977 = false; } break; case 558: /* select_item ::= NK_STAR */ -{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy476 = yylhsminor.yy476; break; case 560: /* select_item ::= common_expression column_alias */ case 570: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==570); -{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy476), &yymsp[0].minor.yy481); } + yymsp[-1].minor.yy476 = yylhsminor.yy476; break; case 561: /* select_item ::= common_expression AS column_alias */ case 571: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==571); -{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; +{ yylhsminor.yy476 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), &yymsp[0].minor.yy481); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; case 566: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 591: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==591); - case 611: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==611); -{ yymsp[-2].minor.yy844 = yymsp[0].minor.yy844; } + case 594: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==594); + case 614: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==614); +{ yymsp[-2].minor.yy332 = yymsp[0].minor.yy332; } break; - case 573: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy452 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 573: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy476 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), releaseRawExprNode(pCxt, yymsp[-1].minor.yy476)); } break; case 574: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy452 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } +{ yymsp[-3].minor.yy476 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy476)); } break; - case 575: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 575: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy476 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), NULL, yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; - case 576: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 576: /* 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.yy476 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy476), releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), yymsp[-1].minor.yy476, yymsp[0].minor.yy476); } break; case 577: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy452 = createEventWindowNode(pCxt, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); } +{ yymsp[-6].minor.yy476 = createEventWindowNode(pCxt, yymsp[-3].minor.yy476, yymsp[0].minor.yy476); } break; - case 581: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy452 = createFillNode(pCxt, yymsp[-1].minor.yy264, NULL); } + case 584: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy476 = createFillNode(pCxt, yymsp[-1].minor.yy30, NULL); } break; - case 582: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy844)); } + case 585: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy476 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy332)); } break; - case 583: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy844)); } + case 586: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy476 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy332)); } break; - case 584: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy264 = FILL_MODE_NONE; } + case 587: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy30 = FILL_MODE_NONE; } break; - case 585: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy264 = FILL_MODE_PREV; } + case 588: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy30 = FILL_MODE_PREV; } break; - case 586: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy264 = FILL_MODE_NULL; } + case 589: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy30 = FILL_MODE_NULL; } break; - case 587: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy264 = FILL_MODE_NULL_F; } + case 590: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy30 = FILL_MODE_NULL_F; } break; - case 588: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy264 = FILL_MODE_LINEAR; } + case 591: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy30 = FILL_MODE_LINEAR; } break; - case 589: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy264 = FILL_MODE_NEXT; } + case 592: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy30 = FILL_MODE_NEXT; } break; - case 592: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy844 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); } - yymsp[0].minor.yy844 = yylhsminor.yy844; + case 595: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy332 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } + yymsp[0].minor.yy332 = yylhsminor.yy332; break; - case 593: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy844 = addNodeToList(pCxt, yymsp[-2].minor.yy844, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); } - yymsp[-2].minor.yy844 = yylhsminor.yy844; + case 596: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy332 = addNodeToList(pCxt, yymsp[-2].minor.yy332, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy476))); } + yymsp[-2].minor.yy332 = yylhsminor.yy332; break; - case 597: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy452 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 600: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy476 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy476), releaseRawExprNode(pCxt, yymsp[-1].minor.yy476)); } break; - case 598: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy452 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 601: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy476 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy476)); } break; - case 601: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 604: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy452 = addOrderByClause(pCxt, yymsp[-3].minor.yy452, yymsp[-2].minor.yy844); - yylhsminor.yy452 = addSlimitClause(pCxt, yylhsminor.yy452, yymsp[-1].minor.yy452); - yylhsminor.yy452 = addLimitClause(pCxt, yylhsminor.yy452, yymsp[0].minor.yy452); + yylhsminor.yy476 = addOrderByClause(pCxt, yymsp[-3].minor.yy476, yymsp[-2].minor.yy332); + yylhsminor.yy476 = addSlimitClause(pCxt, yylhsminor.yy476, yymsp[-1].minor.yy476); + yylhsminor.yy476 = addLimitClause(pCxt, yylhsminor.yy476, yymsp[0].minor.yy476); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; - case 604: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 607: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy476 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy476, yymsp[0].minor.yy476); } + yymsp[-3].minor.yy476 = yylhsminor.yy476; break; - case 605: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 608: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy476 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy476, yymsp[0].minor.yy476); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; - case 613: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 617: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==617); -{ yymsp[-1].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 616: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 620: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==620); +{ yymsp[-1].minor.yy476 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 614: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 618: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==618); -{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 617: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 621: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==621); +{ yymsp[-3].minor.yy476 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 615: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 619: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==619); -{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 618: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 622: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==622); +{ yymsp[-3].minor.yy476 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 620: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 623: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy476 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy476); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; - case 625: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy452 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), yymsp[-1].minor.yy178, yymsp[0].minor.yy807); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 628: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy476 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy476), yymsp[-1].minor.yy906, yymsp[0].minor.yy961); } + yymsp[-2].minor.yy476 = yylhsminor.yy476; break; - case 626: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy178 = ORDER_ASC; } + case 629: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy906 = ORDER_ASC; } break; - case 627: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy178 = ORDER_ASC; } + case 630: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy906 = ORDER_ASC; } break; - case 628: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy178 = ORDER_DESC; } + case 631: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy906 = ORDER_DESC; } break; - case 629: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy807 = NULL_ORDER_DEFAULT; } + case 632: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy961 = NULL_ORDER_DEFAULT; } break; - case 630: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy807 = NULL_ORDER_FIRST; } + case 633: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy961 = NULL_ORDER_FIRST; } break; - case 631: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy807 = NULL_ORDER_LAST; } + case 634: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy961 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 33d6a329ee..d7b3f51961 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -379,7 +379,7 @@ static int32_t stbSplRewriteFuns(const SNodeList* pFuncs, SNodeList** pPartialFu return TSDB_CODE_SUCCESS; } -static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) { +static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex, uint8_t precision) { int32_t index = 0; SNode* pFunc = NULL; FOREACH(pFunc, pFuncs) { @@ -400,6 +400,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) { int32_t len = snprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWStart->functionName, pointer); taosCreateMD5Hash(name, len); strncpy(pWStart->node.aliasName, name, TSDB_COL_NAME_LEN - 1); + pWStart->node.resType.precision = precision; int32_t code = fmGetFuncInfo(pWStart, NULL, 0); if (TSDB_CODE_SUCCESS == code) { @@ -466,7 +467,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic int32_t index = 0; int32_t code = stbSplRewriteFuns(pFunc, &pPartWin->pFuncs, &pMergeWindow->pFuncs); if (TSDB_CODE_SUCCESS == code) { - code = stbSplAppendWStart(pPartWin->pFuncs, &index); + code = stbSplAppendWStart(pPartWin->pFuncs, &index, ((SColumnNode*)pMergeWindow->pTspk)->node.resType.precision); } if (TSDB_CODE_SUCCESS == code) { code = createColumnByRewriteExprs(pPartWin->pFuncs, &pPartWin->node.pTargets); diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 12b51e6c93..c49c647906 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -309,7 +309,9 @@ int32_t streamDoTransferStateToStreamTask(SStreamTask* pTask) { pStreamTask->id.idStr); } - ASSERT(pStreamTask->hTaskInfo.id.taskId == pTask->id.taskId && pTask->status.appendTranstateBlock == true); + ASSERT(((pStreamTask->status.taskStatus == TASK_STATUS__STOP) || + (pStreamTask->hTaskInfo.id.taskId == pTask->id.taskId)) && + pTask->status.appendTranstateBlock == true); STimeWindow* pTimeWindow = &pStreamTask->dataRange.window; diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 870cdd6a72..cec1a12024 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -139,6 +139,7 @@ typedef struct SSyncNode { SSyncFSM* pFsm; int32_t quorum; SRaftId leaderCache; + ESyncFsmState fsmState; // life cycle int64_t rid; diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index f8c96d8be2..9054f47d37 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -116,7 +116,7 @@ typedef struct SyncAppendEntriesReply { SyncIndex matchIndex; SyncIndex lastSendIndex; int64_t startTime; - int16_t reserved; + int16_t fsmState; } SyncAppendEntriesReply; typedef struct SyncHeartbeat { @@ -200,7 +200,7 @@ typedef struct SyncSnapshotSend { SSyncCfg lastConfig; int64_t startTime; int32_t seq; - int16_t reserved; + int16_t payloadType; uint32_t dataLen; char data[]; } SyncSnapshotSend; @@ -219,7 +219,8 @@ typedef struct SyncSnapshotRsp { int32_t ack; int32_t code; SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid - int16_t reserved; + int16_t payloadType; + char data[]; } SyncSnapshotRsp; typedef struct SyncLeaderTransfer { @@ -267,7 +268,7 @@ int32_t syncBuildPreSnapshot(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildPreSnapshotReply(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildApplyMsg(SRpcMsg* pMsg, const SRpcMsg* pOriginal, int32_t vgId, SFsmCbMeta* pMeta); int32_t syncBuildSnapshotSend(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId); -int32_t syncBuildSnapshotSendRsp(SRpcMsg* pMsg, int32_t vgId); +int32_t syncBuildSnapshotSendRsp(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId); int32_t syncBuildLeaderTransfer(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildLocalCmd(SRpcMsg* pMsg, int32_t vgId); diff --git a/source/libs/sync/inc/syncSnapshot.h b/source/libs/sync/inc/syncSnapshot.h index 063b4f51f5..95382132b5 100644 --- a/source/libs/sync/inc/syncSnapshot.h +++ b/source/libs/sync/inc/syncSnapshot.h @@ -31,7 +31,7 @@ extern "C" { #define SYNC_SNAPSHOT_RETRY_MS 5000 typedef struct SSyncSnapshotSender { - bool start; + int8_t start; int32_t seq; int32_t ack; void *pReader; @@ -43,7 +43,7 @@ typedef struct SSyncSnapshotSender { int64_t sendingMS; SyncTerm term; int64_t startTime; - int64_t endTime; + int64_t waitTime; int64_t lastSendTime; bool finish; @@ -60,8 +60,8 @@ void snapshotSenderStop(SSyncSnapshotSender *pSender, bool finis int32_t snapshotReSend(SSyncSnapshotSender *pSender); typedef struct SSyncSnapshotReceiver { - // update when pre snapshot - bool start; + // update when prep snapshot + int8_t start; int32_t ack; SyncTerm term; SRaftId fromId; diff --git a/source/libs/sync/src/syncAppendEntries.c b/source/libs/sync/src/syncAppendEntries.c index 925988f43a..51a0679889 100644 --- a/source/libs/sync/src/syncAppendEntries.c +++ b/source/libs/sync/src/syncAppendEntries.c @@ -155,6 +155,13 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) { pMsg->vgId, pMsg->prevLogIndex + 1, pMsg->term, pMsg->prevLogIndex, pMsg->prevLogTerm, pMsg->commitIndex, pEntry->term); + if (ths->fsmState == SYNC_FSM_STATE_INCOMPLETE) { + pReply->fsmState = ths->fsmState; + sWarn("vgId:%d, unable to accept, due to incomplete fsm state. index:%" PRId64, ths->vgId, pEntry->index); + syncEntryDestroy(pEntry); + goto _SEND_RESPONSE; + } + // accept if (syncLogBufferAccept(ths->pLogBuf, ths, pEntry, pMsg->prevLogTerm) < 0) { goto _SEND_RESPONSE; @@ -175,7 +182,7 @@ _SEND_RESPONSE: (void)syncNodeSendMsgById(&pReply->destId, ths, &rpcRsp); // commit index, i.e. leader notice me - if (syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { + if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE && syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { sError("vgId:%d, failed to commit raft fsm log since %s.", ths->vgId, terrstr()); } diff --git a/source/libs/sync/src/syncElection.c b/source/libs/sync/src/syncElection.c index 86e28db90c..c57e7e273f 100644 --- a/source/libs/sync/src/syncElection.c +++ b/source/libs/sync/src/syncElection.c @@ -71,6 +71,11 @@ static int32_t syncNodeRequestVotePeers(SSyncNode* pNode) { } int32_t syncNodeElect(SSyncNode* pSyncNode) { + if (pSyncNode->fsmState == SYNC_FSM_STATE_INCOMPLETE) { + sNError(pSyncNode, "skip leader election due to incomplete fsm state"); + return -1; + } + sNInfo(pSyncNode, "begin election"); pSyncNode->electNum++; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index eca499cf28..f9dc10da02 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1009,6 +1009,13 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { commitIndex = snapshot.lastApplyIndex; sNTrace(pSyncNode, "reset commit index by snapshot"); } + pSyncNode->fsmState = snapshot.state; + if (pSyncNode->fsmState == SYNC_FSM_STATE_INCOMPLETE) { + sError("vgId:%d, fsm state is incomplete.", pSyncNode->vgId); + if (pSyncNode->replicaNum == 1) { + goto _error; + } + } } pSyncNode->commitIndex = commitIndex; sInfo("vgId:%d, sync node commitIndex initialized as %" PRId64, pSyncNode->vgId, pSyncNode->commitIndex); @@ -1163,7 +1170,8 @@ int32_t syncNodeRestore(SSyncNode* pSyncNode) { pSyncNode->commitIndex = TMAX(pSyncNode->commitIndex, commitIndex); sInfo("vgId:%d, restore sync until commitIndex:%" PRId64, pSyncNode->vgId, pSyncNode->commitIndex); - if (syncLogBufferCommit(pSyncNode->pLogBuf, pSyncNode, pSyncNode->commitIndex) < 0) { + if (pSyncNode->fsmState != SYNC_FSM_STATE_INCOMPLETE && + syncLogBufferCommit(pSyncNode->pLogBuf, pSyncNode, pSyncNode->commitIndex) < 0) { return -1; } @@ -1455,10 +1463,9 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pNode, SRpcMsg } if (code < 0) { - sError("vgId:%d, sync send msg by id error, epset:%p dnode:%d addr:%" PRId64 " err:0x%x", pNode->vgId, epSet, - DID(destRaftId), destRaftId->addr, terrno); + sError("vgId:%d, failed to send sync msg since %s. epset:%p dnode:%d addr:%" PRId64, pNode->vgId, terrstr(), epSet, + DID(destRaftId), destRaftId->addr); rpcFreeCont(pMsg->pCont); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; } return code; @@ -2895,7 +2902,7 @@ _out:; // single replica (void)syncNodeUpdateCommitIndex(ths, matchIndex); - if (syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { + if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE && syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { sError("vgId:%d, failed to commit until commitIndex:%" PRId64 "", ths->vgId, ths->commitIndex); code = -1; } @@ -3139,7 +3146,7 @@ int32_t syncNodeOnLocalCmd(SSyncNode* ths, const SRpcMsg* pRpcMsg) { if (pMsg->currentTerm == matchTerm) { (void)syncNodeUpdateCommitIndex(ths, pMsg->commitIndex); } - if (syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { + if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE && syncLogBufferCommit(ths->pLogBuf, ths, ths->commitIndex) < 0) { sError("vgId:%d, failed to commit raft log since %s. commit index:%" PRId64 "", ths->vgId, terrstr(), ths->commitIndex); } diff --git a/source/libs/sync/src/syncMessage.c b/source/libs/sync/src/syncMessage.c index 72c8887803..9e035f60c2 100644 --- a/source/libs/sync/src/syncMessage.c +++ b/source/libs/sync/src/syncMessage.c @@ -216,42 +216,6 @@ int32_t syncBuildHeartbeatReply(SRpcMsg* pMsg, int32_t vgId) { return 0; } -#if 0 -int32_t syncBuildPreSnapshot(SRpcMsg* pMsg, int32_t vgId) { - int32_t bytes = sizeof(SyncPreSnapshot); - pMsg->pCont = rpcMallocCont(bytes); - pMsg->msgType = TDMT_SYNC_PRE_SNAPSHOT; - pMsg->contLen = bytes; - if (pMsg->pCont == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; - } - - SyncPreSnapshot* pPreSnapshot = pMsg->pCont; - pPreSnapshot->bytes = bytes; - pPreSnapshot->msgType = TDMT_SYNC_PRE_SNAPSHOT; - pPreSnapshot->vgId = vgId; - return 0; -} - -int32_t syncBuildPreSnapshotReply(SRpcMsg* pMsg, int32_t vgId) { - int32_t bytes = sizeof(SyncPreSnapshotReply); - pMsg->pCont = rpcMallocCont(bytes); - pMsg->msgType = TDMT_SYNC_PRE_SNAPSHOT_REPLY; - pMsg->contLen = bytes; - if (pMsg->pCont == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; - } - - SyncPreSnapshotReply* pPreSnapshotReply = pMsg->pCont; - pPreSnapshotReply->bytes = bytes; - pPreSnapshotReply->msgType = TDMT_SYNC_PRE_SNAPSHOT_REPLY; - pPreSnapshotReply->vgId = vgId; - return 0; -} -#endif - int32_t syncBuildSnapshotSend(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId) { int32_t bytes = sizeof(SyncSnapshotSend) + dataLen; pMsg->pCont = rpcMallocCont(bytes); @@ -270,8 +234,8 @@ int32_t syncBuildSnapshotSend(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId) { return 0; } -int32_t syncBuildSnapshotSendRsp(SRpcMsg* pMsg, int32_t vgId) { - int32_t bytes = sizeof(SyncSnapshotRsp); +int32_t syncBuildSnapshotSendRsp(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId) { + int32_t bytes = sizeof(SyncSnapshotRsp) + dataLen; pMsg->pCont = rpcMallocCont(bytes); pMsg->msgType = TDMT_SYNC_SNAPSHOT_RSP; pMsg->contLen = bytes; diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 019f8f7e62..a7ee37cc3b 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -839,14 +839,16 @@ int32_t syncLogReplRecover(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEn return 0; } - if (pMsg->success == false && pMsg->matchIndex >= pMsg->lastSendIndex) { - sWarn("vgId:%d, failed to rollback match index. peer: dnode:%d, match index:%" PRId64 ", last sent:%" PRId64, - pNode->vgId, DID(&destId), pMsg->matchIndex, pMsg->lastSendIndex); + if (pMsg->fsmState == SYNC_FSM_STATE_INCOMPLETE || (!pMsg->success && pMsg->matchIndex >= pMsg->lastSendIndex)) { + char* msg1 = " rollback match index failure"; + char* msg2 = " incomplete fsm state"; + sInfo("vgId:%d, snapshot replication to dnode:%d. reason:%s, match index:%" PRId64 ", last sent:%" PRId64, + pNode->vgId, DID(&destId), (pMsg->fsmState == SYNC_FSM_STATE_INCOMPLETE ? msg2 : msg1), pMsg->matchIndex, + pMsg->lastSendIndex); if (syncNodeStartSnapshot(pNode, &destId) < 0) { sError("vgId:%d, failed to start snapshot for peer dnode:%d", pNode->vgId, DID(&destId)); return -1; } - sInfo("vgId:%d, snapshot replication to peer dnode:%d", pNode->vgId, DID(&destId)); return 0; } } @@ -1000,10 +1002,9 @@ int32_t syncLogReplAttempt(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { pMgr->endIndex = index + 1; if (barrier) { - sInfo("vgId:%d, replicated sync barrier to dest:%" PRIx64 ". index:%" PRId64 ", term:%" PRId64 + sInfo("vgId:%d, replicated sync barrier to dnode:%d. index:%" PRId64 ", term:%" PRId64 ", repl mgr: rs(%d) [%" PRId64 " %" PRId64 ", %" PRId64 ")", - pNode->vgId, pDestId->addr, index, term, pMgr->restored, pMgr->startIndex, pMgr->matchIndex, - pMgr->endIndex); + pNode->vgId, DID(pDestId), index, term, pMgr->restored, pMgr->startIndex, pMgr->matchIndex, pMgr->endIndex); break; } } diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index 763d4ec5d6..924813eb98 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -44,8 +44,8 @@ SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode, int32_t replicaI pSender->pSyncNode = pSyncNode; pSender->replicaIndex = replicaIndex; pSender->term = raftStoreGetTerm(pSyncNode); - pSender->startTime = 0; - pSender->endTime = 0; + pSender->startTime = -1; + pSender->waitTime = -1; pSender->pSyncNode->pFsm->FpGetSnapshotInfo(pSender->pSyncNode->pFsm, &pSender->snapshot); pSender->finish = false; @@ -71,10 +71,14 @@ void snapshotSenderDestroy(SSyncSnapshotSender *pSender) { taosMemoryFree(pSender); } -bool snapshotSenderIsStart(SSyncSnapshotSender *pSender) { return pSender->start; } +bool snapshotSenderIsStart(SSyncSnapshotSender *pSender) { return atomic_load_8(&pSender->start); } int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { - pSender->start = true; + int32_t code = -1; + + int8_t started = atomic_val_compare_exchange_8(&pSender->start, false, true); + if (started) return 0; + pSender->seq = SYNC_SNAPSHOT_SEQ_BEGIN; pSender->ack = SYNC_SNAPSHOT_SEQ_INVALID; pSender->pReader = NULL; @@ -91,15 +95,33 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { memset(&pSender->lastConfig, 0, sizeof(pSender->lastConfig)); pSender->sendingMS = 0; pSender->term = raftStoreGetTerm(pSender->pSyncNode); - pSender->startTime = taosGetTimestampMs(); - pSender->lastSendTime = pSender->startTime; + pSender->startTime = taosGetMonoTimestampMs(); + pSender->lastSendTime = taosGetTimestampMs(); pSender->finish = false; - // build begin msg + // Get full snapshot info + SSyncNode *pSyncNode = pSender->pSyncNode; + SSnapshot snapInfo = {.type = TDMT_SYNC_PREP_SNAPSHOT}; + if (pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, &snapInfo) != 0) { + sSError(pSender, "snapshot get info failure since %s", terrstr()); + goto _out; + } + + int dataLen = 0; + if (snapInfo.data) { + SSyncTLV *datHead = snapInfo.data; + if (datHead->typ != TDMT_SYNC_PREP_SNAPSHOT) { + sSError(pSender, "unexpected data typ in data of snapshot info. typ: %d", datHead->typ); + terrno = TSDB_CODE_INVALID_DATA_FMT; + goto _out; + } + dataLen = sizeof(SSyncTLV) + datHead->len; + } + SRpcMsg rpcMsg = {0}; - if (syncBuildSnapshotSend(&rpcMsg, 0, pSender->pSyncNode->vgId) != 0) { + if (syncBuildSnapshotSend(&rpcMsg, dataLen, pSender->pSyncNode->vgId) != 0) { sSError(pSender, "snapshot sender build msg failed since %s", terrstr()); - return -1; + goto _out; } SyncSnapshotSend *pMsg = rpcMsg.pCont; @@ -114,25 +136,38 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { pMsg->startTime = pSender->startTime; pMsg->seq = SYNC_SNAPSHOT_SEQ_PREP_SNAPSHOT; + if (dataLen > 0) { + pMsg->payloadType = snapInfo.type; + memcpy(pMsg->data, snapInfo.data, dataLen); + } + // event log syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, "snapshot sender start"); // send msg if (syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg) != 0) { sSError(pSender, "snapshot sender send msg failed since %s", terrstr()); - return -1; + goto _out; } - return 0; + code = 0; +_out: + if (snapInfo.data) { + taosMemoryFree(snapInfo.data); + snapInfo.data = NULL; + } + return code; } void snapshotSenderStop(SSyncSnapshotSender *pSender, bool finish) { sSDebug(pSender, "snapshot sender stop, finish:%d reader:%p", finish, pSender->pReader); // update flag - pSender->start = false; + int8_t stopped = !atomic_val_compare_exchange_8(&pSender->start, true, false); + if (stopped) return; + pSender->finish = finish; - pSender->endTime = taosGetTimestampMs(); + pSender->waitTime = -1; // close reader if (pSender->pReader != NULL) { @@ -193,6 +228,7 @@ static int32_t snapshotSend(SSyncSnapshotSender *pSender) { pMsg->lastTerm = pSender->snapshot.lastApplyTerm; pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; pMsg->lastConfig = pSender->lastConfig; + pMsg->startTime = pSender->startTime; pMsg->seq = pSender->seq; if (pSender->pCurrentBlock != NULL) { @@ -234,6 +270,7 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) { pMsg->lastTerm = pSender->snapshot.lastApplyTerm; pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; pMsg->lastConfig = pSender->lastConfig; + pMsg->startTime = pSender->startTime; pMsg->seq = pSender->seq; if (pSender->pCurrentBlock != NULL && pSender->blockLen > 0) { @@ -256,7 +293,7 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) { static int32_t snapshotSenderUpdateProgress(SSyncSnapshotSender *pSender, SyncSnapshotRsp *pMsg) { if (pMsg->ack != pSender->seq) { sSError(pSender, "snapshot sender update seq failed, ack:%d seq:%d", pMsg->ack, pSender->seq); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; return -1; } @@ -271,8 +308,6 @@ static int32_t snapshotSenderUpdateProgress(SSyncSnapshotSender *pSender, SyncSn // return 1, last snapshot finish ok // return -1, error int32_t syncNodeStartSnapshot(SSyncNode *pSyncNode, SRaftId *pDestId) { - sNInfo(pSyncNode, "snapshot sender starting ..."); - SSyncSnapshotSender *pSender = syncNodeGetSnapshotSender(pSyncNode, pDestId); if (pSender == NULL) { sNError(pSyncNode, "snapshot sender start error since get failed"); @@ -280,12 +315,16 @@ int32_t syncNodeStartSnapshot(SSyncNode *pSyncNode, SRaftId *pDestId) { } if (snapshotSenderIsStart(pSender)) { - sSInfo(pSender, "snapshot sender already start, ignore"); + sSDebug(pSender, "snapshot sender already start, ignore"); return 0; } - if (pSender->finish && taosGetTimestampMs() - pSender->endTime < SNAPSHOT_WAIT_MS) { - sSInfo(pSender, "snapshot sender start too frequently, ignore"); + int64_t timeNow = taosGetTimestampMs(); + if (pSender->waitTime <= 0) { + pSender->waitTime = timeNow + SNAPSHOT_WAIT_MS; + } + if (timeNow < pSender->waitTime) { + sSDebug(pSender, "snapshot sender waitTime not expired yet, ignore"); return 0; } @@ -312,6 +351,7 @@ SSyncSnapshotReceiver *snapshotReceiverCreate(SSyncNode *pSyncNode, SRaftId from } pReceiver->start = false; + pReceiver->startTime = 0; pReceiver->ack = SYNC_SNAPSHOT_SEQ_BEGIN; pReceiver->pWriter = NULL; pReceiver->pSyncNode = pSyncNode; @@ -338,12 +378,31 @@ void snapshotReceiverDestroy(SSyncSnapshotReceiver *pReceiver) { pReceiver->pWriter = NULL; } + // free data of snapshot info + if (pReceiver->snapshotParam.data) { + taosMemoryFree(pReceiver->snapshotParam.data); + pReceiver->snapshotParam.data = NULL; + } + + if (pReceiver->snapshot.data) { + taosMemoryFree(pReceiver->snapshot.data); + pReceiver->snapshot.data = NULL; + } + // free receiver taosMemoryFree(pReceiver); } bool snapshotReceiverIsStart(SSyncSnapshotReceiver *pReceiver) { - return (pReceiver != NULL ? pReceiver->start : false); + return (pReceiver != NULL ? atomic_load_8(&pReceiver->start) : false); +} + +static int32_t snapshotReceiverSignatureCmp(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *pMsg) { + if (pReceiver->term < pMsg->term) return -1; + if (pReceiver->term > pMsg->term) return 1; + if (pReceiver->startTime < pMsg->startTime) return -1; + if (pReceiver->startTime > pMsg->startTime) return 1; + return 0; } static int32_t snapshotReceiverStartWriter(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *pBeginMsg) { @@ -382,11 +441,14 @@ void snapshotReceiverStart(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *p return; } - pReceiver->start = true; + int8_t started = atomic_val_compare_exchange_8(&pReceiver->start, false, true); + if (started) return; + pReceiver->ack = SYNC_SNAPSHOT_SEQ_PREP_SNAPSHOT; - pReceiver->term = raftStoreGetTerm(pReceiver->pSyncNode); + pReceiver->term = pPreMsg->term; pReceiver->fromId = pPreMsg->srcId; pReceiver->startTime = pPreMsg->startTime; + ASSERT(pReceiver->startTime); // event log sRInfo(pReceiver, "snapshot receiver is start"); @@ -397,6 +459,9 @@ void snapshotReceiverStart(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *p void snapshotReceiverStop(SSyncSnapshotReceiver *pReceiver) { sRInfo(pReceiver, "snapshot receiver stop, not apply, writer:%p", pReceiver->pWriter); + int8_t stopped = !atomic_val_compare_exchange_8(&pReceiver->start, true, false); + if (stopped) return; + if (pReceiver->pWriter != NULL) { int32_t ret = pReceiver->pSyncNode->pFsm->FpSnapshotStopWrite(pReceiver->pSyncNode->pFsm, pReceiver->pWriter, false, &pReceiver->snapshot); @@ -407,8 +472,6 @@ void snapshotReceiverStop(SSyncSnapshotReceiver *pReceiver) { } else { sRInfo(pReceiver, "snapshot receiver stop, writer is null"); } - - pReceiver->start = false; } // when recv last snapshot block, apply data into snapshot @@ -458,6 +521,10 @@ static int32_t snapshotReceiverFinish(SSyncSnapshotReceiver *pReceiver, SyncSnap // update progress pReceiver->ack = SYNC_SNAPSHOT_SEQ_END; + SSnapshot snapshot = {0}; + pReceiver->pSyncNode->pFsm->FpGetSnapshotInfo(pReceiver->pSyncNode->pFsm, &snapshot); + pReceiver->pSyncNode->fsmState = snapshot.state; + } else { sRError(pReceiver, "snapshot receiver finish error since writer is null"); return -1; @@ -529,19 +596,26 @@ static int32_t syncNodeOnSnapshotPrep(SSyncNode *pSyncNode, SyncSnapshotSend *pM if (snapshotReceiverIsStart(pReceiver)) { // already start - if (pMsg->startTime > pReceiver->startTime) { - sRInfo(pReceiver, "snapshot receiver startTime:%" PRId64 " > msg startTime:%" PRId64 " start receiver", - pReceiver->startTime, pMsg->startTime); + int32_t order = 0; + if ((order = snapshotReceiverSignatureCmp(pReceiver, pMsg)) < 0) { + sRInfo(pReceiver, + "received a new snapshot preparation. restart receiver" + "receiver signature: (%" PRId64 ", %" PRId64 "), msg signature:(%" PRId64 ", %" PRId64 ")", + pReceiver->term, pReceiver->startTime, pMsg->term, pMsg->startTime); goto _START_RECEIVER; - } else if (pMsg->startTime == pReceiver->startTime) { - sRInfo(pReceiver, "snapshot receiver startTime:%" PRId64 " == msg startTime:%" PRId64 " send reply", - pReceiver->startTime, pMsg->startTime); + } else if (order == 0) { + sRInfo(pReceiver, + "received a duplicate snapshot preparation. send reply" + "receiver signature: (%" PRId64 ", %" PRId64 "), msg signature:(%" PRId64 ", %" PRId64 ")", + pReceiver->term, pReceiver->startTime, pMsg->term, pMsg->startTime); goto _SEND_REPLY; } else { // ignore - sRError(pReceiver, "snapshot receiver startTime:%" PRId64 " < msg startTime:%" PRId64 " ignore", - pReceiver->startTime, pMsg->startTime); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + sRError(pReceiver, + "received a stale snapshot preparation. ignore" + "receiver signature: (%" PRId64 ", %" PRId64 "), msg signature:(%" PRId64 ", %" PRId64 ")", + pReceiver->term, pReceiver->startTime, pMsg->term, pMsg->startTime); + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; code = terrno; goto _SEND_REPLY; } @@ -552,36 +626,45 @@ static int32_t syncNodeOnSnapshotPrep(SSyncNode *pSyncNode, SyncSnapshotSend *pM } _START_RECEIVER: - if (timeNow - pMsg->startTime > SNAPSHOT_MAX_CLOCK_SKEW_MS) { - sRError(pReceiver, "snapshot receiver time skew too much, now:%" PRId64 " msg startTime:%" PRId64, timeNow, - pMsg->startTime); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; - code = terrno; - } else { - // waiting for clock match - while (timeNow < pMsg->startTime) { - sRInfo(pReceiver, "snapshot receiver pre waitting for true time, now:%" PRId64 ", startTime:%" PRId64, timeNow, - pMsg->startTime); - taosMsleep(10); - timeNow = taosGetTimestampMs(); - } - - if (snapshotReceiverIsStart(pReceiver)) { - sRInfo(pReceiver, "snapshot receiver already start and force stop pre one"); - snapshotReceiverStop(pReceiver); - } - - snapshotReceiverStart(pReceiver, pMsg); // set start-time same with sender + if (snapshotReceiverIsStart(pReceiver)) { + sRInfo(pReceiver, "snapshot receiver already start and force stop pre one"); + snapshotReceiverStop(pReceiver); } + snapshotReceiverStart(pReceiver, pMsg); // set start-time same with sender + _SEND_REPLY: // build msg ; // make complier happy + SSnapshot snapInfo = {.type = TDMT_SYNC_PREP_SNAPSHOT_REPLY}; + int32_t dataLen = 0; + if (pMsg->dataLen > 0) { + void *data = taosMemoryCalloc(1, pMsg->dataLen); + if (data == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = terrno; + goto _out; + } + memcpy(data, pMsg->data, pMsg->dataLen); + snapInfo.data = data; + data = NULL; + pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, &snapInfo); + + SSyncTLV *datHead = snapInfo.data; + if (datHead->typ != TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + sRError(pReceiver, "unexpected data typ in data of snapshot info. typ: %d", datHead->typ); + code = TSDB_CODE_INVALID_DATA_FMT; + goto _out; + } + dataLen = sizeof(SSyncTLV) + datHead->len; + } + SRpcMsg rpcMsg = {0}; - if (syncBuildSnapshotSendRsp(&rpcMsg, pSyncNode->vgId) != 0) { + if (syncBuildSnapshotSendRsp(&rpcMsg, dataLen, pSyncNode->vgId) != 0) { sRError(pReceiver, "snapshot receiver failed to build resp since %s", terrstr()); - return -1; + code = terrno; + goto _out; } SyncSnapshotRsp *pRspMsg = rpcMsg.pCont; @@ -590,18 +673,40 @@ _SEND_REPLY: pRspMsg->term = raftStoreGetTerm(pSyncNode); pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; - pRspMsg->startTime = pReceiver->startTime; + pRspMsg->startTime = pMsg->startTime; pRspMsg->ack = pMsg->seq; // receiver maybe already closed pRspMsg->code = code; pRspMsg->snapBeginIndex = syncNodeGetSnapBeginIndex(pSyncNode); - // send msg - syncLogSendSyncSnapshotRsp(pSyncNode, pRspMsg, "snapshot receiver pre-snapshot"); - if (syncNodeSendMsgById(&pRspMsg->destId, pSyncNode, &rpcMsg) != 0) { - sRError(pReceiver, "snapshot receiver failed to build resp since %s", terrstr()); - return -1; + if (snapInfo.data) { + pRspMsg->payloadType = snapInfo.type; + memcpy(pRspMsg->data, snapInfo.data, dataLen); + + // save snapshot info + SSnapshotParam *pParam = &pReceiver->snapshotParam; + void *data = taosMemoryRealloc(pParam->data, dataLen); + if (data == NULL) { + sError("vgId:%d, failed to realloc memory for snapshot prep due to %s. dataLen:%d", pSyncNode->vgId, + strerror(errno), dataLen); + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = terrno; + goto _out; + } + pParam->data = data; + memcpy(pParam->data, snapInfo.data, dataLen); } + // send msg + if (syncNodeSendMsgById(&pRspMsg->destId, pSyncNode, &rpcMsg) != 0) { + sRError(pReceiver, "failed to send resp since %s", terrstr()); + code = terrno; + } + +_out: + if (snapInfo.data) { + taosMemoryFree(snapInfo.data); + snapInfo.data = NULL; + } return code; } @@ -611,19 +716,19 @@ static int32_t syncNodeOnSnapshotBegin(SSyncNode *pSyncNode, SyncSnapshotSend *p int32_t code = TSDB_CODE_SYN_INTERNAL_ERROR; if (!snapshotReceiverIsStart(pReceiver)) { - sRError(pReceiver, "snapshot receiver begin failed since not start"); + sRError(pReceiver, "failed to begin snapshot receiver since not started"); goto _SEND_REPLY; } - if (pReceiver->startTime != pMsg->startTime) { - sRError(pReceiver, "snapshot receiver begin failed since startTime:%" PRId64 " not equal to msg startTime:%" PRId64, - pReceiver->startTime, pMsg->startTime); + if (snapshotReceiverSignatureCmp(pReceiver, pMsg) != 0) { + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; + sRError(pReceiver, "failed to begin snapshot receiver since %s", terrstr()); goto _SEND_REPLY; } // start writer if (snapshotReceiverStartWriter(pReceiver, pMsg) != 0) { - sRError(pReceiver, "snapshot receiver begin failed since start writer failed"); + sRError(pReceiver, "failed to start snapshot writer since %s", terrstr()); goto _SEND_REPLY; } @@ -635,8 +740,8 @@ _SEND_REPLY: // build msg SRpcMsg rpcMsg = {0}; - if (syncBuildSnapshotSendRsp(&rpcMsg, pSyncNode->vgId) != 0) { - sRError(pReceiver, "snapshot receiver build resp failed since %s", terrstr()); + if (syncBuildSnapshotSendRsp(&rpcMsg, 0, pSyncNode->vgId) != 0) { + sRError(pReceiver, "failed to build snapshot receiver resp since %s", terrstr()); return -1; } @@ -646,15 +751,14 @@ _SEND_REPLY: pRspMsg->term = raftStoreGetTerm(pSyncNode); pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; - pRspMsg->startTime = pReceiver->startTime; + pRspMsg->startTime = pMsg->startTime; pRspMsg->ack = pReceiver->ack; // receiver maybe already closed pRspMsg->code = code; pRspMsg->snapBeginIndex = pReceiver->snapshotParam.start; // send msg - syncLogSendSyncSnapshotRsp(pSyncNode, pRspMsg, "snapshot receiver begin"); if (syncNodeSendMsgById(&pRspMsg->destId, pSyncNode, &rpcMsg) != 0) { - sRError(pReceiver, "snapshot receiver send resp failed since %s", terrstr()); + sRError(pReceiver, "failed to send snapshot receiver resp since %s", terrstr()); return -1; } @@ -665,17 +769,16 @@ static int32_t syncNodeOnSnapshotReceive(SSyncNode *pSyncNode, SyncSnapshotSend // condition 4 // transfering SSyncSnapshotReceiver *pReceiver = pSyncNode->pNewNodeReceiver; - - // waiting for clock match int64_t timeNow = taosGetTimestampMs(); - while (timeNow < pMsg->startTime) { - sRInfo(pReceiver, "snapshot receiver receiving waitting for true time, now:%" PRId64 ", stime:%" PRId64, timeNow, - pMsg->startTime); - taosMsleep(10); - timeNow = taosGetTimestampMs(); + int32_t code = 0; + + if (snapshotReceiverSignatureCmp(pReceiver, pMsg) != 0) { + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; + sRError(pReceiver, "failed to receive snapshot data since %s.", terrstr()); + code = terrno; + goto _SEND_REPLY; } - int32_t code = 0; if (snapshotReceiverGotData(pReceiver, pMsg) != 0) { code = terrno; if (code >= SYNC_SNAPSHOT_SEQ_INVALID) { @@ -683,10 +786,12 @@ static int32_t syncNodeOnSnapshotReceive(SSyncNode *pSyncNode, SyncSnapshotSend } } +_SEND_REPLY:; + // build msg SRpcMsg rpcMsg = {0}; - if (syncBuildSnapshotSendRsp(&rpcMsg, pSyncNode->vgId)) { - sRError(pReceiver, "snapshot receiver build resp failed since %s", terrstr()); + if (syncBuildSnapshotSendRsp(&rpcMsg, 0, pSyncNode->vgId)) { + sRError(pReceiver, "failed to build snapshot receiver resp since %s", terrstr()); return -1; } @@ -696,15 +801,14 @@ static int32_t syncNodeOnSnapshotReceive(SSyncNode *pSyncNode, SyncSnapshotSend pRspMsg->term = raftStoreGetTerm(pSyncNode); pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; - pRspMsg->startTime = pReceiver->startTime; + pRspMsg->startTime = pMsg->startTime; pRspMsg->ack = pReceiver->ack; // receiver maybe already closed pRspMsg->code = code; pRspMsg->snapBeginIndex = pReceiver->snapshotParam.start; // send msg - syncLogSendSyncSnapshotRsp(pSyncNode, pRspMsg, "snapshot receiver received"); if (syncNodeSendMsgById(&pRspMsg->destId, pSyncNode, &rpcMsg) != 0) { - sRError(pReceiver, "snapshot receiver send resp failed since %s", terrstr()); + sRError(pReceiver, "failed to send snapshot receiver resp since %s", terrstr()); return -1; } @@ -715,24 +819,27 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs // condition 2 // end, finish FSM SSyncSnapshotReceiver *pReceiver = pSyncNode->pNewNodeReceiver; - - // waiting for clock match int64_t timeNow = taosGetTimestampMs(); - while (timeNow < pMsg->startTime) { - sRInfo(pReceiver, "snapshot receiver finish waitting for true time, now:%" PRId64 ", stime:%" PRId64, timeNow, - pMsg->startTime); - taosMsleep(10); - timeNow = taosGetTimestampMs(); + int32_t code = 0; + + if (snapshotReceiverSignatureCmp(pReceiver, pMsg) != 0) { + sRError(pReceiver, "snapshot end failed since startTime:%" PRId64 " not equal to msg startTime:%" PRId64, + pReceiver->startTime, pMsg->startTime); + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; + code = terrno; + goto _SEND_REPLY; } - int32_t code = snapshotReceiverFinish(pReceiver, pMsg); + code = snapshotReceiverFinish(pReceiver, pMsg); if (code == 0) { snapshotReceiverStop(pReceiver); } +_SEND_REPLY:; + // build msg SRpcMsg rpcMsg = {0}; - if (syncBuildSnapshotSendRsp(&rpcMsg, pSyncNode->vgId) != 0) { + if (syncBuildSnapshotSendRsp(&rpcMsg, 0, pSyncNode->vgId) != 0) { sRError(pReceiver, "snapshot receiver build rsp failed since %s", terrstr()); return -1; } @@ -743,7 +850,7 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs pRspMsg->term = raftStoreGetTerm(pSyncNode); pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; - pRspMsg->startTime = pReceiver->startTime; + pRspMsg->startTime = pMsg->startTime; pRspMsg->ack = pReceiver->ack; // receiver maybe already closed pRspMsg->code = code; pRspMsg->snapBeginIndex = pReceiver->snapshotParam.start; @@ -785,13 +892,13 @@ int32_t syncNodeOnSnapshot(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { // if already drop replica, do not process if (!syncNodeInRaftGroup(pSyncNode, &pMsg->srcId)) { syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "not in my config"); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; return -1; } if (pMsg->term < raftStoreGetTerm(pSyncNode)) { syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "reject since small term"); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; return -1; } @@ -809,13 +916,16 @@ int32_t syncNodeOnSnapshot(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { if (pSyncNode->state == TAOS_SYNC_STATE_FOLLOWER || pSyncNode->state == TAOS_SYNC_STATE_LEARNER) { if (pMsg->term == raftStoreGetTerm(pSyncNode)) { if (pMsg->seq == SYNC_SNAPSHOT_SEQ_PREP_SNAPSHOT) { - syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "process seq pre-snapshot"); + sInfo("vgId:%d, receive pre-snapshot msg of snapshot replication. signature:(%" PRId64 ", %" PRId64 ")", + pSyncNode->vgId, pMsg->term, pMsg->startTime); code = syncNodeOnSnapshotPrep(pSyncNode, pMsg); } else if (pMsg->seq == SYNC_SNAPSHOT_SEQ_BEGIN) { - syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "process seq begin"); + sInfo("vgId:%d, receive begin msg of snapshot replication. signature:(%" PRId64 ", %" PRId64 ")", + pSyncNode->vgId, pMsg->term, pMsg->startTime); code = syncNodeOnSnapshotBegin(pSyncNode, pMsg); } else if (pMsg->seq == SYNC_SNAPSHOT_SEQ_END) { - syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "process seq end"); + sInfo("vgId:%d, receive end msg of snapshot replication. signature: (%" PRId64 ", %" PRId64 ")", + pSyncNode->vgId, pMsg->term, pMsg->startTime); code = syncNodeOnSnapshotEnd(pSyncNode, pMsg); if (syncLogBufferReInit(pSyncNode->pLogBuf, pSyncNode) != 0) { sRError(pReceiver, "failed to reinit log buffer since %s", terrstr()); @@ -859,17 +969,21 @@ static int32_t syncNodeOnSnapshotPrepRsp(SSyncNode *pSyncNode, SSyncSnapshotSend sSInfo(pSender, "prepare snapshot, recv-begin:%" PRId64 ", snapshot.last:%" PRId64 ", snapshot.term:%" PRId64, pMsg->snapBeginIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm); - if (pMsg->snapBeginIndex > snapshot.lastApplyIndex) { - sSError(pSender, "prepare snapshot failed since beginIndex:%" PRId64 " larger than applyIndex:%" PRId64, - pMsg->snapBeginIndex, snapshot.lastApplyIndex); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; - return -1; - } - // update sender pSender->snapshot = snapshot; // start reader + if (pMsg->payloadType == TDMT_SYNC_PREP_SNAPSHOT_REPLY) { + SSyncTLV *datHead = (void *)pMsg->data; + if (datHead->typ != pMsg->payloadType) { + sSError(pSender, "unexpected data type in data of SyncSnapshotRsp. typ: %d", datHead->typ); + terrno = TSDB_CODE_INVALID_DATA_FMT; + return -1; + } + pSender->snapshotParam.data = (void *)pMsg->data; + sSInfo(pSender, "data of snapshot param. len: %d", datHead->len); + } + int32_t code = pSyncNode->pFsm->FpSnapshotStartRead(pSyncNode->pFsm, &pSender->snapshotParam, &pSender->pReader); if (code != 0) { sSError(pSender, "prepare snapshot failed since %s", terrstr()); @@ -901,6 +1015,11 @@ static int32_t syncNodeOnSnapshotPrepRsp(SSyncNode *pSyncNode, SSyncSnapshotSend pSendMsg->startTime = pSender->startTime; pSendMsg->seq = SYNC_SNAPSHOT_SEQ_BEGIN; + ASSERT(pSendMsg->startTime); + + sSInfo(pSender, "begin snapshot replication to dnode %d. startTime:%" PRId64, DID(&pSendMsg->destId), + pSendMsg->startTime); + // send msg syncLogSendSyncSnapshotSend(pSyncNode, pSendMsg, "snapshot sender reply pre"); if (syncNodeSendMsgById(&pSendMsg->destId, pSender->pSyncNode, &rpcMsg) != 0) { @@ -911,6 +1030,14 @@ static int32_t syncNodeOnSnapshotPrepRsp(SSyncNode *pSyncNode, SSyncSnapshotSend return 0; } +static int32_t snapshotSenderSignatureCmp(SSyncSnapshotSender *pSender, SyncSnapshotRsp *pMsg) { + if (pSender->term < pMsg->term) return -1; + if (pSender->term > pMsg->term) return 1; + if (pSender->startTime < pMsg->startTime) return -1; + if (pSender->startTime > pMsg->startTime) return 1; + return 0; +} + // sender on message // // condition 1 sender receives SYNC_SNAPSHOT_SEQ_END, close sender @@ -923,7 +1050,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { // if already drop replica, do not process if (!syncNodeInRaftGroup(pSyncNode, &pMsg->srcId)) { syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "maybe replica already dropped"); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; return -1; } @@ -935,6 +1062,27 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { return -1; } + if (!snapshotSenderIsStart(pSender)) { + sSError(pSender, "snapshot sender not started yet. sender startTime:%" PRId64 ", msg startTime:%" PRId64, + pSender->startTime, pMsg->startTime); + return -1; + } + + // check signature + int32_t order = 0; + if ((order = snapshotSenderSignatureCmp(pSender, pMsg)) > 0) { + sSError(pSender, + "received a stale snapshot rsp. ignore it" + "sender signature: (%" PRId64 ", %" PRId64 "), msg signature:(%" PRId64 ", %" PRId64 ")", + pSender->term, pSender->startTime, pMsg->term, pMsg->startTime); + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; + return -1; + } else if (order < 0) { + sSError(pSender, "snapshot sender is stale. stop"); + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; + goto _ERROR; + } + // state, term, seq/ack if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "snapshot sender not leader"); @@ -943,20 +1091,12 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { goto _ERROR; } - if (pMsg->startTime != pSender->startTime) { - syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "snapshot sender and receiver time not match"); - sSError(pSender, "sender:%" PRId64 " receiver:%" PRId64 " time not match, error:%s 0x%x", pMsg->startTime, - pSender->startTime, tstrerror(pMsg->code), pMsg->code); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; - goto _ERROR; - } - SyncTerm currentTerm = raftStoreGetTerm(pSyncNode); if (pMsg->term != currentTerm) { syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "snapshot sender and receiver term not match"); sSError(pSender, "snapshot sender term not equal, msg term:%" PRId64 " currentTerm:%" PRId64, pMsg->term, currentTerm); - terrno = TSDB_CODE_SYN_INTERNAL_ERROR; + terrno = TSDB_CODE_SYN_MISMATCHED_SIGNATURE; goto _ERROR; } diff --git a/source/libs/transport/inc/transComm.h b/source/libs/transport/inc/transComm.h index c82b7c0532..73427446e6 100644 --- a/source/libs/transport/inc/transComm.h +++ b/source/libs/transport/inc/transComm.h @@ -119,6 +119,13 @@ typedef struct SExHandle { void* pThrd; } SExHandle; +typedef struct { + STransMsg* pRsp; + tsem_t* pSem; + int8_t inited; + SRWLatch latch; +} STransSyncMsg; + /*convet from fqdn to ip */ typedef struct SCvtAddr { char ip[TSDB_FQDN_LEN]; @@ -133,11 +140,13 @@ typedef struct { tmsg_t msgType; // message type int8_t connType; // connection type cli/srv - STransCtx appCtx; // - STransMsg* pRsp; // for synchronous API - tsem_t* pSem; // for synchronous API - SCvtAddr cvtAddr; - bool setMaxRetry; + STransCtx appCtx; // + STransMsg* pRsp; // for synchronous API + tsem_t* pSem; // for synchronous API + STransSyncMsg* pSyncMsg; // for syncchronous with timeout API + int64_t syncMsgRef; + SCvtAddr cvtAddr; + bool setMaxRetry; int32_t retryMinInterval; int32_t retryMaxInterval; @@ -307,6 +316,7 @@ int transReleaseSrvHandle(void* handle); int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pMsg, STransCtx* pCtx); int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pMsg, STransMsg* pRsp); +int transSendRecvWithTimeout(void* shandle, const SEpSet* pEpSet, STransMsg* pMsg, STransMsg* pRsp, int32_t timeoutMs); int transSendResponse(const STransMsg* msg); int transRegisterMsg(const STransMsg* msg); int transSetDefaultAddr(void* shandle, const char* ip, const char* fqdn); @@ -432,10 +442,11 @@ int64_t transAddExHandle(int32_t refMgt, void* p); int32_t transRemoveExHandle(int32_t refMgt, int64_t refId); void* transAcquireExHandle(int32_t refMgt, int64_t refId); int32_t transReleaseExHandle(int32_t refMgt, int64_t refId); -void transDestoryExHandle(void* handle); +void transDestroyExHandle(void* handle); int32_t transGetRefMgt(); int32_t transGetInstMgt(); +int32_t transGetSyncMsgMgt(); void transHttpEnvDestroy(); diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index e9aa62eded..b23d229931 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -41,7 +41,8 @@ void* rpcOpen(const SRpcInit* pInit) { return NULL; } if (pInit->label) { - tstrncpy(pRpc->label, pInit->label, sizeof(pRpc->label)); + int len = strlen(pInit->label) > sizeof(pRpc->label) ? sizeof(pRpc->label) : strlen(pInit->label); + memcpy(pRpc->label, pInit->label, len); } pRpc->compressSize = pInit->compressSize; @@ -168,6 +169,9 @@ int rpcSendRequestWithCtx(void* shandle, const SEpSet* pEpSet, SRpcMsg* pMsg, in int rpcSendRecv(void* shandle, SEpSet* pEpSet, SRpcMsg* pMsg, SRpcMsg* pRsp) { return transSendRecv(shandle, pEpSet, pMsg, pRsp); } +int rpcSendRecvWithTimeout(void* shandle, SEpSet* pEpSet, SRpcMsg* pMsg, SRpcMsg* pRsp, int32_t timeoutMs) { + return transSendRecvWithTimeout(shandle, pEpSet, pMsg, pRsp, timeoutMs); +} int rpcSendResponse(const SRpcMsg* pMsg) { return transSendResponse(pMsg); } diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 677e08ec56..ef60c8a94e 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -2411,15 +2411,26 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { } } } - if (pCtx->pSem != NULL) { + if (pCtx->pSem || pCtx->syncMsgRef != 0) { tGTrace("%s conn %p(sync) handle resp", CONN_GET_INST_LABEL(pConn), pConn); - if (pCtx->pRsp == NULL) { - tGTrace("%s conn %p(sync) failed to resp, ignore", CONN_GET_INST_LABEL(pConn), pConn); + if (pCtx->pSem) { + if (pCtx->pRsp == NULL) { + tGTrace("%s conn %p(sync) failed to resp, ignore", CONN_GET_INST_LABEL(pConn), pConn); + } else { + memcpy((char*)pCtx->pRsp, (char*)pResp, sizeof(*pResp)); + } + tsem_post(pCtx->pSem); + pCtx->pRsp = NULL; } else { - memcpy((char*)pCtx->pRsp, (char*)pResp, sizeof(*pResp)); + STransSyncMsg* pSyncMsg = taosAcquireRef(transGetSyncMsgMgt(), pCtx->syncMsgRef); + if (pSyncMsg != NULL) { + memcpy(pSyncMsg->pRsp, (char*)pResp, sizeof(*pResp)); + tsem_post(pSyncMsg->pSem); + taosReleaseRef(transGetSyncMsgMgt(), pCtx->syncMsgRef); + } else { + rpcFreeCont(pResp->pCont); + } } - tsem_post(pCtx->pSem); - pCtx->pRsp = NULL; } else { tGTrace("%s conn %p handle resp", CONN_GET_INST_LABEL(pConn), pConn); if (retry == false && hasEpSet == true) { @@ -2563,15 +2574,18 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran } int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMsg* pRsp) { - STrans* pTransInst = (STrans*)transAcquireExHandle(transGetInstMgt(), (int64_t)shandle); + STrans* pTransInst = (STrans*)transAcquireExHandle(transGetInstMgt(), (int64_t)shandle); + STransMsg* pTransRsp = taosMemoryCalloc(1, sizeof(STransMsg)); if (pTransInst == NULL) { transFreeMsg(pReq->pCont); + taosMemoryFree(pTransRsp); return -1; } SCliThrd* pThrd = transGetWorkThrd(pTransInst, (int64_t)pReq->info.handle); if (pThrd == NULL) { transFreeMsg(pReq->pCont); + taosMemoryFree(pTransRsp); transReleaseExHandle(transGetInstMgt(), (int64_t)shandle); return TSDB_CODE_RPC_BROKEN_LINK; } @@ -2587,7 +2601,7 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs pCtx->ahandle = pReq->info.ahandle; pCtx->msgType = pReq->msgType; pCtx->pSem = sem; - pCtx->pRsp = pRsp; + pCtx->pRsp = pTransRsp; SCliMsg* cliMsg = taosMemoryCalloc(1, sizeof(SCliMsg)); cliMsg->ctx = pCtx; @@ -2607,10 +2621,86 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs } tsem_wait(sem); + memcpy(pRsp, pTransRsp, sizeof(STransMsg)); + _RETURN: tsem_destroy(sem); taosMemoryFree(sem); transReleaseExHandle(transGetInstMgt(), (int64_t)shandle); + taosMemoryFree(pTransRsp); + return ret; +} +int64_t transCreateSyncMsg(STransMsg* pTransMsg) { + tsem_t* sem = taosMemoryCalloc(1, sizeof(tsem_t)); + tsem_init(sem, 0, 0); + + STransSyncMsg* pSyncMsg = taosMemoryCalloc(1, sizeof(STransSyncMsg)); + + taosInitRWLatch(&pSyncMsg->latch); + pSyncMsg->inited = 0; + pSyncMsg->pRsp = pTransMsg; + pSyncMsg->pSem = sem; + + return taosAddRef(transGetSyncMsgMgt(), pSyncMsg); +} +int transSendRecvWithTimeout(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMsg* pRsp, int32_t timeoutMs) { + STrans* pTransInst = (STrans*)transAcquireExHandle(transGetInstMgt(), (int64_t)shandle); + STransMsg* pTransMsg = taosMemoryCalloc(1, sizeof(STransMsg)); + if (pTransInst == NULL) { + transFreeMsg(pReq->pCont); + taosMemoryFree(pTransMsg); + return -1; + } + + SCliThrd* pThrd = transGetWorkThrd(pTransInst, (int64_t)pReq->info.handle); + if (pThrd == NULL) { + transFreeMsg(pReq->pCont); + taosMemoryFree(pTransMsg); + transReleaseExHandle(transGetInstMgt(), (int64_t)shandle); + return TSDB_CODE_RPC_BROKEN_LINK; + } + + TRACE_SET_MSGID(&pReq->info.traceId, tGenIdPI64()); + + STransConnCtx* pCtx = taosMemoryCalloc(1, sizeof(STransConnCtx)); + epsetAssign(&pCtx->epSet, pEpSet); + epsetAssign(&pCtx->origEpSet, pEpSet); + pCtx->ahandle = pReq->info.ahandle; + pCtx->msgType = pReq->msgType; + pCtx->syncMsgRef = transCreateSyncMsg(pTransMsg); + + int64_t ref = pCtx->syncMsgRef; + STransSyncMsg* pSyncMsg = taosAcquireRef(transGetSyncMsgMgt(), ref); + + SCliMsg* cliMsg = taosMemoryCalloc(1, sizeof(SCliMsg)); + cliMsg->ctx = pCtx; + cliMsg->msg = *pReq; + cliMsg->st = taosGetTimestampUs(); + cliMsg->type = Normal; + cliMsg->refId = (int64_t)shandle; + + STraceId* trace = &pReq->info.traceId; + tGDebug("%s send request at thread:%08" PRId64 ", dst:%s:%d, app:%p", transLabel(pTransInst), pThrd->pid, + EPSET_GET_INUSE_IP(&pCtx->epSet), EPSET_GET_INUSE_PORT(&pCtx->epSet), pReq->info.ahandle); + + int ret = transAsyncSend(pThrd->asyncPool, &cliMsg->q); + if (ret != 0) { + destroyCmsg(cliMsg); + goto _RETURN; + } + + ret = tsem_timewait(pSyncMsg->pSem, timeoutMs); + if (ret < 0) { + pRsp->code = TSDB_CODE_TIMEOUT_ERROR; + ret = TSDB_CODE_TIMEOUT_ERROR; + } else { + memcpy(pRsp, pSyncMsg->pRsp, sizeof(STransMsg)); + ret = 0; + } +_RETURN: + transReleaseExHandle(transGetInstMgt(), (int64_t)shandle); + taosReleaseRef(transGetSyncMsgMgt(), ref); + taosRemoveRef(transGetSyncMsgMgt(), ref); return ret; } /* diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index 3dc59a93ee..759a4d79db 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -21,6 +21,9 @@ static TdThreadOnce transModuleInit = PTHREAD_ONCE_INIT; static int32_t refMgt; static int32_t instMgt; +static int32_t transSyncMsgMgt; + +void transDestroySyncMsg(void* msg); int32_t transCompressMsg(char* msg, int32_t len) { int32_t ret = 0; @@ -601,13 +604,15 @@ bool transEpSetIsEqual(SEpSet* a, SEpSet* b) { } static void transInitEnv() { - refMgt = transOpenRefMgt(50000, transDestoryExHandle); + refMgt = transOpenRefMgt(50000, transDestroyExHandle); instMgt = taosOpenRef(50, rpcCloseImpl); + transSyncMsgMgt = taosOpenRef(50, transDestroySyncMsg); uv_os_setenv("UV_TCP_SINGLE_ACCEPT", "1"); } static void transDestroyEnv() { transCloseRefMgt(refMgt); transCloseRefMgt(instMgt); + transCloseRefMgt(transSyncMsgMgt); } void transInit() { @@ -617,6 +622,7 @@ void transInit() { int32_t transGetRefMgt() { return refMgt; } int32_t transGetInstMgt() { return instMgt; } +int32_t transGetSyncMsgMgt() { return transSyncMsgMgt; } void transCleanup() { // clean env @@ -648,13 +654,24 @@ int32_t transReleaseExHandle(int32_t refMgt, int64_t refId) { // release extern handle return taosReleaseRef(refMgt, refId); } -void transDestoryExHandle(void* handle) { +void transDestroyExHandle(void* handle) { if (handle == NULL) { return; } taosMemoryFree(handle); } +void transDestroySyncMsg(void* msg) { + if (msg == NULL) return; + + STransSyncMsg* pSyncMsg = msg; + tsem_destroy(pSyncMsg->pSem); + taosMemoryFree(pSyncMsg->pSem); + + taosMemoryFree(pSyncMsg->pRsp); + taosMemoryFree(pSyncMsg); +} + // void subnetIp2int(const char* const ip_addr, uint8_t* dst) { // char ip_addr_cpy[20]; // char ip[5]; diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index e700ef3d0a..f5e5427c68 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -339,8 +339,9 @@ bool walLogEntriesComplete(const SWal* pWal) { } if (!complete) { - wError("vgId:%d, WAL log entries incomplete in range [%" PRId64 ", %" PRId64 "], aligned with snaphotVer:%" PRId64, - pWal->cfg.vgId, pWal->vers.firstVer, pWal->vers.lastVer, pWal->vers.snapshotVer); + wError("vgId:%d, WAL log entries incomplete in range [%" PRId64 ", %" PRId64 "], index:%" PRId64 + ", snaphotVer:%" PRId64, + pWal->cfg.vgId, pWal->vers.firstVer, pWal->vers.lastVer, index, pWal->vers.snapshotVer); terrno = TSDB_CODE_WAL_LOG_INCOMPLETE; } diff --git a/source/os/src/osRand.c b/source/os/src/osRand.c index b71be59f1d..0e58b7a8ec 100644 --- a/source/os/src/osRand.c +++ b/source/os/src/osRand.c @@ -86,8 +86,7 @@ void taosRandStr(char* str, int32_t size) { } void taosRandStr2(char* str, int32_t size) { - - const char* set = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@"; + const char* set = "abcdefghijklmnopqrstuvwxyz0123456789@"; int32_t len = strlen(set); for (int32_t i = 0; i < size; ++i) { diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 71c29a0b0c..233c04b8e3 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -445,6 +445,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_GEN_ENC_IVLD_KLEN, "Invalid klen to encod // sync TAOS_DEFINE_ERROR(TSDB_CODE_SYN_TIMEOUT, "Sync timeout") +TAOS_DEFINE_ERROR(TSDB_CODE_SYN_MISMATCHED_SIGNATURE, "Sync signature mismatch") TAOS_DEFINE_ERROR(TSDB_CODE_SYN_NOT_LEADER, "Sync leader is unreachable") TAOS_DEFINE_ERROR(TSDB_CODE_SYN_NEW_CONFIG_ERROR, "Sync new config error") TAOS_DEFINE_ERROR(TSDB_CODE_SYN_PROPOSE_NOT_READY, "Sync not ready to propose") diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 8b0451604c..fcd39092bd 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -49,6 +49,10 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_time.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_26.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interval_limit_opt.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interval_unit.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interval_unit.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interval_unit.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interval_unit.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_by_col.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_by_col.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_by_col.py -Q 2 diff --git a/tests/script/tsim/query/unionall_as_table.sim b/tests/script/tsim/query/unionall_as_table.sim index f8145d4e97..a03ecac34a 100644 --- a/tests/script/tsim/query/unionall_as_table.sim +++ b/tests/script/tsim/query/unionall_as_table.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c keepColumnName -v 1 system sh/exec.sh -n dnode1 -s start sql connect @@ -50,4 +51,15 @@ print $data00 if $data00 != 2 then return -1 endi +sql select count(*) from (select f, f from ctcount) +print $data00 +if $data00 != 2 then + return -1 +endi +sql select count(*) from (select last(ts), first(ts) from ctcount); +print $data00 +if $data00 != 1 then + return -1 +endi +sql_error select f from (select f, f from ctcount); system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/system-test/0-others/multilevel.py b/tests/system-test/0-others/multilevel.py index 66434fff67..def2c3152b 100644 --- a/tests/system-test/0-others/multilevel.py +++ b/tests/system-test/0-others/multilevel.py @@ -17,6 +17,28 @@ from util.cases import * from util.sql import * from util.common import * from util.sqlset import * +import glob + +def scanFiles(pattern): + res = [] + for f in glob.iglob(pattern): + res += [f] + return res + +def checkFiles(pattern, state): + res = scanFiles(pattern) + tdLog.info(res) + num = len(res) + if num: + if state: + tdLog.info("%s: %d files exist. expect: files exist" % (pattern, num)) + else: + tdLog.exit("%s: %d files exist. expect: files not exist." % (pattern, num)) + else: + if state: + tdLog.exit("%s: %d files exist. expect: files exist" % (pattern, num)) + else: + tdLog.info("%s: %d files exist. expect: files not exist." % (pattern, num)) class TDTestCase: def init(self, conn, logSql, replicaVar=1): @@ -41,8 +63,8 @@ class TDTestCase: tdDnodes.start(1) tdLog.info("================= step2") - tdSql.haveFile('/mnt/data1/',1) - tdSql.haveFile('/mnt/data2/',0) + checkFiles(r'/mnt/data1/*/*',1) + checkFiles(r'/mnt/data2/*/*',0) tdDnodes.stop(1) def dir_not_exist(self): tdLog.info("============== dir_not_exist test ===============") @@ -156,9 +178,9 @@ class TDTestCase: tdDnodes.start(1) for i in dir_list: if i == '/mnt/data000': - tdSql.haveFile(i,1) + checkFiles("%s/*/*" % i, 1) else: - tdSql.haveFile(i,0) + checkFiles("%s/*/*" % i, 0) def more_than_16_disks(self): tdLog.info("============== more_than_16_disks test ===============") @@ -223,7 +245,8 @@ class TDTestCase: for i in range(10,30): tdSql.execute(f'insert into tb1 values(now-{i}d,10)') tdSql.execute('flush database dbtest') - tdSql.haveFile('/mnt/data1/',1) + time.sleep(3) + checkFiles('/mnt/data1/vnode/*/tsdb/v*',1) tdDnodes.stop(1) cfg={ '/mnt/data1 0 1' : 'dataDir', @@ -234,14 +257,14 @@ class TDTestCase: tdSql.createDir('/mnt/data3') tdDnodes.deploy(1,cfg) tdDnodes.start(1) - tdSql.haveFile('/mnt/data1/',1) - tdSql.haveFile('/mnt/data2/',0) - tdSql.haveFile('/mnt/data3/',0) + checkFiles('/mnt/data1/vnode/*/tsdb/v*',1) + checkFiles('/mnt/data2/vnode/*/tsdb/v*',0) + checkFiles('/mnt/data3/vnode/*/tsdb/v*',0) tdSql.execute('alter database dbtest keep 10d,365d,3650d') tdSql.execute('trim database dbtest') time.sleep(3) - tdSql.haveFile('/mnt/data1/',1) - tdSql.haveFile('/mnt/data2/',1) + checkFiles('/mnt/data1/vnode/*/tsdb/v*',1) + checkFiles('/mnt/data2/vnode/*/tsdb/v*',1) def run(self): self.basic() diff --git a/tests/system-test/2-query/interval_unit.py b/tests/system-test/2-query/interval_unit.py new file mode 100644 index 0000000000..9430c74cff --- /dev/null +++ b/tests/system-test/2-query/interval_unit.py @@ -0,0 +1,197 @@ +import taos +import sys +import time +import socket +import os +import threading +import math + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.common import * +# from tmqCommon import * + +class TDTestCase: + def __init__(self): + self.vgroups = 4 + self.ctbNum = 10 + self.rowsPerTbl = 10000 + self.duraion = '1h' + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), False) + + def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d', precision: str='ms'): + if dropFlag == 1: + tsql.execute("drop database if exists %s"%(dbName), 1) + + tsql.execute("create database if not exists %s vgroups %d replica %d duration %s precision '%s'"%(dbName, vgroups, replica, duration, precision), 1) + tdLog.debug("complete to create database %s"%(dbName)) + return + + def create_stable(self,tsql, paraDict): + colString = tdCom.gen_column_type_str(colname_prefix=paraDict["colPrefix"], column_elm_list=paraDict["colSchema"]) + tagString = tdCom.gen_tag_type_str(tagname_prefix=paraDict["tagPrefix"], tag_elm_list=paraDict["tagSchema"]) + sqlString = f"create table if not exists %s.%s (%s) tags (%s)"%(paraDict["dbName"], paraDict["stbName"], colString, tagString) + tdLog.debug("%s"%(sqlString)) + tsql.execute(sqlString, 1) + return + + def create_ctable(self,tsql=None, dbName='dbx',stbName='stb',ctbPrefix='ctb',ctbNum=1,ctbStartIdx=0): + for i in range(ctbNum): + sqlString = "create table %s.%s%d using %s.%s tags(%d, 'tb%d', 'tb%d', %d, %d, %d)" % \ + (dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,(i+ctbStartIdx) % 5,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx) + tsql.execute(sqlString, 1) + + tdLog.debug("complete to create %d child tables by %s.%s" %(ctbNum, dbName, stbName)) + return + + def insert_data(self,tsql,dbName,ctbPrefix,ctbNum,rowsPerTbl,batchNum,startTs,tsStep): + tdLog.debug("start to insert data ............") + tsql.execute("use %s" %dbName, 1) + pre_insert = "insert into " + sql = pre_insert + + for i in range(ctbNum): + rowsBatched = 0 + sql += " %s%d values "%(ctbPrefix,i) + for j in range(rowsPerTbl): + if (i < ctbNum/2): + sql += "(%d, %d, %d, %d,%d,%d,%d,true,'binary%d', 'nchar%d') "%(startTs + j*tsStep, j%10, j%10, j%10, j%10, j%10, j%10, j%10, j%10) + else: + sql += "(%d, %d, NULL, %d,NULL,%d,%d,true,'binary%d', 'nchar%d') "%(startTs + j*tsStep, j%10, j%10, j%10, j%10, j%10, j%10) + rowsBatched += 1 + if ((rowsBatched == batchNum) or (j == rowsPerTbl - 1)): + tsql.execute(sql, 1) + rowsBatched = 0 + if j < rowsPerTbl - 1: + sql = "insert into %s%d values " %(ctbPrefix,i) + else: + sql = "insert into " + if sql != pre_insert: + tsql.execute(sql, 1) + tdLog.debug("insert data ............ [OK]") + return + + def prepare_db_for_interval_unit_test(self, dbname: str, precision: str = 'ms', startTs = 1537146000000): + self.create_database(tdSql, dbname, precision=precision) + paraDict = {'dbName': dbname, + 'dropFlag': 1, + 'vgroups': 2, + 'stbName': 'meters', + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, + {'type': 'BIGINT', 'count':1}, + {'type': 'FLOAT', 'count':1}, + {'type': 'DOUBLE', 'count':1}, + {'type': 'smallint', 'count':1}, + {'type': 'tinyint', 'count':1}, + {'type': 'bool', 'count':1}, + {'type': 'binary', 'len':10, 'count':1}, + {'type': 'nchar', 'len':10, 'count':1} ], + 'tagSchema': [{'type': 'INT', 'count':1}, + {'type': 'nchar', 'len':20, 'count':1}, + {'type': 'binary', 'len':20, 'count':1}, + {'type': 'BIGINT', 'count':1}, + {'type': 'smallint', 'count':1}, + {'type': 'DOUBLE', 'count':1}], + 'ctbPrefix': 't', + 'ctbStartIdx': 0, + 'ctbNum': 100, + 'rowsPerTbl': 1000, + 'batchNum': 3000, + 'startTs': startTs, + 'tsStep': 100} + + self.create_stable(tdSql, paraDict) + + self.create_ctable(tsql=tdSql, dbName=paraDict["dbName"], \ + stbName=paraDict["stbName"],ctbPrefix=paraDict["ctbPrefix"],\ + ctbNum=paraDict["ctbNum"],ctbStartIdx=paraDict["ctbStartIdx"]) + self.insert_data(tsql=tdSql, dbName=paraDict["dbName"],\ + ctbPrefix=paraDict["ctbPrefix"],ctbNum=paraDict["ctbNum"],\ + rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],\ + startTs=paraDict["startTs"],tsStep=paraDict["tsStep"]) + + def prepare_for_interval_unit_test(self): + self.prepare_db_for_interval_unit_test('msdb', 'ms', startTs=1600000000000) + self.prepare_db_for_interval_unit_test('usdb', 'us', startTs=1600000000000000) + self.prepare_db_for_interval_unit_test('nsdb', 'ns', startTs=1600000000000000000) + + def check_explain_res_has_row(self, plan_str_expect: str, rows): + plan_found = False + for row in rows: + if str(row).find(plan_str_expect) >= 0: + tdLog.debug("plan: [%s] found in: [%s]" % (plan_str_expect, str(row))) + plan_found = True + break + if not plan_found: + tdLog.exit("plan: %s not found in res: [%s]" % (plan_str_expect, str(rows))) + + def explain_and_assert_res(self, sql, expect): + tdSql.query(sql) + res = tdSql.queryResult + self.check_explain_res_has_row(expect, res) + + def test_interval_normal_cases(self): + tdSql.execute('use msdb') + sql_template = 'explain verbose true select count(*), min(c1) from meters interval(%s) sliding(%s)' + + fail_durations = ["'1 s'", "'11ns'", "'11ms'", "'11+2s'", + "' 112s '", '"100s "', "' 112 s '", "'112a20s'", "'s'", + '"1 s"', '"1"', '"100"', '"1y"', '1y', '"1s""', "'12s'12s'", "'12s\""] + + for dura in fail_durations: + tdSql.error(sql_template % (dura, dura)) + + msdb_success_durations = ['1s', '"1s"', '"1000000a"', "'100d'", + "'10m'", '"10h"', '1000'] + + for dura in msdb_success_durations: + tdSql.query(sql_template % (dura, dura), queryTimes=1) + unit = '' + if dura.isdigit(): + unit = 'a' + self.check_explain_res_has_row('interval=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + self.check_explain_res_has_row('sliding=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + + usdb_success_durations = ['"1s"', "'10s'", '"10d"', '"1000000u"', '1000000'] + for dura in usdb_success_durations: + tdSql.execute("use usdb") + tdSql.query(sql_template % (dura, dura), queryTimes=1) + unit = '' + if dura.isdigit(): + unit = 'u' + self.check_explain_res_has_row('interval=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + self.check_explain_res_has_row('sliding=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + + nsdb_success_durations = ['"1s"', "'10s'", '"10d"', '"1000000u"', '"1000000000b"', '1000000000'] + for dura in usdb_success_durations: + tdSql.execute("use nsdb") + tdSql.query(sql_template % (dura, dura), queryTimes=1) + unit = '' + if dura.isdigit(): + unit = 'b' + self.check_explain_res_has_row('interval=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + self.check_explain_res_has_row('sliding=' + dura.lstrip('\'"').rstrip('\'"') + unit, tdSql.queryResult) + + def test_interval_unit_feature(self): + self.prepare_for_interval_unit_test() + self.test_interval_normal_cases() + + def run(self): + self.test_interval_unit_feature() + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +event = threading.Event() + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase())