From 4eba8df3b3559cec8840e77b751f2aa015349f62 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 25 Sep 2024 16:17:21 +0800 Subject: [PATCH 01/56] enh:[TD-32187]test tmq api --- source/client/src/clientTmq.c | 2 +- source/client/test/tmqTest.cpp | 7 +-- tests/system-test/7-tmq/td-32187.py | 80 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 tests/system-test/7-tmq/td-32187.py diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 975d14f3ee..71864d8b9c 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -41,7 +41,7 @@ #define SET_ERROR_MSG_TMQ(MSG) \ - if (errstr != NULL) (void)snprintf(errstr, errstrLen, MSG); + if (errstr != NULL && errstrLen > 0) (void)snprintf(errstr, errstrLen, MSG); #define PROCESS_POLL_RSP(FUNC,DATA) \ SDecoder decoder = {0}; \ diff --git a/source/client/test/tmqTest.cpp b/source/client/test/tmqTest.cpp index c7a75e352a..7505e81884 100644 --- a/source/client/test/tmqTest.cpp +++ b/source/client/test/tmqTest.cpp @@ -33,9 +33,10 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -TEST(testCase, driverInit_Test) { - // taosInitGlobalCfg(); - // taos_init(); +TEST(testCase, tmq_api_Test) { + tmq_conf_t *conf = tmq_conf_new(); + char msg[128] = {0}; + tmq_consumer_new(NULL, msg, -1); } TEST(testCase, create_topic_ctb_Test) { diff --git a/tests/system-test/7-tmq/td-32187.py b/tests/system-test/7-tmq/td-32187.py new file mode 100644 index 0000000000..73c7a88f65 --- /dev/null +++ b/tests/system-test/7-tmq/td-32187.py @@ -0,0 +1,80 @@ + +import taos +import sys +import time +import socket +import os +import threading + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.common import * +from taos.tmq import * +sys.path.append("./7-tmq") +from tmqCommon import * + +class TDTestCase: + clientCfgDict = {'debugFlag': 135} + updatecfgDict = {'debugFlag': 135, 'clientCfg':clientCfgDict} + # updatecfgDict = {'debugFlag': 135, 'clientCfg':clientCfgDict, 'tmqRowSize':1} + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + + def consume_test(self): + + tdSql.execute(f'create database if not exists d1') + tdSql.execute(f'use d1') + tdSql.execute(f'create table st(ts timestamp, i int) tags(t int)') + tdSql.execute(f'insert into t1 using st tags(1) values(now, 1) (now+1s, 2)') + tdSql.execute(f'insert into t2 using st tags(2) values(now, 1) (now+1s, 2)') + tdSql.execute(f'insert into t3 using st tags(3) values(now, 1) (now+1s, 2)') + + + tdSql.execute(f'create topic topic_all as select * from st') + consumer_dict = { + "group.id": "g1", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "auto.offset.reset": "earliest", + } + consumer = Consumer(consumer_dict) + + try: + consumer.unsubscribe() + consumer.unsubscribe() + consumer.subscribe(["topic_all"]) + consumer.subscribe(["topic_all"]) + except TmqError: + tdLog.exit(f"subscribe error") + + cnt = 0 + try: + while True: + res = consumer.poll(2) + if not res: + break + val = res.value() + if val is None: + print(f"null val") + continue + for block in val: + cnt += len(block.fetchall()) + + print(f"block {cnt} rows") + + finally: + consumer.unsubscribe(); + consumer.close() + def run(self): + self.consume_test() + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) From c7f6349e14eeff5ae442c26ffdff2e26f7140808 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 10 Oct 2024 10:35:29 +0800 Subject: [PATCH 02/56] tsnprintf --- include/os/osString.h | 7 ++--- source/libs/command/src/command.c | 16 +++++++----- source/libs/function/src/tudf.c | 2 +- source/os/src/osString.c | 15 +++++++++++ source/os/test/osStringTests.cpp | 43 +++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 10 deletions(-) diff --git a/include/os/osString.h b/include/os/osString.h index b184e7efdb..5c6b5b06cf 100644 --- a/include/os/osString.h +++ b/include/os/osString.h @@ -59,12 +59,13 @@ typedef enum { M2C = 0, C2M } ConvType; #endif -#define tstrncpy(dst, src, size) \ - do { \ +#define tstrncpy(dst, src, size) \ + do { \ (void)strncpy((dst), (src), (size)); \ - (dst)[(size)-1] = 0; \ + (dst)[(size) - 1] = 0; \ } while (0) +int64_t tsnprintf(char *dst, int64_t size, const char *format, ...); #define TAOS_STRCPY(_dst, _src) ((void)strcpy(_dst, _src)) #define TAOS_STRNCPY(_dst, _src, _size) ((void)strncpy(_dst, _src, _size)) #define TAOS_STRCAT(_dst, _src) ((void)strcat(_dst, _src)) diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 1ab568905f..dac14de678 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -510,20 +510,24 @@ void appendColumnFields(char* buf, int32_t* len, STableCfg* pCfg) { #define LTYPE_LEN (32 + 60) // 60 byte for compress info char type[LTYPE_LEN]; snprintf(type, LTYPE_LEN, "%s", tDataTypes[pSchema->type].name); + int typeLen = strlen(type); if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_VARBINARY == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { - snprintf(type + strlen(type), LTYPE_LEN - strlen(type), "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); + snprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { - snprintf(type + strlen(type), LTYPE_LEN - strlen(type), "(%d)", + snprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } if (useCompress(pCfg->tableType) && pCfg->pSchemaExt) { - snprintf(type + strlen(type), LTYPE_LEN - strlen(type), " ENCODE \'%s\'", + typeLen = strlen(type); + snprintf(type + typeLen, LTYPE_LEN - typeLen, " ENCODE \'%s\'", columnEncodeStr(COMPRESS_L1_TYPE_U32(pCfg->pSchemaExt[i].compress))); - snprintf(type + strlen(type), LTYPE_LEN - strlen(type), " COMPRESS \'%s\'", + typeLen = strlen(type); + snprintf(type + typeLen, LTYPE_LEN - typeLen, " COMPRESS \'%s\'", columnCompressStr(COMPRESS_L2_TYPE_U32(pCfg->pSchemaExt[i].compress))); - snprintf(type + strlen(type), LTYPE_LEN - strlen(type), " LEVEL \'%s\'", + typeLen = strlen(type); + snprintf(type + typeLen, LTYPE_LEN - typeLen, " LEVEL \'%s\'", columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(pCfg->pSchemaExt[i].compress))); } if (!(pSchema->flags & COL_IS_KEY)) { @@ -694,7 +698,7 @@ void appendTableOptions(char* buf, int32_t* len, SDbCfgInfo* pDbCfg, STableCfg* if (nSma < pCfg->numOfColumns && nSma > 0) { bool smaOn = false; - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " SMA("); for (int32_t i = 0; i < pCfg->numOfColumns; ++i) { if (IS_BSMA_ON(pCfg->pSchemas + i)) { diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 3a0cff7cf3..7496cc492c 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -143,7 +143,7 @@ static int32_t udfSpawnUdfd(SUdfdData *pData) { char udfdPathLdLib[1024] = {0}; size_t udfdLdLibPathLen = strlen(tsUdfdLdLibPath); - tstrncpy(udfdPathLdLib, tsUdfdLdLibPath, sizeof(udfdPathLdLib) < sizeof(tsUdfdLdLibPath) ? sizeof(udfdPathLdLib) : sizeof(tsUdfdLdLibPath)); + tstrncpy(udfdPathLdLib, tsUdfdLdLibPath, sizeof(udfdPathLdLib)); udfdPathLdLib[udfdLdLibPathLen] = ':'; tstrncpy(udfdPathLdLib + udfdLdLibPathLen + 1, pathTaosdLdLib, sizeof(udfdPathLdLib) - udfdLdLibPathLen - 1); diff --git a/source/os/src/osString.c b/source/os/src/osString.c index d265ed510a..16e28f78b2 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -710,3 +710,18 @@ int32_t taosAscii2Hex(const char *z, uint32_t n, void **data, uint32_t *size) { return 0; } + +int64_t tsnprintf(char *dst, int64_t size, const char *format, ...) { + if (size <= 0 || size > SIZE_MAX) return 0; + + int64_t ret; + va_list args; + va_start(args, format); + ret = vsnprintf(dst, size, format, args); + va_end(args ); + if (ret >= size) { + return size - 1; + } else { + return ret; + } +} diff --git a/source/os/test/osStringTests.cpp b/source/os/test/osStringTests.cpp index 9565e568fb..03cab70f30 100644 --- a/source/os/test/osStringTests.cpp +++ b/source/os/test/osStringTests.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #pragma GCC diagnostic push @@ -111,3 +112,45 @@ TEST(osStringTests, osUcs4lenTests2) { TdUcs4 ucs4_3[] = {'C', 'h', 'i', 'n', 'a', 0x4E2D, 0x6587, '\0'}; EXPECT_EQ(taosUcs4len(ucs4_3), 7); } + +TEST(osStringTests, ostsnprintfTests) { + char buffer[50] = {0}; + int64_t ret; + + ret = tsnprintf(buffer, sizeof(buffer), "Hello, %s!", "World"); + EXPECT_EQ(ret, 13); + EXPECT_STREQ(buffer, "Hello, World!"); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, 10, "Hello, %s!", "World"); + EXPECT_EQ(ret, 9); + EXPECT_EQ(strncmp(buffer, "Hello, Wo", 9), 0); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, 10, "Hello%s", "World"); + EXPECT_EQ(ret, 9); + EXPECT_EQ(strncmp(buffer, "Hello, Wo", 9), 0); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, 0, "Hello, %s!", "World"); + EXPECT_EQ(ret, 0); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, SIZE_MAX + 1, "Hello, %s!", "World"); + EXPECT_EQ(ret, 0); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, sizeof(buffer), ""); + EXPECT_EQ(ret, 0); + EXPECT_STREQ(buffer, ""); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, sizeof(buffer), "Number: %d", 42); + EXPECT_EQ(ret, 10); + EXPECT_STREQ(buffer, "Number: 42"); + + memset(buffer, 0, sizeof(buffer)); + ret = tsnprintf(buffer, sizeof(buffer), "Float: %.2f", 3.14); + EXPECT_EQ(ret, 11); + EXPECT_STREQ(buffer, "Float: 3.14"); +} From e03ccdc6e223f9385c05c83e563a93df6369a929 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 10 Oct 2024 10:35:48 +0800 Subject: [PATCH 03/56] replace snprintf --- source/client/src/clientEnv.c | 2 +- source/client/src/clientMonitor.c | 2 +- source/common/src/cos.c | 14 ++-- source/common/src/tdatablock.c | 38 +++++------ source/common/src/tmisce.c | 10 +-- source/common/src/tname.c | 2 +- source/common/src/ttime.c | 2 +- source/dnode/mgmt/exe/dmMain.c | 2 +- source/dnode/mgmt/mgmt_mnode/src/mmFile.c | 6 +- source/dnode/mgmt/mgmt_vnode/src/vmFile.c | 4 +- source/dnode/mgmt/node_util/src/dmEps.c | 6 +- source/dnode/mgmt/node_util/src/dmFile.c | 18 ++--- source/dnode/mnode/impl/src/mndCompact.c | 4 +- source/dnode/mnode/impl/src/mndProfile.c | 2 +- source/dnode/mnode/impl/src/mndSma.c | 10 +-- source/dnode/mnode/impl/src/mndTrans.c | 10 +-- source/dnode/vnode/src/tq/tqOffset.c | 2 +- source/libs/command/src/command.c | 68 +++++++++---------- source/libs/function/src/builtinsimpl.c | 8 +-- source/libs/function/src/functionMgt.c | 2 +- source/libs/nodes/src/nodesToSQLFuncs.c | 40 +++++------ source/libs/nodes/src/nodesUtilFuncs.c | 4 +- source/libs/parser/src/parTranslater.c | 16 ++--- source/libs/parser/src/parUtil.c | 8 +-- source/libs/planner/src/planOptimizer.c | 12 ++-- source/libs/planner/src/planSpliter.c | 4 +- source/libs/planner/src/planUtil.c | 2 +- source/libs/qcom/src/queryUtil.c | 24 +++---- source/libs/scalar/src/sclfunc.c | 6 +- source/libs/scheduler/src/schUtil.c | 4 +- source/libs/stream/src/streamBackendRocksdb.c | 62 ++++++++--------- source/libs/stream/src/streamCheckpoint.c | 12 ++-- source/libs/stream/src/streamSnapshot.c | 4 +- source/libs/sync/src/syncMain.c | 6 +- source/libs/sync/src/syncUtil.c | 40 +++++------ source/libs/transport/src/thttp.c | 8 +-- source/libs/transport/src/transComm.c | 8 +-- source/os/src/osSysinfo.c | 2 +- source/util/src/tanal.c | 34 +++++----- source/util/src/tconfig.c | 16 ++--- source/util/src/tstrbuild.c | 4 +- tools/shell/src/shellEngine.c | 8 +-- 42 files changed, 268 insertions(+), 268 deletions(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 3b755c2921..ac346f4ba7 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -117,7 +117,7 @@ static void concatStrings(SArray *list, char *buf, int size) { (void)strcat(buf, ","); len += 1; } - int ret = snprintf(buf + len, size - len, "%s", db); + int ret = tsnprintf(buf + len, size - len, "%s", db); if (ret < 0) { tscError("snprintf failed, buf:%s, ret:%d", buf, ret); break; diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index 6667c4c741..f181b345d7 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -21,7 +21,7 @@ char tmpSlowLogPath[PATH_MAX] = {0}; TdThread monitorThread; static int32_t getSlowLogTmpDir(char* tmpPath, int32_t size) { - int ret = snprintf(tmpPath, size, "%s/tdengine_slow_log/", tsTempDir); + int ret = tsnprintf(tmpPath, size, "%s/tdengine_slow_log/", tsTempDir); if (ret < 0) { tscError("failed to get tmp path ret:%d", ret); return TSDB_CODE_TSC_INTERNAL_ERROR; diff --git a/source/common/src/cos.c b/source/common/src/cos.c index c2b9fe34e1..453b924f31 100644 --- a/source/common/src/cos.c +++ b/source/common/src/cos.c @@ -260,19 +260,19 @@ static void responseCompleteCallback(S3Status status, const S3ErrorDetails *erro const int elen = sizeof(cbd->err_msg); if (error) { if (error->message && elen - len > 0) { - len += snprintf(&(cbd->err_msg[len]), elen - len, " Message: %s\n", error->message); + len += tsnprintf(&(cbd->err_msg[len]), elen - len, " Message: %s\n", error->message); } if (error->resource && elen - len > 0) { - len += snprintf(&(cbd->err_msg[len]), elen - len, " Resource: %s\n", error->resource); + len += tsnprintf(&(cbd->err_msg[len]), elen - len, " Resource: %s\n", error->resource); } if (error->furtherDetails && elen - len > 0) { - len += snprintf(&(cbd->err_msg[len]), elen - len, " Further Details: %s\n", error->furtherDetails); + len += tsnprintf(&(cbd->err_msg[len]), elen - len, " Further Details: %s\n", error->furtherDetails); } if (error->extraDetailsCount && elen - len > 0) { - len += snprintf(&(cbd->err_msg[len]), elen - len, "%s", " Extra Details:\n"); + len += tsnprintf(&(cbd->err_msg[len]), elen - len, "%s", " Extra Details:\n"); for (int i = 0; i < error->extraDetailsCount; i++) { if (elen - len > 0) { - len += snprintf(&(cbd->err_msg[len]), elen - len, " %s: %s\n", error->extraDetails[i].name, + len += tsnprintf(&(cbd->err_msg[len]), elen - len, " %s: %s\n", error->extraDetails[i].name, error->extraDetails[i].value); } } @@ -753,7 +753,7 @@ upload: if (!manager.etags[i]) { TAOS_CHECK_GOTO(TAOS_SYSTEM_ERROR(EIO), &lino, _exit); } - n = snprintf(buf, sizeof(buf), + n = tsnprintf(buf, sizeof(buf), "%d" "%s", i + 1, manager.etags[i]); @@ -919,7 +919,7 @@ upload: char buf[256]; int n; for (int i = 0; i < cp.part_num; ++i) { - n = snprintf(buf, sizeof(buf), + n = tsnprintf(buf, sizeof(buf), "%d" "%s", // i + 1, manager.etags[i]); diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 7a67522231..dcf607a258 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -2510,7 +2510,7 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf } int32_t colNum = taosArrayGetSize(pDataBlock->pDataBlock); - len += snprintf(dumpBuf + len, size - len, + len += tsnprintf(dumpBuf + len, size - len, "%s===stream===%s|block type %d|child id %d|group id:%" PRIu64 "|uid:%" PRId64 "|rows:%" PRId64 "|version:%" PRIu64 "|cal start:%" PRIu64 "|cal end:%" PRIu64 "|tbl:%s\n", taskIdStr, flag, (int32_t)pDataBlock->info.type, pDataBlock->info.childId, @@ -2521,7 +2521,7 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf } for (int32_t j = 0; j < rows; j++) { - len += snprintf(dumpBuf + len, size - len, "%s|", flag); + len += tsnprintf(dumpBuf + len, size - len, "%s|", flag); if (len >= size - 1) { goto _exit; } @@ -2534,7 +2534,7 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf } if (colDataIsNull(pColInfoData, rows, j, NULL) || !pColInfoData->pData) { - len += snprintf(dumpBuf + len, size - len, " %15s |", "NULL"); + len += tsnprintf(dumpBuf + len, size - len, " %15s |", "NULL"); if (len >= size - 1) goto _exit; continue; } @@ -2544,51 +2544,51 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf case TSDB_DATA_TYPE_TIMESTAMP: memset(pBuf, 0, sizeof(pBuf)); (void)formatTimestamp(pBuf, *(uint64_t*)var, pColInfoData->info.precision); - len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf); + len += tsnprintf(dumpBuf + len, size - len, " %25s |", pBuf); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_TINYINT: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(int8_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(int8_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_UTINYINT: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(uint8_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(uint8_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_SMALLINT: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(int16_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(int16_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_USMALLINT: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(uint16_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(uint16_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_INT: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(int32_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(int32_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_UINT: - len += snprintf(dumpBuf + len, size - len, " %15u |", *(uint32_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15u |", *(uint32_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_BIGINT: - len += snprintf(dumpBuf + len, size - len, " %15" PRId64 " |", *(int64_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15" PRId64 " |", *(int64_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_UBIGINT: - len += snprintf(dumpBuf + len, size - len, " %15" PRIu64 " |", *(uint64_t*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15" PRIu64 " |", *(uint64_t*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_FLOAT: - len += snprintf(dumpBuf + len, size - len, " %15f |", *(float*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15f |", *(float*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_DOUBLE: - len += snprintf(dumpBuf + len, size - len, " %15f |", *(double*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15f |", *(double*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_BOOL: - len += snprintf(dumpBuf + len, size - len, " %15d |", *(bool*)var); + len += tsnprintf(dumpBuf + len, size - len, " %15d |", *(bool*)var); if (len >= size - 1) goto _exit; break; case TSDB_DATA_TYPE_VARCHAR: @@ -2599,7 +2599,7 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf int32_t dataSize = TMIN(sizeof(pBuf), varDataLen(pData)); dataSize = TMIN(dataSize, 50); memcpy(pBuf, varDataVal(pData), dataSize); - len += snprintf(dumpBuf + len, size - len, " %15s |", pBuf); + len += tsnprintf(dumpBuf + len, size - len, " %15s |", pBuf); if (len >= size - 1) goto _exit; } break; case TSDB_DATA_TYPE_NCHAR: { @@ -2611,15 +2611,15 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf uError("func %s failed to convert to ucs charset since %s", __func__, tstrerror(code)); goto _exit; } - len += snprintf(dumpBuf + len, size - len, " %15s |", pBuf); + len += tsnprintf(dumpBuf + len, size - len, " %15s |", pBuf); if (len >= size - 1) goto _exit; } break; } } - len += snprintf(dumpBuf + len, size - len, "%d\n", j); + len += tsnprintf(dumpBuf + len, size - len, "%d\n", j); if (len >= size - 1) goto _exit; } - len += snprintf(dumpBuf + len, size - len, "%s |end\n", flag); + len += tsnprintf(dumpBuf + len, size - len, "%s |end\n", flag); _exit: if (code == TSDB_CODE_SUCCESS) { diff --git a/source/common/src/tmisce.c b/source/common/src/tmisce.c index 10375ba857..6d2b71a214 100644 --- a/source/common/src/tmisce.c +++ b/source/common/src/tmisce.c @@ -143,7 +143,7 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { int32_t ret = 0; int32_t nwrite = 0; - nwrite = snprintf(pBuf + nwrite, cap, "epset:{"); + nwrite = tsnprintf(pBuf + nwrite, cap, "epset:{"); if (nwrite <= 0 || nwrite >= cap) { return TSDB_CODE_OUT_OF_BUFFER; } @@ -151,9 +151,9 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { for (int _i = 0; (_i < pEpSet->numOfEps) && (cap > 0); _i++) { if (_i == pEpSet->numOfEps - 1) { - ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); + ret = tsnprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); } else { - ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); + ret = tsnprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); } if (ret <= 0 || ret >= cap) { @@ -168,7 +168,7 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { return TSDB_CODE_OUT_OF_BUFFER; } - ret = snprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse); + ret = tsnprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse); if (ret <= 0 || ret >= cap) { return TSDB_CODE_OUT_OF_BUFFER; } else { @@ -215,7 +215,7 @@ int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "numOfCpu", tsNumOfCores), NULL, _exit); } - int32_t nBytes = snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB); + int32_t nBytes = tsnprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB); if (nBytes <= 9 || nBytes >= sizeof(tmp)) { TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_RANGE, NULL, _exit); } diff --git a/source/common/src/tname.c b/source/common/src/tname.c index a9dda87591..cf9e8186cd 100644 --- a/source/common/src/tname.c +++ b/source/common/src/tname.c @@ -103,7 +103,7 @@ int32_t tNameExtractFullName(const SName* name, char* dst) { return TSDB_CODE_INVALID_PARA; } - int32_t len = snprintf(dst, TSDB_DB_FNAME_LEN, "%d.%s", name->acctId, name->dbname); + int32_t len = tsnprintf(dst, TSDB_DB_FNAME_LEN, "%d.%s", name->acctId, name->dbname); size_t tnameLen = strlen(name->tname); if (tnameLen > 0) { diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c index 98e46ab672..afadab7aa1 100644 --- a/source/common/src/ttime.c +++ b/source/common/src/ttime.c @@ -997,7 +997,7 @@ int32_t taosFormatUtcTime(char* buf, int32_t bufLen, int64_t t, int32_t precisio TAOS_RETURN(TAOS_SYSTEM_ERROR(errno)); } int32_t length = (int32_t)strftime(ts, 40, "%Y-%m-%dT%H:%M:%S", &ptm); - length += snprintf(ts + length, fractionLen, format, mod); + length += tsnprintf(ts + length, fractionLen, format, mod); length += (int32_t)strftime(ts + length, 40 - length, "%z", &ptm); tstrncpy(buf, ts, bufLen); diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 89569d69d6..8306406d64 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -280,7 +280,7 @@ static void dmPrintArgs(int32_t argc, char const *argv[]) { taosGetCwd(path, sizeof(path)); char args[1024] = {0}; - int32_t arglen = snprintf(args, sizeof(args), "%s", argv[0]); + int32_t arglen = tsnprintf(args, sizeof(args), "%s", argv[0]); for (int32_t i = 1; i < argc; ++i) { arglen = arglen + snprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]); } diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c index a95ec42f7e..11ed02b283 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c @@ -64,7 +64,7 @@ int32_t mmReadFile(const char *path, SMnodeOpt *pOption) { SJson *pJson = NULL; char file[PATH_MAX] = {0}; - int32_t nBytes = snprintf(file, sizeof(file), "%s%smnode.json", path, TD_DIRSEP); + int32_t nBytes = tsnprintf(file, sizeof(file), "%s%smnode.json", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -168,13 +168,13 @@ int32_t mmWriteFile(const char *path, const SMnodeOpt *pOption) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = snprintf(file, sizeof(file), "%s%smnode.json.bak", path, TD_DIRSEP); + int32_t nBytes = tsnprintf(file, sizeof(file), "%s%smnode.json.bak", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; } - nBytes = snprintf(realfile, sizeof(realfile), "%s%smnode.json", path, TD_DIRSEP); + nBytes = tsnprintf(realfile, sizeof(realfile), "%s%smnode.json", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(realfile)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index 5fabd4cdde..ca64ecabfc 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -204,12 +204,12 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = snprintf(file, sizeof(file), "%s%svnodes_tmp.json", pMgmt->path, TD_DIRSEP); + int32_t nBytes = tsnprintf(file, sizeof(file), "%s%svnodes_tmp.json", pMgmt->path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { return TSDB_CODE_OUT_OF_RANGE; } - nBytes = snprintf(realfile, sizeof(realfile), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); + nBytes = tsnprintf(realfile, sizeof(realfile), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(realfile)) { return TSDB_CODE_OUT_OF_RANGE; } diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index db401375c7..49c1bdf3df 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -461,12 +461,12 @@ void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) { int32_t n = 0; - n += snprintf(buf + n, len - n, "%s", "{"); + n += tsnprintf(buf + n, len - n, "%s", "{"); for (int i = 0; i < epSet->numOfEps; i++) { - n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, + n += tsnprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, (i + 1 < epSet->numOfEps ? ", " : "")); } - n += snprintf(buf + n, len - n, "%s", "}"); + n += tsnprintf(buf + n, len - n, "%s", "}"); } static FORCE_INLINE void dmSwapEps(SEp *epLhs, SEp *epRhs) { diff --git a/source/dnode/mgmt/node_util/src/dmFile.c b/source/dnode/mgmt/node_util/src/dmFile.c index 1da13f72cd..064b107d58 100644 --- a/source/dnode/mgmt/node_util/src/dmFile.c +++ b/source/dnode/mgmt/node_util/src/dmFile.c @@ -42,7 +42,7 @@ int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) { char *content = NULL; SJson *pJson = NULL; char file[PATH_MAX] = {0}; - int32_t nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); + int32_t nBytes = tsnprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -120,13 +120,13 @@ int32_t dmWriteFile(const char *path, const char *name, bool deployed) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); + int32_t nBytes = tsnprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; } - nBytes = snprintf(realfile, sizeof(realfile), "%s%s%s.json", path, TD_DIRSEP, name); + nBytes = tsnprintf(realfile, sizeof(realfile), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -387,22 +387,22 @@ int32_t dmUpdateEncryptKey(char *key, bool toLogFile) { char checkFile[PATH_MAX] = {0}; char realCheckFile[PATH_MAX] = {0}; - int32_t nBytes = snprintf(folder, sizeof(folder), "%s%sdnode", tsDataDir, TD_DIRSEP); + int32_t nBytes = tsnprintf(folder, sizeof(folder), "%s%sdnode", tsDataDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = snprintf(encryptFile, sizeof(realEncryptFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); + nBytes = tsnprintf(encryptFile, sizeof(realEncryptFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = snprintf(realEncryptFile, sizeof(realEncryptFile), "%s%s%s", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); + nBytes = tsnprintf(realEncryptFile, sizeof(realEncryptFile), "%s%s%s", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = snprintf(checkFile, sizeof(checkFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_CHECK_CODE_FILE); + nBytes = tsnprintf(checkFile, sizeof(checkFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_CHECK_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } @@ -507,14 +507,14 @@ int32_t dmGetEncryptKey() { char *encryptKey = NULL; char *content = NULL; - int32_t nBytes = snprintf(encryptFile, sizeof(encryptFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, + int32_t nBytes = tsnprintf(encryptFile, sizeof(encryptFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= sizeof(encryptFile)) { code = TSDB_CODE_OUT_OF_BUFFER; return code; } - nBytes = snprintf(checkFile, sizeof(checkFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_CHECK_CODE_FILE); + nBytes = tsnprintf(checkFile, sizeof(checkFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_CHECK_CODE_FILE); if (nBytes <= 0 || nBytes >= sizeof(checkFile)) { code = TSDB_CODE_OUT_OF_BUFFER; return code; diff --git a/source/dnode/mnode/impl/src/mndCompact.c b/source/dnode/mnode/impl/src/mndCompact.c index 2e40965c18..106680da7f 100644 --- a/source/dnode/mnode/impl/src/mndCompact.c +++ b/source/dnode/mnode/impl/src/mndCompact.c @@ -640,10 +640,10 @@ void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact) { rpcMsg.pCont = pHead; char detail[1024] = {0}; - int32_t len = snprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", + int32_t len = tsnprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", TMSG_INFO(TDMT_VND_QUERY_COMPACT_PROGRESS), epSet.numOfEps, epSet.inUse); for (int32_t i = 0; i < epSet.numOfEps; ++i) { - len += snprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, epSet.eps[i].fqdn, epSet.eps[i].port); + len += tsnprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, epSet.eps[i].fqdn, epSet.eps[i].port); } mDebug("compact:%d, send update progress msg to %s", pDetail->compactId, detail); diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index 4dc2f093e8..a1ffee9b06 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -140,7 +140,7 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType SProfileMgmt *pMgmt = &pMnode->profileMgmt; char connStr[255] = {0}; - int32_t len = snprintf(connStr, sizeof(connStr), "%s%d%d%d%s", user, ip, port, pid, app); + int32_t len = tsnprintf(connStr, sizeof(connStr), "%s%d%d%d%s", user, ip, port, pid, app); uint32_t connId = mndGenerateUid(connStr, len); if (startTime == 0) startTime = taosGetTimestampMs(); diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index a3b3ec01fb..a54c7f1b14 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -1231,7 +1231,7 @@ static int32_t mndGetSma(SMnode *pMnode, SUserIndexReq *indexReq, SUserIndexRsp SNode *node = NULL; FOREACH(node, pList) { SFunctionNode *pFunc = (SFunctionNode *)node; - extOffset += snprintf(rsp->indexExts + extOffset, sizeof(rsp->indexExts) - extOffset - 1, "%s%s", + extOffset += tsnprintf(rsp->indexExts + extOffset, sizeof(rsp->indexExts) - extOffset - 1, "%s%s", (extOffset ? "," : ""), pFunc->functionName); } @@ -2221,10 +2221,10 @@ static int32_t mndRetrieveTSMA(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlo int32_t len = 0; if (TSDB_CODE_SUCCESS == code) { if (!IS_CALENDAR_TIME_DURATION(pSma->intervalUnit)) { - len = snprintf(interval + VARSTR_HEADER_SIZE, 64, "%" PRId64 "%c", pSma->interval, + len = tsnprintf(interval + VARSTR_HEADER_SIZE, 64, "%" PRId64 "%c", pSma->interval, getPrecisionUnit(pSrcDb->cfg.precision)); } else { - len = snprintf(interval + VARSTR_HEADER_SIZE, 64, "%" PRId64 "%c", pSma->interval, pSma->intervalUnit); + len = tsnprintf(interval + VARSTR_HEADER_SIZE, 64, "%" PRId64 "%c", pSma->interval, pSma->intervalUnit); } varDataSetLen(interval, len); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); @@ -2235,7 +2235,7 @@ static int32_t mndRetrieveTSMA(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlo if (TSDB_CODE_SUCCESS == code) { // create sql pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - len = snprintf(buf + VARSTR_HEADER_SIZE, TSDB_MAX_SAVED_SQL_LEN, "%s", pSma->sql); + len = tsnprintf(buf + VARSTR_HEADER_SIZE, TSDB_MAX_SAVED_SQL_LEN, "%s", pSma->sql); varDataSetLen(buf, TMIN(len, TSDB_MAX_SAVED_SQL_LEN)); code = colDataSetVal(pColInfo, numOfRows, buf, false); } @@ -2252,7 +2252,7 @@ static int32_t mndRetrieveTSMA(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlo if (nodeType(pFunc) == QUERY_NODE_FUNCTION) { SFunctionNode *pFuncNode = (SFunctionNode *)pFunc; if (!fmIsTSMASupportedFunc(pFuncNode->funcId)) continue; - len += snprintf(start, TSDB_MAX_SAVED_SQL_LEN - len, "%s%s", start != buf + VARSTR_HEADER_SIZE ? "," : "", + len += tsnprintf(start, TSDB_MAX_SAVED_SQL_LEN - len, "%s%s", start != buf + VARSTR_HEADER_SIZE ? "," : "", ((SExprNode *)pFunc)->userAlias); if (len >= TSDB_MAX_SAVED_SQL_LEN) { len = TSDB_MAX_SAVED_SQL_LEN; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 40bb99d6b5..83facd0af6 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1338,10 +1338,10 @@ static int32_t mndTransSendSingleMsg(SMnode *pMnode, STrans *pTrans, STransActio memcpy(rpcMsg.pCont, pAction->pCont, pAction->contLen); char detail[1024] = {0}; - int32_t len = snprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", TMSG_INFO(pAction->msgType), + int32_t len = tsnprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", TMSG_INFO(pAction->msgType), pAction->epSet.numOfEps, pAction->epSet.inUse); for (int32_t i = 0; i < pAction->epSet.numOfEps; ++i) { - len += snprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, pAction->epSet.eps[i].fqdn, + len += tsnprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, pAction->epSet.eps[i].fqdn, pAction->epSet.eps[i].port); } @@ -2018,14 +2018,14 @@ static int32_t mndRetrieveTrans(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl char lastInfo[TSDB_TRANS_ERROR_LEN + VARSTR_HEADER_SIZE] = {0}; char detail[TSDB_TRANS_ERROR_LEN + 1] = {0}; - int32_t len = snprintf(detail, sizeof(detail), "action:%d code:0x%x(%s) ", pTrans->lastAction, + int32_t len = tsnprintf(detail, sizeof(detail), "action:%d code:0x%x(%s) ", pTrans->lastAction, pTrans->lastErrorNo & 0xFFFF, tstrerror(pTrans->lastErrorNo)); SEpSet epset = pTrans->lastEpset; if (epset.numOfEps > 0) { - len += snprintf(detail + len, sizeof(detail) - len, "msgType:%s numOfEps:%d inUse:%d ", + len += tsnprintf(detail + len, sizeof(detail) - len, "msgType:%s numOfEps:%d inUse:%d ", TMSG_INFO(pTrans->lastMsgType), epset.numOfEps, epset.inUse); for (int32_t i = 0; i < pTrans->lastEpset.numOfEps; ++i) { - len += snprintf(detail + len, sizeof(detail) - len, "ep:%d-%s:%u ", i, epset.eps[i].fqdn, epset.eps[i].port); + len += tsnprintf(detail + len, sizeof(detail) - len, "ep:%d-%s:%u ", i, epset.eps[i].fqdn, epset.eps[i].port); } } STR_WITH_MAXSIZE_TO_VARSTR(lastInfo, detail, pShow->pMeta->pSchemas[cols].bytes); diff --git a/source/dnode/vnode/src/tq/tqOffset.c b/source/dnode/vnode/src/tq/tqOffset.c index 2c892998d2..f392269b9f 100644 --- a/source/dnode/vnode/src/tq/tqOffset.c +++ b/source/dnode/vnode/src/tq/tqOffset.c @@ -22,7 +22,7 @@ int32_t tqBuildFName(char** data, const char* path, char* name) { if(fname == NULL) { return terrno; } - int32_t code = snprintf(fname, len, "%s%s%s", path, TD_DIRSEP, name); + int32_t code = tsnprintf(fname, len, "%s%s%s", path, TD_DIRSEP, name); if (code < 0){ code = TAOS_SYSTEM_ERROR(errno); taosMemoryFree(fname); diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index dac14de678..8429e04a3e 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -303,13 +303,13 @@ static int32_t buildRetension(SArray* pRetension, char** ppRetentions) { int64_t v1 = getValOfDiffPrecision(p->freqUnit, p->freq); int64_t v2 = getValOfDiffPrecision(p->keepUnit, p->keep); if (i == 0) { - len += snprintf(p1 + len, lMaxLen - len, "-:%" PRId64 "%c", v2, p->keepUnit); + len += tsnprintf(p1 + len, lMaxLen - len, "-:%" PRId64 "%c", v2, p->keepUnit); } else { - len += snprintf(p1 + len, lMaxLen - len, "%" PRId64 "%c:%" PRId64 "%c", v1, p->freqUnit, v2, p->keepUnit); + len += tsnprintf(p1 + len, lMaxLen - len, "%" PRId64 "%c:%" PRId64 "%c", v1, p->freqUnit, v2, p->keepUnit); } if (i < size - 1) { - len += snprintf(p1 + len, lMaxLen - len, ","); + len += tsnprintf(p1 + len, lMaxLen - len, ","); } } @@ -352,12 +352,12 @@ int32_t formatDurationOrKeep(char* buffer, int64_t bufSize, int32_t timeInMinute int32_t len = 0; if (timeInMinutes % 1440 == 0) { int32_t days = timeInMinutes / 1440; - len = snprintf(buffer, bufSize, "%dd", days); + len = tsnprintf(buffer, bufSize, "%dd", days); } else if (timeInMinutes % 60 == 0) { int32_t hours = timeInMinutes / 60; - len = snprintf(buffer, bufSize, "%dh", hours); + len = tsnprintf(buffer, bufSize, "%dh", hours); } else { - len = snprintf(buffer, bufSize, "%dm", timeInMinutes); + len = tsnprintf(buffer, bufSize, "%dm", timeInMinutes); } return len; } @@ -410,9 +410,9 @@ static int32_t setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbName, int32_t lenKeep2 = formatDurationOrKeep(keep2Str, sizeof(keep2Str), pCfg->daysToKeep2); if (IS_SYS_DBNAME(dbName)) { - len += snprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE DATABASE `%s`", dbName); + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE DATABASE `%s`", dbName); } else { - len += snprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %s " "WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d STT_TRIGGER %d KEEP %s,%s,%s PAGES %d PAGESIZE %d " "PRECISION '%s' REPLICA %d " @@ -430,7 +430,7 @@ static int32_t setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbName, pCfg->s3KeepLocal, pCfg->s3Compact); if (pRetentions) { - len += snprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, " RETENTIONS %s", pRetentions); + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_DB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, " RETENTIONS %s", pRetentions); } } @@ -531,11 +531,11 @@ void appendColumnFields(char* buf, int32_t* len, STableCfg* pCfg) { columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(pCfg->pSchemaExt[i].compress))); } if (!(pSchema->flags & COL_IS_KEY)) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s", + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s", ((i > 0) ? ", " : ""), pSchema->name, type); } else { char* pk = "PRIMARY KEY"; - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s %s", + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s %s", ((i > 0) ? ", " : ""), pSchema->name, type, pk); } } @@ -554,7 +554,7 @@ void appendTagFields(char* buf, int32_t* len, STableCfg* pCfg) { (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, sizeof(type) - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s", + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, sizeof(type) - (VARSTR_HEADER_SIZE + *len), "%s`%s` %s", ((i > 0) ? ", " : ""), pSchema->name, type); } } @@ -562,7 +562,7 @@ void appendTagFields(char* buf, int32_t* len, STableCfg* pCfg) { void appendTagNameFields(char* buf, int32_t* len, STableCfg* pCfg) { for (int32_t i = 0; i < pCfg->numOfTags; ++i) { SSchema* pSchema = pCfg->pSchemas + pCfg->numOfColumns + i; - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s`%s`", ((i > 0) ? ", " : ""), pSchema->name); } } @@ -584,7 +584,7 @@ int32_t appendTagValues(char* buf, int32_t* len, STableCfg* pCfg) { qError("failed to parse tag to json, pJson is NULL"); return terrno; } - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s", pJson); taosMemoryFree(pJson); @@ -598,12 +598,12 @@ int32_t appendTagValues(char* buf, int32_t* len, STableCfg* pCfg) { for (int32_t i = 0; i < pCfg->numOfTags; ++i) { SSchema* pSchema = pCfg->pSchemas + pCfg->numOfColumns + i; if (i > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), ", "); } if (j >= valueNum) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "NULL"); continue; } @@ -633,7 +633,7 @@ int32_t appendTagValues(char* buf, int32_t* len, STableCfg* pCfg) { *len += tlen; j++; } else { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "NULL"); } } @@ -645,38 +645,38 @@ _exit: void appendTableOptions(char* buf, int32_t* len, SDbCfgInfo* pDbCfg, STableCfg* pCfg) { if (pCfg->commentLen > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " COMMENT '%s'", pCfg->pComment); } else if (0 == pCfg->commentLen) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " COMMENT ''"); } if (NULL != pDbCfg->pRetensions && pCfg->watermark1 > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " WATERMARK %" PRId64 "a", pCfg->watermark1); if (pCfg->watermark2 > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), ", %" PRId64 "a", pCfg->watermark2); } } if (NULL != pDbCfg->pRetensions && pCfg->delay1 > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " MAX_DELAY %" PRId64 "a", pCfg->delay1); if (pCfg->delay2 > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), ", %" PRId64 "a", pCfg->delay2); } } int32_t funcNum = taosArrayGetSize(pCfg->pFuncs); if (NULL != pDbCfg->pRetensions && funcNum > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " ROLLUP("); for (int32_t i = 0; i < funcNum; ++i) { char* pFunc = taosArrayGet(pCfg->pFuncs, i); - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "%s%s", ((i > 0) ? ", " : ""), pFunc); } *len += @@ -684,7 +684,7 @@ void appendTableOptions(char* buf, int32_t* len, SDbCfgInfo* pDbCfg, STableCfg* } if (pCfg->ttl > 0) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), " TTL %d", pCfg->ttl); } @@ -703,18 +703,18 @@ void appendTableOptions(char* buf, int32_t* len, SDbCfgInfo* pDbCfg, STableCfg* for (int32_t i = 0; i < pCfg->numOfColumns; ++i) { if (IS_BSMA_ON(pCfg->pSchemas + i)) { if (smaOn) { - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), ",`%s`", (pCfg->pSchemas + i)->name); } else { smaOn = true; - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + *len), "`%s`", (pCfg->pSchemas + i)->name); } } } - *len += snprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, ")"); + *len += tsnprintf(buf + VARSTR_HEADER_SIZE + *len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, ")"); } } } @@ -738,20 +738,20 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p int32_t len = 0; if (TSDB_SUPER_TABLE == pCfg->tableType) { - len += snprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE STABLE `%s` (", tbName); appendColumnFields(buf2, &len, pCfg); - len += snprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), ") TAGS ("); appendTagFields(buf2, &len, pCfg); len += snprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), ")"); appendTableOptions(buf2, &len, pDbCfg, pCfg); } else if (TSDB_CHILD_TABLE == pCfg->tableType) { - len += snprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE TABLE `%s` USING `%s` (", tbName, pCfg->stbName); appendTagNameFields(buf2, &len, pCfg); - len += snprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), ") TAGS ("); code = appendTagValues(buf2, &len, pCfg); TAOS_CHECK_ERRNO(code); @@ -759,7 +759,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p snprintf(buf2 + VARSTR_HEADER_SIZE + len, SHOW_CREATE_TB_RESULT_FIELD2_LEN - (VARSTR_HEADER_SIZE + len), ")"); appendTableOptions(buf2, &len, pDbCfg, pCfg); } else { - len += snprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, + len += tsnprintf(buf2 + VARSTR_HEADER_SIZE, SHOW_CREATE_TB_RESULT_FIELD2_LEN - VARSTR_HEADER_SIZE, "CREATE TABLE `%s` (", tbName); appendColumnFields(buf2, &len, pCfg); len += diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index a44b9e3ac2..19f3b3fb3c 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1948,11 +1948,11 @@ int32_t leastSQRFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { char buf[LEASTSQUARES_BUFF_LENGTH] = {0}; char slopBuf[64] = {0}; char interceptBuf[64] = {0}; - int n = snprintf(slopBuf, 64, "%.6lf", param02); + int n = tsnprintf(slopBuf, 64, "%.6lf", param02); if (n > LEASTSQUARES_DOUBLE_ITEM_LENGTH) { (void)snprintf(slopBuf, 64, "%." DOUBLE_PRECISION_DIGITS, param02); } - n = snprintf(interceptBuf, 64, "%.6lf", param12); + n = tsnprintf(interceptBuf, 64, "%.6lf", param12); if (n > LEASTSQUARES_DOUBLE_ITEM_LENGTH) { (void)snprintf(interceptBuf, 64, "%." DOUBLE_PRECISION_DIGITS, param12); } @@ -2144,9 +2144,9 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { } if (i == pCtx->numOfParams - 1) { - len += snprintf(varDataVal(buf) + len, sizeof(buf) - VARSTR_HEADER_SIZE - len, "%.6lf]", ppInfo->result); + len += tsnprintf(varDataVal(buf) + len, sizeof(buf) - VARSTR_HEADER_SIZE - len, "%.6lf]", ppInfo->result); } else { - len += snprintf(varDataVal(buf) + len, sizeof(buf) - VARSTR_HEADER_SIZE - len, "%.6lf, ", ppInfo->result); + len += tsnprintf(varDataVal(buf) + len, sizeof(buf) - VARSTR_HEADER_SIZE - len, "%.6lf, ", ppInfo->result); } } diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index 886772b36c..7e0a6b5d0d 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -437,7 +437,7 @@ static int32_t createPartialFunction(const SFunctionNode* pSrcFunc, SFunctionNod (*pPartialFunc)->hasOriginalFunc = true; (*pPartialFunc)->originalFuncId = pSrcFunc->hasOriginalFunc ? pSrcFunc->originalFuncId : pSrcFunc->funcId; char name[TSDB_FUNC_NAME_LEN + TSDB_NAME_DELIMITER_LEN + TSDB_POINTER_PRINT_BYTES + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%p", (*pPartialFunc)->functionName, pSrcFunc); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%p", (*pPartialFunc)->functionName, pSrcFunc); if (taosHashBinary(name, len) < 0) { return TSDB_CODE_FAILED; } diff --git a/source/libs/nodes/src/nodesToSQLFuncs.c b/source/libs/nodes/src/nodesToSQLFuncs.c index b57bba0cc9..de0cd54f16 100644 --- a/source/libs/nodes/src/nodesToSQLFuncs.c +++ b/source/libs/nodes/src/nodesToSQLFuncs.c @@ -110,19 +110,19 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { case QUERY_NODE_COLUMN: { SColumnNode *colNode = (SColumnNode *)pNode; if (colNode->dbName[0]) { - *len += snprintf(buf + *len, bufSize - *len, "`%s`.", colNode->dbName); + *len += tsnprintf(buf + *len, bufSize - *len, "`%s`.", colNode->dbName); } if (colNode->tableAlias[0]) { - *len += snprintf(buf + *len, bufSize - *len, "`%s`.", colNode->tableAlias); + *len += tsnprintf(buf + *len, bufSize - *len, "`%s`.", colNode->tableAlias); } else if (colNode->tableName[0]) { - *len += snprintf(buf + *len, bufSize - *len, "`%s`.", colNode->tableName); + *len += tsnprintf(buf + *len, bufSize - *len, "`%s`.", colNode->tableName); } if (colNode->tableAlias[0]) { - *len += snprintf(buf + *len, bufSize - *len, "`%s`", colNode->node.userAlias); + *len += tsnprintf(buf + *len, bufSize - *len, "`%s`", colNode->node.userAlias); } else { - *len += snprintf(buf + *len, bufSize - *len, "%s", colNode->node.userAlias); + *len += tsnprintf(buf + *len, bufSize - *len, "%s", colNode->node.userAlias); } return TSDB_CODE_SUCCESS; @@ -137,9 +137,9 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { int32_t tlen = strlen(t); if (tlen > 32) { - *len += snprintf(buf + *len, bufSize - *len, "%.*s...%s", 32, t, t + tlen - 1); + *len += tsnprintf(buf + *len, bufSize - *len, "%.*s...%s", 32, t, t + tlen - 1); } else { - *len += snprintf(buf + *len, bufSize - *len, "%s", t); + *len += tsnprintf(buf + *len, bufSize - *len, "%s", t); } taosMemoryFree(t); @@ -147,18 +147,18 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { } case QUERY_NODE_OPERATOR: { SOperatorNode *pOpNode = (SOperatorNode *)pNode; - *len += snprintf(buf + *len, bufSize - *len, "("); + *len += tsnprintf(buf + *len, bufSize - *len, "("); if (pOpNode->pLeft) { NODES_ERR_RET(nodesNodeToSQL(pOpNode->pLeft, buf, bufSize, len)); } - *len += snprintf(buf + *len, bufSize - *len, " %s ", operatorTypeStr(pOpNode->opType)); + *len += tsnprintf(buf + *len, bufSize - *len, " %s ", operatorTypeStr(pOpNode->opType)); if (pOpNode->pRight) { NODES_ERR_RET(nodesNodeToSQL(pOpNode->pRight, buf, bufSize, len)); } - *len += snprintf(buf + *len, bufSize - *len, ")"); + *len += tsnprintf(buf + *len, bufSize - *len, ")"); return TSDB_CODE_SUCCESS; } @@ -167,17 +167,17 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { SNode *node = NULL; bool first = true; - *len += snprintf(buf + *len, bufSize - *len, "("); + *len += tsnprintf(buf + *len, bufSize - *len, "("); FOREACH(node, pLogicNode->pParameterList) { if (!first) { - *len += snprintf(buf + *len, bufSize - *len, " %s ", logicConditionTypeStr(pLogicNode->condType)); + *len += tsnprintf(buf + *len, bufSize - *len, " %s ", logicConditionTypeStr(pLogicNode->condType)); } NODES_ERR_RET(nodesNodeToSQL(node, buf, bufSize, len)); first = false; } - *len += snprintf(buf + *len, bufSize - *len, ")"); + *len += tsnprintf(buf + *len, bufSize - *len, ")"); return TSDB_CODE_SUCCESS; } @@ -186,17 +186,17 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { SNode *node = NULL; bool first = true; - *len += snprintf(buf + *len, bufSize - *len, "%s(", pFuncNode->functionName); + *len += tsnprintf(buf + *len, bufSize - *len, "%s(", pFuncNode->functionName); FOREACH(node, pFuncNode->pParameterList) { if (!first) { - *len += snprintf(buf + *len, bufSize - *len, ", "); + *len += tsnprintf(buf + *len, bufSize - *len, ", "); } NODES_ERR_RET(nodesNodeToSQL(node, buf, bufSize, len)); first = false; } - *len += snprintf(buf + *len, bufSize - *len, ")"); + *len += tsnprintf(buf + *len, bufSize - *len, ")"); return TSDB_CODE_SUCCESS; } @@ -206,13 +206,13 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { bool first = true; int32_t num = 0; - *len += snprintf(buf + *len, bufSize - *len, "("); + *len += tsnprintf(buf + *len, bufSize - *len, "("); FOREACH(node, pListNode->pNodeList) { if (!first) { - *len += snprintf(buf + *len, bufSize - *len, ", "); + *len += tsnprintf(buf + *len, bufSize - *len, ", "); if (++num >= 10) { - *len += snprintf(buf + *len, bufSize - *len, "..."); + *len += tsnprintf(buf + *len, bufSize - *len, "..."); break; } } @@ -220,7 +220,7 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) { first = false; } - *len += snprintf(buf + *len, bufSize - *len, ")"); + *len += tsnprintf(buf + *len, bufSize - *len, ")"); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 2c102f5e74..c7d21d6fde 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -2265,9 +2265,9 @@ static EDealRes doCollect(SCollectColumnsCxt* pCxt, SColumnNode* pCol, SNode* pN char name[TSDB_TABLE_NAME_LEN + TSDB_COL_NAME_LEN]; int32_t len = 0; if ('\0' == pCol->tableAlias[0]) { - len = snprintf(name, sizeof(name), "%s", pCol->colName); + len = tsnprintf(name, sizeof(name), "%s", pCol->colName); } else { - len = snprintf(name, sizeof(name), "%s.%s", pCol->tableAlias, pCol->colName); + len = tsnprintf(name, sizeof(name), "%s.%s", pCol->tableAlias, pCol->colName); } if (pCol->projRefIdx > 0) { len = taosHashBinary(name, strlen(name)); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 3ae4583013..420d112041 100755 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2840,7 +2840,7 @@ static int32_t rewriteServerStatusFunc(STranslateContext* pCxt, SNode** pNode) { static int32_t rewriteUserFunc(STranslateContext* pCxt, SNode** pNode) { char userConn[TSDB_USER_LEN + 1 + TSDB_FQDN_LEN] = {0}; // format 'user@host' - int32_t len = snprintf(userConn, sizeof(userConn), "%s@", pCxt->pParseCxt->pUser); + int32_t len = tsnprintf(userConn, sizeof(userConn), "%s@", pCxt->pParseCxt->pUser); if (TSDB_CODE_SUCCESS != taosGetFqdn(userConn + len)) { return terrno; } @@ -4126,7 +4126,7 @@ static int32_t setTableTsmas(STranslateContext* pCxt, SName* pName, SRealTableNo SVgroupInfo vgInfo = {0}; bool exists = false; toName(pCxt->pParseCxt->acctId, pRealTable->table.dbName, "", &tsmaTargetTbName); - int32_t len = snprintf(buf, TSDB_TABLE_FNAME_LEN + TSDB_TABLE_NAME_LEN, "%s.%s_%s", pTsma->dbFName, pTsma->name, + int32_t len = tsnprintf(buf, TSDB_TABLE_FNAME_LEN + TSDB_TABLE_NAME_LEN, "%s.%s_%s", pTsma->dbFName, pTsma->name, pRealTable->table.tableName); len = taosCreateMD5Hash(buf, len); strncpy(tsmaTargetTbName.tname, buf, MD5_OUTPUT_LEN); @@ -4935,18 +4935,18 @@ static int32_t createMultiResFunc(SFunctionNode* pSrcFunc, SExprNode* pExpr, SNo strcpy(pFunc->node.userAlias, pCol->colName); strcpy(pFunc->node.aliasName, pCol->colName); } else { - len = snprintf(buf, sizeof(buf) - 1, "%s(%s.%s)", pSrcFunc->functionName, pCol->tableAlias, pCol->colName); + len = tsnprintf(buf, sizeof(buf) - 1, "%s(%s.%s)", pSrcFunc->functionName, pCol->tableAlias, pCol->colName); (void)taosHashBinary(buf, len); strncpy(pFunc->node.aliasName, buf, TSDB_COL_NAME_LEN - 1); - len = snprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pCol->colName); + len = tsnprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pCol->colName); // note: userAlias could be truncated here strncpy(pFunc->node.userAlias, buf, TSDB_COL_NAME_LEN - 1); } } else { - len = snprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pExpr->aliasName); + len = tsnprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pExpr->aliasName); (void)taosHashBinary(buf, len); strncpy(pFunc->node.aliasName, buf, TSDB_COL_NAME_LEN - 1); - len = snprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pExpr->userAlias); + len = tsnprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pExpr->userAlias); // note: userAlias could be truncated here strncpy(pFunc->node.userAlias, buf, TSDB_COL_NAME_LEN - 1); } @@ -6402,7 +6402,7 @@ static int32_t replaceToChildTableQuery(STranslateContext* pCxt, SEqCondTbNameTa STableTSMAInfo* pTsma = taosArrayGetP(pRealTable->pTsmas, i); SName tsmaTargetTbName = {0}; toName(pCxt->pParseCxt->acctId, pRealTable->table.dbName, "", &tsmaTargetTbName); - int32_t len = snprintf(buf, TSDB_TABLE_FNAME_LEN + TSDB_TABLE_NAME_LEN, "%s.%s_%s", pTsma->dbFName, pTsma->name, + int32_t len = tsnprintf(buf, TSDB_TABLE_FNAME_LEN + TSDB_TABLE_NAME_LEN, "%s.%s_%s", pTsma->dbFName, pTsma->name, pRealTable->table.tableName); len = taosCreateMD5Hash(buf, len); strncpy(tsmaTargetTbName.tname, buf, MD5_OUTPUT_LEN); @@ -8724,7 +8724,7 @@ static int32_t makeIntervalVal(SRetention* pRetension, int8_t precision, SNode** return code; } char buf[20] = {0}; - int32_t len = snprintf(buf, sizeof(buf), "%" PRId64 "%c", timeVal, pRetension->freqUnit); + int32_t len = tsnprintf(buf, sizeof(buf), "%" PRId64 "%c", timeVal, pRetension->freqUnit); pVal->literal = taosStrndup(buf, len); if (NULL == pVal->literal) { nodesDestroyNode((SNode*)pVal); diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 1ce8b04324..98676160cb 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -987,13 +987,13 @@ static int32_t reserveTableReqInCacheImpl(const char* pTbFName, int32_t len, SHa static int32_t reserveTableReqInCache(int32_t acctId, const char* pDb, const char* pTable, SHashObj** pTables) { char fullName[TSDB_TABLE_FNAME_LEN]; - int32_t len = snprintf(fullName, sizeof(fullName), "%d.%s.%s", acctId, pDb, pTable); + int32_t len = tsnprintf(fullName, sizeof(fullName), "%d.%s.%s", acctId, pDb, pTable); return reserveTableReqInCacheImpl(fullName, len, pTables); } static int32_t reserveTableReqInDbCacheImpl(int32_t acctId, const char* pDb, const char* pTable, SHashObj* pDbs) { SParseTablesMetaReq req = {0}; - int32_t len = snprintf(req.dbFName, sizeof(req.dbFName), "%d.%s", acctId, pDb); + int32_t len = tsnprintf(req.dbFName, sizeof(req.dbFName), "%d.%s", acctId, pDb); int32_t code = reserveTableReqInCache(acctId, pDb, pTable, &req.pTables); if (TSDB_CODE_SUCCESS == code) { code = taosHashPut(pDbs, req.dbFName, len, &req, sizeof(SParseTablesMetaReq)); @@ -1009,7 +1009,7 @@ static int32_t reserveTableReqInDbCache(int32_t acctId, const char* pDb, const c } } char fullName[TSDB_DB_FNAME_LEN]; - int32_t len = snprintf(fullName, sizeof(fullName), "%d.%s", acctId, pDb); + int32_t len = tsnprintf(fullName, sizeof(fullName), "%d.%s", acctId, pDb); SParseTablesMetaReq* pReq = taosHashGet(*pDbs, fullName, len); if (NULL == pReq) { return reserveTableReqInDbCacheImpl(acctId, pDb, pTable, *pDbs); @@ -1109,7 +1109,7 @@ static int32_t reserveDbReqInCache(int32_t acctId, const char* pDb, SHashObj** p } } char fullName[TSDB_TABLE_FNAME_LEN]; - int32_t len = snprintf(fullName, sizeof(fullName), "%d.%s", acctId, pDb); + int32_t len = tsnprintf(fullName, sizeof(fullName), "%d.%s", acctId, pDb); return taosHashPut(*pDbs, fullName, len, &nullPointer, POINTER_BYTES); } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 1bcec86385..97c4fa9dde 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -1166,9 +1166,9 @@ static EDealRes pdcJoinCollectCondCol(SNode* pNode, void* pContext) { char name[TSDB_TABLE_NAME_LEN + TSDB_COL_NAME_LEN]; int32_t len = 0; if ('\0' == pCol->tableAlias[0]) { - len = snprintf(name, sizeof(name), "%s", pCol->colName); + len = tsnprintf(name, sizeof(name), "%s", pCol->colName); } else { - len = snprintf(name, sizeof(name), "%s.%s", pCol->tableAlias, pCol->colName); + len = tsnprintf(name, sizeof(name), "%s.%s", pCol->tableAlias, pCol->colName); } if (NULL == taosHashGet(pCxt->pColHash, name, len)) { pCxt->errCode = taosHashPut(pCxt->pColHash, name, len, NULL, 0); @@ -3162,7 +3162,7 @@ static int32_t partTagsOptRebuildTbanme(SNodeList* pPartKeys) { // todo refact: just to mask compilation warnings static void partTagsSetAlias(char* pAlias, const char* pTableAlias, const char* pColName) { char name[TSDB_COL_FNAME_LEN + 1] = {0}; - int32_t len = snprintf(name, TSDB_COL_FNAME_LEN, "%s.%s", pTableAlias, pColName); + int32_t len = tsnprintf(name, TSDB_COL_FNAME_LEN, "%s.%s", pTableAlias, pColName); (void)taosHashBinary(name, len); strncpy(pAlias, name, TSDB_COL_NAME_LEN - 1); @@ -3841,7 +3841,7 @@ static int32_t rewriteUniqueOptCreateFirstFunc(SFunctionNode* pSelectValue, SNod } else { int64_t pointer = (int64_t)pFunc; char name[TSDB_FUNC_NAME_LEN + TSDB_POINTER_PRINT_BYTES + TSDB_NAME_DELIMITER_LEN + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pFunc->functionName, pointer); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pFunc->functionName, pointer); (void)taosHashBinary(name, len); strncpy(pFunc->node.aliasName, name, TSDB_COL_NAME_LEN - 1); } @@ -4351,7 +4351,7 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic } FOREACH(pParamNode, pFunc->pParameterList) { if (FUNCTION_TYPE_LAST_ROW == funcType || FUNCTION_TYPE_LAST == funcType) { - int32_t len = snprintf(pFunc->functionName, sizeof(pFunc->functionName), + int32_t len = tsnprintf(pFunc->functionName, sizeof(pFunc->functionName), FUNCTION_TYPE_LAST_ROW == funcType ? "_cache_last_row" : "_cache_last"); pFunc->functionName[len] = '\0'; code = fmGetFuncInfo(pFunc, NULL, 0); @@ -7234,7 +7234,7 @@ static int32_t tsmaOptCreateWStart(int8_t precision, SFunctionNode** pWStartOut) strcpy(pWStart->functionName, "_wstart"); int64_t pointer = (int64_t)pWStart; char name[TSDB_COL_NAME_LEN + TSDB_POINTER_PRINT_BYTES + TSDB_NAME_DELIMITER_LEN + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWStart->functionName, pointer); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWStart->functionName, pointer); (void)taosHashBinary(name, len); strncpy(pWStart->node.aliasName, name, TSDB_COL_NAME_LEN - 1); pWStart->node.resType.precision = precision; diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 706394507a..bd2462243d 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -431,7 +431,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex, uint8_t pr strcpy(pWStart->functionName, "_wstart"); int64_t pointer = (int64_t)pWStart; char name[TSDB_COL_NAME_LEN + TSDB_POINTER_PRINT_BYTES + TSDB_NAME_DELIMITER_LEN + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWStart->functionName, pointer); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWStart->functionName, pointer); (void)taosHashBinary(name, len); strncpy(pWStart->node.aliasName, name, TSDB_COL_NAME_LEN - 1); pWStart->node.resType.precision = precision; @@ -463,7 +463,7 @@ static int32_t stbSplAppendWEnd(SWindowLogicNode* pWin, int32_t* pIndex) { strcpy(pWEnd->functionName, "_wend"); int64_t pointer = (int64_t)pWEnd; char name[TSDB_COL_NAME_LEN + TSDB_POINTER_PRINT_BYTES + TSDB_NAME_DELIMITER_LEN + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWEnd->functionName, pointer); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%" PRId64 "", pWEnd->functionName, pointer); (void)taosHashBinary(name, len); strncpy(pWEnd->node.aliasName, name, TSDB_COL_NAME_LEN - 1); diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index b5f0bc50e8..ae958de6e8 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -630,7 +630,7 @@ SFunctionNode* createGroupKeyAggFunc(SColumnNode* pGroupCol) { } if (TSDB_CODE_SUCCESS == code) { char name[TSDB_FUNC_NAME_LEN + TSDB_NAME_DELIMITER_LEN + TSDB_POINTER_PRINT_BYTES + 1] = {0}; - int32_t len = snprintf(name, sizeof(name) - 1, "%s.%p", pFunc->functionName, pFunc); + int32_t len = tsnprintf(name, sizeof(name) - 1, "%s.%p", pFunc->functionName, pFunc); (void)taosHashBinary(name, len); strncpy(pFunc->node.aliasName, name, TSDB_COL_NAME_LEN - 1); } diff --git a/source/libs/qcom/src/queryUtil.c b/source/libs/qcom/src/queryUtil.c index 7d6b0f99a1..847fc9b8e9 100644 --- a/source/libs/qcom/src/queryUtil.c +++ b/source/libs/qcom/src/queryUtil.c @@ -318,36 +318,36 @@ int32_t dataConverToStr(char* str, int64_t capacity, int type, void* buf, int32_ switch (type) { case TSDB_DATA_TYPE_NULL: - n = snprintf(str, capacity, "null"); + n = tsnprintf(str, capacity, "null"); break; case TSDB_DATA_TYPE_BOOL: - n = snprintf(str, capacity, (*(int8_t*)buf) ? "true" : "false"); + n = tsnprintf(str, capacity, (*(int8_t*)buf) ? "true" : "false"); break; case TSDB_DATA_TYPE_TINYINT: - n = snprintf(str, capacity, "%d", *(int8_t*)buf); + n = tsnprintf(str, capacity, "%d", *(int8_t*)buf); break; case TSDB_DATA_TYPE_SMALLINT: - n = snprintf(str, capacity, "%d", *(int16_t*)buf); + n = tsnprintf(str, capacity, "%d", *(int16_t*)buf); break; case TSDB_DATA_TYPE_INT: - n = snprintf(str, capacity, "%d", *(int32_t*)buf); + n = tsnprintf(str, capacity, "%d", *(int32_t*)buf); break; case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_TIMESTAMP: - n = snprintf(str, capacity, "%" PRId64, *(int64_t*)buf); + n = tsnprintf(str, capacity, "%" PRId64, *(int64_t*)buf); break; case TSDB_DATA_TYPE_FLOAT: - n = snprintf(str, capacity, "%e", GET_FLOAT_VAL(buf)); + n = tsnprintf(str, capacity, "%e", GET_FLOAT_VAL(buf)); break; case TSDB_DATA_TYPE_DOUBLE: - n = snprintf(str, capacity, "%e", GET_DOUBLE_VAL(buf)); + n = tsnprintf(str, capacity, "%e", GET_DOUBLE_VAL(buf)); break; case TSDB_DATA_TYPE_VARBINARY: { @@ -394,19 +394,19 @@ int32_t dataConverToStr(char* str, int64_t capacity, int type, void* buf, int32_ n = length + 2; break; case TSDB_DATA_TYPE_UTINYINT: - n = snprintf(str, capacity, "%d", *(uint8_t*)buf); + n = tsnprintf(str, capacity, "%d", *(uint8_t*)buf); break; case TSDB_DATA_TYPE_USMALLINT: - n = snprintf(str, capacity, "%d", *(uint16_t*)buf); + n = tsnprintf(str, capacity, "%d", *(uint16_t*)buf); break; case TSDB_DATA_TYPE_UINT: - n = snprintf(str, capacity, "%u", *(uint32_t*)buf); + n = tsnprintf(str, capacity, "%u", *(uint32_t*)buf); break; case TSDB_DATA_TYPE_UBIGINT: - n = snprintf(str, capacity, "%" PRIu64, *(uint64_t*)buf); + n = tsnprintf(str, capacity, "%" PRIu64, *(uint64_t*)buf); break; default: diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index ff47c091b7..d42d4a5cf3 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -2251,7 +2251,7 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam * len = (int32_t)strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", &tmInfo); - len += snprintf(buf + len, fractionLen, format, mod); + len += tsnprintf(buf + len, fractionLen, format, mod); // add timezone string if (tzLen > 0) { @@ -3844,11 +3844,11 @@ int32_t leastSQRScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarPa char buf[LEASTSQUARES_BUFF_LENGTH] = {0}; char slopBuf[64] = {0}; char interceptBuf[64] = {0}; - int n = snprintf(slopBuf, 64, "%.6lf", matrix02); + int n = tsnprintf(slopBuf, 64, "%.6lf", matrix02); if (n > LEASTSQUARES_DOUBLE_ITEM_LENGTH) { (void)snprintf(slopBuf, 64, "%." DOUBLE_PRECISION_DIGITS, matrix02); } - n = snprintf(interceptBuf, 64, "%.6lf", matrix12); + n = tsnprintf(interceptBuf, 64, "%.6lf", matrix12); if (n > LEASTSQUARES_DOUBLE_ITEM_LENGTH) { (void) snprintf(interceptBuf, 64, "%." DOUBLE_PRECISION_DIGITS, matrix12); } diff --git a/source/libs/scheduler/src/schUtil.c b/source/libs/scheduler/src/schUtil.c index 14447ba856..6cfeab3467 100644 --- a/source/libs/scheduler/src/schUtil.c +++ b/source/libs/scheduler/src/schUtil.c @@ -63,10 +63,10 @@ int32_t schDumpEpSet(SEpSet *pEpSet, char** ppRes) { } int32_t n = 0; - n += snprintf(str + n, maxSize - n, "numOfEps:%d, inUse:%d eps:", pEpSet->numOfEps, pEpSet->inUse); + n += tsnprintf(str + n, maxSize - n, "numOfEps:%d, inUse:%d eps:", pEpSet->numOfEps, pEpSet->inUse); for (int32_t i = 0; i < pEpSet->numOfEps; ++i) { SEp *pEp = &pEpSet->eps[i]; - n += snprintf(str + n, maxSize - n, "[%s:%d]", pEp->fqdn, pEp->port); + n += tsnprintf(str + n, maxSize - n, "[%s:%d]", pEp->fqdn, pEp->port); } *ppRes = str; diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index a2c9012df5..5021933c33 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -216,7 +216,7 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) { return terrno; } - nBytes = snprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); + nBytes = tsnprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(state); return TSDB_CODE_OUT_OF_RANGE; @@ -229,7 +229,7 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) { return terrno; } - nBytes = snprintf(chkp, cap, "%s%s%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, "checkpoints", TD_DIRSEP, chkpId); + nBytes = tsnprintf(chkp, cap, "%s%s%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, "checkpoints", TD_DIRSEP, chkpId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(state); taosMemoryFree(chkp); @@ -282,7 +282,7 @@ int32_t remoteChkp_readMetaData(char* path, SSChkpMetaOnS3** pMeta) { return terrno; } - int32_t n = snprintf(metaPath, cap, "%s%s%s", path, TD_DIRSEP, "META"); + int32_t n = tsnprintf(metaPath, cap, "%s%s%s", path, TD_DIRSEP, "META"); if (n <= 0 || n >= cap) { taosMemoryFree(metaPath); return TSDB_CODE_OUT_OF_MEMORY; @@ -350,7 +350,7 @@ int32_t remoteChkp_validAndCvtMeta(char* path, SSChkpMetaOnS3* pMeta, int64_t ch goto _EXIT; } - nBytes = snprintf(src, cap, "%s%s%s_%" PRId64 "", path, TD_DIRSEP, key, pMeta->currChkptId); + nBytes = tsnprintf(src, cap, "%s%s%s_%" PRId64 "", path, TD_DIRSEP, key, pMeta->currChkptId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -361,7 +361,7 @@ int32_t remoteChkp_validAndCvtMeta(char* path, SSChkpMetaOnS3* pMeta, int64_t ch goto _EXIT; } - nBytes = snprintf(dst, cap, "%s%s%s", path, TD_DIRSEP, key); + nBytes = tsnprintf(dst, cap, "%s%s%s", path, TD_DIRSEP, key); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -403,7 +403,7 @@ int32_t remoteChkpGetDelFile(char* path, SArray* toDel) { return terrno; } - nBytes = snprintf(p, cap, "%s_%" PRId64 "", key, pMeta->currChkptId); + nBytes = tsnprintf(p, cap, "%s_%" PRId64 "", key, pMeta->currChkptId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(pMeta); taosMemoryFree(p); @@ -499,7 +499,7 @@ int32_t rebuildFromRemoteChkp_s3(const char* key, char* chkpPath, int64_t chkpId return terrno; } - int32_t nBytes = snprintf(defaultPath, cap, "%s%s", defaultPath, "_tmp"); + int32_t nBytes = tsnprintf(defaultPath, cap, "%s%s", defaultPath, "_tmp"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(defaultPath); return TSDB_CODE_OUT_OF_RANGE; @@ -611,13 +611,13 @@ int32_t backendFileCopyFilesImpl(const char* src, const char* dst) { continue; } - nBytes = snprintf(srcName, cap, "%s%s%s", src, TD_DIRSEP, name); + nBytes = tsnprintf(srcName, cap, "%s%s%s", src, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = snprintf(dstName, cap, "%s%s%s", dst, TD_DIRSEP, name); + nBytes = tsnprintf(dstName, cap, "%s%s%s", dst, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -715,7 +715,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = snprintf(prefixPath, cap, "%s%s%s", path, TD_DIRSEP, key); + nBytes = tsnprintf(prefixPath, cap, "%s%s%s", path, TD_DIRSEP, key); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -727,7 +727,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = snprintf(defaultPath, cap, "%s%s%s", prefixPath, TD_DIRSEP, "state"); + nBytes = tsnprintf(defaultPath, cap, "%s%s%s", prefixPath, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -739,7 +739,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = snprintf(checkpointRoot, cap, "%s%s%s", prefixPath, TD_DIRSEP, "checkpoints"); + nBytes = tsnprintf(checkpointRoot, cap, "%s%s%s", prefixPath, TD_DIRSEP, "checkpoints"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -753,7 +753,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId stDebug("%s check local backend dir:%s, checkpointId:%" PRId64 " succ", key, defaultPath, chkptId); if (chkptId > 0) { - nBytes = snprintf(checkpointPath, cap, "%s%s%s%s%s%" PRId64 "", prefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, + nBytes = tsnprintf(checkpointPath, cap, "%s%s%s%s%s%" PRId64 "", prefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", chkptId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; @@ -800,7 +800,7 @@ bool streamBackendDataIsExist(const char* path, int64_t chkpId) { return false; } - int16_t nBytes = snprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); + int16_t nBytes = tsnprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { terrno = TSDB_CODE_OUT_OF_RANGE; exist = false; @@ -1322,13 +1322,13 @@ int32_t chkpPreBuildDir(char* path, int64_t chkpId, char** chkpDir, char** chkpI goto _EXIT; } - nBytes = snprintf(pChkpDir, cap, "%s%s%s", path, TD_DIRSEP, "checkpoints"); + nBytes = tsnprintf(pChkpDir, cap, "%s%s%s", path, TD_DIRSEP, "checkpoints"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; } - nBytes = snprintf(pChkpIdDir, cap, "%s%s%s%" PRId64, pChkpDir, TD_DIRSEP, "checkpoint", chkpId); + nBytes = tsnprintf(pChkpIdDir, cap, "%s%s%s%" PRId64, pChkpDir, TD_DIRSEP, "checkpoint", chkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -1500,7 +1500,7 @@ int32_t chkpLoadExtraInfo(char* pChkpIdDir, int64_t* chkpId, int64_t* processId) goto _EXIT; } - nBytes = snprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); + nBytes = tsnprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build dst to load extra info, dir:%s", pChkpIdDir); @@ -1556,7 +1556,7 @@ int32_t chkpAddExtraInfo(char* pChkpIdDir, int64_t chkpId, int64_t processId) { goto _EXIT; } - nBytes = snprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); + nBytes = tsnprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build dst to add extra info, dir:%s, reason:%s", pChkpIdDir, tstrerror(code)); @@ -1570,7 +1570,7 @@ int32_t chkpAddExtraInfo(char* pChkpIdDir, int64_t chkpId, int64_t processId) { goto _EXIT; } - nBytes = snprintf(buf, sizeof(buf), "%" PRId64 " %" PRId64 "", chkpId, processId); + nBytes = tsnprintf(buf, sizeof(buf), "%" PRId64 " %" PRId64 "", chkpId, processId); if (nBytes <= 0 || nBytes >= sizeof(buf)) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build content to add extra info, dir:%s,reason:%s", pChkpIdDir, tstrerror(code)); @@ -2727,7 +2727,7 @@ int32_t taskDbGenChkpUploadData__s3(STaskDbWrapper* pDb, void* bkdChkpMgt, int64 return terrno; } - int32_t nBytes = snprintf(temp, cap, "%s%s%s%" PRId64, pDb->path, TD_DIRSEP, "tmp", chkpId); + int32_t nBytes = tsnprintf(temp, cap, "%s%s%s%" PRId64, pDb->path, TD_DIRSEP, "tmp", chkpId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(temp); return TSDB_CODE_OUT_OF_RANGE; @@ -4805,14 +4805,14 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { char* srcDir = &dstBuf[cap]; char* dstDir = &srcDir[cap]; - int nBytes = snprintf(srcDir, cap, "%s%s%s%s%s%" PRId64 "", p->path, TD_DIRSEP, "checkpoints", TD_DIRSEP, + int nBytes = tsnprintf(srcDir, cap, "%s%s%s%s%s%" PRId64 "", p->path, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = snprintf(dstDir, cap, "%s", dname); + nBytes = tsnprintf(dstDir, cap, "%s", dname); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4837,13 +4837,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(dstBuf, 0, cap); char* filename = taosArrayGetP(p->pAdd, i); - nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, filename); + nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, filename); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = snprintf(dstBuf, cap, "%s%s%s", dstDir, TD_DIRSEP, filename); + nBytes = tsnprintf(dstBuf, cap, "%s%s%s", dstDir, TD_DIRSEP, filename); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4874,13 +4874,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(srcBuf, 0, cap); memset(dstBuf, 0, cap); - nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pCurrent); + nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pCurrent); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = snprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pCurrent, p->curChkpId); + nBytes = tsnprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pCurrent, p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4896,13 +4896,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(srcBuf, 0, cap); memset(dstBuf, 0, cap); - nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pManifest); + nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pManifest); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = snprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pManifest, p->curChkpId); + nBytes = tsnprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pManifest, p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4914,7 +4914,7 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { goto _ERROR; } memset(dstBuf, 0, cap); - nBytes = snprintf(dstDir, cap, "%s%s%s", dstDir, TD_DIRSEP, chkpMeta); + nBytes = tsnprintf(dstDir, cap, "%s%s%s", dstDir, TD_DIRSEP, chkpMeta); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4928,7 +4928,7 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { } char content[256] = {0}; - nBytes = snprintf(content, sizeof(content), META_ON_S3_FORMATE, p->pCurrent, p->curChkpId, p->pManifest, p->curChkpId, + nBytes = tsnprintf(content, sizeof(content), META_ON_S3_FORMATE, p->pCurrent, p->curChkpId, p->pManifest, p->curChkpId, "processVer", processId); if (nBytes <= 0 || nBytes >= sizeof(content)) { code = TSDB_CODE_OUT_OF_RANGE; @@ -5018,7 +5018,7 @@ int32_t bkdMgtGetDelta(SBkdMgt* bm, char* taskId, int64_t chkpId, SArray* list, return terrno; } - int32_t nBytes = snprintf(path, cap, "%s%s%s", bm->path, TD_DIRSEP, taskId); + int32_t nBytes = tsnprintf(path, cap, "%s%s%s", bm->path, TD_DIRSEP, taskId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(path); TAOS_UNUSED(taosThreadRwlockUnlock(&bm->rwLock)); diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c index e44bca123b..91c7d9e2ac 100644 --- a/source/libs/stream/src/streamCheckpoint.c +++ b/source/libs/stream/src/streamCheckpoint.c @@ -710,7 +710,7 @@ static int32_t getCheckpointDataMeta(const char* id, const char* path, SArray* l return terrno; } - int32_t nBytes = snprintf(filePath, cap, "%s%s%s", path, TD_DIRSEP, "META_TMP"); + int32_t nBytes = tsnprintf(filePath, cap, "%s%s%s", path, TD_DIRSEP, "META_TMP"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(filePath); return TSDB_CODE_OUT_OF_RANGE; @@ -1304,13 +1304,13 @@ static int32_t uploadCheckpointToS3(const char* id, const char* path) { char filename[PATH_MAX] = {0}; if (path[strlen(path) - 1] == TD_DIRSEP_CHAR) { - nBytes = snprintf(filename, sizeof(filename), "%s%s", path, name); + nBytes = tsnprintf(filename, sizeof(filename), "%s%s", path, name); if (nBytes <= 0 || nBytes >= sizeof(filename)) { code = TSDB_CODE_OUT_OF_RANGE; break; } } else { - nBytes = snprintf(filename, sizeof(filename), "%s%s%s", path, TD_DIRSEP, name); + nBytes = tsnprintf(filename, sizeof(filename), "%s%s%s", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= sizeof(filename)) { code = TSDB_CODE_OUT_OF_RANGE; break; @@ -1318,7 +1318,7 @@ static int32_t uploadCheckpointToS3(const char* id, const char* path) { } char object[PATH_MAX] = {0}; - nBytes = snprintf(object, sizeof(object), "%s%s%s", id, TD_DIRSEP, name); + nBytes = tsnprintf(object, sizeof(object), "%s%s%s", id, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= sizeof(object)) { code = TSDB_CODE_OUT_OF_RANGE; break; @@ -1349,7 +1349,7 @@ int32_t downloadCheckpointByNameS3(const char* id, const char* fname, const char return terrno; } - nBytes = snprintf(buf, cap, "%s/%s", id, fname); + nBytes = tsnprintf(buf, cap, "%s/%s", id, fname); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(buf); return TSDB_CODE_OUT_OF_RANGE; @@ -1439,7 +1439,7 @@ int32_t deleteCheckpoint(const char* id) { int32_t deleteCheckpointFile(const char* id, const char* name) { char object[128] = {0}; - int32_t nBytes = snprintf(object, sizeof(object), "%s/%s", id, name); + int32_t nBytes = tsnprintf(object, sizeof(object), "%s/%s", id, name); if (nBytes <= 0 || nBytes >= sizeof(object)) { return TSDB_CODE_OUT_OF_RANGE; } diff --git a/source/libs/stream/src/streamSnapshot.c b/source/libs/stream/src/streamSnapshot.c index ae8a71d988..951ca43732 100644 --- a/source/libs/stream/src/streamSnapshot.c +++ b/source/libs/stream/src/streamSnapshot.c @@ -164,7 +164,7 @@ void snapFileDebugInfo(SBackendSnapFile2* pSnapFile) { return; } - int32_t nBytes = snprintf(buf + strlen(buf), cap, "["); + int32_t nBytes = tsnprintf(buf + strlen(buf), cap, "["); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(buf); stError("%s failed to write buf, reason:%s", STREAM_STATE_TRANSFER, tstrerror(TSDB_CODE_OUT_OF_RANGE)); @@ -355,7 +355,7 @@ int32_t streamBackendSnapInitFile(char* metaPath, SStreamTaskSnap* pSnap, SBacke return terrno; } - nBytes = snprintf(path, cap, "%s%s%s%s%s%" PRId64 "", pSnap->dbPrefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, + nBytes = tsnprintf(path, cap, "%s%s%s%s%s%" PRId64 "", pSnap->dbPrefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", pSnap->chkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 1a90eb8ab0..451e82c7d4 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -2897,12 +2897,12 @@ void syncNodeLogConfigInfo(SSyncNode* ths, SSyncCfg* cfg, char* str) { char buf[256]; int32_t len = 256; int32_t n = 0; - n += snprintf(buf + n, len - n, "%s", "{"); + n += tsnprintf(buf + n, len - n, "%s", "{"); for (int i = 0; i < ths->peersEpset->numOfEps; i++) { - n += snprintf(buf + n, len - n, "%s:%d%s", ths->peersEpset->eps[i].fqdn, ths->peersEpset->eps[i].port, + n += tsnprintf(buf + n, len - n, "%s:%d%s", ths->peersEpset->eps[i].fqdn, ths->peersEpset->eps[i].port, (i + 1 < ths->peersEpset->numOfEps ? ", " : "")); } - n += snprintf(buf + n, len - n, "%s", "}"); + n += tsnprintf(buf + n, len - n, "%s", "}"); sInfo("vgId:%d, %s, peersEpset%d, %s, inUse:%d", ths->vgId, str, i, buf, ths->peersEpset->inUse); } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 6f7ea9375c..578f391f5a 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -24,14 +24,14 @@ #include "tglobal.h" static void syncCfg2SimpleStr(const SSyncCfg* pCfg, char* buf, int32_t bufLen) { - int32_t len = snprintf(buf, bufLen, "{num:%d, as:%d, [", pCfg->replicaNum, pCfg->myIndex); + int32_t len = tsnprintf(buf, bufLen, "{num:%d, as:%d, [", pCfg->replicaNum, pCfg->myIndex); for (int32_t i = 0; i < pCfg->replicaNum; ++i) { - len += snprintf(buf + len, bufLen - len, "%s:%d", pCfg->nodeInfo[i].nodeFqdn, pCfg->nodeInfo[i].nodePort); + len += tsnprintf(buf + len, bufLen - len, "%s:%d", pCfg->nodeInfo[i].nodeFqdn, pCfg->nodeInfo[i].nodePort); if (i < pCfg->replicaNum - 1) { - len += snprintf(buf + len, bufLen - len, "%s", ", "); + len += tsnprintf(buf + len, bufLen - len, "%s", ", "); } } - len += snprintf(buf + len, bufLen - len, "%s", "]}"); + len += tsnprintf(buf + len, bufLen - len, "%s", "]}"); } void syncUtilNodeInfo2EpSet(const SNodeInfo* pInfo, SEpSet* pEpSet) { @@ -111,29 +111,29 @@ void syncUtilGenerateArbToken(int32_t nodeId, int32_t groupId, char* buf) { // for leader static void syncHearbeatReplyTime2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; - len += snprintf(buf + len, bufLen - len, "%s", "{"); + len += tsnprintf(buf + len, bufLen - len, "%s", "{"); for (int32_t i = 0; i < pSyncNode->replicaNum; ++i) { int64_t tsMs = syncIndexMgrGetRecvTime(pSyncNode->pMatchIndex, &(pSyncNode->replicasId[i])); - len += snprintf(buf + len, bufLen - len, "%d:%" PRId64, i, tsMs); + len += tsnprintf(buf + len, bufLen - len, "%d:%" PRId64, i, tsMs); if (i < pSyncNode->replicaNum - 1) { - len += snprintf(buf + len, bufLen - len, "%s", ","); + len += tsnprintf(buf + len, bufLen - len, "%s", ","); } } - len += snprintf(buf + len, bufLen - len, "%s", "}"); + len += tsnprintf(buf + len, bufLen - len, "%s", "}"); } // for follower static void syncHearbeatTime2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; - len += snprintf(buf + len, bufLen - len, "%s", "{"); + len += tsnprintf(buf + len, bufLen - len, "%s", "{"); for (int32_t i = 0; i < pSyncNode->replicaNum; ++i) { int64_t tsMs = syncIndexMgrGetRecvTime(pSyncNode->pNextIndex, &(pSyncNode->replicasId[i])); - len += snprintf(buf + len, bufLen - len, "%d:%" PRId64, i, tsMs); + len += tsnprintf(buf + len, bufLen - len, "%d:%" PRId64, i, tsMs); if (i < pSyncNode->replicaNum - 1) { - len += snprintf(buf + len, bufLen - len, "%s", ","); + len += tsnprintf(buf + len, bufLen - len, "%s", ","); } } - len += snprintf(buf + len, bufLen - len, "%s", "}"); + len += tsnprintf(buf + len, bufLen - len, "%s", "}"); } static void syncLogBufferStates2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { @@ -142,35 +142,35 @@ static void syncLogBufferStates2Str(SSyncNode* pSyncNode, char* buf, int32_t buf return; } int32_t len = 0; - len += snprintf(buf + len, bufLen - len, "[%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", pBuf->startIndex, + len += tsnprintf(buf + len, bufLen - len, "[%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", pBuf->startIndex, pBuf->commitIndex, pBuf->matchIndex, pBuf->endIndex); } static void syncLogReplStates2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; - len += snprintf(buf + len, bufLen - len, "%s", "{"); + len += tsnprintf(buf + len, bufLen - len, "%s", "{"); for (int32_t i = 0; i < pSyncNode->replicaNum; i++) { SSyncLogReplMgr* pMgr = pSyncNode->logReplMgrs[i]; if (pMgr == NULL) break; - len += snprintf(buf + len, bufLen - len, "%d:%d [%" PRId64 " %" PRId64 ", %" PRId64 "]", i, pMgr->restored, + len += tsnprintf(buf + len, bufLen - len, "%d:%d [%" PRId64 " %" PRId64 ", %" PRId64 "]", i, pMgr->restored, pMgr->startIndex, pMgr->matchIndex, pMgr->endIndex); if (i + 1 < pSyncNode->replicaNum) { - len += snprintf(buf + len, bufLen - len, "%s", ", "); + len += tsnprintf(buf + len, bufLen - len, "%s", ", "); } } - len += snprintf(buf + len, bufLen - len, "%s", "}"); + len += tsnprintf(buf + len, bufLen - len, "%s", "}"); } static void syncPeerState2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; - len += snprintf(buf + len, bufLen - len, "%s", "{"); + len += tsnprintf(buf + len, bufLen - len, "%s", "{"); for (int32_t i = 0; i < pSyncNode->replicaNum; ++i) { SPeerState* pState = syncNodeGetPeerState(pSyncNode, &(pSyncNode->replicasId[i])); if (pState == NULL) break; - len += snprintf(buf + len, bufLen - len, "%d:%" PRId64 " %" PRId64 "%s", i, pState->lastSendIndex, + len += tsnprintf(buf + len, bufLen - len, "%d:%" PRId64 " %" PRId64 "%s", i, pState->lastSendIndex, pState->lastSendTime, (i < pSyncNode->replicaNum - 1) ? ", " : ""); } - len += snprintf(buf + len, bufLen - len, "%s", "}"); + len += tsnprintf(buf + len, bufLen - len, "%s", "}"); } void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...) { diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 7d7868f3cd..ead985ff99 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -102,14 +102,14 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t int32_t len = 0; if (flag == HTTP_FLAT) { if (qid == NULL) { - len = snprintf(pHead, headLen, + len = tsnprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "Content-Type: application/json\n" "Content-Length: %d\n\n", uri, server, contLen); } else { - len = snprintf(pHead, headLen, + len = tsnprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "X-QID: %s\n" @@ -122,7 +122,7 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t } } else if (flag == HTTP_GZIP) { if (qid == NULL) { - len = snprintf(pHead, headLen, + len = tsnprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "Content-Type: application/json\n" @@ -130,7 +130,7 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t "Content-Length: %d\n\n", uri, server, contLen); } else { - len = snprintf(pHead, headLen, + len = tsnprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "X-QID: %s\n" diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index 98b5d907a0..d3a79f330c 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -679,15 +679,15 @@ void transPrintEpSet(SEpSet* pEpSet) { return; } char buf[512] = {0}; - int len = snprintf(buf, sizeof(buf), "epset:{"); + int len = tsnprintf(buf, sizeof(buf), "epset:{"); for (int i = 0; i < pEpSet->numOfEps; i++) { if (i == pEpSet->numOfEps - 1) { - len += snprintf(buf + len, sizeof(buf) - len, "%d. %s:%d", i, pEpSet->eps[i].fqdn, pEpSet->eps[i].port); + len += tsnprintf(buf + len, sizeof(buf) - len, "%d. %s:%d", i, pEpSet->eps[i].fqdn, pEpSet->eps[i].port); } else { - len += snprintf(buf + len, sizeof(buf) - len, "%d. %s:%d, ", i, pEpSet->eps[i].fqdn, pEpSet->eps[i].port); + len += tsnprintf(buf + len, sizeof(buf) - len, "%d. %s:%d, ", i, pEpSet->eps[i].fqdn, pEpSet->eps[i].port); } } - len += snprintf(buf + len, sizeof(buf) - len, "}"); + len += tsnprintf(buf + len, sizeof(buf) - len, "}"); tTrace("%s, inUse:%d", buf, pEpSet->inUse); } bool transEpSetIsEqual(SEpSet* a, SEpSet* b) { diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index cb6d3a7736..631cf6fca0 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -1054,7 +1054,7 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { uuid_generate(uuid); // it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null uuid_unparse_lower(uuid, buf); - int n = snprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); // though less performance, much safer + int n = tsnprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); // though less performance, much safer return 0; #else int64_t len = 0; diff --git a/source/util/src/tanal.c b/source/util/src/tanal.c index 19d26e8a0a..aa9fe9a174 100644 --- a/source/util/src/tanal.c +++ b/source/util/src/tanal.c @@ -120,7 +120,7 @@ void taosAnalUpdate(int64_t newVer, SHashObj *pHash) { bool taosAnalGetOptStr(const char *option, const char *optName, char *optValue, int32_t optMaxLen) { char buf[TSDB_ANAL_ALGO_OPTION_LEN] = {0}; - int32_t bufLen = snprintf(buf, sizeof(buf), "%s=", optName); + int32_t bufLen = tsnprintf(buf, sizeof(buf), "%s=", optName); char *pos1 = strstr(option, buf); char *pos2 = strstr(option, ANAL_ALGO_SPLIT); @@ -141,7 +141,7 @@ bool taosAnalGetOptStr(const char *option, const char *optName, char *optValue, bool taosAnalGetOptInt(const char *option, const char *optName, int32_t *optValue) { char buf[TSDB_ANAL_ALGO_OPTION_LEN] = {0}; - int32_t bufLen = snprintf(buf, sizeof(buf), "%s=", optName); + int32_t bufLen = tsnprintf(buf, sizeof(buf), "%s=", optName); char *pos1 = strstr(option, buf); char *pos2 = strstr(option, ANAL_ALGO_SPLIT); @@ -343,7 +343,7 @@ _OVER: static int32_t taosAnalJsonBufWriteOptInt(SAnalBuf *pBuf, const char *optName, int64_t optVal) { char buf[64] = {0}; - int32_t bufLen = snprintf(buf, sizeof(buf), "\"%s\": %" PRId64 ",\n", optName, optVal); + int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": %" PRId64 ",\n", optName, optVal); if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { return terrno; } @@ -352,7 +352,7 @@ static int32_t taosAnalJsonBufWriteOptInt(SAnalBuf *pBuf, const char *optName, i static int32_t taosAnalJsonBufWriteOptStr(SAnalBuf *pBuf, const char *optName, const char *optVal) { char buf[128] = {0}; - int32_t bufLen = snprintf(buf, sizeof(buf), "\"%s\": \"%s\",\n", optName, optVal); + int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": \"%s\",\n", optName, optVal); if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { return terrno; } @@ -361,7 +361,7 @@ static int32_t taosAnalJsonBufWriteOptStr(SAnalBuf *pBuf, const char *optName, c static int32_t taosAnalJsonBufWriteOptFloat(SAnalBuf *pBuf, const char *optName, float optVal) { char buf[128] = {0}; - int32_t bufLen = snprintf(buf, sizeof(buf), "\"%s\": %f,\n", optName, optVal); + int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": %f,\n", optName, optVal); if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { return terrno; } @@ -418,7 +418,7 @@ static int32_t taosAnalJsonBufWriteColMeta(SAnalBuf *pBuf, int32_t colIndex, int } } - int32_t bufLen = snprintf(buf, sizeof(buf), " [\"%s\", \"%s\", %d]%s\n", colName, tDataTypes[colType].name, + int32_t bufLen = tsnprintf(buf, sizeof(buf), " [\"%s\", \"%s\", %d]%s\n", colName, tDataTypes[colType].name, tDataTypes[colType].bytes, last ? "" : ","); if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { return terrno; @@ -481,38 +481,38 @@ static int32_t taosAnalJsonBufWriteColData(SAnalBuf *pBuf, int32_t colIndex, int switch (colType) { case TSDB_DATA_TYPE_BOOL: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", (*((int8_t *)colValue) == 1) ? 1 : 0); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", (*((int8_t *)colValue) == 1) ? 1 : 0); break; case TSDB_DATA_TYPE_TINYINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int8_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int8_t *)colValue); break; case TSDB_DATA_TYPE_UTINYINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint8_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint8_t *)colValue); break; case TSDB_DATA_TYPE_SMALLINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int16_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int16_t *)colValue); break; case TSDB_DATA_TYPE_USMALLINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint16_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint16_t *)colValue); break; case TSDB_DATA_TYPE_INT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int32_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int32_t *)colValue); break; case TSDB_DATA_TYPE_UINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint32_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint32_t *)colValue); break; case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_TIMESTAMP: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRId64 "", *(int64_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRId64 "", *(int64_t *)colValue); break; case TSDB_DATA_TYPE_UBIGINT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRIu64 "", *(uint64_t *)colValue); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRIu64 "", *(uint64_t *)colValue); break; case TSDB_DATA_TYPE_FLOAT: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_FLOAT_VAL(colValue)); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_FLOAT_VAL(colValue)); break; case TSDB_DATA_TYPE_DOUBLE: - bufLen += snprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_DOUBLE_VAL(colValue)); + bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_DOUBLE_VAL(colValue)); break; default: buf[bufLen] = '\0'; diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index d84a426e98..d6852b0566 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -672,17 +672,17 @@ int32_t cfgDumpItemValue(SConfigItem *pItem, char *buf, int32_t bufSize, int32_t int32_t len = 0; switch (pItem->dtype) { case CFG_DTYPE_BOOL: - len = snprintf(buf, bufSize, "%u", pItem->bval); + len = tsnprintf(buf, bufSize, "%u", pItem->bval); break; case CFG_DTYPE_INT32: - len = snprintf(buf, bufSize, "%d", pItem->i32); + len = tsnprintf(buf, bufSize, "%d", pItem->i32); break; case CFG_DTYPE_INT64: - len = snprintf(buf, bufSize, "%" PRId64, pItem->i64); + len = tsnprintf(buf, bufSize, "%" PRId64, pItem->i64); break; case CFG_DTYPE_FLOAT: case CFG_DTYPE_DOUBLE: - len = snprintf(buf, bufSize, "%f", pItem->fval); + len = tsnprintf(buf, bufSize, "%f", pItem->fval); break; case CFG_DTYPE_STRING: case CFG_DTYPE_DIR: @@ -690,7 +690,7 @@ int32_t cfgDumpItemValue(SConfigItem *pItem, char *buf, int32_t bufSize, int32_t case CFG_DTYPE_CHARSET: case CFG_DTYPE_TIMEZONE: case CFG_DTYPE_NONE: - len = snprintf(buf, bufSize, "%s", pItem->str); + len = tsnprintf(buf, bufSize, "%s", pItem->str); break; } @@ -710,13 +710,13 @@ int32_t cfgDumpItemScope(SConfigItem *pItem, char *buf, int32_t bufSize, int32_t int32_t len = 0; switch (pItem->scope) { case CFG_SCOPE_SERVER: - len = snprintf(buf, bufSize, "server"); + len = tsnprintf(buf, bufSize, "server"); break; case CFG_SCOPE_CLIENT: - len = snprintf(buf, bufSize, "client"); + len = tsnprintf(buf, bufSize, "client"); break; case CFG_SCOPE_BOTH: - len = snprintf(buf, bufSize, "both"); + len = tsnprintf(buf, bufSize, "both"); break; } diff --git a/source/util/src/tstrbuild.c b/source/util/src/tstrbuild.c index 54e815ee13..8184f57041 100644 --- a/source/util/src/tstrbuild.c +++ b/source/util/src/tstrbuild.c @@ -71,12 +71,12 @@ void taosStringBuilderAppendNull(SStringBuilder* sb) { taosStringBuilderAppendSt void taosStringBuilderAppendInteger(SStringBuilder* sb, int64_t v) { char buf[64] = {0}; - size_t len = snprintf(buf, sizeof(buf), "%" PRId64, v); + size_t len = tsnprintf(buf, sizeof(buf), "%" PRId64, v); taosStringBuilderAppendStringLen(sb, buf, TMIN(len, sizeof(buf))); } void taosStringBuilderAppendDouble(SStringBuilder* sb, double v) { char buf[512] = {0}; - size_t len = snprintf(buf, sizeof(buf), "%.9lf", v); + size_t len = tsnprintf(buf, sizeof(buf), "%.9lf", v); taosStringBuilderAppendStringLen(sb, buf, TMIN(len, sizeof(buf))); } diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 84da746afd..e150f67931 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -405,7 +405,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i if (tsEnableScience) { taosFprintfFile(pFile, "%*.7e", width, GET_FLOAT_VAL(val)); } else { - n = snprintf(buf, LENGTH, "%*.7f", width, GET_FLOAT_VAL(val)); + n = tsnprintf(buf, LENGTH, "%*.7f", width, GET_FLOAT_VAL(val)); if (n > SHELL_FLOAT_WIDTH) { taosFprintfFile(pFile, "%*.7e", width, GET_FLOAT_VAL(val)); } else { @@ -419,7 +419,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i snprintf(buf, LENGTH, "%*.15e", width, GET_DOUBLE_VAL(val)); taosFprintfFile(pFile, "%s", buf); } else { - n = snprintf(buf, LENGTH, "%*.15f", width, GET_DOUBLE_VAL(val)); + n = tsnprintf(buf, LENGTH, "%*.15f", width, GET_DOUBLE_VAL(val)); if (n > SHELL_DOUBLE_WIDTH) { taosFprintfFile(pFile, "%*.15e", width, GET_DOUBLE_VAL(val)); } else { @@ -670,7 +670,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t if (tsEnableScience) { printf("%*.7e", width, GET_FLOAT_VAL(val)); } else { - n = snprintf(buf, LENGTH, "%*.7f", width, GET_FLOAT_VAL(val)); + n = tsnprintf(buf, LENGTH, "%*.7f", width, GET_FLOAT_VAL(val)); if (n > SHELL_FLOAT_WIDTH) { printf("%*.7e", width, GET_FLOAT_VAL(val)); } else { @@ -683,7 +683,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t snprintf(buf, LENGTH, "%*.15e", width, GET_DOUBLE_VAL(val)); printf("%s", buf); } else { - n = snprintf(buf, LENGTH, "%*.15f", width, GET_DOUBLE_VAL(val)); + n = tsnprintf(buf, LENGTH, "%*.15f", width, GET_DOUBLE_VAL(val)); if (n > SHELL_DOUBLE_WIDTH) { printf("%*.15e", width, GET_DOUBLE_VAL(val)); } else { From 402f9daa2a01b0236ee67a542faa86f3a1a68876 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 10 Oct 2024 11:36:02 +0800 Subject: [PATCH 04/56] fix: utest --- source/os/test/osStringTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/os/test/osStringTests.cpp b/source/os/test/osStringTests.cpp index 03cab70f30..de07d21959 100644 --- a/source/os/test/osStringTests.cpp +++ b/source/os/test/osStringTests.cpp @@ -129,7 +129,7 @@ TEST(osStringTests, ostsnprintfTests) { memset(buffer, 0, sizeof(buffer)); ret = tsnprintf(buffer, 10, "Hello%s", "World"); EXPECT_EQ(ret, 9); - EXPECT_EQ(strncmp(buffer, "Hello, Wo", 9), 0); + EXPECT_EQ(strncmp(buffer, "HelloWorl", 9), 0); memset(buffer, 0, sizeof(buffer)); ret = tsnprintf(buffer, 0, "Hello, %s!", "World"); From e81e999fc1542f0c78beeb4f4928cc9afe4b05d6 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 10 Oct 2024 15:40:43 +0800 Subject: [PATCH 05/56] fix: snprintf --- source/common/src/tmisce.c | 10 ++-- source/dnode/mgmt/exe/dmMain.c | 2 +- source/dnode/mgmt/mgmt_mnode/src/mmFile.c | 6 +- source/dnode/mgmt/mgmt_vnode/src/vmFile.c | 4 +- source/dnode/mgmt/node_util/src/dmFile.c | 18 +++--- source/dnode/mnode/impl/src/mndAnode.c | 4 +- source/dnode/mnode/impl/src/mndSma.c | 2 +- source/libs/stream/src/streamBackendRocksdb.c | 60 +++++++++---------- source/libs/stream/src/streamCheckpoint.c | 12 ++-- source/libs/stream/src/streamSnapshot.c | 4 +- source/libs/transport/src/thttp.c | 8 +-- source/os/src/osSysinfo.c | 10 +++- source/util/src/tanal.c | 2 +- 13 files changed, 74 insertions(+), 68 deletions(-) diff --git a/source/common/src/tmisce.c b/source/common/src/tmisce.c index 6d2b71a214..10375ba857 100644 --- a/source/common/src/tmisce.c +++ b/source/common/src/tmisce.c @@ -143,7 +143,7 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { int32_t ret = 0; int32_t nwrite = 0; - nwrite = tsnprintf(pBuf + nwrite, cap, "epset:{"); + nwrite = snprintf(pBuf + nwrite, cap, "epset:{"); if (nwrite <= 0 || nwrite >= cap) { return TSDB_CODE_OUT_OF_BUFFER; } @@ -151,9 +151,9 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { for (int _i = 0; (_i < pEpSet->numOfEps) && (cap > 0); _i++) { if (_i == pEpSet->numOfEps - 1) { - ret = tsnprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); + ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); } else { - ret = tsnprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); + ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port); } if (ret <= 0 || ret >= cap) { @@ -168,7 +168,7 @@ int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) { return TSDB_CODE_OUT_OF_BUFFER; } - ret = tsnprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse); + ret = snprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse); if (ret <= 0 || ret >= cap) { return TSDB_CODE_OUT_OF_BUFFER; } else { @@ -215,7 +215,7 @@ int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "numOfCpu", tsNumOfCores), NULL, _exit); } - int32_t nBytes = tsnprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB); + int32_t nBytes = snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB); if (nBytes <= 9 || nBytes >= sizeof(tmp)) { TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_RANGE, NULL, _exit); } diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 8306406d64..ddef0537f8 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -282,7 +282,7 @@ static void dmPrintArgs(int32_t argc, char const *argv[]) { char args[1024] = {0}; int32_t arglen = tsnprintf(args, sizeof(args), "%s", argv[0]); for (int32_t i = 1; i < argc; ++i) { - arglen = arglen + snprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]); + arglen = arglen + tsnprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]); } dInfo("startup path:%s args:%s", path, args); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c index 11ed02b283..a95ec42f7e 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c @@ -64,7 +64,7 @@ int32_t mmReadFile(const char *path, SMnodeOpt *pOption) { SJson *pJson = NULL; char file[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(file, sizeof(file), "%s%smnode.json", path, TD_DIRSEP); + int32_t nBytes = snprintf(file, sizeof(file), "%s%smnode.json", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -168,13 +168,13 @@ int32_t mmWriteFile(const char *path, const SMnodeOpt *pOption) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(file, sizeof(file), "%s%smnode.json.bak", path, TD_DIRSEP); + int32_t nBytes = snprintf(file, sizeof(file), "%s%smnode.json.bak", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; } - nBytes = tsnprintf(realfile, sizeof(realfile), "%s%smnode.json", path, TD_DIRSEP); + nBytes = snprintf(realfile, sizeof(realfile), "%s%smnode.json", path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(realfile)) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index ca64ecabfc..5fabd4cdde 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -204,12 +204,12 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(file, sizeof(file), "%s%svnodes_tmp.json", pMgmt->path, TD_DIRSEP); + int32_t nBytes = snprintf(file, sizeof(file), "%s%svnodes_tmp.json", pMgmt->path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { return TSDB_CODE_OUT_OF_RANGE; } - nBytes = tsnprintf(realfile, sizeof(realfile), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); + nBytes = snprintf(realfile, sizeof(realfile), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(realfile)) { return TSDB_CODE_OUT_OF_RANGE; } diff --git a/source/dnode/mgmt/node_util/src/dmFile.c b/source/dnode/mgmt/node_util/src/dmFile.c index 064b107d58..1da13f72cd 100644 --- a/source/dnode/mgmt/node_util/src/dmFile.c +++ b/source/dnode/mgmt/node_util/src/dmFile.c @@ -42,7 +42,7 @@ int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) { char *content = NULL; SJson *pJson = NULL; char file[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); + int32_t nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -120,13 +120,13 @@ int32_t dmWriteFile(const char *path, const char *name, bool deployed) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); + int32_t nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; } - nBytes = tsnprintf(realfile, sizeof(realfile), "%s%s%s.json", path, TD_DIRSEP, name); + nBytes = snprintf(realfile, sizeof(realfile), "%s%s%s.json", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= PATH_MAX) { code = TSDB_CODE_OUT_OF_BUFFER; goto _OVER; @@ -387,22 +387,22 @@ int32_t dmUpdateEncryptKey(char *key, bool toLogFile) { char checkFile[PATH_MAX] = {0}; char realCheckFile[PATH_MAX] = {0}; - int32_t nBytes = tsnprintf(folder, sizeof(folder), "%s%sdnode", tsDataDir, TD_DIRSEP); + int32_t nBytes = snprintf(folder, sizeof(folder), "%s%sdnode", tsDataDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = tsnprintf(encryptFile, sizeof(realEncryptFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); + nBytes = snprintf(encryptFile, sizeof(realEncryptFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = tsnprintf(realEncryptFile, sizeof(realEncryptFile), "%s%s%s", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); + nBytes = snprintf(realEncryptFile, sizeof(realEncryptFile), "%s%s%s", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } - nBytes = tsnprintf(checkFile, sizeof(checkFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_CHECK_CODE_FILE); + nBytes = snprintf(checkFile, sizeof(checkFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_CHECK_CODE_FILE); if (nBytes <= 0 || nBytes >= PATH_MAX) { return TSDB_CODE_OUT_OF_BUFFER; } @@ -507,14 +507,14 @@ int32_t dmGetEncryptKey() { char *encryptKey = NULL; char *content = NULL; - int32_t nBytes = tsnprintf(encryptFile, sizeof(encryptFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, + int32_t nBytes = snprintf(encryptFile, sizeof(encryptFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_ENCRYPT_CODE_FILE); if (nBytes <= 0 || nBytes >= sizeof(encryptFile)) { code = TSDB_CODE_OUT_OF_BUFFER; return code; } - nBytes = tsnprintf(checkFile, sizeof(checkFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_CHECK_CODE_FILE); + nBytes = snprintf(checkFile, sizeof(checkFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_CHECK_CODE_FILE); if (nBytes <= 0 || nBytes >= sizeof(checkFile)) { code = TSDB_CODE_OUT_OF_BUFFER; return code; diff --git a/source/dnode/mnode/impl/src/mndAnode.c b/source/dnode/mnode/impl/src/mndAnode.c index 7e02db0e90..62c62a2abf 100644 --- a/source/dnode/mnode/impl/src/mndAnode.c +++ b/source/dnode/mnode/impl/src/mndAnode.c @@ -835,7 +835,7 @@ static int32_t mndProcessAnalAlgoReq(SRpcMsg *pReq) { for (int32_t a = 0; a < taosArrayGetSize(algos); ++a) { SAnodeAlgo *algo = taosArrayGet(algos, a); - nameLen = 1 + snprintf(name, sizeof(name) - 1, "%d:%s", url.type, algo->name); + nameLen = 1 + tsnprintf(name, sizeof(name) - 1, "%d:%s", url.type, algo->name); SAnalUrl *pOldUrl = taosHashAcquire(rsp.hash, name, nameLen); if (pOldUrl == NULL || (pOldUrl != NULL && pOldUrl->anode < url.anode)) { @@ -852,7 +852,7 @@ static int32_t mndProcessAnalAlgoReq(SRpcMsg *pReq) { goto _OVER; } - url.urlLen = 1 + snprintf(url.url, TSDB_ANAL_ANODE_URL_LEN + TSDB_ANAL_ALGO_TYPE_LEN, "%s/%s", pAnode->url, + url.urlLen = 1 + tsnprintf(url.url, TSDB_ANAL_ANODE_URL_LEN + TSDB_ANAL_ALGO_TYPE_LEN, "%s/%s", pAnode->url, taosAnalAlgoUrlStr(url.type)); if (taosHashPut(rsp.hash, name, nameLen, &url, sizeof(SAnalUrl)) != 0) { taosMemoryFree(url.url); diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index a54c7f1b14..fa2538f245 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -2252,7 +2252,7 @@ static int32_t mndRetrieveTSMA(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlo if (nodeType(pFunc) == QUERY_NODE_FUNCTION) { SFunctionNode *pFuncNode = (SFunctionNode *)pFunc; if (!fmIsTSMASupportedFunc(pFuncNode->funcId)) continue; - len += tsnprintf(start, TSDB_MAX_SAVED_SQL_LEN - len, "%s%s", start != buf + VARSTR_HEADER_SIZE ? "," : "", + len += snprintf(start, TSDB_MAX_SAVED_SQL_LEN - len, "%s%s", start != buf + VARSTR_HEADER_SIZE ? "," : "", ((SExprNode *)pFunc)->userAlias); if (len >= TSDB_MAX_SAVED_SQL_LEN) { len = TSDB_MAX_SAVED_SQL_LEN; diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index 5021933c33..c88971ab75 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -216,7 +216,7 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) { return terrno; } - nBytes = tsnprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); + nBytes = snprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(state); return TSDB_CODE_OUT_OF_RANGE; @@ -229,7 +229,7 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) { return terrno; } - nBytes = tsnprintf(chkp, cap, "%s%s%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, "checkpoints", TD_DIRSEP, chkpId); + nBytes = snprintf(chkp, cap, "%s%s%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, "checkpoints", TD_DIRSEP, chkpId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(state); taosMemoryFree(chkp); @@ -282,7 +282,7 @@ int32_t remoteChkp_readMetaData(char* path, SSChkpMetaOnS3** pMeta) { return terrno; } - int32_t n = tsnprintf(metaPath, cap, "%s%s%s", path, TD_DIRSEP, "META"); + int32_t n = snprintf(metaPath, cap, "%s%s%s", path, TD_DIRSEP, "META"); if (n <= 0 || n >= cap) { taosMemoryFree(metaPath); return TSDB_CODE_OUT_OF_MEMORY; @@ -350,7 +350,7 @@ int32_t remoteChkp_validAndCvtMeta(char* path, SSChkpMetaOnS3* pMeta, int64_t ch goto _EXIT; } - nBytes = tsnprintf(src, cap, "%s%s%s_%" PRId64 "", path, TD_DIRSEP, key, pMeta->currChkptId); + nBytes = snprintf(src, cap, "%s%s%s_%" PRId64 "", path, TD_DIRSEP, key, pMeta->currChkptId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -361,7 +361,7 @@ int32_t remoteChkp_validAndCvtMeta(char* path, SSChkpMetaOnS3* pMeta, int64_t ch goto _EXIT; } - nBytes = tsnprintf(dst, cap, "%s%s%s", path, TD_DIRSEP, key); + nBytes = snprintf(dst, cap, "%s%s%s", path, TD_DIRSEP, key); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -403,7 +403,7 @@ int32_t remoteChkpGetDelFile(char* path, SArray* toDel) { return terrno; } - nBytes = tsnprintf(p, cap, "%s_%" PRId64 "", key, pMeta->currChkptId); + nBytes = snprintf(p, cap, "%s_%" PRId64 "", key, pMeta->currChkptId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(pMeta); taosMemoryFree(p); @@ -499,7 +499,7 @@ int32_t rebuildFromRemoteChkp_s3(const char* key, char* chkpPath, int64_t chkpId return terrno; } - int32_t nBytes = tsnprintf(defaultPath, cap, "%s%s", defaultPath, "_tmp"); + int32_t nBytes = snprintf(defaultPath, cap, "%s%s", defaultPath, "_tmp"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(defaultPath); return TSDB_CODE_OUT_OF_RANGE; @@ -611,13 +611,13 @@ int32_t backendFileCopyFilesImpl(const char* src, const char* dst) { continue; } - nBytes = tsnprintf(srcName, cap, "%s%s%s", src, TD_DIRSEP, name); + nBytes = snprintf(srcName, cap, "%s%s%s", src, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = tsnprintf(dstName, cap, "%s%s%s", dst, TD_DIRSEP, name); + nBytes = snprintf(dstName, cap, "%s%s%s", dst, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -715,7 +715,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = tsnprintf(prefixPath, cap, "%s%s%s", path, TD_DIRSEP, key); + nBytes = snprintf(prefixPath, cap, "%s%s%s", path, TD_DIRSEP, key); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -727,7 +727,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = tsnprintf(defaultPath, cap, "%s%s%s", prefixPath, TD_DIRSEP, "state"); + nBytes = snprintf(defaultPath, cap, "%s%s%s", prefixPath, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -739,7 +739,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId goto _EXIT; } - nBytes = tsnprintf(checkpointRoot, cap, "%s%s%s", prefixPath, TD_DIRSEP, "checkpoints"); + nBytes = snprintf(checkpointRoot, cap, "%s%s%s", prefixPath, TD_DIRSEP, "checkpoints"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -753,7 +753,7 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId stDebug("%s check local backend dir:%s, checkpointId:%" PRId64 " succ", key, defaultPath, chkptId); if (chkptId > 0) { - nBytes = tsnprintf(checkpointPath, cap, "%s%s%s%s%s%" PRId64 "", prefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, + nBytes = snprintf(checkpointPath, cap, "%s%s%s%s%s%" PRId64 "", prefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", chkptId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; @@ -800,7 +800,7 @@ bool streamBackendDataIsExist(const char* path, int64_t chkpId) { return false; } - int16_t nBytes = tsnprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); + int16_t nBytes = snprintf(state, cap, "%s%s%s", path, TD_DIRSEP, "state"); if (nBytes <= 0 || nBytes >= cap) { terrno = TSDB_CODE_OUT_OF_RANGE; exist = false; @@ -1322,13 +1322,13 @@ int32_t chkpPreBuildDir(char* path, int64_t chkpId, char** chkpDir, char** chkpI goto _EXIT; } - nBytes = tsnprintf(pChkpDir, cap, "%s%s%s", path, TD_DIRSEP, "checkpoints"); + nBytes = snprintf(pChkpDir, cap, "%s%s%s", path, TD_DIRSEP, "checkpoints"); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; } - nBytes = tsnprintf(pChkpIdDir, cap, "%s%s%s%" PRId64, pChkpDir, TD_DIRSEP, "checkpoint", chkpId); + nBytes = snprintf(pChkpIdDir, cap, "%s%s%s%" PRId64, pChkpDir, TD_DIRSEP, "checkpoint", chkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _EXIT; @@ -1500,7 +1500,7 @@ int32_t chkpLoadExtraInfo(char* pChkpIdDir, int64_t* chkpId, int64_t* processId) goto _EXIT; } - nBytes = tsnprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); + nBytes = snprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build dst to load extra info, dir:%s", pChkpIdDir); @@ -1556,7 +1556,7 @@ int32_t chkpAddExtraInfo(char* pChkpIdDir, int64_t chkpId, int64_t processId) { goto _EXIT; } - nBytes = tsnprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); + nBytes = snprintf(pDst, cap, "%s%sinfo", pChkpIdDir, TD_DIRSEP); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build dst to add extra info, dir:%s, reason:%s", pChkpIdDir, tstrerror(code)); @@ -1570,7 +1570,7 @@ int32_t chkpAddExtraInfo(char* pChkpIdDir, int64_t chkpId, int64_t processId) { goto _EXIT; } - nBytes = tsnprintf(buf, sizeof(buf), "%" PRId64 " %" PRId64 "", chkpId, processId); + nBytes = snprintf(buf, sizeof(buf), "%" PRId64 " %" PRId64 "", chkpId, processId); if (nBytes <= 0 || nBytes >= sizeof(buf)) { code = TSDB_CODE_OUT_OF_RANGE; stError("failed to build content to add extra info, dir:%s,reason:%s", pChkpIdDir, tstrerror(code)); @@ -2727,7 +2727,7 @@ int32_t taskDbGenChkpUploadData__s3(STaskDbWrapper* pDb, void* bkdChkpMgt, int64 return terrno; } - int32_t nBytes = tsnprintf(temp, cap, "%s%s%s%" PRId64, pDb->path, TD_DIRSEP, "tmp", chkpId); + int32_t nBytes = snprintf(temp, cap, "%s%s%s%" PRId64, pDb->path, TD_DIRSEP, "tmp", chkpId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(temp); return TSDB_CODE_OUT_OF_RANGE; @@ -4805,14 +4805,14 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { char* srcDir = &dstBuf[cap]; char* dstDir = &srcDir[cap]; - int nBytes = tsnprintf(srcDir, cap, "%s%s%s%s%s%" PRId64 "", p->path, TD_DIRSEP, "checkpoints", TD_DIRSEP, + int nBytes = snprintf(srcDir, cap, "%s%s%s%s%s%" PRId64 "", p->path, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = tsnprintf(dstDir, cap, "%s", dname); + nBytes = snprintf(dstDir, cap, "%s", dname); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4837,13 +4837,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(dstBuf, 0, cap); char* filename = taosArrayGetP(p->pAdd, i); - nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, filename); + nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, filename); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = tsnprintf(dstBuf, cap, "%s%s%s", dstDir, TD_DIRSEP, filename); + nBytes = snprintf(dstBuf, cap, "%s%s%s", dstDir, TD_DIRSEP, filename); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4874,13 +4874,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(srcBuf, 0, cap); memset(dstBuf, 0, cap); - nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pCurrent); + nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pCurrent); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = tsnprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pCurrent, p->curChkpId); + nBytes = snprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pCurrent, p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4896,13 +4896,13 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { memset(srcBuf, 0, cap); memset(dstBuf, 0, cap); - nBytes = tsnprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pManifest); + nBytes = snprintf(srcBuf, cap, "%s%s%s", srcDir, TD_DIRSEP, p->pManifest); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; } - nBytes = tsnprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pManifest, p->curChkpId); + nBytes = snprintf(dstBuf, cap, "%s%s%s_%" PRId64 "", dstDir, TD_DIRSEP, p->pManifest, p->curChkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -4914,7 +4914,7 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) { goto _ERROR; } memset(dstBuf, 0, cap); - nBytes = tsnprintf(dstDir, cap, "%s%s%s", dstDir, TD_DIRSEP, chkpMeta); + nBytes = snprintf(dstDir, cap, "%s%s%s", dstDir, TD_DIRSEP, chkpMeta); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; goto _ERROR; @@ -5018,7 +5018,7 @@ int32_t bkdMgtGetDelta(SBkdMgt* bm, char* taskId, int64_t chkpId, SArray* list, return terrno; } - int32_t nBytes = tsnprintf(path, cap, "%s%s%s", bm->path, TD_DIRSEP, taskId); + int32_t nBytes = snprintf(path, cap, "%s%s%s", bm->path, TD_DIRSEP, taskId); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(path); TAOS_UNUSED(taosThreadRwlockUnlock(&bm->rwLock)); diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c index 91c7d9e2ac..e44bca123b 100644 --- a/source/libs/stream/src/streamCheckpoint.c +++ b/source/libs/stream/src/streamCheckpoint.c @@ -710,7 +710,7 @@ static int32_t getCheckpointDataMeta(const char* id, const char* path, SArray* l return terrno; } - int32_t nBytes = tsnprintf(filePath, cap, "%s%s%s", path, TD_DIRSEP, "META_TMP"); + int32_t nBytes = snprintf(filePath, cap, "%s%s%s", path, TD_DIRSEP, "META_TMP"); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(filePath); return TSDB_CODE_OUT_OF_RANGE; @@ -1304,13 +1304,13 @@ static int32_t uploadCheckpointToS3(const char* id, const char* path) { char filename[PATH_MAX] = {0}; if (path[strlen(path) - 1] == TD_DIRSEP_CHAR) { - nBytes = tsnprintf(filename, sizeof(filename), "%s%s", path, name); + nBytes = snprintf(filename, sizeof(filename), "%s%s", path, name); if (nBytes <= 0 || nBytes >= sizeof(filename)) { code = TSDB_CODE_OUT_OF_RANGE; break; } } else { - nBytes = tsnprintf(filename, sizeof(filename), "%s%s%s", path, TD_DIRSEP, name); + nBytes = snprintf(filename, sizeof(filename), "%s%s%s", path, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= sizeof(filename)) { code = TSDB_CODE_OUT_OF_RANGE; break; @@ -1318,7 +1318,7 @@ static int32_t uploadCheckpointToS3(const char* id, const char* path) { } char object[PATH_MAX] = {0}; - nBytes = tsnprintf(object, sizeof(object), "%s%s%s", id, TD_DIRSEP, name); + nBytes = snprintf(object, sizeof(object), "%s%s%s", id, TD_DIRSEP, name); if (nBytes <= 0 || nBytes >= sizeof(object)) { code = TSDB_CODE_OUT_OF_RANGE; break; @@ -1349,7 +1349,7 @@ int32_t downloadCheckpointByNameS3(const char* id, const char* fname, const char return terrno; } - nBytes = tsnprintf(buf, cap, "%s/%s", id, fname); + nBytes = snprintf(buf, cap, "%s/%s", id, fname); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(buf); return TSDB_CODE_OUT_OF_RANGE; @@ -1439,7 +1439,7 @@ int32_t deleteCheckpoint(const char* id) { int32_t deleteCheckpointFile(const char* id, const char* name) { char object[128] = {0}; - int32_t nBytes = tsnprintf(object, sizeof(object), "%s/%s", id, name); + int32_t nBytes = snprintf(object, sizeof(object), "%s/%s", id, name); if (nBytes <= 0 || nBytes >= sizeof(object)) { return TSDB_CODE_OUT_OF_RANGE; } diff --git a/source/libs/stream/src/streamSnapshot.c b/source/libs/stream/src/streamSnapshot.c index 951ca43732..ae8a71d988 100644 --- a/source/libs/stream/src/streamSnapshot.c +++ b/source/libs/stream/src/streamSnapshot.c @@ -164,7 +164,7 @@ void snapFileDebugInfo(SBackendSnapFile2* pSnapFile) { return; } - int32_t nBytes = tsnprintf(buf + strlen(buf), cap, "["); + int32_t nBytes = snprintf(buf + strlen(buf), cap, "["); if (nBytes <= 0 || nBytes >= cap) { taosMemoryFree(buf); stError("%s failed to write buf, reason:%s", STREAM_STATE_TRANSFER, tstrerror(TSDB_CODE_OUT_OF_RANGE)); @@ -355,7 +355,7 @@ int32_t streamBackendSnapInitFile(char* metaPath, SStreamTaskSnap* pSnap, SBacke return terrno; } - nBytes = tsnprintf(path, cap, "%s%s%s%s%s%" PRId64 "", pSnap->dbPrefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, + nBytes = snprintf(path, cap, "%s%s%s%s%s%" PRId64 "", pSnap->dbPrefixPath, TD_DIRSEP, "checkpoints", TD_DIRSEP, "checkpoint", pSnap->chkpId); if (nBytes <= 0 || nBytes >= cap) { code = TSDB_CODE_OUT_OF_RANGE; diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index ead985ff99..7d7868f3cd 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -102,14 +102,14 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t int32_t len = 0; if (flag == HTTP_FLAT) { if (qid == NULL) { - len = tsnprintf(pHead, headLen, + len = snprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "Content-Type: application/json\n" "Content-Length: %d\n\n", uri, server, contLen); } else { - len = tsnprintf(pHead, headLen, + len = snprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "X-QID: %s\n" @@ -122,7 +122,7 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t } } else if (flag == HTTP_GZIP) { if (qid == NULL) { - len = tsnprintf(pHead, headLen, + len = snprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "Content-Type: application/json\n" @@ -130,7 +130,7 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t "Content-Length: %d\n\n", uri, server, contLen); } else { - len = tsnprintf(pHead, headLen, + len = snprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "X-QID: %s\n" diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 631cf6fca0..6d4629f476 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -1042,9 +1042,12 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { if (h != S_OK) { return TAOS_SYSTEM_WINAPI_ERROR(GetLastError()); } - snprintf(uid, uidlen, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid.Data1, guid.Data2, guid.Data3, + int n = snprintf(uid, uidlen, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); + if(n >= uidlen) { + return TSDB_CODE_OUT_OF_BUFFER;; + } return 0; #elif defined(_TD_DARWIN_64) @@ -1054,7 +1057,10 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { uuid_generate(uuid); // it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null uuid_unparse_lower(uuid, buf); - int n = tsnprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); // though less performance, much safer + int n = snprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); // though less performance, much safer + if(n >= uidlen) { + return TSDB_CODE_OUT_OF_BUFFER;; + } return 0; #else int64_t len = 0; diff --git a/source/util/src/tanal.c b/source/util/src/tanal.c index aa9fe9a174..a00a2dd2eb 100644 --- a/source/util/src/tanal.c +++ b/source/util/src/tanal.c @@ -156,7 +156,7 @@ bool taosAnalGetOptInt(const char *option, const char *optName, int32_t *optValu int32_t taosAnalGetAlgoUrl(const char *algoName, EAnalAlgoType type, char *url, int32_t urlLen) { int32_t code = 0; char name[TSDB_ANAL_ALGO_KEY_LEN] = {0}; - int32_t nameLen = 1 + snprintf(name, sizeof(name) - 1, "%d:%s", type, algoName); + int32_t nameLen = 1 + tsnprintf(name, sizeof(name) - 1, "%d:%s", type, algoName); taosThreadMutexLock(&tsAlgos.lock); SAnalUrl *pUrl = taosHashAcquire(tsAlgos.hash, name, nameLen); From 3faff06991784977114b96741f77a8bf6667fb8e Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 10 Oct 2024 16:19:27 +0800 Subject: [PATCH 06/56] fix: revoke table name escape issue --- source/libs/parser/src/parAstCreater.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 684bd24a9c..8ede53b0a4 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -3711,6 +3711,7 @@ SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, STokenPair* CHECK_PARSER_STATUS(pCxt); CHECK_NAME(checkDbName(pCxt, &pPrivLevel->first, false)); CHECK_NAME(checkUserName(pCxt, pUserName)); + CHECK_NAME(checkTableName(pCxt, &pPrivLevel->second)); SRevokeStmt* pStmt = NULL; pCxt->errCode = nodesMakeNode(QUERY_NODE_REVOKE_STMT, (SNode**)&pStmt); CHECK_MAKE_NODE(pStmt); From 47a6f3e6bc2fdcdf3383242400f27a98fe59a3af Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Fri, 11 Oct 2024 13:41:53 +0800 Subject: [PATCH 07/56] enh: getsystemuuid --- include/util/tuuid.h | 3 ++ source/client/src/clientEnv.c | 14 +++----- source/libs/scheduler/src/scheduler.c | 2 +- source/util/src/tuuid.c | 48 +++++++++++++++++++-------- 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/include/util/tuuid.h b/include/util/tuuid.h index a4e1059371..9bac855a6c 100644 --- a/include/util/tuuid.h +++ b/include/util/tuuid.h @@ -48,3 +48,6 @@ int64_t tGenIdPI64(void); * @return */ int64_t tGenQid64(int8_t dnodeId); + +int32_t taosGetSystemUUID32(uint32_t *uuid); +int32_t taosGetSystemUUID64(uint64_t *uuid); diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index ac346f4ba7..bcfc5b7a5a 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -1094,18 +1094,14 @@ int taos_options_imp(TSDB_OPTION option, const char *str) { * @return */ uint64_t generateRequestId() { - static uint64_t hashId = 0; - static uint32_t requestSerialId = 0; + static uint32_t hashId = 0; + static int32_t requestSerialId = 0; if (hashId == 0) { - char uid[64] = {0}; - int32_t code = taosGetSystemUUID(uid, tListLen(uid)); + int32_t code = taosGetSystemUUID32(&hashId); if (code != TSDB_CODE_SUCCESS) { tscError("Failed to get the system uid to generated request id, reason:%s. use ip address instead", - tstrerror(TAOS_SYSTEM_ERROR(errno))); - - } else { - hashId = MurmurHash3_32(uid, strlen(uid)); + tstrerror(code)); } } @@ -1117,7 +1113,7 @@ uint64_t generateRequestId() { uint32_t val = atomic_add_fetch_32(&requestSerialId, 1); if (val >= 0xFFFF) atomic_store_32(&requestSerialId, 0); - id = ((hashId & 0x0FFF) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); + id = (((uint64_t)(hashId & 0x0FFF)) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); if (id) { break; } diff --git a/source/libs/scheduler/src/scheduler.c b/source/libs/scheduler/src/scheduler.c index 0c74e99a29..f3d9d88c5e 100644 --- a/source/libs/scheduler/src/scheduler.c +++ b/source/libs/scheduler/src/scheduler.c @@ -56,7 +56,7 @@ int32_t schedulerInit() { SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } - if (taosGetSystemUUID((char *)&schMgmt.sId, sizeof(schMgmt.sId))) { + if (taosGetSystemUUID64(&schMgmt.sId)) { qError("generate schedulerId failed, errno:%d", errno); SCH_ERR_RET(TSDB_CODE_QRY_SYS_ERROR); } diff --git a/source/util/src/tuuid.c b/source/util/src/tuuid.c index 4472189d37..53ef5c493d 100644 --- a/source/util/src/tuuid.c +++ b/source/util/src/tuuid.c @@ -15,19 +15,42 @@ #include "tuuid.h" -static int64_t tUUIDHashId = 0; +static uint32_t tUUIDHashId = 0; static int32_t tUUIDSerialNo = 0; +int32_t taosGetSystemUUID32(uint32_t *uuid) { + if (uuid == NULL) return TSDB_CODE_APP_ERROR; + char uid[65] = {0}; + int32_t code = taosGetSystemUUID(uid, sizeof(uid)); + uid[64] = 0; + + if (code != TSDB_CODE_SUCCESS) { + return code; + } else { + *uuid = MurmurHash3_32(uid, strlen(uid)); + } + return TSDB_CODE_SUCCESS; +} + +int32_t taosGetSystemUUID64(uint64_t *uuid) { + if (uuid == NULL) return TSDB_CODE_APP_ERROR; + char uid[65] = {0}; + int32_t code = taosGetSystemUUID(uid, sizeof(uid)); + uid[64] = 0; + + if (code != TSDB_CODE_SUCCESS) { + return code; + } else { + *uuid = MurmurHash3_64(uid, strlen(uid)); + } + return TSDB_CODE_SUCCESS; +} + int32_t tGenIdPI32(void) { if (tUUIDHashId == 0) { - char uid[65] = {0}; - int32_t code = taosGetSystemUUID(uid, sizeof(uid)); - uid[64] = 0; - + int32_t code = taosGetSystemUUID32(&tUUIDHashId); if (code != TSDB_CODE_SUCCESS) { - terrno = TAOS_SYSTEM_ERROR(errno); - } else { - tUUIDHashId = MurmurHash3_32(uid, strlen(uid)); + terrno = code; } } @@ -41,12 +64,9 @@ int32_t tGenIdPI32(void) { int64_t tGenIdPI64(void) { if (tUUIDHashId == 0) { - char uid[65] = {0}; - int32_t code = taosGetSystemUUID(uid, 64); + int32_t code = taosGetSystemUUID32(&tUUIDHashId); if (code != TSDB_CODE_SUCCESS) { - terrno = TAOS_SYSTEM_ERROR(errno); - } else { - tUUIDHashId = MurmurHash3_32(uid, strlen(uid)); + terrno = code; } } @@ -57,7 +77,7 @@ int64_t tGenIdPI64(void) { uint64_t pid = taosGetPId(); int32_t val = atomic_add_fetch_32(&tUUIDSerialNo, 1); - id = ((tUUIDHashId & 0x07FF) << 52) | ((pid & 0x0F) << 48) | ((ts & 0x3FFFFFF) << 20) | (val & 0xFFFFF); + id = (((uint64_t)(tUUIDHashId & 0x07FF)) << 52) | ((pid & 0x0F) << 48) | ((ts & 0x3FFFFFF) << 20) | (val & 0xFFFFF); if (id) { break; } From 74df5d4711c9300e0a8abeeea5a7105f529651ad Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 11 Oct 2024 14:11:48 +0800 Subject: [PATCH 08/56] fix:[TD-32187] test tmq api random --- source/client/test/tmqTest.cpp | 7 +- tests/system-test/7-tmq/td-32187.py | 69 +++--------- utils/test/c/CMakeLists.txt | 8 ++ utils/test/c/tmq_td32187.c | 168 ++++++++++++++++++++++++++++ 4 files changed, 196 insertions(+), 56 deletions(-) create mode 100644 utils/test/c/tmq_td32187.c diff --git a/source/client/test/tmqTest.cpp b/source/client/test/tmqTest.cpp index 7505e81884..c7a75e352a 100644 --- a/source/client/test/tmqTest.cpp +++ b/source/client/test/tmqTest.cpp @@ -33,10 +33,9 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -TEST(testCase, tmq_api_Test) { - tmq_conf_t *conf = tmq_conf_new(); - char msg[128] = {0}; - tmq_consumer_new(NULL, msg, -1); +TEST(testCase, driverInit_Test) { + // taosInitGlobalCfg(); + // taos_init(); } TEST(testCase, create_topic_ctb_Test) { diff --git a/tests/system-test/7-tmq/td-32187.py b/tests/system-test/7-tmq/td-32187.py index 73c7a88f65..7f971b23da 100644 --- a/tests/system-test/7-tmq/td-32187.py +++ b/tests/system-test/7-tmq/td-32187.py @@ -1,4 +1,3 @@ - import taos import sys import time @@ -16,65 +15,31 @@ sys.path.append("./7-tmq") from tmqCommon import * class TDTestCase: - clientCfgDict = {'debugFlag': 135} - updatecfgDict = {'debugFlag': 135, 'clientCfg':clientCfgDict} - # updatecfgDict = {'debugFlag': 135, 'clientCfg':clientCfgDict, 'tmqRowSize':1} - + updatecfgDict = {'debugFlag': 135, 'asynclog': 0} def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) tdLog.debug(f"start to excute {__file__}") tdSql.init(conn.cursor()) + #tdSql.init(conn.cursor(), logSql) # output sql.txt file - def consume_test(self): - - tdSql.execute(f'create database if not exists d1') - tdSql.execute(f'use d1') - tdSql.execute(f'create table st(ts timestamp, i int) tags(t int)') - tdSql.execute(f'insert into t1 using st tags(1) values(now, 1) (now+1s, 2)') - tdSql.execute(f'insert into t2 using st tags(2) values(now, 1) (now+1s, 2)') - tdSql.execute(f'insert into t3 using st tags(3) values(now, 1) (now+1s, 2)') - - - tdSql.execute(f'create topic topic_all as select * from st') - consumer_dict = { - "group.id": "g1", - "td.connect.user": "root", - "td.connect.pass": "taosdata", - "auto.offset.reset": "earliest", - } - consumer = Consumer(consumer_dict) - - try: - consumer.unsubscribe() - consumer.unsubscribe() - consumer.subscribe(["topic_all"]) - consumer.subscribe(["topic_all"]) - except TmqError: - tdLog.exit(f"subscribe error") - - cnt = 0 - try: - while True: - res = consumer.poll(2) - if not res: - break - val = res.value() - if val is None: - print(f"null val") - continue - for block in val: - cnt += len(block.fetchall()) - - print(f"block {cnt} rows") - - finally: - consumer.unsubscribe(); - consumer.close() def run(self): - self.consume_test() + tdSql.execute(f'create database if not exists db_32187') + tdSql.execute(f'use db_32187') + tdSql.execute(f'create stable if not exists s5466 (ts timestamp, c1 int, c2 int) tags (t binary(32))') + tdSql.execute(f'insert into t1 using s5466 tags("__devicid__") values(1669092069068, 0, 1)') + tdSql.execute(f'insert into t1(ts, c1, c2) values(1669092069067, 0, 1)') + + tdSql.execute("create topic topic_test with meta as database db_32187") + buildPath = tdCom.getBuildPath() + cmdStr = '%s/build/bin/tmq_td32187'%(buildPath) + tdLog.info(cmdStr) + os.system(cmdStr) + + return def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") tdCases.addLinux(__file__, TDTestCase()) -tdCases.addWindows(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) \ No newline at end of file diff --git a/utils/test/c/CMakeLists.txt b/utils/test/c/CMakeLists.txt index 991a004a74..1bf09c0ee2 100644 --- a/utils/test/c/CMakeLists.txt +++ b/utils/test/c/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable(tmq_sim tmqSim.c) add_executable(create_table createTable.c) add_executable(tmq_taosx_ci tmq_taosx_ci.c) add_executable(tmq_ts5466 tmq_ts5466.c) +add_executable(tmq_td32187 tmq_td32187.c) add_executable(tmq_write_raw_test tmq_write_raw_test.c) add_executable(write_raw_block_test write_raw_block_test.c) add_executable(sml_test sml_test.c) @@ -62,6 +63,13 @@ target_link_libraries( PUBLIC common PUBLIC os ) +target_link_libraries( + tmq_td32187 + PUBLIC taos + PUBLIC util + PUBLIC common + PUBLIC os +) target_link_libraries( tmq_taosx_ci PUBLIC taos diff --git a/utils/test/c/tmq_td32187.c b/utils/test/c/tmq_td32187.c new file mode 100644 index 0000000000..05620b482d --- /dev/null +++ b/utils/test/c/tmq_td32187.c @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include "cJSON.h" +#include "taos.h" +#include "tmsg.h" +#include "types.h" + + +static TAOS_RES* tmqmessage = NULL; +static char* topic = "topic_test"; +static int32_t vgroupId = 0; +static int64_t offset = 0; + +void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) { + printf("commit %d tmq %p param %p\n", code, tmq, param); +} + +tmq_t* build_consumer() { + tmq_conf_t* conf = tmq_conf_new(); + tmq_conf_set(conf, "group.id", "tg2"); + tmq_conf_set(conf, "client.id", "my app 1"); + tmq_conf_set(conf, "td.connect.user", "root"); + tmq_conf_set(conf, "td.connect.pass", "taosdata"); + tmq_conf_set(conf, "msg.with.table.name", "true"); + tmq_conf_set(conf, "enable.auto.commit", "true"); + tmq_conf_set(conf, "auto.offset.reset", "earliest"); + tmq_conf_set(conf, "msg.consume.excluded", "1"); +// tmq_conf_set(conf, "experimental.snapshot.enable", "true"); + + tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); + tmq_t* tmq = tmq_consumer_new(conf, NULL, 0); + assert(tmq); + tmq_conf_destroy(conf); + return tmq; +} + +tmq_list_t* build_topic_list() { + tmq_list_t* topic_list = tmq_list_new(); + tmq_list_append(topic_list, topic); + return topic_list; +} + +static void callFunc(int i, tmq_t* tmq, tmq_list_t* topics) { + printf("call %d\n", i); + switch (i) { + case 0: + tmq_subscribe(tmq, topics); + break; + case 1: + tmq_unsubscribe(tmq); + break; + case 2:{ + tmq_list_t* t = NULL; + tmq_subscription(tmq, &t); + tmq_list_destroy(t); + break; + } + case 3: + tmqmessage = tmq_consumer_poll(tmq, 5000); + break; + case 4: + tmq_consumer_close(tmq); + break; + case 5: + tmq_commit_sync(tmq, NULL); + break; + case 6: + tmq_commit_async(tmq, NULL, NULL, NULL); + break; + case 7: + tmq_commit_offset_sync(tmq, topic, vgroupId, offset); + break; + case 8: + tmq_commit_offset_async(tmq, topic, vgroupId, offset, NULL, NULL); + break; + case 9: + tmq_get_topic_assignment(tmq, topic, NULL, NULL); + break; + case 10: + tmq_free_assignment(NULL); + break; + case 11: + tmq_offset_seek(tmq, topic, vgroupId, offset); + break; + case 12: + tmq_position(tmq, topic, vgroupId); + break; + case 13: + tmq_committed(tmq, topic, vgroupId); + break; + case 14: + tmq_get_connect(tmq); + break; + case 15: + tmq_get_table_name(tmqmessage); + break; + case 16: + vgroupId = tmq_get_vgroup_id(tmqmessage); + break; + case 17: + offset = tmq_get_vgroup_offset(tmqmessage); + break; + case 18: + tmq_get_res_type(tmqmessage); + break; + case 19: + tmq_get_topic_name(tmqmessage); + break; + case 20: + tmq_get_db_name(tmqmessage); + break; + default: + break; + } +} +void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) { + int32_t code; + + if ((code = tmq_subscribe(tmq, topics))) { + fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(code)); + printf("subscribe err\n"); + return; + } + int32_t cnt = 0; + while (1) { + tmqmessage = tmq_consumer_poll(tmq, 5000); + if (tmqmessage) { + printf("poll message\n"); + while(cnt < 1000){ + callFunc(taosRand()%21, tmq, topics); + cnt++; + } + } else { + break; + } + } + + code = tmq_consumer_close(tmq); + if (code) + fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(code)); + else + fprintf(stderr, "%% Consumer closed\n"); +} + +int main(int argc, char* argv[]) { + tmq_t* tmq = build_consumer(); + tmq_list_t* topic_list = build_topic_list(); + basic_consume_loop(tmq, topic_list); + tmq_list_destroy(topic_list); +} \ No newline at end of file From f8337a3263a574708f602bac2b97186af05a76bb Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 11 Oct 2024 14:26:45 +0800 Subject: [PATCH 09/56] enh:[TS-5441] change poll flag to consumer for multi consumers --- tests/parallel_test/cases.task | 1 + utils/test/c/tmq_td32187.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index d5e7de3014..0d5838470f 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -285,6 +285,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts5466.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts-5473.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/td-32187.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts4563.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_replay.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSeekAndCommit.py diff --git a/utils/test/c/tmq_td32187.c b/utils/test/c/tmq_td32187.c index 05620b482d..fb26e248c9 100644 --- a/utils/test/c/tmq_td32187.c +++ b/utils/test/c/tmq_td32187.c @@ -74,10 +74,11 @@ static void callFunc(int i, tmq_t* tmq, tmq_list_t* topics) { break; } case 3: + taos_free_result(tmqmessage); tmqmessage = tmq_consumer_poll(tmq, 5000); break; case 4: - tmq_consumer_close(tmq); +// tmq_consumer_close(tmq); break; case 5: tmq_commit_sync(tmq, NULL); @@ -144,13 +145,20 @@ void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) { tmqmessage = tmq_consumer_poll(tmq, 5000); if (tmqmessage) { printf("poll message\n"); - while(cnt < 1000){ - callFunc(taosRand()%21, tmq, topics); + while(cnt < 100){ + uint32_t i = taosRand()%21; + callFunc(i, tmq, topics); + callFunc(i, tmq, topics); cnt++; } - } else { - break; + while(cnt < 300){ + uint32_t i = taosRand()%21; + callFunc(i, tmq, topics); + cnt++; + } + taos_free_result(tmqmessage); } + break; } code = tmq_consumer_close(tmq); From 0bc5b71d551ab6612ba2fcdea10cf9dcadd28266 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Fri, 11 Oct 2024 19:23:03 +0800 Subject: [PATCH 10/56] merge main.20240929 --- packaging/tools/TDengine.pkgproj | 14 +++++++++++++- packaging/tools/mac_install_summary.txt | 13 +++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packaging/tools/mac_install_summary.txt diff --git a/packaging/tools/TDengine.pkgproj b/packaging/tools/TDengine.pkgproj index 7aaac62735..3171d80d71 100644 --- a/packaging/tools/TDengine.pkgproj +++ b/packaging/tools/TDengine.pkgproj @@ -663,7 +663,19 @@ SUMMARY LOCALIZATIONS - + + + LANGUAGE + English + VALUE + + PATH + /opt/taos/TDengine/packaging/tools/mac_install_summary.txt + PATH_TYPE + 0 + + + TITLE diff --git a/packaging/tools/mac_install_summary.txt b/packaging/tools/mac_install_summary.txt new file mode 100644 index 0000000000..d13f1c280b --- /dev/null +++ b/packaging/tools/mac_install_summary.txt @@ -0,0 +1,13 @@ +TDengine is installed successfully. Please open an Mac terminal and execute the commands below: + +To configure TDengine, sudo vi /etc/taos/taos.cfg +To configure taosadapter, sudo vi /etc/taos/taoadapter.toml +To configure taos-explorer, sudo vi /etc/taos/explorer.toml +To start service, sudo launchctl start com.tdengine.taosd +To start Taos Adapter, sudo launchctl start com.tdengine.taosadapter +To start Taos Explorer, sudo launchctl start com.tdengine.taos-explorer + +To start all the components, sudo start-all.sh +To access TDengine Commnd Line Interface, taos -h YourServerName +To access TDengine Graphic User Interface, http://YourServerName:6060 +To read the user manual, http://YourServerName:6060/docs-en From 59816166ef4126e20b249863953dd173ab3bdbc9 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Sat, 12 Oct 2024 09:07:08 +0800 Subject: [PATCH 11/56] enh: getSystemUUIDLen --- include/os/osSysinfo.h | 3 +- include/util/tuuid.h | 4 +- source/client/src/clientEnv.c | 2 +- source/dnode/mnode/impl/src/mndCluster.c | 2 +- source/libs/scheduler/src/schUtil.c | 11 ++- source/libs/scheduler/src/scheduler.c | 2 +- source/os/src/osSysinfo.c | 37 +++++++---- source/os/test/osSystemTests.cpp | 85 ++++++++++++++++++++++++ source/util/src/tuuid.c | 20 +++--- 9 files changed, 130 insertions(+), 36 deletions(-) diff --git a/include/os/osSysinfo.h b/include/os/osSysinfo.h index fb6acf2a0e..d292b326d5 100644 --- a/include/os/osSysinfo.h +++ b/include/os/osSysinfo.h @@ -52,7 +52,8 @@ int32_t taosGetCardInfoDelta(int64_t *receive_bytes, int64_t *transmit_bytes); void taosSetDefaultCardInfoDelta(int64_t *receive_bytes, int64_t *transmit_bytes); void taosKillSystem(); -int32_t taosGetSystemUUID(char *uid, int32_t uidlen); +int32_t taosGetSystemUUIDLimit36(char *uid, int32_t uidlen); +int32_t taosGetSystemUUIDLen(char *uid, int32_t uidlen); char *taosGetCmdlineByPID(int32_t pid); void taosSetCoreDump(bool enable); diff --git a/include/util/tuuid.h b/include/util/tuuid.h index 9bac855a6c..f7e71b910f 100644 --- a/include/util/tuuid.h +++ b/include/util/tuuid.h @@ -49,5 +49,5 @@ int64_t tGenIdPI64(void); */ int64_t tGenQid64(int8_t dnodeId); -int32_t taosGetSystemUUID32(uint32_t *uuid); -int32_t taosGetSystemUUID64(uint64_t *uuid); +int32_t taosGetSystemUUIDU32(uint32_t *uuid); +int32_t taosGetSystemUUIDU64(uint64_t *uuid); diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index bcfc5b7a5a..694e085007 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -1098,7 +1098,7 @@ uint64_t generateRequestId() { static int32_t requestSerialId = 0; if (hashId == 0) { - int32_t code = taosGetSystemUUID32(&hashId); + int32_t code = taosGetSystemUUIDU32(&hashId); if (code != TSDB_CODE_SUCCESS) { tscError("Failed to get the system uid to generated request id, reason:%s. use ip address instead", tstrerror(code)); diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index 5e38a91ab0..3779bea564 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -241,7 +241,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) { clusterObj.createdTime = taosGetTimestampMs(); clusterObj.updateTime = clusterObj.createdTime; - int32_t code = taosGetSystemUUID(clusterObj.name, TSDB_CLUSTER_ID_LEN); + int32_t code = taosGetSystemUUIDLen(clusterObj.name, TSDB_CLUSTER_ID_LEN); if (code != 0) { (void)strcpy(clusterObj.name, "tdengine3.0"); mError("failed to get name from system, set to default val %s", clusterObj.name); diff --git a/source/libs/scheduler/src/schUtil.c b/source/libs/scheduler/src/schUtil.c index 6cfeab3467..e6945dac89 100644 --- a/source/libs/scheduler/src/schUtil.c +++ b/source/libs/scheduler/src/schUtil.c @@ -297,24 +297,21 @@ uint64_t schGenTaskId(void) { return atomic_add_fetch_64(&schMgmt.taskId, 1); } #ifdef BUILD_NO_CALL uint64_t schGenUUID(void) { - static uint64_t hashId = 0; + static uint32_t hashId = 0; static int32_t requestSerialId = 0; if (hashId == 0) { - char uid[64] = {0}; - int32_t code = taosGetSystemUUID(uid, tListLen(uid) - 1); + int32_t code = taosGetSystemUUID32(&hashId); if (code != TSDB_CODE_SUCCESS) { qError("Failed to get the system uid, reason:%s", tstrerror(TAOS_SYSTEM_ERROR(errno))); - } else { - hashId = MurmurHash3_32(uid, strlen(uid)); } } - +ßßß int64_t ts = taosGetTimestampMs(); uint64_t pid = taosGetPId(); int32_t val = atomic_add_fetch_32(&requestSerialId, 1); - uint64_t id = ((hashId & 0x0FFF) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); + uint64_t id = ((uint64_t)((hashId & 0x0FFF)) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); return id; } #endif diff --git a/source/libs/scheduler/src/scheduler.c b/source/libs/scheduler/src/scheduler.c index f3d9d88c5e..091de5c048 100644 --- a/source/libs/scheduler/src/scheduler.c +++ b/source/libs/scheduler/src/scheduler.c @@ -56,7 +56,7 @@ int32_t schedulerInit() { SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } - if (taosGetSystemUUID64(&schMgmt.sId)) { + if (taosGetSystemUUIDU64(&schMgmt.sId)) { qError("generate schedulerId failed, errno:%d", errno); SCH_ERR_RET(TSDB_CODE_QRY_SYS_ERROR); } diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 905f3d008b..bd1a058291 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -1035,19 +1035,17 @@ void taosKillSystem() { #endif } -int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { +#define UUIDLEN (36) +int32_t taosGetSystemUUIDLimit36(char *uid, int32_t uidlen) { #ifdef WINDOWS GUID guid; HRESULT h = CoCreateGuid(&guid); if (h != S_OK) { return TAOS_SYSTEM_WINAPI_ERROR(GetLastError()); } - int n = snprintf(uid, uidlen, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid.Data1, guid.Data2, guid.Data3, + (void)snprintf(uid, uidlen, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - if(n >= uidlen) { - return TSDB_CODE_OUT_OF_BUFFER;; - } return 0; #elif defined(_TD_DARWIN_64) @@ -1057,10 +1055,7 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { uuid_generate(uuid); // it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null uuid_unparse_lower(uuid, buf); - int n = snprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); // though less performance, much safer - if(n >= uidlen) { - return TSDB_CODE_OUT_OF_BUFFER;; - } + (void)snprintf(uid, uidlen, "%.*s", (int)sizeof(buf), buf); return 0; #else int64_t len = 0; @@ -1076,16 +1071,32 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { return terrno; } } - - if (len >= 36) { - uid[36] = 0; - return 0; + if (len >= UUIDLEN + 1) { + uid[len - 1] = 0; + } else { + uid[uidlen - 1] = 0; } return 0; #endif } +int32_t taosGetSystemUUIDLen(char *uid, int32_t uidlen) { + if (uid == NULL || uidlen <= 0) { + return TSDB_CODE_APP_ERROR; + } + int num = (uidlen % UUIDLEN == 0) ? (uidlen / UUIDLEN) : (uidlen / UUIDLEN + 1); + int left = uidlen; + for (int i = 0; i < num; ++i) { + int32_t code = taosGetSystemUUIDLimit36(uid + i * UUIDLEN, left); + if (code != 0) { + return code; + } + left -= UUIDLEN; + } + return TSDB_CODE_SUCCESS; +} + char *taosGetCmdlineByPID(int pid) { #ifdef WINDOWS return ""; diff --git a/source/os/test/osSystemTests.cpp b/source/os/test/osSystemTests.cpp index 3712e45451..bc122aafa0 100644 --- a/source/os/test/osSystemTests.cpp +++ b/source/os/test/osSystemTests.cpp @@ -60,3 +60,88 @@ TEST(osSystemTest, osSystem1) { (void)printf("cpu info: %s\n", tmp); ASSERT_EQ(res, 0); } + + +TEST(osSystemTest, systemUUIDTest) { + char uuid1[38]; + memset(uuid1, 0, sizeof(uuid1)); + taosGetSystemUUIDLimit36(uuid1, sizeof(uuid1)); + ASSERT_EQ(strlen(uuid1), 36); + + char uuid2[34]; + memset(uuid2, 0, sizeof(uuid2)); + taosGetSystemUUIDLimit36(uuid2, sizeof(uuid2)); + ASSERT_EQ(strlen(uuid2), 33); + + char uuid3[36]; + memset(uuid3, 0, sizeof(uuid3)); + taosGetSystemUUIDLimit36(uuid3, sizeof(uuid3)); + ASSERT_EQ(strlen(uuid3), 35); + + char uuid4[2]; + memset(uuid4, 0, sizeof(uuid4)); + taosGetSystemUUIDLimit36(uuid4, sizeof(uuid4)); + ASSERT_EQ(strlen(uuid4), 1); + + char uuid5[36]; + memset( uuid5, 0, sizeof(uuid5)); + taosGetSystemUUIDLimit36(uuid5, sizeof(uuid5)); + ASSERT_EQ(strlen(uuid5), 35); + + char uuid6[37]; + memset( uuid6, 0, sizeof(uuid6)); + taosGetSystemUUIDLimit36(uuid6, sizeof(uuid6)); + ASSERT_EQ(strlen(uuid6), 36); + + char uuid7[1]; + memset(uuid7, 0, sizeof(uuid7)); + taosGetSystemUUIDLimit36(uuid7, sizeof(uuid7)); + ASSERT_EQ(strlen(uuid7), 0); +} + +TEST(osSystemTest, systemUUIDTest2) { + char uuid1[38]; + memset(uuid1, 0, sizeof(uuid1)); + taosGetSystemUUIDLen(uuid1, sizeof(uuid1)); + ASSERT_EQ(strlen(uuid1), sizeof(uuid1) - 1); + + char uuid2[34]; + memset(uuid2, 0, sizeof(uuid2)); + taosGetSystemUUIDLen(uuid2, sizeof(uuid2)); + ASSERT_EQ(strlen(uuid2), sizeof(uuid2) - 1); + + char uuid3[36]; + memset(uuid3, 0, sizeof(uuid3)); + taosGetSystemUUIDLen(uuid3, sizeof(uuid3)); + ASSERT_EQ(strlen(uuid3), sizeof(uuid3) - 1); + + char uuid4[2]; + memset(uuid4, 0, sizeof(uuid4)); + taosGetSystemUUIDLen(uuid4, sizeof(uuid4)); + ASSERT_EQ(strlen(uuid4), sizeof(uuid4) - 1); + + char uuid5[36]; + memset( uuid5, 0, sizeof(uuid5)); + taosGetSystemUUIDLen(uuid5, sizeof(uuid5)); + ASSERT_EQ(strlen(uuid5), sizeof(uuid5) - 1); + + char uuid6[37]; + memset( uuid6, 0, sizeof(uuid6)); + taosGetSystemUUIDLen(uuid6, sizeof(uuid6)); + ASSERT_EQ(strlen(uuid6), sizeof(uuid6) - 1); + + char uuid7[1]; + memset(uuid7, 0, sizeof(uuid7)); + taosGetSystemUUIDLen(uuid7, sizeof(uuid7)); + ASSERT_EQ(strlen(uuid7), sizeof(uuid7) - 1); + + char uuid8[40]; + memset(uuid8, 0, sizeof(uuid8)); + taosGetSystemUUIDLen(uuid8, sizeof(uuid8)); + ASSERT_EQ(strlen(uuid8), sizeof(uuid8) - 1); + + char uuid9[73]; + memset(uuid9, 0, sizeof(uuid9)); + taosGetSystemUUIDLen(uuid9, sizeof(uuid9)); + ASSERT_EQ(strlen(uuid9), sizeof(uuid9) - 1); +} diff --git a/source/util/src/tuuid.c b/source/util/src/tuuid.c index 53ef5c493d..4d50d93e74 100644 --- a/source/util/src/tuuid.c +++ b/source/util/src/tuuid.c @@ -18,11 +18,11 @@ static uint32_t tUUIDHashId = 0; static int32_t tUUIDSerialNo = 0; -int32_t taosGetSystemUUID32(uint32_t *uuid) { +int32_t taosGetSystemUUIDU32(uint32_t *uuid) { if (uuid == NULL) return TSDB_CODE_APP_ERROR; - char uid[65] = {0}; - int32_t code = taosGetSystemUUID(uid, sizeof(uid)); - uid[64] = 0; + char uid[37] = {0}; + int32_t code = taosGetSystemUUIDLimit36(uid, sizeof(uid)); + uid[36] = 0; if (code != TSDB_CODE_SUCCESS) { return code; @@ -32,11 +32,11 @@ int32_t taosGetSystemUUID32(uint32_t *uuid) { return TSDB_CODE_SUCCESS; } -int32_t taosGetSystemUUID64(uint64_t *uuid) { +int32_t taosGetSystemUUIDU64(uint64_t *uuid) { if (uuid == NULL) return TSDB_CODE_APP_ERROR; - char uid[65] = {0}; - int32_t code = taosGetSystemUUID(uid, sizeof(uid)); - uid[64] = 0; + char uid[37] = {0}; + int32_t code = taosGetSystemUUIDLimit36(uid, sizeof(uid)); + uid[36] = 0; if (code != TSDB_CODE_SUCCESS) { return code; @@ -48,7 +48,7 @@ int32_t taosGetSystemUUID64(uint64_t *uuid) { int32_t tGenIdPI32(void) { if (tUUIDHashId == 0) { - int32_t code = taosGetSystemUUID32(&tUUIDHashId); + int32_t code = taosGetSystemUUIDU32(&tUUIDHashId); if (code != TSDB_CODE_SUCCESS) { terrno = code; } @@ -64,7 +64,7 @@ int32_t tGenIdPI32(void) { int64_t tGenIdPI64(void) { if (tUUIDHashId == 0) { - int32_t code = taosGetSystemUUID32(&tUUIDHashId); + int32_t code = taosGetSystemUUIDU32(&tUUIDHashId); if (code != TSDB_CODE_SUCCESS) { terrno = code; } From 41f2653f0a4cf679d121e1a10cbbd18b4162205f Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Fri, 11 Oct 2024 18:54:22 +0800 Subject: [PATCH 12/56] fix: (last) add lock for writebatch --- source/dnode/vnode/src/inc/tsdb.h | 1 + source/dnode/vnode/src/tsdb/tsdbCache.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 30efee42e5..ed8f99ec75 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -342,6 +342,7 @@ typedef struct { rocksdb_writeoptions_t *writeoptions; rocksdb_readoptions_t *readoptions; rocksdb_writebatch_t *writebatch; + TdThreadMutex writeBatchMutex; STSchema *pTSchema; } SRocksCache; diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 00b7f38b8f..89a51eb0f5 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -221,6 +221,8 @@ static int32_t tsdbOpenRocksCache(STsdb *pTsdb) { rocksdb_writebatch_t *writebatch = rocksdb_writebatch_create(); + TAOS_CHECK_GOTO(taosThreadMutexInit(&pTsdb->rCache.writeBatchMutex, NULL), &lino, _err6) ; + pTsdb->rCache.writebatch = writebatch; pTsdb->rCache.my_comparator = cmp; pTsdb->rCache.options = options; @@ -232,6 +234,8 @@ static int32_t tsdbOpenRocksCache(STsdb *pTsdb) { TAOS_RETURN(code); +_err6: + rocksdb_writebatch_destroy(writebatch); _err5: rocksdb_close(pTsdb->rCache.db); _err4: @@ -250,6 +254,7 @@ _err: static void tsdbCloseRocksCache(STsdb *pTsdb) { rocksdb_close(pTsdb->rCache.db); + (void)taosThreadMutexDestroy(&pTsdb->rCache.writeBatchMutex); rocksdb_flushoptions_destroy(pTsdb->rCache.flushoptions); rocksdb_writebatch_destroy(pTsdb->rCache.writebatch); rocksdb_readoptions_destroy(pTsdb->rCache.readoptions); @@ -1077,7 +1082,9 @@ static int32_t tsdbCachePutToRocksdb(STsdb *pTsdb, SLastKey *pLastKey, SLastCol } rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; + (void)taosThreadMutexLock(&pTsdb->rCache.writeBatchMutex); rocksdb_writebatch_put(wb, (char *)pLastKey, ROCKS_KEY_LEN, rocks_value, vlen); + (void)taosThreadMutexUnlock(&pTsdb->rCache.writeBatchMutex); taosMemoryFree(rocks_value); From bcfd74e697a3972acd1d001e482d9def2a01ee74 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Sat, 12 Oct 2024 10:13:53 +0800 Subject: [PATCH 13/56] stmt2/interlace: separate interlace batch adding into exec2 --- source/client/src/clientStmt2.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index 841171bacf..37f5a8c786 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1200,22 +1200,6 @@ static int stmtAddBatch2(TAOS_STMT2* stmt) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_ADD_BATCH)); - if (pStmt->sql.stbInterlaceMode) { - int64_t startUs2 = taosGetTimestampUs(); - pStmt->stat.addBatchUs += startUs2 - startUs; - - pStmt->sql.siInfo.tableColsReady = false; - - SStmtQNode* param = NULL; - STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m)); - param->restoreTbCols = true; - param->next = NULL; - - stmtEnqueue(pStmt, param); - - return TSDB_CODE_SUCCESS; - } - STMT_ERR_RET(stmtCacheBlock(pStmt)); return TSDB_CODE_SUCCESS; @@ -1627,6 +1611,22 @@ int stmtExec2(TAOS_STMT2* stmt, int* affected_rows) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE)); + if (pStmt->sql.stbInterlaceMode) { + int64_t startUs2 = taosGetTimestampUs(); + pStmt->stat.addBatchUs += startUs2 - startUs; + + pStmt->sql.siInfo.tableColsReady = false; + + SStmtQNode* param = NULL; + STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m)); + param->restoreTbCols = true; + param->next = NULL; + + stmtEnqueue(pStmt, param); + + return TSDB_CODE_SUCCESS; + } + if (STMT_TYPE_QUERY != pStmt->sql.type) { if (pStmt->sql.stbInterlaceMode) { int64_t startTs = taosGetTimestampUs(); From 192b05b833cc1f30d3115b4b0805a2cfe66e5f5a Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Sat, 12 Oct 2024 10:52:52 +0800 Subject: [PATCH 14/56] docs: add intro for create tb by csv --- docs/zh/14-reference/03-taos-sql/03-table.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/zh/14-reference/03-taos-sql/03-table.md b/docs/zh/14-reference/03-taos-sql/03-table.md index 2f0ae7100a..cad9190bd9 100644 --- a/docs/zh/14-reference/03-taos-sql/03-table.md +++ b/docs/zh/14-reference/03-taos-sql/03-table.md @@ -79,6 +79,18 @@ CREATE TABLE [IF NOT EXISTS] tb_name1 USING stb_name TAGS (tag_value1, ...) [IF 批量建表方式要求数据表必须以超级表为模板。 在不超出 SQL 语句长度限制的前提下,单条语句中的建表数量建议控制在 1000 ~ 3000 之间,将会获得比较理想的建表速度。 +### 使用 CSV 批量创建子表 + +```sql +CREATE TABLE [IF NOT EXISTS] USING [db_name.]stb_name (field1_name [, field2_name] ....) FILE csv_file_path; +``` + +**参数说明** + +1. FILE 语法表示数据来自于 CSV 文件(英文逗号分隔、英文单引号括住每个值),CSV 文件无需表头。CSV 文件中应仅包含 table name 与 tag 值。如需插入数据,请参考数据写入章节。 +2. 为指定的 stb_name 创建子表,该超级表必须已经存在。 +3. field_name 列表顺序与 CSV 文件各列内容顺序一致。列表中不允许出现重复项,且必须包含 `tbname`,可包含零个或多个超级表中已定义的标签列。未包含在列表中的标签值将被设置为 NULL。 + ## 修改普通表 ```sql From ebe1cf61a832acc66cfe2de61d3919f7b684eaf2 Mon Sep 17 00:00:00 2001 From: Jing Sima Date: Sat, 12 Oct 2024 14:07:07 +0800 Subject: [PATCH 15/56] fix:[TD-32184] fix heap buffer overflow in round and trunc. --- source/libs/scalar/src/sclfunc.c | 156 ++++++++++++++++++++++++++----- 1 file changed, 132 insertions(+), 24 deletions(-) diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 71e29a7aa1..9ae89436f2 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -3006,20 +3006,56 @@ static int32_t doScalarFunction2(SScalarParam *pInput, int32_t inputNum, SScalar } break; } - case TSDB_DATA_TYPE_TINYINT: - case TSDB_DATA_TYPE_SMALLINT: - case TSDB_DATA_TYPE_INT: - case TSDB_DATA_TYPE_BIGINT:{ + case TSDB_DATA_TYPE_TINYINT: { + int8_t *in = (int8_t *)pInputData[0]->pData; + int8_t *out = (int8_t *)pOutputData->pData; + int8_t result = (int8_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_SMALLINT: { + int16_t *in = (int16_t *)pInputData[0]->pData; + int16_t *out = (int16_t *)pOutputData->pData; + int16_t result = (int16_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_INT: { + int32_t *in = (int32_t *)pInputData[0]->pData; + int32_t *out = (int32_t *)pOutputData->pData; + int32_t result = (int32_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_BIGINT: { int64_t *in = (int64_t *)pInputData[0]->pData; int64_t *out = (int64_t *)pOutputData->pData; int64_t result = (int64_t)d1((double)in[i], in2); out[i] = result; break; } - case TSDB_DATA_TYPE_UTINYINT: - case TSDB_DATA_TYPE_USMALLINT: - case TSDB_DATA_TYPE_UINT: - case TSDB_DATA_TYPE_UBIGINT:{ + case TSDB_DATA_TYPE_UTINYINT: { + uint8_t *in = (uint8_t *)pInputData[0]->pData; + uint8_t *out = (uint8_t *)pOutputData->pData; + uint8_t result = (uint8_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_USMALLINT: { + uint16_t *in = (uint16_t *)pInputData[0]->pData; + uint16_t *out = (uint16_t *)pOutputData->pData; + uint16_t result = (uint16_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UINT: { + uint32_t *in = (uint32_t *)pInputData[0]->pData; + uint32_t *out = (uint32_t *)pOutputData->pData; + uint32_t result = (uint32_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UBIGINT: { uint64_t *in = (uint64_t *)pInputData[0]->pData; uint64_t *out = (uint64_t *)pOutputData->pData; uint64_t result = (uint64_t)d1((double)in[i], in2); @@ -3062,20 +3098,56 @@ static int32_t doScalarFunction2(SScalarParam *pInput, int32_t inputNum, SScalar } break; } - case TSDB_DATA_TYPE_TINYINT: - case TSDB_DATA_TYPE_SMALLINT: - case TSDB_DATA_TYPE_INT: - case TSDB_DATA_TYPE_BIGINT:{ + case TSDB_DATA_TYPE_TINYINT: { + int8_t *in = (int8_t *)pInputData[0]->pData; + int8_t *out = (int8_t *)pOutputData->pData; + int8_t result = (int8_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_SMALLINT: { + int16_t *in = (int16_t *)pInputData[0]->pData; + int16_t *out = (int16_t *)pOutputData->pData; + int16_t result = (int16_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_INT: { + int32_t *in = (int32_t *)pInputData[0]->pData; + int32_t *out = (int32_t *)pOutputData->pData; + int32_t result = (int32_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_BIGINT: { int64_t *in = (int64_t *)pInputData[0]->pData; int64_t *out = (int64_t *)pOutputData->pData; int64_t result = (int64_t)d1((double)in[0], in2); out[i] = result; break; } - case TSDB_DATA_TYPE_UTINYINT: - case TSDB_DATA_TYPE_USMALLINT: - case TSDB_DATA_TYPE_UINT: - case TSDB_DATA_TYPE_UBIGINT:{ + case TSDB_DATA_TYPE_UTINYINT: { + uint8_t *in = (uint8_t *)pInputData[0]->pData; + uint8_t *out = (uint8_t *)pOutputData->pData; + uint8_t result = (uint8_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_USMALLINT: { + uint16_t *in = (uint16_t *)pInputData[0]->pData; + uint16_t *out = (uint16_t *)pOutputData->pData; + uint16_t result = (uint16_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UINT: { + uint32_t *in = (uint32_t *)pInputData[0]->pData; + uint32_t *out = (uint32_t *)pOutputData->pData; + uint32_t result = (uint32_t)d1((double)in[0], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UBIGINT: { uint64_t *in = (uint64_t *)pInputData[0]->pData; uint64_t *out = (uint64_t *)pOutputData->pData; uint64_t result = (uint64_t)d1((double)in[0], in2); @@ -3119,20 +3191,56 @@ static int32_t doScalarFunction2(SScalarParam *pInput, int32_t inputNum, SScalar } break; } - case TSDB_DATA_TYPE_TINYINT: - case TSDB_DATA_TYPE_SMALLINT: - case TSDB_DATA_TYPE_INT: - case TSDB_DATA_TYPE_BIGINT:{ + case TSDB_DATA_TYPE_TINYINT: { + int8_t *in = (int8_t *)pInputData[0]->pData; + int8_t *out = (int8_t *)pOutputData->pData; + int8_t result = (int8_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_SMALLINT: { + int16_t *in = (int16_t *)pInputData[0]->pData; + int16_t *out = (int16_t *)pOutputData->pData; + int16_t result = (int16_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_INT: { + int32_t *in = (int32_t *)pInputData[0]->pData; + int32_t *out = (int32_t *)pOutputData->pData; + int32_t result = (int32_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_BIGINT: { int64_t *in = (int64_t *)pInputData[0]->pData; int64_t *out = (int64_t *)pOutputData->pData; int64_t result = (int64_t)d1((double)in[i], in2); out[i] = result; break; } - case TSDB_DATA_TYPE_UTINYINT: - case TSDB_DATA_TYPE_USMALLINT: - case TSDB_DATA_TYPE_UINT: - case TSDB_DATA_TYPE_UBIGINT:{ + case TSDB_DATA_TYPE_UTINYINT: { + uint8_t *in = (uint8_t *)pInputData[0]->pData; + uint8_t *out = (uint8_t *)pOutputData->pData; + uint8_t result = (uint8_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_USMALLINT: { + uint16_t *in = (uint16_t *)pInputData[0]->pData; + uint16_t *out = (uint16_t *)pOutputData->pData; + uint16_t result = (uint16_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UINT: { + uint32_t *in = (uint32_t *)pInputData[0]->pData; + uint32_t *out = (uint32_t *)pOutputData->pData; + uint32_t result = (uint32_t)d1((double)in[i], in2); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UBIGINT: { uint64_t *in = (uint64_t *)pInputData[0]->pData; uint64_t *out = (uint64_t *)pOutputData->pData; uint64_t result = (uint64_t)d1((double)in[i], in2); From 6231d46cc557db0bfdf23b2c14ddd1fb51d47a17 Mon Sep 17 00:00:00 2001 From: Jing Sima Date: Thu, 26 Sep 2024 18:42:13 +0800 Subject: [PATCH 16/56] enh:[TD-32189] Add validation to prevent changes to resultinfo structure. --- include/common/tcommon.h | 26 -- include/common/tvariant.h | 1 + include/libs/function/function.h | 10 +- include/libs/function/functionResInfo.h | 90 +++++ include/util/tdigest.h | 27 +- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 1 + source/libs/function/inc/builtinsimpl.h | 24 +- source/libs/function/inc/functionResInfoInt.h | 366 ++++++++++++++++++ source/libs/function/inc/thistogram.h | 49 +-- source/libs/function/inc/tpercentile.h | 51 +-- source/libs/function/src/builtinsimpl.c | 250 +----------- .../libs/function/src/detail/tavgfunction.c | 7 - tests/army/query/function/test_resinfo.py | 69 ++++ tests/parallel_test/cases.task | 1 + 14 files changed, 558 insertions(+), 414 deletions(-) create mode 100644 include/libs/function/functionResInfo.h create mode 100644 source/libs/function/inc/functionResInfoInt.h create mode 100644 tests/army/query/function/test_resinfo.py diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 753f84d774..3910ea6745 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -89,32 +89,6 @@ typedef struct { int32_t exprIdx; } STupleKey; -typedef struct STuplePos { - union { - struct { - int32_t pageId; - int32_t offset; - }; - SWinKey streamTupleKey; - }; -} STuplePos; - -typedef struct SFirstLastRes { - bool hasResult; - // used for last_row function only, isNullRes in SResultRowEntry can not be passed to downstream.So, - // this attribute is required - bool isNull; - int32_t bytes; - int64_t ts; - char* pkData; - int32_t pkBytes; - int8_t pkType; - STuplePos pos; - STuplePos nullTuplePos; - bool nullTupleSaved; - char buf[]; -} SFirstLastRes; - static inline int STupleKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2) { STupleKey* pTuple1 = (STupleKey*)pKey1; STupleKey* pTuple2 = (STupleKey*)pKey2; diff --git a/include/common/tvariant.h b/include/common/tvariant.h index 0d84b2414e..5ab42ae8b7 100644 --- a/include/common/tvariant.h +++ b/include/common/tvariant.h @@ -23,6 +23,7 @@ extern "C" { #endif // variant, each number/string/field_id has a corresponding struct during parsing sql +// **NOTE**: if you want to change this struct, please consider the backward compatibility of function top and bottom. typedef struct SVariant { uint32_t nType; int32_t nLen; // only used for string, for number, it is useless diff --git a/include/libs/function/function.h b/include/libs/function/function.h index ec01cf1f6f..7ca046762a 100644 --- a/include/libs/function/function.h +++ b/include/libs/function/function.h @@ -23,6 +23,7 @@ extern "C" { #include "tcommon.h" #include "tsimplehash.h" #include "tvariant.h" +#include "functionResInfo.h" struct SqlFunctionCtx; struct SResultRowEntryInfo; @@ -85,14 +86,7 @@ enum { PRE_SCAN = 0x2u, // pre-scan belongs to the main scan and occurs before main scan }; -typedef struct SPoint1 { - int64_t key; - union { - double val; - char *ptr; - }; -} SPoint1; - +struct SPoint1; struct SqlFunctionCtx; struct SResultRowEntryInfo; diff --git a/include/libs/function/functionResInfo.h b/include/libs/function/functionResInfo.h new file mode 100644 index 0000000000..d79caf3f8c --- /dev/null +++ b/include/libs/function/functionResInfo.h @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2019 TAOS Data, Inc. +* +* This program is free software: you can use, redistribute, and/or modify +* it under the terms of the GNU Affero General Public License, version 3 +* or later ("AGPL"), as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . + */ + +#ifndef TDENGINE_FUNCTIONRESINFO_H +#define TDENGINE_FUNCTIONRESINFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "os.h" +#include "tcommon.h" + +typedef struct STuplePos { + union { + struct { + int32_t pageId; + int32_t offset; + }; + SWinKey streamTupleKey; + }; +} STuplePos; + +typedef struct SCentroid { + double mean; + int64_t weight; +} SCentroid; + +typedef struct SPt { + double value; + int64_t weight; +} SPt; + +typedef struct TDigest { + double compression; + int32_t threshold; + int64_t size; + + int64_t total_weight; + double min; + double max; + + int32_t num_buffered_pts; + SPt *buffered_pts; + + int32_t num_centroids; + SCentroid *centroids; +} TDigest; + +typedef struct SFirstLastRes { + bool hasResult; + // used for last_row function only, isNullRes in SResultRowEntry can not be passed to downstream.So, + // this attribute is required + bool isNull; + int32_t bytes; + int64_t ts; + char* pkData; + int32_t pkBytes; + int8_t pkType; + STuplePos pos; + STuplePos nullTuplePos; + bool nullTupleSaved; + char buf[]; +} SFirstLastRes; + +typedef struct SPoint1 { + int64_t key; + union { + double val; + char *ptr; + }; +} SPoint1; + +#ifdef __cplusplus +} +#endif + +#endif // TDENGINE_FUNCTIONRESINFO_H diff --git a/include/util/tdigest.h b/include/util/tdigest.h index 03519b4c7b..d807a7f0cf 100644 --- a/include/util/tdigest.h +++ b/include/util/tdigest.h @@ -23,6 +23,7 @@ #define TDIGEST_H #include "os.h" +#include "libs/function/functionResInfo.h" #ifndef M_PI #define M_PI 3.14159265358979323846264338327950288 /* pi */ @@ -37,32 +38,6 @@ #define TDIGEST_SIZE(compression) \ (sizeof(TDigest) + sizeof(SCentroid) * GET_CENTROID(compression) + sizeof(SPt) * GET_THRESHOLD(compression)) -typedef struct SCentroid { - double mean; - int64_t weight; -} SCentroid; - -typedef struct SPt { - double value; - int64_t weight; -} SPt; - -typedef struct TDigest { - double compression; - int32_t threshold; - int64_t size; - - int64_t total_weight; - double min; - double max; - - int32_t num_buffered_pts; - SPt *buffered_pts; - - int32_t num_centroids; - SCentroid *centroids; -} TDigest; - TDigest *tdigestNewFrom(void *pBuf, int32_t compression); int32_t tdigestAdd(TDigest *t, double x, int64_t w); int32_t tdigestMerge(TDigest *t1, TDigest *t2); diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 9e37e785f8..d508d75922 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -14,6 +14,7 @@ */ #include "functionMgt.h" +#include "functionResInfo.h" #include "taoserror.h" #include "tarray.h" #include "tcommon.h" diff --git a/source/libs/function/inc/builtinsimpl.h b/source/libs/function/inc/builtinsimpl.h index 77905792b8..36e53d0a80 100644 --- a/source/libs/function/inc/builtinsimpl.h +++ b/source/libs/function/inc/builtinsimpl.h @@ -22,29 +22,7 @@ extern "C" { #include "function.h" #include "functionMgt.h" - -typedef struct SSumRes { - union { - int64_t isum; - uint64_t usum; - double dsum; - }; - int16_t type; - int64_t prevTs; - bool isPrevTsSet; - bool overflow; // if overflow is true, dsum to be used for any type; -} SSumRes; - -typedef struct SMinmaxResInfo { - bool assign; // assign the first value or not - int64_t v; - char *str; - STuplePos tuplePos; - - STuplePos nullTuplePos; - bool nullTupleSaved; - int16_t type; -} SMinmaxResInfo; +#include "functionResInfoInt.h" int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems); diff --git a/source/libs/function/inc/functionResInfoInt.h b/source/libs/function/inc/functionResInfoInt.h new file mode 100644 index 0000000000..9ee1e884b3 --- /dev/null +++ b/source/libs/function/inc/functionResInfoInt.h @@ -0,0 +1,366 @@ +/* +* Copyright (c) 2019 TAOS Data, Inc. +* +* This program is free software: you can use, redistribute, and/or modify +* it under the terms of the GNU Affero General Public License, version 3 +* or later ("AGPL"), as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . +*/ + +#ifndef TDENGINE_FUNCTIONRESINFOINT_H +#define TDENGINE_FUNCTIONRESINFOINT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "os.h" +#include "thistogram.h" +#include "tdigest.h" +#include "functionResInfo.h" +#include "tpercentile.h" + +#define USE_ARRAYLIST + +#define HLL_BUCKET_BITS 14 // The bits of the bucket +#define HLL_DATA_BITS (64 - HLL_BUCKET_BITS) +#define HLL_BUCKETS (1 << HLL_BUCKET_BITS) +#define HLL_BUCKET_MASK (HLL_BUCKETS - 1) +#define HLL_ALPHA_INF 0.721347520444481703680 // constant for 0.5/ln(2) + +typedef struct SSumRes { + union { + int64_t isum; + uint64_t usum; + double dsum; + }; + int16_t type; + int64_t prevTs; + bool isPrevTsSet; + bool overflow; // if overflow is true, dsum to be used for any type; +} SSumRes; + +typedef struct SMinmaxResInfo { + bool assign; // assign the first value or not + int64_t v; + char *str; + STuplePos tuplePos; + + STuplePos nullTuplePos; + bool nullTupleSaved; + int16_t type; +} SMinmaxResInfo; + +typedef struct SStdRes { + double result; + int64_t count; + union { + double quadraticDSum; + int64_t quadraticISum; + uint64_t quadraticUSum; + }; + union { + double dsum; + int64_t isum; + uint64_t usum; + }; + int16_t type; +} SStdRes; + +typedef struct SHistBin { + double val; + int64_t num; + +#if !defined(USE_ARRAYLIST) + double delta; + int32_t index; // index in min-heap list +#endif +} SHistBin; + +typedef struct SHistogramInfo { + int64_t numOfElems; + int32_t numOfEntries; + int32_t maxEntries; + double min; + double max; +#if defined(USE_ARRAYLIST) + SHistBin* elems; +#else + tSkipList* pList; + SMultiwayMergeTreeInfo* pLoserTree; + int32_t maxIndex; + bool ordered; +#endif +} SHistogramInfo; + +typedef struct SAPercentileInfo { + double result; + double percent; + int8_t algo; + SHistogramInfo* pHisto; + TDigest* pTDigest; +} SAPercentileInfo; + +typedef struct SSpreadInfo { + double result; + bool hasResult; + double min; + double max; +} SSpreadInfo; + +typedef struct SHLLFuncInfo { + uint64_t result; + uint64_t totalCount; + uint8_t buckets[HLL_BUCKETS]; +} SHLLInfo; + +typedef struct SGroupKeyInfo { + bool hasResult; + bool isNull; + char data[]; +} SGroupKeyInfo; + +typedef struct SAvgRes { + double result; + SSumRes sum; + int64_t count; + int16_t type; // store the original input type, used in merge function +} SAvgRes; + + +// structs above are used in stream + +#define HISTOGRAM_MAX_BINS_NUM 1000 +#define MAVG_MAX_POINTS_NUM 1000 +#define TAIL_MAX_POINTS_NUM 100 +#define TAIL_MAX_OFFSET 100 + +typedef struct STopBotResItem { + SVariant v; + uint64_t uid; // it is a table uid, used to extract tag data during building of the final result for the tag data + STuplePos tuplePos; // tuple data of this chosen row +} STopBotResItem; + +typedef struct STopBotRes { + int32_t maxSize; + int16_t type; + + STuplePos nullTuplePos; + bool nullTupleSaved; + + STopBotResItem* pItems; +} STopBotRes; + +typedef struct SLeastSQRInfo { + double matrix[2][3]; + double startVal; + double stepVal; + int64_t num; +} SLeastSQRInfo; + +typedef struct MinMaxEntry { + union { + double dMinVal; + // double i64MinVal; + uint64_t u64MinVal; + }; + union { + double dMaxVal; + // double i64MaxVal; + int64_t u64MaxVal; + }; +} MinMaxEntry; + +typedef struct { + int32_t size; + int32_t pageId; + SFilePage *data; +} SSlotInfo; + +typedef struct tMemBucketSlot { + SSlotInfo info; + MinMaxEntry range; +} tMemBucketSlot; + +struct tMemBucket; +typedef int32_t (*__perc_hash_func_t)(struct tMemBucket *pBucket, const void *value, int32_t *index); + +typedef struct tMemBucket { + int16_t numOfSlots; + int16_t type; + int32_t bytes; + int32_t total; + int32_t elemPerPage; // number of elements for each object + int32_t maxCapacity; // maximum allowed number of elements that can be sort directly to get the result + int32_t bufPageSize; // disk page size + MinMaxEntry range; // value range + int32_t times; // count that has been checked for deciding the correct data value buckets. + __compar_fn_t comparFn; + tMemBucketSlot *pSlots; + SDiskbasedBuf *pBuffer; + __perc_hash_func_t hashFunc; + SHashObj *groupPagesMap; // disk page map for different groups; +} tMemBucket; + +typedef struct SPercentileInfo { + double result; + tMemBucket* pMemBucket; + int32_t stage; + double minval; + double maxval; + int64_t numOfElems; +} SPercentileInfo; + +typedef struct SDiffInfo { + bool hasPrev; + bool isFirstRow; + int8_t ignoreOption; // replace the ignore with case when + union { + int64_t i64; + double d64; + } prev; + + int64_t prevTs; +} SDiffInfo; + +typedef struct SElapsedInfo { + double result; + TSKEY min; + TSKEY max; + int64_t timeUnit; +} SElapsedInfo; + +typedef struct STwaInfo { + double dOutput; + int64_t numOfElems; + SPoint1 p; + STimeWindow win; +} STwaInfo; + +typedef struct SHistoFuncBin { + double lower; + double upper; + int64_t count; + double percentage; +} SHistoFuncBin; + +typedef struct SHistoFuncInfo { + int32_t numOfBins; + int32_t totalCount; + bool normalized; + SHistoFuncBin bins[]; +} SHistoFuncInfo; + +typedef struct SStateInfo { + union { + int64_t count; + int64_t durationStart; + }; + int64_t prevTs; + bool isPrevTsSet; +} SStateInfo; + +typedef struct SMavgInfo { + int32_t pos; + double sum; + int64_t prevTs; + bool isPrevTsSet; + int32_t numOfPoints; + bool pointsMeet; + double points[]; +} SMavgInfo; + +typedef struct SSampleInfo { + int32_t samples; + int32_t totalPoints; + int32_t numSampled; + uint8_t colType; + uint16_t colBytes; + + STuplePos nullTuplePos; + bool nullTupleSaved; + + char* data; + STuplePos* tuplePos; +} SSampleInfo; + +typedef struct STailItem { + int64_t timestamp; + bool isNull; + char data[]; +} STailItem; + +typedef struct STailInfo { + int32_t numOfPoints; + int32_t numAdded; + int32_t offset; + uint8_t colType; + uint16_t colBytes; + STailItem** pItems; +} STailInfo; + +typedef struct SUniqueItem { + int64_t timestamp; + bool isNull; + char data[]; +} SUniqueItem; + +typedef struct SUniqueInfo { + int32_t numOfPoints; + uint8_t colType; + uint16_t colBytes; + bool hasNull; // null is not hashable, handle separately + SHashObj* pHash; + char pItems[]; +} SUniqueInfo; + +typedef struct SModeItem { + int64_t count; + STuplePos dataPos; + STuplePos tuplePos; +} SModeItem; + +typedef struct SModeInfo { + uint8_t colType; + uint16_t colBytes; + SHashObj* pHash; + + STuplePos nullTuplePos; + bool nullTupleSaved; + + char* buf; // serialize data buffer +} SModeInfo; + +typedef struct SDerivInfo { + double prevValue; // previous value + TSKEY prevTs; // previous timestamp + bool ignoreNegative; // ignore the negative value + int64_t tsWindow; // time window for derivative + bool valueSet; // the value has been set already +} SDerivInfo; + +typedef struct SRateInfo { + double firstValue; + TSKEY firstKey; + double lastValue; + TSKEY lastKey; + int8_t hasResult; // flag to denote has value + + char* firstPk; + char* lastPk; + int8_t pkType; + int32_t pkBytes; + char pkData[]; +} SRateInfo; + +#ifdef __cplusplus +} +#endif + +#endif // TDENGINE_FUNCTIONRESINFOINT_H diff --git a/source/libs/function/inc/thistogram.h b/source/libs/function/inc/thistogram.h index 08bff7117e..26681d0426 100644 --- a/source/libs/function/inc/thistogram.h +++ b/source/libs/function/inc/thistogram.h @@ -16,6 +16,8 @@ #ifndef TDENGINE_HISTOGRAM_H #define TDENGINE_HISTOGRAM_H +#include "functionResInfoInt.h" + #ifdef __cplusplus extern "C" { #endif @@ -24,51 +26,28 @@ extern "C" { #define MAX_HISTOGRAM_BIN 500 -typedef struct SHistBin { - double val; - int64_t num; - -#if !defined(USE_ARRAYLIST) - double delta; - int32_t index; // index in min-heap list -#endif -} SHistBin; - typedef struct SHeapEntry { void* pData; double val; } SHeapEntry; -typedef struct SHistogramInfo { - int64_t numOfElems; - int32_t numOfEntries; - int32_t maxEntries; - double min; - double max; -#if defined(USE_ARRAYLIST) - SHistBin* elems; -#else - tSkipList* pList; - SMultiwayMergeTreeInfo* pLoserTree; - int32_t maxIndex; - bool ordered; -#endif -} SHistogramInfo; +struct SHistogramInfo; +struct SHistBin; -int32_t tHistogramCreate(int32_t numOfEntries, SHistogramInfo** pHisto); -SHistogramInfo* tHistogramCreateFrom(void* pBuf, int32_t numOfBins); +int32_t tHistogramCreate(int32_t numOfEntries, struct SHistogramInfo** pHisto); +struct SHistogramInfo* tHistogramCreateFrom(void* pBuf, int32_t numOfBins); -int32_t tHistogramAdd(SHistogramInfo** pHisto, double val); -int32_t tHistogramSum(SHistogramInfo* pHisto, double v, int64_t *res); +int32_t tHistogramAdd(struct SHistogramInfo** pHisto, double val); +int32_t tHistogramSum(struct SHistogramInfo* pHisto, double v, int64_t *res); -int32_t tHistogramUniform(SHistogramInfo* pHisto, double* ratio, int32_t num, double** pVal); -int32_t tHistogramMerge(SHistogramInfo* pHisto1, SHistogramInfo* pHisto2, int32_t numOfEntries, - SHistogramInfo** pResHistogram); -void tHistogramDestroy(SHistogramInfo** pHisto); +int32_t tHistogramUniform(struct SHistogramInfo* pHisto, double* ratio, int32_t num, double** pVal); +int32_t tHistogramMerge(struct SHistogramInfo* pHisto1, struct SHistogramInfo* pHisto2, int32_t numOfEntries, + struct SHistogramInfo** pResHistogram); +void tHistogramDestroy(struct SHistogramInfo** pHisto); -void tHistogramPrint(SHistogramInfo* pHisto); +void tHistogramPrint(struct SHistogramInfo* pHisto); -int32_t histoBinarySearch(SHistBin* pEntry, int32_t len, double val); +int32_t histoBinarySearch(struct SHistBin* pEntry, int32_t len, double val); SHeapEntry* tHeapCreate(int32_t numOfEntries); void tHeapSort(SHeapEntry* pEntry, int32_t len); diff --git a/source/libs/function/inc/tpercentile.h b/source/libs/function/inc/tpercentile.h index 09df42d3a3..35067fa3ea 100644 --- a/source/libs/function/inc/tpercentile.h +++ b/source/libs/function/inc/tpercentile.h @@ -21,59 +21,18 @@ extern "C" { #endif #include "tpagedbuf.h" - -typedef struct MinMaxEntry { - union { - double dMinVal; - // double i64MinVal; - uint64_t u64MinVal; - }; - union { - double dMaxVal; - // double i64MaxVal; - int64_t u64MaxVal; - }; -} MinMaxEntry; - -typedef struct { - int32_t size; - int32_t pageId; - SFilePage *data; -} SSlotInfo; - -typedef struct tMemBucketSlot { - SSlotInfo info; - MinMaxEntry range; -} tMemBucketSlot; +#include "functionResInfoInt.h" struct tMemBucket; -typedef int32_t (*__perc_hash_func_t)(struct tMemBucket *pBucket, const void *value, int32_t *index); - -typedef struct tMemBucket { - int16_t numOfSlots; - int16_t type; - int32_t bytes; - int32_t total; - int32_t elemPerPage; // number of elements for each object - int32_t maxCapacity; // maximum allowed number of elements that can be sort directly to get the result - int32_t bufPageSize; // disk page size - MinMaxEntry range; // value range - int32_t times; // count that has been checked for deciding the correct data value buckets. - __compar_fn_t comparFn; - tMemBucketSlot *pSlots; - SDiskbasedBuf *pBuffer; - __perc_hash_func_t hashFunc; - SHashObj *groupPagesMap; // disk page map for different groups; -} tMemBucket; int32_t tMemBucketCreate(int32_t nElemSize, int16_t dataType, double minval, double maxval, bool hasWindowOrGroup, - tMemBucket **pBucket); + struct tMemBucket **pBucket); -void tMemBucketDestroy(tMemBucket **pBucket); +void tMemBucketDestroy(struct tMemBucket **pBucket); -int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size); +int32_t tMemBucketPut(struct tMemBucket *pBucket, const void *data, size_t size); -int32_t getPercentile(tMemBucket *pMemBucket, double percent, double *result); +int32_t getPercentile(struct tMemBucket *pMemBucket, double percent, double *result); #endif // TDENGINE_TPERCENTILE_H diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index f13685239a..2e5dd5e381 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -16,6 +16,7 @@ #include "builtinsimpl.h" #include "cJSON.h" #include "function.h" +#include "functionResInfoInt.h" #include "query.h" #include "querynodes.h" #include "tanal.h" @@ -27,82 +28,12 @@ #include "thistogram.h" #include "tpercentile.h" -#define HISTOGRAM_MAX_BINS_NUM 1000 -#define MAVG_MAX_POINTS_NUM 1000 -#define TAIL_MAX_POINTS_NUM 100 -#define TAIL_MAX_OFFSET 100 - -#define HLL_BUCKET_BITS 14 // The bits of the bucket -#define HLL_DATA_BITS (64 - HLL_BUCKET_BITS) -#define HLL_BUCKETS (1 << HLL_BUCKET_BITS) -#define HLL_BUCKET_MASK (HLL_BUCKETS - 1) -#define HLL_ALPHA_INF 0.721347520444481703680 // constant for 0.5/ln(2) - -// typedef struct SMinmaxResInfo { -// bool assign; // assign the first value or not -// int64_t v; -// STuplePos tuplePos; -// -// STuplePos nullTuplePos; -// bool nullTupleSaved; -// int16_t type; -// } SMinmaxResInfo; - -typedef struct STopBotResItem { - SVariant v; - uint64_t uid; // it is a table uid, used to extract tag data during building of the final result for the tag data - STuplePos tuplePos; // tuple data of this chosen row -} STopBotResItem; - -typedef struct STopBotRes { - int32_t maxSize; - int16_t type; - - STuplePos nullTuplePos; - bool nullTupleSaved; - - STopBotResItem* pItems; -} STopBotRes; - -typedef struct SStdRes { - double result; - int64_t count; - union { - double quadraticDSum; - int64_t quadraticISum; - uint64_t quadraticUSum; - }; - union { - double dsum; - int64_t isum; - uint64_t usum; - }; - int16_t type; -} SStdRes; - -typedef struct SLeastSQRInfo { - double matrix[2][3]; - double startVal; - double stepVal; - int64_t num; -} SLeastSQRInfo; - -typedef struct SPercentileInfo { - double result; - tMemBucket* pMemBucket; - int32_t stage; - double minval; - double maxval; - int64_t numOfElems; -} SPercentileInfo; - -typedef struct SAPercentileInfo { - double result; - double percent; - int8_t algo; - SHistogramInfo* pHisto; - TDigest* pTDigest; -} SAPercentileInfo; +bool ignoreNegative(int8_t ignoreOption){ + return (ignoreOption & 0x1) == 0x1; +} +bool ignoreNull(int8_t ignoreOption){ + return (ignoreOption & 0x2) == 0x2; +} typedef enum { APERCT_ALGO_UNKNOWN = 0, @@ -110,76 +41,8 @@ typedef enum { APERCT_ALGO_TDIGEST, } EAPerctAlgoType; -typedef struct SDiffInfo { - bool hasPrev; - bool isFirstRow; - int8_t ignoreOption; // replace the ignore with case when - union { - int64_t i64; - double d64; - } prev; - - int64_t prevTs; -} SDiffInfo; - -bool ignoreNegative(int8_t ignoreOption){ - return (ignoreOption & 0x1) == 0x1; -} -bool ignoreNull(int8_t ignoreOption){ - return (ignoreOption & 0x2) == 0x2; -} -typedef struct SSpreadInfo { - double result; - bool hasResult; - double min; - double max; -} SSpreadInfo; - -typedef struct SElapsedInfo { - double result; - TSKEY min; - TSKEY max; - int64_t timeUnit; -} SElapsedInfo; - -typedef struct STwaInfo { - double dOutput; - int64_t numOfElems; - SPoint1 p; - STimeWindow win; -} STwaInfo; - -typedef struct SHistoFuncBin { - double lower; - double upper; - int64_t count; - double percentage; -} SHistoFuncBin; - -typedef struct SHistoFuncInfo { - int32_t numOfBins; - int32_t totalCount; - bool normalized; - SHistoFuncBin bins[]; -} SHistoFuncInfo; - typedef enum { UNKNOWN_BIN = 0, USER_INPUT_BIN, LINEAR_BIN, LOG_BIN } EHistoBinType; -typedef struct SHLLFuncInfo { - uint64_t result; - uint64_t totalCount; - uint8_t buckets[HLL_BUCKETS]; -} SHLLInfo; - -typedef struct SStateInfo { - union { - int64_t count; - int64_t durationStart; - }; - int64_t prevTs; - bool isPrevTsSet; -} SStateInfo; - typedef enum { STATE_OPER_INVALID = 0, STATE_OPER_LT, @@ -190,105 +53,6 @@ typedef enum { STATE_OPER_EQ, } EStateOperType; -typedef struct SMavgInfo { - int32_t pos; - double sum; - int64_t prevTs; - bool isPrevTsSet; - int32_t numOfPoints; - bool pointsMeet; - double points[]; -} SMavgInfo; - -typedef struct SSampleInfo { - int32_t samples; - int32_t totalPoints; - int32_t numSampled; - uint8_t colType; - uint16_t colBytes; - - STuplePos nullTuplePos; - bool nullTupleSaved; - - char* data; - STuplePos* tuplePos; -} SSampleInfo; - -typedef struct STailItem { - int64_t timestamp; - bool isNull; - char data[]; -} STailItem; - -typedef struct STailInfo { - int32_t numOfPoints; - int32_t numAdded; - int32_t offset; - uint8_t colType; - uint16_t colBytes; - STailItem** pItems; -} STailInfo; - -typedef struct SUniqueItem { - int64_t timestamp; - bool isNull; - char data[]; -} SUniqueItem; - -typedef struct SUniqueInfo { - int32_t numOfPoints; - uint8_t colType; - uint16_t colBytes; - bool hasNull; // null is not hashable, handle separately - SHashObj* pHash; - char pItems[]; -} SUniqueInfo; - -typedef struct SModeItem { - int64_t count; - STuplePos dataPos; - STuplePos tuplePos; -} SModeItem; - -typedef struct SModeInfo { - uint8_t colType; - uint16_t colBytes; - SHashObj* pHash; - - STuplePos nullTuplePos; - bool nullTupleSaved; - - char* buf; // serialize data buffer -} SModeInfo; - -typedef struct SDerivInfo { - double prevValue; // previous value - TSKEY prevTs; // previous timestamp - bool ignoreNegative; // ignore the negative value - int64_t tsWindow; // time window for derivative - bool valueSet; // the value has been set already -} SDerivInfo; - -typedef struct SRateInfo { - double firstValue; - TSKEY firstKey; - double lastValue; - TSKEY lastKey; - int8_t hasResult; // flag to denote has value - - char* firstPk; - char* lastPk; - int8_t pkType; - int32_t pkBytes; - char pkData[]; -} SRateInfo; - -typedef struct SGroupKeyInfo { - bool hasResult; - bool isNull; - char data[]; -} SGroupKeyInfo; - #define SET_VAL(_info, numOfElem, res) \ do { \ if ((numOfElem) <= 0) { \ diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 854260c354..b1bef84511 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -92,13 +92,6 @@ out->sum.usum += val; \ } -typedef struct SAvgRes { - double result; - SSumRes sum; - int64_t count; - int16_t type; // store the original input type, used in merge function -} SAvgRes; - static void floatVectorSumAVX(const float* plist, int32_t numOfRows, SAvgRes* pRes) { const int32_t bitWidth = 256; diff --git a/tests/army/query/function/test_resinfo.py b/tests/army/query/function/test_resinfo.py new file mode 100644 index 0000000000..51d51f3ce1 --- /dev/null +++ b/tests/army/query/function/test_resinfo.py @@ -0,0 +1,69 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import time +import random +import hashlib + +import taos +import frame +import frame.etool + +from frame.log import * +from frame.cases import * +from frame.sql import * +from frame.caseBase import * +from frame import * + +initial_hash_resinfoInt = "e739cde34b98f13dd9ad696d18f060cc" +initial_hash_resinfo = "172d04aa7af0d8cd2e4d9df284079958" + +class TDTestCase(TBase): + def get_file_hash(self, file_path): + hasher = hashlib.md5() + with open(file_path, 'rb') as f: + buf = f.read() + hasher.update(buf) + return hasher.hexdigest() + + def testFileChanged(self): + tdLog.info(f"insert data.") + # taosBenchmark run + resinfoIntFile = etool.curFile(__file__, "../../../../source/libs/function/inc/functionResInfoInt.h") + resinfoFile = etool.curFile(__file__, "../../../../include/libs/function/functionResInfo.h") + current_hash = self.get_file_hash(resinfoIntFile) + if current_hash != initial_hash_resinfoInt: + tdLog.exit(f"{resinfoIntFile} has been modified.") + else: + tdLog.success(f"{resinfoIntFile} is not modified.") + current_hash = self.get_file_hash(resinfoFile) + if current_hash != initial_hash_resinfo: + tdLog.exit(f"{resinfoFile} has been modified.") + else: + tdLog.success(f"{resinfoFile} is not modified.") + + + + # run + def run(self): + tdLog.debug(f"start to excute {__file__}") + + # insert data + self.testFileChanged() + + tdLog.success(f"{__file__} successfully executed") + + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 0d3ed1f8e6..e56d4575a4 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -15,6 +15,7 @@ ,,y,army,./pytest.sh python3 ./test.py -f cluster/snapshot.py -N 3 -L 3 -D 2 ,,y,army,./pytest.sh python3 ./test.py -f query/function/test_func_elapsed.py ,,y,army,./pytest.sh python3 ./test.py -f query/function/test_function.py +,,y,army,./pytest.sh python3 ./test.py -f query/function/test_resinfo.py ,,y,army,./pytest.sh python3 ./test.py -f query/function/concat.py ,,y,army,./pytest.sh python3 ./test.py -f query/function/cast.py ,,y,army,./pytest.sh python3 ./test.py -f query/test_join.py From 618ec35190d5fa9f86f227767f87db30002aa621 Mon Sep 17 00:00:00 2001 From: charles Date: Sat, 12 Oct 2024 15:15:15 +0800 Subject: [PATCH 17/56] update encrypt test case for ts-5507 by charles --- tests/army/db-encrypt/basic.py | 30 ++++++++++++++++++++++++++++++ tests/parallel_test/cases.task | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/army/db-encrypt/basic.py b/tests/army/db-encrypt/basic.py index 8d30bbcfe2..ea648f1b8f 100644 --- a/tests/army/db-encrypt/basic.py +++ b/tests/army/db-encrypt/basic.py @@ -13,6 +13,7 @@ from frame.srvCtl import * from frame.caseBase import * from frame import * from frame.autogen import * +from frame import epath # from frame.server.dnodes import * # from frame.server.cluster import * @@ -20,7 +21,9 @@ from frame.autogen import * class TDTestCase(TBase): def init(self, conn, logSql, replicaVar=1): + updatecfgDict = {'dDebugFlag':131} super(TDTestCase, self).init(conn, logSql, replicaVar=1, checkColName="c1") + self.valgrind = 0 self.db = "test" self.stb = "meters" @@ -50,9 +53,36 @@ class TDTestCase(TBase): tdSql.error("create encrypt_key '12345678abcdefghi'") tdSql.error("create database test ENCRYPT_ALGORITHM 'sm4'") + def recreate_dndoe_encrypt_key(self): + """ + Description: From the jira TS-5507, the encrypt key can be recreated. + create: + 2024-09-23 created by Charles + update: + None + """ + # taosd path + taosd_path = epath.binPath() + tdLog.info(f"taosd_path: {taosd_path}") + # dnode2 path + dndoe2_path = tdDnodes.getDnodeDir(2) + dnode2_data_path = os.sep.join([dndoe2_path, "data"]) + dnode2_cfg_path = os.sep.join([dndoe2_path, "cfg"]) + tdLog.info(f"dnode2_path: {dnode2_data_path}") + # stop dnode2 + tdDnodes.stoptaosd(2) + tdLog.info("stop dndoe2") + # delete dndoe2 data + cmd = f"rm -rf {dnode2_data_path}" + os.system(cmd) + # recreate the encrypt key for dnode2 + os.system(f"{os.sep.join([taosd_path, "taosd"])} -y '1234567890' -c {dnode2_cfg_path}") + tdLog.info("test case: recreate the encrypt key for dnode2 passed") + def run(self): self.create_encrypt_db_error() self.create_encrypt_db() + self.recreate_dndoe_encrypt_key() def stop(self): tdSql.close() diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 0d3ed1f8e6..5d94c2a6b1 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,7 +10,7 @@ # army-test # ,,y,army,./pytest.sh python3 ./test.py -f multi-level/mlevel_basic.py -N 3 -L 3 -D 2 -,,y,army,./pytest.sh python3 ./test.py -f db-encrypt/basic.py +,,y,army,./pytest.sh python3 ./test.py -f db-encrypt/basic.py -N 3 -M 3 ,,n,army,python3 ./test.py -f storage/s3/s3Basic.py -N 3 ,,y,army,./pytest.sh python3 ./test.py -f cluster/snapshot.py -N 3 -L 3 -D 2 ,,y,army,./pytest.sh python3 ./test.py -f query/function/test_func_elapsed.py From 0c11795cdea075339181c3e26649ef827113d260 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 12 Oct 2024 16:09:23 +0800 Subject: [PATCH 18/56] fix:[TD-32526] consumer null if add column because of pDataBlock not clear --- source/libs/executor/src/scanoperator.c | 1 + tests/system-test/7-tmq/tmq_td32526.py | 53 +++++++ utils/test/c/CMakeLists.txt | 8 + utils/test/c/tmq_td32526.c | 200 ++++++++++++++++++++++++ 4 files changed, 262 insertions(+) create mode 100644 tests/system-test/7-tmq/tmq_td32526.py create mode 100644 utils/test/c/tmq_td32526.c diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index bae9926f63..3713a2c071 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2877,6 +2877,7 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock return 0; } + blockDataFreeRes((SSDataBlock*)pBlock); code = calBlockTbName(pInfo, pInfo->pRes, 0); QUERY_CHECK_CODE(code, lino, _end); diff --git a/tests/system-test/7-tmq/tmq_td32526.py b/tests/system-test/7-tmq/tmq_td32526.py new file mode 100644 index 0000000000..70eb91e916 --- /dev/null +++ b/tests/system-test/7-tmq/tmq_td32526.py @@ -0,0 +1,53 @@ +import taos +import sys +import time +import socket +import os +import threading + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.common import * +from taos.tmq import * +sys.path.append("./7-tmq") +from tmqCommon import * + +class TDTestCase: + updatecfgDict = {'debugFlag': 135, 'asynclog': 0} + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + #tdSql.init(conn.cursor(), logSql) # output sql.txt file + + def run(self): + tdSql.execute(f'create database if not exists db_5466') + tdSql.execute(f'use db_5466') + tdSql.execute(f'CREATE STABLE meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)') + tdSql.execute("INSERT INTO d1001 USING meters TAGS('California.SanFrancisco', 2) VALUES('2018-10-05 14:38:05.000',10.30000,219,0.31000)") + + buildPath = tdCom.getBuildPath() + cmdStr = '%s/build/bin/tmq_td32526'%(buildPath) + # tdLog.info(cmdStr) + # os.system(cmdStr) + # + # tdSql.execute("drop topic db_5466_topic") + tdSql.execute(f'alter stable meters add column item_tags nchar(500)') + tdSql.execute(f'alter stable meters add column new_col nchar(100)') + tdSql.execute("create topic db_5466_topic as select * from db_5466.meters") + + tdSql.execute("INSERT INTO d1001 USING meters TAGS('California.SanFrancisco', 2) VALUES('2018-10-06 14:38:05.000',10.30000,219,0.31000, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '1')") + + tdLog.info(cmdStr) + os.system(cmdStr) + + return + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) \ No newline at end of file diff --git a/utils/test/c/CMakeLists.txt b/utils/test/c/CMakeLists.txt index 991a004a74..29b2fcc99f 100644 --- a/utils/test/c/CMakeLists.txt +++ b/utils/test/c/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable(tmq_sim tmqSim.c) add_executable(create_table createTable.c) add_executable(tmq_taosx_ci tmq_taosx_ci.c) add_executable(tmq_ts5466 tmq_ts5466.c) +add_executable(tmq_td32526 tmq_td32526.c) add_executable(tmq_write_raw_test tmq_write_raw_test.c) add_executable(write_raw_block_test write_raw_block_test.c) add_executable(sml_test sml_test.c) @@ -62,6 +63,13 @@ target_link_libraries( PUBLIC common PUBLIC os ) +target_link_libraries( + tmq_td32526 + PUBLIC taos + PUBLIC util + PUBLIC common + PUBLIC os +) target_link_libraries( tmq_taosx_ci PUBLIC taos diff --git a/utils/test/c/tmq_td32526.c b/utils/test/c/tmq_td32526.c new file mode 100644 index 0000000000..42d38ec56c --- /dev/null +++ b/utils/test/c/tmq_td32526.c @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include "cJSON.h" +#include "taos.h" +#include "tmsg.h" +#include "types.h" + +void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) { + printf("commit %d tmq %p param %p\n", code, tmq, param); +} + +tmq_t* build_consumer() { + tmq_conf_t* conf = tmq_conf_new(); + tmq_conf_set(conf, "group.id", "g1"); + tmq_conf_set(conf, "client.id", "my app 1"); + tmq_conf_set(conf, "td.connect.user", "root"); + tmq_conf_set(conf, "td.connect.pass", "taosdata"); + tmq_conf_set(conf, "msg.with.table.name", "true"); + tmq_conf_set(conf, "enable.auto.commit", "true"); + tmq_conf_set(conf, "auto.offset.reset", "earliest"); + tmq_conf_set(conf, "msg.consume.excluded", "1"); + + tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); + tmq_t* tmq = tmq_consumer_new(conf, NULL, 0); + assert(tmq); + tmq_conf_destroy(conf); + return tmq; +} + +tmq_list_t* build_topic_list() { + tmq_list_t* topic_list = tmq_list_new(); + tmq_list_append(topic_list, "db_5466_topic"); + return topic_list; +} + +int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) { + int len = 0; + char split = ' '; + + for (int i = 0; i < numFields; ++i) { + if (i > 0) { + str[len++] = split; + } + + if (row[i] == NULL) { + len += sprintf(str + len, "%s", "NULL"); + continue; + } + + switch (fields[i].type) { + case TSDB_DATA_TYPE_TINYINT: + len += sprintf(str + len, "%d", *((int8_t *)row[i])); + break; + + case TSDB_DATA_TYPE_UTINYINT: + len += sprintf(str + len, "%u", *((uint8_t *)row[i])); + break; + + case TSDB_DATA_TYPE_SMALLINT: + len += sprintf(str + len, "%d", *((int16_t *)row[i])); + break; + + case TSDB_DATA_TYPE_USMALLINT: + len += sprintf(str + len, "%u", *((uint16_t *)row[i])); + break; + + case TSDB_DATA_TYPE_INT: + len += sprintf(str + len, "%d", *((int32_t *)row[i])); + break; + + case TSDB_DATA_TYPE_UINT: + len += sprintf(str + len, "%u", *((uint32_t *)row[i])); + break; + + case TSDB_DATA_TYPE_BIGINT: + len += sprintf(str + len, "%" PRId64, *((int64_t *)row[i])); + break; + + case TSDB_DATA_TYPE_UBIGINT: + len += sprintf(str + len, "%" PRIu64, *((uint64_t *)row[i])); + break; + + case TSDB_DATA_TYPE_FLOAT: { + float fv = 0; + fv = GET_FLOAT_VAL(row[i]); + len += sprintf(str + len, "%f", fv); + } break; + + case TSDB_DATA_TYPE_DOUBLE: { + double dv = 0; + dv = GET_DOUBLE_VAL(row[i]); + len += sprintf(str + len, "%lf", dv); + } break; + + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_VARBINARY: + case TSDB_DATA_TYPE_NCHAR: + case TSDB_DATA_TYPE_GEOMETRY: { + int32_t charLen = varDataLen((char *)row[i] - VARSTR_HEADER_SIZE); + memcpy(str + len, row[i], charLen); + len += charLen; + } break; + + case TSDB_DATA_TYPE_TIMESTAMP: + len += sprintf(str + len, "%" PRId64, *((int64_t *)row[i])); + break; + + case TSDB_DATA_TYPE_BOOL: + len += sprintf(str + len, "%d", *((int8_t *)row[i])); + default: + break; + } + } + + return len; +} + +/** + * @brief print column name and values of each row + * + * @param res + * @return int + */ +static int printResult(TAOS_RES *res) { + TAOS_ROW row = NULL; + int32_t cnt = 0; + while ((row = taos_fetch_row(res))) { + + int numFields = taos_num_fields(res); + TAOS_FIELD *fields = taos_fetch_fields(res); + char header[256] = {0}; + int len = 0; + for (int i = 0; i < numFields; ++i) { + len += sprintf(header + len, "%s ", fields[i].name); + } + puts(header); + + char temp[1024] = {0}; + printRow(temp, row, fields, numFields); + if (cnt == 0){ + ASSERT(strcmp(temp, "1538721485000 10.300000 219 0.310000 NULL NULL California.SanFrancisco 2") == 0); + }else if(cnt == 1){ + ASSERT(strcmp(temp, "1538807885000 10.300000 219 0.310000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1 California.SanFrancisco 2") == 0); + } + cnt++; + } + return 0; +} + +void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) { + int32_t code; + + if ((code = tmq_subscribe(tmq, topics))) { + fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(code)); + printf("subscribe err\n"); + return; + } + int32_t cnt = 0; + while (1) { + TAOS_RES* tmqmessage = tmq_consumer_poll(tmq, 5000); + if (tmqmessage) { + cnt++; + printResult(tmqmessage); + taos_free_result(tmqmessage); + } else { + break; + } + } + + code = tmq_consumer_close(tmq); + if (code) + fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(code)); + else + fprintf(stderr, "%% Consumer closed\n"); +} + +int main(int argc, char* argv[]) { + tmq_t* tmq = build_consumer(); + tmq_list_t* topic_list = build_topic_list(); + basic_consume_loop(tmq, topic_list); + tmq_list_destroy(topic_list); +} \ No newline at end of file From 22b310e79482d0c86ff0b944e47ab1b2c8579cf4 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 12 Oct 2024 16:13:30 +0800 Subject: [PATCH 19/56] fix:[TD-32526] consumer null if add column because of pDataBlock not clear --- tests/parallel_test/cases.task | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 0d3ed1f8e6..450ef91798 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -284,6 +284,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts5466.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts-5473.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_ts4563.py +,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_td32526.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_replay.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSeekAndCommit.py ,,n,system-test,python3 ./test.py -f 7-tmq/tmq_offset.py From 5663519d47df8dd8cd25e4197d6dfaa7bb022581 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 12 Oct 2024 16:28:31 +0800 Subject: [PATCH 20/56] fix:[TD-32526] consumer null if add column because of pDataBlock not clear --- tests/system-test/7-tmq/tmq_td32526.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/system-test/7-tmq/tmq_td32526.py b/tests/system-test/7-tmq/tmq_td32526.py index 70eb91e916..0dd6068cdd 100644 --- a/tests/system-test/7-tmq/tmq_td32526.py +++ b/tests/system-test/7-tmq/tmq_td32526.py @@ -41,7 +41,8 @@ class TDTestCase: tdSql.execute("INSERT INTO d1001 USING meters TAGS('California.SanFrancisco', 2) VALUES('2018-10-06 14:38:05.000',10.30000,219,0.31000, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '1')") tdLog.info(cmdStr) - os.system(cmdStr) + if os.system(cmdStr) != 0: + tdLog.exit(cmdStr) return From e84376c46140d0aec99d06741adef72a543b7328 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Sat, 12 Oct 2024 16:29:13 +0800 Subject: [PATCH 21/56] fix: return val check --- include/os/osSocket.h | 1 - source/common/src/tdatablock.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/os/osSocket.h b/include/os/osSocket.h index 5ee3f30ddf..1cedfc4dcd 100644 --- a/include/os/osSocket.h +++ b/include/os/osSocket.h @@ -85,7 +85,6 @@ typedef int32_t SOCKET; #else #define TAOS_EPOLL_WAIT_TIME 500 typedef int32_t SOCKET; -typedef SOCKET EpollFd; #define EpollClose(pollFd) taosCloseSocket(pollFd) #endif diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 346d2c7584..5372533455 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -2556,7 +2556,7 @@ int32_t dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf memset(pBuf, 0, sizeof(pBuf)); code = formatTimestamp(pBuf, sizeof(pBuf), *(uint64_t*)var, pColInfoData->info.precision); if (code != TSDB_CODE_SUCCESS) { - tsnprintf(pBuf, sizeof(pBuf), "NaN"); + TAOS_UNUSED(tsnprintf(pBuf, sizeof(pBuf), "NaN")); } len += tsnprintf(dumpBuf + len, size - len, " %25s |", pBuf); if (len >= size - 1) goto _exit; From e7b5c72ff23d3f75f4332c758cf06240efaac7a4 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Sat, 12 Oct 2024 18:13:11 +0800 Subject: [PATCH 22/56] Update basic.py --- tests/army/db-encrypt/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/army/db-encrypt/basic.py b/tests/army/db-encrypt/basic.py index ea648f1b8f..a93b85f0da 100644 --- a/tests/army/db-encrypt/basic.py +++ b/tests/army/db-encrypt/basic.py @@ -76,7 +76,7 @@ class TDTestCase(TBase): cmd = f"rm -rf {dnode2_data_path}" os.system(cmd) # recreate the encrypt key for dnode2 - os.system(f"{os.sep.join([taosd_path, "taosd"])} -y '1234567890' -c {dnode2_cfg_path}") + os.system(f"{os.sep.join([taosd_path, 'taosd'])} -y '1234567890' -c {dnode2_cfg_path}") tdLog.info("test case: recreate the encrypt key for dnode2 passed") def run(self): From db97e26d327f344c76c2d5cbc456603d07cb61bd Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 12 Oct 2024 18:31:29 +0800 Subject: [PATCH 23/56] fix:[TD-32526] consumer null if add column because of pDataBlock not clear --- source/dnode/vnode/src/tq/tqRead.c | 20 ++++++++++++++------ source/libs/executor/src/scanoperator.c | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 6dc5453d50..a206c3f7ae 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -562,9 +562,18 @@ int32_t tqMaskBlock(SSchemaWrapper* pDst, SSDataBlock* pBlock, const SSchemaWrap return 0; } -static int32_t buildResSDataBlock(SSDataBlock* pBlock, SSchemaWrapper* pSchema, const SArray* pColIdList) { +static int32_t buildResSDataBlock(STqReader* pReader, SSchemaWrapper* pSchema, const SArray* pColIdList) { + SSDataBlock* pBlock = pReader->pResBlock; if (blockDataGetNumOfCols(pBlock) > 0) { - return TSDB_CODE_SUCCESS; + blockDataDestroy(pBlock); + int32_t code = createDataBlock(&pReader->pResBlock); + if (code) { + return code; + } + pBlock = pReader->pResBlock; + + pBlock->info.id.uid = pReader->cachedSchemaUid; + pBlock->info.version = pReader->msg.ver; } int32_t numOfCols = taosArrayGetSize(pColIdList); @@ -678,10 +687,9 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSDataBlock** pRes, const char* vgId, suid, uid, sversion, pReader->pSchemaWrapper->version); return TSDB_CODE_TQ_INTERNAL_ERROR; } - if (blockDataGetNumOfCols(pBlock) == 0) { - code = buildResSDataBlock(pReader->pResBlock, pReader->pSchemaWrapper, pReader->pColIdList); - TSDB_CHECK_CODE(code, line, END); - } + code = buildResSDataBlock(pReader, pReader->pSchemaWrapper, pReader->pColIdList); + TSDB_CHECK_CODE(code, line, END); + pBlock = pReader->pResBlock; } int32_t numOfRows = 0; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 3713a2c071..bae9926f63 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2877,7 +2877,6 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock return 0; } - blockDataFreeRes((SSDataBlock*)pBlock); code = calBlockTbName(pInfo, pInfo->pRes, 0); QUERY_CHECK_CODE(code, lino, _end); From 14a2cb073a262da89a0217e84c5473c3e18fc97b Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Sat, 12 Oct 2024 18:40:56 +0800 Subject: [PATCH 24/56] enh: add return len --- source/libs/command/src/command.c | 13 +++++-------- source/libs/scheduler/src/schUtil.c | 2 +- source/os/src/osString.c | 29 ++++++++++++++++++----------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 8429e04a3e..27a43f7523 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -513,21 +513,18 @@ void appendColumnFields(char* buf, int32_t* len, STableCfg* pCfg) { int typeLen = strlen(type); if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_VARBINARY == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { - snprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); + typeLen += tsnprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { - snprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", + typeLen += snprintf(type + typeLen, LTYPE_LEN - typeLen, "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } if (useCompress(pCfg->tableType) && pCfg->pSchemaExt) { - typeLen = strlen(type); - snprintf(type + typeLen, LTYPE_LEN - typeLen, " ENCODE \'%s\'", + typeLen += tsnprintf(type + typeLen, LTYPE_LEN - typeLen, " ENCODE \'%s\'", columnEncodeStr(COMPRESS_L1_TYPE_U32(pCfg->pSchemaExt[i].compress))); - typeLen = strlen(type); - snprintf(type + typeLen, LTYPE_LEN - typeLen, " COMPRESS \'%s\'", + typeLen += tsnprintf(type + typeLen, LTYPE_LEN - typeLen, " COMPRESS \'%s\'", columnCompressStr(COMPRESS_L2_TYPE_U32(pCfg->pSchemaExt[i].compress))); - typeLen = strlen(type); - snprintf(type + typeLen, LTYPE_LEN - typeLen, " LEVEL \'%s\'", + typeLen += tsnprintf(type + typeLen, LTYPE_LEN - typeLen, " LEVEL \'%s\'", columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(pCfg->pSchemaExt[i].compress))); } if (!(pSchema->flags & COL_IS_KEY)) { diff --git a/source/libs/scheduler/src/schUtil.c b/source/libs/scheduler/src/schUtil.c index e6945dac89..b68f665200 100644 --- a/source/libs/scheduler/src/schUtil.c +++ b/source/libs/scheduler/src/schUtil.c @@ -306,7 +306,7 @@ uint64_t schGenUUID(void) { qError("Failed to get the system uid, reason:%s", tstrerror(TAOS_SYSTEM_ERROR(errno))); } } -ßßß + int64_t ts = taosGetTimestampMs(); uint64_t pid = taosGetPId(); int32_t val = atomic_add_fetch_32(&requestSerialId, 1); diff --git a/source/os/src/osString.c b/source/os/src/osString.c index f2cadb3924..18da778227 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -712,16 +712,23 @@ int32_t taosAscii2Hex(const char *z, uint32_t n, void **data, uint32_t *size) { } int64_t tsnprintf(char *dst, int64_t size, const char *format, ...) { - if (size <= 0 || size > SIZE_MAX) return 0; + if (size <= 0) return 0; + if (size == 1) { + dst[0] = '\0'; + return 0; + } + if (size > SIZE_MAX) { + size = SIZE_MAX; + } - int64_t ret; - va_list args; - va_start(args, format); - ret = vsnprintf(dst, size, format, args); - va_end(args ); - if (ret >= size) { - return size - 1; - } else { - return ret; - } + int64_t ret; + va_list args; + va_start(args, format); + ret = vsnprintf(dst, size, format, args); + va_end(args); + if (ret >= size) { + return size - 1; + } else { + return ret; + } } From 2e3bebe4051bf32d13c2c5b6ca3bd69a4d41501e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sun, 13 Oct 2024 12:59:50 +0800 Subject: [PATCH 25/56] fix:[TD-32526] conflicts from 3.0 --- source/dnode/vnode/src/tq/tqRead.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index a206c3f7ae..f2f85773b5 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -690,6 +690,7 @@ int32_t tqRetrieveDataBlock(STqReader* pReader, SSDataBlock** pRes, const char* code = buildResSDataBlock(pReader, pReader->pSchemaWrapper, pReader->pColIdList); TSDB_CHECK_CODE(code, line, END); pBlock = pReader->pResBlock; + *pRes = pBlock; } int32_t numOfRows = 0; From 49fd079d5bb87ebf8773e7c3c9ecfab1957129cf Mon Sep 17 00:00:00 2001 From: zhiyong Date: Mon, 14 Oct 2024 09:00:17 +0800 Subject: [PATCH 26/56] update data.precision --- .../10-third-party/01-collection/11-kafka.md | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/docs/zh/10-third-party/01-collection/11-kafka.md b/docs/zh/10-third-party/01-collection/11-kafka.md index 75adefbc50..5113519e50 100644 --- a/docs/zh/10-third-party/01-collection/11-kafka.md +++ b/docs/zh/10-third-party/01-collection/11-kafka.md @@ -347,14 +347,18 @@ curl -X DELETE http://localhost:8083/connectors/TDengineSourceConnector 以下配置项对 TDengine Sink Connector 和 TDengine Source Connector 均适用。 1. `name`: connector 名称。 -2. `connector.class`: connector 的完整类名, 如: com.taosdata.kafka.connect.sink.TDengineSinkConnector。 -3. `tasks.max`: 最大任务数, 默认 1。 -4. `topics`: 需要同步的 topic 列表, 多个用逗号分隔, 如 `topic1,topic2`。 -5. `connection.url`: TDengine JDBC 连接字符串, 如 `jdbc:TAOS://127.0.0.1:6030`。 -6. `connection.user`: TDengine 用户名, 默认 root。 -7. `connection.password` :TDengine 用户密码, 默认 taosdata。 -8. `connection.attempts` :最大尝试连接次数。默认 3。 -9. `connection.backoff.ms` : 创建连接失败重试时间隔时间,单位为 ms。 默认 5000。 +1. `connector.class`: connector 的完整类名, 如: com.taosdata.kafka.connect.sink.TDengineSinkConnector。 +1. `tasks.max`: 最大任务数, 默认 1。 +1. `topics`: 需要同步的 topic 列表, 多个用逗号分隔, 如 `topic1,topic2`。 +1. `connection.url`: TDengine JDBC 连接字符串, 如 `jdbc:TAOS://127.0.0.1:6030`。 +1. `connection.user`: TDengine 用户名, 默认 root。 +1. `connection.password` :TDengine 用户密码, 默认 taosdata。 +1. `connection.attempts` :最大尝试连接次数。默认 3。 +1. `connection.backoff.ms` : 创建连接失败重试时间隔时间,单位为 ms。 默认 5000。 +1. `data.precision`: 使用 InfluxDB 行协议格式时,时间戳的精度。可选值为: + 1. ms : 表示毫秒 + 1. us : 表示微秒 + 1. ns : 表示纳秒 ### TDengine Sink Connector 特有的配置 @@ -367,30 +371,22 @@ curl -X DELETE http://localhost:8083/connectors/TDengineSourceConnector 1. line :代表 InfluxDB 行协议格式 2. json : 代表 OpenTSDB JSON 格式 3. telnet :代表 OpenTSDB Telnet 行协议格式 -7. `data.precision`: 使用 InfluxDB 行协议格式时,时间戳的精度。可选值为: - 1. ms : 表示毫秒 - 2. us : 表示微秒 - 3. ns : 表示纳秒。 ### TDengine Source Connector 特有的配置 1. `connection.database`: 源数据库名称,无缺省值。 -2. `topic.prefix`: 数据导入 kafka 时使用的 topic 名称的前缀。默认为空字符串 ""。 -3. `timestamp.initial`: 数据同步起始时间。格式为'yyyy-MM-dd HH:mm:ss',若未指定则从指定 DB 中最早的一条记录开始。 -4. `poll.interval.ms`: 检查是否有新建或删除的表的时间间隔,单位为 ms。默认为 1000。 -5. `fetch.max.rows` : 检索数据库时最大检索条数。 默认为 100。 -6. `query.interval.ms`: 从 TDengine 一次读取数据的时间跨度,需要根据表中的数据特征合理配置,避免一次查询的数据量过大或过小;在具体的环境中建议通过测试设置一个较优值,默认值为 0,即获取到当前最新时间的所有数据。 -7. `out.format` : 结果集输出格式。`line` 表示输出格式为 InfluxDB Line 协议格式,`json` 表示输出格式是 json。默认为 line。 -8. `data.precision`: 使用 InfluxDB 行协议格式时,时间戳的精度。可选值为: - 1. ms : 表示毫秒, - 2. us : 表示微秒 - 3. ns : 表示纳秒。 -9. `topic.per.stable`: 如果设置为 true,表示一个超级表对应一个 Kafka topic,topic的命名规则 ``;如果设置为 false,则指定的 DB 中的所有数据进入一个 Kafka topic,topic 的命名规则为 `` -10. `topic.ignore.db`: topic 命名规则是否包含 database 名称,true 表示规则为 ``,false 表示规则为 ``,默认 false。此配置项在 `topic.per.stable` 设置为 false 时不生效。 -11. `topic.delimiter`: topic 名称分割符,默认为 `-`。 -12. `read.method`: 从 TDengine 读取数据方式,query 或是 subscription。默认为 subscription。 -13. `subscription.group.id`: 指定 TDengine 数据订阅的组 id,当 `read.method` 为 subscription 时,此项为必填项。 -14. `subscription.from`: 指定 TDengine 数据订阅起始位置,latest 或是 earliest。默认为 latest。 +1. `topic.prefix`: 数据导入 kafka 时使用的 topic 名称的前缀。默认为空字符串 ""。 +1. `timestamp.initial`: 数据同步起始时间。格式为'yyyy-MM-dd HH:mm:ss',若未指定则从指定 DB 中最早的一条记录开始。 +1. `poll.interval.ms`: 检查是否有新建或删除的表的时间间隔,单位为 ms。默认为 1000。 +1. `fetch.max.rows` : 检索数据库时最大检索条数。 默认为 100。 +1. `query.interval.ms`: 从 TDengine 一次读取数据的时间跨度,需要根据表中的数据特征合理配置,避免一次查询的数据量过大或过小;在具体的环境中建议通过测试设置一个较优值,默认值为 0,即获取到当前最新时间的所有数据。 +1. `out.format` : 结果集输出格式。`line` 表示输出格式为 InfluxDB Line 协议格式,`json` 表示输出格式是 json。默认为 line。 +1. `topic.per.stable`: 如果设置为 true,表示一个超级表对应一个 Kafka topic,topic的命名规则 ``;如果设置为 false,则指定的 DB 中的所有数据进入一个 Kafka topic,topic 的命名规则为 `` +1. `topic.ignore.db`: topic 命名规则是否包含 database 名称,true 表示规则为 ``,false 表示规则为 ``,默认 false。此配置项在 `topic.per.stable` 设置为 false 时不生效。 +1. `topic.delimiter`: topic 名称分割符,默认为 `-`。 +1. `read.method`: 从 TDengine 读取数据方式,query 或是 subscription。默认为 subscription。 +1. `subscription.group.id`: 指定 TDengine 数据订阅的组 id,当 `read.method` 为 subscription 时,此项为必填项。 +1. `subscription.from`: 指定 TDengine 数据订阅起始位置,latest 或是 earliest。默认为 latest。 ## 其他说明 From f9405b35d3d27ead229a9f433528acd052356997 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 14 Oct 2024 14:21:38 +0800 Subject: [PATCH 27/56] fix: add tag length check in stmt --- source/libs/parser/src/parInsertStmt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index 500d0e213e..ee61611bf2 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -218,6 +218,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch } else { memcpy(&val.i64, bind[c].buffer, colLen); } + if (IS_VAR_DATA_TYPE(pTagSchema->type) && val.nData > pTagSchema->bytes) { + code = TSDB_CODE_PAR_VALUE_TOO_LONG; + goto end; + } if (NULL == taosArrayPush(pTagArray, &val)) { code = terrno; goto end; @@ -566,6 +570,10 @@ int32_t qBindStmtTagsValue2(void* pBlock, void* boundTags, int64_t suid, const c } else { memcpy(&val.i64, bind[c].buffer, colLen); } + if (IS_VAR_DATA_TYPE(pTagSchema->type) && val.nData > pTagSchema->bytes) { + code = TSDB_CODE_PAR_VALUE_TOO_LONG; + goto end; + } if (NULL == taosArrayPush(pTagArray, &val)) { code = terrno; goto end; From 636c65d62f180b88d568648c3a9d823c22632e3b Mon Sep 17 00:00:00 2001 From: Jinqing Kuang Date: Wed, 11 Sep 2024 14:30:34 +0800 Subject: [PATCH 28/56] enh(query)[TS-4661]. Add AVX2 support for decompression and MIN/MAX comparison - Implement AVX2 instructions to decompress float and double data types - Add AVX2-based MIN/MAX comparison for both integer and floating-point data types - Include unit tests to verify functionality and performance improvements --- cmake/cmake.define | 19 +- include/util/tcompression.h | 16 +- source/common/src/tglobal.c | 8 +- .../libs/function/src/detail/tavgfunction.c | 328 ++-------------- source/libs/function/src/detail/tminmax.c | 365 ++++++----------- source/os/src/osEnv.c | 2 +- source/os/src/osMemory.c | 2 +- source/util/src/tcompression.c | 369 ++++++++++-------- source/util/src/tdecompress.c | 155 +++++++- source/util/test/CMakeLists.txt | 14 +- source/util/test/decompressTest.cpp | 285 +++++++++++--- 11 files changed, 757 insertions(+), 806 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index eb78b54cae..fd8f42de2f 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -177,16 +177,17 @@ ELSE () SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") ENDIF() - IF (COMPILER_SUPPORT_AVX) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") - ENDIF() - IF (COMPILER_SUPPORT_AVX2) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") - ENDIF() - MESSAGE(STATUS "SIMD instructions (FMA/AVX/AVX2) is ACTIVATED") + MESSAGE(STATUS "FMA instructions is ACTIVATED") ENDIF() + IF (COMPILER_SUPPORT_AVX) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") + ENDIF() + IF (COMPILER_SUPPORT_AVX2) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") + ENDIF() + MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") IF ("${SIMD_AVX512_SUPPORT}" MATCHES "true") IF (COMPILER_SUPPORT_AVX512F AND COMPILER_SUPPORT_AVX512BMI) diff --git a/include/util/tcompression.h b/include/util/tcompression.h index fef6c0713c..d32d20b727 100644 --- a/include/util/tcompression.h +++ b/include/util/tcompression.h @@ -152,11 +152,15 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int // for internal usage int32_t getWordLength(char type); +#ifdef __AVX2__ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, char *const output, const char type); -void tsDecompressFloatImplAvx512(const char *const input, const int32_t nelements, char *const output); -void tsDecompressFloatImplAvx2(const char *const input, const int32_t nelements, char *const output); +int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *output); +int32_t tsDecompressDoubleImpAvx2(const char *input, int32_t nelements, char *output); +void tsDecompressTimestampAvx2(const char *input, int32_t nelements, char *output, bool bigEndian); +#endif +#ifdef __AVX512VL__ void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool bigEndian); -void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, char *const output, bool bigEndian); +#endif /************************************************************************* * REGULAR COMPRESSION 2 @@ -213,8 +217,8 @@ typedef int32_t (*__data_compress_init)(char *lossyColumns, float fPrecision, do uint32_t intervals, int32_t ifAdtFse, const char *compressor); typedef int32_t (*__data_compress_l1_fn_t)(const char *const input, const int32_t nelements, char *const output, const char type); -typedef int32_t (*__data_decompress_l1_fn_t)(const char *const input, const int32_t nelements, char *const output, - const char type); +typedef int32_t (*__data_decompress_l1_fn_t)(const char *const input, int32_t ninput, const int32_t nelements, + char *const output, const char type); typedef int32_t (*__data_compress_l2_fn_t)(const char *const input, const int32_t nelements, char *const output, int32_t outputSize, const char type, int8_t level); @@ -289,4 +293,4 @@ int8_t tUpdateCompress(uint32_t oldCmpr, uint32_t newCmpr, uint8_t l2Disabled, u } #endif -#endif /*_TD_UTIL_COMPRESSION_H_*/ \ No newline at end of file +#endif /*_TD_UTIL_COMPRESSION_H_*/ diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index b6fdc2c3c7..3c05294264 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -645,11 +645,6 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { TAOS_CHECK_RETURN(cfgAddBool(pCfg, "enableCoreFile", tsEnableCoreFile, CFG_SCOPE_BOTH, CFG_DYN_BOTH)); TAOS_CHECK_RETURN(cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, CFG_SCOPE_BOTH, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddBool(pCfg, "ssd42", tsSSE42Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddBool(pCfg, "avx", tsAVXSupported, CFG_SCOPE_BOTH, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddBool(pCfg, "avx2", tsAVX2Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddBool(pCfg, "fma", tsFMASupported, CFG_SCOPE_BOTH, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddBool(pCfg, "avx512", tsAVX512Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddBool(pCfg, "simdEnable", tsSIMDEnable, CFG_SCOPE_BOTH, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddBool(pCfg, "AVX512Enable", tsAVX512Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddBool(pCfg, "tagFilterCache", tsTagFilterCache, CFG_SCOPE_BOTH, CFG_DYN_NONE)); @@ -1397,6 +1392,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "simdEnable"); tsSIMDEnable = (bool)pItem->bval; + TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "AVX512Enable"); + tsAVX512Enable = (bool)pItem->bval; + TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "tagFilterCache"); tsTagFilterCache = (bool)pItem->bval; diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index b1bef84511..7313fc82f7 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -92,254 +92,6 @@ out->sum.usum += val; \ } -static void floatVectorSumAVX(const float* plist, int32_t numOfRows, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth>>3u) / sizeof(float); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - const float* p = plist; - - __m256 val; - __m256 sum = _mm256_setzero_ps(); - - for (int32_t i = 0; i < rounds; ++i) { - val = _mm256_loadu_ps(p); - sum = _mm256_add_ps(sum, val); - p += width; - } - - // let sum up the final results - const float* q = (const float*)∑ - pRes->sum.dsum += q[0] + q[1] + q[2] + q[3] + q[4] + q[5] + q[6] + q[7]; - - int32_t startIndex = rounds * width; - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.dsum += plist[j + startIndex]; - } -#endif -} - -static void doubleVectorSumAVX(const double* plist, int32_t numOfRows, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth>>3u) / sizeof(int64_t); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - const double* p = plist; - - __m256d val; - __m256d sum = _mm256_setzero_pd(); - - for (int32_t i = 0; i < rounds; ++i) { - val = _mm256_loadu_pd(p); - sum = _mm256_add_pd(sum, val); - p += width; - } - - // let sum up the final results - const double* q = (const double*)∑ - pRes->sum.dsum += q[0] + q[1] + q[2] + q[3]; - - int32_t startIndex = rounds * width; - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.dsum += plist[j + startIndex]; - } -#endif -} - -static void i8VectorSumAVX2(const int8_t* plist, int32_t numOfRows, int32_t type, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX2__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth>>3u) / sizeof(int64_t); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - __m256i sum = _mm256_setzero_si256(); - - if (type == TSDB_DATA_TYPE_TINYINT) { - const int8_t* p = plist; - - for (int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepi8_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const int64_t* q = (const int64_t*)∑ - pRes->sum.isum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.isum += plist[j + rounds * width]; - } - } else { - const uint8_t* p = (const uint8_t*)plist; - - for(int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepu8_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const uint64_t* q = (const uint64_t*)∑ - pRes->sum.usum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.usum += (uint8_t)plist[j + rounds * width]; - } - } - -#endif -} - -static void i16VectorSumAVX2(const int16_t* plist, int32_t numOfRows, int32_t type, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX2__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth>>3u) / sizeof(int64_t); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - __m256i sum = _mm256_setzero_si256(); - - if (type == TSDB_DATA_TYPE_SMALLINT) { - const int16_t* p = plist; - - for (int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepi16_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const int64_t* q = (const int64_t*)∑ - pRes->sum.isum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.isum += plist[j + rounds * width]; - } - } else { - const uint16_t* p = (const uint16_t*)plist; - - for(int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepu16_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const uint64_t* q = (const uint64_t*)∑ - pRes->sum.usum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.usum += (uint16_t)plist[j + rounds * width]; - } - } - -#endif -} - -static void i32VectorSumAVX2(const int32_t* plist, int32_t numOfRows, int32_t type, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX2__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth>>3u) / sizeof(int64_t); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - __m256i sum = _mm256_setzero_si256(); - - if (type == TSDB_DATA_TYPE_INT) { - const int32_t* p = plist; - - for (int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepi32_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const int64_t* q = (const int64_t*)∑ - pRes->sum.isum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.isum += plist[j + rounds * width]; - } - } else { - const uint32_t* p = (const uint32_t*)plist; - - for(int32_t i = 0; i < rounds; ++i) { - __m128i val = _mm_lddqu_si128((__m128i*)p); - __m256i extVal = _mm256_cvtepu32_epi64(val); // only four items will be converted into __m256i - sum = _mm256_add_epi64(sum, extVal); - p += width; - } - - // let sum up the final results - const uint64_t* q = (const uint64_t*)∑ - pRes->sum.usum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.usum += (uint32_t)plist[j + rounds * width]; - } - } - -#endif -} - -static void i64VectorSumAVX2(const int64_t* plist, int32_t numOfRows, SAvgRes* pRes) { - const int32_t bitWidth = 256; - -#if __AVX2__ - // find the start position that are aligned to 32bytes address in memory - int32_t width = (bitWidth >> 3u) / sizeof(int64_t); - - int32_t remainder = numOfRows % width; - int32_t rounds = numOfRows / width; - - __m256i sum = _mm256_setzero_si256(); - - const int64_t* p = plist; - - for (int32_t i = 0; i < rounds; ++i) { - __m256i val = _mm256_lddqu_si256((__m256i*)p); - sum = _mm256_add_epi64(sum, val); - p += width; - } - - // let sum up the final results - const int64_t* q = (const int64_t*)∑ - pRes->sum.isum += q[0] + q[1] + q[2] + q[3]; - - for (int32_t j = 0; j < remainder; ++j) { - pRes->sum.isum += plist[j + rounds * width]; - } - -#endif -} - int32_t getAvgInfoSize() { return (int32_t)sizeof(SAvgRes); } bool getAvgFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { @@ -561,23 +313,16 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { numOfElem = pInput->numOfRows; pAvgRes->count += pInput->numOfRows; - bool simdAvailable = tsAVXSupported && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE); - switch(type) { case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_TINYINT: { const int8_t* plist = (const int8_t*) pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable) { - i8VectorSumAVX2(plist, numOfRows, type, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - if (type == TSDB_DATA_TYPE_TINYINT) { - CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) - } else { - CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint8_t)plist[i]) - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + if (type == TSDB_DATA_TYPE_TINYINT) { + CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) + } else { + CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint8_t)plist[i]) } } break; @@ -587,16 +332,11 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { case TSDB_DATA_TYPE_SMALLINT: { const int16_t* plist = (const int16_t*)pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable) { - i16VectorSumAVX2(plist, numOfRows, type, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - if (type == TSDB_DATA_TYPE_SMALLINT) { - CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) - } else { - CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint16_t)plist[i]) - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + if (type == TSDB_DATA_TYPE_SMALLINT) { + CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) + } else { + CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint16_t)plist[i]) } } break; @@ -606,16 +346,11 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { case TSDB_DATA_TYPE_INT: { const int32_t* plist = (const int32_t*) pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable) { - i32VectorSumAVX2(plist, numOfRows, type, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - if (type == TSDB_DATA_TYPE_INT) { - CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) - } else { - CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint32_t)plist[i]) - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + if (type == TSDB_DATA_TYPE_INT) { + CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) + } else { + CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint32_t)plist[i]) } } break; @@ -625,16 +360,11 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { case TSDB_DATA_TYPE_BIGINT: { const int64_t* plist = (const int64_t*) pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable && type == TSDB_DATA_TYPE_BIGINT) { - i64VectorSumAVX2(plist, numOfRows, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - if (type == TSDB_DATA_TYPE_BIGINT) { - CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) - } else { - CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint64_t)plist[i]) - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + if (type == TSDB_DATA_TYPE_BIGINT) { + CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) + } else { + CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint64_t)plist[i]) } } break; @@ -643,26 +373,16 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { case TSDB_DATA_TYPE_FLOAT: { const float* plist = (const float*) pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable) { - floatVectorSumAVX(plist, numOfRows, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - pAvgRes->sum.dsum += plist[i]; - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + pAvgRes->sum.dsum += plist[i]; } break; } case TSDB_DATA_TYPE_DOUBLE: { const double* plist = (const double*)pCol->pData; - // 1. If the CPU supports AVX, let's employ AVX instructions to speedup this loop - if (simdAvailable) { - doubleVectorSumAVX(plist, numOfRows, pAvgRes); - } else { - for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { - pAvgRes->sum.dsum += plist[i]; - } + for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { + pAvgRes->sum.dsum += plist[i]; } break; } diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c index e3c12e9a57..69c1a8a6dd 100644 --- a/source/libs/function/src/detail/tminmax.c +++ b/source/libs/function/src/detail/tminmax.c @@ -72,6 +72,7 @@ #define GET_INVOKE_INTRINSIC_THRESHOLD(_bits, _bytes) ((_bits) / ((_bytes) << 3u)) +#ifdef __AVX2__ static void calculateRounds(int32_t numOfRows, int32_t bytes, int32_t* remainder, int32_t* rounds, int32_t* width) { const int32_t bitWidth = 256; @@ -81,224 +82,104 @@ static void calculateRounds(int32_t numOfRows, int32_t bytes, int32_t* remainder } #define EXTRACT_MAX_VAL(_first, _sec, _width, _remain, _v) \ - (_v) = TMAX((_first)[0], (_first)[1]); \ - for (int32_t k = 1; k < (_width); ++k) { \ - (_v) = TMAX((_v), (_first)[k]); \ - } \ - \ - for (int32_t j = 0; j < (_remain); ++j) { \ - if ((_v) < (_sec)[j]) { \ - (_v) = (_sec)[j]; \ - } \ - } + __COMPARE_EXTRACT_MAX(0, (_width), (_v), (_first)) \ + __COMPARE_EXTRACT_MAX(0, (_remain), (_v), (_sec)) #define EXTRACT_MIN_VAL(_first, _sec, _width, _remain, _v) \ - (_v) = TMIN((_first)[0], (_first)[1]); \ - for (int32_t k = 1; k < (_width); ++k) { \ - (_v) = TMIN((_v), (_first)[k]); \ - } \ - \ - for (int32_t j = 0; j < (_remain); ++j) { \ - if ((_v) > (_sec)[j]) { \ - (_v) = (_sec)[j]; \ - } \ - } + __COMPARE_EXTRACT_MIN(0, (_width), (_v), (_first)) \ + __COMPARE_EXTRACT_MIN(0, (_remain), (_v), (_sec)) -static int8_t i8VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal) { - int8_t v = 0; +#define CMP_TYPE_MIN_MAX(type, cmp) \ + const type* p = pData; \ + __m256i initVal = _mm256_lddqu_si256((__m256i*)p); \ + p += width; \ + for (int32_t i = 1; i < (rounds); ++i) { \ + __m256i next = _mm256_lddqu_si256((__m256i*)p); \ + initVal = CMP_FUNC_##cmp##_##type(initVal, next); \ + p += width; \ + } \ + const type* q = (const type*)&initVal; \ + type* v = (type*)res; \ + EXTRACT_##cmp##_VAL(q, p, width, remain, *v) + +static void i8VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) { const int8_t* p = pData; int32_t width, remain, rounds; calculateRounds(numOfRows, sizeof(int8_t), &remain, &rounds, &width); -#if __AVX2__ - __m256i next; - __m256i initVal = _mm256_lddqu_si256((__m256i*)p); - p += width; +#define CMP_FUNC_MIN_int8_t _mm256_min_epi8 +#define CMP_FUNC_MAX_int8_t _mm256_max_epi8 +#define CMP_FUNC_MIN_uint8_t _mm256_min_epu8 +#define CMP_FUNC_MAX_uint8_t _mm256_max_epu8 if (!isMinFunc) { // max function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epi8(initVal, next); - p += width; - } - - const int8_t* q = (const int8_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) - } else { // unsigned value - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epu8(initVal, next); - p += width; - } - - const uint8_t* q = (const uint8_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int8_t, MAX); + } else { + CMP_TYPE_MIN_MAX(uint8_t, MAX); } - } else { // min function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epi8(initVal, next); - p += width; - } - - // let sum up the final results - const int8_t* q = (const int8_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int8_t, MIN); } else { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epu8(initVal, next); - p += width; - } - - // let sum up the final results - const uint8_t* q = (const uint8_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(uint8_t, MIN); } } -#endif - - return v; } -static int16_t i16VectorCmpAVX2(const int16_t* pData, int32_t numOfRows, bool isMinFunc, bool signVal) { - int16_t v = 0; - const int16_t* p = pData; - +static void i16VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) { int32_t width, remain, rounds; calculateRounds(numOfRows, sizeof(int16_t), &remain, &rounds, &width); -#if __AVX2__ - __m256i next; - __m256i initVal = _mm256_lddqu_si256((__m256i*)p); - p += width; - +#define CMP_FUNC_MIN_int16_t _mm256_min_epi16 +#define CMP_FUNC_MAX_int16_t _mm256_max_epi16 +#define CMP_FUNC_MIN_uint16_t _mm256_min_epu16 +#define CMP_FUNC_MAX_uint16_t _mm256_max_epu16 if (!isMinFunc) { // max function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epi16(initVal, next); - p += width; - } - - // let sum up the final results - const int16_t* q = (const int16_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int16_t, MAX); } else { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epu16(initVal, next); - p += width; - } - - // let sum up the final results - const uint16_t* q = (const uint16_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(uint16_t, MAX); } - } else { // min function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epi16(initVal, next); - p += width; - } - - // let sum up the final results - const int16_t* q = (const int16_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int16_t, MIN); } else { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epi16(initVal, next); - p += width; - } - - // let sum up the final results - const uint16_t* q = (const uint16_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(uint16_t, MIN); } } -#endif - - return v; } -static int32_t i32VectorCmpAVX2(const int32_t* pData, int32_t numOfRows, bool isMinFunc, bool signVal) { - int32_t v = 0; - const int32_t* p = pData; - +static void i32VectorCmpAVX2(const void* pData, int32_t numOfRows, bool isMinFunc, bool signVal, int64_t* res) { int32_t width, remain, rounds; calculateRounds(numOfRows, sizeof(int32_t), &remain, &rounds, &width); -#if __AVX2__ - __m256i next; - __m256i initVal = _mm256_lddqu_si256((__m256i*)p); - p += width; - +#define CMP_FUNC_MIN_int32_t _mm256_min_epi32 +#define CMP_FUNC_MAX_int32_t _mm256_max_epi32 +#define CMP_FUNC_MIN_uint32_t _mm256_min_epu32 +#define CMP_FUNC_MAX_uint32_t _mm256_max_epu32 if (!isMinFunc) { // max function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epi32(initVal, next); - p += width; - } - - // let compare the final results - const int32_t* q = (const int32_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) - } else { // unsigned value - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_max_epi32(initVal, next); - p += width; - } - - // let compare the final results - const uint32_t* q = (const uint32_t*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int32_t, MAX); + } else { + CMP_TYPE_MIN_MAX(uint32_t, MAX); } } else { // min function if (signVal) { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epi32(initVal, next); - p += width; - } - - // let sum up the final results - const int32_t* q = (const int32_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(int32_t, MIN); } else { - for (int32_t i = 0; i < rounds; ++i) { - next = _mm256_lddqu_si256((__m256i*)p); - initVal = _mm256_min_epu32(initVal, next); - p += width; - } - - // let sum up the final results - const uint32_t* q = (const uint32_t*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + CMP_TYPE_MIN_MAX(uint32_t, MIN); } } -#endif - - return v; } -static float floatVectorCmpAVX(const float* pData, int32_t numOfRows, bool isMinFunc) { - float v = 0; +static void floatVectorCmpAVX2(const float* pData, int32_t numOfRows, bool isMinFunc, float* res) { const float* p = pData; int32_t width, remain, rounds; calculateRounds(numOfRows, sizeof(float), &remain, &rounds, &width); -#if __AVX__ - __m256 next; __m256 initVal = _mm256_loadu_ps(p); p += width; @@ -311,7 +192,7 @@ static float floatVectorCmpAVX(const float* pData, int32_t numOfRows, bool isMin } const float* q = (const float*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + EXTRACT_MAX_VAL(q, p, width, remain, *res) } else { // min function for (int32_t i = 1; i < rounds; ++i) { next = _mm256_loadu_ps(p); @@ -320,22 +201,16 @@ static float floatVectorCmpAVX(const float* pData, int32_t numOfRows, bool isMin } const float* q = (const float*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + EXTRACT_MIN_VAL(q, p, width, remain, *res) } -#endif - - return v; } -static double doubleVectorCmpAVX(const double* pData, int32_t numOfRows, bool isMinFunc) { - double v = 0; +static void doubleVectorCmpAVX2(const double* pData, int32_t numOfRows, bool isMinFunc, double* res) { const double* p = pData; int32_t width, remain, rounds; calculateRounds(numOfRows, sizeof(double), &remain, &rounds, &width); -#if __AVX__ - __m256d next; __m256d initVal = _mm256_loadu_pd(p); p += width; @@ -349,7 +224,7 @@ static double doubleVectorCmpAVX(const double* pData, int32_t numOfRows, bool is // let sum up the final results const double* q = (const double*)&initVal; - EXTRACT_MAX_VAL(q, p, width, remain, v) + EXTRACT_MAX_VAL(q, p, width, remain, *res) } else { // min function for (int32_t i = 1; i < rounds; ++i) { next = _mm256_loadu_pd(p); @@ -359,12 +234,10 @@ static double doubleVectorCmpAVX(const double* pData, int32_t numOfRows, bool is // let sum up the final results const double* q = (const double*)&initVal; - EXTRACT_MIN_VAL(q, p, width, remain, v) + EXTRACT_MIN_VAL(q, p, width, remain, *res) } -#endif - - return v; } +#endif static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, int32_t numOfRows, bool isStr) { int32_t i = start; @@ -378,14 +251,17 @@ static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { - // AVX2 version to speedup the loop - if (tsAVX2Supported && tsSIMDEnable) { - pBuf->v = i8VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); - } else { - if (!pBuf->assign) { - pBuf->v = ((int8_t*)data)[start]; - } + if (!pBuf->assign) { + pBuf->v = ((const int8_t*)data)[start]; + } +#ifdef __AVX2__ + if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int8_t) >= sizeof(__m256i)) { + i8VectorCmpAVX2(data + start * sizeof(int8_t), numOfRows, isMinFunc, signVal, &pBuf->v); + } else { +#else + if (true) { +#endif if (signVal) { const int8_t* p = (const int8_t*)data; int8_t* v = (int8_t*)&pBuf->v; @@ -412,14 +288,17 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { - // AVX2 version to speedup the loop - if (tsAVX2Supported && tsSIMDEnable) { - pBuf->v = i16VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); - } else { - if (!pBuf->assign) { - pBuf->v = ((int16_t*)data)[start]; - } + if (!pBuf->assign) { + pBuf->v = ((const int16_t*)data)[start]; + } +#ifdef __AVX2__ + if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int16_t) >= sizeof(__m256i)) { + i16VectorCmpAVX2(data + start * sizeof(int16_t), numOfRows, isMinFunc, signVal, &pBuf->v); + } else { +#else + if (true) { +#endif if (signVal) { const int16_t* p = (const int16_t*)data; int16_t* v = (int16_t*)&pBuf->v; @@ -446,14 +325,17 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { - // AVX2 version to speedup the loop - if (tsAVX2Supported && tsSIMDEnable) { - pBuf->v = i32VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); - } else { - if (!pBuf->assign) { - pBuf->v = ((int32_t*)data)[start]; - } + if (!pBuf->assign) { + pBuf->v = ((const int32_t*)data)[start]; + } +#ifdef __AVX2__ + if (tsAVX2Supported && tsSIMDEnable && numOfRows * sizeof(int32_t) >= sizeof(__m256i)) { + i32VectorCmpAVX2(data + start * sizeof(int32_t), numOfRows, isMinFunc, signVal, &pBuf->v); + } else { +#else + if (true) { +#endif if (signVal) { const int32_t* p = (const int32_t*)data; int32_t* v = (int32_t*)&pBuf->v; @@ -481,7 +363,7 @@ static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, S static void handleInt64Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { if (!pBuf->assign) { - pBuf->v = ((int64_t*)data)[start]; + pBuf->v = ((const int64_t*)data)[start]; } if (signVal) { @@ -503,33 +385,29 @@ static void handleInt64Col(const void* data, int32_t start, int32_t numOfRows, S __COMPARE_EXTRACT_MAX(start, start + numOfRows, *v, p); } } + + pBuf->assign = true; } static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc) { float* pData = (float*)pCol->pData; float* val = (float*)&pBuf->v; + if (!pBuf->assign) { + *val = pData[start]; + } - // AVX version to speedup the loop - if (tsAVXSupported && tsSIMDEnable) { - *val = floatVectorCmpAVX(pData, numOfRows, isMinFunc); +#ifdef __AVX2__ + if (tsAVXSupported && tsSIMDEnable && numOfRows * sizeof(float) >= sizeof(__m256i)) { + floatVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val); } else { - if (!pBuf->assign) { - *val = pData[start]; - } - +#else + if (true) { +#endif if (isMinFunc) { // min - for (int32_t i = start; i < start + numOfRows; ++i) { - if (*val > pData[i]) { - *val = pData[i]; - } - } + __COMPARE_EXTRACT_MIN(start, start + numOfRows, *val, pData); } else { // max - for (int32_t i = start; i < start + numOfRows; ++i) { - if (*val < pData[i]) { - *val = pData[i]; - } - } + __COMPARE_EXTRACT_MAX(start, start + numOfRows, *val, pData); } } @@ -540,27 +418,21 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR bool isMinFunc) { double* pData = (double*)pCol->pData; double* val = (double*)&pBuf->v; + if (!pBuf->assign) { + *val = pData[start]; + } - // AVX version to speedup the loop - if (tsAVXSupported && tsSIMDEnable) { - *val = (double)doubleVectorCmpAVX(pData, numOfRows, isMinFunc); +#ifdef __AVX2__ + if (tsAVXSupported && tsSIMDEnable && numOfRows * sizeof(double) >= sizeof(__m256i)) { + doubleVectorCmpAVX2(pData + start, numOfRows, isMinFunc, val); } else { - if (!pBuf->assign) { - *val = pData[start]; - } - +#else + if (true) { +#endif if (isMinFunc) { // min - for (int32_t i = start; i < start + numOfRows; ++i) { - if (*val > pData[i]) { - *val = pData[i]; - } - } + __COMPARE_EXTRACT_MIN(start, start + numOfRows, *val, pData); } else { // max - for (int32_t i = start; i < start + numOfRows; ++i) { - if (*val < pData[i]) { - *val = pData[i]; - } - } + __COMPARE_EXTRACT_MAX(start, start + numOfRows, *val, pData); } } @@ -581,7 +453,7 @@ static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, c } static int32_t doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFunctionCtx* pCtx, SMinmaxResInfo* pBuf, - bool isMinFunc) { + bool isMinFunc) { if (isMinFunc) { switch (pCol->info.type) { case TSDB_DATA_TYPE_BOOL: @@ -652,8 +524,8 @@ static int32_t doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFu if (colDataIsNull_var(pCol, i)) { continue; } - char *pLeft = (char *)colDataGetData(pCol, i); - char *pRight = (char *)pBuf->str; + char* pLeft = (char*)colDataGetData(pCol, i); + char* pRight = (char*)pBuf->str; int32_t ret = compareLenBinaryVal(pLeft, pRight); if (ret < 0) { @@ -674,8 +546,8 @@ static int32_t doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFu if (colDataIsNull_var(pCol, i)) { continue; } - char *pLeft = (char *)colDataGetData(pCol, i); - char *pRight = (char *)pBuf->str; + char* pLeft = (char*)colDataGetData(pCol, i); + char* pRight = (char*)pBuf->str; int32_t ret = compareLenPrefixedWStr(pLeft, pRight); if (ret < 0) { @@ -761,8 +633,8 @@ static int32_t doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFu if (colDataIsNull_var(pCol, i)) { continue; } - char *pLeft = (char *)colDataGetData(pCol, i); - char *pRight = (char *)pBuf->str; + char* pLeft = (char*)colDataGetData(pCol, i); + char* pRight = (char*)pBuf->str; int32_t ret = compareLenBinaryVal(pLeft, pRight); if (ret > 0) { @@ -784,8 +656,8 @@ static int32_t doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFu if (colDataIsNull_var(pCol, i)) { continue; } - char *pLeft = (char *)colDataGetData(pCol, i); - char *pRight = (char *)pBuf->str; + char* pLeft = (char*)colDataGetData(pCol, i); + char* pRight = (char*)pBuf->str; int32_t ret = compareLenPrefixedWStr(pLeft, pRight); if (ret > 0) { @@ -838,7 +710,6 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) // data in current data block are qualified to the query if (pInput->colDataSMAIsSet && !IS_STR_DATA_TYPE(type)) { - numOfElems = pInput->numOfRows - pAgg->numOfNull; if (numOfElems == 0) { goto _over; diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index 14efa1b534..a3791eb026 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -37,7 +37,7 @@ float tsNumOfCores = 0; int64_t tsTotalMemoryKB = 0; char *tsProcPath = NULL; -char tsSIMDEnable = 0; +char tsSIMDEnable = 1; char tsAVX512Enable = 0; char tsSSE42Supported = 0; char tsAVXSupported = 0; diff --git a/source/os/src/osMemory.c b/source/os/src/osMemory.c index 49a5c2a2a2..c084b76485 100644 --- a/source/os/src/osMemory.c +++ b/source/os/src/osMemory.c @@ -168,7 +168,7 @@ void startTrace() { Dwarf_Ptr errarg = 0; FILE *fp = fopen("/proc/self/maps", "r"); - fscanf(fp, "%lx-", &addr); + ret = fscanf(fp, "%lx-", &addr); fclose(fp); ret = dwarf_init_path("/proc/self/exe", NULL, 0, DW_GROUPNUMBER_ANY, NULL, errarg, &tDbg, NULL); diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index 288d440d86..9c9ded693e 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -64,29 +64,33 @@ #include "td_sz.h" int32_t tsCompressPlain2(const char *const input, const int32_t nelements, char *const output, const char type); -int32_t tsDecompressPlain2(const char *const input, const int32_t nelements, char *const output, const char type); +int32_t tsDecompressPlain2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + const char type); // delta int32_t tsCompressTimestampImp2(const char *const input, const int32_t nelements, char *const output, const char type); -int32_t tsDecompressTimestampImp2(const char *const input, const int32_t nelements, char *const output, +int32_t tsDecompressTimestampImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, const char type); // simple8b int32_t tsCompressINTImp2(const char *const input, const int32_t nelements, char *const output, const char type); -int32_t tsDecompressINTImp2(const char *const input, const int32_t nelements, char *const output, const char type); +int32_t tsDecompressINTImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + const char type); // bit int32_t tsCompressBoolImp2(const char *const input, const int32_t nelements, char *const output, char const type); -int32_t tsDecompressBoolImp2(const char *const input, const int32_t nelements, char *const output, char const type); +int32_t tsDecompressBoolImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + char const type); // double specail int32_t tsCompressDoubleImp2(const char *const input, const int32_t nelements, char *const output, char const type); -int32_t tsDecompressDoubleImp2(const char *const input, const int32_t nelements, char *const output, char const type); +int32_t tsDecompressDoubleImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + char const type); int32_t tsCompressDoubleImp(const char *const input, const int32_t nelements, char *const output); -int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements, char *const output); +int32_t tsDecompressDoubleImp(const char *const input, int32_t ninput, const int32_t nelements, char *const output); int32_t tsCompressFloatImp(const char *const input, const int32_t nelements, char *const output); -int32_t tsDecompressFloatImp(const char *const input, const int32_t nelements, char *const output); +int32_t tsDecompressFloatImp(const char *const input, int32_t ninput, const int32_t nelements, char *const output); int32_t l2ComressInitImpl_disabled(char *lossyColumns, float fPrecision, double dPrecision, uint32_t maxIntervals, uint32_t intervals, int32_t ifAdtFse, const char *compressor) { @@ -457,8 +461,8 @@ int32_t tsCompressINTImp(const char *const input, const int32_t nelements, char int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, char *const output, const char type) { int32_t word_length = getWordLength(type); - if (word_length == -1) { - return word_length; + if (word_length < 0) { + return -1; } // If not compressed. @@ -467,70 +471,106 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha return nelements * word_length; } -#if __AVX2__ - tsDecompressIntImpl_Hw(input, nelements, output, type); - return nelements * word_length; -#else +#ifdef __AVX512F__ + if (tsSIMDEnable && tsAVX512Enable && tsAVX512Supported) { + tsDecompressIntImpl_Hw(input, nelements, output, type); + return nelements * word_length; + } +#endif + // Selector value: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 char bit_per_integer[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 30, 60}; int32_t selector_to_elems[] = {240, 120, 60, 30, 20, 15, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1}; const char *ip = input + 1; + char *op = output; int32_t count = 0; - int32_t _pos = 0; int64_t prev_value = 0; - while (1) { - if (count == nelements) break; - - uint64_t w = 0; - memcpy(&w, ip, LONG_BYTES); + while (count < nelements) { + uint64_t w = *(uint64_t *)ip; char selector = (char)(w & INT64MASK(4)); // selector = 4 char bit = bit_per_integer[(int32_t)selector]; // bit = 3 int32_t elems = selector_to_elems[(int32_t)selector]; - for (int32_t i = 0; i < elems; i++) { - uint64_t zigzag_value; - - if (selector == 0 || selector == 1) { - zigzag_value = 0; - } else { - zigzag_value = ((w >> (4 + bit * i)) & INT64MASK(bit)); + switch (type) { + case TSDB_DATA_TYPE_BIGINT: { + int64_t *out = (int64_t *)op; + if (selector == 0 || selector == 1) { + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + *out = prev_value; + } + } else { + uint64_t zigzag_value = 0; + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + zigzag_value = ((w >> (4 + bit * i)) & INT64MASK(bit)); + prev_value += ZIGZAG_DECODE(int64_t, zigzag_value); + *out = prev_value; + } + } + op = (char *)out; + break; } - int64_t diff = ZIGZAG_DECODE(int64_t, zigzag_value); - int64_t curr_value = diff + prev_value; - prev_value = curr_value; - - switch (type) { - case TSDB_DATA_TYPE_BIGINT: - *((int64_t *)output + _pos) = (int64_t)curr_value; - _pos++; - break; - case TSDB_DATA_TYPE_INT: - *((int32_t *)output + _pos) = (int32_t)curr_value; - _pos++; - break; - case TSDB_DATA_TYPE_SMALLINT: - *((int16_t *)output + _pos) = (int16_t)curr_value; - _pos++; - break; - case TSDB_DATA_TYPE_TINYINT: - *((int8_t *)output + _pos) = (int8_t)curr_value; - _pos++; - break; - default: - perror("Wrong integer types.\n"); - return -1; + case TSDB_DATA_TYPE_INT: { + int32_t *out = (int32_t *)op; + if (selector == 0 || selector == 1) { + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + *out = (int32_t)prev_value; + } + } else { + uint64_t zigzag_value = 0; + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + zigzag_value = ((w >> (4 + bit * i)) & INT64MASK(bit)); + prev_value += ZIGZAG_DECODE(int64_t, zigzag_value); + *out = (int32_t)prev_value; + } + } + op = (char *)out; + break; } - count++; - if (count == nelements) break; + case TSDB_DATA_TYPE_SMALLINT: { + int16_t *out = (int16_t *)op; + if (selector == 0 || selector == 1) { + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + *out = (int16_t)prev_value; + } + } else { + uint64_t zigzag_value = 0; + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + zigzag_value = ((w >> (4 + bit * i)) & INT64MASK(bit)); + prev_value += ZIGZAG_DECODE(int64_t, zigzag_value); + *out = (int16_t)prev_value; + } + } + op = (char *)out; + break; + } + case TSDB_DATA_TYPE_TINYINT: { + int8_t *out = (int8_t *)op; + if (selector == 0 || selector == 1) { + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + *out = (int8_t)prev_value; + } + } else { + uint64_t zigzag_value = 0; + for (int32_t i = 0; i < elems && count < nelements; ++i, ++count, ++out) { + zigzag_value = ((w >> (4 + bit * i)) & INT64MASK(bit)); + prev_value += ZIGZAG_DECODE(int64_t, zigzag_value); + *out = (int8_t)prev_value; + } + } + op = (char *)out; + break; + } + default: + perror("Wrong integer types.\n"); + return -1; } ip += LONG_BYTES; } return nelements * word_length; -#endif } /* ----------------------------------------------Bool Compression ---------------------------------------------- */ @@ -590,7 +630,8 @@ int32_t tsDecompressBoolImp(const char *const input, const int32_t nelements, ch int32_t tsCompressBoolImp2(const char *const input, const int32_t nelements, char *const output, char const type) { return tsCompressBoolImp(input, nelements, output); } -int32_t tsDecompressBoolImp2(const char *const input, const int32_t nelements, char *const output, char const type) { +int32_t tsDecompressBoolImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + char const type) { return tsDecompressBoolImp(input, nelements, output); } @@ -602,18 +643,20 @@ int32_t tsCompressDoubleImp2(const char *const input, const int32_t nelements, c } return TSDB_CODE_THIRDPARTY_ERROR; } -int32_t tsDecompressDoubleImp2(const char *const input, const int32_t nelements, char *const output, char const type) { +int32_t tsDecompressDoubleImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + char const type) { if (type == TSDB_DATA_TYPE_FLOAT) { - return tsDecompressFloatImp(input, nelements, output); + return tsDecompressFloatImp(input, ninput, nelements, output); } else if (type == TSDB_DATA_TYPE_DOUBLE) { - return tsDecompressDoubleImp(input, nelements, output); + return tsDecompressDoubleImp(input, ninput, nelements, output); } return TSDB_CODE_THIRDPARTY_ERROR; } int32_t tsCompressINTImp2(const char *const input, const int32_t nelements, char *const output, const char type) { return tsCompressINTImp(input, nelements, output, type); } -int32_t tsDecompressINTImp2(const char *const input, const int32_t nelements, char *const output, const char type) { +int32_t tsDecompressINTImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + const char type) { return tsDecompressINTImp(input, nelements, output, type); } @@ -824,67 +867,68 @@ int32_t tsDecompressTimestampImp(const char *const input, const int32_t nelement memcpy(output, input + 1, nelements * longBytes); return nelements * longBytes; } else if (input[0] == 1) { // Decompress - if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { - tsDecompressTimestampAvx512(input, nelements, output, false); - } else if (tsSIMDEnable && tsAVX2Supported) { - tsDecompressTimestampAvx2(input, nelements, output, false); - } else { - int64_t *ostream = (int64_t *)output; +#ifdef __AVX512VL__ + if (tsSIMDEnable && tsAVX512Enable && tsAVX512Supported) { + tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool bigEndian); + return nelements * longBytes; + } +#endif - int32_t ipos = 1, opos = 0; - int8_t nbytes = 0; - int64_t prev_value = 0; - int64_t prev_delta = 0; - int64_t delta_of_delta = 0; + int64_t *ostream = (int64_t *)output; - while (1) { - uint8_t flags = input[ipos++]; - // Decode dd1 - uint64_t dd1 = 0; - nbytes = flags & INT8MASK(4); - if (nbytes == 0) { - delta_of_delta = 0; + int32_t ipos = 1, opos = 0; + int8_t nbytes = 0; + int64_t prev_value = 0; + int64_t prev_delta = 0; + int64_t delta_of_delta = 0; + + while (1) { + uint8_t flags = input[ipos++]; + // Decode dd1 + uint64_t dd1 = 0; + nbytes = flags & INT8MASK(4); + if (nbytes == 0) { + delta_of_delta = 0; + } else { + if (is_bigendian()) { + memcpy(((char *)(&dd1)) + longBytes - nbytes, input + ipos, nbytes); } else { - if (is_bigendian()) { - memcpy(((char *)(&dd1)) + longBytes - nbytes, input + ipos, nbytes); - } else { - memcpy(&dd1, input + ipos, nbytes); - } - delta_of_delta = ZIGZAG_DECODE(int64_t, dd1); + memcpy(&dd1, input + ipos, nbytes); } + delta_of_delta = ZIGZAG_DECODE(int64_t, dd1); + } - ipos += nbytes; - if (opos == 0) { - prev_value = delta_of_delta; - prev_delta = 0; - ostream[opos++] = delta_of_delta; - } else { - prev_delta = delta_of_delta + prev_delta; - prev_value = prev_value + prev_delta; - ostream[opos++] = prev_value; - } - if (opos == nelements) return nelements * longBytes; - - // Decode dd2 - uint64_t dd2 = 0; - nbytes = (flags >> 4) & INT8MASK(4); - if (nbytes == 0) { - delta_of_delta = 0; - } else { - if (is_bigendian()) { - memcpy(((char *)(&dd2)) + longBytes - nbytes, input + ipos, nbytes); - } else { - memcpy(&dd2, input + ipos, nbytes); - } - // zigzag_decoding - delta_of_delta = ZIGZAG_DECODE(int64_t, dd2); - } - ipos += nbytes; + ipos += nbytes; + if (opos == 0) { + prev_value = delta_of_delta; + prev_delta = 0; + ostream[opos++] = delta_of_delta; + } else { prev_delta = delta_of_delta + prev_delta; prev_value = prev_value + prev_delta; ostream[opos++] = prev_value; - if (opos == nelements) return nelements * longBytes; } + if (opos == nelements) return nelements * longBytes; + + // Decode dd2 + uint64_t dd2 = 0; + nbytes = (flags >> 4) & INT8MASK(4); + if (nbytes == 0) { + delta_of_delta = 0; + } else { + if (is_bigendian()) { + memcpy(((char *)(&dd2)) + longBytes - nbytes, input + ipos, nbytes); + } else { + memcpy(&dd2, input + ipos, nbytes); + } + // zigzag_decoding + delta_of_delta = ZIGZAG_DECODE(int64_t, dd2); + } + ipos += nbytes; + prev_delta = delta_of_delta + prev_delta; + prev_value = prev_value + prev_delta; + ostream[opos++] = prev_value; + if (opos == nelements) return nelements * longBytes; } } @@ -897,7 +941,8 @@ int32_t tsCompressPlain2(const char *const input, const int32_t nelements, char memcpy(output + 1, input, bytes); return bytes + 1; } -int32_t tsDecompressPlain2(const char *const input, const int32_t nelements, char *const output, const char type) { +int32_t tsDecompressPlain2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, + const char type) { int32_t bytes = tDataTypes[type].bytes * nelements; memcpy(output, input + 1, bytes); return bytes; @@ -905,7 +950,7 @@ int32_t tsDecompressPlain2(const char *const input, const int32_t nelements, cha int32_t tsCompressTimestampImp2(const char *const input, const int32_t nelements, char *const output, const char type) { return tsCompressTimestampImp(input, nelements, output); } -int32_t tsDecompressTimestampImp2(const char *const input, const int32_t nelements, char *const output, +int32_t tsDecompressTimestampImp2(const char *const input, int32_t ninput, const int32_t nelements, char *const output, const char type) { return tsDecompressTimestampImp(input, nelements, output); } @@ -1023,17 +1068,10 @@ FORCE_INLINE uint64_t decodeDoubleValue(const char *const input, int32_t *const return diff; } -int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements, char *const output) { - // output stream - double *ostream = (double *)output; - - if (input[0] == 1) { - memcpy(output, input + 1, nelements * DOUBLE_BYTES); - return nelements * DOUBLE_BYTES; - } - +static int32_t tsDecompressDoubleImpHelper(const char *input, int32_t nelements, char *output) { + double *ostream = (double *)output; uint8_t flags = 0; - int32_t ipos = 1; + int32_t ipos = 0; int32_t opos = 0; uint64_t diff = 0; union { @@ -1048,7 +1086,7 @@ int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements, flags = input[ipos++]; } - diff = decodeDoubleValue(input, &ipos, flags & 0x0f); + diff = decodeDoubleValue(input, &ipos, flags & INT8MASK(4)); flags >>= 4; curr.bits ^= diff; @@ -1058,6 +1096,25 @@ int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements, return nelements * DOUBLE_BYTES; } +int32_t tsDecompressDoubleImp(const char *const input, int32_t ninput, const int32_t nelements, char *const output) { + // return the result directly if there is no compression + if (input[0] == 1) { + memcpy(output, input + 1, nelements * DOUBLE_BYTES); + return nelements * DOUBLE_BYTES; + } + +#ifdef __AVX2__ + // use AVX2 implementation when allowed and the compression ratio is not high + double compressRatio = 1.0 * nelements * DOUBLE_BYTES / ninput; + if (tsSIMDEnable && tsAVX2Supported && compressRatio < 2) { + return tsDecompressDoubleImpAvx2(input + 1, nelements, output); + } +#endif + + // use implementation without SIMD instructions by default + return tsDecompressDoubleImpHelper(input + 1, nelements, output); +} + /* --------------------------------------------Float Compression ---------------------------------------------- */ void encodeFloatValue(uint32_t diff, uint8_t flag, char *const output, int32_t *const pos) { uint8_t nbytes = (flag & INT8MASK(3)) + 1; @@ -1166,49 +1223,50 @@ uint32_t decodeFloatValue(const char *const input, int32_t *const ipos, uint8_t return diff; } -static void tsDecompressFloatHelper(const char *const input, const int32_t nelements, float *ostream) { +static int32_t tsDecompressFloatImpHelper(const char *input, int32_t nelements, char *output) { + float *ostream = (float *)output; uint8_t flags = 0; - int32_t ipos = 1; + int32_t ipos = 0; int32_t opos = 0; - uint32_t prev_value = 0; + uint32_t diff = 0; + union { + uint32_t bits; + float real; + } curr; + + curr.bits = 0; for (int32_t i = 0; i < nelements; i++) { if (i % 2 == 0) { flags = input[ipos++]; } - uint8_t flag = flags & INT8MASK(4); + diff = decodeFloatValue(input, &ipos, flags & INT8MASK(4)); flags >>= 4; - - uint32_t diff = decodeFloatValue(input, &ipos, flag); - union { - uint32_t bits; - float real; - } curr; - - uint32_t predicted = prev_value; - curr.bits = predicted ^ diff; - prev_value = curr.bits; + curr.bits ^= diff; ostream[opos++] = curr.real; } + + return nelements * FLOAT_BYTES; } -int32_t tsDecompressFloatImp(const char *const input, const int32_t nelements, char *const output) { +int32_t tsDecompressFloatImp(const char *const input, int32_t ninput, const int32_t nelements, char *const output) { if (input[0] == 1) { memcpy(output, input + 1, nelements * FLOAT_BYTES); return nelements * FLOAT_BYTES; } - if (tsSIMDEnable && tsAVX2Supported) { - tsDecompressFloatImplAvx2(input, nelements, output); - } else if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { - tsDecompressFloatImplAvx512(input, nelements, output); - } else { // alternative implementation without SIMD instructions. - tsDecompressFloatHelper(input, nelements, (float *)output); +#ifdef __AVX2__ + // use AVX2 implementation when allowed and the compression ratio is not high + double compressRatio = 1.0 * nelements * FLOAT_BYTES / ninput; + if (tsSIMDEnable && tsAVX2Supported && compressRatio < 2) { + return tsDecompressFloatImpAvx2(input + 1, nelements, output); } +#endif - return nelements * FLOAT_BYTES; + // use implementation without SIMD instructions by default + return tsDecompressFloatImpHelper(input + 1, nelements, output); } // @@ -1336,10 +1394,11 @@ int32_t tsDecompressFloat(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int3 } else { // decompress lossless if (cmprAlg == ONE_STAGE_COMP) { - return tsDecompressFloatImp(pIn, nEle, pOut); + return tsDecompressFloatImp(pIn, nIn, nEle, pOut); } else if (cmprAlg == TWO_STAGE_COMP) { - if (tsDecompressStringImp(pIn, nIn, pBuf, nBuf) < 0) return -1; - return tsDecompressFloatImp(pBuf, nEle, pOut); + int32_t bufLen = tsDecompressStringImp(pIn, nIn, pBuf, nBuf); + if (bufLen < 0) return -1; + return tsDecompressFloatImp(pBuf, bufLen, nEle, pOut); } else { return TSDB_CODE_INVALID_PARA; } @@ -1373,10 +1432,11 @@ int32_t tsDecompressDouble(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int } else { // decompress lossless if (cmprAlg == ONE_STAGE_COMP) { - return tsDecompressDoubleImp(pIn, nEle, pOut); + return tsDecompressDoubleImp(pIn, nIn, nEle, pOut); } else if (cmprAlg == TWO_STAGE_COMP) { - if (tsDecompressStringImp(pIn, nIn, pBuf, nBuf) < 0) return -1; - return tsDecompressDoubleImp(pBuf, nEle, pOut); + int32_t bufLen = tsDecompressStringImp(pIn, nIn, pBuf, nBuf); + if (bufLen < 0) return -1; + return tsDecompressDoubleImp(pBuf, bufLen, nEle, pOut); } else { return TSDB_CODE_INVALID_PARA; } @@ -1550,7 +1610,7 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int } else { \ uTrace("dencode:%s, compress:%s, level:%s, type:%s", compressL1Dict[l1].name, "disabled", "disabled", \ tDataTypes[type].name); \ - return compressL1Dict[l1].decomprFn(pIn, nEle, pOut, type); \ + return compressL1Dict[l1].decomprFn(pIn, nIn, nEle, pOut, type); \ } \ } else if (l1 != L1_DISABLED && l2 != L2_DISABLED) { \ if (compress) { \ @@ -1562,8 +1622,9 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int } else { \ uTrace("dencode:%s, decompress:%s, level:%d, type:%s", compressL1Dict[l1].name, compressL2Dict[l2].name, lvl, \ tDataTypes[type].name); \ - if (compressL2Dict[l2].decomprFn(pIn, nIn, pBuf, nBuf, type) < 0) return -1; \ - return compressL1Dict[l1].decomprFn(pBuf, nEle, pOut, type); \ + int32_t bufLen = compressL2Dict[l2].decomprFn(pIn, nIn, pBuf, nBuf, type); \ + if (bufLen < 0) return -1; \ + return compressL1Dict[l1].decomprFn(pBuf, bufLen, nEle, pOut, type); \ } \ } else if (l1 == L1_DISABLED && l2 != L2_DISABLED) { \ if (compress) { \ diff --git a/source/util/src/tdecompress.c b/source/util/src/tdecompress.c index 598aca730f..60a1f1c938 100644 --- a/source/util/src/tdecompress.c +++ b/source/util/src/tdecompress.c @@ -40,6 +40,7 @@ int32_t getWordLength(char type) { return wordLength; } +#ifdef __AVX2__ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, char *const output, const char type) { int32_t word_length = getWordLength(type); @@ -52,7 +53,6 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, int32_t _pos = 0; int64_t prevValue = 0; -#if __AVX2__ || __AVX512F__ while (_pos < nelements) { uint64_t w = *(uint64_t *)ip; @@ -309,22 +309,145 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, ip += LONG_BYTES; } -#endif return nelements * word_length; } -void tsDecompressFloatImplAvx512(const char *const input, const int32_t nelements, char *const output) { -#if __AVX512F__ - // todo add it -#endif - return; +#define M256_BYTES sizeof(__m256i) + +FORCE_INLINE __m256i decodeFloatAvx2(const char *data, const char *flag) { + __m256i dataVec = _mm256_load_si256((__m256i *)data); + __m256i flagVec = _mm256_load_si256((__m256i *)flag); + __m256i k7 = _mm256_set1_epi32(7); + __m256i lopart = _mm256_set_epi32(0, -1, 0, -1, 0, -1, 0, -1); + __m256i hipart = _mm256_set_epi32(-1, 0, -1, 0, -1, 0, -1, 0); + __m256i trTail = _mm256_cmpgt_epi32(flagVec, k7); + __m256i trHead = _mm256_andnot_si256(trTail, _mm256_set1_epi32(-1)); + __m256i shiftVec = _mm256_slli_epi32(_mm256_sub_epi32(_mm256_set1_epi32(3), _mm256_and_si256(flagVec, k7)), 3); + __m256i maskVec = hipart; + __m256i diffVec = _mm256_sllv_epi32(dataVec, _mm256_and_si256(shiftVec, maskVec)); + maskVec = _mm256_or_si256(trHead, lopart); + diffVec = _mm256_srlv_epi32(diffVec, _mm256_and_si256(shiftVec, maskVec)); + maskVec = _mm256_and_si256(trTail, lopart); + diffVec = _mm256_sllv_epi32(diffVec, _mm256_and_si256(shiftVec, maskVec)); + return diffVec; } -// todo add later -void tsDecompressFloatImplAvx2(const char *const input, const int32_t nelements, char *const output) { -#if __AVX2__ -#endif - return; +int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *output) { + // Allocate memory-aligned buffer + char buf[M256_BYTES * 3]; + memset(buf, 0, sizeof(buf)); + char *data = (char *)ALIGN_NUM((uint64_t)buf, M256_BYTES); + char *flag = data + M256_BYTES; + const char *in = input; + char *out = output; + + // Load data into the buffer for batch processing + int32_t batchSize = M256_BYTES / FLOAT_BYTES; + int32_t idx = 0; + uint32_t cur = 0; + for (int32_t i = 0; i < nelements; i += 2) { + if (idx == batchSize) { + // Start processing when the buffer is full + __m256i resVec = decodeFloatAvx2(data, flag); + _mm256_storeu_si256((__m256i *)out, resVec); + uint32_t *p = (uint32_t *)out; + for (int32_t j = 0; j < batchSize; ++j) { + p[j] = cur = (p[j] ^ cur); + } + out += M256_BYTES; + idx = 0; + } + uint8_t flag1 = (*in) & 0xF; + uint8_t flag2 = ((*in) >> 4) & 0xF; + int32_t nbytes1 = (flag1 & 0x7) + 1; + int32_t nbytes2 = (flag2 & 0x7) + 1; + in++; + flag[idx * FLOAT_BYTES] = flag1; + flag[(idx + 1) * FLOAT_BYTES] = flag2; + memcpy(data + (idx + 1) * FLOAT_BYTES - nbytes1, in, nbytes1 + nbytes2); + in += nbytes1 + nbytes2; + idx += 2; + } + if (idx) { + idx -= (nelements & 0x1); + // Process the remaining few bytes + __m256i resVec = decodeFloatAvx2(data, flag); + memcpy(out, &resVec, idx * FLOAT_BYTES); + uint32_t *p = (uint32_t *)out; + for (int32_t j = 0; j < idx; ++j) { + p[j] = cur = (p[j] ^ cur); + } + out += idx * FLOAT_BYTES; + } + return (int32_t)(out - output); +} + +FORCE_INLINE __m256i decodeDoubleAvx2(const char *data, const char *flag) { + __m256i dataVec = _mm256_load_si256((__m256i *)data); + __m256i flagVec = _mm256_load_si256((__m256i *)flag); + __m256i k7 = _mm256_set1_epi64x(7); + __m256i lopart = _mm256_set_epi64x(0, -1, 0, -1); + __m256i hipart = _mm256_set_epi64x(-1, 0, -1, 0); + __m256i trTail = _mm256_cmpgt_epi64(flagVec, k7); + __m256i trHead = _mm256_andnot_si256(trTail, _mm256_set1_epi64x(-1)); + __m256i shiftVec = _mm256_slli_epi64(_mm256_sub_epi64(k7, _mm256_and_si256(flagVec, k7)), 3); + __m256i maskVec = hipart; + __m256i diffVec = _mm256_sllv_epi64(dataVec, _mm256_and_si256(shiftVec, maskVec)); + maskVec = _mm256_or_si256(trHead, lopart); + diffVec = _mm256_srlv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec)); + maskVec = _mm256_and_si256(trTail, lopart); + diffVec = _mm256_sllv_epi64(diffVec, _mm256_and_si256(shiftVec, maskVec)); + return diffVec; +} + +int32_t tsDecompressDoubleImpAvx2(const char *input, const int32_t nelements, char *const output) { + // Allocate memory-aligned buffer + char buf[M256_BYTES * 3]; + memset(buf, 0, sizeof(buf)); + char *data = (char *)ALIGN_NUM((uint64_t)buf, M256_BYTES); + char *flag = data + M256_BYTES; + const char *in = input; + char *out = output; + + // Load data into the buffer for batch processing + int32_t batchSize = M256_BYTES / DOUBLE_BYTES; + int32_t idx = 0; + uint64_t cur = 0; + for (int32_t i = 0; i < nelements; i += 2) { + if (idx == batchSize) { + // Start processing when the buffer is full + __m256i resVec = decodeDoubleAvx2(data, flag); + _mm256_storeu_si256((__m256i *)out, resVec); + uint64_t *p = (uint64_t *)out; + for (int32_t j = 0; j < batchSize; ++j) { + p[j] = cur = (p[j] ^ cur); + } + out += M256_BYTES; + idx = 0; + } + uint8_t flag1 = (*in) & 0xF; + uint8_t flag2 = ((*in) >> 4) & 0xF; + int32_t nbytes1 = (flag1 & 0x7) + 1; + int32_t nbytes2 = (flag2 & 0x7) + 1; + in++; + flag[idx * DOUBLE_BYTES] = flag1; + flag[(idx + 1) * DOUBLE_BYTES] = flag2; + memcpy(data + (idx + 1) * DOUBLE_BYTES - nbytes1, in, nbytes1 + nbytes2); + in += nbytes1 + nbytes2; + idx += 2; + } + if (idx) { + idx -= (nelements & 0x1); + // Process the remaining few bytes + __m256i resVec = decodeDoubleAvx2(data, flag); + memcpy(out, &resVec, idx * DOUBLE_BYTES); + uint64_t *p = (uint64_t *)out; + for (int32_t j = 0; j < idx; ++j) { + p[j] = cur = (p[j] ^ cur); + } + out += idx * DOUBLE_BYTES; + } + return (int32_t)(out - output); } // decode two timestamps in one loop. @@ -332,7 +455,6 @@ void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, int64_t *ostream = (int64_t *)output; int32_t ipos = 1, opos = 0; -#if __AVX2__ __m128i prevVal = _mm_setzero_si128(); __m128i prevDelta = _mm_setzero_si128(); @@ -464,17 +586,16 @@ void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, ostream[opos++] = prevVal[1] + prevDeltaX; } } -#endif return; } +#endif +#if __AVX512VL__ void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool UNUSED_PARAM(bigEndian)) { int64_t *ostream = (int64_t *)output; int32_t ipos = 1, opos = 0; -#if __AVX512VL__ - __m128i prevVal = _mm_setzero_si128(); __m128i prevDelta = _mm_setzero_si128(); @@ -579,6 +700,6 @@ void tsDecompressTimestampAvx512(const char *const input, const int32_t nelement } } -#endif return; } +#endif diff --git a/source/util/test/CMakeLists.txt b/source/util/test/CMakeLists.txt index 0d8774ba41..4966a629d8 100644 --- a/source/util/test/CMakeLists.txt +++ b/source/util/test/CMakeLists.txt @@ -126,12 +126,12 @@ add_test( COMMAND regexTest ) -#add_executable(decompressTest "decompressTest.cpp") -#target_link_libraries(decompressTest os util common gtest_main) -#add_test( -# NAME decompressTest -# COMMAND decompressTest -#) +add_executable(decompressTest "decompressTest.cpp") +target_link_libraries(decompressTest os util common gtest_main) +add_test( + NAME decompressTest + COMMAND decompressTest +) if (${TD_LINUX}) # terrorTest @@ -147,4 +147,4 @@ if (${TD_LINUX}) add_custom_command(TARGET terrorTest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ERR_TBL_FILE} $ ) -endif () \ No newline at end of file +endif () diff --git a/source/util/test/decompressTest.cpp b/source/util/test/decompressTest.cpp index dfcd682255..e508c489df 100644 --- a/source/util/test/decompressTest.cpp +++ b/source/util/test/decompressTest.cpp @@ -1,14 +1,12 @@ +#define ALLOW_FORBID_FUNC #include #include #include +#include #include #include "ttypes.h" -namespace { - -} // namespace - -TEST(utilTest, decompress_ts_test) { +TEST(utilTest, DISABLED_decompress_ts_test) { { tsSIMDEnable = 1; tsAVX2Supported = 1; @@ -29,6 +27,7 @@ TEST(utilTest, decompress_ts_test) { std::cout << ((int64_t*)decompOutput)[i] << std::endl; } +#ifdef __AVX512VL__ memset(decompOutput, 0, 10 * 8); tsDecompressTimestampAvx512(reinterpret_cast(pOutput), 10, reinterpret_cast(decompOutput), false); @@ -36,13 +35,16 @@ TEST(utilTest, decompress_ts_test) { for (int32_t i = 0; i < 10; ++i) { std::cout << ((int64_t*)decompOutput)[i] << std::endl; } +#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - tsList[0] = 1286; tsList[1] = 1124; tsList[2]=2681; tsList[3] = 2823; + tsList[0] = 1286; + tsList[1] = 1124; + tsList[2] = 2681; + tsList[3] = 2823; -// char* pOutput[4 * sizeof(int64_t)] = {0}; - len = tsCompressTimestamp(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 4, - ONE_STAGE_COMP, NULL, 0); + len = tsCompressTimestamp(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 4, ONE_STAGE_COMP, + NULL, 0); decompOutput[4 * 8] = {0}; tsDecompressTimestamp(pOutput, len, 4, decompOutput, sizeof(int64_t) * 4, ONE_STAGE_COMP, NULL, 0); @@ -56,6 +58,7 @@ TEST(utilTest, decompress_ts_test) { int32_t len1 = tsCompressTimestamp(tsList1, sizeof(tsList1), sizeof(tsList1) / sizeof(tsList1[0]), pOutput, 7, ONE_STAGE_COMP, NULL, 0); +#ifdef __AVX512VL__ memset(decompOutput, 0, 10 * 8); tsDecompressTimestampAvx512(reinterpret_cast(pOutput), 7, reinterpret_cast(decompOutput), false); @@ -63,12 +66,14 @@ TEST(utilTest, decompress_ts_test) { for (int32_t i = 0; i < 7; ++i) { std::cout << ((int64_t*)decompOutput)[i] << std::endl; } +#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int64_t tsList2[1] = {1700000000}; int32_t len2 = tsCompressTimestamp(tsList2, sizeof(tsList2), sizeof(tsList2) / sizeof(tsList2[0]), pOutput, 1, ONE_STAGE_COMP, NULL, 0); +#ifdef __AVX512VL__ memset(decompOutput, 0, 10 * 8); tsDecompressTimestampAvx512(reinterpret_cast(pOutput), 1, reinterpret_cast(decompOutput), false); @@ -76,52 +81,10 @@ TEST(utilTest, decompress_ts_test) { for (int32_t i = 0; i < 1; ++i) { std::cout << ((int64_t*)decompOutput)[i] << std::endl; } +#endif } -TEST(utilTest, decompress_bigint_avx2_test) { - { - tsSIMDEnable = 1; - tsAVX2Supported = 1; - } - - int64_t tsList[10] = {1700000000, 1700000100, 1700000200, 1700000300, 1700000400, - 1700000500, 1700000600, 1700000700, 1700000800, 1700000900}; - - char* pOutput[10 * sizeof(int64_t)] = {0}; - int32_t len = tsCompressBigint(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 10, - ONE_STAGE_COMP, NULL, 0); - - char* decompOutput[10 * 8] = {0}; - - tsDecompressBigint(pOutput, len, 10, decompOutput, sizeof(int64_t) * 10, ONE_STAGE_COMP, NULL, 0); - - for (int32_t i = 0; i < 10; ++i) { - std::cout << ((int64_t*)decompOutput)[i] << std::endl; - } -} - -TEST(utilTest, decompress_int_avx2_test) { - { - tsSIMDEnable = 1; - tsAVX2Supported = 1; - } - - int32_t tsList[10] = {17000000, 17000001, 17000002, 17000003, 17000004, - 17000005, 17000006, 17000007, 17000008, 17000009}; - - char* pOutput[10 * sizeof(int32_t)] = {0}; - int32_t len = - tsCompressInt(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 10, ONE_STAGE_COMP, NULL, 0); - - char* decompOutput[10 * 8] = {0}; - tsDecompressInt(pOutput, len, 10, decompOutput, sizeof(int32_t) * 10, ONE_STAGE_COMP, NULL, 0); - - for (int32_t i = 0; i < 10; ++i) { - std::cout << ((int32_t*)decompOutput)[i] << std::endl; - } -} - -TEST(utilTest, decompress_perf_test) { +TEST(utilTest, DISABLED_decompress_perf_test) { int32_t num = 10000; int64_t* pList = static_cast(taosMemoryCalloc(num, sizeof(int64_t))); @@ -149,9 +112,11 @@ TEST(utilTest, decompress_perf_test) { memset(pOutput, 0, num * sizeof(int64_t)); st = taosGetTimestampUs(); +#ifdef __AVX512VL__ for (int32_t k = 0; k < 10000; ++k) { tsDecompressTimestampAvx512(px, num, pOutput, false); } +#endif int64_t el2 = taosGetTimestampUs() - st; std::cout << "SIMD decompress elapsed time:" << el2 << " us" << std::endl; @@ -303,7 +268,7 @@ void* genCompressData_float(int32_t type, int32_t num, bool order) { } return pBuf; } -TEST(utilTest, compressAlg) { +TEST(utilTest, DISABLED_compressAlg) { int32_t num = 4096; int64_t* pList = static_cast(taosMemoryCalloc(num, sizeof(int64_t))); int64_t iniVal = 17000; @@ -479,4 +444,214 @@ TEST(utilTest, compressAlg) { } taosMemoryFree(p); } -} \ No newline at end of file +} + +static uint32_t decompressRandomSeed; + +static void refreshSeed() { + decompressRandomSeed = std::random_device()(); + std::cout << "Refresh random seed to " << decompressRandomSeed << "\n"; +} + +#ifdef __GNUC__ +template +static std::vector::value, T>::type> utilTestRandomData(int32_t n, T min, + T max) { + std::mt19937 gen(decompressRandomSeed); + std::vector data(n); + + std::uniform_int_distribution dist(min, max); + for (auto& v : data) v = dist(gen); + return data; +} + +template +static std::vector::value, T>::type> utilTestRandomData(int32_t n, + T min, + T max) { + std::mt19937 gen(decompressRandomSeed); + std::vector data(n); + + std::uniform_real_distribution dist(min, max); + for (auto& v : data) v = dist(gen); + return data; +} +#else +template +static std::vector utilTestRandomData(int32_t n, T min, T max) { + std::vector data(n); + + for (int32_t i = 0; i < n; ++i) { + data[i] = (i & 0x1) ? min : max; + } + return data; +} +#endif + +template +static double measureRunTime(const F& func, int32_t nround = 1) { + auto start = std::chrono::high_resolution_clock::now(); + for (int32_t i = 0; i < nround; ++i) { + func(); + } + auto end = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast(end - start).count(); + return duration / 1000.0; +} + +template +struct DataTypeSupportAvx { + static const bool value = false; +}; + +template <> +struct DataTypeSupportAvx { + static const bool value = true; +}; + +template <> +struct DataTypeSupportAvx { + static const bool value = true; +}; + +template +static void decompressBasicTest(size_t dataSize, const CompF& compress, const DecompF& decompress, T min, T max) { + auto origData = utilTestRandomData(dataSize, min, max); + std::vector compData(origData.size() * sizeof(origData[0]) + 1); + int32_t cnt = compress(origData.data(), origData.size(), origData.size(), compData.data(), compData.size(), + ONE_STAGE_COMP, nullptr, 0); + ASSERT_LE(cnt, compData.size()); + decltype(origData) decompData(origData.size()); + + // test simple implementation without SIMD instructions + tsSIMDEnable = 0; + cnt = decompress(compData.data(), compData.size(), decompData.size(), decompData.data(), decompData.size(), + ONE_STAGE_COMP, nullptr, 0); + ASSERT_EQ(cnt, compData.size() - 1); + EXPECT_EQ(origData, decompData); + +#ifdef __AVX2__ + if (DataTypeSupportAvx::value) { + // test AVX2 implementation + tsSIMDEnable = 1; + tsAVX2Supported = 1; + cnt = decompress(compData.data(), compData.size(), decompData.size(), decompData.data(), decompData.size(), + ONE_STAGE_COMP, nullptr, 0); + ASSERT_EQ(cnt, compData.size() - 1); + EXPECT_EQ(origData, decompData); + } +#endif +} + +template +static void decompressPerfTest(const char* typname, const CompF& compress, const DecompF& decompress, T min, T max) { + constexpr size_t DATA_SIZE = 1 * 1024 * 1024; + constexpr int32_t NROUND = 1000; + auto origData = utilTestRandomData(DATA_SIZE, min, max); + std::vector compData(origData.size() * sizeof(origData[0]) + 1); + int32_t cnt = compress(origData.data(), origData.size(), origData.size(), compData.data(), compData.size(), + ONE_STAGE_COMP, nullptr, 0); + ASSERT_LE(cnt, compData.size()); + if (compData[0] == 1) std::cout << "NOT COMPRESSED!\n"; + std::cout << "Original size: " << compData.size() - 1 << "; Compressed size: " << cnt + << "; Compression ratio: " << 1.0 * (compData.size() - 1) / cnt << "\n"; + decltype(origData) decompData(origData.size()); + + tsSIMDEnable = 0; + auto ms = measureRunTime( + [&]() { + decompress(compData.data(), compData.size(), decompData.size(), decompData.data(), decompData.size(), + ONE_STAGE_COMP, nullptr, 0); + }, + NROUND); + std::cout << "Decompression of " << NROUND * DATA_SIZE << " " << typname << " without SIMD costs " << ms + << " ms, avg speed: " << NROUND * DATA_SIZE * 1000 / ms << " tuples/s\n"; + +#ifdef __AVX2__ + if (DataTypeSupportAvx::value) { + tsSIMDEnable = 1; + tsAVX2Supported = 1; + ms = measureRunTime( + [&]() { + decompress(compData.data(), compData.size(), decompData.size(), decompData.data(), decompData.size(), + ONE_STAGE_COMP, nullptr, 0); + }, + NROUND); + std::cout << "Decompression of " << NROUND * DATA_SIZE << " " << typname << " using AVX2 costs " << ms + << " ms, avg speed: " << NROUND * DATA_SIZE * 1000 / ms << " tuples/s\n"; + } +#endif +} + +#define RUN_PERF_TEST(typname, comp, decomp, min, max) \ + do { \ + refreshSeed(); \ + decompressPerfTest(#typname, comp, decomp, min, max); \ + } while (0) + +TEST(utilTest, decompressTinyintBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressTinyint, tsDecompressTinyint, 0, 100); + } +} + +TEST(utilTest, decompressTinyintPerf) { RUN_PERF_TEST(int8_t, tsCompressTinyint, tsDecompressTinyint, 0, 100); } + +TEST(utilTest, decompressSmallintBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressSmallint, tsDecompressSmallint, 0, 10000); + } +} + +TEST(utilTest, decompressSmallintPerf) { RUN_PERF_TEST(int16_t, tsCompressSmallint, tsDecompressSmallint, 0, 10000); } + +TEST(utilTest, decompressIntBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressInt, tsDecompressInt, 0, 1000000); + } +} + +TEST(utilTest, decompressIntPerf) { RUN_PERF_TEST(int32_t, tsCompressInt, tsDecompressInt, 0, 1000000); } + +TEST(utilTest, decompressBigintBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressBigint, tsDecompressBigint, 0, 1000000000L); + } +} + +TEST(utilTest, decompressBigintPerf) { RUN_PERF_TEST(int64_t, tsCompressBigint, tsDecompressBigint, 0, 1000000000L); } + +TEST(utilTest, decompressFloatBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressFloat, tsDecompressFloat, 0, 99999); + } +} + +TEST(utilTest, decompressFloatPerf) { RUN_PERF_TEST(float, tsCompressFloat, tsDecompressFloat, 0, 99999); } + +TEST(utilTest, decompressDoubleBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressDouble, tsDecompressDouble, 0, 9999999999); + } +} + +TEST(utilTest, decompressDoublePerf) { RUN_PERF_TEST(double, tsCompressDouble, tsDecompressDouble, 0, 9999999999); } + + +TEST(utilTest, decompressTimestampBasic) { + refreshSeed(); + for (int32_t r = 1; r <= 4096; ++r) { + decompressBasicTest(r, tsCompressTimestamp, tsDecompressTimestamp, 0, 1000000000L); + } +} + +TEST(utilTest, decompressTimestampPerf) { + refreshSeed(); + decompressPerfTest("timestamp", tsCompressTimestamp, tsDecompressTimestamp, 0, 1000000000L); +} From 8cd92624ae3d49d486b8258b056c365925dc228e Mon Sep 17 00:00:00 2001 From: dmchen Date: Mon, 14 Oct 2024 09:10:06 +0000 Subject: [PATCH 29/56] fix/TD-32547-memleak --- source/dnode/mgmt/exe/dmMain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index ddef0537f8..ba162bd84f 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "dmMgmt.h" #include "mnode.h" +#include "osFile.h" #include "tconfig.h" #include "tglobal.h" #include "version.h" @@ -415,6 +416,9 @@ int mainWindows(int argc, char **argv) { return code; } int ret = dmUpdateEncryptKey(global.encryptKey, toLogFile); + if (taosCloseFile(&pFile) != 0) { + encryptError("failed to close file:%p", pFile); + } taosCloseLog(); taosCleanupArgs(); return ret; From 52bbb32a2799428a126b6e0f4aebbfa0dc34f075 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Mon, 14 Oct 2024 17:31:56 +0800 Subject: [PATCH 30/56] merge docker packaging updates --- packaging/docker/Dockerfile | 2 +- packaging/docker/bin/entrypoint.sh | 53 +++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index 99a10e0285..a67724d5a8 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:22.04 WORKDIR /root diff --git a/packaging/docker/bin/entrypoint.sh b/packaging/docker/bin/entrypoint.sh index a60254d7ef..02895f4755 100755 --- a/packaging/docker/bin/entrypoint.sh +++ b/packaging/docker/bin/entrypoint.sh @@ -10,6 +10,12 @@ fi DISABLE_ADAPTER=${TAOS_DISABLE_ADAPTER:-0} unset TAOS_DISABLE_ADAPTER +DISABLE_KEEPER=${TAOS_DISABLE_KEEPER:-0} +unset TAOS_DISABLE_KEEPER + +DISABLE_EXPLORER=${TAOS_DISABLE_EXPLORER:-0} +unset TAOS_DISABLE_EXPLORER + # to get mnodeEpSet from data dir DATA_DIR=$(taosd -C|grep -E 'dataDir.*(\S+)' -o |head -n1|sed 's/dataDir *//') DATA_DIR=${DATA_DIR:-/var/lib/taos} @@ -33,26 +39,18 @@ ulimit -c unlimited sysctl -w kernel.core_pattern=/corefile/core-$FQDN-%e-%p >/dev/null >&1 set -e -if [ "$DISABLE_ADAPTER" = "0" ]; then - which taosadapter >/dev/null && taosadapter & - # wait for 6041 port ready - for _ in $(seq 1 20); do - nc -z localhost 6041 && break - sleep 0.5 - done -fi + # if dnode has been created or has mnode ep set or the host is first ep or not for cluster, just start. if [ -f "$DATA_DIR/dnode/dnode.json" ] || [ -f "$DATA_DIR/dnode/mnodeEpSet.json" ] || [ "$TAOS_FQDN" = "$FIRST_EP_HOST" ]; then - $@ + $@ & # others will first wait the first ep ready. else if [ "$TAOS_FIRST_EP" = "" ]; then echo "run TDengine with single node." - $@ - exit $? + $@ & fi while true; do es=$(taos -h $FIRST_EP_HOST -P $FIRST_EP_PORT --check | grep "^[0-9]*:") @@ -64,5 +62,36 @@ else fi sleep 1s done - $@ + if ps aux | grep -v grep | grep taosd > dev/null; then + echo "TDengine is running" + else + $@ & + fi fi + +if [ "$DISABLE_ADAPTER" = "0" ]; then + which taosadapter >/dev/null && taosadapter & + # wait for 6041 port ready + for _ in $(seq 1 20); do + nc -z localhost 6041 && break + sleep 0.5 + done +fi + +if [ "$DISABLE_KEEPER" = "0" ]; then + sleep 3 + which taoskeeper >/dev/null && taoskeeper & + # wait for 6043 port ready + for _ in $(seq 1 20); do + nc -z localhost 6043 && break + sleep 0.5 + done +fi + + +which taos-explorer >/dev/null && taos-explorer +# wait for 6060 port ready +for _ in $(seq 1 20); do + nc -z localhost 6060 && break + sleep 0.5 +done From 9f05ca5ee8fc8e537e31e243f21ef7a00125cee2 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Oct 2024 23:27:11 +0800 Subject: [PATCH 31/56] revert: data analysis --- cmake/cmake.options | 13 - include/common/systable.h | 2 - include/common/tanal.h | 96 - include/common/tmsg.h | 54 - include/common/tmsgdef.h | 5 - include/common/ttokendef.h | 664 +- include/libs/function/functionMgt.h | 6 - include/libs/nodes/cmdnodes.h | 15 - include/libs/nodes/plannodes.h | 20 - include/libs/nodes/querynodes.h | 9 - include/libs/scalar/scalar.h | 1 - include/util/taoserror.h | 22 - include/util/tdef.h | 12 - include/util/tjson.h | 3 - source/common/src/systable.c | 16 - source/common/src/tmsg.c | 263 - source/dnode/mgmt/mgmt_dnode/src/dmHandle.c | 43 - source/dnode/mgmt/mgmt_dnode/src/dmInt.c | 5 - source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 4 - source/dnode/mgmt/node_mgmt/src/dmEnv.c | 2 - source/dnode/mgmt/node_mgmt/src/dmTransport.c | 14 - source/dnode/mnode/impl/CMakeLists.txt | 3 - source/dnode/mnode/impl/inc/mndAnode.h | 32 - source/dnode/mnode/impl/inc/mndDef.h | 21 - source/dnode/mnode/impl/src/mndAnode.c | 901 -- source/dnode/mnode/impl/src/mndDnode.c | 5 +- source/dnode/mnode/impl/src/mndMain.c | 2 - source/dnode/mnode/impl/src/mndShow.c | 4 - source/dnode/mnode/sdb/inc/sdb.h | 3 +- source/dnode/mnode/sdb/src/sdbFile.c | 57 +- source/dnode/mnode/sdb/src/sdbHash.c | 2 - source/libs/executor/CMakeLists.txt | 4 - source/libs/executor/inc/operator.h | 4 - .../libs/executor/src/anomalywindowoperator.c | 609 - source/libs/executor/src/executil.c | 11 +- source/libs/executor/src/forecastoperator.c | 663 - source/libs/executor/src/operator.c | 4 - source/libs/function/inc/builtinsimpl.h | 2 - source/libs/function/inc/functionMgtInt.h | 1 - source/libs/function/src/builtins.c | 84 - source/libs/function/src/builtinsimpl.c | 6 - source/libs/function/src/functionMgt.c | 9 - source/libs/nodes/src/nodesCloneFuncs.c | 21 - source/libs/nodes/src/nodesCodeFuncs.c | 206 - source/libs/nodes/src/nodesMsgFuncs.c | 96 - source/libs/nodes/src/nodesTraverseFuncs.c | 16 - source/libs/nodes/src/nodesUtilFuncs.c | 44 - source/libs/parser/inc/parAst.h | 4 - source/libs/parser/inc/sql.y | 15 - source/libs/parser/src/parAstCreater.c | 60 - source/libs/parser/src/parAstParser.c | 20 - source/libs/parser/src/parAuthenticator.c | 2 - source/libs/parser/src/parTokenizer.c | 6 - source/libs/parser/src/parTranslater.c | 242 +- source/libs/parser/src/parUtil.c | 2 - source/libs/parser/src/sql.c | 11273 ++++++++-------- source/libs/planner/src/planLogicCreater.c | 86 - source/libs/planner/src/planOptimizer.c | 2 - source/libs/planner/src/planPhysiCreater.c | 95 - source/libs/planner/src/planSpliter.c | 17 +- source/libs/planner/src/planUtil.c | 23 - source/libs/scalar/src/sclfunc.c | 4 - source/util/CMakeLists.txt | 4 - source/util/src/tanal.c | 752 -- source/util/src/terror.c | 21 - source/util/src/tjson.c | 17 - .../develop-test/2-query/table_count_scan.py | 16 +- tests/script/tsim/query/sys_tbname.sim | 2 +- tests/script/tsim/query/tableCount.sim | 6 +- .../0-others/information_schema.py | 4 +- 70 files changed, 5947 insertions(+), 10805 deletions(-) delete mode 100644 include/common/tanal.h delete mode 100644 source/dnode/mnode/impl/inc/mndAnode.h delete mode 100644 source/dnode/mnode/impl/src/mndAnode.c delete mode 100644 source/libs/executor/src/anomalywindowoperator.c delete mode 100644 source/libs/executor/src/forecastoperator.c delete mode 100644 source/util/src/tanal.c diff --git a/cmake/cmake.options b/cmake/cmake.options index e3b5782d85..2158157780 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -144,12 +144,6 @@ option( OFF ) -option( - BUILD_WITH_ANALYSIS - "If build with analysis" - ON -) - ENDIF () IF(NOT TD_ENTERPRISE) @@ -157,15 +151,8 @@ MESSAGE("switch s3 off with community version") set(BUILD_S3 OFF) set(BUILD_WITH_S3 OFF) set(BUILD_WITH_COS OFF) -set(BUILD_WITH_ANALYSIS OFF) ENDIF () -IF(${BUILD_WITH_ANALYSIS}) - message("build with analysis") - set(BUILD_S3 ON) - set(BUILD_WITH_S3 ON) -ENDIF() - IF(${BUILD_S3}) IF(${BUILD_WITH_S3}) diff --git a/include/common/systable.h b/include/common/systable.h index 0acafbfc30..65b3b36af8 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -29,8 +29,6 @@ extern "C" { #define TSDB_INS_TABLE_QNODES "ins_qnodes" #define TSDB_INS_TABLE_BNODES "ins_bnodes" // no longer used #define TSDB_INS_TABLE_SNODES "ins_snodes" -#define TSDB_INS_TABLE_ANODES "ins_anodes" -#define TSDB_INS_TABLE_ANODES_FULL "ins_anodes_full" #define TSDB_INS_TABLE_ARBGROUPS "ins_arbgroups" #define TSDB_INS_TABLE_CLUSTER "ins_cluster" #define TSDB_INS_TABLE_DATABASES "ins_databases" diff --git a/include/common/tanal.h b/include/common/tanal.h deleted file mode 100644 index 59a28ddbe3..0000000000 --- a/include/common/tanal.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_UTIL_ANAL_H_ -#define _TD_UTIL_ANAL_H_ - -#include "os.h" -#include "tdef.h" -#include "thash.h" -#include "tjson.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ANAL_FORECAST_DEFAULT_PERIOD 10 -#define ANAL_FORECAST_DEFAULT_ROWS 10 -#define ANAL_FORECAST_DEFAULT_CONF 95 -#define ANAL_FORECAST_DEFAULT_ALPHA 0.05 -#define ANAL_FORECAST_DEFAULT_PARAM "diff" - -typedef struct { - EAnalAlgoType type; - int32_t anode; - int32_t urlLen; - char *url; -} SAnalUrl; - -typedef enum { - ANAL_BUF_TYPE_JSON = 0, - ANAL_BUF_TYPE_JSON_COL = 1, - ANAL_BUF_TYPE_OTHERS, -} EAnalBufType; - -typedef enum { - ANAL_HTTP_TYPE_GET = 0, - ANAL_HTTP_TYPE_POST, -} EAnalHttpType; - -typedef struct { - TdFilePtr filePtr; - char fileName[TSDB_FILENAME_LEN + 10]; - int64_t numOfRows; -} SAnalColBuf; - -typedef struct { - EAnalBufType bufType; - TdFilePtr filePtr; - char fileName[TSDB_FILENAME_LEN]; - int32_t numOfCols; - SAnalColBuf *pCols; -} SAnalBuf; - -int32_t taosAnalInit(); -void taosAnalCleanup(); -SJson *taosAnalSendReqRetJson(const char *url, EAnalHttpType type, SAnalBuf *pBuf); - -int32_t taosAnalGetAlgoUrl(const char *algoName, EAnalAlgoType type, char *url, int32_t urlLen); -bool taosAnalGetOptStr(const char *option, const char *optName, char *optValue, int32_t optMaxLen); -bool taosAnalGetOptInt(const char *option, const char *optName, int32_t *optValue); -int64_t taosAnalGetVersion(); -void taosAnalUpdate(int64_t newVer, SHashObj *pHash); - -int32_t tsosAnalBufOpen(SAnalBuf *pBuf, int32_t numOfCols); -int32_t taosAnalBufWriteOptStr(SAnalBuf *pBuf, const char *optName, const char *optVal); -int32_t taosAnalBufWriteOptInt(SAnalBuf *pBuf, const char *optName, int64_t optVal); -int32_t taosAnalBufWriteOptFloat(SAnalBuf *pBuf, const char *optName, float optVal); -int32_t taosAnalBufWriteColMeta(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, const char *colName); -int32_t taosAnalBufWriteDataBegin(SAnalBuf *pBuf); -int32_t taosAnalBufWriteColBegin(SAnalBuf *pBuf, int32_t colIndex); -int32_t taosAnalBufWriteColData(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, void *colValue); -int32_t taosAnalBufWriteColEnd(SAnalBuf *pBuf, int32_t colIndex); -int32_t taosAnalBufWriteDataEnd(SAnalBuf *pBuf); -int32_t taosAnalBufClose(SAnalBuf *pBuf); -void taosAnalBufDestroy(SAnalBuf *pBuf); - -const char *taosAnalAlgoStr(EAnalAlgoType algoType); -EAnalAlgoType taosAnalAlgoInt(const char *algoName); -const char *taosAnalAlgoUrlStr(EAnalAlgoType algoType); - -#ifdef __cplusplus -} -#endif -#endif /*_TD_UTIL_ANAL_H_*/ \ No newline at end of file diff --git a/include/common/tmsg.h b/include/common/tmsg.h index ae9df866c5..1a10f02c96 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -159,8 +159,6 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_ARBGROUP, TSDB_MGMT_TABLE_ENCRYPTIONS, TSDB_MGMT_TABLE_USER_FULL, - TSDB_MGMT_TABLE_ANODE, - TSDB_MGMT_TABLE_ANODE_FULL, TSDB_MGMT_TABLE_MAX, } EShowType; @@ -262,7 +260,6 @@ typedef enum ENodeType { QUERY_NODE_COUNT_WINDOW, QUERY_NODE_COLUMN_OPTIONS, QUERY_NODE_TSMA_OPTIONS, - QUERY_NODE_ANOMALY_WINDOW, // Statement nodes are used in parser and planner module. QUERY_NODE_SET_OPERATOR = 100, @@ -348,9 +345,6 @@ typedef enum ENodeType { QUERY_NODE_CREATE_VIEW_STMT, QUERY_NODE_DROP_VIEW_STMT, QUERY_NODE_CREATE_SUBTABLE_FROM_FILE_CLAUSE, - QUERY_NODE_CREATE_ANODE_STMT, - QUERY_NODE_DROP_ANODE_STMT, - QUERY_NODE_UPDATE_ANODE_STMT, // show statement nodes // see 'sysTableShowAdapter', 'SYSTABLE_SHOW_TYPE_OFFSET' @@ -392,8 +386,6 @@ typedef enum ENodeType { QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT, QUERY_NODE_SHOW_ENCRYPTIONS_STMT, QUERY_NODE_SHOW_TSMAS_STMT, - QUERY_NODE_SHOW_ANODES_STMT, - QUERY_NODE_SHOW_ANODES_FULL_STMT, QUERY_NODE_CREATE_TSMA_STMT, QUERY_NODE_SHOW_CREATE_TSMA_STMT, QUERY_NODE_DROP_TSMA_STMT, @@ -416,7 +408,6 @@ typedef enum ENodeType { QUERY_NODE_LOGIC_PLAN, QUERY_NODE_LOGIC_PLAN_GROUP_CACHE, QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL, - QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC, // physical plan node QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN = 1100, @@ -467,9 +458,6 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT, QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT, QUERY_NODE_PHYSICAL_PLAN_STREAM_MID_INTERVAL, - QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY, - QUERY_NODE_PHYSICAL_PLAN_STREAM_ANOMALY, - QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC, } ENodeType; typedef struct { @@ -1104,22 +1092,6 @@ typedef struct { int32_t tSerializeRetrieveIpWhite(void* buf, int32_t bufLen, SRetrieveIpWhiteReq* pReq); int32_t tDeserializeRetrieveIpWhite(void* buf, int32_t bufLen, SRetrieveIpWhiteReq* pReq); -typedef struct { - int32_t dnodeId; - int64_t analVer; -} SRetrieveAnalAlgoReq; - -typedef struct { - int64_t ver; - SHashObj* hash; // algoname:algotype -> SAnalUrl -} SRetrieveAnalAlgoRsp; - -int32_t tSerializeRetrieveAnalAlgoReq(void* buf, int32_t bufLen, SRetrieveAnalAlgoReq* pReq); -int32_t tDeserializeRetrieveAnalAlgoReq(void* buf, int32_t bufLen, SRetrieveAnalAlgoReq* pReq); -int32_t tSerializeRetrieveAnalAlgoRsp(void* buf, int32_t bufLen, SRetrieveAnalAlgoRsp* pRsp); -int32_t tDeserializeRetrieveAnalAlgoRsp(void* buf, int32_t bufLen, SRetrieveAnalAlgoRsp* pRsp); -void tFreeRetrieveAnalAlgoRsp(SRetrieveAnalAlgoRsp* pRsp); - typedef struct { int8_t alterType; int8_t superUser; @@ -1794,7 +1766,6 @@ typedef struct { SArray* pVloads; // array of SVnodeLoad int32_t statusSeq; int64_t ipWhiteVer; - int64_t analVer; } SStatusReq; int32_t tSerializeSStatusReq(void* buf, int32_t bufLen, SStatusReq* pReq); @@ -1860,7 +1831,6 @@ typedef struct { SArray* pDnodeEps; // Array of SDnodeEp int32_t statusSeq; int64_t ipWhiteVer; - int64_t analVer; } SStatusRsp; int32_t tSerializeSStatusRsp(void* buf, int32_t bufLen, SStatusRsp* pRsp); @@ -2407,30 +2377,6 @@ typedef struct { int32_t tSerializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); int32_t tDeserializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); -typedef struct { - int32_t urlLen; - int32_t sqlLen; - char* url; - char* sql; -} SMCreateAnodeReq; - -int32_t tSerializeSMCreateAnodeReq(void* buf, int32_t bufLen, SMCreateAnodeReq* pReq); -int32_t tDeserializeSMCreateAnodeReq(void* buf, int32_t bufLen, SMCreateAnodeReq* pReq); -void tFreeSMCreateAnodeReq(SMCreateAnodeReq* pReq); - -typedef struct { - int32_t anodeId; - int32_t sqlLen; - char* sql; -} SMDropAnodeReq, SMUpdateAnodeReq; - -int32_t tSerializeSMDropAnodeReq(void* buf, int32_t bufLen, SMDropAnodeReq* pReq); -int32_t tDeserializeSMDropAnodeReq(void* buf, int32_t bufLen, SMDropAnodeReq* pReq); -void tFreeSMDropAnodeReq(SMDropAnodeReq* pReq); -int32_t tSerializeSMUpdateAnodeReq(void* buf, int32_t bufLen, SMUpdateAnodeReq* pReq); -int32_t tDeserializeSMUpdateAnodeReq(void* buf, int32_t bufLen, SMUpdateAnodeReq* pReq); -void tFreeSMUpdateAnodeReq(SMUpdateAnodeReq* pReq); - typedef struct { int32_t vgId; int32_t hbSeq; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 6540e7b135..40464dc29a 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -125,11 +125,6 @@ TD_DEF_MSG_TYPE(TDMT_DND_ALTER_VNODE_TYPE, "dnode-alter-vnode-type", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP, "dnode-check-vnode-learner-catchup", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_DND_CREATE_ENCRYPT_KEY, "create-encrypt-key", NULL, NULL) - // mnode msg overload - TD_DEF_MSG_TYPE(TDMT_MND_CREATE_ANODE, "create-anode", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_UPDATE_ANODE, "update-anode", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_DROP_ANODE, "drop-anode", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_RETRIEVE_ANAL_ALGO, "retrieve-anal-algo", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_DND_MSG) TD_NEW_MSG_SEG(TDMT_MND_MSG) // 1<<8 diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index b86830869c..005a5c49b1 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -69,341 +69,335 @@ #define TK_NK_DOT 51 #define TK_WITH 52 #define TK_ENCRYPT_KEY 53 -#define TK_ANODE 54 -#define TK_UPDATE 55 -#define TK_ANODES 56 -#define TK_DNODE 57 -#define TK_PORT 58 -#define TK_DNODES 59 -#define TK_RESTORE 60 -#define TK_NK_IPTOKEN 61 -#define TK_FORCE 62 -#define TK_UNSAFE 63 -#define TK_CLUSTER 64 -#define TK_LOCAL 65 -#define TK_QNODE 66 -#define TK_BNODE 67 -#define TK_SNODE 68 -#define TK_MNODE 69 -#define TK_VNODE 70 -#define TK_DATABASE 71 -#define TK_USE 72 -#define TK_FLUSH 73 -#define TK_TRIM 74 -#define TK_S3MIGRATE 75 -#define TK_COMPACT 76 -#define TK_IF 77 -#define TK_NOT 78 -#define TK_EXISTS 79 -#define TK_BUFFER 80 -#define TK_CACHEMODEL 81 -#define TK_CACHESIZE 82 -#define TK_COMP 83 -#define TK_DURATION 84 -#define TK_NK_VARIABLE 85 -#define TK_MAXROWS 86 -#define TK_MINROWS 87 -#define TK_KEEP 88 -#define TK_PAGES 89 -#define TK_PAGESIZE 90 -#define TK_TSDB_PAGESIZE 91 -#define TK_PRECISION 92 -#define TK_REPLICA 93 -#define TK_VGROUPS 94 -#define TK_SINGLE_STABLE 95 -#define TK_RETENTIONS 96 -#define TK_SCHEMALESS 97 -#define TK_WAL_LEVEL 98 -#define TK_WAL_FSYNC_PERIOD 99 -#define TK_WAL_RETENTION_PERIOD 100 -#define TK_WAL_RETENTION_SIZE 101 -#define TK_WAL_ROLL_PERIOD 102 -#define TK_WAL_SEGMENT_SIZE 103 -#define TK_STT_TRIGGER 104 -#define TK_TABLE_PREFIX 105 -#define TK_TABLE_SUFFIX 106 -#define TK_S3_CHUNKSIZE 107 -#define TK_S3_KEEPLOCAL 108 -#define TK_S3_COMPACT 109 -#define TK_KEEP_TIME_OFFSET 110 -#define TK_ENCRYPT_ALGORITHM 111 -#define TK_NK_COLON 112 -#define TK_BWLIMIT 113 -#define TK_START 114 -#define TK_TIMESTAMP 115 -#define TK_END 116 -#define TK_TABLE 117 -#define TK_NK_LP 118 -#define TK_NK_RP 119 -#define TK_USING 120 -#define TK_FILE 121 -#define TK_STABLE 122 -#define TK_COLUMN 123 -#define TK_MODIFY 124 -#define TK_RENAME 125 -#define TK_TAG 126 -#define TK_SET 127 -#define TK_NK_EQ 128 -#define TK_TAGS 129 -#define TK_BOOL 130 -#define TK_TINYINT 131 -#define TK_SMALLINT 132 -#define TK_INT 133 -#define TK_INTEGER 134 -#define TK_BIGINT 135 -#define TK_FLOAT 136 -#define TK_DOUBLE 137 -#define TK_BINARY 138 -#define TK_NCHAR 139 -#define TK_UNSIGNED 140 -#define TK_JSON 141 -#define TK_VARCHAR 142 -#define TK_MEDIUMBLOB 143 -#define TK_BLOB 144 -#define TK_VARBINARY 145 -#define TK_GEOMETRY 146 -#define TK_DECIMAL 147 -#define TK_COMMENT 148 -#define TK_MAX_DELAY 149 -#define TK_WATERMARK 150 -#define TK_ROLLUP 151 -#define TK_TTL 152 -#define TK_SMA 153 -#define TK_DELETE_MARK 154 -#define TK_FIRST 155 -#define TK_LAST 156 -#define TK_SHOW 157 -#define TK_FULL 158 -#define TK_PRIVILEGES 159 -#define TK_DATABASES 160 -#define TK_TABLES 161 -#define TK_STABLES 162 -#define TK_MNODES 163 -#define TK_QNODES 164 -#define TK_ARBGROUPS 165 -#define TK_FUNCTIONS 166 -#define TK_INDEXES 167 -#define TK_ACCOUNTS 168 -#define TK_APPS 169 -#define TK_CONNECTIONS 170 -#define TK_LICENCES 171 -#define TK_GRANTS 172 -#define TK_LOGS 173 -#define TK_MACHINES 174 -#define TK_ENCRYPTIONS 175 -#define TK_QUERIES 176 -#define TK_SCORES 177 -#define TK_TOPICS 178 -#define TK_VARIABLES 179 -#define TK_BNODES 180 -#define TK_SNODES 181 -#define TK_TRANSACTIONS 182 -#define TK_DISTRIBUTED 183 -#define TK_CONSUMERS 184 -#define TK_SUBSCRIPTIONS 185 -#define TK_VNODES 186 -#define TK_ALIVE 187 -#define TK_VIEWS 188 -#define TK_VIEW 189 -#define TK_COMPACTS 190 -#define TK_NORMAL 191 -#define TK_CHILD 192 -#define TK_LIKE 193 -#define TK_TBNAME 194 -#define TK_QTAGS 195 -#define TK_AS 196 -#define TK_SYSTEM 197 -#define TK_TSMA 198 -#define TK_INTERVAL 199 -#define TK_RECURSIVE 200 -#define TK_TSMAS 201 -#define TK_FUNCTION 202 -#define TK_INDEX 203 -#define TK_COUNT 204 -#define TK_LAST_ROW 205 -#define TK_META 206 -#define TK_ONLY 207 -#define TK_TOPIC 208 -#define TK_CONSUMER 209 -#define TK_GROUP 210 -#define TK_DESC 211 -#define TK_DESCRIBE 212 -#define TK_RESET 213 -#define TK_QUERY 214 -#define TK_CACHE 215 -#define TK_EXPLAIN 216 -#define TK_ANALYZE 217 -#define TK_VERBOSE 218 -#define TK_NK_BOOL 219 -#define TK_RATIO 220 -#define TK_NK_FLOAT 221 -#define TK_OUTPUTTYPE 222 -#define TK_AGGREGATE 223 -#define TK_BUFSIZE 224 -#define TK_LANGUAGE 225 -#define TK_REPLACE 226 -#define TK_STREAM 227 -#define TK_INTO 228 -#define TK_PAUSE 229 -#define TK_RESUME 230 -#define TK_PRIMARY 231 -#define TK_KEY 232 -#define TK_TRIGGER 233 -#define TK_AT_ONCE 234 -#define TK_WINDOW_CLOSE 235 -#define TK_IGNORE 236 -#define TK_EXPIRED 237 -#define TK_FILL_HISTORY 238 -#define TK_SUBTABLE 239 -#define TK_UNTREATED 240 -#define TK_KILL 241 -#define TK_CONNECTION 242 -#define TK_TRANSACTION 243 -#define TK_BALANCE 244 -#define TK_VGROUP 245 -#define TK_LEADER 246 -#define TK_MERGE 247 -#define TK_REDISTRIBUTE 248 -#define TK_SPLIT 249 -#define TK_DELETE 250 -#define TK_INSERT 251 -#define TK_NK_BIN 252 -#define TK_NK_HEX 253 -#define TK_NULL 254 -#define TK_NK_QUESTION 255 -#define TK_NK_ALIAS 256 -#define TK_NK_ARROW 257 -#define TK_ROWTS 258 -#define TK_QSTART 259 -#define TK_QEND 260 -#define TK_QDURATION 261 -#define TK_WSTART 262 -#define TK_WEND 263 -#define TK_WDURATION 264 -#define TK_IROWTS 265 -#define TK_ISFILLED 266 -#define TK_FLOW 267 -#define TK_FHIGH 268 -#define TK_FROWTS 269 -#define TK_CAST 270 -#define TK_POSITION 271 -#define TK_IN 272 -#define TK_FOR 273 -#define TK_NOW 274 -#define TK_TODAY 275 -#define TK_RAND 276 -#define TK_SUBSTR 277 -#define TK_SUBSTRING 278 -#define TK_BOTH 279 -#define TK_TRAILING 280 -#define TK_LEADING 281 -#define TK_TIMEZONE 282 -#define TK_CLIENT_VERSION 283 -#define TK_SERVER_VERSION 284 -#define TK_SERVER_STATUS 285 -#define TK_CURRENT_USER 286 -#define TK_PI 287 -#define TK_CASE 288 -#define TK_WHEN 289 -#define TK_THEN 290 -#define TK_ELSE 291 -#define TK_BETWEEN 292 -#define TK_IS 293 -#define TK_NK_LT 294 -#define TK_NK_GT 295 -#define TK_NK_LE 296 -#define TK_NK_GE 297 -#define TK_NK_NE 298 -#define TK_MATCH 299 -#define TK_NMATCH 300 -#define TK_CONTAINS 301 -#define TK_JOIN 302 -#define TK_INNER 303 -#define TK_LEFT 304 -#define TK_RIGHT 305 -#define TK_OUTER 306 -#define TK_SEMI 307 -#define TK_ANTI 308 -#define TK_ASOF 309 -#define TK_WINDOW 310 -#define TK_WINDOW_OFFSET 311 -#define TK_JLIMIT 312 -#define TK_SELECT 313 -#define TK_NK_HINT 314 -#define TK_DISTINCT 315 -#define TK_WHERE 316 -#define TK_PARTITION 317 -#define TK_BY 318 -#define TK_SESSION 319 -#define TK_STATE_WINDOW 320 -#define TK_EVENT_WINDOW 321 -#define TK_COUNT_WINDOW 322 -#define TK_ANOMALY_WINDOW 323 -#define TK_SLIDING 324 -#define TK_FILL 325 -#define TK_VALUE 326 -#define TK_VALUE_F 327 -#define TK_NONE 328 -#define TK_PREV 329 -#define TK_NULL_F 330 -#define TK_LINEAR 331 -#define TK_NEXT 332 -#define TK_HAVING 333 -#define TK_RANGE 334 -#define TK_EVERY 335 -#define TK_ORDER 336 -#define TK_SLIMIT 337 -#define TK_SOFFSET 338 -#define TK_LIMIT 339 -#define TK_OFFSET 340 -#define TK_ASC 341 -#define TK_NULLS 342 -#define TK_ABORT 343 -#define TK_AFTER 344 -#define TK_ATTACH 345 -#define TK_BEFORE 346 -#define TK_BEGIN 347 -#define TK_BITAND 348 -#define TK_BITNOT 349 -#define TK_BITOR 350 -#define TK_BLOCKS 351 -#define TK_CHANGE 352 -#define TK_COMMA 353 -#define TK_CONCAT 354 -#define TK_CONFLICT 355 -#define TK_COPY 356 -#define TK_DEFERRED 357 -#define TK_DELIMITERS 358 -#define TK_DETACH 359 -#define TK_DIVIDE 360 -#define TK_DOT 361 -#define TK_EACH 362 -#define TK_FAIL 363 -#define TK_GLOB 364 -#define TK_ID 365 -#define TK_IMMEDIATE 366 -#define TK_IMPORT 367 -#define TK_INITIALLY 368 -#define TK_INSTEAD 369 -#define TK_ISNULL 370 -#define TK_MODULES 371 -#define TK_NK_BITNOT 372 -#define TK_NK_SEMI 373 -#define TK_NOTNULL 374 -#define TK_OF 375 -#define TK_PLUS 376 -#define TK_PRIVILEGE 377 -#define TK_RAISE 378 -#define TK_RESTRICT 379 -#define TK_ROW 380 -#define TK_STAR 381 -#define TK_STATEMENT 382 -#define TK_STRICT 383 -#define TK_STRING 384 -#define TK_TIMES 385 -#define TK_VALUES 386 -#define TK_VARIABLE 387 -#define TK_WAL 388 +#define TK_DNODE 54 +#define TK_PORT 55 +#define TK_DNODES 56 +#define TK_RESTORE 57 +#define TK_NK_IPTOKEN 58 +#define TK_FORCE 59 +#define TK_UNSAFE 60 +#define TK_CLUSTER 61 +#define TK_LOCAL 62 +#define TK_QNODE 63 +#define TK_BNODE 64 +#define TK_SNODE 65 +#define TK_MNODE 66 +#define TK_VNODE 67 +#define TK_DATABASE 68 +#define TK_USE 69 +#define TK_FLUSH 70 +#define TK_TRIM 71 +#define TK_S3MIGRATE 72 +#define TK_COMPACT 73 +#define TK_IF 74 +#define TK_NOT 75 +#define TK_EXISTS 76 +#define TK_BUFFER 77 +#define TK_CACHEMODEL 78 +#define TK_CACHESIZE 79 +#define TK_COMP 80 +#define TK_DURATION 81 +#define TK_NK_VARIABLE 82 +#define TK_MAXROWS 83 +#define TK_MINROWS 84 +#define TK_KEEP 85 +#define TK_PAGES 86 +#define TK_PAGESIZE 87 +#define TK_TSDB_PAGESIZE 88 +#define TK_PRECISION 89 +#define TK_REPLICA 90 +#define TK_VGROUPS 91 +#define TK_SINGLE_STABLE 92 +#define TK_RETENTIONS 93 +#define TK_SCHEMALESS 94 +#define TK_WAL_LEVEL 95 +#define TK_WAL_FSYNC_PERIOD 96 +#define TK_WAL_RETENTION_PERIOD 97 +#define TK_WAL_RETENTION_SIZE 98 +#define TK_WAL_ROLL_PERIOD 99 +#define TK_WAL_SEGMENT_SIZE 100 +#define TK_STT_TRIGGER 101 +#define TK_TABLE_PREFIX 102 +#define TK_TABLE_SUFFIX 103 +#define TK_S3_CHUNKSIZE 104 +#define TK_S3_KEEPLOCAL 105 +#define TK_S3_COMPACT 106 +#define TK_KEEP_TIME_OFFSET 107 +#define TK_ENCRYPT_ALGORITHM 108 +#define TK_NK_COLON 109 +#define TK_BWLIMIT 110 +#define TK_START 111 +#define TK_TIMESTAMP 112 +#define TK_END 113 +#define TK_TABLE 114 +#define TK_NK_LP 115 +#define TK_NK_RP 116 +#define TK_USING 117 +#define TK_FILE 118 +#define TK_STABLE 119 +#define TK_COLUMN 120 +#define TK_MODIFY 121 +#define TK_RENAME 122 +#define TK_TAG 123 +#define TK_SET 124 +#define TK_NK_EQ 125 +#define TK_TAGS 126 +#define TK_BOOL 127 +#define TK_TINYINT 128 +#define TK_SMALLINT 129 +#define TK_INT 130 +#define TK_INTEGER 131 +#define TK_BIGINT 132 +#define TK_FLOAT 133 +#define TK_DOUBLE 134 +#define TK_BINARY 135 +#define TK_NCHAR 136 +#define TK_UNSIGNED 137 +#define TK_JSON 138 +#define TK_VARCHAR 139 +#define TK_MEDIUMBLOB 140 +#define TK_BLOB 141 +#define TK_VARBINARY 142 +#define TK_GEOMETRY 143 +#define TK_DECIMAL 144 +#define TK_COMMENT 145 +#define TK_MAX_DELAY 146 +#define TK_WATERMARK 147 +#define TK_ROLLUP 148 +#define TK_TTL 149 +#define TK_SMA 150 +#define TK_DELETE_MARK 151 +#define TK_FIRST 152 +#define TK_LAST 153 +#define TK_SHOW 154 +#define TK_FULL 155 +#define TK_PRIVILEGES 156 +#define TK_DATABASES 157 +#define TK_TABLES 158 +#define TK_STABLES 159 +#define TK_MNODES 160 +#define TK_QNODES 161 +#define TK_ARBGROUPS 162 +#define TK_FUNCTIONS 163 +#define TK_INDEXES 164 +#define TK_ACCOUNTS 165 +#define TK_APPS 166 +#define TK_CONNECTIONS 167 +#define TK_LICENCES 168 +#define TK_GRANTS 169 +#define TK_LOGS 170 +#define TK_MACHINES 171 +#define TK_ENCRYPTIONS 172 +#define TK_QUERIES 173 +#define TK_SCORES 174 +#define TK_TOPICS 175 +#define TK_VARIABLES 176 +#define TK_BNODES 177 +#define TK_SNODES 178 +#define TK_TRANSACTIONS 179 +#define TK_DISTRIBUTED 180 +#define TK_CONSUMERS 181 +#define TK_SUBSCRIPTIONS 182 +#define TK_VNODES 183 +#define TK_ALIVE 184 +#define TK_VIEWS 185 +#define TK_VIEW 186 +#define TK_COMPACTS 187 +#define TK_NORMAL 188 +#define TK_CHILD 189 +#define TK_LIKE 190 +#define TK_TBNAME 191 +#define TK_QTAGS 192 +#define TK_AS 193 +#define TK_SYSTEM 194 +#define TK_TSMA 195 +#define TK_INTERVAL 196 +#define TK_RECURSIVE 197 +#define TK_TSMAS 198 +#define TK_FUNCTION 199 +#define TK_INDEX 200 +#define TK_COUNT 201 +#define TK_LAST_ROW 202 +#define TK_META 203 +#define TK_ONLY 204 +#define TK_TOPIC 205 +#define TK_CONSUMER 206 +#define TK_GROUP 207 +#define TK_DESC 208 +#define TK_DESCRIBE 209 +#define TK_RESET 210 +#define TK_QUERY 211 +#define TK_CACHE 212 +#define TK_EXPLAIN 213 +#define TK_ANALYZE 214 +#define TK_VERBOSE 215 +#define TK_NK_BOOL 216 +#define TK_RATIO 217 +#define TK_NK_FLOAT 218 +#define TK_OUTPUTTYPE 219 +#define TK_AGGREGATE 220 +#define TK_BUFSIZE 221 +#define TK_LANGUAGE 222 +#define TK_REPLACE 223 +#define TK_STREAM 224 +#define TK_INTO 225 +#define TK_PAUSE 226 +#define TK_RESUME 227 +#define TK_PRIMARY 228 +#define TK_KEY 229 +#define TK_TRIGGER 230 +#define TK_AT_ONCE 231 +#define TK_WINDOW_CLOSE 232 +#define TK_IGNORE 233 +#define TK_EXPIRED 234 +#define TK_FILL_HISTORY 235 +#define TK_UPDATE 236 +#define TK_SUBTABLE 237 +#define TK_UNTREATED 238 +#define TK_KILL 239 +#define TK_CONNECTION 240 +#define TK_TRANSACTION 241 +#define TK_BALANCE 242 +#define TK_VGROUP 243 +#define TK_LEADER 244 +#define TK_MERGE 245 +#define TK_REDISTRIBUTE 246 +#define TK_SPLIT 247 +#define TK_DELETE 248 +#define TK_INSERT 249 +#define TK_NK_BIN 250 +#define TK_NK_HEX 251 +#define TK_NULL 252 +#define TK_NK_QUESTION 253 +#define TK_NK_ALIAS 254 +#define TK_NK_ARROW 255 +#define TK_ROWTS 256 +#define TK_QSTART 257 +#define TK_QEND 258 +#define TK_QDURATION 259 +#define TK_WSTART 260 +#define TK_WEND 261 +#define TK_WDURATION 262 +#define TK_IROWTS 263 +#define TK_ISFILLED 264 +#define TK_CAST 265 +#define TK_POSITION 266 +#define TK_IN 267 +#define TK_FOR 268 +#define TK_NOW 269 +#define TK_TODAY 270 +#define TK_RAND 271 +#define TK_SUBSTR 272 +#define TK_SUBSTRING 273 +#define TK_BOTH 274 +#define TK_TRAILING 275 +#define TK_LEADING 276 +#define TK_TIMEZONE 277 +#define TK_CLIENT_VERSION 278 +#define TK_SERVER_VERSION 279 +#define TK_SERVER_STATUS 280 +#define TK_CURRENT_USER 281 +#define TK_PI 282 +#define TK_CASE 283 +#define TK_WHEN 284 +#define TK_THEN 285 +#define TK_ELSE 286 +#define TK_BETWEEN 287 +#define TK_IS 288 +#define TK_NK_LT 289 +#define TK_NK_GT 290 +#define TK_NK_LE 291 +#define TK_NK_GE 292 +#define TK_NK_NE 293 +#define TK_MATCH 294 +#define TK_NMATCH 295 +#define TK_CONTAINS 296 +#define TK_JOIN 297 +#define TK_INNER 298 +#define TK_LEFT 299 +#define TK_RIGHT 300 +#define TK_OUTER 301 +#define TK_SEMI 302 +#define TK_ANTI 303 +#define TK_ASOF 304 +#define TK_WINDOW 305 +#define TK_WINDOW_OFFSET 306 +#define TK_JLIMIT 307 +#define TK_SELECT 308 +#define TK_NK_HINT 309 +#define TK_DISTINCT 310 +#define TK_WHERE 311 +#define TK_PARTITION 312 +#define TK_BY 313 +#define TK_SESSION 314 +#define TK_STATE_WINDOW 315 +#define TK_EVENT_WINDOW 316 +#define TK_COUNT_WINDOW 317 +#define TK_SLIDING 318 +#define TK_FILL 319 +#define TK_VALUE 320 +#define TK_VALUE_F 321 +#define TK_NONE 322 +#define TK_PREV 323 +#define TK_NULL_F 324 +#define TK_LINEAR 325 +#define TK_NEXT 326 +#define TK_HAVING 327 +#define TK_RANGE 328 +#define TK_EVERY 329 +#define TK_ORDER 330 +#define TK_SLIMIT 331 +#define TK_SOFFSET 332 +#define TK_LIMIT 333 +#define TK_OFFSET 334 +#define TK_ASC 335 +#define TK_NULLS 336 +#define TK_ABORT 337 +#define TK_AFTER 338 +#define TK_ATTACH 339 +#define TK_BEFORE 340 +#define TK_BEGIN 341 +#define TK_BITAND 342 +#define TK_BITNOT 343 +#define TK_BITOR 344 +#define TK_BLOCKS 345 +#define TK_CHANGE 346 +#define TK_COMMA 347 +#define TK_CONCAT 348 +#define TK_CONFLICT 349 +#define TK_COPY 350 +#define TK_DEFERRED 351 +#define TK_DELIMITERS 352 +#define TK_DETACH 353 +#define TK_DIVIDE 354 +#define TK_DOT 355 +#define TK_EACH 356 +#define TK_FAIL 357 +#define TK_GLOB 358 +#define TK_ID 359 +#define TK_IMMEDIATE 360 +#define TK_IMPORT 361 +#define TK_INITIALLY 362 +#define TK_INSTEAD 363 +#define TK_ISNULL 364 +#define TK_MODULES 365 +#define TK_NK_BITNOT 366 +#define TK_NK_SEMI 367 +#define TK_NOTNULL 368 +#define TK_OF 369 +#define TK_PLUS 370 +#define TK_PRIVILEGE 371 +#define TK_RAISE 372 +#define TK_RESTRICT 373 +#define TK_ROW 374 +#define TK_STAR 375 +#define TK_STATEMENT 376 +#define TK_STRICT 377 +#define TK_STRING 378 +#define TK_TIMES 379 +#define TK_VALUES 380 +#define TK_VARIABLE 381 +#define TK_WAL 382 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index e5bacf85b2..519207377b 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -62,7 +62,6 @@ typedef enum EFunctionType { FUNCTION_TYPE_UNIQUE, FUNCTION_TYPE_STATE_COUNT, FUNCTION_TYPE_STATE_DURATION, - FUNCTION_TYPE_FORECAST, // math function FUNCTION_TYPE_ABS = 1000, @@ -150,9 +149,6 @@ typedef enum EFunctionType { FUNCTION_TYPE_TBUID, FUNCTION_TYPE_VGID, FUNCTION_TYPE_VGVER, - FUNCTION_TYPE_FORECAST_LOW, - FUNCTION_TYPE_FORECAST_HIGH, - FUNCTION_TYPE_FORECAST_ROWTS, // internal function FUNCTION_TYPE_SELECT_VALUE = 3750, @@ -267,7 +263,6 @@ bool fmIsForbidSysTableFunc(int32_t funcId); bool fmIsIntervalInterpoFunc(int32_t funcId); bool fmIsInterpFunc(int32_t funcId); bool fmIsLastRowFunc(int32_t funcId); -bool fmIsForecastFunc(int32_t funcId); bool fmIsNotNullOutputFunc(int32_t funcId); bool fmIsSelectValueFunc(int32_t funcId); bool fmIsSystemInfoFunc(int32_t funcId); @@ -277,7 +272,6 @@ bool fmIsMultiRowsFunc(int32_t funcId); bool fmIsKeepOrderFunc(int32_t funcId); bool fmIsCumulativeFunc(int32_t funcId); bool fmIsInterpPseudoColumnFunc(int32_t funcId); -bool fmIsForecastPseudoColumnFunc(int32_t funcId); bool fmIsGroupKeyFunc(int32_t funcId); bool fmIsBlockDistFunc(int32_t funcId); bool fmIsIgnoreNullFunc(int32_t funcId); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index bbf2889289..2a18e800b8 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -318,21 +318,6 @@ typedef struct SAlterDnodeStmt { char value[TSDB_DNODE_VALUE_LEN]; } SAlterDnodeStmt; -typedef struct { - ENodeType type; - char url[TSDB_ANAL_ANODE_URL_LEN + 3]; -} SCreateAnodeStmt; - -typedef struct { - ENodeType type; - int32_t anodeId; -} SDropAnodeStmt; - -typedef struct { - ENodeType type; - int32_t anodeId; -} SUpdateAnodeStmt; - typedef struct SShowStmt { ENodeType type; SNode* pDbName; // SValueNode diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 8e4a3ea32b..bfe9e9555b 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -204,11 +204,6 @@ typedef struct SInterpFuncLogicNode { SNode* pTimeSeries; // SColumnNode } SInterpFuncLogicNode; -typedef struct SForecastFuncLogicNode { - SLogicNode node; - SNodeList* pFuncs; -} SForecastFuncLogicNode; - typedef struct SGroupCacheLogicNode { SLogicNode node; bool grpColsMayBeNull; @@ -280,7 +275,6 @@ typedef enum EWindowType { WINDOW_TYPE_STATE, WINDOW_TYPE_EVENT, WINDOW_TYPE_COUNT, - WINDOW_TYPE_ANOMALY } EWindowType; typedef enum EWindowAlgorithm { @@ -321,8 +315,6 @@ typedef struct SWindowLogicNode { int64_t windowCount; int64_t windowSliding; SNodeList* pTsmaSubplans; - SNode* pAnomalyExpr; - char anomalyOpt[TSDB_ANAL_ALGO_OPTION_LEN]; } SWindowLogicNode; typedef struct SFillLogicNode { @@ -515,12 +507,6 @@ typedef struct SInterpFuncPhysiNode { SNode* pTimeSeries; // SColumnNode } SInterpFuncPhysiNode; -typedef struct SForecastFuncPhysiNode { - SPhysiNode node; - SNodeList* pExprs; - SNodeList* pFuncs; -} SForecastFuncPhysiNode; - typedef struct SSortMergeJoinPhysiNode { SPhysiNode node; EJoinType joinType; @@ -718,12 +704,6 @@ typedef struct SCountWinodwPhysiNode { typedef SCountWinodwPhysiNode SStreamCountWinodwPhysiNode; -typedef struct SAnomalyWindowPhysiNode { - SWindowPhysiNode window; - SNode* pAnomalyKey; - char anomalyOpt[TSDB_ANAL_ALGO_OPTION_LEN]; -} SAnomalyWindowPhysiNode; - typedef struct SSortPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of order_by_clause and parameter expression of aggregate function diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 4763077ed9..f5567c735e 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -347,13 +347,6 @@ typedef struct SCountWindowNode { int64_t windowSliding; } SCountWindowNode; -typedef struct SAnomalyWindowNode { - ENodeType type; // QUERY_NODE_ANOMALY_WINDOW - SNode* pCol; // timestamp primary key - SNode* pExpr; - char anomalyOpt[TSDB_ANAL_ALGO_OPTION_LEN]; -} SAnomalyWindowNode; - typedef enum EFillMode { FILL_MODE_NONE = 1, FILL_MODE_VALUE, @@ -449,8 +442,6 @@ typedef struct SSelectStmt { bool hasTailFunc; bool hasInterpFunc; bool hasInterpPseudoColFunc; - bool hasForecastFunc; - bool hasForecastPseudoColFunc; bool hasLastRowFunc; bool hasLastFunc; bool hasTimeLineFunc; diff --git a/include/libs/scalar/scalar.h b/include/libs/scalar/scalar.h index fd936dd087..b06b7c74c7 100644 --- a/include/libs/scalar/scalar.h +++ b/include/libs/scalar/scalar.h @@ -139,7 +139,6 @@ int32_t mavgScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam int32_t hllScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t csumScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t diffScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); -int32_t forecastScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t stateCountScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t stateDurationScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t histogramScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 2620342b22..2b116514e6 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -476,24 +476,6 @@ int32_t taosGetErrSize(); #define TSDB_CODE_DNODE_INVALID_MONITOR_PARAS TAOS_DEF_ERROR_CODE(0, 0x0429) #define TSDB_CODE_MNODE_STOPPED TAOS_DEF_ERROR_CODE(0, 0x042A) -// anode -#define TSDB_CODE_MND_ANODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0430) -#define TSDB_CODE_MND_ANODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0431) -#define TSDB_CODE_MND_ANODE_TOO_LONG_URL TAOS_DEF_ERROR_CODE(0, 0x0432) -#define TSDB_CODE_MND_ANODE_INVALID_PROTOCOL TAOS_DEF_ERROR_CODE(0, 0x0433) -#define TSDB_CODE_MND_ANODE_INVALID_VERSION TAOS_DEF_ERROR_CODE(0, 0x0434) -#define TSDB_CODE_MND_ANODE_INVALID_ALGO_TYPE TAOS_DEF_ERROR_CODE(0, 0x0435) -#define TSDB_CODE_MND_ANODE_TOO_MANY_ALGO TAOS_DEF_ERROR_CODE(0, 0x0436) -#define TSDB_CODE_MND_ANODE_TOO_LONG_ALGO_NAME TAOS_DEF_ERROR_CODE(0, 0x0437) -#define TSDB_CODE_MND_ANODE_TOO_MANY_ALGO_TYPE TAOS_DEF_ERROR_CODE(0, 0x0438) - -// analysis -#define TSDB_CODE_ANAL_URL_RSP_IS_NULL TAOS_DEF_ERROR_CODE(0, 0x0440) -#define TSDB_CODE_ANAL_URL_CANT_ACCESS TAOS_DEF_ERROR_CODE(0, 0x0441) -#define TSDB_CODE_ANAL_ALGO_NOT_FOUND TAOS_DEF_ERROR_CODE(0, 0x0442) -#define TSDB_CODE_ANAL_ALGO_NOT_LOAD TAOS_DEF_ERROR_CODE(0, 0x0443) -#define TSDB_CODE_ANAL_BUF_INVALID_TYPE TAOS_DEF_ERROR_CODE(0, 0x0444) - // mnode-sma #define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0480) #define TSDB_CODE_MND_SMA_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0481) @@ -885,10 +867,6 @@ int32_t taosGetErrSize(); #define TSDB_CODE_PAR_TAG_NAME_DUPLICATED TAOS_DEF_ERROR_CODE(0, 0x267F) #define TSDB_CODE_PAR_NOT_ALLOWED_DIFFERENT_BY_ROW_FUNC TAOS_DEF_ERROR_CODE(0, 0x2680) #define TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR TAOS_DEF_ERROR_CODE(0, 0x2681) -#define TSDB_CODE_PAR_INVALID_ANOMALY_WIN_TYPE TAOS_DEF_ERROR_CODE(0, 0x2682) -#define TSDB_CODE_PAR_INVALID_ANOMALY_WIN_COL TAOS_DEF_ERROR_CODE(0, 0x2683) -#define TSDB_CODE_PAR_INVALID_ANOMALY_WIN_OPT TAOS_DEF_ERROR_CODE(0, 0x2684) -#define TSDB_CODE_PAR_INVALID_FORECAST_CLAUSE TAOS_DEF_ERROR_CODE(0, 0x2685) #define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF) //planner diff --git a/include/util/tdef.h b/include/util/tdef.h index b4cb1bdd1c..a2bc77d819 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -293,12 +293,6 @@ typedef enum ELogicConditionType { #define TSDB_SLOW_QUERY_SQL_LEN 512 #define TSDB_SHOW_SUBQUERY_LEN 1000 #define TSDB_LOG_VAR_LEN 32 -#define TSDB_ANAL_ANODE_URL_LEN 128 -#define TSDB_ANAL_ALGO_NAME_LEN 64 -#define TSDB_ANAL_ALGO_TYPE_LEN 24 -#define TSDB_ANAL_ALGO_KEY_LEN (TSDB_ANAL_ALGO_NAME_LEN + 9) -#define TSDB_ANAL_ALGO_URL_LEN (TSDB_ANAL_ANODE_URL_LEN + TSDB_ANAL_ALGO_TYPE_LEN + 1) -#define TSDB_ANAL_ALGO_OPTION_LEN 256 #define TSDB_MAX_EP_NUM 10 @@ -610,12 +604,6 @@ enum { RAND_ERR_MEMORY = 1, RAND_ERR_FILE = 2, RAND_ERR_NETWORK = 4 }; #define MONITOR_TAG_VALUE_LEN 300 #define MONITOR_METRIC_NAME_LEN 100 -typedef enum { - ANAL_ALGO_TYPE_ANOMALY_DETECT = 0, - ANAL_ALGO_TYPE_FORECAST = 1, - ANAL_ALGO_TYPE_END, -} EAnalAlgoType; - #ifdef __cplusplus } #endif diff --git a/include/util/tjson.h b/include/util/tjson.h index 88c2a1efb7..b9ea72b4bb 100644 --- a/include/util/tjson.h +++ b/include/util/tjson.h @@ -68,10 +68,7 @@ int32_t tjsonAddItemToArray(SJson* pJson, SJson* pItem); SJson* tjsonGetObjectItem(const SJson* pJson, const char* pName); int32_t tjsonGetObjectName(const SJson* pJson, char** pName); int32_t tjsonGetObjectValueString(const SJson* pJson, char** pStringValue); -void tjsonGetObjectValueBigInt(const SJson* pJson, int64_t* pVal); -void tjsonGetObjectValueDouble(const SJson* pJson, double* pVal); int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal); -int32_t tjsonGetStringValue2(const SJson* pJson, const char* pName, char* pVal, int32_t maxLen); int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal); int32_t tjsonGetBigIntValue(const SJson* pJson, const char* pName, int64_t* pVal); int32_t tjsonGetIntValue(const SJson* pJson, const char* pName, int32_t* pVal); diff --git a/source/common/src/systable.c b/source/common/src/systable.c index eef38bf18e..19df0f5a78 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -399,20 +399,6 @@ static const SSysDbTableSchema userCompactsDetailSchema[] = { {.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, }; -static const SSysDbTableSchema anodesSchema[] = { - {.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, - {.name = "url", .bytes = TSDB_ANAL_ANODE_URL_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, - {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, - {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, - {.name = "update_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, -}; - -static const SSysDbTableSchema anodesFullSchema[] = { - {.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, - {.name = "type", .bytes = TSDB_ANAL_ALGO_TYPE_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, - {.name = "algo", .bytes = TSDB_ANAL_ALGO_NAME_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, -}; - static const SSysDbTableSchema tsmaSchema[] = { {.name = "tsma_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, @@ -487,8 +473,6 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_ARBGROUPS, arbGroupsSchema, tListLen(arbGroupsSchema), true}, {TSDB_INS_TABLE_ENCRYPTIONS, encryptionsSchema, tListLen(encryptionsSchema), true}, {TSDB_INS_TABLE_TSMAS, tsmaSchema, tListLen(tsmaSchema), false}, - {TSDB_INS_TABLE_ANODES, anodesSchema, tListLen(anodesSchema), true}, - {TSDB_INS_TABLE_ANODES_FULL, anodesFullSchema, tListLen(anodesFullSchema), true}, }; static const SSysDbTableSchema connectionsSchema[] = { diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 63fcf900bf..4c4b78278e 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -40,7 +40,6 @@ #define TD_MSG_RANGE_CODE_ #include "tmsgdef.h" -#include "tanal.h" #include "tcol.h" #include "tlog.h" @@ -1454,7 +1453,6 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { } TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->ipWhiteVer)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer)); TAOS_CHECK_EXIT(tSerializeSMonitorParas(&encoder, &pReq->clusterCfg.monitorParas)); tEndEncode(&encoder); @@ -1578,10 +1576,6 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->ipWhiteVer)); } - if (!tDecodeIsEnd(&decoder)) { - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->analVer)); - } - if (!tDecodeIsEnd(&decoder)) { TAOS_CHECK_EXIT(tDeserializeSMonitorParas(&decoder, &pReq->clusterCfg.monitorParas)); } @@ -1658,7 +1652,6 @@ int32_t tSerializeSStatusRsp(void *buf, int32_t bufLen, SStatusRsp *pRsp) { TAOS_CHECK_EXIT(tEncodeI32(&encoder, pRsp->statusSeq)); TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->ipWhiteVer)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->analVer)); tEndEncode(&encoder); _exit: @@ -1711,10 +1704,6 @@ int32_t tDeserializeSStatusRsp(void *buf, int32_t bufLen, SStatusRsp *pRsp) { TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->ipWhiteVer)); } - if (!tDecodeIsEnd(&decoder)) { - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->analVer)); - } - tEndDecode(&decoder); _exit: tDecoderClear(&decoder); @@ -2056,156 +2045,6 @@ _exit: return code; } -int32_t tSerializeRetrieveAnalAlgoReq(void *buf, int32_t bufLen, SRetrieveAnalAlgoReq *pReq) { - SEncoder encoder = {0}; - int32_t code = 0; - int32_t lino; - int32_t tlen; - tEncoderInit(&encoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartEncode(&encoder)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->dnodeId)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer)); - tEndEncode(&encoder); - -_exit: - if (code) { - tlen = code; - } else { - tlen = encoder.pos; - } - tEncoderClear(&encoder); - return tlen; -} - -int32_t tDeserializeRetrieveAnalAlgoReq(void *buf, int32_t bufLen, SRetrieveAnalAlgoReq *pReq) { - SDecoder decoder = {0}; - int32_t code = 0; - int32_t lino; - - tDecoderInit(&decoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartDecode(&decoder)); - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->dnodeId)); - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->analVer)); - tEndDecode(&decoder); - -_exit: - tDecoderClear(&decoder); - return code; -} - -int32_t tSerializeRetrieveAnalAlgoRsp(void *buf, int32_t bufLen, SRetrieveAnalAlgoRsp *pRsp) { - SEncoder encoder = {0}; - int32_t code = 0; - int32_t lino; - int32_t tlen; - tEncoderInit(&encoder, buf, bufLen); - - int32_t numOfAlgos = 0; - void *pIter = taosHashIterate(pRsp->hash, NULL); - while (pIter != NULL) { - SAnalUrl *pUrl = pIter; - size_t nameLen = 0; - const char *name = taosHashGetKey(pIter, &nameLen); - if (nameLen > 0 && nameLen <= TSDB_ANAL_ALGO_KEY_LEN && pUrl->urlLen > 0) { - numOfAlgos++; - } - pIter = taosHashIterate(pRsp->hash, pIter); - } - - TAOS_CHECK_EXIT(tStartEncode(&encoder)); - TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->ver)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, numOfAlgos)); - - pIter = taosHashIterate(pRsp->hash, NULL); - while (pIter != NULL) { - SAnalUrl *pUrl = pIter; - size_t nameLen = 0; - const char *name = taosHashGetKey(pIter, &nameLen); - if (nameLen > 0 && pUrl->urlLen > 0) { - TAOS_CHECK_EXIT(tEncodeI32(&encoder, nameLen)); - TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)name, nameLen)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->anode)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->type)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->urlLen)); - TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)pUrl->url, pUrl->urlLen)); - } - pIter = taosHashIterate(pRsp->hash, pIter); - } - - tEndEncode(&encoder); - -_exit: - if (code) { - tlen = code; - } else { - tlen = encoder.pos; - } - tEncoderClear(&encoder); - return tlen; -} - -int32_t tDeserializeRetrieveAnalAlgoRsp(void *buf, int32_t bufLen, SRetrieveAnalAlgoRsp *pRsp) { - if (pRsp->hash == NULL) { - pRsp->hash = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); - if (pRsp->hash == NULL) { - terrno = TSDB_CODE_OUT_OF_BUFFER; - return terrno; - } - } - - SDecoder decoder = {0}; - int32_t code = 0; - int32_t lino; - tDecoderInit(&decoder, buf, bufLen); - - int32_t numOfAlgos = 0; - int32_t nameLen; - int32_t type; - char name[TSDB_ANAL_ALGO_KEY_LEN]; - SAnalUrl url = {0}; - - TAOS_CHECK_EXIT(tStartDecode(&decoder)); - TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->ver)); - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &numOfAlgos)); - - for (int32_t f = 0; f < numOfAlgos; ++f) { - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &nameLen)); - if (nameLen > 0 && nameLen <= TSDB_ANAL_ALGO_NAME_LEN) { - TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, name)); - } - - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &url.anode)); - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &type)); - url.type = (EAnalAlgoType)type; - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &url.urlLen)); - if (url.urlLen > 0) { - TAOS_CHECK_EXIT(tDecodeBinaryAlloc(&decoder, (void **)&url.url, NULL) < 0); - } - - TAOS_CHECK_EXIT(taosHashPut(pRsp->hash, name, nameLen, &url, sizeof(SAnalUrl))); - } - - tEndDecode(&decoder); - -_exit: - tDecoderClear(&decoder); - return code; -} - -void tFreeRetrieveAnalAlgoRsp(SRetrieveAnalAlgoRsp *pRsp) { - void *pIter = taosHashIterate(pRsp->hash, NULL); - while (pIter != NULL) { - SAnalUrl *pUrl = (SAnalUrl *)pIter; - taosMemoryFree(pUrl->url); - pIter = taosHashIterate(pRsp->hash, pIter); - } - taosHashCleanup(pRsp->hash); - - pRsp->hash = NULL; -} - void tFreeSCreateUserReq(SCreateUserReq *pReq) { FREESQL(); taosMemoryFreeClear(pReq->pIpRanges); @@ -3123,108 +2962,6 @@ _exit: return code; } -int32_t tSerializeSMCreateAnodeReq(void *buf, int32_t bufLen, SMCreateAnodeReq *pReq) { - SEncoder encoder = {0}; - int32_t code = 0; - int32_t lino; - int32_t tlen; - tEncoderInit(&encoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartEncode(&encoder)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->urlLen)); - if (pReq->urlLen > 0) { - TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)pReq->url, pReq->urlLen)); - } - ENCODESQL(); - tEndEncode(&encoder); - -_exit: - if (code) { - tlen = code; - } else { - tlen = encoder.pos; - } - tEncoderClear(&encoder); - return tlen; -} - -int32_t tDeserializeSMCreateAnodeReq(void *buf, int32_t bufLen, SMCreateAnodeReq *pReq) { - SDecoder decoder = {0}; - int32_t code = 0; - int32_t lino; - - tDecoderInit(&decoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartDecode(&decoder)); - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->urlLen)); - if (pReq->urlLen > 0) { - TAOS_CHECK_EXIT(tDecodeBinaryAlloc(&decoder, (void **)&pReq->url, NULL)); - } - - DECODESQL(); - tEndDecode(&decoder); - -_exit: - tDecoderClear(&decoder); - return code; -} - -void tFreeSMCreateAnodeReq(SMCreateAnodeReq *pReq) { - taosMemoryFreeClear(pReq->url); - FREESQL(); -} - -int32_t tSerializeSMDropAnodeReq(void *buf, int32_t bufLen, SMDropAnodeReq *pReq) { - SEncoder encoder = {0}; - int32_t code = 0; - int32_t lino; - int32_t tlen; - tEncoderInit(&encoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartEncode(&encoder)); - TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->anodeId)); - ENCODESQL(); - tEndEncode(&encoder); - -_exit: - if (code) { - tlen = code; - } else { - tlen = encoder.pos; - } - tEncoderClear(&encoder); - return tlen; -} - -int32_t tDeserializeSMDropAnodeReq(void *buf, int32_t bufLen, SMDropAnodeReq *pReq) { - SDecoder decoder = {0}; - int32_t code = 0; - int32_t lino; - - tDecoderInit(&decoder, buf, bufLen); - - TAOS_CHECK_EXIT(tStartDecode(&decoder)); - TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->anodeId)); - DECODESQL(); - tEndDecode(&decoder); - -_exit: - tDecoderClear(&decoder); - return code; -} - -void tFreeSMDropAnodeReq(SMDropAnodeReq *pReq) { FREESQL(); } - -int32_t tSerializeSMUpdateAnodeReq(void *buf, int32_t bufLen, SMUpdateAnodeReq *pReq) { - return tSerializeSMDropAnodeReq(buf, bufLen, pReq); -} - -int32_t tDeserializeSMUpdateAnodeReq(void *buf, int32_t bufLen, SMUpdateAnodeReq *pReq) { - return tDeserializeSMDropAnodeReq(buf, bufLen, pReq); -} - -void tFreeSMUpdateAnodeReq(SMUpdateAnodeReq *pReq) { tFreeSMDropAnodeReq(pReq); } - int32_t tSerializeSCreateDnodeReq(void *buf, int32_t bufLen, SCreateDnodeReq *pReq) { SEncoder encoder = {0}; int32_t code = 0; diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index bc33fc43dc..f1f3a3bee7 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -18,7 +18,6 @@ #include "dmInt.h" #include "monitor.h" #include "systable.h" -#include "tanal.h" #include "tchecksum.h" extern SConfig *tsCfg; @@ -87,46 +86,6 @@ static void dmMayShouldUpdateIpWhiteList(SDnodeMgmt *pMgmt, int64_t ver) { } } -static void dmMayShouldUpdateAnalFunc(SDnodeMgmt *pMgmt, int64_t newVer) { - int32_t code = 0; - int64_t oldVer = taosAnalGetVersion(); - if (oldVer == newVer) return; - dDebug("analysis on dnode ver:%" PRId64 ", status ver:%" PRId64, oldVer, newVer); - - SRetrieveAnalAlgoReq req = {.dnodeId = pMgmt->pData->dnodeId, .analVer = oldVer}; - int32_t contLen = tSerializeRetrieveAnalAlgoReq(NULL, 0, &req); - if (contLen < 0) { - dError("failed to serialize analysis function ver request since %s", tstrerror(contLen)); - return; - } - - void *pHead = rpcMallocCont(contLen); - contLen = tSerializeRetrieveAnalAlgoReq(pHead, contLen, &req); - if (contLen < 0) { - rpcFreeCont(pHead); - dError("failed to serialize analysis function ver request since %s", tstrerror(contLen)); - return; - } - - SRpcMsg rpcMsg = { - .pCont = pHead, - .contLen = contLen, - .msgType = TDMT_MND_RETRIEVE_ANAL_ALGO, - .info.ahandle = (void *)0x9527, - .info.refId = 0, - .info.noResp = 0, - .info.handle = 0, - }; - SEpSet epset = {0}; - - (void)dmGetMnodeEpSet(pMgmt->pData, &epset); - - code = rpcSendRequest(pMgmt->msgCb.clientRpc, &epset, &rpcMsg, NULL); - if (code != 0) { - dError("failed to send retrieve analysis func ver request since %s", tstrerror(code)); - } -} - static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) { const STraceId *trace = &pRsp->info.traceId; dGTrace("status rsp received from mnode, statusSeq:%d code:0x%x", pMgmt->statusSeq, pRsp->code); @@ -154,7 +113,6 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) { dmUpdateEps(pMgmt->pData, statusRsp.pDnodeEps); } dmMayShouldUpdateIpWhiteList(pMgmt, statusRsp.ipWhiteVer); - dmMayShouldUpdateAnalFunc(pMgmt, statusRsp.analVer); } tFreeSStatusRsp(&statusRsp); } @@ -216,7 +174,6 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { pMgmt->statusSeq++; req.statusSeq = pMgmt->statusSeq; req.ipWhiteVer = pMgmt->pData->ipWhiteVer; - req.analVer = taosAnalGetVersion(); int32_t contLen = tSerializeSStatusReq(NULL, 0, &req); if (contLen < 0) { diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c index 74ef67ff1d..22c2b2f5b2 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c @@ -16,7 +16,6 @@ #define _DEFAULT_SOURCE #include "dmInt.h" #include "libs/function/tudf.h" -#include "tanal.h" static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) { int32_t code = 0; @@ -81,10 +80,6 @@ static int32_t dmOpenMgmt(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) { dError("failed to start udfd since %s", tstrerror(code)); } - if ((code = taosAnalInit()) != 0) { - dError("failed to init analysis env since %s", tstrerror(code)); - } - pOutput->pMgmt = pMgmt; return 0; } diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index d9aa4614b6..7204cde8f7 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -141,9 +141,6 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_DNODE_LIST, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_SNODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_SNODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_ANODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_MND_UPDATE_ANODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_ANODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_DB, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_DB, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_USE_DB, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; @@ -183,7 +180,6 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH_TTL_EXPIRED_TBS_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TABLE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_MND_RETRIEVE_ANAL_ALGO, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_RETRIEVE_IP_WHITE, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_GET_USER_WHITELIST, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_GET_INDEX, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 0c2bd2bc0f..2d0ad70adf 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -20,7 +20,6 @@ #include "libs/function/tudf.h" #include "tgrant.h" #include "tcompare.h" -#include "tanal.h" // clang-format on #define DM_INIT_AUDIT() \ @@ -215,7 +214,6 @@ void dmCleanup() { dError("failed to close udfc"); } udfStopUdfd(); - taosAnalCleanup(); taosStopCacheRefreshWorker(); (void)dmDiskClose(); DestroyRegexCache(); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index e84d756e0a..3090903805 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -17,7 +17,6 @@ #include "dmMgmt.h" #include "qworker.h" #include "tversion.h" -#include "tanal.h" static inline void dmSendRsp(SRpcMsg *pMsg) { if (rpcSendResponse(pMsg) != 0) { @@ -107,16 +106,6 @@ static bool dmIsForbiddenIp(int8_t forbidden, char *user, uint32_t clientIp) { } } -static void dmUpdateAnalFunc(SDnodeData *pData, void *pTrans, SRpcMsg *pRpc) { - SRetrieveAnalAlgoRsp rsp = {0}; - if (tDeserializeRetrieveAnalAlgoRsp(pRpc->pCont, pRpc->contLen, &rsp) == 0) { - taosAnalUpdate(rsp.ver, rsp.hash); - rsp.hash = NULL; - } - tFreeRetrieveAnalAlgoRsp(&rsp); - rpcFreeCont(pRpc->pCont); -} - static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { SDnodeTrans *pTrans = &pDnode->trans; int32_t code = -1; @@ -165,9 +154,6 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { case TDMT_MND_RETRIEVE_IP_WHITE_RSP: dmUpdateRpcIpWhite(&pDnode->data, pTrans->serverRpc, pRpc); return; - case TDMT_MND_RETRIEVE_ANAL_ALGO_RSP: - dmUpdateAnalFunc(&pDnode->data, pTrans->serverRpc, pRpc); - return; default: break; } diff --git a/source/dnode/mnode/impl/CMakeLists.txt b/source/dnode/mnode/impl/CMakeLists.txt index 1a74b6fa9f..cb148c1949 100644 --- a/source/dnode/mnode/impl/CMakeLists.txt +++ b/source/dnode/mnode/impl/CMakeLists.txt @@ -15,9 +15,6 @@ IF (TD_ENTERPRISE) add_definitions(-DUSE_COS) ENDIF() - IF(${BUILD_WITH_ANALYSIS}) - add_definitions(-DUSE_ANAL) - ENDIF() ENDIF () add_library(mnode STATIC ${MNODE_SRC}) diff --git a/source/dnode/mnode/impl/inc/mndAnode.h b/source/dnode/mnode/impl/inc/mndAnode.h deleted file mode 100644 index 63e8f9090e..0000000000 --- a/source/dnode/mnode/impl/inc/mndAnode.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_MND_ANODE_H_ -#define _TD_MND_ANODE_H_ - -#include "mndInt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int32_t mndInitAnode(SMnode *pMnode); -void mndCleanupAnode(SMnode *pMnode); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_MND_ANODE_H_*/ \ No newline at end of file diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 742db8f450..60b732f817 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -78,9 +78,6 @@ typedef enum { MND_OPER_DROP_VIEW, MND_OPER_CONFIG_CLUSTER, MND_OPER_BALANCE_VGROUP_LEADER, - MND_OPER_CREATE_ANODE, - MND_OPER_UPDATE_ANODE, - MND_OPER_DROP_ANODE } EOperType; typedef enum { @@ -235,24 +232,6 @@ typedef struct { char machineId[TSDB_MACHINE_ID_LEN + 1]; } SDnodeObj; -typedef struct { - int32_t nameLen; - char* name; -} SAnodeAlgo; - -typedef struct { - int32_t id; - int64_t createdTime; - int64_t updateTime; - int32_t version; - int32_t urlLen; - int32_t numOfAlgos; - int32_t status; - SRWLatch lock; - char* url; - SArray** algos; -} SAnodeObj; - typedef struct { int32_t id; int64_t createdTime; diff --git a/source/dnode/mnode/impl/src/mndAnode.c b/source/dnode/mnode/impl/src/mndAnode.c deleted file mode 100644 index 469e16c7ea..0000000000 --- a/source/dnode/mnode/impl/src/mndAnode.c +++ /dev/null @@ -1,901 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#define _DEFAULT_SOURCE -#include "mndAnode.h" -#include "audit.h" -#include "mndDnode.h" -#include "mndPrivilege.h" -#include "mndShow.h" -#include "mndTrans.h" -#include "mndUser.h" -#include "tanal.h" -#include "tjson.h" - -#ifdef USE_ANAL - -#define TSDB_ANODE_VER_NUMBER 1 -#define TSDB_ANODE_RESERVE_SIZE 64 - -static SSdbRaw *mndAnodeActionEncode(SAnodeObj *pObj); -static SSdbRow *mndAnodeActionDecode(SSdbRaw *pRaw); -static int32_t mndAnodeActionInsert(SSdb *pSdb, SAnodeObj *pObj); -static int32_t mndAnodeActionUpdate(SSdb *pSdb, SAnodeObj *pOld, SAnodeObj *pNew); -static int32_t mndAnodeActionDelete(SSdb *pSdb, SAnodeObj *pObj); -static int32_t mndProcessCreateAnodeReq(SRpcMsg *pReq); -static int32_t mndProcessUpdateAnodeReq(SRpcMsg *pReq); -static int32_t mndProcessDropAnodeReq(SRpcMsg *pReq); -static int32_t mndProcessAnalAlgoReq(SRpcMsg *pReq); -static int32_t mndRetrieveAnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); -static void mndCancelGetNextAnode(SMnode *pMnode, void *pIter); -static int32_t mndRetrieveAnodesFull(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); -static void mndCancelGetNextAnodeFull(SMnode *pMnode, void *pIter); -static int32_t mndGetAnodeAlgoList(const char *url, SAnodeObj *pObj); -static int32_t mndGetAnodeStatus(SAnodeObj *pObj, char *status, int32_t statusLen); - -int32_t mndInitAnode(SMnode *pMnode) { - SSdbTable table = { - .sdbType = SDB_ANODE, - .keyType = SDB_KEY_INT32, - .encodeFp = (SdbEncodeFp)mndAnodeActionEncode, - .decodeFp = (SdbDecodeFp)mndAnodeActionDecode, - .insertFp = (SdbInsertFp)mndAnodeActionInsert, - .updateFp = (SdbUpdateFp)mndAnodeActionUpdate, - .deleteFp = (SdbDeleteFp)mndAnodeActionDelete, - }; - - mndSetMsgHandle(pMnode, TDMT_MND_CREATE_ANODE, mndProcessCreateAnodeReq); - mndSetMsgHandle(pMnode, TDMT_MND_UPDATE_ANODE, mndProcessUpdateAnodeReq); - mndSetMsgHandle(pMnode, TDMT_MND_DROP_ANODE, mndProcessDropAnodeReq); - mndSetMsgHandle(pMnode, TDMT_MND_RETRIEVE_ANAL_ALGO, mndProcessAnalAlgoReq); - - mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ANODE, mndRetrieveAnodes); - mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_ANODE, mndCancelGetNextAnode); - mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ANODE_FULL, mndRetrieveAnodesFull); - mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_ANODE_FULL, mndCancelGetNextAnodeFull); - - return sdbSetTable(pMnode->pSdb, table); -} - -void mndCleanupAnode(SMnode *pMnode) {} - -SAnodeObj *mndAcquireAnode(SMnode *pMnode, int32_t anodeId) { - SAnodeObj *pObj = sdbAcquire(pMnode->pSdb, SDB_ANODE, &anodeId); - if (pObj == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { - terrno = TSDB_CODE_MND_ANODE_NOT_EXIST; - } - return pObj; -} - -void mndReleaseAnode(SMnode *pMnode, SAnodeObj *pObj) { - SSdb *pSdb = pMnode->pSdb; - sdbRelease(pSdb, pObj); -} - -static SSdbRaw *mndAnodeActionEncode(SAnodeObj *pObj) { - int32_t code = 0; - int32_t lino = 0; - terrno = TSDB_CODE_OUT_OF_MEMORY; - - int32_t rawDataLen = sizeof(SAnodeObj) + TSDB_ANODE_RESERVE_SIZE + pObj->urlLen; - for (int32_t t = 0; t < pObj->numOfAlgos; ++t) { - SArray *algos = pObj->algos[t]; - for (int32_t a = 0; a < (int32_t)taosArrayGetSize(algos); ++a) { - SAnodeAlgo *algo = taosArrayGet(algos, a); - rawDataLen += (2 * sizeof(int32_t) + algo->nameLen); - } - rawDataLen += sizeof(int32_t); - } - - SSdbRaw *pRaw = sdbAllocRaw(SDB_ANODE, TSDB_ANODE_VER_NUMBER, rawDataLen); - if (pRaw == NULL) goto _OVER; - - int32_t dataPos = 0; - SDB_SET_INT32(pRaw, dataPos, pObj->id, _OVER) - SDB_SET_INT64(pRaw, dataPos, pObj->createdTime, _OVER) - SDB_SET_INT64(pRaw, dataPos, pObj->updateTime, _OVER) - SDB_SET_INT32(pRaw, dataPos, pObj->version, _OVER) - SDB_SET_INT32(pRaw, dataPos, pObj->urlLen, _OVER) - SDB_SET_BINARY(pRaw, dataPos, pObj->url, pObj->urlLen, _OVER) - SDB_SET_INT32(pRaw, dataPos, pObj->numOfAlgos, _OVER) - for (int32_t i = 0; i < pObj->numOfAlgos; ++i) { - SArray *algos = pObj->algos[i]; - SDB_SET_INT32(pRaw, dataPos, (int32_t)taosArrayGetSize(algos), _OVER) - for (int32_t j = 0; j < (int32_t)taosArrayGetSize(algos); ++j) { - SAnodeAlgo *algo = taosArrayGet(algos, j); - SDB_SET_INT32(pRaw, dataPos, algo->nameLen, _OVER) - SDB_SET_BINARY(pRaw, dataPos, algo->name, algo->nameLen, _OVER) - SDB_SET_INT32(pRaw, dataPos, 0, _OVER) // reserved - } - } - - SDB_SET_RESERVE(pRaw, dataPos, TSDB_ANODE_RESERVE_SIZE, _OVER) - - terrno = 0; - -_OVER: - if (terrno != 0) { - mError("anode:%d, failed to encode to raw:%p since %s", pObj->id, pRaw, terrstr()); - sdbFreeRaw(pRaw); - return NULL; - } - - mTrace("anode:%d, encode to raw:%p, row:%p", pObj->id, pRaw, pObj); - return pRaw; -} - -static SSdbRow *mndAnodeActionDecode(SSdbRaw *pRaw) { - int32_t code = 0; - int32_t lino = 0; - terrno = TSDB_CODE_OUT_OF_MEMORY; - SSdbRow *pRow = NULL; - SAnodeObj *pObj = NULL; - - int8_t sver = 0; - if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; - - if (sver != TSDB_ANODE_VER_NUMBER) { - terrno = TSDB_CODE_SDB_INVALID_DATA_VER; - goto _OVER; - } - - pRow = sdbAllocRow(sizeof(SAnodeObj)); - if (pRow == NULL) goto _OVER; - - pObj = sdbGetRowObj(pRow); - if (pObj == NULL) goto _OVER; - - int32_t dataPos = 0; - SDB_GET_INT32(pRaw, dataPos, &pObj->id, _OVER) - SDB_GET_INT64(pRaw, dataPos, &pObj->createdTime, _OVER) - SDB_GET_INT64(pRaw, dataPos, &pObj->updateTime, _OVER) - SDB_GET_INT32(pRaw, dataPos, &pObj->version, _OVER) - SDB_GET_INT32(pRaw, dataPos, &pObj->urlLen, _OVER) - - if (pObj->urlLen > 0) { - pObj->url = taosMemoryCalloc(pObj->urlLen, 1); - if (pObj->url == NULL) goto _OVER; - SDB_GET_BINARY(pRaw, dataPos, pObj->url, pObj->urlLen, _OVER) - } - - SDB_GET_INT32(pRaw, dataPos, &pObj->numOfAlgos, _OVER) - if (pObj->numOfAlgos > 0) { - pObj->algos = taosMemoryCalloc(pObj->numOfAlgos, sizeof(SArray *)); - if (pObj->algos == NULL) { - goto _OVER; - } - } - - for (int32_t i = 0; i < pObj->numOfAlgos; ++i) { - int32_t numOfAlgos = 0; - SDB_GET_INT32(pRaw, dataPos, &numOfAlgos, _OVER) - - pObj->algos[i] = taosArrayInit(2, sizeof(SAnodeAlgo)); - if (pObj->algos[i] == NULL) goto _OVER; - - for (int32_t j = 0; j < numOfAlgos; ++j) { - SAnodeAlgo algoObj = {0}; - int32_t reserved = 0; - - SDB_GET_INT32(pRaw, dataPos, &algoObj.nameLen, _OVER) - if (algoObj.nameLen > 0) { - algoObj.name = taosMemoryCalloc(algoObj.nameLen, 1); - if (algoObj.name == NULL) goto _OVER; - } - - SDB_GET_BINARY(pRaw, dataPos, algoObj.name, algoObj.nameLen, _OVER) - SDB_GET_INT32(pRaw, dataPos, &reserved, _OVER); - - if (taosArrayPush(pObj->algos[i], &algoObj) == NULL) goto _OVER; - } - } - - SDB_GET_RESERVE(pRaw, dataPos, TSDB_ANODE_RESERVE_SIZE, _OVER) - - terrno = 0; - -_OVER: - if (terrno != 0) { - mError("anode:%d, failed to decode from raw:%p since %s", pObj == NULL ? 0 : pObj->id, pRaw, terrstr()); - if (pObj != NULL) { - taosMemoryFreeClear(pObj->url); - } - taosMemoryFreeClear(pRow); - return NULL; - } - - mTrace("anode:%d, decode from raw:%p, row:%p", pObj->id, pRaw, pObj); - return pRow; -} - -static void mndFreeAnode(SAnodeObj *pObj) { - taosMemoryFreeClear(pObj->url); - for (int32_t i = 0; i < pObj->numOfAlgos; ++i) { - SArray *algos = pObj->algos[i]; - for (int32_t j = 0; j < (int32_t)taosArrayGetSize(algos); ++j) { - SAnodeAlgo *algo = taosArrayGet(algos, j); - taosMemoryFreeClear(algo->name); - } - taosArrayDestroy(algos); - } - taosMemoryFreeClear(pObj->algos); -} - -static int32_t mndAnodeActionInsert(SSdb *pSdb, SAnodeObj *pObj) { - mTrace("anode:%d, perform insert action, row:%p", pObj->id, pObj); - return 0; -} - -static int32_t mndAnodeActionDelete(SSdb *pSdb, SAnodeObj *pObj) { - mTrace("anode:%d, perform delete action, row:%p", pObj->id, pObj); - mndFreeAnode(pObj); - return 0; -} - -static int32_t mndAnodeActionUpdate(SSdb *pSdb, SAnodeObj *pOld, SAnodeObj *pNew) { - mTrace("anode:%d, perform update action, old row:%p new row:%p", pOld->id, pOld, pNew); - - taosWLockLatch(&pOld->lock); - int32_t numOfAlgos = pNew->numOfAlgos; - void *algos = pNew->algos; - pNew->numOfAlgos = pOld->numOfAlgos; - pNew->algos = pOld->algos; - pOld->numOfAlgos = numOfAlgos; - pOld->algos = algos; - pOld->updateTime = pNew->updateTime; - pOld->version = pNew->version; - taosWUnLockLatch(&pOld->lock); - return 0; -} - -static int32_t mndSetCreateAnodeRedoLogs(STrans *pTrans, SAnodeObj *pObj) { - int32_t code = 0; - SSdbRaw *pRedoRaw = mndAnodeActionEncode(pObj); - if (pRedoRaw == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - TAOS_RETURN(code); - } - TAOS_CHECK_RETURN(mndTransAppendRedolog(pTrans, pRedoRaw)); - TAOS_CHECK_RETURN(sdbSetRawStatus(pRedoRaw, SDB_STATUS_CREATING)); - TAOS_RETURN(code); -} - -static int32_t mndSetCreateAnodeUndoLogs(STrans *pTrans, SAnodeObj *pObj) { - int32_t code = 0; - SSdbRaw *pUndoRaw = mndAnodeActionEncode(pObj); - if (pUndoRaw == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - TAOS_RETURN(code); - } - TAOS_CHECK_RETURN(mndTransAppendUndolog(pTrans, pUndoRaw)); - TAOS_CHECK_RETURN(sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED)); - TAOS_RETURN(code); -} - -static int32_t mndSetCreateAnodeCommitLogs(STrans *pTrans, SAnodeObj *pObj) { - int32_t code = 0; - SSdbRaw *pCommitRaw = mndAnodeActionEncode(pObj); - if (pCommitRaw == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - TAOS_RETURN(code); - } - TAOS_CHECK_RETURN(mndTransAppendCommitlog(pTrans, pCommitRaw)); - TAOS_CHECK_RETURN(sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY)); - TAOS_RETURN(code); -} - -static int32_t mndCreateAnode(SMnode *pMnode, SRpcMsg *pReq, SMCreateAnodeReq *pCreate) { - int32_t code = -1; - STrans *pTrans = NULL; - - SAnodeObj anodeObj = {0}; - anodeObj.id = sdbGetMaxId(pMnode->pSdb, SDB_ANODE); - anodeObj.createdTime = taosGetTimestampMs(); - anodeObj.updateTime = anodeObj.createdTime; - anodeObj.version = 0; - anodeObj.urlLen = pCreate->urlLen; - if (anodeObj.urlLen > TSDB_ANAL_ANODE_URL_LEN) { - code = TSDB_CODE_MND_ANODE_TOO_LONG_URL; - goto _OVER; - } - - anodeObj.url = taosMemoryCalloc(1, pCreate->urlLen); - if (anodeObj.url == NULL) goto _OVER; - (void)memcpy(anodeObj.url, pCreate->url, pCreate->urlLen); - - code = mndGetAnodeAlgoList(anodeObj.url, &anodeObj); - if (code != 0) goto _OVER; - - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pReq, "create-anode"); - if (pTrans == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - goto _OVER; - } - mndTransSetSerial(pTrans); - - mInfo("trans:%d, used to create anode:%s as anode:%d", pTrans->id, pCreate->url, anodeObj.id); - - TAOS_CHECK_GOTO(mndSetCreateAnodeRedoLogs(pTrans, &anodeObj), NULL, _OVER); - TAOS_CHECK_GOTO(mndSetCreateAnodeUndoLogs(pTrans, &anodeObj), NULL, _OVER); - TAOS_CHECK_GOTO(mndSetCreateAnodeCommitLogs(pTrans, &anodeObj), NULL, _OVER); - TAOS_CHECK_GOTO(mndTransPrepare(pMnode, pTrans), NULL, _OVER); - - code = 0; - -_OVER: - mndFreeAnode(&anodeObj); - mndTransDrop(pTrans); - TAOS_RETURN(code); -} - -static SAnodeObj *mndAcquireAnodeByURL(SMnode *pMnode, char *url) { - SSdb *pSdb = pMnode->pSdb; - - void *pIter = NULL; - while (1) { - SAnodeObj *pAnode = NULL; - pIter = sdbFetch(pSdb, SDB_ANODE, pIter, (void **)&pAnode); - if (pIter == NULL) break; - - if (strcasecmp(url, pAnode->url) == 0) { - sdbCancelFetch(pSdb, pIter); - return pAnode; - } - - sdbRelease(pSdb, pAnode); - } - - terrno = TSDB_CODE_MND_ANODE_NOT_EXIST; - return NULL; -} - -static int32_t mndProcessCreateAnodeReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SAnodeObj *pObj = NULL; - SMCreateAnodeReq createReq = {0}; - - TAOS_CHECK_GOTO(tDeserializeSMCreateAnodeReq(pReq->pCont, pReq->contLen, &createReq), NULL, _OVER); - - mInfo("anode:%s, start to create", createReq.url); - TAOS_CHECK_GOTO(mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_ANODE), NULL, _OVER); - - pObj = mndAcquireAnodeByURL(pMnode, createReq.url); - if (pObj != NULL) { - code = TSDB_CODE_MND_ANODE_ALREADY_EXIST; - goto _OVER; - } - - code = mndCreateAnode(pMnode, pReq, &createReq); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; - -_OVER: - if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("anode:%s, failed to create since %s", createReq.url, tstrerror(code)); - } - - mndReleaseAnode(pMnode, pObj); - tFreeSMCreateAnodeReq(&createReq); - TAOS_RETURN(code); -} - -static int32_t mndUpdateAnode(SMnode *pMnode, SAnodeObj *pAnode, SRpcMsg *pReq) { - mInfo("anode:%d, start to update", pAnode->id); - int32_t code = -1; - STrans *pTrans = NULL; - SAnodeObj anodeObj = {0}; - anodeObj.id = pAnode->id; - anodeObj.updateTime = taosGetTimestampMs(); - - code = mndGetAnodeAlgoList(pAnode->url, &anodeObj); - if (code != 0) goto _OVER; - - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pReq, "update-anode"); - if (pTrans == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - goto _OVER; - } - mInfo("trans:%d, used to update anode:%d", pTrans->id, anodeObj.id); - - TAOS_CHECK_GOTO(mndSetCreateAnodeCommitLogs(pTrans, &anodeObj), NULL, _OVER); - TAOS_CHECK_GOTO(mndTransPrepare(pMnode, pTrans), NULL, _OVER); - code = 0; - -_OVER: - mndFreeAnode(&anodeObj); - mndTransDrop(pTrans); - TAOS_RETURN(code); -} - -static int32_t mndUpdateAllAnodes(SMnode *pMnode, SRpcMsg *pReq) { - mInfo("update all anodes"); - SSdb *pSdb = pMnode->pSdb; - int32_t code = 0; - int32_t rows = 0; - int32_t numOfRows = sdbGetSize(pSdb, SDB_ANODE); - - void *pIter = NULL; - while (1) { - SAnodeObj *pObj = NULL; - ESdbStatus objStatus = 0; - pIter = sdbFetchAll(pSdb, SDB_ANODE, pIter, (void **)&pObj, &objStatus, true); - if (pIter == NULL) break; - - rows++; - void *transReq = NULL; - if (rows == numOfRows) transReq = pReq; - code = mndUpdateAnode(pMnode, pObj, transReq); - sdbRelease(pSdb, pObj); - - if (code != 0) break; - } - - if (code == 0 && rows == numOfRows) { - code = TSDB_CODE_ACTION_IN_PROGRESS; - } - - return code; -} - -static int32_t mndProcessUpdateAnodeReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SAnodeObj *pObj = NULL; - SMUpdateAnodeReq updateReq = {0}; - - TAOS_CHECK_GOTO(tDeserializeSMUpdateAnodeReq(pReq->pCont, pReq->contLen, &updateReq), NULL, _OVER); - TAOS_CHECK_GOTO(mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_UPDATE_ANODE), NULL, _OVER); - - if (updateReq.anodeId == -1) { - code = mndUpdateAllAnodes(pMnode, pReq); - } else { - pObj = mndAcquireAnode(pMnode, updateReq.anodeId); - if (pObj == NULL) { - code = TSDB_CODE_MND_ANODE_NOT_EXIST; - goto _OVER; - } - code = mndUpdateAnode(pMnode, pObj, pReq); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; - } - -_OVER: - if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - if (updateReq.anodeId != -1) { - mError("anode:%d, failed to update since %s", updateReq.anodeId, tstrerror(code)); - } - } - - mndReleaseAnode(pMnode, pObj); - tFreeSMUpdateAnodeReq(&updateReq); - TAOS_RETURN(code); -} - -static int32_t mndSetDropAnodeRedoLogs(STrans *pTrans, SAnodeObj *pObj) { - int32_t code = 0; - SSdbRaw *pRedoRaw = mndAnodeActionEncode(pObj); - if (pRedoRaw == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - TAOS_RETURN(code); - } - TAOS_CHECK_RETURN(mndTransAppendRedolog(pTrans, pRedoRaw)); - TAOS_CHECK_RETURN(sdbSetRawStatus(pRedoRaw, SDB_STATUS_DROPPING)); - TAOS_RETURN(code); -} - -static int32_t mndSetDropAnodeCommitLogs(STrans *pTrans, SAnodeObj *pObj) { - int32_t code = 0; - SSdbRaw *pCommitRaw = mndAnodeActionEncode(pObj); - if (pCommitRaw == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - TAOS_RETURN(code); - } - TAOS_CHECK_RETURN(mndTransAppendCommitlog(pTrans, pCommitRaw)); - TAOS_CHECK_RETURN(sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED)); - TAOS_RETURN(code); -} - -static int32_t mndSetDropAnodeInfoToTrans(SMnode *pMnode, STrans *pTrans, SAnodeObj *pObj, bool force) { - if (pObj == NULL) return 0; - TAOS_CHECK_RETURN(mndSetDropAnodeRedoLogs(pTrans, pObj)); - TAOS_CHECK_RETURN(mndSetDropAnodeCommitLogs(pTrans, pObj)); - return 0; -} - -static int32_t mndDropAnode(SMnode *pMnode, SRpcMsg *pReq, SAnodeObj *pObj) { - int32_t code = -1; - - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pReq, "drop-anode"); - if (pTrans == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - goto _OVER; - } - mndTransSetSerial(pTrans); - - mInfo("trans:%d, used to drop anode:%d", pTrans->id, pObj->id); - TAOS_CHECK_GOTO(mndSetDropAnodeInfoToTrans(pMnode, pTrans, pObj, false), NULL, _OVER); - TAOS_CHECK_GOTO(mndTransPrepare(pMnode, pTrans), NULL, _OVER); - - code = 0; - -_OVER: - mndTransDrop(pTrans); - TAOS_RETURN(code); -} - -static int32_t mndProcessDropAnodeReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SAnodeObj *pObj = NULL; - SMDropAnodeReq dropReq = {0}; - - TAOS_CHECK_GOTO(tDeserializeSMDropAnodeReq(pReq->pCont, pReq->contLen, &dropReq), NULL, _OVER); - - mInfo("anode:%d, start to drop", dropReq.anodeId); - TAOS_CHECK_GOTO(mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_ANODE), NULL, _OVER); - - if (dropReq.anodeId <= 0) { - code = TSDB_CODE_INVALID_MSG; - goto _OVER; - } - - pObj = mndAcquireAnode(pMnode, dropReq.anodeId); - if (pObj == NULL) { - code = TSDB_CODE_MND_RETURN_VALUE_NULL; - if (terrno != 0) code = terrno; - goto _OVER; - } - - code = mndDropAnode(pMnode, pReq, pObj); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; - -_OVER: - if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { - mError("anode:%d, failed to drop since %s", dropReq.anodeId, tstrerror(code)); - } - - mndReleaseAnode(pMnode, pObj); - tFreeSMDropAnodeReq(&dropReq); - TAOS_RETURN(code); -} - -static int32_t mndRetrieveAnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { - SMnode *pMnode = pReq->info.node; - SSdb *pSdb = pMnode->pSdb; - int32_t numOfRows = 0; - int32_t cols = 0; - SAnodeObj *pObj = NULL; - char buf[TSDB_ANAL_ANODE_URL_LEN + VARSTR_HEADER_SIZE]; - char status[64]; - int32_t code = 0; - - while (numOfRows < rows) { - pShow->pIter = sdbFetch(pSdb, SDB_ANODE, pShow->pIter, (void **)&pObj); - if (pShow->pIter == NULL) break; - - cols = 0; - SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->id, false); - if (code != 0) goto _end; - - STR_WITH_MAXSIZE_TO_VARSTR(buf, pObj->url, pShow->pMeta->pSchemas[cols].bytes); - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, (const char *)buf, false); - if (code != 0) goto _end; - - status[0] = 0; - if (mndGetAnodeStatus(pObj, status, 64) == 0) { - STR_TO_VARSTR(buf, status); - } else { - STR_TO_VARSTR(buf, "offline"); - } - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, buf, false); - if (code != 0) goto _end; - - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->createdTime, false); - if (code != 0) goto _end; - - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->updateTime, false); - if (code != 0) goto _end; - - numOfRows++; - sdbRelease(pSdb, pObj); - } - -_end: - if (code != 0) sdbRelease(pSdb, pObj); - - pShow->numOfRows += numOfRows; - return numOfRows; -} - -static void mndCancelGetNextAnode(SMnode *pMnode, void *pIter) { - SSdb *pSdb = pMnode->pSdb; - sdbCancelFetchByType(pSdb, pIter, SDB_ANODE); -} - -static int32_t mndRetrieveAnodesFull(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { - SMnode *pMnode = pReq->info.node; - SSdb *pSdb = pMnode->pSdb; - int32_t numOfRows = 0; - int32_t cols = 0; - SAnodeObj *pObj = NULL; - char buf[TSDB_ANAL_ALGO_NAME_LEN + VARSTR_HEADER_SIZE]; - int32_t code = 0; - - while (numOfRows < rows) { - pShow->pIter = sdbFetch(pSdb, SDB_ANODE, pShow->pIter, (void **)&pObj); - if (pShow->pIter == NULL) break; - - for (int32_t t = 0; t < pObj->numOfAlgos; ++t) { - SArray *algos = pObj->algos[t]; - - for (int32_t a = 0; a < taosArrayGetSize(algos); ++a) { - SAnodeAlgo *algo = taosArrayGet(algos, a); - - cols = 0; - SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->id, false); - if (code != 0) goto _end; - - STR_TO_VARSTR(buf, taosAnalAlgoStr(t)); - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, buf, false); - if (code != 0) goto _end; - - STR_TO_VARSTR(buf, algo->name); - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - code = colDataSetVal(pColInfo, numOfRows, buf, false); - if (code != 0) goto _end; - - numOfRows++; - } - } - - sdbRelease(pSdb, pObj); - } - -_end: - if (code != 0) sdbRelease(pSdb, pObj); - - pShow->numOfRows += numOfRows; - return numOfRows; -} - -static void mndCancelGetNextAnodeFull(SMnode *pMnode, void *pIter) { - SSdb *pSdb = pMnode->pSdb; - sdbCancelFetchByType(pSdb, pIter, SDB_ANODE); -} - -static int32_t mndDecodeAlgoList(SJson *pJson, SAnodeObj *pObj) { - int32_t code = 0; - int32_t protocol = 0; - double tmp = 0; - char buf[TSDB_ANAL_ALGO_NAME_LEN + 1] = {0}; - - code = tjsonGetDoubleValue(pJson, "protocol", &tmp); - if (code < 0) return TSDB_CODE_INVALID_JSON_FORMAT; - protocol = (int32_t)(tmp * 1000); - if (protocol != 100 && protocol != 1000) return TSDB_CODE_MND_ANODE_INVALID_PROTOCOL; - - code = tjsonGetDoubleValue(pJson, "version", &tmp); - pObj->version = (int32_t)(tmp * 1000); - if (code < 0) return TSDB_CODE_INVALID_JSON_FORMAT; - if (pObj->version <= 0) return TSDB_CODE_MND_ANODE_INVALID_VERSION; - - SJson *details = tjsonGetObjectItem(pJson, "details"); - if (details == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - int32_t numOfDetails = tjsonGetArraySize(details); - - pObj->algos = taosMemoryCalloc(ANAL_ALGO_TYPE_END, sizeof(SArray *)); - if (pObj->algos == NULL) return TSDB_CODE_OUT_OF_MEMORY; - - pObj->numOfAlgos = ANAL_ALGO_TYPE_END; - for (int32_t i = 0; i < ANAL_ALGO_TYPE_END; ++i) { - pObj->algos[i] = taosArrayInit(4, sizeof(SAnodeAlgo)); - if (pObj->algos[i] == NULL) return TSDB_CODE_OUT_OF_MEMORY; - } - - for (int32_t d = 0; d < numOfDetails; ++d) { - SJson *detail = tjsonGetArrayItem(details, d); - if (detail == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - - code = tjsonGetStringValue2(detail, "type", buf, sizeof(buf)); - if (code < 0) return TSDB_CODE_INVALID_JSON_FORMAT; - EAnalAlgoType type = taosAnalAlgoInt(buf); - if (type < 0 || type >= ANAL_ALGO_TYPE_END) return TSDB_CODE_MND_ANODE_INVALID_ALGO_TYPE; - - SJson *algos = tjsonGetObjectItem(detail, "algo"); - if (algos == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - int32_t numOfAlgos = tjsonGetArraySize(algos); - for (int32_t a = 0; a < numOfAlgos; ++a) { - SJson *algo = tjsonGetArrayItem(algos, a); - if (algo == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - - code = tjsonGetStringValue2(algo, "name", buf, sizeof(buf)); - if (code < 0) return TSDB_CODE_MND_ANODE_TOO_LONG_ALGO_NAME; - - SAnodeAlgo algoObj = {0}; - algoObj.nameLen = strlen(buf) + 1; - if (algoObj.nameLen <= 1) return TSDB_CODE_INVALID_JSON_FORMAT; - algoObj.name = taosMemoryCalloc(algoObj.nameLen, 1); - tstrncpy(algoObj.name, buf, algoObj.nameLen); - - if (taosArrayPush(pObj->algos[type], &algoObj) == NULL) return TSDB_CODE_OUT_OF_MEMORY; - } - } - - return 0; -} - -static int32_t mndGetAnodeAlgoList(const char *url, SAnodeObj *pObj) { - char anodeUrl[TSDB_ANAL_ANODE_URL_LEN + 1] = {0}; - snprintf(anodeUrl, TSDB_ANAL_ANODE_URL_LEN, "%s/%s", url, "list"); - - SJson *pJson = taosAnalSendReqRetJson(anodeUrl, ANAL_HTTP_TYPE_GET, NULL); - if (pJson == NULL) return terrno; - - int32_t code = mndDecodeAlgoList(pJson, pObj); - if (pJson != NULL) tjsonDelete(pJson); - - TAOS_RETURN(code); -} - -static int32_t mndGetAnodeStatus(SAnodeObj *pObj, char *status, int32_t statusLen) { - int32_t code = 0; - int32_t protocol = 0; - double tmp = 0; - char anodeUrl[TSDB_ANAL_ANODE_URL_LEN + 1] = {0}; - snprintf(anodeUrl, TSDB_ANAL_ANODE_URL_LEN, "%s/%s", pObj->url, "status"); - - SJson *pJson = taosAnalSendReqRetJson(anodeUrl, ANAL_HTTP_TYPE_GET, NULL); - if (pJson == NULL) return terrno; - - code = tjsonGetDoubleValue(pJson, "protocol", &tmp); - if (code < 0) { - code = TSDB_CODE_INVALID_JSON_FORMAT; - goto _OVER; - } - protocol = (int32_t)(tmp * 1000); - if (protocol != 100 && protocol != 1000) { - code = TSDB_CODE_MND_ANODE_INVALID_PROTOCOL; - goto _OVER; - } - - code = tjsonGetStringValue2(pJson, "status", status, statusLen); - if (code < 0) { - code = TSDB_CODE_INVALID_JSON_FORMAT; - goto _OVER; - } - if (strlen(status) == 0) { - code = TSDB_CODE_MND_ANODE_INVALID_PROTOCOL; - goto _OVER; - } - -_OVER: - if (pJson != NULL) tjsonDelete(pJson); - TAOS_RETURN(code); -} - -static int32_t mndProcessAnalAlgoReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - SSdb *pSdb = pMnode->pSdb; - int32_t code = -1; - SAnodeObj *pObj = NULL; - SAnalUrl url; - int32_t nameLen; - char name[TSDB_ANAL_ALGO_KEY_LEN]; - SRetrieveAnalAlgoReq req = {0}; - SRetrieveAnalAlgoRsp rsp = {0}; - - TAOS_CHECK_GOTO(tDeserializeRetrieveAnalAlgoReq(pReq->pCont, pReq->contLen, &req), NULL, _OVER); - - rsp.ver = sdbGetTableVer(pSdb, SDB_ANODE); - if (req.analVer != rsp.ver) { - mInfo("dnode:%d, update analysis old ver:%" PRId64 " to new ver:%" PRId64, req.dnodeId, req.analVer, rsp.ver); - rsp.hash = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); - if (rsp.hash == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _OVER; - } - - void *pIter = NULL; - while (1) { - SAnodeObj *pAnode = NULL; - pIter = sdbFetch(pSdb, SDB_ANODE, pIter, (void **)&pAnode); - if (pIter == NULL) break; - - url.anode = pAnode->id; - for (int32_t t = 0; t < pAnode->numOfAlgos; ++t) { - SArray *algos = pAnode->algos[t]; - url.type = t; - - for (int32_t a = 0; a < taosArrayGetSize(algos); ++a) { - SAnodeAlgo *algo = taosArrayGet(algos, a); - nameLen = 1 + tsnprintf(name, sizeof(name) - 1, "%d:%s", url.type, algo->name); - - SAnalUrl *pOldUrl = taosHashAcquire(rsp.hash, name, nameLen); - if (pOldUrl == NULL || (pOldUrl != NULL && pOldUrl->anode < url.anode)) { - if (pOldUrl != NULL) { - taosMemoryFreeClear(pOldUrl->url); - if (taosHashRemove(rsp.hash, name, nameLen) != 0) { - sdbRelease(pSdb, pAnode); - goto _OVER; - } - } - url.url = taosMemoryMalloc(TSDB_ANAL_ANODE_URL_LEN + TSDB_ANAL_ALGO_TYPE_LEN + 1); - if (url.url == NULL) { - sdbRelease(pSdb, pAnode); - goto _OVER; - } - - url.urlLen = 1 + tsnprintf(url.url, TSDB_ANAL_ANODE_URL_LEN + TSDB_ANAL_ALGO_TYPE_LEN, "%s/%s", pAnode->url, - taosAnalAlgoUrlStr(url.type)); - if (taosHashPut(rsp.hash, name, nameLen, &url, sizeof(SAnalUrl)) != 0) { - taosMemoryFree(url.url); - sdbRelease(pSdb, pAnode); - goto _OVER; - } - } - } - - sdbRelease(pSdb, pAnode); - } - } - } - - int32_t contLen = tSerializeRetrieveAnalAlgoRsp(NULL, 0, &rsp); - void *pHead = rpcMallocCont(contLen); - (void)tSerializeRetrieveAnalAlgoRsp(pHead, contLen, &rsp); - - pReq->info.rspLen = contLen; - pReq->info.rsp = pHead; - -_OVER: - tFreeRetrieveAnalAlgoRsp(&rsp); - TAOS_RETURN(code); -} - -#else - -static int32_t mndProcessUnsupportReq(SRpcMsg *pReq) { return TSDB_CODE_OPS_NOT_SUPPORT; } -static int32_t mndRetrieveUnsupport(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { - return TSDB_CODE_OPS_NOT_SUPPORT; -} - -int32_t mndInitAnode(SMnode *pMnode) { - mndSetMsgHandle(pMnode, TDMT_MND_CREATE_ANODE, mndProcessUnsupportReq); - mndSetMsgHandle(pMnode, TDMT_MND_UPDATE_ANODE, mndProcessUnsupportReq); - mndSetMsgHandle(pMnode, TDMT_MND_DROP_ANODE, mndProcessUnsupportReq); - mndSetMsgHandle(pMnode, TDMT_MND_RETRIEVE_ANAL_ALGO, mndProcessUnsupportReq); - - mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ANODE, mndRetrieveUnsupport); - mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ANODE_FULL, mndRetrieveUnsupport); - return 0; -} - -void mndCleanupAnode(SMnode *pMnode) {} - -#endif \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 5e10583a0a..04041646eb 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -730,7 +730,6 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pMnode->ipWhiteVer = mndGetIpWhiteVer(pMnode); - int64_t analVer = sdbGetTableVer(pMnode->pSdb, SDB_ANODE); int64_t dnodeVer = sdbGetTableVer(pMnode->pSdb, SDB_DNODE) + sdbGetTableVer(pMnode->pSdb, SDB_MNODE); int64_t curMs = taosGetTimestampMs(); bool online = mndIsDnodeOnline(pDnode, curMs); @@ -739,8 +738,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { bool supportVnodesChanged = pDnode->numOfSupportVnodes != statusReq.numOfSupportVnodes; bool encryptKeyChanged = pDnode->encryptionKeyChksum != statusReq.clusterCfg.encryptionKeyChksum; bool enableWhiteListChanged = statusReq.clusterCfg.enableWhiteList != (tsEnableWhiteList ? 1 : 0); - bool analVerChanged = (analVer != statusReq.analVer); - bool needCheck = !online || dnodeChanged || reboot || supportVnodesChanged || analVerChanged || + bool needCheck = !online || dnodeChanged || reboot || supportVnodesChanged || pMnode->ipWhiteVer != statusReq.ipWhiteVer || encryptKeyChanged || enableWhiteListChanged; const STraceId *trace = &pReq->info.traceId; mGTrace("dnode:%d, status received, accessTimes:%d check:%d online:%d reboot:%d changed:%d statusSeq:%d", pDnode->id, @@ -864,7 +862,6 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { SStatusRsp statusRsp = {0}; statusRsp.statusSeq++; - statusRsp.analVer = analVer; statusRsp.dnodeVer = dnodeVer; statusRsp.dnodeCfg.dnodeId = pDnode->id; statusRsp.dnodeCfg.clusterId = pMnode->clusterId; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index c80016e174..bee971b966 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -16,7 +16,6 @@ #define _DEFAULT_SOURCE #include "mndAcct.h" #include "mndArbGroup.h" -#include "mndAnode.h" #include "mndCluster.h" #include "mndCompact.h" #include "mndCompactDetail.h" @@ -608,7 +607,6 @@ static int32_t mndInitSteps(SMnode *pMnode) { TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-mnode", mndInitMnode, mndCleanupMnode)); TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-qnode", mndInitQnode, mndCleanupQnode)); TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-snode", mndInitSnode, mndCleanupSnode)); - TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-anode", mndInitAnode, mndCleanupAnode)); TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-arbgroup", mndInitArbGroup, mndCleanupArbGroup)); TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-dnode", mndInitDnode, mndCleanupDnode)); TAOS_CHECK_RETURN(mndAllocStep(pMnode, "mnode-user", mndInitUser, mndCleanupUser)); diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 264fea3476..55687c00ba 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -68,10 +68,6 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_QNODE; } else if (strncasecmp(name, TSDB_INS_TABLE_SNODES, len) == 0) { type = TSDB_MGMT_TABLE_SNODE; - } else if (strncasecmp(name, TSDB_INS_TABLE_ANODES, len) == 0) { - type = TSDB_MGMT_TABLE_ANODE; - } else if (strncasecmp(name, TSDB_INS_TABLE_ANODES_FULL, len) == 0) { - type = TSDB_MGMT_TABLE_ANODE_FULL; } else if (strncasecmp(name, TSDB_INS_TABLE_ARBGROUPS, len) == 0) { type = TSDB_MGMT_TABLE_ARBGROUP; } else if (strncasecmp(name, TSDB_INS_TABLE_CLUSTER, len) == 0) { diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index f6d1587bb2..c33b1d4366 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -161,8 +161,7 @@ typedef enum { SDB_COMPACT_DETAIL = 25, SDB_GRANT = 26, // grant log SDB_ARBGROUP = 27, - SDB_ANODE = 28, - SDB_MAX = 29 + SDB_MAX = 28 } ESdbType; typedef struct SSdbRaw { diff --git a/source/dnode/mnode/sdb/src/sdbFile.c b/source/dnode/mnode/sdb/src/sdbFile.c index 227ff15da9..0a6dc45d51 100644 --- a/source/dnode/mnode/sdb/src/sdbFile.c +++ b/source/dnode/mnode/sdb/src/sdbFile.c @@ -25,9 +25,6 @@ #define SDB_RESERVE_SIZE 512 #define SDB_FILE_VER 1 -#define SDB_TABLE_SIZE_EXTRA SDB_MAX -#define SDB_RESERVE_SIZE_EXTRA (512 - (SDB_TABLE_SIZE_EXTRA - SDB_TABLE_SIZE) * 2 * sizeof(int64_t)) - static int32_t sdbDeployData(SSdb *pSdb) { int32_t code = 0; mInfo("start to deploy sdb"); @@ -157,38 +154,7 @@ static int32_t sdbReadFileHead(SSdb *pSdb, TdFilePtr pFile) { } } - // for sdb compatibility - for (int32_t i = SDB_TABLE_SIZE; i < SDB_TABLE_SIZE_EXTRA; ++i) { - int64_t maxId = 0; - ret = taosReadFile(pFile, &maxId, sizeof(int64_t)); - if (ret < 0) { - code = TAOS_SYSTEM_ERROR(errno); - TAOS_RETURN(code); - } - if (ret != sizeof(int64_t)) { - code = TSDB_CODE_FILE_CORRUPTED; - TAOS_RETURN(code); - } - if (i < SDB_MAX) { - pSdb->maxId[i] = maxId; - } - - int64_t ver = 0; - ret = taosReadFile(pFile, &ver, sizeof(int64_t)); - if (ret < 0) { - code = TAOS_SYSTEM_ERROR(errno); - TAOS_RETURN(code); - } - if (ret != sizeof(int64_t)) { - code = TSDB_CODE_FILE_CORRUPTED; - TAOS_RETURN(code); - } - if (i < SDB_MAX) { - pSdb->tableVer[i] = ver; - } - } - - char reserve[SDB_RESERVE_SIZE_EXTRA] = {0}; + char reserve[SDB_RESERVE_SIZE] = {0}; ret = taosReadFile(pFile, reserve, sizeof(reserve)); if (ret < 0) { return terrno; @@ -241,26 +207,7 @@ static int32_t sdbWriteFileHead(SSdb *pSdb, TdFilePtr pFile) { } } - // for sdb compatibility - for (int32_t i = SDB_TABLE_SIZE; i < SDB_TABLE_SIZE_EXTRA; ++i) { - int64_t maxId = 0; - if (i < SDB_MAX) { - maxId = pSdb->maxId[i]; - } - if (taosWriteFile(pFile, &maxId, sizeof(int64_t)) != sizeof(int64_t)) { - return terrno; - } - - int64_t ver = 0; - if (i < SDB_MAX) { - ver = pSdb->tableVer[i]; - } - if (taosWriteFile(pFile, &ver, sizeof(int64_t)) != sizeof(int64_t)) { - return terrno; - } - } - - char reserve[SDB_RESERVE_SIZE_EXTRA] = {0}; + char reserve[SDB_RESERVE_SIZE] = {0}; if (taosWriteFile(pFile, reserve, sizeof(reserve)) != sizeof(reserve)) { return terrno; } diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index 3f85ccb087..ea44a7c549 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -74,8 +74,6 @@ const char *sdbTableName(ESdbType type) { return "grant"; case SDB_ARBGROUP: return "arb_group"; - case SDB_ANODE: - return "anode"; default: return "undefine"; } diff --git a/source/libs/executor/CMakeLists.txt b/source/libs/executor/CMakeLists.txt index af2c3986aa..8ba5f9a866 100644 --- a/source/libs/executor/CMakeLists.txt +++ b/source/libs/executor/CMakeLists.txt @@ -5,10 +5,6 @@ if(${TD_DARWIN}) target_compile_options(executor PRIVATE -Wno-error=deprecated-non-prototype) endif(${TD_DARWIN}) -IF(${BUILD_WITH_ANALYSIS}) - add_definitions(-DUSE_ANAL) -ENDIF() - target_link_libraries(executor PRIVATE os util common function parser planner qcom scalar nodes index wal tdb geometry ) diff --git a/source/libs/executor/inc/operator.h b/source/libs/executor/inc/operator.h index 7dfc7080d6..fce0b05fde 100644 --- a/source/libs/executor/inc/operator.h +++ b/source/libs/executor/inc/operator.h @@ -133,8 +133,6 @@ int32_t createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStreamPart int32_t createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); -int32_t createForecastOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); - int32_t createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SSortMergeJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); int32_t createHashJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SHashJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); @@ -161,8 +159,6 @@ int32_t createCountwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* phy int32_t createGroupCacheOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SGroupCachePhysiNode* pPhyciNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); -int32_t createAnomalywindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); - int32_t createDynQueryCtrlOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SDynQueryCtrlPhysiNode* pPhyciNode, SExecTaskInfo* pTaskInfo, SOperatorInfo** pInfo); // clang-format on diff --git a/source/libs/executor/src/anomalywindowoperator.c b/source/libs/executor/src/anomalywindowoperator.c deleted file mode 100644 index 7267bbbe09..0000000000 --- a/source/libs/executor/src/anomalywindowoperator.c +++ /dev/null @@ -1,609 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "executorInt.h" -#include "filter.h" -#include "function.h" -#include "functionMgt.h" -#include "operator.h" -#include "querytask.h" -#include "tanal.h" -#include "tcommon.h" -#include "tcompare.h" -#include "tdatablock.h" -#include "tjson.h" -#include "ttime.h" - -#ifdef USE_ANAL - -typedef struct { - SArray* blocks; // SSDataBlock* - SArray* windows; // STimeWindow - uint64_t groupId; - int64_t numOfRows; - int32_t curWinIndex; - STimeWindow curWin; - SResultRow* pResultRow; -} SAnomalyWindowSupp; - -typedef struct { - SOptrBasicInfo binfo; - SAggSupporter aggSup; - SExprSupp scalarSup; - int32_t tsSlotId; - STimeWindowAggSupp twAggSup; - char algoName[TSDB_ANAL_ALGO_NAME_LEN]; - char algoUrl[TSDB_ANAL_ALGO_URL_LEN]; - char anomalyOpt[TSDB_ANAL_ALGO_OPTION_LEN]; - SAnomalyWindowSupp anomalySup; - SWindowRowsSup anomalyWinRowSup; - SColumn anomalyCol; - SStateKeys anomalyKey; -} SAnomalyWindowOperatorInfo; - -static void anomalyDestroyOperatorInfo(void* param); -static int32_t anomalyAggregateNext(SOperatorInfo* pOperator, SSDataBlock** ppRes); -static void anomalyAggregateBlocks(SOperatorInfo* pOperator); -static int32_t anomalyCacheBlock(SAnomalyWindowOperatorInfo* pInfo, SSDataBlock* pBlock); - -int32_t createAnomalywindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo, - SOperatorInfo** pOptrInfo) { - QRY_PARAM_CHECK(pOptrInfo); - - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SAnomalyWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SAnomalyWindowOperatorInfo)); - SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); - SAnomalyWindowPhysiNode* pAnomalyNode = (SAnomalyWindowPhysiNode*)physiNode; - SColumnNode* pColNode = (SColumnNode*)(pAnomalyNode->pAnomalyKey); - if (pInfo == NULL || pOperator == NULL) { - code = terrno; - goto _error; - } - - if (!taosAnalGetOptStr(pAnomalyNode->anomalyOpt, "algo", pInfo->algoName, sizeof(pInfo->algoName))) { - qError("failed to get anomaly_window algorithm name from %s", pAnomalyNode->anomalyOpt); - code = TSDB_CODE_ANAL_ALGO_NOT_FOUND; - goto _error; - } - if (taosAnalGetAlgoUrl(pInfo->algoName, ANAL_ALGO_TYPE_ANOMALY_DETECT, pInfo->algoUrl, sizeof(pInfo->algoUrl)) != 0) { - qError("failed to get anomaly_window algorithm url from %s", pInfo->algoName); - code = TSDB_CODE_ANAL_ALGO_NOT_LOAD; - goto _error; - } - - pOperator->exprSupp.hasWindowOrGroup = true; - pInfo->tsSlotId = ((SColumnNode*)pAnomalyNode->window.pTspk)->slotId; - strncpy(pInfo->anomalyOpt, pAnomalyNode->anomalyOpt, sizeof(pInfo->anomalyOpt)); - - if (pAnomalyNode->window.pExprs != NULL) { - int32_t numOfScalarExpr = 0; - SExprInfo* pScalarExprInfo = NULL; - code = createExprInfo(pAnomalyNode->window.pExprs, NULL, &pScalarExprInfo, &numOfScalarExpr); - QUERY_CHECK_CODE(code, lino, _error); - code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr, &pTaskInfo->storageAPI.functionStore); - QUERY_CHECK_CODE(code, lino, _error); - } - - size_t keyBufSize = 0; - int32_t num = 0; - SExprInfo* pExprInfo = NULL; - code = createExprInfo(pAnomalyNode->window.pFuncs, NULL, &pExprInfo, &num); - QUERY_CHECK_CODE(code, lino, _error); - - initResultSizeInfo(&pOperator->resultInfo, 4096); - - code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str, - pTaskInfo->streamInfo.pState, &pTaskInfo->storageAPI.functionStore); - QUERY_CHECK_CODE(code, lino, _error); - - SSDataBlock* pResBlock = createDataBlockFromDescNode(pAnomalyNode->window.node.pOutputDataBlockDesc); - QUERY_CHECK_NULL(pResBlock, code, lino, _error, terrno); - initBasicInfo(&pInfo->binfo, pResBlock); - - code = blockDataEnsureCapacity(pResBlock, pOperator->resultInfo.capacity); - QUERY_CHECK_CODE(code, lino, _error); - - initResultRowInfo(&pInfo->binfo.resultRowInfo); - pInfo->binfo.inputTsOrder = pAnomalyNode->window.node.inputTsOrder; - pInfo->binfo.outputTsOrder = pAnomalyNode->window.node.outputTsOrder; - - pInfo->anomalyCol = extractColumnFromColumnNode(pColNode); - pInfo->anomalyKey.type = pInfo->anomalyCol.type; - pInfo->anomalyKey.bytes = pInfo->anomalyCol.bytes; - pInfo->anomalyKey.pData = taosMemoryCalloc(1, pInfo->anomalyCol.bytes); - if (pInfo->anomalyKey.pData == NULL) { - goto _error; - } - - int32_t itemSize = sizeof(int32_t) + pInfo->aggSup.resultRowSize + pInfo->anomalyKey.bytes; - pInfo->anomalySup.pResultRow = taosMemoryCalloc(1, itemSize); - pInfo->anomalySup.blocks = taosArrayInit(16, sizeof(SSDataBlock*)); - pInfo->anomalySup.windows = taosArrayInit(16, sizeof(STimeWindow)); - - if (pInfo->anomalySup.windows == NULL || pInfo->anomalySup.blocks == NULL || pInfo->anomalySup.pResultRow == NULL) { - code = TSDB_CODE_OUT_OF_MEMORY; - goto _error; - } - - code = filterInitFromNode((SNode*)pAnomalyNode->window.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); - QUERY_CHECK_CODE(code, lino, _error); - - code = initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); - QUERY_CHECK_CODE(code, lino, _error); - - setOperatorInfo(pOperator, "AnomalyWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY, true, OP_NOT_OPENED, - pInfo, pTaskInfo); - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, anomalyAggregateNext, NULL, anomalyDestroyOperatorInfo, - optrDefaultBufFn, NULL, optrDefaultGetNextExtFn, NULL); - - code = appendDownstream(pOperator, &downstream, 1); - QUERY_CHECK_CODE(code, lino, _error); - - *pOptrInfo = pOperator; - - qDebug("anomaly_window operator is created, algo:%s url:%s opt:%s", pInfo->algoName, pInfo->algoUrl, - pInfo->anomalyOpt); - return TSDB_CODE_SUCCESS; - -_error: - if (pInfo != NULL) { - anomalyDestroyOperatorInfo(pInfo); - } - - destroyOperatorAndDownstreams(pOperator, &downstream, 1); - pTaskInfo->code = code; - qError("failed to create anomaly_window operator, algo:%s code:0x%x", pInfo->algoName, code); - return code; -} - -static int32_t anomalyAggregateNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) { - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SAnomalyWindowOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SOptrBasicInfo* pBInfo = &pInfo->binfo; - SAnomalyWindowSupp* pSupp = &pInfo->anomalySup; - SSDataBlock* pRes = pInfo->binfo.pRes; - int64_t st = taosGetTimestampUs(); - int32_t numOfBlocks = taosArrayGetSize(pSupp->blocks); - - blockDataCleanup(pRes); - - while (1) { - SSDataBlock* pBlock = getNextBlockFromDownstream(pOperator, 0); - if (pBlock == NULL) { - break; - } - - if (pSupp->groupId == 0 || pSupp->groupId == pBlock->info.id.groupId) { - pSupp->groupId = pBlock->info.id.groupId; - numOfBlocks++; - qDebug("group:%" PRId64 ", blocks:%d, cache block rows:%" PRId64, pSupp->groupId, numOfBlocks, pBlock->info.rows); - code = anomalyCacheBlock(pInfo, pBlock); - QUERY_CHECK_CODE(code, lino, _end); - } else { - qDebug("group:%" PRId64 ", read finish for new group coming, blocks:%d", pSupp->groupId, numOfBlocks); - anomalyAggregateBlocks(pOperator); - pSupp->groupId = pBlock->info.id.groupId; - numOfBlocks = 1; - qDebug("group:%" PRId64 ", new group, cache block rows:%" PRId64, pSupp->groupId, pBlock->info.rows); - code = anomalyCacheBlock(pInfo, pBlock); - QUERY_CHECK_CODE(code, lino, _end); - } - - if (pRes->info.rows > 0) { - (*ppRes) = pRes; - qDebug("group:%" PRId64 ", return to upstream, blocks:%d", pRes->info.id.groupId, numOfBlocks); - return code; - } - } - - if (numOfBlocks > 0) { - qDebug("group:%" PRId64 ", read finish, blocks:%d", pInfo->anomalySup.groupId, numOfBlocks); - anomalyAggregateBlocks(pOperator); - } - - int64_t cost = taosGetTimestampUs() - st; - qDebug("all groups finished, cost:%" PRId64 "us", cost); - -_end: - if (code != TSDB_CODE_SUCCESS) { - qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); - pTaskInfo->code = code; - T_LONG_JMP(pTaskInfo->env, code); - } - (*ppRes) = (pBInfo->pRes->info.rows == 0) ? NULL : pBInfo->pRes; - return code; -} - -static void anomalyDestroyOperatorInfo(void* param) { - SAnomalyWindowOperatorInfo* pInfo = (SAnomalyWindowOperatorInfo*)param; - if (pInfo == NULL) return; - - qDebug("anomaly_window operator is destroyed, algo:%s", pInfo->algoName); - - cleanupBasicInfo(&pInfo->binfo); - cleanupAggSup(&pInfo->aggSup); - cleanupExprSupp(&pInfo->scalarSup); - colDataDestroy(&pInfo->twAggSup.timeWindowData); - - for (int32_t i = 0; i < taosArrayGetSize(pInfo->anomalySup.blocks); ++i) { - SSDataBlock* pBlock = taosArrayGetP(pInfo->anomalySup.blocks, i); - blockDataDestroy(pBlock); - } - taosArrayDestroy(pInfo->anomalySup.blocks); - taosArrayDestroy(pInfo->anomalySup.windows); - taosMemoryFreeClear(pInfo->anomalySup.pResultRow); - taosMemoryFreeClear(pInfo->anomalyKey.pData); - - taosMemoryFreeClear(param); -} - -static int32_t anomalyCacheBlock(SAnomalyWindowOperatorInfo* pInfo, SSDataBlock* pSrc) { - SSDataBlock* pDst = NULL; - int32_t code = createOneDataBlock(pSrc, true, &pDst); - - if (code != 0) return code; - if (pDst == NULL) return TSDB_CODE_OUT_OF_MEMORY; - if (taosArrayPush(pInfo->anomalySup.blocks, &pDst) == NULL) return TSDB_CODE_OUT_OF_MEMORY; - - return 0; -} - -static int32_t anomalyFindWindow(SAnomalyWindowSupp* pSupp, TSKEY key) { - for (int32_t i = pSupp->curWinIndex; i < taosArrayGetSize(pSupp->windows); ++i) { - STimeWindow* pWindow = taosArrayGet(pSupp->windows, i); - if (key >= pWindow->skey && key < pWindow->ekey) { - pSupp->curWin = *pWindow; - pSupp->curWinIndex = i; - return 0; - } - } - return -1; -} - -static int32_t anomalyParseJson(SJson* pJson, SArray* pWindows) { - int32_t code = 0; - int32_t rows = 0; - STimeWindow win = {0}; - - taosArrayClear(pWindows); - - tjsonGetInt32ValueFromDouble(pJson, "rows", rows, code); - if (code < 0) return TSDB_CODE_INVALID_JSON_FORMAT; - if (rows <= 0) return 0; - - SJson* res = tjsonGetObjectItem(pJson, "res"); - if (res == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - - int32_t ressize = tjsonGetArraySize(res); - if (ressize != rows) return TSDB_CODE_INVALID_JSON_FORMAT; - - for (int32_t i = 0; i < rows; ++i) { - SJson* row = tjsonGetArrayItem(res, i); - if (row == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - - int32_t colsize = tjsonGetArraySize(row); - if (colsize != 2) return TSDB_CODE_INVALID_JSON_FORMAT; - - SJson* start = tjsonGetArrayItem(row, 0); - SJson* end = tjsonGetArrayItem(row, 1); - if (start == NULL || end == NULL) return TSDB_CODE_INVALID_JSON_FORMAT; - - tjsonGetObjectValueBigInt(start, &win.skey); - tjsonGetObjectValueBigInt(end, &win.ekey); - - if (win.skey >= win.ekey) { - win.ekey = win.skey + 1; - } - - if (taosArrayPush(pWindows, &win) == NULL) return TSDB_CODE_OUT_OF_BUFFER; - } - - int32_t numOfWins = taosArrayGetSize(pWindows); - qDebug("anomaly window recevied, total:%d", numOfWins); - for (int32_t i = 0; i < numOfWins; ++i) { - STimeWindow* pWindow = taosArrayGet(pWindows, i); - qDebug("anomaly win:%d [%" PRId64 ", %" PRId64 ")", i, pWindow->skey, pWindow->ekey); - } - - return 0; -} - -static int32_t anomalyAnalysisWindow(SOperatorInfo* pOperator) { - SAnomalyWindowOperatorInfo* pInfo = pOperator->info; - SAnomalyWindowSupp* pSupp = &pInfo->anomalySup; - SJson* pJson = NULL; - SAnalBuf analBuf = {.bufType = ANAL_BUF_TYPE_JSON}; - char dataBuf[64] = {0}; - int32_t code = 0; - - int64_t ts = 0; - // int64_t ts = taosGetTimestampMs(); - snprintf(analBuf.fileName, sizeof(analBuf.fileName), "%s/tdengine-anomaly-%" PRId64 "-%" PRId64, tsTempDir, ts, - pSupp->groupId); - code = tsosAnalBufOpen(&analBuf, 2); - if (code != 0) goto _OVER; - - const char* prec = TSDB_TIME_PRECISION_MILLI_STR; - if (pInfo->anomalyCol.precision == TSDB_TIME_PRECISION_MICRO) prec = TSDB_TIME_PRECISION_MICRO_STR; - if (pInfo->anomalyCol.precision == TSDB_TIME_PRECISION_NANO) prec = TSDB_TIME_PRECISION_NANO_STR; - - code = taosAnalBufWriteOptStr(&analBuf, "algo", pInfo->algoName); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteOptStr(&analBuf, "prec", prec); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteColMeta(&analBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, "ts"); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteColMeta(&analBuf, 1, pInfo->anomalyCol.type, "val"); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteDataBegin(&analBuf); - if (code != 0) goto _OVER; - - int32_t numOfBlocks = (int32_t)taosArrayGetSize(pSupp->blocks); - - // timestamp - code = taosAnalBufWriteColBegin(&analBuf, 0); - if (code != 0) goto _OVER; - for (int32_t i = 0; i < numOfBlocks; ++i) { - SSDataBlock* pBlock = taosArrayGetP(pSupp->blocks, i); - if (pBlock == NULL) break; - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); - if (pTsCol == NULL) break; - for (int32_t j = 0; j < pBlock->info.rows; ++j) { - code = taosAnalBufWriteColData(&analBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, &((TSKEY*)pTsCol->pData)[j]); - if (code != 0) goto _OVER; - } - } - code = taosAnalBufWriteColEnd(&analBuf, 0); - if (code != 0) goto _OVER; - - // data - code = taosAnalBufWriteColBegin(&analBuf, 1); - if (code != 0) goto _OVER; - for (int32_t i = 0; i < numOfBlocks; ++i) { - SSDataBlock* pBlock = taosArrayGetP(pSupp->blocks, i); - if (pBlock == NULL) break; - SColumnInfoData* pValCol = taosArrayGet(pBlock->pDataBlock, pInfo->anomalyCol.slotId); - if (pValCol == NULL) break; - - for (int32_t j = 0; j < pBlock->info.rows; ++j) { - code = taosAnalBufWriteColData(&analBuf, 1, pValCol->info.type, colDataGetData(pValCol, j)); - if (code != 0) goto _OVER; - if (code != 0) goto _OVER; - } - } - code = taosAnalBufWriteColEnd(&analBuf, 1); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteDataEnd(&analBuf); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteOptStr(&analBuf, "option", pInfo->anomalyOpt); - if (code != 0) goto _OVER; - - code = taosAnalBufClose(&analBuf); - if (code != 0) goto _OVER; - - pJson = taosAnalSendReqRetJson(pInfo->algoUrl, ANAL_HTTP_TYPE_POST, &analBuf); - if (pJson == NULL) { - code = terrno; - goto _OVER; - } - - code = anomalyParseJson(pJson, pSupp->windows); - if (code != 0) goto _OVER; - -_OVER: - if (code != 0) { - qError("failed to analysis window since %s", tstrerror(code)); - } - taosAnalBufDestroy(&analBuf); - if (pJson != NULL) tjsonDelete(pJson); - return code; -} - -static void anomalyAggregateRows(SOperatorInfo* pOperator, SSDataBlock* pBlock) { - SAnomalyWindowOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SExprSupp* pExprSup = &pOperator->exprSupp; - SAnomalyWindowSupp* pSupp = &pInfo->anomalySup; - SWindowRowsSup* pRowSup = &pInfo->anomalyWinRowSup; - SResultRow* pResRow = pSupp->pResultRow; - int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - - if (setResultRowInitCtx(pResRow, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset) == 0) { - updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pSupp->curWin, 0); - applyAggFunctionOnPartialTuples(pTaskInfo, pExprSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, - pRowSup->numOfRows, pBlock->info.rows, numOfOutput); - } -} - -static void anomalyBuildResult(SOperatorInfo* pOperator) { - SAnomalyWindowOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SExprSupp* pExprSup = &pOperator->exprSupp; - SSDataBlock* pRes = pInfo->binfo.pRes; - SResultRow* pResRow = pInfo->anomalySup.pResultRow; - - doUpdateNumOfRows(pExprSup->pCtx, pResRow, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); - copyResultrowToDataBlock(pExprSup->pExprInfo, pExprSup->numOfExprs, pResRow, pExprSup->pCtx, pRes, - pExprSup->rowEntryInfoOffset, pTaskInfo); - pRes->info.rows += pResRow->numOfRows; - clearResultRowInitFlag(pExprSup->pCtx, pExprSup->numOfExprs); -} - -static void anomalyAggregateBlocks(SOperatorInfo* pOperator) { - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SAnomalyWindowOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SExprSupp* pExprSup = &pOperator->exprSupp; - SSDataBlock* pRes = pInfo->binfo.pRes; - SAnomalyWindowSupp* pSupp = &pInfo->anomalySup; - SWindowRowsSup* pRowSup = &pInfo->anomalyWinRowSup; - SResultRow* pResRow = pSupp->pResultRow; - int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - int32_t rowsInWin = 0; - int32_t rowsInBlock = 0; - const int64_t gid = pSupp->groupId; - const int32_t order = pInfo->binfo.inputTsOrder; - - int32_t numOfBlocks = (int32_t)taosArrayGetSize(pSupp->blocks); - if (numOfBlocks == 0) goto _OVER; - - qDebug("group:%" PRId64 ", aggregate blocks, blocks:%d", pSupp->groupId, numOfBlocks); - pRes->info.id.groupId = pSupp->groupId; - - code = anomalyAnalysisWindow(pOperator); - QUERY_CHECK_CODE(code, lino, _OVER); - - int32_t numOfWins = taosArrayGetSize(pSupp->windows); - qDebug("group:%" PRId64 ", wins:%d, rows:%" PRId64, pSupp->groupId, numOfWins, pSupp->numOfRows); - for (int32_t w = 0; w < numOfWins; ++w) { - STimeWindow* pWindow = taosArrayGet(pSupp->windows, w); - if (w == 0) { - pSupp->curWin = *pWindow; - pRowSup->win.skey = pSupp->curWin.skey; - } - qDebug("group:%" PRId64 ", win:%d [%" PRId64 ", %" PRId64 ")", pSupp->groupId, w, pWindow->skey, pWindow->ekey); - } - - if (numOfWins <= 0) goto _OVER; - if (numOfWins > pRes->info.capacity) { - code = blockDataEnsureCapacity(pRes, numOfWins); - QUERY_CHECK_CODE(code, lino, _OVER); - } - - for (int32_t b = 0; b < numOfBlocks; ++b) { - SSDataBlock* pBlock = taosArrayGetP(pSupp->blocks, b); - if (pBlock == NULL) break; - - pRes->info.scanFlag = pBlock->info.scanFlag; - code = setInputDataBlock(pExprSup, pBlock, order, MAIN_SCAN, true); - if (code != 0) break; - - code = blockDataUpdateTsWindow(pBlock, pInfo->tsSlotId); - if (code != 0) break; - - // there is an scalar expression that needs to be calculated right before apply the group aggregation. - if (pInfo->scalarSup.pExprInfo != NULL) { - code = projectApplyFunctions(pInfo->scalarSup.pExprInfo, pBlock, pBlock, pInfo->scalarSup.pCtx, - pInfo->scalarSup.numOfExprs, NULL); - if (code != 0) break; - } - - SColumnInfoData* pValCol = taosArrayGet(pBlock->pDataBlock, pInfo->anomalyCol.slotId); - if (pValCol == NULL) break; - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); - if (pTsCol == NULL) break; - TSKEY* tsList = (TSKEY*)pTsCol->pData; - bool lastBlock = (b == numOfBlocks - 1); - - qTrace("group:%" PRId64 ", block:%d win:%d, riwin:%d riblock:%d, rows:%" PRId64, pSupp->groupId, b, - pSupp->curWinIndex, rowsInWin, rowsInBlock, pBlock->info.rows); - - for (int32_t r = 0; r < pBlock->info.rows; ++r) { - TSKEY key = tsList[r]; - bool keyInWin = (key >= pSupp->curWin.skey && key < pSupp->curWin.ekey); - bool lastRow = (r == pBlock->info.rows - 1); - - if (keyInWin) { - if (r < 5) { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d", pSupp->groupId, b, - pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - } - if (rowsInBlock == 0) { - doKeepNewWindowStartInfo(pRowSup, tsList, r, gid); - } - doKeepTuple(pRowSup, tsList[r], gid); - rowsInBlock++; - rowsInWin++; - } else { - if (rowsInBlock > 0) { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d, agg", pSupp->groupId, - b, pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - anomalyAggregateRows(pOperator, pBlock); - rowsInBlock = 0; - } - if (rowsInWin > 0) { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d, build result", - pSupp->groupId, b, pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - anomalyBuildResult(pOperator); - rowsInWin = 0; - } - if (anomalyFindWindow(pSupp, tsList[r]) == 0) { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d, new window detect", - pSupp->groupId, b, pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - doKeepNewWindowStartInfo(pRowSup, tsList, r, gid); - doKeepTuple(pRowSup, tsList[r], gid); - rowsInBlock = 1; - rowsInWin = 1; - } else { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d, window not found", - pSupp->groupId, b, pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - rowsInBlock = 0; - rowsInWin = 0; - } - } - - if (lastRow && rowsInBlock > 0) { - qTrace("group:%" PRId64 ", block:%d win:%d, row:%d ts:%" PRId64 ", riwin:%d riblock:%d, agg since lastrow", - pSupp->groupId, b, pSupp->curWinIndex, r, key, rowsInWin, rowsInBlock); - anomalyAggregateRows(pOperator, pBlock); - rowsInBlock = 0; - } - } - - if (lastBlock && rowsInWin > 0) { - qTrace("group:%" PRId64 ", block:%d win:%d, riwin:%d riblock:%d, build result since lastblock", pSupp->groupId, b, - pSupp->curWinIndex, rowsInWin, rowsInBlock); - anomalyBuildResult(pOperator); - rowsInWin = 0; - } - } - - code = doFilter(pRes, pOperator->exprSupp.pFilterInfo, NULL); - QUERY_CHECK_CODE(code, lino, _OVER); - -_OVER: - for (int32_t i = 0; i < numOfBlocks; ++i) { - SSDataBlock* pBlock = taosArrayGetP(pSupp->blocks, i); - qDebug("%s, clear block, pBlock:%p pBlock->pDataBlock:%p", __func__, pBlock, pBlock->pDataBlock); - blockDataDestroy(pBlock); - } - - taosArrayClear(pSupp->blocks); - taosArrayClear(pSupp->windows); - pSupp->numOfRows = 0; - pSupp->curWin.ekey = 0; - pSupp->curWin.skey = 0; - pSupp->curWinIndex = 0; -} - -#else - -int32_t createAnomalywindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo, - SOperatorInfo** pOptrInfo) { - return TSDB_CODE_OPS_NOT_SUPPORT; -} -void destroyForecastInfo(void* param) {} - -#endif \ No newline at end of file diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 4fe45ff72e..0cadffbfdf 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -1794,14 +1794,9 @@ int32_t createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) { pExp->pExpr->nodeType = QUERY_NODE_FUNCTION; SFunctionNode* pFuncNode = (SFunctionNode*)pNode; - SDataType* pType = &pFuncNode->node.resType; - const char* pName = pFuncNode->node.aliasName; - if (pFuncNode->funcType == FUNCTION_TYPE_FORECAST_LOW || pFuncNode->funcType == FUNCTION_TYPE_FORECAST_HIGH || - pFuncNode->funcType == FUNCTION_TYPE_FORECAST_ROWTS) { - pName = pFuncNode->functionName; - } - pExp->base.resSchema = createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pName); - + SDataType* pType = &pFuncNode->node.resType; + pExp->base.resSchema = + createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pFuncNode->node.aliasName); tExprNode* pExprNode = pExp->pExpr; pExprNode->_function.functionId = pFuncNode->funcId; diff --git a/source/libs/executor/src/forecastoperator.c b/source/libs/executor/src/forecastoperator.c deleted file mode 100644 index 599678106c..0000000000 --- a/source/libs/executor/src/forecastoperator.c +++ /dev/null @@ -1,663 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -#include "executorInt.h" -#include "filter.h" -#include "function.h" -#include "functionMgt.h" -#include "operator.h" -#include "querytask.h" -#include "storageapi.h" -#include "tanal.h" -#include "tcommon.h" -#include "tcompare.h" -#include "tdatablock.h" -#include "tfill.h" -#include "ttime.h" - -#ifdef USE_ANAL - -typedef struct { - char algoName[TSDB_ANAL_ALGO_NAME_LEN]; - char algoUrl[TSDB_ANAL_ALGO_URL_LEN]; - char algoOpt[TSDB_ANAL_ALGO_OPTION_LEN]; - int64_t maxTs; - int64_t minTs; - int64_t numOfRows; - uint64_t groupId; - int32_t numOfBlocks; - int32_t optRows; - int16_t resTsSlot; - int16_t resValSlot; - int16_t resLowSlot; - int16_t resHighSlot; - int16_t inputTsSlot; - int16_t inputValSlot; - int8_t inputValType; - int8_t inputPrecision; - SAnalBuf analBuf; -} SForecastSupp; - -typedef struct SForecastOperatorInfo { - SSDataBlock* pRes; - SExprSupp scalarSup; // scalar calculation - SForecastSupp forecastSupp; -} SForecastOperatorInfo; - -static void destroyForecastInfo(void* param); - -static FORCE_INLINE int32_t forecastEnsureBlockCapacity(SSDataBlock* pBlock, int32_t newRowsNum) { - if (pBlock->info.rows < pBlock->info.capacity) { - return TSDB_CODE_SUCCESS; - } - - int32_t code = blockDataEnsureCapacity(pBlock, newRowsNum); - if (code != TSDB_CODE_SUCCESS) { - qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code)); - return code; - } - - return TSDB_CODE_SUCCESS; -} - -static int32_t forecastCacheBlock(SForecastSupp* pSupp, SSDataBlock* pBlock) { - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SAnalBuf* pBuf = &pSupp->analBuf; - - qDebug("block:%d, %p rows:%" PRId64, pSupp->numOfBlocks, pBlock, pBlock->info.rows); - pSupp->numOfBlocks++; - - for (int32_t j = 0; j < pBlock->info.rows; ++j) { - SColumnInfoData* pValCol = taosArrayGet(pBlock->pDataBlock, pSupp->inputValSlot); - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSupp->inputTsSlot); - if (pTsCol == NULL || pValCol == NULL) break; - - int64_t ts = ((TSKEY*)pTsCol->pData)[j]; - char* val = colDataGetData(pValCol, j); - int16_t valType = pValCol->info.type; - - pSupp->minTs = MIN(pSupp->minTs, ts); - pSupp->maxTs = MAX(pSupp->maxTs, ts); - pSupp->numOfRows++; - - code = taosAnalBufWriteColData(pBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, &ts); - if (TSDB_CODE_SUCCESS != code) return code; - - code = taosAnalBufWriteColData(pBuf, 1, valType, val); - if (TSDB_CODE_SUCCESS != code) return code; - } - - return 0; -} - -static int32_t forecastCloseBuf(SForecastSupp* pSupp) { - SAnalBuf* pBuf = &pSupp->analBuf; - int32_t code = 0; - - for (int32_t i = 0; i < 2; ++i) { - code = taosAnalBufWriteColEnd(pBuf, i); - if (code != 0) return code; - } - - code = taosAnalBufWriteDataEnd(pBuf); - if (code != 0) return code; - - int32_t len = strlen(pSupp->algoOpt); - int64_t every = (pSupp->maxTs - pSupp->minTs) / (pSupp->numOfRows + 1); - int64_t start = pSupp->maxTs + every; - bool hasStart = taosAnalGetOptStr(pSupp->algoOpt, "start", NULL, 0); - if (!hasStart) { - qDebug("forecast start not found from %s, use %" PRId64, pSupp->algoOpt, start); - code = taosAnalBufWriteOptInt(pBuf, "start", start); - if (code != 0) return code; - } - - bool hasEvery = taosAnalGetOptStr(pSupp->algoOpt, "every", NULL, 0); - if (!hasEvery) { - qDebug("forecast every not found from %s, use %" PRId64, pSupp->algoOpt, every); - code = taosAnalBufWriteOptInt(pBuf, "every", every); - if (code != 0) return code; - } - - code = taosAnalBufWriteOptStr(pBuf, "option", pSupp->algoOpt); - if (code != 0) return code; - - code = taosAnalBufClose(pBuf); - return code; -} - -static int32_t forecastAnalysis(SForecastSupp* pSupp, SSDataBlock* pBlock) { - SAnalBuf* pBuf = &pSupp->analBuf; - int32_t resCurRow = pBlock->info.rows; - int8_t tmpI8; - int16_t tmpI16; - int32_t tmpI32; - int64_t tmpI64; - float tmpFloat; - double tmpDouble; - int32_t code = 0; - - SColumnInfoData* pResValCol = taosArrayGet(pBlock->pDataBlock, pSupp->resValSlot); - if (NULL == pResValCol) return TSDB_CODE_OUT_OF_RANGE; - - SColumnInfoData* pResTsCol = (pSupp->resTsSlot != -1 ? taosArrayGet(pBlock->pDataBlock, pSupp->resTsSlot) : NULL); - SColumnInfoData* pResLowCol = (pSupp->resLowSlot != -1 ? taosArrayGet(pBlock->pDataBlock, pSupp->resLowSlot) : NULL); - SColumnInfoData* pResHighCol = - (pSupp->resHighSlot != -1 ? taosArrayGet(pBlock->pDataBlock, pSupp->resHighSlot) : NULL); - - SJson* pJson = taosAnalSendReqRetJson(pSupp->algoUrl, ANAL_HTTP_TYPE_POST, pBuf); - if (pJson == NULL) return terrno; - - int32_t rows = 0; - tjsonGetInt32ValueFromDouble(pJson, "rows", rows, code); - if (code < 0) goto _OVER; - if (rows <= 0) goto _OVER; - - SJson* res = tjsonGetObjectItem(pJson, "res"); - if (res == NULL) goto _OVER; - int32_t ressize = tjsonGetArraySize(res); - bool returnConf = (pSupp->resHighSlot != -1 || pSupp->resLowSlot != -1); - if (returnConf) { - if (ressize != 4) goto _OVER; - } else if (ressize != 2) { - goto _OVER; - } - - if (pResTsCol != NULL) { - resCurRow = pBlock->info.rows; - SJson* tsJsonArray = tjsonGetArrayItem(res, 0); - if (tsJsonArray == NULL) goto _OVER; - int32_t tsSize = tjsonGetArraySize(tsJsonArray); - if (tsSize != rows) goto _OVER; - for (int32_t i = 0; i < tsSize; ++i) { - SJson* tsJson = tjsonGetArrayItem(tsJsonArray, i); - tjsonGetObjectValueBigInt(tsJson, &tmpI64); - colDataSetInt64(pResTsCol, resCurRow, &tmpI64); - resCurRow++; - } - } - - if (pResLowCol != NULL) { - resCurRow = pBlock->info.rows; - SJson* lowJsonArray = tjsonGetArrayItem(res, 2); - if (lowJsonArray == NULL) goto _OVER; - int32_t lowSize = tjsonGetArraySize(lowJsonArray); - if (lowSize != rows) goto _OVER; - for (int32_t i = 0; i < lowSize; ++i) { - SJson* lowJson = tjsonGetArrayItem(lowJsonArray, i); - tjsonGetObjectValueDouble(lowJson, &tmpDouble); - tmpFloat = (float)tmpDouble; - colDataSetFloat(pResLowCol, resCurRow, &tmpFloat); - resCurRow++; - } - } - - if (pResHighCol != NULL) { - resCurRow = pBlock->info.rows; - SJson* highJsonArray = tjsonGetArrayItem(res, 3); - if (highJsonArray == NULL) goto _OVER; - int32_t highSize = tjsonGetArraySize(highJsonArray); - if (highSize != rows) goto _OVER; - for (int32_t i = 0; i < highSize; ++i) { - SJson* highJson = tjsonGetArrayItem(highJsonArray, i); - tjsonGetObjectValueDouble(highJson, &tmpDouble); - tmpFloat = (float)tmpDouble; - colDataSetFloat(pResHighCol, resCurRow, &tmpFloat); - resCurRow++; - } - } - - resCurRow = pBlock->info.rows; - SJson* valJsonArray = tjsonGetArrayItem(res, 1); - if (valJsonArray == NULL) goto _OVER; - int32_t valSize = tjsonGetArraySize(valJsonArray); - if (valSize != rows) goto _OVER; - for (int32_t i = 0; i < valSize; ++i) { - SJson* valJson = tjsonGetArrayItem(valJsonArray, i); - tjsonGetObjectValueDouble(valJson, &tmpDouble); - - switch (pSupp->inputValType) { - case TSDB_DATA_TYPE_BOOL: - case TSDB_DATA_TYPE_UTINYINT: - case TSDB_DATA_TYPE_TINYINT: { - tmpI8 = (int8_t)tmpDouble; - colDataSetInt8(pResValCol, resCurRow, &tmpI8); - break; - } - case TSDB_DATA_TYPE_USMALLINT: - case TSDB_DATA_TYPE_SMALLINT: { - tmpI16 = (int16_t)tmpDouble; - colDataSetInt16(pResValCol, resCurRow, &tmpI16); - break; - } - case TSDB_DATA_TYPE_INT: - case TSDB_DATA_TYPE_UINT: { - tmpI32 = (int32_t)tmpDouble; - colDataSetInt32(pResValCol, resCurRow, &tmpI32); - break; - } - case TSDB_DATA_TYPE_TIMESTAMP: - case TSDB_DATA_TYPE_UBIGINT: - case TSDB_DATA_TYPE_BIGINT: { - tmpI64 = (int64_t)tmpDouble; - colDataSetInt64(pResValCol, resCurRow, &tmpI64); - break; - } - case TSDB_DATA_TYPE_FLOAT: { - tmpFloat = (float)tmpDouble; - colDataSetFloat(pResValCol, resCurRow, &tmpFloat); - break; - } - case TSDB_DATA_TYPE_DOUBLE: { - colDataSetDouble(pResValCol, resCurRow, &tmpDouble); - break; - } - default: - code = TSDB_CODE_FUNC_FUNTION_PARA_TYPE; - goto _OVER; - } - resCurRow++; - } - - // for (int32_t i = rows; i < pSupp->optRows; ++i) { - // colDataSetNNULL(pResValCol, rows, (pSupp->optRows - rows)); - // if (pResTsCol != NULL) { - // colDataSetNNULL(pResTsCol, rows, (pSupp->optRows - rows)); - // } - // if (pResLowCol != NULL) { - // colDataSetNNULL(pResLowCol, rows, (pSupp->optRows - rows)); - // } - // if (pResHighCol != NULL) { - // colDataSetNNULL(pResHighCol, rows, (pSupp->optRows - rows)); - // } - // } - - // if (rows == pSupp->optRows) { - // pResValCol->hasNull = false; - // } - - pBlock->info.rows += rows; - - if (pJson != NULL) tjsonDelete(pJson); - return 0; - -_OVER: - if (pJson != NULL) tjsonDelete(pJson); - if (code == 0) { - code = TSDB_CODE_INVALID_JSON_FORMAT; - } - qError("failed to perform forecast finalize since %s", tstrerror(code)); - return TSDB_CODE_INVALID_JSON_FORMAT; -} - -static int32_t forecastAggregateBlocks(SForecastSupp* pSupp, SSDataBlock* pResBlock) { - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SAnalBuf* pBuf = &pSupp->analBuf; - - code = forecastCloseBuf(pSupp); - QUERY_CHECK_CODE(code, lino, _end); - - code = forecastEnsureBlockCapacity(pResBlock, 1); - QUERY_CHECK_CODE(code, lino, _end); - - code = forecastAnalysis(pSupp, pResBlock); - QUERY_CHECK_CODE(code, lino, _end); - - uInfo("block:%d, forecast finalize", pSupp->numOfBlocks); - -_end: - pSupp->numOfBlocks = 0; - taosAnalBufDestroy(&pSupp->analBuf); - return code; -} - -static int32_t forecastNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) { - int32_t code = TSDB_CODE_SUCCESS; - int32_t lino = 0; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SForecastOperatorInfo* pInfo = pOperator->info; - SSDataBlock* pResBlock = pInfo->pRes; - SForecastSupp* pSupp = &pInfo->forecastSupp; - SAnalBuf* pBuf = &pSupp->analBuf; - int64_t st = taosGetTimestampUs(); - int32_t numOfBlocks = pSupp->numOfBlocks; - - blockDataCleanup(pResBlock); - - while (1) { - SSDataBlock* pBlock = getNextBlockFromDownstream(pOperator, 0); - if (pBlock == NULL) { - break; - } - - if (pSupp->groupId == 0 || pSupp->groupId == pBlock->info.id.groupId) { - pSupp->groupId = pBlock->info.id.groupId; - numOfBlocks++; - qDebug("group:%" PRId64 ", blocks:%d, cache block rows:%" PRId64, pSupp->groupId, numOfBlocks, pBlock->info.rows); - code = forecastCacheBlock(pSupp, pBlock); - QUERY_CHECK_CODE(code, lino, _end); - } else { - qDebug("group:%" PRId64 ", read finish for new group coming, blocks:%d", pSupp->groupId, numOfBlocks); - forecastAggregateBlocks(pSupp, pResBlock); - pSupp->groupId = pBlock->info.id.groupId; - numOfBlocks = 1; - qDebug("group:%" PRId64 ", new group, cache block rows:%" PRId64, pSupp->groupId, pBlock->info.rows); - code = forecastCacheBlock(pSupp, pBlock); - QUERY_CHECK_CODE(code, lino, _end); - } - - if (pResBlock->info.rows > 0) { - (*ppRes) = pResBlock; - qDebug("group:%" PRId64 ", return to upstream, blocks:%d", pResBlock->info.id.groupId, numOfBlocks); - return code; - } - } - - if (numOfBlocks > 0) { - qDebug("group:%" PRId64 ", read finish, blocks:%d", pSupp->groupId, numOfBlocks); - forecastAggregateBlocks(pSupp, pResBlock); - } - - int64_t cost = taosGetTimestampUs() - st; - qDebug("all groups finished, cost:%" PRId64 "us", cost); - -_end: - if (code != TSDB_CODE_SUCCESS) { - qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); - pTaskInfo->code = code; - T_LONG_JMP(pTaskInfo->env, code); - } - (*ppRes) = (pResBlock->info.rows == 0) ? NULL : pResBlock; - return code; -} - -static int32_t forecastParseOutput(SForecastSupp* pSupp, SExprSupp* pExprSup) { - pSupp->resLowSlot = -1; - pSupp->resHighSlot = -1; - pSupp->resTsSlot = -1; - pSupp->resValSlot = -1; - - for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { - SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; - int32_t dstSlot = pExprInfo->base.resSchema.slotId; - if (pExprInfo->pExpr->_function.functionType == FUNCTION_TYPE_FORECAST) { - pSupp->resValSlot = dstSlot; - } else if (pExprInfo->pExpr->_function.functionType == FUNCTION_TYPE_FORECAST_ROWTS) { - pSupp->resTsSlot = dstSlot; - } else if (pExprInfo->pExpr->_function.functionType == FUNCTION_TYPE_FORECAST_LOW) { - pSupp->resLowSlot = dstSlot; - } else if (pExprInfo->pExpr->_function.functionType == FUNCTION_TYPE_FORECAST_HIGH) { - pSupp->resHighSlot = dstSlot; - } else { - } - } - - return 0; -} - -static int32_t forecastParseInput(SForecastSupp* pSupp, SNodeList* pFuncs) { - SNode* pNode = NULL; - - pSupp->inputTsSlot = -1; - pSupp->inputValSlot = -1; - pSupp->inputValType = -1; - pSupp->inputPrecision = -1; - - FOREACH(pNode, pFuncs) { - if ((nodeType(pNode) == QUERY_NODE_TARGET) && (nodeType(((STargetNode*)pNode)->pExpr) == QUERY_NODE_FUNCTION)) { - SFunctionNode* pFunc = (SFunctionNode*)((STargetNode*)pNode)->pExpr; - int32_t numOfParam = LIST_LENGTH(pFunc->pParameterList); - - if (pFunc->funcType == FUNCTION_TYPE_FORECAST) { - if (numOfParam == 3) { - SNode* p1 = nodesListGetNode(pFunc->pParameterList, 0); - SNode* p2 = nodesListGetNode(pFunc->pParameterList, 1); - SNode* p3 = nodesListGetNode(pFunc->pParameterList, 2); - if (p1 == NULL || p2 == NULL || p3 == NULL) return TSDB_CODE_PLAN_INTERNAL_ERROR; - if (p1->type != QUERY_NODE_COLUMN) return TSDB_CODE_PLAN_INTERNAL_ERROR; - if (p2->type != QUERY_NODE_VALUE) return TSDB_CODE_PLAN_INTERNAL_ERROR; - if (p3->type != QUERY_NODE_COLUMN) return TSDB_CODE_PLAN_INTERNAL_ERROR; - SColumnNode* pValNode = (SColumnNode*)p1; - SValueNode* pOptNode = (SValueNode*)p2; - SColumnNode* pTsNode = (SColumnNode*)p3; - pSupp->inputTsSlot = pTsNode->slotId; - pSupp->inputPrecision = pTsNode->node.resType.precision; - pSupp->inputValSlot = pValNode->slotId; - pSupp->inputValType = pValNode->node.resType.type; - tstrncpy(pSupp->algoOpt, pOptNode->literal, sizeof(pSupp->algoOpt)); - } else if (numOfParam == 2) { - SNode* p1 = nodesListGetNode(pFunc->pParameterList, 0); - SNode* p2 = nodesListGetNode(pFunc->pParameterList, 1); - if (p1 == NULL || p2 == NULL) return TSDB_CODE_PLAN_INTERNAL_ERROR; - if (p1->type != QUERY_NODE_COLUMN) return TSDB_CODE_PLAN_INTERNAL_ERROR; - if (p2->type != QUERY_NODE_COLUMN) return TSDB_CODE_PLAN_INTERNAL_ERROR; - SColumnNode* pValNode = (SColumnNode*)p1; - SColumnNode* pTsNode = (SColumnNode*)p2; - pSupp->inputTsSlot = pTsNode->slotId; - pSupp->inputPrecision = pTsNode->node.resType.precision; - pSupp->inputValSlot = pValNode->slotId; - pSupp->inputValType = pValNode->node.resType.type; - tstrncpy(pSupp->algoOpt, "algo=arima", TSDB_ANAL_ALGO_OPTION_LEN); - } else { - return TSDB_CODE_PLAN_INTERNAL_ERROR; - } - } - } - } - - return 0; -} - -static int32_t forecastParseAlgo(SForecastSupp* pSupp) { - pSupp->maxTs = 0; - pSupp->minTs = INT64_MAX; - pSupp->numOfRows = 0; - - if (!taosAnalGetOptStr(pSupp->algoOpt, "algo", pSupp->algoName, sizeof(pSupp->algoName))) { - qError("failed to get forecast algorithm name from %s", pSupp->algoOpt); - return TSDB_CODE_ANAL_ALGO_NOT_FOUND; - } - - if (taosAnalGetAlgoUrl(pSupp->algoName, ANAL_ALGO_TYPE_FORECAST, pSupp->algoUrl, sizeof(pSupp->algoUrl)) != 0) { - qError("failed to get forecast algorithm url from %s", pSupp->algoName); - return TSDB_CODE_ANAL_ALGO_NOT_LOAD; - } - - return 0; -} - -static int32_t forecastCreateBuf(SForecastSupp* pSupp) { - SAnalBuf* pBuf = &pSupp->analBuf; - int64_t ts = 0; // taosGetTimestampMs(); - - pBuf->bufType = ANAL_BUF_TYPE_JSON_COL; - snprintf(pBuf->fileName, sizeof(pBuf->fileName), "%s/tdengine-forecast-%" PRId64, tsTempDir, ts); - int32_t code = tsosAnalBufOpen(pBuf, 2); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteOptStr(pBuf, "algo", pSupp->algoName); - if (code != 0) goto _OVER; - - bool returnConf = (pSupp->resHighSlot == -1 || pSupp->resLowSlot == -1); - code = taosAnalBufWriteOptStr(pBuf, "return_conf", returnConf ? "true" : "false"); - if (code != 0) goto _OVER; - - bool hasAlpha = taosAnalGetOptStr(pSupp->algoOpt, "alpha", NULL, 0); - if (!hasAlpha) { - qDebug("forecast alpha not found from %s, use default:%f", pSupp->algoOpt, ANAL_FORECAST_DEFAULT_ALPHA); - code = taosAnalBufWriteOptFloat(pBuf, "alpha", ANAL_FORECAST_DEFAULT_ALPHA); - if (code != 0) goto _OVER; - } - - char tmpOpt[32] = {0}; - bool hasParam = taosAnalGetOptStr(pSupp->algoOpt, "param", tmpOpt, sizeof(tmpOpt)); - if (!hasParam) { - qDebug("forecast param not found from %s, use default:%s", pSupp->algoOpt, ANAL_FORECAST_DEFAULT_PARAM); - code = taosAnalBufWriteOptStr(pBuf, "param", ANAL_FORECAST_DEFAULT_PARAM); - if (code != 0) goto _OVER; - } - - bool hasPeriod = taosAnalGetOptInt(pSupp->algoOpt, "period", NULL); - if (!hasPeriod) { - qDebug("forecast period not found from %s, use default:%d", pSupp->algoOpt, ANAL_FORECAST_DEFAULT_PERIOD); - code = taosAnalBufWriteOptInt(pBuf, "period", ANAL_FORECAST_DEFAULT_PERIOD); - if (code != 0) goto _OVER; - } - - bool hasRows = taosAnalGetOptInt(pSupp->algoOpt, "rows", &pSupp->optRows); - if (!hasRows) { - pSupp->optRows = ANAL_FORECAST_DEFAULT_ROWS; - qDebug("forecast rows not found from %s, use default:%d", pSupp->algoOpt, pSupp->optRows); - code = taosAnalBufWriteOptInt(pBuf, "forecast_rows", pSupp->optRows); - if (code != 0) goto _OVER; - } - - const char* prec = TSDB_TIME_PRECISION_MILLI_STR; - if (pSupp->inputPrecision == TSDB_TIME_PRECISION_MICRO) prec = TSDB_TIME_PRECISION_MICRO_STR; - if (pSupp->inputPrecision == TSDB_TIME_PRECISION_NANO) prec = TSDB_TIME_PRECISION_NANO_STR; - code = taosAnalBufWriteOptStr(pBuf, "prec", prec); - if (code != 0) goto _OVER; - - if (returnConf) { - bool hasConf = taosAnalGetOptStr(pSupp->algoOpt, "conf", NULL, 0); - if (!hasConf) { - qDebug("forecast conf not found from %s, use default:%d", pSupp->algoOpt, ANAL_FORECAST_DEFAULT_CONF); - code = taosAnalBufWriteOptInt(pBuf, "conf", ANAL_FORECAST_DEFAULT_CONF); - if (code != 0) goto _OVER; - } - } - - code = taosAnalBufWriteColMeta(pBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, "ts"); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteColMeta(pBuf, 1, pSupp->inputValType, "val"); - if (code != 0) goto _OVER; - - code = taosAnalBufWriteDataBegin(pBuf); - if (code != 0) goto _OVER; - - for (int32_t i = 0; i < 2; ++i) { - code = taosAnalBufWriteColBegin(pBuf, i); - if (code != 0) goto _OVER; - } - -_OVER: - if (code != 0) { - taosAnalBufClose(pBuf); - taosAnalBufDestroy(pBuf); - } - return code; -} - -int32_t createForecastOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, - SOperatorInfo** pOptrInfo) { - QRY_PARAM_CHECK(pOptrInfo); - - int32_t code = 0; - int32_t lino = 0; - SForecastOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SForecastOperatorInfo)); - SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); - if (pOperator == NULL || pInfo == NULL) { - code = terrno; - goto _error; - } - - SForecastSupp* pSupp = &pInfo->forecastSupp; - SForecastFuncPhysiNode* pForecastPhyNode = (SForecastFuncPhysiNode*)pPhyNode; - SExprSupp* pExprSup = &pOperator->exprSupp; - int32_t numOfExprs = 0; - SExprInfo* pExprInfo = NULL; - - code = createExprInfo(pForecastPhyNode->pFuncs, NULL, &pExprInfo, &numOfExprs); - QUERY_CHECK_CODE(code, lino, _error); - - code = initExprSupp(pExprSup, pExprInfo, numOfExprs, &pTaskInfo->storageAPI.functionStore); - QUERY_CHECK_CODE(code, lino, _error); - - if (pForecastPhyNode->pExprs != NULL) { - int32_t num = 0; - SExprInfo* pScalarExprInfo = NULL; - code = createExprInfo(pForecastPhyNode->pExprs, NULL, &pScalarExprInfo, &num); - QUERY_CHECK_CODE(code, lino, _error); - - code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, num, &pTaskInfo->storageAPI.functionStore); - QUERY_CHECK_CODE(code, lino, _error); - } - - code = filterInitFromNode((SNode*)pForecastPhyNode->node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); - QUERY_CHECK_CODE(code, lino, _error); - - code = forecastParseInput(pSupp, pForecastPhyNode->pFuncs); - QUERY_CHECK_CODE(code, lino, _error); - - code = forecastParseOutput(pSupp, pExprSup); - QUERY_CHECK_CODE(code, lino, _error); - - code = forecastParseAlgo(pSupp); - QUERY_CHECK_CODE(code, lino, _error); - - code = forecastCreateBuf(pSupp); - QUERY_CHECK_CODE(code, lino, _error); - - initResultSizeInfo(&pOperator->resultInfo, 4096); - - pInfo->pRes = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); - QUERY_CHECK_NULL(pInfo->pRes, code, lino, _error, terrno); - - setOperatorInfo(pOperator, "ForecastOperator", QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC, false, OP_NOT_OPENED, pInfo, - pTaskInfo); - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, forecastNext, NULL, destroyForecastInfo, optrDefaultBufFn, - NULL, optrDefaultGetNextExtFn, NULL); - - code = blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); - QUERY_CHECK_CODE(code, lino, _error); - - code = appendDownstream(pOperator, &downstream, 1); - QUERY_CHECK_CODE(code, lino, _error); - - *pOptrInfo = pOperator; - - qDebug("forecast env is initialized, option:%s", pSupp->algoOpt); - return TSDB_CODE_SUCCESS; - -_error: - if (code != TSDB_CODE_SUCCESS) { - qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); - } - if (pInfo != NULL) destroyForecastInfo(pInfo); - destroyOperatorAndDownstreams(pOperator, &downstream, 1); - pTaskInfo->code = code; - return code; -} - -static void destroyForecastInfo(void* param) { - SForecastOperatorInfo* pInfo = (SForecastOperatorInfo*)param; - - blockDataDestroy(pInfo->pRes); - pInfo->pRes = NULL; - cleanupExprSupp(&pInfo->scalarSup); - taosAnalBufDestroy(&pInfo->forecastSupp.analBuf); - taosMemoryFreeClear(param); -} - -#else - -int32_t createForecastOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, - SOperatorInfo** pOptrInfo) { - return TSDB_CODE_OPS_NOT_SUPPORT; -} - -#endif diff --git a/source/libs/executor/src/operator.c b/source/libs/executor/src/operator.c index 7914f9f320..8daf4695db 100644 --- a/source/libs/executor/src/operator.c +++ b/source/libs/executor/src/operator.c @@ -619,8 +619,6 @@ int32_t createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHand code = createIndefinitOutputOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); } else if (QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC == type) { code = createTimeSliceOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); - } else if (QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC == type) { - code = createForecastOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT == type) { code = createEventwindowOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); } else if (QUERY_NODE_PHYSICAL_PLAN_GROUP_CACHE == type) { @@ -631,8 +629,6 @@ int32_t createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHand code = createStreamCountAggOperatorInfo(ops[0], pPhyNode, pTaskInfo, pHandle, &pOptr); } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT == type) { code = createCountwindowOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); - } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY == type) { - code = createAnomalywindowOperatorInfo(ops[0], pPhyNode, pTaskInfo, &pOptr); } else { code = TSDB_CODE_INVALID_PARA; pTaskInfo->code = code; diff --git a/source/libs/function/inc/builtinsimpl.h b/source/libs/function/inc/builtinsimpl.h index 36e53d0a80..970bdc6305 100644 --- a/source/libs/function/inc/builtinsimpl.h +++ b/source/libs/function/inc/builtinsimpl.h @@ -116,8 +116,6 @@ int32_t diffFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo); int32_t diffFunction(SqlFunctionCtx* pCtx); int32_t diffFunctionByRow(SArray* pCtx); -bool getForecastConfEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv); - bool getDerivativeFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); int32_t derivativeFuncSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo); int32_t derivativeFunction(SqlFunctionCtx* pCtx); diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h index 3112245de9..a50562d78d 100644 --- a/source/libs/function/inc/functionMgtInt.h +++ b/source/libs/function/inc/functionMgtInt.h @@ -58,7 +58,6 @@ extern "C" { #define FUNC_MGT_TSMA_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(29) #define FUNC_MGT_COUNT_LIKE_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(30) // funcs that should also return 0 when no rows found #define FUNC_MGT_PROCESS_BY_ROW FUNC_MGT_FUNC_CLASSIFICATION_MASK(31) -#define FUNC_MGT_FORECAST_PC_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(32) #define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 1fd99125a0..48b8f0d9c8 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -19,7 +19,6 @@ #include "geomFunc.h" #include "querynodes.h" #include "scalar.h" -#include "tanal.h" #include "taoserror.h" #include "ttime.h" @@ -2079,47 +2078,6 @@ static int32_t translateMode(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { return translateUniqueMode(pFunc, pErrBuf, len, false); } -static int32_t translateForecast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { - int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); - if (2 != numOfParams && 1 != numOfParams) { - return invaildFuncParaNumErrMsg(pErrBuf, len, "FORECAST require 1 or 2 parameters"); - } - - uint8_t valType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; - if (!IS_MATHABLE_TYPE(valType)) { - return invaildFuncParaTypeErrMsg(pErrBuf, len, "FORECAST only support mathable column"); - } - - if (numOfParams == 2) { - uint8_t optionType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; - if (TSDB_DATA_TYPE_BINARY != optionType) { - return invaildFuncParaTypeErrMsg(pErrBuf, len, "FORECAST option should be varchar"); - } - - SNode* pOption = nodesListGetNode(pFunc->pParameterList, 1); - if (QUERY_NODE_VALUE != nodeType(pOption)) { - return invaildFuncParaTypeErrMsg(pErrBuf, len, "FORECAST option should be value"); - } - - SValueNode* pValue = (SValueNode*)pOption; - if (!taosAnalGetOptStr(pValue->literal, "algo", NULL, 0) != 0) { - return invaildFuncParaValueErrMsg(pErrBuf, len, "FORECAST option should include algo field"); - } - - pValue->notReserved = true; - } - - pFunc->node.resType = (SDataType){.bytes = tDataTypes[valType].bytes, .type = valType}; - return TSDB_CODE_SUCCESS; -} - -static int32_t translateForecastConf(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { - pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_FLOAT].bytes, .type = TSDB_DATA_TYPE_FLOAT}; - return TSDB_CODE_SUCCESS; -} - -static EFuncReturnRows forecastEstReturnRows(SFunctionNode* pFunc) { return FUNC_RETURN_ROWS_N; } - static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); if (numOfParams > 2) { @@ -4839,48 +4797,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .sprocessFunc = randFunction, .finalizeFunc = NULL }, - { - .name = "forecast", - .type = FUNCTION_TYPE_FORECAST, - .classification = FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | - FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_FORBID_SYSTABLE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC | FUNC_MGT_PRIMARY_KEY_FUNC, - .translateFunc = translateForecast, - .getEnvFunc = getSelectivityFuncEnv, - .initFunc = functionSetup, - .processFunc = NULL, - .finalizeFunc = NULL, - .estimateReturnRowsFunc = forecastEstReturnRows, - }, - { - .name = "_frowts", - .type = FUNCTION_TYPE_FORECAST_ROWTS, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_FORECAST_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, - .translateFunc = translateTimePseudoColumn, - .getEnvFunc = getTimePseudoFuncEnv, - .initFunc = NULL, - .sprocessFunc = NULL, - .finalizeFunc = NULL - }, - { - .name = "_flow", - .type = FUNCTION_TYPE_FORECAST_LOW, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_FORECAST_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, - .translateFunc = translateForecastConf, - .getEnvFunc = getForecastConfEnv, - .initFunc = NULL, - .sprocessFunc = NULL, - .finalizeFunc = NULL - }, - { - .name = "_fhigh", - .type = FUNCTION_TYPE_FORECAST_HIGH, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_FORECAST_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, - .translateFunc = translateForecastConf, - .getEnvFunc = getForecastConfEnv, - .initFunc = NULL, - .sprocessFunc = NULL, - .finalizeFunc = NULL - }, }; // clang-format on diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index af023f5dba..9f50e705ca 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -19,7 +19,6 @@ #include "functionResInfoInt.h" #include "query.h" #include "querynodes.h" -#include "tanal.h" #include "tcompare.h" #include "tdatablock.h" #include "tdigest.h" @@ -3343,11 +3342,6 @@ bool funcInputGetNextRowIndex(SInputColumnInfoData* pInput, int32_t from, bool f } } -bool getForecastConfEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { - pEnv->calcMemSize = sizeof(float); - return true; -} - int32_t diffResultIsNull(SqlFunctionCtx* pCtx, SFuncInputRow* pRow){ SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); SDiffInfo* pDiffInfo = GET_ROWCELL_INTERBUF(pResInfo); diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index aaa66441ee..6c67a888a2 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -232,15 +232,6 @@ bool fmIsInterpFunc(int32_t funcId) { bool fmIsInterpPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_INTERP_PC_FUNC); } -bool fmIsForecastFunc(int32_t funcId) { - if (funcId < 0 || funcId >= funcMgtBuiltinsNum) { - return false; - } - return FUNCTION_TYPE_FORECAST == funcMgtBuiltins[funcId].type; -} - -bool fmIsForecastPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORECAST_PC_FUNC); } - bool fmIsLastRowFunc(int32_t funcId) { if (funcId < 0 || funcId >= funcMgtBuiltinsNum) { return false; diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index b77ffb8d2c..5db8863311 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -368,13 +368,6 @@ static int32_t countWindowNodeCopy(const SCountWindowNode* pSrc, SCountWindowNod return TSDB_CODE_SUCCESS; } -static int32_t anomalyWindowNodeCopy(const SAnomalyWindowNode* pSrc, SAnomalyWindowNode* pDst) { - CLONE_NODE_FIELD(pCol); - CLONE_NODE_FIELD(pExpr); - COPY_CHAR_ARRAY_FIELD(anomalyOpt); - return TSDB_CODE_SUCCESS; -} - static int32_t sessionWindowNodeCopy(const SSessionWindowNode* pSrc, SSessionWindowNode* pDst) { CLONE_NODE_FIELD_EX(pCol, SColumnNode*); CLONE_NODE_FIELD_EX(pGap, SValueNode*); @@ -629,8 +622,6 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p COPY_SCALAR_FIELD(windowAlgo); COPY_SCALAR_FIELD(windowCount); COPY_SCALAR_FIELD(windowSliding); - CLONE_NODE_FIELD(pAnomalyExpr); - COPY_CHAR_ARRAY_FIELD(anomalyOpt); return TSDB_CODE_SUCCESS; } @@ -683,12 +674,6 @@ static int32_t logicInterpFuncCopy(const SInterpFuncLogicNode* pSrc, SInterpFunc return TSDB_CODE_SUCCESS; } -static int32_t logicForecastFuncCopy(const SForecastFuncLogicNode* pSrc, SForecastFuncLogicNode* pDst) { - COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); - CLONE_NODE_LIST_FIELD(pFuncs); - return TSDB_CODE_SUCCESS; -} - static int32_t logicGroupCacheCopy(const SGroupCacheLogicNode* pSrc, SGroupCacheLogicNode* pDst) { COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); COPY_SCALAR_FIELD(grpColsMayBeNull); @@ -952,9 +937,6 @@ int32_t nodesCloneNode(const SNode* pNode, SNode** ppNode) { case QUERY_NODE_COUNT_WINDOW: code = countWindowNodeCopy((const SCountWindowNode*)pNode, (SCountWindowNode*)pDst); break; - case QUERY_NODE_ANOMALY_WINDOW: - code = anomalyWindowNodeCopy((const SAnomalyWindowNode*)pNode, (SAnomalyWindowNode*)pDst); - break; case QUERY_NODE_SESSION_WINDOW: code = sessionWindowNodeCopy((const SSessionWindowNode*)pNode, (SSessionWindowNode*)pDst); break; @@ -1039,9 +1021,6 @@ int32_t nodesCloneNode(const SNode* pNode, SNode** ppNode) { case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: code = logicInterpFuncCopy((const SInterpFuncLogicNode*)pNode, (SInterpFuncLogicNode*)pDst); break; - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - code = logicForecastFuncCopy((const SForecastFuncLogicNode*)pNode, (SForecastFuncLogicNode*)pDst); - break; case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: code = logicGroupCacheCopy((const SGroupCacheLogicNode*)pNode, (SGroupCacheLogicNode*)pDst); break; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 0f67493094..4b3ca97bbf 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -97,8 +97,6 @@ const char* nodesNodeName(ENodeType type) { return "WindowOffset"; case QUERY_NODE_COUNT_WINDOW: return "CountWindow"; - case QUERY_NODE_ANOMALY_WINDOW: - return "AnomalyWindow"; case QUERY_NODE_SET_OPERATOR: return "SetOperator"; case QUERY_NODE_SELECT_STMT: @@ -155,12 +153,6 @@ const char* nodesNodeName(ENodeType type) { return "CreateQnodeStmt"; case QUERY_NODE_DROP_QNODE_STMT: return "DropQnodeStmt"; - case QUERY_NODE_CREATE_ANODE_STMT: - return "CreateAnodeStmt"; - case QUERY_NODE_DROP_ANODE_STMT: - return "DropAnodeStmt"; - case QUERY_NODE_UPDATE_ANODE_STMT: - return "UpdateAnodeStmt"; case QUERY_NODE_CREATE_SNODE_STMT: return "CreateSnodeStmt"; case QUERY_NODE_DROP_SNODE_STMT: @@ -221,10 +213,6 @@ const char* nodesNodeName(ENodeType type) { return "ShowModulesStmt"; case QUERY_NODE_SHOW_QNODES_STMT: return "ShowQnodesStmt"; - case QUERY_NODE_SHOW_ANODES_STMT: - return "ShowAnodesStmt"; - case QUERY_NODE_SHOW_ANODES_FULL_STMT: - return "ShowAnodesFullStmt"; case QUERY_NODE_SHOW_SNODES_STMT: return "ShowSnodesStmt"; case QUERY_NODE_SHOW_BNODES_STMT: @@ -340,8 +328,6 @@ const char* nodesNodeName(ENodeType type) { return "LogicIndefRowsFunc"; case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: return "LogicInterpFunc"; - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - return "LogicForecastFunc"; case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: return "LogicGroupCache"; case QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL: @@ -376,10 +362,6 @@ const char* nodesNodeName(ENodeType type) { return "PhysiMergeCountWindow"; case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: return "PhysiStreamCountWindow"; - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - return "PhysiMergeAnomalyWindow"; - case QUERY_NODE_PHYSICAL_PLAN_STREAM_ANOMALY: - return "PhysiStreamAnomalyWindow"; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return "PhysiProject"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -431,8 +413,6 @@ const char* nodesNodeName(ENodeType type) { return "PhysiIndefRowsFunc"; case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: return "PhysiInterpFunc"; - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - return "PhysiForecastFunc"; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return "PhysiDispatch"; case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -1280,30 +1260,6 @@ static int32_t jsonToLogicInterpFuncNode(const SJson* pJson, void* pObj) { return code; } -static const char* jkForecastFuncLogicPlanFuncs = "Funcs"; - -static int32_t logicForecastFuncNodeToJson(const void* pObj, SJson* pJson) { - const SForecastFuncLogicNode* pNode = (const SForecastFuncLogicNode*)pObj; - - int32_t code = logicPlanNodeToJson(pObj, pJson); - if (TSDB_CODE_SUCCESS == code) { - code = nodeListToJson(pJson, jkForecastFuncLogicPlanFuncs, pNode->pFuncs); - } - - return code; -} - -static int32_t jsonToLogicForecastFuncNode(const SJson* pJson, void* pObj) { - SForecastFuncLogicNode* pNode = (SForecastFuncLogicNode*)pObj; - - int32_t code = jsonToLogicPlanNode(pJson, pObj); - if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeList(pJson, jkForecastFuncLogicPlanFuncs, &pNode->pFuncs); - } - - return code; -} - static const char* jkGroupCacheLogicPlanGrpColsMayBeNull = "GroupColsMayBeNull"; static const char* jkGroupCacheLogicPlanGroupByUid = "GroupByUid"; static const char* jkGroupCacheLogicPlanGlobalGroup = "GlobalGroup"; @@ -3055,36 +3011,6 @@ static int32_t jsonToPhysiCountWindowNode(const SJson* pJson, void* pObj) { return code; } -static const char* jkAnomalyWindowPhysiPlanAnomalyKey = "AnomalyKey"; -static const char* jkAnomalyWindowPhysiPlanAnomalyOption = "AnomalyOpt"; - -static int32_t physiAnomalyWindowNodeToJson(const void* pObj, SJson* pJson) { - const SAnomalyWindowPhysiNode* pNode = (const SAnomalyWindowPhysiNode*)pObj; - - int32_t code = physiWindowNodeToJson(pObj, pJson); - if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddObject(pJson, jkAnomalyWindowPhysiPlanAnomalyKey, nodeToJson, pNode->pAnomalyKey); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddStringToObject(pJson, jkAnomalyWindowPhysiPlanAnomalyOption, pNode->anomalyOpt); - } - return code; -} - -static int32_t jsonToPhysiAnomalyWindowNode(const SJson* pJson, void* pObj) { - SAnomalyWindowPhysiNode* pNode = (SAnomalyWindowPhysiNode*)pObj; - - int32_t code = jsonToPhysiWindowNode(pJson, pObj); - if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeObject(pJson, jkAnomalyWindowPhysiPlanAnomalyKey, &pNode->pAnomalyKey); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetStringValue(pJson, jkAnomalyWindowPhysiPlanAnomalyOption, pNode->anomalyOpt); - } - - return code; -} - static const char* jkPartitionPhysiPlanExprs = "Exprs"; static const char* jkPartitionPhysiPlanPartitionKeys = "PartitionKeys"; static const char* jkPartitionPhysiPlanTargets = "Targets"; @@ -3272,37 +3198,6 @@ static int32_t jsonToPhysiInterpFuncNode(const SJson* pJson, void* pObj) { return code; } -static const char* jkForecastFuncPhysiPlanExprs = "Exprs"; -static const char* jkForecastFuncPhysiPlanFuncs = "Funcs"; - -static int32_t physiForecastFuncNodeToJson(const void* pObj, SJson* pJson) { - const SForecastFuncPhysiNode* pNode = (const SForecastFuncPhysiNode*)pObj; - - int32_t code = physicPlanNodeToJson(pObj, pJson); - if (TSDB_CODE_SUCCESS == code) { - code = nodeListToJson(pJson, jkForecastFuncPhysiPlanExprs, pNode->pExprs); - } - if (TSDB_CODE_SUCCESS == code) { - code = nodeListToJson(pJson, jkForecastFuncPhysiPlanFuncs, pNode->pFuncs); - } - - return code; -} - -static int32_t jsonToPhysiForecastFuncNode(const SJson* pJson, void* pObj) { - SForecastFuncPhysiNode* pNode = (SForecastFuncPhysiNode*)pObj; - - int32_t code = jsonToPhysicPlanNode(pJson, pObj); - if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeList(pJson, jkForecastFuncPhysiPlanExprs, &pNode->pExprs); - } - if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeList(pJson, jkForecastFuncPhysiPlanFuncs, &pNode->pFuncs); - } - - return code; -} - static const char* jkDataSinkInputDataBlockDesc = "InputDataBlockDesc"; static int32_t physicDataSinkNodeToJson(const void* pObj, SJson* pJson) { @@ -4870,36 +4765,6 @@ static int32_t jsonToCountWindowNode(const SJson* pJson, void* pObj) { return code; } -static const char* jkAnomalyWindowTsPrimaryKey = "AnomalyTsPrimaryKey"; -static const char* jkAnomalyWindowExpr = "AnomalyWindowExpr"; -static const char* jkAnomalyWindowOption = "AnomalyWindowOpt"; - -static int32_t anomalyWindowNodeToJson(const void* pObj, SJson* pJson) { - const SAnomalyWindowNode* pNode = (const SAnomalyWindowNode*)pObj; - - int32_t code = tjsonAddObject(pJson, jkAnomalyWindowTsPrimaryKey, nodeToJson, pNode->pCol); - if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddObject(pJson, jkAnomalyWindowExpr, nodeToJson, pNode->pExpr); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddStringToObject(pJson, jkAnomalyWindowOption, pNode->anomalyOpt); - } - return code; -} - -static int32_t jsonToAnomalyWindowNode(const SJson* pJson, void* pObj) { - SAnomalyWindowNode* pNode = (SAnomalyWindowNode*)pObj; - - int32_t code = jsonToNodeObject(pJson, jkAnomalyWindowTsPrimaryKey, &pNode->pCol); - if (TSDB_CODE_SUCCESS == code) { - code = jsonToNodeObject(pJson, jkAnomalyWindowExpr, (SNode**)&pNode->pExpr); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetStringValue(pJson, jkAnomalyWindowOption, pNode->anomalyOpt); - } - return code; -} - static const char* jkIntervalWindowInterval = "Interval"; static const char* jkIntervalWindowOffset = "Offset"; static const char* jkIntervalWindowSliding = "Sliding"; @@ -6586,39 +6451,6 @@ static int32_t dropQnodeStmtToJson(const void* pObj, SJson* pJson) { return drop static int32_t jsonToDropQnodeStmt(const SJson* pJson, void* pObj) { return jsonToDropComponentNodeStmt(pJson, pObj); } -static const char* jkCreateAnodeStmtUrl = "Url"; -static const char* jkUpdateDropANodeStmtId = "AnodeId"; - -static int32_t createAnodeStmtToJson(const void* pObj, SJson* pJson) { - const SCreateAnodeStmt* pNode = (const SCreateAnodeStmt*)pObj; - return tjsonAddStringToObject(pJson, jkCreateAnodeStmtUrl, pNode->url); -} - -static int32_t jsonToCreateAnodeStmt(const SJson* pJson, void* pObj) { - SCreateAnodeStmt* pNode = (SCreateAnodeStmt*)pObj; - return tjsonGetStringValue(pJson, jkCreateAnodeStmtUrl, pNode->url); -} - -static int32_t updateAnodeStmtToJson(const void* pObj, SJson* pJson) { - const SUpdateAnodeStmt* pNode = (const SUpdateAnodeStmt*)pObj; - return tjsonAddIntegerToObject(pJson, jkUpdateDropANodeStmtId, pNode->anodeId); -} - -static int32_t jsonToUpdateAnodeStmt(const SJson* pJson, void* pObj) { - SUpdateAnodeStmt* pNode = (SUpdateAnodeStmt*)pObj; - return tjsonGetIntValue(pJson, jkUpdateDropANodeStmtId, &pNode->anodeId); -} - -static int32_t dropAnodeStmtToJson(const void* pObj, SJson* pJson) { - const SDropAnodeStmt* pNode = (const SDropAnodeStmt*)pObj; - return tjsonAddIntegerToObject(pJson, jkUpdateDropANodeStmtId, pNode->anodeId); -} - -static int32_t jsonToDropAnodeStmt(const SJson* pJson, void* pObj) { - SDropAnodeStmt* pNode = (SDropAnodeStmt*)pObj; - return tjsonGetIntValue(pJson, jkUpdateDropANodeStmtId, &pNode->anodeId); -} - static int32_t createSnodeStmtToJson(const void* pObj, SJson* pJson) { return createComponentNodeStmtToJson(pObj, pJson); } @@ -7184,14 +7016,6 @@ static int32_t showQnodesStmtToJson(const void* pObj, SJson* pJson) { return sho static int32_t jsonToShowQnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } -static int32_t showAnodesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } - -static int32_t jsonToShowAnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } - -static int32_t showAnodesFullStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } - -static int32_t jsonToShowAnodesFullStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } - static int32_t showArbGroupsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } static int32_t jsonToShowArbGroupsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } @@ -7728,8 +7552,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return windowOffsetNodeToJson(pObj, pJson); case QUERY_NODE_COUNT_WINDOW: return countWindowNodeToJson(pObj, pJson); - case QUERY_NODE_ANOMALY_WINDOW: - return anomalyWindowNodeToJson(pObj, pJson); case QUERY_NODE_SET_OPERATOR: return setOperatorToJson(pObj, pJson); case QUERY_NODE_SELECT_STMT: @@ -7782,12 +7604,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return createQnodeStmtToJson(pObj, pJson); case QUERY_NODE_DROP_QNODE_STMT: return dropQnodeStmtToJson(pObj, pJson); - case QUERY_NODE_CREATE_ANODE_STMT: - return createAnodeStmtToJson(pObj, pJson); - case QUERY_NODE_DROP_ANODE_STMT: - return dropAnodeStmtToJson(pObj, pJson); - case QUERY_NODE_UPDATE_ANODE_STMT: - return updateAnodeStmtToJson(pObj, pJson); case QUERY_NODE_CREATE_SNODE_STMT: return createSnodeStmtToJson(pObj, pJson); case QUERY_NODE_DROP_SNODE_STMT: @@ -7838,10 +7654,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return showMnodesStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_QNODES_STMT: return showQnodesStmtToJson(pObj, pJson); - case QUERY_NODE_SHOW_ANODES_STMT: - return showAnodesStmtToJson(pObj, pJson); - case QUERY_NODE_SHOW_ANODES_FULL_STMT: - return showAnodesFullStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_ARBGROUPS_STMT: return showArbGroupsStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_CLUSTER_STMT: @@ -7931,8 +7743,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return logicIndefRowsFuncNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: return logicInterpFuncNodeToJson(pObj, pJson); - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - return logicForecastFuncNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: return logicGroupCacheNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL: @@ -7993,8 +7803,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: return physiCountWindowNodeToJson(pObj, pJson); - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - return physiAnomalyWindowNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -8003,8 +7811,6 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return physiIndefRowsFuncNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: return physiInterpFuncNodeToJson(pObj, pJson); - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - return physiForecastFuncNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return physiDispatchNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -8096,8 +7902,6 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToWindowOffsetNode(pJson, pObj); case QUERY_NODE_COUNT_WINDOW: return jsonToCountWindowNode(pJson, pObj); - case QUERY_NODE_ANOMALY_WINDOW: - return jsonToAnomalyWindowNode(pJson, pObj); case QUERY_NODE_SET_OPERATOR: return jsonToSetOperator(pJson, pObj); case QUERY_NODE_SELECT_STMT: @@ -8200,10 +8004,6 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToShowMnodesStmt(pJson, pObj); case QUERY_NODE_SHOW_QNODES_STMT: return jsonToShowQnodesStmt(pJson, pObj); - case QUERY_NODE_SHOW_ANODES_STMT: - return jsonToShowAnodesStmt(pJson, pObj); - case QUERY_NODE_SHOW_ANODES_FULL_STMT: - return jsonToShowAnodesFullStmt(pJson, pObj); case QUERY_NODE_SHOW_ARBGROUPS_STMT: return jsonToShowArbGroupsStmt(pJson, pObj); case QUERY_NODE_SHOW_CLUSTER_STMT: @@ -8301,8 +8101,6 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToLogicIndefRowsFuncNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: return jsonToLogicInterpFuncNode(pJson, pObj); - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - return jsonToLogicForecastFuncNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: return jsonToLogicGroupCacheNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL: @@ -8363,8 +8161,6 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: return jsonToPhysiCountWindowNode(pJson, pObj); - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - return jsonToPhysiAnomalyWindowNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -8373,8 +8169,6 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToPhysiIndefRowsFuncNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: return jsonToPhysiInterpFuncNode(pJson, pObj); - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - return jsonToPhysiForecastFuncNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: return jsonToPhysiDispatchNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index 3d8a57363b..581c6222d2 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -3539,46 +3539,6 @@ static int32_t msgToPhysiCountWindowNode(STlvDecoder* pDecoder, void* pObj) { return code; } -enum { PHY_ANOMALY_CODE_WINDOW = 1, PHY_ANOMALY_CODE_KEY, PHY_ANOMALY_CODE_WINDOW_OPTION }; - -static int32_t physiAnomalyWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { - const SAnomalyWindowPhysiNode* pNode = (const SAnomalyWindowPhysiNode*)pObj; - - int32_t code = tlvEncodeObj(pEncoder, PHY_ANOMALY_CODE_WINDOW, physiWindowNodeToMsg, &pNode->window); - if (TSDB_CODE_SUCCESS == code) { - code = tlvEncodeObj(pEncoder, PHY_ANOMALY_CODE_KEY, nodeToMsg, pNode->pAnomalyKey); - } - if (TSDB_CODE_SUCCESS == code) { - code = tlvEncodeCStr(pEncoder, PHY_ANOMALY_CODE_WINDOW_OPTION, pNode->anomalyOpt); - } - - return code; -} - -static int32_t msgToPhysiAnomalyWindowNode(STlvDecoder* pDecoder, void* pObj) { - SAnomalyWindowPhysiNode* pNode = (SAnomalyWindowPhysiNode*)pObj; - - int32_t code = TSDB_CODE_SUCCESS; - STlv* pTlv = NULL; - tlvForEach(pDecoder, pTlv, code) { - switch (pTlv->type) { - case PHY_ANOMALY_CODE_WINDOW: - code = tlvDecodeObjFromTlv(pTlv, msgToPhysiWindowNode, &pNode->window); - break; - case PHY_ANOMALY_CODE_KEY: - code = msgToNodeFromTlv(pTlv, (void**)&pNode->pAnomalyKey); - break; - case PHY_ANOMALY_CODE_WINDOW_OPTION: - code = tlvDecodeCStr(pTlv, pNode->anomalyOpt, sizeof(pNode->anomalyOpt)); - break; - default: - break; - } - } - - return code; -} - enum { PHY_PARTITION_CODE_BASE_NODE = 1, PHY_PARTITION_CODE_EXPR, @@ -3810,50 +3770,6 @@ static int32_t msgToPhysiInterpFuncNode(STlvDecoder* pDecoder, void* pObj) { return code; } -enum { - PHY_FORECAST_FUNC_CODE_BASE_NODE = 1, - PHY_FORECAST_FUNC_CODE_EXPR, - PHY_FORECAST_FUNC_CODE_FUNCS, -}; - -static int32_t physiForecastFuncNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { - const SForecastFuncPhysiNode* pNode = (const SForecastFuncPhysiNode*)pObj; - - int32_t code = tlvEncodeObj(pEncoder, PHY_FORECAST_FUNC_CODE_BASE_NODE, physiNodeToMsg, &pNode->node); - if (TSDB_CODE_SUCCESS == code) { - code = tlvEncodeObj(pEncoder, PHY_FORECAST_FUNC_CODE_EXPR, nodeListToMsg, pNode->pExprs); - } - if (TSDB_CODE_SUCCESS == code) { - code = tlvEncodeObj(pEncoder, PHY_FORECAST_FUNC_CODE_FUNCS, nodeListToMsg, pNode->pFuncs); - } - - return code; -} - -static int32_t msgToPhysiForecastFuncNode(STlvDecoder* pDecoder, void* pObj) { - SForecastFuncPhysiNode* pNode = (SForecastFuncPhysiNode*)pObj; - - int32_t code = TSDB_CODE_SUCCESS; - STlv* pTlv = NULL; - tlvForEach(pDecoder, pTlv, code) { - switch (pTlv->type) { - case PHY_FORECAST_FUNC_CODE_BASE_NODE: - code = tlvDecodeObjFromTlv(pTlv, msgToPhysiNode, &pNode->node); - break; - case PHY_FORECAST_FUNC_CODE_EXPR: - code = msgToNodeListFromTlv(pTlv, (void**)&pNode->pExprs); - break; - case PHY_FORECAST_FUNC_CODE_FUNCS: - code = msgToNodeListFromTlv(pTlv, (void**)&pNode->pFuncs); - break; - default: - break; - } - } - - return code; -} - enum { PHY_DATA_SINK_CODE_INPUT_DESC = 1 }; static int32_t physicDataSinkNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { @@ -4620,9 +4536,6 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: code = physiCountWindowNodeToMsg(pObj, pEncoder); break; - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - code = physiAnomalyWindowNodeToMsg(pObj, pEncoder); - break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = physiPartitionNodeToMsg(pObj, pEncoder); break; @@ -4635,9 +4548,6 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: code = physiInterpFuncNodeToMsg(pObj, pEncoder); break; - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - code = physiForecastFuncNodeToMsg(pObj, pEncoder); - break; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: code = physiDispatchNodeToMsg(pObj, pEncoder); break; @@ -4788,9 +4698,6 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: code = msgToPhysiCountWindowNode(pDecoder, pObj); break; - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - code = msgToPhysiAnomalyWindowNode(pDecoder, pObj); - break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = msgToPhysiPartitionNode(pDecoder, pObj); break; @@ -4803,9 +4710,6 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: code = msgToPhysiInterpFuncNode(pDecoder, pObj); break; - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - code = msgToPhysiForecastFuncNode(pDecoder, pObj); - break; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: code = msgToPhysiDispatchNode(pDecoder, pObj); break; diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index f3f7395a37..4f30cb12b7 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -181,14 +181,6 @@ static EDealRes dispatchExpr(SNode* pNode, ETraversalOrder order, FNodeWalker wa res = walkExpr(pEvent->pCol, order, walker, pContext); break; } - case QUERY_NODE_ANOMALY_WINDOW: { - SAnomalyWindowNode* pAnomaly = (SAnomalyWindowNode*)pNode; - res = walkExpr(pAnomaly->pExpr, order, walker, pContext); - if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { - res = walkExpr(pAnomaly->pCol, order, walker, pContext); - } - break; - } default: break; } @@ -400,14 +392,6 @@ static EDealRes rewriteExpr(SNode** pRawNode, ETraversalOrder order, FNodeRewrit res = rewriteExpr(&pEvent->pCol, order, rewriter, pContext); break; } - case QUERY_NODE_ANOMALY_WINDOW: { - SAnomalyWindowNode* pAnomaly = (SAnomalyWindowNode*)pNode; - res = rewriteExpr(&pAnomaly->pExpr, order, rewriter, pContext); - if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { - res = rewriteExpr(&pAnomaly->pCol, order, rewriter, pContext); - } - break; - } default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 31568149c9..c7d21d6fde 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -419,8 +419,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { code = makeNode(type, sizeof(SEventWindowNode), &pNode); break; case QUERY_NODE_COUNT_WINDOW: code = makeNode(type, sizeof(SCountWindowNode), &pNode); break; - case QUERY_NODE_ANOMALY_WINDOW: - code = makeNode(type, sizeof(SAnomalyWindowNode), &pNode); break; case QUERY_NODE_HINT: code = makeNode(type, sizeof(SHintNode), &pNode); break; case QUERY_NODE_VIEW: @@ -476,12 +474,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { code = makeNode(type, sizeof(SDropDnodeStmt), &pNode); break; case QUERY_NODE_ALTER_DNODE_STMT: code = makeNode(type, sizeof(SAlterDnodeStmt), &pNode); break; - case QUERY_NODE_CREATE_ANODE_STMT: - code = makeNode(type, sizeof(SCreateAnodeStmt), &pNode); break; - case QUERY_NODE_DROP_ANODE_STMT: - code = makeNode(type, sizeof(SDropAnodeStmt), &pNode); break; - case QUERY_NODE_UPDATE_ANODE_STMT: - code = makeNode(type, sizeof(SUpdateAnodeStmt), &pNode); break; case QUERY_NODE_CREATE_INDEX_STMT: code = makeNode(type, sizeof(SCreateIndexStmt), &pNode); break; case QUERY_NODE_DROP_INDEX_STMT: @@ -548,8 +540,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: - case QUERY_NODE_SHOW_ANODES_STMT: - case QUERY_NODE_SHOW_ANODES_FULL_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: case QUERY_NODE_SHOW_ARBGROUPS_STMT: @@ -657,8 +647,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { code = makeNode(type, sizeof(SIndefRowsFuncLogicNode), &pNode); break; case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: code = makeNode(type, sizeof(SInterpFuncLogicNode), &pNode); break; - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - code = makeNode(type, sizeof(SForecastFuncLogicNode), &pNode); break; case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: code = makeNode(type, sizeof(SGroupCacheLogicNode), &pNode); break; case QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL: @@ -734,8 +722,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { code = makeNode(type, sizeof(SStreamEventWinodwPhysiNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_MERGE_COUNT: code = makeNode(type, sizeof(SCountWinodwPhysiNode), &pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: - code = makeNode(type, sizeof(SAnomalyWindowPhysiNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_STREAM_COUNT: code = makeNode(type, sizeof(SStreamCountWinodwPhysiNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: @@ -746,8 +732,6 @@ int32_t nodesMakeNode(ENodeType type, SNode** ppNodeOut) { code = makeNode(type, sizeof(SIndefRowsFuncPhysiNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: code = makeNode(type, sizeof(SInterpFuncLogicNode), &pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: - code = makeNode(type, sizeof(SForecastFuncLogicNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: code = makeNode(type, sizeof(SDataDispatcherNode), &pNode); break; case QUERY_NODE_PHYSICAL_PLAN_INSERT: @@ -1035,11 +1019,6 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pEvent->pCol); break; } - case QUERY_NODE_ANOMALY_WINDOW: { - SAnomalyWindowNode* pAnomaly = (SAnomalyWindowNode*)pNode; - nodesDestroyNode(pAnomaly->pCol); - break; - } case QUERY_NODE_HINT: { SHintNode* pHint = (SHintNode*)pNode; destroyHintValue(pHint->option, pHint->value); @@ -1188,9 +1167,6 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_CREATE_DNODE_STMT: // no pointer field case QUERY_NODE_DROP_DNODE_STMT: // no pointer field case QUERY_NODE_ALTER_DNODE_STMT: // no pointer field - case QUERY_NODE_CREATE_ANODE_STMT: // no pointer field - case QUERY_NODE_UPDATE_ANODE_STMT: // no pointer field - case QUERY_NODE_DROP_ANODE_STMT: // no pointer field break; case QUERY_NODE_CREATE_INDEX_STMT: { SCreateIndexStmt* pStmt = (SCreateIndexStmt*)pNode; @@ -1276,8 +1252,6 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: - case QUERY_NODE_SHOW_ANODES_STMT: - case QUERY_NODE_SHOW_ANODES_FULL_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: case QUERY_NODE_SHOW_ARBGROUPS_STMT: @@ -1526,12 +1500,6 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pLogicNode->pTimeSeries); break; } - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: { - SForecastFuncLogicNode* pLogicNode = (SForecastFuncLogicNode*)pNode; - destroyLogicNode((SLogicNode*)pLogicNode); - nodesDestroyList(pLogicNode->pFuncs); - break; - } case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: { SGroupCacheLogicNode* pLogicNode = (SGroupCacheLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); @@ -1695,11 +1663,6 @@ void nodesDestroyNode(SNode* pNode) { destroyWinodwPhysiNode((SWindowPhysiNode*)pPhyNode); break; } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY: { - SAnomalyWindowPhysiNode* pPhyNode = (SAnomalyWindowPhysiNode*)pNode; - destroyWinodwPhysiNode((SWindowPhysiNode*)pPhyNode); - break; - } case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); break; @@ -1727,13 +1690,6 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pTimeSeries); break; } - case QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC: { - SForecastFuncPhysiNode* pPhyNode = (SForecastFuncPhysiNode*)pNode; - destroyPhysiNode((SPhysiNode*)pPhyNode); - nodesDestroyList(pPhyNode->pExprs); - nodesDestroyList(pPhyNode->pFuncs); - break; - } case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: destroyDataSinkNode((SDataSinkNode*)pNode); break; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 28e867965f..a2aec77c2e 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -154,7 +154,6 @@ SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr); SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond); SNode* createCountWindowNode(SAstCreateContext* pCxt, const SToken* pCountToken, const SToken* pSlidingToken); -SNode* createAnomalyWindowNode(SAstCreateContext* pCxt, SNode* pExpr, const SToken* pFuncOpt); SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill); SNode* createWindowOffsetNode(SAstCreateContext* pCxt, SNode* pStartOffset, SNode* pEndOffset); @@ -252,9 +251,6 @@ SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName); SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort); SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force, bool unsafe); SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue); -SNode* createCreateAnodeStmt(SAstCreateContext* pCxt, const SToken* pUrl); -SNode* createDropAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode); -SNode* createUpdateAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode, bool updateAll); SNode* createEncryptKeyStmt(SAstCreateContext* pCxt, const SToken* pValue); SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName); SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName, diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 99f301445a..ae908f0826 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -157,12 +157,6 @@ with_clause_opt(A) ::= WITH search_condition(B). /************************************************ create encrypt_key *********************************************/ cmd ::= CREATE ENCRYPT_KEY NK_STRING(A). { pCxt->pRootNode = createEncryptKeyStmt(pCxt, &A); } -/************************************************ create drop update anode ***************************************/ -cmd ::= CREATE ANODE NK_STRING(A). { pCxt->pRootNode = createCreateAnodeStmt(pCxt, &A); } -cmd ::= UPDATE ANODE NK_INTEGER(A). { pCxt->pRootNode = createUpdateAnodeStmt(pCxt, &A, false); } -cmd ::= UPDATE ALL ANODES. { pCxt->pRootNode = createUpdateAnodeStmt(pCxt, NULL, true); } -cmd ::= DROP ANODE NK_INTEGER(A). { pCxt->pRootNode = createDropAnodeStmt(pCxt, &A); } - /************************************************ create/drop/alter/restore dnode *********************************************/ cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); } cmd ::= CREATE DNODE dnode_endpoint(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); } @@ -530,8 +524,6 @@ cmd ::= SHOW db_name_cond_opt(A) VGROUPS. cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } //cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } -cmd ::= SHOW ANODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_STMT); } -cmd ::= SHOW ANODES FULL. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_FULL_STMT); } cmd ::= SHOW ARBGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, B, A, OP_TYPE_EQUAL); } @@ -1195,9 +1187,6 @@ pseudo_column(A) ::= WDURATION(B). pseudo_column(A) ::= IROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= ISFILLED(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= QTAGS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } -pseudo_column(A) ::= FLOW(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } -pseudo_column(A) ::= FHIGH(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } -pseudo_column(A) ::= FROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } @@ -1516,10 +1505,6 @@ twindow_clause_opt(A) ::= COUNT_WINDOW NK_LP NK_INTEGER(B) NK_RP. { A = createCountWindowNode(pCxt, &B, &B); } twindow_clause_opt(A) ::= COUNT_WINDOW NK_LP NK_INTEGER(B) NK_COMMA NK_INTEGER(C) NK_RP. { A = createCountWindowNode(pCxt, &B, &C); } -twindow_clause_opt(A) ::= - ANOMALY_WINDOW NK_LP expr_or_subquery(B) NK_RP. { A = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, B), NULL); } -twindow_clause_opt(A) ::= - ANOMALY_WINDOW NK_LP expr_or_subquery(B) NK_COMMA NK_STRING(C) NK_RP. { A = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, B), &C); } sliding_opt(A) ::= . { A = NULL; } sliding_opt(A) ::= SLIDING NK_LP interval_sliding_duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 8ede53b0a4..5db7e18fc5 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1367,25 +1367,6 @@ _err: return NULL; } -SNode* createAnomalyWindowNode(SAstCreateContext* pCxt, SNode* pExpr, const SToken* pFuncOpt) { - SAnomalyWindowNode* pAnomaly = NULL; - CHECK_PARSER_STATUS(pCxt); - pCxt->errCode = nodesMakeNode(QUERY_NODE_ANOMALY_WINDOW, (SNode**)&pAnomaly); - CHECK_MAKE_NODE(pAnomaly); - pAnomaly->pCol = createPrimaryKeyCol(pCxt, NULL); - CHECK_MAKE_NODE(pAnomaly->pCol); - pAnomaly->pExpr = pExpr; - if (pFuncOpt == NULL) { - tstrncpy(pAnomaly->anomalyOpt, "algo=iqr", TSDB_ANAL_ALGO_OPTION_LEN); - } else { - (void)trimString(pFuncOpt->z, pFuncOpt->n, pAnomaly->anomalyOpt, sizeof(pAnomaly->anomalyOpt)); - } - return (SNode*)pAnomaly; -_err: - nodesDestroyNode((SNode*)pAnomaly); - return NULL; -} - SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill) { SIntervalWindowNode* interval = NULL; @@ -3016,47 +2997,6 @@ _err: return NULL; } -SNode* createCreateAnodeStmt(SAstCreateContext* pCxt, const SToken* pUrl) { - CHECK_PARSER_STATUS(pCxt); - SCreateAnodeStmt* pStmt = NULL; - pCxt->errCode = nodesMakeNode(QUERY_NODE_CREATE_ANODE_STMT, (SNode**)&pStmt); - CHECK_MAKE_NODE(pStmt); - (void)trimString(pUrl->z, pUrl->n, pStmt->url, sizeof(pStmt->url)); - return (SNode*)pStmt; -_err: - return NULL; -} - -SNode* createDropAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode) { - CHECK_PARSER_STATUS(pCxt); - SUpdateAnodeStmt* pStmt = NULL; - pCxt->errCode = nodesMakeNode(QUERY_NODE_DROP_ANODE_STMT, (SNode**)&pStmt); - CHECK_MAKE_NODE(pStmt); - if (NULL != pAnode) { - pStmt->anodeId = taosStr2Int32(pAnode->z, NULL, 10); - } else { - pStmt->anodeId = -1; - } - return (SNode*)pStmt; -_err: - return NULL; -} - -SNode* createUpdateAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode, bool updateAll) { - CHECK_PARSER_STATUS(pCxt); - SUpdateAnodeStmt* pStmt = NULL; - pCxt->errCode = nodesMakeNode(QUERY_NODE_UPDATE_ANODE_STMT, (SNode**)&pStmt); - CHECK_MAKE_NODE(pStmt); - if (NULL != pAnode) { - pStmt->anodeId = taosStr2Int32(pAnode->z, NULL, 10); - } else { - pStmt->anodeId = -1; - } - return (SNode*)pStmt; -_err: - return NULL; -} - SNode* createEncryptKeyStmt(SAstCreateContext* pCxt, const SToken* pValue) { SToken config; config.type = TK_NK_STRING; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index eecc04658b..10d9b19e7f 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -555,22 +555,6 @@ static int32_t collectMetaKeyFromShowSnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* return TSDB_CODE_SUCCESS; } -static int32_t collectMetaKeyFromShowAnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - if (pCxt->pParseCxt->enableSysInfo) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_ANODES, - pCxt->pMetaCache); - } - return TSDB_CODE_SUCCESS; -} - -static int32_t collectMetaKeyFromShowAnodesFull(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - if (pCxt->pParseCxt->enableSysInfo) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_ANODES_FULL, - pCxt->pMetaCache); - } - return TSDB_CODE_SUCCESS; -} - static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { if (pCxt->pParseCxt->enableSysInfo) { return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_BNODES, @@ -999,10 +983,6 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowQnodes(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_SNODES_STMT: return collectMetaKeyFromShowSnodes(pCxt, (SShowStmt*)pStmt); - case QUERY_NODE_SHOW_ANODES_STMT: - return collectMetaKeyFromShowAnodes(pCxt, (SShowStmt*)pStmt); - case QUERY_NODE_SHOW_ANODES_FULL_STMT: - return collectMetaKeyFromShowAnodesFull(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_BNODES_STMT: return collectMetaKeyFromShowBnodes(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_ARBGROUPS_STMT: diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index 5ae17a7647..0eb07d8143 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -358,8 +358,6 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: - case QUERY_NODE_SHOW_ANODES_STMT: - case QUERY_NODE_SHOW_ANODES_FULL_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 63121ec044..5857093cec 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -38,9 +38,6 @@ static SKeyword keywordTable[] = { {"ANALYZE", TK_ANALYZE}, {"AND", TK_AND}, {"ANTI", TK_ANTI}, - {"ANODE", TK_ANODE}, - {"ANODES", TK_ANODES}, - {"ANOMALY_WINDOW", TK_ANOMALY_WINDOW}, // {"ANY", TK_ANY}, {"APPS", TK_APPS}, {"AS", TK_AS}, @@ -335,9 +332,6 @@ static SKeyword keywordTable[] = { {"_WDURATION", TK_WDURATION}, {"_WEND", TK_WEND}, {"_WSTART", TK_WSTART}, - {"_FLOW", TK_FLOW}, - {"_FHIGH", TK_FHIGH}, - {"_FROWTS", TK_FROWTS}, {"ALIVE", TK_ALIVE}, {"VARBINARY", TK_VARBINARY}, {"S3_CHUNKSIZE", TK_S3_CHUNKSIZE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index fc9ca7418c..5c6f619397 100755 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -24,7 +24,6 @@ #include "parUtil.h" #include "scalar.h" #include "systable.h" -#include "tanal.h" #include "tcol.h" #include "tglobal.h" #include "ttime.h" @@ -349,20 +348,6 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, - { - .showType = QUERY_NODE_SHOW_ANODES_STMT, - .pDbName = TSDB_INFORMATION_SCHEMA_DB, - .pTableName = TSDB_INS_TABLE_ANODES, - .numOfShowCols = 1, - .pShowCols = {"*"} - }, - { - .showType = QUERY_NODE_SHOW_ANODES_FULL_STMT, - .pDbName = TSDB_INFORMATION_SCHEMA_DB, - .pTableName = TSDB_INS_TABLE_ANODES_FULL, - .numOfShowCols = 1, - .pShowCols = {"*"} - }, }; // clang-format on @@ -1050,14 +1035,6 @@ static bool isInterpPseudoColumnFunc(const SNode* pNode) { return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsInterpPseudoColumnFunc(((SFunctionNode*)pNode)->funcId)); } -static bool isForecastFunc(const SNode* pNode) { - return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsForecastFunc(((SFunctionNode*)pNode)->funcId)); -} - -static bool isForecastPseudoColumnFunc(const SNode* pNode) { - return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsForecastPseudoColumnFunc(((SFunctionNode*)pNode)->funcId)); -} - #ifdef BUILD_NO_CALL static bool isTimelineFunc(const SNode* pNode) { return (QUERY_NODE_FUNCTION == nodeType(pNode) && fmIsTimelineFunc(((SFunctionNode*)pNode)->funcId)); @@ -1260,7 +1237,7 @@ bool isPrimaryKeyImpl(SNode* pExpr) { FUNCTION_TYPE_LAST_ROW == pFunc->funcType || FUNCTION_TYPE_TIMETRUNCATE == pFunc->funcType) { return isPrimaryKeyImpl(nodesListGetNode(pFunc->pParameterList, 0)); } else if (FUNCTION_TYPE_WSTART == pFunc->funcType || FUNCTION_TYPE_WEND == pFunc->funcType || - FUNCTION_TYPE_IROWTS == pFunc->funcType || FUNCTION_TYPE_FORECAST_ROWTS == pFunc->funcType) { + FUNCTION_TYPE_IROWTS == pFunc->funcType) { return true; } } else if (QUERY_NODE_OPERATOR == nodeType(pExpr)) { @@ -2273,7 +2250,7 @@ static EDealRes translateOperator(STranslateContext* pCxt, SOperatorNode* pOp) { static EDealRes haveVectorFunction(SNode* pNode, void* pContext) { if (isAggFunc(pNode) || isIndefiniteRowsFunc(pNode) || isWindowPseudoColumnFunc(pNode) || - isInterpPseudoColumnFunc(pNode) || isForecastPseudoColumnFunc(pNode)) { + isInterpPseudoColumnFunc(pNode)) { *((bool*)pContext) = true; return DEAL_RES_END; } @@ -2576,72 +2553,6 @@ static int32_t translateInterpPseudoColumnFunc(STranslateContext* pCxt, SNode** return TSDB_CODE_SUCCESS; } -static int32_t translateForecastFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { - if (!fmIsForecastFunc(pFunc->funcId)) { - return TSDB_CODE_SUCCESS; - } - if (!isSelectStmt(pCxt->pCurrStmt) || SQL_CLAUSE_SELECT != pCxt->currClause) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); - } - SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; - SNode* pTable = pSelect->pFromTable; - - if (pSelect->hasAggFuncs || pSelect->hasMultiRowsFunc || pSelect->hasIndefiniteRowsFunc) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); - } - - if (pSelect->hasForecastFunc && - (FUNC_RETURN_ROWS_INDEFINITE == pSelect->returnRows || pSelect->returnRows != fmGetFuncReturnRows(pFunc))) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, - "%s ignoring null value options cannot be used when applying to multiple columns", - pFunc->functionName); - } - - if (NULL != pSelect->pWindow || NULL != pSelect->pGroupByList) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, - "%s function is not supported in window query or group query", pFunc->functionName); - } - if (hasInvalidFuncNesting(pFunc->pParameterList)) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_AGG_FUNC_NESTING); - } - return TSDB_CODE_SUCCESS; -} - -static int32_t translateForecastPseudoColumnFunc(STranslateContext* pCxt, SNode** ppNode, bool* pRewriteToColumn) { - SFunctionNode* pFunc = (SFunctionNode*)(*ppNode); - if (!fmIsForecastPseudoColumnFunc(pFunc->funcId)) { - return TSDB_CODE_SUCCESS; - } - if (!isSelectStmt(pCxt->pCurrStmt)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, - "%s must be used in select statements", pFunc->functionName); - } - if (pCxt->currClause == SQL_CLAUSE_WHERE) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_INTERP_CLAUSE, - "%s is not allowed in where clause", pFunc->functionName); - } - - SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; - SNode* pNode = NULL; - bool bFound = false; - FOREACH(pNode, pSelect->pProjectionList) { - if (nodeType(pNode) == QUERY_NODE_FUNCTION && strcasecmp(((SFunctionNode*)pNode)->functionName, "forecast") == 0) { - bFound = true; - break; - } - } - if (!bFound) { - *pRewriteToColumn = true; - int32_t code = replacePsedudoColumnFuncWithColumn(pCxt, ppNode); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - (void)translateColumn(pCxt, (SColumnNode**)ppNode); - return pCxt->errCode; - } - return TSDB_CODE_SUCCESS; -} - static int32_t translateTimelineFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { if (!fmIsTimelineFunc(pFunc->funcId)) { return TSDB_CODE_SUCCESS; @@ -2827,9 +2738,7 @@ static void setFuncClassification(STranslateContext* pCxt, SFunctionNode* pFunc) pSelect->returnRows = fmGetFuncReturnRows(pFunc); } else if (fmIsInterpFunc(pFunc->funcId)) { pSelect->returnRows = fmGetFuncReturnRows(pFunc); - } else if (fmIsForecastFunc(pFunc->funcId)) { - pSelect->returnRows = fmGetFuncReturnRows(pFunc); - } + } if (fmIsProcessByRowFunc(pFunc->funcId)) { pSelect->lastProcessByRowFuncId = pFunc->funcId; } @@ -2846,9 +2755,6 @@ static void setFuncClassification(STranslateContext* pCxt, SFunctionNode* pFunc) pSelect->hasInterpFunc = pSelect->hasInterpFunc ? true : (FUNCTION_TYPE_INTERP == pFunc->funcType); pSelect->hasInterpPseudoColFunc = pSelect->hasInterpPseudoColFunc ? true : fmIsInterpPseudoColumnFunc(pFunc->funcId); - pSelect->hasForecastFunc = pSelect->hasForecastFunc ? true : (FUNCTION_TYPE_FORECAST == pFunc->funcType); - pSelect->hasForecastPseudoColFunc = - pSelect->hasForecastPseudoColFunc ? true : fmIsForecastPseudoColumnFunc(pFunc->funcId); pSelect->hasLastRowFunc = pSelect->hasLastRowFunc ? true : (FUNCTION_TYPE_LAST_ROW == pFunc->funcType); pSelect->hasLastFunc = pSelect->hasLastFunc ? true : (FUNCTION_TYPE_LAST == pFunc->funcType); pSelect->hasTimeLineFunc = pSelect->hasTimeLineFunc ? true : fmIsTimelineFunc(pFunc->funcId); @@ -3040,9 +2946,6 @@ static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SNode** pp return TSDB_CODE_SUCCESS; } if (0 == LIST_LENGTH(pFunc->pParameterList)) { - if (pFunc->funcType == FUNCTION_TYPE_FORECAST_LOW || pFunc->funcType == FUNCTION_TYPE_FORECAST_HIGH) { - return TSDB_CODE_SUCCESS; - } if (!isSelectStmt(pCxt->pCurrStmt) || NULL == ((SSelectStmt*)pCxt->pCurrStmt)->pFromTable) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TBNAME); } @@ -3113,16 +3016,6 @@ static int32_t translateNormalFunction(STranslateContext* pCxt, SNode** ppNode) return code; } } - if (TSDB_CODE_SUCCESS == code) { - code = translateForecastFunc(pCxt, pFunc); - } - if (TSDB_CODE_SUCCESS == code) { - bool bRewriteToColumn = false; - code = translateForecastPseudoColumnFunc(pCxt, ppNode, &bRewriteToColumn); - if (bRewriteToColumn) { - return code; - } - } if (TSDB_CODE_SUCCESS == code) { code = translateTimelineFunc(pCxt, pFunc); } @@ -3866,8 +3759,7 @@ static int32_t resetSelectFuncNumWithoutDup(SSelectStmt* pSelect) { static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) { if (NULL != pSelect->pGroupByList || NULL != pSelect->pWindow || isWindowJoinStmt(pSelect) || - (!pSelect->hasAggFuncs && !pSelect->hasIndefiniteRowsFunc && !pSelect->hasInterpFunc && - !pSelect->hasForecastFunc)) { + (!pSelect->hasAggFuncs && !pSelect->hasIndefiniteRowsFunc && !pSelect->hasInterpFunc)) { return TSDB_CODE_SUCCESS; } if (!pSelect->onlyHasKeepOrderFunc) { @@ -3890,7 +3782,7 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) static int32_t checkWinJoinAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) { if (!isWindowJoinStmt(pSelect) || (!pSelect->hasAggFuncs && !pSelect->hasIndefiniteRowsFunc && - !pSelect->hasInterpFunc && !pSelect->hasForecastFunc)) { + !pSelect->hasInterpFunc)) { return TSDB_CODE_SUCCESS; } if (!pSelect->onlyHasKeepOrderFunc) { @@ -5903,40 +5795,6 @@ static int32_t translateCountWindow(STranslateContext* pCxt, SSelectStmt* pSelec return TSDB_CODE_SUCCESS; } -static int32_t checkAnomalyExpr(STranslateContext* pCxt, SNode* pNode) { - int32_t type = ((SExprNode*)pNode)->resType.type; - if (!IS_MATHABLE_TYPE(type)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ANOMALY_WIN_TYPE, - "ANOMALY_WINDOW only support mathable column"); - } - - if (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TAG == ((SColumnNode*)pNode)->colType) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ANOMALY_WIN_COL, - "ANOMALY_WINDOW not support on tag column"); - } - - return TSDB_CODE_SUCCESS; -} - -static int32_t translateAnomalyWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && - !isGlobalTimeLineQuery(((STempTableNode*)pSelect->pFromTable)->pSubquery)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TIMELINE_QUERY, - "ANOMALY_WINDOW requires valid time series input"); - } - - SAnomalyWindowNode* pAnomaly = (SAnomalyWindowNode*)pSelect->pWindow; - int32_t code = checkAnomalyExpr(pCxt, pAnomaly->pExpr); - if (TSDB_CODE_SUCCESS == code) { - if (!taosAnalGetOptStr(pAnomaly->anomalyOpt, "algo", NULL, 0) != 0) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ANOMALY_WIN_OPT, - "ANOMALY_WINDOW option should include algo field"); - } - } - - return code; -} - static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { switch (nodeType(pSelect->pWindow)) { case QUERY_NODE_STATE_WINDOW: @@ -5949,8 +5807,6 @@ static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSe return translateEventWindow(pCxt, pSelect); case QUERY_NODE_COUNT_WINDOW: return translateCountWindow(pCxt, pSelect); - case QUERY_NODE_ANOMALY_WINDOW: - return translateAnomalyWindow(pCxt, pSelect); default: break; } @@ -6187,26 +6043,6 @@ static int32_t translateInterp(STranslateContext* pCxt, SSelectStmt* pSelect) { return code; } -static int32_t translateForecast(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (!pSelect->hasForecastFunc) { - if (pSelect->hasForecastPseudoColFunc) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, - "Has Forecast pseudo column(s) but missing forcast function"); - } - return TSDB_CODE_SUCCESS; - } - - if ((NULL != pSelect->pFromTable) && (QUERY_NODE_JOIN_TABLE == nodeType(pSelect->pFromTable))) { - SJoinTableNode* pJoinTable = (SJoinTableNode*)pSelect->pFromTable; - if (IS_WINDOW_JOIN(pJoinTable->subType)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_FORECAST_CLAUSE, - "Forecast not supported to be used in WINDOW join"); - } - } - - return 0; -} - static int32_t removeConstantValueFromList(SNodeList** pList) { SNode* pNode = NULL; WHERE_EACH(pNode, *pList) { @@ -7048,9 +6884,6 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { code = translateInterp(pCxt, pSelect); } - if (TSDB_CODE_SUCCESS == code) { - code = translateForecast(pCxt, pSelect); - } if (TSDB_CODE_SUCCESS == code) { code = appendTsForImplicitTsFunc(pCxt, pSelect); } @@ -8062,19 +7895,6 @@ static int32_t fillCmdSql(STranslateContext* pCxt, int16_t msgType, void* pReq) break; } - case TDMT_MND_CREATE_ANODE: { - FILL_CMD_SQL(sql, sqlLen, pCmdReq, SMCreateAnodeReq, pReq); - break; - } - case TDMT_MND_DROP_ANODE: { - FILL_CMD_SQL(sql, sqlLen, pCmdReq, SMDropAnodeReq, pReq); - break; - } - case TDMT_MND_UPDATE_ANODE: { - FILL_CMD_SQL(sql, sqlLen, pCmdReq, SMUpdateAnodeReq, pReq); - break; - } - case TDMT_MND_CREATE_MNODE: { FILL_CMD_SQL(sql, sqlLen, pCmdReq, SMCreateMnodeReq, pReq); break; @@ -9578,43 +9398,6 @@ static int32_t translateDropUser(STranslateContext* pCxt, SDropUserStmt* pStmt) return code; } -static int32_t translateCreateAnode(STranslateContext* pCxt, SCreateAnodeStmt* pStmt) { - SMCreateAnodeReq createReq = {0}; - createReq.urlLen = strlen(pStmt->url) + 1; - if (createReq.urlLen > TSDB_ANAL_ANODE_URL_LEN) { - return TSDB_CODE_MND_ANODE_TOO_LONG_URL; - } - - createReq.url = taosMemoryCalloc(createReq.urlLen, 1); - if (createReq.url == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - tstrncpy(createReq.url, pStmt->url, createReq.urlLen); - - int32_t code = buildCmdMsg(pCxt, TDMT_MND_CREATE_ANODE, (FSerializeFunc)tSerializeSMCreateAnodeReq, &createReq); - tFreeSMCreateAnodeReq(&createReq); - return code; -} - -static int32_t translateDropAnode(STranslateContext* pCxt, SDropAnodeStmt* pStmt) { - SMDropAnodeReq dropReq = {0}; - dropReq.anodeId = pStmt->anodeId; - - int32_t code = buildCmdMsg(pCxt, TDMT_MND_DROP_ANODE, (FSerializeFunc)tSerializeSMDropAnodeReq, &dropReq); - tFreeSMDropAnodeReq(&dropReq); - return code; -} - -static int32_t translateUpdateAnode(STranslateContext* pCxt, SUpdateAnodeStmt* pStmt) { - SMUpdateAnodeReq updateReq = {0}; - updateReq.anodeId = pStmt->anodeId; - - int32_t code = buildCmdMsg(pCxt, TDMT_MND_UPDATE_ANODE, (FSerializeFunc)tSerializeSMUpdateAnodeReq, &updateReq); - tFreeSMUpdateAnodeReq(&updateReq); - return code; -} - static int32_t translateCreateDnode(STranslateContext* pCxt, SCreateDnodeStmt* pStmt) { SCreateDnodeReq createReq = {0}; strcpy(createReq.fqdn, pStmt->fqdn); @@ -10037,7 +9820,7 @@ static int32_t translateDropComponentNode(STranslateContext* pCxt, SDropComponen } static int32_t checkTopicQuery(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (pSelect->hasAggFuncs || pSelect->hasForecastFunc || pSelect->hasInterpFunc || pSelect->hasIndefiniteRowsFunc) { + if (pSelect->hasAggFuncs || pSelect->hasInterpFunc || pSelect->hasIndefiniteRowsFunc) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TOPIC_QUERY); } return TSDB_CODE_SUCCESS; @@ -10403,7 +10186,7 @@ static int32_t translateKillTransaction(STranslateContext* pCxt, SKillStmt* pStm static bool crossTableWithoutAggOper(SSelectStmt* pSelect) { return NULL == pSelect->pWindow && !pSelect->hasAggFuncs && !pSelect->hasIndefiniteRowsFunc && - !pSelect->hasInterpFunc && !pSelect->hasForecastFunc && + !pSelect->hasInterpFunc && TSDB_SUPER_TABLE == ((SRealTableNode*)pSelect->pFromTable)->pMeta->tableType && !hasTbnameFunction(pSelect->pPartitionByList); } @@ -12612,15 +12395,6 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_ALTER_DNODE_STMT: code = translateAlterDnode(pCxt, (SAlterDnodeStmt*)pNode); break; - case QUERY_NODE_CREATE_ANODE_STMT: - code = translateCreateAnode(pCxt, (SCreateAnodeStmt*)pNode); - break; - case QUERY_NODE_DROP_ANODE_STMT: - code = translateDropAnode(pCxt, (SDropAnodeStmt*)pNode); - break; - case QUERY_NODE_UPDATE_ANODE_STMT: - code = translateUpdateAnode(pCxt, (SUpdateAnodeStmt*)pNode); - break; case QUERY_NODE_CREATE_INDEX_STMT: code = translateCreateIndex(pCxt, (SCreateIndexStmt*)pNode); break; @@ -15981,8 +15755,6 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: - case QUERY_NODE_SHOW_ANODES_STMT: - case QUERY_NODE_SHOW_ANODES_FULL_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: case QUERY_NODE_SHOW_INDEXES_STMT: case QUERY_NODE_SHOW_STREAMS_STMT: diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 5f3eb1c427..98676160cb 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -185,8 +185,6 @@ static char* getSyntaxErrFormat(int32_t errCode) { return "%s is not supported in system table query"; case TSDB_CODE_PAR_INVALID_INTERP_CLAUSE: return "Invalid usage of RANGE clause, EVERY clause or FILL clause"; - case TSDB_CODE_PAR_INVALID_FORECAST_CLAUSE: - return "Invalid usage of forecast clause"; case TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN: return "No valid function in window query"; case TSDB_CODE_PAR_INVALID_OPTR_USAGE: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 5849977a3a..2c7f473d9a 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,31 +104,31 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 573 +#define YYNOCODE 567 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EFillMode yy102; - EOperatorType yy140; - ETrimType yy300; - ENullOrder yy307; - EOrder yy410; - SDataType yy424; - int64_t yy483; - SToken yy557; - bool yy569; - SShowTablesOption yy595; - SAlterOption yy683; - STokenPair yy723; - EShowKind yy741; - EJoinSubType yy744; - EJoinType yy792; - int8_t yy815; - int32_t yy904; - SNodeList* yy946; - SNode* yy974; + EFillMode yy18; + EJoinType yy36; + ENullOrder yy109; + bool yy173; + SNodeList* yy334; + SAlterOption yy389; + STokenPair yy399; + EOperatorType yy506; + SToken yy533; + EShowKind yy537; + SNode* yy560; + int64_t yy585; + EJoinSubType yy648; + ETrimType yy672; + SShowTablesOption yy709; + int8_t yy719; + int32_t yy802; + SDataType yy952; + EOrder yy974; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -144,18 +144,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 1025 -#define YYNRULE 784 -#define YYNRULE_WITH_ACTION 784 -#define YYNTOKEN 389 -#define YY_MAX_SHIFT 1024 -#define YY_MIN_SHIFTREDUCE 1516 -#define YY_MAX_SHIFTREDUCE 2299 -#define YY_ERROR_ACTION 2300 -#define YY_ACCEPT_ACTION 2301 -#define YY_NO_ACTION 2302 -#define YY_MIN_REDUCE 2303 -#define YY_MAX_REDUCE 3086 +#define YYNSTATE 1009 +#define YYNRULE 773 +#define YYNRULE_WITH_ACTION 773 +#define YYNTOKEN 383 +#define YY_MAX_SHIFT 1008 +#define YY_MIN_SHIFTREDUCE 1495 +#define YY_MAX_SHIFTREDUCE 2267 +#define YY_ERROR_ACTION 2268 +#define YY_ACCEPT_ACTION 2269 +#define YY_NO_ACTION 2270 +#define YY_MIN_REDUCE 2271 +#define YY_MAX_REDUCE 3043 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -222,1204 +222,1181 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (4475) +#define YY_ACTTAB_COUNT (4386) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 839, 683, 3059, 691, 684, 2351, 684, 2351, 3054, 2577, - /* 10 */ 3054, 2816, 60, 58, 678, 59, 57, 56, 55, 54, - /* 20 */ 506, 2304, 2016, 2521, 915, 2517, 838, 231, 858, 3058, - /* 30 */ 2816, 3055, 840, 3055, 3057, 205, 2014, 332, 2124, 2399, - /* 40 */ 2041, 2820, 151, 2841, 530, 150, 149, 148, 147, 146, - /* 50 */ 145, 144, 143, 142, 914, 851, 170, 466, 854, 389, - /* 60 */ 2820, 53, 52, 220, 680, 59, 57, 56, 55, 54, - /* 70 */ 2303, 2119, 151, 2045, 884, 150, 149, 148, 147, 146, - /* 80 */ 145, 144, 143, 142, 782, 2022, 2041, 2674, 2859, 829, - /* 90 */ 2647, 2822, 2824, 501, 160, 159, 158, 157, 156, 155, - /* 100 */ 154, 153, 152, 688, 2806, 919, 896, 2672, 901, 685, - /* 110 */ 2822, 2825, 1592, 2759, 1591, 1021, 851, 170, 61, 990, - /* 120 */ 989, 988, 987, 536, 919, 986, 985, 175, 980, 979, - /* 130 */ 978, 977, 976, 975, 974, 174, 968, 967, 966, 535, - /* 140 */ 534, 963, 962, 961, 211, 210, 960, 531, 959, 958, - /* 150 */ 957, 2840, 63, 1593, 2891, 2127, 2128, 197, 134, 2842, - /* 160 */ 900, 2844, 2845, 895, 75, 2448, 883, 2892, 919, 2041, - /* 170 */ 802, 772, 1592, 213, 1591, 2954, 2042, 251, 3054, 500, - /* 180 */ 2950, 207, 2962, 850, 75, 162, 849, 766, 166, 770, - /* 190 */ 768, 303, 302, 3054, 2077, 2087, 3060, 231, 198, 232, - /* 200 */ 2315, 3055, 840, 3059, 2126, 2129, 528, 3001, 509, 2570, - /* 210 */ 2572, 838, 231, 1593, 1862, 1863, 3055, 840, 195, 2017, - /* 220 */ 2044, 2015, 824, 107, 914, 9, 882, 2220, 106, 2522, - /* 230 */ 53, 52, 914, 2041, 59, 57, 56, 55, 54, 676, - /* 240 */ 64, 853, 200, 2962, 2963, 2213, 168, 2967, 674, 227, - /* 250 */ 318, 670, 666, 581, 2020, 2021, 2074, 2841, 2076, 2079, - /* 260 */ 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2088, 2089, 2090, - /* 270 */ 892, 885, 894, 914, 917, 916, 881, 2111, 2112, 2113, - /* 280 */ 2114, 2115, 2118, 2120, 2121, 2122, 2123, 2125, 2, 60, - /* 290 */ 58, 2216, 700, 2841, 445, 105, 2039, 506, 75, 2016, - /* 300 */ 458, 118, 2859, 625, 644, 642, 469, 441, 897, 2046, - /* 310 */ 245, 1889, 1890, 2014, 646, 2124, 915, 2517, 2806, 2286, - /* 320 */ 896, 2616, 53, 52, 127, 2074, 59, 57, 56, 55, - /* 330 */ 54, 510, 468, 604, 2599, 648, 236, 220, 2859, 2191, - /* 340 */ 446, 606, 830, 825, 818, 814, 810, 339, 2119, 2674, - /* 350 */ 2154, 884, 584, 785, 2806, 19, 896, 701, 2667, 339, - /* 360 */ 1888, 1891, 2022, 498, 2647, 2840, 2042, 2326, 2891, 2671, - /* 370 */ 901, 63, 436, 2842, 900, 2844, 2845, 895, 893, 339, - /* 380 */ 883, 2892, 919, 874, 2919, 954, 187, 186, 951, 950, - /* 390 */ 949, 184, 1021, 467, 973, 15, 337, 2474, 572, 2044, - /* 400 */ 571, 2840, 2251, 887, 2891, 592, 2674, 2078, 134, 2842, - /* 410 */ 900, 2844, 2845, 895, 886, 2155, 883, 2892, 919, 922, - /* 420 */ 508, 172, 224, 181, 2925, 2954, 2671, 901, 2806, 500, - /* 430 */ 2950, 570, 2127, 2128, 801, 339, 2654, 2633, 2564, 634, - /* 440 */ 633, 631, 630, 629, 624, 623, 622, 621, 450, 590, - /* 450 */ 2643, 611, 610, 609, 608, 607, 601, 600, 599, 267, - /* 460 */ 594, 593, 465, 686, 699, 2359, 585, 1850, 1851, 2075, - /* 470 */ 220, 2077, 2087, 1869, 821, 820, 2249, 2250, 2252, 2253, - /* 480 */ 2254, 2126, 2129, 2974, 2188, 2189, 2190, 2974, 2974, 2974, - /* 490 */ 2974, 2974, 620, 339, 2160, 618, 2017, 2648, 2015, 41, - /* 500 */ 617, 1786, 1787, 882, 247, 53, 52, 619, 616, 59, - /* 510 */ 57, 56, 55, 54, 44, 502, 2149, 2150, 2151, 2152, - /* 520 */ 2153, 2157, 2158, 2159, 79, 2293, 2193, 2194, 2195, 2196, - /* 530 */ 2197, 2020, 2021, 2074, 2841, 2076, 2079, 2080, 2081, 2082, - /* 540 */ 2083, 2084, 2085, 2086, 2088, 2089, 2090, 892, 885, 854, - /* 550 */ 3059, 917, 916, 881, 2111, 2112, 2212, 786, 3054, 2118, - /* 560 */ 2120, 2121, 2122, 2123, 2125, 2, 60, 58, 2841, 2191, - /* 570 */ 2016, 828, 533, 532, 506, 337, 2016, 3058, 73, 2859, - /* 580 */ 2577, 3055, 3056, 897, 2014, 2135, 45, 355, 1747, 799, - /* 590 */ 2014, 2041, 2124, 702, 269, 2806, 2023, 896, 686, 866, - /* 600 */ 2359, 2859, 1561, 1738, 946, 945, 944, 1742, 943, 1744, - /* 610 */ 1745, 942, 939, 2859, 1753, 936, 1755, 1756, 933, 930, - /* 620 */ 927, 1568, 2499, 473, 786, 2119, 195, 2969, 884, 2806, - /* 630 */ 923, 896, 19, 2022, 137, 596, 2643, 2523, 75, 2022, - /* 640 */ 693, 2713, 2840, 526, 2519, 2891, 1563, 1566, 1567, 134, - /* 650 */ 2842, 900, 2844, 2845, 895, 2292, 2966, 883, 2892, 919, - /* 660 */ 915, 2517, 706, 1021, 213, 196, 2954, 725, 724, 1021, - /* 670 */ 500, 2950, 15, 827, 526, 2519, 2840, 915, 2517, 2891, - /* 680 */ 161, 2841, 2045, 135, 2842, 900, 2844, 2845, 895, 731, - /* 690 */ 249, 883, 2892, 919, 487, 2721, 897, 161, 3002, 2489, - /* 700 */ 2954, 56, 55, 54, 2953, 2950, 736, 788, 2713, 2127, - /* 710 */ 2128, 627, 2643, 2974, 2188, 2189, 2190, 2974, 2974, 2974, - /* 720 */ 2974, 2974, 518, 53, 52, 956, 2859, 59, 57, 56, - /* 730 */ 55, 54, 752, 751, 750, 851, 170, 14, 13, 742, - /* 740 */ 167, 746, 2806, 783, 896, 745, 1683, 521, 2077, 2087, - /* 750 */ 744, 749, 480, 479, 2191, 12, 743, 558, 2126, 2129, - /* 760 */ 478, 739, 738, 737, 2969, 2078, 254, 2017, 2022, 2015, - /* 770 */ 2571, 2572, 43, 2017, 1695, 2015, 956, 2045, 53, 52, - /* 780 */ 882, 2026, 59, 57, 56, 55, 54, 2799, 1694, 2840, - /* 790 */ 523, 703, 2891, 2965, 2041, 1685, 199, 2842, 900, 2844, - /* 800 */ 2845, 895, 2020, 2021, 883, 2892, 919, 2301, 2020, 2021, - /* 810 */ 2074, 2841, 2076, 2079, 2080, 2081, 2082, 2083, 2084, 2085, - /* 820 */ 2086, 2088, 2089, 2090, 892, 885, 897, 2075, 917, 916, - /* 830 */ 881, 2111, 2112, 339, 2262, 2325, 2118, 2120, 2121, 2122, - /* 840 */ 2123, 2125, 2, 12, 60, 58, 803, 3012, 851, 170, - /* 850 */ 512, 2661, 506, 704, 2016, 2168, 2859, 947, 226, 1699, - /* 860 */ 1747, 140, 2962, 2963, 919, 168, 2967, 649, 2014, 2969, - /* 870 */ 2124, 117, 2806, 1698, 896, 1738, 946, 945, 944, 1742, - /* 880 */ 943, 1744, 1745, 891, 890, 2577, 1753, 889, 1755, 1756, - /* 890 */ 888, 930, 927, 464, 2324, 562, 2806, 539, 2964, 2188, - /* 900 */ 2189, 2190, 538, 2119, 2575, 1917, 884, 1985, 113, 396, - /* 910 */ 19, 1595, 1596, 915, 2517, 1568, 307, 2022, 2046, 2840, - /* 920 */ 2506, 126, 2891, 564, 560, 638, 135, 2842, 900, 2844, - /* 930 */ 2845, 895, 1984, 68, 883, 2892, 919, 2511, 517, 516, - /* 940 */ 553, 1566, 1567, 2954, 2841, 915, 2517, 1021, 2951, 2508, - /* 950 */ 15, 2800, 651, 234, 802, 2806, 225, 915, 2517, 897, - /* 960 */ 2760, 2361, 3054, 520, 519, 578, 190, 238, 2078, 486, - /* 970 */ 2721, 409, 533, 532, 201, 2962, 2963, 579, 168, 2967, - /* 980 */ 3060, 231, 2030, 512, 839, 3055, 840, 2127, 2128, 2859, - /* 990 */ 407, 89, 3054, 256, 88, 2323, 2023, 919, 2124, 727, - /* 1000 */ 726, 1943, 1944, 470, 2491, 2806, 2504, 896, 447, 2322, - /* 1010 */ 838, 231, 2502, 2046, 512, 3055, 840, 802, 637, 255, - /* 1020 */ 265, 661, 659, 656, 654, 3054, 2077, 2087, 919, 97, - /* 1030 */ 2075, 2119, 635, 3, 53, 52, 2126, 2129, 59, 57, - /* 1040 */ 56, 55, 54, 3060, 231, 2022, 173, 66, 3055, 840, - /* 1050 */ 2321, 2017, 2840, 2015, 113, 2891, 2806, 2507, 882, 134, - /* 1060 */ 2842, 900, 2844, 2845, 895, 2243, 75, 883, 2892, 919, - /* 1070 */ 2806, 748, 747, 471, 3074, 879, 2954, 346, 347, 2244, - /* 1080 */ 500, 2950, 345, 2510, 574, 3058, 2020, 2021, 2074, 573, - /* 1090 */ 2076, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2088, - /* 1100 */ 2089, 2090, 892, 885, 970, 76, 917, 916, 881, 2111, - /* 1110 */ 2112, 2806, 984, 982, 2118, 2120, 2121, 2122, 2123, 2125, - /* 1120 */ 2, 60, 58, 2130, 915, 2517, 2320, 2319, 2242, 506, - /* 1130 */ 2318, 2016, 53, 52, 2331, 1014, 59, 57, 56, 55, - /* 1140 */ 54, 802, 306, 2577, 598, 2014, 305, 2124, 2449, 3054, - /* 1150 */ 759, 496, 954, 187, 186, 951, 950, 949, 184, 101, - /* 1160 */ 100, 577, 2575, 846, 244, 773, 2577, 3060, 231, 2488, - /* 1170 */ 2317, 40, 3055, 840, 511, 395, 972, 569, 567, 2031, - /* 1180 */ 2119, 2026, 403, 884, 304, 2575, 2554, 2806, 2806, 444, - /* 1190 */ 2402, 2806, 556, 314, 2022, 552, 548, 544, 541, 570, - /* 1200 */ 2727, 53, 52, 762, 402, 59, 57, 56, 55, 54, - /* 1210 */ 756, 754, 915, 2517, 2034, 2036, 12, 301, 10, 2314, - /* 1220 */ 116, 2841, 2521, 196, 1021, 453, 34, 61, 485, 2577, - /* 1230 */ 774, 2806, 612, 2520, 917, 916, 897, 527, 3009, 185, - /* 1240 */ 915, 2517, 2118, 2120, 2121, 2122, 2123, 2125, 2575, 915, - /* 1250 */ 2517, 53, 52, 915, 2517, 59, 57, 56, 55, 54, - /* 1260 */ 613, 339, 308, 85, 2127, 2128, 2859, 2045, 84, 614, - /* 1270 */ 752, 751, 750, 705, 2041, 2746, 809, 742, 167, 746, - /* 1280 */ 2806, 396, 2806, 745, 896, 915, 2517, 2313, 744, 749, - /* 1290 */ 480, 479, 333, 2312, 743, 915, 2517, 2577, 478, 739, - /* 1300 */ 738, 737, 2386, 2077, 2087, 2512, 915, 2517, 875, 877, - /* 1310 */ 2926, 2926, 2263, 2126, 2129, 309, 2576, 954, 187, 186, - /* 1320 */ 951, 950, 949, 184, 753, 67, 317, 2311, 2017, 2840, - /* 1330 */ 2015, 2156, 2891, 833, 843, 882, 134, 2842, 900, 2844, - /* 1340 */ 2845, 895, 2722, 2316, 883, 2892, 919, 948, 2806, 952, - /* 1350 */ 2568, 3074, 2568, 2954, 2806, 2310, 735, 500, 2950, 2309, - /* 1360 */ 734, 205, 2238, 2020, 2021, 2074, 2841, 2076, 2079, 2080, - /* 1370 */ 2081, 2082, 2083, 2084, 2085, 2086, 2088, 2089, 2090, 892, - /* 1380 */ 885, 897, 2626, 917, 916, 881, 2111, 2112, 2806, 915, - /* 1390 */ 2517, 2118, 2120, 2121, 2122, 2123, 2125, 2, 60, 58, - /* 1400 */ 2841, 915, 2517, 915, 2517, 2202, 506, 2750, 2016, 857, - /* 1410 */ 2161, 2859, 915, 2517, 2308, 897, 2806, 3022, 842, 2307, - /* 1420 */ 2806, 350, 2014, 871, 2124, 171, 588, 2806, 2925, 896, - /* 1430 */ 42, 2306, 357, 53, 52, 915, 2517, 59, 57, 56, - /* 1440 */ 55, 54, 53, 52, 529, 2859, 59, 57, 56, 55, - /* 1450 */ 54, 775, 915, 2517, 195, 908, 1570, 2119, 915, 2517, - /* 1460 */ 884, 2806, 2040, 896, 546, 2522, 953, 915, 2517, 2568, - /* 1470 */ 847, 2022, 909, 2588, 2840, 2806, 3015, 2891, 913, 163, - /* 1480 */ 2806, 413, 2842, 900, 2844, 2845, 895, 385, 32, 883, - /* 1490 */ 2892, 919, 2806, 103, 91, 2492, 294, 296, 2841, 292, - /* 1500 */ 295, 1021, 177, 2046, 61, 2109, 2295, 2296, 2840, 2579, - /* 1510 */ 2075, 2891, 740, 897, 1678, 134, 2842, 900, 2844, 2845, - /* 1520 */ 895, 222, 177, 883, 2892, 919, 298, 2384, 176, 297, - /* 1530 */ 3074, 300, 2954, 812, 299, 1676, 500, 2950, 2375, 741, - /* 1540 */ 185, 2127, 2128, 2859, 2101, 2373, 62, 822, 104, 755, - /* 1550 */ 53, 52, 62, 2232, 59, 57, 56, 55, 54, 2806, - /* 1560 */ 757, 896, 1674, 1679, 14, 13, 880, 760, 53, 52, - /* 1570 */ 364, 363, 59, 57, 56, 55, 54, 2025, 53, 52, - /* 1580 */ 2077, 2087, 59, 57, 56, 55, 54, 325, 1933, 47, - /* 1590 */ 2126, 2129, 53, 52, 214, 344, 59, 57, 56, 55, - /* 1600 */ 54, 90, 62, 366, 365, 2017, 2840, 2015, 1941, 2891, - /* 1610 */ 77, 852, 882, 134, 2842, 900, 2844, 2845, 895, 2236, - /* 1620 */ 62, 883, 2892, 919, 2827, 2024, 856, 165, 2929, 2860, - /* 1630 */ 2954, 632, 2248, 776, 500, 2950, 368, 367, 2247, 844, - /* 1640 */ 2020, 2021, 2074, 62, 2076, 2079, 2080, 2081, 2082, 2083, - /* 1650 */ 2084, 2085, 2086, 2088, 2089, 2090, 892, 885, 62, 2441, - /* 1660 */ 917, 916, 881, 2111, 2112, 62, 90, 647, 2118, 2120, - /* 1670 */ 2121, 2122, 2123, 2125, 2, 60, 58, 2841, 182, 2097, - /* 1680 */ 323, 348, 779, 506, 2440, 2016, 163, 863, 2100, 2099, - /* 1690 */ 185, 2829, 897, 132, 816, 129, 2162, 2352, 46, 2014, - /* 1700 */ 87, 2124, 2367, 2102, 370, 369, 2110, 53, 52, 3005, - /* 1710 */ 39, 59, 57, 56, 55, 54, 372, 371, 1656, 53, - /* 1720 */ 52, 819, 2859, 59, 57, 56, 55, 54, 2841, 2103, - /* 1730 */ 374, 373, 376, 375, 2119, 378, 377, 884, 2806, 802, - /* 1740 */ 896, 925, 2146, 897, 1886, 380, 379, 3054, 2022, 382, - /* 1750 */ 381, 2091, 1876, 384, 383, 1629, 964, 965, 48, 492, - /* 1760 */ 1008, 826, 2028, 183, 360, 3060, 231, 1657, 185, 164, - /* 1770 */ 3055, 840, 912, 2859, 488, 182, 1729, 860, 1021, 1648, - /* 1780 */ 1646, 61, 2652, 555, 2565, 2840, 401, 537, 2891, 2806, - /* 1790 */ 2358, 896, 134, 2842, 900, 2844, 2845, 895, 795, 3006, - /* 1800 */ 883, 2892, 919, 3016, 1630, 834, 835, 3074, 330, 2954, - /* 1810 */ 2027, 338, 335, 500, 2950, 2653, 53, 52, 2127, 2128, - /* 1820 */ 59, 57, 56, 55, 54, 2475, 5, 1760, 540, 545, - /* 1830 */ 2096, 462, 2039, 554, 2049, 566, 2840, 565, 239, 2891, - /* 1840 */ 568, 240, 394, 135, 2842, 900, 2844, 2845, 895, 1768, - /* 1850 */ 242, 883, 2892, 919, 1775, 1773, 1910, 2077, 2087, 582, - /* 1860 */ 2954, 188, 2040, 589, 878, 2950, 253, 2126, 2129, 53, - /* 1870 */ 52, 591, 595, 59, 57, 56, 55, 54, 597, 640, - /* 1880 */ 602, 615, 2017, 626, 2015, 2645, 53, 52, 636, 882, - /* 1890 */ 59, 57, 56, 55, 54, 628, 639, 641, 652, 477, - /* 1900 */ 475, 653, 650, 259, 258, 657, 2047, 655, 658, 262, - /* 1910 */ 660, 662, 4, 681, 682, 689, 2042, 2020, 2021, 2074, - /* 1920 */ 690, 2076, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, - /* 1930 */ 2088, 2089, 2090, 892, 885, 692, 270, 917, 916, 881, - /* 1940 */ 2111, 2112, 694, 787, 109, 2118, 2120, 2121, 2122, 2123, - /* 1950 */ 2125, 2, 60, 58, 273, 2048, 695, 2050, 696, 276, - /* 1960 */ 506, 698, 2016, 2051, 855, 278, 2668, 110, 2052, 111, - /* 1970 */ 112, 49, 2662, 1727, 2841, 730, 2014, 707, 2124, 284, - /* 1980 */ 2098, 287, 474, 472, 114, 733, 732, 763, 764, 897, - /* 1990 */ 2736, 3047, 139, 2505, 291, 439, 2501, 2095, 778, 115, - /* 2000 */ 802, 293, 191, 780, 138, 2841, 735, 310, 3054, 136, - /* 2010 */ 734, 2119, 2043, 178, 884, 2503, 2498, 192, 193, 2859, - /* 2020 */ 897, 802, 397, 2714, 790, 2022, 3060, 231, 791, 3054, - /* 2030 */ 789, 3055, 840, 315, 313, 2806, 2733, 896, 2732, 823, - /* 2040 */ 797, 861, 3021, 794, 3020, 8, 832, 3060, 231, 326, - /* 2050 */ 2859, 806, 3055, 840, 796, 1021, 2841, 2993, 61, 807, - /* 2060 */ 805, 837, 804, 320, 204, 2973, 2806, 328, 896, 324, - /* 2070 */ 322, 897, 327, 2986, 836, 329, 331, 845, 848, 169, - /* 2080 */ 493, 2044, 2840, 2210, 2208, 2891, 217, 340, 179, 134, - /* 2090 */ 2842, 900, 2844, 2845, 895, 2127, 2128, 883, 2892, 919, - /* 2100 */ 3077, 2859, 3053, 398, 3074, 2970, 2954, 859, 334, 2682, - /* 2110 */ 500, 2950, 2681, 898, 1, 2680, 2891, 2806, 497, 896, - /* 2120 */ 135, 2842, 900, 2844, 2845, 895, 864, 872, 883, 2892, - /* 2130 */ 919, 399, 869, 74, 2077, 2087, 865, 2954, 180, 2935, - /* 2140 */ 353, 457, 2950, 904, 2126, 2129, 902, 233, 906, 907, - /* 2150 */ 2798, 2797, 128, 400, 2793, 2518, 2792, 404, 2784, 2017, - /* 2160 */ 358, 2015, 2783, 125, 2840, 387, 882, 2891, 2775, 2774, - /* 2170 */ 921, 134, 2842, 900, 2844, 2845, 895, 1540, 1016, 883, - /* 2180 */ 2892, 919, 2790, 1017, 2789, 2781, 3074, 2780, 2954, 1018, - /* 2190 */ 189, 1013, 500, 2950, 2020, 2021, 2074, 391, 2076, 2079, - /* 2200 */ 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2088, 2089, 2090, - /* 2210 */ 892, 885, 1020, 2769, 917, 916, 881, 2111, 2112, 2768, - /* 2220 */ 2787, 2786, 2118, 2120, 2121, 2122, 2123, 2125, 2, 60, - /* 2230 */ 58, 2778, 2777, 2766, 2765, 390, 2763, 506, 2762, 2016, - /* 2240 */ 2569, 65, 476, 454, 427, 782, 440, 455, 524, 438, - /* 2250 */ 428, 2841, 406, 2014, 408, 2124, 2758, 2757, 2756, 98, - /* 2260 */ 2751, 542, 543, 1967, 1968, 547, 897, 237, 2749, 549, - /* 2270 */ 550, 551, 1966, 2748, 2747, 463, 2745, 557, 2744, 559, - /* 2280 */ 2743, 561, 2742, 563, 1954, 2718, 241, 2717, 2119, 243, - /* 2290 */ 1913, 884, 99, 1912, 2695, 2694, 2859, 2693, 575, 576, - /* 2300 */ 2692, 2691, 2022, 2635, 580, 1849, 2632, 583, 2631, 2625, - /* 2310 */ 2622, 586, 2806, 246, 896, 248, 102, 2620, 587, 2621, - /* 2320 */ 2619, 2624, 2623, 2618, 2617, 2615, 2614, 449, 448, 2613, - /* 2330 */ 2612, 2610, 1021, 2841, 603, 15, 250, 513, 605, 2609, - /* 2340 */ 2608, 2607, 2606, 2630, 2605, 2604, 2603, 2628, 897, 2611, - /* 2350 */ 2602, 522, 2601, 2124, 2600, 2598, 2597, 2596, 2595, 2840, - /* 2360 */ 2594, 2593, 2891, 252, 2592, 108, 134, 2842, 900, 2844, - /* 2370 */ 2845, 895, 2127, 2128, 883, 2892, 919, 2591, 2859, 257, - /* 2380 */ 2582, 2927, 2590, 2954, 2589, 2587, 2119, 500, 2950, 2586, - /* 2390 */ 2660, 2629, 2627, 2585, 2806, 2584, 896, 1855, 2583, 643, - /* 2400 */ 2581, 645, 2580, 2578, 2406, 1696, 260, 2405, 1700, 261, - /* 2410 */ 1692, 2077, 2087, 2404, 451, 452, 2403, 2401, 2398, 263, - /* 2420 */ 665, 2126, 2129, 663, 264, 664, 2397, 668, 2390, 672, - /* 2430 */ 667, 2377, 669, 671, 2365, 675, 2017, 677, 2015, 2364, - /* 2440 */ 673, 2840, 679, 882, 2891, 2347, 1569, 212, 134, 2842, - /* 2450 */ 900, 2844, 2845, 895, 94, 266, 883, 2892, 919, 2346, - /* 2460 */ 2826, 2716, 223, 876, 268, 2954, 687, 95, 2712, 500, - /* 2470 */ 2950, 2020, 2021, 2074, 2702, 2076, 2079, 2080, 2081, 2082, - /* 2480 */ 2083, 2084, 2085, 2086, 2088, 2089, 2090, 892, 885, 784, - /* 2490 */ 2690, 917, 916, 881, 2111, 2112, 275, 2689, 277, 2118, - /* 2500 */ 2120, 2121, 2122, 2123, 2125, 2, 280, 1024, 2666, 282, - /* 2510 */ 2659, 2493, 1622, 2400, 2396, 2841, 708, 709, 2394, 710, - /* 2520 */ 712, 713, 714, 2392, 717, 716, 393, 718, 2389, 720, - /* 2530 */ 897, 722, 2372, 721, 2007, 2370, 1983, 2371, 2369, 2366, - /* 2540 */ 728, 1012, 1010, 2343, 2495, 221, 1779, 290, 86, 2494, - /* 2550 */ 2387, 1780, 1682, 1681, 1006, 1002, 998, 994, 1680, 388, - /* 2560 */ 2859, 1677, 1675, 1673, 981, 1672, 983, 515, 514, 2008, - /* 2570 */ 1671, 2385, 1670, 481, 1664, 482, 2806, 1669, 896, 2376, - /* 2580 */ 483, 1666, 1665, 1663, 2374, 484, 2342, 2341, 2340, 917, - /* 2590 */ 916, 761, 765, 2339, 2338, 767, 769, 2118, 2120, 2121, - /* 2600 */ 2122, 2123, 2125, 2337, 771, 133, 1948, 758, 1950, 141, - /* 2610 */ 361, 1947, 2715, 1952, 33, 312, 80, 2711, 69, 1919, - /* 2620 */ 1921, 2841, 2701, 2840, 792, 70, 2891, 1923, 2688, 316, - /* 2630 */ 202, 2842, 900, 2844, 2845, 895, 897, 1938, 883, 2892, - /* 2640 */ 919, 867, 793, 2687, 2841, 1898, 798, 194, 800, 1897, - /* 2650 */ 3059, 22, 17, 808, 25, 781, 811, 489, 35, 897, - /* 2660 */ 6, 2265, 7, 23, 228, 24, 2859, 216, 38, 229, - /* 2670 */ 2827, 78, 319, 2205, 26, 2280, 2239, 18, 2279, 36, - /* 2680 */ 817, 2237, 2806, 813, 896, 815, 359, 494, 873, 2859, - /* 2690 */ 2203, 342, 841, 3075, 2284, 321, 341, 2246, 203, 215, - /* 2700 */ 2283, 495, 72, 37, 336, 2806, 503, 896, 208, 2231, - /* 2710 */ 96, 2686, 2665, 2664, 2201, 311, 2285, 230, 120, 2286, - /* 2720 */ 2841, 121, 351, 2185, 2658, 2184, 343, 119, 122, 2840, - /* 2730 */ 2241, 27, 2891, 218, 349, 897, 437, 2842, 900, 2844, - /* 2740 */ 2845, 895, 82, 71, 883, 2892, 919, 11, 868, 13, - /* 2750 */ 2032, 209, 2840, 2147, 219, 2891, 352, 2067, 21, 199, - /* 2760 */ 2842, 900, 2844, 2845, 895, 2859, 862, 883, 2892, 919, - /* 2770 */ 2137, 2841, 870, 28, 29, 354, 2657, 2136, 2094, 2490, - /* 2780 */ 20, 2806, 2093, 896, 50, 932, 897, 123, 935, 938, - /* 2790 */ 941, 51, 910, 362, 2092, 2059, 16, 30, 31, 83, - /* 2800 */ 905, 903, 2106, 356, 2841, 490, 124, 129, 2299, 92, - /* 2810 */ 3013, 911, 2904, 2903, 918, 81, 2859, 924, 920, 897, - /* 2820 */ 1761, 525, 926, 386, 1758, 928, 929, 931, 2840, 1757, - /* 2830 */ 934, 2891, 2806, 1754, 896, 437, 2842, 900, 2844, 2845, - /* 2840 */ 895, 1748, 937, 883, 2892, 919, 2298, 940, 899, 2859, - /* 2850 */ 1746, 130, 131, 1774, 93, 1752, 491, 1751, 1750, 1749, - /* 2860 */ 1770, 1620, 955, 1660, 1659, 2806, 1658, 896, 1655, 2841, - /* 2870 */ 1652, 1651, 1650, 1649, 969, 1647, 1645, 1690, 1644, 2840, - /* 2880 */ 1643, 1689, 2891, 971, 897, 235, 437, 2842, 900, 2844, - /* 2890 */ 2845, 895, 2841, 1641, 883, 2892, 919, 1640, 1639, 1638, - /* 2900 */ 1637, 1636, 1635, 1686, 1684, 1632, 1631, 894, 1628, 1627, - /* 2910 */ 1626, 1625, 2840, 992, 2859, 2891, 2395, 991, 993, 430, - /* 2920 */ 2842, 900, 2844, 2845, 895, 2393, 995, 883, 2892, 919, - /* 2930 */ 2806, 997, 896, 996, 2391, 999, 1000, 2859, 1001, 2388, - /* 2940 */ 1003, 1004, 1005, 2368, 1007, 2363, 1009, 2362, 1011, 2336, - /* 2950 */ 1558, 1541, 1015, 2806, 1546, 896, 1548, 392, 1019, 1022, - /* 2960 */ 2841, 2302, 2018, 405, 1023, 2302, 2302, 2302, 2302, 2302, - /* 2970 */ 2302, 2302, 2302, 831, 2302, 897, 2302, 2840, 2302, 2302, - /* 2980 */ 2891, 2302, 2302, 2302, 202, 2842, 900, 2844, 2845, 895, - /* 2990 */ 2302, 2302, 883, 2892, 919, 2302, 2302, 2302, 2302, 2302, - /* 3000 */ 2840, 2302, 2302, 2891, 2302, 2859, 2302, 436, 2842, 900, - /* 3010 */ 2844, 2845, 895, 2302, 2302, 883, 2892, 919, 2302, 2920, - /* 3020 */ 2302, 2806, 2302, 896, 2302, 2841, 2302, 289, 2302, 2302, - /* 3030 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3040 */ 897, 2302, 2302, 729, 2302, 504, 206, 3076, 2302, 2302, - /* 3050 */ 2302, 2302, 2841, 2302, 2302, 723, 719, 715, 711, 2302, - /* 3060 */ 288, 2302, 2302, 2302, 2302, 2302, 2302, 897, 2840, 2302, - /* 3070 */ 2859, 2891, 2302, 2302, 2302, 437, 2842, 900, 2844, 2845, - /* 3080 */ 895, 2302, 2302, 883, 2892, 919, 2806, 2302, 896, 2302, - /* 3090 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2859, 2302, 2302, - /* 3100 */ 2302, 2302, 2302, 2302, 2302, 2302, 286, 2302, 2302, 2302, - /* 3110 */ 499, 285, 2302, 2806, 2302, 896, 2302, 2302, 2302, 2302, - /* 3120 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3130 */ 2302, 2302, 2302, 2840, 2302, 2302, 2891, 505, 2841, 2302, - /* 3140 */ 422, 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, - /* 3150 */ 919, 2302, 2302, 897, 2302, 2302, 2302, 2302, 2841, 2302, - /* 3160 */ 2840, 2302, 2302, 2891, 2302, 2302, 2302, 437, 2842, 900, - /* 3170 */ 2844, 2845, 895, 897, 2302, 883, 2892, 919, 272, 2841, - /* 3180 */ 2302, 2302, 2302, 2859, 2302, 2302, 2302, 283, 2302, 2302, - /* 3190 */ 2302, 274, 281, 2302, 897, 2302, 2302, 279, 697, 2806, - /* 3200 */ 2302, 896, 2302, 2859, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3210 */ 2302, 2302, 2302, 2302, 2302, 2302, 271, 2302, 2302, 2806, - /* 3220 */ 2302, 896, 2302, 507, 2859, 2302, 2302, 2302, 2302, 2302, - /* 3230 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3240 */ 2806, 2302, 896, 2302, 2302, 2302, 2840, 2302, 2302, 2891, - /* 3250 */ 2302, 2302, 2302, 437, 2842, 900, 2844, 2845, 895, 2302, - /* 3260 */ 2302, 883, 2892, 919, 2302, 2302, 2840, 2302, 2302, 2891, - /* 3270 */ 2302, 2302, 2302, 418, 2842, 900, 2844, 2845, 895, 2302, - /* 3280 */ 2302, 883, 2892, 919, 2302, 2841, 2302, 777, 2302, 2302, - /* 3290 */ 2891, 2302, 2302, 2302, 432, 2842, 900, 2844, 2845, 895, - /* 3300 */ 897, 2302, 883, 2892, 919, 2841, 2302, 2302, 2302, 2302, - /* 3310 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3320 */ 897, 2302, 2302, 2302, 2302, 2841, 2302, 2302, 2302, 2302, - /* 3330 */ 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3340 */ 897, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, - /* 3350 */ 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3360 */ 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, - /* 3370 */ 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3380 */ 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, - /* 3390 */ 2302, 2302, 2302, 2840, 2302, 2302, 2891, 2302, 2302, 2302, - /* 3400 */ 414, 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, - /* 3410 */ 919, 2302, 2841, 2840, 2302, 2302, 2891, 2302, 2302, 2302, - /* 3420 */ 410, 2842, 900, 2844, 2845, 895, 2302, 897, 883, 2892, - /* 3430 */ 919, 2302, 2302, 2840, 2302, 2302, 2891, 2302, 2841, 2302, - /* 3440 */ 411, 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, - /* 3450 */ 919, 2302, 2302, 897, 2302, 2302, 2302, 2859, 2302, 2302, - /* 3460 */ 2302, 2841, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3470 */ 2302, 2302, 2302, 2806, 2302, 896, 897, 2302, 2302, 2302, - /* 3480 */ 2302, 2841, 2302, 2859, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3490 */ 2302, 2302, 2302, 2302, 2302, 2302, 897, 2302, 2302, 2806, - /* 3500 */ 2302, 896, 2302, 2841, 2302, 2302, 2859, 2302, 2302, 2302, - /* 3510 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 897, 2302, - /* 3520 */ 2840, 2302, 2806, 2891, 896, 2302, 2859, 415, 2842, 900, - /* 3530 */ 2844, 2845, 895, 2302, 2302, 883, 2892, 919, 2302, 2302, - /* 3540 */ 2302, 2302, 2806, 2302, 896, 2302, 2840, 2302, 2859, 2891, - /* 3550 */ 2302, 2302, 2302, 429, 2842, 900, 2844, 2845, 895, 2302, - /* 3560 */ 2302, 883, 2892, 919, 2806, 2302, 896, 2302, 2841, 2840, - /* 3570 */ 2302, 2302, 2891, 2302, 2302, 2302, 416, 2842, 900, 2844, - /* 3580 */ 2845, 895, 2302, 897, 883, 2892, 919, 2841, 2302, 2840, - /* 3590 */ 2302, 2302, 2891, 2302, 2302, 2302, 417, 2842, 900, 2844, - /* 3600 */ 2845, 895, 897, 2302, 883, 2892, 919, 2302, 2302, 2841, - /* 3610 */ 2302, 2840, 2302, 2859, 2891, 2302, 2302, 2302, 433, 2842, - /* 3620 */ 900, 2844, 2845, 895, 897, 2302, 883, 2892, 919, 2806, - /* 3630 */ 2302, 896, 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3640 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, - /* 3650 */ 896, 2302, 2302, 2302, 2859, 2302, 2302, 2302, 2302, 2302, - /* 3660 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3670 */ 2806, 2302, 896, 2302, 2841, 2302, 2840, 2302, 2302, 2891, - /* 3680 */ 2302, 2302, 2302, 419, 2842, 900, 2844, 2845, 895, 897, - /* 3690 */ 2302, 883, 2892, 919, 2302, 2840, 2302, 2302, 2891, 2302, - /* 3700 */ 2302, 2302, 434, 2842, 900, 2844, 2845, 895, 2302, 2302, - /* 3710 */ 883, 2892, 919, 2302, 2302, 2302, 2302, 2840, 2302, 2859, - /* 3720 */ 2891, 2302, 2302, 2841, 420, 2842, 900, 2844, 2845, 895, - /* 3730 */ 2302, 2302, 883, 2892, 919, 2806, 2302, 896, 897, 2302, - /* 3740 */ 2302, 2302, 2302, 2841, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3750 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 897, 2302, - /* 3760 */ 2302, 2302, 2302, 2841, 2302, 2302, 2302, 2302, 2859, 2302, - /* 3770 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 897, 2302, - /* 3780 */ 2302, 2302, 2840, 2302, 2806, 2891, 896, 2302, 2859, 435, - /* 3790 */ 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, 919, - /* 3800 */ 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, 2859, 2302, - /* 3810 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3820 */ 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, 2302, 2302, - /* 3830 */ 2302, 2840, 2302, 2302, 2891, 2302, 2302, 2302, 421, 2842, - /* 3840 */ 900, 2844, 2845, 895, 2302, 2302, 883, 2892, 919, 2302, - /* 3850 */ 2841, 2840, 2302, 2302, 2891, 2302, 2302, 2302, 412, 2842, - /* 3860 */ 900, 2844, 2845, 895, 2302, 897, 883, 2892, 919, 2841, - /* 3870 */ 2302, 2840, 2302, 2302, 2891, 2302, 2302, 2302, 423, 2842, - /* 3880 */ 900, 2844, 2845, 895, 897, 2302, 883, 2892, 919, 2841, - /* 3890 */ 2302, 2302, 2302, 2302, 2302, 2859, 2302, 2302, 2302, 2302, - /* 3900 */ 2302, 2302, 2302, 2302, 897, 2302, 2302, 2302, 2302, 2302, - /* 3910 */ 2302, 2806, 2302, 896, 2859, 2302, 2302, 2302, 2302, 2302, - /* 3920 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3930 */ 2806, 2302, 896, 2302, 2859, 2302, 2302, 2302, 2302, 2302, - /* 3940 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 3950 */ 2806, 2302, 896, 2302, 2302, 2302, 2841, 2302, 2840, 2302, - /* 3960 */ 2302, 2891, 2302, 2302, 2302, 424, 2842, 900, 2844, 2845, - /* 3970 */ 895, 897, 2302, 883, 2892, 919, 2841, 2840, 2302, 2302, - /* 3980 */ 2891, 2302, 2302, 2302, 425, 2842, 900, 2844, 2845, 895, - /* 3990 */ 2302, 897, 883, 2892, 919, 2841, 2302, 2840, 2302, 2302, - /* 4000 */ 2891, 2859, 2302, 2302, 426, 2842, 900, 2844, 2845, 895, - /* 4010 */ 897, 2302, 883, 2892, 919, 2302, 2302, 2806, 2302, 896, - /* 4020 */ 2302, 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4030 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, - /* 4040 */ 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4050 */ 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, - /* 4060 */ 2302, 2302, 2302, 2841, 2840, 2302, 2302, 2891, 2302, 2302, - /* 4070 */ 2302, 442, 2842, 900, 2844, 2845, 895, 2302, 897, 883, - /* 4080 */ 2892, 919, 2841, 2302, 2840, 2302, 2302, 2891, 2302, 2302, - /* 4090 */ 2302, 443, 2842, 900, 2844, 2845, 895, 897, 2302, 883, - /* 4100 */ 2892, 919, 2302, 2840, 2302, 2302, 2891, 2302, 2859, 2302, - /* 4110 */ 2853, 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, - /* 4120 */ 919, 2302, 2302, 2302, 2806, 2302, 896, 2859, 2302, 2302, - /* 4130 */ 2302, 2841, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4140 */ 2302, 2302, 2302, 2806, 2302, 896, 897, 2302, 2302, 2302, - /* 4150 */ 2302, 2841, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4160 */ 2302, 2302, 2302, 2302, 2302, 2302, 897, 2302, 2302, 2302, - /* 4170 */ 2302, 2840, 2302, 2302, 2891, 2302, 2859, 2302, 2852, 2842, - /* 4180 */ 900, 2844, 2845, 895, 2302, 2302, 883, 2892, 919, 2302, - /* 4190 */ 2840, 2302, 2806, 2891, 896, 2302, 2859, 2851, 2842, 900, - /* 4200 */ 2844, 2845, 895, 2302, 2302, 883, 2892, 919, 2302, 2302, - /* 4210 */ 2302, 2302, 2806, 2302, 896, 2302, 2302, 2302, 2302, 2841, - /* 4220 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4230 */ 2302, 2302, 2302, 2302, 897, 2302, 2302, 2302, 2302, 2840, - /* 4240 */ 2302, 2302, 2891, 2841, 2302, 2302, 459, 2842, 900, 2844, - /* 4250 */ 2845, 895, 2302, 2302, 883, 2892, 919, 2302, 897, 2840, - /* 4260 */ 2302, 2302, 2891, 2302, 2859, 2302, 460, 2842, 900, 2844, - /* 4270 */ 2845, 895, 2302, 2302, 883, 2892, 919, 2302, 2302, 2302, - /* 4280 */ 2806, 2302, 896, 2302, 2302, 2302, 2302, 2302, 2859, 2302, - /* 4290 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4300 */ 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, 2302, 2302, - /* 4310 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4320 */ 2302, 2302, 2302, 2302, 2302, 2841, 2302, 2840, 2302, 2302, - /* 4330 */ 2891, 2302, 2302, 2302, 456, 2842, 900, 2844, 2845, 895, - /* 4340 */ 897, 2302, 883, 2892, 919, 2302, 2302, 2302, 2302, 2841, - /* 4350 */ 2302, 2840, 2302, 2302, 2891, 2302, 2302, 2302, 461, 2842, - /* 4360 */ 900, 2844, 2845, 895, 897, 2302, 883, 2892, 919, 2302, - /* 4370 */ 2859, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4380 */ 2302, 2302, 2302, 2302, 2302, 2302, 2806, 2302, 896, 2302, - /* 4390 */ 2302, 2302, 2302, 2302, 2859, 2302, 2302, 2302, 2302, 2302, - /* 4400 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4410 */ 2806, 2302, 896, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4420 */ 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, 2302, - /* 4430 */ 2302, 2302, 2302, 898, 2302, 2302, 2891, 2302, 2302, 2302, - /* 4440 */ 432, 2842, 900, 2844, 2845, 895, 2302, 2302, 883, 2892, - /* 4450 */ 919, 2302, 2302, 2302, 2302, 2302, 2302, 2840, 2302, 2302, - /* 4460 */ 2891, 2302, 2302, 2302, 431, 2842, 900, 2844, 2845, 895, - /* 4470 */ 2302, 2302, 883, 2892, 919, + /* 0 */ 44, 354, 464, 2712, 570, 586, 2605, 2269, 219, 569, + /* 10 */ 2689, 506, 59, 57, 136, 674, 2721, 219, 675, 2319, + /* 20 */ 502, 2272, 1989, 522, 2483, 52, 51, 2014, 679, 58, + /* 30 */ 56, 55, 54, 53, 676, 2609, 1987, 2578, 2094, 2363, + /* 40 */ 2803, 2331, 150, 873, 2609, 149, 148, 147, 146, 145, + /* 50 */ 144, 143, 142, 141, 872, 840, 2636, 542, 52, 51, + /* 60 */ 246, 791, 58, 56, 55, 54, 53, 78, 2089, 3011, + /* 70 */ 494, 870, 307, 791, 483, 2683, 2633, 887, 196, 837, + /* 80 */ 169, 3011, 1995, 34, 1670, 2821, 2412, 3017, 230, 529, + /* 90 */ 528, 682, 3012, 826, 675, 2319, 994, 535, 1669, 3017, + /* 100 */ 230, 2768, 534, 882, 3012, 826, 2761, 473, 471, 519, + /* 110 */ 2722, 900, 1005, 1996, 815, 60, 976, 975, 974, 973, + /* 120 */ 532, 2928, 972, 971, 174, 966, 965, 964, 963, 962, + /* 130 */ 961, 960, 173, 954, 953, 952, 531, 530, 949, 948, + /* 140 */ 947, 210, 209, 946, 527, 945, 944, 943, 2802, 814, + /* 150 */ 2925, 2850, 2097, 2098, 791, 133, 2804, 886, 2806, 2807, + /* 160 */ 881, 125, 3011, 869, 2851, 905, 2231, 791, 223, 508, + /* 170 */ 212, 774, 2913, 250, 644, 3011, 496, 2909, 74, 2821, + /* 180 */ 3017, 230, 2803, 905, 2528, 3012, 826, 470, 468, 2472, + /* 190 */ 722, 2050, 2060, 3017, 230, 2541, 231, 840, 3012, 826, + /* 200 */ 9, 2096, 2099, 492, 2960, 206, 2921, 836, 614, 161, + /* 210 */ 835, 724, 2015, 613, 2539, 723, 1990, 3011, 1988, 106, + /* 220 */ 900, 612, 96, 868, 105, 52, 51, 2821, 761, 58, + /* 230 */ 56, 55, 54, 53, 402, 824, 230, 2018, 2518, 172, + /* 240 */ 3012, 826, 775, 2768, 755, 882, 759, 757, 302, 301, + /* 250 */ 2471, 813, 1993, 1994, 2047, 2183, 2049, 2052, 2053, 2054, + /* 260 */ 2055, 2056, 2057, 2058, 2059, 878, 871, 901, 2481, 903, + /* 270 */ 902, 867, 2081, 2082, 2083, 2084, 2085, 2088, 2090, 2091, + /* 280 */ 2092, 2093, 2095, 2, 59, 57, 2186, 160, 2803, 900, + /* 290 */ 2802, 104, 502, 2850, 1989, 1999, 720, 133, 2804, 886, + /* 300 */ 2806, 2807, 881, 880, 1658, 869, 2851, 905, 1987, 2636, + /* 310 */ 2094, 2161, 212, 2485, 2913, 62, 52, 51, 496, 2909, + /* 320 */ 58, 56, 55, 54, 53, 684, 2675, 2803, 577, 2634, + /* 330 */ 887, 52, 51, 2821, 74, 58, 56, 55, 54, 53, + /* 340 */ 2089, 690, 883, 870, 1761, 1762, 2961, 19, 2047, 2768, + /* 350 */ 1660, 882, 837, 169, 1995, 150, 901, 2481, 149, 148, + /* 360 */ 147, 146, 145, 144, 143, 142, 141, 59, 57, 693, + /* 370 */ 3016, 338, 2821, 2161, 771, 502, 526, 1989, 3011, 639, + /* 380 */ 637, 2541, 439, 456, 1005, 244, 126, 15, 2768, 507, + /* 390 */ 882, 1987, 2126, 2094, 2463, 469, 2802, 3015, 2014, 2850, + /* 400 */ 2539, 3012, 3014, 434, 2804, 886, 2806, 2807, 881, 879, + /* 410 */ 226, 869, 2851, 905, 860, 2878, 940, 186, 185, 937, + /* 420 */ 936, 935, 183, 2089, 2097, 2098, 870, 1567, 2470, 1566, + /* 430 */ 19, 592, 2605, 2124, 568, 2802, 567, 1995, 2850, 2071, + /* 440 */ 2535, 2536, 198, 2804, 886, 2806, 2807, 881, 514, 2161, + /* 450 */ 869, 2851, 905, 2933, 2158, 2159, 2160, 2933, 2933, 2933, + /* 460 */ 2933, 2933, 74, 2050, 2060, 1568, 2453, 1005, 566, 2131, + /* 470 */ 15, 2019, 549, 2096, 2099, 2190, 697, 839, 199, 2921, + /* 480 */ 2922, 2014, 167, 2926, 901, 2481, 248, 517, 1990, 41, + /* 490 */ 1988, 508, 792, 2971, 2219, 868, 237, 671, 2125, 2163, + /* 500 */ 2164, 2165, 2166, 2167, 160, 905, 669, 2097, 2098, 665, + /* 510 */ 661, 2015, 204, 725, 331, 2933, 2158, 2159, 2160, 2933, + /* 520 */ 2933, 2933, 2933, 2933, 1993, 1994, 2047, 338, 2049, 2052, + /* 530 */ 2053, 2054, 2055, 2056, 2057, 2058, 2059, 878, 871, 810, + /* 540 */ 942, 903, 902, 867, 2081, 2082, 2050, 2060, 942, 2088, + /* 550 */ 2090, 2091, 2092, 2093, 2095, 2, 2096, 2099, 2271, 900, + /* 560 */ 2636, 2182, 807, 806, 2217, 2218, 2220, 2221, 2222, 1835, + /* 570 */ 1836, 1990, 63, 1988, 504, 2130, 1570, 1571, 868, 219, + /* 580 */ 2633, 887, 159, 158, 157, 156, 155, 154, 153, 152, + /* 590 */ 151, 45, 2158, 2159, 2160, 43, 498, 2119, 2120, 2121, + /* 600 */ 2122, 2123, 2127, 2128, 2129, 3016, 2610, 1993, 1994, 2047, + /* 610 */ 772, 2049, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, + /* 620 */ 878, 871, 2017, 2017, 903, 902, 867, 2081, 2082, 1567, + /* 630 */ 1958, 1566, 2088, 2090, 2091, 2092, 2093, 2095, 2, 12, + /* 640 */ 59, 57, 724, 1862, 1863, 165, 723, 691, 502, 554, + /* 650 */ 1989, 12, 2051, 2803, 62, 338, 1722, 816, 811, 804, + /* 660 */ 800, 2778, 513, 512, 1987, 2014, 2094, 1568, 883, 1957, + /* 670 */ 2329, 1713, 932, 931, 930, 1717, 929, 1719, 1720, 928, + /* 680 */ 925, 2541, 1728, 922, 1730, 1731, 919, 916, 913, 2803, + /* 690 */ 1995, 2782, 1861, 1864, 2014, 197, 2089, 2283, 2821, 870, + /* 700 */ 844, 516, 515, 19, 883, 58, 56, 55, 54, 53, + /* 710 */ 1995, 2541, 692, 2629, 2768, 2048, 882, 388, 2254, 462, + /* 720 */ 12, 2778, 10, 59, 57, 2100, 694, 825, 901, 2481, + /* 730 */ 2539, 502, 266, 1989, 2821, 3011, 677, 2541, 2327, 2105, + /* 740 */ 1005, 2784, 2787, 15, 861, 2014, 2885, 1987, 235, 2094, + /* 750 */ 2768, 2782, 882, 824, 230, 905, 852, 933, 3012, 826, + /* 760 */ 74, 2802, 305, 193, 2850, 338, 304, 3016, 133, 2804, + /* 770 */ 886, 2806, 2807, 881, 2487, 3011, 869, 2851, 905, 2089, + /* 780 */ 2097, 2098, 870, 3031, 829, 2913, 2623, 558, 695, 496, + /* 790 */ 2909, 901, 2481, 1995, 3015, 336, 336, 2802, 3012, 3013, + /* 800 */ 2850, 2784, 2786, 497, 201, 2804, 886, 2806, 2807, 881, + /* 810 */ 825, 67, 869, 2851, 905, 905, 560, 556, 3011, 2050, + /* 820 */ 2060, 524, 2456, 1005, 2534, 2536, 60, 52, 51, 2096, + /* 830 */ 2099, 58, 56, 55, 54, 53, 824, 230, 345, 346, + /* 840 */ 115, 3012, 826, 344, 1990, 451, 1988, 338, 481, 775, + /* 850 */ 763, 868, 505, 52, 51, 175, 2294, 58, 56, 55, + /* 860 */ 54, 53, 193, 2097, 2098, 2051, 827, 3032, 2762, 1674, + /* 870 */ 52, 51, 790, 2486, 58, 56, 55, 54, 53, 2468, + /* 880 */ 1993, 1994, 2047, 1673, 2049, 2052, 2053, 2054, 2055, 2056, + /* 890 */ 2057, 2058, 2059, 878, 871, 901, 2481, 903, 902, 867, + /* 900 */ 2081, 2082, 2050, 2060, 2466, 2088, 2090, 2091, 2092, 2093, + /* 910 */ 2095, 2, 2096, 2099, 2588, 574, 2051, 2768, 52, 51, + /* 920 */ 1722, 2018, 58, 56, 55, 54, 53, 1990, 2048, 1988, + /* 930 */ 306, 508, 777, 2675, 868, 1713, 932, 931, 930, 1717, + /* 940 */ 929, 1719, 1720, 877, 876, 905, 1728, 875, 1730, 1731, + /* 950 */ 874, 916, 913, 338, 837, 169, 268, 47, 584, 646, + /* 960 */ 677, 2230, 2327, 1993, 1994, 2047, 1540, 2049, 2052, 2053, + /* 970 */ 2054, 2055, 2056, 2057, 2058, 2059, 878, 871, 2202, 2048, + /* 980 */ 903, 902, 867, 2081, 2082, 1547, 901, 2481, 2088, 2090, + /* 990 */ 2091, 2092, 2093, 2095, 2, 59, 57, 863, 633, 2885, + /* 1000 */ 1989, 395, 2293, 502, 317, 1989, 575, 1547, 2803, 2292, + /* 1010 */ 1542, 1545, 1546, 72, 1987, 1916, 1917, 623, 2605, 1987, + /* 1020 */ 394, 2094, 194, 883, 788, 2968, 2066, 2261, 741, 740, + /* 1030 */ 739, 522, 2483, 1545, 1546, 731, 166, 735, 55, 54, + /* 1040 */ 53, 734, 2455, 3015, 901, 2481, 733, 738, 476, 475, + /* 1050 */ 2291, 2089, 732, 2821, 870, 117, 474, 728, 727, 726, + /* 1060 */ 1995, 482, 2683, 2768, 594, 1995, 255, 901, 2481, 2768, + /* 1070 */ 2768, 882, 253, 901, 2481, 313, 901, 2481, 59, 57, + /* 1080 */ 139, 2921, 2922, 830, 167, 2926, 502, 608, 1989, 112, + /* 1090 */ 1005, 632, 254, 609, 225, 1005, 610, 395, 60, 2079, + /* 1100 */ 901, 2481, 1987, 2211, 2094, 630, 2290, 748, 467, 901, + /* 1110 */ 2481, 2768, 2289, 38, 956, 224, 2802, 2212, 2474, 2850, + /* 1120 */ 696, 2288, 762, 133, 2804, 886, 2806, 2807, 881, 2476, + /* 1130 */ 401, 869, 2851, 905, 2089, 2097, 2098, 870, 3031, 2018, + /* 1140 */ 2913, 303, 901, 2481, 496, 2909, 901, 2481, 1995, 901, + /* 1150 */ 2481, 2561, 901, 2481, 2260, 2019, 2485, 751, 2684, 901, + /* 1160 */ 2481, 2708, 308, 2210, 745, 743, 316, 2768, 2287, 843, + /* 1170 */ 194, 300, 349, 2768, 2050, 2060, 525, 2286, 1005, 857, + /* 1180 */ 2484, 60, 2768, 958, 2096, 2099, 193, 940, 186, 185, + /* 1190 */ 937, 936, 935, 183, 1990, 959, 1988, 2486, 2438, 1990, + /* 1200 */ 729, 1988, 2366, 52, 51, 2018, 868, 58, 56, 55, + /* 1210 */ 54, 53, 901, 2481, 901, 2481, 2543, 84, 2097, 2098, + /* 1220 */ 52, 51, 83, 1651, 58, 56, 55, 54, 53, 2768, + /* 1230 */ 1993, 1994, 356, 2413, 894, 1993, 1994, 2047, 2768, 2049, + /* 1240 */ 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 878, 871, + /* 1250 */ 14, 13, 903, 902, 867, 2081, 2082, 2050, 2060, 39, + /* 1260 */ 2088, 2090, 2091, 2092, 2093, 2095, 2, 2096, 2099, 52, + /* 1270 */ 51, 901, 2481, 58, 56, 55, 54, 53, 2284, 741, + /* 1280 */ 740, 739, 1990, 2014, 1988, 112, 731, 166, 735, 868, + /* 1290 */ 3, 895, 734, 901, 2481, 901, 2481, 733, 738, 476, + /* 1300 */ 475, 716, 715, 732, 65, 2285, 616, 474, 728, 727, + /* 1310 */ 726, 2067, 233, 899, 2475, 384, 718, 717, 1993, 1994, + /* 1320 */ 2047, 615, 2049, 2052, 2053, 2054, 2055, 2056, 2057, 2058, + /* 1330 */ 2059, 878, 871, 2541, 2974, 903, 902, 867, 2081, 2082, + /* 1340 */ 2928, 523, 2282, 2088, 2090, 2091, 2092, 2093, 2095, 2, + /* 1350 */ 59, 57, 2539, 737, 736, 970, 968, 116, 502, 288, + /* 1360 */ 1989, 934, 204, 2803, 2532, 2138, 2768, 2281, 2928, 2924, + /* 1370 */ 828, 642, 768, 2019, 1987, 205, 2094, 2069, 883, 170, + /* 1380 */ 2981, 2280, 2884, 2279, 714, 710, 706, 702, 40, 287, + /* 1390 */ 2278, 1890, 1653, 2277, 52, 51, 819, 2923, 58, 56, + /* 1400 */ 55, 54, 53, 2768, 42, 221, 2089, 162, 2821, 870, + /* 1410 */ 52, 51, 2276, 2541, 58, 56, 55, 54, 53, 1549, + /* 1420 */ 1995, 102, 837, 169, 2768, 2013, 882, 908, 2768, 791, + /* 1430 */ 2299, 998, 2540, 59, 57, 285, 2275, 3011, 1654, 2019, + /* 1440 */ 284, 502, 2768, 1989, 2768, 2274, 938, 332, 184, 2532, + /* 1450 */ 1005, 2768, 832, 60, 2768, 3017, 230, 1987, 776, 2094, + /* 1460 */ 3012, 826, 52, 51, 866, 2172, 58, 56, 55, 54, + /* 1470 */ 53, 2802, 939, 2768, 2850, 2532, 176, 176, 133, 2804, + /* 1480 */ 886, 2806, 2807, 881, 90, 798, 869, 2851, 905, 2089, + /* 1490 */ 2097, 2098, 870, 3031, 765, 2913, 764, 2768, 293, 496, + /* 1500 */ 2909, 291, 730, 1995, 52, 51, 2768, 271, 58, 56, + /* 1510 */ 55, 54, 53, 2263, 2264, 791, 282, 2048, 1631, 295, + /* 1520 */ 273, 280, 294, 3011, 808, 1649, 278, 688, 164, 2050, + /* 1530 */ 2060, 66, 297, 1005, 299, 296, 15, 298, 103, 2096, + /* 1540 */ 2099, 3017, 230, 46, 2350, 270, 3012, 826, 200, 2921, + /* 1550 */ 2922, 61, 167, 2926, 1990, 61, 1988, 213, 950, 1906, + /* 1560 */ 1914, 868, 14, 13, 1632, 184, 742, 2348, 2206, 838, + /* 1570 */ 2072, 2822, 343, 2097, 2098, 89, 61, 1998, 2789, 52, + /* 1580 */ 51, 1623, 76, 58, 56, 55, 54, 53, 2452, 744, + /* 1590 */ 1993, 1994, 2047, 61, 2049, 2052, 2053, 2054, 2055, 2056, + /* 1600 */ 2057, 2058, 2059, 878, 871, 2339, 61, 903, 902, 867, + /* 1610 */ 2081, 2082, 2050, 2060, 2337, 2088, 2090, 2091, 2092, 2093, + /* 1620 */ 2095, 2, 2096, 2099, 52, 51, 1997, 746, 58, 56, + /* 1630 */ 55, 54, 53, 61, 2216, 909, 749, 1990, 2215, 1988, + /* 1640 */ 322, 2116, 2791, 61, 868, 89, 52, 51, 842, 324, + /* 1650 */ 58, 56, 55, 54, 53, 347, 52, 51, 849, 2070, + /* 1660 */ 58, 56, 55, 54, 53, 2132, 363, 362, 2405, 181, + /* 1670 */ 365, 364, 162, 1993, 1994, 2047, 2080, 2049, 2052, 2053, + /* 1680 */ 2054, 2055, 2056, 2057, 2058, 2059, 878, 871, 184, 2073, + /* 1690 */ 903, 902, 867, 2081, 2082, 367, 366, 951, 2088, 2090, + /* 1700 */ 2091, 2092, 2093, 2095, 2, 443, 2803, 2012, 369, 368, + /* 1710 */ 86, 371, 370, 911, 621, 841, 2061, 466, 373, 372, + /* 1720 */ 1621, 883, 195, 182, 184, 641, 1859, 408, 1849, 375, + /* 1730 */ 374, 2404, 2068, 940, 186, 185, 937, 936, 935, 183, + /* 1740 */ 131, 600, 128, 643, 163, 181, 406, 88, 444, 602, + /* 1750 */ 87, 2821, 359, 833, 2065, 898, 377, 376, 2320, 2001, + /* 1760 */ 580, 445, 379, 378, 137, 381, 380, 2768, 2964, 882, + /* 1770 */ 1604, 1704, 791, 264, 656, 654, 651, 649, 383, 382, + /* 1780 */ 3011, 805, 488, 812, 484, 846, 2614, 551, 533, 2326, + /* 1790 */ 2529, 784, 2965, 400, 2975, 820, 1735, 334, 3017, 230, + /* 1800 */ 329, 465, 821, 3012, 826, 2615, 1743, 1750, 2000, 337, + /* 1810 */ 2439, 5, 541, 588, 2802, 536, 1605, 2850, 460, 74, + /* 1820 */ 2012, 133, 2804, 886, 2806, 2807, 881, 1748, 187, 869, + /* 1830 */ 2851, 905, 550, 2022, 171, 562, 180, 2884, 2913, 561, + /* 1840 */ 239, 238, 496, 2909, 2616, 2595, 241, 629, 628, 627, + /* 1850 */ 626, 625, 620, 619, 618, 617, 448, 564, 75, 607, + /* 1860 */ 606, 605, 604, 603, 597, 596, 595, 1883, 590, 589, + /* 1870 */ 463, 393, 578, 2803, 581, 1823, 1824, 2013, 585, 252, + /* 1880 */ 587, 1842, 591, 593, 635, 611, 598, 622, 883, 647, + /* 1890 */ 802, 2607, 624, 631, 634, 636, 648, 645, 258, 650, + /* 1900 */ 257, 652, 261, 653, 655, 657, 2020, 672, 4, 673, + /* 1910 */ 680, 683, 100, 99, 573, 48, 681, 243, 2821, 269, + /* 1920 */ 108, 2015, 685, 2021, 272, 686, 2023, 689, 687, 275, + /* 1930 */ 565, 563, 2024, 2630, 2768, 277, 882, 109, 2025, 2624, + /* 1940 */ 110, 2803, 111, 442, 1702, 286, 552, 698, 283, 548, + /* 1950 */ 544, 540, 537, 566, 752, 719, 883, 113, 3004, 138, + /* 1960 */ 721, 753, 437, 2698, 767, 2469, 290, 769, 2465, 292, + /* 1970 */ 114, 189, 2016, 309, 779, 396, 778, 135, 2676, 2803, + /* 1980 */ 177, 2802, 2467, 2462, 2850, 190, 2821, 191, 133, 2804, + /* 1990 */ 886, 2806, 2807, 881, 883, 2695, 869, 2851, 905, 314, + /* 2000 */ 2694, 786, 2768, 3031, 882, 2913, 2803, 783, 809, 496, + /* 2010 */ 2909, 795, 338, 847, 2980, 2979, 818, 793, 323, 8, + /* 2020 */ 2952, 883, 203, 2945, 2821, 325, 796, 327, 794, 823, + /* 2030 */ 822, 3034, 780, 2932, 489, 319, 330, 785, 312, 326, + /* 2040 */ 2768, 321, 882, 834, 328, 831, 168, 2017, 2180, 2802, + /* 2050 */ 1, 2821, 2850, 216, 2178, 845, 133, 2804, 886, 2806, + /* 2060 */ 2807, 881, 529, 528, 869, 2851, 905, 2768, 3010, 882, + /* 2070 */ 339, 3031, 2003, 2913, 2803, 178, 2929, 496, 2909, 2644, + /* 2080 */ 397, 2643, 2642, 850, 398, 851, 1996, 2802, 2094, 883, + /* 2090 */ 2850, 493, 179, 855, 133, 2804, 886, 2806, 2807, 881, + /* 2100 */ 858, 73, 869, 2851, 905, 2894, 890, 888, 352, 2888, + /* 2110 */ 892, 2913, 2803, 2760, 2802, 496, 2909, 2850, 2089, 2821, + /* 2120 */ 232, 133, 2804, 886, 2806, 2807, 881, 883, 357, 869, + /* 2130 */ 2851, 905, 1995, 893, 333, 2768, 3031, 882, 2913, 447, + /* 2140 */ 446, 399, 496, 2909, 124, 127, 1519, 2482, 403, 509, + /* 2150 */ 2759, 1000, 907, 1001, 2755, 2754, 2803, 2821, 386, 188, + /* 2160 */ 2746, 389, 865, 518, 1004, 2094, 2745, 2737, 1002, 997, + /* 2170 */ 2736, 883, 2752, 2768, 390, 882, 2751, 2743, 2742, 2731, + /* 2180 */ 2730, 405, 2802, 2749, 2720, 2850, 2748, 2740, 2739, 133, + /* 2190 */ 2804, 886, 2806, 2807, 881, 2089, 2728, 869, 2851, 905, + /* 2200 */ 472, 2821, 771, 2727, 2886, 64, 2913, 2725, 2724, 2533, + /* 2210 */ 496, 2909, 425, 436, 520, 452, 426, 2768, 407, 882, + /* 2220 */ 2802, 438, 453, 2850, 2719, 2718, 97, 133, 2804, 886, + /* 2230 */ 2806, 2807, 881, 2713, 538, 869, 2851, 905, 2803, 539, + /* 2240 */ 1940, 1941, 862, 236, 2913, 543, 2711, 545, 496, 2909, + /* 2250 */ 546, 547, 1939, 883, 2710, 2709, 461, 2707, 553, 2706, + /* 2260 */ 2705, 557, 555, 2704, 2802, 559, 2004, 2850, 1999, 1927, + /* 2270 */ 2680, 134, 2804, 886, 2806, 2807, 881, 240, 2679, 869, + /* 2280 */ 2851, 905, 242, 2821, 98, 1886, 1885, 2657, 2913, 571, + /* 2290 */ 572, 2654, 2912, 2909, 2656, 2655, 2653, 2597, 576, 2768, + /* 2300 */ 1822, 882, 2007, 2009, 2594, 579, 2593, 2587, 582, 2584, + /* 2310 */ 583, 2583, 245, 101, 2582, 2581, 2586, 2585, 247, 903, + /* 2320 */ 902, 2803, 2580, 2579, 2577, 2576, 2575, 2088, 2090, 2091, + /* 2330 */ 2092, 2093, 2095, 249, 599, 2574, 883, 601, 2572, 2571, + /* 2340 */ 2570, 2569, 2568, 1980, 2592, 1956, 2802, 2567, 2566, 2850, + /* 2350 */ 2565, 2590, 2573, 134, 2804, 886, 2806, 2807, 881, 2564, + /* 2360 */ 2563, 869, 2851, 905, 2562, 2560, 2821, 2559, 2558, 2557, + /* 2370 */ 2913, 2556, 2555, 2554, 864, 2909, 2553, 511, 510, 1981, + /* 2380 */ 251, 107, 2768, 2552, 882, 2551, 2550, 2622, 2591, 2589, + /* 2390 */ 2549, 2548, 1828, 2547, 256, 2546, 903, 902, 638, 2545, + /* 2400 */ 640, 2544, 2542, 1671, 2088, 2090, 2091, 2092, 2093, 2095, + /* 2410 */ 2803, 2370, 2369, 449, 1675, 450, 1667, 259, 2368, 2367, + /* 2420 */ 2365, 260, 2362, 262, 263, 883, 660, 2361, 659, 884, + /* 2430 */ 658, 773, 2850, 662, 2354, 2341, 134, 2804, 886, 2806, + /* 2440 */ 2807, 881, 664, 666, 869, 2851, 905, 2803, 668, 1008, + /* 2450 */ 663, 670, 2315, 2913, 667, 2821, 265, 455, 2909, 211, + /* 2460 */ 93, 2788, 883, 1548, 222, 678, 2314, 94, 392, 267, + /* 2470 */ 2678, 2768, 2674, 882, 2664, 2803, 2652, 274, 276, 2651, + /* 2480 */ 279, 2628, 281, 996, 220, 2621, 2457, 2364, 2360, 699, + /* 2490 */ 883, 700, 2821, 992, 988, 984, 980, 1597, 387, 701, + /* 2500 */ 2358, 703, 704, 705, 2356, 707, 709, 2353, 2768, 711, + /* 2510 */ 882, 708, 712, 2336, 2334, 713, 2335, 2333, 2802, 2311, + /* 2520 */ 2821, 2850, 2459, 2458, 1754, 134, 2804, 886, 2806, 2807, + /* 2530 */ 881, 85, 1657, 869, 2851, 905, 2768, 1755, 882, 1656, + /* 2540 */ 289, 1655, 2913, 2351, 132, 1652, 2349, 2910, 1650, 360, + /* 2550 */ 1639, 1648, 477, 478, 1647, 2802, 1646, 967, 2850, 969, + /* 2560 */ 499, 1645, 411, 2804, 886, 2806, 2807, 881, 1644, 32, + /* 2570 */ 869, 2851, 905, 1641, 1640, 1638, 2340, 479, 2338, 480, + /* 2580 */ 853, 2803, 2310, 2802, 750, 747, 2850, 2309, 2308, 754, + /* 2590 */ 435, 2804, 886, 2806, 2807, 881, 883, 2307, 869, 2851, + /* 2600 */ 905, 756, 2306, 758, 2305, 760, 2803, 1921, 1923, 140, + /* 2610 */ 1920, 1925, 33, 2677, 79, 311, 2673, 1892, 68, 2663, + /* 2620 */ 1894, 883, 781, 2650, 2649, 358, 2821, 859, 3016, 69, + /* 2630 */ 341, 1896, 1911, 770, 782, 340, 1871, 315, 1870, 22, + /* 2640 */ 17, 797, 2768, 787, 882, 789, 485, 192, 35, 25, + /* 2650 */ 2233, 2821, 2207, 6, 310, 318, 799, 801, 803, 7, + /* 2660 */ 23, 320, 24, 215, 37, 2214, 202, 2768, 2201, 882, + /* 2670 */ 2171, 214, 227, 36, 95, 2803, 2173, 2789, 228, 2175, + /* 2680 */ 77, 229, 26, 2248, 2253, 2254, 2247, 490, 2252, 2802, + /* 2690 */ 883, 486, 2850, 2251, 491, 2155, 198, 2804, 886, 2806, + /* 2700 */ 2807, 881, 2154, 71, 869, 2851, 905, 335, 2648, 2627, + /* 2710 */ 207, 118, 119, 2626, 2802, 342, 120, 2850, 2803, 2209, + /* 2720 */ 2821, 435, 2804, 886, 2806, 2807, 881, 217, 2620, 869, + /* 2730 */ 2851, 905, 348, 883, 854, 81, 2768, 351, 882, 121, + /* 2740 */ 2803, 70, 350, 27, 13, 18, 848, 2972, 2107, 11, + /* 2750 */ 2106, 2005, 2064, 21, 28, 883, 856, 353, 2117, 29, + /* 2760 */ 487, 2803, 2063, 2821, 2062, 208, 218, 2040, 20, 49, + /* 2770 */ 2619, 891, 2454, 896, 122, 918, 880, 921, 924, 2768, + /* 2780 */ 927, 882, 50, 2802, 16, 2821, 2850, 2032, 30, 31, + /* 2790 */ 435, 2804, 886, 2806, 2807, 881, 82, 355, 869, 2851, + /* 2800 */ 905, 2768, 889, 882, 123, 128, 2821, 91, 897, 361, + /* 2810 */ 2076, 2863, 2862, 904, 80, 2267, 885, 906, 1736, 2266, + /* 2820 */ 910, 521, 2768, 1733, 882, 914, 2802, 912, 917, 2850, + /* 2830 */ 920, 915, 923, 428, 2804, 886, 2806, 2807, 881, 1732, + /* 2840 */ 1729, 869, 2851, 905, 926, 385, 1749, 1723, 2802, 1721, + /* 2850 */ 129, 2850, 130, 92, 1727, 201, 2804, 886, 2806, 2807, + /* 2860 */ 881, 1745, 1726, 869, 2851, 905, 1595, 1635, 1634, 2802, + /* 2870 */ 941, 1725, 2850, 1724, 1633, 955, 434, 2804, 886, 2806, + /* 2880 */ 2807, 881, 2803, 1630, 869, 2851, 905, 817, 2879, 1627, + /* 2890 */ 1626, 1625, 1624, 1622, 1620, 1619, 1618, 883, 1665, 1664, + /* 2900 */ 957, 234, 1616, 1615, 1613, 1614, 1612, 2803, 1611, 1661, + /* 2910 */ 1610, 1659, 1607, 1606, 1603, 1602, 1601, 1600, 3033, 2359, + /* 2920 */ 977, 2357, 883, 981, 979, 978, 2355, 2821, 985, 983, + /* 2930 */ 2352, 989, 987, 991, 2332, 993, 2330, 982, 995, 1537, + /* 2940 */ 986, 2304, 1520, 2768, 990, 882, 999, 1525, 1527, 2803, + /* 2950 */ 391, 1991, 2821, 1003, 2270, 404, 1006, 1007, 2270, 2270, + /* 2960 */ 2270, 2270, 2270, 2270, 883, 2270, 2270, 500, 2768, 2270, + /* 2970 */ 882, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 2980 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 2990 */ 2802, 2270, 495, 2850, 2821, 2270, 2270, 435, 2804, 886, + /* 3000 */ 2806, 2807, 881, 2270, 2270, 869, 2851, 905, 2270, 2270, + /* 3010 */ 2768, 2270, 882, 2270, 2803, 2802, 2270, 2270, 2850, 2270, + /* 3020 */ 2270, 2270, 420, 2804, 886, 2806, 2807, 881, 2270, 883, + /* 3030 */ 869, 2851, 905, 2270, 501, 2270, 2270, 2270, 2270, 2270, + /* 3040 */ 2270, 2803, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3050 */ 2270, 2270, 2270, 2270, 2270, 2270, 883, 2802, 2270, 2821, + /* 3060 */ 2850, 2270, 2270, 2270, 435, 2804, 886, 2806, 2807, 881, + /* 3070 */ 2270, 2270, 869, 2851, 905, 2768, 2270, 882, 2270, 2803, + /* 3080 */ 2270, 2270, 2270, 2270, 2270, 2270, 2821, 2270, 2270, 2270, + /* 3090 */ 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, 2270, 503, + /* 3100 */ 2270, 2270, 2768, 2270, 882, 2270, 2270, 2270, 2803, 2270, + /* 3110 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3120 */ 2270, 2270, 2802, 883, 2821, 2850, 2270, 2270, 2270, 435, + /* 3130 */ 2804, 886, 2806, 2807, 881, 2270, 2270, 869, 2851, 905, + /* 3140 */ 2768, 2270, 882, 2270, 2270, 2270, 2270, 2803, 2270, 2802, + /* 3150 */ 2270, 2270, 2850, 2821, 2270, 2270, 416, 2804, 886, 2806, + /* 3160 */ 2807, 881, 883, 2270, 869, 2851, 905, 2270, 2270, 2768, + /* 3170 */ 2270, 882, 2270, 2803, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3180 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 766, 883, 2270, + /* 3190 */ 2850, 2270, 2821, 2270, 430, 2804, 886, 2806, 2807, 881, + /* 3200 */ 2270, 2270, 869, 2851, 905, 2270, 2270, 2270, 2768, 2270, + /* 3210 */ 882, 2270, 2270, 2270, 2270, 2270, 2802, 2270, 2821, 2850, + /* 3220 */ 2270, 2270, 2270, 412, 2804, 886, 2806, 2807, 881, 2270, + /* 3230 */ 2270, 869, 2851, 905, 2768, 2270, 882, 2270, 2803, 2270, + /* 3240 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3250 */ 2270, 2270, 2270, 883, 2270, 2802, 2270, 2270, 2850, 2803, + /* 3260 */ 2270, 2270, 409, 2804, 886, 2806, 2807, 881, 2270, 2270, + /* 3270 */ 869, 2851, 905, 2270, 883, 2270, 2270, 2270, 2270, 2270, + /* 3280 */ 2270, 2802, 2270, 2821, 2850, 2270, 2270, 2270, 413, 2804, + /* 3290 */ 886, 2806, 2807, 881, 2270, 2270, 869, 2851, 905, 2768, + /* 3300 */ 2270, 882, 2270, 2270, 2821, 2270, 2270, 2270, 2270, 2270, + /* 3310 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3320 */ 2768, 2270, 882, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3330 */ 2270, 2270, 2270, 2270, 2270, 2270, 2803, 2270, 2270, 2270, + /* 3340 */ 2270, 2270, 2270, 2270, 2270, 2270, 2802, 2270, 2270, 2850, + /* 3350 */ 2270, 883, 2270, 427, 2804, 886, 2806, 2807, 881, 2270, + /* 3360 */ 2270, 869, 2851, 905, 2270, 2270, 2270, 2802, 2270, 2270, + /* 3370 */ 2850, 2270, 2270, 2270, 414, 2804, 886, 2806, 2807, 881, + /* 3380 */ 2803, 2821, 869, 2851, 905, 2270, 2270, 2270, 2270, 2270, + /* 3390 */ 2270, 2270, 2270, 2270, 2270, 883, 2270, 2768, 2270, 882, + /* 3400 */ 2270, 2803, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3410 */ 2270, 2270, 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, + /* 3420 */ 2270, 2803, 2270, 2270, 2270, 2821, 2270, 2270, 2270, 2270, + /* 3430 */ 2270, 2270, 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, + /* 3440 */ 2270, 2768, 2270, 882, 2802, 2270, 2821, 2850, 2270, 2270, + /* 3450 */ 2270, 415, 2804, 886, 2806, 2807, 881, 2270, 2270, 869, + /* 3460 */ 2851, 905, 2768, 2270, 882, 2270, 2821, 2270, 2270, 2270, + /* 3470 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3480 */ 2270, 2270, 2768, 2270, 882, 2270, 2803, 2270, 2802, 2270, + /* 3490 */ 2270, 2850, 2270, 2270, 2270, 431, 2804, 886, 2806, 2807, + /* 3500 */ 881, 883, 2270, 869, 2851, 905, 2270, 2270, 2270, 2802, + /* 3510 */ 2270, 2270, 2850, 2270, 2270, 2270, 417, 2804, 886, 2806, + /* 3520 */ 2807, 881, 2270, 2270, 869, 2851, 905, 2803, 2270, 2802, + /* 3530 */ 2270, 2821, 2850, 2270, 2270, 2270, 432, 2804, 886, 2806, + /* 3540 */ 2807, 881, 883, 2270, 869, 2851, 905, 2768, 2270, 882, + /* 3550 */ 2270, 2803, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3560 */ 2270, 2270, 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, + /* 3570 */ 2270, 2270, 2821, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3580 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2768, 2270, + /* 3590 */ 882, 2270, 2270, 2270, 2802, 2270, 2821, 2850, 2270, 2270, + /* 3600 */ 2270, 418, 2804, 886, 2806, 2807, 881, 2270, 2270, 869, + /* 3610 */ 2851, 905, 2768, 2270, 882, 2270, 2270, 2270, 2803, 2270, + /* 3620 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3630 */ 2270, 2270, 2270, 883, 2270, 2802, 2270, 2270, 2850, 2270, + /* 3640 */ 2803, 2270, 433, 2804, 886, 2806, 2807, 881, 2270, 2270, + /* 3650 */ 869, 2851, 905, 2270, 2270, 883, 2270, 2270, 2270, 2802, + /* 3660 */ 2270, 2270, 2850, 2821, 2270, 2270, 419, 2804, 886, 2806, + /* 3670 */ 2807, 881, 2270, 2270, 869, 2851, 905, 2270, 2270, 2768, + /* 3680 */ 2270, 882, 2270, 2803, 2270, 2821, 2270, 2270, 2270, 2270, + /* 3690 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 883, 2270, + /* 3700 */ 2270, 2768, 2270, 882, 2270, 2270, 2270, 2803, 2270, 2270, + /* 3710 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3720 */ 2270, 2270, 883, 2270, 2270, 2270, 2802, 2270, 2821, 2850, + /* 3730 */ 2270, 2270, 2270, 410, 2804, 886, 2806, 2807, 881, 2270, + /* 3740 */ 2270, 869, 2851, 905, 2768, 2270, 882, 2270, 2802, 2270, + /* 3750 */ 2270, 2850, 2821, 2270, 2270, 421, 2804, 886, 2806, 2807, + /* 3760 */ 881, 2270, 2270, 869, 2851, 905, 2270, 2270, 2768, 2270, + /* 3770 */ 882, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3780 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3790 */ 2270, 2802, 2270, 2270, 2850, 2270, 2270, 2270, 422, 2804, + /* 3800 */ 886, 2806, 2807, 881, 2270, 2270, 869, 2851, 905, 2270, + /* 3810 */ 2270, 2270, 2270, 2270, 2270, 2802, 2270, 2270, 2850, 2270, + /* 3820 */ 2270, 2270, 423, 2804, 886, 2806, 2807, 881, 2803, 2270, + /* 3830 */ 869, 2851, 905, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3840 */ 2270, 2270, 2270, 883, 2270, 2270, 2270, 2803, 2270, 2270, + /* 3850 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3860 */ 2270, 2270, 883, 2270, 2270, 2270, 2270, 2270, 2270, 2803, + /* 3870 */ 2270, 2270, 2270, 2821, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3880 */ 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, 2270, 2768, + /* 3890 */ 2270, 882, 2821, 2270, 2270, 2270, 2803, 2270, 2270, 2270, + /* 3900 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2768, 2270, + /* 3910 */ 882, 883, 2270, 2270, 2821, 2270, 2270, 2270, 2270, 2270, + /* 3920 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 3930 */ 2768, 2270, 882, 2270, 2803, 2270, 2802, 2270, 2270, 2850, + /* 3940 */ 2270, 2821, 2270, 424, 2804, 886, 2806, 2807, 881, 883, + /* 3950 */ 2270, 869, 2851, 905, 2270, 2802, 2270, 2768, 2850, 882, + /* 3960 */ 2270, 2270, 440, 2804, 886, 2806, 2807, 881, 2270, 2270, + /* 3970 */ 869, 2851, 905, 2270, 2270, 2270, 2270, 2802, 2270, 2821, + /* 3980 */ 2850, 2270, 2270, 2803, 441, 2804, 886, 2806, 2807, 881, + /* 3990 */ 2270, 2270, 869, 2851, 905, 2768, 2270, 882, 883, 2270, + /* 4000 */ 2270, 2270, 2270, 2270, 2802, 2270, 2270, 2850, 2270, 2270, + /* 4010 */ 2270, 2815, 2804, 886, 2806, 2807, 881, 2270, 2270, 869, + /* 4020 */ 2851, 905, 2803, 2270, 2270, 2270, 2270, 2270, 2821, 2270, + /* 4030 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 883, 2270, 2270, + /* 4040 */ 2270, 2270, 2802, 2270, 2768, 2850, 882, 2270, 2270, 2814, + /* 4050 */ 2804, 886, 2806, 2807, 881, 2270, 2270, 869, 2851, 905, + /* 4060 */ 2270, 2270, 2270, 2270, 2270, 2270, 2803, 2821, 2270, 2270, + /* 4070 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4080 */ 2270, 883, 2270, 2768, 2270, 882, 2270, 2270, 2270, 2270, + /* 4090 */ 2803, 2802, 2270, 2270, 2850, 2270, 2270, 2270, 2813, 2804, + /* 4100 */ 886, 2806, 2807, 881, 2270, 883, 869, 2851, 905, 2803, + /* 4110 */ 2270, 2821, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4120 */ 2270, 2270, 2270, 2270, 883, 2270, 2270, 2768, 2270, 882, + /* 4130 */ 2802, 2270, 2270, 2850, 2270, 2821, 2270, 457, 2804, 886, + /* 4140 */ 2806, 2807, 881, 2270, 2270, 869, 2851, 905, 2270, 2270, + /* 4150 */ 2270, 2768, 2270, 882, 2821, 2270, 2270, 2270, 2270, 2270, + /* 4160 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4170 */ 2768, 2270, 882, 2270, 2802, 2270, 2270, 2850, 2803, 2270, + /* 4180 */ 2270, 458, 2804, 886, 2806, 2807, 881, 2270, 2270, 869, + /* 4190 */ 2851, 905, 2270, 883, 2270, 2270, 2270, 2270, 2802, 2270, + /* 4200 */ 2270, 2850, 2270, 2270, 2270, 454, 2804, 886, 2806, 2807, + /* 4210 */ 881, 2270, 2270, 869, 2851, 905, 2270, 2802, 2270, 2270, + /* 4220 */ 2850, 2270, 2270, 2821, 459, 2804, 886, 2806, 2807, 881, + /* 4230 */ 2270, 2270, 869, 2851, 905, 2270, 2270, 2270, 2270, 2768, + /* 4240 */ 2270, 882, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4250 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4260 */ 2803, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4270 */ 2270, 2270, 2270, 2270, 2270, 883, 2270, 2270, 2270, 2270, + /* 4280 */ 2270, 2270, 2270, 2270, 2270, 2270, 884, 2270, 2270, 2850, + /* 4290 */ 2270, 2270, 2270, 430, 2804, 886, 2806, 2807, 881, 2270, + /* 4300 */ 2270, 869, 2851, 905, 2270, 2821, 2270, 2270, 2270, 2270, + /* 4310 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4320 */ 2270, 2768, 2270, 882, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4330 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4340 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4350 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, + /* 4360 */ 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2270, 2802, 2270, + /* 4370 */ 2270, 2850, 2270, 2270, 2270, 429, 2804, 886, 2806, 2807, + /* 4380 */ 881, 2270, 2270, 869, 2851, 905, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 536, 401, 536, 401, 404, 405, 404, 405, 544, 437, - /* 10 */ 544, 423, 12, 13, 4, 12, 13, 14, 15, 16, - /* 20 */ 20, 0, 22, 438, 406, 407, 562, 563, 456, 563, - /* 30 */ 423, 567, 568, 567, 568, 538, 36, 540, 38, 0, - /* 40 */ 20, 453, 21, 392, 426, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 20, 406, 407, 431, 407, 34, - /* 60 */ 453, 8, 9, 437, 54, 12, 13, 14, 15, 16, - /* 70 */ 0, 71, 21, 20, 74, 24, 25, 26, 27, 28, - /* 80 */ 29, 30, 31, 32, 499, 85, 20, 455, 437, 20, - /* 90 */ 464, 503, 504, 505, 24, 25, 26, 27, 28, 29, - /* 100 */ 30, 31, 32, 14, 453, 517, 455, 475, 476, 20, - /* 110 */ 503, 504, 20, 479, 22, 115, 406, 407, 118, 80, - /* 120 */ 81, 82, 83, 84, 517, 86, 87, 88, 89, 90, + /* 0 */ 519, 520, 425, 0, 473, 400, 401, 383, 431, 478, + /* 10 */ 426, 425, 12, 13, 431, 395, 473, 431, 398, 399, + /* 20 */ 20, 0, 22, 440, 441, 8, 9, 20, 14, 12, + /* 30 */ 13, 14, 15, 16, 20, 458, 36, 0, 38, 0, + /* 40 */ 386, 0, 21, 432, 458, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 443, 401, 449, 54, 8, 9, + /* 60 */ 455, 530, 12, 13, 14, 15, 16, 4, 68, 538, + /* 70 */ 463, 71, 488, 530, 491, 492, 469, 470, 410, 400, + /* 80 */ 401, 538, 82, 33, 22, 431, 418, 556, 557, 12, + /* 90 */ 13, 395, 561, 562, 398, 399, 55, 473, 36, 556, + /* 100 */ 557, 447, 478, 449, 561, 562, 434, 41, 42, 437, + /* 110 */ 473, 20, 112, 36, 20, 115, 77, 78, 79, 80, + /* 120 */ 81, 500, 83, 84, 85, 86, 87, 88, 89, 90, /* 130 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - /* 140 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - /* 150 */ 111, 500, 118, 61, 503, 155, 156, 416, 507, 508, - /* 160 */ 509, 510, 511, 512, 118, 424, 515, 516, 517, 20, - /* 170 */ 536, 21, 20, 522, 22, 524, 20, 71, 544, 528, - /* 180 */ 529, 532, 533, 534, 118, 536, 537, 37, 36, 39, - /* 190 */ 40, 41, 42, 544, 194, 195, 562, 563, 391, 548, - /* 200 */ 393, 567, 568, 3, 204, 205, 451, 556, 427, 454, - /* 210 */ 455, 562, 563, 61, 194, 195, 567, 568, 437, 219, - /* 220 */ 20, 221, 199, 117, 20, 44, 226, 14, 122, 448, - /* 230 */ 8, 9, 20, 20, 12, 13, 14, 15, 16, 57, - /* 240 */ 118, 531, 532, 533, 534, 4, 536, 537, 66, 196, - /* 250 */ 71, 69, 70, 406, 254, 255, 256, 392, 258, 259, - /* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 270 */ 270, 271, 407, 20, 274, 275, 276, 277, 278, 279, - /* 280 */ 280, 281, 282, 283, 284, 285, 286, 287, 288, 12, - /* 290 */ 13, 14, 406, 392, 18, 189, 20, 20, 118, 22, - /* 300 */ 78, 122, 437, 27, 457, 458, 30, 460, 407, 256, - /* 310 */ 463, 155, 156, 36, 38, 38, 406, 407, 453, 119, - /* 320 */ 455, 0, 8, 9, 120, 256, 12, 13, 14, 15, - /* 330 */ 16, 431, 56, 57, 0, 59, 426, 437, 437, 158, - /* 340 */ 64, 65, 319, 320, 321, 322, 323, 313, 71, 455, - /* 350 */ 128, 74, 76, 20, 453, 78, 455, 471, 472, 313, - /* 360 */ 204, 205, 85, 469, 464, 500, 20, 392, 503, 475, - /* 370 */ 476, 118, 507, 508, 509, 510, 511, 512, 513, 313, - /* 380 */ 515, 516, 517, 518, 519, 148, 149, 150, 151, 152, - /* 390 */ 153, 154, 115, 117, 422, 118, 196, 425, 218, 20, - /* 400 */ 220, 500, 254, 438, 503, 129, 455, 194, 507, 508, - /* 410 */ 509, 510, 511, 512, 449, 193, 515, 516, 517, 20, - /* 420 */ 469, 520, 436, 522, 523, 524, 475, 476, 453, 528, - /* 430 */ 529, 251, 155, 156, 52, 313, 160, 161, 452, 163, - /* 440 */ 164, 165, 166, 167, 168, 169, 170, 171, 172, 406, - /* 450 */ 407, 175, 176, 177, 178, 179, 180, 181, 182, 402, - /* 460 */ 184, 185, 186, 406, 20, 408, 190, 191, 192, 256, - /* 470 */ 437, 194, 195, 197, 326, 327, 328, 329, 330, 331, - /* 480 */ 332, 204, 205, 302, 303, 304, 305, 306, 307, 308, - /* 490 */ 309, 310, 158, 313, 272, 174, 219, 464, 221, 2, - /* 500 */ 179, 155, 156, 226, 461, 8, 9, 173, 187, 12, - /* 510 */ 13, 14, 15, 16, 292, 293, 294, 295, 296, 297, - /* 520 */ 298, 299, 300, 301, 4, 211, 306, 307, 308, 309, - /* 530 */ 310, 254, 255, 256, 392, 258, 259, 260, 261, 262, - /* 540 */ 263, 264, 265, 266, 267, 268, 269, 270, 271, 407, - /* 550 */ 536, 274, 275, 276, 277, 278, 315, 406, 544, 282, - /* 560 */ 283, 284, 285, 286, 287, 288, 12, 13, 392, 158, - /* 570 */ 22, 407, 12, 13, 20, 196, 22, 563, 196, 437, - /* 580 */ 437, 567, 568, 407, 36, 14, 525, 526, 115, 207, - /* 590 */ 36, 20, 38, 20, 402, 453, 36, 455, 406, 456, - /* 600 */ 408, 437, 4, 130, 131, 132, 133, 134, 135, 136, - /* 610 */ 137, 138, 139, 437, 141, 142, 143, 144, 145, 146, - /* 620 */ 147, 23, 438, 439, 406, 71, 437, 506, 74, 453, - /* 630 */ 231, 455, 78, 85, 437, 406, 407, 448, 118, 85, - /* 640 */ 489, 490, 500, 446, 447, 503, 48, 49, 50, 507, - /* 650 */ 508, 509, 510, 511, 512, 341, 535, 515, 516, 517, - /* 660 */ 406, 407, 77, 115, 522, 437, 524, 411, 412, 115, - /* 670 */ 528, 529, 118, 509, 446, 447, 500, 406, 407, 503, - /* 680 */ 426, 392, 20, 507, 508, 509, 510, 511, 512, 435, - /* 690 */ 461, 515, 516, 517, 497, 498, 407, 426, 556, 0, - /* 700 */ 524, 14, 15, 16, 528, 529, 435, 489, 490, 155, - /* 710 */ 156, 406, 407, 302, 303, 304, 305, 306, 307, 308, - /* 720 */ 309, 310, 36, 8, 9, 77, 437, 12, 13, 14, - /* 730 */ 15, 16, 80, 81, 82, 406, 407, 1, 2, 87, - /* 740 */ 88, 89, 453, 129, 455, 93, 36, 36, 194, 195, - /* 750 */ 98, 99, 100, 101, 158, 289, 104, 76, 204, 205, - /* 760 */ 108, 109, 110, 111, 506, 194, 461, 219, 85, 221, - /* 770 */ 454, 455, 2, 219, 22, 221, 77, 20, 8, 9, - /* 780 */ 226, 221, 12, 13, 14, 15, 16, 440, 36, 500, - /* 790 */ 443, 406, 503, 535, 20, 85, 507, 508, 509, 510, - /* 800 */ 511, 512, 254, 255, 515, 516, 517, 389, 254, 255, - /* 810 */ 256, 392, 258, 259, 260, 261, 262, 263, 264, 265, - /* 820 */ 266, 267, 268, 269, 270, 271, 407, 256, 274, 275, - /* 830 */ 276, 277, 278, 313, 119, 392, 282, 283, 284, 285, - /* 840 */ 286, 287, 288, 289, 12, 13, 557, 558, 406, 407, - /* 850 */ 503, 466, 20, 468, 22, 119, 437, 129, 196, 22, - /* 860 */ 115, 532, 533, 534, 517, 536, 537, 115, 36, 506, - /* 870 */ 38, 189, 453, 36, 455, 130, 131, 132, 133, 134, - /* 880 */ 135, 136, 137, 138, 139, 437, 141, 142, 143, 144, - /* 890 */ 145, 146, 147, 445, 392, 214, 453, 479, 535, 303, - /* 900 */ 304, 305, 484, 71, 456, 223, 74, 221, 415, 437, - /* 910 */ 78, 62, 63, 406, 407, 23, 149, 85, 256, 500, - /* 920 */ 440, 413, 503, 242, 243, 94, 507, 508, 509, 510, - /* 930 */ 511, 512, 221, 426, 515, 516, 517, 444, 252, 253, - /* 940 */ 44, 49, 50, 524, 392, 406, 407, 115, 529, 441, - /* 950 */ 118, 440, 115, 196, 536, 453, 485, 406, 407, 407, - /* 960 */ 479, 409, 544, 252, 253, 426, 18, 71, 194, 497, - /* 970 */ 498, 23, 12, 13, 532, 533, 534, 426, 536, 537, - /* 980 */ 562, 563, 22, 503, 536, 567, 568, 155, 156, 437, - /* 990 */ 42, 43, 544, 162, 46, 392, 36, 517, 38, 411, - /* 1000 */ 412, 234, 235, 55, 0, 453, 438, 455, 60, 392, - /* 1010 */ 562, 563, 438, 256, 503, 567, 568, 536, 187, 188, - /* 1020 */ 72, 73, 74, 75, 76, 544, 194, 195, 517, 413, - /* 1030 */ 256, 71, 201, 33, 8, 9, 204, 205, 12, 13, - /* 1040 */ 14, 15, 16, 562, 563, 85, 430, 47, 567, 568, - /* 1050 */ 392, 219, 500, 221, 415, 503, 453, 441, 226, 507, - /* 1060 */ 508, 509, 510, 511, 512, 22, 118, 515, 516, 517, - /* 1070 */ 453, 420, 421, 434, 522, 115, 524, 149, 150, 36, - /* 1080 */ 528, 529, 154, 444, 479, 3, 254, 255, 256, 484, - /* 1090 */ 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - /* 1100 */ 268, 269, 270, 271, 13, 157, 274, 275, 276, 277, - /* 1110 */ 278, 453, 420, 421, 282, 283, 284, 285, 286, 287, - /* 1120 */ 288, 12, 13, 14, 406, 407, 392, 392, 85, 20, - /* 1130 */ 392, 22, 8, 9, 395, 396, 12, 13, 14, 15, - /* 1140 */ 16, 536, 150, 437, 426, 36, 154, 38, 424, 544, - /* 1150 */ 4, 445, 148, 149, 150, 151, 152, 153, 154, 211, - /* 1160 */ 212, 213, 456, 33, 216, 19, 437, 562, 563, 0, - /* 1170 */ 392, 47, 567, 568, 445, 438, 85, 229, 230, 219, - /* 1180 */ 71, 221, 428, 74, 38, 456, 432, 453, 453, 241, - /* 1190 */ 0, 453, 244, 438, 85, 247, 248, 249, 250, 251, - /* 1200 */ 432, 8, 9, 57, 438, 12, 13, 14, 15, 16, - /* 1210 */ 64, 65, 406, 407, 254, 255, 289, 71, 291, 392, - /* 1220 */ 228, 392, 438, 437, 115, 233, 33, 118, 236, 437, - /* 1230 */ 238, 453, 426, 447, 274, 275, 407, 445, 409, 33, - /* 1240 */ 406, 407, 282, 283, 284, 285, 286, 287, 456, 406, - /* 1250 */ 407, 8, 9, 406, 407, 12, 13, 14, 15, 16, - /* 1260 */ 426, 313, 494, 117, 155, 156, 437, 20, 122, 426, - /* 1270 */ 80, 81, 82, 426, 20, 0, 33, 87, 88, 89, - /* 1280 */ 453, 437, 453, 93, 455, 406, 407, 392, 98, 99, - /* 1290 */ 100, 101, 571, 392, 104, 406, 407, 437, 108, 109, - /* 1300 */ 110, 111, 0, 194, 195, 426, 406, 407, 521, 521, - /* 1310 */ 523, 523, 119, 204, 205, 426, 456, 148, 149, 150, - /* 1320 */ 151, 152, 153, 154, 22, 119, 426, 392, 219, 500, - /* 1330 */ 221, 193, 503, 13, 33, 226, 507, 508, 509, 510, - /* 1340 */ 511, 512, 498, 393, 515, 516, 517, 450, 453, 450, - /* 1350 */ 453, 522, 453, 524, 453, 392, 148, 528, 529, 392, - /* 1360 */ 152, 538, 119, 254, 255, 256, 392, 258, 259, 260, - /* 1370 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - /* 1380 */ 271, 407, 0, 274, 275, 276, 277, 278, 453, 406, - /* 1390 */ 407, 282, 283, 284, 285, 286, 287, 288, 12, 13, - /* 1400 */ 392, 406, 407, 406, 407, 85, 20, 0, 22, 426, - /* 1410 */ 272, 437, 406, 407, 392, 407, 453, 409, 336, 392, - /* 1420 */ 453, 426, 36, 426, 38, 520, 44, 453, 523, 455, - /* 1430 */ 292, 392, 426, 8, 9, 406, 407, 12, 13, 14, - /* 1440 */ 15, 16, 8, 9, 427, 437, 12, 13, 14, 15, - /* 1450 */ 16, 55, 406, 407, 437, 426, 14, 71, 406, 407, - /* 1460 */ 74, 453, 20, 455, 57, 448, 450, 406, 407, 453, - /* 1470 */ 340, 85, 426, 0, 500, 453, 465, 503, 426, 33, - /* 1480 */ 453, 507, 508, 509, 510, 511, 512, 426, 514, 515, - /* 1490 */ 516, 517, 453, 47, 129, 0, 123, 123, 392, 126, - /* 1500 */ 126, 115, 33, 256, 118, 119, 155, 156, 500, 0, - /* 1510 */ 256, 503, 13, 407, 36, 507, 508, 509, 510, 511, - /* 1520 */ 512, 246, 33, 515, 516, 517, 123, 0, 33, 126, - /* 1530 */ 522, 123, 524, 33, 126, 36, 528, 529, 0, 13, - /* 1540 */ 33, 155, 156, 437, 119, 0, 33, 560, 183, 22, - /* 1550 */ 8, 9, 33, 119, 12, 13, 14, 15, 16, 453, - /* 1560 */ 22, 455, 36, 85, 1, 2, 78, 22, 8, 9, - /* 1570 */ 12, 13, 12, 13, 14, 15, 16, 36, 8, 9, - /* 1580 */ 194, 195, 12, 13, 14, 15, 16, 553, 119, 47, - /* 1590 */ 204, 205, 8, 9, 33, 33, 12, 13, 14, 15, - /* 1600 */ 16, 33, 33, 12, 13, 219, 500, 221, 119, 503, - /* 1610 */ 33, 539, 226, 507, 508, 509, 510, 511, 512, 119, - /* 1620 */ 33, 515, 516, 517, 51, 36, 119, 410, 522, 437, - /* 1630 */ 524, 158, 119, 237, 528, 529, 12, 13, 119, 338, - /* 1640 */ 254, 255, 256, 33, 258, 259, 260, 261, 262, 263, - /* 1650 */ 264, 265, 266, 267, 268, 269, 270, 271, 33, 423, - /* 1660 */ 274, 275, 276, 277, 278, 33, 33, 158, 282, 283, - /* 1670 */ 284, 285, 286, 287, 288, 12, 13, 392, 33, 119, - /* 1680 */ 119, 119, 479, 20, 423, 22, 33, 119, 119, 119, - /* 1690 */ 33, 118, 407, 118, 409, 120, 119, 405, 273, 36, - /* 1700 */ 33, 38, 0, 119, 12, 13, 119, 8, 9, 465, - /* 1710 */ 47, 12, 13, 14, 15, 16, 12, 13, 36, 8, - /* 1720 */ 9, 559, 437, 12, 13, 14, 15, 16, 392, 119, - /* 1730 */ 12, 13, 12, 13, 71, 12, 13, 74, 453, 536, - /* 1740 */ 455, 33, 254, 407, 119, 12, 13, 544, 85, 12, - /* 1750 */ 13, 119, 119, 12, 13, 36, 13, 13, 47, 559, - /* 1760 */ 58, 559, 221, 33, 119, 562, 563, 85, 33, 33, - /* 1770 */ 567, 568, 119, 437, 478, 33, 119, 559, 115, 36, - /* 1780 */ 36, 118, 465, 501, 452, 500, 119, 410, 503, 453, - /* 1790 */ 407, 455, 507, 508, 509, 510, 511, 512, 486, 465, - /* 1800 */ 515, 516, 517, 465, 85, 543, 543, 522, 530, 524, - /* 1810 */ 221, 546, 564, 528, 529, 465, 8, 9, 155, 156, - /* 1820 */ 12, 13, 14, 15, 16, 425, 316, 119, 480, 57, - /* 1830 */ 119, 502, 20, 406, 20, 491, 500, 236, 496, 503, - /* 1840 */ 491, 415, 482, 507, 508, 509, 510, 511, 512, 119, - /* 1850 */ 415, 515, 516, 517, 119, 119, 217, 194, 195, 406, - /* 1860 */ 524, 119, 20, 407, 528, 529, 47, 204, 205, 8, - /* 1870 */ 9, 462, 407, 12, 13, 14, 15, 16, 462, 193, - /* 1880 */ 459, 406, 219, 407, 221, 406, 8, 9, 459, 226, - /* 1890 */ 12, 13, 14, 15, 16, 462, 459, 459, 116, 41, - /* 1900 */ 42, 419, 114, 406, 418, 113, 20, 406, 417, 406, - /* 1910 */ 406, 406, 52, 399, 403, 399, 20, 254, 255, 256, - /* 1920 */ 403, 258, 259, 260, 261, 262, 263, 264, 265, 266, - /* 1930 */ 267, 268, 269, 270, 271, 491, 415, 274, 275, 276, - /* 1940 */ 277, 278, 455, 479, 415, 282, 283, 284, 285, 286, - /* 1950 */ 287, 288, 12, 13, 415, 20, 408, 20, 481, 415, - /* 1960 */ 20, 408, 22, 20, 479, 415, 472, 415, 20, 415, - /* 1970 */ 415, 272, 466, 52, 392, 399, 36, 406, 38, 433, - /* 1980 */ 119, 415, 124, 125, 433, 127, 437, 395, 395, 407, - /* 1990 */ 453, 409, 406, 437, 437, 399, 437, 119, 239, 118, - /* 2000 */ 536, 437, 437, 495, 196, 392, 148, 413, 544, 437, - /* 2010 */ 152, 71, 20, 493, 74, 437, 437, 437, 437, 437, - /* 2020 */ 407, 536, 491, 490, 225, 85, 562, 563, 488, 544, - /* 2030 */ 224, 567, 568, 413, 487, 453, 453, 455, 453, 325, - /* 2040 */ 406, 324, 552, 455, 552, 333, 210, 562, 563, 551, - /* 2050 */ 437, 453, 567, 568, 480, 115, 392, 555, 118, 335, - /* 2060 */ 334, 312, 317, 473, 552, 542, 453, 549, 455, 554, - /* 2070 */ 473, 407, 550, 409, 311, 480, 541, 337, 339, 407, - /* 2080 */ 342, 20, 500, 129, 314, 503, 408, 413, 413, 507, - /* 2090 */ 508, 509, 510, 511, 512, 155, 156, 515, 516, 517, - /* 2100 */ 572, 437, 566, 473, 522, 506, 524, 453, 565, 453, - /* 2110 */ 528, 529, 453, 500, 547, 453, 503, 453, 453, 455, - /* 2120 */ 507, 508, 509, 510, 511, 512, 202, 466, 515, 516, - /* 2130 */ 517, 473, 453, 118, 194, 195, 470, 524, 413, 527, - /* 2140 */ 413, 528, 529, 453, 204, 205, 202, 545, 467, 466, - /* 2150 */ 453, 453, 118, 432, 453, 407, 453, 406, 453, 219, - /* 2160 */ 413, 221, 453, 413, 500, 413, 226, 503, 453, 453, - /* 2170 */ 442, 507, 508, 509, 510, 511, 512, 22, 394, 515, - /* 2180 */ 516, 517, 453, 35, 453, 453, 522, 453, 524, 37, - /* 2190 */ 397, 40, 528, 529, 254, 255, 256, 400, 258, 259, - /* 2200 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 2210 */ 270, 271, 399, 453, 274, 275, 276, 277, 278, 453, - /* 2220 */ 453, 453, 282, 283, 284, 285, 286, 287, 288, 12, - /* 2230 */ 13, 453, 453, 453, 453, 398, 453, 20, 453, 22, - /* 2240 */ 453, 483, 439, 474, 429, 499, 492, 474, 439, 429, - /* 2250 */ 429, 392, 414, 36, 390, 38, 0, 0, 0, 47, - /* 2260 */ 0, 36, 245, 36, 36, 245, 407, 36, 0, 36, - /* 2270 */ 36, 245, 36, 0, 0, 245, 0, 36, 0, 36, - /* 2280 */ 0, 22, 0, 36, 240, 0, 227, 0, 71, 227, - /* 2290 */ 221, 74, 228, 219, 0, 0, 437, 0, 215, 214, - /* 2300 */ 0, 0, 85, 161, 51, 51, 0, 36, 0, 0, - /* 2310 */ 0, 36, 453, 51, 455, 51, 47, 0, 57, 0, - /* 2320 */ 0, 0, 0, 0, 0, 0, 0, 12, 13, 0, - /* 2330 */ 0, 0, 115, 392, 36, 118, 179, 22, 179, 0, - /* 2340 */ 0, 0, 0, 0, 0, 0, 0, 0, 407, 0, - /* 2350 */ 0, 36, 0, 38, 0, 0, 0, 0, 0, 500, - /* 2360 */ 0, 0, 503, 51, 0, 47, 507, 508, 509, 510, - /* 2370 */ 511, 512, 155, 156, 515, 516, 517, 0, 437, 161, - /* 2380 */ 0, 522, 0, 524, 0, 0, 71, 528, 529, 0, - /* 2390 */ 0, 0, 0, 0, 453, 0, 455, 22, 0, 160, - /* 2400 */ 0, 159, 0, 0, 0, 22, 71, 0, 22, 71, - /* 2410 */ 36, 194, 195, 0, 52, 52, 0, 0, 0, 71, - /* 2420 */ 44, 204, 205, 36, 71, 57, 0, 57, 0, 57, - /* 2430 */ 36, 0, 44, 36, 0, 36, 219, 56, 221, 0, - /* 2440 */ 44, 500, 36, 226, 503, 0, 14, 33, 507, 508, - /* 2450 */ 509, 510, 511, 512, 44, 47, 515, 516, 517, 0, - /* 2460 */ 51, 0, 51, 522, 45, 524, 51, 44, 0, 528, - /* 2470 */ 529, 254, 255, 256, 0, 258, 259, 260, 261, 262, - /* 2480 */ 263, 264, 265, 266, 267, 268, 269, 270, 271, 1, - /* 2490 */ 0, 274, 275, 276, 277, 278, 44, 0, 210, 282, - /* 2500 */ 283, 284, 285, 286, 287, 288, 51, 19, 0, 51, - /* 2510 */ 0, 0, 79, 0, 0, 392, 36, 57, 0, 44, - /* 2520 */ 36, 57, 44, 0, 57, 36, 38, 44, 0, 36, - /* 2530 */ 407, 44, 0, 57, 219, 0, 221, 0, 0, 0, - /* 2540 */ 36, 53, 54, 0, 0, 57, 22, 126, 128, 0, - /* 2550 */ 0, 36, 22, 36, 66, 67, 68, 69, 36, 71, - /* 2560 */ 437, 36, 36, 36, 33, 36, 33, 252, 253, 254, - /* 2570 */ 36, 0, 36, 22, 22, 22, 453, 36, 455, 0, - /* 2580 */ 22, 36, 36, 36, 0, 22, 0, 0, 0, 274, - /* 2590 */ 275, 36, 36, 0, 0, 36, 36, 282, 283, 284, - /* 2600 */ 285, 286, 287, 0, 22, 117, 36, 59, 36, 20, - /* 2610 */ 122, 36, 0, 119, 118, 51, 118, 0, 196, 36, - /* 2620 */ 22, 392, 0, 500, 22, 196, 503, 226, 0, 202, - /* 2630 */ 507, 508, 509, 510, 511, 512, 407, 232, 515, 516, - /* 2640 */ 517, 153, 196, 0, 392, 196, 206, 222, 206, 196, - /* 2650 */ 3, 33, 318, 22, 318, 231, 36, 36, 118, 407, - /* 2660 */ 52, 119, 52, 33, 51, 33, 437, 33, 33, 33, - /* 2670 */ 51, 3, 118, 36, 33, 36, 119, 318, 36, 118, - /* 2680 */ 114, 119, 453, 118, 455, 116, 198, 36, 200, 437, - /* 2690 */ 85, 203, 569, 570, 36, 119, 208, 119, 118, 118, - /* 2700 */ 36, 36, 33, 118, 51, 453, 477, 455, 51, 119, - /* 2710 */ 118, 0, 0, 0, 119, 227, 119, 118, 44, 119, - /* 2720 */ 392, 44, 203, 119, 0, 119, 119, 118, 44, 500, - /* 2730 */ 119, 33, 503, 118, 118, 407, 507, 508, 509, 510, - /* 2740 */ 511, 512, 118, 302, 515, 516, 517, 290, 119, 2, - /* 2750 */ 22, 51, 500, 254, 51, 503, 118, 22, 118, 507, - /* 2760 */ 508, 509, 510, 511, 512, 437, 199, 515, 516, 517, - /* 2770 */ 116, 392, 199, 118, 118, 198, 0, 116, 119, 0, - /* 2780 */ 118, 453, 119, 455, 118, 118, 407, 44, 118, 118, - /* 2790 */ 118, 118, 22, 51, 119, 119, 118, 118, 118, 118, - /* 2800 */ 199, 119, 119, 118, 392, 477, 118, 120, 22, 118, - /* 2810 */ 558, 121, 118, 118, 118, 118, 437, 36, 129, 407, - /* 2820 */ 119, 36, 118, 33, 119, 36, 118, 36, 500, 119, - /* 2830 */ 36, 503, 453, 119, 455, 507, 508, 509, 510, 511, - /* 2840 */ 512, 119, 36, 515, 516, 517, 232, 36, 257, 437, - /* 2850 */ 119, 118, 118, 36, 118, 140, 477, 140, 140, 140, - /* 2860 */ 22, 79, 78, 22, 36, 453, 36, 455, 36, 392, - /* 2870 */ 36, 36, 36, 36, 112, 36, 36, 85, 36, 500, - /* 2880 */ 36, 85, 503, 112, 407, 33, 507, 508, 509, 510, - /* 2890 */ 511, 512, 392, 36, 515, 516, 517, 36, 36, 22, - /* 2900 */ 36, 36, 36, 85, 36, 36, 36, 407, 36, 36, - /* 2910 */ 22, 36, 500, 57, 437, 503, 0, 36, 44, 507, - /* 2920 */ 508, 509, 510, 511, 512, 0, 36, 515, 516, 517, - /* 2930 */ 453, 44, 455, 57, 0, 36, 57, 437, 44, 0, - /* 2940 */ 36, 57, 44, 0, 36, 0, 22, 0, 22, 0, - /* 2950 */ 36, 22, 33, 453, 36, 455, 36, 22, 21, 21, - /* 2960 */ 392, 573, 22, 22, 20, 573, 573, 573, 573, 573, - /* 2970 */ 573, 573, 573, 561, 573, 407, 573, 500, 573, 573, - /* 2980 */ 503, 573, 573, 573, 507, 508, 509, 510, 511, 512, - /* 2990 */ 573, 573, 515, 516, 517, 573, 573, 573, 573, 573, - /* 3000 */ 500, 573, 573, 503, 573, 437, 573, 507, 508, 509, - /* 3010 */ 510, 511, 512, 573, 573, 515, 516, 517, 573, 519, - /* 3020 */ 573, 453, 573, 455, 573, 392, 573, 38, 573, 573, - /* 3030 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3040 */ 407, 573, 573, 54, 573, 477, 57, 570, 573, 573, - /* 3050 */ 573, 573, 392, 573, 573, 66, 67, 68, 69, 573, - /* 3060 */ 71, 573, 573, 573, 573, 573, 573, 407, 500, 573, - /* 3070 */ 437, 503, 573, 573, 573, 507, 508, 509, 510, 511, - /* 3080 */ 512, 573, 573, 515, 516, 517, 453, 573, 455, 573, - /* 3090 */ 573, 573, 573, 573, 573, 573, 573, 437, 573, 573, - /* 3100 */ 573, 573, 573, 573, 573, 573, 117, 573, 573, 573, - /* 3110 */ 477, 122, 573, 453, 573, 455, 573, 573, 573, 573, - /* 3120 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3130 */ 573, 573, 573, 500, 573, 573, 503, 477, 392, 573, - /* 3140 */ 507, 508, 509, 510, 511, 512, 573, 573, 515, 516, - /* 3150 */ 517, 573, 573, 407, 573, 573, 573, 573, 392, 573, - /* 3160 */ 500, 573, 573, 503, 573, 573, 573, 507, 508, 509, - /* 3170 */ 510, 511, 512, 407, 573, 515, 516, 517, 189, 392, - /* 3180 */ 573, 573, 573, 437, 573, 573, 573, 198, 573, 573, - /* 3190 */ 573, 202, 203, 573, 407, 573, 573, 208, 209, 453, - /* 3200 */ 573, 455, 573, 437, 573, 573, 573, 573, 573, 573, - /* 3210 */ 573, 573, 573, 573, 573, 573, 227, 573, 573, 453, - /* 3220 */ 573, 455, 573, 477, 437, 573, 573, 573, 573, 573, - /* 3230 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3240 */ 453, 573, 455, 573, 573, 573, 500, 573, 573, 503, - /* 3250 */ 573, 573, 573, 507, 508, 509, 510, 511, 512, 573, - /* 3260 */ 573, 515, 516, 517, 573, 573, 500, 573, 573, 503, - /* 3270 */ 573, 573, 573, 507, 508, 509, 510, 511, 512, 573, - /* 3280 */ 573, 515, 516, 517, 573, 392, 573, 500, 573, 573, - /* 3290 */ 503, 573, 573, 573, 507, 508, 509, 510, 511, 512, - /* 3300 */ 407, 573, 515, 516, 517, 392, 573, 573, 573, 573, - /* 3310 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3320 */ 407, 573, 573, 573, 573, 392, 573, 573, 573, 573, - /* 3330 */ 437, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3340 */ 407, 573, 573, 573, 573, 573, 453, 573, 455, 573, - /* 3350 */ 437, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3360 */ 573, 573, 573, 573, 573, 573, 453, 573, 455, 573, - /* 3370 */ 437, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3380 */ 573, 573, 573, 573, 573, 573, 453, 573, 455, 573, - /* 3390 */ 573, 573, 573, 500, 573, 573, 503, 573, 573, 573, - /* 3400 */ 507, 508, 509, 510, 511, 512, 573, 573, 515, 516, - /* 3410 */ 517, 573, 392, 500, 573, 573, 503, 573, 573, 573, - /* 3420 */ 507, 508, 509, 510, 511, 512, 573, 407, 515, 516, - /* 3430 */ 517, 573, 573, 500, 573, 573, 503, 573, 392, 573, - /* 3440 */ 507, 508, 509, 510, 511, 512, 573, 573, 515, 516, - /* 3450 */ 517, 573, 573, 407, 573, 573, 573, 437, 573, 573, - /* 3460 */ 573, 392, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3470 */ 573, 573, 573, 453, 573, 455, 407, 573, 573, 573, - /* 3480 */ 573, 392, 573, 437, 573, 573, 573, 573, 573, 573, - /* 3490 */ 573, 573, 573, 573, 573, 573, 407, 573, 573, 453, - /* 3500 */ 573, 455, 573, 392, 573, 573, 437, 573, 573, 573, - /* 3510 */ 573, 573, 573, 573, 573, 573, 573, 573, 407, 573, - /* 3520 */ 500, 573, 453, 503, 455, 573, 437, 507, 508, 509, - /* 3530 */ 510, 511, 512, 573, 573, 515, 516, 517, 573, 573, - /* 3540 */ 573, 573, 453, 573, 455, 573, 500, 573, 437, 503, - /* 3550 */ 573, 573, 573, 507, 508, 509, 510, 511, 512, 573, - /* 3560 */ 573, 515, 516, 517, 453, 573, 455, 573, 392, 500, - /* 3570 */ 573, 573, 503, 573, 573, 573, 507, 508, 509, 510, - /* 3580 */ 511, 512, 573, 407, 515, 516, 517, 392, 573, 500, - /* 3590 */ 573, 573, 503, 573, 573, 573, 507, 508, 509, 510, - /* 3600 */ 511, 512, 407, 573, 515, 516, 517, 573, 573, 392, - /* 3610 */ 573, 500, 573, 437, 503, 573, 573, 573, 507, 508, - /* 3620 */ 509, 510, 511, 512, 407, 573, 515, 516, 517, 453, - /* 3630 */ 573, 455, 437, 573, 573, 573, 573, 573, 573, 573, - /* 3640 */ 573, 573, 573, 573, 573, 573, 573, 573, 453, 573, - /* 3650 */ 455, 573, 573, 573, 437, 573, 573, 573, 573, 573, - /* 3660 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3670 */ 453, 573, 455, 573, 392, 573, 500, 573, 573, 503, - /* 3680 */ 573, 573, 573, 507, 508, 509, 510, 511, 512, 407, - /* 3690 */ 573, 515, 516, 517, 573, 500, 573, 573, 503, 573, - /* 3700 */ 573, 573, 507, 508, 509, 510, 511, 512, 573, 573, - /* 3710 */ 515, 516, 517, 573, 573, 573, 573, 500, 573, 437, - /* 3720 */ 503, 573, 573, 392, 507, 508, 509, 510, 511, 512, - /* 3730 */ 573, 573, 515, 516, 517, 453, 573, 455, 407, 573, - /* 3740 */ 573, 573, 573, 392, 573, 573, 573, 573, 573, 573, - /* 3750 */ 573, 573, 573, 573, 573, 573, 573, 573, 407, 573, - /* 3760 */ 573, 573, 573, 392, 573, 573, 573, 573, 437, 573, - /* 3770 */ 573, 573, 573, 573, 573, 573, 573, 573, 407, 573, - /* 3780 */ 573, 573, 500, 573, 453, 503, 455, 573, 437, 507, - /* 3790 */ 508, 509, 510, 511, 512, 573, 573, 515, 516, 517, - /* 3800 */ 573, 573, 573, 573, 453, 573, 455, 573, 437, 573, - /* 3810 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3820 */ 573, 573, 573, 573, 453, 573, 455, 573, 573, 573, - /* 3830 */ 573, 500, 573, 573, 503, 573, 573, 573, 507, 508, - /* 3840 */ 509, 510, 511, 512, 573, 573, 515, 516, 517, 573, - /* 3850 */ 392, 500, 573, 573, 503, 573, 573, 573, 507, 508, - /* 3860 */ 509, 510, 511, 512, 573, 407, 515, 516, 517, 392, - /* 3870 */ 573, 500, 573, 573, 503, 573, 573, 573, 507, 508, - /* 3880 */ 509, 510, 511, 512, 407, 573, 515, 516, 517, 392, - /* 3890 */ 573, 573, 573, 573, 573, 437, 573, 573, 573, 573, - /* 3900 */ 573, 573, 573, 573, 407, 573, 573, 573, 573, 573, - /* 3910 */ 573, 453, 573, 455, 437, 573, 573, 573, 573, 573, - /* 3920 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3930 */ 453, 573, 455, 573, 437, 573, 573, 573, 573, 573, - /* 3940 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 3950 */ 453, 573, 455, 573, 573, 573, 392, 573, 500, 573, - /* 3960 */ 573, 503, 573, 573, 573, 507, 508, 509, 510, 511, - /* 3970 */ 512, 407, 573, 515, 516, 517, 392, 500, 573, 573, - /* 3980 */ 503, 573, 573, 573, 507, 508, 509, 510, 511, 512, - /* 3990 */ 573, 407, 515, 516, 517, 392, 573, 500, 573, 573, - /* 4000 */ 503, 437, 573, 573, 507, 508, 509, 510, 511, 512, - /* 4010 */ 407, 573, 515, 516, 517, 573, 573, 453, 573, 455, - /* 4020 */ 573, 437, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4030 */ 573, 573, 573, 573, 573, 573, 573, 453, 573, 455, - /* 4040 */ 437, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4050 */ 573, 573, 573, 573, 573, 573, 453, 573, 455, 573, - /* 4060 */ 573, 573, 573, 392, 500, 573, 573, 503, 573, 573, - /* 4070 */ 573, 507, 508, 509, 510, 511, 512, 573, 407, 515, - /* 4080 */ 516, 517, 392, 573, 500, 573, 573, 503, 573, 573, - /* 4090 */ 573, 507, 508, 509, 510, 511, 512, 407, 573, 515, - /* 4100 */ 516, 517, 573, 500, 573, 573, 503, 573, 437, 573, - /* 4110 */ 507, 508, 509, 510, 511, 512, 573, 573, 515, 516, - /* 4120 */ 517, 573, 573, 573, 453, 573, 455, 437, 573, 573, - /* 4130 */ 573, 392, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4140 */ 573, 573, 573, 453, 573, 455, 407, 573, 573, 573, - /* 4150 */ 573, 392, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4160 */ 573, 573, 573, 573, 573, 573, 407, 573, 573, 573, - /* 4170 */ 573, 500, 573, 573, 503, 573, 437, 573, 507, 508, - /* 4180 */ 509, 510, 511, 512, 573, 573, 515, 516, 517, 573, - /* 4190 */ 500, 573, 453, 503, 455, 573, 437, 507, 508, 509, - /* 4200 */ 510, 511, 512, 573, 573, 515, 516, 517, 573, 573, - /* 4210 */ 573, 573, 453, 573, 455, 573, 573, 573, 573, 392, - /* 4220 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4230 */ 573, 573, 573, 573, 407, 573, 573, 573, 573, 500, - /* 4240 */ 573, 573, 503, 392, 573, 573, 507, 508, 509, 510, - /* 4250 */ 511, 512, 573, 573, 515, 516, 517, 573, 407, 500, - /* 4260 */ 573, 573, 503, 573, 437, 573, 507, 508, 509, 510, - /* 4270 */ 511, 512, 573, 573, 515, 516, 517, 573, 573, 573, - /* 4280 */ 453, 573, 455, 573, 573, 573, 573, 573, 437, 573, - /* 4290 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4300 */ 573, 573, 573, 573, 453, 573, 455, 573, 573, 573, - /* 4310 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4320 */ 573, 573, 573, 573, 573, 392, 573, 500, 573, 573, - /* 4330 */ 503, 573, 573, 573, 507, 508, 509, 510, 511, 512, - /* 4340 */ 407, 573, 515, 516, 517, 573, 573, 573, 573, 392, - /* 4350 */ 573, 500, 573, 573, 503, 573, 573, 573, 507, 508, - /* 4360 */ 509, 510, 511, 512, 407, 573, 515, 516, 517, 573, - /* 4370 */ 437, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4380 */ 573, 573, 573, 573, 573, 573, 453, 573, 455, 573, - /* 4390 */ 573, 573, 573, 573, 437, 573, 573, 573, 573, 573, - /* 4400 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4410 */ 453, 573, 455, 573, 573, 573, 573, 573, 573, 573, - /* 4420 */ 573, 573, 573, 573, 573, 573, 573, 573, 573, 573, - /* 4430 */ 573, 573, 573, 500, 573, 573, 503, 573, 573, 573, - /* 4440 */ 507, 508, 509, 510, 511, 512, 573, 573, 515, 516, - /* 4450 */ 517, 573, 573, 573, 573, 573, 573, 500, 573, 573, - /* 4460 */ 503, 573, 573, 573, 507, 508, 509, 510, 511, 512, - /* 4470 */ 573, 573, 515, 516, 517, 389, 389, 389, 389, 389, - /* 4480 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4490 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4500 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4510 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4520 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4530 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4540 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4550 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4560 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4570 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4580 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4590 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4600 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4610 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4620 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4630 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4640 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4650 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4660 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4670 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4680 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4690 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4700 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4710 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4720 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4730 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4740 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4750 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4760 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4770 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4780 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4790 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4800 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4810 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4820 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4830 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4840 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4850 */ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, - /* 4860 */ 389, 389, 389, 389, + /* 140 */ 101, 102, 103, 104, 105, 106, 107, 108, 494, 401, + /* 150 */ 529, 497, 152, 153, 530, 501, 502, 503, 504, 505, + /* 160 */ 506, 407, 538, 509, 510, 511, 116, 530, 430, 497, + /* 170 */ 516, 20, 518, 68, 112, 538, 522, 523, 115, 431, + /* 180 */ 556, 557, 386, 511, 446, 561, 562, 121, 122, 435, + /* 190 */ 124, 191, 192, 556, 557, 431, 542, 401, 561, 562, + /* 200 */ 44, 201, 202, 439, 550, 526, 527, 528, 171, 530, + /* 210 */ 531, 145, 20, 176, 450, 149, 216, 538, 218, 114, + /* 220 */ 20, 184, 407, 223, 119, 8, 9, 431, 21, 12, + /* 230 */ 13, 14, 15, 16, 422, 556, 557, 20, 426, 424, + /* 240 */ 561, 562, 400, 447, 37, 449, 39, 40, 41, 42, + /* 250 */ 435, 503, 252, 253, 254, 4, 256, 257, 258, 259, + /* 260 */ 260, 261, 262, 263, 264, 265, 266, 400, 401, 269, + /* 270 */ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + /* 280 */ 280, 281, 282, 283, 12, 13, 14, 420, 386, 20, + /* 290 */ 494, 186, 20, 497, 22, 218, 429, 501, 502, 503, + /* 300 */ 504, 505, 506, 401, 36, 509, 510, 511, 36, 449, + /* 310 */ 38, 155, 516, 432, 518, 115, 8, 9, 522, 523, + /* 320 */ 12, 13, 14, 15, 16, 483, 484, 386, 400, 469, + /* 330 */ 470, 8, 9, 431, 115, 12, 13, 14, 15, 16, + /* 340 */ 68, 20, 401, 71, 152, 153, 550, 75, 254, 447, + /* 350 */ 82, 449, 400, 401, 82, 21, 400, 401, 24, 25, + /* 360 */ 26, 27, 28, 29, 30, 31, 32, 12, 13, 20, + /* 370 */ 530, 308, 431, 155, 493, 20, 420, 22, 538, 451, + /* 380 */ 452, 431, 454, 75, 112, 457, 117, 115, 447, 439, + /* 390 */ 449, 36, 190, 38, 432, 433, 494, 557, 20, 497, + /* 400 */ 450, 561, 562, 501, 502, 503, 504, 505, 506, 507, + /* 410 */ 193, 509, 510, 511, 512, 513, 145, 146, 147, 148, + /* 420 */ 149, 150, 151, 68, 152, 153, 71, 20, 434, 22, + /* 430 */ 75, 400, 401, 125, 215, 494, 217, 82, 497, 116, + /* 440 */ 448, 449, 501, 502, 503, 504, 505, 506, 36, 155, + /* 450 */ 509, 510, 511, 297, 298, 299, 300, 301, 302, 303, + /* 460 */ 304, 305, 115, 191, 192, 58, 0, 112, 249, 267, + /* 470 */ 115, 254, 44, 201, 202, 14, 74, 525, 526, 527, + /* 480 */ 528, 20, 530, 531, 400, 401, 455, 36, 216, 287, + /* 490 */ 218, 497, 551, 552, 252, 223, 68, 54, 190, 301, + /* 500 */ 302, 303, 304, 305, 420, 511, 63, 152, 153, 66, + /* 510 */ 67, 20, 532, 429, 534, 297, 298, 299, 300, 301, + /* 520 */ 302, 303, 304, 305, 252, 253, 254, 308, 256, 257, + /* 530 */ 258, 259, 260, 261, 262, 263, 264, 265, 266, 196, + /* 540 */ 74, 269, 270, 271, 272, 273, 191, 192, 74, 277, + /* 550 */ 278, 279, 280, 281, 282, 283, 201, 202, 0, 20, + /* 560 */ 449, 310, 320, 321, 322, 323, 324, 325, 326, 191, + /* 570 */ 192, 216, 115, 218, 463, 267, 59, 60, 223, 431, + /* 580 */ 469, 470, 24, 25, 26, 27, 28, 29, 30, 31, + /* 590 */ 32, 268, 298, 299, 300, 287, 288, 289, 290, 291, + /* 600 */ 292, 293, 294, 295, 296, 3, 458, 252, 253, 254, + /* 610 */ 126, 256, 257, 258, 259, 260, 261, 262, 263, 264, + /* 620 */ 265, 266, 20, 20, 269, 270, 271, 272, 273, 20, + /* 630 */ 218, 22, 277, 278, 279, 280, 281, 282, 283, 284, + /* 640 */ 12, 13, 145, 152, 153, 36, 149, 400, 20, 73, + /* 650 */ 22, 284, 191, 386, 115, 308, 112, 314, 315, 316, + /* 660 */ 317, 417, 250, 251, 36, 20, 38, 58, 401, 218, + /* 670 */ 403, 127, 128, 129, 130, 131, 132, 133, 134, 135, + /* 680 */ 136, 431, 138, 139, 140, 141, 142, 143, 144, 386, + /* 690 */ 82, 447, 201, 202, 20, 385, 68, 387, 431, 71, + /* 700 */ 450, 250, 251, 75, 401, 12, 13, 14, 15, 16, + /* 710 */ 82, 431, 465, 466, 447, 254, 449, 34, 116, 439, + /* 720 */ 284, 417, 286, 12, 13, 14, 400, 530, 400, 401, + /* 730 */ 450, 20, 396, 22, 431, 538, 400, 431, 402, 14, + /* 740 */ 112, 497, 498, 115, 515, 20, 517, 36, 420, 38, + /* 750 */ 447, 447, 449, 556, 557, 511, 450, 126, 561, 562, + /* 760 */ 115, 494, 147, 431, 497, 308, 151, 530, 501, 502, + /* 770 */ 503, 504, 505, 506, 442, 538, 509, 510, 511, 68, + /* 780 */ 152, 153, 71, 516, 33, 518, 460, 211, 462, 522, + /* 790 */ 523, 400, 401, 82, 557, 193, 193, 494, 561, 562, + /* 800 */ 497, 497, 498, 499, 501, 502, 503, 504, 505, 506, + /* 810 */ 530, 420, 509, 510, 511, 511, 240, 241, 538, 191, + /* 820 */ 192, 445, 0, 112, 448, 449, 115, 8, 9, 201, + /* 830 */ 202, 12, 13, 14, 15, 16, 556, 557, 146, 147, + /* 840 */ 225, 561, 562, 151, 216, 230, 218, 308, 233, 400, + /* 850 */ 235, 223, 421, 8, 9, 33, 386, 12, 13, 14, + /* 860 */ 15, 16, 431, 152, 153, 191, 563, 564, 434, 22, + /* 870 */ 8, 9, 52, 442, 12, 13, 14, 15, 16, 432, + /* 880 */ 252, 253, 254, 36, 256, 257, 258, 259, 260, 261, + /* 890 */ 262, 263, 264, 265, 266, 400, 401, 269, 270, 271, + /* 900 */ 272, 273, 191, 192, 432, 277, 278, 279, 280, 281, + /* 910 */ 282, 283, 201, 202, 0, 420, 191, 447, 8, 9, + /* 920 */ 112, 20, 12, 13, 14, 15, 16, 216, 254, 218, + /* 930 */ 146, 497, 483, 484, 223, 127, 128, 129, 130, 131, + /* 940 */ 132, 133, 134, 135, 136, 511, 138, 139, 140, 141, + /* 950 */ 142, 143, 144, 308, 400, 401, 396, 47, 44, 112, + /* 960 */ 400, 116, 402, 252, 253, 254, 4, 256, 257, 258, + /* 970 */ 259, 260, 261, 262, 263, 264, 265, 266, 116, 254, + /* 980 */ 269, 270, 271, 272, 273, 23, 400, 401, 277, 278, + /* 990 */ 279, 280, 281, 282, 283, 12, 13, 515, 91, 517, + /* 1000 */ 22, 431, 386, 20, 68, 22, 420, 23, 386, 386, + /* 1010 */ 48, 49, 50, 193, 36, 231, 232, 400, 401, 36, + /* 1020 */ 432, 38, 431, 401, 204, 403, 116, 208, 77, 78, + /* 1030 */ 79, 440, 441, 49, 50, 84, 85, 86, 14, 15, + /* 1040 */ 16, 90, 0, 3, 400, 401, 95, 96, 97, 98, + /* 1050 */ 386, 68, 101, 431, 71, 119, 105, 106, 107, 108, + /* 1060 */ 82, 491, 492, 447, 420, 82, 159, 400, 401, 447, + /* 1070 */ 447, 449, 455, 400, 401, 432, 400, 401, 12, 13, + /* 1080 */ 526, 527, 528, 332, 530, 531, 20, 420, 22, 409, + /* 1090 */ 112, 184, 185, 420, 193, 112, 420, 431, 115, 116, + /* 1100 */ 400, 401, 36, 22, 38, 198, 386, 4, 428, 400, + /* 1110 */ 401, 447, 386, 47, 13, 479, 494, 36, 438, 497, + /* 1120 */ 420, 386, 19, 501, 502, 503, 504, 505, 506, 420, + /* 1130 */ 432, 509, 510, 511, 68, 152, 153, 71, 516, 20, + /* 1140 */ 518, 38, 400, 401, 522, 523, 400, 401, 82, 400, + /* 1150 */ 401, 0, 400, 401, 335, 254, 432, 54, 492, 400, + /* 1160 */ 401, 0, 420, 82, 61, 62, 420, 447, 386, 420, + /* 1170 */ 431, 68, 420, 447, 191, 192, 421, 386, 112, 420, + /* 1180 */ 441, 115, 447, 82, 201, 202, 431, 145, 146, 147, + /* 1190 */ 148, 149, 150, 151, 216, 416, 218, 442, 419, 216, + /* 1200 */ 13, 218, 0, 8, 9, 20, 223, 12, 13, 14, + /* 1210 */ 15, 16, 400, 401, 400, 401, 0, 114, 152, 153, + /* 1220 */ 8, 9, 119, 36, 12, 13, 14, 15, 16, 447, + /* 1230 */ 252, 253, 420, 418, 420, 252, 253, 254, 447, 256, + /* 1240 */ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + /* 1250 */ 1, 2, 269, 270, 271, 272, 273, 191, 192, 47, + /* 1260 */ 277, 278, 279, 280, 281, 282, 283, 201, 202, 8, + /* 1270 */ 9, 400, 401, 12, 13, 14, 15, 16, 387, 77, + /* 1280 */ 78, 79, 216, 20, 218, 409, 84, 85, 86, 223, + /* 1290 */ 33, 420, 90, 400, 401, 400, 401, 95, 96, 97, + /* 1300 */ 98, 405, 406, 101, 47, 386, 155, 105, 106, 107, + /* 1310 */ 108, 116, 193, 420, 438, 420, 405, 406, 252, 253, + /* 1320 */ 254, 170, 256, 257, 258, 259, 260, 261, 262, 263, + /* 1330 */ 264, 265, 266, 431, 459, 269, 270, 271, 272, 273, + /* 1340 */ 500, 439, 386, 277, 278, 279, 280, 281, 282, 283, + /* 1350 */ 12, 13, 450, 414, 415, 414, 415, 186, 20, 38, + /* 1360 */ 22, 444, 532, 386, 447, 116, 447, 386, 500, 529, + /* 1370 */ 330, 155, 473, 254, 36, 54, 38, 116, 401, 514, + /* 1380 */ 403, 386, 517, 386, 63, 64, 65, 66, 2, 68, + /* 1390 */ 386, 220, 36, 386, 8, 9, 13, 529, 12, 13, + /* 1400 */ 14, 15, 16, 447, 2, 244, 68, 33, 431, 71, + /* 1410 */ 8, 9, 386, 431, 12, 13, 14, 15, 16, 14, + /* 1420 */ 82, 47, 400, 401, 447, 20, 449, 20, 447, 530, + /* 1430 */ 389, 390, 450, 12, 13, 114, 386, 538, 82, 254, + /* 1440 */ 119, 20, 447, 22, 447, 386, 444, 565, 33, 447, + /* 1450 */ 112, 447, 33, 115, 447, 556, 557, 36, 473, 38, + /* 1460 */ 561, 562, 8, 9, 75, 82, 12, 13, 14, 15, + /* 1470 */ 16, 494, 444, 447, 497, 447, 33, 33, 501, 502, + /* 1480 */ 503, 504, 505, 506, 126, 33, 509, 510, 511, 68, + /* 1490 */ 152, 153, 71, 516, 234, 518, 236, 447, 120, 522, + /* 1500 */ 523, 123, 13, 82, 8, 9, 447, 186, 12, 13, + /* 1510 */ 14, 15, 16, 152, 153, 530, 195, 254, 36, 120, + /* 1520 */ 199, 200, 123, 538, 554, 36, 205, 206, 404, 191, + /* 1530 */ 192, 116, 120, 112, 120, 123, 115, 123, 180, 201, + /* 1540 */ 202, 556, 557, 47, 0, 224, 561, 562, 526, 527, + /* 1550 */ 528, 33, 530, 531, 216, 33, 218, 33, 13, 116, + /* 1560 */ 116, 223, 1, 2, 82, 33, 22, 0, 116, 533, + /* 1570 */ 116, 431, 33, 152, 153, 33, 33, 36, 51, 8, + /* 1580 */ 9, 36, 33, 12, 13, 14, 15, 16, 0, 22, + /* 1590 */ 252, 253, 254, 33, 256, 257, 258, 259, 260, 261, + /* 1600 */ 262, 263, 264, 265, 266, 0, 33, 269, 270, 271, + /* 1610 */ 272, 273, 191, 192, 0, 277, 278, 279, 280, 281, + /* 1620 */ 282, 283, 201, 202, 8, 9, 36, 22, 12, 13, + /* 1630 */ 14, 15, 16, 33, 116, 228, 22, 216, 116, 218, + /* 1640 */ 116, 252, 115, 33, 223, 33, 8, 9, 116, 547, + /* 1650 */ 12, 13, 14, 15, 16, 116, 8, 9, 116, 116, + /* 1660 */ 12, 13, 14, 15, 16, 116, 12, 13, 417, 33, + /* 1670 */ 12, 13, 33, 252, 253, 254, 116, 256, 257, 258, + /* 1680 */ 259, 260, 261, 262, 263, 264, 265, 266, 33, 116, + /* 1690 */ 269, 270, 271, 272, 273, 12, 13, 13, 277, 278, + /* 1700 */ 279, 280, 281, 282, 283, 18, 386, 20, 12, 13, + /* 1710 */ 33, 12, 13, 33, 27, 473, 116, 30, 12, 13, + /* 1720 */ 36, 401, 18, 33, 33, 38, 116, 23, 116, 12, + /* 1730 */ 13, 417, 116, 145, 146, 147, 148, 149, 150, 151, + /* 1740 */ 115, 54, 117, 56, 33, 33, 42, 43, 61, 62, + /* 1750 */ 46, 431, 116, 334, 116, 116, 12, 13, 399, 218, + /* 1760 */ 73, 57, 12, 13, 193, 12, 13, 447, 459, 449, + /* 1770 */ 36, 116, 530, 69, 70, 71, 72, 73, 12, 13, + /* 1780 */ 538, 553, 553, 553, 472, 553, 459, 495, 404, 401, + /* 1790 */ 446, 480, 459, 116, 459, 537, 116, 558, 556, 557, + /* 1800 */ 524, 114, 537, 561, 562, 459, 116, 116, 218, 540, + /* 1810 */ 419, 311, 54, 126, 494, 474, 82, 497, 496, 115, + /* 1820 */ 20, 501, 502, 503, 504, 505, 506, 116, 116, 509, + /* 1830 */ 510, 511, 400, 20, 514, 485, 516, 517, 518, 233, + /* 1840 */ 409, 490, 522, 523, 157, 158, 409, 160, 161, 162, + /* 1850 */ 163, 164, 165, 166, 167, 168, 169, 485, 154, 172, + /* 1860 */ 173, 174, 175, 176, 177, 178, 179, 214, 181, 182, + /* 1870 */ 183, 476, 400, 386, 187, 188, 189, 20, 401, 47, + /* 1880 */ 456, 194, 401, 456, 190, 400, 453, 401, 401, 113, + /* 1890 */ 403, 400, 456, 453, 453, 453, 413, 111, 400, 400, + /* 1900 */ 412, 110, 400, 411, 400, 400, 20, 393, 52, 397, + /* 1910 */ 393, 485, 208, 209, 210, 267, 397, 213, 431, 409, + /* 1920 */ 409, 20, 449, 20, 409, 402, 20, 402, 475, 409, + /* 1930 */ 226, 227, 20, 466, 447, 409, 449, 409, 20, 460, + /* 1940 */ 409, 386, 409, 239, 52, 409, 242, 400, 427, 245, + /* 1950 */ 246, 247, 248, 249, 389, 393, 401, 427, 403, 400, + /* 1960 */ 431, 389, 393, 447, 237, 431, 431, 489, 431, 431, + /* 1970 */ 115, 431, 20, 407, 222, 485, 221, 431, 484, 386, + /* 1980 */ 487, 494, 431, 431, 497, 431, 431, 431, 501, 502, + /* 1990 */ 503, 504, 505, 506, 401, 447, 509, 510, 511, 407, + /* 2000 */ 447, 400, 447, 516, 449, 518, 386, 449, 319, 522, + /* 2010 */ 523, 447, 308, 318, 546, 546, 207, 312, 548, 327, + /* 2020 */ 549, 401, 546, 403, 431, 545, 329, 543, 328, 307, + /* 2030 */ 306, 566, 482, 536, 336, 467, 535, 474, 481, 544, + /* 2040 */ 447, 467, 449, 333, 474, 331, 401, 20, 126, 494, + /* 2050 */ 541, 431, 497, 402, 309, 447, 501, 502, 503, 504, + /* 2060 */ 505, 506, 12, 13, 509, 510, 511, 447, 560, 449, + /* 2070 */ 407, 516, 22, 518, 386, 407, 500, 522, 523, 447, + /* 2080 */ 467, 447, 447, 199, 467, 464, 36, 494, 38, 401, + /* 2090 */ 497, 447, 407, 447, 501, 502, 503, 504, 505, 506, + /* 2100 */ 460, 115, 509, 510, 511, 521, 447, 199, 407, 516, + /* 2110 */ 461, 518, 386, 447, 494, 522, 523, 497, 68, 431, + /* 2120 */ 539, 501, 502, 503, 504, 505, 506, 401, 407, 509, + /* 2130 */ 510, 511, 82, 460, 559, 447, 516, 449, 518, 12, + /* 2140 */ 13, 426, 522, 523, 407, 115, 22, 401, 400, 22, + /* 2150 */ 447, 388, 436, 35, 447, 447, 386, 431, 407, 391, + /* 2160 */ 447, 392, 112, 36, 393, 38, 447, 447, 37, 40, + /* 2170 */ 447, 401, 447, 447, 394, 449, 447, 447, 447, 447, + /* 2180 */ 447, 408, 494, 447, 0, 497, 447, 447, 447, 501, + /* 2190 */ 502, 503, 504, 505, 506, 68, 447, 509, 510, 511, + /* 2200 */ 433, 431, 493, 447, 516, 477, 518, 447, 447, 447, + /* 2210 */ 522, 523, 423, 423, 433, 468, 423, 447, 384, 449, + /* 2220 */ 494, 486, 468, 497, 0, 0, 47, 501, 502, 503, + /* 2230 */ 504, 505, 506, 0, 36, 509, 510, 511, 386, 243, + /* 2240 */ 36, 36, 516, 36, 518, 243, 0, 36, 522, 523, + /* 2250 */ 36, 243, 36, 401, 0, 0, 243, 0, 36, 0, + /* 2260 */ 0, 22, 36, 0, 494, 36, 216, 497, 218, 238, + /* 2270 */ 0, 501, 502, 503, 504, 505, 506, 224, 0, 509, + /* 2280 */ 510, 511, 224, 431, 225, 218, 216, 0, 518, 212, + /* 2290 */ 211, 0, 522, 523, 0, 0, 0, 158, 51, 447, + /* 2300 */ 51, 449, 252, 253, 0, 36, 0, 0, 36, 0, + /* 2310 */ 54, 0, 51, 47, 0, 0, 0, 0, 51, 269, + /* 2320 */ 270, 386, 0, 0, 0, 0, 0, 277, 278, 279, + /* 2330 */ 280, 281, 282, 176, 36, 0, 401, 176, 0, 0, + /* 2340 */ 0, 0, 0, 216, 0, 218, 494, 0, 0, 497, + /* 2350 */ 0, 0, 0, 501, 502, 503, 504, 505, 506, 0, + /* 2360 */ 0, 509, 510, 511, 0, 0, 431, 0, 0, 0, + /* 2370 */ 518, 0, 0, 0, 522, 523, 0, 250, 251, 252, + /* 2380 */ 51, 47, 447, 0, 449, 0, 0, 0, 0, 0, + /* 2390 */ 0, 0, 22, 0, 158, 0, 269, 270, 157, 0, + /* 2400 */ 156, 0, 0, 22, 277, 278, 279, 280, 281, 282, + /* 2410 */ 386, 0, 0, 52, 22, 52, 36, 68, 0, 0, + /* 2420 */ 0, 68, 0, 68, 68, 401, 44, 0, 54, 494, + /* 2430 */ 36, 1, 497, 36, 0, 0, 501, 502, 503, 504, + /* 2440 */ 505, 506, 44, 36, 509, 510, 511, 386, 44, 19, + /* 2450 */ 54, 36, 0, 518, 54, 431, 47, 522, 523, 33, + /* 2460 */ 44, 51, 401, 14, 51, 51, 0, 44, 38, 45, + /* 2470 */ 0, 447, 0, 449, 0, 386, 0, 44, 207, 0, + /* 2480 */ 51, 0, 51, 53, 54, 0, 0, 0, 0, 36, + /* 2490 */ 401, 54, 431, 63, 64, 65, 66, 76, 68, 44, + /* 2500 */ 0, 36, 54, 44, 0, 36, 44, 0, 447, 36, + /* 2510 */ 449, 54, 54, 0, 0, 44, 0, 0, 494, 0, + /* 2520 */ 431, 497, 0, 0, 22, 501, 502, 503, 504, 505, + /* 2530 */ 506, 125, 22, 509, 510, 511, 447, 36, 449, 36, + /* 2540 */ 123, 36, 518, 0, 114, 36, 0, 523, 36, 119, + /* 2550 */ 22, 36, 22, 22, 36, 494, 36, 33, 497, 33, + /* 2560 */ 471, 36, 501, 502, 503, 504, 505, 506, 36, 508, + /* 2570 */ 509, 510, 511, 36, 36, 36, 0, 22, 0, 22, + /* 2580 */ 150, 386, 0, 494, 36, 56, 497, 0, 0, 36, + /* 2590 */ 501, 502, 503, 504, 505, 506, 401, 0, 509, 510, + /* 2600 */ 511, 36, 0, 36, 0, 22, 386, 36, 36, 20, + /* 2610 */ 36, 116, 115, 0, 115, 51, 0, 36, 193, 0, + /* 2620 */ 22, 401, 22, 0, 0, 195, 431, 197, 3, 193, + /* 2630 */ 200, 223, 229, 228, 193, 205, 193, 199, 193, 33, + /* 2640 */ 313, 36, 447, 203, 449, 203, 36, 219, 115, 313, + /* 2650 */ 116, 431, 116, 52, 224, 115, 115, 113, 111, 52, + /* 2660 */ 33, 116, 33, 33, 33, 116, 115, 447, 116, 449, + /* 2670 */ 116, 115, 51, 115, 115, 386, 82, 51, 33, 36, + /* 2680 */ 3, 115, 33, 36, 116, 116, 36, 36, 36, 494, + /* 2690 */ 401, 471, 497, 36, 36, 116, 501, 502, 503, 504, + /* 2700 */ 505, 506, 116, 33, 509, 510, 511, 51, 0, 0, + /* 2710 */ 51, 115, 44, 0, 494, 116, 44, 497, 386, 116, + /* 2720 */ 431, 501, 502, 503, 504, 505, 506, 115, 0, 509, + /* 2730 */ 510, 511, 115, 401, 116, 115, 447, 115, 449, 44, + /* 2740 */ 386, 297, 200, 33, 2, 313, 196, 552, 113, 285, + /* 2750 */ 113, 22, 116, 115, 115, 401, 196, 195, 252, 115, + /* 2760 */ 471, 386, 116, 431, 116, 51, 51, 22, 115, 115, + /* 2770 */ 0, 196, 0, 22, 44, 115, 401, 115, 115, 447, + /* 2780 */ 115, 449, 115, 494, 115, 431, 497, 116, 115, 115, + /* 2790 */ 501, 502, 503, 504, 505, 506, 115, 115, 509, 510, + /* 2800 */ 511, 447, 116, 449, 115, 117, 431, 115, 118, 51, + /* 2810 */ 116, 115, 115, 115, 115, 22, 255, 126, 116, 229, + /* 2820 */ 36, 36, 447, 116, 449, 36, 494, 115, 36, 497, + /* 2830 */ 36, 115, 36, 501, 502, 503, 504, 505, 506, 116, + /* 2840 */ 116, 509, 510, 511, 36, 33, 36, 116, 494, 116, + /* 2850 */ 115, 497, 115, 115, 137, 501, 502, 503, 504, 505, + /* 2860 */ 506, 22, 137, 509, 510, 511, 76, 22, 36, 494, + /* 2870 */ 75, 137, 497, 137, 36, 109, 501, 502, 503, 504, + /* 2880 */ 505, 506, 386, 36, 509, 510, 511, 555, 513, 36, + /* 2890 */ 36, 36, 36, 36, 36, 36, 36, 401, 82, 82, + /* 2900 */ 109, 33, 36, 36, 22, 36, 36, 386, 36, 82, + /* 2910 */ 36, 36, 36, 36, 36, 36, 22, 36, 564, 0, + /* 2920 */ 36, 0, 401, 36, 44, 54, 0, 431, 36, 44, + /* 2930 */ 0, 36, 44, 44, 0, 36, 0, 54, 22, 36, + /* 2940 */ 54, 0, 22, 447, 54, 449, 33, 36, 36, 386, + /* 2950 */ 22, 22, 431, 21, 567, 22, 21, 20, 567, 567, + /* 2960 */ 567, 567, 567, 567, 401, 567, 567, 471, 447, 567, + /* 2970 */ 449, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 2980 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 2990 */ 494, 567, 471, 497, 431, 567, 567, 501, 502, 503, + /* 3000 */ 504, 505, 506, 567, 567, 509, 510, 511, 567, 567, + /* 3010 */ 447, 567, 449, 567, 386, 494, 567, 567, 497, 567, + /* 3020 */ 567, 567, 501, 502, 503, 504, 505, 506, 567, 401, + /* 3030 */ 509, 510, 511, 567, 471, 567, 567, 567, 567, 567, + /* 3040 */ 567, 386, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3050 */ 567, 567, 567, 567, 567, 567, 401, 494, 567, 431, + /* 3060 */ 497, 567, 567, 567, 501, 502, 503, 504, 505, 506, + /* 3070 */ 567, 567, 509, 510, 511, 447, 567, 449, 567, 386, + /* 3080 */ 567, 567, 567, 567, 567, 567, 431, 567, 567, 567, + /* 3090 */ 567, 567, 567, 567, 401, 567, 567, 567, 567, 471, + /* 3100 */ 567, 567, 447, 567, 449, 567, 567, 567, 386, 567, + /* 3110 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3120 */ 567, 567, 494, 401, 431, 497, 567, 567, 567, 501, + /* 3130 */ 502, 503, 504, 505, 506, 567, 567, 509, 510, 511, + /* 3140 */ 447, 567, 449, 567, 567, 567, 567, 386, 567, 494, + /* 3150 */ 567, 567, 497, 431, 567, 567, 501, 502, 503, 504, + /* 3160 */ 505, 506, 401, 567, 509, 510, 511, 567, 567, 447, + /* 3170 */ 567, 449, 567, 386, 567, 567, 567, 567, 567, 567, + /* 3180 */ 567, 567, 567, 567, 567, 567, 567, 494, 401, 567, + /* 3190 */ 497, 567, 431, 567, 501, 502, 503, 504, 505, 506, + /* 3200 */ 567, 567, 509, 510, 511, 567, 567, 567, 447, 567, + /* 3210 */ 449, 567, 567, 567, 567, 567, 494, 567, 431, 497, + /* 3220 */ 567, 567, 567, 501, 502, 503, 504, 505, 506, 567, + /* 3230 */ 567, 509, 510, 511, 447, 567, 449, 567, 386, 567, + /* 3240 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3250 */ 567, 567, 567, 401, 567, 494, 567, 567, 497, 386, + /* 3260 */ 567, 567, 501, 502, 503, 504, 505, 506, 567, 567, + /* 3270 */ 509, 510, 511, 567, 401, 567, 567, 567, 567, 567, + /* 3280 */ 567, 494, 567, 431, 497, 567, 567, 567, 501, 502, + /* 3290 */ 503, 504, 505, 506, 567, 567, 509, 510, 511, 447, + /* 3300 */ 567, 449, 567, 567, 431, 567, 567, 567, 567, 567, + /* 3310 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3320 */ 447, 567, 449, 567, 567, 567, 567, 567, 567, 567, + /* 3330 */ 567, 567, 567, 567, 567, 567, 386, 567, 567, 567, + /* 3340 */ 567, 567, 567, 567, 567, 567, 494, 567, 567, 497, + /* 3350 */ 567, 401, 567, 501, 502, 503, 504, 505, 506, 567, + /* 3360 */ 567, 509, 510, 511, 567, 567, 567, 494, 567, 567, + /* 3370 */ 497, 567, 567, 567, 501, 502, 503, 504, 505, 506, + /* 3380 */ 386, 431, 509, 510, 511, 567, 567, 567, 567, 567, + /* 3390 */ 567, 567, 567, 567, 567, 401, 567, 447, 567, 449, + /* 3400 */ 567, 386, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3410 */ 567, 567, 567, 567, 567, 567, 401, 567, 567, 567, + /* 3420 */ 567, 386, 567, 567, 567, 431, 567, 567, 567, 567, + /* 3430 */ 567, 567, 567, 567, 567, 567, 401, 567, 567, 567, + /* 3440 */ 567, 447, 567, 449, 494, 567, 431, 497, 567, 567, + /* 3450 */ 567, 501, 502, 503, 504, 505, 506, 567, 567, 509, + /* 3460 */ 510, 511, 447, 567, 449, 567, 431, 567, 567, 567, + /* 3470 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3480 */ 567, 567, 447, 567, 449, 567, 386, 567, 494, 567, + /* 3490 */ 567, 497, 567, 567, 567, 501, 502, 503, 504, 505, + /* 3500 */ 506, 401, 567, 509, 510, 511, 567, 567, 567, 494, + /* 3510 */ 567, 567, 497, 567, 567, 567, 501, 502, 503, 504, + /* 3520 */ 505, 506, 567, 567, 509, 510, 511, 386, 567, 494, + /* 3530 */ 567, 431, 497, 567, 567, 567, 501, 502, 503, 504, + /* 3540 */ 505, 506, 401, 567, 509, 510, 511, 447, 567, 449, + /* 3550 */ 567, 386, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3560 */ 567, 567, 567, 567, 567, 567, 401, 567, 567, 567, + /* 3570 */ 567, 567, 431, 567, 567, 567, 567, 567, 567, 567, + /* 3580 */ 567, 567, 567, 567, 567, 567, 567, 567, 447, 567, + /* 3590 */ 449, 567, 567, 567, 494, 567, 431, 497, 567, 567, + /* 3600 */ 567, 501, 502, 503, 504, 505, 506, 567, 567, 509, + /* 3610 */ 510, 511, 447, 567, 449, 567, 567, 567, 386, 567, + /* 3620 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3630 */ 567, 567, 567, 401, 567, 494, 567, 567, 497, 567, + /* 3640 */ 386, 567, 501, 502, 503, 504, 505, 506, 567, 567, + /* 3650 */ 509, 510, 511, 567, 567, 401, 567, 567, 567, 494, + /* 3660 */ 567, 567, 497, 431, 567, 567, 501, 502, 503, 504, + /* 3670 */ 505, 506, 567, 567, 509, 510, 511, 567, 567, 447, + /* 3680 */ 567, 449, 567, 386, 567, 431, 567, 567, 567, 567, + /* 3690 */ 567, 567, 567, 567, 567, 567, 567, 567, 401, 567, + /* 3700 */ 567, 447, 567, 449, 567, 567, 567, 386, 567, 567, + /* 3710 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3720 */ 567, 567, 401, 567, 567, 567, 494, 567, 431, 497, + /* 3730 */ 567, 567, 567, 501, 502, 503, 504, 505, 506, 567, + /* 3740 */ 567, 509, 510, 511, 447, 567, 449, 567, 494, 567, + /* 3750 */ 567, 497, 431, 567, 567, 501, 502, 503, 504, 505, + /* 3760 */ 506, 567, 567, 509, 510, 511, 567, 567, 447, 567, + /* 3770 */ 449, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3780 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3790 */ 567, 494, 567, 567, 497, 567, 567, 567, 501, 502, + /* 3800 */ 503, 504, 505, 506, 567, 567, 509, 510, 511, 567, + /* 3810 */ 567, 567, 567, 567, 567, 494, 567, 567, 497, 567, + /* 3820 */ 567, 567, 501, 502, 503, 504, 505, 506, 386, 567, + /* 3830 */ 509, 510, 511, 567, 567, 567, 567, 567, 567, 567, + /* 3840 */ 567, 567, 567, 401, 567, 567, 567, 386, 567, 567, + /* 3850 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3860 */ 567, 567, 401, 567, 567, 567, 567, 567, 567, 386, + /* 3870 */ 567, 567, 567, 431, 567, 567, 567, 567, 567, 567, + /* 3880 */ 567, 567, 567, 567, 401, 567, 567, 567, 567, 447, + /* 3890 */ 567, 449, 431, 567, 567, 567, 386, 567, 567, 567, + /* 3900 */ 567, 567, 567, 567, 567, 567, 567, 567, 447, 567, + /* 3910 */ 449, 401, 567, 567, 431, 567, 567, 567, 567, 567, + /* 3920 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3930 */ 447, 567, 449, 567, 386, 567, 494, 567, 567, 497, + /* 3940 */ 567, 431, 567, 501, 502, 503, 504, 505, 506, 401, + /* 3950 */ 567, 509, 510, 511, 567, 494, 567, 447, 497, 449, + /* 3960 */ 567, 567, 501, 502, 503, 504, 505, 506, 567, 567, + /* 3970 */ 509, 510, 511, 567, 567, 567, 567, 494, 567, 431, + /* 3980 */ 497, 567, 567, 386, 501, 502, 503, 504, 505, 506, + /* 3990 */ 567, 567, 509, 510, 511, 447, 567, 449, 401, 567, + /* 4000 */ 567, 567, 567, 567, 494, 567, 567, 497, 567, 567, + /* 4010 */ 567, 501, 502, 503, 504, 505, 506, 567, 567, 509, + /* 4020 */ 510, 511, 386, 567, 567, 567, 567, 567, 431, 567, + /* 4030 */ 567, 567, 567, 567, 567, 567, 567, 401, 567, 567, + /* 4040 */ 567, 567, 494, 567, 447, 497, 449, 567, 567, 501, + /* 4050 */ 502, 503, 504, 505, 506, 567, 567, 509, 510, 511, + /* 4060 */ 567, 567, 567, 567, 567, 567, 386, 431, 567, 567, + /* 4070 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4080 */ 567, 401, 567, 447, 567, 449, 567, 567, 567, 567, + /* 4090 */ 386, 494, 567, 567, 497, 567, 567, 567, 501, 502, + /* 4100 */ 503, 504, 505, 506, 567, 401, 509, 510, 511, 386, + /* 4110 */ 567, 431, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4120 */ 567, 567, 567, 567, 401, 567, 567, 447, 567, 449, + /* 4130 */ 494, 567, 567, 497, 567, 431, 567, 501, 502, 503, + /* 4140 */ 504, 505, 506, 567, 567, 509, 510, 511, 567, 567, + /* 4150 */ 567, 447, 567, 449, 431, 567, 567, 567, 567, 567, + /* 4160 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4170 */ 447, 567, 449, 567, 494, 567, 567, 497, 386, 567, + /* 4180 */ 567, 501, 502, 503, 504, 505, 506, 567, 567, 509, + /* 4190 */ 510, 511, 567, 401, 567, 567, 567, 567, 494, 567, + /* 4200 */ 567, 497, 567, 567, 567, 501, 502, 503, 504, 505, + /* 4210 */ 506, 567, 567, 509, 510, 511, 567, 494, 567, 567, + /* 4220 */ 497, 567, 567, 431, 501, 502, 503, 504, 505, 506, + /* 4230 */ 567, 567, 509, 510, 511, 567, 567, 567, 567, 447, + /* 4240 */ 567, 449, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4250 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4260 */ 386, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4270 */ 567, 567, 567, 567, 567, 401, 567, 567, 567, 567, + /* 4280 */ 567, 567, 567, 567, 567, 567, 494, 567, 567, 497, + /* 4290 */ 567, 567, 567, 501, 502, 503, 504, 505, 506, 567, + /* 4300 */ 567, 509, 510, 511, 567, 431, 567, 567, 567, 567, + /* 4310 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4320 */ 567, 447, 567, 449, 567, 567, 567, 567, 567, 567, + /* 4330 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4340 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4350 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 4360 */ 567, 567, 567, 567, 567, 567, 567, 567, 494, 567, + /* 4370 */ 567, 497, 567, 567, 567, 501, 502, 503, 504, 505, + /* 4380 */ 506, 567, 567, 509, 510, 511, 383, 383, 383, 383, + /* 4390 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4400 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4410 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4420 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4430 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4440 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4450 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4460 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4470 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4480 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4490 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4500 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4510 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4520 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4530 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4540 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4550 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4560 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4570 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4580 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4590 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4600 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4610 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4620 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4630 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4640 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4650 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4660 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4670 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4680 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4690 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4700 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4710 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4720 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4730 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4740 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4750 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + /* 4760 */ 383, 383, 383, 383, 383, 383, 383, 383, 383, }; -#define YY_SHIFT_COUNT (1024) +#define YY_SHIFT_COUNT (1008) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2989) +#define YY_SHIFT_MAX (2941) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 948, 277, 554, 277, 832, 832, 832, 832, 832, 832, - /* 10 */ 832, 832, 832, 832, 832, 832, 1109, 1940, 1940, 2217, - /* 20 */ 0, 1386, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, - /* 30 */ 1940, 1940, 1663, 1940, 1940, 1940, 1940, 1940, 1940, 1940, - /* 40 */ 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, - /* 50 */ 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, 1940, - /* 60 */ 1940, 1940, 1940, 34, 66, 180, 253, 46, 122, 46, - /* 70 */ 46, 253, 253, 46, 960, 46, 276, 960, 520, 46, - /* 80 */ 149, 2315, 156, 156, 212, 212, 2315, 2315, 598, 598, - /* 90 */ 156, 20, 20, 346, 89, 89, 69, 204, 212, 212, - /* 100 */ 212, 212, 212, 212, 212, 212, 212, 212, 212, 333, - /* 110 */ 444, 573, 212, 212, 585, 149, 212, 333, 212, 149, - /* 120 */ 212, 212, 212, 212, 149, 212, 212, 212, 149, 212, - /* 130 */ 149, 149, 149, 648, 222, 222, 473, 473, 745, 652, - /* 140 */ 181, 51, 548, 548, 548, 548, 548, 548, 548, 548, - /* 150 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, - /* 160 */ 548, 1858, 200, 20, 346, 849, 849, 710, 379, 379, - /* 170 */ 379, 927, 927, 699, 1091, 710, 585, 149, 614, 149, - /* 180 */ 149, 466, 149, 149, 683, 149, 683, 683, 728, 25, - /* 190 */ 2488, 473, 473, 473, 473, 473, 473, 1190, 21, 53, - /* 200 */ 411, 411, 314, 148, 23, 220, 152, 596, 213, 571, - /* 210 */ 560, 560, 892, 662, 1043, 1043, 1043, 382, 1043, 774, - /* 220 */ 757, 92, 896, 1442, 1208, 682, 1247, 1247, 1254, 1320, - /* 230 */ 1320, 1082, 1000, 241, 1247, 1091, 1510, 1772, 1812, 1814, - /* 240 */ 1601, 585, 1814, 585, 1639, 1812, 1842, 1819, 1842, 1819, - /* 250 */ 1686, 1812, 1842, 1812, 1819, 1686, 1686, 1686, 1782, 1788, - /* 260 */ 1812, 1812, 1792, 1812, 1812, 1812, 1886, 1860, 1886, 1860, - /* 270 */ 1814, 585, 585, 1896, 585, 1935, 1937, 585, 1935, 585, - /* 280 */ 1943, 585, 1948, 585, 585, 1921, 1921, 1812, 585, 1886, - /* 290 */ 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - /* 300 */ 149, 1812, 25, 25, 1886, 683, 683, 683, 1759, 1881, - /* 310 */ 1814, 648, 1992, 1799, 1806, 1896, 648, 1510, 1812, 683, - /* 320 */ 1714, 1717, 1714, 1717, 1712, 1836, 1714, 1724, 1726, 1745, - /* 330 */ 1510, 1749, 1763, 1738, 1739, 1740, 1842, 2061, 1954, 1770, - /* 340 */ 1935, 648, 648, 1717, 683, 683, 683, 683, 1717, 683, - /* 350 */ 1924, 648, 683, 1948, 648, 2015, 683, 1944, 1948, 648, - /* 360 */ 728, 648, 1842, 683, 683, 683, 683, 683, 683, 683, - /* 370 */ 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, - /* 380 */ 683, 683, 683, 683, 683, 2034, 683, 1812, 648, 2155, - /* 390 */ 2148, 2152, 2151, 1886, 4475, 4475, 4475, 4475, 4475, 4475, - /* 400 */ 4475, 4475, 4475, 4475, 4475, 4475, 39, 2989, 70, 1146, - /* 410 */ 1193, 1243, 1425, 1711, 715, 1434, 1560, 1570, 1124, 497, - /* 420 */ 770, 1584, 1542, 1861, 1878, 1699, 1808, 1004, 1169, 1026, - /* 430 */ 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 237, 150, - /* 440 */ 992, 831, 3, 3, 681, 106, 321, 182, 686, 711, - /* 450 */ 334, 752, 837, 767, 928, 928, 687, 736, 1138, 687, - /* 460 */ 687, 687, 1407, 1275, 1206, 1382, 1446, 1365, 1473, 1509, - /* 470 */ 10, 1495, 1373, 399, 1374, 1403, 399, 1408, 1478, 1499, - /* 480 */ 1526, 1302, 1527, 1538, 1545, 1396, 1469, 1489, 179, 1500, - /* 490 */ 1513, 1519, 1561, 1351, 1301, 1130, 1507, 1562, 1568, 1569, - /* 500 */ 1563, 1577, 1488, 1587, 1610, 1632, 1573, 1625, 1633, 1645, - /* 510 */ 1653, 1657, 1558, 1591, 1624, 1692, 1704, 1718, 1720, 1723, - /* 520 */ 1733, 1737, 1741, 1667, 399, 1708, 1730, 1735, 1736, 1742, - /* 530 */ 1575, 1682, 1541, 1589, 1743, 1744, 1719, 1702, 2256, 2257, - /* 540 */ 2258, 2212, 2260, 2225, 2017, 2227, 2228, 2231, 2020, 2268, - /* 550 */ 2233, 2234, 2026, 2236, 2273, 2274, 2030, 2276, 2241, 2278, - /* 560 */ 2243, 2280, 2259, 2282, 2247, 2044, 2285, 2059, 2287, 2062, - /* 570 */ 2064, 2069, 2074, 2294, 2295, 2297, 2083, 2085, 2300, 2301, - /* 580 */ 2142, 2253, 2254, 2306, 2271, 2308, 2309, 2275, 2261, 2310, - /* 590 */ 2262, 2319, 2269, 2317, 2320, 2321, 2264, 2322, 2323, 2324, - /* 600 */ 2325, 2326, 2329, 2157, 2298, 2330, 2159, 2331, 2339, 2340, - /* 610 */ 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2349, 2350, 2352, - /* 620 */ 2354, 2355, 2356, 2357, 2358, 2360, 2361, 2312, 2364, 2318, - /* 630 */ 2377, 2382, 2384, 2385, 2389, 2390, 2391, 2392, 2393, 2395, - /* 640 */ 2375, 2398, 2218, 2380, 2239, 2400, 2242, 2402, 2403, 2383, - /* 650 */ 2362, 2386, 2363, 2404, 2335, 2407, 2338, 2374, 2413, 2348, - /* 660 */ 2416, 2353, 2417, 2418, 2387, 2368, 2376, 2426, 2394, 2370, - /* 670 */ 2388, 2428, 2397, 2372, 2396, 2431, 2399, 2434, 2381, 2439, - /* 680 */ 2406, 2445, 2408, 2410, 2414, 2409, 2411, 2432, 2415, 2459, - /* 690 */ 2419, 2423, 2461, 2468, 2474, 2490, 2452, 2288, 2497, 2409, - /* 700 */ 2455, 2508, 2409, 2458, 2510, 2511, 2433, 2513, 2514, 2480, - /* 710 */ 2460, 2475, 2518, 2484, 2464, 2478, 2523, 2489, 2467, 2483, - /* 720 */ 2528, 2493, 2476, 2487, 2532, 2535, 2537, 2538, 2539, 2504, - /* 730 */ 2543, 2544, 2420, 2421, 2515, 2524, 2549, 2530, 2517, 2522, - /* 740 */ 2525, 2526, 2527, 2529, 2534, 2536, 2541, 2531, 2533, 2545, - /* 750 */ 2546, 2552, 2547, 2550, 2551, 2571, 2553, 2579, 2558, 2548, - /* 760 */ 2584, 2563, 2555, 2586, 2587, 2588, 2556, 2593, 2559, 2594, - /* 770 */ 2560, 2603, 2582, 2589, 2570, 2572, 2575, 2494, 2496, 2612, - /* 780 */ 2422, 2405, 2424, 2498, 2401, 2409, 2564, 2617, 2429, 2583, - /* 790 */ 2598, 2622, 2425, 2602, 2446, 2427, 2628, 2643, 2449, 2440, - /* 800 */ 2453, 2442, 2647, 2618, 2334, 2540, 2542, 2554, 2557, 2631, - /* 810 */ 2561, 2562, 2620, 2621, 2565, 2608, 2569, 2610, 2566, 2576, - /* 820 */ 2630, 2632, 2578, 2580, 2581, 2585, 2590, 2634, 2613, 2619, - /* 830 */ 2592, 2635, 2336, 2605, 2595, 2636, 2599, 2637, 2597, 2600, - /* 840 */ 2668, 2641, 2359, 2639, 2642, 2651, 2658, 2664, 2665, 2604, - /* 850 */ 2606, 2653, 2441, 2669, 2657, 2711, 2712, 2609, 2674, 2607, - /* 860 */ 2611, 2615, 2616, 2567, 2624, 2713, 2677, 2519, 2724, 2629, - /* 870 */ 2638, 2573, 2684, 2577, 2698, 2654, 2457, 2661, 2747, 2728, - /* 880 */ 2499, 2640, 2655, 2656, 2662, 2666, 2659, 2663, 2667, 2670, - /* 890 */ 2671, 2672, 2673, 2675, 2700, 2678, 2679, 2703, 2676, 2735, - /* 900 */ 2591, 2680, 2681, 2776, 2682, 2685, 2601, 2743, 2688, 2687, - /* 910 */ 2779, 2770, 2690, 2691, 2409, 2742, 2694, 2695, 2683, 2696, - /* 920 */ 2697, 2689, 2786, 2614, 2701, 2781, 2785, 2704, 2705, 2789, - /* 930 */ 2708, 2710, 2791, 2667, 2714, 2794, 2670, 2722, 2806, 2671, - /* 940 */ 2731, 2811, 2672, 2715, 2717, 2718, 2719, 2733, 2790, 2734, - /* 950 */ 2817, 2736, 2790, 2790, 2838, 2782, 2784, 2841, 2828, 2830, - /* 960 */ 2832, 2834, 2835, 2836, 2837, 2839, 2840, 2842, 2844, 2792, - /* 970 */ 2762, 2796, 2771, 2852, 2857, 2861, 2862, 2877, 2864, 2865, - /* 980 */ 2866, 2818, 2531, 2868, 2533, 2869, 2870, 2872, 2873, 2888, - /* 990 */ 2875, 2916, 2881, 2856, 2874, 2925, 2890, 2876, 2887, 2934, - /* 1000 */ 2899, 2879, 2894, 2939, 2904, 2884, 2898, 2943, 2908, 2945, - /* 1010 */ 2924, 2947, 2926, 2914, 2949, 2929, 2919, 2918, 2920, 2935, - /* 1020 */ 2937, 2940, 2941, 2938, 2944, + /* 0 */ 1704, 272, 355, 272, 628, 628, 628, 628, 628, 628, + /* 10 */ 628, 628, 628, 628, 628, 628, 711, 1338, 1338, 1421, + /* 20 */ 0, 983, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, + /* 30 */ 1338, 1338, 1066, 1338, 1338, 1338, 1338, 1338, 1338, 1338, + /* 40 */ 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, + /* 50 */ 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, + /* 60 */ 1338, 1338, 539, 645, 219, 200, 347, 457, 347, 347, + /* 70 */ 200, 200, 347, 2050, 347, 1687, 2050, 63, 347, 7, + /* 80 */ 2127, 491, 491, 91, 91, 2127, 2127, 962, 962, 491, + /* 90 */ 378, 378, 192, 14, 14, 94, 269, 91, 91, 91, + /* 100 */ 91, 91, 91, 91, 91, 91, 91, 91, 151, 321, + /* 110 */ 349, 91, 91, 402, 7, 91, 151, 91, 7, 91, + /* 120 */ 91, 91, 91, 7, 91, 91, 91, 7, 91, 7, + /* 130 */ 7, 7, 474, 308, 308, 544, 544, 808, 951, 156, + /* 140 */ 334, 978, 978, 978, 978, 978, 978, 978, 978, 978, + /* 150 */ 978, 978, 978, 978, 978, 978, 978, 978, 978, 978, + /* 160 */ 66, 602, 378, 192, 517, 517, 268, 603, 603, 603, + /* 170 */ 436, 436, 466, 1101, 268, 402, 7, 484, 7, 7, + /* 180 */ 367, 7, 7, 608, 7, 608, 608, 631, 683, 544, + /* 190 */ 544, 544, 544, 544, 544, 2430, 1202, 21, 217, 218, + /* 200 */ 218, 819, 242, 343, 198, 609, 294, 461, 725, 77, + /* 210 */ 77, 984, 901, 1081, 1081, 1081, 820, 1081, 674, 1119, + /* 220 */ 407, 428, 1405, 497, 1171, 1185, 1185, 1263, 1383, 1383, + /* 230 */ 1040, 1257, 251, 1185, 1101, 1500, 1758, 1800, 1813, 1606, + /* 240 */ 402, 1813, 402, 1653, 1800, 1857, 1832, 1857, 1832, 1694, + /* 250 */ 1800, 1857, 1800, 1832, 1694, 1694, 1694, 1776, 1786, 1800, + /* 260 */ 1800, 1791, 1800, 1800, 1800, 1886, 1856, 1886, 1856, 1813, + /* 270 */ 402, 402, 1901, 402, 1903, 1906, 402, 1903, 402, 1912, + /* 280 */ 402, 1918, 402, 402, 1892, 1892, 1800, 402, 1886, 7, + /* 290 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 300 */ 1800, 683, 683, 1886, 608, 608, 608, 1727, 1855, 1813, + /* 310 */ 474, 1952, 1752, 1755, 1901, 474, 1500, 1800, 608, 1689, + /* 320 */ 1695, 1689, 1695, 1692, 1809, 1689, 1697, 1700, 1705, 1500, + /* 330 */ 1722, 1724, 1698, 1710, 1714, 1857, 2027, 1922, 1745, 1903, + /* 340 */ 474, 474, 1695, 608, 608, 608, 608, 1695, 608, 1884, + /* 350 */ 474, 608, 1918, 474, 1986, 608, 1908, 1918, 474, 631, + /* 360 */ 474, 1857, 608, 608, 608, 608, 608, 608, 608, 608, + /* 370 */ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, + /* 380 */ 608, 608, 608, 608, 2030, 608, 1800, 474, 2124, 2118, + /* 390 */ 2131, 2129, 1886, 4386, 4386, 4386, 4386, 4386, 4386, 4386, + /* 400 */ 4386, 4386, 4386, 4386, 4386, 39, 1321, 558, 1103, 50, + /* 410 */ 323, 910, 845, 862, 1195, 1261, 1212, 1386, 1402, 1454, + /* 420 */ 1496, 1616, 1638, 1648, 1571, 1042, 1588, 17, 17, 17, + /* 430 */ 17, 17, 17, 17, 17, 17, 271, 207, 615, 907, + /* 440 */ 693, 693, 576, 105, 37, 443, 412, 451, 1151, 62, + /* 450 */ 847, 784, 692, 692, 1024, 1249, 202, 1024, 1024, 1024, + /* 460 */ 3, 1161, 1415, 914, 1374, 1358, 1216, 822, 1378, 1407, + /* 470 */ 1399, 1412, 1407, 1414, 1356, 1187, 1489, 1544, 1567, 1605, + /* 480 */ 1614, 1260, 1443, 1444, 936, 1452, 1518, 1522, 1524, 1361, + /* 490 */ 751, 1419, 1532, 1539, 1542, 1543, 1561, 1549, 1389, 1560, + /* 500 */ 1573, 1600, 1527, 1610, 1612, 1636, 1639, 1655, 1654, 1658, + /* 510 */ 1683, 1696, 1699, 1706, 1717, 1744, 1750, 1753, 1766, 1677, + /* 520 */ 1407, 1680, 1690, 1691, 1711, 1712, 1625, 1482, 1541, 1590, + /* 530 */ 1545, 1684, 1734, 41, 2184, 2224, 2225, 2179, 2233, 2198, + /* 540 */ 1996, 2204, 2205, 2207, 2002, 2246, 2211, 2214, 2008, 2216, + /* 550 */ 2254, 2255, 2013, 2257, 2222, 2259, 2226, 2260, 2239, 2263, + /* 560 */ 2229, 2031, 2270, 2053, 2278, 2058, 2059, 2067, 2070, 2287, + /* 570 */ 2294, 2295, 2077, 2079, 2291, 2296, 2139, 2247, 2249, 2304, + /* 580 */ 2269, 2306, 2307, 2272, 2256, 2309, 2261, 2311, 2266, 2314, + /* 590 */ 2315, 2316, 2267, 2317, 2322, 2323, 2324, 2325, 2326, 2157, + /* 600 */ 2298, 2335, 2161, 2338, 2339, 2340, 2341, 2342, 2344, 2347, + /* 610 */ 2348, 2350, 2351, 2352, 2359, 2360, 2364, 2365, 2367, 2368, + /* 620 */ 2369, 2371, 2372, 2329, 2373, 2334, 2376, 2383, 2385, 2386, + /* 630 */ 2387, 2388, 2389, 2390, 2391, 2370, 2393, 2236, 2395, 2241, + /* 640 */ 2399, 2244, 2401, 2402, 2381, 2361, 2392, 2363, 2411, 2349, + /* 650 */ 2412, 2353, 2380, 2418, 2355, 2419, 2356, 2420, 2422, 2394, + /* 660 */ 2374, 2382, 2427, 2397, 2396, 2398, 2434, 2407, 2400, 2404, + /* 670 */ 2435, 2415, 2452, 2409, 2416, 2426, 2410, 2413, 2449, 2414, + /* 680 */ 2466, 2424, 2423, 2470, 2472, 2474, 2476, 2433, 2271, 2479, + /* 690 */ 2410, 2429, 2481, 2410, 2431, 2485, 2486, 2421, 2487, 2488, + /* 700 */ 2453, 2437, 2455, 2500, 2465, 2448, 2459, 2504, 2469, 2457, + /* 710 */ 2462, 2507, 2473, 2458, 2471, 2513, 2514, 2516, 2517, 2519, + /* 720 */ 2522, 2406, 2417, 2501, 2502, 2523, 2510, 2503, 2505, 2509, + /* 730 */ 2512, 2515, 2518, 2520, 2525, 2532, 2524, 2526, 2537, 2538, + /* 740 */ 2528, 2539, 2543, 2530, 2546, 2531, 2576, 2555, 2529, 2578, + /* 750 */ 2557, 2548, 2582, 2587, 2588, 2553, 2597, 2565, 2602, 2567, + /* 760 */ 2604, 2583, 2589, 2571, 2572, 2574, 2495, 2497, 2613, 2425, + /* 770 */ 2403, 2405, 2499, 2408, 2410, 2564, 2616, 2436, 2581, 2598, + /* 780 */ 2619, 2428, 2600, 2441, 2438, 2623, 2624, 2443, 2440, 2445, + /* 790 */ 2442, 2625, 2606, 2327, 2533, 2534, 2540, 2536, 2605, 2610, + /* 800 */ 2541, 2601, 2544, 2607, 2547, 2545, 2627, 2629, 2549, 2551, + /* 810 */ 2556, 2558, 2552, 2630, 2621, 2626, 2559, 2631, 2336, 2594, + /* 820 */ 2554, 2645, 2566, 2643, 2568, 2569, 2677, 2649, 2432, 2647, + /* 830 */ 2650, 2651, 2652, 2657, 2658, 2579, 2586, 2656, 2444, 2670, + /* 840 */ 2659, 2708, 2709, 2596, 2668, 2599, 2603, 2612, 2617, 2550, + /* 850 */ 2620, 2713, 2672, 2542, 2728, 2618, 2622, 2560, 2695, 2562, + /* 860 */ 2710, 2635, 2464, 2637, 2742, 2729, 2506, 2638, 2639, 2644, + /* 870 */ 2653, 2654, 2636, 2646, 2660, 2662, 2663, 2665, 2667, 2648, + /* 880 */ 2714, 2669, 2673, 2715, 2671, 2745, 2561, 2674, 2681, 2770, + /* 890 */ 2686, 2682, 2575, 2730, 2689, 2688, 2772, 2751, 2690, 2692, + /* 900 */ 2410, 2758, 2696, 2697, 2694, 2698, 2699, 2691, 2793, 2590, + /* 910 */ 2702, 2784, 2785, 2712, 2707, 2789, 2716, 2723, 2792, 2660, + /* 920 */ 2724, 2794, 2662, 2731, 2796, 2663, 2733, 2808, 2665, 2717, + /* 930 */ 2725, 2734, 2736, 2735, 2812, 2737, 2810, 2738, 2812, 2812, + /* 940 */ 2839, 2790, 2795, 2845, 2832, 2838, 2847, 2853, 2854, 2855, + /* 950 */ 2856, 2857, 2858, 2859, 2860, 2816, 2766, 2817, 2791, 2868, + /* 960 */ 2866, 2867, 2869, 2882, 2870, 2872, 2874, 2827, 2524, 2875, + /* 970 */ 2526, 2876, 2877, 2878, 2879, 2894, 2881, 2919, 2884, 2871, + /* 980 */ 2880, 2921, 2887, 2883, 2885, 2926, 2892, 2886, 2888, 2930, + /* 990 */ 2895, 2890, 2889, 2934, 2899, 2936, 2916, 2903, 2941, 2920, + /* 1000 */ 2913, 2911, 2912, 2928, 2932, 2929, 2933, 2935, 2937, }; -#define YY_REDUCE_COUNT (405) -#define YY_REDUCE_MIN (-536) -#define YY_REDUCE_MAX (3957) +#define YY_REDUCE_COUNT (404) +#define YY_REDUCE_MIN (-519) +#define YY_REDUCE_MAX (3874) static const short yy_reduce_ofst[] = { - /* 0 */ 418, -349, -99, 142, 552, 829, 1008, 1285, 1582, 1664, - /* 10 */ 1106, 1859, 1941, 176, 1336, 1613, -135, 289, 2123, 419, - /* 20 */ 974, 2229, 2252, 2328, 2379, 2412, 2477, 2500, 2568, 2633, - /* 30 */ 2660, 2746, 2766, 2787, 2893, 2913, 2933, 3020, 3046, 3069, - /* 40 */ 3089, 3111, 3176, 3195, 3217, 3282, 3331, 3351, 3371, 3458, - /* 50 */ 3477, 3497, 3564, 3584, 3603, 3671, 3690, 3739, 3759, 3827, - /* 60 */ 3851, 3933, 3957, -351, 448, 605, -290, -366, 481, 1203, - /* 70 */ 1464, 329, 442, 1485, -412, -536, -153, -393, -534, 14, - /* 80 */ 197, 347, -106, -49, 254, 271, 480, 511, -400, -398, - /* 90 */ -368, -374, -100, -245, 57, 192, 164, -382, -90, 507, - /* 100 */ 539, 551, 43, 229, 718, 806, 834, 843, 305, 151, - /* 110 */ -114, 385, 847, 879, 639, 472, 889, 218, 900, 706, - /* 120 */ 983, 995, 997, 1006, -219, 1029, 1046, 1052, 729, 1061, - /* 130 */ 228, 792, 1017, 616, 61, 61, 184, -415, -35, -259, - /* 140 */ -503, -193, -25, 443, 502, 603, 617, 658, 734, 735, - /* 150 */ 738, 778, 827, 895, 901, 935, 963, 967, 1022, 1027, - /* 160 */ 1039, -14, 121, 33, 316, 256, 588, 651, 121, 258, - /* 170 */ 363, 787, 788, 508, -28, 692, 493, 844, 768, -428, - /* 180 */ 143, 905, 189, 786, 897, 860, 899, 1016, 754, 739, - /* 190 */ 471, 568, 574, 737, 755, 766, 784, 724, 950, 1011, - /* 200 */ 823, 823, 721, 987, 1034, 1072, 1217, 823, 1192, 1192, - /* 210 */ 1236, 1261, 1292, 1244, 1162, 1200, 1202, 1296, 1218, 1192, - /* 220 */ 1317, 1377, 1282, 1383, 1332, 1312, 1334, 1338, 1192, 1262, - /* 230 */ 1263, 1248, 1278, 1265, 1350, 1400, 1348, 1329, 1427, 1344, - /* 240 */ 1342, 1426, 1349, 1435, 1360, 1453, 1456, 1409, 1465, 1416, - /* 250 */ 1421, 1475, 1476, 1479, 1433, 1429, 1437, 1438, 1482, 1486, - /* 260 */ 1497, 1501, 1491, 1503, 1504, 1505, 1514, 1511, 1516, 1517, - /* 270 */ 1444, 1521, 1529, 1487, 1539, 1548, 1477, 1544, 1553, 1550, - /* 280 */ 1494, 1552, 1506, 1554, 1555, 1546, 1551, 1571, 1566, 1576, - /* 290 */ 1549, 1556, 1557, 1559, 1564, 1565, 1572, 1578, 1579, 1580, - /* 300 */ 1581, 1586, 1592, 1593, 1596, 1537, 1583, 1585, 1508, 1520, - /* 310 */ 1531, 1594, 1533, 1540, 1547, 1588, 1620, 1574, 1634, 1598, - /* 320 */ 1490, 1590, 1492, 1597, 1502, 1515, 1512, 1498, 1522, 1518, - /* 330 */ 1595, 1523, 1535, 1528, 1536, 1543, 1672, 1599, 1567, 1602, - /* 340 */ 1678, 1674, 1675, 1630, 1654, 1656, 1659, 1662, 1658, 1665, - /* 350 */ 1666, 1725, 1679, 1661, 1727, 1612, 1690, 1681, 1683, 1747, - /* 360 */ 1721, 1750, 1748, 1697, 1698, 1701, 1703, 1705, 1709, 1715, - /* 370 */ 1716, 1729, 1731, 1732, 1734, 1760, 1766, 1767, 1768, 1778, - /* 380 */ 1779, 1780, 1781, 1783, 1785, 1728, 1787, 1751, 1752, 1784, - /* 390 */ 1793, 1837, 1797, 1813, 1758, 1803, 1746, 1754, 1769, 1773, - /* 400 */ 1815, 1820, 1809, 1821, 1838, 1864, + /* 0 */ -376, -346, 1320, -204, 267, 622, 977, 1487, 1555, 1620, + /* 10 */ 1593, 1688, 1726, 1770, 1852, 1935, -98, -59, 303, 2024, + /* 20 */ 2061, 2089, 2195, 2220, 2289, 2332, 2354, 2375, 2496, 2521, + /* 30 */ 2563, 2628, 2655, 2693, 2722, 2761, 2787, 2852, 2873, 2950, + /* 40 */ 2994, 3015, 3035, 3100, 3141, 3165, 3232, 3254, 3297, 3321, + /* 50 */ 3442, 3461, 3483, 3510, 3548, 3597, 3636, 3680, 3704, 3723, + /* 60 */ 3792, 3874, -321, 280, -469, -48, -457, -363, 899, 985, + /* 70 */ 554, 1022, 1242, 304, 197, -72, 244, -160, 237, -417, + /* 80 */ -328, -393, 111, -133, 84, -6, 434, -380, -304, -140, + /* 90 */ -423, -414, 376, 336, 560, -252, -44, 328, 391, 495, + /* 100 */ 586, -395, 31, 644, 667, 673, 676, 617, -158, 247, + /* 110 */ 326, 700, 709, 680, 570, 742, 449, 746, -236, 749, + /* 120 */ 752, 759, 812, 431, 814, 871, 893, -50, 895, 591, + /* 130 */ 902, 755, -185, -519, -519, -38, -119, -389, -332, -20, + /* 140 */ 310, 470, 616, 623, 664, 720, 726, 735, 782, 791, + /* 150 */ 919, 956, 981, 995, 997, 1004, 1007, 1026, 1050, 1059, + /* 160 */ -262, -379, 148, -8, 896, 911, 939, -379, 840, 868, + /* 170 */ 229, 482, -246, 779, 941, 876, 666, -416, 250, 306, + /* 180 */ 865, 332, 739, 917, 982, 1002, 1028, -188, 1041, 447, + /* 190 */ 472, 588, 643, 698, 724, 636, 815, 891, 875, 830, + /* 200 */ 830, 882, 970, 1102, 1036, 1124, 830, 1140, 1140, 1251, + /* 210 */ 1314, 1359, 1309, 1228, 1229, 1230, 1312, 1232, 1140, 1327, + /* 220 */ 1384, 1292, 1388, 1344, 1311, 1333, 1335, 1140, 1258, 1265, + /* 230 */ 1239, 1276, 1269, 1346, 1391, 1341, 1322, 1432, 1350, 1351, + /* 240 */ 1431, 1372, 1437, 1395, 1472, 1477, 1424, 1481, 1427, 1433, + /* 250 */ 1485, 1486, 1491, 1436, 1440, 1441, 1442, 1483, 1488, 1498, + /* 260 */ 1499, 1492, 1502, 1504, 1505, 1514, 1512, 1517, 1519, 1426, + /* 270 */ 1510, 1511, 1473, 1515, 1523, 1453, 1520, 1525, 1526, 1467, + /* 280 */ 1528, 1479, 1531, 1533, 1521, 1530, 1547, 1536, 1562, 1529, + /* 290 */ 1534, 1535, 1537, 1538, 1540, 1546, 1551, 1552, 1554, 1556, + /* 300 */ 1559, 1565, 1572, 1569, 1516, 1548, 1553, 1478, 1493, 1490, + /* 310 */ 1566, 1494, 1550, 1557, 1558, 1592, 1563, 1601, 1564, 1468, + /* 320 */ 1568, 1469, 1574, 1471, 1470, 1476, 1480, 1495, 1484, 1570, + /* 330 */ 1497, 1501, 1465, 1508, 1575, 1645, 1576, 1509, 1581, 1651, + /* 340 */ 1663, 1668, 1613, 1608, 1632, 1634, 1635, 1617, 1644, 1621, + /* 350 */ 1685, 1646, 1640, 1701, 1584, 1659, 1649, 1673, 1721, 1715, + /* 360 */ 1737, 1746, 1666, 1703, 1707, 1708, 1713, 1719, 1720, 1723, + /* 370 */ 1725, 1729, 1730, 1731, 1732, 1733, 1736, 1739, 1740, 1741, + /* 380 */ 1749, 1756, 1760, 1761, 1716, 1762, 1748, 1751, 1763, 1768, + /* 390 */ 1769, 1780, 1771, 1728, 1767, 1709, 1735, 1747, 1754, 1789, + /* 400 */ 1790, 1781, 1793, 1773, 1834, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 10 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 20 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 30 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 40 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 50 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 60 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 70 */ 2300, 2300, 2300, 2683, 2300, 2300, 2639, 2300, 2300, 2300, - /* 80 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 90 */ 2300, 2646, 2646, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 100 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 110 */ 2300, 2300, 2300, 2300, 2410, 2300, 2300, 2300, 2300, 2300, - /* 120 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 130 */ 2300, 2300, 2300, 2408, 2956, 2300, 3084, 2724, 2300, 2300, - /* 140 */ 2985, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 150 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 160 */ 2300, 2300, 2968, 2300, 2300, 2381, 2381, 2300, 2968, 2968, - /* 170 */ 2968, 2928, 2928, 2408, 2300, 2300, 2410, 2300, 2726, 2300, - /* 180 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2553, 2330, - /* 190 */ 2709, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 3014, - /* 200 */ 2960, 2961, 3078, 2300, 3017, 2979, 2300, 2974, 2300, 2300, - /* 210 */ 2300, 2300, 2300, 3004, 2300, 2300, 2300, 2300, 2300, 2300, - /* 220 */ 2651, 2300, 2752, 2300, 2496, 2703, 2300, 2300, 2300, 2300, - /* 230 */ 2300, 3062, 2958, 2998, 2300, 2300, 3008, 2300, 2300, 2300, - /* 240 */ 2740, 2410, 2300, 2410, 2696, 2634, 2300, 2644, 2300, 2644, - /* 250 */ 2641, 2300, 2300, 2300, 2644, 2641, 2641, 2641, 2484, 2480, - /* 260 */ 2300, 2300, 2478, 2300, 2300, 2300, 2300, 2360, 2300, 2360, - /* 270 */ 2300, 2410, 2410, 2300, 2410, 2300, 2300, 2410, 2300, 2410, - /* 280 */ 2300, 2410, 2300, 2410, 2410, 2513, 2513, 2300, 2410, 2300, - /* 290 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 300 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2738, 2719, - /* 310 */ 2300, 2408, 2300, 2707, 2705, 2300, 2408, 3008, 2300, 2300, - /* 320 */ 3032, 3027, 3032, 3027, 3046, 3042, 3032, 3051, 3048, 3010, - /* 330 */ 3008, 2991, 2987, 3081, 3068, 3064, 2300, 2300, 2996, 2994, - /* 340 */ 2300, 2408, 2408, 3027, 2300, 2300, 2300, 2300, 3027, 2300, - /* 350 */ 2300, 2408, 2300, 2300, 2408, 2300, 2300, 2300, 2300, 2408, - /* 360 */ 2300, 2408, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 370 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 380 */ 2300, 2300, 2300, 2300, 2300, 2515, 2300, 2300, 2408, 2300, - /* 390 */ 2332, 2334, 2344, 2300, 2698, 3084, 2724, 2729, 2679, 2679, - /* 400 */ 2556, 2556, 3084, 2556, 2411, 2305, 2300, 2300, 2300, 2300, - /* 410 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 420 */ 2300, 2300, 2857, 2300, 2300, 2300, 2300, 2300, 2300, 3045, - /* 430 */ 3044, 2858, 2300, 2932, 2931, 2930, 2921, 2857, 2509, 2300, - /* 440 */ 2300, 2300, 2856, 2855, 2300, 2300, 2300, 2300, 2300, 2300, - /* 450 */ 2300, 2300, 2300, 2300, 2670, 2669, 2849, 2300, 2300, 2850, - /* 460 */ 2848, 2847, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 470 */ 2300, 2300, 2300, 2500, 2300, 2300, 2497, 2300, 2300, 2300, - /* 480 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 490 */ 2300, 2300, 2300, 2300, 3065, 3069, 2300, 2300, 2300, 2300, - /* 500 */ 2957, 2300, 2300, 2300, 2300, 2300, 2828, 2300, 2300, 2300, - /* 510 */ 2300, 2300, 2796, 2791, 2782, 2773, 2788, 2779, 2767, 2785, - /* 520 */ 2776, 2764, 2761, 2300, 2524, 2300, 2300, 2300, 2300, 2300, - /* 530 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 540 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 550 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 560 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 570 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 580 */ 2640, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 590 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 600 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 610 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 620 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 630 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 640 */ 2300, 2300, 2300, 2300, 2300, 2300, 2655, 2300, 2300, 2300, - /* 650 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 660 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 670 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 680 */ 2300, 2300, 2300, 2300, 2349, 2835, 2300, 2300, 2300, 2300, - /* 690 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2838, - /* 700 */ 2300, 2300, 2839, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 710 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 720 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 730 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 740 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2455, 2454, 2300, - /* 750 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 760 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 770 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2840, 2300, 2300, - /* 780 */ 2300, 2300, 2723, 2300, 2300, 2830, 2300, 2300, 2300, 2300, - /* 790 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 800 */ 2300, 2300, 3061, 3011, 2300, 2300, 2300, 2300, 2300, 2300, - /* 810 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 820 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2828, - /* 830 */ 2300, 3043, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 3059, - /* 840 */ 2300, 3063, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2967, - /* 850 */ 2963, 2300, 2300, 2959, 2300, 2300, 2300, 2300, 2300, 2300, - /* 860 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 870 */ 2300, 2300, 2300, 2300, 2918, 2300, 2300, 2300, 2952, 2300, - /* 880 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2552, 2551, - /* 890 */ 2550, 2549, 2300, 2300, 2300, 2300, 2300, 2300, 2840, 2300, - /* 900 */ 2843, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 910 */ 2300, 2300, 2300, 2300, 2827, 2300, 2895, 2894, 2300, 2300, - /* 920 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2546, 2300, 2300, - /* 930 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 940 */ 2300, 2300, 2300, 2530, 2528, 2527, 2526, 2300, 2563, 2300, - /* 950 */ 2300, 2300, 2559, 2558, 2300, 2300, 2300, 2300, 2300, 2300, - /* 960 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 970 */ 2300, 2300, 2300, 2429, 2300, 2300, 2300, 2300, 2300, 2300, - /* 980 */ 2300, 2300, 2421, 2300, 2420, 2300, 2300, 2300, 2300, 2300, - /* 990 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 1000 */ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300, - /* 1010 */ 2300, 2300, 2300, 2300, 2300, 2300, 2329, 2300, 2300, 2300, - /* 1020 */ 2300, 2300, 2300, 2300, 2300, + /* 0 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 10 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 20 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 30 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 40 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 50 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 60 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 70 */ 2268, 2268, 2645, 2268, 2268, 2601, 2268, 2268, 2268, 2268, + /* 80 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 90 */ 2608, 2608, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 100 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 110 */ 2268, 2268, 2268, 2374, 2268, 2268, 2268, 2268, 2268, 2268, + /* 120 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 130 */ 2268, 2268, 2372, 2915, 2268, 3041, 2686, 2268, 2268, 2944, + /* 140 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 150 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 160 */ 2268, 2927, 2268, 2268, 2345, 2345, 2268, 2927, 2927, 2927, + /* 170 */ 2887, 2887, 2372, 2268, 2268, 2374, 2268, 2688, 2268, 2268, + /* 180 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2517, 2298, 2268, + /* 190 */ 2268, 2268, 2268, 2268, 2268, 2671, 2268, 2268, 2973, 2919, + /* 200 */ 2920, 3035, 2268, 2976, 2938, 2268, 2933, 2268, 2268, 2268, + /* 210 */ 2268, 2268, 2963, 2268, 2268, 2268, 2268, 2268, 2268, 2613, + /* 220 */ 2268, 2714, 2268, 2460, 2665, 2268, 2268, 2268, 2268, 2268, + /* 230 */ 3019, 2917, 2957, 2268, 2268, 2967, 2268, 2268, 2268, 2702, + /* 240 */ 2374, 2268, 2374, 2658, 2596, 2268, 2606, 2268, 2606, 2603, + /* 250 */ 2268, 2268, 2268, 2606, 2603, 2603, 2603, 2448, 2444, 2268, + /* 260 */ 2268, 2442, 2268, 2268, 2268, 2268, 2328, 2268, 2328, 2268, + /* 270 */ 2374, 2374, 2268, 2374, 2268, 2268, 2374, 2268, 2374, 2268, + /* 280 */ 2374, 2268, 2374, 2374, 2477, 2477, 2268, 2374, 2268, 2268, + /* 290 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 300 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2700, 2681, 2268, + /* 310 */ 2372, 2268, 2669, 2667, 2268, 2372, 2967, 2268, 2268, 2989, + /* 320 */ 2984, 2989, 2984, 3003, 2999, 2989, 3008, 3005, 2969, 2967, + /* 330 */ 2950, 2946, 3038, 3025, 3021, 2268, 2268, 2955, 2953, 2268, + /* 340 */ 2372, 2372, 2984, 2268, 2268, 2268, 2268, 2984, 2268, 2268, + /* 350 */ 2372, 2268, 2268, 2372, 2268, 2268, 2268, 2268, 2372, 2268, + /* 360 */ 2372, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 370 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 380 */ 2268, 2268, 2268, 2268, 2479, 2268, 2268, 2372, 2268, 2300, + /* 390 */ 2302, 2312, 2268, 2660, 3041, 2686, 2691, 2641, 2641, 2520, + /* 400 */ 2520, 3041, 2520, 2375, 2273, 2268, 2268, 2268, 2268, 2268, + /* 410 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 420 */ 2819, 2268, 2268, 2268, 2268, 2268, 2268, 3002, 3001, 2820, + /* 430 */ 2268, 2891, 2890, 2889, 2880, 2819, 2473, 2268, 2268, 2268, + /* 440 */ 2818, 2817, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 450 */ 2268, 2268, 2632, 2631, 2811, 2268, 2268, 2812, 2810, 2809, + /* 460 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2464, + /* 470 */ 2268, 2268, 2461, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 480 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 490 */ 3022, 3026, 2268, 2268, 2268, 2268, 2916, 2268, 2268, 2268, + /* 500 */ 2268, 2268, 2790, 2268, 2268, 2268, 2268, 2268, 2758, 2753, + /* 510 */ 2744, 2735, 2750, 2741, 2729, 2747, 2738, 2726, 2723, 2268, + /* 520 */ 2488, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 530 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 540 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 550 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 560 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 570 */ 2268, 2268, 2268, 2268, 2268, 2268, 2602, 2268, 2268, 2268, + /* 580 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 590 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 600 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 610 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 620 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 630 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 640 */ 2268, 2617, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 650 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 660 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 670 */ 2268, 2268, 2268, 2268, 2268, 2317, 2797, 2268, 2268, 2268, + /* 680 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 690 */ 2800, 2268, 2268, 2801, 2268, 2268, 2268, 2268, 2268, 2268, + /* 700 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 710 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 720 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 730 */ 2268, 2268, 2268, 2268, 2268, 2268, 2419, 2418, 2268, 2268, + /* 740 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 750 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 760 */ 2268, 2268, 2268, 2268, 2268, 2268, 2802, 2268, 2268, 2268, + /* 770 */ 2268, 2685, 2268, 2268, 2792, 2268, 2268, 2268, 2268, 2268, + /* 780 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 790 */ 2268, 3018, 2970, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 800 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 810 */ 2268, 2268, 2268, 2268, 2268, 2790, 2268, 3000, 2268, 2268, + /* 820 */ 2268, 2268, 2268, 2268, 2268, 3016, 2268, 3020, 2268, 2268, + /* 830 */ 2268, 2268, 2268, 2268, 2268, 2926, 2922, 2268, 2268, 2918, + /* 840 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 850 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 860 */ 2877, 2268, 2268, 2268, 2911, 2268, 2268, 2268, 2268, 2268, + /* 870 */ 2268, 2268, 2268, 2268, 2516, 2515, 2514, 2513, 2268, 2268, + /* 880 */ 2268, 2268, 2268, 2268, 2802, 2268, 2805, 2268, 2268, 2268, + /* 890 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 900 */ 2789, 2268, 2854, 2853, 2268, 2268, 2268, 2268, 2268, 2268, + /* 910 */ 2268, 2268, 2268, 2510, 2268, 2268, 2268, 2268, 2268, 2268, + /* 920 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2494, + /* 930 */ 2492, 2491, 2490, 2268, 2527, 2268, 2268, 2268, 2523, 2522, + /* 940 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 950 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2393, + /* 960 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2385, 2268, + /* 970 */ 2384, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 980 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 990 */ 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, + /* 1000 */ 2297, 2268, 2268, 2268, 2268, 2268, 2268, 2268, 2268, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1493,9 +1470,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* NK_DOT => nothing */ 0, /* WITH => nothing */ 0, /* ENCRYPT_KEY => nothing */ - 0, /* ANODE => nothing */ - 0, /* UPDATE => nothing */ - 0, /* ANODES => nothing */ 0, /* DNODE => nothing */ 0, /* PORT => nothing */ 0, /* DNODES => nothing */ @@ -1555,12 +1529,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 343, /* END => ABORT */ + 337, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ 0, /* USING => nothing */ - 343, /* FILE => ABORT */ + 337, /* FILE => ABORT */ 0, /* STABLE => nothing */ 0, /* COLUMN => nothing */ 0, /* MODIFY => nothing */ @@ -1628,7 +1602,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 343, /* VIEW => ABORT */ + 337, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1671,13 +1645,14 @@ static const YYCODETYPE yyFallback[] = { 0, /* PAUSE => nothing */ 0, /* RESUME => nothing */ 0, /* PRIMARY => nothing */ - 343, /* KEY => ABORT */ + 337, /* KEY => ABORT */ 0, /* TRIGGER => nothing */ 0, /* AT_ONCE => nothing */ 0, /* WINDOW_CLOSE => nothing */ 0, /* IGNORE => nothing */ 0, /* EXPIRED => nothing */ 0, /* FILL_HISTORY => nothing */ + 0, /* UPDATE => nothing */ 0, /* SUBTABLE => nothing */ 0, /* UNTREATED => nothing */ 0, /* KILL => nothing */ @@ -1706,13 +1681,10 @@ static const YYCODETYPE yyFallback[] = { 0, /* WDURATION => nothing */ 0, /* IROWTS => nothing */ 0, /* ISFILLED => nothing */ - 0, /* FLOW => nothing */ - 0, /* FHIGH => nothing */ - 0, /* FROWTS => nothing */ 0, /* CAST => nothing */ 0, /* POSITION => nothing */ 0, /* IN => nothing */ - 343, /* FOR => ABORT */ + 337, /* FOR => ABORT */ 0, /* NOW => nothing */ 0, /* TODAY => nothing */ 0, /* RAND => nothing */ @@ -1746,7 +1718,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* LEFT => nothing */ 0, /* RIGHT => nothing */ 0, /* OUTER => nothing */ - 343, /* SEMI => ABORT */ + 337, /* SEMI => ABORT */ 0, /* ANTI => nothing */ 0, /* ASOF => nothing */ 0, /* WINDOW => nothing */ @@ -1762,7 +1734,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* STATE_WINDOW => nothing */ 0, /* EVENT_WINDOW => nothing */ 0, /* COUNT_WINDOW => nothing */ - 0, /* ANOMALY_WINDOW => nothing */ 0, /* SLIDING => nothing */ 0, /* FILL => nothing */ 0, /* VALUE => nothing */ @@ -1783,51 +1754,51 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 343, /* AFTER => ABORT */ - 343, /* ATTACH => ABORT */ - 343, /* BEFORE => ABORT */ - 343, /* BEGIN => ABORT */ - 343, /* BITAND => ABORT */ - 343, /* BITNOT => ABORT */ - 343, /* BITOR => ABORT */ - 343, /* BLOCKS => ABORT */ - 343, /* CHANGE => ABORT */ - 343, /* COMMA => ABORT */ - 343, /* CONCAT => ABORT */ - 343, /* CONFLICT => ABORT */ - 343, /* COPY => ABORT */ - 343, /* DEFERRED => ABORT */ - 343, /* DELIMITERS => ABORT */ - 343, /* DETACH => ABORT */ - 343, /* DIVIDE => ABORT */ - 343, /* DOT => ABORT */ - 343, /* EACH => ABORT */ - 343, /* FAIL => ABORT */ - 343, /* GLOB => ABORT */ - 343, /* ID => ABORT */ - 343, /* IMMEDIATE => ABORT */ - 343, /* IMPORT => ABORT */ - 343, /* INITIALLY => ABORT */ - 343, /* INSTEAD => ABORT */ - 343, /* ISNULL => ABORT */ - 343, /* MODULES => ABORT */ - 343, /* NK_BITNOT => ABORT */ - 343, /* NK_SEMI => ABORT */ - 343, /* NOTNULL => ABORT */ - 343, /* OF => ABORT */ - 343, /* PLUS => ABORT */ - 343, /* PRIVILEGE => ABORT */ - 343, /* RAISE => ABORT */ - 343, /* RESTRICT => ABORT */ - 343, /* ROW => ABORT */ - 343, /* STAR => ABORT */ - 343, /* STATEMENT => ABORT */ - 343, /* STRICT => ABORT */ - 343, /* STRING => ABORT */ - 343, /* TIMES => ABORT */ - 343, /* VALUES => ABORT */ - 343, /* VARIABLE => ABORT */ - 343, /* WAL => ABORT */ + 337, /* AFTER => ABORT */ + 337, /* ATTACH => ABORT */ + 337, /* BEFORE => ABORT */ + 337, /* BEGIN => ABORT */ + 337, /* BITAND => ABORT */ + 337, /* BITNOT => ABORT */ + 337, /* BITOR => ABORT */ + 337, /* BLOCKS => ABORT */ + 337, /* CHANGE => ABORT */ + 337, /* COMMA => ABORT */ + 337, /* CONCAT => ABORT */ + 337, /* CONFLICT => ABORT */ + 337, /* COPY => ABORT */ + 337, /* DEFERRED => ABORT */ + 337, /* DELIMITERS => ABORT */ + 337, /* DETACH => ABORT */ + 337, /* DIVIDE => ABORT */ + 337, /* DOT => ABORT */ + 337, /* EACH => ABORT */ + 337, /* FAIL => ABORT */ + 337, /* GLOB => ABORT */ + 337, /* ID => ABORT */ + 337, /* IMMEDIATE => ABORT */ + 337, /* IMPORT => ABORT */ + 337, /* INITIALLY => ABORT */ + 337, /* INSTEAD => ABORT */ + 337, /* ISNULL => ABORT */ + 337, /* MODULES => ABORT */ + 337, /* NK_BITNOT => ABORT */ + 337, /* NK_SEMI => ABORT */ + 337, /* NOTNULL => ABORT */ + 337, /* OF => ABORT */ + 337, /* PLUS => ABORT */ + 337, /* PRIVILEGE => ABORT */ + 337, /* RAISE => ABORT */ + 337, /* RESTRICT => ABORT */ + 337, /* ROW => ABORT */ + 337, /* STAR => ABORT */ + 337, /* STATEMENT => ABORT */ + 337, /* STRICT => ABORT */ + 337, /* STRING => ABORT */ + 337, /* TIMES => ABORT */ + 337, /* VALUES => ABORT */ + 337, /* VARIABLE => ABORT */ + 337, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1969,525 +1940,519 @@ static const char *const yyTokenName[] = { /* 51 */ "NK_DOT", /* 52 */ "WITH", /* 53 */ "ENCRYPT_KEY", - /* 54 */ "ANODE", - /* 55 */ "UPDATE", - /* 56 */ "ANODES", - /* 57 */ "DNODE", - /* 58 */ "PORT", - /* 59 */ "DNODES", - /* 60 */ "RESTORE", - /* 61 */ "NK_IPTOKEN", - /* 62 */ "FORCE", - /* 63 */ "UNSAFE", - /* 64 */ "CLUSTER", - /* 65 */ "LOCAL", - /* 66 */ "QNODE", - /* 67 */ "BNODE", - /* 68 */ "SNODE", - /* 69 */ "MNODE", - /* 70 */ "VNODE", - /* 71 */ "DATABASE", - /* 72 */ "USE", - /* 73 */ "FLUSH", - /* 74 */ "TRIM", - /* 75 */ "S3MIGRATE", - /* 76 */ "COMPACT", - /* 77 */ "IF", - /* 78 */ "NOT", - /* 79 */ "EXISTS", - /* 80 */ "BUFFER", - /* 81 */ "CACHEMODEL", - /* 82 */ "CACHESIZE", - /* 83 */ "COMP", - /* 84 */ "DURATION", - /* 85 */ "NK_VARIABLE", - /* 86 */ "MAXROWS", - /* 87 */ "MINROWS", - /* 88 */ "KEEP", - /* 89 */ "PAGES", - /* 90 */ "PAGESIZE", - /* 91 */ "TSDB_PAGESIZE", - /* 92 */ "PRECISION", - /* 93 */ "REPLICA", - /* 94 */ "VGROUPS", - /* 95 */ "SINGLE_STABLE", - /* 96 */ "RETENTIONS", - /* 97 */ "SCHEMALESS", - /* 98 */ "WAL_LEVEL", - /* 99 */ "WAL_FSYNC_PERIOD", - /* 100 */ "WAL_RETENTION_PERIOD", - /* 101 */ "WAL_RETENTION_SIZE", - /* 102 */ "WAL_ROLL_PERIOD", - /* 103 */ "WAL_SEGMENT_SIZE", - /* 104 */ "STT_TRIGGER", - /* 105 */ "TABLE_PREFIX", - /* 106 */ "TABLE_SUFFIX", - /* 107 */ "S3_CHUNKSIZE", - /* 108 */ "S3_KEEPLOCAL", - /* 109 */ "S3_COMPACT", - /* 110 */ "KEEP_TIME_OFFSET", - /* 111 */ "ENCRYPT_ALGORITHM", - /* 112 */ "NK_COLON", - /* 113 */ "BWLIMIT", - /* 114 */ "START", - /* 115 */ "TIMESTAMP", - /* 116 */ "END", - /* 117 */ "TABLE", - /* 118 */ "NK_LP", - /* 119 */ "NK_RP", - /* 120 */ "USING", - /* 121 */ "FILE", - /* 122 */ "STABLE", - /* 123 */ "COLUMN", - /* 124 */ "MODIFY", - /* 125 */ "RENAME", - /* 126 */ "TAG", - /* 127 */ "SET", - /* 128 */ "NK_EQ", - /* 129 */ "TAGS", - /* 130 */ "BOOL", - /* 131 */ "TINYINT", - /* 132 */ "SMALLINT", - /* 133 */ "INT", - /* 134 */ "INTEGER", - /* 135 */ "BIGINT", - /* 136 */ "FLOAT", - /* 137 */ "DOUBLE", - /* 138 */ "BINARY", - /* 139 */ "NCHAR", - /* 140 */ "UNSIGNED", - /* 141 */ "JSON", - /* 142 */ "VARCHAR", - /* 143 */ "MEDIUMBLOB", - /* 144 */ "BLOB", - /* 145 */ "VARBINARY", - /* 146 */ "GEOMETRY", - /* 147 */ "DECIMAL", - /* 148 */ "COMMENT", - /* 149 */ "MAX_DELAY", - /* 150 */ "WATERMARK", - /* 151 */ "ROLLUP", - /* 152 */ "TTL", - /* 153 */ "SMA", - /* 154 */ "DELETE_MARK", - /* 155 */ "FIRST", - /* 156 */ "LAST", - /* 157 */ "SHOW", - /* 158 */ "FULL", - /* 159 */ "PRIVILEGES", - /* 160 */ "DATABASES", - /* 161 */ "TABLES", - /* 162 */ "STABLES", - /* 163 */ "MNODES", - /* 164 */ "QNODES", - /* 165 */ "ARBGROUPS", - /* 166 */ "FUNCTIONS", - /* 167 */ "INDEXES", - /* 168 */ "ACCOUNTS", - /* 169 */ "APPS", - /* 170 */ "CONNECTIONS", - /* 171 */ "LICENCES", - /* 172 */ "GRANTS", - /* 173 */ "LOGS", - /* 174 */ "MACHINES", - /* 175 */ "ENCRYPTIONS", - /* 176 */ "QUERIES", - /* 177 */ "SCORES", - /* 178 */ "TOPICS", - /* 179 */ "VARIABLES", - /* 180 */ "BNODES", - /* 181 */ "SNODES", - /* 182 */ "TRANSACTIONS", - /* 183 */ "DISTRIBUTED", - /* 184 */ "CONSUMERS", - /* 185 */ "SUBSCRIPTIONS", - /* 186 */ "VNODES", - /* 187 */ "ALIVE", - /* 188 */ "VIEWS", - /* 189 */ "VIEW", - /* 190 */ "COMPACTS", - /* 191 */ "NORMAL", - /* 192 */ "CHILD", - /* 193 */ "LIKE", - /* 194 */ "TBNAME", - /* 195 */ "QTAGS", - /* 196 */ "AS", - /* 197 */ "SYSTEM", - /* 198 */ "TSMA", - /* 199 */ "INTERVAL", - /* 200 */ "RECURSIVE", - /* 201 */ "TSMAS", - /* 202 */ "FUNCTION", - /* 203 */ "INDEX", - /* 204 */ "COUNT", - /* 205 */ "LAST_ROW", - /* 206 */ "META", - /* 207 */ "ONLY", - /* 208 */ "TOPIC", - /* 209 */ "CONSUMER", - /* 210 */ "GROUP", - /* 211 */ "DESC", - /* 212 */ "DESCRIBE", - /* 213 */ "RESET", - /* 214 */ "QUERY", - /* 215 */ "CACHE", - /* 216 */ "EXPLAIN", - /* 217 */ "ANALYZE", - /* 218 */ "VERBOSE", - /* 219 */ "NK_BOOL", - /* 220 */ "RATIO", - /* 221 */ "NK_FLOAT", - /* 222 */ "OUTPUTTYPE", - /* 223 */ "AGGREGATE", - /* 224 */ "BUFSIZE", - /* 225 */ "LANGUAGE", - /* 226 */ "REPLACE", - /* 227 */ "STREAM", - /* 228 */ "INTO", - /* 229 */ "PAUSE", - /* 230 */ "RESUME", - /* 231 */ "PRIMARY", - /* 232 */ "KEY", - /* 233 */ "TRIGGER", - /* 234 */ "AT_ONCE", - /* 235 */ "WINDOW_CLOSE", - /* 236 */ "IGNORE", - /* 237 */ "EXPIRED", - /* 238 */ "FILL_HISTORY", - /* 239 */ "SUBTABLE", - /* 240 */ "UNTREATED", - /* 241 */ "KILL", - /* 242 */ "CONNECTION", - /* 243 */ "TRANSACTION", - /* 244 */ "BALANCE", - /* 245 */ "VGROUP", - /* 246 */ "LEADER", - /* 247 */ "MERGE", - /* 248 */ "REDISTRIBUTE", - /* 249 */ "SPLIT", - /* 250 */ "DELETE", - /* 251 */ "INSERT", - /* 252 */ "NK_BIN", - /* 253 */ "NK_HEX", - /* 254 */ "NULL", - /* 255 */ "NK_QUESTION", - /* 256 */ "NK_ALIAS", - /* 257 */ "NK_ARROW", - /* 258 */ "ROWTS", - /* 259 */ "QSTART", - /* 260 */ "QEND", - /* 261 */ "QDURATION", - /* 262 */ "WSTART", - /* 263 */ "WEND", - /* 264 */ "WDURATION", - /* 265 */ "IROWTS", - /* 266 */ "ISFILLED", - /* 267 */ "FLOW", - /* 268 */ "FHIGH", - /* 269 */ "FROWTS", - /* 270 */ "CAST", - /* 271 */ "POSITION", - /* 272 */ "IN", - /* 273 */ "FOR", - /* 274 */ "NOW", - /* 275 */ "TODAY", - /* 276 */ "RAND", - /* 277 */ "SUBSTR", - /* 278 */ "SUBSTRING", - /* 279 */ "BOTH", - /* 280 */ "TRAILING", - /* 281 */ "LEADING", - /* 282 */ "TIMEZONE", - /* 283 */ "CLIENT_VERSION", - /* 284 */ "SERVER_VERSION", - /* 285 */ "SERVER_STATUS", - /* 286 */ "CURRENT_USER", - /* 287 */ "PI", - /* 288 */ "CASE", - /* 289 */ "WHEN", - /* 290 */ "THEN", - /* 291 */ "ELSE", - /* 292 */ "BETWEEN", - /* 293 */ "IS", - /* 294 */ "NK_LT", - /* 295 */ "NK_GT", - /* 296 */ "NK_LE", - /* 297 */ "NK_GE", - /* 298 */ "NK_NE", - /* 299 */ "MATCH", - /* 300 */ "NMATCH", - /* 301 */ "CONTAINS", - /* 302 */ "JOIN", - /* 303 */ "INNER", - /* 304 */ "LEFT", - /* 305 */ "RIGHT", - /* 306 */ "OUTER", - /* 307 */ "SEMI", - /* 308 */ "ANTI", - /* 309 */ "ASOF", - /* 310 */ "WINDOW", - /* 311 */ "WINDOW_OFFSET", - /* 312 */ "JLIMIT", - /* 313 */ "SELECT", - /* 314 */ "NK_HINT", - /* 315 */ "DISTINCT", - /* 316 */ "WHERE", - /* 317 */ "PARTITION", - /* 318 */ "BY", - /* 319 */ "SESSION", - /* 320 */ "STATE_WINDOW", - /* 321 */ "EVENT_WINDOW", - /* 322 */ "COUNT_WINDOW", - /* 323 */ "ANOMALY_WINDOW", - /* 324 */ "SLIDING", - /* 325 */ "FILL", - /* 326 */ "VALUE", - /* 327 */ "VALUE_F", - /* 328 */ "NONE", - /* 329 */ "PREV", - /* 330 */ "NULL_F", - /* 331 */ "LINEAR", - /* 332 */ "NEXT", - /* 333 */ "HAVING", - /* 334 */ "RANGE", - /* 335 */ "EVERY", - /* 336 */ "ORDER", - /* 337 */ "SLIMIT", - /* 338 */ "SOFFSET", - /* 339 */ "LIMIT", - /* 340 */ "OFFSET", - /* 341 */ "ASC", - /* 342 */ "NULLS", - /* 343 */ "ABORT", - /* 344 */ "AFTER", - /* 345 */ "ATTACH", - /* 346 */ "BEFORE", - /* 347 */ "BEGIN", - /* 348 */ "BITAND", - /* 349 */ "BITNOT", - /* 350 */ "BITOR", - /* 351 */ "BLOCKS", - /* 352 */ "CHANGE", - /* 353 */ "COMMA", - /* 354 */ "CONCAT", - /* 355 */ "CONFLICT", - /* 356 */ "COPY", - /* 357 */ "DEFERRED", - /* 358 */ "DELIMITERS", - /* 359 */ "DETACH", - /* 360 */ "DIVIDE", - /* 361 */ "DOT", - /* 362 */ "EACH", - /* 363 */ "FAIL", - /* 364 */ "GLOB", - /* 365 */ "ID", - /* 366 */ "IMMEDIATE", - /* 367 */ "IMPORT", - /* 368 */ "INITIALLY", - /* 369 */ "INSTEAD", - /* 370 */ "ISNULL", - /* 371 */ "MODULES", - /* 372 */ "NK_BITNOT", - /* 373 */ "NK_SEMI", - /* 374 */ "NOTNULL", - /* 375 */ "OF", - /* 376 */ "PLUS", - /* 377 */ "PRIVILEGE", - /* 378 */ "RAISE", - /* 379 */ "RESTRICT", - /* 380 */ "ROW", - /* 381 */ "STAR", - /* 382 */ "STATEMENT", - /* 383 */ "STRICT", - /* 384 */ "STRING", - /* 385 */ "TIMES", - /* 386 */ "VALUES", - /* 387 */ "VARIABLE", - /* 388 */ "WAL", - /* 389 */ "cmd", - /* 390 */ "account_options", - /* 391 */ "alter_account_options", - /* 392 */ "literal", - /* 393 */ "alter_account_option", - /* 394 */ "ip_range_list", - /* 395 */ "white_list", - /* 396 */ "white_list_opt", - /* 397 */ "is_import_opt", - /* 398 */ "is_createdb_opt", - /* 399 */ "user_name", - /* 400 */ "sysinfo_opt", - /* 401 */ "privileges", - /* 402 */ "priv_level", - /* 403 */ "with_clause_opt", - /* 404 */ "priv_type_list", - /* 405 */ "priv_type", - /* 406 */ "db_name", - /* 407 */ "table_name", - /* 408 */ "topic_name", - /* 409 */ "search_condition", - /* 410 */ "dnode_endpoint", - /* 411 */ "force_opt", - /* 412 */ "unsafe_opt", - /* 413 */ "not_exists_opt", - /* 414 */ "db_options", - /* 415 */ "exists_opt", - /* 416 */ "alter_db_options", - /* 417 */ "speed_opt", - /* 418 */ "start_opt", - /* 419 */ "end_opt", - /* 420 */ "integer_list", - /* 421 */ "variable_list", - /* 422 */ "retention_list", - /* 423 */ "signed", - /* 424 */ "alter_db_option", - /* 425 */ "retention", - /* 426 */ "full_table_name", - /* 427 */ "column_def_list", - /* 428 */ "tags_def_opt", - /* 429 */ "table_options", - /* 430 */ "multi_create_clause", - /* 431 */ "tag_list_opt", - /* 432 */ "tags_def", - /* 433 */ "with_opt", - /* 434 */ "multi_drop_clause", - /* 435 */ "alter_table_clause", - /* 436 */ "alter_table_options", - /* 437 */ "column_name", - /* 438 */ "type_name", - /* 439 */ "column_options", - /* 440 */ "tags_literal", - /* 441 */ "create_subtable_clause", - /* 442 */ "specific_cols_opt", - /* 443 */ "tags_literal_list", - /* 444 */ "drop_table_clause", - /* 445 */ "col_name_list", - /* 446 */ "tag_def_list", - /* 447 */ "tag_def", - /* 448 */ "column_def", - /* 449 */ "type_name_default_len", - /* 450 */ "duration_list", - /* 451 */ "rollup_func_list", - /* 452 */ "alter_table_option", - /* 453 */ "duration_literal", - /* 454 */ "rollup_func_name", - /* 455 */ "function_name", - /* 456 */ "col_name", - /* 457 */ "db_kind_opt", - /* 458 */ "table_kind_db_name_cond_opt", - /* 459 */ "like_pattern_opt", - /* 460 */ "db_name_cond_opt", - /* 461 */ "table_name_cond", - /* 462 */ "from_db_opt", - /* 463 */ "table_kind", - /* 464 */ "tag_item", - /* 465 */ "column_alias", - /* 466 */ "tsma_name", - /* 467 */ "tsma_func_list", - /* 468 */ "full_tsma_name", - /* 469 */ "func_list", - /* 470 */ "index_options", - /* 471 */ "full_index_name", - /* 472 */ "index_name", - /* 473 */ "sliding_opt", - /* 474 */ "sma_stream_opt", - /* 475 */ "func", - /* 476 */ "sma_func_name", - /* 477 */ "expression_list", - /* 478 */ "with_meta", - /* 479 */ "query_or_subquery", - /* 480 */ "where_clause_opt", - /* 481 */ "cgroup_name", - /* 482 */ "analyze_opt", - /* 483 */ "explain_options", - /* 484 */ "insert_query", - /* 485 */ "or_replace_opt", - /* 486 */ "agg_func_opt", - /* 487 */ "bufsize_opt", - /* 488 */ "language_opt", - /* 489 */ "full_view_name", - /* 490 */ "view_name", - /* 491 */ "stream_name", - /* 492 */ "stream_options", - /* 493 */ "col_list_opt", - /* 494 */ "tag_def_or_ref_opt", - /* 495 */ "subtable_opt", - /* 496 */ "ignore_opt", - /* 497 */ "column_stream_def_list", - /* 498 */ "column_stream_def", - /* 499 */ "stream_col_options", - /* 500 */ "expression", - /* 501 */ "on_vgroup_id", - /* 502 */ "dnode_list", - /* 503 */ "literal_func", - /* 504 */ "signed_literal", - /* 505 */ "literal_list", - /* 506 */ "table_alias", - /* 507 */ "expr_or_subquery", - /* 508 */ "pseudo_column", - /* 509 */ "column_reference", - /* 510 */ "function_expression", - /* 511 */ "case_when_expression", - /* 512 */ "star_func", - /* 513 */ "star_func_para_list", - /* 514 */ "trim_specification_type", - /* 515 */ "substr_func", - /* 516 */ "rand_func", - /* 517 */ "noarg_func", - /* 518 */ "other_para_list", - /* 519 */ "star_func_para", - /* 520 */ "when_then_list", - /* 521 */ "case_when_else_opt", - /* 522 */ "common_expression", - /* 523 */ "when_then_expr", - /* 524 */ "predicate", - /* 525 */ "compare_op", - /* 526 */ "in_op", - /* 527 */ "in_predicate_value", - /* 528 */ "boolean_value_expression", - /* 529 */ "boolean_primary", - /* 530 */ "from_clause_opt", - /* 531 */ "table_reference_list", - /* 532 */ "table_reference", - /* 533 */ "table_primary", - /* 534 */ "joined_table", - /* 535 */ "alias_opt", - /* 536 */ "subquery", - /* 537 */ "parenthesized_joined_table", - /* 538 */ "join_type", - /* 539 */ "join_subtype", - /* 540 */ "join_on_clause_opt", - /* 541 */ "window_offset_clause_opt", - /* 542 */ "jlimit_clause_opt", - /* 543 */ "window_offset_literal", - /* 544 */ "query_specification", - /* 545 */ "hint_list", - /* 546 */ "set_quantifier_opt", - /* 547 */ "tag_mode_opt", - /* 548 */ "select_list", - /* 549 */ "partition_by_clause_opt", - /* 550 */ "range_opt", - /* 551 */ "every_opt", - /* 552 */ "fill_opt", - /* 553 */ "twindow_clause_opt", - /* 554 */ "group_by_clause_opt", - /* 555 */ "having_clause_opt", - /* 556 */ "select_item", - /* 557 */ "partition_list", - /* 558 */ "partition_item", - /* 559 */ "interval_sliding_duration_literal", - /* 560 */ "fill_mode", - /* 561 */ "group_by_list", - /* 562 */ "query_expression", - /* 563 */ "query_simple", - /* 564 */ "order_by_clause_opt", - /* 565 */ "slimit_clause_opt", - /* 566 */ "limit_clause_opt", - /* 567 */ "union_query_expression", - /* 568 */ "query_simple_or_subquery", - /* 569 */ "sort_specification_list", - /* 570 */ "sort_specification", - /* 571 */ "ordering_specification_opt", - /* 572 */ "null_ordering_opt", + /* 54 */ "DNODE", + /* 55 */ "PORT", + /* 56 */ "DNODES", + /* 57 */ "RESTORE", + /* 58 */ "NK_IPTOKEN", + /* 59 */ "FORCE", + /* 60 */ "UNSAFE", + /* 61 */ "CLUSTER", + /* 62 */ "LOCAL", + /* 63 */ "QNODE", + /* 64 */ "BNODE", + /* 65 */ "SNODE", + /* 66 */ "MNODE", + /* 67 */ "VNODE", + /* 68 */ "DATABASE", + /* 69 */ "USE", + /* 70 */ "FLUSH", + /* 71 */ "TRIM", + /* 72 */ "S3MIGRATE", + /* 73 */ "COMPACT", + /* 74 */ "IF", + /* 75 */ "NOT", + /* 76 */ "EXISTS", + /* 77 */ "BUFFER", + /* 78 */ "CACHEMODEL", + /* 79 */ "CACHESIZE", + /* 80 */ "COMP", + /* 81 */ "DURATION", + /* 82 */ "NK_VARIABLE", + /* 83 */ "MAXROWS", + /* 84 */ "MINROWS", + /* 85 */ "KEEP", + /* 86 */ "PAGES", + /* 87 */ "PAGESIZE", + /* 88 */ "TSDB_PAGESIZE", + /* 89 */ "PRECISION", + /* 90 */ "REPLICA", + /* 91 */ "VGROUPS", + /* 92 */ "SINGLE_STABLE", + /* 93 */ "RETENTIONS", + /* 94 */ "SCHEMALESS", + /* 95 */ "WAL_LEVEL", + /* 96 */ "WAL_FSYNC_PERIOD", + /* 97 */ "WAL_RETENTION_PERIOD", + /* 98 */ "WAL_RETENTION_SIZE", + /* 99 */ "WAL_ROLL_PERIOD", + /* 100 */ "WAL_SEGMENT_SIZE", + /* 101 */ "STT_TRIGGER", + /* 102 */ "TABLE_PREFIX", + /* 103 */ "TABLE_SUFFIX", + /* 104 */ "S3_CHUNKSIZE", + /* 105 */ "S3_KEEPLOCAL", + /* 106 */ "S3_COMPACT", + /* 107 */ "KEEP_TIME_OFFSET", + /* 108 */ "ENCRYPT_ALGORITHM", + /* 109 */ "NK_COLON", + /* 110 */ "BWLIMIT", + /* 111 */ "START", + /* 112 */ "TIMESTAMP", + /* 113 */ "END", + /* 114 */ "TABLE", + /* 115 */ "NK_LP", + /* 116 */ "NK_RP", + /* 117 */ "USING", + /* 118 */ "FILE", + /* 119 */ "STABLE", + /* 120 */ "COLUMN", + /* 121 */ "MODIFY", + /* 122 */ "RENAME", + /* 123 */ "TAG", + /* 124 */ "SET", + /* 125 */ "NK_EQ", + /* 126 */ "TAGS", + /* 127 */ "BOOL", + /* 128 */ "TINYINT", + /* 129 */ "SMALLINT", + /* 130 */ "INT", + /* 131 */ "INTEGER", + /* 132 */ "BIGINT", + /* 133 */ "FLOAT", + /* 134 */ "DOUBLE", + /* 135 */ "BINARY", + /* 136 */ "NCHAR", + /* 137 */ "UNSIGNED", + /* 138 */ "JSON", + /* 139 */ "VARCHAR", + /* 140 */ "MEDIUMBLOB", + /* 141 */ "BLOB", + /* 142 */ "VARBINARY", + /* 143 */ "GEOMETRY", + /* 144 */ "DECIMAL", + /* 145 */ "COMMENT", + /* 146 */ "MAX_DELAY", + /* 147 */ "WATERMARK", + /* 148 */ "ROLLUP", + /* 149 */ "TTL", + /* 150 */ "SMA", + /* 151 */ "DELETE_MARK", + /* 152 */ "FIRST", + /* 153 */ "LAST", + /* 154 */ "SHOW", + /* 155 */ "FULL", + /* 156 */ "PRIVILEGES", + /* 157 */ "DATABASES", + /* 158 */ "TABLES", + /* 159 */ "STABLES", + /* 160 */ "MNODES", + /* 161 */ "QNODES", + /* 162 */ "ARBGROUPS", + /* 163 */ "FUNCTIONS", + /* 164 */ "INDEXES", + /* 165 */ "ACCOUNTS", + /* 166 */ "APPS", + /* 167 */ "CONNECTIONS", + /* 168 */ "LICENCES", + /* 169 */ "GRANTS", + /* 170 */ "LOGS", + /* 171 */ "MACHINES", + /* 172 */ "ENCRYPTIONS", + /* 173 */ "QUERIES", + /* 174 */ "SCORES", + /* 175 */ "TOPICS", + /* 176 */ "VARIABLES", + /* 177 */ "BNODES", + /* 178 */ "SNODES", + /* 179 */ "TRANSACTIONS", + /* 180 */ "DISTRIBUTED", + /* 181 */ "CONSUMERS", + /* 182 */ "SUBSCRIPTIONS", + /* 183 */ "VNODES", + /* 184 */ "ALIVE", + /* 185 */ "VIEWS", + /* 186 */ "VIEW", + /* 187 */ "COMPACTS", + /* 188 */ "NORMAL", + /* 189 */ "CHILD", + /* 190 */ "LIKE", + /* 191 */ "TBNAME", + /* 192 */ "QTAGS", + /* 193 */ "AS", + /* 194 */ "SYSTEM", + /* 195 */ "TSMA", + /* 196 */ "INTERVAL", + /* 197 */ "RECURSIVE", + /* 198 */ "TSMAS", + /* 199 */ "FUNCTION", + /* 200 */ "INDEX", + /* 201 */ "COUNT", + /* 202 */ "LAST_ROW", + /* 203 */ "META", + /* 204 */ "ONLY", + /* 205 */ "TOPIC", + /* 206 */ "CONSUMER", + /* 207 */ "GROUP", + /* 208 */ "DESC", + /* 209 */ "DESCRIBE", + /* 210 */ "RESET", + /* 211 */ "QUERY", + /* 212 */ "CACHE", + /* 213 */ "EXPLAIN", + /* 214 */ "ANALYZE", + /* 215 */ "VERBOSE", + /* 216 */ "NK_BOOL", + /* 217 */ "RATIO", + /* 218 */ "NK_FLOAT", + /* 219 */ "OUTPUTTYPE", + /* 220 */ "AGGREGATE", + /* 221 */ "BUFSIZE", + /* 222 */ "LANGUAGE", + /* 223 */ "REPLACE", + /* 224 */ "STREAM", + /* 225 */ "INTO", + /* 226 */ "PAUSE", + /* 227 */ "RESUME", + /* 228 */ "PRIMARY", + /* 229 */ "KEY", + /* 230 */ "TRIGGER", + /* 231 */ "AT_ONCE", + /* 232 */ "WINDOW_CLOSE", + /* 233 */ "IGNORE", + /* 234 */ "EXPIRED", + /* 235 */ "FILL_HISTORY", + /* 236 */ "UPDATE", + /* 237 */ "SUBTABLE", + /* 238 */ "UNTREATED", + /* 239 */ "KILL", + /* 240 */ "CONNECTION", + /* 241 */ "TRANSACTION", + /* 242 */ "BALANCE", + /* 243 */ "VGROUP", + /* 244 */ "LEADER", + /* 245 */ "MERGE", + /* 246 */ "REDISTRIBUTE", + /* 247 */ "SPLIT", + /* 248 */ "DELETE", + /* 249 */ "INSERT", + /* 250 */ "NK_BIN", + /* 251 */ "NK_HEX", + /* 252 */ "NULL", + /* 253 */ "NK_QUESTION", + /* 254 */ "NK_ALIAS", + /* 255 */ "NK_ARROW", + /* 256 */ "ROWTS", + /* 257 */ "QSTART", + /* 258 */ "QEND", + /* 259 */ "QDURATION", + /* 260 */ "WSTART", + /* 261 */ "WEND", + /* 262 */ "WDURATION", + /* 263 */ "IROWTS", + /* 264 */ "ISFILLED", + /* 265 */ "CAST", + /* 266 */ "POSITION", + /* 267 */ "IN", + /* 268 */ "FOR", + /* 269 */ "NOW", + /* 270 */ "TODAY", + /* 271 */ "RAND", + /* 272 */ "SUBSTR", + /* 273 */ "SUBSTRING", + /* 274 */ "BOTH", + /* 275 */ "TRAILING", + /* 276 */ "LEADING", + /* 277 */ "TIMEZONE", + /* 278 */ "CLIENT_VERSION", + /* 279 */ "SERVER_VERSION", + /* 280 */ "SERVER_STATUS", + /* 281 */ "CURRENT_USER", + /* 282 */ "PI", + /* 283 */ "CASE", + /* 284 */ "WHEN", + /* 285 */ "THEN", + /* 286 */ "ELSE", + /* 287 */ "BETWEEN", + /* 288 */ "IS", + /* 289 */ "NK_LT", + /* 290 */ "NK_GT", + /* 291 */ "NK_LE", + /* 292 */ "NK_GE", + /* 293 */ "NK_NE", + /* 294 */ "MATCH", + /* 295 */ "NMATCH", + /* 296 */ "CONTAINS", + /* 297 */ "JOIN", + /* 298 */ "INNER", + /* 299 */ "LEFT", + /* 300 */ "RIGHT", + /* 301 */ "OUTER", + /* 302 */ "SEMI", + /* 303 */ "ANTI", + /* 304 */ "ASOF", + /* 305 */ "WINDOW", + /* 306 */ "WINDOW_OFFSET", + /* 307 */ "JLIMIT", + /* 308 */ "SELECT", + /* 309 */ "NK_HINT", + /* 310 */ "DISTINCT", + /* 311 */ "WHERE", + /* 312 */ "PARTITION", + /* 313 */ "BY", + /* 314 */ "SESSION", + /* 315 */ "STATE_WINDOW", + /* 316 */ "EVENT_WINDOW", + /* 317 */ "COUNT_WINDOW", + /* 318 */ "SLIDING", + /* 319 */ "FILL", + /* 320 */ "VALUE", + /* 321 */ "VALUE_F", + /* 322 */ "NONE", + /* 323 */ "PREV", + /* 324 */ "NULL_F", + /* 325 */ "LINEAR", + /* 326 */ "NEXT", + /* 327 */ "HAVING", + /* 328 */ "RANGE", + /* 329 */ "EVERY", + /* 330 */ "ORDER", + /* 331 */ "SLIMIT", + /* 332 */ "SOFFSET", + /* 333 */ "LIMIT", + /* 334 */ "OFFSET", + /* 335 */ "ASC", + /* 336 */ "NULLS", + /* 337 */ "ABORT", + /* 338 */ "AFTER", + /* 339 */ "ATTACH", + /* 340 */ "BEFORE", + /* 341 */ "BEGIN", + /* 342 */ "BITAND", + /* 343 */ "BITNOT", + /* 344 */ "BITOR", + /* 345 */ "BLOCKS", + /* 346 */ "CHANGE", + /* 347 */ "COMMA", + /* 348 */ "CONCAT", + /* 349 */ "CONFLICT", + /* 350 */ "COPY", + /* 351 */ "DEFERRED", + /* 352 */ "DELIMITERS", + /* 353 */ "DETACH", + /* 354 */ "DIVIDE", + /* 355 */ "DOT", + /* 356 */ "EACH", + /* 357 */ "FAIL", + /* 358 */ "GLOB", + /* 359 */ "ID", + /* 360 */ "IMMEDIATE", + /* 361 */ "IMPORT", + /* 362 */ "INITIALLY", + /* 363 */ "INSTEAD", + /* 364 */ "ISNULL", + /* 365 */ "MODULES", + /* 366 */ "NK_BITNOT", + /* 367 */ "NK_SEMI", + /* 368 */ "NOTNULL", + /* 369 */ "OF", + /* 370 */ "PLUS", + /* 371 */ "PRIVILEGE", + /* 372 */ "RAISE", + /* 373 */ "RESTRICT", + /* 374 */ "ROW", + /* 375 */ "STAR", + /* 376 */ "STATEMENT", + /* 377 */ "STRICT", + /* 378 */ "STRING", + /* 379 */ "TIMES", + /* 380 */ "VALUES", + /* 381 */ "VARIABLE", + /* 382 */ "WAL", + /* 383 */ "cmd", + /* 384 */ "account_options", + /* 385 */ "alter_account_options", + /* 386 */ "literal", + /* 387 */ "alter_account_option", + /* 388 */ "ip_range_list", + /* 389 */ "white_list", + /* 390 */ "white_list_opt", + /* 391 */ "is_import_opt", + /* 392 */ "is_createdb_opt", + /* 393 */ "user_name", + /* 394 */ "sysinfo_opt", + /* 395 */ "privileges", + /* 396 */ "priv_level", + /* 397 */ "with_clause_opt", + /* 398 */ "priv_type_list", + /* 399 */ "priv_type", + /* 400 */ "db_name", + /* 401 */ "table_name", + /* 402 */ "topic_name", + /* 403 */ "search_condition", + /* 404 */ "dnode_endpoint", + /* 405 */ "force_opt", + /* 406 */ "unsafe_opt", + /* 407 */ "not_exists_opt", + /* 408 */ "db_options", + /* 409 */ "exists_opt", + /* 410 */ "alter_db_options", + /* 411 */ "speed_opt", + /* 412 */ "start_opt", + /* 413 */ "end_opt", + /* 414 */ "integer_list", + /* 415 */ "variable_list", + /* 416 */ "retention_list", + /* 417 */ "signed", + /* 418 */ "alter_db_option", + /* 419 */ "retention", + /* 420 */ "full_table_name", + /* 421 */ "column_def_list", + /* 422 */ "tags_def_opt", + /* 423 */ "table_options", + /* 424 */ "multi_create_clause", + /* 425 */ "tag_list_opt", + /* 426 */ "tags_def", + /* 427 */ "with_opt", + /* 428 */ "multi_drop_clause", + /* 429 */ "alter_table_clause", + /* 430 */ "alter_table_options", + /* 431 */ "column_name", + /* 432 */ "type_name", + /* 433 */ "column_options", + /* 434 */ "tags_literal", + /* 435 */ "create_subtable_clause", + /* 436 */ "specific_cols_opt", + /* 437 */ "tags_literal_list", + /* 438 */ "drop_table_clause", + /* 439 */ "col_name_list", + /* 440 */ "tag_def_list", + /* 441 */ "tag_def", + /* 442 */ "column_def", + /* 443 */ "type_name_default_len", + /* 444 */ "duration_list", + /* 445 */ "rollup_func_list", + /* 446 */ "alter_table_option", + /* 447 */ "duration_literal", + /* 448 */ "rollup_func_name", + /* 449 */ "function_name", + /* 450 */ "col_name", + /* 451 */ "db_kind_opt", + /* 452 */ "table_kind_db_name_cond_opt", + /* 453 */ "like_pattern_opt", + /* 454 */ "db_name_cond_opt", + /* 455 */ "table_name_cond", + /* 456 */ "from_db_opt", + /* 457 */ "table_kind", + /* 458 */ "tag_item", + /* 459 */ "column_alias", + /* 460 */ "tsma_name", + /* 461 */ "tsma_func_list", + /* 462 */ "full_tsma_name", + /* 463 */ "func_list", + /* 464 */ "index_options", + /* 465 */ "full_index_name", + /* 466 */ "index_name", + /* 467 */ "sliding_opt", + /* 468 */ "sma_stream_opt", + /* 469 */ "func", + /* 470 */ "sma_func_name", + /* 471 */ "expression_list", + /* 472 */ "with_meta", + /* 473 */ "query_or_subquery", + /* 474 */ "where_clause_opt", + /* 475 */ "cgroup_name", + /* 476 */ "analyze_opt", + /* 477 */ "explain_options", + /* 478 */ "insert_query", + /* 479 */ "or_replace_opt", + /* 480 */ "agg_func_opt", + /* 481 */ "bufsize_opt", + /* 482 */ "language_opt", + /* 483 */ "full_view_name", + /* 484 */ "view_name", + /* 485 */ "stream_name", + /* 486 */ "stream_options", + /* 487 */ "col_list_opt", + /* 488 */ "tag_def_or_ref_opt", + /* 489 */ "subtable_opt", + /* 490 */ "ignore_opt", + /* 491 */ "column_stream_def_list", + /* 492 */ "column_stream_def", + /* 493 */ "stream_col_options", + /* 494 */ "expression", + /* 495 */ "on_vgroup_id", + /* 496 */ "dnode_list", + /* 497 */ "literal_func", + /* 498 */ "signed_literal", + /* 499 */ "literal_list", + /* 500 */ "table_alias", + /* 501 */ "expr_or_subquery", + /* 502 */ "pseudo_column", + /* 503 */ "column_reference", + /* 504 */ "function_expression", + /* 505 */ "case_when_expression", + /* 506 */ "star_func", + /* 507 */ "star_func_para_list", + /* 508 */ "trim_specification_type", + /* 509 */ "substr_func", + /* 510 */ "rand_func", + /* 511 */ "noarg_func", + /* 512 */ "other_para_list", + /* 513 */ "star_func_para", + /* 514 */ "when_then_list", + /* 515 */ "case_when_else_opt", + /* 516 */ "common_expression", + /* 517 */ "when_then_expr", + /* 518 */ "predicate", + /* 519 */ "compare_op", + /* 520 */ "in_op", + /* 521 */ "in_predicate_value", + /* 522 */ "boolean_value_expression", + /* 523 */ "boolean_primary", + /* 524 */ "from_clause_opt", + /* 525 */ "table_reference_list", + /* 526 */ "table_reference", + /* 527 */ "table_primary", + /* 528 */ "joined_table", + /* 529 */ "alias_opt", + /* 530 */ "subquery", + /* 531 */ "parenthesized_joined_table", + /* 532 */ "join_type", + /* 533 */ "join_subtype", + /* 534 */ "join_on_clause_opt", + /* 535 */ "window_offset_clause_opt", + /* 536 */ "jlimit_clause_opt", + /* 537 */ "window_offset_literal", + /* 538 */ "query_specification", + /* 539 */ "hint_list", + /* 540 */ "set_quantifier_opt", + /* 541 */ "tag_mode_opt", + /* 542 */ "select_list", + /* 543 */ "partition_by_clause_opt", + /* 544 */ "range_opt", + /* 545 */ "every_opt", + /* 546 */ "fill_opt", + /* 547 */ "twindow_clause_opt", + /* 548 */ "group_by_clause_opt", + /* 549 */ "having_clause_opt", + /* 550 */ "select_item", + /* 551 */ "partition_list", + /* 552 */ "partition_item", + /* 553 */ "interval_sliding_duration_literal", + /* 554 */ "fill_mode", + /* 555 */ "group_by_list", + /* 556 */ "query_expression", + /* 557 */ "query_simple", + /* 558 */ "order_by_clause_opt", + /* 559 */ "slimit_clause_opt", + /* 560 */ "limit_clause_opt", + /* 561 */ "union_query_expression", + /* 562 */ "query_simple_or_subquery", + /* 563 */ "sort_specification_list", + /* 564 */ "sort_specification", + /* 565 */ "ordering_specification_opt", + /* 566 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2555,730 +2520,719 @@ static const char *const yyRuleName[] = { /* 57 */ "with_clause_opt ::=", /* 58 */ "with_clause_opt ::= WITH search_condition", /* 59 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", - /* 60 */ "cmd ::= CREATE ANODE NK_STRING", - /* 61 */ "cmd ::= UPDATE ANODE NK_INTEGER", - /* 62 */ "cmd ::= UPDATE ALL ANODES", - /* 63 */ "cmd ::= DROP ANODE NK_INTEGER", - /* 64 */ "cmd ::= CREATE DNODE dnode_endpoint", - /* 65 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", - /* 66 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", - /* 67 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", - /* 68 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", - /* 69 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", - /* 70 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", - /* 71 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", - /* 72 */ "cmd ::= ALTER ALL DNODES NK_STRING", - /* 73 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", - /* 74 */ "cmd ::= RESTORE DNODE NK_INTEGER", - /* 75 */ "dnode_endpoint ::= NK_STRING", - /* 76 */ "dnode_endpoint ::= NK_ID", - /* 77 */ "dnode_endpoint ::= NK_IPTOKEN", - /* 78 */ "force_opt ::=", - /* 79 */ "force_opt ::= FORCE", - /* 80 */ "unsafe_opt ::= UNSAFE", - /* 81 */ "cmd ::= ALTER CLUSTER NK_STRING", - /* 82 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", - /* 83 */ "cmd ::= ALTER LOCAL NK_STRING", - /* 84 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", - /* 85 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 86 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", - /* 87 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", - /* 88 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", - /* 89 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", - /* 90 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", - /* 91 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", - /* 92 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", - /* 93 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", - /* 94 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", - /* 95 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", - /* 96 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 97 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 98 */ "cmd ::= USE db_name", - /* 99 */ "cmd ::= ALTER DATABASE db_name alter_db_options", - /* 100 */ "cmd ::= FLUSH DATABASE db_name", - /* 101 */ "cmd ::= TRIM DATABASE db_name speed_opt", - /* 102 */ "cmd ::= S3MIGRATE DATABASE db_name", - /* 103 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", - /* 104 */ "not_exists_opt ::= IF NOT EXISTS", - /* 105 */ "not_exists_opt ::=", - /* 106 */ "exists_opt ::= IF EXISTS", - /* 107 */ "exists_opt ::=", - /* 108 */ "db_options ::=", - /* 109 */ "db_options ::= db_options BUFFER NK_INTEGER", - /* 110 */ "db_options ::= db_options CACHEMODEL NK_STRING", - /* 111 */ "db_options ::= db_options CACHESIZE NK_INTEGER", - /* 112 */ "db_options ::= db_options COMP NK_INTEGER", - /* 113 */ "db_options ::= db_options DURATION NK_INTEGER", - /* 114 */ "db_options ::= db_options DURATION NK_VARIABLE", - /* 115 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 116 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 117 */ "db_options ::= db_options KEEP integer_list", - /* 118 */ "db_options ::= db_options KEEP variable_list", - /* 119 */ "db_options ::= db_options PAGES NK_INTEGER", - /* 120 */ "db_options ::= db_options PAGESIZE NK_INTEGER", - /* 121 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", - /* 122 */ "db_options ::= db_options PRECISION NK_STRING", - /* 123 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 124 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 125 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 126 */ "db_options ::= db_options RETENTIONS retention_list", - /* 127 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 128 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 129 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 130 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 131 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 132 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 133 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 134 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 135 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 136 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 137 */ "db_options ::= db_options TABLE_PREFIX signed", - /* 138 */ "db_options ::= db_options TABLE_SUFFIX signed", - /* 139 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", - /* 140 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", - /* 141 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", - /* 142 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", - /* 143 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", - /* 144 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", - /* 145 */ "alter_db_options ::= alter_db_option", - /* 146 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 147 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 148 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 149 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 150 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 151 */ "alter_db_option ::= KEEP integer_list", - /* 152 */ "alter_db_option ::= KEEP variable_list", - /* 153 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 154 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 155 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 156 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 157 */ "alter_db_option ::= MINROWS NK_INTEGER", - /* 158 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", - /* 159 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 160 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", - /* 161 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 162 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", - /* 163 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", - /* 164 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", - /* 165 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", - /* 166 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", - /* 167 */ "integer_list ::= NK_INTEGER", - /* 168 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 169 */ "variable_list ::= NK_VARIABLE", - /* 170 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 171 */ "retention_list ::= retention", - /* 172 */ "retention_list ::= retention_list NK_COMMA retention", - /* 173 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 174 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", - /* 175 */ "speed_opt ::=", - /* 176 */ "speed_opt ::= BWLIMIT NK_INTEGER", - /* 177 */ "start_opt ::=", - /* 178 */ "start_opt ::= START WITH NK_INTEGER", - /* 179 */ "start_opt ::= START WITH NK_STRING", - /* 180 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", - /* 181 */ "end_opt ::=", - /* 182 */ "end_opt ::= END WITH NK_INTEGER", - /* 183 */ "end_opt ::= END WITH NK_STRING", - /* 184 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", - /* 185 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 186 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 187 */ "cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", - /* 188 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 189 */ "cmd ::= DROP TABLE with_opt multi_drop_clause", - /* 190 */ "cmd ::= DROP STABLE with_opt exists_opt full_table_name", - /* 191 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 192 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 193 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 194 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", - /* 195 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 196 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 197 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", - /* 198 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 199 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 200 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 201 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 202 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 203 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", - /* 204 */ "multi_create_clause ::= create_subtable_clause", - /* 205 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 206 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", - /* 207 */ "multi_drop_clause ::= drop_table_clause", - /* 208 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 209 */ "drop_table_clause ::= exists_opt full_table_name", - /* 210 */ "with_opt ::=", - /* 211 */ "with_opt ::= WITH", - /* 212 */ "specific_cols_opt ::=", - /* 213 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 214 */ "full_table_name ::= table_name", - /* 215 */ "full_table_name ::= db_name NK_DOT table_name", - /* 216 */ "tag_def_list ::= tag_def", - /* 217 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", - /* 218 */ "tag_def ::= column_name type_name", - /* 219 */ "column_def_list ::= column_def", - /* 220 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 221 */ "column_def ::= column_name type_name column_options", - /* 222 */ "type_name ::= BOOL", - /* 223 */ "type_name ::= TINYINT", - /* 224 */ "type_name ::= SMALLINT", - /* 225 */ "type_name ::= INT", - /* 226 */ "type_name ::= INTEGER", - /* 227 */ "type_name ::= BIGINT", - /* 228 */ "type_name ::= FLOAT", - /* 229 */ "type_name ::= DOUBLE", - /* 230 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 231 */ "type_name ::= TIMESTAMP", - /* 232 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 233 */ "type_name ::= TINYINT UNSIGNED", - /* 234 */ "type_name ::= SMALLINT UNSIGNED", - /* 235 */ "type_name ::= INT UNSIGNED", - /* 236 */ "type_name ::= BIGINT UNSIGNED", - /* 237 */ "type_name ::= JSON", - /* 238 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 239 */ "type_name ::= MEDIUMBLOB", - /* 240 */ "type_name ::= BLOB", - /* 241 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 242 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 243 */ "type_name ::= DECIMAL", - /* 244 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 245 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 246 */ "type_name_default_len ::= BINARY", - /* 247 */ "type_name_default_len ::= NCHAR", - /* 248 */ "type_name_default_len ::= VARCHAR", - /* 249 */ "type_name_default_len ::= VARBINARY", - /* 250 */ "tags_def_opt ::=", - /* 251 */ "tags_def_opt ::= tags_def", - /* 252 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", - /* 253 */ "table_options ::=", - /* 254 */ "table_options ::= table_options COMMENT NK_STRING", - /* 255 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 256 */ "table_options ::= table_options WATERMARK duration_list", - /* 257 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 258 */ "table_options ::= table_options TTL NK_INTEGER", - /* 259 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 260 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 261 */ "alter_table_options ::= alter_table_option", - /* 262 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 263 */ "alter_table_option ::= COMMENT NK_STRING", - /* 264 */ "alter_table_option ::= TTL NK_INTEGER", - /* 265 */ "duration_list ::= duration_literal", - /* 266 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 267 */ "rollup_func_list ::= rollup_func_name", - /* 268 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 269 */ "rollup_func_name ::= function_name", - /* 270 */ "rollup_func_name ::= FIRST", - /* 271 */ "rollup_func_name ::= LAST", - /* 272 */ "col_name_list ::= col_name", - /* 273 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 274 */ "col_name ::= column_name", - /* 275 */ "cmd ::= SHOW DNODES", - /* 276 */ "cmd ::= SHOW USERS", - /* 277 */ "cmd ::= SHOW USERS FULL", - /* 278 */ "cmd ::= SHOW USER PRIVILEGES", - /* 279 */ "cmd ::= SHOW db_kind_opt DATABASES", - /* 280 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", - /* 281 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 282 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 283 */ "cmd ::= SHOW MNODES", - /* 284 */ "cmd ::= SHOW QNODES", - /* 285 */ "cmd ::= SHOW ANODES", - /* 286 */ "cmd ::= SHOW ANODES FULL", - /* 287 */ "cmd ::= SHOW ARBGROUPS", - /* 288 */ "cmd ::= SHOW FUNCTIONS", - /* 289 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 290 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 291 */ "cmd ::= SHOW STREAMS", - /* 292 */ "cmd ::= SHOW ACCOUNTS", - /* 293 */ "cmd ::= SHOW APPS", - /* 294 */ "cmd ::= SHOW CONNECTIONS", - /* 295 */ "cmd ::= SHOW LICENCES", - /* 296 */ "cmd ::= SHOW GRANTS", - /* 297 */ "cmd ::= SHOW GRANTS FULL", - /* 298 */ "cmd ::= SHOW GRANTS LOGS", - /* 299 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 300 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 301 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 302 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 303 */ "cmd ::= SHOW ENCRYPTIONS", - /* 304 */ "cmd ::= SHOW QUERIES", - /* 305 */ "cmd ::= SHOW SCORES", - /* 306 */ "cmd ::= SHOW TOPICS", - /* 307 */ "cmd ::= SHOW VARIABLES", - /* 308 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 309 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 310 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 311 */ "cmd ::= SHOW BNODES", - /* 312 */ "cmd ::= SHOW SNODES", - /* 313 */ "cmd ::= SHOW CLUSTER", - /* 314 */ "cmd ::= SHOW TRANSACTIONS", - /* 315 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 316 */ "cmd ::= SHOW CONSUMERS", - /* 317 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 318 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 319 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 320 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 321 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 322 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 323 */ "cmd ::= SHOW VNODES", - /* 324 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 325 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 326 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 327 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 328 */ "cmd ::= SHOW COMPACTS", - /* 329 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 330 */ "table_kind_db_name_cond_opt ::=", - /* 331 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 332 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 333 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 334 */ "table_kind ::= NORMAL", - /* 335 */ "table_kind ::= CHILD", - /* 336 */ "db_name_cond_opt ::=", - /* 337 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 338 */ "like_pattern_opt ::=", - /* 339 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 340 */ "table_name_cond ::= table_name", - /* 341 */ "from_db_opt ::=", - /* 342 */ "from_db_opt ::= FROM db_name", - /* 343 */ "tag_list_opt ::=", - /* 344 */ "tag_list_opt ::= tag_item", - /* 345 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 346 */ "tag_item ::= TBNAME", - /* 347 */ "tag_item ::= QTAGS", - /* 348 */ "tag_item ::= column_name", - /* 349 */ "tag_item ::= column_name column_alias", - /* 350 */ "tag_item ::= column_name AS column_alias", - /* 351 */ "db_kind_opt ::=", - /* 352 */ "db_kind_opt ::= USER", - /* 353 */ "db_kind_opt ::= SYSTEM", - /* 354 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", - /* 355 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", - /* 356 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", - /* 357 */ "cmd ::= SHOW db_name_cond_opt TSMAS", - /* 358 */ "full_tsma_name ::= tsma_name", - /* 359 */ "full_tsma_name ::= db_name NK_DOT tsma_name", - /* 360 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", - /* 361 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 362 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 363 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 364 */ "full_index_name ::= index_name", - /* 365 */ "full_index_name ::= db_name NK_DOT index_name", - /* 366 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 367 */ "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", - /* 368 */ "func_list ::= func", - /* 369 */ "func_list ::= func_list NK_COMMA func", - /* 370 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 371 */ "sma_func_name ::= function_name", - /* 372 */ "sma_func_name ::= COUNT", - /* 373 */ "sma_func_name ::= FIRST", - /* 374 */ "sma_func_name ::= LAST", - /* 375 */ "sma_func_name ::= LAST_ROW", - /* 376 */ "sma_stream_opt ::=", - /* 377 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 378 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 379 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 380 */ "with_meta ::= AS", - /* 381 */ "with_meta ::= WITH META AS", - /* 382 */ "with_meta ::= ONLY META AS", - /* 383 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 384 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 385 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 386 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 387 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 388 */ "cmd ::= DESC full_table_name", - /* 389 */ "cmd ::= DESCRIBE full_table_name", - /* 390 */ "cmd ::= RESET QUERY CACHE", - /* 391 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 392 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 393 */ "analyze_opt ::=", - /* 394 */ "analyze_opt ::= ANALYZE", - /* 395 */ "explain_options ::=", - /* 396 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 397 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 398 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 399 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 400 */ "agg_func_opt ::=", - /* 401 */ "agg_func_opt ::= AGGREGATE", - /* 402 */ "bufsize_opt ::=", - /* 403 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 404 */ "language_opt ::=", - /* 405 */ "language_opt ::= LANGUAGE NK_STRING", - /* 406 */ "or_replace_opt ::=", - /* 407 */ "or_replace_opt ::= OR REPLACE", - /* 408 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 409 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 410 */ "full_view_name ::= view_name", - /* 411 */ "full_view_name ::= db_name NK_DOT view_name", - /* 412 */ "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", - /* 413 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 414 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 415 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 416 */ "col_list_opt ::=", - /* 417 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", - /* 418 */ "column_stream_def_list ::= column_stream_def", - /* 419 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", - /* 420 */ "column_stream_def ::= column_name stream_col_options", - /* 421 */ "stream_col_options ::=", - /* 422 */ "stream_col_options ::= stream_col_options PRIMARY KEY", - /* 423 */ "tag_def_or_ref_opt ::=", - /* 424 */ "tag_def_or_ref_opt ::= tags_def", - /* 425 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", - /* 426 */ "stream_options ::=", - /* 427 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 428 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 429 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 430 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 431 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 432 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 433 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 434 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 435 */ "subtable_opt ::=", - /* 436 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 437 */ "ignore_opt ::=", - /* 438 */ "ignore_opt ::= IGNORE UNTREATED", - /* 439 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 440 */ "cmd ::= KILL QUERY NK_STRING", - /* 441 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 442 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 443 */ "cmd ::= BALANCE VGROUP", - /* 444 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 445 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", - /* 446 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 447 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 448 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 449 */ "on_vgroup_id ::=", - /* 450 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 451 */ "dnode_list ::= DNODE NK_INTEGER", - /* 452 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 453 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 454 */ "cmd ::= query_or_subquery", - /* 455 */ "cmd ::= insert_query", - /* 456 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 457 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 458 */ "tags_literal ::= NK_INTEGER", - /* 459 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", - /* 460 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", - /* 461 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 462 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", - /* 463 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", - /* 464 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 465 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", - /* 466 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", - /* 467 */ "tags_literal ::= NK_FLOAT", - /* 468 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 469 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 470 */ "tags_literal ::= NK_BIN", - /* 471 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", - /* 472 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", - /* 473 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 474 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", - /* 475 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", - /* 476 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 477 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", - /* 478 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", - /* 479 */ "tags_literal ::= NK_HEX", - /* 480 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", - /* 481 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", - /* 482 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 483 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", - /* 484 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", - /* 485 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 486 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", - /* 487 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", - /* 488 */ "tags_literal ::= NK_STRING", - /* 489 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", - /* 490 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", - /* 491 */ "tags_literal ::= NK_BOOL", - /* 492 */ "tags_literal ::= NULL", - /* 493 */ "tags_literal ::= literal_func", - /* 494 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 495 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 496 */ "tags_literal_list ::= tags_literal", - /* 497 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 498 */ "literal ::= NK_INTEGER", - /* 499 */ "literal ::= NK_FLOAT", - /* 500 */ "literal ::= NK_STRING", - /* 501 */ "literal ::= NK_BOOL", - /* 502 */ "literal ::= TIMESTAMP NK_STRING", - /* 503 */ "literal ::= duration_literal", - /* 504 */ "literal ::= NULL", - /* 505 */ "literal ::= NK_QUESTION", - /* 506 */ "duration_literal ::= NK_VARIABLE", - /* 507 */ "signed ::= NK_INTEGER", - /* 508 */ "signed ::= NK_PLUS NK_INTEGER", - /* 509 */ "signed ::= NK_MINUS NK_INTEGER", - /* 510 */ "signed ::= NK_FLOAT", - /* 511 */ "signed ::= NK_PLUS NK_FLOAT", - /* 512 */ "signed ::= NK_MINUS NK_FLOAT", - /* 513 */ "signed_literal ::= signed", - /* 514 */ "signed_literal ::= NK_STRING", - /* 515 */ "signed_literal ::= NK_BOOL", - /* 516 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 517 */ "signed_literal ::= duration_literal", - /* 518 */ "signed_literal ::= NULL", - /* 519 */ "signed_literal ::= literal_func", - /* 520 */ "signed_literal ::= NK_QUESTION", - /* 521 */ "literal_list ::= signed_literal", - /* 522 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 523 */ "db_name ::= NK_ID", - /* 524 */ "table_name ::= NK_ID", - /* 525 */ "column_name ::= NK_ID", - /* 526 */ "function_name ::= NK_ID", - /* 527 */ "view_name ::= NK_ID", - /* 528 */ "table_alias ::= NK_ID", - /* 529 */ "column_alias ::= NK_ID", - /* 530 */ "column_alias ::= NK_ALIAS", - /* 531 */ "user_name ::= NK_ID", - /* 532 */ "topic_name ::= NK_ID", - /* 533 */ "stream_name ::= NK_ID", - /* 534 */ "cgroup_name ::= NK_ID", - /* 535 */ "index_name ::= NK_ID", - /* 536 */ "tsma_name ::= NK_ID", - /* 537 */ "expr_or_subquery ::= expression", - /* 538 */ "expression ::= literal", - /* 539 */ "expression ::= pseudo_column", - /* 540 */ "expression ::= column_reference", - /* 541 */ "expression ::= function_expression", - /* 542 */ "expression ::= case_when_expression", - /* 543 */ "expression ::= NK_LP expression NK_RP", - /* 544 */ "expression ::= NK_PLUS expr_or_subquery", - /* 545 */ "expression ::= NK_MINUS expr_or_subquery", - /* 546 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 547 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 548 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 549 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 550 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 551 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 552 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 553 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 554 */ "expression_list ::= expr_or_subquery", - /* 555 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 556 */ "column_reference ::= column_name", - /* 557 */ "column_reference ::= table_name NK_DOT column_name", - /* 558 */ "column_reference ::= NK_ALIAS", - /* 559 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 560 */ "pseudo_column ::= ROWTS", - /* 561 */ "pseudo_column ::= TBNAME", - /* 562 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 563 */ "pseudo_column ::= QSTART", - /* 564 */ "pseudo_column ::= QEND", - /* 565 */ "pseudo_column ::= QDURATION", - /* 566 */ "pseudo_column ::= WSTART", - /* 567 */ "pseudo_column ::= WEND", - /* 568 */ "pseudo_column ::= WDURATION", - /* 569 */ "pseudo_column ::= IROWTS", - /* 570 */ "pseudo_column ::= ISFILLED", - /* 571 */ "pseudo_column ::= QTAGS", - /* 572 */ "pseudo_column ::= FLOW", - /* 573 */ "pseudo_column ::= FHIGH", - /* 574 */ "pseudo_column ::= FROWTS", - /* 575 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 576 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 577 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 578 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", - /* 579 */ "function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP", - /* 580 */ "function_expression ::= TRIM NK_LP expr_or_subquery NK_RP", - /* 581 */ "function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP", - /* 582 */ "function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", - /* 583 */ "function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP", - /* 584 */ "function_expression ::= substr_func NK_LP expression_list NK_RP", - /* 585 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", - /* 586 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP", - /* 587 */ "function_expression ::= REPLACE NK_LP expression_list NK_RP", - /* 588 */ "function_expression ::= literal_func", - /* 589 */ "function_expression ::= rand_func", - /* 590 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 591 */ "literal_func ::= NOW", - /* 592 */ "literal_func ::= TODAY", - /* 593 */ "rand_func ::= RAND NK_LP NK_RP", - /* 594 */ "rand_func ::= RAND NK_LP expression_list NK_RP", - /* 595 */ "substr_func ::= SUBSTR", - /* 596 */ "substr_func ::= SUBSTRING", - /* 597 */ "trim_specification_type ::= BOTH", - /* 598 */ "trim_specification_type ::= TRAILING", - /* 599 */ "trim_specification_type ::= LEADING", - /* 600 */ "noarg_func ::= NOW", - /* 601 */ "noarg_func ::= TODAY", - /* 602 */ "noarg_func ::= TIMEZONE", - /* 603 */ "noarg_func ::= DATABASE", - /* 604 */ "noarg_func ::= CLIENT_VERSION", - /* 605 */ "noarg_func ::= SERVER_VERSION", - /* 606 */ "noarg_func ::= SERVER_STATUS", - /* 607 */ "noarg_func ::= CURRENT_USER", - /* 608 */ "noarg_func ::= USER", - /* 609 */ "noarg_func ::= PI", - /* 610 */ "star_func ::= COUNT", - /* 611 */ "star_func ::= FIRST", - /* 612 */ "star_func ::= LAST", - /* 613 */ "star_func ::= LAST_ROW", - /* 614 */ "star_func_para_list ::= NK_STAR", - /* 615 */ "star_func_para_list ::= other_para_list", - /* 616 */ "other_para_list ::= star_func_para", - /* 617 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 618 */ "star_func_para ::= expr_or_subquery", - /* 619 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 620 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 621 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 622 */ "when_then_list ::= when_then_expr", - /* 623 */ "when_then_list ::= when_then_list when_then_expr", - /* 624 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 625 */ "case_when_else_opt ::=", - /* 626 */ "case_when_else_opt ::= ELSE common_expression", - /* 627 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 628 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 629 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 630 */ "predicate ::= expr_or_subquery IS NULL", - /* 631 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 632 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 633 */ "compare_op ::= NK_LT", - /* 634 */ "compare_op ::= NK_GT", - /* 635 */ "compare_op ::= NK_LE", - /* 636 */ "compare_op ::= NK_GE", - /* 637 */ "compare_op ::= NK_NE", - /* 638 */ "compare_op ::= NK_EQ", - /* 639 */ "compare_op ::= LIKE", - /* 640 */ "compare_op ::= NOT LIKE", - /* 641 */ "compare_op ::= MATCH", - /* 642 */ "compare_op ::= NMATCH", - /* 643 */ "compare_op ::= CONTAINS", - /* 644 */ "in_op ::= IN", - /* 645 */ "in_op ::= NOT IN", - /* 646 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 647 */ "boolean_value_expression ::= boolean_primary", - /* 648 */ "boolean_value_expression ::= NOT boolean_primary", - /* 649 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 650 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 651 */ "boolean_primary ::= predicate", - /* 652 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 653 */ "common_expression ::= expr_or_subquery", - /* 654 */ "common_expression ::= boolean_value_expression", - /* 655 */ "from_clause_opt ::=", - /* 656 */ "from_clause_opt ::= FROM table_reference_list", - /* 657 */ "table_reference_list ::= table_reference", - /* 658 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 659 */ "table_reference ::= table_primary", - /* 660 */ "table_reference ::= joined_table", - /* 661 */ "table_primary ::= table_name alias_opt", - /* 662 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 663 */ "table_primary ::= subquery alias_opt", - /* 664 */ "table_primary ::= parenthesized_joined_table", - /* 665 */ "alias_opt ::=", - /* 666 */ "alias_opt ::= table_alias", - /* 667 */ "alias_opt ::= AS table_alias", - /* 668 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 669 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 670 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 671 */ "join_type ::=", - /* 672 */ "join_type ::= INNER", - /* 673 */ "join_type ::= LEFT", - /* 674 */ "join_type ::= RIGHT", - /* 675 */ "join_type ::= FULL", - /* 676 */ "join_subtype ::=", - /* 677 */ "join_subtype ::= OUTER", - /* 678 */ "join_subtype ::= SEMI", - /* 679 */ "join_subtype ::= ANTI", - /* 680 */ "join_subtype ::= ASOF", - /* 681 */ "join_subtype ::= WINDOW", - /* 682 */ "join_on_clause_opt ::=", - /* 683 */ "join_on_clause_opt ::= ON search_condition", - /* 684 */ "window_offset_clause_opt ::=", - /* 685 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 686 */ "window_offset_literal ::= NK_VARIABLE", - /* 687 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 688 */ "jlimit_clause_opt ::=", - /* 689 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 690 */ "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", - /* 691 */ "hint_list ::=", - /* 692 */ "hint_list ::= NK_HINT", - /* 693 */ "tag_mode_opt ::=", - /* 694 */ "tag_mode_opt ::= TAGS", - /* 695 */ "set_quantifier_opt ::=", - /* 696 */ "set_quantifier_opt ::= DISTINCT", - /* 697 */ "set_quantifier_opt ::= ALL", - /* 698 */ "select_list ::= select_item", - /* 699 */ "select_list ::= select_list NK_COMMA select_item", - /* 700 */ "select_item ::= NK_STAR", - /* 701 */ "select_item ::= common_expression", - /* 702 */ "select_item ::= common_expression column_alias", - /* 703 */ "select_item ::= common_expression AS column_alias", - /* 704 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 705 */ "where_clause_opt ::=", - /* 706 */ "where_clause_opt ::= WHERE search_condition", - /* 707 */ "partition_by_clause_opt ::=", - /* 708 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 709 */ "partition_list ::= partition_item", - /* 710 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 711 */ "partition_item ::= expr_or_subquery", - /* 712 */ "partition_item ::= expr_or_subquery column_alias", - /* 713 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 714 */ "twindow_clause_opt ::=", - /* 715 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 716 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 717 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 718 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 719 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 720 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 721 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 722 */ "twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP", - /* 723 */ "twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP", - /* 724 */ "sliding_opt ::=", - /* 725 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 726 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 727 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 728 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 729 */ "fill_opt ::=", - /* 730 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 731 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 732 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 733 */ "fill_mode ::= NONE", - /* 734 */ "fill_mode ::= PREV", - /* 735 */ "fill_mode ::= NULL", - /* 736 */ "fill_mode ::= NULL_F", - /* 737 */ "fill_mode ::= LINEAR", - /* 738 */ "fill_mode ::= NEXT", - /* 739 */ "group_by_clause_opt ::=", - /* 740 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 741 */ "group_by_list ::= expr_or_subquery", - /* 742 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 743 */ "having_clause_opt ::=", - /* 744 */ "having_clause_opt ::= HAVING search_condition", - /* 745 */ "range_opt ::=", - /* 746 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 747 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 748 */ "every_opt ::=", - /* 749 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 750 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 751 */ "query_simple ::= query_specification", - /* 752 */ "query_simple ::= union_query_expression", - /* 753 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 754 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 755 */ "query_simple_or_subquery ::= query_simple", - /* 756 */ "query_simple_or_subquery ::= subquery", - /* 757 */ "query_or_subquery ::= query_expression", - /* 758 */ "query_or_subquery ::= subquery", - /* 759 */ "order_by_clause_opt ::=", - /* 760 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 761 */ "slimit_clause_opt ::=", - /* 762 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 763 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 764 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 765 */ "limit_clause_opt ::=", - /* 766 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 767 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 768 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 769 */ "subquery ::= NK_LP query_expression NK_RP", - /* 770 */ "subquery ::= NK_LP subquery NK_RP", - /* 771 */ "search_condition ::= common_expression", - /* 772 */ "sort_specification_list ::= sort_specification", - /* 773 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 774 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 775 */ "ordering_specification_opt ::=", - /* 776 */ "ordering_specification_opt ::= ASC", - /* 777 */ "ordering_specification_opt ::= DESC", - /* 778 */ "null_ordering_opt ::=", - /* 779 */ "null_ordering_opt ::= NULLS FIRST", - /* 780 */ "null_ordering_opt ::= NULLS LAST", - /* 781 */ "column_options ::=", - /* 782 */ "column_options ::= column_options PRIMARY KEY", - /* 783 */ "column_options ::= column_options NK_ID NK_STRING", + /* 60 */ "cmd ::= CREATE DNODE dnode_endpoint", + /* 61 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", + /* 62 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", + /* 63 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", + /* 64 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", + /* 65 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", + /* 66 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", + /* 67 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", + /* 68 */ "cmd ::= ALTER ALL DNODES NK_STRING", + /* 69 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", + /* 70 */ "cmd ::= RESTORE DNODE NK_INTEGER", + /* 71 */ "dnode_endpoint ::= NK_STRING", + /* 72 */ "dnode_endpoint ::= NK_ID", + /* 73 */ "dnode_endpoint ::= NK_IPTOKEN", + /* 74 */ "force_opt ::=", + /* 75 */ "force_opt ::= FORCE", + /* 76 */ "unsafe_opt ::= UNSAFE", + /* 77 */ "cmd ::= ALTER CLUSTER NK_STRING", + /* 78 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", + /* 79 */ "cmd ::= ALTER LOCAL NK_STRING", + /* 80 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", + /* 81 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", + /* 82 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 83 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", + /* 84 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", + /* 85 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", + /* 86 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", + /* 87 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", + /* 88 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", + /* 89 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", + /* 90 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", + /* 91 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", + /* 92 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 93 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 94 */ "cmd ::= USE db_name", + /* 95 */ "cmd ::= ALTER DATABASE db_name alter_db_options", + /* 96 */ "cmd ::= FLUSH DATABASE db_name", + /* 97 */ "cmd ::= TRIM DATABASE db_name speed_opt", + /* 98 */ "cmd ::= S3MIGRATE DATABASE db_name", + /* 99 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", + /* 100 */ "not_exists_opt ::= IF NOT EXISTS", + /* 101 */ "not_exists_opt ::=", + /* 102 */ "exists_opt ::= IF EXISTS", + /* 103 */ "exists_opt ::=", + /* 104 */ "db_options ::=", + /* 105 */ "db_options ::= db_options BUFFER NK_INTEGER", + /* 106 */ "db_options ::= db_options CACHEMODEL NK_STRING", + /* 107 */ "db_options ::= db_options CACHESIZE NK_INTEGER", + /* 108 */ "db_options ::= db_options COMP NK_INTEGER", + /* 109 */ "db_options ::= db_options DURATION NK_INTEGER", + /* 110 */ "db_options ::= db_options DURATION NK_VARIABLE", + /* 111 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 112 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 113 */ "db_options ::= db_options KEEP integer_list", + /* 114 */ "db_options ::= db_options KEEP variable_list", + /* 115 */ "db_options ::= db_options PAGES NK_INTEGER", + /* 116 */ "db_options ::= db_options PAGESIZE NK_INTEGER", + /* 117 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", + /* 118 */ "db_options ::= db_options PRECISION NK_STRING", + /* 119 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 120 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 121 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 122 */ "db_options ::= db_options RETENTIONS retention_list", + /* 123 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 124 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 125 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 126 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 127 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 128 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 129 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 130 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 131 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 132 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 133 */ "db_options ::= db_options TABLE_PREFIX signed", + /* 134 */ "db_options ::= db_options TABLE_SUFFIX signed", + /* 135 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", + /* 136 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", + /* 137 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", + /* 138 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", + /* 139 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", + /* 140 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", + /* 141 */ "alter_db_options ::= alter_db_option", + /* 142 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 143 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 144 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 145 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 146 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 147 */ "alter_db_option ::= KEEP integer_list", + /* 148 */ "alter_db_option ::= KEEP variable_list", + /* 149 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 150 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 151 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 152 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 153 */ "alter_db_option ::= MINROWS NK_INTEGER", + /* 154 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", + /* 155 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 156 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", + /* 157 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 158 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", + /* 159 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", + /* 160 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", + /* 161 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", + /* 162 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", + /* 163 */ "integer_list ::= NK_INTEGER", + /* 164 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 165 */ "variable_list ::= NK_VARIABLE", + /* 166 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 167 */ "retention_list ::= retention", + /* 168 */ "retention_list ::= retention_list NK_COMMA retention", + /* 169 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 170 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", + /* 171 */ "speed_opt ::=", + /* 172 */ "speed_opt ::= BWLIMIT NK_INTEGER", + /* 173 */ "start_opt ::=", + /* 174 */ "start_opt ::= START WITH NK_INTEGER", + /* 175 */ "start_opt ::= START WITH NK_STRING", + /* 176 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", + /* 177 */ "end_opt ::=", + /* 178 */ "end_opt ::= END WITH NK_INTEGER", + /* 179 */ "end_opt ::= END WITH NK_STRING", + /* 180 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", + /* 181 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 182 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 183 */ "cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", + /* 184 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 185 */ "cmd ::= DROP TABLE with_opt multi_drop_clause", + /* 186 */ "cmd ::= DROP STABLE with_opt exists_opt full_table_name", + /* 187 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 188 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 189 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 190 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", + /* 191 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 192 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 193 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", + /* 194 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 195 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 196 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 197 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 198 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 199 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", + /* 200 */ "multi_create_clause ::= create_subtable_clause", + /* 201 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 202 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", + /* 203 */ "multi_drop_clause ::= drop_table_clause", + /* 204 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", + /* 205 */ "drop_table_clause ::= exists_opt full_table_name", + /* 206 */ "with_opt ::=", + /* 207 */ "with_opt ::= WITH", + /* 208 */ "specific_cols_opt ::=", + /* 209 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 210 */ "full_table_name ::= table_name", + /* 211 */ "full_table_name ::= db_name NK_DOT table_name", + /* 212 */ "tag_def_list ::= tag_def", + /* 213 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", + /* 214 */ "tag_def ::= column_name type_name", + /* 215 */ "column_def_list ::= column_def", + /* 216 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 217 */ "column_def ::= column_name type_name column_options", + /* 218 */ "type_name ::= BOOL", + /* 219 */ "type_name ::= TINYINT", + /* 220 */ "type_name ::= SMALLINT", + /* 221 */ "type_name ::= INT", + /* 222 */ "type_name ::= INTEGER", + /* 223 */ "type_name ::= BIGINT", + /* 224 */ "type_name ::= FLOAT", + /* 225 */ "type_name ::= DOUBLE", + /* 226 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 227 */ "type_name ::= TIMESTAMP", + /* 228 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 229 */ "type_name ::= TINYINT UNSIGNED", + /* 230 */ "type_name ::= SMALLINT UNSIGNED", + /* 231 */ "type_name ::= INT UNSIGNED", + /* 232 */ "type_name ::= BIGINT UNSIGNED", + /* 233 */ "type_name ::= JSON", + /* 234 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 235 */ "type_name ::= MEDIUMBLOB", + /* 236 */ "type_name ::= BLOB", + /* 237 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 238 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 239 */ "type_name ::= DECIMAL", + /* 240 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 241 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 242 */ "type_name_default_len ::= BINARY", + /* 243 */ "type_name_default_len ::= NCHAR", + /* 244 */ "type_name_default_len ::= VARCHAR", + /* 245 */ "type_name_default_len ::= VARBINARY", + /* 246 */ "tags_def_opt ::=", + /* 247 */ "tags_def_opt ::= tags_def", + /* 248 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", + /* 249 */ "table_options ::=", + /* 250 */ "table_options ::= table_options COMMENT NK_STRING", + /* 251 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 252 */ "table_options ::= table_options WATERMARK duration_list", + /* 253 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 254 */ "table_options ::= table_options TTL NK_INTEGER", + /* 255 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 256 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 257 */ "alter_table_options ::= alter_table_option", + /* 258 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 259 */ "alter_table_option ::= COMMENT NK_STRING", + /* 260 */ "alter_table_option ::= TTL NK_INTEGER", + /* 261 */ "duration_list ::= duration_literal", + /* 262 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 263 */ "rollup_func_list ::= rollup_func_name", + /* 264 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 265 */ "rollup_func_name ::= function_name", + /* 266 */ "rollup_func_name ::= FIRST", + /* 267 */ "rollup_func_name ::= LAST", + /* 268 */ "col_name_list ::= col_name", + /* 269 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 270 */ "col_name ::= column_name", + /* 271 */ "cmd ::= SHOW DNODES", + /* 272 */ "cmd ::= SHOW USERS", + /* 273 */ "cmd ::= SHOW USERS FULL", + /* 274 */ "cmd ::= SHOW USER PRIVILEGES", + /* 275 */ "cmd ::= SHOW db_kind_opt DATABASES", + /* 276 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", + /* 277 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 278 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 279 */ "cmd ::= SHOW MNODES", + /* 280 */ "cmd ::= SHOW QNODES", + /* 281 */ "cmd ::= SHOW ARBGROUPS", + /* 282 */ "cmd ::= SHOW FUNCTIONS", + /* 283 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 284 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 285 */ "cmd ::= SHOW STREAMS", + /* 286 */ "cmd ::= SHOW ACCOUNTS", + /* 287 */ "cmd ::= SHOW APPS", + /* 288 */ "cmd ::= SHOW CONNECTIONS", + /* 289 */ "cmd ::= SHOW LICENCES", + /* 290 */ "cmd ::= SHOW GRANTS", + /* 291 */ "cmd ::= SHOW GRANTS FULL", + /* 292 */ "cmd ::= SHOW GRANTS LOGS", + /* 293 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 294 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 295 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 296 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 297 */ "cmd ::= SHOW ENCRYPTIONS", + /* 298 */ "cmd ::= SHOW QUERIES", + /* 299 */ "cmd ::= SHOW SCORES", + /* 300 */ "cmd ::= SHOW TOPICS", + /* 301 */ "cmd ::= SHOW VARIABLES", + /* 302 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 303 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 304 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 305 */ "cmd ::= SHOW BNODES", + /* 306 */ "cmd ::= SHOW SNODES", + /* 307 */ "cmd ::= SHOW CLUSTER", + /* 308 */ "cmd ::= SHOW TRANSACTIONS", + /* 309 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 310 */ "cmd ::= SHOW CONSUMERS", + /* 311 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 312 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 313 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 314 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 315 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 316 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 317 */ "cmd ::= SHOW VNODES", + /* 318 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 319 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 320 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 321 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 322 */ "cmd ::= SHOW COMPACTS", + /* 323 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 324 */ "table_kind_db_name_cond_opt ::=", + /* 325 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 326 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 327 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 328 */ "table_kind ::= NORMAL", + /* 329 */ "table_kind ::= CHILD", + /* 330 */ "db_name_cond_opt ::=", + /* 331 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 332 */ "like_pattern_opt ::=", + /* 333 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 334 */ "table_name_cond ::= table_name", + /* 335 */ "from_db_opt ::=", + /* 336 */ "from_db_opt ::= FROM db_name", + /* 337 */ "tag_list_opt ::=", + /* 338 */ "tag_list_opt ::= tag_item", + /* 339 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 340 */ "tag_item ::= TBNAME", + /* 341 */ "tag_item ::= QTAGS", + /* 342 */ "tag_item ::= column_name", + /* 343 */ "tag_item ::= column_name column_alias", + /* 344 */ "tag_item ::= column_name AS column_alias", + /* 345 */ "db_kind_opt ::=", + /* 346 */ "db_kind_opt ::= USER", + /* 347 */ "db_kind_opt ::= SYSTEM", + /* 348 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", + /* 349 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", + /* 350 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", + /* 351 */ "cmd ::= SHOW db_name_cond_opt TSMAS", + /* 352 */ "full_tsma_name ::= tsma_name", + /* 353 */ "full_tsma_name ::= db_name NK_DOT tsma_name", + /* 354 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", + /* 355 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 356 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 357 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 358 */ "full_index_name ::= index_name", + /* 359 */ "full_index_name ::= db_name NK_DOT index_name", + /* 360 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 361 */ "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", + /* 362 */ "func_list ::= func", + /* 363 */ "func_list ::= func_list NK_COMMA func", + /* 364 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 365 */ "sma_func_name ::= function_name", + /* 366 */ "sma_func_name ::= COUNT", + /* 367 */ "sma_func_name ::= FIRST", + /* 368 */ "sma_func_name ::= LAST", + /* 369 */ "sma_func_name ::= LAST_ROW", + /* 370 */ "sma_stream_opt ::=", + /* 371 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 372 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 373 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 374 */ "with_meta ::= AS", + /* 375 */ "with_meta ::= WITH META AS", + /* 376 */ "with_meta ::= ONLY META AS", + /* 377 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 378 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 379 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 380 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 381 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 382 */ "cmd ::= DESC full_table_name", + /* 383 */ "cmd ::= DESCRIBE full_table_name", + /* 384 */ "cmd ::= RESET QUERY CACHE", + /* 385 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 386 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 387 */ "analyze_opt ::=", + /* 388 */ "analyze_opt ::= ANALYZE", + /* 389 */ "explain_options ::=", + /* 390 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 391 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 392 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 393 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 394 */ "agg_func_opt ::=", + /* 395 */ "agg_func_opt ::= AGGREGATE", + /* 396 */ "bufsize_opt ::=", + /* 397 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 398 */ "language_opt ::=", + /* 399 */ "language_opt ::= LANGUAGE NK_STRING", + /* 400 */ "or_replace_opt ::=", + /* 401 */ "or_replace_opt ::= OR REPLACE", + /* 402 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 403 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 404 */ "full_view_name ::= view_name", + /* 405 */ "full_view_name ::= db_name NK_DOT view_name", + /* 406 */ "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", + /* 407 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 408 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 409 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 410 */ "col_list_opt ::=", + /* 411 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", + /* 412 */ "column_stream_def_list ::= column_stream_def", + /* 413 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", + /* 414 */ "column_stream_def ::= column_name stream_col_options", + /* 415 */ "stream_col_options ::=", + /* 416 */ "stream_col_options ::= stream_col_options PRIMARY KEY", + /* 417 */ "tag_def_or_ref_opt ::=", + /* 418 */ "tag_def_or_ref_opt ::= tags_def", + /* 419 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", + /* 420 */ "stream_options ::=", + /* 421 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 422 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 423 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 424 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 425 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 426 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 427 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 428 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 429 */ "subtable_opt ::=", + /* 430 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 431 */ "ignore_opt ::=", + /* 432 */ "ignore_opt ::= IGNORE UNTREATED", + /* 433 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 434 */ "cmd ::= KILL QUERY NK_STRING", + /* 435 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 436 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 437 */ "cmd ::= BALANCE VGROUP", + /* 438 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 439 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", + /* 440 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 441 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 442 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 443 */ "on_vgroup_id ::=", + /* 444 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 445 */ "dnode_list ::= DNODE NK_INTEGER", + /* 446 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 447 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 448 */ "cmd ::= query_or_subquery", + /* 449 */ "cmd ::= insert_query", + /* 450 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 451 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 452 */ "tags_literal ::= NK_INTEGER", + /* 453 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", + /* 454 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", + /* 455 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 456 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", + /* 457 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", + /* 458 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 459 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", + /* 460 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", + /* 461 */ "tags_literal ::= NK_FLOAT", + /* 462 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 463 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 464 */ "tags_literal ::= NK_BIN", + /* 465 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", + /* 466 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", + /* 467 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 468 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", + /* 469 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", + /* 470 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 471 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", + /* 472 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", + /* 473 */ "tags_literal ::= NK_HEX", + /* 474 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", + /* 475 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", + /* 476 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 477 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", + /* 478 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", + /* 479 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 480 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", + /* 481 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", + /* 482 */ "tags_literal ::= NK_STRING", + /* 483 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", + /* 484 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", + /* 485 */ "tags_literal ::= NK_BOOL", + /* 486 */ "tags_literal ::= NULL", + /* 487 */ "tags_literal ::= literal_func", + /* 488 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 489 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 490 */ "tags_literal_list ::= tags_literal", + /* 491 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 492 */ "literal ::= NK_INTEGER", + /* 493 */ "literal ::= NK_FLOAT", + /* 494 */ "literal ::= NK_STRING", + /* 495 */ "literal ::= NK_BOOL", + /* 496 */ "literal ::= TIMESTAMP NK_STRING", + /* 497 */ "literal ::= duration_literal", + /* 498 */ "literal ::= NULL", + /* 499 */ "literal ::= NK_QUESTION", + /* 500 */ "duration_literal ::= NK_VARIABLE", + /* 501 */ "signed ::= NK_INTEGER", + /* 502 */ "signed ::= NK_PLUS NK_INTEGER", + /* 503 */ "signed ::= NK_MINUS NK_INTEGER", + /* 504 */ "signed ::= NK_FLOAT", + /* 505 */ "signed ::= NK_PLUS NK_FLOAT", + /* 506 */ "signed ::= NK_MINUS NK_FLOAT", + /* 507 */ "signed_literal ::= signed", + /* 508 */ "signed_literal ::= NK_STRING", + /* 509 */ "signed_literal ::= NK_BOOL", + /* 510 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 511 */ "signed_literal ::= duration_literal", + /* 512 */ "signed_literal ::= NULL", + /* 513 */ "signed_literal ::= literal_func", + /* 514 */ "signed_literal ::= NK_QUESTION", + /* 515 */ "literal_list ::= signed_literal", + /* 516 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 517 */ "db_name ::= NK_ID", + /* 518 */ "table_name ::= NK_ID", + /* 519 */ "column_name ::= NK_ID", + /* 520 */ "function_name ::= NK_ID", + /* 521 */ "view_name ::= NK_ID", + /* 522 */ "table_alias ::= NK_ID", + /* 523 */ "column_alias ::= NK_ID", + /* 524 */ "column_alias ::= NK_ALIAS", + /* 525 */ "user_name ::= NK_ID", + /* 526 */ "topic_name ::= NK_ID", + /* 527 */ "stream_name ::= NK_ID", + /* 528 */ "cgroup_name ::= NK_ID", + /* 529 */ "index_name ::= NK_ID", + /* 530 */ "tsma_name ::= NK_ID", + /* 531 */ "expr_or_subquery ::= expression", + /* 532 */ "expression ::= literal", + /* 533 */ "expression ::= pseudo_column", + /* 534 */ "expression ::= column_reference", + /* 535 */ "expression ::= function_expression", + /* 536 */ "expression ::= case_when_expression", + /* 537 */ "expression ::= NK_LP expression NK_RP", + /* 538 */ "expression ::= NK_PLUS expr_or_subquery", + /* 539 */ "expression ::= NK_MINUS expr_or_subquery", + /* 540 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 541 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 542 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 543 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 544 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 545 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 546 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 547 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 548 */ "expression_list ::= expr_or_subquery", + /* 549 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 550 */ "column_reference ::= column_name", + /* 551 */ "column_reference ::= table_name NK_DOT column_name", + /* 552 */ "column_reference ::= NK_ALIAS", + /* 553 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 554 */ "pseudo_column ::= ROWTS", + /* 555 */ "pseudo_column ::= TBNAME", + /* 556 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 557 */ "pseudo_column ::= QSTART", + /* 558 */ "pseudo_column ::= QEND", + /* 559 */ "pseudo_column ::= QDURATION", + /* 560 */ "pseudo_column ::= WSTART", + /* 561 */ "pseudo_column ::= WEND", + /* 562 */ "pseudo_column ::= WDURATION", + /* 563 */ "pseudo_column ::= IROWTS", + /* 564 */ "pseudo_column ::= ISFILLED", + /* 565 */ "pseudo_column ::= QTAGS", + /* 566 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 567 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 568 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 569 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", + /* 570 */ "function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP", + /* 571 */ "function_expression ::= TRIM NK_LP expr_or_subquery NK_RP", + /* 572 */ "function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP", + /* 573 */ "function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", + /* 574 */ "function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP", + /* 575 */ "function_expression ::= substr_func NK_LP expression_list NK_RP", + /* 576 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", + /* 577 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP", + /* 578 */ "function_expression ::= REPLACE NK_LP expression_list NK_RP", + /* 579 */ "function_expression ::= literal_func", + /* 580 */ "function_expression ::= rand_func", + /* 581 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 582 */ "literal_func ::= NOW", + /* 583 */ "literal_func ::= TODAY", + /* 584 */ "rand_func ::= RAND NK_LP NK_RP", + /* 585 */ "rand_func ::= RAND NK_LP expression_list NK_RP", + /* 586 */ "substr_func ::= SUBSTR", + /* 587 */ "substr_func ::= SUBSTRING", + /* 588 */ "trim_specification_type ::= BOTH", + /* 589 */ "trim_specification_type ::= TRAILING", + /* 590 */ "trim_specification_type ::= LEADING", + /* 591 */ "noarg_func ::= NOW", + /* 592 */ "noarg_func ::= TODAY", + /* 593 */ "noarg_func ::= TIMEZONE", + /* 594 */ "noarg_func ::= DATABASE", + /* 595 */ "noarg_func ::= CLIENT_VERSION", + /* 596 */ "noarg_func ::= SERVER_VERSION", + /* 597 */ "noarg_func ::= SERVER_STATUS", + /* 598 */ "noarg_func ::= CURRENT_USER", + /* 599 */ "noarg_func ::= USER", + /* 600 */ "noarg_func ::= PI", + /* 601 */ "star_func ::= COUNT", + /* 602 */ "star_func ::= FIRST", + /* 603 */ "star_func ::= LAST", + /* 604 */ "star_func ::= LAST_ROW", + /* 605 */ "star_func_para_list ::= NK_STAR", + /* 606 */ "star_func_para_list ::= other_para_list", + /* 607 */ "other_para_list ::= star_func_para", + /* 608 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 609 */ "star_func_para ::= expr_or_subquery", + /* 610 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 611 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 612 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 613 */ "when_then_list ::= when_then_expr", + /* 614 */ "when_then_list ::= when_then_list when_then_expr", + /* 615 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 616 */ "case_when_else_opt ::=", + /* 617 */ "case_when_else_opt ::= ELSE common_expression", + /* 618 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 619 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 620 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 621 */ "predicate ::= expr_or_subquery IS NULL", + /* 622 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 623 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 624 */ "compare_op ::= NK_LT", + /* 625 */ "compare_op ::= NK_GT", + /* 626 */ "compare_op ::= NK_LE", + /* 627 */ "compare_op ::= NK_GE", + /* 628 */ "compare_op ::= NK_NE", + /* 629 */ "compare_op ::= NK_EQ", + /* 630 */ "compare_op ::= LIKE", + /* 631 */ "compare_op ::= NOT LIKE", + /* 632 */ "compare_op ::= MATCH", + /* 633 */ "compare_op ::= NMATCH", + /* 634 */ "compare_op ::= CONTAINS", + /* 635 */ "in_op ::= IN", + /* 636 */ "in_op ::= NOT IN", + /* 637 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 638 */ "boolean_value_expression ::= boolean_primary", + /* 639 */ "boolean_value_expression ::= NOT boolean_primary", + /* 640 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 641 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 642 */ "boolean_primary ::= predicate", + /* 643 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 644 */ "common_expression ::= expr_or_subquery", + /* 645 */ "common_expression ::= boolean_value_expression", + /* 646 */ "from_clause_opt ::=", + /* 647 */ "from_clause_opt ::= FROM table_reference_list", + /* 648 */ "table_reference_list ::= table_reference", + /* 649 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 650 */ "table_reference ::= table_primary", + /* 651 */ "table_reference ::= joined_table", + /* 652 */ "table_primary ::= table_name alias_opt", + /* 653 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 654 */ "table_primary ::= subquery alias_opt", + /* 655 */ "table_primary ::= parenthesized_joined_table", + /* 656 */ "alias_opt ::=", + /* 657 */ "alias_opt ::= table_alias", + /* 658 */ "alias_opt ::= AS table_alias", + /* 659 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 660 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 661 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 662 */ "join_type ::=", + /* 663 */ "join_type ::= INNER", + /* 664 */ "join_type ::= LEFT", + /* 665 */ "join_type ::= RIGHT", + /* 666 */ "join_type ::= FULL", + /* 667 */ "join_subtype ::=", + /* 668 */ "join_subtype ::= OUTER", + /* 669 */ "join_subtype ::= SEMI", + /* 670 */ "join_subtype ::= ANTI", + /* 671 */ "join_subtype ::= ASOF", + /* 672 */ "join_subtype ::= WINDOW", + /* 673 */ "join_on_clause_opt ::=", + /* 674 */ "join_on_clause_opt ::= ON search_condition", + /* 675 */ "window_offset_clause_opt ::=", + /* 676 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 677 */ "window_offset_literal ::= NK_VARIABLE", + /* 678 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 679 */ "jlimit_clause_opt ::=", + /* 680 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 681 */ "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", + /* 682 */ "hint_list ::=", + /* 683 */ "hint_list ::= NK_HINT", + /* 684 */ "tag_mode_opt ::=", + /* 685 */ "tag_mode_opt ::= TAGS", + /* 686 */ "set_quantifier_opt ::=", + /* 687 */ "set_quantifier_opt ::= DISTINCT", + /* 688 */ "set_quantifier_opt ::= ALL", + /* 689 */ "select_list ::= select_item", + /* 690 */ "select_list ::= select_list NK_COMMA select_item", + /* 691 */ "select_item ::= NK_STAR", + /* 692 */ "select_item ::= common_expression", + /* 693 */ "select_item ::= common_expression column_alias", + /* 694 */ "select_item ::= common_expression AS column_alias", + /* 695 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 696 */ "where_clause_opt ::=", + /* 697 */ "where_clause_opt ::= WHERE search_condition", + /* 698 */ "partition_by_clause_opt ::=", + /* 699 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 700 */ "partition_list ::= partition_item", + /* 701 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 702 */ "partition_item ::= expr_or_subquery", + /* 703 */ "partition_item ::= expr_or_subquery column_alias", + /* 704 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 705 */ "twindow_clause_opt ::=", + /* 706 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 707 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 708 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 709 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 710 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 711 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 712 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 713 */ "sliding_opt ::=", + /* 714 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 715 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 716 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 717 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 718 */ "fill_opt ::=", + /* 719 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 720 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 721 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 722 */ "fill_mode ::= NONE", + /* 723 */ "fill_mode ::= PREV", + /* 724 */ "fill_mode ::= NULL", + /* 725 */ "fill_mode ::= NULL_F", + /* 726 */ "fill_mode ::= LINEAR", + /* 727 */ "fill_mode ::= NEXT", + /* 728 */ "group_by_clause_opt ::=", + /* 729 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 730 */ "group_by_list ::= expr_or_subquery", + /* 731 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 732 */ "having_clause_opt ::=", + /* 733 */ "having_clause_opt ::= HAVING search_condition", + /* 734 */ "range_opt ::=", + /* 735 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 736 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 737 */ "every_opt ::=", + /* 738 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 739 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 740 */ "query_simple ::= query_specification", + /* 741 */ "query_simple ::= union_query_expression", + /* 742 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 743 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 744 */ "query_simple_or_subquery ::= query_simple", + /* 745 */ "query_simple_or_subquery ::= subquery", + /* 746 */ "query_or_subquery ::= query_expression", + /* 747 */ "query_or_subquery ::= subquery", + /* 748 */ "order_by_clause_opt ::=", + /* 749 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 750 */ "slimit_clause_opt ::=", + /* 751 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 752 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 753 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 754 */ "limit_clause_opt ::=", + /* 755 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 756 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 757 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 758 */ "subquery ::= NK_LP query_expression NK_RP", + /* 759 */ "subquery ::= NK_LP subquery NK_RP", + /* 760 */ "search_condition ::= common_expression", + /* 761 */ "sort_specification_list ::= sort_specification", + /* 762 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 763 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 764 */ "ordering_specification_opt ::=", + /* 765 */ "ordering_specification_opt ::= ASC", + /* 766 */ "ordering_specification_opt ::= DESC", + /* 767 */ "null_ordering_opt ::=", + /* 768 */ "null_ordering_opt ::= NULLS FIRST", + /* 769 */ "null_ordering_opt ::= NULLS LAST", + /* 770 */ "column_options ::=", + /* 771 */ "column_options ::= column_options PRIMARY KEY", + /* 772 */ "column_options ::= column_options NK_ID NK_STRING", }; #endif /* NDEBUG */ @@ -3405,266 +3359,266 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 389: /* cmd */ - case 392: /* literal */ - case 403: /* with_clause_opt */ - case 409: /* search_condition */ - case 414: /* db_options */ - case 416: /* alter_db_options */ - case 418: /* start_opt */ - case 419: /* end_opt */ - case 423: /* signed */ - case 425: /* retention */ - case 426: /* full_table_name */ - case 429: /* table_options */ - case 435: /* alter_table_clause */ - case 436: /* alter_table_options */ - case 439: /* column_options */ - case 440: /* tags_literal */ - case 441: /* create_subtable_clause */ - case 444: /* drop_table_clause */ - case 447: /* tag_def */ - case 448: /* column_def */ - case 453: /* duration_literal */ - case 454: /* rollup_func_name */ - case 456: /* col_name */ - case 459: /* like_pattern_opt */ - case 460: /* db_name_cond_opt */ - case 461: /* table_name_cond */ - case 462: /* from_db_opt */ - case 464: /* tag_item */ - case 468: /* full_tsma_name */ - case 470: /* index_options */ - case 471: /* full_index_name */ - case 473: /* sliding_opt */ - case 474: /* sma_stream_opt */ - case 475: /* func */ - case 479: /* query_or_subquery */ - case 480: /* where_clause_opt */ - case 483: /* explain_options */ - case 484: /* insert_query */ - case 489: /* full_view_name */ - case 492: /* stream_options */ - case 495: /* subtable_opt */ - case 498: /* column_stream_def */ - case 499: /* stream_col_options */ - case 500: /* expression */ - case 503: /* literal_func */ - case 504: /* signed_literal */ - case 507: /* expr_or_subquery */ - case 508: /* pseudo_column */ - case 509: /* column_reference */ - case 510: /* function_expression */ - case 511: /* case_when_expression */ - case 516: /* rand_func */ - case 519: /* star_func_para */ - case 521: /* case_when_else_opt */ - case 522: /* common_expression */ - case 523: /* when_then_expr */ - case 524: /* predicate */ - case 527: /* in_predicate_value */ - case 528: /* boolean_value_expression */ - case 529: /* boolean_primary */ - case 530: /* from_clause_opt */ - case 531: /* table_reference_list */ - case 532: /* table_reference */ - case 533: /* table_primary */ - case 534: /* joined_table */ - case 536: /* subquery */ - case 537: /* parenthesized_joined_table */ - case 540: /* join_on_clause_opt */ - case 541: /* window_offset_clause_opt */ - case 542: /* jlimit_clause_opt */ - case 543: /* window_offset_literal */ - case 544: /* query_specification */ - case 550: /* range_opt */ - case 551: /* every_opt */ - case 552: /* fill_opt */ - case 553: /* twindow_clause_opt */ - case 555: /* having_clause_opt */ - case 556: /* select_item */ - case 558: /* partition_item */ - case 559: /* interval_sliding_duration_literal */ - case 562: /* query_expression */ - case 563: /* query_simple */ - case 565: /* slimit_clause_opt */ - case 566: /* limit_clause_opt */ - case 567: /* union_query_expression */ - case 568: /* query_simple_or_subquery */ - case 570: /* sort_specification */ + case 383: /* cmd */ + case 386: /* literal */ + case 397: /* with_clause_opt */ + case 403: /* search_condition */ + case 408: /* db_options */ + case 410: /* alter_db_options */ + case 412: /* start_opt */ + case 413: /* end_opt */ + case 417: /* signed */ + case 419: /* retention */ + case 420: /* full_table_name */ + case 423: /* table_options */ + case 429: /* alter_table_clause */ + case 430: /* alter_table_options */ + case 433: /* column_options */ + case 434: /* tags_literal */ + case 435: /* create_subtable_clause */ + case 438: /* drop_table_clause */ + case 441: /* tag_def */ + case 442: /* column_def */ + case 447: /* duration_literal */ + case 448: /* rollup_func_name */ + case 450: /* col_name */ + case 453: /* like_pattern_opt */ + case 454: /* db_name_cond_opt */ + case 455: /* table_name_cond */ + case 456: /* from_db_opt */ + case 458: /* tag_item */ + case 462: /* full_tsma_name */ + case 464: /* index_options */ + case 465: /* full_index_name */ + case 467: /* sliding_opt */ + case 468: /* sma_stream_opt */ + case 469: /* func */ + case 473: /* query_or_subquery */ + case 474: /* where_clause_opt */ + case 477: /* explain_options */ + case 478: /* insert_query */ + case 483: /* full_view_name */ + case 486: /* stream_options */ + case 489: /* subtable_opt */ + case 492: /* column_stream_def */ + case 493: /* stream_col_options */ + case 494: /* expression */ + case 497: /* literal_func */ + case 498: /* signed_literal */ + case 501: /* expr_or_subquery */ + case 502: /* pseudo_column */ + case 503: /* column_reference */ + case 504: /* function_expression */ + case 505: /* case_when_expression */ + case 510: /* rand_func */ + case 513: /* star_func_para */ + case 515: /* case_when_else_opt */ + case 516: /* common_expression */ + case 517: /* when_then_expr */ + case 518: /* predicate */ + case 521: /* in_predicate_value */ + case 522: /* boolean_value_expression */ + case 523: /* boolean_primary */ + case 524: /* from_clause_opt */ + case 525: /* table_reference_list */ + case 526: /* table_reference */ + case 527: /* table_primary */ + case 528: /* joined_table */ + case 530: /* subquery */ + case 531: /* parenthesized_joined_table */ + case 534: /* join_on_clause_opt */ + case 535: /* window_offset_clause_opt */ + case 536: /* jlimit_clause_opt */ + case 537: /* window_offset_literal */ + case 538: /* query_specification */ + case 544: /* range_opt */ + case 545: /* every_opt */ + case 546: /* fill_opt */ + case 547: /* twindow_clause_opt */ + case 549: /* having_clause_opt */ + case 550: /* select_item */ + case 552: /* partition_item */ + case 553: /* interval_sliding_duration_literal */ + case 556: /* query_expression */ + case 557: /* query_simple */ + case 559: /* slimit_clause_opt */ + case 560: /* limit_clause_opt */ + case 561: /* union_query_expression */ + case 562: /* query_simple_or_subquery */ + case 564: /* sort_specification */ { - nodesDestroyNode((yypminor->yy974)); + nodesDestroyNode((yypminor->yy560)); } break; - case 390: /* account_options */ - case 391: /* alter_account_options */ - case 393: /* alter_account_option */ - case 417: /* speed_opt */ - case 478: /* with_meta */ - case 487: /* bufsize_opt */ + case 384: /* account_options */ + case 385: /* alter_account_options */ + case 387: /* alter_account_option */ + case 411: /* speed_opt */ + case 472: /* with_meta */ + case 481: /* bufsize_opt */ { } break; - case 394: /* ip_range_list */ - case 395: /* white_list */ - case 396: /* white_list_opt */ - case 420: /* integer_list */ - case 421: /* variable_list */ - case 422: /* retention_list */ - case 427: /* column_def_list */ - case 428: /* tags_def_opt */ - case 430: /* multi_create_clause */ - case 431: /* tag_list_opt */ - case 432: /* tags_def */ - case 434: /* multi_drop_clause */ - case 442: /* specific_cols_opt */ - case 443: /* tags_literal_list */ - case 445: /* col_name_list */ - case 446: /* tag_def_list */ - case 450: /* duration_list */ - case 451: /* rollup_func_list */ - case 469: /* func_list */ - case 477: /* expression_list */ - case 493: /* col_list_opt */ - case 494: /* tag_def_or_ref_opt */ - case 497: /* column_stream_def_list */ - case 502: /* dnode_list */ - case 505: /* literal_list */ - case 513: /* star_func_para_list */ - case 518: /* other_para_list */ - case 520: /* when_then_list */ - case 545: /* hint_list */ - case 548: /* select_list */ - case 549: /* partition_by_clause_opt */ - case 554: /* group_by_clause_opt */ - case 557: /* partition_list */ - case 561: /* group_by_list */ - case 564: /* order_by_clause_opt */ - case 569: /* sort_specification_list */ + case 388: /* ip_range_list */ + case 389: /* white_list */ + case 390: /* white_list_opt */ + case 414: /* integer_list */ + case 415: /* variable_list */ + case 416: /* retention_list */ + case 421: /* column_def_list */ + case 422: /* tags_def_opt */ + case 424: /* multi_create_clause */ + case 425: /* tag_list_opt */ + case 426: /* tags_def */ + case 428: /* multi_drop_clause */ + case 436: /* specific_cols_opt */ + case 437: /* tags_literal_list */ + case 439: /* col_name_list */ + case 440: /* tag_def_list */ + case 444: /* duration_list */ + case 445: /* rollup_func_list */ + case 463: /* func_list */ + case 471: /* expression_list */ + case 487: /* col_list_opt */ + case 488: /* tag_def_or_ref_opt */ + case 491: /* column_stream_def_list */ + case 496: /* dnode_list */ + case 499: /* literal_list */ + case 507: /* star_func_para_list */ + case 512: /* other_para_list */ + case 514: /* when_then_list */ + case 539: /* hint_list */ + case 542: /* select_list */ + case 543: /* partition_by_clause_opt */ + case 548: /* group_by_clause_opt */ + case 551: /* partition_list */ + case 555: /* group_by_list */ + case 558: /* order_by_clause_opt */ + case 563: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy946)); + nodesDestroyList((yypminor->yy334)); } break; - case 397: /* is_import_opt */ - case 398: /* is_createdb_opt */ - case 400: /* sysinfo_opt */ + case 391: /* is_import_opt */ + case 392: /* is_createdb_opt */ + case 394: /* sysinfo_opt */ { } break; - case 399: /* user_name */ - case 406: /* db_name */ - case 407: /* table_name */ - case 408: /* topic_name */ - case 410: /* dnode_endpoint */ - case 437: /* column_name */ - case 455: /* function_name */ - case 465: /* column_alias */ - case 466: /* tsma_name */ - case 472: /* index_name */ - case 476: /* sma_func_name */ - case 481: /* cgroup_name */ - case 488: /* language_opt */ - case 490: /* view_name */ - case 491: /* stream_name */ - case 501: /* on_vgroup_id */ - case 506: /* table_alias */ - case 512: /* star_func */ - case 515: /* substr_func */ - case 517: /* noarg_func */ - case 535: /* alias_opt */ + case 393: /* user_name */ + case 400: /* db_name */ + case 401: /* table_name */ + case 402: /* topic_name */ + case 404: /* dnode_endpoint */ + case 431: /* column_name */ + case 449: /* function_name */ + case 459: /* column_alias */ + case 460: /* tsma_name */ + case 466: /* index_name */ + case 470: /* sma_func_name */ + case 475: /* cgroup_name */ + case 482: /* language_opt */ + case 484: /* view_name */ + case 485: /* stream_name */ + case 495: /* on_vgroup_id */ + case 500: /* table_alias */ + case 506: /* star_func */ + case 509: /* substr_func */ + case 511: /* noarg_func */ + case 529: /* alias_opt */ { } break; - case 401: /* privileges */ - case 404: /* priv_type_list */ - case 405: /* priv_type */ + case 395: /* privileges */ + case 398: /* priv_type_list */ + case 399: /* priv_type */ { } break; - case 402: /* priv_level */ + case 396: /* priv_level */ { } break; - case 411: /* force_opt */ - case 412: /* unsafe_opt */ - case 413: /* not_exists_opt */ - case 415: /* exists_opt */ - case 433: /* with_opt */ - case 482: /* analyze_opt */ - case 485: /* or_replace_opt */ - case 486: /* agg_func_opt */ - case 496: /* ignore_opt */ - case 546: /* set_quantifier_opt */ - case 547: /* tag_mode_opt */ + case 405: /* force_opt */ + case 406: /* unsafe_opt */ + case 407: /* not_exists_opt */ + case 409: /* exists_opt */ + case 427: /* with_opt */ + case 476: /* analyze_opt */ + case 479: /* or_replace_opt */ + case 480: /* agg_func_opt */ + case 490: /* ignore_opt */ + case 540: /* set_quantifier_opt */ + case 541: /* tag_mode_opt */ { } break; - case 424: /* alter_db_option */ - case 452: /* alter_table_option */ + case 418: /* alter_db_option */ + case 446: /* alter_table_option */ { } break; - case 438: /* type_name */ - case 449: /* type_name_default_len */ + case 432: /* type_name */ + case 443: /* type_name_default_len */ { } break; - case 457: /* db_kind_opt */ - case 463: /* table_kind */ + case 451: /* db_kind_opt */ + case 457: /* table_kind */ { } break; - case 458: /* table_kind_db_name_cond_opt */ + case 452: /* table_kind_db_name_cond_opt */ { } break; - case 467: /* tsma_func_list */ + case 461: /* tsma_func_list */ { - nodesDestroyNode((yypminor->yy974)); + nodesDestroyNode((yypminor->yy560)); } break; - case 514: /* trim_specification_type */ + case 508: /* trim_specification_type */ { } break; - case 525: /* compare_op */ - case 526: /* in_op */ + case 519: /* compare_op */ + case 520: /* in_op */ { } break; - case 538: /* join_type */ + case 532: /* join_type */ { } break; - case 539: /* join_subtype */ + case 533: /* join_subtype */ { } break; - case 560: /* fill_mode */ + case 554: /* fill_mode */ { } break; - case 571: /* ordering_specification_opt */ + case 565: /* ordering_specification_opt */ { } break; - case 572: /* null_ordering_opt */ + case 566: /* null_ordering_opt */ { } @@ -3955,790 +3909,779 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 389, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 389, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 390, /* (2) account_options ::= */ - 390, /* (3) account_options ::= account_options PPS literal */ - 390, /* (4) account_options ::= account_options TSERIES literal */ - 390, /* (5) account_options ::= account_options STORAGE literal */ - 390, /* (6) account_options ::= account_options STREAMS literal */ - 390, /* (7) account_options ::= account_options QTIME literal */ - 390, /* (8) account_options ::= account_options DBS literal */ - 390, /* (9) account_options ::= account_options USERS literal */ - 390, /* (10) account_options ::= account_options CONNS literal */ - 390, /* (11) account_options ::= account_options STATE literal */ - 391, /* (12) alter_account_options ::= alter_account_option */ - 391, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 393, /* (14) alter_account_option ::= PASS literal */ - 393, /* (15) alter_account_option ::= PPS literal */ - 393, /* (16) alter_account_option ::= TSERIES literal */ - 393, /* (17) alter_account_option ::= STORAGE literal */ - 393, /* (18) alter_account_option ::= STREAMS literal */ - 393, /* (19) alter_account_option ::= QTIME literal */ - 393, /* (20) alter_account_option ::= DBS literal */ - 393, /* (21) alter_account_option ::= USERS literal */ - 393, /* (22) alter_account_option ::= CONNS literal */ - 393, /* (23) alter_account_option ::= STATE literal */ - 394, /* (24) ip_range_list ::= NK_STRING */ - 394, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 395, /* (26) white_list ::= HOST ip_range_list */ - 396, /* (27) white_list_opt ::= */ - 396, /* (28) white_list_opt ::= white_list */ - 397, /* (29) is_import_opt ::= */ - 397, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ - 398, /* (31) is_createdb_opt ::= */ - 398, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ - 389, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ - 389, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ - 389, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 389, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 389, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - 389, /* (38) cmd ::= ALTER USER user_name ADD white_list */ - 389, /* (39) cmd ::= ALTER USER user_name DROP white_list */ - 389, /* (40) cmd ::= DROP USER user_name */ - 400, /* (41) sysinfo_opt ::= */ - 400, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 389, /* (43) cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ - 389, /* (44) cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ - 401, /* (45) privileges ::= ALL */ - 401, /* (46) privileges ::= priv_type_list */ - 401, /* (47) privileges ::= SUBSCRIBE */ - 404, /* (48) priv_type_list ::= priv_type */ - 404, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 405, /* (50) priv_type ::= READ */ - 405, /* (51) priv_type ::= WRITE */ - 405, /* (52) priv_type ::= ALTER */ - 402, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 402, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ - 402, /* (55) priv_level ::= db_name NK_DOT table_name */ - 402, /* (56) priv_level ::= topic_name */ - 403, /* (57) with_clause_opt ::= */ - 403, /* (58) with_clause_opt ::= WITH search_condition */ - 389, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - 389, /* (60) cmd ::= CREATE ANODE NK_STRING */ - 389, /* (61) cmd ::= UPDATE ANODE NK_INTEGER */ - 389, /* (62) cmd ::= UPDATE ALL ANODES */ - 389, /* (63) cmd ::= DROP ANODE NK_INTEGER */ - 389, /* (64) cmd ::= CREATE DNODE dnode_endpoint */ - 389, /* (65) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 389, /* (66) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 389, /* (67) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 389, /* (68) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 389, /* (69) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 389, /* (70) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 389, /* (71) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 389, /* (72) cmd ::= ALTER ALL DNODES NK_STRING */ - 389, /* (73) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 389, /* (74) cmd ::= RESTORE DNODE NK_INTEGER */ - 410, /* (75) dnode_endpoint ::= NK_STRING */ - 410, /* (76) dnode_endpoint ::= NK_ID */ - 410, /* (77) dnode_endpoint ::= NK_IPTOKEN */ - 411, /* (78) force_opt ::= */ - 411, /* (79) force_opt ::= FORCE */ - 412, /* (80) unsafe_opt ::= UNSAFE */ - 389, /* (81) cmd ::= ALTER CLUSTER NK_STRING */ - 389, /* (82) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 389, /* (83) cmd ::= ALTER LOCAL NK_STRING */ - 389, /* (84) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 389, /* (85) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 389, /* (86) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 389, /* (87) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 389, /* (88) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 389, /* (89) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 389, /* (90) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 389, /* (91) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 389, /* (92) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 389, /* (93) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 389, /* (94) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 389, /* (95) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 389, /* (96) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 389, /* (97) cmd ::= DROP DATABASE exists_opt db_name */ - 389, /* (98) cmd ::= USE db_name */ - 389, /* (99) cmd ::= ALTER DATABASE db_name alter_db_options */ - 389, /* (100) cmd ::= FLUSH DATABASE db_name */ - 389, /* (101) cmd ::= TRIM DATABASE db_name speed_opt */ - 389, /* (102) cmd ::= S3MIGRATE DATABASE db_name */ - 389, /* (103) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 413, /* (104) not_exists_opt ::= IF NOT EXISTS */ - 413, /* (105) not_exists_opt ::= */ - 415, /* (106) exists_opt ::= IF EXISTS */ - 415, /* (107) exists_opt ::= */ - 414, /* (108) db_options ::= */ - 414, /* (109) db_options ::= db_options BUFFER NK_INTEGER */ - 414, /* (110) db_options ::= db_options CACHEMODEL NK_STRING */ - 414, /* (111) db_options ::= db_options CACHESIZE NK_INTEGER */ - 414, /* (112) db_options ::= db_options COMP NK_INTEGER */ - 414, /* (113) db_options ::= db_options DURATION NK_INTEGER */ - 414, /* (114) db_options ::= db_options DURATION NK_VARIABLE */ - 414, /* (115) db_options ::= db_options MAXROWS NK_INTEGER */ - 414, /* (116) db_options ::= db_options MINROWS NK_INTEGER */ - 414, /* (117) db_options ::= db_options KEEP integer_list */ - 414, /* (118) db_options ::= db_options KEEP variable_list */ - 414, /* (119) db_options ::= db_options PAGES NK_INTEGER */ - 414, /* (120) db_options ::= db_options PAGESIZE NK_INTEGER */ - 414, /* (121) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 414, /* (122) db_options ::= db_options PRECISION NK_STRING */ - 414, /* (123) db_options ::= db_options REPLICA NK_INTEGER */ - 414, /* (124) db_options ::= db_options VGROUPS NK_INTEGER */ - 414, /* (125) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 414, /* (126) db_options ::= db_options RETENTIONS retention_list */ - 414, /* (127) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 414, /* (128) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 414, /* (129) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 414, /* (130) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 414, /* (131) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 414, /* (132) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 414, /* (133) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 414, /* (134) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 414, /* (135) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 414, /* (136) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 414, /* (137) db_options ::= db_options TABLE_PREFIX signed */ - 414, /* (138) db_options ::= db_options TABLE_SUFFIX signed */ - 414, /* (139) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - 414, /* (140) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - 414, /* (141) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - 414, /* (142) db_options ::= db_options S3_COMPACT NK_INTEGER */ - 414, /* (143) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 414, /* (144) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - 416, /* (145) alter_db_options ::= alter_db_option */ - 416, /* (146) alter_db_options ::= alter_db_options alter_db_option */ - 424, /* (147) alter_db_option ::= BUFFER NK_INTEGER */ - 424, /* (148) alter_db_option ::= CACHEMODEL NK_STRING */ - 424, /* (149) alter_db_option ::= CACHESIZE NK_INTEGER */ - 424, /* (150) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 424, /* (151) alter_db_option ::= KEEP integer_list */ - 424, /* (152) alter_db_option ::= KEEP variable_list */ - 424, /* (153) alter_db_option ::= PAGES NK_INTEGER */ - 424, /* (154) alter_db_option ::= REPLICA NK_INTEGER */ - 424, /* (155) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 424, /* (156) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 424, /* (157) alter_db_option ::= MINROWS NK_INTEGER */ - 424, /* (158) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 424, /* (159) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 424, /* (160) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 424, /* (161) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 424, /* (162) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - 424, /* (163) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - 424, /* (164) alter_db_option ::= S3_COMPACT NK_INTEGER */ - 424, /* (165) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 424, /* (166) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - 420, /* (167) integer_list ::= NK_INTEGER */ - 420, /* (168) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 421, /* (169) variable_list ::= NK_VARIABLE */ - 421, /* (170) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 422, /* (171) retention_list ::= retention */ - 422, /* (172) retention_list ::= retention_list NK_COMMA retention */ - 425, /* (173) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 425, /* (174) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 417, /* (175) speed_opt ::= */ - 417, /* (176) speed_opt ::= BWLIMIT NK_INTEGER */ - 418, /* (177) start_opt ::= */ - 418, /* (178) start_opt ::= START WITH NK_INTEGER */ - 418, /* (179) start_opt ::= START WITH NK_STRING */ - 418, /* (180) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 419, /* (181) end_opt ::= */ - 419, /* (182) end_opt ::= END WITH NK_INTEGER */ - 419, /* (183) end_opt ::= END WITH NK_STRING */ - 419, /* (184) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 389, /* (185) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 389, /* (186) cmd ::= CREATE TABLE multi_create_clause */ - 389, /* (187) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - 389, /* (188) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 389, /* (189) cmd ::= DROP TABLE with_opt multi_drop_clause */ - 389, /* (190) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ - 389, /* (191) cmd ::= ALTER TABLE alter_table_clause */ - 389, /* (192) cmd ::= ALTER STABLE alter_table_clause */ - 435, /* (193) alter_table_clause ::= full_table_name alter_table_options */ - 435, /* (194) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - 435, /* (195) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 435, /* (196) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 435, /* (197) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - 435, /* (198) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 435, /* (199) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 435, /* (200) alter_table_clause ::= full_table_name DROP TAG column_name */ - 435, /* (201) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 435, /* (202) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 435, /* (203) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 430, /* (204) multi_create_clause ::= create_subtable_clause */ - 430, /* (205) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 441, /* (206) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 434, /* (207) multi_drop_clause ::= drop_table_clause */ - 434, /* (208) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 444, /* (209) drop_table_clause ::= exists_opt full_table_name */ - 433, /* (210) with_opt ::= */ - 433, /* (211) with_opt ::= WITH */ - 442, /* (212) specific_cols_opt ::= */ - 442, /* (213) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 426, /* (214) full_table_name ::= table_name */ - 426, /* (215) full_table_name ::= db_name NK_DOT table_name */ - 446, /* (216) tag_def_list ::= tag_def */ - 446, /* (217) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - 447, /* (218) tag_def ::= column_name type_name */ - 427, /* (219) column_def_list ::= column_def */ - 427, /* (220) column_def_list ::= column_def_list NK_COMMA column_def */ - 448, /* (221) column_def ::= column_name type_name column_options */ - 438, /* (222) type_name ::= BOOL */ - 438, /* (223) type_name ::= TINYINT */ - 438, /* (224) type_name ::= SMALLINT */ - 438, /* (225) type_name ::= INT */ - 438, /* (226) type_name ::= INTEGER */ - 438, /* (227) type_name ::= BIGINT */ - 438, /* (228) type_name ::= FLOAT */ - 438, /* (229) type_name ::= DOUBLE */ - 438, /* (230) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 438, /* (231) type_name ::= TIMESTAMP */ - 438, /* (232) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 438, /* (233) type_name ::= TINYINT UNSIGNED */ - 438, /* (234) type_name ::= SMALLINT UNSIGNED */ - 438, /* (235) type_name ::= INT UNSIGNED */ - 438, /* (236) type_name ::= BIGINT UNSIGNED */ - 438, /* (237) type_name ::= JSON */ - 438, /* (238) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 438, /* (239) type_name ::= MEDIUMBLOB */ - 438, /* (240) type_name ::= BLOB */ - 438, /* (241) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 438, /* (242) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 438, /* (243) type_name ::= DECIMAL */ - 438, /* (244) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 438, /* (245) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 449, /* (246) type_name_default_len ::= BINARY */ - 449, /* (247) type_name_default_len ::= NCHAR */ - 449, /* (248) type_name_default_len ::= VARCHAR */ - 449, /* (249) type_name_default_len ::= VARBINARY */ - 428, /* (250) tags_def_opt ::= */ - 428, /* (251) tags_def_opt ::= tags_def */ - 432, /* (252) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 429, /* (253) table_options ::= */ - 429, /* (254) table_options ::= table_options COMMENT NK_STRING */ - 429, /* (255) table_options ::= table_options MAX_DELAY duration_list */ - 429, /* (256) table_options ::= table_options WATERMARK duration_list */ - 429, /* (257) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 429, /* (258) table_options ::= table_options TTL NK_INTEGER */ - 429, /* (259) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 429, /* (260) table_options ::= table_options DELETE_MARK duration_list */ - 436, /* (261) alter_table_options ::= alter_table_option */ - 436, /* (262) alter_table_options ::= alter_table_options alter_table_option */ - 452, /* (263) alter_table_option ::= COMMENT NK_STRING */ - 452, /* (264) alter_table_option ::= TTL NK_INTEGER */ - 450, /* (265) duration_list ::= duration_literal */ - 450, /* (266) duration_list ::= duration_list NK_COMMA duration_literal */ - 451, /* (267) rollup_func_list ::= rollup_func_name */ - 451, /* (268) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 454, /* (269) rollup_func_name ::= function_name */ - 454, /* (270) rollup_func_name ::= FIRST */ - 454, /* (271) rollup_func_name ::= LAST */ - 445, /* (272) col_name_list ::= col_name */ - 445, /* (273) col_name_list ::= col_name_list NK_COMMA col_name */ - 456, /* (274) col_name ::= column_name */ - 389, /* (275) cmd ::= SHOW DNODES */ - 389, /* (276) cmd ::= SHOW USERS */ - 389, /* (277) cmd ::= SHOW USERS FULL */ - 389, /* (278) cmd ::= SHOW USER PRIVILEGES */ - 389, /* (279) cmd ::= SHOW db_kind_opt DATABASES */ - 389, /* (280) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 389, /* (281) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 389, /* (282) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 389, /* (283) cmd ::= SHOW MNODES */ - 389, /* (284) cmd ::= SHOW QNODES */ - 389, /* (285) cmd ::= SHOW ANODES */ - 389, /* (286) cmd ::= SHOW ANODES FULL */ - 389, /* (287) cmd ::= SHOW ARBGROUPS */ - 389, /* (288) cmd ::= SHOW FUNCTIONS */ - 389, /* (289) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 389, /* (290) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 389, /* (291) cmd ::= SHOW STREAMS */ - 389, /* (292) cmd ::= SHOW ACCOUNTS */ - 389, /* (293) cmd ::= SHOW APPS */ - 389, /* (294) cmd ::= SHOW CONNECTIONS */ - 389, /* (295) cmd ::= SHOW LICENCES */ - 389, /* (296) cmd ::= SHOW GRANTS */ - 389, /* (297) cmd ::= SHOW GRANTS FULL */ - 389, /* (298) cmd ::= SHOW GRANTS LOGS */ - 389, /* (299) cmd ::= SHOW CLUSTER MACHINES */ - 389, /* (300) cmd ::= SHOW CREATE DATABASE db_name */ - 389, /* (301) cmd ::= SHOW CREATE TABLE full_table_name */ - 389, /* (302) cmd ::= SHOW CREATE STABLE full_table_name */ - 389, /* (303) cmd ::= SHOW ENCRYPTIONS */ - 389, /* (304) cmd ::= SHOW QUERIES */ - 389, /* (305) cmd ::= SHOW SCORES */ - 389, /* (306) cmd ::= SHOW TOPICS */ - 389, /* (307) cmd ::= SHOW VARIABLES */ - 389, /* (308) cmd ::= SHOW CLUSTER VARIABLES */ - 389, /* (309) cmd ::= SHOW LOCAL VARIABLES */ - 389, /* (310) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 389, /* (311) cmd ::= SHOW BNODES */ - 389, /* (312) cmd ::= SHOW SNODES */ - 389, /* (313) cmd ::= SHOW CLUSTER */ - 389, /* (314) cmd ::= SHOW TRANSACTIONS */ - 389, /* (315) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 389, /* (316) cmd ::= SHOW CONSUMERS */ - 389, /* (317) cmd ::= SHOW SUBSCRIPTIONS */ - 389, /* (318) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 389, /* (319) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 389, /* (320) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 389, /* (321) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 389, /* (322) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 389, /* (323) cmd ::= SHOW VNODES */ - 389, /* (324) cmd ::= SHOW db_name_cond_opt ALIVE */ - 389, /* (325) cmd ::= SHOW CLUSTER ALIVE */ - 389, /* (326) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 389, /* (327) cmd ::= SHOW CREATE VIEW full_table_name */ - 389, /* (328) cmd ::= SHOW COMPACTS */ - 389, /* (329) cmd ::= SHOW COMPACT NK_INTEGER */ - 458, /* (330) table_kind_db_name_cond_opt ::= */ - 458, /* (331) table_kind_db_name_cond_opt ::= table_kind */ - 458, /* (332) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 458, /* (333) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 463, /* (334) table_kind ::= NORMAL */ - 463, /* (335) table_kind ::= CHILD */ - 460, /* (336) db_name_cond_opt ::= */ - 460, /* (337) db_name_cond_opt ::= db_name NK_DOT */ - 459, /* (338) like_pattern_opt ::= */ - 459, /* (339) like_pattern_opt ::= LIKE NK_STRING */ - 461, /* (340) table_name_cond ::= table_name */ - 462, /* (341) from_db_opt ::= */ - 462, /* (342) from_db_opt ::= FROM db_name */ - 431, /* (343) tag_list_opt ::= */ - 431, /* (344) tag_list_opt ::= tag_item */ - 431, /* (345) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 464, /* (346) tag_item ::= TBNAME */ - 464, /* (347) tag_item ::= QTAGS */ - 464, /* (348) tag_item ::= column_name */ - 464, /* (349) tag_item ::= column_name column_alias */ - 464, /* (350) tag_item ::= column_name AS column_alias */ - 457, /* (351) db_kind_opt ::= */ - 457, /* (352) db_kind_opt ::= USER */ - 457, /* (353) db_kind_opt ::= SYSTEM */ - 389, /* (354) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - 389, /* (355) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - 389, /* (356) cmd ::= DROP TSMA exists_opt full_tsma_name */ - 389, /* (357) cmd ::= SHOW db_name_cond_opt TSMAS */ - 468, /* (358) full_tsma_name ::= tsma_name */ - 468, /* (359) full_tsma_name ::= db_name NK_DOT tsma_name */ - 467, /* (360) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - 389, /* (361) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 389, /* (362) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 389, /* (363) cmd ::= DROP INDEX exists_opt full_index_name */ - 471, /* (364) full_index_name ::= index_name */ - 471, /* (365) full_index_name ::= db_name NK_DOT index_name */ - 470, /* (366) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 470, /* (367) 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 */ - 469, /* (368) func_list ::= func */ - 469, /* (369) func_list ::= func_list NK_COMMA func */ - 475, /* (370) func ::= sma_func_name NK_LP expression_list NK_RP */ - 476, /* (371) sma_func_name ::= function_name */ - 476, /* (372) sma_func_name ::= COUNT */ - 476, /* (373) sma_func_name ::= FIRST */ - 476, /* (374) sma_func_name ::= LAST */ - 476, /* (375) sma_func_name ::= LAST_ROW */ - 474, /* (376) sma_stream_opt ::= */ - 474, /* (377) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 474, /* (378) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 474, /* (379) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 478, /* (380) with_meta ::= AS */ - 478, /* (381) with_meta ::= WITH META AS */ - 478, /* (382) with_meta ::= ONLY META AS */ - 389, /* (383) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 389, /* (384) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 389, /* (385) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 389, /* (386) cmd ::= DROP TOPIC exists_opt topic_name */ - 389, /* (387) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 389, /* (388) cmd ::= DESC full_table_name */ - 389, /* (389) cmd ::= DESCRIBE full_table_name */ - 389, /* (390) cmd ::= RESET QUERY CACHE */ - 389, /* (391) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 389, /* (392) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 482, /* (393) analyze_opt ::= */ - 482, /* (394) analyze_opt ::= ANALYZE */ - 483, /* (395) explain_options ::= */ - 483, /* (396) explain_options ::= explain_options VERBOSE NK_BOOL */ - 483, /* (397) explain_options ::= explain_options RATIO NK_FLOAT */ - 389, /* (398) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 389, /* (399) cmd ::= DROP FUNCTION exists_opt function_name */ - 486, /* (400) agg_func_opt ::= */ - 486, /* (401) agg_func_opt ::= AGGREGATE */ - 487, /* (402) bufsize_opt ::= */ - 487, /* (403) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 488, /* (404) language_opt ::= */ - 488, /* (405) language_opt ::= LANGUAGE NK_STRING */ - 485, /* (406) or_replace_opt ::= */ - 485, /* (407) or_replace_opt ::= OR REPLACE */ - 389, /* (408) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 389, /* (409) cmd ::= DROP VIEW exists_opt full_view_name */ - 489, /* (410) full_view_name ::= view_name */ - 489, /* (411) full_view_name ::= db_name NK_DOT view_name */ - 389, /* (412) 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 */ - 389, /* (413) cmd ::= DROP STREAM exists_opt stream_name */ - 389, /* (414) cmd ::= PAUSE STREAM exists_opt stream_name */ - 389, /* (415) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 493, /* (416) col_list_opt ::= */ - 493, /* (417) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - 497, /* (418) column_stream_def_list ::= column_stream_def */ - 497, /* (419) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - 498, /* (420) column_stream_def ::= column_name stream_col_options */ - 499, /* (421) stream_col_options ::= */ - 499, /* (422) stream_col_options ::= stream_col_options PRIMARY KEY */ - 494, /* (423) tag_def_or_ref_opt ::= */ - 494, /* (424) tag_def_or_ref_opt ::= tags_def */ - 494, /* (425) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 492, /* (426) stream_options ::= */ - 492, /* (427) stream_options ::= stream_options TRIGGER AT_ONCE */ - 492, /* (428) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 492, /* (429) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 492, /* (430) stream_options ::= stream_options WATERMARK duration_literal */ - 492, /* (431) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 492, /* (432) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 492, /* (433) stream_options ::= stream_options DELETE_MARK duration_literal */ - 492, /* (434) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 495, /* (435) subtable_opt ::= */ - 495, /* (436) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 496, /* (437) ignore_opt ::= */ - 496, /* (438) ignore_opt ::= IGNORE UNTREATED */ - 389, /* (439) cmd ::= KILL CONNECTION NK_INTEGER */ - 389, /* (440) cmd ::= KILL QUERY NK_STRING */ - 389, /* (441) cmd ::= KILL TRANSACTION NK_INTEGER */ - 389, /* (442) cmd ::= KILL COMPACT NK_INTEGER */ - 389, /* (443) cmd ::= BALANCE VGROUP */ - 389, /* (444) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 389, /* (445) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - 389, /* (446) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 389, /* (447) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 389, /* (448) cmd ::= SPLIT VGROUP NK_INTEGER */ - 501, /* (449) on_vgroup_id ::= */ - 501, /* (450) on_vgroup_id ::= ON NK_INTEGER */ - 502, /* (451) dnode_list ::= DNODE NK_INTEGER */ - 502, /* (452) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 389, /* (453) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 389, /* (454) cmd ::= query_or_subquery */ - 389, /* (455) cmd ::= insert_query */ - 484, /* (456) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 484, /* (457) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 440, /* (458) tags_literal ::= NK_INTEGER */ - 440, /* (459) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - 440, /* (460) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - 440, /* (461) tags_literal ::= NK_PLUS NK_INTEGER */ - 440, /* (462) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - 440, /* (463) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - 440, /* (464) tags_literal ::= NK_MINUS NK_INTEGER */ - 440, /* (465) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - 440, /* (466) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - 440, /* (467) tags_literal ::= NK_FLOAT */ - 440, /* (468) tags_literal ::= NK_PLUS NK_FLOAT */ - 440, /* (469) tags_literal ::= NK_MINUS NK_FLOAT */ - 440, /* (470) tags_literal ::= NK_BIN */ - 440, /* (471) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - 440, /* (472) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - 440, /* (473) tags_literal ::= NK_PLUS NK_BIN */ - 440, /* (474) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - 440, /* (475) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - 440, /* (476) tags_literal ::= NK_MINUS NK_BIN */ - 440, /* (477) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - 440, /* (478) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - 440, /* (479) tags_literal ::= NK_HEX */ - 440, /* (480) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - 440, /* (481) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - 440, /* (482) tags_literal ::= NK_PLUS NK_HEX */ - 440, /* (483) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - 440, /* (484) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - 440, /* (485) tags_literal ::= NK_MINUS NK_HEX */ - 440, /* (486) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - 440, /* (487) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - 440, /* (488) tags_literal ::= NK_STRING */ - 440, /* (489) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - 440, /* (490) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - 440, /* (491) tags_literal ::= NK_BOOL */ - 440, /* (492) tags_literal ::= NULL */ - 440, /* (493) tags_literal ::= literal_func */ - 440, /* (494) tags_literal ::= literal_func NK_PLUS duration_literal */ - 440, /* (495) tags_literal ::= literal_func NK_MINUS duration_literal */ - 443, /* (496) tags_literal_list ::= tags_literal */ - 443, /* (497) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 392, /* (498) literal ::= NK_INTEGER */ - 392, /* (499) literal ::= NK_FLOAT */ - 392, /* (500) literal ::= NK_STRING */ - 392, /* (501) literal ::= NK_BOOL */ - 392, /* (502) literal ::= TIMESTAMP NK_STRING */ - 392, /* (503) literal ::= duration_literal */ - 392, /* (504) literal ::= NULL */ - 392, /* (505) literal ::= NK_QUESTION */ - 453, /* (506) duration_literal ::= NK_VARIABLE */ - 423, /* (507) signed ::= NK_INTEGER */ - 423, /* (508) signed ::= NK_PLUS NK_INTEGER */ - 423, /* (509) signed ::= NK_MINUS NK_INTEGER */ - 423, /* (510) signed ::= NK_FLOAT */ - 423, /* (511) signed ::= NK_PLUS NK_FLOAT */ - 423, /* (512) signed ::= NK_MINUS NK_FLOAT */ - 504, /* (513) signed_literal ::= signed */ - 504, /* (514) signed_literal ::= NK_STRING */ - 504, /* (515) signed_literal ::= NK_BOOL */ - 504, /* (516) signed_literal ::= TIMESTAMP NK_STRING */ - 504, /* (517) signed_literal ::= duration_literal */ - 504, /* (518) signed_literal ::= NULL */ - 504, /* (519) signed_literal ::= literal_func */ - 504, /* (520) signed_literal ::= NK_QUESTION */ - 505, /* (521) literal_list ::= signed_literal */ - 505, /* (522) literal_list ::= literal_list NK_COMMA signed_literal */ - 406, /* (523) db_name ::= NK_ID */ - 407, /* (524) table_name ::= NK_ID */ - 437, /* (525) column_name ::= NK_ID */ - 455, /* (526) function_name ::= NK_ID */ - 490, /* (527) view_name ::= NK_ID */ - 506, /* (528) table_alias ::= NK_ID */ - 465, /* (529) column_alias ::= NK_ID */ - 465, /* (530) column_alias ::= NK_ALIAS */ - 399, /* (531) user_name ::= NK_ID */ - 408, /* (532) topic_name ::= NK_ID */ - 491, /* (533) stream_name ::= NK_ID */ - 481, /* (534) cgroup_name ::= NK_ID */ - 472, /* (535) index_name ::= NK_ID */ - 466, /* (536) tsma_name ::= NK_ID */ - 507, /* (537) expr_or_subquery ::= expression */ - 500, /* (538) expression ::= literal */ - 500, /* (539) expression ::= pseudo_column */ - 500, /* (540) expression ::= column_reference */ - 500, /* (541) expression ::= function_expression */ - 500, /* (542) expression ::= case_when_expression */ - 500, /* (543) expression ::= NK_LP expression NK_RP */ - 500, /* (544) expression ::= NK_PLUS expr_or_subquery */ - 500, /* (545) expression ::= NK_MINUS expr_or_subquery */ - 500, /* (546) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 500, /* (547) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 500, /* (548) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 500, /* (549) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 500, /* (550) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 500, /* (551) expression ::= column_reference NK_ARROW NK_STRING */ - 500, /* (552) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 500, /* (553) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 477, /* (554) expression_list ::= expr_or_subquery */ - 477, /* (555) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 509, /* (556) column_reference ::= column_name */ - 509, /* (557) column_reference ::= table_name NK_DOT column_name */ - 509, /* (558) column_reference ::= NK_ALIAS */ - 509, /* (559) column_reference ::= table_name NK_DOT NK_ALIAS */ - 508, /* (560) pseudo_column ::= ROWTS */ - 508, /* (561) pseudo_column ::= TBNAME */ - 508, /* (562) pseudo_column ::= table_name NK_DOT TBNAME */ - 508, /* (563) pseudo_column ::= QSTART */ - 508, /* (564) pseudo_column ::= QEND */ - 508, /* (565) pseudo_column ::= QDURATION */ - 508, /* (566) pseudo_column ::= WSTART */ - 508, /* (567) pseudo_column ::= WEND */ - 508, /* (568) pseudo_column ::= WDURATION */ - 508, /* (569) pseudo_column ::= IROWTS */ - 508, /* (570) pseudo_column ::= ISFILLED */ - 508, /* (571) pseudo_column ::= QTAGS */ - 508, /* (572) pseudo_column ::= FLOW */ - 508, /* (573) pseudo_column ::= FHIGH */ - 508, /* (574) pseudo_column ::= FROWTS */ - 510, /* (575) function_expression ::= function_name NK_LP expression_list NK_RP */ - 510, /* (576) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 510, /* (577) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 510, /* (578) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - 510, /* (579) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ - 510, /* (580) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ - 510, /* (581) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ - 510, /* (582) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - 510, /* (583) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ - 510, /* (584) function_expression ::= substr_func NK_LP expression_list NK_RP */ - 510, /* (585) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - 510, /* (586) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ - 510, /* (587) function_expression ::= REPLACE NK_LP expression_list NK_RP */ - 510, /* (588) function_expression ::= literal_func */ - 510, /* (589) function_expression ::= rand_func */ - 503, /* (590) literal_func ::= noarg_func NK_LP NK_RP */ - 503, /* (591) literal_func ::= NOW */ - 503, /* (592) literal_func ::= TODAY */ - 516, /* (593) rand_func ::= RAND NK_LP NK_RP */ - 516, /* (594) rand_func ::= RAND NK_LP expression_list NK_RP */ - 515, /* (595) substr_func ::= SUBSTR */ - 515, /* (596) substr_func ::= SUBSTRING */ - 514, /* (597) trim_specification_type ::= BOTH */ - 514, /* (598) trim_specification_type ::= TRAILING */ - 514, /* (599) trim_specification_type ::= LEADING */ - 517, /* (600) noarg_func ::= NOW */ - 517, /* (601) noarg_func ::= TODAY */ - 517, /* (602) noarg_func ::= TIMEZONE */ - 517, /* (603) noarg_func ::= DATABASE */ - 517, /* (604) noarg_func ::= CLIENT_VERSION */ - 517, /* (605) noarg_func ::= SERVER_VERSION */ - 517, /* (606) noarg_func ::= SERVER_STATUS */ - 517, /* (607) noarg_func ::= CURRENT_USER */ - 517, /* (608) noarg_func ::= USER */ - 517, /* (609) noarg_func ::= PI */ - 512, /* (610) star_func ::= COUNT */ - 512, /* (611) star_func ::= FIRST */ - 512, /* (612) star_func ::= LAST */ - 512, /* (613) star_func ::= LAST_ROW */ - 513, /* (614) star_func_para_list ::= NK_STAR */ - 513, /* (615) star_func_para_list ::= other_para_list */ - 518, /* (616) other_para_list ::= star_func_para */ - 518, /* (617) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 519, /* (618) star_func_para ::= expr_or_subquery */ - 519, /* (619) star_func_para ::= table_name NK_DOT NK_STAR */ - 511, /* (620) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 511, /* (621) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 520, /* (622) when_then_list ::= when_then_expr */ - 520, /* (623) when_then_list ::= when_then_list when_then_expr */ - 523, /* (624) when_then_expr ::= WHEN common_expression THEN common_expression */ - 521, /* (625) case_when_else_opt ::= */ - 521, /* (626) case_when_else_opt ::= ELSE common_expression */ - 524, /* (627) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 524, /* (628) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 524, /* (629) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 524, /* (630) predicate ::= expr_or_subquery IS NULL */ - 524, /* (631) predicate ::= expr_or_subquery IS NOT NULL */ - 524, /* (632) predicate ::= expr_or_subquery in_op in_predicate_value */ - 525, /* (633) compare_op ::= NK_LT */ - 525, /* (634) compare_op ::= NK_GT */ - 525, /* (635) compare_op ::= NK_LE */ - 525, /* (636) compare_op ::= NK_GE */ - 525, /* (637) compare_op ::= NK_NE */ - 525, /* (638) compare_op ::= NK_EQ */ - 525, /* (639) compare_op ::= LIKE */ - 525, /* (640) compare_op ::= NOT LIKE */ - 525, /* (641) compare_op ::= MATCH */ - 525, /* (642) compare_op ::= NMATCH */ - 525, /* (643) compare_op ::= CONTAINS */ - 526, /* (644) in_op ::= IN */ - 526, /* (645) in_op ::= NOT IN */ - 527, /* (646) in_predicate_value ::= NK_LP literal_list NK_RP */ - 528, /* (647) boolean_value_expression ::= boolean_primary */ - 528, /* (648) boolean_value_expression ::= NOT boolean_primary */ - 528, /* (649) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 528, /* (650) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 529, /* (651) boolean_primary ::= predicate */ - 529, /* (652) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 522, /* (653) common_expression ::= expr_or_subquery */ - 522, /* (654) common_expression ::= boolean_value_expression */ - 530, /* (655) from_clause_opt ::= */ - 530, /* (656) from_clause_opt ::= FROM table_reference_list */ - 531, /* (657) table_reference_list ::= table_reference */ - 531, /* (658) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 532, /* (659) table_reference ::= table_primary */ - 532, /* (660) table_reference ::= joined_table */ - 533, /* (661) table_primary ::= table_name alias_opt */ - 533, /* (662) table_primary ::= db_name NK_DOT table_name alias_opt */ - 533, /* (663) table_primary ::= subquery alias_opt */ - 533, /* (664) table_primary ::= parenthesized_joined_table */ - 535, /* (665) alias_opt ::= */ - 535, /* (666) alias_opt ::= table_alias */ - 535, /* (667) alias_opt ::= AS table_alias */ - 537, /* (668) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 537, /* (669) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 534, /* (670) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 538, /* (671) join_type ::= */ - 538, /* (672) join_type ::= INNER */ - 538, /* (673) join_type ::= LEFT */ - 538, /* (674) join_type ::= RIGHT */ - 538, /* (675) join_type ::= FULL */ - 539, /* (676) join_subtype ::= */ - 539, /* (677) join_subtype ::= OUTER */ - 539, /* (678) join_subtype ::= SEMI */ - 539, /* (679) join_subtype ::= ANTI */ - 539, /* (680) join_subtype ::= ASOF */ - 539, /* (681) join_subtype ::= WINDOW */ - 540, /* (682) join_on_clause_opt ::= */ - 540, /* (683) join_on_clause_opt ::= ON search_condition */ - 541, /* (684) window_offset_clause_opt ::= */ - 541, /* (685) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 543, /* (686) window_offset_literal ::= NK_VARIABLE */ - 543, /* (687) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 542, /* (688) jlimit_clause_opt ::= */ - 542, /* (689) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 544, /* (690) 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 */ - 545, /* (691) hint_list ::= */ - 545, /* (692) hint_list ::= NK_HINT */ - 547, /* (693) tag_mode_opt ::= */ - 547, /* (694) tag_mode_opt ::= TAGS */ - 546, /* (695) set_quantifier_opt ::= */ - 546, /* (696) set_quantifier_opt ::= DISTINCT */ - 546, /* (697) set_quantifier_opt ::= ALL */ - 548, /* (698) select_list ::= select_item */ - 548, /* (699) select_list ::= select_list NK_COMMA select_item */ - 556, /* (700) select_item ::= NK_STAR */ - 556, /* (701) select_item ::= common_expression */ - 556, /* (702) select_item ::= common_expression column_alias */ - 556, /* (703) select_item ::= common_expression AS column_alias */ - 556, /* (704) select_item ::= table_name NK_DOT NK_STAR */ - 480, /* (705) where_clause_opt ::= */ - 480, /* (706) where_clause_opt ::= WHERE search_condition */ - 549, /* (707) partition_by_clause_opt ::= */ - 549, /* (708) partition_by_clause_opt ::= PARTITION BY partition_list */ - 557, /* (709) partition_list ::= partition_item */ - 557, /* (710) partition_list ::= partition_list NK_COMMA partition_item */ - 558, /* (711) partition_item ::= expr_or_subquery */ - 558, /* (712) partition_item ::= expr_or_subquery column_alias */ - 558, /* (713) partition_item ::= expr_or_subquery AS column_alias */ - 553, /* (714) twindow_clause_opt ::= */ - 553, /* (715) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 553, /* (716) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 553, /* (717) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 553, /* (718) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 553, /* (719) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 553, /* (720) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 553, /* (721) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 553, /* (722) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ - 553, /* (723) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ - 473, /* (724) sliding_opt ::= */ - 473, /* (725) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 559, /* (726) interval_sliding_duration_literal ::= NK_VARIABLE */ - 559, /* (727) interval_sliding_duration_literal ::= NK_STRING */ - 559, /* (728) interval_sliding_duration_literal ::= NK_INTEGER */ - 552, /* (729) fill_opt ::= */ - 552, /* (730) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 552, /* (731) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 552, /* (732) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 560, /* (733) fill_mode ::= NONE */ - 560, /* (734) fill_mode ::= PREV */ - 560, /* (735) fill_mode ::= NULL */ - 560, /* (736) fill_mode ::= NULL_F */ - 560, /* (737) fill_mode ::= LINEAR */ - 560, /* (738) fill_mode ::= NEXT */ - 554, /* (739) group_by_clause_opt ::= */ - 554, /* (740) group_by_clause_opt ::= GROUP BY group_by_list */ - 561, /* (741) group_by_list ::= expr_or_subquery */ - 561, /* (742) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 555, /* (743) having_clause_opt ::= */ - 555, /* (744) having_clause_opt ::= HAVING search_condition */ - 550, /* (745) range_opt ::= */ - 550, /* (746) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 550, /* (747) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 551, /* (748) every_opt ::= */ - 551, /* (749) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 562, /* (750) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 563, /* (751) query_simple ::= query_specification */ - 563, /* (752) query_simple ::= union_query_expression */ - 567, /* (753) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 567, /* (754) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 568, /* (755) query_simple_or_subquery ::= query_simple */ - 568, /* (756) query_simple_or_subquery ::= subquery */ - 479, /* (757) query_or_subquery ::= query_expression */ - 479, /* (758) query_or_subquery ::= subquery */ - 564, /* (759) order_by_clause_opt ::= */ - 564, /* (760) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 565, /* (761) slimit_clause_opt ::= */ - 565, /* (762) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 565, /* (763) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 565, /* (764) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 566, /* (765) limit_clause_opt ::= */ - 566, /* (766) limit_clause_opt ::= LIMIT NK_INTEGER */ - 566, /* (767) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 566, /* (768) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 536, /* (769) subquery ::= NK_LP query_expression NK_RP */ - 536, /* (770) subquery ::= NK_LP subquery NK_RP */ - 409, /* (771) search_condition ::= common_expression */ - 569, /* (772) sort_specification_list ::= sort_specification */ - 569, /* (773) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 570, /* (774) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 571, /* (775) ordering_specification_opt ::= */ - 571, /* (776) ordering_specification_opt ::= ASC */ - 571, /* (777) ordering_specification_opt ::= DESC */ - 572, /* (778) null_ordering_opt ::= */ - 572, /* (779) null_ordering_opt ::= NULLS FIRST */ - 572, /* (780) null_ordering_opt ::= NULLS LAST */ - 439, /* (781) column_options ::= */ - 439, /* (782) column_options ::= column_options PRIMARY KEY */ - 439, /* (783) column_options ::= column_options NK_ID NK_STRING */ + 383, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 383, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 384, /* (2) account_options ::= */ + 384, /* (3) account_options ::= account_options PPS literal */ + 384, /* (4) account_options ::= account_options TSERIES literal */ + 384, /* (5) account_options ::= account_options STORAGE literal */ + 384, /* (6) account_options ::= account_options STREAMS literal */ + 384, /* (7) account_options ::= account_options QTIME literal */ + 384, /* (8) account_options ::= account_options DBS literal */ + 384, /* (9) account_options ::= account_options USERS literal */ + 384, /* (10) account_options ::= account_options CONNS literal */ + 384, /* (11) account_options ::= account_options STATE literal */ + 385, /* (12) alter_account_options ::= alter_account_option */ + 385, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 387, /* (14) alter_account_option ::= PASS literal */ + 387, /* (15) alter_account_option ::= PPS literal */ + 387, /* (16) alter_account_option ::= TSERIES literal */ + 387, /* (17) alter_account_option ::= STORAGE literal */ + 387, /* (18) alter_account_option ::= STREAMS literal */ + 387, /* (19) alter_account_option ::= QTIME literal */ + 387, /* (20) alter_account_option ::= DBS literal */ + 387, /* (21) alter_account_option ::= USERS literal */ + 387, /* (22) alter_account_option ::= CONNS literal */ + 387, /* (23) alter_account_option ::= STATE literal */ + 388, /* (24) ip_range_list ::= NK_STRING */ + 388, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 389, /* (26) white_list ::= HOST ip_range_list */ + 390, /* (27) white_list_opt ::= */ + 390, /* (28) white_list_opt ::= white_list */ + 391, /* (29) is_import_opt ::= */ + 391, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ + 392, /* (31) is_createdb_opt ::= */ + 392, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ + 383, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + 383, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ + 383, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 383, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 383, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + 383, /* (38) cmd ::= ALTER USER user_name ADD white_list */ + 383, /* (39) cmd ::= ALTER USER user_name DROP white_list */ + 383, /* (40) cmd ::= DROP USER user_name */ + 394, /* (41) sysinfo_opt ::= */ + 394, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 383, /* (43) cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ + 383, /* (44) cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ + 395, /* (45) privileges ::= ALL */ + 395, /* (46) privileges ::= priv_type_list */ + 395, /* (47) privileges ::= SUBSCRIBE */ + 398, /* (48) priv_type_list ::= priv_type */ + 398, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 399, /* (50) priv_type ::= READ */ + 399, /* (51) priv_type ::= WRITE */ + 399, /* (52) priv_type ::= ALTER */ + 396, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 396, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ + 396, /* (55) priv_level ::= db_name NK_DOT table_name */ + 396, /* (56) priv_level ::= topic_name */ + 397, /* (57) with_clause_opt ::= */ + 397, /* (58) with_clause_opt ::= WITH search_condition */ + 383, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + 383, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + 383, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 383, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 383, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 383, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 383, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 383, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 383, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 383, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + 383, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 383, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + 404, /* (71) dnode_endpoint ::= NK_STRING */ + 404, /* (72) dnode_endpoint ::= NK_ID */ + 404, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + 405, /* (74) force_opt ::= */ + 405, /* (75) force_opt ::= FORCE */ + 406, /* (76) unsafe_opt ::= UNSAFE */ + 383, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + 383, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 383, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + 383, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 383, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 383, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 383, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 383, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 383, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 383, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 383, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 383, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 383, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 383, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 383, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 383, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 383, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + 383, /* (94) cmd ::= USE db_name */ + 383, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + 383, /* (96) cmd ::= FLUSH DATABASE db_name */ + 383, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + 383, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + 383, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 407, /* (100) not_exists_opt ::= IF NOT EXISTS */ + 407, /* (101) not_exists_opt ::= */ + 409, /* (102) exists_opt ::= IF EXISTS */ + 409, /* (103) exists_opt ::= */ + 408, /* (104) db_options ::= */ + 408, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + 408, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + 408, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + 408, /* (108) db_options ::= db_options COMP NK_INTEGER */ + 408, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + 408, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + 408, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + 408, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + 408, /* (113) db_options ::= db_options KEEP integer_list */ + 408, /* (114) db_options ::= db_options KEEP variable_list */ + 408, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + 408, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + 408, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 408, /* (118) db_options ::= db_options PRECISION NK_STRING */ + 408, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + 408, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + 408, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 408, /* (122) db_options ::= db_options RETENTIONS retention_list */ + 408, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 408, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 408, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 408, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 408, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 408, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 408, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 408, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 408, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 408, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 408, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + 408, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + 408, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + 408, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + 408, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + 408, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + 408, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 408, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + 410, /* (141) alter_db_options ::= alter_db_option */ + 410, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + 418, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + 418, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + 418, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + 418, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 418, /* (147) alter_db_option ::= KEEP integer_list */ + 418, /* (148) alter_db_option ::= KEEP variable_list */ + 418, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + 418, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + 418, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 418, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 418, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + 418, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 418, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 418, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 418, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 418, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + 418, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + 418, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + 418, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 418, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + 414, /* (163) integer_list ::= NK_INTEGER */ + 414, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 415, /* (165) variable_list ::= NK_VARIABLE */ + 415, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 416, /* (167) retention_list ::= retention */ + 416, /* (168) retention_list ::= retention_list NK_COMMA retention */ + 419, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 419, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 411, /* (171) speed_opt ::= */ + 411, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + 412, /* (173) start_opt ::= */ + 412, /* (174) start_opt ::= START WITH NK_INTEGER */ + 412, /* (175) start_opt ::= START WITH NK_STRING */ + 412, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 413, /* (177) end_opt ::= */ + 413, /* (178) end_opt ::= END WITH NK_INTEGER */ + 413, /* (179) end_opt ::= END WITH NK_STRING */ + 413, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 383, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 383, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + 383, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + 383, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 383, /* (185) cmd ::= DROP TABLE with_opt multi_drop_clause */ + 383, /* (186) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ + 383, /* (187) cmd ::= ALTER TABLE alter_table_clause */ + 383, /* (188) cmd ::= ALTER STABLE alter_table_clause */ + 429, /* (189) alter_table_clause ::= full_table_name alter_table_options */ + 429, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + 429, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 429, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 429, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + 429, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 429, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 429, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ + 429, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 429, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 429, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 424, /* (200) multi_create_clause ::= create_subtable_clause */ + 424, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 435, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 428, /* (203) multi_drop_clause ::= drop_table_clause */ + 428, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 438, /* (205) drop_table_clause ::= exists_opt full_table_name */ + 427, /* (206) with_opt ::= */ + 427, /* (207) with_opt ::= WITH */ + 436, /* (208) specific_cols_opt ::= */ + 436, /* (209) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 420, /* (210) full_table_name ::= table_name */ + 420, /* (211) full_table_name ::= db_name NK_DOT table_name */ + 440, /* (212) tag_def_list ::= tag_def */ + 440, /* (213) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + 441, /* (214) tag_def ::= column_name type_name */ + 421, /* (215) column_def_list ::= column_def */ + 421, /* (216) column_def_list ::= column_def_list NK_COMMA column_def */ + 442, /* (217) column_def ::= column_name type_name column_options */ + 432, /* (218) type_name ::= BOOL */ + 432, /* (219) type_name ::= TINYINT */ + 432, /* (220) type_name ::= SMALLINT */ + 432, /* (221) type_name ::= INT */ + 432, /* (222) type_name ::= INTEGER */ + 432, /* (223) type_name ::= BIGINT */ + 432, /* (224) type_name ::= FLOAT */ + 432, /* (225) type_name ::= DOUBLE */ + 432, /* (226) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 432, /* (227) type_name ::= TIMESTAMP */ + 432, /* (228) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 432, /* (229) type_name ::= TINYINT UNSIGNED */ + 432, /* (230) type_name ::= SMALLINT UNSIGNED */ + 432, /* (231) type_name ::= INT UNSIGNED */ + 432, /* (232) type_name ::= BIGINT UNSIGNED */ + 432, /* (233) type_name ::= JSON */ + 432, /* (234) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 432, /* (235) type_name ::= MEDIUMBLOB */ + 432, /* (236) type_name ::= BLOB */ + 432, /* (237) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 432, /* (238) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 432, /* (239) type_name ::= DECIMAL */ + 432, /* (240) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 432, /* (241) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 443, /* (242) type_name_default_len ::= BINARY */ + 443, /* (243) type_name_default_len ::= NCHAR */ + 443, /* (244) type_name_default_len ::= VARCHAR */ + 443, /* (245) type_name_default_len ::= VARBINARY */ + 422, /* (246) tags_def_opt ::= */ + 422, /* (247) tags_def_opt ::= tags_def */ + 426, /* (248) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 423, /* (249) table_options ::= */ + 423, /* (250) table_options ::= table_options COMMENT NK_STRING */ + 423, /* (251) table_options ::= table_options MAX_DELAY duration_list */ + 423, /* (252) table_options ::= table_options WATERMARK duration_list */ + 423, /* (253) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 423, /* (254) table_options ::= table_options TTL NK_INTEGER */ + 423, /* (255) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 423, /* (256) table_options ::= table_options DELETE_MARK duration_list */ + 430, /* (257) alter_table_options ::= alter_table_option */ + 430, /* (258) alter_table_options ::= alter_table_options alter_table_option */ + 446, /* (259) alter_table_option ::= COMMENT NK_STRING */ + 446, /* (260) alter_table_option ::= TTL NK_INTEGER */ + 444, /* (261) duration_list ::= duration_literal */ + 444, /* (262) duration_list ::= duration_list NK_COMMA duration_literal */ + 445, /* (263) rollup_func_list ::= rollup_func_name */ + 445, /* (264) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 448, /* (265) rollup_func_name ::= function_name */ + 448, /* (266) rollup_func_name ::= FIRST */ + 448, /* (267) rollup_func_name ::= LAST */ + 439, /* (268) col_name_list ::= col_name */ + 439, /* (269) col_name_list ::= col_name_list NK_COMMA col_name */ + 450, /* (270) col_name ::= column_name */ + 383, /* (271) cmd ::= SHOW DNODES */ + 383, /* (272) cmd ::= SHOW USERS */ + 383, /* (273) cmd ::= SHOW USERS FULL */ + 383, /* (274) cmd ::= SHOW USER PRIVILEGES */ + 383, /* (275) cmd ::= SHOW db_kind_opt DATABASES */ + 383, /* (276) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 383, /* (277) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 383, /* (278) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 383, /* (279) cmd ::= SHOW MNODES */ + 383, /* (280) cmd ::= SHOW QNODES */ + 383, /* (281) cmd ::= SHOW ARBGROUPS */ + 383, /* (282) cmd ::= SHOW FUNCTIONS */ + 383, /* (283) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 383, /* (284) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 383, /* (285) cmd ::= SHOW STREAMS */ + 383, /* (286) cmd ::= SHOW ACCOUNTS */ + 383, /* (287) cmd ::= SHOW APPS */ + 383, /* (288) cmd ::= SHOW CONNECTIONS */ + 383, /* (289) cmd ::= SHOW LICENCES */ + 383, /* (290) cmd ::= SHOW GRANTS */ + 383, /* (291) cmd ::= SHOW GRANTS FULL */ + 383, /* (292) cmd ::= SHOW GRANTS LOGS */ + 383, /* (293) cmd ::= SHOW CLUSTER MACHINES */ + 383, /* (294) cmd ::= SHOW CREATE DATABASE db_name */ + 383, /* (295) cmd ::= SHOW CREATE TABLE full_table_name */ + 383, /* (296) cmd ::= SHOW CREATE STABLE full_table_name */ + 383, /* (297) cmd ::= SHOW ENCRYPTIONS */ + 383, /* (298) cmd ::= SHOW QUERIES */ + 383, /* (299) cmd ::= SHOW SCORES */ + 383, /* (300) cmd ::= SHOW TOPICS */ + 383, /* (301) cmd ::= SHOW VARIABLES */ + 383, /* (302) cmd ::= SHOW CLUSTER VARIABLES */ + 383, /* (303) cmd ::= SHOW LOCAL VARIABLES */ + 383, /* (304) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 383, /* (305) cmd ::= SHOW BNODES */ + 383, /* (306) cmd ::= SHOW SNODES */ + 383, /* (307) cmd ::= SHOW CLUSTER */ + 383, /* (308) cmd ::= SHOW TRANSACTIONS */ + 383, /* (309) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 383, /* (310) cmd ::= SHOW CONSUMERS */ + 383, /* (311) cmd ::= SHOW SUBSCRIPTIONS */ + 383, /* (312) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 383, /* (313) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 383, /* (314) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 383, /* (315) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 383, /* (316) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 383, /* (317) cmd ::= SHOW VNODES */ + 383, /* (318) cmd ::= SHOW db_name_cond_opt ALIVE */ + 383, /* (319) cmd ::= SHOW CLUSTER ALIVE */ + 383, /* (320) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 383, /* (321) cmd ::= SHOW CREATE VIEW full_table_name */ + 383, /* (322) cmd ::= SHOW COMPACTS */ + 383, /* (323) cmd ::= SHOW COMPACT NK_INTEGER */ + 452, /* (324) table_kind_db_name_cond_opt ::= */ + 452, /* (325) table_kind_db_name_cond_opt ::= table_kind */ + 452, /* (326) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 452, /* (327) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 457, /* (328) table_kind ::= NORMAL */ + 457, /* (329) table_kind ::= CHILD */ + 454, /* (330) db_name_cond_opt ::= */ + 454, /* (331) db_name_cond_opt ::= db_name NK_DOT */ + 453, /* (332) like_pattern_opt ::= */ + 453, /* (333) like_pattern_opt ::= LIKE NK_STRING */ + 455, /* (334) table_name_cond ::= table_name */ + 456, /* (335) from_db_opt ::= */ + 456, /* (336) from_db_opt ::= FROM db_name */ + 425, /* (337) tag_list_opt ::= */ + 425, /* (338) tag_list_opt ::= tag_item */ + 425, /* (339) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 458, /* (340) tag_item ::= TBNAME */ + 458, /* (341) tag_item ::= QTAGS */ + 458, /* (342) tag_item ::= column_name */ + 458, /* (343) tag_item ::= column_name column_alias */ + 458, /* (344) tag_item ::= column_name AS column_alias */ + 451, /* (345) db_kind_opt ::= */ + 451, /* (346) db_kind_opt ::= USER */ + 451, /* (347) db_kind_opt ::= SYSTEM */ + 383, /* (348) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + 383, /* (349) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + 383, /* (350) cmd ::= DROP TSMA exists_opt full_tsma_name */ + 383, /* (351) cmd ::= SHOW db_name_cond_opt TSMAS */ + 462, /* (352) full_tsma_name ::= tsma_name */ + 462, /* (353) full_tsma_name ::= db_name NK_DOT tsma_name */ + 461, /* (354) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + 383, /* (355) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 383, /* (356) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 383, /* (357) cmd ::= DROP INDEX exists_opt full_index_name */ + 465, /* (358) full_index_name ::= index_name */ + 465, /* (359) full_index_name ::= db_name NK_DOT index_name */ + 464, /* (360) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 464, /* (361) 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 */ + 463, /* (362) func_list ::= func */ + 463, /* (363) func_list ::= func_list NK_COMMA func */ + 469, /* (364) func ::= sma_func_name NK_LP expression_list NK_RP */ + 470, /* (365) sma_func_name ::= function_name */ + 470, /* (366) sma_func_name ::= COUNT */ + 470, /* (367) sma_func_name ::= FIRST */ + 470, /* (368) sma_func_name ::= LAST */ + 470, /* (369) sma_func_name ::= LAST_ROW */ + 468, /* (370) sma_stream_opt ::= */ + 468, /* (371) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 468, /* (372) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 468, /* (373) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 472, /* (374) with_meta ::= AS */ + 472, /* (375) with_meta ::= WITH META AS */ + 472, /* (376) with_meta ::= ONLY META AS */ + 383, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 383, /* (378) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 383, /* (379) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 383, /* (380) cmd ::= DROP TOPIC exists_opt topic_name */ + 383, /* (381) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 383, /* (382) cmd ::= DESC full_table_name */ + 383, /* (383) cmd ::= DESCRIBE full_table_name */ + 383, /* (384) cmd ::= RESET QUERY CACHE */ + 383, /* (385) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 383, /* (386) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 476, /* (387) analyze_opt ::= */ + 476, /* (388) analyze_opt ::= ANALYZE */ + 477, /* (389) explain_options ::= */ + 477, /* (390) explain_options ::= explain_options VERBOSE NK_BOOL */ + 477, /* (391) explain_options ::= explain_options RATIO NK_FLOAT */ + 383, /* (392) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 383, /* (393) cmd ::= DROP FUNCTION exists_opt function_name */ + 480, /* (394) agg_func_opt ::= */ + 480, /* (395) agg_func_opt ::= AGGREGATE */ + 481, /* (396) bufsize_opt ::= */ + 481, /* (397) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 482, /* (398) language_opt ::= */ + 482, /* (399) language_opt ::= LANGUAGE NK_STRING */ + 479, /* (400) or_replace_opt ::= */ + 479, /* (401) or_replace_opt ::= OR REPLACE */ + 383, /* (402) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 383, /* (403) cmd ::= DROP VIEW exists_opt full_view_name */ + 483, /* (404) full_view_name ::= view_name */ + 483, /* (405) full_view_name ::= db_name NK_DOT view_name */ + 383, /* (406) 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 */ + 383, /* (407) cmd ::= DROP STREAM exists_opt stream_name */ + 383, /* (408) cmd ::= PAUSE STREAM exists_opt stream_name */ + 383, /* (409) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 487, /* (410) col_list_opt ::= */ + 487, /* (411) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + 491, /* (412) column_stream_def_list ::= column_stream_def */ + 491, /* (413) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + 492, /* (414) column_stream_def ::= column_name stream_col_options */ + 493, /* (415) stream_col_options ::= */ + 493, /* (416) stream_col_options ::= stream_col_options PRIMARY KEY */ + 488, /* (417) tag_def_or_ref_opt ::= */ + 488, /* (418) tag_def_or_ref_opt ::= tags_def */ + 488, /* (419) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 486, /* (420) stream_options ::= */ + 486, /* (421) stream_options ::= stream_options TRIGGER AT_ONCE */ + 486, /* (422) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 486, /* (423) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 486, /* (424) stream_options ::= stream_options WATERMARK duration_literal */ + 486, /* (425) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 486, /* (426) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 486, /* (427) stream_options ::= stream_options DELETE_MARK duration_literal */ + 486, /* (428) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 489, /* (429) subtable_opt ::= */ + 489, /* (430) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 490, /* (431) ignore_opt ::= */ + 490, /* (432) ignore_opt ::= IGNORE UNTREATED */ + 383, /* (433) cmd ::= KILL CONNECTION NK_INTEGER */ + 383, /* (434) cmd ::= KILL QUERY NK_STRING */ + 383, /* (435) cmd ::= KILL TRANSACTION NK_INTEGER */ + 383, /* (436) cmd ::= KILL COMPACT NK_INTEGER */ + 383, /* (437) cmd ::= BALANCE VGROUP */ + 383, /* (438) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 383, /* (439) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + 383, /* (440) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 383, /* (441) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 383, /* (442) cmd ::= SPLIT VGROUP NK_INTEGER */ + 495, /* (443) on_vgroup_id ::= */ + 495, /* (444) on_vgroup_id ::= ON NK_INTEGER */ + 496, /* (445) dnode_list ::= DNODE NK_INTEGER */ + 496, /* (446) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 383, /* (447) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 383, /* (448) cmd ::= query_or_subquery */ + 383, /* (449) cmd ::= insert_query */ + 478, /* (450) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 478, /* (451) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 434, /* (452) tags_literal ::= NK_INTEGER */ + 434, /* (453) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + 434, /* (454) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + 434, /* (455) tags_literal ::= NK_PLUS NK_INTEGER */ + 434, /* (456) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + 434, /* (457) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + 434, /* (458) tags_literal ::= NK_MINUS NK_INTEGER */ + 434, /* (459) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + 434, /* (460) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + 434, /* (461) tags_literal ::= NK_FLOAT */ + 434, /* (462) tags_literal ::= NK_PLUS NK_FLOAT */ + 434, /* (463) tags_literal ::= NK_MINUS NK_FLOAT */ + 434, /* (464) tags_literal ::= NK_BIN */ + 434, /* (465) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + 434, /* (466) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + 434, /* (467) tags_literal ::= NK_PLUS NK_BIN */ + 434, /* (468) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + 434, /* (469) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + 434, /* (470) tags_literal ::= NK_MINUS NK_BIN */ + 434, /* (471) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + 434, /* (472) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + 434, /* (473) tags_literal ::= NK_HEX */ + 434, /* (474) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + 434, /* (475) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + 434, /* (476) tags_literal ::= NK_PLUS NK_HEX */ + 434, /* (477) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + 434, /* (478) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + 434, /* (479) tags_literal ::= NK_MINUS NK_HEX */ + 434, /* (480) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + 434, /* (481) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + 434, /* (482) tags_literal ::= NK_STRING */ + 434, /* (483) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + 434, /* (484) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + 434, /* (485) tags_literal ::= NK_BOOL */ + 434, /* (486) tags_literal ::= NULL */ + 434, /* (487) tags_literal ::= literal_func */ + 434, /* (488) tags_literal ::= literal_func NK_PLUS duration_literal */ + 434, /* (489) tags_literal ::= literal_func NK_MINUS duration_literal */ + 437, /* (490) tags_literal_list ::= tags_literal */ + 437, /* (491) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 386, /* (492) literal ::= NK_INTEGER */ + 386, /* (493) literal ::= NK_FLOAT */ + 386, /* (494) literal ::= NK_STRING */ + 386, /* (495) literal ::= NK_BOOL */ + 386, /* (496) literal ::= TIMESTAMP NK_STRING */ + 386, /* (497) literal ::= duration_literal */ + 386, /* (498) literal ::= NULL */ + 386, /* (499) literal ::= NK_QUESTION */ + 447, /* (500) duration_literal ::= NK_VARIABLE */ + 417, /* (501) signed ::= NK_INTEGER */ + 417, /* (502) signed ::= NK_PLUS NK_INTEGER */ + 417, /* (503) signed ::= NK_MINUS NK_INTEGER */ + 417, /* (504) signed ::= NK_FLOAT */ + 417, /* (505) signed ::= NK_PLUS NK_FLOAT */ + 417, /* (506) signed ::= NK_MINUS NK_FLOAT */ + 498, /* (507) signed_literal ::= signed */ + 498, /* (508) signed_literal ::= NK_STRING */ + 498, /* (509) signed_literal ::= NK_BOOL */ + 498, /* (510) signed_literal ::= TIMESTAMP NK_STRING */ + 498, /* (511) signed_literal ::= duration_literal */ + 498, /* (512) signed_literal ::= NULL */ + 498, /* (513) signed_literal ::= literal_func */ + 498, /* (514) signed_literal ::= NK_QUESTION */ + 499, /* (515) literal_list ::= signed_literal */ + 499, /* (516) literal_list ::= literal_list NK_COMMA signed_literal */ + 400, /* (517) db_name ::= NK_ID */ + 401, /* (518) table_name ::= NK_ID */ + 431, /* (519) column_name ::= NK_ID */ + 449, /* (520) function_name ::= NK_ID */ + 484, /* (521) view_name ::= NK_ID */ + 500, /* (522) table_alias ::= NK_ID */ + 459, /* (523) column_alias ::= NK_ID */ + 459, /* (524) column_alias ::= NK_ALIAS */ + 393, /* (525) user_name ::= NK_ID */ + 402, /* (526) topic_name ::= NK_ID */ + 485, /* (527) stream_name ::= NK_ID */ + 475, /* (528) cgroup_name ::= NK_ID */ + 466, /* (529) index_name ::= NK_ID */ + 460, /* (530) tsma_name ::= NK_ID */ + 501, /* (531) expr_or_subquery ::= expression */ + 494, /* (532) expression ::= literal */ + 494, /* (533) expression ::= pseudo_column */ + 494, /* (534) expression ::= column_reference */ + 494, /* (535) expression ::= function_expression */ + 494, /* (536) expression ::= case_when_expression */ + 494, /* (537) expression ::= NK_LP expression NK_RP */ + 494, /* (538) expression ::= NK_PLUS expr_or_subquery */ + 494, /* (539) expression ::= NK_MINUS expr_or_subquery */ + 494, /* (540) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 494, /* (541) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 494, /* (542) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 494, /* (543) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 494, /* (544) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 494, /* (545) expression ::= column_reference NK_ARROW NK_STRING */ + 494, /* (546) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 494, /* (547) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 471, /* (548) expression_list ::= expr_or_subquery */ + 471, /* (549) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 503, /* (550) column_reference ::= column_name */ + 503, /* (551) column_reference ::= table_name NK_DOT column_name */ + 503, /* (552) column_reference ::= NK_ALIAS */ + 503, /* (553) column_reference ::= table_name NK_DOT NK_ALIAS */ + 502, /* (554) pseudo_column ::= ROWTS */ + 502, /* (555) pseudo_column ::= TBNAME */ + 502, /* (556) pseudo_column ::= table_name NK_DOT TBNAME */ + 502, /* (557) pseudo_column ::= QSTART */ + 502, /* (558) pseudo_column ::= QEND */ + 502, /* (559) pseudo_column ::= QDURATION */ + 502, /* (560) pseudo_column ::= WSTART */ + 502, /* (561) pseudo_column ::= WEND */ + 502, /* (562) pseudo_column ::= WDURATION */ + 502, /* (563) pseudo_column ::= IROWTS */ + 502, /* (564) pseudo_column ::= ISFILLED */ + 502, /* (565) pseudo_column ::= QTAGS */ + 504, /* (566) function_expression ::= function_name NK_LP expression_list NK_RP */ + 504, /* (567) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 504, /* (568) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 504, /* (569) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + 504, /* (570) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ + 504, /* (571) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ + 504, /* (572) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ + 504, /* (573) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + 504, /* (574) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ + 504, /* (575) function_expression ::= substr_func NK_LP expression_list NK_RP */ + 504, /* (576) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + 504, /* (577) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ + 504, /* (578) function_expression ::= REPLACE NK_LP expression_list NK_RP */ + 504, /* (579) function_expression ::= literal_func */ + 504, /* (580) function_expression ::= rand_func */ + 497, /* (581) literal_func ::= noarg_func NK_LP NK_RP */ + 497, /* (582) literal_func ::= NOW */ + 497, /* (583) literal_func ::= TODAY */ + 510, /* (584) rand_func ::= RAND NK_LP NK_RP */ + 510, /* (585) rand_func ::= RAND NK_LP expression_list NK_RP */ + 509, /* (586) substr_func ::= SUBSTR */ + 509, /* (587) substr_func ::= SUBSTRING */ + 508, /* (588) trim_specification_type ::= BOTH */ + 508, /* (589) trim_specification_type ::= TRAILING */ + 508, /* (590) trim_specification_type ::= LEADING */ + 511, /* (591) noarg_func ::= NOW */ + 511, /* (592) noarg_func ::= TODAY */ + 511, /* (593) noarg_func ::= TIMEZONE */ + 511, /* (594) noarg_func ::= DATABASE */ + 511, /* (595) noarg_func ::= CLIENT_VERSION */ + 511, /* (596) noarg_func ::= SERVER_VERSION */ + 511, /* (597) noarg_func ::= SERVER_STATUS */ + 511, /* (598) noarg_func ::= CURRENT_USER */ + 511, /* (599) noarg_func ::= USER */ + 511, /* (600) noarg_func ::= PI */ + 506, /* (601) star_func ::= COUNT */ + 506, /* (602) star_func ::= FIRST */ + 506, /* (603) star_func ::= LAST */ + 506, /* (604) star_func ::= LAST_ROW */ + 507, /* (605) star_func_para_list ::= NK_STAR */ + 507, /* (606) star_func_para_list ::= other_para_list */ + 512, /* (607) other_para_list ::= star_func_para */ + 512, /* (608) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 513, /* (609) star_func_para ::= expr_or_subquery */ + 513, /* (610) star_func_para ::= table_name NK_DOT NK_STAR */ + 505, /* (611) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 505, /* (612) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 514, /* (613) when_then_list ::= when_then_expr */ + 514, /* (614) when_then_list ::= when_then_list when_then_expr */ + 517, /* (615) when_then_expr ::= WHEN common_expression THEN common_expression */ + 515, /* (616) case_when_else_opt ::= */ + 515, /* (617) case_when_else_opt ::= ELSE common_expression */ + 518, /* (618) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 518, /* (619) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 518, /* (620) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 518, /* (621) predicate ::= expr_or_subquery IS NULL */ + 518, /* (622) predicate ::= expr_or_subquery IS NOT NULL */ + 518, /* (623) predicate ::= expr_or_subquery in_op in_predicate_value */ + 519, /* (624) compare_op ::= NK_LT */ + 519, /* (625) compare_op ::= NK_GT */ + 519, /* (626) compare_op ::= NK_LE */ + 519, /* (627) compare_op ::= NK_GE */ + 519, /* (628) compare_op ::= NK_NE */ + 519, /* (629) compare_op ::= NK_EQ */ + 519, /* (630) compare_op ::= LIKE */ + 519, /* (631) compare_op ::= NOT LIKE */ + 519, /* (632) compare_op ::= MATCH */ + 519, /* (633) compare_op ::= NMATCH */ + 519, /* (634) compare_op ::= CONTAINS */ + 520, /* (635) in_op ::= IN */ + 520, /* (636) in_op ::= NOT IN */ + 521, /* (637) in_predicate_value ::= NK_LP literal_list NK_RP */ + 522, /* (638) boolean_value_expression ::= boolean_primary */ + 522, /* (639) boolean_value_expression ::= NOT boolean_primary */ + 522, /* (640) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 522, /* (641) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 523, /* (642) boolean_primary ::= predicate */ + 523, /* (643) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 516, /* (644) common_expression ::= expr_or_subquery */ + 516, /* (645) common_expression ::= boolean_value_expression */ + 524, /* (646) from_clause_opt ::= */ + 524, /* (647) from_clause_opt ::= FROM table_reference_list */ + 525, /* (648) table_reference_list ::= table_reference */ + 525, /* (649) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 526, /* (650) table_reference ::= table_primary */ + 526, /* (651) table_reference ::= joined_table */ + 527, /* (652) table_primary ::= table_name alias_opt */ + 527, /* (653) table_primary ::= db_name NK_DOT table_name alias_opt */ + 527, /* (654) table_primary ::= subquery alias_opt */ + 527, /* (655) table_primary ::= parenthesized_joined_table */ + 529, /* (656) alias_opt ::= */ + 529, /* (657) alias_opt ::= table_alias */ + 529, /* (658) alias_opt ::= AS table_alias */ + 531, /* (659) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 531, /* (660) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 528, /* (661) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 532, /* (662) join_type ::= */ + 532, /* (663) join_type ::= INNER */ + 532, /* (664) join_type ::= LEFT */ + 532, /* (665) join_type ::= RIGHT */ + 532, /* (666) join_type ::= FULL */ + 533, /* (667) join_subtype ::= */ + 533, /* (668) join_subtype ::= OUTER */ + 533, /* (669) join_subtype ::= SEMI */ + 533, /* (670) join_subtype ::= ANTI */ + 533, /* (671) join_subtype ::= ASOF */ + 533, /* (672) join_subtype ::= WINDOW */ + 534, /* (673) join_on_clause_opt ::= */ + 534, /* (674) join_on_clause_opt ::= ON search_condition */ + 535, /* (675) window_offset_clause_opt ::= */ + 535, /* (676) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 537, /* (677) window_offset_literal ::= NK_VARIABLE */ + 537, /* (678) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 536, /* (679) jlimit_clause_opt ::= */ + 536, /* (680) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 538, /* (681) 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 */ + 539, /* (682) hint_list ::= */ + 539, /* (683) hint_list ::= NK_HINT */ + 541, /* (684) tag_mode_opt ::= */ + 541, /* (685) tag_mode_opt ::= TAGS */ + 540, /* (686) set_quantifier_opt ::= */ + 540, /* (687) set_quantifier_opt ::= DISTINCT */ + 540, /* (688) set_quantifier_opt ::= ALL */ + 542, /* (689) select_list ::= select_item */ + 542, /* (690) select_list ::= select_list NK_COMMA select_item */ + 550, /* (691) select_item ::= NK_STAR */ + 550, /* (692) select_item ::= common_expression */ + 550, /* (693) select_item ::= common_expression column_alias */ + 550, /* (694) select_item ::= common_expression AS column_alias */ + 550, /* (695) select_item ::= table_name NK_DOT NK_STAR */ + 474, /* (696) where_clause_opt ::= */ + 474, /* (697) where_clause_opt ::= WHERE search_condition */ + 543, /* (698) partition_by_clause_opt ::= */ + 543, /* (699) partition_by_clause_opt ::= PARTITION BY partition_list */ + 551, /* (700) partition_list ::= partition_item */ + 551, /* (701) partition_list ::= partition_list NK_COMMA partition_item */ + 552, /* (702) partition_item ::= expr_or_subquery */ + 552, /* (703) partition_item ::= expr_or_subquery column_alias */ + 552, /* (704) partition_item ::= expr_or_subquery AS column_alias */ + 547, /* (705) twindow_clause_opt ::= */ + 547, /* (706) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 547, /* (707) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 547, /* (708) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 547, /* (709) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 547, /* (710) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 547, /* (711) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 547, /* (712) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 467, /* (713) sliding_opt ::= */ + 467, /* (714) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 553, /* (715) interval_sliding_duration_literal ::= NK_VARIABLE */ + 553, /* (716) interval_sliding_duration_literal ::= NK_STRING */ + 553, /* (717) interval_sliding_duration_literal ::= NK_INTEGER */ + 546, /* (718) fill_opt ::= */ + 546, /* (719) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 546, /* (720) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 546, /* (721) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 554, /* (722) fill_mode ::= NONE */ + 554, /* (723) fill_mode ::= PREV */ + 554, /* (724) fill_mode ::= NULL */ + 554, /* (725) fill_mode ::= NULL_F */ + 554, /* (726) fill_mode ::= LINEAR */ + 554, /* (727) fill_mode ::= NEXT */ + 548, /* (728) group_by_clause_opt ::= */ + 548, /* (729) group_by_clause_opt ::= GROUP BY group_by_list */ + 555, /* (730) group_by_list ::= expr_or_subquery */ + 555, /* (731) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 549, /* (732) having_clause_opt ::= */ + 549, /* (733) having_clause_opt ::= HAVING search_condition */ + 544, /* (734) range_opt ::= */ + 544, /* (735) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 544, /* (736) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 545, /* (737) every_opt ::= */ + 545, /* (738) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 556, /* (739) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 557, /* (740) query_simple ::= query_specification */ + 557, /* (741) query_simple ::= union_query_expression */ + 561, /* (742) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 561, /* (743) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 562, /* (744) query_simple_or_subquery ::= query_simple */ + 562, /* (745) query_simple_or_subquery ::= subquery */ + 473, /* (746) query_or_subquery ::= query_expression */ + 473, /* (747) query_or_subquery ::= subquery */ + 558, /* (748) order_by_clause_opt ::= */ + 558, /* (749) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 559, /* (750) slimit_clause_opt ::= */ + 559, /* (751) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 559, /* (752) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 559, /* (753) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 560, /* (754) limit_clause_opt ::= */ + 560, /* (755) limit_clause_opt ::= LIMIT NK_INTEGER */ + 560, /* (756) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 560, /* (757) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 530, /* (758) subquery ::= NK_LP query_expression NK_RP */ + 530, /* (759) subquery ::= NK_LP subquery NK_RP */ + 403, /* (760) search_condition ::= common_expression */ + 563, /* (761) sort_specification_list ::= sort_specification */ + 563, /* (762) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 564, /* (763) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 565, /* (764) ordering_specification_opt ::= */ + 565, /* (765) ordering_specification_opt ::= ASC */ + 565, /* (766) ordering_specification_opt ::= DESC */ + 566, /* (767) null_ordering_opt ::= */ + 566, /* (768) null_ordering_opt ::= NULLS FIRST */ + 566, /* (769) null_ordering_opt ::= NULLS LAST */ + 433, /* (770) column_options ::= */ + 433, /* (771) column_options ::= column_options PRIMARY KEY */ + 433, /* (772) column_options ::= column_options NK_ID NK_STRING */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4804,730 +4747,719 @@ static const signed char yyRuleInfoNRhs[] = { 0, /* (57) with_clause_opt ::= */ -2, /* (58) with_clause_opt ::= WITH search_condition */ -3, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - -3, /* (60) cmd ::= CREATE ANODE NK_STRING */ - -3, /* (61) cmd ::= UPDATE ANODE NK_INTEGER */ - -3, /* (62) cmd ::= UPDATE ALL ANODES */ - -3, /* (63) cmd ::= DROP ANODE NK_INTEGER */ - -3, /* (64) cmd ::= CREATE DNODE dnode_endpoint */ - -5, /* (65) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - -4, /* (66) cmd ::= DROP DNODE NK_INTEGER force_opt */ - -4, /* (67) cmd ::= DROP DNODE dnode_endpoint force_opt */ - -4, /* (68) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - -4, /* (69) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - -4, /* (70) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - -5, /* (71) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - -4, /* (72) cmd ::= ALTER ALL DNODES NK_STRING */ - -5, /* (73) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - -3, /* (74) cmd ::= RESTORE DNODE NK_INTEGER */ - -1, /* (75) dnode_endpoint ::= NK_STRING */ - -1, /* (76) dnode_endpoint ::= NK_ID */ - -1, /* (77) dnode_endpoint ::= NK_IPTOKEN */ - 0, /* (78) force_opt ::= */ - -1, /* (79) force_opt ::= FORCE */ - -1, /* (80) unsafe_opt ::= UNSAFE */ - -3, /* (81) cmd ::= ALTER CLUSTER NK_STRING */ - -4, /* (82) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - -3, /* (83) cmd ::= ALTER LOCAL NK_STRING */ - -4, /* (84) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - -5, /* (85) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - -5, /* (86) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - -5, /* (87) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - -5, /* (88) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - -5, /* (89) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - -5, /* (90) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - -5, /* (91) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - -5, /* (92) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - -5, /* (93) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - -5, /* (94) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - -5, /* (95) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - -5, /* (96) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - -4, /* (97) cmd ::= DROP DATABASE exists_opt db_name */ - -2, /* (98) cmd ::= USE db_name */ - -4, /* (99) cmd ::= ALTER DATABASE db_name alter_db_options */ - -3, /* (100) cmd ::= FLUSH DATABASE db_name */ - -4, /* (101) cmd ::= TRIM DATABASE db_name speed_opt */ - -3, /* (102) cmd ::= S3MIGRATE DATABASE db_name */ - -5, /* (103) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - -3, /* (104) not_exists_opt ::= IF NOT EXISTS */ - 0, /* (105) not_exists_opt ::= */ - -2, /* (106) exists_opt ::= IF EXISTS */ - 0, /* (107) exists_opt ::= */ - 0, /* (108) db_options ::= */ - -3, /* (109) db_options ::= db_options BUFFER NK_INTEGER */ - -3, /* (110) db_options ::= db_options CACHEMODEL NK_STRING */ - -3, /* (111) db_options ::= db_options CACHESIZE NK_INTEGER */ - -3, /* (112) db_options ::= db_options COMP NK_INTEGER */ - -3, /* (113) db_options ::= db_options DURATION NK_INTEGER */ - -3, /* (114) db_options ::= db_options DURATION NK_VARIABLE */ - -3, /* (115) db_options ::= db_options MAXROWS NK_INTEGER */ - -3, /* (116) db_options ::= db_options MINROWS NK_INTEGER */ - -3, /* (117) db_options ::= db_options KEEP integer_list */ - -3, /* (118) db_options ::= db_options KEEP variable_list */ - -3, /* (119) db_options ::= db_options PAGES NK_INTEGER */ - -3, /* (120) db_options ::= db_options PAGESIZE NK_INTEGER */ - -3, /* (121) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - -3, /* (122) db_options ::= db_options PRECISION NK_STRING */ - -3, /* (123) db_options ::= db_options REPLICA NK_INTEGER */ - -3, /* (124) db_options ::= db_options VGROUPS NK_INTEGER */ - -3, /* (125) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - -3, /* (126) db_options ::= db_options RETENTIONS retention_list */ - -3, /* (127) db_options ::= db_options SCHEMALESS NK_INTEGER */ - -3, /* (128) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - -3, /* (129) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - -3, /* (130) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - -4, /* (131) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -3, /* (132) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - -4, /* (133) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -3, /* (134) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - -3, /* (135) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - -3, /* (136) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - -3, /* (137) db_options ::= db_options TABLE_PREFIX signed */ - -3, /* (138) db_options ::= db_options TABLE_SUFFIX signed */ - -3, /* (139) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - -3, /* (140) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - -3, /* (141) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - -3, /* (142) db_options ::= db_options S3_COMPACT NK_INTEGER */ - -3, /* (143) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - -3, /* (144) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (145) alter_db_options ::= alter_db_option */ - -2, /* (146) alter_db_options ::= alter_db_options alter_db_option */ - -2, /* (147) alter_db_option ::= BUFFER NK_INTEGER */ - -2, /* (148) alter_db_option ::= CACHEMODEL NK_STRING */ - -2, /* (149) alter_db_option ::= CACHESIZE NK_INTEGER */ - -2, /* (150) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - -2, /* (151) alter_db_option ::= KEEP integer_list */ - -2, /* (152) alter_db_option ::= KEEP variable_list */ - -2, /* (153) alter_db_option ::= PAGES NK_INTEGER */ - -2, /* (154) alter_db_option ::= REPLICA NK_INTEGER */ - -2, /* (155) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - -2, /* (156) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - -2, /* (157) alter_db_option ::= MINROWS NK_INTEGER */ - -2, /* (158) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - -3, /* (159) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -2, /* (160) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - -3, /* (161) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -2, /* (162) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - -2, /* (163) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - -2, /* (164) alter_db_option ::= S3_COMPACT NK_INTEGER */ - -2, /* (165) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - -2, /* (166) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (167) integer_list ::= NK_INTEGER */ - -3, /* (168) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - -1, /* (169) variable_list ::= NK_VARIABLE */ - -3, /* (170) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - -1, /* (171) retention_list ::= retention */ - -3, /* (172) retention_list ::= retention_list NK_COMMA retention */ - -3, /* (173) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - -3, /* (174) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 0, /* (175) speed_opt ::= */ - -2, /* (176) speed_opt ::= BWLIMIT NK_INTEGER */ - 0, /* (177) start_opt ::= */ - -3, /* (178) start_opt ::= START WITH NK_INTEGER */ - -3, /* (179) start_opt ::= START WITH NK_STRING */ - -4, /* (180) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 0, /* (181) end_opt ::= */ - -3, /* (182) end_opt ::= END WITH NK_INTEGER */ - -3, /* (183) end_opt ::= END WITH NK_STRING */ - -4, /* (184) end_opt ::= END WITH TIMESTAMP NK_STRING */ - -9, /* (185) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - -3, /* (186) cmd ::= CREATE TABLE multi_create_clause */ - -10, /* (187) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - -9, /* (188) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - -4, /* (189) cmd ::= DROP TABLE with_opt multi_drop_clause */ - -5, /* (190) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ - -3, /* (191) cmd ::= ALTER TABLE alter_table_clause */ - -3, /* (192) cmd ::= ALTER STABLE alter_table_clause */ - -2, /* (193) alter_table_clause ::= full_table_name alter_table_options */ - -6, /* (194) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - -4, /* (195) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -5, /* (196) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - -5, /* (197) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - -5, /* (198) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -5, /* (199) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - -4, /* (200) alter_table_clause ::= full_table_name DROP TAG column_name */ - -5, /* (201) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - -5, /* (202) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (203) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - -1, /* (204) multi_create_clause ::= create_subtable_clause */ - -2, /* (205) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -10, /* (206) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - -1, /* (207) multi_drop_clause ::= drop_table_clause */ - -3, /* (208) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - -2, /* (209) drop_table_clause ::= exists_opt full_table_name */ - 0, /* (210) with_opt ::= */ - -1, /* (211) with_opt ::= WITH */ - 0, /* (212) specific_cols_opt ::= */ - -3, /* (213) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - -1, /* (214) full_table_name ::= table_name */ - -3, /* (215) full_table_name ::= db_name NK_DOT table_name */ - -1, /* (216) tag_def_list ::= tag_def */ - -3, /* (217) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - -2, /* (218) tag_def ::= column_name type_name */ - -1, /* (219) column_def_list ::= column_def */ - -3, /* (220) column_def_list ::= column_def_list NK_COMMA column_def */ - -3, /* (221) column_def ::= column_name type_name column_options */ - -1, /* (222) type_name ::= BOOL */ - -1, /* (223) type_name ::= TINYINT */ - -1, /* (224) type_name ::= SMALLINT */ - -1, /* (225) type_name ::= INT */ - -1, /* (226) type_name ::= INTEGER */ - -1, /* (227) type_name ::= BIGINT */ - -1, /* (228) type_name ::= FLOAT */ - -1, /* (229) type_name ::= DOUBLE */ - -4, /* (230) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (231) type_name ::= TIMESTAMP */ - -4, /* (232) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (233) type_name ::= TINYINT UNSIGNED */ - -2, /* (234) type_name ::= SMALLINT UNSIGNED */ - -2, /* (235) type_name ::= INT UNSIGNED */ - -2, /* (236) type_name ::= BIGINT UNSIGNED */ - -1, /* (237) type_name ::= JSON */ - -4, /* (238) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (239) type_name ::= MEDIUMBLOB */ - -1, /* (240) type_name ::= BLOB */ - -4, /* (241) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (242) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (243) type_name ::= DECIMAL */ - -4, /* (244) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (245) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -1, /* (246) type_name_default_len ::= BINARY */ - -1, /* (247) type_name_default_len ::= NCHAR */ - -1, /* (248) type_name_default_len ::= VARCHAR */ - -1, /* (249) type_name_default_len ::= VARBINARY */ - 0, /* (250) tags_def_opt ::= */ - -1, /* (251) tags_def_opt ::= tags_def */ - -4, /* (252) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 0, /* (253) table_options ::= */ - -3, /* (254) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (255) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (256) table_options ::= table_options WATERMARK duration_list */ - -5, /* (257) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (258) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (259) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (260) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (261) alter_table_options ::= alter_table_option */ - -2, /* (262) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (263) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (264) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (265) duration_list ::= duration_literal */ - -3, /* (266) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (267) rollup_func_list ::= rollup_func_name */ - -3, /* (268) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (269) rollup_func_name ::= function_name */ - -1, /* (270) rollup_func_name ::= FIRST */ - -1, /* (271) rollup_func_name ::= LAST */ - -1, /* (272) col_name_list ::= col_name */ - -3, /* (273) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (274) col_name ::= column_name */ - -2, /* (275) cmd ::= SHOW DNODES */ - -2, /* (276) cmd ::= SHOW USERS */ - -3, /* (277) cmd ::= SHOW USERS FULL */ - -3, /* (278) cmd ::= SHOW USER PRIVILEGES */ - -3, /* (279) cmd ::= SHOW db_kind_opt DATABASES */ - -4, /* (280) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (281) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (282) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (283) cmd ::= SHOW MNODES */ - -2, /* (284) cmd ::= SHOW QNODES */ - -2, /* (285) cmd ::= SHOW ANODES */ - -3, /* (286) cmd ::= SHOW ANODES FULL */ - -2, /* (287) cmd ::= SHOW ARBGROUPS */ - -2, /* (288) cmd ::= SHOW FUNCTIONS */ - -5, /* (289) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (290) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (291) cmd ::= SHOW STREAMS */ - -2, /* (292) cmd ::= SHOW ACCOUNTS */ - -2, /* (293) cmd ::= SHOW APPS */ - -2, /* (294) cmd ::= SHOW CONNECTIONS */ - -2, /* (295) cmd ::= SHOW LICENCES */ - -2, /* (296) cmd ::= SHOW GRANTS */ - -3, /* (297) cmd ::= SHOW GRANTS FULL */ - -3, /* (298) cmd ::= SHOW GRANTS LOGS */ - -3, /* (299) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (300) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (301) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (302) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (303) cmd ::= SHOW ENCRYPTIONS */ - -2, /* (304) cmd ::= SHOW QUERIES */ - -2, /* (305) cmd ::= SHOW SCORES */ - -2, /* (306) cmd ::= SHOW TOPICS */ - -2, /* (307) cmd ::= SHOW VARIABLES */ - -3, /* (308) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (309) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (310) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (311) cmd ::= SHOW BNODES */ - -2, /* (312) cmd ::= SHOW SNODES */ - -2, /* (313) cmd ::= SHOW CLUSTER */ - -2, /* (314) cmd ::= SHOW TRANSACTIONS */ - -4, /* (315) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (316) cmd ::= SHOW CONSUMERS */ - -2, /* (317) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (318) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (319) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (320) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (321) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (322) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (323) cmd ::= SHOW VNODES */ - -3, /* (324) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (325) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (326) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (327) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (328) cmd ::= SHOW COMPACTS */ - -3, /* (329) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (330) table_kind_db_name_cond_opt ::= */ - -1, /* (331) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (332) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (333) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (334) table_kind ::= NORMAL */ - -1, /* (335) table_kind ::= CHILD */ - 0, /* (336) db_name_cond_opt ::= */ - -2, /* (337) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (338) like_pattern_opt ::= */ - -2, /* (339) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (340) table_name_cond ::= table_name */ - 0, /* (341) from_db_opt ::= */ - -2, /* (342) from_db_opt ::= FROM db_name */ - 0, /* (343) tag_list_opt ::= */ - -1, /* (344) tag_list_opt ::= tag_item */ - -3, /* (345) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (346) tag_item ::= TBNAME */ - -1, /* (347) tag_item ::= QTAGS */ - -1, /* (348) tag_item ::= column_name */ - -2, /* (349) tag_item ::= column_name column_alias */ - -3, /* (350) tag_item ::= column_name AS column_alias */ - 0, /* (351) db_kind_opt ::= */ - -1, /* (352) db_kind_opt ::= USER */ - -1, /* (353) db_kind_opt ::= SYSTEM */ - -11, /* (354) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - -11, /* (355) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - -4, /* (356) cmd ::= DROP TSMA exists_opt full_tsma_name */ - -3, /* (357) cmd ::= SHOW db_name_cond_opt TSMAS */ - -1, /* (358) full_tsma_name ::= tsma_name */ - -3, /* (359) full_tsma_name ::= db_name NK_DOT tsma_name */ - -4, /* (360) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - -8, /* (361) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (362) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (363) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (364) full_index_name ::= index_name */ - -3, /* (365) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (366) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (367) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (368) func_list ::= func */ - -3, /* (369) func_list ::= func_list NK_COMMA func */ - -4, /* (370) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (371) sma_func_name ::= function_name */ - -1, /* (372) sma_func_name ::= COUNT */ - -1, /* (373) sma_func_name ::= FIRST */ - -1, /* (374) sma_func_name ::= LAST */ - -1, /* (375) sma_func_name ::= LAST_ROW */ - 0, /* (376) sma_stream_opt ::= */ - -3, /* (377) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (378) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (379) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (380) with_meta ::= AS */ - -3, /* (381) with_meta ::= WITH META AS */ - -3, /* (382) with_meta ::= ONLY META AS */ - -6, /* (383) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (384) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (385) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (386) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (387) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (388) cmd ::= DESC full_table_name */ - -2, /* (389) cmd ::= DESCRIBE full_table_name */ - -3, /* (390) cmd ::= RESET QUERY CACHE */ - -4, /* (391) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (392) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (393) analyze_opt ::= */ - -1, /* (394) analyze_opt ::= ANALYZE */ - 0, /* (395) explain_options ::= */ - -3, /* (396) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (397) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (398) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (399) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (400) agg_func_opt ::= */ - -1, /* (401) agg_func_opt ::= AGGREGATE */ - 0, /* (402) bufsize_opt ::= */ - -2, /* (403) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (404) language_opt ::= */ - -2, /* (405) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (406) or_replace_opt ::= */ - -2, /* (407) or_replace_opt ::= OR REPLACE */ - -6, /* (408) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (409) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (410) full_view_name ::= view_name */ - -3, /* (411) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (412) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (413) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (414) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (415) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (416) col_list_opt ::= */ - -3, /* (417) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - -1, /* (418) column_stream_def_list ::= column_stream_def */ - -3, /* (419) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - -2, /* (420) column_stream_def ::= column_name stream_col_options */ - 0, /* (421) stream_col_options ::= */ - -3, /* (422) stream_col_options ::= stream_col_options PRIMARY KEY */ - 0, /* (423) tag_def_or_ref_opt ::= */ - -1, /* (424) tag_def_or_ref_opt ::= tags_def */ - -4, /* (425) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 0, /* (426) stream_options ::= */ - -3, /* (427) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (428) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (429) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (430) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (431) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (432) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (433) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (434) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (435) subtable_opt ::= */ - -4, /* (436) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (437) ignore_opt ::= */ - -2, /* (438) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (439) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (440) cmd ::= KILL QUERY NK_STRING */ - -3, /* (441) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (442) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (443) cmd ::= BALANCE VGROUP */ - -4, /* (444) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -5, /* (445) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - -4, /* (446) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (447) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (448) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (449) on_vgroup_id ::= */ - -2, /* (450) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (451) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (452) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (453) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (454) cmd ::= query_or_subquery */ - -1, /* (455) cmd ::= insert_query */ - -7, /* (456) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (457) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (458) tags_literal ::= NK_INTEGER */ - -3, /* (459) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - -3, /* (460) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - -2, /* (461) tags_literal ::= NK_PLUS NK_INTEGER */ - -4, /* (462) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (463) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - -2, /* (464) tags_literal ::= NK_MINUS NK_INTEGER */ - -4, /* (465) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (466) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - -1, /* (467) tags_literal ::= NK_FLOAT */ - -2, /* (468) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (469) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (470) tags_literal ::= NK_BIN */ - -3, /* (471) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - -3, /* (472) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - -2, /* (473) tags_literal ::= NK_PLUS NK_BIN */ - -4, /* (474) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - -4, /* (475) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - -2, /* (476) tags_literal ::= NK_MINUS NK_BIN */ - -4, /* (477) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - -4, /* (478) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - -1, /* (479) tags_literal ::= NK_HEX */ - -3, /* (480) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - -3, /* (481) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - -2, /* (482) tags_literal ::= NK_PLUS NK_HEX */ - -4, /* (483) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - -4, /* (484) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - -2, /* (485) tags_literal ::= NK_MINUS NK_HEX */ - -4, /* (486) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - -4, /* (487) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - -1, /* (488) tags_literal ::= NK_STRING */ - -3, /* (489) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - -3, /* (490) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - -1, /* (491) tags_literal ::= NK_BOOL */ - -1, /* (492) tags_literal ::= NULL */ - -1, /* (493) tags_literal ::= literal_func */ - -3, /* (494) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (495) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (496) tags_literal_list ::= tags_literal */ - -3, /* (497) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (498) literal ::= NK_INTEGER */ - -1, /* (499) literal ::= NK_FLOAT */ - -1, /* (500) literal ::= NK_STRING */ - -1, /* (501) literal ::= NK_BOOL */ - -2, /* (502) literal ::= TIMESTAMP NK_STRING */ - -1, /* (503) literal ::= duration_literal */ - -1, /* (504) literal ::= NULL */ - -1, /* (505) literal ::= NK_QUESTION */ - -1, /* (506) duration_literal ::= NK_VARIABLE */ - -1, /* (507) signed ::= NK_INTEGER */ - -2, /* (508) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (509) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (510) signed ::= NK_FLOAT */ - -2, /* (511) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (512) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (513) signed_literal ::= signed */ - -1, /* (514) signed_literal ::= NK_STRING */ - -1, /* (515) signed_literal ::= NK_BOOL */ - -2, /* (516) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (517) signed_literal ::= duration_literal */ - -1, /* (518) signed_literal ::= NULL */ - -1, /* (519) signed_literal ::= literal_func */ - -1, /* (520) signed_literal ::= NK_QUESTION */ - -1, /* (521) literal_list ::= signed_literal */ - -3, /* (522) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (523) db_name ::= NK_ID */ - -1, /* (524) table_name ::= NK_ID */ - -1, /* (525) column_name ::= NK_ID */ - -1, /* (526) function_name ::= NK_ID */ - -1, /* (527) view_name ::= NK_ID */ - -1, /* (528) table_alias ::= NK_ID */ - -1, /* (529) column_alias ::= NK_ID */ - -1, /* (530) column_alias ::= NK_ALIAS */ - -1, /* (531) user_name ::= NK_ID */ - -1, /* (532) topic_name ::= NK_ID */ - -1, /* (533) stream_name ::= NK_ID */ - -1, /* (534) cgroup_name ::= NK_ID */ - -1, /* (535) index_name ::= NK_ID */ - -1, /* (536) tsma_name ::= NK_ID */ - -1, /* (537) expr_or_subquery ::= expression */ - -1, /* (538) expression ::= literal */ - -1, /* (539) expression ::= pseudo_column */ - -1, /* (540) expression ::= column_reference */ - -1, /* (541) expression ::= function_expression */ - -1, /* (542) expression ::= case_when_expression */ - -3, /* (543) expression ::= NK_LP expression NK_RP */ - -2, /* (544) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (545) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (546) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (547) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (548) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (549) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (550) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (551) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (552) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (553) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (554) expression_list ::= expr_or_subquery */ - -3, /* (555) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (556) column_reference ::= column_name */ - -3, /* (557) column_reference ::= table_name NK_DOT column_name */ - -1, /* (558) column_reference ::= NK_ALIAS */ - -3, /* (559) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (560) pseudo_column ::= ROWTS */ - -1, /* (561) pseudo_column ::= TBNAME */ - -3, /* (562) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (563) pseudo_column ::= QSTART */ - -1, /* (564) pseudo_column ::= QEND */ - -1, /* (565) pseudo_column ::= QDURATION */ - -1, /* (566) pseudo_column ::= WSTART */ - -1, /* (567) pseudo_column ::= WEND */ - -1, /* (568) pseudo_column ::= WDURATION */ - -1, /* (569) pseudo_column ::= IROWTS */ - -1, /* (570) pseudo_column ::= ISFILLED */ - -1, /* (571) pseudo_column ::= QTAGS */ - -1, /* (572) pseudo_column ::= FLOW */ - -1, /* (573) pseudo_column ::= FHIGH */ - -1, /* (574) pseudo_column ::= FROWTS */ - -4, /* (575) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (576) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (577) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -6, /* (578) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - -6, /* (579) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ - -4, /* (580) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ - -6, /* (581) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ - -6, /* (582) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - -7, /* (583) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ - -4, /* (584) function_expression ::= substr_func NK_LP expression_list NK_RP */ - -6, /* (585) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - -8, /* (586) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ - -4, /* (587) function_expression ::= REPLACE NK_LP expression_list NK_RP */ - -1, /* (588) function_expression ::= literal_func */ - -1, /* (589) function_expression ::= rand_func */ - -3, /* (590) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (591) literal_func ::= NOW */ - -1, /* (592) literal_func ::= TODAY */ - -3, /* (593) rand_func ::= RAND NK_LP NK_RP */ - -4, /* (594) rand_func ::= RAND NK_LP expression_list NK_RP */ - -1, /* (595) substr_func ::= SUBSTR */ - -1, /* (596) substr_func ::= SUBSTRING */ - -1, /* (597) trim_specification_type ::= BOTH */ - -1, /* (598) trim_specification_type ::= TRAILING */ - -1, /* (599) trim_specification_type ::= LEADING */ - -1, /* (600) noarg_func ::= NOW */ - -1, /* (601) noarg_func ::= TODAY */ - -1, /* (602) noarg_func ::= TIMEZONE */ - -1, /* (603) noarg_func ::= DATABASE */ - -1, /* (604) noarg_func ::= CLIENT_VERSION */ - -1, /* (605) noarg_func ::= SERVER_VERSION */ - -1, /* (606) noarg_func ::= SERVER_STATUS */ - -1, /* (607) noarg_func ::= CURRENT_USER */ - -1, /* (608) noarg_func ::= USER */ - -1, /* (609) noarg_func ::= PI */ - -1, /* (610) star_func ::= COUNT */ - -1, /* (611) star_func ::= FIRST */ - -1, /* (612) star_func ::= LAST */ - -1, /* (613) star_func ::= LAST_ROW */ - -1, /* (614) star_func_para_list ::= NK_STAR */ - -1, /* (615) star_func_para_list ::= other_para_list */ - -1, /* (616) other_para_list ::= star_func_para */ - -3, /* (617) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (618) star_func_para ::= expr_or_subquery */ - -3, /* (619) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (620) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (621) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (622) when_then_list ::= when_then_expr */ - -2, /* (623) when_then_list ::= when_then_list when_then_expr */ - -4, /* (624) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (625) case_when_else_opt ::= */ - -2, /* (626) case_when_else_opt ::= ELSE common_expression */ - -3, /* (627) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (628) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (629) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (630) predicate ::= expr_or_subquery IS NULL */ - -4, /* (631) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (632) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (633) compare_op ::= NK_LT */ - -1, /* (634) compare_op ::= NK_GT */ - -1, /* (635) compare_op ::= NK_LE */ - -1, /* (636) compare_op ::= NK_GE */ - -1, /* (637) compare_op ::= NK_NE */ - -1, /* (638) compare_op ::= NK_EQ */ - -1, /* (639) compare_op ::= LIKE */ - -2, /* (640) compare_op ::= NOT LIKE */ - -1, /* (641) compare_op ::= MATCH */ - -1, /* (642) compare_op ::= NMATCH */ - -1, /* (643) compare_op ::= CONTAINS */ - -1, /* (644) in_op ::= IN */ - -2, /* (645) in_op ::= NOT IN */ - -3, /* (646) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (647) boolean_value_expression ::= boolean_primary */ - -2, /* (648) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (649) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (650) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (651) boolean_primary ::= predicate */ - -3, /* (652) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (653) common_expression ::= expr_or_subquery */ - -1, /* (654) common_expression ::= boolean_value_expression */ - 0, /* (655) from_clause_opt ::= */ - -2, /* (656) from_clause_opt ::= FROM table_reference_list */ - -1, /* (657) table_reference_list ::= table_reference */ - -3, /* (658) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (659) table_reference ::= table_primary */ - -1, /* (660) table_reference ::= joined_table */ - -2, /* (661) table_primary ::= table_name alias_opt */ - -4, /* (662) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (663) table_primary ::= subquery alias_opt */ - -1, /* (664) table_primary ::= parenthesized_joined_table */ - 0, /* (665) alias_opt ::= */ - -1, /* (666) alias_opt ::= table_alias */ - -2, /* (667) alias_opt ::= AS table_alias */ - -3, /* (668) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (669) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (670) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (671) join_type ::= */ - -1, /* (672) join_type ::= INNER */ - -1, /* (673) join_type ::= LEFT */ - -1, /* (674) join_type ::= RIGHT */ - -1, /* (675) join_type ::= FULL */ - 0, /* (676) join_subtype ::= */ - -1, /* (677) join_subtype ::= OUTER */ - -1, /* (678) join_subtype ::= SEMI */ - -1, /* (679) join_subtype ::= ANTI */ - -1, /* (680) join_subtype ::= ASOF */ - -1, /* (681) join_subtype ::= WINDOW */ - 0, /* (682) join_on_clause_opt ::= */ - -2, /* (683) join_on_clause_opt ::= ON search_condition */ - 0, /* (684) window_offset_clause_opt ::= */ - -6, /* (685) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (686) window_offset_literal ::= NK_VARIABLE */ - -2, /* (687) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (688) jlimit_clause_opt ::= */ - -2, /* (689) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (690) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (691) hint_list ::= */ - -1, /* (692) hint_list ::= NK_HINT */ - 0, /* (693) tag_mode_opt ::= */ - -1, /* (694) tag_mode_opt ::= TAGS */ - 0, /* (695) set_quantifier_opt ::= */ - -1, /* (696) set_quantifier_opt ::= DISTINCT */ - -1, /* (697) set_quantifier_opt ::= ALL */ - -1, /* (698) select_list ::= select_item */ - -3, /* (699) select_list ::= select_list NK_COMMA select_item */ - -1, /* (700) select_item ::= NK_STAR */ - -1, /* (701) select_item ::= common_expression */ - -2, /* (702) select_item ::= common_expression column_alias */ - -3, /* (703) select_item ::= common_expression AS column_alias */ - -3, /* (704) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (705) where_clause_opt ::= */ - -2, /* (706) where_clause_opt ::= WHERE search_condition */ - 0, /* (707) partition_by_clause_opt ::= */ - -3, /* (708) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (709) partition_list ::= partition_item */ - -3, /* (710) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (711) partition_item ::= expr_or_subquery */ - -2, /* (712) partition_item ::= expr_or_subquery column_alias */ - -3, /* (713) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (714) twindow_clause_opt ::= */ - -6, /* (715) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (716) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (717) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (718) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (719) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (720) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (721) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -4, /* (722) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (723) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ - 0, /* (724) sliding_opt ::= */ - -4, /* (725) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (726) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (727) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (728) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (729) fill_opt ::= */ - -4, /* (730) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (731) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (732) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (733) fill_mode ::= NONE */ - -1, /* (734) fill_mode ::= PREV */ - -1, /* (735) fill_mode ::= NULL */ - -1, /* (736) fill_mode ::= NULL_F */ - -1, /* (737) fill_mode ::= LINEAR */ - -1, /* (738) fill_mode ::= NEXT */ - 0, /* (739) group_by_clause_opt ::= */ - -3, /* (740) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (741) group_by_list ::= expr_or_subquery */ - -3, /* (742) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (743) having_clause_opt ::= */ - -2, /* (744) having_clause_opt ::= HAVING search_condition */ - 0, /* (745) range_opt ::= */ - -6, /* (746) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (747) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (748) every_opt ::= */ - -4, /* (749) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (750) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (751) query_simple ::= query_specification */ - -1, /* (752) query_simple ::= union_query_expression */ - -4, /* (753) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (754) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (755) query_simple_or_subquery ::= query_simple */ - -1, /* (756) query_simple_or_subquery ::= subquery */ - -1, /* (757) query_or_subquery ::= query_expression */ - -1, /* (758) query_or_subquery ::= subquery */ - 0, /* (759) order_by_clause_opt ::= */ - -3, /* (760) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (761) slimit_clause_opt ::= */ - -2, /* (762) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (763) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (764) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (765) limit_clause_opt ::= */ - -2, /* (766) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (767) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (768) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (769) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (770) subquery ::= NK_LP subquery NK_RP */ - -1, /* (771) search_condition ::= common_expression */ - -1, /* (772) sort_specification_list ::= sort_specification */ - -3, /* (773) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (774) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (775) ordering_specification_opt ::= */ - -1, /* (776) ordering_specification_opt ::= ASC */ - -1, /* (777) ordering_specification_opt ::= DESC */ - 0, /* (778) null_ordering_opt ::= */ - -2, /* (779) null_ordering_opt ::= NULLS FIRST */ - -2, /* (780) null_ordering_opt ::= NULLS LAST */ - 0, /* (781) column_options ::= */ - -3, /* (782) column_options ::= column_options PRIMARY KEY */ - -3, /* (783) column_options ::= column_options NK_ID NK_STRING */ + -3, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + -5, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + -4, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + -4, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + -4, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + -4, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + -4, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + -5, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + -4, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + -5, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + -3, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + -1, /* (71) dnode_endpoint ::= NK_STRING */ + -1, /* (72) dnode_endpoint ::= NK_ID */ + -1, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + 0, /* (74) force_opt ::= */ + -1, /* (75) force_opt ::= FORCE */ + -1, /* (76) unsafe_opt ::= UNSAFE */ + -3, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + -4, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + -3, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + -4, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + -5, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + -5, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + -5, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + -5, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + -5, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + -5, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + -5, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + -5, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + -5, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + -5, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + -5, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + -5, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + -4, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + -2, /* (94) cmd ::= USE db_name */ + -4, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + -3, /* (96) cmd ::= FLUSH DATABASE db_name */ + -4, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + -3, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + -5, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + -3, /* (100) not_exists_opt ::= IF NOT EXISTS */ + 0, /* (101) not_exists_opt ::= */ + -2, /* (102) exists_opt ::= IF EXISTS */ + 0, /* (103) exists_opt ::= */ + 0, /* (104) db_options ::= */ + -3, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + -3, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + -3, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + -3, /* (108) db_options ::= db_options COMP NK_INTEGER */ + -3, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + -3, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + -3, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + -3, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + -3, /* (113) db_options ::= db_options KEEP integer_list */ + -3, /* (114) db_options ::= db_options KEEP variable_list */ + -3, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + -3, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + -3, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + -3, /* (118) db_options ::= db_options PRECISION NK_STRING */ + -3, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + -3, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + -3, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + -3, /* (122) db_options ::= db_options RETENTIONS retention_list */ + -3, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + -3, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + -3, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + -3, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + -4, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -3, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + -4, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -3, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + -3, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + -3, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + -3, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + -3, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + -3, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + -3, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + -3, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + -3, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + -3, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + -3, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (141) alter_db_options ::= alter_db_option */ + -2, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + -2, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + -2, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + -2, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + -2, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + -2, /* (147) alter_db_option ::= KEEP integer_list */ + -2, /* (148) alter_db_option ::= KEEP variable_list */ + -2, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + -2, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + -2, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + -2, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + -2, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + -2, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + -3, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -2, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + -3, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -2, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + -2, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + -2, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + -2, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + -2, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (163) integer_list ::= NK_INTEGER */ + -3, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + -1, /* (165) variable_list ::= NK_VARIABLE */ + -3, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + -1, /* (167) retention_list ::= retention */ + -3, /* (168) retention_list ::= retention_list NK_COMMA retention */ + -3, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + -3, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 0, /* (171) speed_opt ::= */ + -2, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + 0, /* (173) start_opt ::= */ + -3, /* (174) start_opt ::= START WITH NK_INTEGER */ + -3, /* (175) start_opt ::= START WITH NK_STRING */ + -4, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 0, /* (177) end_opt ::= */ + -3, /* (178) end_opt ::= END WITH NK_INTEGER */ + -3, /* (179) end_opt ::= END WITH NK_STRING */ + -4, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + -9, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + -3, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + -10, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + -9, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + -4, /* (185) cmd ::= DROP TABLE with_opt multi_drop_clause */ + -5, /* (186) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ + -3, /* (187) cmd ::= ALTER TABLE alter_table_clause */ + -3, /* (188) cmd ::= ALTER STABLE alter_table_clause */ + -2, /* (189) alter_table_clause ::= full_table_name alter_table_options */ + -6, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + -4, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + -5, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + -5, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + -5, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + -5, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + -4, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ + -5, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + -5, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + -6, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + -1, /* (200) multi_create_clause ::= create_subtable_clause */ + -2, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ + -10, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + -1, /* (203) multi_drop_clause ::= drop_table_clause */ + -3, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + -2, /* (205) drop_table_clause ::= exists_opt full_table_name */ + 0, /* (206) with_opt ::= */ + -1, /* (207) with_opt ::= WITH */ + 0, /* (208) specific_cols_opt ::= */ + -3, /* (209) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + -1, /* (210) full_table_name ::= table_name */ + -3, /* (211) full_table_name ::= db_name NK_DOT table_name */ + -1, /* (212) tag_def_list ::= tag_def */ + -3, /* (213) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + -2, /* (214) tag_def ::= column_name type_name */ + -1, /* (215) column_def_list ::= column_def */ + -3, /* (216) column_def_list ::= column_def_list NK_COMMA column_def */ + -3, /* (217) column_def ::= column_name type_name column_options */ + -1, /* (218) type_name ::= BOOL */ + -1, /* (219) type_name ::= TINYINT */ + -1, /* (220) type_name ::= SMALLINT */ + -1, /* (221) type_name ::= INT */ + -1, /* (222) type_name ::= INTEGER */ + -1, /* (223) type_name ::= BIGINT */ + -1, /* (224) type_name ::= FLOAT */ + -1, /* (225) type_name ::= DOUBLE */ + -4, /* (226) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + -1, /* (227) type_name ::= TIMESTAMP */ + -4, /* (228) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + -2, /* (229) type_name ::= TINYINT UNSIGNED */ + -2, /* (230) type_name ::= SMALLINT UNSIGNED */ + -2, /* (231) type_name ::= INT UNSIGNED */ + -2, /* (232) type_name ::= BIGINT UNSIGNED */ + -1, /* (233) type_name ::= JSON */ + -4, /* (234) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + -1, /* (235) type_name ::= MEDIUMBLOB */ + -1, /* (236) type_name ::= BLOB */ + -4, /* (237) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + -4, /* (238) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (239) type_name ::= DECIMAL */ + -4, /* (240) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (241) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + -1, /* (242) type_name_default_len ::= BINARY */ + -1, /* (243) type_name_default_len ::= NCHAR */ + -1, /* (244) type_name_default_len ::= VARCHAR */ + -1, /* (245) type_name_default_len ::= VARBINARY */ + 0, /* (246) tags_def_opt ::= */ + -1, /* (247) tags_def_opt ::= tags_def */ + -4, /* (248) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 0, /* (249) table_options ::= */ + -3, /* (250) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (251) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (252) table_options ::= table_options WATERMARK duration_list */ + -5, /* (253) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (254) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (255) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (256) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (257) alter_table_options ::= alter_table_option */ + -2, /* (258) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (259) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (260) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (261) duration_list ::= duration_literal */ + -3, /* (262) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (263) rollup_func_list ::= rollup_func_name */ + -3, /* (264) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (265) rollup_func_name ::= function_name */ + -1, /* (266) rollup_func_name ::= FIRST */ + -1, /* (267) rollup_func_name ::= LAST */ + -1, /* (268) col_name_list ::= col_name */ + -3, /* (269) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (270) col_name ::= column_name */ + -2, /* (271) cmd ::= SHOW DNODES */ + -2, /* (272) cmd ::= SHOW USERS */ + -3, /* (273) cmd ::= SHOW USERS FULL */ + -3, /* (274) cmd ::= SHOW USER PRIVILEGES */ + -3, /* (275) cmd ::= SHOW db_kind_opt DATABASES */ + -4, /* (276) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (277) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (278) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (279) cmd ::= SHOW MNODES */ + -2, /* (280) cmd ::= SHOW QNODES */ + -2, /* (281) cmd ::= SHOW ARBGROUPS */ + -2, /* (282) cmd ::= SHOW FUNCTIONS */ + -5, /* (283) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (284) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (285) cmd ::= SHOW STREAMS */ + -2, /* (286) cmd ::= SHOW ACCOUNTS */ + -2, /* (287) cmd ::= SHOW APPS */ + -2, /* (288) cmd ::= SHOW CONNECTIONS */ + -2, /* (289) cmd ::= SHOW LICENCES */ + -2, /* (290) cmd ::= SHOW GRANTS */ + -3, /* (291) cmd ::= SHOW GRANTS FULL */ + -3, /* (292) cmd ::= SHOW GRANTS LOGS */ + -3, /* (293) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (294) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (295) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (296) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (297) cmd ::= SHOW ENCRYPTIONS */ + -2, /* (298) cmd ::= SHOW QUERIES */ + -2, /* (299) cmd ::= SHOW SCORES */ + -2, /* (300) cmd ::= SHOW TOPICS */ + -2, /* (301) cmd ::= SHOW VARIABLES */ + -3, /* (302) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (303) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (304) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (305) cmd ::= SHOW BNODES */ + -2, /* (306) cmd ::= SHOW SNODES */ + -2, /* (307) cmd ::= SHOW CLUSTER */ + -2, /* (308) cmd ::= SHOW TRANSACTIONS */ + -4, /* (309) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (310) cmd ::= SHOW CONSUMERS */ + -2, /* (311) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (312) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (313) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (314) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (315) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (316) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (317) cmd ::= SHOW VNODES */ + -3, /* (318) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (319) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (320) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (321) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (322) cmd ::= SHOW COMPACTS */ + -3, /* (323) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (324) table_kind_db_name_cond_opt ::= */ + -1, /* (325) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (326) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (327) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (328) table_kind ::= NORMAL */ + -1, /* (329) table_kind ::= CHILD */ + 0, /* (330) db_name_cond_opt ::= */ + -2, /* (331) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (332) like_pattern_opt ::= */ + -2, /* (333) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (334) table_name_cond ::= table_name */ + 0, /* (335) from_db_opt ::= */ + -2, /* (336) from_db_opt ::= FROM db_name */ + 0, /* (337) tag_list_opt ::= */ + -1, /* (338) tag_list_opt ::= tag_item */ + -3, /* (339) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (340) tag_item ::= TBNAME */ + -1, /* (341) tag_item ::= QTAGS */ + -1, /* (342) tag_item ::= column_name */ + -2, /* (343) tag_item ::= column_name column_alias */ + -3, /* (344) tag_item ::= column_name AS column_alias */ + 0, /* (345) db_kind_opt ::= */ + -1, /* (346) db_kind_opt ::= USER */ + -1, /* (347) db_kind_opt ::= SYSTEM */ + -11, /* (348) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + -11, /* (349) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + -4, /* (350) cmd ::= DROP TSMA exists_opt full_tsma_name */ + -3, /* (351) cmd ::= SHOW db_name_cond_opt TSMAS */ + -1, /* (352) full_tsma_name ::= tsma_name */ + -3, /* (353) full_tsma_name ::= db_name NK_DOT tsma_name */ + -4, /* (354) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + -8, /* (355) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (356) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (357) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (358) full_index_name ::= index_name */ + -3, /* (359) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (360) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (361) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + -1, /* (362) func_list ::= func */ + -3, /* (363) func_list ::= func_list NK_COMMA func */ + -4, /* (364) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (365) sma_func_name ::= function_name */ + -1, /* (366) sma_func_name ::= COUNT */ + -1, /* (367) sma_func_name ::= FIRST */ + -1, /* (368) sma_func_name ::= LAST */ + -1, /* (369) sma_func_name ::= LAST_ROW */ + 0, /* (370) sma_stream_opt ::= */ + -3, /* (371) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (372) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (373) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (374) with_meta ::= AS */ + -3, /* (375) with_meta ::= WITH META AS */ + -3, /* (376) with_meta ::= ONLY META AS */ + -6, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (378) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (379) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (380) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (381) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (382) cmd ::= DESC full_table_name */ + -2, /* (383) cmd ::= DESCRIBE full_table_name */ + -3, /* (384) cmd ::= RESET QUERY CACHE */ + -4, /* (385) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (386) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (387) analyze_opt ::= */ + -1, /* (388) analyze_opt ::= ANALYZE */ + 0, /* (389) explain_options ::= */ + -3, /* (390) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (391) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (392) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (393) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (394) agg_func_opt ::= */ + -1, /* (395) agg_func_opt ::= AGGREGATE */ + 0, /* (396) bufsize_opt ::= */ + -2, /* (397) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (398) language_opt ::= */ + -2, /* (399) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (400) or_replace_opt ::= */ + -2, /* (401) or_replace_opt ::= OR REPLACE */ + -6, /* (402) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (403) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (404) full_view_name ::= view_name */ + -3, /* (405) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (406) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (407) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (408) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (409) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (410) col_list_opt ::= */ + -3, /* (411) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + -1, /* (412) column_stream_def_list ::= column_stream_def */ + -3, /* (413) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + -2, /* (414) column_stream_def ::= column_name stream_col_options */ + 0, /* (415) stream_col_options ::= */ + -3, /* (416) stream_col_options ::= stream_col_options PRIMARY KEY */ + 0, /* (417) tag_def_or_ref_opt ::= */ + -1, /* (418) tag_def_or_ref_opt ::= tags_def */ + -4, /* (419) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 0, /* (420) stream_options ::= */ + -3, /* (421) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (422) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (423) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (424) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (425) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (426) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (427) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (428) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (429) subtable_opt ::= */ + -4, /* (430) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (431) ignore_opt ::= */ + -2, /* (432) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (433) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (434) cmd ::= KILL QUERY NK_STRING */ + -3, /* (435) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (436) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (437) cmd ::= BALANCE VGROUP */ + -4, /* (438) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -5, /* (439) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + -4, /* (440) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (441) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (442) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (443) on_vgroup_id ::= */ + -2, /* (444) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (445) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (446) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (447) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (448) cmd ::= query_or_subquery */ + -1, /* (449) cmd ::= insert_query */ + -7, /* (450) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (451) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (452) tags_literal ::= NK_INTEGER */ + -3, /* (453) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + -3, /* (454) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + -2, /* (455) tags_literal ::= NK_PLUS NK_INTEGER */ + -4, /* (456) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (457) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + -2, /* (458) tags_literal ::= NK_MINUS NK_INTEGER */ + -4, /* (459) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (460) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + -1, /* (461) tags_literal ::= NK_FLOAT */ + -2, /* (462) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (463) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (464) tags_literal ::= NK_BIN */ + -3, /* (465) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + -3, /* (466) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + -2, /* (467) tags_literal ::= NK_PLUS NK_BIN */ + -4, /* (468) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + -4, /* (469) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + -2, /* (470) tags_literal ::= NK_MINUS NK_BIN */ + -4, /* (471) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + -4, /* (472) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + -1, /* (473) tags_literal ::= NK_HEX */ + -3, /* (474) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + -3, /* (475) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + -2, /* (476) tags_literal ::= NK_PLUS NK_HEX */ + -4, /* (477) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + -4, /* (478) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + -2, /* (479) tags_literal ::= NK_MINUS NK_HEX */ + -4, /* (480) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + -4, /* (481) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + -1, /* (482) tags_literal ::= NK_STRING */ + -3, /* (483) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + -3, /* (484) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + -1, /* (485) tags_literal ::= NK_BOOL */ + -1, /* (486) tags_literal ::= NULL */ + -1, /* (487) tags_literal ::= literal_func */ + -3, /* (488) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (489) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (490) tags_literal_list ::= tags_literal */ + -3, /* (491) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (492) literal ::= NK_INTEGER */ + -1, /* (493) literal ::= NK_FLOAT */ + -1, /* (494) literal ::= NK_STRING */ + -1, /* (495) literal ::= NK_BOOL */ + -2, /* (496) literal ::= TIMESTAMP NK_STRING */ + -1, /* (497) literal ::= duration_literal */ + -1, /* (498) literal ::= NULL */ + -1, /* (499) literal ::= NK_QUESTION */ + -1, /* (500) duration_literal ::= NK_VARIABLE */ + -1, /* (501) signed ::= NK_INTEGER */ + -2, /* (502) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (503) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (504) signed ::= NK_FLOAT */ + -2, /* (505) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (506) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (507) signed_literal ::= signed */ + -1, /* (508) signed_literal ::= NK_STRING */ + -1, /* (509) signed_literal ::= NK_BOOL */ + -2, /* (510) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (511) signed_literal ::= duration_literal */ + -1, /* (512) signed_literal ::= NULL */ + -1, /* (513) signed_literal ::= literal_func */ + -1, /* (514) signed_literal ::= NK_QUESTION */ + -1, /* (515) literal_list ::= signed_literal */ + -3, /* (516) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (517) db_name ::= NK_ID */ + -1, /* (518) table_name ::= NK_ID */ + -1, /* (519) column_name ::= NK_ID */ + -1, /* (520) function_name ::= NK_ID */ + -1, /* (521) view_name ::= NK_ID */ + -1, /* (522) table_alias ::= NK_ID */ + -1, /* (523) column_alias ::= NK_ID */ + -1, /* (524) column_alias ::= NK_ALIAS */ + -1, /* (525) user_name ::= NK_ID */ + -1, /* (526) topic_name ::= NK_ID */ + -1, /* (527) stream_name ::= NK_ID */ + -1, /* (528) cgroup_name ::= NK_ID */ + -1, /* (529) index_name ::= NK_ID */ + -1, /* (530) tsma_name ::= NK_ID */ + -1, /* (531) expr_or_subquery ::= expression */ + -1, /* (532) expression ::= literal */ + -1, /* (533) expression ::= pseudo_column */ + -1, /* (534) expression ::= column_reference */ + -1, /* (535) expression ::= function_expression */ + -1, /* (536) expression ::= case_when_expression */ + -3, /* (537) expression ::= NK_LP expression NK_RP */ + -2, /* (538) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (539) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (540) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (541) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (542) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (543) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (544) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (545) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (546) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (547) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (548) expression_list ::= expr_or_subquery */ + -3, /* (549) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (550) column_reference ::= column_name */ + -3, /* (551) column_reference ::= table_name NK_DOT column_name */ + -1, /* (552) column_reference ::= NK_ALIAS */ + -3, /* (553) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (554) pseudo_column ::= ROWTS */ + -1, /* (555) pseudo_column ::= TBNAME */ + -3, /* (556) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (557) pseudo_column ::= QSTART */ + -1, /* (558) pseudo_column ::= QEND */ + -1, /* (559) pseudo_column ::= QDURATION */ + -1, /* (560) pseudo_column ::= WSTART */ + -1, /* (561) pseudo_column ::= WEND */ + -1, /* (562) pseudo_column ::= WDURATION */ + -1, /* (563) pseudo_column ::= IROWTS */ + -1, /* (564) pseudo_column ::= ISFILLED */ + -1, /* (565) pseudo_column ::= QTAGS */ + -4, /* (566) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (567) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (568) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -6, /* (569) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + -6, /* (570) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ + -4, /* (571) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ + -6, /* (572) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ + -6, /* (573) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + -7, /* (574) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ + -4, /* (575) function_expression ::= substr_func NK_LP expression_list NK_RP */ + -6, /* (576) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + -8, /* (577) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ + -4, /* (578) function_expression ::= REPLACE NK_LP expression_list NK_RP */ + -1, /* (579) function_expression ::= literal_func */ + -1, /* (580) function_expression ::= rand_func */ + -3, /* (581) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (582) literal_func ::= NOW */ + -1, /* (583) literal_func ::= TODAY */ + -3, /* (584) rand_func ::= RAND NK_LP NK_RP */ + -4, /* (585) rand_func ::= RAND NK_LP expression_list NK_RP */ + -1, /* (586) substr_func ::= SUBSTR */ + -1, /* (587) substr_func ::= SUBSTRING */ + -1, /* (588) trim_specification_type ::= BOTH */ + -1, /* (589) trim_specification_type ::= TRAILING */ + -1, /* (590) trim_specification_type ::= LEADING */ + -1, /* (591) noarg_func ::= NOW */ + -1, /* (592) noarg_func ::= TODAY */ + -1, /* (593) noarg_func ::= TIMEZONE */ + -1, /* (594) noarg_func ::= DATABASE */ + -1, /* (595) noarg_func ::= CLIENT_VERSION */ + -1, /* (596) noarg_func ::= SERVER_VERSION */ + -1, /* (597) noarg_func ::= SERVER_STATUS */ + -1, /* (598) noarg_func ::= CURRENT_USER */ + -1, /* (599) noarg_func ::= USER */ + -1, /* (600) noarg_func ::= PI */ + -1, /* (601) star_func ::= COUNT */ + -1, /* (602) star_func ::= FIRST */ + -1, /* (603) star_func ::= LAST */ + -1, /* (604) star_func ::= LAST_ROW */ + -1, /* (605) star_func_para_list ::= NK_STAR */ + -1, /* (606) star_func_para_list ::= other_para_list */ + -1, /* (607) other_para_list ::= star_func_para */ + -3, /* (608) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (609) star_func_para ::= expr_or_subquery */ + -3, /* (610) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (611) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (612) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (613) when_then_list ::= when_then_expr */ + -2, /* (614) when_then_list ::= when_then_list when_then_expr */ + -4, /* (615) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (616) case_when_else_opt ::= */ + -2, /* (617) case_when_else_opt ::= ELSE common_expression */ + -3, /* (618) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (619) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (620) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (621) predicate ::= expr_or_subquery IS NULL */ + -4, /* (622) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (623) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (624) compare_op ::= NK_LT */ + -1, /* (625) compare_op ::= NK_GT */ + -1, /* (626) compare_op ::= NK_LE */ + -1, /* (627) compare_op ::= NK_GE */ + -1, /* (628) compare_op ::= NK_NE */ + -1, /* (629) compare_op ::= NK_EQ */ + -1, /* (630) compare_op ::= LIKE */ + -2, /* (631) compare_op ::= NOT LIKE */ + -1, /* (632) compare_op ::= MATCH */ + -1, /* (633) compare_op ::= NMATCH */ + -1, /* (634) compare_op ::= CONTAINS */ + -1, /* (635) in_op ::= IN */ + -2, /* (636) in_op ::= NOT IN */ + -3, /* (637) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (638) boolean_value_expression ::= boolean_primary */ + -2, /* (639) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (640) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (641) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (642) boolean_primary ::= predicate */ + -3, /* (643) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (644) common_expression ::= expr_or_subquery */ + -1, /* (645) common_expression ::= boolean_value_expression */ + 0, /* (646) from_clause_opt ::= */ + -2, /* (647) from_clause_opt ::= FROM table_reference_list */ + -1, /* (648) table_reference_list ::= table_reference */ + -3, /* (649) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (650) table_reference ::= table_primary */ + -1, /* (651) table_reference ::= joined_table */ + -2, /* (652) table_primary ::= table_name alias_opt */ + -4, /* (653) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (654) table_primary ::= subquery alias_opt */ + -1, /* (655) table_primary ::= parenthesized_joined_table */ + 0, /* (656) alias_opt ::= */ + -1, /* (657) alias_opt ::= table_alias */ + -2, /* (658) alias_opt ::= AS table_alias */ + -3, /* (659) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (660) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (661) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (662) join_type ::= */ + -1, /* (663) join_type ::= INNER */ + -1, /* (664) join_type ::= LEFT */ + -1, /* (665) join_type ::= RIGHT */ + -1, /* (666) join_type ::= FULL */ + 0, /* (667) join_subtype ::= */ + -1, /* (668) join_subtype ::= OUTER */ + -1, /* (669) join_subtype ::= SEMI */ + -1, /* (670) join_subtype ::= ANTI */ + -1, /* (671) join_subtype ::= ASOF */ + -1, /* (672) join_subtype ::= WINDOW */ + 0, /* (673) join_on_clause_opt ::= */ + -2, /* (674) join_on_clause_opt ::= ON search_condition */ + 0, /* (675) window_offset_clause_opt ::= */ + -6, /* (676) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (677) window_offset_literal ::= NK_VARIABLE */ + -2, /* (678) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (679) jlimit_clause_opt ::= */ + -2, /* (680) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (681) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (682) hint_list ::= */ + -1, /* (683) hint_list ::= NK_HINT */ + 0, /* (684) tag_mode_opt ::= */ + -1, /* (685) tag_mode_opt ::= TAGS */ + 0, /* (686) set_quantifier_opt ::= */ + -1, /* (687) set_quantifier_opt ::= DISTINCT */ + -1, /* (688) set_quantifier_opt ::= ALL */ + -1, /* (689) select_list ::= select_item */ + -3, /* (690) select_list ::= select_list NK_COMMA select_item */ + -1, /* (691) select_item ::= NK_STAR */ + -1, /* (692) select_item ::= common_expression */ + -2, /* (693) select_item ::= common_expression column_alias */ + -3, /* (694) select_item ::= common_expression AS column_alias */ + -3, /* (695) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (696) where_clause_opt ::= */ + -2, /* (697) where_clause_opt ::= WHERE search_condition */ + 0, /* (698) partition_by_clause_opt ::= */ + -3, /* (699) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (700) partition_list ::= partition_item */ + -3, /* (701) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (702) partition_item ::= expr_or_subquery */ + -2, /* (703) partition_item ::= expr_or_subquery column_alias */ + -3, /* (704) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (705) twindow_clause_opt ::= */ + -6, /* (706) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (707) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (708) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (709) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (710) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (711) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (712) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (713) sliding_opt ::= */ + -4, /* (714) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (715) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (716) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (717) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (718) fill_opt ::= */ + -4, /* (719) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (720) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (721) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (722) fill_mode ::= NONE */ + -1, /* (723) fill_mode ::= PREV */ + -1, /* (724) fill_mode ::= NULL */ + -1, /* (725) fill_mode ::= NULL_F */ + -1, /* (726) fill_mode ::= LINEAR */ + -1, /* (727) fill_mode ::= NEXT */ + 0, /* (728) group_by_clause_opt ::= */ + -3, /* (729) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (730) group_by_list ::= expr_or_subquery */ + -3, /* (731) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (732) having_clause_opt ::= */ + -2, /* (733) having_clause_opt ::= HAVING search_condition */ + 0, /* (734) range_opt ::= */ + -6, /* (735) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (736) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (737) every_opt ::= */ + -4, /* (738) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (739) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (740) query_simple ::= query_specification */ + -1, /* (741) query_simple ::= union_query_expression */ + -4, /* (742) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (743) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (744) query_simple_or_subquery ::= query_simple */ + -1, /* (745) query_simple_or_subquery ::= subquery */ + -1, /* (746) query_or_subquery ::= query_expression */ + -1, /* (747) query_or_subquery ::= subquery */ + 0, /* (748) order_by_clause_opt ::= */ + -3, /* (749) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (750) slimit_clause_opt ::= */ + -2, /* (751) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (752) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (753) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (754) limit_clause_opt ::= */ + -2, /* (755) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (756) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (757) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (758) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (759) subquery ::= NK_LP subquery NK_RP */ + -1, /* (760) search_condition ::= common_expression */ + -1, /* (761) sort_specification_list ::= sort_specification */ + -3, /* (762) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (763) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (764) ordering_specification_opt ::= */ + -1, /* (765) ordering_specification_opt ::= ASC */ + -1, /* (766) ordering_specification_opt ::= DESC */ + 0, /* (767) null_ordering_opt ::= */ + -2, /* (768) null_ordering_opt ::= NULLS FIRST */ + -2, /* (769) null_ordering_opt ::= NULLS LAST */ + 0, /* (770) column_options ::= */ + -3, /* (771) column_options ::= column_options PRIMARY KEY */ + -3, /* (772) column_options ::= column_options NK_ID NK_STRING */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -5619,11 +5551,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,390,&yymsp[0].minor); + yy_destructor(yypParser,384,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,391,&yymsp[0].minor); + yy_destructor(yypParser,385,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -5637,20 +5569,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,390,&yymsp[-2].minor); +{ yy_destructor(yypParser,384,&yymsp[-2].minor); { } - yy_destructor(yypParser,392,&yymsp[0].minor); + yy_destructor(yypParser,386,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,393,&yymsp[0].minor); +{ yy_destructor(yypParser,387,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,391,&yymsp[-1].minor); +{ yy_destructor(yypParser,385,&yymsp[-1].minor); { } - yy_destructor(yypParser,393,&yymsp[0].minor); + yy_destructor(yypParser,387,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -5664,2137 +5596,2110 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,392,&yymsp[0].minor); + yy_destructor(yypParser,386,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy946 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy946 = yylhsminor.yy946; +{ yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy946 = yymsp[0].minor.yy946; } +{ yymsp[-1].minor.yy334 = yymsp[0].minor.yy334; } break; case 27: /* white_list_opt ::= */ - case 212: /* specific_cols_opt ::= */ yytestcase(yyruleno==212); - case 250: /* tags_def_opt ::= */ yytestcase(yyruleno==250); - case 343: /* tag_list_opt ::= */ yytestcase(yyruleno==343); - case 416: /* col_list_opt ::= */ yytestcase(yyruleno==416); - case 423: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==423); - case 707: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==707); - case 739: /* group_by_clause_opt ::= */ yytestcase(yyruleno==739); - case 759: /* order_by_clause_opt ::= */ yytestcase(yyruleno==759); -{ yymsp[1].minor.yy946 = NULL; } + case 208: /* specific_cols_opt ::= */ yytestcase(yyruleno==208); + case 246: /* tags_def_opt ::= */ yytestcase(yyruleno==246); + case 337: /* tag_list_opt ::= */ yytestcase(yyruleno==337); + case 410: /* col_list_opt ::= */ yytestcase(yyruleno==410); + case 417: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==417); + case 698: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==698); + case 728: /* group_by_clause_opt ::= */ yytestcase(yyruleno==728); + case 748: /* order_by_clause_opt ::= */ yytestcase(yyruleno==748); +{ yymsp[1].minor.yy334 = NULL; } break; case 28: /* white_list_opt ::= white_list */ - case 251: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==251); - case 424: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==424); - case 615: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==615); -{ yylhsminor.yy946 = yymsp[0].minor.yy946; } - yymsp[0].minor.yy946 = yylhsminor.yy946; + case 247: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==247); + case 418: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==418); + case 606: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==606); +{ yylhsminor.yy334 = yymsp[0].minor.yy334; } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; case 29: /* is_import_opt ::= */ case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); -{ yymsp[1].minor.yy815 = 0; } +{ yymsp[1].minor.yy719 = 0; } break; case 30: /* is_import_opt ::= IS_IMPORT NK_INTEGER */ case 32: /* is_createdb_opt ::= CREATEDB NK_INTEGER */ yytestcase(yyruleno==32); case 42: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ yytestcase(yyruleno==42); -{ yymsp[-1].minor.yy815 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy719 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy557, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy815, yymsp[-1].minor.yy815, yymsp[-2].minor.yy815); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy946); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy533, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy719, yymsp[-1].minor.yy719, yymsp[-2].minor.yy719); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy334); } break; case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } break; case 38: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy946); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy334); } break; case 39: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy557, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy946); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy334); } break; case 40: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy557); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy533); } break; case 41: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy815 = 1; } +{ yymsp[1].minor.yy719 = 1; } break; case 43: /* cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy483, &yymsp[-3].minor.yy723, &yymsp[0].minor.yy557, yymsp[-2].minor.yy974); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy585, &yymsp[-3].minor.yy399, &yymsp[0].minor.yy533, yymsp[-2].minor.yy560); } break; case 44: /* cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy483, &yymsp[-3].minor.yy723, &yymsp[0].minor.yy557, yymsp[-2].minor.yy974); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy585, &yymsp[-3].minor.yy399, &yymsp[0].minor.yy533, yymsp[-2].minor.yy560); } break; case 45: /* privileges ::= ALL */ -{ yymsp[0].minor.yy483 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_ALL; } break; case 46: /* privileges ::= priv_type_list */ case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); -{ yylhsminor.yy483 = yymsp[0].minor.yy483; } - yymsp[0].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy585 = yymsp[0].minor.yy585; } + yymsp[0].minor.yy585 = yylhsminor.yy585; break; case 47: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy483 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy483 = yymsp[-2].minor.yy483 | yymsp[0].minor.yy483; } - yymsp[-2].minor.yy483 = yylhsminor.yy483; +{ yylhsminor.yy585 = yymsp[-2].minor.yy585 | yymsp[0].minor.yy585; } + yymsp[-2].minor.yy585 = yylhsminor.yy585; break; case 50: /* priv_type ::= READ */ -{ yymsp[0].minor.yy483 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_READ; } break; case 51: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy483 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_WRITE; } break; case 52: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy483 = PRIVILEGE_TYPE_ALTER; } +{ yymsp[0].minor.yy585 = PRIVILEGE_TYPE_ALTER; } break; case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy723.first = yymsp[-2].minor.yy0; yylhsminor.yy723.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy723 = yylhsminor.yy723; +{ yylhsminor.yy399.first = yymsp[-2].minor.yy0; yylhsminor.yy399.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; break; case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy723.first = yymsp[-2].minor.yy557; yylhsminor.yy723.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy723 = yylhsminor.yy723; +{ yylhsminor.yy399.first = yymsp[-2].minor.yy533; yylhsminor.yy399.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; break; case 55: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy723.first = yymsp[-2].minor.yy557; yylhsminor.yy723.second = yymsp[0].minor.yy557; } - yymsp[-2].minor.yy723 = yylhsminor.yy723; +{ yylhsminor.yy399.first = yymsp[-2].minor.yy533; yylhsminor.yy399.second = yymsp[0].minor.yy533; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; break; case 56: /* priv_level ::= topic_name */ -{ yylhsminor.yy723.first = yymsp[0].minor.yy557; yylhsminor.yy723.second = nil_token; } - yymsp[0].minor.yy723 = yylhsminor.yy723; +{ yylhsminor.yy399.first = yymsp[0].minor.yy533; yylhsminor.yy399.second = nil_token; } + yymsp[0].minor.yy399 = yylhsminor.yy399; break; case 57: /* with_clause_opt ::= */ - case 177: /* start_opt ::= */ yytestcase(yyruleno==177); - case 181: /* end_opt ::= */ yytestcase(yyruleno==181); - case 338: /* like_pattern_opt ::= */ yytestcase(yyruleno==338); - case 435: /* subtable_opt ::= */ yytestcase(yyruleno==435); - case 625: /* case_when_else_opt ::= */ yytestcase(yyruleno==625); - case 655: /* from_clause_opt ::= */ yytestcase(yyruleno==655); - case 682: /* join_on_clause_opt ::= */ yytestcase(yyruleno==682); - case 684: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==684); - case 688: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==688); - case 705: /* where_clause_opt ::= */ yytestcase(yyruleno==705); - case 714: /* twindow_clause_opt ::= */ yytestcase(yyruleno==714); - case 724: /* sliding_opt ::= */ yytestcase(yyruleno==724); - case 729: /* fill_opt ::= */ yytestcase(yyruleno==729); - case 743: /* having_clause_opt ::= */ yytestcase(yyruleno==743); - case 745: /* range_opt ::= */ yytestcase(yyruleno==745); - case 748: /* every_opt ::= */ yytestcase(yyruleno==748); - case 761: /* slimit_clause_opt ::= */ yytestcase(yyruleno==761); - case 765: /* limit_clause_opt ::= */ yytestcase(yyruleno==765); -{ yymsp[1].minor.yy974 = NULL; } + case 173: /* start_opt ::= */ yytestcase(yyruleno==173); + case 177: /* end_opt ::= */ yytestcase(yyruleno==177); + case 332: /* like_pattern_opt ::= */ yytestcase(yyruleno==332); + case 429: /* subtable_opt ::= */ yytestcase(yyruleno==429); + case 616: /* case_when_else_opt ::= */ yytestcase(yyruleno==616); + case 646: /* from_clause_opt ::= */ yytestcase(yyruleno==646); + case 673: /* join_on_clause_opt ::= */ yytestcase(yyruleno==673); + case 675: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==675); + case 679: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==679); + case 696: /* where_clause_opt ::= */ yytestcase(yyruleno==696); + case 705: /* twindow_clause_opt ::= */ yytestcase(yyruleno==705); + case 713: /* sliding_opt ::= */ yytestcase(yyruleno==713); + case 718: /* fill_opt ::= */ yytestcase(yyruleno==718); + case 732: /* having_clause_opt ::= */ yytestcase(yyruleno==732); + case 734: /* range_opt ::= */ yytestcase(yyruleno==734); + case 737: /* every_opt ::= */ yytestcase(yyruleno==737); + case 750: /* slimit_clause_opt ::= */ yytestcase(yyruleno==750); + case 754: /* limit_clause_opt ::= */ yytestcase(yyruleno==754); +{ yymsp[1].minor.yy560 = NULL; } break; case 58: /* with_clause_opt ::= WITH search_condition */ - case 656: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==656); - case 683: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==683); - case 706: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==706); - case 744: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==744); -{ yymsp[-1].minor.yy974 = yymsp[0].minor.yy974; } + case 647: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==647); + case 674: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==674); + case 697: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==697); + case 733: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==733); +{ yymsp[-1].minor.yy560 = yymsp[0].minor.yy560; } break; case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ { pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 60: /* cmd ::= CREATE ANODE NK_STRING */ -{ pCxt->pRootNode = createCreateAnodeStmt(pCxt, &yymsp[0].minor.yy0); } + case 60: /* cmd ::= CREATE DNODE dnode_endpoint */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy533, NULL); } break; - case 61: /* cmd ::= UPDATE ANODE NK_INTEGER */ -{ pCxt->pRootNode = createUpdateAnodeStmt(pCxt, &yymsp[0].minor.yy0, false); } + case 61: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); } break; - case 62: /* cmd ::= UPDATE ALL ANODES */ -{ pCxt->pRootNode = createUpdateAnodeStmt(pCxt, NULL, true); } + case 62: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy173, false); } break; - case 63: /* cmd ::= DROP ANODE NK_INTEGER */ -{ pCxt->pRootNode = createDropAnodeStmt(pCxt, &yymsp[0].minor.yy0); } + case 63: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy173, false); } break; - case 64: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy557, NULL); } + case 64: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy173); } break; - case 65: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0); } + case 65: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy533, false, yymsp[0].minor.yy173); } break; - case 66: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy569, false); } - break; - case 67: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy557, yymsp[0].minor.yy569, false); } - break; - case 68: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy569); } - break; - case 69: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy557, false, yymsp[0].minor.yy569); } - break; - case 70: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + case 66: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } break; - case 71: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + case 67: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 72: /* cmd ::= ALTER ALL DNODES NK_STRING */ + case 68: /* cmd ::= ALTER ALL DNODES NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } break; - case 73: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + case 69: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 74: /* cmd ::= RESTORE DNODE NK_INTEGER */ + case 70: /* cmd ::= RESTORE DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } break; - case 75: /* dnode_endpoint ::= NK_STRING */ - case 76: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==76); - case 77: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==77); - case 372: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==372); - case 373: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==373); - case 374: /* sma_func_name ::= LAST */ yytestcase(yyruleno==374); - case 375: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==375); - case 523: /* db_name ::= NK_ID */ yytestcase(yyruleno==523); - case 524: /* table_name ::= NK_ID */ yytestcase(yyruleno==524); - case 525: /* column_name ::= NK_ID */ yytestcase(yyruleno==525); - case 526: /* function_name ::= NK_ID */ yytestcase(yyruleno==526); - case 527: /* view_name ::= NK_ID */ yytestcase(yyruleno==527); - case 528: /* table_alias ::= NK_ID */ yytestcase(yyruleno==528); - case 529: /* column_alias ::= NK_ID */ yytestcase(yyruleno==529); - case 530: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==530); - case 531: /* user_name ::= NK_ID */ yytestcase(yyruleno==531); - case 532: /* topic_name ::= NK_ID */ yytestcase(yyruleno==532); - case 533: /* stream_name ::= NK_ID */ yytestcase(yyruleno==533); - case 534: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==534); - case 535: /* index_name ::= NK_ID */ yytestcase(yyruleno==535); - case 536: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==536); - case 595: /* substr_func ::= SUBSTR */ yytestcase(yyruleno==595); - case 596: /* substr_func ::= SUBSTRING */ yytestcase(yyruleno==596); - case 600: /* noarg_func ::= NOW */ yytestcase(yyruleno==600); - case 601: /* noarg_func ::= TODAY */ yytestcase(yyruleno==601); - case 602: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==602); - case 603: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==603); - case 604: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==604); - case 605: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==605); - case 606: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==606); - case 607: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==607); - case 608: /* noarg_func ::= USER */ yytestcase(yyruleno==608); - case 609: /* noarg_func ::= PI */ yytestcase(yyruleno==609); - case 610: /* star_func ::= COUNT */ yytestcase(yyruleno==610); - case 611: /* star_func ::= FIRST */ yytestcase(yyruleno==611); - case 612: /* star_func ::= LAST */ yytestcase(yyruleno==612); - case 613: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==613); -{ yylhsminor.yy557 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy557 = yylhsminor.yy557; + case 71: /* dnode_endpoint ::= NK_STRING */ + case 72: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==72); + case 73: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==73); + case 366: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==366); + case 367: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==367); + case 368: /* sma_func_name ::= LAST */ yytestcase(yyruleno==368); + case 369: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==369); + case 517: /* db_name ::= NK_ID */ yytestcase(yyruleno==517); + case 518: /* table_name ::= NK_ID */ yytestcase(yyruleno==518); + case 519: /* column_name ::= NK_ID */ yytestcase(yyruleno==519); + case 520: /* function_name ::= NK_ID */ yytestcase(yyruleno==520); + case 521: /* view_name ::= NK_ID */ yytestcase(yyruleno==521); + case 522: /* table_alias ::= NK_ID */ yytestcase(yyruleno==522); + case 523: /* column_alias ::= NK_ID */ yytestcase(yyruleno==523); + case 524: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==524); + case 525: /* user_name ::= NK_ID */ yytestcase(yyruleno==525); + case 526: /* topic_name ::= NK_ID */ yytestcase(yyruleno==526); + case 527: /* stream_name ::= NK_ID */ yytestcase(yyruleno==527); + case 528: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==528); + case 529: /* index_name ::= NK_ID */ yytestcase(yyruleno==529); + case 530: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==530); + case 586: /* substr_func ::= SUBSTR */ yytestcase(yyruleno==586); + case 587: /* substr_func ::= SUBSTRING */ yytestcase(yyruleno==587); + case 591: /* noarg_func ::= NOW */ yytestcase(yyruleno==591); + case 592: /* noarg_func ::= TODAY */ yytestcase(yyruleno==592); + case 593: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==593); + case 594: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==594); + case 595: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==595); + case 596: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==596); + case 597: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==597); + case 598: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==598); + case 599: /* noarg_func ::= USER */ yytestcase(yyruleno==599); + case 600: /* noarg_func ::= PI */ yytestcase(yyruleno==600); + case 601: /* star_func ::= COUNT */ yytestcase(yyruleno==601); + case 602: /* star_func ::= FIRST */ yytestcase(yyruleno==602); + case 603: /* star_func ::= LAST */ yytestcase(yyruleno==603); + case 604: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==604); +{ yylhsminor.yy533 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy533 = yylhsminor.yy533; break; - case 78: /* force_opt ::= */ - case 105: /* not_exists_opt ::= */ yytestcase(yyruleno==105); - case 107: /* exists_opt ::= */ yytestcase(yyruleno==107); - case 210: /* with_opt ::= */ yytestcase(yyruleno==210); - case 393: /* analyze_opt ::= */ yytestcase(yyruleno==393); - case 400: /* agg_func_opt ::= */ yytestcase(yyruleno==400); - case 406: /* or_replace_opt ::= */ yytestcase(yyruleno==406); - case 437: /* ignore_opt ::= */ yytestcase(yyruleno==437); - case 693: /* tag_mode_opt ::= */ yytestcase(yyruleno==693); - case 695: /* set_quantifier_opt ::= */ yytestcase(yyruleno==695); -{ yymsp[1].minor.yy569 = false; } + case 74: /* force_opt ::= */ + case 101: /* not_exists_opt ::= */ yytestcase(yyruleno==101); + case 103: /* exists_opt ::= */ yytestcase(yyruleno==103); + case 206: /* with_opt ::= */ yytestcase(yyruleno==206); + case 387: /* analyze_opt ::= */ yytestcase(yyruleno==387); + case 394: /* agg_func_opt ::= */ yytestcase(yyruleno==394); + case 400: /* or_replace_opt ::= */ yytestcase(yyruleno==400); + case 431: /* ignore_opt ::= */ yytestcase(yyruleno==431); + case 684: /* tag_mode_opt ::= */ yytestcase(yyruleno==684); + case 686: /* set_quantifier_opt ::= */ yytestcase(yyruleno==686); +{ yymsp[1].minor.yy173 = false; } break; - case 79: /* force_opt ::= FORCE */ - case 80: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==80); - case 211: /* with_opt ::= WITH */ yytestcase(yyruleno==211); - case 394: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==394); - case 401: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==401); - case 694: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==694); - case 696: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==696); -{ yymsp[0].minor.yy569 = true; } + case 75: /* force_opt ::= FORCE */ + case 76: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==76); + case 207: /* with_opt ::= WITH */ yytestcase(yyruleno==207); + case 388: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==388); + case 395: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==395); + case 685: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==685); + case 687: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==687); +{ yymsp[0].minor.yy173 = true; } break; - case 81: /* cmd ::= ALTER CLUSTER NK_STRING */ + case 77: /* cmd ::= ALTER CLUSTER NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 82: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + case 78: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 83: /* cmd ::= ALTER LOCAL NK_STRING */ + case 79: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 84: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + case 80: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 85: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + case 81: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 86: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + case 82: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 87: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + case 83: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 88: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + case 84: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 89: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + case 85: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 90: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + case 86: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 91: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + case 87: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 92: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + case 88: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 93: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + case 89: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 94: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + case 90: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 95: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + case 91: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; - case 96: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy569, &yymsp[-1].minor.yy557, yymsp[0].minor.yy974); } + case 92: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy173, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } break; - case 97: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 93: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 98: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy557); } + case 94: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 99: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy557, yymsp[0].minor.yy974); } + case 95: /* cmd ::= ALTER DATABASE db_name alter_db_options */ +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } break; - case 100: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy557); } + case 96: /* cmd ::= FLUSH DATABASE db_name */ +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 101: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy557, yymsp[0].minor.yy904); } + case 97: /* cmd ::= TRIM DATABASE db_name speed_opt */ +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy802); } break; - case 102: /* cmd ::= S3MIGRATE DATABASE db_name */ -{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy557); } + case 98: /* cmd ::= S3MIGRATE DATABASE db_name */ +{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 103: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy557, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 99: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 104: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy569 = true; } + case 100: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy173 = true; } break; - case 106: /* exists_opt ::= IF EXISTS */ - case 407: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==407); - case 438: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==438); -{ yymsp[-1].minor.yy569 = true; } + case 102: /* exists_opt ::= IF EXISTS */ + case 401: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==401); + case 432: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==432); +{ yymsp[-1].minor.yy173 = true; } break; - case 108: /* db_options ::= */ -{ yymsp[1].minor.yy974 = createDefaultDatabaseOptions(pCxt); } + case 104: /* db_options ::= */ +{ yymsp[1].minor.yy560 = createDefaultDatabaseOptions(pCxt); } break; - case 109: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 105: /* db_options ::= db_options BUFFER NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 110: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 106: /* db_options ::= db_options CACHEMODEL NK_STRING */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 111: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 107: /* db_options ::= db_options CACHESIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 112: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 108: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 113: /* db_options ::= db_options DURATION NK_INTEGER */ - case 114: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==114); -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 109: /* db_options ::= db_options DURATION NK_INTEGER */ + case 110: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==110); +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 115: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 111: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 116: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 112: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 117: /* db_options ::= db_options KEEP integer_list */ - case 118: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==118); -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_KEEP, yymsp[0].minor.yy946); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 113: /* db_options ::= db_options KEEP integer_list */ + case 114: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==114); +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_KEEP, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 119: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 115: /* db_options ::= db_options PAGES NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 120: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 116: /* db_options ::= db_options PAGESIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 121: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 117: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 122: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 118: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 123: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 119: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 124: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 120: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 125: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 121: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 126: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_RETENTIONS, yymsp[0].minor.yy946); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 122: /* db_options ::= db_options RETENTIONS retention_list */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_RETENTIONS, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 127: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 123: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 128: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 124: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 129: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 125: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 130: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 126: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 131: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 127: /* 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.yy974 = setDatabaseOption(pCxt, yymsp[-3].minor.yy974, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-3].minor.yy560, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 132: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 128: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 133: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 129: /* 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.yy974 = setDatabaseOption(pCxt, yymsp[-3].minor.yy974, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-3].minor.yy560, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 134: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 130: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 135: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 131: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 136: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 132: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 137: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 133: /* db_options ::= db_options TABLE_PREFIX signed */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 138: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 134: /* db_options ::= db_options TABLE_SUFFIX signed */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 139: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 135: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 140: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - case 141: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==141); -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 136: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + case 137: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==137); +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 142: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 138: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 143: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 139: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 144: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ -{ yylhsminor.yy974 = setDatabaseOption(pCxt, yymsp[-2].minor.yy974, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 140: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ +{ yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 145: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy974 = createAlterDatabaseOptions(pCxt); yylhsminor.yy974 = setAlterDatabaseOption(pCxt, yylhsminor.yy974, &yymsp[0].minor.yy683); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 141: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy560 = createAlterDatabaseOptions(pCxt); yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yylhsminor.yy560, &yymsp[0].minor.yy389); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 146: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy974 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy974, &yymsp[0].minor.yy683); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 142: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy560, &yymsp[0].minor.yy389); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 147: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 143: /* alter_db_option ::= BUFFER NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 148: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 144: /* alter_db_option ::= CACHEMODEL NK_STRING */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 149: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 145: /* alter_db_option ::= CACHESIZE NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 150: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 146: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 151: /* alter_db_option ::= KEEP integer_list */ - case 152: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==152); -{ yymsp[-1].minor.yy683.type = DB_OPTION_KEEP; yymsp[-1].minor.yy683.pList = yymsp[0].minor.yy946; } + case 147: /* alter_db_option ::= KEEP integer_list */ + case 148: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==148); +{ yymsp[-1].minor.yy389.type = DB_OPTION_KEEP; yymsp[-1].minor.yy389.pList = yymsp[0].minor.yy334; } break; - case 153: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_PAGES; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 149: /* alter_db_option ::= PAGES NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_PAGES; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 154: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 150: /* alter_db_option ::= REPLICA NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 155: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_WAL; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 151: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_WAL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 156: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 152: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 157: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 153: /* alter_db_option ::= MINROWS NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 158: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 154: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 159: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 155: /* 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.yy683.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy683.val = t; + yymsp[-2].minor.yy389.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy389.val = t; } break; - case 160: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 156: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 161: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 157: /* 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.yy683.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy683.val = t; + yymsp[-2].minor.yy389.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy389.val = t; } break; - case 162: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - case 163: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==163); -{ yymsp[-1].minor.yy683.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } - break; - case 164: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } - break; - case 165: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } - break; - case 166: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ -{ yymsp[-1].minor.yy683.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } - break; - case 167: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy946 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy946 = yylhsminor.yy946; - break; - case 168: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 452: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==452); -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; - break; - case 169: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy946 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy946 = yylhsminor.yy946; - break; - case 170: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; - break; - case 171: /* retention_list ::= retention */ - case 204: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==204); - case 207: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==207); - case 216: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==216); - case 219: /* column_def_list ::= column_def */ yytestcase(yyruleno==219); - case 267: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==267); - case 272: /* col_name_list ::= col_name */ yytestcase(yyruleno==272); - case 344: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==344); - case 368: /* func_list ::= func */ yytestcase(yyruleno==368); - case 418: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==418); - case 496: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==496); - case 521: /* literal_list ::= signed_literal */ yytestcase(yyruleno==521); - case 616: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==616); - case 622: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==622); - case 698: /* select_list ::= select_item */ yytestcase(yyruleno==698); - case 709: /* partition_list ::= partition_item */ yytestcase(yyruleno==709); - case 772: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==772); -{ yylhsminor.yy946 = createNodeList(pCxt, yymsp[0].minor.yy974); } - yymsp[0].minor.yy946 = yylhsminor.yy946; - break; - case 172: /* retention_list ::= retention_list NK_COMMA retention */ - case 208: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==208); - case 217: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==217); - case 220: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==220); - case 268: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==268); - case 273: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==273); - case 345: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==345); - case 369: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==369); - case 419: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==419); - case 497: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==497); - case 522: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==522); - case 617: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==617); - case 699: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==699); - case 710: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==710); - case 773: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==773); -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, yymsp[0].minor.yy974); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; - break; - case 173: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - case 174: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==174); -{ yylhsminor.yy974 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; - break; - case 175: /* speed_opt ::= */ - case 402: /* bufsize_opt ::= */ yytestcase(yyruleno==402); -{ yymsp[1].minor.yy904 = 0; } - break; - case 176: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 403: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==403); -{ yymsp[-1].minor.yy904 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 178: /* start_opt ::= START WITH NK_INTEGER */ - case 182: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==182); -{ yymsp[-2].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 179: /* start_opt ::= START WITH NK_STRING */ - case 183: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==183); -{ yymsp[-2].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 180: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ - case 184: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==184); -{ yymsp[-3].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 185: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 188: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==188); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy569, yymsp[-5].minor.yy974, yymsp[-3].minor.yy946, yymsp[-1].minor.yy946, yymsp[0].minor.yy974); } - break; - case 186: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy946); } - break; - case 187: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ -{ pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy569, yymsp[-5].minor.yy974, yymsp[-3].minor.yy946, &yymsp[0].minor.yy0); } - break; - case 189: /* cmd ::= DROP TABLE with_opt multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[-1].minor.yy569, yymsp[0].minor.yy946); } - break; - case 190: /* cmd ::= DROP STABLE with_opt exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-2].minor.yy569, yymsp[-1].minor.yy569, yymsp[0].minor.yy974); } - break; - case 191: /* cmd ::= ALTER TABLE alter_table_clause */ - case 454: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==454); - case 455: /* cmd ::= insert_query */ yytestcase(yyruleno==455); -{ pCxt->pRootNode = yymsp[0].minor.yy974; } - break; - case 192: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy974); } - break; - case 193: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy974 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; - break; - case 194: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ -{ yylhsminor.yy974 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy974, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy557, yymsp[-1].minor.yy424, yymsp[0].minor.yy974); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; - break; - case 195: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy974 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy974, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy557); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; - break; - case 196: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy974 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy557, yymsp[0].minor.yy424); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; - break; - case 197: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ -{ yylhsminor.yy974 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy557, yymsp[0].minor.yy974); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; - break; - case 198: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy974 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; - break; - case 199: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy974 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy557, yymsp[0].minor.yy424); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 158: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + case 159: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==159); +{ yymsp[-1].minor.yy389.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 160: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 161: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 162: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ +{ yymsp[-1].minor.yy389.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 163: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 164: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 446: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==446); +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 165: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy334 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 166: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 167: /* retention_list ::= retention */ + case 200: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==200); + case 203: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==203); + case 212: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==212); + case 215: /* column_def_list ::= column_def */ yytestcase(yyruleno==215); + case 263: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==263); + case 268: /* col_name_list ::= col_name */ yytestcase(yyruleno==268); + case 338: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==338); + case 362: /* func_list ::= func */ yytestcase(yyruleno==362); + case 412: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==412); + case 490: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==490); + case 515: /* literal_list ::= signed_literal */ yytestcase(yyruleno==515); + case 607: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==607); + case 613: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==613); + case 689: /* select_list ::= select_item */ yytestcase(yyruleno==689); + case 700: /* partition_list ::= partition_item */ yytestcase(yyruleno==700); + case 761: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==761); +{ yylhsminor.yy334 = createNodeList(pCxt, yymsp[0].minor.yy560); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 168: /* retention_list ::= retention_list NK_COMMA retention */ + case 204: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==204); + case 213: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==213); + case 216: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==216); + case 264: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==264); + case 269: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==269); + case 339: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==339); + case 363: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==363); + case 413: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==413); + case 491: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==491); + case 516: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==516); + case 608: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==608); + case 690: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==690); + case 701: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==701); + case 762: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==762); +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 169: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 170: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==170); +{ yylhsminor.yy560 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 171: /* speed_opt ::= */ + case 396: /* bufsize_opt ::= */ yytestcase(yyruleno==396); +{ yymsp[1].minor.yy802 = 0; } + break; + case 172: /* speed_opt ::= BWLIMIT NK_INTEGER */ + case 397: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==397); +{ yymsp[-1].minor.yy802 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 174: /* start_opt ::= START WITH NK_INTEGER */ + case 178: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==178); +{ yymsp[-2].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 175: /* start_opt ::= START WITH NK_STRING */ + case 179: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==179); +{ yymsp[-2].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 176: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ + case 180: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==180); +{ yymsp[-3].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 181: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 184: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==184); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy334, yymsp[-1].minor.yy334, yymsp[0].minor.yy560); } + break; + case 182: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy334); } + break; + case 183: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ +{ pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy334, &yymsp[0].minor.yy0); } + break; + case 185: /* cmd ::= DROP TABLE with_opt multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy334); } + break; + case 186: /* cmd ::= DROP STABLE with_opt exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + break; + case 187: /* cmd ::= ALTER TABLE alter_table_clause */ + case 448: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==448); + case 449: /* cmd ::= insert_query */ yytestcase(yyruleno==449); +{ pCxt->pRootNode = yymsp[0].minor.yy560; } + break; + case 188: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy560); } + break; + case 189: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy560 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 190: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ +{ yylhsminor.yy560 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy560, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy952, yymsp[0].minor.yy560); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 191: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 193: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ +{ yylhsminor.yy560 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 194: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 195: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 200: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy974 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy974, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy557); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 196: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 201: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy974 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy557, yymsp[0].minor.yy424); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 197: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 202: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy974 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy974, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 198: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 203: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy974 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy974, &yymsp[-2].minor.yy557, yymsp[0].minor.yy974); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 199: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ +{ yylhsminor.yy560 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy560, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 205: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 623: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==623); -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-1].minor.yy946, yymsp[0].minor.yy974); } - yymsp[-1].minor.yy946 = yylhsminor.yy946; + case 201: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 614: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==614); +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-1].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy334 = yylhsminor.yy334; break; - case 206: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -{ yylhsminor.yy974 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy569, yymsp[-8].minor.yy974, yymsp[-6].minor.yy974, yymsp[-5].minor.yy946, yymsp[-2].minor.yy946, yymsp[0].minor.yy974); } - yymsp[-9].minor.yy974 = yylhsminor.yy974; + case 202: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ +{ yylhsminor.yy560 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy173, yymsp[-8].minor.yy560, yymsp[-6].minor.yy560, yymsp[-5].minor.yy334, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-9].minor.yy560 = yylhsminor.yy560; break; - case 209: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy974 = createDropTableClause(pCxt, yymsp[-1].minor.yy569, yymsp[0].minor.yy974); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 205: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy560 = createDropTableClause(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 213: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 417: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==417); -{ yymsp[-2].minor.yy946 = yymsp[-1].minor.yy946; } + case 209: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 411: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==411); +{ yymsp[-2].minor.yy334 = yymsp[-1].minor.yy334; } break; - case 214: /* full_table_name ::= table_name */ - case 358: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==358); -{ yylhsminor.yy974 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy557, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 210: /* full_table_name ::= table_name */ + case 352: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==352); +{ yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy533, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 215: /* full_table_name ::= db_name NK_DOT table_name */ - case 359: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==359); -{ yylhsminor.yy974 = createRealTableNode(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557, NULL); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 211: /* full_table_name ::= db_name NK_DOT table_name */ + case 353: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==353); +{ yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 218: /* tag_def ::= column_name type_name */ -{ yylhsminor.yy974 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy557, yymsp[0].minor.yy424, NULL); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 214: /* tag_def ::= column_name type_name */ +{ yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952, NULL); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 221: /* column_def ::= column_name type_name column_options */ -{ yylhsminor.yy974 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy557, yymsp[-1].minor.yy424, yymsp[0].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 217: /* column_def ::= column_name type_name column_options */ +{ yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy952, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 222: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 218: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 223: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 219: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 224: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 220: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 225: /* type_name ::= INT */ - case 226: /* type_name ::= INTEGER */ yytestcase(yyruleno==226); -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_INT); } + case 221: /* type_name ::= INT */ + case 222: /* type_name ::= INTEGER */ yytestcase(yyruleno==222); +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 227: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 223: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 228: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 224: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 229: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 225: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 230: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 226: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 231: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 227: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 232: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 228: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 233: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy424 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 229: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 234: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy424 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 230: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 235: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy424 = createDataType(TSDB_DATA_TYPE_UINT); } + case 231: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 236: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy424 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 232: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 237: /* type_name ::= JSON */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_JSON); } + case 233: /* type_name ::= JSON */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 238: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 234: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 239: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 235: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 240: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 236: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 241: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 237: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 242: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } + case 238: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; - case 243: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy424 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 239: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 244: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy424 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 240: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 245: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy424 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 241: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 246: /* type_name_default_len ::= BINARY */ -{ yymsp[0].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } + case 242: /* type_name_default_len ::= BINARY */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } break; - case 247: /* type_name_default_len ::= NCHAR */ -{ yymsp[0].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } + case 243: /* type_name_default_len ::= NCHAR */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } break; - case 248: /* type_name_default_len ::= VARCHAR */ -{ yymsp[0].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } + case 244: /* type_name_default_len ::= VARCHAR */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } break; - case 249: /* type_name_default_len ::= VARBINARY */ -{ yymsp[0].minor.yy424 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } + case 245: /* type_name_default_len ::= VARBINARY */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } break; - case 252: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - case 425: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==425); -{ yymsp[-3].minor.yy946 = yymsp[-1].minor.yy946; } + case 248: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + case 419: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==419); +{ yymsp[-3].minor.yy334 = yymsp[-1].minor.yy334; } break; - case 253: /* table_options ::= */ -{ yymsp[1].minor.yy974 = createDefaultTableOptions(pCxt); } + case 249: /* table_options ::= */ +{ yymsp[1].minor.yy560 = createDefaultTableOptions(pCxt); } break; - case 254: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-2].minor.yy974, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 250: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 255: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-2].minor.yy974, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy946); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 251: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 256: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-2].minor.yy974, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy946); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 252: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 257: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-4].minor.yy974, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy946); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 253: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy334); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 258: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-2].minor.yy974, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 254: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 259: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-4].minor.yy974, TABLE_OPTION_SMA, yymsp[-1].minor.yy946); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 255: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_SMA, yymsp[-1].minor.yy334); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 260: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-2].minor.yy974, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy946); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 256: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 261: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy974 = createAlterTableOptions(pCxt); yylhsminor.yy974 = setTableOption(pCxt, yylhsminor.yy974, yymsp[0].minor.yy683.type, &yymsp[0].minor.yy683.val); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 257: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy560 = createAlterTableOptions(pCxt); yylhsminor.yy560 = setTableOption(pCxt, yylhsminor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 262: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy974 = setTableOption(pCxt, yymsp[-1].minor.yy974, yymsp[0].minor.yy683.type, &yymsp[0].minor.yy683.val); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 258: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy560 = setTableOption(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 263: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy683.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 259: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy389.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 264: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy683.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy683.val = yymsp[0].minor.yy0; } + case 260: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy389.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } break; - case 265: /* duration_list ::= duration_literal */ - case 554: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==554); -{ yylhsminor.yy946 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } - yymsp[0].minor.yy946 = yylhsminor.yy946; + case 261: /* duration_list ::= duration_literal */ + case 548: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==548); +{ yylhsminor.yy334 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; - case 266: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 555: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==555); -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; + case 262: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 549: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==549); +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; break; - case 269: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy974 = createFunctionNode(pCxt, &yymsp[0].minor.yy557, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 265: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy533, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 270: /* rollup_func_name ::= FIRST */ - case 271: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==271); - case 347: /* tag_item ::= QTAGS */ yytestcase(yyruleno==347); -{ yylhsminor.yy974 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 266: /* rollup_func_name ::= FIRST */ + case 267: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==267); + case 341: /* tag_item ::= QTAGS */ yytestcase(yyruleno==341); +{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 274: /* col_name ::= column_name */ - case 348: /* tag_item ::= column_name */ yytestcase(yyruleno==348); -{ yylhsminor.yy974 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 270: /* col_name ::= column_name */ + case 342: /* tag_item ::= column_name */ yytestcase(yyruleno==342); +{ yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 275: /* cmd ::= SHOW DNODES */ + case 271: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 276: /* cmd ::= SHOW USERS */ + case 272: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 277: /* cmd ::= SHOW USERS FULL */ + case 273: /* cmd ::= SHOW USERS FULL */ { pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } break; - case 278: /* cmd ::= SHOW USER PRIVILEGES */ + case 274: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 279: /* cmd ::= SHOW db_kind_opt DATABASES */ + case 275: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - (void)setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy741); + (void)setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy537); } break; - case 280: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + case 276: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy595, yymsp[0].minor.yy974, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy709, yymsp[0].minor.yy560, OP_TYPE_LIKE); } break; - case 281: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy974, yymsp[0].minor.yy974, OP_TYPE_LIKE); } + case 277: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); } break; - case 282: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy974, NULL, OP_TYPE_LIKE); } + case 278: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy560, NULL, OP_TYPE_LIKE); } break; - case 283: /* cmd ::= SHOW MNODES */ + case 279: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 284: /* cmd ::= SHOW QNODES */ + case 280: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 285: /* cmd ::= SHOW ANODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_STMT); } - break; - case 286: /* cmd ::= SHOW ANODES FULL */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_FULL_STMT); } - break; - case 287: /* cmd ::= SHOW ARBGROUPS */ + case 281: /* cmd ::= SHOW ARBGROUPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } break; - case 288: /* cmd ::= SHOW FUNCTIONS */ + case 282: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 289: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy974, yymsp[-1].minor.yy974, OP_TYPE_EQUAL); } + case 283: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy560, yymsp[-1].minor.yy560, OP_TYPE_EQUAL); } break; - case 290: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy557), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy557), OP_TYPE_EQUAL); } + case 284: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), OP_TYPE_EQUAL); } break; - case 291: /* cmd ::= SHOW STREAMS */ + case 285: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 292: /* cmd ::= SHOW ACCOUNTS */ + case 286: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 293: /* cmd ::= SHOW APPS */ + case 287: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 294: /* cmd ::= SHOW CONNECTIONS */ + case 288: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 295: /* cmd ::= SHOW LICENCES */ - case 296: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==296); + case 289: /* cmd ::= SHOW LICENCES */ + case 290: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==290); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 297: /* cmd ::= SHOW GRANTS FULL */ + case 291: /* cmd ::= SHOW GRANTS FULL */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } break; - case 298: /* cmd ::= SHOW GRANTS LOGS */ + case 292: /* cmd ::= SHOW GRANTS LOGS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } break; - case 299: /* cmd ::= SHOW CLUSTER MACHINES */ + case 293: /* cmd ::= SHOW CLUSTER MACHINES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } break; - case 300: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy557); } + case 294: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 301: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy974); } + case 295: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy560); } break; - case 302: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 296: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, -yymsp[0].minor.yy974); } +yymsp[0].minor.yy560); } break; - case 303: /* cmd ::= SHOW ENCRYPTIONS */ + case 297: /* cmd ::= SHOW ENCRYPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } break; - case 304: /* cmd ::= SHOW QUERIES */ + case 298: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 305: /* cmd ::= SHOW SCORES */ + case 299: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 306: /* cmd ::= SHOW TOPICS */ + case 300: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 307: /* cmd ::= SHOW VARIABLES */ - case 308: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==308); + case 301: /* cmd ::= SHOW VARIABLES */ + case 302: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==302); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 309: /* cmd ::= SHOW LOCAL VARIABLES */ + case 303: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 310: /* 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.yy974); } + case 304: /* 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.yy560); } break; - case 311: /* cmd ::= SHOW BNODES */ + case 305: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 312: /* cmd ::= SHOW SNODES */ + case 306: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 313: /* cmd ::= SHOW CLUSTER */ + case 307: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 314: /* cmd ::= SHOW TRANSACTIONS */ + case 308: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 315: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy974); } + case 309: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy560); } break; - case 316: /* cmd ::= SHOW CONSUMERS */ + case 310: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 317: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 311: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 318: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy974, yymsp[-1].minor.yy974, OP_TYPE_EQUAL); } + case 312: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy560, yymsp[-1].minor.yy560, OP_TYPE_EQUAL); } break; - case 319: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy557), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy557), OP_TYPE_EQUAL); } + case 313: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), OP_TYPE_EQUAL); } break; - case 320: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy974, yymsp[0].minor.yy974, yymsp[-3].minor.yy946); } + case 314: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560, yymsp[-3].minor.yy334); } break; - case 321: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy557), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy557), yymsp[-4].minor.yy946); } + case 315: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), yymsp[-4].minor.yy334); } break; - case 322: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 316: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 323: /* cmd ::= SHOW VNODES */ + case 317: /* cmd ::= SHOW VNODES */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; - case 324: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy974, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 318: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy560, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 325: /* cmd ::= SHOW CLUSTER ALIVE */ + case 319: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 326: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy974, yymsp[0].minor.yy974, OP_TYPE_LIKE); } + case 320: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); } break; - case 327: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy974); } + case 321: /* cmd ::= SHOW CREATE VIEW full_table_name */ +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy560); } break; - case 328: /* cmd ::= SHOW COMPACTS */ + case 322: /* cmd ::= SHOW COMPACTS */ { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } break; - case 329: /* cmd ::= SHOW COMPACT NK_INTEGER */ + case 323: /* cmd ::= SHOW COMPACT NK_INTEGER */ { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 330: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy595.kind = SHOW_KIND_ALL; yymsp[1].minor.yy595.dbName = nil_token; } + case 324: /* table_kind_db_name_cond_opt ::= */ +{ yymsp[1].minor.yy709.kind = SHOW_KIND_ALL; yymsp[1].minor.yy709.dbName = nil_token; } break; - case 331: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy595.kind = yymsp[0].minor.yy741; yylhsminor.yy595.dbName = nil_token; } - yymsp[0].minor.yy595 = yylhsminor.yy595; + case 325: /* table_kind_db_name_cond_opt ::= table_kind */ +{ yylhsminor.yy709.kind = yymsp[0].minor.yy537; yylhsminor.yy709.dbName = nil_token; } + yymsp[0].minor.yy709 = yylhsminor.yy709; break; - case 332: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy595.kind = SHOW_KIND_ALL; yylhsminor.yy595.dbName = yymsp[-1].minor.yy557; } - yymsp[-1].minor.yy595 = yylhsminor.yy595; + case 326: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy709.kind = SHOW_KIND_ALL; yylhsminor.yy709.dbName = yymsp[-1].minor.yy533; } + yymsp[-1].minor.yy709 = yylhsminor.yy709; break; - case 333: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy595.kind = yymsp[-2].minor.yy741; yylhsminor.yy595.dbName = yymsp[-1].minor.yy557; } - yymsp[-2].minor.yy595 = yylhsminor.yy595; + case 327: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +{ yylhsminor.yy709.kind = yymsp[-2].minor.yy537; yylhsminor.yy709.dbName = yymsp[-1].minor.yy533; } + yymsp[-2].minor.yy709 = yylhsminor.yy709; break; - case 334: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy741 = SHOW_KIND_TABLES_NORMAL; } + case 328: /* table_kind ::= NORMAL */ +{ yymsp[0].minor.yy537 = SHOW_KIND_TABLES_NORMAL; } break; - case 335: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy741 = SHOW_KIND_TABLES_CHILD; } + case 329: /* table_kind ::= CHILD */ +{ yymsp[0].minor.yy537 = SHOW_KIND_TABLES_CHILD; } break; - case 336: /* db_name_cond_opt ::= */ - case 341: /* from_db_opt ::= */ yytestcase(yyruleno==341); -{ yymsp[1].minor.yy974 = createDefaultDatabaseCondValue(pCxt); } + case 330: /* db_name_cond_opt ::= */ + case 335: /* from_db_opt ::= */ yytestcase(yyruleno==335); +{ yymsp[1].minor.yy560 = createDefaultDatabaseCondValue(pCxt); } break; - case 337: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy974 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy557); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 331: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy560 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 339: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 333: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 340: /* table_name_cond ::= table_name */ -{ yylhsminor.yy974 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 334: /* table_name_cond ::= table_name */ +{ yylhsminor.yy560 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 342: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy974 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy557); } + case 336: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy560 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533); } break; - case 346: /* tag_item ::= TBNAME */ -{ yylhsminor.yy974 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 340: /* tag_item ::= TBNAME */ +{ yylhsminor.yy560 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 349: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy974 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy557), &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 343: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy560 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy533), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 350: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy974 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy557), &yymsp[0].minor.yy557); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 344: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy560 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy533), &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 351: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy741 = SHOW_KIND_ALL; } + case 345: /* db_kind_opt ::= */ +{ yymsp[1].minor.yy537 = SHOW_KIND_ALL; } break; - case 352: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy741 = SHOW_KIND_DATABASES_USER; } + case 346: /* db_kind_opt ::= USER */ +{ yymsp[0].minor.yy537 = SHOW_KIND_DATABASES_USER; } break; - case 353: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy741 = SHOW_KIND_DATABASES_SYSTEM; } + case 347: /* db_kind_opt ::= SYSTEM */ +{ yymsp[0].minor.yy537 = SHOW_KIND_DATABASES_SYSTEM; } break; - case 354: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy569, &yymsp[-7].minor.yy557, yymsp[-4].minor.yy974, yymsp[-5].minor.yy974, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } + case 348: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy173, &yymsp[-7].minor.yy533, yymsp[-4].minor.yy560, yymsp[-5].minor.yy560, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 355: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy569, &yymsp[-6].minor.yy557, NULL, yymsp[-4].minor.yy974, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } + case 349: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy173, &yymsp[-6].minor.yy533, NULL, yymsp[-4].minor.yy560, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 356: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ -{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy569, yymsp[0].minor.yy974); } + case 350: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ +{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } break; - case 357: /* cmd ::= SHOW db_name_cond_opt TSMAS */ -{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy974); } + case 351: /* cmd ::= SHOW db_name_cond_opt TSMAS */ +{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy560); } break; - case 360: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ -{ yymsp[-3].minor.yy974 = createTSMAOptions(pCxt, yymsp[-1].minor.yy946); } + case 354: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ +{ yymsp[-3].minor.yy560 = createTSMAOptions(pCxt, yymsp[-1].minor.yy334); } break; - case 361: /* 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.yy569, yymsp[-3].minor.yy974, yymsp[-1].minor.yy974, NULL, yymsp[0].minor.yy974); } + case 355: /* 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.yy173, yymsp[-3].minor.yy560, yymsp[-1].minor.yy560, NULL, yymsp[0].minor.yy560); } break; - case 362: /* 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.yy569, yymsp[-5].minor.yy974, yymsp[-3].minor.yy974, yymsp[-1].minor.yy946, NULL); } + case 356: /* 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.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy560, yymsp[-1].minor.yy334, NULL); } break; - case 363: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy569, yymsp[0].minor.yy974); } + case 357: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } break; - case 364: /* full_index_name ::= index_name */ -{ yylhsminor.yy974 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 358: /* full_index_name ::= index_name */ +{ yylhsminor.yy560 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 365: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy974 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 359: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy560 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 366: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy974 = createIndexOption(pCxt, yymsp[-7].minor.yy946, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), NULL, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 360: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy560 = createIndexOption(pCxt, yymsp[-7].minor.yy334, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 367: /* 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.yy974 = createIndexOption(pCxt, yymsp[-9].minor.yy946, releaseRawExprNode(pCxt, yymsp[-5].minor.yy974), releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 361: /* 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.yy560 = createIndexOption(pCxt, yymsp[-9].minor.yy334, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 370: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy974 = createFunctionNode(pCxt, &yymsp[-3].minor.yy557, yymsp[-1].minor.yy946); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 364: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy334); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 371: /* sma_func_name ::= function_name */ - case 666: /* alias_opt ::= table_alias */ yytestcase(yyruleno==666); -{ yylhsminor.yy557 = yymsp[0].minor.yy557; } - yymsp[0].minor.yy557 = yylhsminor.yy557; + case 365: /* sma_func_name ::= function_name */ + case 657: /* alias_opt ::= table_alias */ yytestcase(yyruleno==657); +{ yylhsminor.yy533 = yymsp[0].minor.yy533; } + yymsp[0].minor.yy533 = yylhsminor.yy533; break; - case 376: /* sma_stream_opt ::= */ - case 426: /* stream_options ::= */ yytestcase(yyruleno==426); -{ yymsp[1].minor.yy974 = createStreamOptions(pCxt); } + case 370: /* sma_stream_opt ::= */ + case 420: /* stream_options ::= */ yytestcase(yyruleno==420); +{ yymsp[1].minor.yy560 = createStreamOptions(pCxt); } break; - case 377: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy974)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy974); yylhsminor.yy974 = yymsp[-2].minor.yy974; } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 371: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy560)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 378: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy974)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy974); yylhsminor.yy974 = yymsp[-2].minor.yy974; } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 372: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy560)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 379: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy974)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy974); yylhsminor.yy974 = yymsp[-2].minor.yy974; } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 373: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy560)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 380: /* with_meta ::= AS */ -{ yymsp[0].minor.yy904 = 0; } + case 374: /* with_meta ::= AS */ +{ yymsp[0].minor.yy802 = 0; } break; - case 381: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy904 = 1; } + case 375: /* with_meta ::= WITH META AS */ +{ yymsp[-2].minor.yy802 = 1; } break; - case 382: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy904 = 2; } + case 376: /* with_meta ::= ONLY META AS */ +{ yymsp[-2].minor.yy802 = 2; } break; - case 383: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy569, &yymsp[-2].minor.yy557, yymsp[0].minor.yy974); } + case 377: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); } break; - case 384: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy569, &yymsp[-3].minor.yy557, &yymsp[0].minor.yy557, yymsp[-2].minor.yy904); } + case 378: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy173, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy533, yymsp[-2].minor.yy802); } break; - case 385: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy569, &yymsp[-4].minor.yy557, yymsp[-1].minor.yy974, yymsp[-3].minor.yy904, yymsp[0].minor.yy974); } + case 379: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy173, &yymsp[-4].minor.yy533, yymsp[-1].minor.yy560, yymsp[-3].minor.yy802, yymsp[0].minor.yy560); } break; - case 386: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 380: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 387: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy569, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557); } + case 381: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } break; - case 388: /* cmd ::= DESC full_table_name */ - case 389: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==389); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy974); } + case 382: /* cmd ::= DESC full_table_name */ + case 383: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==383); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy560); } break; - case 390: /* cmd ::= RESET QUERY CACHE */ + case 384: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 391: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 392: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==392); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy569, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 385: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 386: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==386); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 395: /* explain_options ::= */ -{ yymsp[1].minor.yy974 = createDefaultExplainOptions(pCxt); } + case 389: /* explain_options ::= */ +{ yymsp[1].minor.yy560 = createDefaultExplainOptions(pCxt); } break; - case 396: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy974 = setExplainVerbose(pCxt, yymsp[-2].minor.yy974, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 390: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy560 = setExplainVerbose(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 397: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy974 = setExplainRatio(pCxt, yymsp[-2].minor.yy974, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 391: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy560 = setExplainRatio(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 398: /* 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.yy569, yymsp[-9].minor.yy569, &yymsp[-6].minor.yy557, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy424, yymsp[-1].minor.yy904, &yymsp[0].minor.yy557, yymsp[-10].minor.yy569); } + case 392: /* 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.yy173, yymsp[-9].minor.yy173, &yymsp[-6].minor.yy533, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy952, yymsp[-1].minor.yy802, &yymsp[0].minor.yy533, yymsp[-10].minor.yy173); } break; - case 399: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 393: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 404: /* language_opt ::= */ - case 449: /* on_vgroup_id ::= */ yytestcase(yyruleno==449); -{ yymsp[1].minor.yy557 = nil_token; } + case 398: /* language_opt ::= */ + case 443: /* on_vgroup_id ::= */ yytestcase(yyruleno==443); +{ yymsp[1].minor.yy533 = nil_token; } break; - case 405: /* language_opt ::= LANGUAGE NK_STRING */ - case 450: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==450); -{ yymsp[-1].minor.yy557 = yymsp[0].minor.yy0; } + case 399: /* language_opt ::= LANGUAGE NK_STRING */ + case 444: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==444); +{ yymsp[-1].minor.yy533 = yymsp[0].minor.yy0; } break; - case 408: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy569, yymsp[-2].minor.yy974, &yymsp[-1].minor.yy0, yymsp[0].minor.yy974); } + case 402: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy173, yymsp[-2].minor.yy560, &yymsp[-1].minor.yy0, yymsp[0].minor.yy560); } break; - case 409: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy569, yymsp[0].minor.yy974); } + case 403: /* cmd ::= DROP VIEW exists_opt full_view_name */ +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } break; - case 410: /* full_view_name ::= view_name */ -{ yylhsminor.yy974 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 404: /* full_view_name ::= view_name */ +{ yylhsminor.yy560 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 411: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy974 = createViewNode(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 405: /* full_view_name ::= db_name NK_DOT view_name */ +{ yylhsminor.yy560 = createViewNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 412: /* 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.yy569, &yymsp[-8].minor.yy557, yymsp[-5].minor.yy974, yymsp[-7].minor.yy974, yymsp[-3].minor.yy946, yymsp[-2].minor.yy974, yymsp[0].minor.yy974, yymsp[-4].minor.yy946); } + case 406: /* 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.yy173, &yymsp[-8].minor.yy533, yymsp[-5].minor.yy560, yymsp[-7].minor.yy560, yymsp[-3].minor.yy334, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, yymsp[-4].minor.yy334); } break; - case 413: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 407: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 414: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 408: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 415: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy569, yymsp[-1].minor.yy569, &yymsp[0].minor.yy557); } + case 409: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } break; - case 420: /* column_stream_def ::= column_name stream_col_options */ -{ yylhsminor.yy974 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy557, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy974); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 414: /* column_stream_def ::= column_name stream_col_options */ +{ yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy533, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 421: /* stream_col_options ::= */ - case 781: /* column_options ::= */ yytestcase(yyruleno==781); -{ yymsp[1].minor.yy974 = createDefaultColumnOptions(pCxt); } + case 415: /* stream_col_options ::= */ + case 770: /* column_options ::= */ yytestcase(yyruleno==770); +{ yymsp[1].minor.yy560 = createDefaultColumnOptions(pCxt); } break; - case 422: /* stream_col_options ::= stream_col_options PRIMARY KEY */ - case 782: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==782); -{ yylhsminor.yy974 = setColumnOptionsPK(pCxt, yymsp[-2].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 416: /* stream_col_options ::= stream_col_options PRIMARY KEY */ + case 771: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==771); +{ yylhsminor.yy560 = setColumnOptionsPK(pCxt, yymsp[-2].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 427: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 428: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==428); -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-2].minor.yy974, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 421: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 422: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==422); +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 429: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-3].minor.yy974, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 423: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 430: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-2].minor.yy974, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 424: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 431: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-3].minor.yy974, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 425: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 432: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-2].minor.yy974, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 426: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 433: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-2].minor.yy974, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 427: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 434: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy974 = setStreamOptions(pCxt, yymsp[-3].minor.yy974, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 428: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 436: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 725: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==725); - case 749: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==749); -{ yymsp[-3].minor.yy974 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy974); } + case 430: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 714: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==714); + case 738: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==738); +{ yymsp[-3].minor.yy560 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy560); } break; - case 439: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 433: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 440: /* cmd ::= KILL QUERY NK_STRING */ + case 434: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 441: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 435: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 442: /* cmd ::= KILL COMPACT NK_INTEGER */ + case 436: /* cmd ::= KILL COMPACT NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } break; - case 443: /* cmd ::= BALANCE VGROUP */ + case 437: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 444: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy557); } + case 438: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 445: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ -{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy557); } + case 439: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ +{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy533); } break; - case 446: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 440: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 447: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy946); } + case 441: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy334); } break; - case 448: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 442: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 451: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy946 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 445: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 453: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 447: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 456: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy974 = createInsertStmt(pCxt, yymsp[-4].minor.yy974, yymsp[-2].minor.yy946, yymsp[0].minor.yy974); } + case 450: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy560 = createInsertStmt(pCxt, yymsp[-4].minor.yy560, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } break; - case 457: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy974 = createInsertStmt(pCxt, yymsp[-1].minor.yy974, NULL, yymsp[0].minor.yy974); } + case 451: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy560 = createInsertStmt(pCxt, yymsp[-1].minor.yy560, NULL, yymsp[0].minor.yy560); } break; - case 458: /* tags_literal ::= NK_INTEGER */ - case 470: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==470); - case 479: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==479); -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 452: /* tags_literal ::= NK_INTEGER */ + case 464: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==464); + case 473: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==473); +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 459: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - case 460: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==460); - case 471: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==471); - case 472: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==472); - case 480: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==480); - case 481: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==481); - case 489: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==489); - case 490: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==490); + case 453: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + case 454: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==454); + case 465: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==465); + case 466: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==466); + case 474: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==474); + case 475: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==475); + case 483: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==483); + case 484: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==484); { SToken l = yymsp[-2].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); l.n = (r.z + r.n) - l.z; - yylhsminor.yy974 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy974); + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy560); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 461: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 464: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==464); - case 473: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==473); - case 476: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==476); - case 482: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==482); - case 485: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==485); + case 455: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 458: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==458); + case 467: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==467); + case 470: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==470); + case 476: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==476); + case 479: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==479); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 462: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - case 463: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==463); - case 465: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==465); - case 466: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==466); - case 474: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==474); - case 475: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==475); - case 477: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==477); - case 478: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==478); - case 483: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==483); - case 484: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==484); - case 486: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==486); - case 487: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==487); + case 456: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + case 457: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==457); + case 459: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==459); + case 460: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==460); + case 468: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==468); + case 469: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==469); + case 471: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==471); + case 472: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==472); + case 477: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==477); + case 478: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==478); + case 480: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==480); + case 481: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==481); { SToken l = yymsp[-3].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); l.n = (r.z + r.n) - l.z; - yylhsminor.yy974 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy974); + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy560); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 467: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 461: /* tags_literal ::= NK_FLOAT */ +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 468: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 469: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==469); + case 462: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 463: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==463); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 488: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 482: /* tags_literal ::= NK_STRING */ +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 491: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 485: /* tags_literal ::= NK_BOOL */ +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 492: /* tags_literal ::= NULL */ -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 486: /* tags_literal ::= NULL */ +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 493: /* tags_literal ::= literal_func */ -{ yylhsminor.yy974 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy974); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 487: /* tags_literal ::= literal_func */ +{ yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy560); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 494: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 495: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==495); + case 488: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 489: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==489); { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); l.n = (r.z + r.n) - l.z; - yylhsminor.yy974 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy974, yymsp[0].minor.yy974); + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 498: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 492: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 499: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 493: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 500: /* literal ::= NK_STRING */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 494: /* literal ::= NK_STRING */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 501: /* literal ::= NK_BOOL */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 495: /* literal ::= NK_BOOL */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 502: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 496: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 503: /* literal ::= duration_literal */ - case 513: /* signed_literal ::= signed */ yytestcase(yyruleno==513); - case 537: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==537); - case 538: /* expression ::= literal */ yytestcase(yyruleno==538); - case 540: /* expression ::= column_reference */ yytestcase(yyruleno==540); - case 541: /* expression ::= function_expression */ yytestcase(yyruleno==541); - case 542: /* expression ::= case_when_expression */ yytestcase(yyruleno==542); - case 588: /* function_expression ::= literal_func */ yytestcase(yyruleno==588); - case 589: /* function_expression ::= rand_func */ yytestcase(yyruleno==589); - case 647: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==647); - case 651: /* boolean_primary ::= predicate */ yytestcase(yyruleno==651); - case 653: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==653); - case 654: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==654); - case 657: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==657); - case 659: /* table_reference ::= table_primary */ yytestcase(yyruleno==659); - case 660: /* table_reference ::= joined_table */ yytestcase(yyruleno==660); - case 664: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==664); - case 751: /* query_simple ::= query_specification */ yytestcase(yyruleno==751); - case 752: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==752); - case 755: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==755); - case 757: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==757); -{ yylhsminor.yy974 = yymsp[0].minor.yy974; } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 497: /* literal ::= duration_literal */ + case 507: /* signed_literal ::= signed */ yytestcase(yyruleno==507); + case 531: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==531); + case 532: /* expression ::= literal */ yytestcase(yyruleno==532); + case 534: /* expression ::= column_reference */ yytestcase(yyruleno==534); + case 535: /* expression ::= function_expression */ yytestcase(yyruleno==535); + case 536: /* expression ::= case_when_expression */ yytestcase(yyruleno==536); + case 579: /* function_expression ::= literal_func */ yytestcase(yyruleno==579); + case 580: /* function_expression ::= rand_func */ yytestcase(yyruleno==580); + case 638: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==638); + case 642: /* boolean_primary ::= predicate */ yytestcase(yyruleno==642); + case 644: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==644); + case 645: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==645); + case 648: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==648); + case 650: /* table_reference ::= table_primary */ yytestcase(yyruleno==650); + case 651: /* table_reference ::= joined_table */ yytestcase(yyruleno==651); + case 655: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==655); + case 740: /* query_simple ::= query_specification */ yytestcase(yyruleno==740); + case 741: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==741); + case 744: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==744); + case 746: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==746); +{ yylhsminor.yy560 = yymsp[0].minor.yy560; } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 504: /* literal ::= NULL */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 498: /* literal ::= NULL */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 505: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 499: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 506: /* duration_literal ::= NK_VARIABLE */ - case 726: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==726); - case 727: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==727); - case 728: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==728); -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 500: /* duration_literal ::= NK_VARIABLE */ + case 715: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==715); + case 716: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==716); + case 717: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==717); +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 507: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 501: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 508: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 502: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 509: /* signed ::= NK_MINUS NK_INTEGER */ + case 503: /* 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.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 510: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 504: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 511: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 505: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 512: /* signed ::= NK_MINUS NK_FLOAT */ + case 506: /* 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.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 514: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 508: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 515: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 509: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 516: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 510: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 517: /* signed_literal ::= duration_literal */ - case 519: /* signed_literal ::= literal_func */ yytestcase(yyruleno==519); - case 618: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==618); - case 701: /* select_item ::= common_expression */ yytestcase(yyruleno==701); - case 711: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==711); - case 756: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==756); - case 758: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==758); - case 771: /* search_condition ::= common_expression */ yytestcase(yyruleno==771); -{ yylhsminor.yy974 = releaseRawExprNode(pCxt, yymsp[0].minor.yy974); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 511: /* signed_literal ::= duration_literal */ + case 513: /* signed_literal ::= literal_func */ yytestcase(yyruleno==513); + case 609: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==609); + case 692: /* select_item ::= common_expression */ yytestcase(yyruleno==692); + case 702: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==702); + case 745: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==745); + case 747: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==747); + case 760: /* search_condition ::= common_expression */ yytestcase(yyruleno==760); +{ yylhsminor.yy560 = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 518: /* signed_literal ::= NULL */ -{ yylhsminor.yy974 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 512: /* signed_literal ::= NULL */ +{ yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 520: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy974 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 514: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy560 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 539: /* expression ::= pseudo_column */ -{ yylhsminor.yy974 = yymsp[0].minor.yy974; (void)setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy974, true); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 533: /* expression ::= pseudo_column */ +{ yylhsminor.yy560 = yymsp[0].minor.yy560; (void)setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy560, true); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 543: /* expression ::= NK_LP expression NK_RP */ - case 652: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==652); - case 770: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==770); -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 537: /* expression ::= NK_LP expression NK_RP */ + case 643: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==643); + case 759: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==759); +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 544: /* expression ::= NK_PLUS expr_or_subquery */ + case 538: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 545: /* expression ::= NK_MINUS expr_or_subquery */ + case 539: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy974), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL)); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 546: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 540: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 547: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 541: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 548: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 542: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 549: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 543: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 550: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 544: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 551: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 545: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 552: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 546: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 553: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 547: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 556: /* column_reference ::= column_name */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy557, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy557)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 550: /* column_reference ::= column_name */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy533, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 557: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557, createColumnNode(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy557)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 551: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 558: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 552: /* column_reference ::= NK_ALIAS */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 559: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 553: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 560: /* pseudo_column ::= ROWTS */ - case 561: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==561); - case 563: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==563); - case 564: /* pseudo_column ::= QEND */ yytestcase(yyruleno==564); - case 565: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==565); - case 566: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==566); - case 567: /* pseudo_column ::= WEND */ yytestcase(yyruleno==567); - case 568: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==568); - case 569: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==569); - case 570: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==570); - case 571: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==571); - case 572: /* pseudo_column ::= FLOW */ yytestcase(yyruleno==572); - case 573: /* pseudo_column ::= FHIGH */ yytestcase(yyruleno==573); - case 574: /* pseudo_column ::= FROWTS */ yytestcase(yyruleno==574); - case 591: /* literal_func ::= NOW */ yytestcase(yyruleno==591); - case 592: /* literal_func ::= TODAY */ yytestcase(yyruleno==592); -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 554: /* pseudo_column ::= ROWTS */ + case 555: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==555); + case 557: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==557); + case 558: /* pseudo_column ::= QEND */ yytestcase(yyruleno==558); + case 559: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==559); + case 560: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==560); + case 561: /* pseudo_column ::= WEND */ yytestcase(yyruleno==561); + case 562: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==562); + case 563: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==563); + case 564: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==564); + case 565: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==565); + case 582: /* literal_func ::= NOW */ yytestcase(yyruleno==582); + case 583: /* literal_func ::= TODAY */ yytestcase(yyruleno==583); +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 562: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy557)))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 556: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy533)))); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 575: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 576: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==576); - case 584: /* function_expression ::= substr_func NK_LP expression_list NK_RP */ yytestcase(yyruleno==584); -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy557, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy557, yymsp[-1].minor.yy946)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 566: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 567: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==567); + case 575: /* function_expression ::= substr_func NK_LP expression_list NK_RP */ yytestcase(yyruleno==575); +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy334)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 577: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - case 578: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==578); -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), yymsp[-1].minor.yy424)); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 568: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 569: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==569); +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy952)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 579: /* function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createPositionFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974))); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 570: /* function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createPositionFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 580: /* function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), TRIM_TYPE_BOTH)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 571: /* function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), TRIM_TYPE_BOTH)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 581: /* function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), yymsp[-3].minor.yy300)); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 572: /* function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), yymsp[-3].minor.yy672)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 582: /* function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), TRIM_TYPE_BOTH)); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 573: /* function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), TRIM_TYPE_BOTH)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 583: /* function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-6].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), yymsp[-4].minor.yy300)); } - yymsp[-6].minor.yy974 = yylhsminor.yy974; + case 574: /* function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-6].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), yymsp[-4].minor.yy672)); } + yymsp[-6].minor.yy560 = yylhsminor.yy560; break; - case 585: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy557, &yymsp[0].minor.yy0, createSubstrFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974))); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + case 576: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy533, &yymsp[0].minor.yy0, createSubstrFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 586: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-7].minor.yy557, &yymsp[0].minor.yy0, createSubstrFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy974), releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974))); } - yymsp[-7].minor.yy974 = yylhsminor.yy974; + case 577: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-7].minor.yy533, &yymsp[0].minor.yy0, createSubstrFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-7].minor.yy560 = yylhsminor.yy560; break; - case 587: /* function_expression ::= REPLACE NK_LP expression_list NK_RP */ - case 594: /* rand_func ::= RAND NK_LP expression_list NK_RP */ yytestcase(yyruleno==594); -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy946)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 578: /* function_expression ::= REPLACE NK_LP expression_list NK_RP */ + case 585: /* rand_func ::= RAND NK_LP expression_list NK_RP */ yytestcase(yyruleno==585); +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy334)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 590: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy557, NULL)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 581: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy533, NULL)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 593: /* rand_func ::= RAND NK_LP NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy0, NULL)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 584: /* rand_func ::= RAND NK_LP NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy0, NULL)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 597: /* trim_specification_type ::= BOTH */ -{ yymsp[0].minor.yy300 = TRIM_TYPE_BOTH; } + case 588: /* trim_specification_type ::= BOTH */ +{ yymsp[0].minor.yy672 = TRIM_TYPE_BOTH; } break; - case 598: /* trim_specification_type ::= TRAILING */ -{ yymsp[0].minor.yy300 = TRIM_TYPE_TRAILING; } + case 589: /* trim_specification_type ::= TRAILING */ +{ yymsp[0].minor.yy672 = TRIM_TYPE_TRAILING; } break; - case 599: /* trim_specification_type ::= LEADING */ -{ yymsp[0].minor.yy300 = TRIM_TYPE_LEADING; } + case 590: /* trim_specification_type ::= LEADING */ +{ yymsp[0].minor.yy672 = TRIM_TYPE_LEADING; } break; - case 614: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy946 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy946 = yylhsminor.yy946; + case 605: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy334 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; - case 619: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 704: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==704); -{ yylhsminor.yy974 = createColumnNode(pCxt, &yymsp[-2].minor.yy557, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 610: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 695: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==695); +{ yylhsminor.yy560 = createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 620: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy946, yymsp[-1].minor.yy974)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 611: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy334, yymsp[-1].minor.yy560)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 621: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), yymsp[-2].minor.yy946, yymsp[-1].minor.yy974)); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + case 612: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-2].minor.yy334, yymsp[-1].minor.yy560)); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 624: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy974 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974)); } + case 615: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy560 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } break; - case 626: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy974 = releaseRawExprNode(pCxt, yymsp[0].minor.yy974); } + case 617: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy560 = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); } break; - case 627: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 632: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==632); + case 618: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 623: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==623); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy140, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy506, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 628: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 619: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy974), releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-4].minor.yy974 = yylhsminor.yy974; + yymsp[-4].minor.yy560 = yylhsminor.yy560; break; - case 629: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 620: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy974), releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-5].minor.yy974 = yylhsminor.yy974; + yymsp[-5].minor.yy560 = yylhsminor.yy560; break; - case 630: /* predicate ::= expr_or_subquery IS NULL */ + case 621: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), NULL)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 631: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 622: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL)); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 633: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy140 = OP_TYPE_LOWER_THAN; } + case 624: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy506 = OP_TYPE_LOWER_THAN; } break; - case 634: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy140 = OP_TYPE_GREATER_THAN; } + case 625: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy506 = OP_TYPE_GREATER_THAN; } break; - case 635: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy140 = OP_TYPE_LOWER_EQUAL; } + case 626: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy506 = OP_TYPE_LOWER_EQUAL; } break; - case 636: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy140 = OP_TYPE_GREATER_EQUAL; } + case 627: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy506 = OP_TYPE_GREATER_EQUAL; } break; - case 637: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy140 = OP_TYPE_NOT_EQUAL; } + case 628: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy506 = OP_TYPE_NOT_EQUAL; } break; - case 638: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy140 = OP_TYPE_EQUAL; } + case 629: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy506 = OP_TYPE_EQUAL; } break; - case 639: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy140 = OP_TYPE_LIKE; } + case 630: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy506 = OP_TYPE_LIKE; } break; - case 640: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy140 = OP_TYPE_NOT_LIKE; } + case 631: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy506 = OP_TYPE_NOT_LIKE; } break; - case 641: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy140 = OP_TYPE_MATCH; } + case 632: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy506 = OP_TYPE_MATCH; } break; - case 642: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy140 = OP_TYPE_NMATCH; } + case 633: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy506 = OP_TYPE_NMATCH; } break; - case 643: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy140 = OP_TYPE_JSON_CONTAINS; } + case 634: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy506 = OP_TYPE_JSON_CONTAINS; } break; - case 644: /* in_op ::= IN */ -{ yymsp[0].minor.yy140 = OP_TYPE_IN; } + case 635: /* in_op ::= IN */ +{ yymsp[0].minor.yy506 = OP_TYPE_IN; } break; - case 645: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy140 = OP_TYPE_NOT_IN; } + case 636: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy506 = OP_TYPE_NOT_IN; } break; - case 646: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy946)); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 637: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 648: /* boolean_value_expression ::= NOT boolean_primary */ + case 639: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy974), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL)); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 649: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 640: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 650: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 641: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy974); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy974); - yylhsminor.yy974 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 658: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy974 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy974, yymsp[0].minor.yy974, NULL); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 649: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy560 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 661: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy974 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 652: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 662: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy974 = createRealTableNode(pCxt, &yymsp[-3].minor.yy557, &yymsp[-1].minor.yy557, &yymsp[0].minor.yy557); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 653: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-3].minor.yy533, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 663: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy974 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 654: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy560 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 665: /* alias_opt ::= */ -{ yymsp[1].minor.yy557 = nil_token; } + case 656: /* alias_opt ::= */ +{ yymsp[1].minor.yy533 = nil_token; } break; - case 667: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy557 = yymsp[0].minor.yy557; } + case 658: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy533 = yymsp[0].minor.yy533; } break; - case 668: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 669: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==669); -{ yymsp[-2].minor.yy974 = yymsp[-1].minor.yy974; } + case 659: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 660: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==660); +{ yymsp[-2].minor.yy560 = yymsp[-1].minor.yy560; } break; - case 670: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + case 661: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ { - yylhsminor.yy974 = createJoinTableNode(pCxt, yymsp[-6].minor.yy792, yymsp[-5].minor.yy744, yymsp[-7].minor.yy974, yymsp[-3].minor.yy974, yymsp[-2].minor.yy974); - yylhsminor.yy974 = addWindowOffsetClause(pCxt, yylhsminor.yy974, yymsp[-1].minor.yy974); - yylhsminor.yy974 = addJLimitClause(pCxt, yylhsminor.yy974, yymsp[0].minor.yy974); + yylhsminor.yy560 = createJoinTableNode(pCxt, yymsp[-6].minor.yy36, yymsp[-5].minor.yy648, yymsp[-7].minor.yy560, yymsp[-3].minor.yy560, yymsp[-2].minor.yy560); + yylhsminor.yy560 = addWindowOffsetClause(pCxt, yylhsminor.yy560, yymsp[-1].minor.yy560); + yylhsminor.yy560 = addJLimitClause(pCxt, yylhsminor.yy560, yymsp[0].minor.yy560); } - yymsp[-7].minor.yy974 = yylhsminor.yy974; + yymsp[-7].minor.yy560 = yylhsminor.yy560; break; - case 671: /* join_type ::= */ -{ yymsp[1].minor.yy792 = JOIN_TYPE_INNER; } + case 662: /* join_type ::= */ +{ yymsp[1].minor.yy36 = JOIN_TYPE_INNER; } break; - case 672: /* join_type ::= INNER */ -{ yymsp[0].minor.yy792 = JOIN_TYPE_INNER; } + case 663: /* join_type ::= INNER */ +{ yymsp[0].minor.yy36 = JOIN_TYPE_INNER; } break; - case 673: /* join_type ::= LEFT */ -{ yymsp[0].minor.yy792 = JOIN_TYPE_LEFT; } + case 664: /* join_type ::= LEFT */ +{ yymsp[0].minor.yy36 = JOIN_TYPE_LEFT; } break; - case 674: /* join_type ::= RIGHT */ -{ yymsp[0].minor.yy792 = JOIN_TYPE_RIGHT; } + case 665: /* join_type ::= RIGHT */ +{ yymsp[0].minor.yy36 = JOIN_TYPE_RIGHT; } break; - case 675: /* join_type ::= FULL */ -{ yymsp[0].minor.yy792 = JOIN_TYPE_FULL; } + case 666: /* join_type ::= FULL */ +{ yymsp[0].minor.yy36 = JOIN_TYPE_FULL; } break; - case 676: /* join_subtype ::= */ -{ yymsp[1].minor.yy744 = JOIN_STYPE_NONE; } + case 667: /* join_subtype ::= */ +{ yymsp[1].minor.yy648 = JOIN_STYPE_NONE; } break; - case 677: /* join_subtype ::= OUTER */ -{ yymsp[0].minor.yy744 = JOIN_STYPE_OUTER; } + case 668: /* join_subtype ::= OUTER */ +{ yymsp[0].minor.yy648 = JOIN_STYPE_OUTER; } break; - case 678: /* join_subtype ::= SEMI */ -{ yymsp[0].minor.yy744 = JOIN_STYPE_SEMI; } + case 669: /* join_subtype ::= SEMI */ +{ yymsp[0].minor.yy648 = JOIN_STYPE_SEMI; } break; - case 679: /* join_subtype ::= ANTI */ -{ yymsp[0].minor.yy744 = JOIN_STYPE_ANTI; } + case 670: /* join_subtype ::= ANTI */ +{ yymsp[0].minor.yy648 = JOIN_STYPE_ANTI; } break; - case 680: /* join_subtype ::= ASOF */ -{ yymsp[0].minor.yy744 = JOIN_STYPE_ASOF; } + case 671: /* join_subtype ::= ASOF */ +{ yymsp[0].minor.yy648 = JOIN_STYPE_ASOF; } break; - case 681: /* join_subtype ::= WINDOW */ -{ yymsp[0].minor.yy744 = JOIN_STYPE_WIN; } + case 672: /* join_subtype ::= WINDOW */ +{ yymsp[0].minor.yy648 = JOIN_STYPE_WIN; } break; - case 685: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -{ yymsp[-5].minor.yy974 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } + case 676: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ +{ yymsp[-5].minor.yy560 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 686: /* window_offset_literal ::= NK_VARIABLE */ -{ yylhsminor.yy974 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 677: /* window_offset_literal ::= NK_VARIABLE */ +{ yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 687: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ + case 678: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy974 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + yylhsminor.yy560 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 689: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 762: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==762); - case 766: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==766); -{ yymsp[-1].minor.yy974 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 680: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 751: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==751); + case 755: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==755); +{ yymsp[-1].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 690: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 681: /* 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.yy974 = createSelectStmt(pCxt, yymsp[-11].minor.yy569, yymsp[-9].minor.yy946, yymsp[-8].minor.yy974, yymsp[-12].minor.yy946); - yymsp[-13].minor.yy974 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy974, yymsp[-10].minor.yy569); - yymsp[-13].minor.yy974 = addWhereClause(pCxt, yymsp[-13].minor.yy974, yymsp[-7].minor.yy974); - yymsp[-13].minor.yy974 = addPartitionByClause(pCxt, yymsp[-13].minor.yy974, yymsp[-6].minor.yy946); - yymsp[-13].minor.yy974 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy974, yymsp[-2].minor.yy974); - yymsp[-13].minor.yy974 = addGroupByClause(pCxt, yymsp[-13].minor.yy974, yymsp[-1].minor.yy946); - yymsp[-13].minor.yy974 = addHavingClause(pCxt, yymsp[-13].minor.yy974, yymsp[0].minor.yy974); - yymsp[-13].minor.yy974 = addRangeClause(pCxt, yymsp[-13].minor.yy974, yymsp[-5].minor.yy974); - yymsp[-13].minor.yy974 = addEveryClause(pCxt, yymsp[-13].minor.yy974, yymsp[-4].minor.yy974); - yymsp[-13].minor.yy974 = addFillClause(pCxt, yymsp[-13].minor.yy974, yymsp[-3].minor.yy974); + yymsp[-13].minor.yy560 = createSelectStmt(pCxt, yymsp[-11].minor.yy173, yymsp[-9].minor.yy334, yymsp[-8].minor.yy560, yymsp[-12].minor.yy334); + yymsp[-13].minor.yy560 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy560, yymsp[-10].minor.yy173); + yymsp[-13].minor.yy560 = addWhereClause(pCxt, yymsp[-13].minor.yy560, yymsp[-7].minor.yy560); + yymsp[-13].minor.yy560 = addPartitionByClause(pCxt, yymsp[-13].minor.yy560, yymsp[-6].minor.yy334); + yymsp[-13].minor.yy560 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy560, yymsp[-2].minor.yy560); + yymsp[-13].minor.yy560 = addGroupByClause(pCxt, yymsp[-13].minor.yy560, yymsp[-1].minor.yy334); + yymsp[-13].minor.yy560 = addHavingClause(pCxt, yymsp[-13].minor.yy560, yymsp[0].minor.yy560); + yymsp[-13].minor.yy560 = addRangeClause(pCxt, yymsp[-13].minor.yy560, yymsp[-5].minor.yy560); + yymsp[-13].minor.yy560 = addEveryClause(pCxt, yymsp[-13].minor.yy560, yymsp[-4].minor.yy560); + yymsp[-13].minor.yy560 = addFillClause(pCxt, yymsp[-13].minor.yy560, yymsp[-3].minor.yy560); } break; - case 691: /* hint_list ::= */ -{ yymsp[1].minor.yy946 = createHintNodeList(pCxt, NULL); } + case 682: /* hint_list ::= */ +{ yymsp[1].minor.yy334 = createHintNodeList(pCxt, NULL); } break; - case 692: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy946 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy946 = yylhsminor.yy946; + case 683: /* hint_list ::= NK_HINT */ +{ yylhsminor.yy334 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; - case 697: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy569 = false; } + case 688: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy173 = false; } break; - case 700: /* select_item ::= NK_STAR */ -{ yylhsminor.yy974 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy974 = yylhsminor.yy974; + case 691: /* select_item ::= NK_STAR */ +{ yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; break; - case 702: /* select_item ::= common_expression column_alias */ - case 712: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==712); -{ yylhsminor.yy974 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy974 = yylhsminor.yy974; + case 693: /* select_item ::= common_expression column_alias */ + case 703: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==703); +{ yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; break; - case 703: /* select_item ::= common_expression AS column_alias */ - case 713: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==713); -{ yylhsminor.yy974 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), &yymsp[0].minor.yy557); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 694: /* select_item ::= common_expression AS column_alias */ + case 704: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==704); +{ yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 708: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 740: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==740); - case 760: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==760); -{ yymsp[-2].minor.yy946 = yymsp[0].minor.yy946; } + case 699: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 729: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==729); + case 749: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==749); +{ yymsp[-2].minor.yy334 = yymsp[0].minor.yy334; } break; - case 715: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy974 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } + case 706: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy560 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 716: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy974 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } + case 707: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy560 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 717: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy974 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), NULL, yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 708: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 718: /* 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.yy974 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy974), releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), yymsp[-1].minor.yy974, yymsp[0].minor.yy974); } + case 709: /* 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.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } break; - case 719: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy974 = createEventWindowNode(pCxt, yymsp[-3].minor.yy974, yymsp[0].minor.yy974); } + case 710: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy560 = createEventWindowNode(pCxt, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); } break; - case 720: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy974 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 711: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy560 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 721: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy974 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 712: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy560 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 722: /* twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy974 = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974), NULL); } + case 719: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy560 = createFillNode(pCxt, yymsp[-1].minor.yy18, NULL); } break; - case 723: /* twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ -{ yymsp[-5].minor.yy974 = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), &yymsp[-1].minor.yy0); } + case 720: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy560 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } break; - case 730: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy974 = createFillNode(pCxt, yymsp[-1].minor.yy102, NULL); } + case 721: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy560 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } break; - case 731: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy974 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy946)); } + case 722: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy18 = FILL_MODE_NONE; } break; - case 732: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy974 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy946)); } + case 723: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy18 = FILL_MODE_PREV; } break; - case 733: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy102 = FILL_MODE_NONE; } + case 724: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy18 = FILL_MODE_NULL; } break; - case 734: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy102 = FILL_MODE_PREV; } + case 725: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy18 = FILL_MODE_NULL_F; } break; - case 735: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy102 = FILL_MODE_NULL; } + case 726: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy18 = FILL_MODE_LINEAR; } break; - case 736: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy102 = FILL_MODE_NULL_F; } + case 727: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy18 = FILL_MODE_NEXT; } break; - case 737: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy102 = FILL_MODE_LINEAR; } + case 730: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy334 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } + yymsp[0].minor.yy334 = yylhsminor.yy334; break; - case 738: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy102 = FILL_MODE_NEXT; } + case 731: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; break; - case 741: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy946 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); } - yymsp[0].minor.yy946 = yylhsminor.yy946; + case 735: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy560 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 742: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy946 = addNodeToList(pCxt, yymsp[-2].minor.yy946, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy974))); } - yymsp[-2].minor.yy946 = yylhsminor.yy946; + case 736: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy560 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } break; - case 746: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy974 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy974), releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } - break; - case 747: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy974 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy974)); } - break; - case 750: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 739: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy974 = addOrderByClause(pCxt, yymsp[-3].minor.yy974, yymsp[-2].minor.yy946); - yylhsminor.yy974 = addSlimitClause(pCxt, yylhsminor.yy974, yymsp[-1].minor.yy974); - yylhsminor.yy974 = addLimitClause(pCxt, yylhsminor.yy974, yymsp[0].minor.yy974); + yylhsminor.yy560 = addOrderByClause(pCxt, yymsp[-3].minor.yy560, yymsp[-2].minor.yy334); + yylhsminor.yy560 = addSlimitClause(pCxt, yylhsminor.yy560, yymsp[-1].minor.yy560); + yylhsminor.yy560 = addLimitClause(pCxt, yylhsminor.yy560, yymsp[0].minor.yy560); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 753: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy974 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy974, yymsp[0].minor.yy974); } - yymsp[-3].minor.yy974 = yylhsminor.yy974; + case 742: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; break; - case 754: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy974 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy974, yymsp[0].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 743: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 763: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 767: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==767); -{ yymsp[-3].minor.yy974 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 752: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 756: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==756); +{ yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 764: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 768: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==768); -{ yymsp[-3].minor.yy974 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 753: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 757: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==757); +{ yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 769: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy974 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy974); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 758: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 774: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy974 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy974), yymsp[-1].minor.yy410, yymsp[0].minor.yy307); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 763: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy560 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), yymsp[-1].minor.yy974, yymsp[0].minor.yy109); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; - case 775: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy410 = ORDER_ASC; } + case 764: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy974 = ORDER_ASC; } break; - case 776: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy410 = ORDER_ASC; } + case 765: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy974 = ORDER_ASC; } break; - case 777: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy410 = ORDER_DESC; } + case 766: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy974 = ORDER_DESC; } break; - case 778: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy307 = NULL_ORDER_DEFAULT; } + case 767: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } break; - case 779: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy307 = NULL_ORDER_FIRST; } + case 768: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } break; - case 780: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy307 = NULL_ORDER_LAST; } + case 769: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } break; - case 783: /* column_options ::= column_options NK_ID NK_STRING */ -{ yylhsminor.yy974 = setColumnOptions(pCxt, yymsp[-2].minor.yy974, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy974 = yylhsminor.yy974; + case 772: /* column_options ::= column_options NK_ID NK_STRING */ +{ yylhsminor.yy560 = setColumnOptions(pCxt, yymsp[-2].minor.yy560, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; break; default: break; diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 40cd415cb9..6ad30eccb8 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -973,45 +973,6 @@ static int32_t createInterpFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* p return code; } -static bool isForecastFunc(int32_t funcId) { - return fmIsForecastFunc(funcId) || fmIsForecastPseudoColumnFunc(funcId) || fmIsGroupKeyFunc(funcId) || fmisSelectGroupConstValueFunc(funcId); -} - -static int32_t createForecastFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { - if (!pSelect->hasForecastFunc) { - return TSDB_CODE_SUCCESS; - } - - SForecastFuncLogicNode* pForecastFunc = NULL; - int32_t code = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC, (SNode**)&pForecastFunc); - if (NULL == pForecastFunc) { - return code; - } - - pForecastFunc->node.groupAction = getGroupAction(pCxt, pSelect); - pForecastFunc->node.requireDataOrder = getRequireDataOrder(true, pSelect); - pForecastFunc->node.resultDataOrder = pForecastFunc->node.requireDataOrder; - - // interp functions and _group_key functions - code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, NULL, isForecastFunc, &pForecastFunc->pFuncs); - if (TSDB_CODE_SUCCESS == code) { - code = rewriteExprsForSelect(pForecastFunc->pFuncs, pSelect, SQL_CLAUSE_SELECT, NULL); - } - - // set the output - if (TSDB_CODE_SUCCESS == code) { - code = createColumnByRewriteExprs(pForecastFunc->pFuncs, &pForecastFunc->node.pTargets); - } - - if (TSDB_CODE_SUCCESS == code) { - *pLogicNode = (SLogicNode*)pForecastFunc; - } else { - nodesDestroyNode((SNode*)pForecastFunc); - } - - return code; -} - static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SWindowLogicNode* pWindow, SLogicNode** pLogicNode) { if (pCxt->pPlanCxt->streamQuery) { @@ -1213,48 +1174,6 @@ static int32_t createWindowLogicNodeByCount(SLogicPlanContext* pCxt, SCountWindo return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); } -static int32_t createWindowLogicNodeByAnomaly(SLogicPlanContext* pCxt, SAnomalyWindowNode* pAnomaly, - SSelectStmt* pSelect, SLogicNode** pLogicNode) { - SWindowLogicNode* pWindow = NULL; - int32_t code = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW, (SNode**)&pWindow); - if (NULL == pWindow) { - return code; - } - - pWindow->winType = WINDOW_TYPE_ANOMALY; - pWindow->node.groupAction = getGroupAction(pCxt, pSelect); - pWindow->node.requireDataOrder = - pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_IN_BLOCK : getRequireDataOrder(true, pSelect); - pWindow->node.resultDataOrder = - pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_GLOBAL : pWindow->node.requireDataOrder; - - pWindow->pAnomalyExpr = NULL; - code = nodesCloneNode(pAnomaly->pExpr, &pWindow->pAnomalyExpr); - if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode((SNode*)pWindow); - return code; - } - - tstrncpy(pWindow->anomalyOpt, pAnomaly->anomalyOpt, sizeof(pWindow->anomalyOpt)); - - pWindow->pTspk = NULL; - code = nodesCloneNode(pAnomaly->pCol, &pWindow->pTspk); - if (NULL == pWindow->pTspk) { - nodesDestroyNode((SNode*)pWindow); - return code; - } - - // rewrite the expression in subsequent clauses - code = rewriteExprForSelect(pWindow->pAnomalyExpr, pSelect, SQL_CLAUSE_WINDOW); - if (TSDB_CODE_SUCCESS == code) { - code = createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); - } else { - nodesDestroyNode((SNode*)pWindow); - } - - return code; -} - static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; @@ -1270,8 +1189,6 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele return createWindowLogicNodeByEvent(pCxt, (SEventWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_COUNT_WINDOW: return createWindowLogicNodeByCount(pCxt, (SCountWindowNode*)pSelect->pWindow, pSelect, pLogicNode); - case QUERY_NODE_ANOMALY_WINDOW: - return createWindowLogicNodeByAnomaly(pCxt, (SAnomalyWindowNode*)pSelect->pWindow, pSelect, pLogicNode); default: break; } @@ -1683,9 +1600,6 @@ static int32_t createSelectFromLogicNode(SLogicPlanContext* pCxt, SSelectStmt* p if (TSDB_CODE_SUCCESS == code) { code = createSelectRootLogicNode(pCxt, pSelect, createInterpFuncLogicNode, &pRoot); } - if (TSDB_CODE_SUCCESS == code) { - code = createSelectRootLogicNode(pCxt, pSelect, createForecastFuncLogicNode, &pRoot); - } if (TSDB_CODE_SUCCESS == code) { code = createSelectRootLogicNode(pCxt, pSelect, createDistinctLogicNode, &pRoot); } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 885faa5461..97c4fa9dde 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2380,8 +2380,6 @@ static bool sortPriKeyOptHasUnsupportedPkFunc(SLogicNode* pLogicNode, EOrder sor case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: pFuncList = ((SInterpFuncLogicNode*)pLogicNode)->pFuncs; break; - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - pFuncList = ((SForecastFuncLogicNode*)pLogicNode)->pFuncs; default: break; } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index a88909947b..a00eb05482 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1990,50 +1990,6 @@ static int32_t createInterpFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pCh return code; } -static int32_t createForecastFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, - SForecastFuncLogicNode* pFuncLogicNode, SPhysiNode** pPhyNode) { - SForecastFuncPhysiNode* pForecastFunc = - (SForecastFuncPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pFuncLogicNode, QUERY_NODE_PHYSICAL_PLAN_FORECAST_FUNC); - if (NULL == pForecastFunc) { - return terrno; - } - - SNodeList* pPrecalcExprs = NULL; - SNodeList* pFuncs = NULL; - int32_t code = rewritePrecalcExprs(pCxt, pFuncLogicNode->pFuncs, &pPrecalcExprs, &pFuncs); - - SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); - // push down expression to pOutputDataBlockDesc of child node - if (TSDB_CODE_SUCCESS == code && NULL != pPrecalcExprs) { - code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pPrecalcExprs, &pForecastFunc->pExprs); - if (TSDB_CODE_SUCCESS == code) { - code = pushdownDataBlockSlots(pCxt, pForecastFunc->pExprs, pChildTupe); - } - } - - if (TSDB_CODE_SUCCESS == code) { - code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pFuncs, &pForecastFunc->pFuncs); - if (TSDB_CODE_SUCCESS == code) { - code = addDataBlockSlots(pCxt, pForecastFunc->pFuncs, pForecastFunc->node.pOutputDataBlockDesc); - } - } - - if (TSDB_CODE_SUCCESS == code) { - code = setConditionsSlotId(pCxt, (const SLogicNode*)pFuncLogicNode, (SPhysiNode*)pForecastFunc); - } - - if (TSDB_CODE_SUCCESS == code) { - *pPhyNode = (SPhysiNode*)pForecastFunc; - } else { - nodesDestroyNode((SNode*)pForecastFunc); - } - - nodesDestroyList(pPrecalcExprs); - nodesDestroyList(pFuncs); - - return code; -} - static bool projectCanMergeDataBlock(SProjectLogicNode* pProject) { if (GROUP_ACTION_KEEP == pProject->node.groupAction) { return false; @@ -2369,53 +2325,6 @@ static int32_t createCountWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC return code; } -static int32_t createAnomalyWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, - SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { - SAnomalyWindowPhysiNode* pAnomaly = (SAnomalyWindowPhysiNode*)makePhysiNode( - pCxt, (SLogicNode*)pWindowLogicNode, - (pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_ANOMALY : QUERY_NODE_PHYSICAL_PLAN_MERGE_ANOMALY)); - if (NULL == pAnomaly) { - return terrno; - } - - SNodeList* pPrecalcExprs = NULL; - SNode* pAnomalyKey = NULL; - int32_t code = rewritePrecalcExpr(pCxt, pWindowLogicNode->pAnomalyExpr, &pPrecalcExprs, &pAnomalyKey); - - SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); - // push down expression to pOutputDataBlockDesc of child node - if (TSDB_CODE_SUCCESS == code && NULL != pPrecalcExprs) { - code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pPrecalcExprs, &pAnomaly->window.pExprs); - if (TSDB_CODE_SUCCESS == code) { - code = addDataBlockSlots(pCxt, pAnomaly->window.pExprs, pChildTupe); - } - } - - if (TSDB_CODE_SUCCESS == code) { - code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pAnomalyKey, &pAnomaly->pAnomalyKey); - // if (TSDB_CODE_SUCCESS == code) { - // code = addDataBlockSlot(pCxt, &pAnomaly->pAnomalyKey, pAnomaly->window.node.pOutputDataBlockDesc); - // } - } - - tstrncpy(pAnomaly->anomalyOpt, pWindowLogicNode->anomalyOpt, sizeof(pAnomaly->anomalyOpt)); - - if (TSDB_CODE_SUCCESS == code) { - code = createWindowPhysiNodeFinalize(pCxt, pChildren, &pAnomaly->window, pWindowLogicNode); - } - - if (TSDB_CODE_SUCCESS == code) { - *pPhyNode = (SPhysiNode*)pAnomaly; - } else { - nodesDestroyNode((SNode*)pAnomaly); - } - - nodesDestroyList(pPrecalcExprs); - nodesDestroyNode(pAnomalyKey); - - return code; -} - static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { switch (pWindowLogicNode->winType) { @@ -2429,8 +2338,6 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr return createEventWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); case WINDOW_TYPE_COUNT: return createCountWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); - case WINDOW_TYPE_ANOMALY: - return createAnomalyWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); default: break; } @@ -2745,8 +2652,6 @@ static int32_t doCreatePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode return createIndefRowsFuncPhysiNode(pCxt, pChildren, (SIndefRowsFuncLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: return createInterpFuncPhysiNode(pCxt, pChildren, (SInterpFuncLogicNode*)pLogicNode, pPhyNode); - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - return createForecastFuncPhysiNode(pCxt, pChildren, (SForecastFuncLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_MERGE: return createMergePhysiNode(pCxt, pChildren, (SMergeLogicNode*)pLogicNode, pPhyNode); case QUERY_NODE_LOGIC_PLAN_GROUP_CACHE: diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index e0e42087f3..bd2462243d 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -939,18 +939,6 @@ static int32_t stbSplSplitCount(SSplitContext* pCxt, SStableSplitInfo* pInfo) { } } -static int32_t stbSplSplitAnomalyForStream(SSplitContext* pCxt, SStableSplitInfo* pInfo) { - return TSDB_CODE_PLAN_INTERNAL_ERROR; -} - -static int32_t stbSplSplitAnomaly(SSplitContext* pCxt, SStableSplitInfo* pInfo) { - if (pCxt->pPlanCxt->streamQuery) { - return stbSplSplitAnomalyForStream(pCxt, pInfo); - } else { - return stbSplSplitSessionOrStateForBatch(pCxt, pInfo); - } -} - static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitInfo* pInfo) { switch (((SWindowLogicNode*)pInfo->pSplitNode)->winType) { case WINDOW_TYPE_INTERVAL: @@ -963,8 +951,6 @@ static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitI return stbSplSplitEvent(pCxt, pInfo); case WINDOW_TYPE_COUNT: return stbSplSplitCount(pCxt, pInfo); - case WINDOW_TYPE_ANOMALY: - return stbSplSplitAnomaly(pCxt, pInfo); default: break; } @@ -2014,8 +2000,7 @@ typedef struct SQnodeSplitInfo { static bool qndSplFindSplitNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SLogicNode* pNode, SQnodeSplitInfo* pInfo) { if (QUERY_NODE_LOGIC_PLAN_SCAN == nodeType(pNode) && NULL != pNode->pParent && - QUERY_NODE_LOGIC_PLAN_INTERP_FUNC != nodeType(pNode->pParent) && - QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC != nodeType(pNode->pParent) && ((SScanLogicNode*)pNode)->scanSeq[0] <= 1 && + QUERY_NODE_LOGIC_PLAN_INTERP_FUNC != nodeType(pNode->pParent) && ((SScanLogicNode*)pNode)->scanSeq[0] <= 1 && ((SScanLogicNode*)pNode)->scanSeq[1] <= 1) { pInfo->pSplitNode = pNode; pInfo->pSubplan = pSubplan; diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index fd8670c23e..ae958de6e8 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -256,15 +256,6 @@ static int32_t adjustCountDataRequirement(SWindowLogicNode* pWindow, EDataOrderL return TSDB_CODE_SUCCESS; } -static int32_t adjustAnomalyDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { - if (requirement <= pWindow->node.resultDataOrder) { - return TSDB_CODE_SUCCESS; - } - pWindow->node.resultDataOrder = requirement; - pWindow->node.requireDataOrder = requirement; - return TSDB_CODE_SUCCESS; -} - static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { switch (pWindow->winType) { case WINDOW_TYPE_INTERVAL: @@ -277,8 +268,6 @@ static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrder return adjustEventDataRequirement(pWindow, requirement); case WINDOW_TYPE_COUNT: return adjustCountDataRequirement(pWindow, requirement); - case WINDOW_TYPE_ANOMALY: - return adjustAnomalyDataRequirement(pWindow, requirement); default: break; } @@ -329,15 +318,6 @@ static int32_t adjustInterpDataRequirement(SInterpFuncLogicNode* pInterp, EDataO return TSDB_CODE_SUCCESS; } -static int32_t adjustForecastDataRequirement(SForecastFuncLogicNode* pForecast, EDataOrderLevel requirement) { - if (requirement <= pForecast->node.requireDataOrder) { - return TSDB_CODE_SUCCESS; - } - pForecast->node.resultDataOrder = requirement; - pForecast->node.requireDataOrder = requirement; - return TSDB_CODE_SUCCESS; -} - int32_t adjustLogicNodeDataRequirement(SLogicNode* pNode, EDataOrderLevel requirement) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pNode)) { @@ -375,9 +355,6 @@ int32_t adjustLogicNodeDataRequirement(SLogicNode* pNode, EDataOrderLevel requir case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC: code = adjustInterpDataRequirement((SInterpFuncLogicNode*)pNode, requirement); break; - case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC: - code = adjustForecastDataRequirement((SForecastFuncLogicNode*)pNode, requirement); - break; default: break; } diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 0197b94fff..341ce760f5 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -4080,10 +4080,6 @@ int32_t diffScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam return nonCalcScalarFunction(pInput, inputNum, pOutput); } -int32_t forecastScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - return nonCalcScalarFunction(pInput, inputNum, pOutput); -} - int32_t twaScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { return avgScalarFunction(pInput, inputNum, pOutput); } diff --git a/source/util/CMakeLists.txt b/source/util/CMakeLists.txt index 4972e9f50b..f907746821 100644 --- a/source/util/CMakeLists.txt +++ b/source/util/CMakeLists.txt @@ -12,10 +12,6 @@ ELSE () MESSAGE(STATUS "enable assert core") ENDIF (${ASSERT_NOT_CORE}) -if(${BUILD_WITH_ANALYSIS}) - add_definitions(-DUSE_ANAL) -endif() - target_include_directories( util PUBLIC "${TD_SOURCE_DIR}/include/util" diff --git a/source/util/src/tanal.c b/source/util/src/tanal.c deleted file mode 100644 index 34be2af3e7..0000000000 --- a/source/util/src/tanal.c +++ /dev/null @@ -1,752 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#define _DEFAULT_SOURCE -#include "tanal.h" -#include "tmsg.h" -#include "ttypes.h" -#include "tutil.h" - -#ifdef USE_ANAL -#include -#define ANAL_ALGO_SPLIT "," - -typedef struct { - int64_t ver; - SHashObj *hash; // algoname:algotype -> SAnalUrl - TdThreadMutex lock; -} SAlgoMgmt; - -typedef struct { - char *data; - int64_t dataLen; -} SCurlResp; - -static SAlgoMgmt tsAlgos = {0}; -static int32_t taosAnalBufGetCont(SAnalBuf *pBuf, char **ppCont, int64_t *pContLen); - -const char *taosAnalAlgoStr(EAnalAlgoType type) { - switch (type) { - case ANAL_ALGO_TYPE_ANOMALY_DETECT: - return "anomaly-detection"; - case ANAL_ALGO_TYPE_FORECAST: - return "forecast"; - default: - return "unknown"; - } -} - -const char *taosAnalAlgoUrlStr(EAnalAlgoType type) { - switch (type) { - case ANAL_ALGO_TYPE_ANOMALY_DETECT: - return "anomaly-detect"; - case ANAL_ALGO_TYPE_FORECAST: - return "forecast"; - default: - return "unknown"; - } -} - -EAnalAlgoType taosAnalAlgoInt(const char *name) { - for (EAnalAlgoType i = 0; i < ANAL_ALGO_TYPE_END; ++i) { - if (strcasecmp(name, taosAnalAlgoStr(i)) == 0) { - return i; - } - } - - return ANAL_ALGO_TYPE_END; -} - -int32_t taosAnalInit() { - if (curl_global_init(CURL_GLOBAL_ALL) != 0) { - uError("failed to init curl"); - return -1; - } - - tsAlgos.ver = 0; - if (taosThreadMutexInit(&tsAlgos.lock, NULL) != 0) { - uError("failed to init algo mutex"); - return -1; - } - - tsAlgos.hash = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); - if (tsAlgos.hash == NULL) { - uError("failed to init algo hash"); - return -1; - } - - uInfo("analysis env is initialized"); - return 0; -} - -static void taosAnalFreeHash(SHashObj *hash) { - void *pIter = taosHashIterate(hash, NULL); - while (pIter != NULL) { - SAnalUrl *pUrl = (SAnalUrl *)pIter; - taosMemoryFree(pUrl->url); - pIter = taosHashIterate(hash, pIter); - } - taosHashCleanup(hash); -} - -void taosAnalCleanup() { - curl_global_cleanup(); - if (taosThreadMutexDestroy(&tsAlgos.lock) != 0) { - uError("failed to destroy anal lock"); - } - taosAnalFreeHash(tsAlgos.hash); - tsAlgos.hash = NULL; - uInfo("analysis env is cleaned up"); -} - -void taosAnalUpdate(int64_t newVer, SHashObj *pHash) { - if (newVer > tsAlgos.ver) { - if (taosThreadMutexLock(&tsAlgos.lock) == 0) { - SHashObj *hash = tsAlgos.hash; - tsAlgos.ver = newVer; - tsAlgos.hash = pHash; - if (taosThreadMutexUnlock(&tsAlgos.lock) != 0) { - uError("failed to unlock hash") - } - taosAnalFreeHash(hash); - } - } else { - taosAnalFreeHash(pHash); - } -} - -bool taosAnalGetOptStr(const char *option, const char *optName, char *optValue, int32_t optMaxLen) { - char buf[TSDB_ANAL_ALGO_OPTION_LEN] = {0}; - int32_t bufLen = tsnprintf(buf, sizeof(buf), "%s=", optName); - - char *pos1 = strstr(option, buf); - char *pos2 = strstr(option, ANAL_ALGO_SPLIT); - if (pos1 != NULL) { - if (optMaxLen > 0) { - int32_t copyLen = optMaxLen; - if (pos2 != NULL) { - copyLen = (int32_t)(pos2 - pos1 - strlen(optName) + 1); - copyLen = MIN(copyLen, optMaxLen); - } - tstrncpy(optValue, pos1 + bufLen, copyLen); - } - return true; - } else { - return false; - } -} - -bool taosAnalGetOptInt(const char *option, const char *optName, int32_t *optValue) { - char buf[TSDB_ANAL_ALGO_OPTION_LEN] = {0}; - int32_t bufLen = tsnprintf(buf, sizeof(buf), "%s=", optName); - - char *pos1 = strstr(option, buf); - char *pos2 = strstr(option, ANAL_ALGO_SPLIT); - if (pos1 != NULL) { - *optValue = taosStr2Int32(pos1 + bufLen + 1, NULL, 10); - return true; - } else { - return false; - } -} - -int32_t taosAnalGetAlgoUrl(const char *algoName, EAnalAlgoType type, char *url, int32_t urlLen) { - int32_t code = 0; - char name[TSDB_ANAL_ALGO_KEY_LEN] = {0}; - int32_t nameLen = 1 + tsnprintf(name, sizeof(name) - 1, "%d:%s", type, algoName); - - if (taosThreadMutexLock(&tsAlgos.lock) == 0) { - SAnalUrl *pUrl = taosHashAcquire(tsAlgos.hash, name, nameLen); - if (pUrl != NULL) { - tstrncpy(url, pUrl->url, urlLen); - uDebug("algo:%s, type:%s, url:%s", algoName, taosAnalAlgoStr(type), url); - } else { - url[0] = 0; - terrno = TSDB_CODE_ANAL_ALGO_NOT_FOUND; - code = terrno; - uError("algo:%s, type:%s, url not found", algoName, taosAnalAlgoStr(type)); - } - if (taosThreadMutexUnlock(&tsAlgos.lock) != 0) { - uError("failed to unlock hash"); - return TSDB_CODE_OUT_OF_MEMORY; - } - } - - return code; -} - -int64_t taosAnalGetVersion() { return tsAlgos.ver; } - -static size_t taosCurlWriteData(char *pCont, size_t contLen, size_t nmemb, void *userdata) { - SCurlResp *pRsp = userdata; - if (contLen == 0 || nmemb == 0 || pCont == NULL) { - pRsp->dataLen = 0; - pRsp->data = NULL; - uError("curl response is received, len:%" PRId64, pRsp->dataLen); - return 0; - } - - pRsp->dataLen = (int64_t)contLen * (int64_t)nmemb; - pRsp->data = taosMemoryMalloc(pRsp->dataLen + 1); - - if (pRsp->data != NULL) { - (void)memcpy(pRsp->data, pCont, pRsp->dataLen); - pRsp->data[pRsp->dataLen] = 0; - uDebug("curl response is received, len:%" PRId64 ", content:%s", pRsp->dataLen, pRsp->data); - return pRsp->dataLen; - } else { - pRsp->dataLen = 0; - uError("failed to malloc curl response"); - return 0; - } -} - -static int32_t taosCurlGetRequest(const char *url, SCurlResp *pRsp) { - CURL *curl = NULL; - CURLcode code = 0; - - curl = curl_easy_init(); - if (curl == NULL) { - uError("failed to create curl handle"); - return -1; - } - - if (curl_easy_setopt(curl, CURLOPT_URL, url) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, taosCurlWriteData) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_WRITEDATA, pRsp) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 100) != 0) goto _OVER; - - uDebug("curl get request will sent, url:%s", url); - code = curl_easy_perform(curl); - if (code != CURLE_OK) { - uError("failed to perform curl action, code:%d", code); - } - -_OVER: - if (curl != NULL) curl_easy_cleanup(curl); - return code; -} - -static int32_t taosCurlPostRequest(const char *url, SCurlResp *pRsp, const char *buf, int32_t bufLen) { - struct curl_slist *headers = NULL; - CURL *curl = NULL; - CURLcode code = 0; - - curl = curl_easy_init(); - if (curl == NULL) { - uError("failed to create curl handle"); - return -1; - } - - headers = curl_slist_append(headers, "Content-Type:application/json;charset=UTF-8"); - if (curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_URL, url) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, taosCurlWriteData) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_WRITEDATA, pRsp) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 60000) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_POST, 1) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, bufLen) != 0) goto _OVER; - if (curl_easy_setopt(curl, CURLOPT_POSTFIELDS, buf) != 0) goto _OVER; - - uDebug("curl post request will sent, url:%s len:%d", url, bufLen); - code = curl_easy_perform(curl); - if (code != CURLE_OK) { - uError("failed to perform curl action, code:%d", code); - } - -_OVER: - if (curl != NULL) { - curl_slist_free_all(headers); - curl_easy_cleanup(curl); - } - return code; -} - -SJson *taosAnalSendReqRetJson(const char *url, EAnalHttpType type, SAnalBuf *pBuf) { - int32_t code = -1; - char *pCont = NULL; - int64_t contentLen; - SJson *pJson = NULL; - SCurlResp curlRsp = {0}; - - if (type == ANAL_HTTP_TYPE_GET) { - if (taosCurlGetRequest(url, &curlRsp) != 0) { - terrno = TSDB_CODE_ANAL_URL_CANT_ACCESS; - goto _OVER; - } - } else { - code = taosAnalBufGetCont(pBuf, &pCont, &contentLen); - if (code != 0) { - terrno = code; - goto _OVER; - } - if (taosCurlPostRequest(url, &curlRsp, pCont, contentLen) != 0) { - terrno = TSDB_CODE_ANAL_URL_CANT_ACCESS; - goto _OVER; - } - } - - if (curlRsp.data == NULL || curlRsp.dataLen == 0) { - terrno = TSDB_CODE_ANAL_URL_RSP_IS_NULL; - goto _OVER; - } - - pJson = tjsonParse(curlRsp.data); - if (pJson == NULL) { - terrno = TSDB_CODE_INVALID_JSON_FORMAT; - goto _OVER; - } - -_OVER: - if (curlRsp.data != NULL) taosMemoryFreeClear(curlRsp.data); - if (pCont != NULL) taosMemoryFree(pCont); - return pJson; -} - -static int32_t taosAnalJsonBufGetCont(const char *fileName, char **ppCont, int64_t *pContLen) { - int32_t code = 0; - int64_t contLen; - char *pCont = NULL; - TdFilePtr pFile = NULL; - - pFile = taosOpenFile(fileName, TD_FILE_READ); - if (pFile == NULL) { - code = terrno; - goto _OVER; - } - - code = taosFStatFile(pFile, &contLen, NULL); - if (code != 0) goto _OVER; - - pCont = taosMemoryMalloc(contLen + 1); - if (pCont == NULL) { - code = TSDB_CODE_OUT_OF_MEMORY; - goto _OVER; - } - - if (taosReadFile(pFile, pCont, contLen) != contLen) { - code = terrno; - goto _OVER; - } - - pCont[contLen] = '\0'; - -_OVER: - if (code == 0) { - *ppCont = pCont; - *pContLen = contLen; - } else { - if (pCont != NULL) taosMemoryFree(pCont); - } - if (pFile != NULL) taosCloseFile(&pFile); - return code; -} - -static int32_t taosAnalJsonBufWriteOptInt(SAnalBuf *pBuf, const char *optName, int64_t optVal) { - char buf[64] = {0}; - int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": %" PRId64 ",\n", optName, optVal); - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - return 0; -} - -static int32_t taosAnalJsonBufWriteOptStr(SAnalBuf *pBuf, const char *optName, const char *optVal) { - char buf[128] = {0}; - int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": \"%s\",\n", optName, optVal); - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - return 0; -} - -static int32_t taosAnalJsonBufWriteOptFloat(SAnalBuf *pBuf, const char *optName, float optVal) { - char buf[128] = {0}; - int32_t bufLen = tsnprintf(buf, sizeof(buf), "\"%s\": %f,\n", optName, optVal); - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - return 0; -} - -static int32_t taosAnalJsonBufWriteStr(SAnalBuf *pBuf, const char *buf, int32_t bufLen) { - if (bufLen <= 0) { - bufLen = strlen(buf); - } - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - return 0; -} - -static int32_t taosAnalJsonBufWriteStart(SAnalBuf *pBuf) { return taosAnalJsonBufWriteStr(pBuf, "{\n", 0); } - -static int32_t tsosAnalJsonBufOpen(SAnalBuf *pBuf, int32_t numOfCols) { - pBuf->filePtr = taosOpenFile(pBuf->fileName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH); - if (pBuf->filePtr == NULL) { - return terrno; - } - - pBuf->pCols = taosMemoryCalloc(numOfCols, sizeof(SAnalColBuf)); - if (pBuf->pCols == NULL) return TSDB_CODE_OUT_OF_MEMORY; - pBuf->numOfCols = numOfCols; - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON) { - return taosAnalJsonBufWriteStart(pBuf); - } - - for (int32_t i = 0; i < numOfCols; ++i) { - SAnalColBuf *pCol = &pBuf->pCols[i]; - snprintf(pCol->fileName, sizeof(pCol->fileName), "%s-c%d", pBuf->fileName, i); - pCol->filePtr = - taosOpenFile(pCol->fileName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH); - if (pCol->filePtr == NULL) { - return terrno; - } - } - - return taosAnalJsonBufWriteStart(pBuf); -} - -static int32_t taosAnalJsonBufWriteColMeta(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, const char *colName) { - char buf[128] = {0}; - bool first = (colIndex == 0); - bool last = (colIndex == pBuf->numOfCols - 1); - - if (first) { - if (taosAnalJsonBufWriteStr(pBuf, "\"schema\": [\n", 0) != 0) { - return terrno; - } - } - - int32_t bufLen = tsnprintf(buf, sizeof(buf), " [\"%s\", \"%s\", %d]%s\n", colName, tDataTypes[colType].name, - tDataTypes[colType].bytes, last ? "" : ","); - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - - if (last) { - if (taosAnalJsonBufWriteStr(pBuf, "],\n", 0) != 0) { - return terrno; - } - } - - return 0; -} - -static int32_t taosAnalJsonBufWriteDataBegin(SAnalBuf *pBuf) { - return taosAnalJsonBufWriteStr(pBuf, "\"data\": [\n", 0); -} - -static int32_t taosAnalJsonBufWriteStrUseCol(SAnalBuf *pBuf, const char *buf, int32_t bufLen, int32_t colIndex) { - if (bufLen <= 0) { - bufLen = strlen(buf); - } - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON) { - if (taosWriteFile(pBuf->filePtr, buf, bufLen) != bufLen) { - return terrno; - } - } else { - if (taosWriteFile(pBuf->pCols[colIndex].filePtr, buf, bufLen) != bufLen) { - return terrno; - } - } - - return 0; -} - -static int32_t taosAnalJsonBufWriteColBegin(SAnalBuf *pBuf, int32_t colIndex) { - return taosAnalJsonBufWriteStrUseCol(pBuf, "[\n", 0, colIndex); -} - -static int32_t taosAnalJsonBufWriteColEnd(SAnalBuf *pBuf, int32_t colIndex) { - if (colIndex == pBuf->numOfCols - 1) { - return taosAnalJsonBufWriteStrUseCol(pBuf, "\n]\n", 0, colIndex); - - } else { - return taosAnalJsonBufWriteStrUseCol(pBuf, "\n],\n", 0, colIndex); - } -} - -static int32_t taosAnalJsonBufWriteColData(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, void *colValue) { - char buf[64]; - int32_t bufLen = 0; - - if (pBuf->pCols[colIndex].numOfRows != 0) { - buf[bufLen] = ','; - buf[bufLen + 1] = '\n'; - buf[bufLen + 2] = 0; - bufLen += 2; - } - - switch (colType) { - case TSDB_DATA_TYPE_BOOL: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", (*((int8_t *)colValue) == 1) ? 1 : 0); - break; - case TSDB_DATA_TYPE_TINYINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int8_t *)colValue); - break; - case TSDB_DATA_TYPE_UTINYINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint8_t *)colValue); - break; - case TSDB_DATA_TYPE_SMALLINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int16_t *)colValue); - break; - case TSDB_DATA_TYPE_USMALLINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint16_t *)colValue); - break; - case TSDB_DATA_TYPE_INT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%d", *(int32_t *)colValue); - break; - case TSDB_DATA_TYPE_UINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%u", *(uint32_t *)colValue); - break; - case TSDB_DATA_TYPE_BIGINT: - case TSDB_DATA_TYPE_TIMESTAMP: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRId64 "", *(int64_t *)colValue); - break; - case TSDB_DATA_TYPE_UBIGINT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%" PRIu64 "", *(uint64_t *)colValue); - break; - case TSDB_DATA_TYPE_FLOAT: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_FLOAT_VAL(colValue)); - break; - case TSDB_DATA_TYPE_DOUBLE: - bufLen += tsnprintf(buf + bufLen, sizeof(buf) - bufLen, "%f", GET_DOUBLE_VAL(colValue)); - break; - default: - buf[bufLen] = '\0'; - } - - pBuf->pCols[colIndex].numOfRows++; - return taosAnalJsonBufWriteStrUseCol(pBuf, buf, bufLen, colIndex); -} - -static int32_t taosAnalJsonBufWriteDataEnd(SAnalBuf *pBuf) { - int32_t code = 0; - char *pCont = NULL; - int64_t contLen = 0; - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - for (int32_t i = 0; i < pBuf->numOfCols; ++i) { - SAnalColBuf *pCol = &pBuf->pCols[i]; - - code = taosFsyncFile(pCol->filePtr); - if (code != 0) return code; - - code = taosCloseFile(&pCol->filePtr); - if (code != 0) return code; - - code = taosAnalJsonBufGetCont(pBuf->pCols[i].fileName, &pCont, &contLen); - if (code != 0) return code; - - code = taosAnalJsonBufWriteStr(pBuf, pCont, contLen); - if (code != 0) return code; - - taosMemoryFreeClear(pCont); - contLen = 0; - } - } - - return taosAnalJsonBufWriteStr(pBuf, "],\n", 0); -} - -static int32_t taosAnalJsonBufWriteEnd(SAnalBuf *pBuf) { - int32_t code = taosAnalJsonBufWriteOptInt(pBuf, "rows", pBuf->pCols[0].numOfRows); - if (code != 0) return code; - - return taosAnalJsonBufWriteStr(pBuf, "\"protocol\": 1.0\n}", 0); -} - -int32_t taosAnalJsonBufClose(SAnalBuf *pBuf) { - int32_t code = taosAnalJsonBufWriteEnd(pBuf); - if (code != 0) return code; - - if (pBuf->filePtr != NULL) { - code = taosFsyncFile(pBuf->filePtr); - if (code != 0) return code; - code = taosCloseFile(&pBuf->filePtr); - if (code != 0) return code; - } - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - for (int32_t i = 0; i < pBuf->numOfCols; ++i) { - SAnalColBuf *pCol = &pBuf->pCols[i]; - if (pCol->filePtr != NULL) { - code = taosFsyncFile(pCol->filePtr); - if (code != 0) return code; - code = taosCloseFile(&pCol->filePtr); - if (code != 0) return code; - } - } - } - - return 0; -} - -void taosAnalBufDestroy(SAnalBuf *pBuf) { - if (pBuf->fileName[0] != 0) { - if (pBuf->filePtr != NULL) (void)taosCloseFile(&pBuf->filePtr); - // taosRemoveFile(pBuf->fileName); - pBuf->fileName[0] = 0; - } - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - for (int32_t i = 0; i < pBuf->numOfCols; ++i) { - SAnalColBuf *pCol = &pBuf->pCols[i]; - if (pCol->fileName[0] != 0) { - if (pCol->filePtr != NULL) (void)taosCloseFile(&pCol->filePtr); - if (taosRemoveFile(pCol->fileName) != 0) { - uError("failed to remove file %s", pCol->fileName); - } - pCol->fileName[0] = 0; - } - } - } - - taosMemoryFreeClear(pBuf->pCols); - pBuf->numOfCols = 0; -} - -int32_t tsosAnalBufOpen(SAnalBuf *pBuf, int32_t numOfCols) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return tsosAnalJsonBufOpen(pBuf, numOfCols); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteOptStr(SAnalBuf *pBuf, const char *optName, const char *optVal) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteOptStr(pBuf, optName, optVal); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteOptInt(SAnalBuf *pBuf, const char *optName, int64_t optVal) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteOptInt(pBuf, optName, optVal); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteOptFloat(SAnalBuf *pBuf, const char *optName, float optVal) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteOptFloat(pBuf, optName, optVal); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteColMeta(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, const char *colName) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteColMeta(pBuf, colIndex, colType, colName); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteDataBegin(SAnalBuf *pBuf) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteDataBegin(pBuf); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteColBegin(SAnalBuf *pBuf, int32_t colIndex) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteColBegin(pBuf, colIndex); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteColData(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, void *colValue) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteColData(pBuf, colIndex, colType, colValue); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteColEnd(SAnalBuf *pBuf, int32_t colIndex) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteColEnd(pBuf, colIndex); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufWriteDataEnd(SAnalBuf *pBuf) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufWriteDataEnd(pBuf); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -int32_t taosAnalBufClose(SAnalBuf *pBuf) { - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufClose(pBuf); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -static int32_t taosAnalBufGetCont(SAnalBuf *pBuf, char **ppCont, int64_t *pContLen) { - *ppCont = NULL; - *pContLen = 0; - - if (pBuf->bufType == ANAL_BUF_TYPE_JSON || pBuf->bufType == ANAL_BUF_TYPE_JSON_COL) { - return taosAnalJsonBufGetCont(pBuf->fileName, ppCont, pContLen); - } else { - return TSDB_CODE_ANAL_BUF_INVALID_TYPE; - } -} - -#else - -int32_t taosAnalInit() { return 0; } -void taosAnalCleanup() {} -SJson *taosAnalSendReqRetJson(const char *url, EAnalHttpType type, SAnalBuf *pBuf) { return NULL; } - -int32_t taosAnalGetAlgoUrl(const char *algoName, EAnalAlgoType type, char *url, int32_t urlLen) { return 0; } -bool taosAnalGetOptStr(const char *option, const char *optName, char *optValue, int32_t optMaxLen) { return true; } -bool taosAnalGetOptInt(const char *option, const char *optName, int32_t *optValue) { return true; } -int64_t taosAnalGetVersion() { return 0; } -void taosAnalUpdate(int64_t newVer, SHashObj *pHash) {} - -int32_t tsosAnalBufOpen(SAnalBuf *pBuf, int32_t numOfCols) { return 0; } -int32_t taosAnalBufWriteOptStr(SAnalBuf *pBuf, const char *optName, const char *optVal) { return 0; } -int32_t taosAnalBufWriteOptInt(SAnalBuf *pBuf, const char *optName, int64_t optVal) { return 0; } -int32_t taosAnalBufWriteOptFloat(SAnalBuf *pBuf, const char *optName, float optVal) { return 0; } -int32_t taosAnalBufWriteColMeta(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, const char *colName) { return 0; } -int32_t taosAnalBufWriteDataBegin(SAnalBuf *pBuf) { return 0; } -int32_t taosAnalBufWriteColBegin(SAnalBuf *pBuf, int32_t colIndex) { return 0; } -int32_t taosAnalBufWriteColData(SAnalBuf *pBuf, int32_t colIndex, int32_t colType, void *colValue) { return 0; } -int32_t taosAnalBufWriteColEnd(SAnalBuf *pBuf, int32_t colIndex) { return 0; } -int32_t taosAnalBufWriteDataEnd(SAnalBuf *pBuf) { return 0; } -int32_t taosAnalBufClose(SAnalBuf *pBuf) { return 0; } -void taosAnalBufDestroy(SAnalBuf *pBuf) {} - -const char *taosAnalAlgoStr(EAnalAlgoType algoType) { return 0; } -EAnalAlgoType taosAnalAlgoInt(const char *algoName) { return 0; } -const char *taosAnalAlgoUrlStr(EAnalAlgoType algoType) { return 0; } - -#endif \ No newline at end of file diff --git a/source/util/src/terror.c b/source/util/src/terror.c index ad43426efa..1c94a5f2e4 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -345,22 +345,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB, "Stream temporarily do TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_STREAMS, "Too many streams") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TARGET_TABLE, "Cannot write the same stable as other stream") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_ALREADY_EXIST, "Anode already exists") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_NOT_EXIST, "Anode not there") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_TOO_LONG_URL, "Anode too long url") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_INVALID_PROTOCOL, "Anode invalid protocol") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_INVALID_ALGO_TYPE, "Anode invalid algorithm type") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_INVALID_VERSION, "Anode invalid version") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_TOO_MANY_ALGO, "Anode too many algorithm") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_TOO_LONG_ALGO_NAME, "Anode too long algorithm name") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ANODE_TOO_MANY_ALGO_TYPE, "Anode too many algorithm type") - -TAOS_DEFINE_ERROR(TSDB_CODE_ANAL_URL_RSP_IS_NULL, "Analysis url response is NULL") -TAOS_DEFINE_ERROR(TSDB_CODE_ANAL_URL_CANT_ACCESS, "Analysis url can't access") -TAOS_DEFINE_ERROR(TSDB_CODE_ANAL_ALGO_NOT_FOUND, "Analysis algorithm not found") -TAOS_DEFINE_ERROR(TSDB_CODE_ANAL_ALGO_NOT_LOAD, "Analysis algorithm not loaded") -TAOS_DEFINE_ERROR(TSDB_CODE_ANAL_BUF_INVALID_TYPE, "Analysis invalid buffer type") - // mnode-sma TAOS_DEFINE_ERROR(TSDB_CODE_MND_SMA_ALREADY_EXIST, "SMA already exists") TAOS_DEFINE_ERROR(TSDB_CODE_MND_SMA_NOT_EXIST, "sma not exist") @@ -725,11 +709,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TBNAME_DUPLICATED, "Table name duplicat TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TAG_NAME_DUPLICATED, "Tag name duplicated") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NOT_ALLOWED_DIFFERENT_BY_ROW_FUNC, "Some functions cannot appear in the select list at the same time") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR, "Syntax error in regular expression") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ANOMALY_WIN_TYPE, "ANOMALY_WINDOW only support mathable column") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ANOMALY_WIN_COL, "ANOMALY_WINDOW not support on tag column") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ANOMALY_WIN_OPT, "ANOMALY_WINDOW option should include algo field") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_FORECAST_CLAUSE, "Invalid forecast clause") -TAOS_DEFINE_ERROR(TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR, "Syntax error in regular expression") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INTERNAL_ERROR, "Parser internal error") //planner diff --git a/source/util/src/tjson.c b/source/util/src/tjson.c index 752a3136ed..0f2504ff5e 100644 --- a/source/util/src/tjson.c +++ b/source/util/src/tjson.c @@ -194,10 +194,6 @@ int32_t tjsonGetObjectValueString(const SJson* pJson, char** pValueString) { return TSDB_CODE_SUCCESS; } -void tjsonGetObjectValueBigInt(const SJson* pJson, int64_t* pVal) { *pVal = (int64_t)((cJSON*)pJson)->valuedouble; } - -void tjsonGetObjectValueDouble(const SJson* pJson, double* pVal) { *pVal = ((cJSON*)pJson)->valuedouble; } - int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { @@ -207,19 +203,6 @@ int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { return TSDB_CODE_SUCCESS; } -int32_t tjsonGetStringValue2(const SJson* pJson, const char* pName, char* pVal, int32_t maxLen) { - char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); - if (NULL == p) { - return TSDB_CODE_SUCCESS; - } - int32_t len = strlen(p); - if (len >= maxLen-1) { - return TSDB_CODE_OUT_OF_MEMORY; - } - strcpy(pVal, p); - return TSDB_CODE_SUCCESS; -} - int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index b2b48c1f0b..38e35a175e 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -65,7 +65,7 @@ class TDTestCase: tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 34) + tdSql.checkData(0, 0, 32) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 3) @@ -77,7 +77,7 @@ class TDTestCase: tdSql.query('select count(1) v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 34) + tdSql.checkData(0, 0, 32) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -93,7 +93,7 @@ class TDTestCase: tdSql.checkData(1, 1, 'performance_schema') tdSql.checkData(0, 0, 3) tdSql.checkData(0, 1, 'tbl_count') - tdSql.checkData(2, 0, 34) + tdSql.checkData(2, 0, 32) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -106,7 +106,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 42) + tdSql.checkData(0, 0, 40) tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') @@ -189,7 +189,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 34) + tdSql.checkData(3, 0, 32) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -204,7 +204,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 34) + tdSql.checkData(3, 0, 32) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -215,7 +215,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'tbl_count') tdSql.checkData(1, 0, 5) tdSql.checkData(1, 1, 'performance_schema') - tdSql.checkData(2, 0, 34) + tdSql.checkData(2, 0, 32) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -228,7 +228,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 43) + tdSql.checkData(0, 0, 41) tdSql.execute('drop database tbl_count') diff --git a/tests/script/tsim/query/sys_tbname.sim b/tests/script/tsim/query/sys_tbname.sim index 9736893428..dabe4fcdde 100644 --- a/tests/script/tsim/query/sys_tbname.sim +++ b/tests/script/tsim/query/sys_tbname.sim @@ -58,7 +58,7 @@ endi sql select tbname from information_schema.ins_tables; print $rows $data00 -if $rows != 43 then +if $rows != 41 then return -1 endi if $data00 != @ins_tables@ then diff --git a/tests/script/tsim/query/tableCount.sim b/tests/script/tsim/query/tableCount.sim index 87f72eb3b6..5a3dd0714f 100644 --- a/tests/script/tsim/query/tableCount.sim +++ b/tests/script/tsim/query/tableCount.sim @@ -53,7 +53,7 @@ sql select stable_name,count(table_name) from information_schema.ins_tables grou if $rows != 3 then return -1 endi -if $data01 != 40 then +if $data01 != 38 then return -1 endi if $data11 != 10 then @@ -72,7 +72,7 @@ endi if $data11 != 5 then return -1 endi -if $data21 != 34 then +if $data21 != 32 then return -1 endi if $data31 != 5 then @@ -97,7 +97,7 @@ endi if $data42 != 3 then return -1 endi -if $data52 != 34 then +if $data52 != 32 then return -1 endi if $data62 != 5 then diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 01e416bb26..f59410b552 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -61,7 +61,7 @@ class TDTestCase: self.ins_list = ['ins_dnodes','ins_mnodes','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views', - 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups', 'ins_tsmas', "ins_encryptions", "ins_anodes", "ins_anodes_full"] + 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups', 'ins_tsmas', "ins_encryptions"] self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] def insert_data(self,column_dict,tbname,row_num): insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str) @@ -222,7 +222,7 @@ class TDTestCase: tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'") tdLog.info(len(tdSql.queryResult)) - tdSql.checkEqual(True, len(tdSql.queryResult) in range(280, 281)) + tdSql.checkEqual(True, len(tdSql.queryResult) in range(272, 273)) tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'") tdSql.checkEqual(56, len(tdSql.queryResult)) From c1557c423f72a74e8c9e3ecc3674beb90f6a785d Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Oct 2024 01:12:52 +0000 Subject: [PATCH 32/56] fix/TD-32555-reset-actionpos-when-rollbak --- source/dnode/mnode/impl/src/mndTrans.c | 44 +++++++++++++++----------- source/util/src/terror.c | 2 +- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index fcf7905cd1..657601f5ae 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1252,8 +1252,9 @@ int32_t mndTransProcessRsp(SRpcMsg *pRsp) { pAction->errCode = pRsp->code; pTrans->lastErrorNo = pRsp->code; - mInfo("trans:%d, %s:%d response is received, code:0x%x, accept:0x%x retry:0x%x", transId, - mndTransStr(pAction->stage), action, pRsp->code, pAction->acceptableCode, pAction->retryCode); + mInfo("trans:%d, %s:%d response is received, received code:0x%x(%s), accept:0x%x(%s) retry:0x%x(%s)", transId, + mndTransStr(pAction->stage), action, pRsp->code, tstrerror(pRsp->code), pAction->acceptableCode, + tstrerror(pAction->acceptableCode), pAction->retryCode, tstrerror(pAction->retryCode)); } else { mInfo("trans:%d, invalid action, index:%d, code:0x%x", transId, action, pRsp->code); } @@ -1469,8 +1470,8 @@ static int32_t mndTransExecuteActions(SMnode *pMnode, STrans *pTrans, SArray *pA static int32_t mndTransExecuteRedoActions(SMnode *pMnode, STrans *pTrans, bool topHalf) { int32_t code = mndTransExecuteActions(pMnode, pTrans, pTrans->redoActions, topHalf); if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS && code != TSDB_CODE_MND_TRANS_CTX_SWITCH) { - mError("trans:%d, failed to execute redoActions since:%s, code:0x%x, topHalf:%d", pTrans->id, terrstr(), terrno, - topHalf); + mError("trans:%d, failed to execute redoActions since:%s, code:0x%x, topHalf(TransContext):%d", pTrans->id, + terrstr(), terrno, topHalf); } return code; } @@ -1478,7 +1479,8 @@ static int32_t mndTransExecuteRedoActions(SMnode *pMnode, STrans *pTrans, bool t static int32_t mndTransExecuteUndoActions(SMnode *pMnode, STrans *pTrans, bool topHalf) { int32_t code = mndTransExecuteActions(pMnode, pTrans, pTrans->undoActions, topHalf); if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS && code != TSDB_CODE_MND_TRANS_CTX_SWITCH) { - mError("trans:%d, failed to execute undoActions since %s. topHalf:%d", pTrans->id, terrstr(), topHalf); + mError("trans:%d, failed to execute undoActions since %s. topHalf(TransContext):%d", pTrans->id, terrstr(), + topHalf); } return code; } @@ -1486,7 +1488,8 @@ static int32_t mndTransExecuteUndoActions(SMnode *pMnode, STrans *pTrans, bool t static int32_t mndTransExecuteCommitActions(SMnode *pMnode, STrans *pTrans, bool topHalf) { int32_t code = mndTransExecuteActions(pMnode, pTrans, pTrans->commitActions, topHalf); if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS && code != TSDB_CODE_MND_TRANS_CTX_SWITCH) { - mError("trans:%d, failed to execute commitActions since %s. topHalf:%d", pTrans->id, terrstr(), topHalf); + mError("trans:%d, failed to execute commitActions since %s. topHalf(TransContext):%d", pTrans->id, terrstr(), + topHalf); } return code; } @@ -1500,11 +1503,15 @@ static int32_t mndTransExecuteActionsSerial(SMnode *pMnode, STrans *pTrans, SArr return code; } - mInfo("trans:%d, execute %d actions serial, current action:%d", pTrans->id, numOfActions, pTrans->actionPos); + mInfo("trans:%d, execute %d actions serial, begin at action:%d, stage:%s", pTrans->id, numOfActions, + pTrans->actionPos, mndTransStr(pTrans->stage)); for (int32_t action = pTrans->actionPos; action < numOfActions; ++action) { STransAction *pAction = taosArrayGet(pActions, action); + mInfo("trans:%d, current action:%d, stage:%s, actionType(0:log,1:msg):%d", pTrans->id, pTrans->actionPos, + mndTransStr(pAction->stage), pAction->actionType); + code = mndTransExecSingleAction(pMnode, pTrans, pAction, topHalf); if (code == 0) { if (pAction->msgSent) { @@ -1536,8 +1543,8 @@ static int32_t mndTransExecuteActionsSerial(SMnode *pMnode, STrans *pTrans, SArr if (mndCannotExecuteTransAction(pMnode, topHalf)) { pTrans->lastErrorNo = code; pTrans->code = code; - mInfo("trans:%d, %s:%d, topHalf:%d, not execute next action, code:%s", pTrans->id, mndTransStr(pAction->stage), - action, topHalf, tstrerror(code)); + mInfo("trans:%d, %s:%d, topHalf(TransContext):%d, not execute next action, code:%s", pTrans->id, + mndTransStr(pAction->stage), action, topHalf, tstrerror(code)); break; } @@ -1561,7 +1568,8 @@ static int32_t mndTransExecuteActionsSerial(SMnode *pMnode, STrans *pTrans, SArr break; } else if (code == pAction->retryCode || code == TSDB_CODE_SYN_PROPOSE_NOT_READY || code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_SYN_NOT_LEADER) { - mInfo("trans:%d, %s:%d receive code:0x%x and retry", pTrans->id, mndTransStr(pAction->stage), pAction->id, code); + mInfo("trans:%d, %s:%d receive code:0x%x(%s) and retry", pTrans->id, mndTransStr(pAction->stage), pAction->id, + code, tstrerror(code)); pTrans->lastErrorNo = code; taosMsleep(300); action--; @@ -1570,8 +1578,8 @@ static int32_t mndTransExecuteActionsSerial(SMnode *pMnode, STrans *pTrans, SArr terrno = code; pTrans->lastErrorNo = code; pTrans->code = code; - mInfo("trans:%d, %s:%d receive code:0x%x and wait another schedule, failedTimes:%d", pTrans->id, - mndTransStr(pAction->stage), pAction->id, code, pTrans->failedTimes); + mInfo("trans:%d, %s:%d receive code:0x%x(%s) and wait another schedule, failedTimes:%d", pTrans->id, + mndTransStr(pAction->stage), pAction->id, code, tstrerror(code), pTrans->failedTimes); break; } } @@ -1647,8 +1655,8 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans, bool } else { continueExec = false; } - mInfo("trans:%d, cannot execute redo action stage, topHalf:%d, continueExec:%d, code:%s", pTrans->id, topHalf, - continueExec, tstrerror(code)); + mInfo("trans:%d, cannot execute redo action stage, topHalf(TransContext):%d, continueExec:%d, code:%s", pTrans->id, + topHalf, continueExec, tstrerror(code)); return continueExec; } @@ -1680,7 +1688,9 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans, bool } pTrans->stage = TRN_STAGE_ROLLBACK; - mError("trans:%d, stage from redoAction to rollback since %s", pTrans->id, terrstr()); + pTrans->actionPos = 0; + mError("trans:%d, stage from redoAction to rollback since %s, and set actionPos to %d", pTrans->id, terrstr(), + pTrans->actionPos); continueExec = true; } else { mError("trans:%d, stage keep on redoAction since %s, failedTimes:%d", pTrans->id, terrstr(), pTrans->failedTimes); @@ -1773,8 +1783,6 @@ static bool mndTransPerformRollbackStage(SMnode *pMnode, STrans *pTrans, bool to if (code == 0) { pTrans->stage = TRN_STAGE_UNDO_ACTION; - pTrans->actionPos = 0; - mInfo("trans:%d, stage from rollback to undoAction, actionPos:%d", pTrans->id, pTrans->actionPos); continueExec = true; } else { pTrans->failedTimes++; @@ -1829,7 +1837,7 @@ void mndTransExecuteImp(SMnode *pMnode, STrans *pTrans, bool topHalf) { bool continueExec = true; while (continueExec) { - mInfo("trans:%d, continue to execute, stage:%s createTime:%" PRId64 " topHalf:%d", pTrans->id, + mInfo("trans:%d, continue to execute, stage:%s createTime:%" PRId64 " topHalf(TransContext):%d", pTrans->id, mndTransStr(pTrans->stage), pTrans->createdTime, topHalf); pTrans->lastExecTime = taosGetTimestampMs(); switch (pTrans->stage) { diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 1c94a5f2e4..35f0bc73eb 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -314,7 +314,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CLOG_IS_NULL, "Transaction commitlog TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_NETWORK_UNAVAILL, "Unable to establish connection While execute transaction and will continue in the background") TAOS_DEFINE_ERROR(TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED, "Last Transaction not finished") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_SYNC_TIMEOUT, "Sync timeout While execute transaction and will continue in the background") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CTX_SWITCH, "Transaction context switch") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CTX_SWITCH, "Wrong transaction execution context") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_CONFLICT_COMPACT, "Transaction not completed due to conflict with compact") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TRANS_UNKNOW_ERROR, "Unknown transaction error") From c372959cef3d6da7077dff3d3514f0c08a2736dc Mon Sep 17 00:00:00 2001 From: Jinqing Kuang Date: Tue, 15 Oct 2024 11:32:26 +0800 Subject: [PATCH 33/56] fix(query)[TD-30667]. Fix avx/avx2 check and compilation on ARM platform --- cmake/cmake.define | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index fd8f42de2f..9fae397363 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -160,12 +160,21 @@ ELSE () CHECK_C_COMPILER_FLAG("-msse4.2" COMPILER_SUPPORT_SSE42) ENDIF() - CHECK_C_COMPILER_FLAG("-mfma" COMPILER_SUPPORT_FMA) - CHECK_C_COMPILER_FLAG("-mavx" COMPILER_SUPPORT_AVX) - CHECK_C_COMPILER_FLAG("-mavx2" COMPILER_SUPPORT_AVX2) - CHECK_C_COMPILER_FLAG("-mavx512f" COMPILER_SUPPORT_AVX512F) - CHECK_C_COMPILER_FLAG("-mavx512vbmi" COMPILER_SUPPORT_AVX512BMI) - CHECK_C_COMPILER_FLAG("-mavx512vl" COMPILER_SUPPORT_AVX512VL) + IF (TD_ARM_64 OR TD_ARM_32) + SET(COMPILER_SUPPORT_FMA false) + SET(COMPILER_SUPPORT_AVX false) + SET(COMPILER_SUPPORT_AVX2 false) + SET(COMPILER_SUPPORT_AVX512F false) + SET(COMPILER_SUPPORT_AVX512BMI false) + SET(COMPILER_SUPPORT_AVX512VL false) + ELSE() + CHECK_C_COMPILER_FLAG("-mfma" COMPILER_SUPPORT_FMA) + CHECK_C_COMPILER_FLAG("-mavx" COMPILER_SUPPORT_AVX) + CHECK_C_COMPILER_FLAG("-mavx2" COMPILER_SUPPORT_AVX2) + CHECK_C_COMPILER_FLAG("-mavx512f" COMPILER_SUPPORT_AVX512F) + CHECK_C_COMPILER_FLAG("-mavx512vbmi" COMPILER_SUPPORT_AVX512BMI) + CHECK_C_COMPILER_FLAG("-mavx512vl" COMPILER_SUPPORT_AVX512VL) + ENDIF() IF (COMPILER_SUPPORT_SSE42) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2") @@ -182,12 +191,13 @@ ELSE () IF (COMPILER_SUPPORT_AVX) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") + MESSAGE(STATUS "AVX instructions is ACTIVATED") ENDIF() IF (COMPILER_SUPPORT_AVX2) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") + MESSAGE(STATUS "AVX2 instructions is ACTIVATED") ENDIF() - MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") IF ("${SIMD_AVX512_SUPPORT}" MATCHES "true") IF (COMPILER_SUPPORT_AVX512F AND COMPILER_SUPPORT_AVX512BMI) From 8663779def87d90d1702924f5d1c81a34633e73c Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Oct 2024 03:56:47 +0000 Subject: [PATCH 34/56] fix/wal-load-file-set --- source/libs/wal/src/walMeta.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 9ade5e5638..cb9f6e2dfe 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -253,6 +253,7 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) int j = 0; // both of the lists in asc order + /* for (int i = 0; i < actualFileNum; i++) { SWalFileInfo* pLogInfo = taosArrayGet(actualLogList, i); while (j < metaFileNum) { @@ -268,6 +269,7 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) } } } + */ taosArrayClear(metaLogList); @@ -400,6 +402,17 @@ static int32_t walTrimIdxFile(SWal* pWal, int32_t fileIdx) { TAOS_RETURN(TSDB_CODE_SUCCESS); } +void printFileSet(SArray* fileSet) { + int32_t sz = taosArrayGetSize(fileSet); + for (int32_t i = 0; i < sz; i++) { + SWalFileInfo* pFileInfo = taosArrayGet(fileSet, i); + wInfo("firstVer:%" PRId64 ", lastVer:%" PRId64 ", fileSize:%" PRId64 ", syncedOffset:%" PRId64 ", createTs:%" PRId64 + ", closeTs:%" PRId64, + pFileInfo->firstVer, pFileInfo->lastVer, pFileInfo->fileSize, pFileInfo->syncedOffset, pFileInfo->createTs, + pFileInfo->closeTs); + } +} + int32_t walCheckAndRepairMeta(SWal* pWal) { // load log files, get first/snapshot/last version info int32_t code = 0; @@ -460,6 +473,9 @@ int32_t walCheckAndRepairMeta(SWal* pWal) { taosArraySort(actualLog, compareWalFileInfo); + wInfo("vgId:%d, wal path:%s, actual log file num:%" PRId64, pWal->cfg.vgId, pWal->path, taosArrayGetSize(actualLog)); + printFileSet(actualLog); + int metaFileNum = taosArrayGetSize(pWal->fileInfoSet); int actualFileNum = taosArrayGetSize(actualLog); int64_t firstVerPrev = pWal->vers.firstVer; @@ -474,6 +490,10 @@ int32_t walCheckAndRepairMeta(SWal* pWal) { TAOS_RETURN(code); } + wInfo("vgId:%d, wal path:%s, meta log file num:%" PRId64, pWal->cfg.vgId, pWal->path, + taosArrayGetSize(pWal->fileInfoSet)); + printFileSet(pWal->fileInfoSet); + int32_t sz = taosArrayGetSize(pWal->fileInfoSet); // scan and determine the lastVer @@ -1124,6 +1144,10 @@ int32_t walLoadMeta(SWal* pWal) { (void)taosCloseFile(&pFile); taosMemoryFree(buf); + wInfo("vgId:%d, load meta file: %s, fileInfoSet size:%" PRId64, pWal->cfg.vgId, fnameStr, + taosArrayGetSize(pWal->fileInfoSet)); + printFileSet(pWal->fileInfoSet); + TAOS_RETURN(code); } From a00dfb52e10760423ae2f0b87fd9f57feb2f3d25 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 15 Oct 2024 14:00:15 +0800 Subject: [PATCH 35/56] fix:[TS-5528] insert error in sml --- source/client/inc/clientSml.h | 1 + source/client/src/clientSml.c | 8 ++++++-- source/client/src/clientSmlLine.c | 4 ++++ tests/system-test/2-query/sml.py | 4 ++++ utils/test/c/sml_test.c | 32 +++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/source/client/inc/clientSml.h b/source/client/inc/clientSml.h index 209c376f30..a6aca2fddf 100644 --- a/source/client/inc/clientSml.h +++ b/source/client/inc/clientSml.h @@ -199,6 +199,7 @@ typedef struct { SArray *preLineTagKV; SArray *maxTagKVs; SArray *maxColKVs; + SArray *escapedStringList; SSmlLineInfo preLine; STableMeta *currSTableMeta; diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index d5cca55701..80f583bbee 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -479,6 +479,7 @@ int32_t smlParseEndLine(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs) } clearColValArraySml(info->currTableDataCtx->pValues); + taosArrayClearP(info->escapedStringList, taosMemoryFree); if (unlikely(ret != TSDB_CODE_SUCCESS)) { smlBuildInvalidDataMsg(&info->msgBuf, "smlBuildCol error", NULL); return ret; @@ -1608,6 +1609,7 @@ void smlDestroyInfo(SSmlHandle *info) { taosArrayDestroy(info->valueJsonArray); taosArrayDestroyEx(info->preLineTagKV, freeSSmlKv); + taosArrayDestroyP(info->escapedStringList, taosMemoryFree); if (!info->dataFormat) { for (int i = 0; i < info->lineNum; i++) { @@ -1667,8 +1669,9 @@ int32_t smlBuildSmlInfo(TAOS *taos, SSmlHandle **handle) { info->tagJsonArray = taosArrayInit(8, POINTER_BYTES); info->valueJsonArray = taosArrayInit(8, POINTER_BYTES); info->preLineTagKV = taosArrayInit(8, sizeof(SSmlKv)); - - if (info->tagJsonArray == NULL || info->valueJsonArray == NULL || info->preLineTagKV == NULL) { + info->escapedStringList = taosArrayInit(8, POINTER_BYTES); + if (info->tagJsonArray == NULL || info->valueJsonArray == NULL || + info->preLineTagKV == NULL || info->escapedStringList == NULL) { uError("SML:0x%" PRIx64 " failed to allocate memory", info->id); code = terrno; goto FAILED; @@ -1949,6 +1952,7 @@ int32_t smlClearForRerun(SSmlHandle *info) { } } + taosArrayClearP(info->escapedStringList, taosMemoryFree); (void)memset(&info->preLine, 0, sizeof(SSmlLineInfo)); info->currSTableMeta = NULL; info->currTableDataCtx = NULL; diff --git a/source/client/src/clientSmlLine.c b/source/client/src/clientSmlLine.c index e620ca9b0c..fabda47ae1 100644 --- a/source/client/src/clientSmlLine.c +++ b/source/client/src/clientSmlLine.c @@ -451,6 +451,10 @@ static int32_t smlParseColLine(SSmlHandle *info, char **sql, char *sqlEnd, SSmlL if (info->dataFormat) { bool isAligned = isSmlColAligned(info, cnt, &kv); + if (kv.type == TSDB_DATA_TYPE_BINARY && valueEscaped) { + taosArrayPush(info->escapedStringList, &kv.value); + kv.value = NULL; + } freeSSmlKv(&kv); if(!isAligned){ return TSDB_CODE_SUCCESS; diff --git a/tests/system-test/2-query/sml.py b/tests/system-test/2-query/sml.py index e28f3b1edd..4a8760cd67 100644 --- a/tests/system-test/2-query/sml.py +++ b/tests/system-test/2-query/sml.py @@ -105,6 +105,10 @@ class TDTestCase: tdSql.query(f"select * from ts3724.`stb2.`") tdSql.checkRows(1) + tdSql.query(f"select * from ts5528.device_log_yuelan_cs1") + tdSql.checkRows(2) + tdSql.checkData(0, 1, '{"deviceId":"星宇公司-861701069493741","headers":{"_uid":"4e3599eacd62834995c77b38ad95f88d","creatorId":"1199596756811550720","deviceNmae":"861701069493741","productId":"yuelan","productName":"悦蓝cat1穿戴设备"},"messageType":"REPORT_PROPERTY","properties":{"lat":35.265527067449185,"lng":118.49713144245987,"location":"118.49713144245987,35.265527067449185"},"timestamp":1728719963230}') + tdSql.checkData(1, 1, '{"deviceId":"星宇公司-861701069065507","headers":{"_uid":"9045d6b78b4ffaf1e2d244e912ebbff8","creatorId":"1199596756811550720","deviceNmae":"861701069065507","productId":"yuelan","productName":"悦蓝cat1穿戴设备"},"messageType":"REPORT_PROPERTY","properties":{"lat":36.788241914043425,"lng":119.15042325460891,"location":"119.15042325460891,36.788241914043425"},"timestamp":1728719964105}') # tdSql.query(f"select * from td24559.stb order by _ts") # tdSql.checkRows(4) # tdSql.checkData(0, 2, "POINT (4.343000 89.342000)") diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index a3830d2518..4f4f09bd85 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -2098,12 +2098,44 @@ int sml_td29373_Test() { return code; } +int sml_ts5528_test(){ + TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); + + TAOS_RES *pRes = taos_query(taos, "drop database if exists ts5528"); + taos_free_result(pRes); + + pRes = taos_query(taos, "create database if not exists ts5528"); + taos_free_result(pRes); + + // check column name duplication + char *sql[] = { + "device_log_yuelan_cs1,deviceId=861701069493741 content=\"{\\\"deviceId\\\":\\\"星宇公司-861701069493741\\\",\\\"headers\\\":{\\\"_uid\\\":\\\"4e3599eacd62834995c77b38ad95f88d\\\",\\\"creatorId\\\":\\\"1199596756811550720\\\",\\\"deviceNmae\\\":\\\"861701069493741\\\",\\\"productId\\\":\\\"yuelan\\\",\\\"productName\\\":\\\"悦蓝cat1穿戴设备\\\"},\\\"messageType\\\":\\\"REPORT_PROPERTY\\\",\\\"properties\\\":{\\\"lat\\\":35.265527067449185,\\\"lng\\\":118.49713144245987,\\\"location\\\":\\\"118.49713144245987,35.265527067449185\\\"},\\\"timestamp\\\":1728719963230}\",createTime=1728719963230i64,id=\"4e3599eacd62834995c77b38ad95f88d\",messageId=\"\",timestamp=1728719963230i64,type=\"reportProperty\" 1728719963230", + "device_log_yuelan_cs1,deviceId=861701069065507 content=\"{\\\"deviceId\\\":\\\"星宇公司-861701069065507\\\",\\\"headers\\\":{\\\"_uid\\\":\\\"9045d6b78b4ffaf1e2d244e912ebbff8\\\",\\\"creatorId\\\":\\\"1199596756811550720\\\",\\\"deviceNmae\\\":\\\"861701069065507\\\",\\\"productId\\\":\\\"yuelan\\\",\\\"productName\\\":\\\"悦蓝cat1穿戴设备\\\"},\\\"messageType\\\":\\\"REPORT_PROPERTY\\\",\\\"properties\\\":{\\\"lat\\\":36.788241914043425,\\\"lng\\\":119.15042325460891,\\\"location\\\":\\\"119.15042325460891,36.788241914043425\\\"},\\\"timestamp\\\":1728719964105}\",createTime=1728719964105i64,id=\"9045d6b78b4ffaf1e2d244e912ebbff8\",messageId=\"\",timestamp=1728719964105i64,type=\"reportProperty\" 1728719964105", + }; + pRes = taos_query(taos, "use ts5528"); + taos_free_result(pRes); + + for( int i = 0; i < 2; i++){ + int32_t totalRows = 0; + pRes = taos_schemaless_insert_raw(taos, sql[i], strlen(sql[i]), &totalRows, TSDB_SML_LINE_PROTOCOL, + TSDB_SML_TIMESTAMP_MILLI_SECONDS); + taos_free_result(pRes); + int code = taos_errno(pRes); + if (code != 0) { + return code; + } + } + printf("%s result success\n", __FUNCTION__); + return 0; +} int main(int argc, char *argv[]) { if (argc == 2) { taos_options(TSDB_OPTION_CONFIGDIR, argv[1]); } int ret = 0; + ret = sml_ts5528_test(); + ASSERT(!ret); ret = sml_td29691_Test(); ASSERT(ret); ret = sml_td29373_Test(); From b40db3fab138bce2270818b3d3553617be206560 Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:13:24 +0800 Subject: [PATCH 36/56] Update 17-mongodb.md --- docs/zh/06-advanced/05-data-in/17-mongodb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/06-advanced/05-data-in/17-mongodb.md b/docs/zh/06-advanced/05-data-in/17-mongodb.md index 2434e2e122..5311bc43c6 100644 --- a/docs/zh/06-advanced/05-data-in/17-mongodb.md +++ b/docs/zh/06-advanced/05-data-in/17-mongodb.md @@ -13,7 +13,7 @@ MongoDB 是一个介于关系型数据库与非关系型数据库之间的产品 ### 1. 新增数据源 -在数据写入页面中点击左上角的 **+新增数据源** 按钮进入新增数据源页面,如下图所示: +在数据写入页面中点击右上角的 **+新增数据源** 按钮进入新增数据源页面,如下图所示: ![Common-zh00-EnterDataSourcePage.png](./pic/Common-zh00-EnterDataSourcePage.png "进入新增数据源页面") From 986f92d31766482b6aab5784d94980e71760236f Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 15 Oct 2024 14:30:36 +0800 Subject: [PATCH 37/56] fix:[TS-5528] insert error in sml --- utils/test/c/sml_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 4f4f09bd85..1d8d82ccb9 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -2119,12 +2119,14 @@ int sml_ts5528_test(){ int32_t totalRows = 0; pRes = taos_schemaless_insert_raw(taos, sql[i], strlen(sql[i]), &totalRows, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_MILLI_SECONDS); - taos_free_result(pRes); int code = taos_errno(pRes); + taos_free_result(pRes); if (code != 0) { + taos_close(taos); return code; } } + taos_close(taos); printf("%s result success\n", __FUNCTION__); return 0; } From f048de5b44c27e1b22c5992dd66fa643913126b4 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 15 Oct 2024 14:35:58 +0800 Subject: [PATCH 38/56] Revert "stmt2/interlace: separate interlace batch adding into exec2" This reverts commit bcfd74e697a3972acd1d001e482d9def2a01ee74. --- source/client/src/clientStmt2.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index b78e0d0f56..0837154fce 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1200,6 +1200,22 @@ static int stmtAddBatch2(TAOS_STMT2* stmt) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_ADD_BATCH)); + if (pStmt->sql.stbInterlaceMode) { + int64_t startUs2 = taosGetTimestampUs(); + pStmt->stat.addBatchUs += startUs2 - startUs; + + pStmt->sql.siInfo.tableColsReady = false; + + SStmtQNode* param = NULL; + STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m)); + param->restoreTbCols = true; + param->next = NULL; + + stmtEnqueue(pStmt, param); + + return TSDB_CODE_SUCCESS; + } + STMT_ERR_RET(stmtCacheBlock(pStmt)); return TSDB_CODE_SUCCESS; @@ -1611,22 +1627,6 @@ int stmtExec2(TAOS_STMT2* stmt, int* affected_rows) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE)); - if (pStmt->sql.stbInterlaceMode) { - int64_t startUs2 = taosGetTimestampUs(); - pStmt->stat.addBatchUs += startUs2 - startUs; - - pStmt->sql.siInfo.tableColsReady = false; - - SStmtQNode* param = NULL; - STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m)); - param->restoreTbCols = true; - param->next = NULL; - - stmtEnqueue(pStmt, param); - - return TSDB_CODE_SUCCESS; - } - if (STMT_TYPE_QUERY != pStmt->sql.type) { if (pStmt->sql.stbInterlaceMode) { int64_t startTs = taosGetTimestampUs(); From 7348eddc092f9e7f98c7ff449fe0cc443947e534 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 15 Oct 2024 14:51:07 +0800 Subject: [PATCH 39/56] stmt2/add batch: move interlace add batch into exec2 --- source/client/src/clientStmt2.c | 8 +++++-- source/libs/parser/src/parUtil.c | 40 ++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index 0837154fce..2f046b61d6 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1419,10 +1419,10 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) { if (pStmt->sql.stbInterlaceMode) { STMT_ERR_RET(stmtAppendTablePostHandle(pStmt, param)); + } else { + STMT_ERR_RET(stmtAddBatch2(pStmt)); } - STMT_ERR_RET(stmtAddBatch2(pStmt)); - pStmt->stat.bindDataUs4 += taosGetTimestampUs() - startUs4; return TSDB_CODE_SUCCESS; @@ -1625,6 +1625,10 @@ int stmtExec2(TAOS_STMT2* stmt, int* affected_rows) { return pStmt->errCode; } + if (pStmt->sql.stbInterlaceMode) { + STMT_ERR_RET(stmtAddBatch2(pStmt)); + } + STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE)); if (STMT_TYPE_QUERY != pStmt->sql.type) { diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 98676160cb..9c2977d289 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -247,7 +247,10 @@ int32_t generateSyntaxErrMsgExt(SMsgBuf* pBuf, int32_t errCode, const char* pFor } int32_t buildInvalidOperationMsg(SMsgBuf* pBuf, const char* msg) { - strncpy(pBuf->buf, msg, pBuf->len); + if (pBuf->buf) { + strncpy(pBuf->buf, msg, pBuf->len); + } + return TSDB_CODE_TSC_INVALID_OPERATION; } @@ -259,7 +262,6 @@ int32_t buildInvalidOperationMsgExt(SMsgBuf* pBuf, const char* pFormat, ...) { return TSDB_CODE_TSC_INVALID_OPERATION; } - int32_t buildSyntaxErrMsg(SMsgBuf* pBuf, const char* additionalInfo, const char* sourceStr) { if (pBuf == NULL) return TSDB_CODE_TSC_SQL_SYNTAX_ERROR; const char* msgFormat1 = "syntax error near \'%s\'"; @@ -328,7 +330,7 @@ STableMeta* tableMetaDup(const STableMeta* pTableMeta) { STableMeta* p = taosMemoryMalloc(size + schemaExtSize); if (NULL == p) return NULL; - memcpy(p, pTableMeta, schemaExtSize+size); + memcpy(p, pTableMeta, schemaExtSize + size); if (hasSchemaExt) { p->schemaExt = (SSchemaExt*)(((char*)p) + size); } else { @@ -453,7 +455,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi // strcpy(val.colName, colName); val.pKey = jsonKey; retCode = taosHashPut(keyHash, jsonKey, keyLen, &keyLen, - CHAR_BYTES); // add key to hash to remove dumplicate, value is useless + CHAR_BYTES); // add key to hash to remove dumplicate, value is useless if (TSDB_CODE_SUCCESS != retCode) { goto end; } @@ -649,7 +651,7 @@ static int32_t buildTableReq(SHashObj* pTablesHash, SArray** pTables) { char* pKey = taosHashGetKey(p, &len); char fullName[TSDB_TABLE_FNAME_LEN] = {0}; strncpy(fullName, pKey, len); - SName name = {0}; + SName name = {0}; int32_t code = tNameFromString(&name, fullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); if (TSDB_CODE_SUCCESS == code) { if (NULL == taosArrayPush(*pTables, &name)) { @@ -816,9 +818,10 @@ int32_t buildCatalogReq(const SParseMetaCache* pMetaCache, SCatalogReq* pCatalog return code; } -int32_t createSelectStmtImpl(bool isDistinct, SNodeList* pProjectionList, SNode* pTable, SNodeList* pHint, SNode** ppSelect) { +int32_t createSelectStmtImpl(bool isDistinct, SNodeList* pProjectionList, SNode* pTable, SNodeList* pHint, + SNode** ppSelect) { SSelectStmt* select = NULL; - int32_t code = nodesMakeNode(QUERY_NODE_SELECT_STMT, (SNode**)&select); + int32_t code = nodesMakeNode(QUERY_NODE_SELECT_STMT, (SNode**)&select); if (NULL == select) { return code; } @@ -861,7 +864,7 @@ int32_t getMetaDataFromHash(const char* pKey, int32_t len, SHashObj* pHash, void static int32_t putTableDataToCache(const SArray* pTableReq, const SArray* pTableData, SHashObj** pTable) { int32_t ntables = taosArrayGetSize(pTableReq); for (int32_t i = 0; i < ntables; ++i) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(taosArrayGet(pTableReq, i), fullName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -892,7 +895,7 @@ static int32_t putDbTableDataToCache(const SArray* pDbReq, const SArray* pTableD STablesReq* pReq = taosArrayGet(pDbReq, i); int32_t ntables = taosArrayGetSize(pReq->pTables); for (int32_t j = 0; j < ntables; ++j) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(taosArrayGet(pReq->pTables, j), fullName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -1088,7 +1091,7 @@ int32_t buildTableMetaFromViewMeta(STableMeta** pMeta, SViewMeta* pViewMeta) { } int32_t getViewMetaFromCache(SParseMetaCache* pMetaCache, const SName* pName, STableMeta** pMeta) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pName, fullName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -1139,7 +1142,7 @@ int32_t reserveTableVgroupInCacheExt(const SName* pName, SParseMetaCache* pMetaC } int32_t getTableVgroupFromCache(SParseMetaCache* pMetaCache, const SName* pName, SVgroupInfo* pVgroup) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pName, fullName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -1299,7 +1302,7 @@ int32_t reserveTableCfgInCache(int32_t acctId, const char* pDb, const char* pTab return reserveTableReqInCache(acctId, pDb, pTable, &pMetaCache->pTableCfg); } -int32_t reserveTableTSMAInfoInCache(int32_t acctId, const char *pDb, const char *pTable, SParseMetaCache *pMetaCache) { +int32_t reserveTableTSMAInfoInCache(int32_t acctId, const char* pDb, const char* pTable, SParseMetaCache* pMetaCache) { return reserveTableReqInCache(acctId, pDb, pTable, &pMetaCache->pTableTSMAs); } @@ -1308,9 +1311,10 @@ int32_t reserveTSMAInfoInCache(int32_t acctId, const char* pDb, const char* pTsm } int32_t getTableIndexFromCache(SParseMetaCache* pMetaCache, const SName* pName, SArray** pIndexes) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pName, fullName); - if (TSDB_CODE_SUCCESS != code) return code;; + if (TSDB_CODE_SUCCESS != code) return code; + ; SArray* pSmaIndexes = NULL; code = getMetaDataFromHash(fullName, strlen(fullName), pMetaCache->pTableIndex, (void**)&pSmaIndexes); if (TSDB_CODE_SUCCESS == code && NULL != pSmaIndexes) { @@ -1323,7 +1327,7 @@ int32_t getTableIndexFromCache(SParseMetaCache* pMetaCache, const SName* pName, } int32_t getTableTsmasFromCache(SParseMetaCache* pMetaCache, const SName* pTbName, SArray** pTsmas) { - char tbFName[TSDB_TABLE_FNAME_LEN]; + char tbFName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pTbName, tbFName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -1337,7 +1341,7 @@ int32_t getTableTsmasFromCache(SParseMetaCache* pMetaCache, const SName* pTbName } int32_t getTsmaFromCache(SParseMetaCache* pMetaCache, const SName* pTsmaName, STableTSMAInfo** pTsma) { - char tsmaFName[TSDB_TABLE_FNAME_LEN]; + char tsmaFName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pTsmaName, tsmaFName); if (TSDB_CODE_SUCCESS != code) { return code; @@ -1349,7 +1353,7 @@ int32_t getTsmaFromCache(SParseMetaCache* pMetaCache, const SName* pTsmaName, ST return TSDB_CODE_PAR_INTERNAL_ERROR; } *pTsma = taosArrayGetP(pTsmaRsp->pTsmas, 0); - } else if (code == TSDB_CODE_PAR_INTERNAL_ERROR){ + } else if (code == TSDB_CODE_PAR_INTERNAL_ERROR) { code = TSDB_CODE_MND_SMA_NOT_EXIST; } return code; @@ -1410,7 +1414,7 @@ err: } int32_t getTableCfgFromCache(SParseMetaCache* pMetaCache, const SName* pName, STableCfg** pOutput) { - char fullName[TSDB_TABLE_FNAME_LEN]; + char fullName[TSDB_TABLE_FNAME_LEN]; int32_t code = tNameExtractFullName(pName, fullName); if (TSDB_CODE_SUCCESS != code) { return code; From 490466747184737a44688eec38db16fd0b004020 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 15 Oct 2024 15:19:37 +0800 Subject: [PATCH 40/56] fix:[TS-5528] insert error in sml --- source/client/src/clientSml.c | 5 ++--- source/client/src/clientSmlLine.c | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 80f583bbee..46aaf29b6b 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -262,7 +262,7 @@ int32_t smlBuildSuperTableInfo(SSmlHandle *info, SSmlLineInfo *currElement, SSml return TSDB_CODE_SUCCESS; } -bool isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { +void isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { // cnt begin 0, add ts so + 2 if (unlikely(cnt + 2 > info->currSTableMeta->tableInfo.numOfColumns)) { goto END; @@ -288,12 +288,11 @@ bool isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { maxKV->length = kv->length; info->needModifySchema = true; } - return true; + return; END: info->dataFormat = false; info->reRun = true; - return false; } bool isSmlTagAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { diff --git a/source/client/src/clientSmlLine.c b/source/client/src/clientSmlLine.c index fabda47ae1..c1f3431698 100644 --- a/source/client/src/clientSmlLine.c +++ b/source/client/src/clientSmlLine.c @@ -452,7 +452,10 @@ static int32_t smlParseColLine(SSmlHandle *info, char **sql, char *sqlEnd, SSmlL if (info->dataFormat) { bool isAligned = isSmlColAligned(info, cnt, &kv); if (kv.type == TSDB_DATA_TYPE_BINARY && valueEscaped) { - taosArrayPush(info->escapedStringList, &kv.value); + if (taosArrayPush(info->escapedStringList, &kv.value) == NULL){ + freeSSmlKv(&kv); + return terrno; + } kv.value = NULL; } freeSSmlKv(&kv); @@ -463,10 +466,12 @@ static int32_t smlParseColLine(SSmlHandle *info, char **sql, char *sqlEnd, SSmlL if (currElement->colArray == NULL) { currElement->colArray = taosArrayInit_s(sizeof(SSmlKv), 1); if (currElement->colArray == NULL) { + freeSSmlKv(&kv); return terrno; } } if (taosArrayPush(currElement->colArray, &kv) == NULL){ // reserve for timestamp + freeSSmlKv(&kv); return terrno; } } From c9f835e60d742e5608b902f11e0e910c4ccd0dd2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 15 Oct 2024 15:25:28 +0800 Subject: [PATCH 41/56] fix:[TS-5528] insert error in sml --- source/client/src/clientSml.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 46aaf29b6b..80f583bbee 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -262,7 +262,7 @@ int32_t smlBuildSuperTableInfo(SSmlHandle *info, SSmlLineInfo *currElement, SSml return TSDB_CODE_SUCCESS; } -void isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { +bool isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { // cnt begin 0, add ts so + 2 if (unlikely(cnt + 2 > info->currSTableMeta->tableInfo.numOfColumns)) { goto END; @@ -288,11 +288,12 @@ void isSmlColAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { maxKV->length = kv->length; info->needModifySchema = true; } - return; + return true; END: info->dataFormat = false; info->reRun = true; + return false; } bool isSmlTagAligned(SSmlHandle *info, int cnt, SSmlKv *kv) { From 056fbe5eb3ad9e92000c8d4e8c903fd4721a1e3f Mon Sep 17 00:00:00 2001 From: Jinqing Kuang Date: Tue, 15 Oct 2024 15:30:04 +0800 Subject: [PATCH 42/56] fix(query)[TD-30667]. Fix compilation with AVX instructions on older GCC versions --- include/util/tcompression.h | 2 +- source/util/src/tdecompress.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/util/tcompression.h b/include/util/tcompression.h index d32d20b727..1f09b750cb 100644 --- a/include/util/tcompression.h +++ b/include/util/tcompression.h @@ -156,9 +156,9 @@ int32_t getWordLength(char type); int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, char *const output, const char type); int32_t tsDecompressFloatImpAvx2(const char *input, int32_t nelements, char *output); int32_t tsDecompressDoubleImpAvx2(const char *input, int32_t nelements, char *output); -void tsDecompressTimestampAvx2(const char *input, int32_t nelements, char *output, bool bigEndian); #endif #ifdef __AVX512VL__ +void tsDecompressTimestampAvx2(const char *input, int32_t nelements, char *output, bool bigEndian); void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool bigEndian); #endif diff --git a/source/util/src/tdecompress.c b/source/util/src/tdecompress.c index 60a1f1c938..81223d7311 100644 --- a/source/util/src/tdecompress.c +++ b/source/util/src/tdecompress.c @@ -449,7 +449,9 @@ int32_t tsDecompressDoubleImpAvx2(const char *input, const int32_t nelements, ch } return (int32_t)(out - output); } +#endif +#if __AVX512VL__ // decode two timestamps in one loop. void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, char *const output, bool bigEndian) { int64_t *ostream = (int64_t *)output; @@ -588,9 +590,7 @@ void tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, } return; } -#endif -#if __AVX512VL__ void tsDecompressTimestampAvx512(const char *const input, const int32_t nelements, char *const output, bool UNUSED_PARAM(bigEndian)) { int64_t *ostream = (int64_t *)output; From ca7f490e6d6fbf07aa400c1c37d292180985924c Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Tue, 15 Oct 2024 16:53:15 +0800 Subject: [PATCH 43/56] fix invaild snapshotVer while repair wal meta file --- include/libs/wal/wal.h | 1 + source/dnode/mnode/impl/src/mndMain.c | 1 + source/dnode/vnode/src/vnd/vnodeCfg.c | 1 + source/dnode/vnode/src/vnd/vnodeCommit.c | 1 + source/libs/wal/src/walMeta.c | 6 ++++++ 5 files changed, 10 insertions(+) diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index 74ab0bf484..f95b3f20ca 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -50,6 +50,7 @@ typedef struct { int32_t rollPeriod; // secs int64_t retentionSize; int64_t segSize; + int64_t committed; EWalType level; // wal level int32_t encryptAlgorithm; char encryptKey[ENCRYPT_KEY_LEN + 1]; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index bee971b966..685ad2b7a5 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -515,6 +515,7 @@ static int32_t mndInitWal(SMnode *pMnode) { .fsyncPeriod = 0, .rollPeriod = -1, .segSize = -1, + .committed = -1, .retentionPeriod = 0, .retentionSize = 0, .level = TAOS_WAL_FSYNC, diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index d3acea4766..7c789e84ae 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -45,6 +45,7 @@ const SVnodeCfg vnodeCfgDefault = {.vgId = -1, .retentionPeriod = -1, .rollPeriod = 0, .segSize = 0, + .committed = 0, .retentionSize = -1, .level = TAOS_WAL_WRITE, .clearFiles = 0, diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 4a4d305f25..dae2b3a5ec 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -257,6 +257,7 @@ int vnodeLoadInfo(const char *dir, SVnodeInfo *pInfo) { code = vnodeDecodeInfo(pData, pInfo); TSDB_CHECK_CODE(code, lino, _exit); + pInfo->config.walCfg.committed = pInfo->state.committed; _exit: if (code) { if (pFile) { diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 9ade5e5638..8649581d5d 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -282,6 +282,12 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) } static void walAlignVersions(SWal* pWal) { + if (pWal->cfg.committed > 0 && pWal->cfg.committed != pWal->vers.snapshotVer) { + wWarn("vgId:%d, snapshotVer:%" PRId64 " in wal is different from commited:%" PRId64 + ". in vnode/mnode. align with it.", + pWal->cfg.vgId, pWal->vers.snapshotVer, pWal->cfg.committed); + pWal->vers.snapshotVer = pWal->cfg.committed; + } if (pWal->vers.firstVer > pWal->vers.snapshotVer + 1) { wWarn("vgId:%d, firstVer:%" PRId64 " is larger than snapshotVer:%" PRId64 " + 1. align with it.", pWal->cfg.vgId, pWal->vers.firstVer, pWal->vers.snapshotVer); From e4373116b2e566ff0834b3b65f76abc1ab61abf3 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Oct 2024 09:04:20 +0000 Subject: [PATCH 44/56] fix/wal-load-file-set --- source/libs/wal/src/walMeta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index cb9f6e2dfe..f84496eee2 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -253,7 +253,6 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) int j = 0; // both of the lists in asc order - /* for (int i = 0; i < actualFileNum; i++) { SWalFileInfo* pLogInfo = taosArrayGet(actualLogList, i); while (j < metaFileNum) { @@ -269,7 +268,6 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) } } } - */ taosArrayClear(metaLogList); @@ -553,6 +551,7 @@ int32_t walCheckAndRepairMeta(SWal* pWal) { // repair ts of files TAOS_CHECK_RETURN(walRepairLogFileTs(pWal, &updateMeta)); + printFileSet(pWal->fileInfoSet); // update meta file if (updateMeta) { TAOS_CHECK_RETURN(walSaveMeta(pWal)); From 47d39c4ab8d5295750992b7373f57bb4943ec4fd Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Tue, 15 Oct 2024 17:23:28 +0800 Subject: [PATCH 45/56] fix wal test in ci --- source/libs/wal/test/walMetaTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/wal/test/walMetaTest.cpp b/source/libs/wal/test/walMetaTest.cpp index 8bd4de0a89..a0285f1363 100644 --- a/source/libs/wal/test/walMetaTest.cpp +++ b/source/libs/wal/test/walMetaTest.cpp @@ -127,6 +127,7 @@ class WalRetentionEnv : public ::testing::Test { SWalCfg cfg; cfg.rollPeriod = -1; cfg.segSize = -1; + cfg.committed =-1; cfg.retentionPeriod = -1; cfg.retentionSize = 0; cfg.rollPeriod = 0; From 39c429182e04a034fbd1f5dd8a95ff88056a79b2 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Oct 2024 10:46:25 +0000 Subject: [PATCH 46/56] fix/wal-load-file-set-fix-case --- source/libs/wal/src/walMeta.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index f84496eee2..17830ff200 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -471,7 +471,8 @@ int32_t walCheckAndRepairMeta(SWal* pWal) { taosArraySort(actualLog, compareWalFileInfo); - wInfo("vgId:%d, wal path:%s, actual log file num:%" PRId64, pWal->cfg.vgId, pWal->path, taosArrayGetSize(actualLog)); + wInfo("vgId:%d, wal path:%s, actual log file num:%d", pWal->cfg.vgId, pWal->path, + (int32_t)taosArrayGetSize(actualLog)); printFileSet(actualLog); int metaFileNum = taosArrayGetSize(pWal->fileInfoSet); @@ -488,8 +489,8 @@ int32_t walCheckAndRepairMeta(SWal* pWal) { TAOS_RETURN(code); } - wInfo("vgId:%d, wal path:%s, meta log file num:%" PRId64, pWal->cfg.vgId, pWal->path, - taosArrayGetSize(pWal->fileInfoSet)); + wInfo("vgId:%d, wal path:%s, meta log file num:%d", pWal->cfg.vgId, pWal->path, + (int32_t)taosArrayGetSize(pWal->fileInfoSet)); printFileSet(pWal->fileInfoSet); int32_t sz = taosArrayGetSize(pWal->fileInfoSet); @@ -1143,8 +1144,8 @@ int32_t walLoadMeta(SWal* pWal) { (void)taosCloseFile(&pFile); taosMemoryFree(buf); - wInfo("vgId:%d, load meta file: %s, fileInfoSet size:%" PRId64, pWal->cfg.vgId, fnameStr, - taosArrayGetSize(pWal->fileInfoSet)); + wInfo("vgId:%d, load meta file: %s, fileInfoSet size:%d", pWal->cfg.vgId, fnameStr, + (int32_t)taosArrayGetSize(pWal->fileInfoSet)); printFileSet(pWal->fileInfoSet); TAOS_RETURN(code); From 2b83a20c69008dcbc532e88215dc96a4390e9caa Mon Sep 17 00:00:00 2001 From: Jing Sima Date: Mon, 14 Oct 2024 17:19:29 +0800 Subject: [PATCH 47/56] Revert "fix:[TD-32334] Generate correct time window when using interp with fill next and linear." This reverts commit 77e63d0922f6d230a314d28863744185faab8aa5. --- source/libs/executor/src/timesliceoperator.c | 20 ++-- tests/system-test/2-query/interp.py | 120 +++++++------------ 2 files changed, 50 insertions(+), 90 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 70bf26405e..2ea300ace8 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -278,7 +278,7 @@ static bool checkNullRow(SExprSupp* pExprSup, SSDataBlock* pSrcBlock, int32_t in } static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, - SSDataBlock* pSrcBlock, int32_t index, bool beforeTs, SExecTaskInfo* pTaskInfo, bool genAfterBlock) { + SSDataBlock* pSrcBlock, int32_t index, bool beforeTs, SExecTaskInfo* pTaskInfo) { int32_t code = TSDB_CODE_SUCCESS; int32_t lino = 0; int32_t rows = pResBlock->info.rows; @@ -427,7 +427,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp break; } - if (start.key == INT64_MIN || end.key == INT64_MIN || genAfterBlock) { + if (start.key == INT64_MIN || end.key == INT64_MIN) { colDataSetNULL(pDst, rows); break; } @@ -463,13 +463,8 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp break; } - if (genAfterBlock && rows == 0) { - hasInterp = false; - break; - } - SGroupKeys* pkey = taosArrayGet(pSliceInfo->pNextRow, srcSlot); - if (pkey->isNull == false && !genAfterBlock) { + if (pkey->isNull == false) { code = colDataSetVal(pDst, rows, pkey->pData, false); QUERY_CHECK_CODE(code, lino, _end); } else { @@ -841,7 +836,7 @@ static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pS int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, i + 1); if (nextTs > pSliceInfo->current) { while (pSliceInfo->current < nextTs && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, false, pTaskInfo, false) && + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, false, pTaskInfo) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { break; } else { @@ -869,7 +864,7 @@ static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pS doKeepLinearInfo(pSliceInfo, pBlock, i); while (pSliceInfo->current < ts && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, true, pTaskInfo, false) && + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, true, pTaskInfo) && pSliceInfo->fillType == TSDB_FILL_LINEAR) { break; } else { @@ -914,12 +909,13 @@ static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperato SSDataBlock* pResBlock = pSliceInfo->pRes; SInterval* pInterval = &pSliceInfo->interval; - if (pSliceInfo->pPrevGroupKey == NULL) { + if (pSliceInfo->fillType == TSDB_FILL_NEXT || pSliceInfo->fillType == TSDB_FILL_LINEAR || + pSliceInfo->pPrevGroupKey == NULL) { return; } while (pSliceInfo->current <= pSliceInfo->win.ekey) { - (void)genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, NULL, index, false, pOperator->pTaskInfo, true); + (void)genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, NULL, index, false, pOperator->pTaskInfo); pSliceInfo->current = taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); } diff --git a/tests/system-test/2-query/interp.py b/tests/system-test/2-query/interp.py index 3cdf52725a..bcfc389d7b 100644 --- a/tests/system-test/2-query/interp.py +++ b/tests/system-test/2-query/interp.py @@ -907,7 +907,7 @@ class TDTestCase: ## {. . .} tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") - tdSql.checkRows(13) + tdSql.checkRows(12) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, 5) tdSql.checkData(2, 0, 10) @@ -920,7 +920,6 @@ class TDTestCase: tdSql.checkData(9, 0, 15) tdSql.checkData(10, 0, 15) tdSql.checkData(11, 0, 15) - tdSql.checkData(12, 0, None) ## {} ... tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:01', '2020-02-01 00:00:04') every(1s) fill(next)") @@ -958,12 +957,10 @@ class TDTestCase: ## ..{.} tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:13', '2020-02-01 00:00:17') every(1s) fill(next)") - tdSql.checkRows(5) + tdSql.checkRows(3) tdSql.checkData(0, 0, 15) tdSql.checkData(1, 0, 15) tdSql.checkData(2, 0, 15) - tdSql.checkData(3, 0, None) - tdSql.checkData(4, 0, None) ## ... {} tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(next)") @@ -1275,7 +1272,7 @@ class TDTestCase: tdSql.checkData(8, 1, True) tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") - tdSql.checkRows(13) + tdSql.checkRows(12) tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') @@ -1290,7 +1287,6 @@ class TDTestCase: tdSql.checkData(9, 0, '2020-02-01 00:00:13.000') tdSql.checkData(10, 0, '2020-02-01 00:00:14.000') tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') - tdSql.checkData(12, 0, '2020-02-01 00:00:16.000') tdSql.checkData(0, 1, True) tdSql.checkData(1, 1, False) @@ -1304,7 +1300,6 @@ class TDTestCase: tdSql.checkData(9, 1, True) tdSql.checkData(10, 1, True) tdSql.checkData(11, 1, False) - tdSql.checkData(12, 1, True) tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(next)") tdSql.checkRows(6) @@ -1682,13 +1677,9 @@ class TDTestCase: ## | . | { | .} | tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(next)") - tdSql.checkRows(6) + tdSql.checkRows(2) tdSql.checkData(0, 0, 15) tdSql.checkData(1, 0, 15) - tdSql.checkData(2, 0, None) - tdSql.checkData(3, 0, None) - tdSql.checkData(4, 0, None) - tdSql.checkData(5, 0, None) # test fill linear @@ -2741,7 +2732,7 @@ class TDTestCase: tdSql.checkData(4, i, 15) tdSql.query(f"select interp(c0),interp(c1),interp(c2),interp(c3) from {dbname}.{tbname} range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(next)") - tdSql.checkRows(5) + tdSql.checkRows(3) tdSql.checkCols(4) for i in range (tdSql.queryCols): @@ -2837,7 +2828,7 @@ class TDTestCase: # test fill next tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname2} range('2020-02-02 00:00:00', '2020-02-02 00:00:18') every(1s) fill(next)") - tdSql.checkRows(19) + tdSql.checkRows(18) tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-02 00:00:00.000') @@ -2860,7 +2851,6 @@ class TDTestCase: tdSql.checkData(15, 2, None) tdSql.checkData(16, 2, None) tdSql.checkData(17, 2, None) - tdSql.checkData(18, 2, None) tdSql.checkData(17, 0, '2020-02-02 00:00:17.000') @@ -3091,7 +3081,7 @@ class TDTestCase: # test fill linear tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname2} range('2020-02-02 00:00:00', '2020-02-02 00:00:18') every(1s) fill(linear)") - tdSql.checkRows(18) + tdSql.checkRows(17) tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-02 00:00:01.000') @@ -3113,9 +3103,8 @@ class TDTestCase: tdSql.checkData(14, 2, None) tdSql.checkData(15, 2, None) tdSql.checkData(16, 2, None) - tdSql.checkData(17, 2, None) - tdSql.checkData(17, 0, '2020-02-02 00:00:18.000') + tdSql.checkData(16, 0, '2020-02-02 00:00:17.000') tdLog.printNoPrefix("==========step13:test error cases") @@ -3231,7 +3220,7 @@ class TDTestCase: tdSql.checkData(17, 1, True) tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") - tdSql.checkRows(19) + tdSql.checkRows(18) tdSql.checkData(0, 0, '2020-02-01 00:00:00.000') tdSql.checkData(0, 1, True) @@ -3254,12 +3243,9 @@ class TDTestCase: tdSql.checkData(15, 2, 15) tdSql.checkData(16, 2, 17) tdSql.checkData(17, 2, 17) - tdSql.checkData(18, 2, None) tdSql.checkData(17, 0, '2020-02-01 00:00:17.000') tdSql.checkData(17, 1, False) - tdSql.checkData(18, 0, '2020-02-01 00:00:18.000') - tdSql.checkData(18, 1, True) tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") tdSql.checkRows(17) @@ -3376,24 +3362,24 @@ class TDTestCase: tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") - tdSql.checkRows(57) - for i in range(0, 19): + tdSql.checkRows(48) + for i in range(0, 14): tdSql.checkData(i, 0, 'ctb1') - for i in range(19, 38): + for i in range(14, 30): tdSql.checkData(i, 0, 'ctb2') - for i in range(38, 57): + for i in range(30, 48): tdSql.checkData(i, 0, 'ctb3') tdSql.checkData(0, 1, '2020-02-01 00:00:00.000') - tdSql.checkData(18, 1, '2020-02-01 00:00:18.000') + tdSql.checkData(13, 1, '2020-02-01 00:00:13.000') - tdSql.checkData(19, 1, '2020-02-01 00:00:00.000') - tdSql.checkData(37, 1, '2020-02-01 00:00:18.000') + tdSql.checkData(14, 1, '2020-02-01 00:00:00.000') + tdSql.checkData(29, 1, '2020-02-01 00:00:15.000') - tdSql.checkData(38, 1, '2020-02-01 00:00:00.000') - tdSql.checkData(56, 1, '2020-02-01 00:00:18.000') + tdSql.checkData(30, 1, '2020-02-01 00:00:00.000') + tdSql.checkData(47, 1, '2020-02-01 00:00:17.000') for i in range(0, 2): tdSql.checkData(i, 3, 1) @@ -3404,33 +3390,24 @@ class TDTestCase: for i in range(8, 14): tdSql.checkData(i, 3, 13) - for i in range(14, 19): - tdSql.checkData(i, 3, None) - - for i in range(19, 23): + for i in range(14, 18): tdSql.checkData(i, 3, 3) - for i in range(23, 29): + for i in range(18, 24): tdSql.checkData(i, 3, 9) - for i in range(29, 35): + for i in range(24, 30): tdSql.checkData(i, 3, 15) - for i in range(35, 38): - tdSql.checkData(i, 3, None) - - for i in range(38, 44): + for i in range(30, 36): tdSql.checkData(i, 3, 5) - for i in range(44, 50): + for i in range(36, 42): tdSql.checkData(i, 3, 11) - for i in range(50, 56): + for i in range(42, 48): tdSql.checkData(i, 3, 17) - for i in range(56, 57): - tdSql.checkData(i, 3, None) - tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") tdSql.checkRows(39) @@ -3473,7 +3450,7 @@ class TDTestCase: tdSql.checkRows(90) tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") - tdSql.checkRows(171) + tdSql.checkRows(90) tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") tdSql.checkRows(9) @@ -3490,7 +3467,7 @@ class TDTestCase: tdSql.checkRows(48) tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") - tdSql.checkRows(57) + tdSql.checkRows(48) tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") tdSql.checkRows(39) @@ -4386,7 +4363,7 @@ class TDTestCase: tdSql.query(f"select _irowts, _isfilled, interp(c0, 1) from {dbname}.{tbname_null} range('2020-02-02 00:00:01', '2020-02-02 00:00:11') every(1s) fill(next)") - tdSql.checkRows(11) + tdSql.checkRows(9) tdSql.checkData(0, 1, False) tdSql.checkData(1, 1, True) tdSql.checkData(2, 1, False) @@ -4396,8 +4373,6 @@ class TDTestCase: tdSql.checkData(6, 1, True) tdSql.checkData(7, 1, False) tdSql.checkData(8, 1, False) - tdSql.checkData(9, 1, True) - tdSql.checkData(10, 1, True) tdSql.checkData(0, 2, 1) tdSql.checkData(1, 2, 3) @@ -4408,13 +4383,11 @@ class TDTestCase: tdSql.checkData(6, 2, 8) tdSql.checkData(7, 2, 8) tdSql.checkData(8, 2, 9) - tdSql.checkData(9, 2, None) - tdSql.checkData(10, 2, None) tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{tbname_null} where c0 is not null range('2020-02-02 00:00:01', '2020-02-02 00:00:11') every(1s) fill(next)") - tdSql.checkRows(11) + tdSql.checkRows(9) tdSql.checkData(0, 1, False) tdSql.checkData(1, 1, True) tdSql.checkData(2, 1, False) @@ -4424,9 +4397,6 @@ class TDTestCase: tdSql.checkData(6, 1, True) tdSql.checkData(7, 1, False) tdSql.checkData(8, 1, False) - tdSql.checkData(9, 1, True) - tdSql.checkData(10, 1, True) - tdSql.checkData(0, 2, 1) tdSql.checkData(1, 2, 3) @@ -4437,8 +4407,6 @@ class TDTestCase: tdSql.checkData(6, 2, 8) tdSql.checkData(7, 2, 8) tdSql.checkData(8, 2, 9) - tdSql.checkData(9, 2, None) - tdSql.checkData(10, 2, None) # super table tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)") @@ -4475,7 +4443,7 @@ class TDTestCase: tdSql.query(f"select _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)") - tdSql.checkRows(9) + tdSql.checkRows(8) tdSql.checkData(0, 1, False) tdSql.checkData(1, 1, True) tdSql.checkData(2, 1, True) @@ -4484,7 +4452,6 @@ class TDTestCase: tdSql.checkData(5, 1, True) tdSql.checkData(6, 1, False) tdSql.checkData(7, 1, False) - tdSql.checkData(8, 1, True) tdSql.checkData(0, 2, 1) tdSql.checkData(1, 2, 9) @@ -4494,12 +4461,11 @@ class TDTestCase: tdSql.checkData(5, 2, 13) tdSql.checkData(6, 2, 13) tdSql.checkData(7, 2, 15) - tdSql.checkData(8, 2, None) tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)") - tdSql.checkRows(9) + tdSql.checkRows(8) tdSql.checkData(0, 1, False) tdSql.checkData(1, 1, True) tdSql.checkData(2, 1, True) @@ -4508,7 +4474,6 @@ class TDTestCase: tdSql.checkData(5, 1, True) tdSql.checkData(6, 1, False) tdSql.checkData(7, 1, False) - tdSql.checkData(8, 1, True) tdSql.checkData(0, 2, 1) tdSql.checkData(1, 2, 9) @@ -4518,37 +4483,36 @@ class TDTestCase: tdSql.checkData(5, 2, 13) tdSql.checkData(6, 2, 13) tdSql.checkData(7, 2, 15) - tdSql.checkData(8, 2, None) tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)") - tdSql.checkRows(18) - for i in range(0, 9): + tdSql.checkRows(15) + for i in range(0, 7): tdSql.checkData(i, 0, 'ctb1_null') - for i in range(9, 18): + for i in range(7, 15): tdSql.checkData(i, 0, 'ctb2_null') tdSql.checkData(0, 1, '2020-02-01 00:00:01.000') - tdSql.checkData(8, 1, '2020-02-01 00:00:17.000') + tdSql.checkData(6, 1, '2020-02-01 00:00:13.000') - tdSql.checkData(9, 1, '2020-02-01 00:00:01.000') - tdSql.checkData(17, 1, '2020-02-01 00:00:17.000') + tdSql.checkData(7, 1, '2020-02-01 00:00:01.000') + tdSql.checkData(14, 1, '2020-02-01 00:00:15.000') tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)") - tdSql.checkRows(18) - for i in range(0, 9): + tdSql.checkRows(15) + for i in range(0, 7): tdSql.checkData(i, 0, 'ctb1_null') - for i in range(9, 18): + for i in range(7, 15): tdSql.checkData(i, 0, 'ctb2_null') tdSql.checkData(0, 1, '2020-02-01 00:00:01.000') - tdSql.checkData(8, 1, '2020-02-01 00:00:17.000') + tdSql.checkData(6, 1, '2020-02-01 00:00:13.000') - tdSql.checkData(9, 1, '2020-02-01 00:00:01.000') - tdSql.checkData(17, 1, '2020-02-01 00:00:17.000') + tdSql.checkData(7, 1, '2020-02-01 00:00:01.000') + tdSql.checkData(14, 1, '2020-02-01 00:00:15.000') # fill linear # normal table From 3310e8145620ff06332d262ad2411ada14bb36ab Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Wed, 16 Oct 2024 10:15:12 +0800 Subject: [PATCH 48/56] make sure mnode can be started --- source/libs/wal/src/walMeta.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 8649581d5d..042024284c 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -288,6 +288,11 @@ static void walAlignVersions(SWal* pWal) { pWal->cfg.vgId, pWal->vers.snapshotVer, pWal->cfg.committed); pWal->vers.snapshotVer = pWal->cfg.committed; } + if (pWal->vers.snapshotVer < 0) { + wWarn("vgId:%d, snapshotVer:%" PRId64 " in wal is an invalid value. align it with firstVer:%" PRId64 ".", + pWal->cfg.vgId, pWal->vers.snapshotVer, pWal->vers.firstVer); + pWal->vers.snapshotVer = pWal->vers.firstVer; + } if (pWal->vers.firstVer > pWal->vers.snapshotVer + 1) { wWarn("vgId:%d, firstVer:%" PRId64 " is larger than snapshotVer:%" PRId64 " + 1. align with it.", pWal->cfg.vgId, pWal->vers.firstVer, pWal->vers.snapshotVer); From d0a0d578bd149e82f0623f35a52378393e229391 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Oct 2024 02:16:31 +0000 Subject: [PATCH 49/56] fix/TS-5533-update-os-info-when-monitor --- source/dnode/mgmt/node_util/src/dmUtil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dnode/mgmt/node_util/src/dmUtil.c b/source/dnode/mgmt/node_util/src/dmUtil.c index b50c746c92..f8c0955745 100644 --- a/source/dnode/mgmt/node_util/src/dmUtil.c +++ b/source/dnode/mgmt/node_util/src/dmUtil.c @@ -74,6 +74,7 @@ void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) { } pInfo->mem_total = tsTotalMemoryKB; pInfo->disk_engine = 0; + osUpdate(); pInfo->disk_used = tsDataSpace.size.used; pInfo->disk_total = tsDataSpace.size.total; code = taosGetCardInfoDelta(&pInfo->net_in, &pInfo->net_out); From f206837d48f86fb3102c2e40626a7cbe5cdc6c5f Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Wed, 16 Oct 2024 10:30:27 +0800 Subject: [PATCH 50/56] modify log level while walLoadMeta failed --- source/libs/wal/src/walMgmt.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index 3b23a2db80..d8a58efe4e 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -91,7 +91,8 @@ static int32_t walInitLock(SWal *pWal) { } SWal *walOpen(const char *path, SWalCfg *pCfg) { - SWal *pWal = taosMemoryCalloc(1, sizeof(SWal)); + int32_t code = 0; + SWal *pWal = taosMemoryCalloc(1, sizeof(SWal)); if (pWal == NULL) { terrno = TAOS_SYSTEM_ERROR(errno); return NULL; @@ -160,17 +161,20 @@ SWal *walOpen(const char *path, SWalCfg *pCfg) { pWal->writeHead.magic = WAL_MAGIC; // load meta - if (walLoadMeta(pWal) < 0) { - wInfo("vgId:%d, failed to load meta since %s", pWal->cfg.vgId, tstrerror(terrno)); + code = walLoadMeta(pWal); + if (code < 0) { + wWarn("vgId:%d, failed to load meta since %s", pWal->cfg.vgId, tstrerror(code)); } - if (walCheckAndRepairMeta(pWal) < 0) { - wError("vgId:%d, cannot open wal since repair meta file failed", pWal->cfg.vgId); + code = walCheckAndRepairMeta(pWal); + if (code < 0) { + wError("vgId:%d, cannot open wal since repair meta file failed since %s", pWal->cfg.vgId, tstrerror(code)); goto _err; } - if (walCheckAndRepairIdx(pWal) < 0) { - wError("vgId:%d, cannot open wal since repair idx file failed", pWal->cfg.vgId); + code = walCheckAndRepairIdx(pWal); + if (code < 0) { + wError("vgId:%d, cannot open wal since repair idx file failed since %s", pWal->cfg.vgId, tstrerror(code)); goto _err; } From dca0822b5d424ebadbbe52c0570dee7349812e74 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 16 Oct 2024 10:47:02 +0800 Subject: [PATCH 51/56] feat: support query-QPS new feature --- tools/auto/testCompression/testCompression.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/auto/testCompression/testCompression.py b/tools/auto/testCompression/testCompression.py index 281a097f8a..ee922a1a23 100644 --- a/tools/auto/testCompression/testCompression.py +++ b/tools/auto/testCompression/testCompression.py @@ -134,8 +134,6 @@ def getMatch(datatype, algo): def generateJsonFile(algo): - print(f"doTest algo: {algo} \n") - # replace datatype context = readFileContext(templateFile) # replace compress @@ -192,8 +190,6 @@ def findContextValue(context, label): ends = [',','}',']', 0] while context[end] not in ends: end += 1 - - print(f"start = {start} end={end}\n") return context[start:end] @@ -281,10 +277,10 @@ def testQuery(): # INFO: Spend 6.7350 second completed total queries: 10, the QPS of all threads: 1.485 speed = None - for i in range(20, len(lines)): + for i in range(0, len(lines)): # find second real + context = lines[i] pos = context.find("the QPS of all threads:") - context = lines[26] if pos == -1 : continue pos += 24 @@ -302,7 +298,6 @@ def doTest(algo, resultFile): print(f"doTest algo: {algo} \n") #cleanAndStartTaosd() - # json jsonFile = generateJsonFile(algo) From de7006743627a2e561f833c2117f17b8afce0791 Mon Sep 17 00:00:00 2001 From: Jinqing Kuang Date: Wed, 16 Oct 2024 10:48:41 +0800 Subject: [PATCH 52/56] fix(query)[TD-32564]. Fix memory leak in exceptional cases In function tsdbTFileSetInitRef, clear all FileObj stored in the variable lvl when an error occurs, and release the memory allocated for lvl itself. --- source/dnode/vnode/src/tsdb/tsdbFSet2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbFSet2.c b/source/dnode/vnode/src/tsdb/tsdbFSet2.c index fc681f9753..a0ae58ac96 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSet2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFSet2.c @@ -602,14 +602,14 @@ int32_t tsdbTFileSetInitRef(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fs SSttLvl *lvl; code = tsdbSttLvlInitRef(pTsdb, lvl1, &lvl); if (code) { - taosMemoryFree(lvl); + tsdbSttLvlClear(&lvl); tsdbTFileSetClear(fset); return code; } code = TARRAY2_APPEND(fset[0]->lvlArr, lvl); if (code) { - taosMemoryFree(lvl); + tsdbSttLvlClear(&lvl); tsdbTFileSetClear(fset); return code; } From 2520eead4842472e3f03690041d02bcaca273269 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Oct 2024 04:59:02 +0000 Subject: [PATCH 53/56] fix/TS-5533-update-os-info-when-monitor-fix-check --- source/dnode/mgmt/node_util/src/dmUtil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/dnode/mgmt/node_util/src/dmUtil.c b/source/dnode/mgmt/node_util/src/dmUtil.c index f8c0955745..3a6c73a1bc 100644 --- a/source/dnode/mgmt/node_util/src/dmUtil.c +++ b/source/dnode/mgmt/node_util/src/dmUtil.c @@ -74,7 +74,10 @@ void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) { } pInfo->mem_total = tsTotalMemoryKB; pInfo->disk_engine = 0; - osUpdate(); + code = osUpdate(); + if (code != 0) { + dError("failed to update os info since %s", tstrerror(code)); + } pInfo->disk_used = tsDataSpace.size.used; pInfo->disk_total = tsDataSpace.size.total; code = taosGetCardInfoDelta(&pInfo->net_in, &pInfo->net_out); From 48d9f2da65e8aea47a03e44f30084bbac478a06a Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Wed, 16 Oct 2024 13:38:45 +0800 Subject: [PATCH 54/56] fix ci walTest --- source/libs/wal/src/walMeta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 042024284c..92ad760a20 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -288,7 +288,7 @@ static void walAlignVersions(SWal* pWal) { pWal->cfg.vgId, pWal->vers.snapshotVer, pWal->cfg.committed); pWal->vers.snapshotVer = pWal->cfg.committed; } - if (pWal->vers.snapshotVer < 0) { + if (pWal->vers.snapshotVer < 0 && pWal->vers.firstVer > 0) { wWarn("vgId:%d, snapshotVer:%" PRId64 " in wal is an invalid value. align it with firstVer:%" PRId64 ".", pWal->cfg.vgId, pWal->vers.snapshotVer, pWal->vers.firstVer); pWal->vers.snapshotVer = pWal->vers.firstVer; From 544a1828e6c094d4ed874c36893e44afc2986f29 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Oct 2024 07:00:28 +0000 Subject: [PATCH 55/56] fix/TS-5532-add-more-log-status-msg --- source/dnode/mgmt/mgmt_dnode/src/dmHandle.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index f1f3a3bee7..87b1ae0efa 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -123,6 +123,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { int32_t code = 0; SStatusReq req = {0}; + dDebug("send status req to mnode, statusSeq:%d, begin to mgnt lock", pMgmt->statusSeq); (void)taosThreadRwlockRdlock(&pMgmt->pData->lock); req.sver = tsVersion; req.dnodeVer = pMgmt->pData->dnodeVer; @@ -161,14 +162,17 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { memcpy(req.clusterCfg.charset, tsCharset, TD_LOCALE_LEN); (void)taosThreadRwlockUnlock(&pMgmt->pData->lock); + dDebug("send status req to mnode, statusSeq:%d, begin to get vnode loads", pMgmt->statusSeq); SMonVloadInfo vinfo = {0}; (*pMgmt->getVnodeLoadsFp)(&vinfo); req.pVloads = vinfo.pVloads; + dDebug("send status req to mnode, statusSeq:%d, begin to get mnode loads", pMgmt->statusSeq); SMonMloadInfo minfo = {0}; (*pMgmt->getMnodeLoadsFp)(&minfo); req.mload = minfo.load; + dDebug("send status req to mnode, statusSeq:%d, begin to get qnode loads", pMgmt->statusSeq); (*pMgmt->getQnodeLoadsFp)(&req.qload); pMgmt->statusSeq++; @@ -206,6 +210,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { int8_t epUpdated = 0; (void)dmGetMnodeEpSet(pMgmt->pData, &epSet); + dDebug("send status req to mnode, statusSeq:%d, begin to send rpc msg", pMgmt->statusSeq); code = rpcSendRecvWithTimeout(pMgmt->msgCb.statusRpc, &epSet, &rpcMsg, &rpcRsp, &epUpdated, tsStatusInterval * 5 * 1000); if (code != 0) { From 1d018d0d287cc428cdf3656e964e6c492784fd1e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 16 Oct 2024 18:05:35 +0800 Subject: [PATCH 56/56] enh: stmt2Perf add p90 p95 min max --- .../auto/stmt2Performance/json/template.json | 6 +- tools/auto/stmt2Performance/stmt2Perf.py | 110 +++++++++++++----- 2 files changed, 86 insertions(+), 30 deletions(-) diff --git a/tools/auto/stmt2Performance/json/template.json b/tools/auto/stmt2Performance/json/template.json index 659c5966a4..8c54c5be22 100644 --- a/tools/auto/stmt2Performance/json/template.json +++ b/tools/auto/stmt2Performance/json/template.json @@ -16,14 +16,14 @@ { "dbinfo": { "name": "dbrate", - "drop": "yes", - "vgroups": 2 + "vgroups": 1, + "drop": "yes" }, "super_tables": [ { "name": "meters", "child_table_exists": "no", - "childtable_count": 10, + "childtable_count": 1, "childtable_prefix": "d", "insert_mode": "@STMT_MODE", "interlace_rows": @INTERLACE_MODE, diff --git a/tools/auto/stmt2Performance/stmt2Perf.py b/tools/auto/stmt2Performance/stmt2Perf.py index e7a4d5ecbe..4d99f2483d 100644 --- a/tools/auto/stmt2Performance/stmt2Perf.py +++ b/tools/auto/stmt2Performance/stmt2Perf.py @@ -198,16 +198,20 @@ def findContextValue(context, label): def writeTemplateInfo(resultFile): # create info - context = readFileContext(templateFile) + context = readFileContext(templateFile) vgroups = findContextValue(context, "vgroups") childCount = findContextValue(context, "childtable_count") insertRows = findContextValue(context, "insert_rows") - line = f"vgroups = {vgroups}\nchildtable_count = {childCount}\ninsert_rows = {insertRows}\n\n" + bindVGroup = findContextValue(context, "thread_bind_vgroup") + nThread = findContextValue(context, "thread_count") + if bindVGroup.lower().find("yes") != -1: + nThread = vgroups + line = f"thread_bind_vgroup = {bindVGroup}\nvgroups = {vgroups}\nchildtable_count = {childCount}\ninsert_rows = {insertRows}\ninsertThreads = {nThread} \n\n" print(line) appendFileContext(resultFile, line) -def totalCompressRate(stmt, interlace, resultFile, writeSpeed, querySpeed): +def totalCompressRate(stmt, interlace, resultFile, spent, spentReal, writeSpeed, writeReal, min, avg, p90, p99, max, querySpeed): global Number # flush command = 'taos -s "flush database dbrate;"' @@ -220,7 +224,7 @@ def totalCompressRate(stmt, interlace, resultFile, writeSpeed, querySpeed): # read compress rate command = 'taos -s "show table distributed dbrate.meters\G;"' rets = runRetList(command) - print(rets) + #print(rets) str1 = rets[5] arr = str1.split(" ") @@ -234,46 +238,88 @@ def totalCompressRate(stmt, interlace, resultFile, writeSpeed, querySpeed): str2 = arr[6] pos = str2.find("=[") rate = str2[pos+2:] - print("rate =" + rate) # total data file size #dataSize = getFolderSize(f"{dataDir}/vnode/") #dataSizeMB = int(dataSize/1024/1024) # appand to file - + + # %("No", "stmtMode", "interlaceRows", "spent", "spent-real", "writeSpeed", "write-real", "query-QPS", "dataSize", "rate") Number += 1 - context = "%10s %10s %15s %10s %10s %30s %15s\n"%( Number, stmt, interlace, str(totalSize)+" MB", rate+"%", writeSpeed + " Records/second", querySpeed) + ''' + context = "%2s %6s %10s %10s %10s %15s %15s %16s %16s %16s %16s %16s %8s %8s %8s\n"%( + Number, stmt, interlace, spent + "s", spentReal + "s", writeSpeed + " rows/s", writeReal + " rows/s", + min, avg, p90, p99, max, + querySpeed, str(totalSize) + " MB", rate + "%") + ''' + context = "%2s %8s %10s %10s %16s %16s %12s %12s %12s %12s %12s %12s %10s %10s %10s\n"%( + Number, stmt, interlace, spent + "s", spentReal + "s", writeSpeed + "r/s", writeReal + "r/s", + min, avg, p90, p99, max + "ms", + querySpeed, str(totalSize) + " MB", rate + "%") + showLog(context) appendFileContext(resultFile, context) +def cutEnd(line, start, endChar): + pos = line.find(endChar, start) + if pos == -1: + return line[start:] + return line[start : pos] + +def findValue(context, pos, key, endChar,command): + pos = context.find(key, pos) + if pos == -1: + print(f"error, run command={command} output not found \"{key}\" keyword. context={context}") + exit(1) + pos += len(key) + value = cutEnd(context, pos, endChar) + return (value, pos) + def testWrite(jsonFile): command = f"taosBenchmark -f {jsonFile}" output, context = run(command, 60000) + print(context) + # SUCC: Spent 0.960248 (real 0.947154) seconds to insert rows: 100000 with 1 thread(s) into dbrate 104139.76 (real 105579.45) records/second - # find second real - pos = context.find("(real ") + # spent + key = "Spent " + pos = -1 + pos1 = 0 + while pos1 != -1: # find last "Spent " + pos1 = context.find(key, pos1) + if pos1 != -1: + pos = pos1 # update last found + pos1 += len(key) if pos == -1: - print(f"error, run command={command} output not found first \"(real\" keyword. error={context}") + print(f"error, run command={command} output not found \"{key}\" keyword. context={context}") exit(1) - pos = context.find("(real ", pos + 5) + pos += len(key) + spent = cutEnd(context, pos, ".") + + # spent-real + spentReal, pos = findValue(context, pos, "(real ", ".", command) + + # writeSpeed + key = "into " + pos = context.find(key, pos) if pos == -1: - print(f"error, run command={command} output not found second \"(real\" keyword. error={context}") - exit(1) - - pos += 5 - length = len(context) - while pos < length and context[pos] == ' ': - pos += 1 - end = context.find(".", pos) - if end == -1: - print(f"error, run command={command} output not found second \".\" keyword. error={context}") + print(f"error, run command={command} output not found \"{key}\" keyword. context={context}") exit(1) + pos += len(key) + writeSpeed, pos = findValue(context, pos, " ", ".", command) + # writeReal + writeReal, pos = findValue(context, pos, "(real ", ".", command) - speed = context[pos: end] - #print(f"write pos ={pos} end={end} speed={speed}\n output={context} \n") - return speed + # delay + min, pos = findValue(context, pos, "min: ", ",", command) + avg, pos = findValue(context, pos, "avg: ", ",", command) + p90, pos = findValue(context, pos, "p90: ", ",", command) + p99, pos = findValue(context, pos, "p99: ", ",", command) + max, pos = findValue(context, pos, "max: ", "ms", command) + + return (spent, spentReal, writeSpeed, writeReal, min, avg, p90, p99, max) def testQuery(): command = f"taosBenchmark -f json/query.json" @@ -308,13 +354,13 @@ def doTest(stmt, interlace, resultFile): # run taosBenchmark t1 = time.time() - writeSpeed = testWrite(jsonFile) + spent, spentReal, writeSpeed, writeReal, min, avg, p90, p99, max = testWrite(jsonFile) t2 = time.time() # total write speed querySpeed = testQuery() # total compress rate - totalCompressRate(stmt, interlace, resultFile, writeSpeed, querySpeed) + totalCompressRate(stmt, interlace, resultFile, spent, spentReal, writeSpeed, writeReal, min, avg, p90, p99, max, querySpeed) def main(): @@ -333,7 +379,17 @@ def main(): # json info writeTemplateInfo(resultFile) # head - context = "\n%10s %10s %15s %10s %10s %30s %15s\n"%("No", "stmtMode", "interlaceRows", "dataSize", "rate", "writeSpeed", "query-QPS") + ''' + context = "%3s %8s %10s %10s %10s %15s %15s %10s %10s %10s %10s %10s %8s %8s %8s\n"%( + "No", "stmtMode", "interlace", "spent", "spent-real", "writeSpeed", "write-real", + "min", "avg", "p90", "p99", "max", + "query-QPS", "dataSize", "rate") + ''' + context = "%2s %8s %10s %10s %16s %16s %12s %12s %12s %12s %12s %12s %10s %10s %10s\n"%( + "No", "stmtMode", "interlace", "spent", "spent-real", "writeSpeed", "write-real", + "min", "avg", "p90", "p99", "max", + "query-QPS", "dataSize", "rate") + appendFileContext(resultFile, context)