From 1c4f354adfa2652b7e4822545d48569dc8a9c23f Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 02:32:55 +0000 Subject: [PATCH 01/40] add http interface --- include/libs/transport/thttp.h | 5 + include/util/taoserror.h | 2 + source/libs/transport/src/thttp.c | 418 +++++++++++++++++++++--------- source/util/src/terror.c | 3 + 4 files changed, 305 insertions(+), 123 deletions(-) diff --git a/include/libs/transport/thttp.h b/include/libs/transport/thttp.h index f6f1f7f027..c3f107028a 100644 --- a/include/libs/transport/thttp.h +++ b/include/libs/transport/thttp.h @@ -25,8 +25,13 @@ extern "C" { typedef enum { HTTP_GZIP, HTTP_FLAT } EHttpCompFlag; +int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId); + int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag); +int64_t taosInitHttpChan(); +void taosDestroyHttpChan(int64_t chanId); #ifdef __cplusplus } diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 7ac22ac40f..108ae4223b 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -87,6 +87,7 @@ int32_t taosGetErrSize(); #define TSDB_CODE_RPC_MAX_SESSIONS TAOS_DEF_ERROR_CODE(0, 0x0022) // #define TSDB_CODE_RPC_NETWORK_ERROR TAOS_DEF_ERROR_CODE(0, 0x0023) #define TSDB_CODE_RPC_NETWORK_BUSY TAOS_DEF_ERROR_CODE(0, 0x0024) +#define TSDB_CODE_HTTP_MODULE_QUIT TAOS_DEF_ERROR_CODE(0, 0x0025) @@ -136,6 +137,7 @@ int32_t taosGetErrSize(); #define TSDB_CODE_TIMEOUT_ERROR TAOS_DEF_ERROR_CODE(0, 0x012C) #define TSDB_CODE_MSG_ENCODE_ERROR TAOS_DEF_ERROR_CODE(0, 0x012D) #define TSDB_CODE_NO_ENOUGH_DISKSPACE TAOS_DEF_ERROR_CODE(0, 0x012E) +#define TSDB_CODE_THIRDPARTY_ERROR TAOS_DEF_ERROR_CODE(0, 0x012F) #define TSDB_CODE_APP_IS_STARTING TAOS_DEF_ERROR_CODE(0, 0x0130) #define TSDB_CODE_APP_IS_STOPPING TAOS_DEF_ERROR_CODE(0, 0x0131) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index c4ca39c323..704c4b06e2 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -19,7 +19,6 @@ #include "zlib.h" #include "thttp.h" #include "taoserror.h" -#include "tlog.h" #include "transComm.h" // clang-format on @@ -27,13 +26,16 @@ #define HTTP_RECV_BUF_SIZE 1024 static int32_t httpRefMgt = 0; -static int64_t httpRef = -1; static int32_t FAST_FAILURE_LIMIT = 1; + +static int64_t httpDefaultChanId = -1; + typedef struct SHttpModule { uv_loop_t* loop; SAsyncPool* asyncPool; TdThread thread; SHashObj* connStatusTable; + SHashObj* connPool; int8_t quit; } SHttpModule; @@ -46,7 +48,7 @@ typedef struct SHttpMsg { int32_t len; EHttpCompFlag flag; int8_t quit; - + int64_t chanId; } SHttpMsg; typedef struct SHttpClient { @@ -58,19 +60,33 @@ typedef struct SHttpClient { char* addr; uint16_t port; struct sockaddr_in dest; + int64_t chanId; } SHttpClient; +typedef struct SHttpConnList { + queue q; + +} SHttpConnList; + static TdThreadOnce transHttpInit = PTHREAD_ONCE_INIT; static void transHttpEnvInit(); static void httpHandleReq(SHttpMsg* msg); static void httpHandleQuit(SHttpMsg* msg); -static int32_t httpSendQuit(); +static int32_t httpSendQuit(int64_t chanId); + +static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId); +static void httpDestroyMsg(SHttpMsg* msg); static bool httpFailFastShoudIgnoreMsg(SHashObj* pTable, char* server, int16_t port); static void httpFailFastMayUpdate(SHashObj* pTable, char* server, int16_t port, int8_t succ); static int32_t taosSendHttpReportImpl(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag); +static void httpModuleDestroy(SHttpModule* http); + +static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, uint16_t port, char* pCont, + int32_t contLen, EHttpCompFlag flag, int64_t chanId); static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t contLen, char* pHead, int32_t headLen, EHttpCompFlag flag) { @@ -91,7 +107,7 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t uri, server, contLen); } else { terrno = TSDB_CODE_INVALID_CFG; - return -1; + return terrno; } } @@ -158,6 +174,8 @@ _OVER: if (code == 0) { memcpy(pSrc, pDest, gzipStream.total_out); code = gzipStream.total_out; + } else { + code = terrno; } taosMemoryFree(pDest); @@ -168,11 +186,15 @@ static FORCE_INLINE int32_t taosBuildDstAddr(const char* server, uint16_t port, uint32_t ip = taosGetIpv4FromFqdn(server); if (ip == 0xffffffff) { tError("http-report failed to resolving domain names: %s", server); - return -1; + return TSDB_CODE_RPC_FQDN_ERROR; } - char buf[128] = {0}; + char buf[256] = {0}; tinet_ntoa(buf, ip); - uv_ip4_addr(buf, port, dest); + int ret = uv_ip4_addr(buf, port, dest); + if (ret != 0) { + tError("http-report failed to get addr %s", uv_err_name(ret)); + return TSDB_CODE_THIRDPARTY_ERROR; + } return 0; } @@ -183,6 +205,43 @@ static void* httpThread(void* arg) { return NULL; } +static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId) { + if (server == NULL || uri == NULL) { + tError("http-report failed to report to invalid addr, chanId:%" PRId64 "", chanId); + terrno = TSDB_CODE_INVALID_PARA; + return NULL; + } + + if (pCont == NULL || contLen == 0) { + tError("http-report failed to report empty packet, chanId:%" PRId64 "", chanId); + terrno = TSDB_CODE_INVALID_PARA; + return NULL; + } + + SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg)); + if (msg == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + msg->port = port; + msg->server = taosStrdup(server); + msg->uri = taosStrdup(uri); + msg->cont = taosMemoryMalloc(contLen); + if (msg->server == NULL || msg->uri == NULL || msg->cont == NULL) { + httpDestroyMsg(msg); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + memcpy(msg->cont, pCont, contLen); + msg->len = contLen; + msg->flag = flag; + msg->quit = 0; + msg->chanId = chanId; + return msg; +} static void httpDestroyMsg(SHttpMsg* msg) { if (msg == NULL) return; @@ -191,15 +250,7 @@ static void httpDestroyMsg(SHttpMsg* msg) { taosMemoryFree(msg->cont); taosMemoryFree(msg); } -static void httpDestroyMsgWrapper(void* cont, void* param) { - httpDestroyMsg((SHttpMsg*)cont); - // if (msg == NULL) return; - - // taosMemoryFree(msg->server); - // taosMemoryFree(msg->uri); - // taosMemoryFree(msg->cont); - // taosMemoryFree(msg); -} +static void httpDestroyMsgWrapper(void* cont, void* param) { httpDestroyMsg((SHttpMsg*)cont); } static void httpMayDiscardMsg(SHttpModule* http, SAsyncItem* item) { SHttpMsg *msg = NULL, *quitMsg = NULL; @@ -278,7 +329,7 @@ static FORCE_INLINE void clientAllocBuffCb(uv_handle_t* handle, size_t suggested static FORCE_INLINE void clientRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { SHttpClient* cli = handle->data; if (nread < 0) { - tError("http-report recv error:%s", uv_err_name(nread)); + tError("http-report recv error:%s", uv_strerror(nread)); } else { tTrace("http-report succ to recv %d bytes", (int32_t)nread); } @@ -289,92 +340,77 @@ static FORCE_INLINE void clientRecvCb(uv_stream_t* handle, ssize_t nread, const static void clientSentCb(uv_write_t* req, int32_t status) { SHttpClient* cli = req->data; if (status != 0) { - tError("http-report failed to send data, reason: %s, dst:%s:%d", uv_strerror(status), cli->addr, cli->port); + tError("http-report failed to send data, reason: %s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(status), cli->addr, + cli->port, cli->chanId); if (!uv_is_closing((uv_handle_t*)&cli->tcp)) { uv_close((uv_handle_t*)&cli->tcp, clientCloseCb); } return; } else { - tTrace("http-report succ to send data"); + tTrace("http-report succ to send data, chanId:%" PRId64 "", cli->chanId); } status = uv_read_start((uv_stream_t*)&cli->tcp, clientAllocBuffCb, clientRecvCb); if (status != 0) { - tError("http-report failed to recv data,reason:%s, dst:%s:%d", uv_strerror(status), cli->addr, cli->port); + tError("http-report failed to recv data,reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(status), cli->addr, + cli->port, cli->chanId); if (!uv_is_closing((uv_handle_t*)&cli->tcp)) { uv_close((uv_handle_t*)&cli->tcp, clientCloseCb); } } } static void clientConnCb(uv_connect_t* req, int32_t status) { - SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef); SHttpClient* cli = req->data; + int64_t chanId = cli->chanId; + + SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); if (status != 0) { httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 0); - tError("http-report failed to conn to server, reason:%s, dst:%s:%d", uv_strerror(status), cli->addr, cli->port); + tError("http-report failed to conn to server, reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(status), + cli->addr, cli->port, chanId); if (!uv_is_closing((uv_handle_t*)&cli->tcp)) { uv_close((uv_handle_t*)&cli->tcp, clientCloseCb); } - taosReleaseRef(httpRefMgt, httpRef); + taosReleaseRef(httpRefMgt, chanId); return; } httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 1); status = uv_write(&cli->req, (uv_stream_t*)&cli->tcp, cli->wbuf, 2, clientSentCb); if (0 != status) { - tError("http-report failed to send data,reason:%s, dst:%s:%d", uv_strerror(status), cli->addr, cli->port); + tError("http-report failed to send data,reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(status), cli->addr, + cli->port, chanId); if (!uv_is_closing((uv_handle_t*)&cli->tcp)) { uv_close((uv_handle_t*)&cli->tcp, clientCloseCb); } } - taosReleaseRef(httpRefMgt, httpRef); + taosReleaseRef(httpRefMgt, chanId); } -int32_t httpSendQuit() { - SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef); - if (http == NULL) return 0; +int32_t httpSendQuit(int64_t chanId) { + SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); + if (http == NULL) return terrno; SHttpMsg* msg = taosMemoryCalloc(1, sizeof(SHttpMsg)); + if (msg == NULL) { + taosReleaseRef(httpRefMgt, chanId); + return TSDB_CODE_OUT_OF_MEMORY; + } + msg->quit = 1; + msg->chanId = chanId; - transAsyncSend(http->asyncPool, &(msg->q)); - taosReleaseRef(httpRefMgt, httpRef); + int ret = transAsyncSend(http->asyncPool, &(msg->q)); + if (ret != 0) { + taosMemoryFree(msg); + taosReleaseRef(httpRefMgt, chanId); + return ret; + } + + taosReleaseRef(httpRefMgt, chanId); return 0; } -static int32_t taosSendHttpReportImpl(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, - EHttpCompFlag flag) { - if (server == NULL || uri == NULL) { - tError("http-report failed to report to invalid addr"); - return -1; - } - - if (pCont == NULL || contLen == 0) { - tError("http-report failed to report empty packet"); - return -1; - } - SHttpModule* load = taosAcquireRef(httpRefMgt, httpRef); - if (load == NULL) { - tError("http-report already released"); - return -1; - } - - SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg)); - - msg->server = taosStrdup(server); - msg->uri = taosStrdup(uri); - msg->port = port; - msg->cont = taosMemoryMalloc(contLen); - memcpy(msg->cont, pCont, contLen); - msg->len = contLen; - msg->flag = flag; - msg->quit = 0; - - int ret = transAsyncSend(load->asyncPool, &(msg->q)); - taosReleaseRef(httpRefMgt, httpRef); - return ret; -} - static void httpDestroyClientCb(uv_handle_t* handle) { SHttpClient* http = handle->data; destroyHttpClient(http); @@ -392,13 +428,14 @@ static void httpWalkCb(uv_handle_t* handle, void* arg) { return; } static void httpHandleQuit(SHttpMsg* msg) { + int64_t chanId = msg->chanId; taosMemoryFree(msg); - SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef); + tDebug("http-report receive quit, chanId:%" PRId64 "", chanId); + SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); if (http == NULL) return; - uv_walk(http->loop, httpWalkCb, NULL); - taosReleaseRef(httpRefMgt, httpRef); + taosReleaseRef(httpRefMgt, chanId); } static bool httpFailFastShoudIgnoreMsg(SHashObj* pTable, char* server, int16_t port) { @@ -431,8 +468,12 @@ static void httpFailFastMayUpdate(SHashObj* pTable, char* server, int16_t port, return; } static void httpHandleReq(SHttpMsg* msg) { - int32_t ignore = false; - SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef); + int64_t chanId = msg->chanId; + int32_t ignore = false; + char* header = NULL; + terrno = 0; + + SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); if (http == NULL) { goto END; } @@ -457,119 +498,250 @@ static void httpHandleReq(SHttpMsg* msg) { } } - int32_t len = 2048; - char* header = taosMemoryCalloc(1, len); - int32_t headLen = taosBuildHttpHeader(msg->server, msg->uri, msg->len, header, len, msg->flag); - if (headLen < 0) { - taosMemoryFree(header); + int32_t cap = 2048; + header = taosMemoryCalloc(1, cap); + if (header == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + + int32_t headLen = taosBuildHttpHeader(msg->server, msg->uri, msg->len, header, cap, msg->flag); + if (headLen < 0 || headLen >= cap) { goto END; } uv_buf_t* wb = taosMemoryCalloc(2, sizeof(uv_buf_t)); + if (wb == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto END; + } + wb[0] = uv_buf_init((char*)header, strlen(header)); // heap var wb[1] = uv_buf_init((char*)msg->cont, msg->len); // heap var SHttpClient* cli = taosMemoryCalloc(1, sizeof(SHttpClient)); + if (cli == NULL) { + taosMemoryFree(wb); + goto END; + } + cli->conn.data = cli; cli->tcp.data = cli; cli->req.data = cli; cli->wbuf = wb; cli->rbuf = taosMemoryCalloc(1, HTTP_RECV_BUF_SIZE); + if (cli->rbuf == NULL) { + taosMemoryFree(msg->uri); + taosMemoryFree(msg); + destroyHttpClient(cli); + taosReleaseRef(httpRefMgt, chanId); + return; + } + cli->addr = msg->server; cli->port = msg->port; cli->dest = dest; + cli->chanId = chanId; taosMemoryFree(msg->uri); taosMemoryFree(msg); - uv_tcp_init(http->loop, &cli->tcp); + int err = uv_tcp_init(http->loop, &cli->tcp); + if (err != 0) { + tError("http-report failed to init socket handle, dst:%s:%d,reason:%s chanId:%" PRId64 "", cli->addr, cli->port, + uv_strerror(err), chanId); + destroyHttpClient(cli); + taosReleaseRef(httpRefMgt, chanId); + } // set up timeout to avoid stuck; int32_t fd = taosCreateSocketWithTimeout(5000); if (fd < 0) { - tError("http-report failed to open socket, dst:%s:%d", cli->addr, cli->port); + tError("http-report failed to open socket, dst:%s:%d, chanId:%" PRId64 "", cli->addr, cli->port, chanId); destroyHttpClient(cli); - taosReleaseRef(httpRefMgt, httpRef); + taosReleaseRef(httpRefMgt, chanId); return; } int ret = uv_tcp_open((uv_tcp_t*)&cli->tcp, fd); if (ret != 0) { - tError("http-report failed to open socket, reason:%s, dst:%s:%d", uv_strerror(ret), cli->addr, cli->port); - taosReleaseRef(httpRefMgt, httpRef); + tError("http-report failed to open socket, reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(ret), cli->addr, + cli->port, chanId); destroyHttpClient(cli); + taosReleaseRef(httpRefMgt, chanId); return; } ret = uv_tcp_connect(&cli->conn, &cli->tcp, (const struct sockaddr*)&cli->dest, clientConnCb); if (ret != 0) { - tError("http-report failed to connect to http-server, reason:%s, dst:%s:%d", uv_strerror(ret), cli->addr, - cli->port); + tError("http-report failed to connect to http-server, reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(ret), + cli->addr, cli->port, chanId); httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 0); destroyHttpClient(cli); } - taosReleaseRef(httpRefMgt, httpRef); + taosReleaseRef(httpRefMgt, chanId); return; END: if (ignore == false) { - tError("http-report failed to report, reason: %s, addr: %s:%d", terrstr(), msg->server, msg->port); + tError("http-report failed to report, reason: %s, addr: %s:%d, chanId:%" PRId64 "", terrstr(), msg->server, + msg->port, chanId); } httpDestroyMsg(msg); - taosReleaseRef(httpRefMgt, httpRef); + taosMemoryFree(header); + taosReleaseRef(httpRefMgt, chanId); +} + +static void httpModuleDestroy(SHttpModule* http) { + if (http->asyncPool != NULL) { + TRANS_DESTROY_ASYNC_POOL_MSG(http->asyncPool, SHttpMsg, httpDestroyMsgWrapper, NULL); + transAsyncPoolDestroy(http->asyncPool); + } + if (http->loop) { + uv_loop_close(http->loop); + taosMemoryFree(http->loop); + } + taosHashCleanup(http->connStatusTable); + // not free http, http freeed by ref +} + +static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, uint16_t port, char* pCont, + int32_t contLen, EHttpCompFlag flag, int64_t chanId) { + int32_t ret = 0; + terrno = 0; + SHttpMsg* msg = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId); + if (msg == NULL) { + return terrno; + } + + SHttpModule* load = taosAcquireRef(httpRefMgt, chanId); + if (load == NULL) { + httpDestroyMsg(msg); + return terrno; + } + + if (atomic_load_8(&load->quit)) { + httpDestroyMsg(msg); + taosReleaseRef(httpRefMgt, chanId); + terrno = TSDB_CODE_HTTP_MODULE_QUIT; + return terrno; + } + + ret = transAsyncSend(load->asyncPool, &(msg->q)); + if (ret < 0) { + httpDestroyMsg(msg); + taosReleaseRef(httpRefMgt, chanId); + terrno = TSDB_CODE_HTTP_MODULE_QUIT; + return terrno; + } + + taosReleaseRef(httpRefMgt, chanId); + return ret; +} + +int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId) { + return taosSendHttpReportImplByChan(server, uri, port, pCont, contLen, flag, chanId); } int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag) { taosThreadOnce(&transHttpInit, transHttpEnvInit); - return taosSendHttpReportImpl(server, uri, port, pCont, contLen, flag); + return taosSendHttpReportImplByChan(server, uri, port, pCont, contLen, flag, httpDefaultChanId); } static void transHttpDestroyHandle(void* handle) { taosMemoryFree(handle); } + +int64_t transInitHttpChanImpl(); + static void transHttpEnvInit() { - httpRefMgt = taosOpenRef(1, transHttpDestroyHandle); - - SHttpModule* http = taosMemoryCalloc(1, sizeof(SHttpModule)); - http->loop = taosMemoryMalloc(sizeof(uv_loop_t)); - http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); - http->quit = 0; - - uv_loop_init(http->loop); - - http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); - if (NULL == http->asyncPool) { - taosMemoryFree(http->loop); - taosMemoryFree(http); - http = NULL; - return; - } - - int err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http); - if (err != 0) { - taosMemoryFree(http->loop); - taosMemoryFree(http); - http = NULL; - } - httpRef = taosAddRef(httpRefMgt, http); + httpRefMgt = taosOpenRef(64, transHttpDestroyHandle); + httpDefaultChanId = transInitHttpChanImpl(); } void transHttpEnvDestroy() { - // remove http - if (httpRef == -1) { + // remove default chanId + taosDestroyHttpChan(httpDefaultChanId); + httpDefaultChanId = -1; +} + +int64_t transInitHttpChanImpl() { + SHttpModule* http = taosMemoryCalloc(1, sizeof(SHttpModule)); + if (http == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return terrno; + } + + http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); + if (http->connStatusTable == NULL) { + httpModuleDestroy(http); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return terrno; + } + + http->loop = taosMemoryMalloc(sizeof(uv_loop_t)); + if (http->loop == NULL) { + httpModuleDestroy(http); + taosMemoryFree(http); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return terrno; + } + + int err = uv_loop_init(http->loop); + if (err != 0) { + tError("http-report failed init uv, reason:%s", uv_strerror(err)); + httpModuleDestroy(http); + taosMemoryFree(http); + return TSDB_CODE_THIRDPARTY_ERROR; + } + + http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); + if (NULL == http->asyncPool) { + httpModuleDestroy(http); + taosMemoryFree(http); + return terrno; + } + http->quit = 0; + + err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http); + if (err != 0) { + httpModuleDestroy(http); + taosMemoryFree(http); + terrno = TAOS_SYSTEM_ERROR(errno); + return terrno; + } + int64_t ref = taosAddRef(httpRefMgt, http); + if (ref < 0) { + return terrno; + } + return ref; +} +int64_t taosInitHttpChan() { + taosThreadOnce(&transHttpInit, transHttpEnvInit); + return transInitHttpChanImpl(); +} + +void taosDestroyHttpChan(int64_t chanId) { + tDebug("http-report send quit, chanId:%" PRId64 "", chanId); + + int ret = 0; + SHttpModule* load = taosAcquireRef(httpRefMgt, chanId); + if (load == NULL) { + tError("http-report failed destroy chanId %" PRId64 "", chanId); return; } - SHttpModule* load = taosAcquireRef(httpRefMgt, httpRef); - atomic_store_8(&load->quit, 1); - httpSendQuit(); + + ret = httpSendQuit(chanId); + if (ret != 0) { + tDebug("http-report already destroyed, chanId %" PRId64 "", chanId); + taosReleaseRef(httpRefMgt, chanId); + return; + } + taosThreadJoin(load->thread, NULL); - TRANS_DESTROY_ASYNC_POOL_MSG(load->asyncPool, SHttpMsg, httpDestroyMsgWrapper, NULL); - transAsyncPoolDestroy(load->asyncPool); - uv_loop_close(load->loop); - taosMemoryFree(load->loop); + httpModuleDestroy(load); - taosHashCleanup(load->connStatusTable); - - taosReleaseRef(httpRefMgt, httpRef); - taosRemoveRef(httpRefMgt, httpRef); -} + taosReleaseRef(httpRefMgt, chanId); + taosReleaseRef(httpRefMgt, chanId); +} \ No newline at end of file diff --git a/source/util/src/terror.c b/source/util/src/terror.c index e9fa58e6e3..e46703b88c 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -54,6 +54,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED, "some vnode/qnode/mnod TAOS_DEFINE_ERROR(TSDB_CODE_RPC_MAX_SESSIONS, "rpc open too many session") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_NETWORK_ERROR, "rpc network error") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_NETWORK_BUSY, "rpc network busy") +TAOS_DEFINE_ERROR(TSDB_CODE_HTTP_MODULE_QUIT, "http-report already quit") //common & util TAOS_DEFINE_ERROR(TSDB_CODE_TIME_UNSYNCED, "Client and server's time is not synchronized") @@ -96,6 +97,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NOT_FOUND, "Not found") TAOS_DEFINE_ERROR(TSDB_CODE_NO_DISKSPACE, "Out of disk space") TAOS_DEFINE_ERROR(TSDB_CODE_TIMEOUT_ERROR, "Operation timeout") TAOS_DEFINE_ERROR(TSDB_CODE_NO_ENOUGH_DISKSPACE, "No enough disk space") +TAOS_DEFINE_ERROR(TSDB_CODE_THIRDPARTY_ERROR, "third party error, please check the log") + TAOS_DEFINE_ERROR(TSDB_CODE_APP_IS_STARTING, "Database is starting up") TAOS_DEFINE_ERROR(TSDB_CODE_APP_IS_STOPPING, "Database is closing down") From 3148463ab316bedd4bee2b1dc275bf433aaa97dc Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 02:43:58 +0000 Subject: [PATCH 02/40] add http interface --- source/libs/transport/src/transComm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index 68ff5dc5e5..b9223e7b39 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -224,14 +224,28 @@ int transSetConnOption(uv_tcp_t* stream, int keepalive) { SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb) { SAsyncPool* pool = taosMemoryCalloc(1, sizeof(SAsyncPool)); + if (pool == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + pool->nAsync = sz; pool->asyncs = taosMemoryCalloc(1, sizeof(uv_async_t) * pool->nAsync); + if (pool->asyncs == NULL) { + taosMemoryFree(pool); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } int i = 0, err = 0; for (i = 0; i < pool->nAsync; i++) { uv_async_t* async = &(pool->asyncs[i]); SAsyncItem* item = taosMemoryCalloc(1, sizeof(SAsyncItem)); + if (item == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + break; + } item->pThrd = arg; QUEUE_INIT(&item->qmsg); taosThreadMutexInit(&item->mtx, NULL); @@ -240,6 +254,7 @@ SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb) err = uv_async_init(loop, async, cb); if (err != 0) { tError("failed to init async, reason:%s", uv_err_name(err)); + terrno = TSDB_CODE_THIRDPARTY_ERROR; break; } } From 92281bb4a3e8dafbd1b9ec578a46496be0b94e15 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 02:44:52 +0000 Subject: [PATCH 03/40] add http interface --- source/libs/transport/src/thttp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 704c4b06e2..903facb208 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -691,7 +691,8 @@ int64_t transInitHttpChanImpl() { tError("http-report failed init uv, reason:%s", uv_strerror(err)); httpModuleDestroy(http); taosMemoryFree(http); - return TSDB_CODE_THIRDPARTY_ERROR; + terrno = TSDB_CODE_THIRDPARTY_ERROR; + return terrno; } http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); From 0e1677d397ff903b6b78b0080e9f8d405e47f298 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 02:51:47 +0000 Subject: [PATCH 04/40] add http interface --- source/libs/transport/src/thttp.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 903facb208..50f3a8a135 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -73,7 +73,7 @@ static void transHttpEnvInit(); static void httpHandleReq(SHttpMsg* msg); static void httpHandleQuit(SHttpMsg* msg); -static int32_t httpSendQuit(int64_t chanId); +static int32_t httpSendQuit(SHttpModule* http, int64_t chanId); static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag, int64_t chanId); @@ -387,13 +387,9 @@ static void clientConnCb(uv_connect_t* req, int32_t status) { taosReleaseRef(httpRefMgt, chanId); } -int32_t httpSendQuit(int64_t chanId) { - SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); - if (http == NULL) return terrno; - +int32_t httpSendQuit(SHttpModule* http, int64_t chanId) { SHttpMsg* msg = taosMemoryCalloc(1, sizeof(SHttpMsg)); if (msg == NULL) { - taosReleaseRef(httpRefMgt, chanId); return TSDB_CODE_OUT_OF_MEMORY; } @@ -403,11 +399,9 @@ int32_t httpSendQuit(int64_t chanId) { int ret = transAsyncSend(http->asyncPool, &(msg->q)); if (ret != 0) { taosMemoryFree(msg); - taosReleaseRef(httpRefMgt, chanId); - return ret; + return TSDB_CODE_THIRDPARTY_ERROR; } - taosReleaseRef(httpRefMgt, chanId); return 0; } @@ -727,14 +721,14 @@ void taosDestroyHttpChan(int64_t chanId) { int ret = 0; SHttpModule* load = taosAcquireRef(httpRefMgt, chanId); if (load == NULL) { - tError("http-report failed destroy chanId %" PRId64 "", chanId); + tError("http-report failed to destroy chanId %" PRId64 ", reason:%s", chanId, tstrerror(terrno)); return; } - atomic_store_8(&load->quit, 1); - ret = httpSendQuit(chanId); + atomic_store_8(&load->quit, 1); + ret = httpSendQuit(load, chanId); if (ret != 0) { - tDebug("http-report already destroyed, chanId %" PRId64 "", chanId); + tDebug("http-report already destroyed, chanId %" PRId64 ",reason:%s", chanId, tstrerror(ret)); taosReleaseRef(httpRefMgt, chanId); return; } From 392e65c2ac6f754b71b6861917e3caf6aa77f943 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 03:22:26 +0000 Subject: [PATCH 05/40] add http interface --- source/libs/transport/src/thttp.c | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 50f3a8a135..c023422427 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -516,50 +516,53 @@ static void httpHandleReq(SHttpMsg* msg) { SHttpClient* cli = taosMemoryCalloc(1, sizeof(SHttpClient)); if (cli == NULL) { taosMemoryFree(wb); + terrno = TSDB_CODE_OUT_OF_MEMORY; goto END; } + cli->wbuf = wb; cli->conn.data = cli; cli->tcp.data = cli; cli->req.data = cli; - cli->wbuf = wb; + cli->addr = msg->server; + cli->port = msg->port; + cli->dest = dest; + cli->chanId = chanId; + taosMemoryFree(msg->uri); + taosMemoryFree(msg); + cli->rbuf = taosMemoryCalloc(1, HTTP_RECV_BUF_SIZE); if (cli->rbuf == NULL) { - taosMemoryFree(msg->uri); - taosMemoryFree(msg); + tError("http-report failed to alloc read buf, dst:%s:%d,chanId:%" PRId64 ", reason:%s", cli->addr, cli->port, + chanId, tstrerror(TSDB_CODE_OUT_OF_MEMORY)); destroyHttpClient(cli); taosReleaseRef(httpRefMgt, chanId); return; } - cli->addr = msg->server; - cli->port = msg->port; - cli->dest = dest; - cli->chanId = chanId; - - taosMemoryFree(msg->uri); - taosMemoryFree(msg); - int err = uv_tcp_init(http->loop, &cli->tcp); if (err != 0) { - tError("http-report failed to init socket handle, dst:%s:%d,reason:%s chanId:%" PRId64 "", cli->addr, cli->port, - uv_strerror(err), chanId); + tError("http-report failed to init socket handle, dst:%s:%d,chanId:%" PRId64 ", reason:%s", cli->addr, cli->port, + chanId, uv_strerror(err)); destroyHttpClient(cli); taosReleaseRef(httpRefMgt, chanId); + return; } // set up timeout to avoid stuck; int32_t fd = taosCreateSocketWithTimeout(5000); if (fd < 0) { - tError("http-report failed to open socket, dst:%s:%d, chanId:%" PRId64 "", cli->addr, cli->port, chanId); + tError("http-report failed to open socket, dst:%s:%d, chanId:%" PRId64 ", reason:%s", cli->addr, cli->port, chanId, + tstrerror(TAOS_SYSTEM_ERROR(errno))); destroyHttpClient(cli); taosReleaseRef(httpRefMgt, chanId); return; } + int ret = uv_tcp_open((uv_tcp_t*)&cli->tcp, fd); if (ret != 0) { - tError("http-report failed to open socket, reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(ret), cli->addr, - cli->port, chanId); + tError("http-report failed to open socket, reason:%s, dst:%s:%d, chanId:%" PRId64 ",reason:%s", uv_strerror(ret), + cli->addr, cli->port, chanId, uv_strerror(ret)); destroyHttpClient(cli); taosReleaseRef(httpRefMgt, chanId); return; @@ -567,8 +570,8 @@ static void httpHandleReq(SHttpMsg* msg) { ret = uv_tcp_connect(&cli->conn, &cli->tcp, (const struct sockaddr*)&cli->dest, clientConnCb); if (ret != 0) { - tError("http-report failed to connect to http-server, reason:%s, dst:%s:%d, chanId:%" PRId64 "", uv_strerror(ret), - cli->addr, cli->port, chanId); + tError("http-report failed to connect to http-server,dst:%s:%d, chanId:%" PRId64 ",reson:%s", cli->addr, cli->port, + chanId, uv_strerror(ret)); httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 0); destroyHttpClient(cli); } @@ -577,9 +580,10 @@ static void httpHandleReq(SHttpMsg* msg) { END: if (ignore == false) { - tError("http-report failed to report, reason: %s, addr: %s:%d, chanId:%" PRId64 "", terrstr(), msg->server, - msg->port, chanId); + tError("http-report failed to report to addr: %s:%d, chanId:%" PRId64 ", reason:%s", msg->server, msg->port, chanId, + tstrerror(terrno)); } + terrno = 0; httpDestroyMsg(msg); taosMemoryFree(header); taosReleaseRef(httpRefMgt, chanId); From c3caa8475aeafb71da01b9b0526fd2afeaaf26a0 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 03:25:41 +0000 Subject: [PATCH 06/40] add http interface --- source/libs/transport/src/thttp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index c023422427..4370b3d899 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -509,7 +509,6 @@ static void httpHandleReq(SHttpMsg* msg) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto END; } - wb[0] = uv_buf_init((char*)header, strlen(header)); // heap var wb[1] = uv_buf_init((char*)msg->cont, msg->len); // heap var @@ -520,17 +519,17 @@ static void httpHandleReq(SHttpMsg* msg) { goto END; } - cli->wbuf = wb; cli->conn.data = cli; cli->tcp.data = cli; cli->req.data = cli; - cli->addr = msg->server; - cli->port = msg->port; cli->dest = dest; cli->chanId = chanId; + cli->addr = msg->server; + cli->port = msg->port; taosMemoryFree(msg->uri); taosMemoryFree(msg); + cli->wbuf = wb; cli->rbuf = taosMemoryCalloc(1, HTTP_RECV_BUF_SIZE); if (cli->rbuf == NULL) { tError("http-report failed to alloc read buf, dst:%s:%d,chanId:%" PRId64 ", reason:%s", cli->addr, cli->port, From e02caa97575f8091f93be52258a676235737cfed Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 05:41:38 +0000 Subject: [PATCH 07/40] add http interface --- source/libs/transport/src/thttp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 4370b3d899..74325ae5ab 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -509,6 +509,7 @@ static void httpHandleReq(SHttpMsg* msg) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto END; } + wb[0] = uv_buf_init((char*)header, strlen(header)); // heap var wb[1] = uv_buf_init((char*)msg->cont, msg->len); // heap var From fe9aebc4fe420be791db5e62050c367456bd287c Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 09:27:42 +0000 Subject: [PATCH 08/40] fix invalid read --- source/libs/transport/src/thttp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 74325ae5ab..13c63db903 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -604,8 +604,7 @@ static void httpModuleDestroy(SHttpModule* http) { static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag, int64_t chanId) { - int32_t ret = 0; - terrno = 0; + int32_t ret = 0; SHttpMsg* msg = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId); if (msg == NULL) { return terrno; From b96e282aff681b01c38ce9560076bc6767375713 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Tue, 9 Jul 2024 03:28:27 +0000 Subject: [PATCH 09/40] refactor code --- include/libs/transport/thttp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libs/transport/thttp.h b/include/libs/transport/thttp.h index c3f107028a..a2f6b5ac8b 100644 --- a/include/libs/transport/thttp.h +++ b/include/libs/transport/thttp.h @@ -25,12 +25,12 @@ extern "C" { typedef enum { HTTP_GZIP, HTTP_FLAT } EHttpCompFlag; -int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, - EHttpCompFlag flag, int64_t chanId); - int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag); + int64_t taosInitHttpChan(); +int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId); void taosDestroyHttpChan(int64_t chanId); #ifdef __cplusplus From ddd3c23ff0b720d7b1b19f973ec9e5a60c88286b Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Tue, 9 Jul 2024 09:12:02 +0000 Subject: [PATCH 10/40] refactor code --- source/libs/transport/src/thttp.c | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 13c63db903..6f7c2aae0a 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -602,37 +602,41 @@ static void httpModuleDestroy(SHttpModule* http) { // not free http, http freeed by ref } +void httpModuleDestroy2(SHttpModule* http) { + httpModuleDestroy(http); + taosMemoryFree(http); +} + static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag, int64_t chanId) { - int32_t ret = 0; - SHttpMsg* msg = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId); + int32_t ret = 0; + SHttpModule* load = NULL; + SHttpMsg* msg = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId); if (msg == NULL) { - return terrno; + goto _ERROR; } - SHttpModule* load = taosAcquireRef(httpRefMgt, chanId); + load = taosAcquireRef(httpRefMgt, chanId); if (load == NULL) { - httpDestroyMsg(msg); - return terrno; + goto _ERROR; } if (atomic_load_8(&load->quit)) { - httpDestroyMsg(msg); - taosReleaseRef(httpRefMgt, chanId); terrno = TSDB_CODE_HTTP_MODULE_QUIT; - return terrno; + goto _ERROR; } ret = transAsyncSend(load->asyncPool, &(msg->q)); if (ret < 0) { - httpDestroyMsg(msg); - taosReleaseRef(httpRefMgt, chanId); terrno = TSDB_CODE_HTTP_MODULE_QUIT; - return terrno; + goto _ERROR; } + msg = NULL; - taosReleaseRef(httpRefMgt, chanId); - return ret; +_ERROR: + httpDestroyMsg(msg); + if (load != NULL) taosReleaseRef(httpRefMgt, chanId); + return ret = terrno; } int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, @@ -670,15 +674,14 @@ int64_t transInitHttpChanImpl() { http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); if (http->connStatusTable == NULL) { - httpModuleDestroy(http); + httpModuleDestroy2(http); terrno = TSDB_CODE_OUT_OF_MEMORY; return terrno; } http->loop = taosMemoryMalloc(sizeof(uv_loop_t)); if (http->loop == NULL) { - httpModuleDestroy(http); - taosMemoryFree(http); + httpModuleDestroy2(http); terrno = TSDB_CODE_OUT_OF_MEMORY; return terrno; } @@ -686,24 +689,21 @@ int64_t transInitHttpChanImpl() { int err = uv_loop_init(http->loop); if (err != 0) { tError("http-report failed init uv, reason:%s", uv_strerror(err)); - httpModuleDestroy(http); - taosMemoryFree(http); + httpModuleDestroy2(http); terrno = TSDB_CODE_THIRDPARTY_ERROR; return terrno; } http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); if (NULL == http->asyncPool) { - httpModuleDestroy(http); - taosMemoryFree(http); + httpModuleDestroy2(http); return terrno; } http->quit = 0; err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http); if (err != 0) { - httpModuleDestroy(http); - taosMemoryFree(http); + httpModuleDestroy2(http); terrno = TAOS_SYSTEM_ERROR(errno); return terrno; } @@ -741,5 +741,5 @@ void taosDestroyHttpChan(int64_t chanId) { httpModuleDestroy(load); taosReleaseRef(httpRefMgt, chanId); - taosReleaseRef(httpRefMgt, chanId); + taosRemoveRef(httpRefMgt, chanId); } \ No newline at end of file From 1b052eefd048b1061d4842f7b03afc1424935272 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Tue, 9 Jul 2024 09:48:26 +0000 Subject: [PATCH 11/40] refactor code --- source/libs/transport/src/thttp.c | 43 +++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 6f7c2aae0a..32f3bcea36 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -37,6 +37,7 @@ typedef struct SHttpModule { SHashObj* connStatusTable; SHashObj* connPool; int8_t quit; + int16_t connNum; } SHttpModule; typedef struct SHttpMsg { @@ -272,6 +273,7 @@ static void httpMayDiscardMsg(SHttpModule* http, SAsyncItem* item) { QUEUE_PUSH(&item->qmsg, &quitMsg->q); } } + static void httpAsyncCb(uv_async_t* handle) { SAsyncItem* item = handle->data; SHttpModule* http = item->pThrd; @@ -317,6 +319,14 @@ static FORCE_INLINE void destroyHttpClient(SHttpClient* cli) { static FORCE_INLINE void clientCloseCb(uv_handle_t* handle) { SHttpClient* cli = handle->data; + + int64_t chanId = cli->chanId; + SHttpModule* http = taosAcquireRef(httpRefMgt, cli->chanId); + if (http != NULL) { + http->connNum -= 1; + taosReleaseRef(httpRefMgt, chanId); + } + destroyHttpClient(cli); } @@ -374,6 +384,8 @@ static void clientConnCb(uv_connect_t* req, int32_t status) { taosReleaseRef(httpRefMgt, chanId); return; } + http->connNum += 1; + httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 1); status = uv_write(&cli->req, (uv_stream_t*)&cli->tcp, cli->wbuf, 2, clientSentCb); @@ -590,6 +602,8 @@ END: } static void httpModuleDestroy(SHttpModule* http) { + if (http == NULL) return; + if (http->asyncPool != NULL) { TRANS_DESTROY_ASYNC_POOL_MSG(http->asyncPool, SHttpMsg, httpDestroyMsgWrapper, NULL); transAsyncPoolDestroy(http->asyncPool); @@ -598,11 +612,13 @@ static void httpModuleDestroy(SHttpModule* http) { uv_loop_close(http->loop); taosMemoryFree(http->loop); } + taosHashCleanup(http->connStatusTable); // not free http, http freeed by ref } void httpModuleDestroy2(SHttpModule* http) { + if (http == NULL) return; httpModuleDestroy(http); taosMemoryFree(http); } @@ -669,49 +685,50 @@ int64_t transInitHttpChanImpl() { SHttpModule* http = taosMemoryCalloc(1, sizeof(SHttpModule)); if (http == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; - return terrno; + goto _ERROR; } http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); if (http->connStatusTable == NULL) { - httpModuleDestroy2(http); terrno = TSDB_CODE_OUT_OF_MEMORY; - return terrno; + goto _ERROR; } http->loop = taosMemoryMalloc(sizeof(uv_loop_t)); if (http->loop == NULL) { - httpModuleDestroy2(http); terrno = TSDB_CODE_OUT_OF_MEMORY; - return terrno; + goto _ERROR; } int err = uv_loop_init(http->loop); if (err != 0) { tError("http-report failed init uv, reason:%s", uv_strerror(err)); - httpModuleDestroy2(http); terrno = TSDB_CODE_THIRDPARTY_ERROR; - return terrno; + goto _ERROR; } http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); - if (NULL == http->asyncPool) { - httpModuleDestroy2(http); - return terrno; + if (http->asyncPool == NULL) { + goto _ERROR; } + http->quit = 0; err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http); if (err != 0) { - httpModuleDestroy2(http); terrno = TAOS_SYSTEM_ERROR(errno); - return terrno; + goto _ERROR; } + int64_t ref = taosAddRef(httpRefMgt, http); if (ref < 0) { - return terrno; + goto _ERROR; } return ref; + +_ERROR: + httpModuleDestroy2(http); + return terrno; } int64_t taosInitHttpChan() { taosThreadOnce(&transHttpInit, transHttpEnvInit); From 41b8693430ec02f49083ab35efdc5e4f0f2fb60e Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Wed, 10 Jul 2024 19:46:09 +0800 Subject: [PATCH 12/40] use regex cache --- include/util/taoserror.h | 1 + include/util/tcompare.h | 3 +- source/dnode/mgmt/node_mgmt/src/dmEnv.c | 3 + source/libs/parser/src/parUtil.c | 4 +- source/libs/scalar/src/sclvector.c | 2 + source/util/src/tcompare.c | 138 +++++++++++++++++++----- source/util/src/terror.c | 1 + source/util/src/tworker.c | 3 - 8 files changed, 125 insertions(+), 30 deletions(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 24f9d041fc..8efd67f745 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -836,6 +836,7 @@ int32_t taosGetErrSize(); #define TSDB_CODE_PAR_TBNAME_DUPLICATED TAOS_DEF_ERROR_CODE(0, 0x267E) #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_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF) //planner diff --git a/include/util/tcompare.h b/include/util/tcompare.h index 9694bee92d..4f574a9b79 100644 --- a/include/util/tcompare.h +++ b/include/util/tcompare.h @@ -45,6 +45,8 @@ typedef struct SPatternCompareInfo { TdUcs4 umatchOne; // unicode version matchOne } SPatternCompareInfo; +int32_t InitRegexCache(); +void DestroyRegexCache(); int32_t patternMatch(const char *pattern, size_t psize, const char *str, size_t ssize, const SPatternCompareInfo *pInfo); int32_t wcsPatternMatch(const TdUcs4 *pattern, size_t psize, const TdUcs4 *str, size_t ssize, const SPatternCompareInfo *pInfo); @@ -83,7 +85,6 @@ int32_t compareLenBinaryVal(const void *pLeft, const void *pRight); int32_t comparestrRegexMatch(const void *pLeft, const void *pRight); int32_t comparestrRegexNMatch(const void *pLeft, const void *pRight); -void DestoryThreadLocalRegComp(); int32_t comparewcsRegexMatch(const void *pLeft, const void *pRight); int32_t comparewcsRegexNMatch(const void *pLeft, const void *pRight); diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 4be1af30b5..46f9965d1a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -18,6 +18,7 @@ #include "audit.h" #include "libs/function/tudf.h" #include "tgrant.h" +#include "tcompare.h" #define DM_INIT_AUDIT() \ do { \ @@ -163,6 +164,7 @@ int32_t dmInit() { if (dmInitMonitor() != 0) return -1; if (dmInitAudit() != 0) return -1; if (dmInitDnode(dmInstance()) != 0) return -1; + if (InitRegexCache() != 0) return -1; #if defined(USE_S3) if (s3Begin() != 0) return -1; #endif @@ -192,6 +194,7 @@ void dmCleanup() { udfStopUdfd(); taosStopCacheRefreshWorker(); dmDiskClose(); + DestroyRegexCache(); #if defined(USE_S3) s3End(); diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index d67c7d306f..e6b6bcc903 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -223,7 +223,9 @@ static char* getSyntaxErrFormat(int32_t errCode) { return "Tag name:%s duplicated"; case TSDB_CODE_PAR_NOT_ALLOWED_DIFFERENT_BY_ROW_FUNC: return "Some functions cannot appear in the select list at the same time"; - default: + case TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR: + return "Syntax error in regular expression"; + default: return "Unknown error"; } } diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index c5789a65ca..673919b2f5 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -1667,6 +1667,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa } } else { for (int32_t i = startIndex; i < numOfRows && i >= 0; i += step) { + if (terrno != TSDB_CODE_SUCCESS) break; int32_t leftIndex = (i >= pLeft->numOfRows) ? 0 : i; int32_t rightIndex = (i >= pRight->numOfRows) ? 0 : i; @@ -1688,6 +1689,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa } else { // if (GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_JSON || GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_JSON) { for (int32_t i = startIndex; i < numOfRows && i >= startIndex; i += step) { + if (terrno != TSDB_CODE_SUCCESS) break; int32_t leftIndex = (i >= pLeft->numOfRows) ? 0 : i; int32_t rightIndex = (i >= pRight->numOfRows) ? 0 : i; diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 26122a4a29..7f14f3a1e0 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1203,54 +1203,142 @@ int32_t comparestrRegexNMatch(const void *pLeft, const void *pRight) { return comparestrRegexMatch(pLeft, pRight) ? 0 : 1; } -static threadlocal regex_t pRegex; -static threadlocal char *pOldPattern = NULL; -static regex_t *threadGetRegComp(const char *pPattern) { - if (NULL != pOldPattern) { - if( strcmp(pOldPattern, pPattern) == 0) { - return &pRegex; - } else { - DestoryThreadLocalRegComp(); +typedef struct UsingRegex { + regex_t pRegex; + int32_t usingCount; + int32_t lastUsedTime; +} UsingRegex; + +typedef struct RegexCache { + SHashObj *regexHash; + int32_t regexCaheSize; + TdThreadRwlock regexLock; + int32_t lastClearTime; +} RegexCache; +static RegexCache sRegexCache; +#define MAX_REGEX_CACHE_SIZE 20 +#define REGEX_CACHE_CLEAR_TIME 30 + +int32_t InitRegexCache() { + if (taosThreadRwlockInit(&sRegexCache.regexLock, NULL) != 0) { + uError("failed to create RegexCache lock"); + return -1; + } + sRegexCache.regexHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); + if (sRegexCache.regexHash == NULL) { + uError("failed to create RegexCache"); + return -1; + } + sRegexCache.regexCaheSize = MAX_REGEX_CACHE_SIZE; + sRegexCache.lastClearTime = taosGetTimestampSec(); + return 0; +} + +void DestroyRegexCache(){ + UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); + while ((ppUsingRegex != NULL)) { + regfree(&(*ppUsingRegex)->pRegex); + taosMemoryFree(*ppUsingRegex); + ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); + } + taosHashCleanup(sRegexCache.regexHash); + taosThreadRwlockDestroy(&sRegexCache.regexLock); +} + +static void clearOlderRegex() { + if (taosGetTimestampSec() - sRegexCache.lastClearTime < REGEX_CACHE_CLEAR_TIME || + taosHashGetSize(sRegexCache.regexHash) < sRegexCache.regexCaheSize) { + return; + } + taosThreadRwlockWrlock(&sRegexCache.regexLock); + if (taosHashGetSize(sRegexCache.regexHash) >= sRegexCache.regexCaheSize) { + UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); + while ((ppUsingRegex != NULL)) { + if ((*ppUsingRegex)->usingCount == 0 && + taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { + regfree(&(*ppUsingRegex)->pRegex); + taosMemoryFree(*ppUsingRegex); + taosHashRelease(sRegexCache.regexHash, ppUsingRegex); + sRegexCache.lastClearTime = taosGetTimestampSec(); + } + ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } } - pOldPattern = taosMemoryMalloc(strlen(pPattern) + 1); - if (NULL == pOldPattern) { + taosThreadRwlockUnlock(&sRegexCache.regexLock); +} + +static UsingRegex *getRegComp(const char *pPattern) { + taosThreadRwlockRdlock(&sRegexCache.regexLock); + UsingRegex **ppUsingRegex = (UsingRegex **)taosHashGet(sRegexCache.regexHash, pPattern, strlen(pPattern)); + if (ppUsingRegex != NULL) { + (*ppUsingRegex)->usingCount++; + taosThreadRwlockUnlock(&sRegexCache.regexLock); + return *ppUsingRegex; + } + taosThreadRwlockUnlock(&sRegexCache.regexLock); + + UsingRegex *pUsingRegex = taosMemoryMalloc(sizeof(UsingRegex)); + if (pUsingRegex == NULL) { uError("Failed to Malloc when compile regex pattern %s.", pPattern); return NULL; } - strcpy(pOldPattern, pPattern); int32_t cflags = REG_EXTENDED; - int32_t ret = regcomp(&pRegex, pPattern, cflags); + int32_t ret = regcomp(&pUsingRegex->pRegex, pPattern, cflags); if (ret != 0) { char msgbuf[256] = {0}; - regerror(ret, &pRegex, msgbuf, tListLen(msgbuf)); + regerror(ret, &pUsingRegex->pRegex, msgbuf, tListLen(msgbuf)); uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf); - DestoryThreadLocalRegComp(); + taosMemoryFree(pUsingRegex); + terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR; return NULL; } - return &pRegex; + + taosThreadRwlockWrlock(&sRegexCache.regexLock); + int code = taosHashPut(sRegexCache.regexHash, pPattern, strlen(pPattern), &pUsingRegex, sizeof(UsingRegex *)); + if (code != 0) { + if( terrno == TSDB_CODE_DUP_KEY) { + regfree(&pUsingRegex->pRegex); + taosMemoryFree(pUsingRegex); + + UsingRegex **ppUsingRegex = (UsingRegex **)taosHashGet(sRegexCache.regexHash, pPattern, strlen(pPattern)); + if(ppUsingRegex) { + pUsingRegex = (*ppUsingRegex); + } else { + uError("Failed to get regex pattern %s from cache, exception internal error.", pPattern); + taosThreadRwlockUnlock(&sRegexCache.regexLock); + return NULL; + } + } else { + uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); + taosThreadRwlockUnlock(&sRegexCache.regexLock); + return NULL; + } + } + atomic_add_fetch_32(&pUsingRegex->usingCount, 1); + taosThreadRwlockUnlock(&sRegexCache.regexLock); + + clearOlderRegex(); + return pUsingRegex; } -void DestoryThreadLocalRegComp() { - if (NULL != pOldPattern) { - regfree(&pRegex); - taosMemoryFree(pOldPattern); - pOldPattern = NULL; - } +void recycleRegex(UsingRegex *regex){ + atomic_add_fetch_32(®ex->usingCount, -1); + regex->lastUsedTime = taosGetTimestampSec(); } static int32_t doExecRegexMatch(const char *pString, const char *pPattern) { int32_t ret = 0; char msgbuf[256] = {0}; - regex_t *regex = threadGetRegComp(pPattern); - if (regex == NULL) { + UsingRegex *pUsingRegex = getRegComp(pPattern); + if (pUsingRegex == NULL) { return 1; } regmatch_t pmatch[1]; - ret = regexec(regex, pString, 1, pmatch, 0); + ret = regexec(&pUsingRegex->pRegex, pString, 1, pmatch, 0); + recycleRegex(pUsingRegex); if (ret != 0 && ret != REG_NOMATCH) { - regerror(ret, regex, msgbuf, sizeof(msgbuf)); + regerror(ret, &pUsingRegex->pRegex, msgbuf, sizeof(msgbuf)); uDebug("Failed to match %s with pattern %s, reason %s", pString, pPattern, msgbuf) } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index c7fd6f65c5..c3f3a07b86 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -683,6 +683,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TBNAME_ERROR, "Pseudo tag tbname n TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TBNAME_DUPLICATED, "Table name duplicated") 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_INTERNAL_ERROR, "Parser internal error") //planner diff --git a/source/util/src/tworker.c b/source/util/src/tworker.c index 4a8a0823b7..7a97dc3527 100644 --- a/source/util/src/tworker.c +++ b/source/util/src/tworker.c @@ -104,7 +104,6 @@ static void *tQWorkerThreadFp(SQueueWorker *worker) { } destroyThreadLocalGeosCtx(); - DestoryThreadLocalRegComp(); return NULL; } @@ -224,7 +223,6 @@ static void *tAutoQWorkerThreadFp(SQueueWorker *worker) { taosUpdateItemSize(qinfo.queue, 1); } - DestoryThreadLocalRegComp(); return NULL; } @@ -636,7 +634,6 @@ static void *tQueryAutoQWorkerThreadFp(SQueryAutoQWorker *worker) { } destroyThreadLocalGeosCtx(); - DestoryThreadLocalRegComp(); return NULL; } From 97576dc091b6627ddaf3f6be64e6f8542d9019fc Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 10 Jul 2024 20:41:45 +0800 Subject: [PATCH 13/40] fix: change s3 timestamp_step 100ms and 50ms --- tests/army/s3/s3Basic.json | 2 +- tests/army/s3/s3Basic.py | 4 ++-- tests/army/s3/s3Basic1.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/army/s3/s3Basic.json b/tests/army/s3/s3Basic.json index ef1585d2ba..c3fcdb567c 100644 --- a/tests/army/s3/s3Basic.json +++ b/tests/army/s3/s3Basic.json @@ -36,7 +36,7 @@ "insert_rows": 2000000, "childtable_prefix": "d", "insert_mode": "taosc", - "timestamp_step": 1000, + "timestamp_step": 100, "start_timestamp": 1600000000000, "columns": [ { "type": "bool", "name": "bc"}, diff --git a/tests/army/s3/s3Basic.py b/tests/army/s3/s3Basic.py index f94fe611a6..466cc5ab19 100644 --- a/tests/army/s3/s3Basic.py +++ b/tests/army/s3/s3Basic.py @@ -73,7 +73,7 @@ class TDTestCase(TBase): # come from s3_basic.json self.childtable_count = 6 self.insert_rows = 2000000 - self.timestamp_step = 1000 + self.timestamp_step = 100 def createStream(self, sname): sql = f"create stream {sname} fill_history 1 into stm1 as select count(*) from {self.db}.{self.stb} interval(10s);" @@ -262,7 +262,7 @@ class TDTestCase(TBase): # come from s3_basic.json self.insert_rows += self.insert_rows/4 - self.timestamp_step = 500 + self.timestamp_step = 50 # delete def checkDelete(self): diff --git a/tests/army/s3/s3Basic1.json b/tests/army/s3/s3Basic1.json index fb95c14e98..0618c341c9 100644 --- a/tests/army/s3/s3Basic1.json +++ b/tests/army/s3/s3Basic1.json @@ -36,7 +36,7 @@ "insert_rows": 1000000, "childtable_prefix": "d", "insert_mode": "taosc", - "timestamp_step": 500, + "timestamp_step": 50, "start_timestamp": 1600000000000, "columns": [ { "type": "bool", "name": "bc"}, From d0ade067b26207aeda72a9ee56c01463b78d9435 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Thu, 11 Jul 2024 09:12:41 +0800 Subject: [PATCH 14/40] init regex cache in unit test --- source/libs/scalar/test/scalar/scalarTests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/libs/scalar/test/scalar/scalarTests.cpp b/source/libs/scalar/test/scalar/scalarTests.cpp index fe86e18ce3..dd88344962 100644 --- a/source/libs/scalar/test/scalar/scalarTests.cpp +++ b/source/libs/scalar/test/scalar/scalarTests.cpp @@ -43,6 +43,7 @@ #include "tglobal.h" #include "tlog.h" #include "tvariant.h" +#include "tcompare.h" #define _DEBUG_PRINT_ 0 @@ -52,6 +53,12 @@ #define PRINTF(...) #endif +class constantTest { + public: + constantTest() { InitRegexCache(); } + ~constantTest() { DestroyRegexCache(); } +}; +static constantTest test; namespace { SColumnInfo createColumnInfo(int32_t colId, int32_t type, int32_t bytes) { From e0f9dc1dce6b5da21f89e1a096462e4a17b40c3f Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Thu, 11 Jul 2024 11:23:13 +0800 Subject: [PATCH 15/40] add test case --- tests/parallel_test/cases.task | 4 + tests/system-test/2-query/match.py | 149 +++++++++++++++++++++++++++++ tests/system-test/win-test-file | 4 + 3 files changed, 157 insertions(+) create mode 100644 tests/system-test/2-query/match.py diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 4338187791..e9daf4f0ca 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -192,6 +192,10 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/like.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/like.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/like.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/match.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/match.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/match.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/match.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/td-28068.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/td-28068.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/td-28068.py -Q 3 diff --git a/tests/system-test/2-query/match.py b/tests/system-test/2-query/match.py new file mode 100644 index 0000000000..2e47f079e2 --- /dev/null +++ b/tests/system-test/2-query/match.py @@ -0,0 +1,149 @@ +import taos +import sys +import datetime +import inspect +import threading +import time + +from util.log import * +from util.sql import * +from util.cases import * +from util.common import tdCom + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), True) + + def initConnection(self): + self.records = 10000000 + self.numOfTherads = 50 + self.ts = 1537146000000 + self.host = "127.0.0.1" + self.user = "root" + self.password = "taosdata" + self.config = "/home/xp/git/TDengine/sim/dnode1/cfg" + self.conn = taos.connect( + self.host, + self.user, + self.password, + self.config) + + def initDB(self): + tdSql.execute("drop database if exists db") + tdSql.execute("create database if not exists db") + + def stopTest(self): + tdSql.execute("drop database if exists db") + + def insertData(self, threadID): + cursor = self.conn.cursor() + print("Thread %d: starting" % threadID) + base = 200000 * threadID + for i in range(200): + query = "insert into tb values" + for j in range(1000): + query += "(%d, %d, 'test')" % (self.ts + base + i * 1000 + j, base + i * 1000 + j) + cursor.execute(query) + cursor.close() + print("Thread %d: finishing" % threadID) + + def threadTest(self, threadID): + print(f"Thread {threadID} starting...") + tdsqln = tdCom.newTdSql() + for i in range(2, 50): + tdsqln.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*{i}dx'") + tdsqln.checkRows(0) + for i in range(100): + tdsqln.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*1x'") + tdsqln.checkRows(2) + + tdsqln.query("select * from db.t1x") + tdsqln.checkRows(5) + + tdsqln.query("select * from db.t1x where c1 match '_c'") + tdsqln.checkRows(2) + + tdsqln.query("select * from db.t1x where c1 match '%__c'") + tdsqln.checkRows(0) + + print(f"Thread {threadID} finished.") + + def match_test(self): + tdSql.execute("create table db.t1x (ts timestamp, c1 varchar(100))") + tdSql.execute("create table db.t_1x (ts timestamp, c1 varchar(100))") + + tdSql.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*1x'") + tdSql.checkRows(2) + for i in range(2, 50): + tdSql.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*{i}x'") + tdSql.checkRows(0) + + tdSql.query("insert into db.t1x values(now, 'abc'), (now+1s, 'a%c'),(now+2s, 'a_c'),(now+3s, '_c'),(now+4s, '%c')") + + tdSql.query("select * from db.t1x") + tdSql.checkRows(5) + + tdSql.query("select * from db.t1x where c1 match '_c'") + tdSql.checkRows(2) + + tdSql.query("select * from db.t1x where c1 match '%__c'") + tdSql.checkRows(0) + + threads = [] + for i in range(10): + t = threading.Thread(target=self.threadTest, args=(i,)) + threads.append(t) + t.start() + + time.sleep(31) + + tdSql.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*1x'") + tdSql.checkRows(2) + for i in range(2, 50): + tdSql.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*{i}x'") + tdSql.checkRows(0) + + tdSql.query("select * from db.t1x") + tdSql.checkRows(5) + + tdSql.query("select * from db.t1x where c1 match '_c'") + tdSql.checkRows(2) + + tdSql.query("select * from db.t1x where c1 match '%__c'") + tdSql.checkRows(0) + + tdSql.execute("create table db.t3x (ts timestamp, c1 varchar(100))") + + tdSql.execute("insert into db.t3x values(now, '我是中文'), (now+1s, '我是_中文'), (now+2s, '我是%中文'), (now+3s, '%中文'),(now+4s, '_中文')") + tdSql.query("select * from db.t3x where c1 match '%中文'") + tdSql.checkRows(2) + tdSql.query("select * from db.t3x where c1 match '中文'") + tdSql.checkRows(5) + + for thread in threads: + print(f"Thread waitting for finish...") + thread.join() + + print(f"Mutithread test finished.") + + def run(self): + tdLog.printNoPrefix("==========start match_test run ...............") + tdSql.prepare(replica = self.replicaVar) + + self.initConnection() + + self.initDB() + self.match_test() + + self.stopTest() + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/win-test-file b/tests/system-test/win-test-file index 96f9452827..cdc4e27f20 100644 --- a/tests/system-test/win-test-file +++ b/tests/system-test/win-test-file @@ -104,6 +104,10 @@ python3 ./test.py -f 2-query/like.py python3 ./test.py -f 2-query/like.py -Q 2 python3 ./test.py -f 2-query/like.py -Q 3 python3 ./test.py -f 2-query/like.py -Q 4 +python3 ./test.py -f 2-query/match.py +python3 ./test.py -f 2-query/match.py -Q 2 +python3 ./test.py -f 2-query/match.py -Q 3 +python3 ./test.py -f 2-query/match.py -Q 4 python3 ./test.py -f 3-enterprise/restore/restoreDnode.py -N 5 -M 3 -i False python3 ./test.py -f 3-enterprise/restore/restoreVnode.py -N 5 -M 3 -i False python3 ./test.py -f 3-enterprise/restore/restoreMnode.py -N 5 -M 3 -i False From c135ee835867a1ab226a5e66ea664fb32589b72f Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Thu, 11 Jul 2024 11:37:16 +0800 Subject: [PATCH 16/40] fix: set terrno --- source/util/src/tcompare.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 7f14f3a1e0..fde07b4ba8 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1280,6 +1280,7 @@ static UsingRegex *getRegComp(const char *pPattern) { UsingRegex *pUsingRegex = taosMemoryMalloc(sizeof(UsingRegex)); if (pUsingRegex == NULL) { uError("Failed to Malloc when compile regex pattern %s.", pPattern); + terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } int32_t cflags = REG_EXTENDED; @@ -1306,11 +1307,13 @@ static UsingRegex *getRegComp(const char *pPattern) { } else { uError("Failed to get regex pattern %s from cache, exception internal error.", pPattern); taosThreadRwlockUnlock(&sRegexCache.regexLock); + terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; return NULL; } } else { uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); taosThreadRwlockUnlock(&sRegexCache.regexLock); + terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; return NULL; } } From 942599fe04ef913745d7aba3684c2a14504d93d4 Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Tue, 9 Jul 2024 09:10:27 +0800 Subject: [PATCH 17/40] enh: 'create table' parses csv file per tsMaxInsertBatchRows --- include/common/ttokendef.h | 20 +- include/libs/nodes/cmdnodes.h | 3 - include/libs/nodes/querynodes.h | 22 +- source/libs/nodes/src/nodesUtilFuncs.c | 16 +- source/libs/parser/inc/parInt.h | 1 + source/libs/parser/inc/sql.y | 6 +- source/libs/parser/src/parAstParser.c | 20 + source/libs/parser/src/parTranslater.c | 445 +- source/libs/parser/src/parser.c | 37 +- source/libs/parser/src/sql.c | 9963 ++++++++++---------- source/libs/planner/src/planLogicCreater.c | 9 +- 11 files changed, 5367 insertions(+), 5175 deletions(-) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 81c494223c..41802d5400 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -132,16 +132,16 @@ #define TK_TABLE 114 #define TK_NK_LP 115 #define TK_NK_RP 116 -#define TK_STABLE 117 -#define TK_COLUMN 118 -#define TK_MODIFY 119 -#define TK_RENAME 120 -#define TK_TAG 121 -#define TK_SET 122 -#define TK_NK_EQ 123 -#define TK_USING 124 -#define TK_TAGS 125 -#define TK_FILE 126 +#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 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index f97240a167..cb9234c5c6 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -221,9 +221,6 @@ typedef struct SCreateSubTableFromFileClause { bool ignoreExists; SNodeList* pSpecificTags; char filePath[PATH_MAX]; - TdFilePtr fp; - SArray* aCreateTbData; - SArray* aTagIndexs; } SCreateSubTableFromFileClause; typedef struct SCreateMultiTablesStmt { diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 457937835d..a28583d6ec 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -233,7 +233,7 @@ typedef struct SViewNode { #define IS_WINDOW_JOIN(_stype) ((_stype) == JOIN_STYPE_WIN) #define IS_ASOF_JOIN(_stype) ((_stype) == JOIN_STYPE_ASOF) -typedef enum EJoinType { +typedef enum EJoinType { JOIN_TYPE_INNER = 0, JOIN_TYPE_LEFT, JOIN_TYPE_RIGHT, @@ -251,7 +251,7 @@ typedef enum EJoinSubType { JOIN_STYPE_MAX_VALUE } EJoinSubType; -typedef enum EJoinAlgorithm { +typedef enum EJoinAlgorithm { JOIN_ALGO_UNKNOWN = 0, JOIN_ALGO_MERGE, JOIN_ALGO_HASH, @@ -453,7 +453,7 @@ typedef struct SSetOperator { SNode* pLimit; char stmtName[TSDB_TABLE_NAME_LEN]; uint8_t precision; - ETimeLineMode timeLineResMode; + ETimeLineMode timeLineResMode; bool timeLineFromOrderBy; bool joinContains; } SSetOperator; @@ -503,6 +503,10 @@ typedef void (*FFreeTableBlockHash)(SHashObj*); typedef void (*FFreeVgourpBlockArray)(SArray*); struct SStbRowsDataContext; typedef void (*FFreeStbRowsDataContext)(struct SStbRowsDataContext*); +struct SCreateTbInfo; +struct SParseFileContext; +typedef void (*FDestroyParseFileContext)(struct SParseFileContext**); + typedef struct SVnodeModifyOpStmt { ENodeType nodeType; ENodeType sqlNodeType; @@ -523,7 +527,7 @@ typedef struct SVnodeModifyOpStmt { SHashObj* pTableNameHashObj; // set of table names for refreshing meta, sync mode SHashObj* pDbFNameHashObj; // set of db names for refreshing meta, sync mode SHashObj* pTableCxtHashObj; // temp SHashObj for single request - SArray* pVgDataBlocks; // SArray + SArray* pVgDataBlocks; // SArray SVCreateTbReq* pCreateTblReq; TdFilePtr fp; FFreeTableBlockHash freeHashFunc; @@ -531,9 +535,13 @@ typedef struct SVnodeModifyOpStmt { bool usingTableProcessing; bool fileProcessing; - bool stbSyntax; - struct SStbRowsDataContext* pStbRowsCxt; + bool stbSyntax; + struct SStbRowsDataContext* pStbRowsCxt; FFreeStbRowsDataContext freeStbRowsCxtFunc; + + struct SCreateTbInfo* pCreateTbInfo; + struct SParseFileContext* pParFileCxt; + FDestroyParseFileContext destroyParseFileCxt; } SVnodeModifyOpStmt; typedef struct SExplainOptions { @@ -601,7 +609,7 @@ typedef enum ECollectColType { COLLECT_COL_TYPE_COL = 1, COLLECT_COL_TYPE_TAG, C int32_t nodesCollectColumns(SSelectStmt* pSelect, ESqlClause clause, const char* pTableAlias, ECollectColType type, SNodeList** pCols); int32_t nodesCollectColumnsExt(SSelectStmt* pSelect, ESqlClause clause, SSHashObj* pMultiTableAlias, ECollectColType type, - SNodeList** pCols); + SNodeList** pCols); int32_t nodesCollectColumnsFromNode(SNode* node, const char* pTableAlias, ECollectColType type, SNodeList** pCols); typedef bool (*FFuncClassifier)(int32_t funcId); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index f118c15b7a..ce410f76be 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1061,6 +1061,13 @@ void nodesDestroyNode(SNode* pNode) { pStmt->freeStbRowsCxtFunc(pStmt->pStbRowsCxt); } taosMemoryFreeClear(pStmt->pStbRowsCxt); + + taosMemoryFreeClear(pStmt->pCreateTbInfo); + + if (pStmt->destroyParseFileCxt) { + pStmt->destroyParseFileCxt(&pStmt->pParFileCxt); + } + taosCloseFile(&pStmt->fp); break; } @@ -1093,15 +1100,6 @@ void nodesDestroyNode(SNode* pNode) { } case QUERY_NODE_CREATE_SUBTABLE_FROM_FILE_CLAUSE: { SCreateSubTableFromFileClause* pStmt = (SCreateSubTableFromFileClause*)pNode; - if (pStmt->aCreateTbData) { - taosArrayDestroy(pStmt->aCreateTbData); - } - if (pStmt->aTagIndexs) { - taosArrayDestroy(pStmt->aTagIndexs); - } - if (pStmt->fp) { - taosCloseFile(&pStmt->fp); - } nodesDestroyList(pStmt->pSpecificTags); break; } diff --git a/source/libs/parser/inc/parInt.h b/source/libs/parser/inc/parInt.h index d58e9bd86a..c231de653c 100644 --- a/source/libs/parser/inc/parInt.h +++ b/source/libs/parser/inc/parInt.h @@ -29,6 +29,7 @@ extern "C" { #define QUERY_SMA_OPTIMIZE_ENABLE 1 int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatalogReq, const SMetaData* pMetaData); +int32_t continueCreateTbFromFile(SParseContext* pCxt, SQuery** pQuery); int32_t parse(SParseContext* pParseCxt, SQuery** pQuery); int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache); int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index f9bf9b8bb1..149e02ad3d 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -353,6 +353,8 @@ end_opt(A) ::= END WITH TIMESTAMP NK_STRING(B). cmd ::= CREATE TABLE not_exists_opt(A) full_table_name(B) NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); } cmd ::= CREATE TABLE multi_create_clause(A). { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, A); } +cmd ::= CREATE TABLE not_exists_opt(B) USING full_table_name(C) + NK_LP tag_list_opt(D) NK_RP FILE NK_STRING(E). { pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, B, C, D, &E); } cmd ::= CREATE STABLE not_exists_opt(A) full_table_name(B) NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); } cmd ::= DROP TABLE multi_drop_clause(A). { pCxt->pRootNode = createDropTableStmt(pCxt, A); } @@ -385,15 +387,11 @@ alter_table_clause(A) ::= %destructor multi_create_clause { nodesDestroyList($$); } multi_create_clause(A) ::= create_subtable_clause(B). { A = createNodeList(pCxt, B); } multi_create_clause(A) ::= multi_create_clause(B) create_subtable_clause(C). { A = addNodeToList(pCxt, B, C); } -multi_create_clause(A) ::= create_from_file_clause(B). { A = createNodeList(pCxt, B); } create_subtable_clause(A) ::= not_exists_opt(B) full_table_name(C) USING full_table_name(D) specific_cols_opt(E) TAGS NK_LP tags_literal_list(F) NK_RP table_options(G). { A = createCreateSubTableClause(pCxt, B, C, D, E, F, G); } -create_from_file_clause(A) ::= not_exists_opt(B) USING full_table_name(C) - NK_LP tag_list_opt(D) NK_RP FILE NK_STRING(E). { A = createCreateSubTableFromFileClause(pCxt, B, C, D, &E); } - %type multi_drop_clause { SNodeList* } %destructor multi_drop_clause { nodesDestroyList($$); } multi_drop_clause(A) ::= drop_table_clause(B). { A = createNodeList(pCxt, B); } diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 02f262cfb1..fa4b57c2b4 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -310,6 +310,24 @@ static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCre return code; } +static int32_t collectMetaKeyFromCreateSubTableFromFile(SCollectMetaKeyCxt* pCxt, + SCreateSubTableFromFileClause* pClause) { + int32_t code = TSDB_CODE_SUCCESS; + SNode* pNode = NULL; + + code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pClause->useDbName, pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = + reserveTableMetaInCache(pCxt->pParseCxt->acctId, pClause->useDbName, pClause->useTableName, pCxt->pMetaCache); + } + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pClause->useDbName, NULL, + AUTH_TYPE_WRITE, pCxt->pMetaCache); + } + + return code; +} + static int32_t collectMetaKeyFromDropTable(SCollectMetaKeyCxt* pCxt, SDropTableStmt* pStmt) { int32_t code = TSDB_CODE_SUCCESS; SNode* pNode = NULL; @@ -866,6 +884,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromCreateTable(pCxt, (SCreateTableStmt*)pStmt); case QUERY_NODE_CREATE_MULTI_TABLES_STMT: return collectMetaKeyFromCreateMultiTable(pCxt, (SCreateMultiTablesStmt*)pStmt); + case QUERY_NODE_CREATE_SUBTABLE_FROM_FILE_CLAUSE: + return collectMetaKeyFromCreateSubTableFromFile(pCxt, (SCreateSubTableFromFileClause*)pStmt); case QUERY_NODE_DROP_TABLE_STMT: return collectMetaKeyFromDropTable(pCxt, (SDropTableStmt*)pStmt); case QUERY_NODE_DROP_SUPER_TABLE_STMT: diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index b741db3ae6..c5c9732c5f 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -11856,7 +11856,8 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN return TSDB_CODE_SUCCESS; } -static int32_t createParOperatorNode(EOperatorType opType, const char* pLeftCol, const char* pRightCol, SNode** ppResOp) { +static int32_t createParOperatorNode(EOperatorType opType, const char* pLeftCol, const char* pRightCol, + SNode** ppResOp) { SOperatorNode* pOper = (SOperatorNode*)nodesMakeNode(QUERY_NODE_OPERATOR); CHECK_POINTER_OUT_OF_MEM(pOper); @@ -12661,7 +12662,7 @@ static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableCla } static int32_t buildTagIndexForBindTags(SMsgBuf* pMsgBuf, SCreateSubTableFromFileClause* pStmt, - STableMeta* pSuperTableMeta) { + STableMeta* pSuperTableMeta, SArray* aTagIndexs) { int32_t code = TSDB_CODE_SUCCESS; int32_t numOfTags = getNumOfTags(pSuperTableMeta); @@ -12672,7 +12673,7 @@ static int32_t buildTagIndexForBindTags(SMsgBuf* pMsgBuf, SCreateSubTableFromFil return TSDB_CODE_OUT_OF_MEMORY; } - bool tbnameFound = false; + bool tbnameFound = false; SNode* pTagNode; FOREACH(pTagNode, pStmt->pSpecificTags) { @@ -12724,14 +12725,14 @@ static int32_t buildTagIndexForBindTags(SMsgBuf* pMsgBuf, SCreateSubTableFromFil goto _OUT; } - if (NULL == taosArrayPush(pStmt->aTagIndexs, &idx)) { + if (NULL == taosArrayPush(aTagIndexs, &idx)) { code = TSDB_CODE_OUT_OF_MEMORY; goto _OUT; } } if (TSDB_CODE_SUCCESS == code && !tbnameFound) { - code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_ERROR); + code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_ERROR); } _OUT: @@ -12739,21 +12740,19 @@ _OUT: return code; } -typedef struct { - // refer - STableMeta* pSuperTableMeta; - SArray* pTagIndexs; - TdFilePtr fp; +typedef struct SParseFileContext { + SHashObj* pTbNameHash; + SArray* aTagNames; + bool tagNameFilled; + STableMeta* pStbMeta; + SArray* aTagIndexs; - // containers - SHashObj* pTbNameHash; - SArray* aTagNames; - bool tagNameFilled; - SArray* aTagVals; - char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW]; + char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW]; + SArray* aCreateTbData; // per line const char* pSql; + SArray* aTagVals; STag* pTag; SName ctbName; SVgroupInfo vg; @@ -12777,48 +12776,48 @@ static int32_t fillVgroupInfo(SParseContext* pParseCxt, const SName* pName, SVgr return code; } -static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCtx) { +static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCxt) { int32_t code = TSDB_CODE_SUCCESS; - int sz = taosArrayGetSize(pParFileCtx->pTagIndexs); - int32_t numOfTags = getNumOfTags(pParFileCtx->pSuperTableMeta); - uint8_t precision = getTableInfo(pParFileCtx->pSuperTableMeta).precision; - SSchema* pSchemas = getTableTagSchema(pParFileCtx->pSuperTableMeta); + int sz = taosArrayGetSize(pParFileCxt->aTagIndexs); + int32_t numOfTags = getNumOfTags(pParFileCxt->pStbMeta); + uint8_t precision = getTableInfo(pParFileCxt->pStbMeta).precision; + SSchema* pSchemas = getTableTagSchema(pParFileCxt->pStbMeta); for (int i = 0; i < sz; i++) { - const char* pSql = pParFileCtx->pSql; + const char* pSql = pParFileCxt->pSql; int32_t pos = 0; SToken token = tStrGetToken(pSql, &pos, true, NULL); - pParFileCtx->pSql += pos; + pParFileCxt->pSql += pos; if (TK_NK_RP == token.type) { code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_INVALID_COLUMNS_NUM); break; } - int16_t index = *(int16_t*)taosArrayGet(pParFileCtx->pTagIndexs, i); + int16_t index = *(int16_t*)taosArrayGet(pParFileCxt->aTagIndexs, i); if (index < numOfTags) { // parse tag const SSchema* pTagSchema = &pSchemas[index]; - code = checkAndTrimValue(&token, pParFileCtx->tmpTokenBuf, pMsgBuf, pTagSchema->type); + code = checkAndTrimValue(&token, pParFileCxt->tmpTokenBuf, pMsgBuf, pTagSchema->type); if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { code = buildInvalidOperationMsg(pMsgBuf, "not expected row value"); } if (TSDB_CODE_SUCCESS == code) { - SArray* aTagNames = pParFileCtx->tagNameFilled ? NULL : pParFileCtx->aTagNames; - code = parseTagValue(pMsgBuf, &pParFileCtx->pSql, precision, (SSchema*)pTagSchema, &token, - aTagNames, pParFileCtx->aTagVals, &pParFileCtx->pTag); + SArray* aTagNames = pParFileCxt->tagNameFilled ? NULL : pParFileCxt->aTagNames; + code = parseTagValue(pMsgBuf, &pParFileCxt->pSql, precision, (SSchema*)pTagSchema, &token, aTagNames, + pParFileCxt->aTagVals, &pParFileCxt->pTag); } } else { // parse tbname - code = checkAndTrimValue(&token, pParFileCtx->tmpTokenBuf, pMsgBuf, TSDB_DATA_TYPE_BINARY); + code = checkAndTrimValue(&token, pParFileCxt->tmpTokenBuf, pMsgBuf, TSDB_DATA_TYPE_BINARY); if (TK_NK_VARIABLE == token.type) { code = buildInvalidOperationMsg(pMsgBuf, "not expected tbname"); } if (TSDB_CODE_SUCCESS == code) { bool bFoundTbName = false; - code = parseTbnameToken(pMsgBuf, pParFileCtx->ctbName.tname, &token, &bFoundTbName); + code = parseTbnameToken(pMsgBuf, pParFileCxt->ctbName.tname, &token, &bFoundTbName); } } @@ -12826,8 +12825,8 @@ static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCtx) } if (TSDB_CODE_SUCCESS == code) { - pParFileCtx->tagNameFilled = true; - code = tTagNew(pParFileCtx->aTagVals, 1, false, &pParFileCtx->pTag); + pParFileCxt->tagNameFilled = true; + code = tTagNew(pParFileCxt->aTagVals, 1, false, &pParFileCxt->pTag); } return code; @@ -12840,171 +12839,262 @@ typedef struct { SVgroupInfo vg; } SCreateTableData; -static void clearTagValArrayFp(void *data) { +static void clearTagValArrayFp(void* data) { STagVal* p = (STagVal*)data; if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFreeClear(p->pData); } } -static void clearCreateTbArrayFp(void *data) { +static void clearCreateTbArrayFp(void* data) { SCreateTableData* p = (SCreateTableData*)data; taosMemoryFreeClear(p->pTag); } -static int32_t parseCsvFile(SMsgBuf* pMsgBuf, SParseContext* pParseCxt, SParseFileContext* pParseFileCtx, - SArray* aCreateTbData) { +static int32_t parseCsvFile(SMsgBuf* pMsgBuf, SParseContext* pParseCxt, SParseFileContext* pParFileCxt, TdFilePtr fp, + int32_t maxLineCount) { int32_t code = TSDB_CODE_SUCCESS; char* pLine = NULL; int64_t readLen = 0; - while (TSDB_CODE_SUCCESS == code && (readLen = taosGetLineFile(pParseFileCtx->fp, &pLine)) != -1) { + int32_t lineCount = 0; + while (TSDB_CODE_SUCCESS == code && (readLen = taosGetLineFile(fp, &pLine)) != -1) { if (('\r' == pLine[readLen - 1]) || ('\n' == pLine[readLen - 1])) { pLine[--readLen] = '\0'; } if (readLen == 0) continue; - if (pLine[0] == '#') continue; + if (pLine[0] == '#') continue; // ignore comment line begins with '#' strtolower(pLine, pLine); - pParseFileCtx->pSql = pLine; + pParFileCxt->pSql = pLine; - code = parseOneStbRow(pMsgBuf, pParseFileCtx); + code = parseOneStbRow(pMsgBuf, pParFileCxt); if (TSDB_CODE_SUCCESS == code) { - if (taosHashGet(pParseFileCtx->pTbNameHash, pParseFileCtx->ctbName.tname, - strlen(pParseFileCtx->ctbName.tname) + 1) != NULL) { - taosMemoryFreeClear(pParseFileCtx->pTag); - code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_DUPLICATED, pParseFileCtx->ctbName.tname); + if (taosHashGet(pParFileCxt->pTbNameHash, pParFileCxt->ctbName.tname, strlen(pParFileCxt->ctbName.tname) + 1) != + NULL) { + taosMemoryFreeClear(pParFileCxt->pTag); + code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_DUPLICATED, pParFileCxt->ctbName.tname); break; } - code = taosHashPut(pParseFileCtx->pTbNameHash, pParseFileCtx->ctbName.tname, - strlen(pParseFileCtx->ctbName.tname) + 1, NULL, 0); + code = taosHashPut(pParFileCxt->pTbNameHash, pParFileCxt->ctbName.tname, strlen(pParFileCxt->ctbName.tname) + 1, + NULL, 0); } if (TSDB_CODE_SUCCESS == code) { - code = fillVgroupInfo(pParseCxt, &pParseFileCtx->ctbName, &pParseFileCtx->vg); + code = fillVgroupInfo(pParseCxt, &pParFileCxt->ctbName, &pParFileCxt->vg); } if (TSDB_CODE_SUCCESS == code) { - SCreateTableData data = {.ctbName = pParseFileCtx->ctbName, - .aTagNames = pParseFileCtx->aTagNames, - .pTag = pParseFileCtx->pTag, - .vg = pParseFileCtx->vg}; + SCreateTableData data = {.ctbName = pParFileCxt->ctbName, + .aTagNames = pParFileCxt->aTagNames, + .pTag = pParFileCxt->pTag, + .vg = pParFileCxt->vg}; - taosArrayPush(aCreateTbData, &data); + taosArrayPush(pParFileCxt->aCreateTbData, &data); } else { - taosMemoryFreeClear(pParseFileCtx->pTag); + taosMemoryFreeClear(pParFileCxt->pTag); } - pParseFileCtx->pTag = NULL; - taosArrayClearEx(pParseFileCtx->aTagVals, clearTagValArrayFp); + pParFileCxt->pTag = NULL; + taosArrayClearEx(pParFileCxt->aTagVals, clearTagValArrayFp); + lineCount++; + if (lineCount == maxLineCount) break; } if (TSDB_CODE_SUCCESS != code) { - taosArrayClearEx(aCreateTbData, clearCreateTbArrayFp); + taosArrayClearEx(pParFileCxt->aCreateTbData, clearCreateTbArrayFp); } taosMemoryFree(pLine); return code; } -static int32_t prepareReadFromFile(SCreateSubTableFromFileClause* pStmt) { +static void destructParseFileContext(SParseFileContext** ppParFileCxt) { + if (NULL == ppParFileCxt || NULL == *ppParFileCxt) { + return; + } + + SParseFileContext* pParFileCxt = *ppParFileCxt; + + taosHashCleanup(pParFileCxt->pTbNameHash); + taosArrayDestroy(pParFileCxt->aTagNames); + taosMemoryFreeClear(pParFileCxt->pStbMeta); + taosArrayDestroy(pParFileCxt->aTagIndexs); + taosArrayDestroy(pParFileCxt->aCreateTbData); + taosArrayDestroy(pParFileCxt->aTagVals); + taosMemoryFree(pParFileCxt); + + *ppParFileCxt = NULL; + + return; +} + +static int32_t constructParseFileContext(SCreateSubTableFromFileClause* pStmt, STableMeta* pSuperTableMeta, + int32_t acctId, SParseFileContext** ppParFileCxt) { int32_t code = TSDB_CODE_SUCCESS; - if (NULL == pStmt->fp) { - pStmt->fp = taosOpenFile(pStmt->filePath, TD_FILE_READ | TD_FILE_STREAM); - if (NULL == pStmt->fp) { + + SParseFileContext* pParFileCxt = taosMemoryCalloc(1, sizeof(SParseFileContext)); + pParFileCxt->pStbMeta = pSuperTableMeta; + pParFileCxt->tagNameFilled = false; + pParFileCxt->pTag = NULL; + pParFileCxt->ctbName.type = TSDB_TABLE_NAME_T; + pParFileCxt->ctbName.acctId = acctId; + strcpy(pParFileCxt->ctbName.dbname, pStmt->useDbName); + + if (NULL == pParFileCxt->pTbNameHash) { + pParFileCxt->pTbNameHash = + taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); + if (!pParFileCxt->pTbNameHash) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _ERR; + } + } + + if (NULL == pParFileCxt->aTagNames) { + pParFileCxt->aTagNames = taosArrayInit(8, TSDB_COL_NAME_LEN); + if (NULL == pParFileCxt->aTagNames) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _ERR; + } + } + + if (NULL == pParFileCxt->aCreateTbData) { + pParFileCxt->aCreateTbData = taosArrayInit(16, sizeof(SCreateTableData)); + if (NULL == pParFileCxt->aCreateTbData) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _ERR; + } + } + + if (NULL == pParFileCxt->aTagIndexs) { + pParFileCxt->aTagIndexs = taosArrayInit(pStmt->pSpecificTags->length, sizeof(int16_t)); + if (!pParFileCxt->aTagIndexs) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _ERR; + } + } + + if (NULL == pParFileCxt->aTagVals) { + pParFileCxt->aTagVals = taosArrayInit(8, sizeof(STagVal)); + if (!pParFileCxt->aTagVals) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _ERR; + } + } + + *ppParFileCxt = pParFileCxt; + + return code; + +_ERR: + destructParseFileContext(&pParFileCxt); + + return code; +} + +typedef struct SCreateTbInfo { + bool ignoreExists; + char useDbName[TSDB_DB_NAME_LEN]; + char useTableName[TSDB_TABLE_NAME_LEN]; +} SCreateTbInfo; + +static int32_t prepareReadCsvFile(STranslateContext* pCxt, SCreateSubTableFromFileClause* pCreateStmt, + SVnodeModifyOpStmt* pModifyStmt) { + int32_t code = 0; + + TdFilePtr fp = NULL; + SCreateTbInfo* pCreateInfo = NULL; + SParseFileContext* pParFileCxt = NULL; + + if (NULL == pModifyStmt->fp) { + fp = taosOpenFile(pCreateStmt->filePath, TD_FILE_READ | TD_FILE_STREAM); + if (NULL == fp) { code = TAOS_SYSTEM_ERROR(errno); goto _ERR; } } - if (NULL == pStmt->aCreateTbData) { - pStmt->aCreateTbData = taosArrayInit(16, sizeof(SCreateTableData)); - if (NULL == pStmt->aCreateTbData) { + { + pCreateInfo = taosMemoryCalloc(1, sizeof(SCreateTbInfo)); + if (NULL == pCreateInfo) { code = TSDB_CODE_OUT_OF_MEMORY; goto _ERR; } + + pCreateInfo->ignoreExists = pCreateStmt->ignoreExists; + strncpy(pCreateInfo->useDbName, pCreateStmt->useDbName, TSDB_DB_NAME_LEN); + strncpy(pCreateInfo->useTableName, pCreateStmt->useTableName, TSDB_TABLE_NAME_LEN); } - if (NULL == pStmt->aTagIndexs) { - pStmt->aTagIndexs = taosArrayInit(pStmt->pSpecificTags->length, sizeof(int16_t)); - if (!pStmt->aTagIndexs) { - code = TSDB_CODE_OUT_OF_MEMORY; - goto _ERR; - } + { + STableMeta* pSuperTableMeta = NULL; + code = getTableMeta(pCxt, pCreateStmt->useDbName, pCreateStmt->useTableName, &pSuperTableMeta); + if (TSDB_CODE_SUCCESS != code) goto _ERR; + + code = constructParseFileContext(pCreateStmt, pSuperTableMeta, pCxt->pParseCxt->acctId, &pParFileCxt); + if (TSDB_CODE_SUCCESS != code) goto _ERR; + + code = buildTagIndexForBindTags(&pCxt->msgBuf, pCreateStmt, pParFileCxt->pStbMeta, pParFileCxt->aTagIndexs); + if (TSDB_CODE_SUCCESS != code) goto _ERR; } + pModifyStmt->fp = fp; + pModifyStmt->fileProcessing = false; + pModifyStmt->pCreateTbInfo = pCreateInfo; + pModifyStmt->pParFileCxt = pParFileCxt; + return code; _ERR: - taosCloseFile(&pStmt->fp); - taosArrayDestroy(pStmt->aCreateTbData); - taosArrayDestroy(pStmt->aTagIndexs); - + taosCloseFile(&fp); + taosMemoryFreeClear(pCreateInfo); + destructParseFileContext(&pParFileCxt); return code; } -static int32_t rewriteCreateSubTableFromFile(STranslateContext* pCxt, SCreateSubTableFromFileClause* pStmt, - SHashObj* pVgroupHashmap) { +static int32_t resetParseFileContext(SParseFileContext* pParFileCxt) { + taosArrayClear(pParFileCxt->aCreateTbData); + taosArrayClearEx(pParFileCxt->aTagVals, clearTagValArrayFp); + return TSDB_CODE_SUCCESS; +} + +static int32_t createSubTableFromFile(SMsgBuf* pMsgBuf, SParseContext* pParseCxt, SVnodeModifyOpStmt* pModifyStmt) { int32_t code = 0; - STableMeta* pSuperTableMeta = NULL; - if (TSDB_CODE_SUCCESS == code) { - code = getTableMeta(pCxt, pStmt->useDbName, pStmt->useTableName, &pSuperTableMeta); - } + SCreateTbInfo* pCreateInfo = pModifyStmt->pCreateTbInfo; + SParseFileContext* pParFileCxt = pModifyStmt->pParFileCxt; if (TSDB_CODE_SUCCESS == code) { - code = prepareReadFromFile(pStmt); + code = parseCsvFile(pMsgBuf, pParseCxt, pParFileCxt, pModifyStmt->fp, tsMaxInsertBatchRows); } + STableMeta* pSuperTableMeta = pParFileCxt->pStbMeta; if (TSDB_CODE_SUCCESS == code) { - code = buildTagIndexForBindTags(&pCxt->msgBuf, pStmt, pSuperTableMeta); - } - - SParseFileContext parseFileCtx = { - .pSuperTableMeta = pSuperTableMeta, .fp = pStmt->fp, .pTagIndexs = pStmt->aTagIndexs}; - parseFileCtx.pTbNameHash = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); - parseFileCtx.aTagNames = taosArrayInit(8, TSDB_COL_NAME_LEN); - parseFileCtx.tagNameFilled = false; - parseFileCtx.aTagVals = taosArrayInit(8, sizeof(STagVal)); - parseFileCtx.pTag = NULL; - parseFileCtx.ctbName.type = TSDB_TABLE_NAME_T; - parseFileCtx.ctbName.acctId = pCxt->pParseCxt->acctId; - strcpy(parseFileCtx.ctbName.dbname, pStmt->useDbName); - - if (NULL == parseFileCtx.aTagNames || NULL == parseFileCtx.aTagVals || NULL == parseFileCtx.pTbNameHash) { - code = TSDB_CODE_OUT_OF_MEMORY; - goto _OUT; - } - - if (TSDB_CODE_SUCCESS == code) { - code = parseCsvFile(&pCxt->msgBuf, pCxt->pParseCxt, &parseFileCtx, pStmt->aCreateTbData); - } - - if (TSDB_CODE_SUCCESS == code) { - int sz = taosArrayGetSize(pStmt->aCreateTbData); + int sz = taosArrayGetSize(pParFileCxt->aCreateTbData); for (int i = 0; i < sz; i++) { - SCreateTableData* pData = taosArrayGet(pStmt->aCreateTbData, i); + SCreateTableData* pData = taosArrayGet(pParFileCxt->aCreateTbData, i); - code = collectUseTable(&pData->ctbName, pCxt->pTargetTables); - if (TSDB_CODE_SUCCESS != code) { - taosMemoryFree(pData->pTag); - } + // code = collectUseTable(&pData->ctbName, pCxt->pTargetTables); + // if (TSDB_CODE_SUCCESS != code) { + // taosMemoryFree(pData->pTag); + // } - code = addCreateTbReqIntoVgroup(pVgroupHashmap, pStmt->useDbName, pSuperTableMeta->uid, pStmt->useTableName, - pData->ctbName.tname, pData->aTagNames, pSuperTableMeta->tableInfo.numOfTags, - pData->pTag, TSDB_DEFAULT_TABLE_TTL, NULL, pStmt->ignoreExists, &pData->vg); + code = addCreateTbReqIntoVgroup(pModifyStmt->pVgroupsHashObj, pCreateInfo->useDbName, pSuperTableMeta->uid, + pCreateInfo->useTableName, pData->ctbName.tname, pData->aTagNames, + pSuperTableMeta->tableInfo.numOfTags, pData->pTag, TSDB_DEFAULT_TABLE_TTL, NULL, + pCreateInfo->ignoreExists, &pData->vg); + } + + if (TSDB_CODE_SUCCESS == code) { + pModifyStmt->fileProcessing = (sz == tsMaxInsertBatchRows); } } -_OUT: - taosMemoryFreeClear(pSuperTableMeta); - taosHashCleanup(parseFileCtx.pTbNameHash); - taosArrayDestroy(parseFileCtx.aTagNames); - taosArrayDestroy(parseFileCtx.aTagVals); + (void)resetParseFileContext(pModifyStmt->pParFileCxt); return code; } @@ -13041,13 +13131,8 @@ static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery) int32_t code = TSDB_CODE_SUCCESS; SNode* pNode; FOREACH(pNode, pStmt->pSubTables) { - if (pNode->type == QUERY_NODE_CREATE_SUBTABLE_CLAUSE) { - SCreateSubTableClause* pClause = (SCreateSubTableClause*)pNode; - code = rewriteCreateSubTable(pCxt, pClause, pVgroupHashmap); - } else { - SCreateSubTableFromFileClause* pClause = (SCreateSubTableFromFileClause*)pNode; - code = rewriteCreateSubTableFromFile(pCxt, pClause, pVgroupHashmap); - } + SCreateSubTableClause* pClause = (SCreateSubTableClause*)pNode; + code = rewriteCreateSubTable(pCxt, pClause, pVgroupHashmap); if (TSDB_CODE_SUCCESS != code) { taosHashCleanup(pVgroupHashmap); return code; @@ -13063,6 +13148,75 @@ static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery) return rewriteToVnodeModifyOpStmt(pQuery, pBufArray); } +static int32_t rewriteCreateTableFromFile(STranslateContext* pCxt, SQuery* pQuery) { + SVnodeModifyOpStmt* pModifyStmt = (SVnodeModifyOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIFY_STMT); + if (pModifyStmt == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pModifyStmt->sqlNodeType = nodeType(pQuery->pRoot); + pModifyStmt->fileProcessing = false; + pModifyStmt->destroyParseFileCxt = destructParseFileContext; + pModifyStmt->pVgroupsHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK); + if (NULL == pModifyStmt->pVgroupsHashObj) { + return TSDB_CODE_OUT_OF_MEMORY; + } + taosHashSetFreeFp(pModifyStmt->pVgroupsHashObj, destroyCreateTbReqBatch); + + SCreateSubTableFromFileClause* pCreateStmt = (SCreateSubTableFromFileClause*)pQuery->pRoot; + + int32_t code = prepareReadCsvFile(pCxt, pCreateStmt, pModifyStmt); + if (TSDB_CODE_SUCCESS != code) { + taosHashCleanup(pModifyStmt->pVgroupsHashObj); + return code; + } + + code = createSubTableFromFile(&pCxt->msgBuf, pCxt->pParseCxt, pModifyStmt); + if (TSDB_CODE_SUCCESS != code) { + taosHashCleanup(pModifyStmt->pVgroupsHashObj); + return code; + } + + SArray* pBufArray = serializeVgroupsCreateTableBatch(pModifyStmt->pVgroupsHashObj); + taosHashClear(pModifyStmt->pVgroupsHashObj); + if (NULL == pBufArray) { + taosHashCleanup(pModifyStmt->pVgroupsHashObj); + return TSDB_CODE_OUT_OF_MEMORY; + } + + pModifyStmt->pDataBlocks = pBufArray; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pModifyStmt; + + return TSDB_CODE_SUCCESS; +} + +int32_t continueCreateTbFromFile(SParseContext* pParseCxt, SQuery** pQuery) { + SVnodeModifyOpStmt* pModifyStmt = (SVnodeModifyOpStmt*)(*pQuery)->pRoot; + + SMsgBuf tmpBuf = {0}; + tmpBuf.buf = taosMemoryMalloc(1024); + int32_t code = createSubTableFromFile(&tmpBuf, pParseCxt, pModifyStmt); + if (TSDB_CODE_SUCCESS != code) goto _OUT; + + SArray* pBufArray = serializeVgroupsCreateTableBatch(pModifyStmt->pVgroupsHashObj); + taosHashClear(pModifyStmt->pVgroupsHashObj); + if (NULL == pBufArray) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _OUT; + } + + pModifyStmt->pDataBlocks = pBufArray; + (*pQuery)->execStage = QUERY_EXEC_STAGE_SCHEDULE; + if (!pModifyStmt->fileProcessing) { + (*pQuery)->execMode = QUERY_EXEC_MODE_EMPTY_RESULT; + } + code = TSDB_CODE_SUCCESS; + +_OUT: + taosMemoryFreeClear(tmpBuf.buf); + return code; +} + typedef struct SVgroupDropTableBatch { SVDropTbBatchReq req; SVgroupInfo info; @@ -13765,7 +13919,8 @@ static int32_t createParWhenThenNode(SNode* pWhen, SNode* pThen, SNode** ppResWh return TSDB_CODE_SUCCESS; } -static int32_t createParCaseWhenNode(SNode* pCase, SNodeList* pWhenThenList, SNode* pElse, const char* pAias, SNode** ppResCaseWhen) { +static int32_t createParCaseWhenNode(SNode* pCase, SNodeList* pWhenThenList, SNode* pElse, const char* pAias, + SNode** ppResCaseWhen) { SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)nodesMakeNode(QUERY_NODE_CASE_WHEN); CHECK_POINTER_OUT_OF_MEM(pCaseWhen); @@ -13780,7 +13935,8 @@ static int32_t createParCaseWhenNode(SNode* pCase, SNodeList* pWhenThenList, SNo return TSDB_CODE_SUCCESS; } -static int32_t createParFunctionNode(const char* pFunName, const char* pAias, SNodeList* pParameterList, SNode** ppResFunc) { +static int32_t createParFunctionNode(const char* pFunName, const char* pAias, SNodeList* pParameterList, + SNode** ppResFunc) { SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); CHECK_POINTER_OUT_OF_MEM(pFunc); strcpy(pFunc->functionName, pFunName); @@ -13821,13 +13977,13 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { } } - SValueNode* pValNode = nodesMakeValueNodeFromString("leader"); + SValueNode* pValNode = nodesMakeValueNodeFromString("leader"); CHECK_POINTER_OUT_OF_MEM(pValNode); - SNode* pCond1 = NULL; - SNode* pCond2 = NULL; - SNode* pCond3 = NULL; - SNode* pCond4 = NULL; + SNode* pCond1 = NULL; + SNode* pCond2 = NULL; + SNode* pCond3 = NULL; + SNode* pCond4 = NULL; CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v1_status", (SNode*)pValNode, &pCond1)); CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v2_status", (SNode*)pValNode, &pCond2)); CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v3_status", (SNode*)pValNode, &pCond3)); @@ -13852,16 +14008,16 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { SNode* pElse = nodesMakeValueNodeFromInt32(0); CHECK_POINTER_OUT_OF_MEM(pElse); - // case when (v1_status = "leader" or v2_status = "lead er" or v3_status = "leader" or v4_status = "leader") then 1 else 0 end + // case when (v1_status = "leader" or v2_status = "lead er" or v3_status = "leader" or v4_status = "leader") then 1 + // else 0 end SNode* pCaseWhen = NULL; CHECK_RES_OUT_OF_MEM(createParCaseWhenNode(NULL, pWhenThenlist, pElse, NULL, &pCaseWhen)); SNodeList* pParaList = NULL; CHECK_RES_OUT_OF_MEM(createParListNode(pCaseWhen, &pParaList)); - // sum( case when ... end) as leader_col - SNode* pSumFun = NULL; + SNode* pSumFun = NULL; const char* pSumColAlias = "leader_col"; CHECK_RES_OUT_OF_MEM(createParFunctionNode("sum", pSumColAlias, pParaList, &pSumFun)); @@ -13871,7 +14027,7 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { CHECK_RES_OUT_OF_MEM(createParListNode(pPara1, &pParaList)); // count(1) as count_col - SNode* pCountFun = NULL; + SNode* pCountFun = NULL; const char* pCountColAlias = "count_col"; CHECK_RES_OUT_OF_MEM(createParFunctionNode("count", pCountColAlias, pParaList, &pCountFun)); @@ -13881,11 +14037,13 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { SSelectStmt* pSubSelect = NULL; // select sum( case when .... end) as leader_col, count(*) as count_col from information_schema.ins_vgroups - CHECK_RES_OUT_OF_MEM(createSimpleSelectStmtFromProjList(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, pProjList, &pSubSelect)); + CHECK_RES_OUT_OF_MEM( + createSimpleSelectStmtFromProjList(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, pProjList, &pSubSelect)); if (pDbName && pDbName[0] != 0) { // for show db.alive - // select sum( case when .... end) as leader_col, count(*) as count_col from information_schema.ins_vgroups where db_name = "..." + // select sum( case when .... end) as leader_col, count(*) as count_col from information_schema.ins_vgroups where + // db_name = "..." SNode* pDbCond = NULL; pValNode = nodesMakeValueNodeFromString(pDbName); CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "db_name", (SNode*)pValNode, &pDbCond)); @@ -13895,14 +14053,12 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { pSubSelect->pWhere = pDbCond; } - - pCond1 = NULL; CHECK_RES_OUT_OF_MEM(createParOperatorNode(OP_TYPE_EQUAL, pSumColAlias, pCountColAlias, &pCond1)); pCond2 = NULL; SNode* pTempVal = nodesMakeValueNodeFromInt32(0); CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_GREATER_THAN, pSumColAlias, pTempVal, &pCond2)); - //leader_col = count_col and leader_col > 0 + // leader_col = count_col and leader_col > 0 pTemp1 = NULL; CHECK_RES_OUT_OF_MEM(createLogicCondNode(pCond1, pCond2, &pTemp1, LOGIC_COND_TYPE_AND)); @@ -13928,7 +14084,8 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { CHECK_RES_OUT_OF_MEM(createParWhenThenNode(pTemp2, pThen, &pWhenThen)); CHECK_RES_OUT_OF_MEM(nodesListStrictAppend(pWhenThenlist, pWhenThen)); - // case when leader_col = count_col and count_col > 0 then 1 when leader_col < count_col and count_col > 0 then 2 else 0 end as status + // case when leader_col = count_col and count_col > 0 then 1 when leader_col < count_col and count_col > 0 then 2 else + // 0 end as status pCaseWhen = NULL; pElse = nodesMakeValueNodeFromInt32(0); CHECK_POINTER_OUT_OF_MEM(pElse); @@ -13940,7 +14097,6 @@ static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { SNode* pTempTblNode = NULL; CHECK_RES_OUT_OF_MEM(createParTempTableNode(pSubSelect, &pTempTblNode)); - SSelectStmt* pStmt = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); CHECK_POINTER_OUT_OF_MEM(pStmt); pStmt->pProjectionList = pProjList; @@ -14014,6 +14170,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_CREATE_MULTI_TABLES_STMT: code = rewriteCreateMultiTable(pCxt, pQuery); break; + case QUERY_NODE_CREATE_SUBTABLE_FROM_FILE_CLAUSE: + code = rewriteCreateTableFromFile(pCxt, pQuery); + break; case QUERY_NODE_DROP_TABLE_STMT: code = rewriteDropTable(pCxt, pQuery); break; diff --git a/source/libs/parser/src/parser.c b/source/libs/parser/src/parser.c index a5cbe90598..7d042aeddb 100644 --- a/source/libs/parser/src/parser.c +++ b/source/libs/parser/src/parser.c @@ -48,6 +48,33 @@ bool qIsInsertValuesSql(const char* pStr, size_t length) { return false; } +bool qIsCreateTbFromFileSql(const char* pStr, size_t length) { + if (NULL == pStr) { + return false; + } + + const char* pSql = pStr; + + int32_t index = 0; + SToken t = tStrGetToken((char*)pStr, &index, false, NULL); + if (TK_CREATE != t.type) { + return false; + } + + do { + pStr += index; + index = 0; + t = tStrGetToken((char*)pStr, &index, false, NULL); + if (TK_FILE == t.type) { + return true; + } + if (0 == t.type || 0 == t.n) { + break; + } + } while (pStr - pSql < length); + return false; +} + bool qParseDbName(const char* pStr, size_t length, char** pDbName) { (void) length; int32_t index = 0; @@ -239,11 +266,19 @@ static int32_t parseQuerySyntax(SParseContext* pCxt, SQuery** pQuery, struct SCa return code; } +static int32_t parseCreateTbFromFileSyntax(SParseContext* pCxt, SQuery** pQuery, struct SCatalogReq* pCatalogReq) { + if (NULL == *pQuery) return parseQuerySyntax(pCxt, pQuery, pCatalogReq); + + return continueCreateTbFromFile(pCxt, pQuery); +} + int32_t qParseSqlSyntax(SParseContext* pCxt, SQuery** pQuery, struct SCatalogReq* pCatalogReq) { int32_t code = nodesAcquireAllocator(pCxt->allocatorId); if (TSDB_CODE_SUCCESS == code) { if (qIsInsertValuesSql(pCxt->pSql, pCxt->sqlLen)) { code = parseInsertSql(pCxt, pQuery, pCatalogReq, NULL); + } else if (qIsCreateTbFromFileSql(pCxt->pSql, pCxt->sqlLen)) { + code = parseCreateTbFromFileSyntax(pCxt, pQuery, pCatalogReq); } else { code = parseQuerySyntax(pCxt, pQuery, pCatalogReq); } @@ -322,7 +357,7 @@ void destoryCatalogReq(SCatalogReq *pCatalogReq) { taosArrayDestroyEx(pCatalogReq->pTableHash, destoryTablesReq); #ifdef TD_ENTERPRISE taosArrayDestroyEx(pCatalogReq->pView, destoryTablesReq); -#endif +#endif taosArrayDestroyEx(pCatalogReq->pTableTSMAs, destoryTablesReq); taosArrayDestroyEx(pCatalogReq->pTSMAs, destoryTablesReq); } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 2af9c1dadd..26c5465b8c 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -163,16 +163,16 @@ #define TK_TABLE 114 #define TK_NK_LP 115 #define TK_NK_RP 116 -#define TK_STABLE 117 -#define TK_COLUMN 118 -#define TK_MODIFY 119 -#define TK_RENAME 120 -#define TK_TAG 121 -#define TK_SET 122 -#define TK_NK_EQ 123 -#define TK_USING 124 -#define TK_TAGS 125 -#define TK_FILE 126 +#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 @@ -483,30 +483,30 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 559 +#define YYNOCODE 558 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNode* yy54; - SDataType yy84; - EJoinType yy230; - bool yy325; - int32_t yy332; - EFillMode yy478; - STokenPair yy495; - ENullOrder yy503; - int8_t yy535; - SShowTablesOption yy579; - SNodeList* yy652; - SAlterOption yy663; - EShowKind yy719; - EOrder yy760; - SToken yy837; - int64_t yy909; - EOperatorType yy922; - EJoinSubType yy948; + SAlterOption yy101; + bool yy209; + SNodeList* yy316; + SNode* yy416; + EOrder yy506; + EJoinSubType yy630; + EShowKind yy681; + int32_t yy820; + EOperatorType yy848; + STokenPair yy849; + EFillMode yy882; + SShowTablesOption yy925; + SDataType yy952; + EJoinType yy972; + int8_t yy1043; + ENullOrder yy1045; + int64_t yy1089; + SToken yy1109; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -522,18 +522,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 978 -#define YYNRULE 756 -#define YYNRULE_WITH_ACTION 756 +#define YYNSTATE 979 +#define YYNRULE 755 +#define YYNRULE_WITH_ACTION 755 #define YYNTOKEN 378 -#define YY_MAX_SHIFT 977 -#define YY_MIN_SHIFTREDUCE 1449 -#define YY_MAX_SHIFTREDUCE 2204 -#define YY_ERROR_ACTION 2205 -#define YY_ACCEPT_ACTION 2206 -#define YY_NO_ACTION 2207 -#define YY_MIN_REDUCE 2208 -#define YY_MAX_REDUCE 2963 +#define YY_MAX_SHIFT 978 +#define YY_MIN_SHIFTREDUCE 1448 +#define YY_MAX_SHIFTREDUCE 2202 +#define YY_ERROR_ACTION 2203 +#define YY_ACCEPT_ACTION 2204 +#define YY_NO_ACTION 2205 +#define YY_MIN_REDUCE 2206 +#define YY_MAX_REDUCE 2960 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -600,646 +600,637 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3105) +#define YY_ACTTAB_COUNT (3018) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2404, 2697, 101, 2572, 2406, 493, 647, 2572, 798, 648, - /* 10 */ 2256, 2402, 47, 45, 2121, 2739, 2929, 471, 2934, 446, - /* 20 */ 476, 478, 1942, 2569, 855, 1967, 2929, 2569, 855, 2714, - /* 30 */ 813, 2412, 810, 157, 797, 218, 1940, 2714, 2030, 2930, - /* 40 */ 799, 502, 501, 2231, 787, 2933, 172, 40, 39, 2930, - /* 50 */ 2932, 46, 44, 43, 42, 41, 2934, 655, 2757, 2718, - /* 60 */ 648, 2256, 450, 449, 2739, 1949, 482, 2718, 2025, 482, - /* 70 */ 734, 1967, 2757, 1970, 2698, 19, 2704, 872, 850, 848, - /* 80 */ 872, 788, 1948, 66, 810, 157, 728, 33, 732, 730, - /* 90 */ 288, 287, 2477, 40, 39, 47, 45, 46, 44, 43, - /* 100 */ 42, 41, 469, 476, 2704, 1942, 606, 2757, 867, 2720, - /* 110 */ 2722, 473, 974, 2475, 435, 15, 207, 2720, 2723, 1940, - /* 120 */ 872, 2030, 867, 2738, 443, 2704, 2777, 850, 872, 54, - /* 130 */ 121, 2740, 854, 2742, 2743, 849, 867, 872, 2206, 482, - /* 140 */ 448, 447, 200, 695, 2831, 2545, 786, 2421, 472, 2827, - /* 150 */ 872, 2025, 2032, 2033, 812, 187, 2839, 2840, 19, 155, - /* 160 */ 2844, 911, 2059, 550, 841, 1948, 697, 254, 219, 2189, - /* 170 */ 696, 650, 2738, 2264, 243, 2777, 2878, 840, 2739, 410, - /* 180 */ 2740, 854, 2742, 2743, 849, 847, 872, 833, 2796, 559, - /* 190 */ 2541, 2003, 2013, 851, 62, 974, 1788, 1789, 15, 605, - /* 200 */ 242, 2031, 2034, 50, 810, 157, 867, 194, 2839, 809, - /* 210 */ 744, 149, 808, 603, 612, 610, 1943, 415, 1941, 2929, - /* 220 */ 232, 2757, 46, 44, 43, 42, 41, 211, 508, 2060, - /* 230 */ 2572, 50, 79, 507, 652, 2032, 2033, 797, 218, 2704, - /* 240 */ 649, 850, 2930, 799, 234, 2464, 322, 1952, 810, 157, - /* 250 */ 2570, 855, 1946, 1947, 2000, 62, 2002, 2005, 2006, 2007, - /* 260 */ 2008, 2009, 2010, 2011, 2012, 846, 870, 869, 2024, 2026, - /* 270 */ 2027, 2028, 2029, 2, 2003, 2013, 192, 256, 317, 644, - /* 280 */ 9, 650, 764, 2264, 2031, 2034, 2738, 92, 642, 2777, - /* 290 */ 2929, 638, 634, 121, 2740, 854, 2742, 2743, 849, 1943, - /* 300 */ 872, 1941, 2303, 159, 2497, 168, 2802, 2831, 2935, 218, - /* 310 */ 115, 472, 2827, 2930, 799, 2000, 36, 474, 2054, 2055, - /* 320 */ 2056, 2057, 2058, 2062, 2063, 2064, 2065, 127, 2839, 2840, - /* 330 */ 497, 155, 2844, 2470, 2472, 1946, 1947, 2000, 381, 2002, - /* 340 */ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 846, 870, - /* 350 */ 869, 2024, 2026, 2027, 2028, 2029, 2, 12, 47, 45, - /* 360 */ 747, 1968, 2739, 1971, 667, 183, 476, 185, 1942, 2220, - /* 370 */ 394, 188, 2839, 2840, 2390, 155, 2844, 813, 324, 714, - /* 380 */ 713, 712, 1940, 124, 2030, 85, 704, 154, 708, 392, - /* 390 */ 77, 2096, 707, 76, 495, 2419, 2846, 706, 711, 453, - /* 400 */ 452, 2620, 160, 705, 421, 2757, 2209, 451, 701, 700, - /* 410 */ 699, 2407, 2409, 381, 2025, 324, 252, 629, 627, 624, - /* 420 */ 622, 19, 2843, 2704, 2559, 850, 668, 138, 1948, 748, - /* 430 */ 137, 136, 135, 134, 133, 132, 131, 130, 129, 324, - /* 440 */ 783, 47, 45, 2035, 2154, 460, 2619, 2477, 911, 476, - /* 450 */ 2477, 1942, 868, 2417, 292, 1968, 2934, 441, 974, 589, - /* 460 */ 481, 15, 62, 928, 2929, 1940, 2375, 2030, 2475, 663, - /* 470 */ 2738, 2475, 499, 2777, 588, 459, 2619, 121, 2740, 854, - /* 480 */ 2742, 2743, 849, 2933, 872, 1967, 802, 2930, 2931, 200, - /* 490 */ 2208, 2831, 2391, 1815, 1816, 472, 2827, 2025, 2032, 2033, - /* 500 */ 51, 63, 184, 780, 779, 2152, 2153, 2155, 2156, 2157, - /* 510 */ 2349, 1948, 657, 2611, 147, 146, 145, 144, 143, 142, - /* 520 */ 141, 140, 139, 2879, 2851, 2093, 2094, 2095, 2851, 2851, - /* 530 */ 2851, 2851, 2851, 1612, 868, 2417, 213, 2003, 2013, 1869, - /* 540 */ 1870, 974, 1814, 1817, 48, 798, 207, 2031, 2034, 789, - /* 550 */ 784, 777, 773, 2929, 148, 89, 88, 546, 868, 2417, - /* 560 */ 231, 693, 1943, 666, 1941, 2098, 2099, 2100, 2101, 2102, - /* 570 */ 670, 797, 218, 538, 536, 2546, 2930, 799, 148, 1614, - /* 580 */ 62, 2032, 2033, 2096, 664, 698, 418, 1714, 1715, 525, - /* 590 */ 527, 2514, 521, 517, 513, 510, 539, 1972, 1946, 1947, - /* 600 */ 2000, 2477, 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - /* 610 */ 2012, 846, 870, 869, 2024, 2026, 2027, 2028, 2029, 2, - /* 620 */ 2003, 2013, 817, 909, 174, 173, 906, 905, 904, 171, - /* 630 */ 2031, 2034, 1521, 1521, 1520, 1520, 1675, 909, 174, 173, - /* 640 */ 906, 905, 904, 171, 2118, 1943, 324, 1941, 153, 665, - /* 650 */ 2565, 1666, 901, 900, 899, 1670, 898, 1672, 1673, 897, - /* 660 */ 894, 238, 1681, 891, 1683, 1684, 888, 885, 882, 138, - /* 670 */ 1522, 1522, 137, 136, 135, 134, 133, 132, 131, 130, - /* 680 */ 129, 1946, 1947, 2000, 324, 2002, 2005, 2006, 2007, 2008, - /* 690 */ 2009, 2010, 2011, 2012, 846, 870, 869, 2024, 2026, 2027, - /* 700 */ 2028, 2029, 2, 47, 45, 2739, 1494, 95, 181, 1942, - /* 710 */ 94, 476, 697, 1942, 1970, 1675, 696, 2093, 2094, 2095, - /* 720 */ 851, 2423, 2266, 1940, 12, 1501, 10, 1940, 531, 2030, - /* 730 */ 1666, 901, 900, 899, 1670, 898, 1672, 1673, 845, 844, - /* 740 */ 721, 1681, 843, 1683, 1684, 842, 885, 882, 2757, 745, - /* 750 */ 1496, 1499, 1500, 37, 340, 735, 1624, 533, 529, 2025, - /* 760 */ 158, 2096, 587, 2802, 324, 2125, 2704, 586, 850, 1948, - /* 770 */ 1623, 1967, 207, 1948, 289, 585, 803, 40, 39, 93, - /* 780 */ 480, 46, 44, 43, 42, 41, 47, 45, 868, 2417, - /* 790 */ 724, 868, 2417, 1948, 476, 543, 1942, 718, 716, 974, - /* 800 */ 542, 2545, 2739, 974, 286, 2477, 48, 2846, 223, 12, - /* 810 */ 1940, 55, 2030, 2738, 2846, 496, 2777, 851, 902, 2886, - /* 820 */ 121, 2740, 854, 2742, 2743, 849, 2475, 872, 748, 565, - /* 830 */ 2541, 1607, 2949, 2842, 2831, 878, 596, 2541, 472, 2827, - /* 840 */ 2841, 2061, 2025, 2032, 2033, 2757, 617, 2230, 35, 764, - /* 850 */ 72, 2389, 1501, 71, 40, 39, 1948, 2929, 46, 44, - /* 860 */ 43, 42, 41, 2704, 114, 850, 40, 39, 868, 2417, - /* 870 */ 46, 44, 43, 42, 41, 2935, 218, 1608, 1499, 1500, - /* 880 */ 2930, 799, 2003, 2013, 236, 2165, 974, 322, 547, 15, - /* 890 */ 2408, 241, 2031, 2034, 2851, 2093, 2094, 2095, 2851, 2851, - /* 900 */ 2851, 2851, 2851, 1943, 2644, 1941, 2229, 1943, 2704, 1941, - /* 910 */ 2738, 750, 2611, 2777, 868, 2417, 925, 121, 2740, 854, - /* 920 */ 2742, 2743, 849, 3, 872, 479, 2032, 2033, 34, 2949, - /* 930 */ 834, 2831, 2803, 181, 548, 472, 2827, 53, 2066, 1946, - /* 940 */ 1947, 2117, 2004, 1946, 1947, 2000, 2422, 2002, 2005, 2006, - /* 950 */ 2007, 2008, 2009, 2010, 2011, 2012, 846, 870, 869, 2024, - /* 960 */ 2026, 2027, 2028, 2029, 2, 2003, 2013, 2704, 419, 1967, - /* 970 */ 1965, 522, 2040, 498, 2137, 2031, 2034, 594, 1967, 380, - /* 980 */ 445, 181, 877, 876, 875, 927, 331, 332, 614, 1971, - /* 990 */ 1943, 330, 1941, 2300, 2422, 225, 909, 174, 173, 906, - /* 1000 */ 905, 904, 171, 299, 573, 2001, 616, 2399, 422, 868, - /* 1010 */ 2417, 420, 575, 40, 39, 763, 374, 46, 44, 43, - /* 1020 */ 42, 41, 387, 553, 2471, 2472, 1946, 1947, 2000, 567, - /* 1030 */ 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 846, - /* 1040 */ 870, 869, 2024, 2026, 2027, 2028, 2029, 2, 40, 39, - /* 1050 */ 689, 688, 46, 44, 43, 42, 41, 836, 488, 2803, - /* 1060 */ 1971, 40, 39, 1585, 444, 46, 44, 43, 42, 41, - /* 1070 */ 945, 944, 943, 942, 505, 561, 941, 940, 162, 935, - /* 1080 */ 934, 933, 932, 931, 930, 929, 161, 923, 922, 921, - /* 1090 */ 504, 503, 918, 917, 916, 198, 197, 915, 500, 914, - /* 1100 */ 913, 912, 43, 42, 41, 2933, 2146, 2552, 2531, 1586, + /* 0 */ 2711, 2403, 647, 543, 2569, 648, 2254, 2569, 542, 37, + /* 10 */ 340, 550, 47, 45, 2119, 2401, 2736, 652, 798, 211, + /* 20 */ 476, 471, 1940, 649, 2567, 855, 2926, 2566, 855, 2715, + /* 30 */ 2711, 813, 124, 810, 157, 2461, 1938, 787, 2028, 2405, + /* 40 */ 1965, 495, 2416, 2694, 797, 218, 493, 40, 39, 2927, + /* 50 */ 799, 46, 44, 43, 42, 41, 2736, 764, 748, 2715, + /* 60 */ 2754, 612, 610, 2123, 415, 2926, 2754, 232, 2023, 1965, + /* 70 */ 788, 851, 868, 502, 501, 19, 2701, 527, 850, 2717, + /* 80 */ 2719, 473, 1946, 2932, 218, 810, 157, 2569, 2927, 799, + /* 90 */ 873, 2645, 460, 2616, 1966, 47, 45, 1947, 810, 157, + /* 100 */ 2754, 478, 482, 476, 2695, 1940, 482, 2566, 855, 2717, + /* 110 */ 2720, 670, 975, 873, 435, 15, 2701, 873, 850, 1938, + /* 120 */ 873, 2028, 868, 2735, 810, 157, 2774, 43, 42, 41, + /* 130 */ 121, 2737, 854, 2739, 2740, 849, 1965, 873, 786, 2204, + /* 140 */ 657, 2608, 200, 655, 2828, 515, 648, 2254, 472, 2824, + /* 150 */ 2229, 2023, 2030, 2031, 812, 187, 2836, 2837, 19, 155, + /* 160 */ 2841, 14, 13, 2735, 2057, 1946, 2774, 482, 219, 114, + /* 170 */ 121, 2737, 854, 2739, 2740, 849, 2875, 873, 873, 2736, + /* 180 */ 159, 488, 168, 2799, 2828, 869, 2414, 929, 472, 2824, + /* 190 */ 2373, 2001, 2011, 254, 851, 975, 2264, 650, 15, 2262, + /* 200 */ 256, 2029, 2032, 841, 650, 148, 2262, 194, 2836, 809, + /* 210 */ 2701, 149, 808, 693, 840, 531, 1941, 50, 1939, 2926, + /* 220 */ 127, 2836, 2837, 2754, 155, 2841, 1712, 1713, 508, 2058, + /* 230 */ 2474, 62, 868, 507, 868, 2030, 2031, 797, 218, 2701, + /* 240 */ 2002, 850, 2927, 799, 533, 529, 188, 2836, 2837, 817, + /* 250 */ 155, 2841, 1944, 1945, 1998, 172, 2000, 2003, 2004, 2005, + /* 260 */ 2006, 2007, 2008, 2009, 2010, 846, 871, 870, 2022, 2024, + /* 270 */ 2025, 2026, 2027, 2, 2001, 2011, 2071, 2094, 443, 1950, + /* 280 */ 9, 1968, 764, 207, 2029, 2032, 2735, 331, 332, 2774, + /* 290 */ 2926, 491, 330, 121, 2737, 854, 2739, 2740, 849, 1941, + /* 300 */ 873, 1939, 2301, 1999, 1998, 2946, 747, 2828, 2932, 218, + /* 310 */ 2542, 472, 2824, 2927, 799, 2418, 36, 474, 2052, 2053, + /* 320 */ 2054, 2055, 2056, 2060, 2061, 2062, 2063, 50, 910, 174, + /* 330 */ 173, 907, 906, 905, 171, 1944, 1945, 1998, 54, 2000, + /* 340 */ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 846, 871, + /* 350 */ 870, 2022, 2024, 2025, 2026, 2027, 2, 12, 47, 45, + /* 360 */ 2398, 422, 2736, 1909, 2474, 183, 476, 291, 1940, 388, + /* 370 */ 394, 290, 441, 2451, 869, 2414, 744, 813, 2228, 714, + /* 380 */ 713, 712, 1938, 2472, 2028, 667, 704, 154, 708, 392, + /* 390 */ 76, 2094, 707, 75, 148, 487, 486, 706, 711, 453, + /* 400 */ 452, 324, 698, 705, 421, 2207, 2754, 451, 701, 700, + /* 410 */ 699, 2091, 2092, 2093, 2023, 324, 252, 629, 627, 624, + /* 420 */ 622, 19, 2701, 192, 850, 317, 138, 663, 1946, 137, + /* 430 */ 136, 135, 134, 133, 132, 131, 130, 129, 2701, 2931, + /* 440 */ 2474, 47, 45, 2033, 2556, 103, 668, 2926, 469, 476, + /* 450 */ 430, 1940, 1966, 458, 322, 736, 2474, 1965, 975, 2472, + /* 460 */ 798, 15, 62, 1493, 481, 1938, 2930, 2028, 2926, 2735, + /* 470 */ 2927, 2929, 2774, 1908, 926, 2472, 121, 2737, 854, 2739, + /* 480 */ 2740, 849, 1500, 873, 869, 2414, 797, 218, 200, 381, + /* 490 */ 2828, 2927, 799, 666, 472, 2824, 2388, 2023, 2030, 2031, + /* 500 */ 185, 63, 2218, 2094, 499, 490, 489, 1495, 1498, 1499, + /* 510 */ 138, 1946, 207, 137, 136, 135, 134, 133, 132, 131, + /* 520 */ 130, 129, 2876, 62, 2848, 2091, 2092, 2093, 2848, 2848, + /* 530 */ 2848, 2848, 2848, 734, 2931, 480, 182, 2001, 2011, 2543, + /* 540 */ 207, 975, 2926, 928, 48, 495, 2416, 2029, 2032, 728, + /* 550 */ 2617, 732, 730, 288, 287, 88, 87, 546, 2285, 783, + /* 560 */ 231, 2930, 1941, 1965, 1939, 2927, 2928, 2542, 869, 2414, + /* 570 */ 912, 40, 39, 538, 536, 46, 44, 43, 42, 41, + /* 580 */ 715, 2030, 2031, 1969, 1813, 1814, 418, 497, 223, 525, + /* 590 */ 2467, 2469, 521, 517, 513, 510, 539, 697, 1944, 1945, + /* 600 */ 1998, 696, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + /* 610 */ 2010, 846, 871, 870, 2022, 2024, 2025, 2026, 2027, 2, + /* 620 */ 2001, 2011, 2096, 2097, 2098, 2099, 2100, 66, 1786, 1787, + /* 630 */ 2029, 2032, 100, 1812, 1815, 1673, 2848, 2091, 2092, 2093, + /* 640 */ 2848, 2848, 2848, 2848, 2848, 1941, 324, 1939, 2206, 62, + /* 650 */ 1664, 902, 901, 900, 1668, 899, 1670, 1671, 898, 895, + /* 660 */ 2410, 1679, 892, 1681, 1682, 889, 886, 883, 789, 784, + /* 670 */ 777, 773, 147, 146, 145, 144, 143, 142, 141, 140, + /* 680 */ 139, 1944, 1945, 1998, 238, 2000, 2003, 2004, 2005, 2006, + /* 690 */ 2007, 2008, 2009, 2010, 846, 871, 870, 2022, 2024, 2025, + /* 700 */ 2026, 2027, 2, 47, 45, 1623, 2736, 324, 869, 2414, + /* 710 */ 912, 476, 1969, 1940, 46, 44, 43, 42, 41, 1622, + /* 720 */ 1520, 851, 1519, 2883, 714, 713, 712, 1938, 55, 2028, + /* 730 */ 94, 704, 154, 708, 2002, 93, 153, 707, 62, 745, + /* 740 */ 869, 2414, 706, 711, 453, 452, 2931, 2736, 705, 541, + /* 750 */ 2754, 540, 451, 701, 700, 699, 214, 12, 1521, 2023, + /* 760 */ 547, 2038, 851, 1968, 2896, 479, 2701, 1965, 850, 2494, + /* 770 */ 879, 40, 39, 1946, 181, 46, 44, 43, 42, 41, + /* 780 */ 644, 498, 664, 539, 606, 2419, 47, 45, 748, 642, + /* 790 */ 181, 2754, 638, 634, 476, 617, 1940, 1999, 869, 2414, + /* 800 */ 2474, 2419, 92, 975, 559, 2538, 48, 2701, 496, 850, + /* 810 */ 1938, 2511, 2028, 2735, 2468, 2469, 2774, 1970, 548, 2472, + /* 820 */ 121, 2737, 854, 2739, 2740, 849, 1611, 873, 869, 2414, + /* 830 */ 565, 2538, 2946, 324, 2828, 869, 2414, 381, 472, 2824, + /* 840 */ 869, 2414, 2023, 2030, 2031, 839, 665, 2562, 567, 869, + /* 850 */ 2414, 2152, 243, 3, 2735, 581, 1946, 2774, 234, 2187, + /* 860 */ 669, 121, 2737, 854, 2739, 2740, 849, 53, 873, 582, + /* 870 */ 750, 2608, 1613, 2946, 1946, 2828, 100, 605, 242, 472, + /* 880 */ 2824, 51, 2001, 2011, 236, 213, 975, 596, 2538, 15, + /* 890 */ 903, 603, 2029, 2032, 446, 40, 39, 459, 2616, 46, + /* 900 */ 44, 43, 42, 41, 2409, 274, 12, 1941, 10, 1939, + /* 910 */ 780, 779, 2150, 2151, 2153, 2154, 2155, 878, 877, 876, + /* 920 */ 29, 193, 324, 2144, 589, 2521, 2030, 2031, 2059, 2227, + /* 930 */ 687, 683, 679, 675, 2390, 273, 322, 2145, 2002, 588, + /* 940 */ 834, 241, 2800, 1944, 1945, 1998, 1970, 2000, 2003, 2004, + /* 950 */ 2005, 2006, 2007, 2008, 2009, 2010, 846, 871, 870, 2022, + /* 960 */ 2024, 2025, 2026, 2027, 2, 2001, 2011, 84, 419, 557, + /* 970 */ 1963, 2194, 2474, 869, 2414, 2029, 2032, 594, 869, 2414, + /* 980 */ 445, 101, 587, 2143, 160, 2116, 271, 586, 614, 2701, + /* 990 */ 1941, 825, 1939, 583, 2406, 585, 869, 2414, 2411, 763, + /* 1000 */ 184, 1999, 292, 2164, 573, 836, 616, 2800, 2347, 869, + /* 1010 */ 2414, 420, 575, 40, 39, 34, 294, 46, 44, 43, + /* 1020 */ 42, 41, 2049, 553, 2843, 2064, 1944, 1945, 1998, 302, + /* 1030 */ 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 846, + /* 1040 */ 871, 870, 2022, 2024, 2025, 2026, 2027, 2, 869, 2414, + /* 1050 */ 2840, 40, 39, 259, 522, 46, 44, 43, 42, 41, + /* 1060 */ 1940, 1969, 270, 1502, 444, 324, 261, 268, 816, 1964, + /* 1070 */ 869, 2414, 266, 661, 1938, 113, 561, 2298, 225, 910, + /* 1080 */ 174, 173, 907, 906, 905, 171, 2736, 1867, 1868, 2193, + /* 1090 */ 335, 258, 40, 39, 1523, 1524, 46, 44, 43, 42, + /* 1100 */ 41, 851, 2407, 775, 689, 688, 2930, 2549, 2528, 1500, /* 1110 */ 602, 601, 600, 599, 598, 593, 592, 591, 590, 427, - /* 1120 */ 2147, 2625, 580, 579, 578, 577, 576, 570, 569, 568, - /* 1130 */ 2739, 563, 562, 442, 2657, 868, 2417, 554, 1776, 1777, - /* 1140 */ 2004, 868, 2417, 2228, 1795, 851, 2725, 2899, 209, 2004, - /* 1150 */ 2421, 714, 713, 712, 491, 581, 60, 2227, 704, 154, - /* 1160 */ 708, 582, 221, 212, 707, 62, 2145, 761, 2739, 706, - /* 1170 */ 711, 453, 452, 2757, 2350, 705, 1628, 868, 2417, 451, - /* 1180 */ 701, 700, 699, 851, 293, 775, 868, 2417, 764, 182, - /* 1190 */ 1627, 2704, 2739, 850, 1524, 1525, 2929, 583, 502, 501, - /* 1200 */ 495, 2419, 792, 2001, 2704, 101, 669, 851, 1956, 2922, - /* 1210 */ 2727, 2757, 2001, 2196, 2935, 218, 868, 2417, 2704, 2930, - /* 1220 */ 799, 2477, 1949, 1972, 2030, 691, 690, 710, 709, 2704, - /* 1230 */ 2221, 850, 1971, 214, 2413, 2757, 2414, 2477, 2738, 182, - /* 1240 */ 1911, 2777, 825, 2226, 2225, 121, 2740, 854, 2742, 2743, - /* 1250 */ 849, 2420, 872, 2704, 2025, 850, 291, 2949, 2476, 2831, - /* 1260 */ 290, 868, 2417, 472, 2827, 541, 619, 540, 1948, 14, - /* 1270 */ 13, 2107, 487, 486, 2739, 903, 2738, 2224, 2468, 2777, - /* 1280 */ 1967, 294, 2223, 121, 2740, 854, 2742, 2743, 849, 851, - /* 1290 */ 872, 2863, 2222, 2219, 1972, 2949, 805, 2831, 838, 539, - /* 1300 */ 2738, 472, 2827, 2777, 2704, 2704, 2892, 121, 2740, 854, - /* 1310 */ 2742, 2743, 849, 2739, 872, 907, 2218, 2757, 2468, 2949, - /* 1320 */ 2217, 2831, 425, 424, 303, 472, 2827, 2216, 851, 939, - /* 1330 */ 937, 2195, 483, 150, 104, 2704, 1910, 850, 2704, 430, - /* 1340 */ 868, 2417, 458, 2704, 736, 2479, 492, 91, 2030, 324, - /* 1350 */ 868, 2417, 2739, 2704, 2704, 2215, 2757, 40, 39, 2214, - /* 1360 */ 302, 46, 44, 43, 42, 41, 2213, 851, 490, 489, - /* 1370 */ 816, 2236, 967, 106, 2704, 2212, 850, 2704, 2025, 868, - /* 1380 */ 2417, 2704, 2738, 2648, 2073, 2777, 868, 2417, 2704, 121, - /* 1390 */ 2740, 854, 2742, 2743, 849, 2757, 872, 868, 2417, 335, - /* 1400 */ 2211, 2949, 1957, 2831, 1952, 192, 830, 472, 2827, 908, - /* 1410 */ 105, 279, 2468, 2704, 277, 850, 2704, 342, 1951, 2739, - /* 1420 */ 2704, 2738, 318, 801, 2777, 868, 2417, 2704, 121, 2740, - /* 1430 */ 854, 2742, 2743, 849, 851, 872, 2704, 515, 1960, 1962, - /* 1440 */ 2806, 746, 2831, 1503, 1843, 862, 472, 2827, 388, 1966, - /* 1450 */ 2392, 2454, 870, 869, 2024, 2026, 2027, 2028, 2029, 977, - /* 1460 */ 2738, 2704, 2757, 2777, 868, 2417, 1972, 121, 2740, 854, - /* 1470 */ 2742, 2743, 849, 2524, 872, 738, 164, 737, 378, 2804, - /* 1480 */ 2704, 2831, 850, 163, 863, 472, 2827, 868, 2417, 2658, - /* 1490 */ 164, 40, 39, 965, 208, 46, 44, 43, 42, 41, - /* 1500 */ 615, 702, 703, 961, 957, 953, 949, 866, 373, 771, - /* 1510 */ 281, 868, 2417, 280, 2001, 283, 29, 557, 282, 285, - /* 1520 */ 49, 839, 284, 2287, 1605, 1603, 1933, 2738, 1909, 741, - /* 1530 */ 2777, 370, 781, 49, 121, 2740, 854, 2742, 2743, 849, - /* 1540 */ 749, 872, 125, 764, 2285, 715, 835, 1950, 2831, 2276, - /* 1550 */ 2739, 2929, 472, 2827, 73, 2198, 2199, 346, 201, 1859, - /* 1560 */ 485, 484, 1934, 2274, 310, 851, 717, 811, 814, 2935, - /* 1570 */ 218, 719, 172, 1867, 2930, 799, 870, 869, 2024, 2026, - /* 1580 */ 2027, 2028, 2029, 764, 152, 722, 2758, 120, 806, 2739, - /* 1590 */ 826, 2929, 2141, 2757, 764, 329, 117, 78, 2257, 2166, - /* 1600 */ 1954, 2882, 2929, 2151, 851, 14, 13, 64, 2342, 2935, - /* 1610 */ 218, 2704, 49, 850, 2930, 799, 2150, 349, 348, 49, - /* 1620 */ 2935, 218, 764, 351, 350, 2930, 799, 2341, 2739, 78, - /* 1630 */ 2929, 169, 2757, 150, 778, 344, 172, 832, 353, 352, - /* 1640 */ 327, 308, 1558, 851, 465, 326, 355, 354, 2935, 218, - /* 1650 */ 2704, 75, 850, 2930, 799, 815, 357, 356, 2738, 359, - /* 1660 */ 358, 2777, 361, 360, 296, 122, 2740, 854, 2742, 2743, - /* 1670 */ 849, 2757, 872, 363, 362, 365, 364, 2739, 333, 2831, - /* 1680 */ 822, 367, 366, 2830, 2827, 369, 368, 880, 1559, 2704, - /* 1690 */ 2067, 850, 851, 170, 919, 2014, 2268, 2738, 2051, 172, - /* 1700 */ 2777, 151, 1812, 169, 122, 2740, 854, 2742, 2743, 849, - /* 1710 */ 2739, 872, 1802, 785, 345, 461, 865, 1577, 2831, 1657, - /* 1720 */ 2757, 819, 837, 2827, 2550, 851, 920, 506, 524, 1953, - /* 1730 */ 2263, 2465, 757, 2883, 386, 2893, 852, 320, 2704, 2777, - /* 1740 */ 850, 315, 793, 122, 2740, 854, 2742, 2743, 849, 1575, - /* 1750 */ 872, 963, 794, 2757, 323, 2551, 2376, 2831, 5, 514, - /* 1760 */ 509, 434, 2827, 439, 1965, 523, 1975, 535, 534, 226, - /* 1770 */ 1688, 2704, 2739, 850, 537, 274, 1696, 227, 229, 1836, - /* 1780 */ 379, 551, 1703, 1966, 1701, 2738, 175, 851, 2777, 558, - /* 1790 */ 240, 193, 186, 2740, 854, 2742, 2743, 849, 560, 872, - /* 1800 */ 687, 683, 679, 675, 564, 273, 566, 608, 571, 584, - /* 1810 */ 597, 595, 2543, 604, 607, 2757, 609, 620, 2738, 621, - /* 1820 */ 618, 2777, 246, 245, 625, 189, 2740, 854, 2742, 2743, - /* 1830 */ 849, 623, 872, 2704, 626, 850, 249, 628, 1973, 765, - /* 1840 */ 2889, 645, 630, 4, 646, 1968, 653, 654, 257, 656, - /* 1850 */ 658, 102, 2739, 97, 271, 260, 1974, 659, 1976, 660, - /* 1860 */ 662, 1977, 1978, 263, 2560, 265, 2566, 851, 98, 99, - /* 1870 */ 100, 272, 671, 692, 725, 726, 2634, 126, 694, 2631, - /* 1880 */ 2738, 413, 740, 2777, 800, 2950, 2405, 122, 2740, 854, - /* 1890 */ 2742, 2743, 849, 276, 872, 2757, 742, 103, 2401, 278, - /* 1900 */ 165, 2831, 177, 123, 2403, 2398, 2828, 295, 178, 1969, - /* 1910 */ 179, 382, 2739, 2704, 2612, 850, 752, 300, 751, 759, - /* 1920 */ 782, 820, 753, 259, 298, 2898, 2897, 851, 791, 769, - /* 1930 */ 305, 8, 270, 191, 2630, 2870, 261, 268, 756, 2739, - /* 1940 */ 768, 767, 266, 661, 309, 766, 796, 311, 2850, 312, - /* 1950 */ 795, 316, 466, 804, 851, 2757, 313, 2952, 307, 807, - /* 1960 */ 2738, 258, 156, 2777, 758, 1970, 314, 186, 2740, 854, - /* 1970 */ 2742, 2743, 849, 2704, 872, 850, 2115, 2928, 2113, 204, - /* 1980 */ 325, 319, 2757, 166, 383, 818, 823, 2580, 2579, 2578, - /* 1990 */ 384, 824, 470, 167, 2847, 828, 831, 463, 61, 338, - /* 2000 */ 2704, 858, 850, 1, 856, 385, 116, 860, 1473, 861, - /* 2010 */ 2739, 2696, 2418, 2695, 2812, 2890, 343, 113, 2691, 2690, - /* 2020 */ 2738, 372, 2682, 2777, 464, 851, 2681, 411, 2740, 854, - /* 2030 */ 2742, 2743, 849, 220, 872, 2673, 2672, 2688, 874, 969, - /* 2040 */ 970, 2687, 375, 2679, 2678, 176, 389, 2738, 2739, 2667, - /* 2050 */ 2777, 971, 966, 2757, 411, 2740, 854, 2742, 2743, 849, - /* 2060 */ 376, 872, 2666, 851, 973, 2685, 2684, 423, 414, 2676, - /* 2070 */ 2675, 2704, 2664, 850, 2739, 2663, 744, 391, 2661, 2660, - /* 2080 */ 2469, 393, 401, 412, 426, 2656, 2655, 2654, 86, 848, - /* 2090 */ 402, 2757, 2649, 52, 511, 431, 512, 1893, 1894, 224, - /* 2100 */ 516, 2647, 432, 518, 519, 520, 1892, 2646, 2645, 2704, - /* 2110 */ 440, 850, 2643, 526, 2642, 528, 2641, 2757, 2738, 530, - /* 2120 */ 2640, 2777, 1880, 2616, 532, 404, 2740, 854, 2742, 2743, - /* 2130 */ 849, 228, 872, 2615, 230, 2704, 87, 850, 1839, 1838, - /* 2140 */ 2593, 2592, 2591, 2739, 544, 545, 2590, 2589, 2533, 549, - /* 2150 */ 1775, 2530, 2529, 552, 2523, 555, 2738, 556, 851, 2777, - /* 2160 */ 2520, 233, 2519, 189, 2740, 854, 2742, 2743, 849, 90, - /* 2170 */ 872, 2518, 2517, 2522, 2521, 235, 790, 2516, 2515, 2513, - /* 2180 */ 2512, 2511, 2738, 237, 2739, 2777, 2757, 239, 2490, 410, - /* 2190 */ 2740, 854, 2742, 2743, 849, 572, 872, 2510, 2797, 851, - /* 2200 */ 574, 2508, 2507, 2739, 2704, 2506, 850, 2505, 2504, 2528, - /* 2210 */ 2503, 2502, 2501, 2526, 2509, 2500, 2499, 2498, 851, 428, - /* 2220 */ 1781, 2483, 96, 2951, 2496, 2495, 2494, 2757, 475, 2493, - /* 2230 */ 2492, 2491, 2489, 2739, 2488, 2487, 2486, 2558, 2527, 2525, - /* 2240 */ 2485, 2484, 244, 2482, 2481, 2704, 2757, 850, 851, 2480, - /* 2250 */ 611, 2738, 613, 2478, 2777, 1625, 429, 2307, 411, 2740, - /* 2260 */ 854, 2742, 2743, 849, 2704, 872, 850, 2739, 1629, 477, - /* 2270 */ 253, 247, 2306, 2305, 248, 2304, 2757, 2302, 1621, 2299, - /* 2280 */ 2298, 631, 851, 2291, 635, 2278, 250, 2252, 251, 199, - /* 2290 */ 2251, 633, 2738, 2614, 2704, 2777, 850, 2739, 639, 411, - /* 2300 */ 2740, 854, 2742, 2743, 849, 632, 872, 637, 636, 640, - /* 2310 */ 2757, 739, 851, 641, 2777, 82, 2724, 643, 406, 2740, - /* 2320 */ 854, 2742, 2743, 849, 1502, 872, 83, 210, 2704, 651, - /* 2330 */ 850, 255, 2610, 2600, 2588, 262, 264, 2587, 2564, 267, - /* 2340 */ 2757, 2738, 2557, 269, 2777, 2393, 2301, 2297, 396, 2740, - /* 2350 */ 854, 2742, 2743, 849, 672, 872, 673, 2739, 2704, 674, - /* 2360 */ 850, 2295, 676, 677, 678, 1551, 2293, 680, 681, 682, - /* 2370 */ 2290, 684, 851, 685, 686, 2738, 2273, 2271, 2777, 2739, - /* 2380 */ 275, 74, 395, 2740, 854, 2742, 2743, 849, 2272, 872, - /* 2390 */ 2270, 2248, 2739, 2395, 851, 1707, 1708, 2394, 1610, 1609, - /* 2400 */ 2757, 1611, 936, 1606, 1604, 2738, 1593, 851, 2777, 2288, - /* 2410 */ 1602, 1601, 397, 2740, 854, 2742, 2743, 849, 2704, 872, - /* 2420 */ 850, 1600, 2757, 1599, 454, 1598, 2286, 938, 1595, 455, - /* 2430 */ 2277, 1594, 1592, 456, 720, 2757, 2275, 457, 2247, 723, - /* 2440 */ 2704, 2739, 850, 2246, 2245, 2244, 727, 2243, 729, 731, - /* 2450 */ 2242, 733, 128, 2704, 1874, 850, 851, 1878, 1876, 1873, - /* 2460 */ 2613, 56, 2609, 28, 67, 2738, 2599, 297, 2777, 1845, - /* 2470 */ 1847, 754, 403, 2740, 854, 2742, 2743, 849, 743, 872, - /* 2480 */ 180, 1864, 2586, 1849, 2757, 2585, 2934, 2738, 57, 755, - /* 2490 */ 2777, 1824, 1823, 301, 407, 2740, 854, 2742, 2743, 849, - /* 2500 */ 2738, 872, 2704, 2777, 850, 20, 760, 398, 2740, 854, - /* 2510 */ 2742, 2743, 849, 30, 872, 762, 2168, 2142, 215, 2739, - /* 2520 */ 304, 772, 770, 462, 306, 6, 17, 774, 7, 21, - /* 2530 */ 776, 22, 203, 2149, 851, 190, 32, 2108, 2739, 202, - /* 2540 */ 31, 2725, 216, 2136, 2106, 65, 84, 2110, 24, 2738, - /* 2550 */ 217, 321, 2777, 851, 2183, 2188, 408, 2740, 854, 2742, - /* 2560 */ 2743, 849, 2757, 872, 2182, 467, 2187, 2189, 2739, 2186, - /* 2570 */ 23, 18, 468, 2090, 2089, 195, 59, 2584, 2563, 107, - /* 2580 */ 2704, 2757, 850, 851, 108, 328, 2144, 2562, 58, 205, - /* 2590 */ 334, 109, 69, 2556, 827, 821, 337, 110, 25, 2704, - /* 2600 */ 2739, 850, 2042, 11, 336, 2041, 13, 1958, 2052, 2017, - /* 2610 */ 2016, 2757, 887, 196, 206, 851, 890, 893, 1993, 853, - /* 2620 */ 896, 38, 2555, 2015, 1985, 16, 347, 2738, 26, 2704, - /* 2630 */ 2777, 850, 27, 829, 399, 2740, 854, 2742, 2743, 849, - /* 2640 */ 70, 872, 857, 2757, 111, 117, 2738, 339, 1652, 2777, - /* 2650 */ 341, 2739, 859, 409, 2740, 854, 2742, 2743, 849, 112, - /* 2660 */ 872, 2704, 2019, 850, 864, 80, 851, 2782, 2204, 2781, - /* 2670 */ 871, 68, 2203, 873, 2202, 2201, 2738, 1689, 2739, 2777, - /* 2680 */ 879, 494, 881, 400, 2740, 854, 2742, 2743, 849, 1686, - /* 2690 */ 872, 883, 1685, 851, 2757, 884, 886, 1682, 889, 1676, - /* 2700 */ 892, 895, 1674, 1680, 118, 1679, 1678, 1677, 2738, 371, - /* 2710 */ 119, 2777, 2704, 1702, 850, 416, 2740, 854, 2742, 2743, - /* 2720 */ 849, 2757, 872, 81, 1698, 1549, 910, 1589, 1588, 1587, - /* 2730 */ 1584, 1581, 1580, 1579, 1578, 1576, 1574, 1573, 1619, 2704, - /* 2740 */ 2739, 850, 1572, 924, 926, 1618, 222, 1570, 1569, 1567, - /* 2750 */ 1568, 1566, 1565, 1564, 1615, 851, 1613, 1561, 1560, 2738, - /* 2760 */ 1557, 2739, 2777, 1555, 1556, 1554, 417, 2740, 854, 2742, - /* 2770 */ 2743, 849, 2296, 872, 946, 948, 851, 947, 2294, 950, - /* 2780 */ 951, 952, 2292, 2757, 954, 2289, 2738, 955, 956, 2777, - /* 2790 */ 958, 960, 2269, 2751, 2740, 854, 2742, 2743, 849, 959, - /* 2800 */ 872, 2704, 2739, 850, 2757, 962, 2267, 1491, 964, 2241, - /* 2810 */ 1474, 1479, 968, 1481, 976, 377, 972, 851, 1944, 390, - /* 2820 */ 975, 2207, 2704, 2739, 850, 2207, 2207, 2207, 2207, 2207, - /* 2830 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 851, 2207, - /* 2840 */ 2207, 2207, 2207, 2207, 2207, 2757, 2207, 2207, 2738, 2207, - /* 2850 */ 2207, 2777, 2207, 2207, 2207, 2750, 2740, 854, 2742, 2743, - /* 2860 */ 849, 2207, 872, 2704, 2207, 850, 2757, 2207, 2207, 2738, - /* 2870 */ 2207, 2207, 2777, 2207, 2207, 2207, 2749, 2740, 854, 2742, - /* 2880 */ 2743, 849, 2207, 872, 2704, 2739, 850, 2207, 2207, 2207, - /* 2890 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 2900 */ 851, 2739, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 2910 */ 2738, 2207, 2207, 2777, 2207, 2207, 851, 436, 2740, 854, - /* 2920 */ 2742, 2743, 849, 2207, 872, 2207, 2207, 2207, 2757, 2207, - /* 2930 */ 2207, 2738, 2207, 2207, 2777, 2207, 2207, 2207, 437, 2740, - /* 2940 */ 854, 2742, 2743, 849, 2757, 872, 2704, 2207, 850, 2207, - /* 2950 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 2960 */ 2207, 2207, 2704, 2739, 850, 2207, 2207, 2207, 2207, 2207, - /* 2970 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 851, 2207, - /* 2980 */ 2207, 2207, 2739, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 2990 */ 2207, 2207, 2207, 2738, 2207, 2207, 2777, 851, 2207, 2207, - /* 3000 */ 433, 2740, 854, 2742, 2743, 849, 2757, 872, 2207, 2738, - /* 3010 */ 2207, 2207, 2777, 2207, 2207, 2207, 438, 2740, 854, 2742, - /* 3020 */ 2743, 849, 2207, 872, 2704, 2757, 850, 2207, 2207, 2207, - /* 3030 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 3040 */ 2207, 2207, 2207, 2704, 2207, 850, 2207, 2207, 2207, 2207, - /* 3050 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 3060 */ 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207, - /* 3070 */ 2207, 852, 2207, 2207, 2777, 2207, 2207, 2207, 406, 2740, - /* 3080 */ 854, 2742, 2743, 849, 2207, 872, 2207, 2207, 2207, 2207, - /* 3090 */ 2738, 2207, 2207, 2777, 2207, 2207, 2207, 405, 2740, 854, - /* 3100 */ 2742, 2743, 849, 2207, 872, + /* 1120 */ 1946, 2163, 580, 579, 578, 577, 576, 570, 569, 568, + /* 1130 */ 2754, 563, 562, 442, 2226, 1498, 1499, 554, 1774, 1775, + /* 1140 */ 60, 691, 690, 182, 1793, 78, 2701, 805, 850, 158, + /* 1150 */ 975, 761, 2799, 2417, 946, 945, 944, 943, 505, 2135, + /* 1160 */ 942, 941, 162, 936, 935, 934, 933, 932, 931, 930, + /* 1170 */ 161, 924, 923, 922, 504, 503, 919, 918, 917, 198, + /* 1180 */ 197, 916, 500, 915, 914, 913, 1969, 502, 501, 869, + /* 1190 */ 2414, 2736, 1965, 2735, 2701, 2225, 2774, 1954, 2224, 91, + /* 1200 */ 121, 2737, 854, 2739, 2740, 849, 851, 873, 2919, 830, + /* 1210 */ 721, 1947, 2946, 2028, 2828, 2223, 33, 2222, 472, 2824, + /* 1220 */ 2221, 2736, 40, 39, 2220, 735, 46, 44, 43, 42, + /* 1230 */ 41, 1627, 869, 2414, 221, 2754, 851, 104, 2860, 869, + /* 1240 */ 2414, 2641, 2217, 2023, 289, 1626, 869, 2414, 1520, 2476, + /* 1250 */ 1519, 2701, 342, 850, 1941, 2701, 1939, 1946, 2701, 862, + /* 1260 */ 724, 374, 2216, 450, 449, 2754, 863, 718, 716, 869, + /* 1270 */ 2414, 1841, 869, 2414, 286, 2701, 303, 2701, 710, 709, + /* 1280 */ 2701, 2701, 2115, 850, 2701, 2215, 1521, 838, 181, 867, + /* 1290 */ 1944, 1945, 370, 940, 938, 1970, 2474, 2214, 2735, 2420, + /* 1300 */ 2843, 2774, 2701, 2234, 968, 121, 2737, 854, 2739, 2740, + /* 1310 */ 849, 802, 873, 2213, 2622, 2473, 164, 2946, 2212, 2828, + /* 1320 */ 72, 619, 2701, 472, 2824, 71, 2839, 105, 2735, 2211, + /* 1330 */ 2210, 2774, 2654, 792, 150, 121, 2737, 854, 2739, 2740, + /* 1340 */ 849, 2736, 873, 448, 447, 2701, 695, 2946, 90, 2828, + /* 1350 */ 425, 424, 35, 472, 2824, 2209, 851, 2701, 40, 39, + /* 1360 */ 483, 380, 46, 44, 43, 42, 41, 697, 2196, 2197, + /* 1370 */ 2843, 696, 2736, 2701, 492, 293, 2028, 904, 2701, 908, + /* 1380 */ 2465, 909, 2465, 1606, 2465, 2754, 764, 851, 2391, 2701, + /* 1390 */ 2701, 1955, 279, 1950, 2926, 277, 2838, 2283, 738, 1857, + /* 1400 */ 737, 2701, 2105, 850, 615, 1949, 2023, 281, 2736, 164, + /* 1410 */ 280, 283, 2932, 218, 282, 2701, 2754, 2927, 799, 717, + /* 1420 */ 1970, 163, 2655, 851, 801, 299, 1999, 1958, 1960, 1607, + /* 1430 */ 285, 702, 2701, 284, 850, 387, 771, 49, 703, 806, + /* 1440 */ 2266, 871, 870, 2022, 2024, 2025, 2026, 2027, 2735, 2274, + /* 1450 */ 2272, 2774, 2754, 2722, 1604, 121, 2737, 854, 2739, 2740, + /* 1460 */ 849, 1602, 873, 49, 201, 172, 2418, 2803, 2701, 2828, + /* 1470 */ 850, 719, 722, 472, 2824, 2387, 764, 14, 13, 2735, + /* 1480 */ 212, 119, 2774, 116, 2926, 209, 121, 2737, 854, 2739, + /* 1490 */ 2740, 849, 1865, 873, 1948, 964, 329, 77, 2801, 64, + /* 1500 */ 2828, 49, 2932, 218, 472, 2824, 2348, 2927, 799, 1584, + /* 1510 */ 49, 77, 169, 349, 348, 2735, 2219, 2724, 2774, 2139, + /* 1520 */ 2149, 920, 121, 2737, 854, 2739, 2740, 849, 2889, 873, + /* 1530 */ 150, 172, 351, 350, 835, 192, 2828, 2736, 353, 352, + /* 1540 */ 472, 2824, 355, 354, 1576, 1673, 2148, 308, 815, 318, + /* 1550 */ 357, 356, 851, 781, 1931, 1585, 1907, 811, 359, 358, + /* 1560 */ 1664, 902, 901, 900, 1668, 899, 1670, 1671, 845, 844, + /* 1570 */ 310, 1679, 843, 1681, 1682, 842, 886, 883, 746, 333, + /* 1580 */ 822, 2754, 2065, 1557, 2012, 361, 360, 1952, 485, 484, + /* 1590 */ 1932, 363, 362, 1810, 1800, 345, 978, 2701, 74, 850, + /* 1600 */ 881, 803, 365, 364, 871, 870, 2022, 2024, 2025, 2026, + /* 1610 */ 2027, 921, 741, 866, 1655, 378, 367, 366, 2736, 170, + /* 1620 */ 910, 174, 173, 907, 906, 905, 171, 369, 368, 1558, + /* 1630 */ 966, 208, 749, 851, 1574, 152, 172, 2755, 2340, 2255, + /* 1640 */ 962, 958, 954, 950, 2735, 373, 151, 2774, 2879, 778, + /* 1650 */ 2339, 122, 2737, 854, 2739, 2740, 849, 169, 873, 465, + /* 1660 */ 785, 819, 2754, 461, 2547, 2828, 764, 506, 814, 2827, + /* 1670 */ 2824, 524, 2261, 2462, 2926, 793, 1951, 757, 2701, 794, + /* 1680 */ 850, 386, 2880, 1686, 2890, 320, 764, 2548, 315, 323, + /* 1690 */ 514, 120, 2932, 218, 2926, 2374, 346, 2927, 799, 2736, + /* 1700 */ 40, 39, 1694, 5, 46, 44, 43, 42, 41, 439, + /* 1710 */ 509, 1963, 2932, 218, 851, 1973, 523, 2927, 799, 1701, + /* 1720 */ 534, 227, 764, 2736, 226, 2735, 535, 826, 2774, 1699, + /* 1730 */ 2926, 537, 122, 2737, 854, 2739, 2740, 849, 848, 873, + /* 1740 */ 175, 229, 2736, 2754, 379, 1834, 2828, 551, 2932, 218, + /* 1750 */ 837, 2824, 1964, 2927, 799, 558, 240, 851, 560, 2701, + /* 1760 */ 564, 850, 566, 571, 608, 584, 2540, 2754, 595, 597, + /* 1770 */ 604, 607, 344, 609, 832, 620, 621, 327, 618, 246, + /* 1780 */ 245, 623, 326, 2701, 625, 850, 2754, 626, 249, 628, + /* 1790 */ 630, 1971, 4, 645, 656, 653, 257, 1966, 646, 658, + /* 1800 */ 654, 296, 2701, 96, 850, 1972, 852, 659, 1974, 2774, + /* 1810 */ 2736, 662, 660, 122, 2737, 854, 2739, 2740, 849, 260, + /* 1820 */ 873, 263, 1975, 265, 97, 851, 1976, 2828, 98, 2557, + /* 1830 */ 2735, 434, 2824, 2774, 2563, 692, 671, 410, 2737, 854, + /* 1840 */ 2739, 2740, 849, 847, 873, 833, 2793, 99, 272, 2735, + /* 1850 */ 2736, 694, 2774, 2404, 2754, 126, 186, 2737, 854, 2739, + /* 1860 */ 2740, 849, 276, 873, 2400, 851, 725, 278, 726, 413, + /* 1870 */ 2701, 177, 850, 123, 740, 2736, 2402, 2397, 178, 179, + /* 1880 */ 102, 742, 295, 1967, 751, 125, 2631, 752, 382, 758, + /* 1890 */ 851, 2609, 165, 300, 2754, 759, 2628, 2627, 753, 782, + /* 1900 */ 756, 820, 298, 765, 2886, 8, 768, 2867, 791, 766, + /* 1910 */ 2701, 769, 850, 767, 2895, 2894, 191, 2735, 2736, 2754, + /* 1920 */ 2774, 309, 305, 307, 189, 2737, 854, 2739, 2740, 849, + /* 1930 */ 796, 873, 311, 851, 313, 2701, 795, 850, 314, 466, + /* 1940 */ 2949, 807, 2925, 2847, 2736, 804, 156, 312, 2113, 316, + /* 1950 */ 1968, 2111, 204, 325, 166, 818, 383, 2735, 2577, 851, + /* 1960 */ 2774, 2844, 2754, 2576, 186, 2737, 854, 2739, 2740, 849, + /* 1970 */ 1, 873, 384, 2575, 470, 823, 824, 167, 2701, 831, + /* 1980 */ 850, 828, 2735, 800, 2947, 2774, 2736, 338, 2754, 122, + /* 1990 */ 2737, 854, 2739, 2740, 849, 61, 873, 2809, 858, 856, + /* 2000 */ 860, 851, 463, 2828, 2701, 385, 850, 861, 2825, 319, + /* 2010 */ 343, 112, 2887, 220, 2415, 115, 389, 2693, 1472, 2692, + /* 2020 */ 971, 2688, 2687, 2736, 2679, 2735, 875, 970, 2774, 2678, + /* 2030 */ 2754, 372, 411, 2737, 854, 2739, 2740, 849, 851, 873, + /* 2040 */ 2670, 2669, 2685, 2684, 176, 972, 2701, 375, 850, 967, + /* 2050 */ 376, 2735, 2676, 52, 2774, 2675, 974, 2664, 404, 2737, + /* 2060 */ 854, 2739, 2740, 849, 393, 873, 2663, 2754, 2682, 2681, + /* 2070 */ 464, 2673, 2672, 423, 2661, 2660, 2658, 414, 391, 2657, + /* 2080 */ 744, 2466, 431, 2701, 432, 850, 426, 401, 412, 402, + /* 2090 */ 2653, 2652, 2651, 2735, 85, 2646, 2774, 511, 512, 1891, + /* 2100 */ 411, 2737, 854, 2739, 2740, 849, 1892, 873, 224, 790, + /* 2110 */ 2736, 516, 2644, 518, 519, 520, 1890, 2643, 2642, 440, + /* 2120 */ 2640, 526, 2639, 528, 2638, 848, 530, 2637, 1878, 532, + /* 2130 */ 2735, 2613, 2736, 2774, 228, 2612, 230, 189, 2737, 854, + /* 2140 */ 2739, 2740, 849, 86, 873, 1837, 2590, 851, 1836, 2589, + /* 2150 */ 2588, 544, 545, 2587, 2754, 2586, 2530, 549, 1773, 2736, + /* 2160 */ 2527, 552, 2526, 2520, 555, 556, 2517, 233, 2516, 2515, + /* 2170 */ 2701, 2514, 850, 89, 851, 2519, 2754, 2518, 2513, 2512, + /* 2180 */ 235, 2510, 2509, 2508, 572, 2507, 237, 574, 2505, 2504, + /* 2190 */ 2503, 2502, 2701, 2501, 850, 2525, 2736, 2948, 2500, 2499, + /* 2200 */ 2498, 2523, 2506, 2754, 2497, 2496, 2495, 2493, 2492, 2491, + /* 2210 */ 2490, 851, 2489, 2488, 2487, 239, 475, 2735, 2486, 2701, + /* 2220 */ 2774, 850, 2485, 2736, 410, 2737, 854, 2739, 2740, 849, + /* 2230 */ 2484, 873, 2483, 2794, 95, 2555, 2524, 2522, 851, 2735, + /* 2240 */ 2754, 2482, 2774, 477, 2481, 2736, 411, 2737, 854, 2739, + /* 2250 */ 2740, 849, 2480, 873, 244, 1779, 2701, 2479, 850, 611, + /* 2260 */ 851, 2478, 2477, 2475, 613, 1624, 2735, 2754, 428, 2774, + /* 2270 */ 1628, 429, 2736, 411, 2737, 854, 2739, 2740, 849, 2305, + /* 2280 */ 873, 2304, 2303, 2701, 2302, 850, 1620, 851, 247, 2754, + /* 2290 */ 2300, 248, 250, 251, 2297, 631, 632, 633, 2296, 636, + /* 2300 */ 635, 2289, 637, 739, 639, 2701, 2774, 850, 640, 2736, + /* 2310 */ 406, 2737, 854, 2739, 2740, 849, 2754, 873, 641, 2276, + /* 2320 */ 2250, 643, 253, 2721, 851, 199, 1501, 81, 210, 651, + /* 2330 */ 2735, 2249, 2701, 2774, 850, 2611, 255, 396, 2737, 854, + /* 2340 */ 2739, 2740, 849, 82, 873, 2607, 2597, 2585, 262, 264, + /* 2350 */ 2736, 267, 2735, 2754, 2584, 2774, 2561, 269, 2554, 395, + /* 2360 */ 2737, 854, 2739, 2740, 849, 851, 873, 2392, 2299, 2701, + /* 2370 */ 2295, 850, 1550, 672, 674, 673, 2293, 676, 677, 2735, + /* 2380 */ 678, 2291, 2774, 681, 680, 2736, 397, 2737, 854, 2739, + /* 2390 */ 2740, 849, 2288, 873, 2754, 684, 682, 685, 2271, 686, + /* 2400 */ 851, 2269, 2270, 2268, 2246, 2394, 1705, 1706, 2393, 1610, + /* 2410 */ 2701, 1609, 850, 73, 1608, 1605, 2735, 2736, 275, 2774, + /* 2420 */ 2286, 1603, 1601, 403, 2737, 854, 2739, 2740, 849, 2754, + /* 2430 */ 873, 1600, 851, 1599, 2284, 1598, 2736, 1592, 454, 455, + /* 2440 */ 937, 2275, 1597, 939, 456, 2701, 720, 850, 1594, 1593, + /* 2450 */ 1591, 851, 2273, 457, 2245, 723, 2244, 2735, 2243, 727, + /* 2460 */ 2774, 2754, 2242, 729, 407, 2737, 854, 2739, 2740, 849, + /* 2470 */ 2241, 873, 731, 2240, 1872, 733, 1874, 2701, 1871, 850, + /* 2480 */ 2754, 128, 2736, 2610, 1862, 1876, 56, 28, 743, 67, + /* 2490 */ 1847, 2606, 2735, 1843, 297, 2774, 2701, 851, 850, 398, + /* 2500 */ 2737, 854, 2739, 2740, 849, 2596, 873, 57, 1845, 754, + /* 2510 */ 755, 2583, 301, 2582, 2736, 1822, 180, 2931, 760, 1821, + /* 2520 */ 770, 762, 20, 6, 2735, 2166, 2754, 2774, 462, 851, + /* 2530 */ 17, 408, 2737, 854, 2739, 2740, 849, 2140, 873, 30, + /* 2540 */ 304, 772, 2701, 2735, 850, 774, 2774, 7, 215, 306, + /* 2550 */ 399, 2737, 854, 2739, 2740, 849, 776, 873, 2754, 21, + /* 2560 */ 22, 203, 2147, 190, 202, 31, 32, 2134, 2722, 23, + /* 2570 */ 83, 216, 2106, 2108, 2701, 2104, 850, 65, 2736, 217, + /* 2580 */ 24, 2186, 2187, 2088, 18, 2181, 2180, 467, 2185, 2735, + /* 2590 */ 2184, 468, 2774, 851, 2087, 321, 409, 2737, 854, 2739, + /* 2600 */ 2740, 849, 2736, 873, 58, 59, 2581, 195, 2560, 106, + /* 2610 */ 107, 2559, 328, 108, 2142, 205, 334, 851, 69, 2553, + /* 2620 */ 827, 2735, 2754, 337, 2774, 821, 829, 2736, 400, 2737, + /* 2630 */ 854, 2739, 2740, 849, 109, 873, 25, 2040, 2701, 336, + /* 2640 */ 850, 11, 851, 2039, 13, 1956, 2754, 2015, 2050, 196, + /* 2650 */ 2014, 888, 206, 1991, 891, 339, 894, 897, 38, 2552, + /* 2660 */ 110, 2013, 2701, 16, 850, 859, 853, 2736, 26, 2389, + /* 2670 */ 864, 2754, 347, 1983, 27, 70, 865, 857, 341, 111, + /* 2680 */ 79, 880, 851, 2779, 116, 2735, 2778, 2701, 2774, 850, + /* 2690 */ 872, 2736, 416, 2737, 854, 2739, 2740, 849, 2017, 873, + /* 2700 */ 68, 2202, 874, 2201, 2199, 2200, 851, 1687, 494, 2735, + /* 2710 */ 882, 2754, 2774, 1684, 884, 885, 417, 2737, 854, 2739, + /* 2720 */ 2740, 849, 887, 873, 890, 1683, 1680, 2701, 1674, 850, + /* 2730 */ 893, 1672, 2736, 896, 2735, 2754, 1678, 2774, 371, 1677, + /* 2740 */ 117, 2748, 2737, 854, 2739, 2740, 849, 851, 873, 118, + /* 2750 */ 1676, 2701, 1700, 850, 1675, 80, 1696, 1588, 1548, 911, + /* 2760 */ 1587, 1586, 1583, 1580, 1579, 1578, 1577, 1575, 1573, 1572, + /* 2770 */ 925, 1618, 2736, 1571, 2735, 1617, 2754, 2774, 222, 927, + /* 2780 */ 1569, 2747, 2737, 854, 2739, 2740, 849, 851, 873, 1568, + /* 2790 */ 1567, 1566, 2701, 1565, 850, 1564, 1563, 1614, 2735, 2736, + /* 2800 */ 1612, 2774, 1560, 1559, 1556, 2746, 2737, 854, 2739, 2740, + /* 2810 */ 849, 1555, 873, 1554, 851, 1553, 2754, 2294, 2736, 947, + /* 2820 */ 949, 2292, 951, 2290, 948, 952, 953, 956, 955, 957, + /* 2830 */ 2287, 959, 2701, 851, 850, 960, 2267, 961, 963, 2735, + /* 2840 */ 2265, 965, 2774, 2754, 1490, 2239, 436, 2737, 854, 2739, + /* 2850 */ 2740, 849, 1478, 873, 1473, 969, 1480, 377, 973, 2701, + /* 2860 */ 1942, 850, 2754, 390, 976, 2205, 977, 2205, 2205, 2205, + /* 2870 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2701, 2735, + /* 2880 */ 850, 2205, 2774, 2736, 2205, 2205, 437, 2737, 854, 2739, + /* 2890 */ 2740, 849, 2205, 873, 2205, 2205, 2736, 2205, 851, 2205, + /* 2900 */ 2205, 2205, 2205, 2205, 2205, 2205, 2735, 2205, 2205, 2774, + /* 2910 */ 2205, 851, 2205, 433, 2737, 854, 2739, 2740, 849, 2205, + /* 2920 */ 873, 2205, 2205, 2205, 2205, 2735, 2205, 2754, 2774, 2205, + /* 2930 */ 2205, 2205, 438, 2737, 854, 2739, 2740, 849, 2205, 873, + /* 2940 */ 2754, 2205, 2205, 2701, 2205, 850, 2205, 2205, 2205, 2205, + /* 2950 */ 2205, 2205, 2205, 2205, 2205, 2205, 2701, 2205, 850, 2205, + /* 2960 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, + /* 2970 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, + /* 2980 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, + /* 2990 */ 852, 2205, 2205, 2774, 2205, 2205, 2205, 406, 2737, 854, + /* 3000 */ 2739, 2740, 849, 2735, 873, 2205, 2774, 2205, 2205, 2205, + /* 3010 */ 405, 2737, 854, 2739, 2740, 849, 2205, 873, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 425, 427, 404, 444, 427, 431, 390, 444, 522, 393, - /* 10 */ 394, 425, 12, 13, 14, 381, 530, 458, 522, 421, - /* 20 */ 20, 458, 22, 464, 465, 20, 530, 464, 465, 412, - /* 30 */ 396, 433, 395, 396, 548, 549, 36, 412, 38, 553, - /* 40 */ 554, 12, 13, 381, 396, 549, 33, 8, 9, 553, - /* 50 */ 554, 12, 13, 14, 15, 16, 3, 390, 424, 442, - /* 60 */ 393, 394, 41, 42, 381, 36, 492, 442, 68, 492, - /* 70 */ 21, 20, 424, 20, 427, 75, 442, 503, 444, 396, - /* 80 */ 503, 20, 82, 4, 395, 396, 37, 2, 39, 40, - /* 90 */ 41, 42, 424, 8, 9, 12, 13, 12, 13, 14, - /* 100 */ 15, 16, 434, 20, 442, 22, 91, 424, 20, 492, - /* 110 */ 493, 494, 112, 445, 75, 115, 424, 492, 493, 36, - /* 120 */ 503, 38, 20, 489, 432, 442, 492, 444, 503, 116, - /* 130 */ 496, 497, 498, 499, 500, 501, 20, 503, 378, 492, - /* 140 */ 119, 120, 508, 122, 510, 453, 498, 425, 514, 515, - /* 150 */ 503, 68, 152, 153, 517, 518, 519, 520, 75, 522, - /* 160 */ 523, 74, 123, 395, 425, 82, 145, 391, 534, 116, - /* 170 */ 149, 395, 489, 397, 159, 492, 542, 438, 381, 496, - /* 180 */ 497, 498, 499, 500, 501, 502, 503, 504, 505, 395, - /* 190 */ 396, 191, 192, 396, 115, 112, 191, 192, 115, 184, - /* 200 */ 185, 201, 202, 115, 395, 396, 20, 518, 519, 520, - /* 210 */ 488, 522, 523, 198, 446, 447, 216, 449, 218, 530, - /* 220 */ 452, 424, 12, 13, 14, 15, 16, 423, 468, 190, - /* 230 */ 444, 115, 125, 473, 14, 152, 153, 548, 549, 442, - /* 240 */ 20, 444, 553, 554, 450, 441, 193, 218, 395, 396, - /* 250 */ 464, 465, 252, 253, 254, 115, 256, 257, 258, 259, + /* 0 */ 412, 426, 390, 467, 443, 393, 394, 443, 472, 510, + /* 10 */ 511, 395, 12, 13, 14, 426, 381, 14, 521, 424, + /* 20 */ 20, 457, 22, 20, 463, 464, 529, 463, 464, 441, + /* 30 */ 412, 396, 425, 395, 396, 440, 36, 396, 38, 428, + /* 40 */ 20, 434, 435, 428, 547, 548, 431, 8, 9, 552, + /* 50 */ 553, 12, 13, 14, 15, 16, 381, 521, 395, 441, + /* 60 */ 425, 445, 446, 14, 448, 529, 425, 451, 68, 20, + /* 70 */ 20, 396, 20, 12, 13, 75, 441, 73, 443, 491, + /* 80 */ 492, 493, 82, 547, 548, 395, 396, 443, 552, 553, + /* 90 */ 502, 0, 485, 486, 20, 12, 13, 36, 395, 396, + /* 100 */ 425, 457, 491, 20, 428, 22, 491, 463, 464, 491, + /* 110 */ 492, 74, 112, 502, 75, 115, 441, 502, 443, 36, + /* 120 */ 502, 38, 20, 488, 395, 396, 491, 14, 15, 16, + /* 130 */ 495, 496, 497, 498, 499, 500, 20, 502, 497, 378, + /* 140 */ 477, 478, 507, 390, 509, 54, 393, 394, 513, 514, + /* 150 */ 381, 68, 152, 153, 516, 517, 518, 519, 75, 521, + /* 160 */ 522, 1, 2, 488, 125, 82, 491, 491, 533, 117, + /* 170 */ 495, 496, 497, 498, 499, 500, 541, 502, 502, 381, + /* 180 */ 505, 36, 507, 508, 509, 395, 396, 411, 513, 514, + /* 190 */ 414, 191, 192, 391, 396, 112, 398, 395, 115, 397, + /* 200 */ 391, 201, 202, 426, 395, 415, 397, 517, 518, 519, + /* 210 */ 441, 521, 522, 423, 437, 211, 216, 115, 218, 529, + /* 220 */ 517, 518, 519, 425, 521, 522, 152, 153, 467, 190, + /* 230 */ 425, 115, 20, 472, 20, 152, 153, 547, 548, 441, + /* 240 */ 191, 443, 552, 553, 240, 241, 517, 518, 519, 444, + /* 250 */ 521, 522, 252, 253, 254, 33, 256, 257, 258, 259, /* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 270 */ 270, 271, 272, 273, 191, 192, 524, 391, 526, 54, - /* 280 */ 44, 395, 522, 397, 201, 202, 489, 180, 63, 492, - /* 290 */ 530, 66, 67, 496, 497, 498, 499, 500, 501, 216, - /* 300 */ 503, 218, 0, 506, 0, 508, 509, 510, 548, 549, - /* 310 */ 124, 514, 515, 553, 554, 254, 277, 278, 279, 280, - /* 320 */ 281, 282, 283, 284, 285, 286, 287, 518, 519, 520, - /* 330 */ 440, 522, 523, 443, 444, 252, 253, 254, 424, 256, + /* 270 */ 270, 271, 272, 273, 191, 192, 116, 155, 420, 218, + /* 280 */ 44, 20, 521, 425, 201, 202, 488, 146, 147, 491, + /* 290 */ 529, 36, 151, 495, 496, 497, 498, 499, 500, 216, + /* 300 */ 502, 218, 0, 254, 254, 507, 20, 509, 547, 548, + /* 310 */ 452, 513, 514, 552, 553, 426, 277, 278, 279, 280, + /* 320 */ 281, 282, 283, 284, 285, 286, 287, 115, 145, 146, + /* 330 */ 147, 148, 149, 150, 151, 252, 253, 254, 116, 256, /* 340 */ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, /* 350 */ 267, 268, 269, 270, 271, 272, 273, 274, 12, 13, - /* 360 */ 20, 20, 381, 20, 395, 18, 20, 380, 22, 382, - /* 370 */ 23, 518, 519, 520, 0, 522, 523, 396, 299, 77, - /* 380 */ 78, 79, 36, 424, 38, 402, 84, 85, 86, 42, - /* 390 */ 43, 155, 90, 46, 435, 436, 495, 95, 96, 97, - /* 400 */ 98, 487, 419, 101, 57, 424, 0, 105, 106, 107, - /* 410 */ 108, 428, 429, 424, 68, 299, 69, 70, 71, 72, - /* 420 */ 73, 75, 521, 442, 455, 444, 457, 21, 82, 395, - /* 430 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 299, - /* 440 */ 196, 12, 13, 14, 252, 486, 487, 424, 74, 20, - /* 450 */ 424, 22, 395, 396, 146, 20, 522, 434, 112, 155, - /* 460 */ 434, 115, 115, 411, 530, 36, 414, 38, 445, 20, - /* 470 */ 489, 445, 415, 492, 170, 486, 487, 496, 497, 498, - /* 480 */ 499, 500, 501, 549, 503, 20, 33, 553, 554, 508, - /* 490 */ 0, 510, 0, 152, 153, 514, 515, 68, 152, 153, - /* 500 */ 115, 154, 405, 311, 312, 313, 314, 315, 316, 317, - /* 510 */ 413, 82, 478, 479, 24, 25, 26, 27, 28, 29, - /* 520 */ 30, 31, 32, 542, 288, 289, 290, 291, 292, 293, - /* 530 */ 294, 295, 296, 36, 395, 396, 193, 191, 192, 231, - /* 540 */ 232, 112, 201, 202, 115, 522, 424, 201, 202, 305, - /* 550 */ 306, 307, 308, 530, 415, 208, 209, 210, 395, 396, - /* 560 */ 213, 422, 216, 20, 218, 292, 293, 294, 295, 296, - /* 570 */ 74, 548, 549, 226, 227, 453, 553, 554, 415, 82, - /* 580 */ 115, 152, 153, 155, 395, 422, 239, 152, 153, 242, - /* 590 */ 73, 0, 245, 246, 247, 248, 249, 254, 252, 253, - /* 600 */ 254, 424, 256, 257, 258, 259, 260, 261, 262, 263, + /* 360 */ 426, 427, 381, 218, 425, 18, 20, 147, 22, 417, + /* 370 */ 23, 151, 433, 421, 395, 396, 487, 396, 381, 77, + /* 380 */ 78, 79, 36, 444, 38, 395, 84, 85, 86, 42, + /* 390 */ 43, 155, 90, 46, 415, 250, 251, 95, 96, 97, + /* 400 */ 98, 299, 423, 101, 57, 0, 425, 105, 106, 107, + /* 410 */ 108, 289, 290, 291, 68, 299, 69, 70, 71, 72, + /* 420 */ 73, 75, 441, 523, 443, 525, 21, 20, 82, 24, + /* 430 */ 25, 26, 27, 28, 29, 30, 31, 32, 441, 521, + /* 440 */ 425, 12, 13, 14, 454, 225, 456, 529, 433, 20, + /* 450 */ 230, 22, 20, 233, 193, 235, 425, 20, 112, 444, + /* 460 */ 521, 115, 115, 4, 433, 36, 548, 38, 529, 488, + /* 470 */ 552, 553, 491, 218, 13, 444, 495, 496, 497, 498, + /* 480 */ 499, 500, 23, 502, 395, 396, 547, 548, 507, 425, + /* 490 */ 509, 552, 553, 20, 513, 514, 0, 68, 152, 153, + /* 500 */ 380, 154, 382, 155, 415, 250, 251, 48, 49, 50, + /* 510 */ 21, 82, 425, 24, 25, 26, 27, 28, 29, 30, + /* 520 */ 31, 32, 541, 115, 288, 289, 290, 291, 292, 293, + /* 530 */ 294, 295, 296, 21, 521, 420, 425, 191, 192, 452, + /* 540 */ 425, 112, 529, 82, 115, 434, 435, 201, 202, 37, + /* 550 */ 486, 39, 40, 41, 42, 208, 209, 210, 0, 196, + /* 560 */ 213, 548, 216, 20, 218, 552, 553, 452, 395, 396, + /* 570 */ 74, 8, 9, 226, 227, 12, 13, 14, 15, 16, + /* 580 */ 22, 152, 153, 20, 152, 153, 239, 439, 415, 242, + /* 590 */ 442, 443, 245, 246, 247, 248, 249, 145, 252, 253, + /* 600 */ 254, 149, 256, 257, 258, 259, 260, 261, 262, 263, /* 610 */ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - /* 620 */ 191, 192, 445, 145, 146, 147, 148, 149, 150, 151, - /* 630 */ 201, 202, 20, 20, 22, 22, 112, 145, 146, 147, - /* 640 */ 148, 149, 150, 151, 4, 216, 299, 218, 36, 460, - /* 650 */ 461, 127, 128, 129, 130, 131, 132, 133, 134, 135, - /* 660 */ 136, 68, 138, 139, 140, 141, 142, 143, 144, 21, - /* 670 */ 58, 58, 24, 25, 26, 27, 28, 29, 30, 31, - /* 680 */ 32, 252, 253, 254, 299, 256, 257, 258, 259, 260, + /* 620 */ 191, 192, 292, 293, 294, 295, 296, 4, 191, 192, + /* 630 */ 201, 202, 404, 201, 202, 112, 288, 289, 290, 291, + /* 640 */ 292, 293, 294, 295, 296, 216, 299, 218, 0, 115, + /* 650 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + /* 660 */ 432, 138, 139, 140, 141, 142, 143, 144, 305, 306, + /* 670 */ 307, 308, 24, 25, 26, 27, 28, 29, 30, 31, + /* 680 */ 32, 252, 253, 254, 68, 256, 257, 258, 259, 260, /* 690 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - /* 700 */ 271, 272, 273, 12, 13, 381, 4, 114, 424, 22, - /* 710 */ 117, 20, 145, 22, 20, 112, 149, 289, 290, 291, - /* 720 */ 396, 437, 398, 36, 274, 23, 276, 36, 211, 38, - /* 730 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - /* 740 */ 4, 138, 139, 140, 141, 142, 143, 144, 424, 125, - /* 750 */ 48, 49, 50, 511, 512, 19, 22, 240, 241, 68, - /* 760 */ 506, 155, 171, 509, 299, 14, 442, 176, 444, 82, - /* 770 */ 36, 20, 424, 82, 38, 184, 323, 8, 9, 186, - /* 780 */ 432, 12, 13, 14, 15, 16, 12, 13, 395, 396, - /* 790 */ 54, 395, 396, 82, 20, 468, 22, 61, 62, 112, - /* 800 */ 473, 453, 381, 112, 68, 424, 115, 495, 415, 274, - /* 810 */ 36, 415, 38, 489, 495, 434, 492, 396, 125, 398, - /* 820 */ 496, 497, 498, 499, 500, 501, 445, 503, 395, 395, - /* 830 */ 396, 36, 508, 521, 510, 228, 395, 396, 514, 515, - /* 840 */ 521, 190, 68, 152, 153, 424, 112, 381, 2, 522, - /* 850 */ 114, 0, 23, 117, 8, 9, 82, 530, 12, 13, - /* 860 */ 14, 15, 16, 442, 402, 444, 8, 9, 395, 396, - /* 870 */ 12, 13, 14, 15, 16, 548, 549, 82, 49, 50, - /* 880 */ 553, 554, 191, 192, 450, 116, 112, 193, 415, 115, - /* 890 */ 428, 450, 201, 202, 288, 289, 290, 291, 292, 293, - /* 900 */ 294, 295, 296, 216, 0, 218, 381, 216, 442, 218, - /* 910 */ 489, 478, 479, 492, 395, 396, 13, 496, 497, 498, - /* 920 */ 499, 500, 501, 33, 503, 416, 152, 153, 277, 508, - /* 930 */ 507, 510, 509, 424, 415, 514, 515, 47, 287, 252, - /* 940 */ 253, 301, 191, 252, 253, 254, 437, 256, 257, 258, + /* 700 */ 271, 272, 273, 12, 13, 22, 381, 299, 395, 396, + /* 710 */ 74, 20, 20, 22, 12, 13, 14, 15, 16, 36, + /* 720 */ 20, 396, 22, 398, 77, 78, 79, 36, 415, 38, + /* 730 */ 114, 84, 85, 86, 191, 119, 36, 90, 115, 126, + /* 740 */ 395, 396, 95, 96, 97, 98, 3, 381, 101, 215, + /* 750 */ 425, 217, 105, 106, 107, 108, 193, 274, 58, 68, + /* 760 */ 415, 14, 396, 20, 398, 416, 441, 20, 443, 0, + /* 770 */ 228, 8, 9, 82, 425, 12, 13, 14, 15, 16, + /* 780 */ 54, 416, 395, 249, 91, 436, 12, 13, 395, 63, + /* 790 */ 425, 425, 66, 67, 20, 112, 22, 254, 395, 396, + /* 800 */ 425, 436, 186, 112, 395, 396, 115, 441, 433, 443, + /* 810 */ 36, 0, 38, 488, 442, 443, 491, 254, 415, 444, + /* 820 */ 495, 496, 497, 498, 499, 500, 36, 502, 395, 396, + /* 830 */ 395, 396, 507, 299, 509, 395, 396, 425, 513, 514, + /* 840 */ 395, 396, 68, 152, 153, 75, 459, 460, 415, 395, + /* 850 */ 396, 252, 159, 33, 488, 415, 82, 491, 449, 116, + /* 860 */ 415, 495, 496, 497, 498, 499, 500, 47, 502, 415, + /* 870 */ 477, 478, 82, 507, 82, 509, 404, 184, 185, 513, + /* 880 */ 514, 115, 191, 192, 449, 193, 112, 395, 396, 115, + /* 890 */ 126, 198, 201, 202, 422, 8, 9, 485, 486, 12, + /* 900 */ 13, 14, 15, 16, 432, 38, 274, 216, 276, 218, + /* 910 */ 311, 312, 313, 314, 315, 316, 317, 375, 376, 377, + /* 920 */ 33, 54, 299, 22, 155, 0, 152, 153, 190, 381, + /* 930 */ 63, 64, 65, 66, 0, 68, 193, 36, 191, 170, + /* 940 */ 506, 449, 508, 252, 253, 254, 254, 256, 257, 258, /* 950 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 960 */ 269, 270, 271, 272, 273, 191, 192, 442, 18, 20, - /* 970 */ 20, 44, 14, 416, 116, 201, 202, 27, 20, 425, - /* 980 */ 30, 424, 375, 376, 377, 82, 146, 147, 38, 20, - /* 990 */ 216, 151, 218, 0, 437, 68, 145, 146, 147, 148, - /* 1000 */ 149, 150, 151, 425, 54, 254, 56, 425, 426, 395, - /* 1010 */ 396, 61, 62, 8, 9, 52, 34, 12, 13, 14, - /* 1020 */ 15, 16, 425, 73, 443, 444, 252, 253, 254, 415, + /* 960 */ 269, 270, 271, 272, 273, 191, 192, 402, 18, 44, + /* 970 */ 20, 208, 425, 395, 396, 201, 202, 27, 395, 396, + /* 980 */ 30, 114, 171, 82, 419, 4, 119, 176, 38, 441, + /* 990 */ 216, 444, 218, 415, 429, 184, 395, 396, 415, 52, + /* 1000 */ 405, 254, 146, 116, 54, 506, 56, 508, 413, 395, + /* 1010 */ 396, 61, 62, 8, 9, 277, 415, 12, 13, 14, + /* 1020 */ 15, 16, 252, 73, 494, 287, 252, 253, 254, 415, /* 1030 */ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - /* 1040 */ 266, 267, 268, 269, 270, 271, 272, 273, 8, 9, - /* 1050 */ 400, 401, 12, 13, 14, 15, 16, 507, 36, 509, - /* 1060 */ 20, 8, 9, 36, 114, 12, 13, 14, 15, 16, - /* 1070 */ 77, 78, 79, 80, 81, 125, 83, 84, 85, 86, - /* 1080 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - /* 1090 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - /* 1100 */ 107, 108, 14, 15, 16, 3, 22, 157, 158, 82, + /* 1040 */ 266, 267, 268, 269, 270, 271, 272, 273, 395, 396, + /* 1050 */ 520, 8, 9, 186, 44, 12, 13, 14, 15, 16, + /* 1060 */ 22, 20, 195, 14, 114, 299, 199, 200, 415, 20, + /* 1070 */ 395, 396, 205, 206, 36, 402, 126, 0, 68, 145, + /* 1080 */ 146, 147, 148, 149, 150, 151, 381, 231, 232, 326, + /* 1090 */ 415, 224, 8, 9, 59, 60, 12, 13, 14, 15, + /* 1100 */ 16, 396, 429, 398, 400, 401, 3, 157, 158, 23, /* 1110 */ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - /* 1120 */ 36, 420, 172, 173, 174, 175, 176, 177, 178, 179, - /* 1130 */ 381, 181, 182, 183, 468, 395, 396, 187, 188, 189, - /* 1140 */ 191, 395, 396, 381, 194, 396, 51, 398, 244, 191, - /* 1150 */ 425, 77, 78, 79, 36, 415, 193, 381, 84, 85, - /* 1160 */ 86, 415, 193, 474, 90, 115, 82, 204, 381, 95, - /* 1170 */ 96, 97, 98, 424, 413, 101, 22, 395, 396, 105, - /* 1180 */ 106, 107, 108, 396, 483, 398, 395, 396, 522, 424, - /* 1190 */ 36, 442, 381, 444, 59, 60, 530, 415, 12, 13, - /* 1200 */ 435, 436, 13, 254, 442, 404, 415, 396, 22, 398, - /* 1210 */ 115, 424, 254, 208, 548, 549, 395, 396, 442, 553, - /* 1220 */ 554, 424, 36, 254, 38, 400, 401, 409, 410, 442, - /* 1230 */ 382, 444, 20, 193, 433, 424, 415, 424, 489, 424, - /* 1240 */ 218, 492, 445, 381, 381, 496, 497, 498, 499, 500, - /* 1250 */ 501, 436, 503, 442, 68, 444, 147, 508, 445, 510, - /* 1260 */ 151, 395, 396, 514, 515, 215, 112, 217, 82, 1, - /* 1270 */ 2, 82, 250, 251, 381, 439, 489, 381, 442, 492, - /* 1280 */ 20, 415, 381, 496, 497, 498, 499, 500, 501, 396, - /* 1290 */ 503, 398, 381, 381, 254, 508, 33, 510, 112, 249, - /* 1300 */ 489, 514, 515, 492, 442, 442, 454, 496, 497, 498, - /* 1310 */ 499, 500, 501, 381, 503, 439, 381, 424, 442, 508, - /* 1320 */ 381, 510, 12, 13, 68, 514, 515, 381, 396, 409, - /* 1330 */ 410, 326, 22, 33, 225, 442, 218, 444, 442, 230, - /* 1340 */ 395, 396, 233, 442, 235, 0, 36, 47, 38, 299, - /* 1350 */ 395, 396, 381, 442, 442, 381, 424, 8, 9, 381, - /* 1360 */ 415, 12, 13, 14, 15, 16, 381, 396, 250, 251, - /* 1370 */ 415, 384, 385, 117, 442, 381, 444, 442, 68, 395, - /* 1380 */ 396, 442, 489, 0, 116, 492, 395, 396, 442, 496, - /* 1390 */ 497, 498, 499, 500, 501, 424, 503, 395, 396, 415, - /* 1400 */ 381, 508, 216, 510, 218, 524, 415, 514, 515, 439, - /* 1410 */ 186, 118, 442, 442, 121, 444, 442, 415, 36, 381, - /* 1420 */ 442, 489, 557, 321, 492, 395, 396, 442, 496, 497, - /* 1430 */ 498, 499, 500, 501, 396, 503, 442, 54, 252, 253, - /* 1440 */ 508, 1, 510, 14, 220, 415, 514, 515, 417, 20, - /* 1450 */ 0, 420, 266, 267, 268, 269, 270, 271, 272, 19, - /* 1460 */ 489, 442, 424, 492, 395, 396, 254, 496, 497, 498, - /* 1470 */ 499, 500, 501, 0, 503, 234, 33, 236, 38, 508, - /* 1480 */ 442, 510, 444, 33, 415, 514, 515, 395, 396, 468, - /* 1490 */ 33, 8, 9, 53, 54, 12, 13, 14, 15, 16, - /* 1500 */ 155, 13, 13, 63, 64, 65, 66, 415, 68, 33, - /* 1510 */ 118, 395, 396, 121, 254, 118, 33, 44, 121, 118, - /* 1520 */ 33, 75, 121, 0, 36, 36, 216, 489, 218, 468, - /* 1530 */ 492, 415, 546, 33, 496, 497, 498, 499, 500, 501, - /* 1540 */ 468, 503, 193, 522, 0, 22, 508, 36, 510, 0, - /* 1550 */ 381, 530, 514, 515, 114, 152, 153, 117, 33, 116, - /* 1560 */ 250, 251, 252, 0, 539, 396, 22, 525, 468, 548, - /* 1570 */ 549, 22, 33, 116, 553, 554, 266, 267, 268, 269, - /* 1580 */ 270, 271, 272, 522, 399, 22, 424, 115, 325, 381, - /* 1590 */ 150, 530, 116, 424, 522, 33, 124, 33, 394, 116, - /* 1600 */ 218, 454, 530, 116, 396, 1, 2, 33, 412, 548, - /* 1610 */ 549, 442, 33, 444, 553, 554, 116, 12, 13, 33, - /* 1620 */ 548, 549, 522, 12, 13, 553, 554, 412, 381, 33, - /* 1630 */ 530, 33, 424, 33, 545, 195, 33, 197, 12, 13, - /* 1640 */ 200, 116, 36, 396, 545, 205, 12, 13, 548, 549, - /* 1650 */ 442, 33, 444, 553, 554, 116, 12, 13, 489, 12, - /* 1660 */ 13, 492, 12, 13, 224, 496, 497, 498, 499, 500, - /* 1670 */ 501, 424, 503, 12, 13, 12, 13, 381, 116, 510, - /* 1680 */ 116, 12, 13, 514, 515, 12, 13, 33, 82, 442, - /* 1690 */ 116, 444, 396, 33, 13, 116, 0, 489, 252, 33, - /* 1700 */ 492, 33, 116, 33, 496, 497, 498, 499, 500, 501, - /* 1710 */ 381, 503, 116, 545, 116, 467, 116, 36, 510, 116, - /* 1720 */ 424, 545, 514, 515, 454, 396, 13, 399, 490, 218, - /* 1730 */ 396, 441, 475, 454, 116, 454, 489, 550, 442, 492, - /* 1740 */ 444, 516, 529, 496, 497, 498, 499, 500, 501, 36, - /* 1750 */ 503, 55, 529, 424, 532, 454, 414, 510, 302, 54, - /* 1760 */ 469, 514, 515, 491, 20, 395, 20, 480, 233, 485, - /* 1770 */ 116, 442, 381, 444, 480, 38, 116, 404, 404, 214, - /* 1780 */ 471, 395, 116, 20, 116, 489, 116, 396, 492, 396, - /* 1790 */ 47, 54, 496, 497, 498, 499, 500, 501, 451, 503, - /* 1800 */ 63, 64, 65, 66, 396, 68, 451, 190, 448, 395, - /* 1810 */ 451, 396, 395, 448, 448, 424, 448, 113, 489, 408, - /* 1820 */ 111, 492, 395, 407, 110, 496, 497, 498, 499, 500, - /* 1830 */ 501, 395, 503, 442, 406, 444, 395, 395, 20, 543, - /* 1840 */ 544, 388, 395, 52, 392, 20, 388, 392, 404, 480, - /* 1850 */ 444, 114, 381, 404, 117, 404, 20, 397, 20, 470, - /* 1860 */ 397, 20, 20, 404, 455, 404, 461, 396, 404, 404, - /* 1870 */ 404, 404, 395, 388, 384, 384, 442, 395, 424, 442, - /* 1880 */ 489, 388, 237, 492, 555, 556, 424, 496, 497, 498, - /* 1890 */ 499, 500, 501, 424, 503, 424, 484, 115, 424, 424, - /* 1900 */ 482, 510, 424, 424, 424, 424, 515, 402, 424, 20, - /* 1910 */ 424, 480, 381, 442, 479, 444, 222, 402, 221, 395, - /* 1920 */ 310, 309, 477, 186, 476, 538, 538, 396, 207, 320, - /* 1930 */ 462, 318, 195, 538, 442, 541, 199, 200, 444, 381, - /* 1940 */ 442, 319, 205, 206, 540, 303, 298, 537, 528, 536, - /* 1950 */ 297, 527, 327, 322, 396, 424, 535, 558, 462, 324, - /* 1960 */ 489, 224, 396, 492, 469, 20, 469, 496, 497, 498, - /* 1970 */ 499, 500, 501, 442, 503, 444, 125, 552, 300, 397, - /* 1980 */ 402, 551, 424, 402, 462, 442, 199, 442, 442, 442, - /* 1990 */ 462, 459, 442, 402, 495, 442, 455, 466, 115, 402, - /* 2000 */ 442, 442, 444, 533, 199, 420, 115, 456, 22, 455, - /* 2010 */ 381, 442, 396, 442, 513, 544, 402, 402, 442, 442, - /* 2020 */ 489, 402, 442, 492, 466, 396, 442, 496, 497, 498, - /* 2030 */ 499, 500, 501, 531, 503, 442, 442, 442, 430, 383, - /* 2040 */ 35, 442, 387, 442, 442, 386, 395, 489, 381, 442, - /* 2050 */ 492, 37, 40, 424, 496, 497, 498, 499, 500, 501, - /* 2060 */ 389, 503, 442, 396, 388, 442, 442, 426, 481, 442, - /* 2070 */ 442, 442, 442, 444, 381, 442, 488, 403, 442, 442, - /* 2080 */ 442, 379, 418, 418, 426, 0, 0, 0, 47, 396, - /* 2090 */ 418, 424, 0, 472, 36, 463, 243, 36, 36, 36, - /* 2100 */ 243, 0, 463, 36, 36, 243, 36, 0, 0, 442, - /* 2110 */ 243, 444, 0, 36, 0, 36, 0, 424, 489, 22, - /* 2120 */ 0, 492, 238, 0, 36, 496, 497, 498, 499, 500, - /* 2130 */ 501, 224, 503, 0, 224, 442, 225, 444, 218, 216, - /* 2140 */ 0, 0, 0, 381, 212, 211, 0, 0, 158, 51, - /* 2150 */ 51, 0, 0, 36, 0, 36, 489, 54, 396, 492, - /* 2160 */ 0, 51, 0, 496, 497, 498, 499, 500, 501, 47, - /* 2170 */ 503, 0, 0, 0, 0, 51, 547, 0, 0, 0, - /* 2180 */ 0, 0, 489, 176, 381, 492, 424, 51, 0, 496, - /* 2190 */ 497, 498, 499, 500, 501, 36, 503, 0, 505, 396, - /* 2200 */ 176, 0, 0, 381, 442, 0, 444, 0, 0, 0, - /* 2210 */ 0, 0, 0, 0, 0, 0, 0, 0, 396, 52, - /* 2220 */ 22, 0, 47, 556, 0, 0, 0, 424, 466, 0, - /* 2230 */ 0, 0, 0, 381, 0, 0, 0, 0, 0, 0, - /* 2240 */ 0, 0, 158, 0, 0, 442, 424, 444, 396, 0, - /* 2250 */ 157, 489, 156, 0, 492, 22, 52, 0, 496, 497, - /* 2260 */ 498, 499, 500, 501, 442, 503, 444, 381, 22, 466, - /* 2270 */ 47, 68, 0, 0, 68, 0, 424, 0, 36, 0, - /* 2280 */ 0, 36, 396, 0, 36, 0, 68, 0, 68, 33, - /* 2290 */ 0, 44, 489, 0, 442, 492, 444, 381, 36, 496, - /* 2300 */ 497, 498, 499, 500, 501, 54, 503, 44, 54, 54, - /* 2310 */ 424, 489, 396, 44, 492, 44, 51, 36, 496, 497, - /* 2320 */ 498, 499, 500, 501, 14, 503, 44, 51, 442, 51, - /* 2330 */ 444, 45, 0, 0, 0, 44, 207, 0, 0, 51, - /* 2340 */ 424, 489, 0, 51, 492, 0, 0, 0, 496, 497, - /* 2350 */ 498, 499, 500, 501, 36, 503, 54, 381, 442, 44, - /* 2360 */ 444, 0, 36, 54, 44, 76, 0, 36, 54, 44, - /* 2370 */ 0, 36, 396, 54, 44, 489, 0, 0, 492, 381, - /* 2380 */ 121, 123, 496, 497, 498, 499, 500, 501, 0, 503, - /* 2390 */ 0, 0, 381, 0, 396, 22, 36, 0, 36, 36, - /* 2400 */ 424, 22, 33, 36, 36, 489, 22, 396, 492, 0, - /* 2410 */ 36, 36, 496, 497, 498, 499, 500, 501, 442, 503, - /* 2420 */ 444, 36, 424, 36, 22, 36, 0, 33, 36, 22, - /* 2430 */ 0, 36, 36, 22, 56, 424, 0, 22, 0, 36, - /* 2440 */ 442, 381, 444, 0, 0, 0, 36, 0, 36, 36, - /* 2450 */ 0, 22, 20, 442, 36, 444, 396, 116, 36, 36, - /* 2460 */ 0, 193, 0, 115, 115, 489, 0, 51, 492, 36, - /* 2470 */ 22, 22, 496, 497, 498, 499, 500, 501, 228, 503, - /* 2480 */ 219, 229, 0, 223, 424, 0, 3, 489, 193, 193, - /* 2490 */ 492, 193, 193, 199, 496, 497, 498, 499, 500, 501, - /* 2500 */ 489, 503, 442, 492, 444, 33, 203, 496, 497, 498, - /* 2510 */ 499, 500, 501, 115, 503, 203, 116, 116, 51, 381, - /* 2520 */ 115, 115, 36, 36, 116, 52, 304, 113, 52, 33, - /* 2530 */ 111, 33, 33, 116, 396, 115, 33, 82, 381, 115, - /* 2540 */ 115, 51, 33, 116, 116, 3, 115, 36, 33, 489, - /* 2550 */ 115, 51, 492, 396, 36, 116, 496, 497, 498, 499, - /* 2560 */ 500, 501, 424, 503, 36, 36, 36, 116, 381, 36, - /* 2570 */ 304, 304, 36, 116, 116, 51, 33, 0, 0, 115, - /* 2580 */ 442, 424, 444, 396, 44, 116, 116, 0, 288, 115, - /* 2590 */ 115, 44, 115, 0, 116, 196, 115, 44, 33, 442, - /* 2600 */ 381, 444, 113, 275, 200, 113, 2, 22, 252, 116, - /* 2610 */ 116, 424, 115, 51, 51, 396, 115, 115, 22, 255, - /* 2620 */ 115, 115, 0, 116, 116, 115, 51, 489, 115, 442, - /* 2630 */ 492, 444, 115, 196, 496, 497, 498, 499, 500, 501, - /* 2640 */ 115, 503, 116, 424, 44, 124, 489, 195, 22, 492, - /* 2650 */ 115, 381, 196, 496, 497, 498, 499, 500, 501, 115, - /* 2660 */ 503, 442, 116, 444, 126, 115, 396, 115, 22, 115, - /* 2670 */ 115, 115, 22, 125, 22, 229, 489, 116, 381, 492, - /* 2680 */ 36, 36, 115, 496, 497, 498, 499, 500, 501, 116, - /* 2690 */ 503, 36, 116, 396, 424, 115, 36, 116, 36, 116, - /* 2700 */ 36, 36, 116, 137, 115, 137, 137, 137, 489, 33, - /* 2710 */ 115, 492, 442, 36, 444, 496, 497, 498, 499, 500, - /* 2720 */ 501, 424, 503, 115, 22, 76, 75, 22, 36, 36, - /* 2730 */ 36, 36, 36, 36, 36, 36, 36, 36, 82, 442, - /* 2740 */ 381, 444, 36, 109, 109, 82, 33, 36, 36, 22, - /* 2750 */ 36, 36, 36, 36, 82, 396, 36, 36, 36, 489, - /* 2760 */ 36, 381, 492, 22, 36, 36, 496, 497, 498, 499, - /* 2770 */ 500, 501, 0, 503, 36, 44, 396, 54, 0, 36, - /* 2780 */ 54, 44, 0, 424, 36, 0, 489, 54, 44, 492, - /* 2790 */ 36, 44, 0, 496, 497, 498, 499, 500, 501, 54, - /* 2800 */ 503, 442, 381, 444, 424, 36, 0, 36, 22, 0, - /* 2810 */ 22, 36, 33, 36, 20, 22, 21, 396, 22, 22, - /* 2820 */ 21, 559, 442, 381, 444, 559, 559, 559, 559, 559, - /* 2830 */ 559, 559, 559, 559, 559, 559, 559, 559, 396, 559, - /* 2840 */ 559, 559, 559, 559, 559, 424, 559, 559, 489, 559, - /* 2850 */ 559, 492, 559, 559, 559, 496, 497, 498, 499, 500, - /* 2860 */ 501, 559, 503, 442, 559, 444, 424, 559, 559, 489, - /* 2870 */ 559, 559, 492, 559, 559, 559, 496, 497, 498, 499, - /* 2880 */ 500, 501, 559, 503, 442, 381, 444, 559, 559, 559, - /* 2890 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 2900 */ 396, 381, 559, 559, 559, 559, 559, 559, 559, 559, - /* 2910 */ 489, 559, 559, 492, 559, 559, 396, 496, 497, 498, - /* 2920 */ 499, 500, 501, 559, 503, 559, 559, 559, 424, 559, - /* 2930 */ 559, 489, 559, 559, 492, 559, 559, 559, 496, 497, - /* 2940 */ 498, 499, 500, 501, 424, 503, 442, 559, 444, 559, - /* 2950 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 2960 */ 559, 559, 442, 381, 444, 559, 559, 559, 559, 559, - /* 2970 */ 559, 559, 559, 559, 559, 559, 559, 559, 396, 559, - /* 2980 */ 559, 559, 381, 559, 559, 559, 559, 559, 559, 559, - /* 2990 */ 559, 559, 559, 489, 559, 559, 492, 396, 559, 559, - /* 3000 */ 496, 497, 498, 499, 500, 501, 424, 503, 559, 489, - /* 3010 */ 559, 559, 492, 559, 559, 559, 496, 497, 498, 499, - /* 3020 */ 500, 501, 559, 503, 442, 424, 444, 559, 559, 559, - /* 3030 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3040 */ 559, 559, 559, 442, 559, 444, 559, 559, 559, 559, - /* 3050 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3060 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3070 */ 559, 489, 559, 559, 492, 559, 559, 559, 496, 497, - /* 3080 */ 498, 499, 500, 501, 559, 503, 559, 559, 559, 559, - /* 3090 */ 489, 559, 559, 492, 559, 559, 559, 496, 497, 498, - /* 3100 */ 499, 500, 501, 559, 503, 559, 559, 559, 559, 559, - /* 3110 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3120 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3130 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3140 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3150 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3160 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3170 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3180 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, - /* 3190 */ 559, 559, 559, 559, 559, 559, 559, 559, 559, 378, - /* 3200 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3210 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3220 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3230 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3240 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 1120 */ 82, 116, 172, 173, 174, 175, 176, 177, 178, 179, + /* 1130 */ 425, 181, 182, 183, 381, 49, 50, 187, 188, 189, + /* 1140 */ 193, 400, 401, 425, 194, 126, 441, 33, 443, 505, + /* 1150 */ 112, 204, 508, 435, 77, 78, 79, 80, 81, 116, + /* 1160 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + /* 1170 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + /* 1180 */ 103, 104, 105, 106, 107, 108, 20, 12, 13, 395, + /* 1190 */ 396, 381, 20, 488, 441, 381, 491, 22, 381, 180, + /* 1200 */ 495, 496, 497, 498, 499, 500, 396, 502, 398, 415, + /* 1210 */ 4, 36, 507, 38, 509, 381, 2, 381, 513, 514, + /* 1220 */ 381, 381, 8, 9, 381, 19, 12, 13, 14, 15, + /* 1230 */ 16, 22, 395, 396, 193, 425, 396, 186, 398, 395, + /* 1240 */ 396, 0, 381, 68, 38, 36, 395, 396, 20, 0, + /* 1250 */ 22, 441, 415, 443, 216, 441, 218, 82, 441, 415, + /* 1260 */ 54, 34, 381, 41, 42, 425, 415, 61, 62, 395, + /* 1270 */ 396, 220, 395, 396, 68, 441, 68, 441, 409, 410, + /* 1280 */ 441, 441, 301, 443, 441, 381, 58, 112, 425, 415, + /* 1290 */ 252, 253, 415, 409, 410, 254, 425, 381, 488, 436, + /* 1300 */ 494, 491, 441, 384, 385, 495, 496, 497, 498, 499, + /* 1310 */ 500, 33, 502, 381, 421, 444, 33, 507, 381, 509, + /* 1320 */ 114, 112, 441, 513, 514, 119, 520, 119, 488, 381, + /* 1330 */ 381, 491, 467, 13, 33, 495, 496, 497, 498, 499, + /* 1340 */ 500, 381, 502, 121, 122, 441, 124, 507, 47, 509, + /* 1350 */ 12, 13, 2, 513, 514, 381, 396, 441, 8, 9, + /* 1360 */ 22, 426, 12, 13, 14, 15, 16, 145, 152, 153, + /* 1370 */ 494, 149, 381, 441, 36, 482, 38, 438, 441, 438, + /* 1380 */ 441, 438, 441, 36, 441, 425, 521, 396, 0, 441, + /* 1390 */ 441, 216, 120, 218, 529, 123, 520, 0, 234, 116, + /* 1400 */ 236, 441, 82, 443, 155, 36, 68, 120, 381, 33, + /* 1410 */ 123, 120, 547, 548, 123, 441, 425, 552, 553, 22, + /* 1420 */ 254, 33, 467, 396, 321, 426, 254, 252, 253, 82, + /* 1430 */ 120, 13, 441, 123, 443, 426, 33, 33, 13, 325, + /* 1440 */ 0, 266, 267, 268, 269, 270, 271, 272, 488, 0, + /* 1450 */ 0, 491, 425, 51, 36, 495, 496, 497, 498, 499, + /* 1460 */ 500, 36, 502, 33, 33, 33, 426, 507, 441, 509, + /* 1470 */ 443, 22, 22, 513, 514, 0, 521, 1, 2, 488, + /* 1480 */ 473, 115, 491, 117, 529, 244, 495, 496, 497, 498, + /* 1490 */ 499, 500, 116, 502, 36, 55, 33, 33, 507, 33, + /* 1500 */ 509, 33, 547, 548, 513, 514, 413, 552, 553, 36, + /* 1510 */ 33, 33, 33, 12, 13, 488, 382, 115, 491, 116, + /* 1520 */ 116, 13, 495, 496, 497, 498, 499, 500, 453, 502, + /* 1530 */ 33, 33, 12, 13, 507, 523, 509, 381, 12, 13, + /* 1540 */ 513, 514, 12, 13, 36, 112, 116, 116, 116, 556, + /* 1550 */ 12, 13, 396, 545, 216, 82, 218, 524, 12, 13, + /* 1560 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + /* 1570 */ 538, 138, 139, 140, 141, 142, 143, 144, 1, 116, + /* 1580 */ 116, 425, 116, 36, 116, 12, 13, 218, 250, 251, + /* 1590 */ 252, 12, 13, 116, 116, 116, 19, 441, 33, 443, + /* 1600 */ 33, 323, 12, 13, 266, 267, 268, 269, 270, 271, + /* 1610 */ 272, 13, 467, 116, 116, 38, 12, 13, 381, 33, + /* 1620 */ 145, 146, 147, 148, 149, 150, 151, 12, 13, 82, + /* 1630 */ 53, 54, 467, 396, 36, 399, 33, 425, 412, 394, + /* 1640 */ 63, 64, 65, 66, 488, 68, 33, 491, 453, 544, + /* 1650 */ 412, 495, 496, 497, 498, 499, 500, 33, 502, 544, + /* 1660 */ 544, 544, 425, 466, 453, 509, 521, 399, 467, 513, + /* 1670 */ 514, 489, 396, 440, 529, 528, 218, 474, 441, 528, + /* 1680 */ 443, 116, 453, 116, 453, 549, 521, 453, 515, 531, + /* 1690 */ 54, 114, 547, 548, 529, 414, 119, 552, 553, 381, + /* 1700 */ 8, 9, 116, 302, 12, 13, 14, 15, 16, 490, + /* 1710 */ 468, 20, 547, 548, 396, 20, 395, 552, 553, 116, + /* 1720 */ 233, 404, 521, 381, 484, 488, 479, 150, 491, 116, + /* 1730 */ 529, 479, 495, 496, 497, 498, 499, 500, 396, 502, + /* 1740 */ 116, 404, 381, 425, 470, 214, 509, 395, 547, 548, + /* 1750 */ 513, 514, 20, 552, 553, 396, 47, 396, 450, 441, + /* 1760 */ 396, 443, 450, 447, 190, 395, 395, 425, 396, 450, + /* 1770 */ 447, 447, 195, 447, 197, 113, 408, 200, 111, 395, + /* 1780 */ 407, 395, 205, 441, 110, 443, 425, 406, 395, 395, + /* 1790 */ 395, 20, 52, 388, 479, 388, 404, 20, 392, 443, + /* 1800 */ 392, 224, 441, 404, 443, 20, 488, 397, 20, 491, + /* 1810 */ 381, 397, 469, 495, 496, 497, 498, 499, 500, 404, + /* 1820 */ 502, 404, 20, 404, 404, 396, 20, 509, 404, 454, + /* 1830 */ 488, 513, 514, 491, 460, 388, 395, 495, 496, 497, + /* 1840 */ 498, 499, 500, 501, 502, 503, 504, 404, 404, 488, + /* 1850 */ 381, 425, 491, 425, 425, 395, 495, 496, 497, 498, + /* 1860 */ 499, 500, 425, 502, 425, 396, 384, 425, 384, 388, + /* 1870 */ 441, 425, 443, 425, 237, 381, 425, 425, 425, 425, + /* 1880 */ 115, 483, 402, 20, 221, 193, 441, 222, 479, 468, + /* 1890 */ 396, 478, 481, 402, 425, 395, 441, 441, 476, 310, + /* 1900 */ 443, 309, 475, 542, 543, 318, 441, 540, 207, 303, + /* 1910 */ 441, 320, 443, 319, 537, 537, 537, 488, 381, 425, + /* 1920 */ 491, 539, 461, 461, 495, 496, 497, 498, 499, 500, + /* 1930 */ 298, 502, 536, 396, 534, 441, 297, 443, 468, 327, + /* 1940 */ 557, 324, 551, 527, 381, 322, 396, 535, 126, 526, + /* 1950 */ 20, 300, 397, 402, 402, 441, 461, 488, 441, 396, + /* 1960 */ 491, 494, 425, 441, 495, 496, 497, 498, 499, 500, + /* 1970 */ 532, 502, 461, 441, 441, 199, 458, 402, 441, 454, + /* 1980 */ 443, 441, 488, 554, 555, 491, 381, 402, 425, 495, + /* 1990 */ 496, 497, 498, 499, 500, 115, 502, 512, 441, 199, + /* 2000 */ 455, 396, 465, 509, 441, 421, 443, 454, 514, 550, + /* 2010 */ 402, 402, 543, 530, 396, 115, 395, 441, 22, 441, + /* 2020 */ 35, 441, 441, 381, 441, 488, 430, 383, 491, 441, + /* 2030 */ 425, 402, 495, 496, 497, 498, 499, 500, 396, 502, + /* 2040 */ 441, 441, 441, 441, 386, 37, 441, 387, 443, 40, + /* 2050 */ 389, 488, 441, 471, 491, 441, 388, 441, 495, 496, + /* 2060 */ 497, 498, 499, 500, 379, 502, 441, 425, 441, 441, + /* 2070 */ 465, 441, 441, 427, 441, 441, 441, 480, 403, 441, + /* 2080 */ 487, 441, 462, 441, 462, 443, 427, 418, 418, 418, + /* 2090 */ 0, 0, 0, 488, 47, 0, 491, 36, 243, 36, + /* 2100 */ 495, 496, 497, 498, 499, 500, 36, 502, 36, 546, + /* 2110 */ 381, 243, 0, 36, 36, 243, 36, 0, 0, 243, + /* 2120 */ 0, 36, 0, 36, 0, 396, 22, 0, 238, 36, + /* 2130 */ 488, 0, 381, 491, 224, 0, 224, 495, 496, 497, + /* 2140 */ 498, 499, 500, 225, 502, 218, 0, 396, 216, 0, + /* 2150 */ 0, 212, 211, 0, 425, 0, 158, 51, 51, 381, + /* 2160 */ 0, 36, 0, 0, 36, 54, 0, 51, 0, 0, + /* 2170 */ 441, 0, 443, 47, 396, 0, 425, 0, 0, 0, + /* 2180 */ 51, 0, 0, 0, 36, 0, 176, 176, 0, 0, + /* 2190 */ 0, 0, 441, 0, 443, 0, 381, 555, 0, 0, + /* 2200 */ 0, 0, 0, 425, 0, 0, 0, 0, 0, 0, + /* 2210 */ 0, 396, 0, 0, 0, 51, 465, 488, 0, 441, + /* 2220 */ 491, 443, 0, 381, 495, 496, 497, 498, 499, 500, + /* 2230 */ 0, 502, 0, 504, 47, 0, 0, 0, 396, 488, + /* 2240 */ 425, 0, 491, 465, 0, 381, 495, 496, 497, 498, + /* 2250 */ 499, 500, 0, 502, 158, 22, 441, 0, 443, 157, + /* 2260 */ 396, 0, 0, 0, 156, 22, 488, 425, 52, 491, + /* 2270 */ 22, 52, 381, 495, 496, 497, 498, 499, 500, 0, + /* 2280 */ 502, 0, 0, 441, 0, 443, 36, 396, 68, 425, + /* 2290 */ 0, 68, 68, 68, 0, 36, 54, 44, 0, 54, + /* 2300 */ 36, 0, 44, 488, 36, 441, 491, 443, 54, 381, + /* 2310 */ 495, 496, 497, 498, 499, 500, 425, 502, 44, 0, + /* 2320 */ 0, 36, 47, 51, 396, 33, 14, 44, 51, 51, + /* 2330 */ 488, 0, 441, 491, 443, 0, 45, 495, 496, 497, + /* 2340 */ 498, 499, 500, 44, 502, 0, 0, 0, 44, 207, + /* 2350 */ 381, 51, 488, 425, 0, 491, 0, 51, 0, 495, + /* 2360 */ 496, 497, 498, 499, 500, 396, 502, 0, 0, 441, + /* 2370 */ 0, 443, 76, 36, 44, 54, 0, 36, 54, 488, + /* 2380 */ 44, 0, 491, 54, 36, 381, 495, 496, 497, 498, + /* 2390 */ 499, 500, 0, 502, 425, 36, 44, 54, 0, 44, + /* 2400 */ 396, 0, 0, 0, 0, 0, 22, 36, 0, 22, + /* 2410 */ 441, 36, 443, 125, 36, 36, 488, 381, 123, 491, + /* 2420 */ 0, 36, 36, 495, 496, 497, 498, 499, 500, 425, + /* 2430 */ 502, 36, 396, 36, 0, 36, 381, 22, 22, 22, + /* 2440 */ 33, 0, 36, 33, 22, 441, 56, 443, 36, 36, + /* 2450 */ 36, 396, 0, 22, 0, 36, 0, 488, 0, 36, + /* 2460 */ 491, 425, 0, 36, 495, 496, 497, 498, 499, 500, + /* 2470 */ 0, 502, 36, 0, 36, 22, 36, 441, 36, 443, + /* 2480 */ 425, 20, 381, 0, 229, 116, 193, 115, 228, 115, + /* 2490 */ 223, 0, 488, 36, 51, 491, 441, 396, 443, 495, + /* 2500 */ 496, 497, 498, 499, 500, 0, 502, 193, 22, 22, + /* 2510 */ 193, 0, 199, 0, 381, 193, 219, 3, 203, 193, + /* 2520 */ 36, 203, 33, 52, 488, 116, 425, 491, 36, 396, + /* 2530 */ 304, 495, 496, 497, 498, 499, 500, 116, 502, 115, + /* 2540 */ 115, 115, 441, 488, 443, 113, 491, 52, 51, 116, + /* 2550 */ 495, 496, 497, 498, 499, 500, 111, 502, 425, 33, + /* 2560 */ 33, 33, 116, 115, 115, 115, 33, 116, 51, 304, + /* 2570 */ 115, 33, 82, 36, 441, 116, 443, 3, 381, 115, + /* 2580 */ 33, 116, 116, 116, 304, 36, 36, 36, 36, 488, + /* 2590 */ 36, 36, 491, 396, 116, 51, 495, 496, 497, 498, + /* 2600 */ 499, 500, 381, 502, 288, 33, 0, 51, 0, 115, + /* 2610 */ 44, 0, 116, 44, 116, 115, 115, 396, 115, 0, + /* 2620 */ 116, 488, 425, 115, 491, 196, 196, 381, 495, 496, + /* 2630 */ 497, 498, 499, 500, 44, 502, 33, 113, 441, 200, + /* 2640 */ 443, 275, 396, 113, 2, 22, 425, 116, 252, 51, + /* 2650 */ 116, 115, 51, 22, 115, 195, 115, 115, 115, 0, + /* 2660 */ 44, 116, 441, 115, 443, 196, 255, 381, 115, 0, + /* 2670 */ 22, 425, 51, 116, 115, 115, 118, 116, 115, 115, + /* 2680 */ 115, 36, 396, 115, 117, 488, 115, 441, 491, 443, + /* 2690 */ 115, 381, 495, 496, 497, 498, 499, 500, 116, 502, + /* 2700 */ 115, 22, 126, 22, 229, 22, 396, 116, 36, 488, + /* 2710 */ 115, 425, 491, 116, 36, 115, 495, 496, 497, 498, + /* 2720 */ 499, 500, 36, 502, 36, 116, 116, 441, 116, 443, + /* 2730 */ 36, 116, 381, 36, 488, 425, 137, 491, 33, 137, + /* 2740 */ 115, 495, 496, 497, 498, 499, 500, 396, 502, 115, + /* 2750 */ 137, 441, 36, 443, 137, 115, 22, 22, 76, 75, + /* 2760 */ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + /* 2770 */ 109, 82, 381, 36, 488, 82, 425, 491, 33, 109, + /* 2780 */ 36, 495, 496, 497, 498, 499, 500, 396, 502, 36, + /* 2790 */ 36, 22, 441, 36, 443, 36, 36, 82, 488, 381, + /* 2800 */ 36, 491, 36, 36, 36, 495, 496, 497, 498, 499, + /* 2810 */ 500, 36, 502, 22, 396, 36, 425, 0, 381, 36, + /* 2820 */ 44, 0, 36, 0, 54, 54, 44, 54, 36, 44, + /* 2830 */ 0, 36, 441, 396, 443, 54, 0, 44, 36, 488, + /* 2840 */ 0, 22, 491, 425, 36, 0, 495, 496, 497, 498, + /* 2850 */ 499, 500, 36, 502, 22, 33, 36, 22, 21, 441, + /* 2860 */ 22, 443, 425, 22, 21, 558, 20, 558, 558, 558, + /* 2870 */ 558, 558, 558, 558, 558, 558, 558, 558, 441, 488, + /* 2880 */ 443, 558, 491, 381, 558, 558, 495, 496, 497, 498, + /* 2890 */ 499, 500, 558, 502, 558, 558, 381, 558, 396, 558, + /* 2900 */ 558, 558, 558, 558, 558, 558, 488, 558, 558, 491, + /* 2910 */ 558, 396, 558, 495, 496, 497, 498, 499, 500, 558, + /* 2920 */ 502, 558, 558, 558, 558, 488, 558, 425, 491, 558, + /* 2930 */ 558, 558, 495, 496, 497, 498, 499, 500, 558, 502, + /* 2940 */ 425, 558, 558, 441, 558, 443, 558, 558, 558, 558, + /* 2950 */ 558, 558, 558, 558, 558, 558, 441, 558, 443, 558, + /* 2960 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 2970 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 2980 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 2990 */ 488, 558, 558, 491, 558, 558, 558, 495, 496, 497, + /* 3000 */ 498, 499, 500, 488, 502, 558, 491, 558, 558, 558, + /* 3010 */ 495, 496, 497, 498, 499, 500, 558, 502, 558, 558, + /* 3020 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3030 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3040 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3050 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3060 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3070 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3080 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3090 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3100 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3110 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3120 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3130 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3140 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3150 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3160 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3170 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3180 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3190 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3200 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3210 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3220 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3230 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3240 */ 558, 558, 558, 558, 558, 378, 378, 378, 378, 378, /* 3250 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, /* 3260 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, /* 3270 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, @@ -1254,264 +1245,255 @@ static const YYCODETYPE yy_lookahead[] = { /* 3360 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, /* 3370 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, /* 3380 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3390 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3400 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3410 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3420 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3430 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3440 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3450 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3460 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3470 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3480 */ 378, 378, 378, + /* 3390 */ 378, 378, 378, 378, 378, 378, }; -#define YY_SHIFT_COUNT (977) +#define YY_SHIFT_COUNT (978) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2809) +#define YY_SHIFT_MAX (2846) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 347, 0, 83, 0, 346, 346, 346, 346, 346, 346, /* 10 */ 346, 346, 346, 346, 346, 346, 429, 691, 691, 774, /* 20 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, /* 30 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, /* 40 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, - /* 50 */ 116, 465, 1050, 88, 140, 385, 140, 140, 88, 88, - /* 60 */ 140, 1186, 140, 950, 1186, 79, 140, 51, 1310, 341, - /* 70 */ 341, 102, 102, 87, 1310, 1310, 702, 702, 341, 5, - /* 80 */ 5, 435, 220, 220, 61, 186, 102, 102, 102, 102, - /* 90 */ 102, 102, 102, 102, 102, 102, 102, 340, 449, 543, - /* 100 */ 102, 102, 496, 51, 102, 340, 102, 51, 102, 102, - /* 110 */ 102, 102, 51, 102, 102, 102, 51, 102, 51, 51, - /* 120 */ 51, 39, 39, 524, 524, 603, 1074, 236, 648, 687, - /* 130 */ 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, - /* 140 */ 687, 687, 687, 687, 687, 687, 687, 687, 21, 53, - /* 150 */ 5, 435, 1135, 1135, 497, 694, 694, 694, 450, 450, - /* 160 */ 374, 903, 497, 496, 51, 624, 51, 51, 535, 51, - /* 170 */ 51, 711, 51, 711, 711, 693, 982, 524, 524, 524, - /* 180 */ 524, 524, 524, 1440, 302, 406, 1040, 606, 606, 1005, - /* 190 */ 192, 244, 273, 612, 428, 751, 958, 29, 29, 829, - /* 200 */ 343, 1084, 1084, 1084, 963, 1084, 949, 969, 613, 927, - /* 210 */ 1429, 567, 1224, 1212, 1212, 1260, 1189, 1189, 1102, 890, - /* 220 */ 640, 1212, 903, 1456, 1705, 1744, 1746, 1535, 496, 1746, - /* 230 */ 496, 1565, 1744, 1763, 1743, 1763, 1743, 1617, 1744, 1763, - /* 240 */ 1744, 1743, 1617, 1617, 1617, 1704, 1709, 1744, 1744, 1714, - /* 250 */ 1744, 1744, 1744, 1818, 1791, 1818, 1791, 1746, 496, 496, - /* 260 */ 1825, 496, 1836, 1838, 496, 1836, 496, 1841, 496, 1842, - /* 270 */ 496, 496, 1744, 496, 1818, 51, 51, 51, 51, 51, - /* 280 */ 51, 51, 51, 51, 51, 51, 1744, 982, 982, 1818, - /* 290 */ 711, 711, 711, 1645, 1782, 1746, 87, 1889, 1694, 1697, - /* 300 */ 1825, 87, 1456, 1744, 711, 1610, 1612, 1610, 1612, 1613, - /* 310 */ 1721, 1610, 1609, 1622, 1642, 1456, 1648, 1653, 1625, 1635, - /* 320 */ 1631, 1763, 1945, 1851, 1678, 1836, 87, 87, 1612, 711, - /* 330 */ 711, 711, 711, 1612, 711, 1787, 87, 711, 1842, 87, - /* 340 */ 1883, 711, 1805, 1842, 87, 693, 87, 1763, 711, 711, - /* 350 */ 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, - /* 360 */ 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, - /* 370 */ 1891, 711, 1744, 87, 1986, 2005, 2014, 2012, 1818, 3105, - /* 380 */ 3105, 3105, 3105, 3105, 3105, 3105, 3105, 3105, 3105, 3105, - /* 390 */ 3105, 993, 1737, 490, 736, 1483, 769, 858, 85, 846, - /* 400 */ 1349, 492, 851, 1053, 1053, 1053, 1053, 1053, 1053, 1053, - /* 410 */ 1053, 1053, 478, 49, 1109, 15, 210, 210, 517, 593, - /* 420 */ 591, 225, 607, 607, 1022, 1118, 607, 304, 734, 1154, - /* 430 */ 308, 840, 840, 1088, 1268, 651, 1088, 1088, 1088, 1383, - /* 440 */ 904, 13, 1473, 1300, 107, 1345, 1450, 1293, 1392, 1397, - /* 450 */ 1401, 795, 1488, 1489, 1523, 1544, 1549, 1563, 1241, 1443, - /* 460 */ 1457, 1256, 1476, 1487, 1500, 1525, 1403, 453, 1263, 1539, - /* 470 */ 1562, 1564, 1604, 1574, 1446, 1579, 1095, 1586, 1596, 1598, - /* 480 */ 1600, 1603, 1605, 1611, 1626, 1634, 1644, 1647, 1650, 1661, - /* 490 */ 1663, 1669, 1673, 1618, 1654, 1660, 1666, 1668, 1670, 1472, - /* 500 */ 1027, 1382, 1511, 1681, 1713, 1606, 1696, 2085, 2086, 2087, - /* 510 */ 2041, 2092, 2058, 1853, 2061, 2062, 2063, 1857, 2101, 2067, - /* 520 */ 2068, 1862, 2070, 2107, 2108, 1867, 2112, 2077, 2114, 2079, - /* 530 */ 2116, 2097, 2120, 2088, 1884, 2123, 1907, 2133, 1910, 1911, - /* 540 */ 1920, 1923, 2140, 2141, 2142, 1932, 1934, 2146, 2147, 1990, - /* 550 */ 2098, 2099, 2151, 2117, 2152, 2154, 2119, 2103, 2160, 2110, - /* 560 */ 2162, 2122, 2171, 2172, 2173, 2124, 2174, 2177, 2178, 2179, - /* 570 */ 2180, 2181, 2007, 2159, 2197, 2024, 2201, 2202, 2205, 2207, - /* 580 */ 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, - /* 590 */ 2224, 2225, 2226, 2229, 2230, 2231, 2136, 2188, 2175, 2232, - /* 600 */ 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2198, 2221, - /* 610 */ 2084, 2243, 2093, 2244, 2096, 2249, 2253, 2233, 2167, 2246, - /* 620 */ 2204, 2257, 2203, 2272, 2206, 2242, 2273, 2218, 2275, 2220, - /* 630 */ 2277, 2279, 2245, 2251, 2247, 2280, 2248, 2254, 2263, 2283, - /* 640 */ 2262, 2255, 2269, 2285, 2281, 2287, 2223, 2271, 2256, 2265, - /* 650 */ 2276, 2310, 2278, 2290, 2286, 2282, 2293, 2332, 2333, 2334, - /* 660 */ 2291, 2129, 2337, 2265, 2288, 2338, 2265, 2292, 2342, 2345, - /* 670 */ 2289, 2346, 2347, 2318, 2302, 2315, 2361, 2326, 2309, 2320, - /* 680 */ 2366, 2331, 2314, 2325, 2370, 2335, 2319, 2330, 2376, 2377, - /* 690 */ 2388, 2390, 2391, 2393, 2258, 2259, 2360, 2373, 2397, 2379, - /* 700 */ 2362, 2363, 2367, 2368, 2374, 2375, 2385, 2387, 2389, 2369, - /* 710 */ 2394, 2392, 2395, 2384, 2396, 2409, 2402, 2426, 2407, 2430, - /* 720 */ 2411, 2378, 2436, 2415, 2403, 2438, 2443, 2444, 2410, 2445, - /* 730 */ 2412, 2447, 2413, 2450, 2429, 2432, 2418, 2422, 2423, 2341, - /* 740 */ 2348, 2460, 2268, 2252, 2250, 2349, 2260, 2265, 2416, 2462, - /* 750 */ 2295, 2433, 2448, 2466, 2261, 2449, 2296, 2294, 2482, 2485, - /* 760 */ 2298, 2303, 2299, 2312, 2483, 2472, 2222, 2398, 2400, 2405, - /* 770 */ 2401, 2486, 2487, 2406, 2473, 2414, 2476, 2419, 2408, 2496, - /* 780 */ 2498, 2417, 2420, 2424, 2425, 2427, 2499, 2467, 2490, 2431, - /* 790 */ 2503, 2266, 2455, 2428, 2509, 2435, 2511, 2439, 2451, 2542, - /* 800 */ 2515, 2267, 2518, 2528, 2529, 2530, 2533, 2536, 2457, 2458, - /* 810 */ 2500, 2300, 2543, 2524, 2577, 2578, 2464, 2540, 2469, 2470, - /* 820 */ 2474, 2475, 2399, 2477, 2587, 2547, 2404, 2593, 2478, 2481, - /* 830 */ 2437, 2553, 2452, 2565, 2489, 2328, 2492, 2604, 2585, 2356, - /* 840 */ 2493, 2494, 2497, 2501, 2502, 2505, 2506, 2507, 2562, 2510, - /* 850 */ 2513, 2563, 2508, 2596, 2364, 2517, 2525, 2622, 2526, 2535, - /* 860 */ 2456, 2600, 2544, 2521, 2626, 2538, 2550, 2265, 2575, 2552, - /* 870 */ 2554, 2546, 2555, 2556, 2548, 2646, 2650, 2652, 2446, 2561, - /* 880 */ 2644, 2645, 2567, 2573, 2655, 2580, 2576, 2660, 2497, 2581, - /* 890 */ 2662, 2501, 2583, 2664, 2502, 2586, 2665, 2505, 2566, 2568, - /* 900 */ 2569, 2570, 2589, 2676, 2595, 2677, 2608, 2676, 2676, 2702, - /* 910 */ 2649, 2651, 2705, 2692, 2693, 2694, 2695, 2696, 2697, 2698, - /* 920 */ 2699, 2700, 2701, 2706, 2656, 2634, 2663, 2635, 2713, 2711, - /* 930 */ 2712, 2714, 2727, 2715, 2716, 2717, 2672, 2369, 2720, 2394, - /* 940 */ 2721, 2722, 2724, 2728, 2741, 2729, 2772, 2738, 2723, 2731, - /* 950 */ 2778, 2743, 2726, 2737, 2782, 2748, 2733, 2744, 2785, 2754, - /* 960 */ 2745, 2747, 2792, 2769, 2806, 2786, 2771, 2809, 2788, 2779, - /* 970 */ 2775, 2777, 2793, 2795, 2796, 2797, 2799, 2794, + /* 50 */ 102, 116, 534, 212, 408, 766, 408, 408, 212, 212, + /* 60 */ 408, 1175, 408, 950, 1175, 623, 408, 20, 1338, 432, + /* 70 */ 432, 214, 214, 1338, 1338, 459, 459, 432, 437, 437, + /* 80 */ 74, 3, 3, 50, 52, 214, 214, 214, 214, 214, + /* 90 */ 214, 214, 214, 214, 214, 214, 286, 407, 473, 214, + /* 100 */ 214, 37, 20, 214, 286, 214, 20, 214, 214, 214, + /* 110 */ 214, 20, 214, 214, 214, 20, 214, 20, 20, 20, + /* 120 */ 636, 39, 39, 523, 523, 1433, 647, 236, 489, 1038, + /* 130 */ 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, + /* 140 */ 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1222, 743, + /* 150 */ 437, 74, 1035, 1035, 790, 261, 261, 261, 632, 632, + /* 160 */ 496, 461, 790, 37, 20, 613, 20, 20, 483, 20, + /* 170 */ 20, 792, 20, 792, 792, 764, 1227, 523, 523, 523, + /* 180 */ 523, 523, 523, 1577, 302, 405, 563, 348, 348, 763, + /* 190 */ 599, 363, 330, 700, 122, 49, 747, 61, 61, 1086, + /* 200 */ 692, 901, 901, 901, 947, 901, 543, 1041, 1228, 1010, + /* 210 */ 1049, 452, 1051, 1166, 1166, 1172, 1320, 1320, 1103, 820, + /* 220 */ 981, 1166, 461, 1401, 1636, 1691, 1695, 1487, 37, 1695, + /* 230 */ 37, 1531, 1691, 1732, 1709, 1732, 1709, 1574, 1691, 1732, + /* 240 */ 1691, 1709, 1574, 1574, 1574, 1662, 1667, 1691, 1691, 1674, + /* 250 */ 1691, 1691, 1691, 1771, 1740, 1771, 1740, 1695, 37, 37, + /* 260 */ 1777, 37, 1785, 1788, 37, 1785, 37, 1802, 37, 1806, + /* 270 */ 37, 37, 1691, 37, 1771, 20, 20, 20, 20, 20, + /* 280 */ 20, 20, 20, 20, 20, 20, 1691, 1227, 1227, 1771, + /* 290 */ 792, 792, 792, 1637, 1765, 1695, 636, 1863, 1665, 1663, + /* 300 */ 1777, 636, 1401, 1691, 792, 1589, 1592, 1589, 1592, 1587, + /* 310 */ 1701, 1589, 1591, 1594, 1606, 1401, 1632, 1639, 1612, 1617, + /* 320 */ 1623, 1732, 1930, 1822, 1651, 1785, 636, 636, 1592, 792, + /* 330 */ 792, 792, 792, 1592, 792, 1776, 636, 792, 1806, 636, + /* 340 */ 1880, 792, 1800, 1806, 636, 764, 636, 1732, 792, 792, + /* 350 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, + /* 360 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, + /* 370 */ 1900, 792, 1691, 636, 1996, 1985, 2008, 2009, 1771, 3018, + /* 380 */ 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, + /* 390 */ 3018, 1077, 867, 648, 1206, 887, 1005, 1043, 1214, 1350, + /* 400 */ 1692, 934, 1475, 1084, 1084, 1084, 1084, 1084, 1084, 1084, + /* 410 */ 1084, 1084, 183, 512, 220, 693, 702, 702, 4, 616, + /* 420 */ 811, 726, 542, 542, 145, 255, 542, 769, 683, 1209, + /* 430 */ 856, 141, 141, 113, 160, 738, 113, 113, 113, 91, + /* 440 */ 1241, 222, 925, 1301, 1019, 1249, 1388, 1272, 1287, 1291, + /* 450 */ 1310, 1347, 1418, 1425, 558, 1397, 1449, 1450, 1164, 1283, + /* 460 */ 1376, 1208, 1403, 1404, 1430, 1431, 1216, 1278, 1114, 1432, + /* 470 */ 1463, 1464, 1476, 1466, 770, 1468, 1402, 1477, 1478, 1479, + /* 480 */ 1497, 1498, 1501, 1520, 1526, 1530, 1538, 1546, 1573, 1579, + /* 490 */ 1590, 1604, 1615, 1565, 1567, 1586, 1603, 1613, 1624, 1366, + /* 500 */ 1473, 1369, 1458, 1508, 1598, 1547, 1440, 2090, 2091, 2092, + /* 510 */ 2047, 2095, 2061, 1855, 2063, 2070, 2072, 1868, 2112, 2077, + /* 520 */ 2078, 1872, 2080, 2117, 2118, 1876, 2120, 2085, 2122, 2087, + /* 530 */ 2124, 2104, 2127, 2093, 1890, 2131, 1910, 2135, 1912, 1918, + /* 540 */ 1927, 1932, 2146, 2149, 2150, 1939, 1941, 2153, 2155, 1998, + /* 550 */ 2106, 2107, 2160, 2125, 2162, 2163, 2128, 2111, 2166, 2116, + /* 560 */ 2168, 2126, 2169, 2171, 2175, 2129, 2177, 2178, 2179, 2181, + /* 570 */ 2182, 2183, 2010, 2148, 2185, 2011, 2188, 2189, 2190, 2191, + /* 580 */ 2193, 2195, 2198, 2199, 2200, 2201, 2202, 2204, 2205, 2206, + /* 590 */ 2207, 2208, 2209, 2210, 2212, 2213, 2164, 2214, 2187, 2218, + /* 600 */ 2222, 2230, 2232, 2235, 2236, 2237, 2241, 2244, 2233, 2252, + /* 610 */ 2096, 2257, 2102, 2261, 2108, 2262, 2263, 2243, 2216, 2248, + /* 620 */ 2219, 2279, 2220, 2281, 2223, 2250, 2282, 2224, 2284, 2225, + /* 630 */ 2290, 2294, 2259, 2242, 2253, 2298, 2264, 2245, 2258, 2301, + /* 640 */ 2268, 2254, 2274, 2319, 2285, 2320, 2275, 2283, 2292, 2272, + /* 650 */ 2277, 2312, 2278, 2331, 2291, 2299, 2335, 2345, 2346, 2347, + /* 660 */ 2304, 2142, 2354, 2272, 2300, 2356, 2272, 2306, 2358, 2367, + /* 670 */ 2296, 2368, 2370, 2337, 2321, 2330, 2376, 2341, 2324, 2336, + /* 680 */ 2381, 2348, 2329, 2352, 2392, 2359, 2343, 2355, 2398, 2401, + /* 690 */ 2402, 2403, 2404, 2405, 2288, 2295, 2371, 2384, 2408, 2387, + /* 700 */ 2375, 2378, 2379, 2385, 2386, 2395, 2397, 2399, 2406, 2407, + /* 710 */ 2410, 2412, 2413, 2415, 2414, 2420, 2416, 2434, 2417, 2441, + /* 720 */ 2422, 2390, 2452, 2431, 2419, 2454, 2456, 2458, 2423, 2462, + /* 730 */ 2427, 2470, 2436, 2473, 2453, 2461, 2438, 2440, 2442, 2369, + /* 740 */ 2372, 2483, 2293, 2255, 2260, 2374, 2267, 2272, 2443, 2491, + /* 750 */ 2314, 2457, 2486, 2505, 2297, 2487, 2317, 2313, 2511, 2513, + /* 760 */ 2322, 2315, 2326, 2318, 2514, 2489, 2226, 2424, 2409, 2425, + /* 770 */ 2421, 2484, 2492, 2426, 2471, 2432, 2495, 2445, 2433, 2526, + /* 780 */ 2527, 2446, 2448, 2449, 2450, 2451, 2528, 2497, 2517, 2455, + /* 790 */ 2533, 2265, 2490, 2459, 2538, 2464, 2537, 2465, 2466, 2574, + /* 800 */ 2547, 2280, 2549, 2550, 2551, 2552, 2554, 2555, 2467, 2478, + /* 810 */ 2544, 2316, 2572, 2556, 2606, 2608, 2494, 2566, 2496, 2498, + /* 820 */ 2500, 2501, 2429, 2503, 2611, 2569, 2439, 2619, 2504, 2508, + /* 830 */ 2430, 2590, 2460, 2603, 2524, 2366, 2530, 2642, 2623, 2396, + /* 840 */ 2531, 2534, 2536, 2539, 2541, 2542, 2543, 2545, 2598, 2548, + /* 850 */ 2553, 2601, 2557, 2631, 2411, 2559, 2560, 2659, 2561, 2563, + /* 860 */ 2469, 2616, 2564, 2567, 2669, 2648, 2558, 2565, 2272, 2621, + /* 870 */ 2568, 2571, 2582, 2575, 2585, 2576, 2679, 2681, 2683, 2475, + /* 880 */ 2591, 2645, 2672, 2595, 2597, 2678, 2600, 2609, 2686, 2536, + /* 890 */ 2610, 2688, 2539, 2612, 2694, 2541, 2615, 2697, 2542, 2599, + /* 900 */ 2602, 2613, 2617, 2625, 2705, 2634, 2716, 2640, 2705, 2705, + /* 910 */ 2734, 2682, 2684, 2735, 2724, 2725, 2726, 2727, 2728, 2729, + /* 920 */ 2730, 2731, 2732, 2733, 2737, 2689, 2661, 2693, 2670, 2745, + /* 930 */ 2744, 2753, 2754, 2769, 2757, 2759, 2760, 2715, 2407, 2764, + /* 940 */ 2410, 2766, 2767, 2768, 2775, 2791, 2779, 2817, 2783, 2770, + /* 950 */ 2776, 2821, 2786, 2771, 2782, 2823, 2792, 2773, 2785, 2830, + /* 960 */ 2795, 2781, 2793, 2836, 2802, 2840, 2819, 2808, 2845, 2832, + /* 970 */ 2822, 2816, 2820, 2835, 2837, 2838, 2841, 2843, 2846, }; #define YY_REDUCE_COUNT (390) -#define YY_REDUCE_MIN (-514) -#define YY_REDUCE_MAX (2601) +#define YY_REDUCE_MIN (-503) +#define YY_REDUCE_MAX (2515) static const short yy_reduce_ofst[] = { - /* 0 */ -240, -366, -203, -19, 324, 421, 749, 787, 811, 893, - /* 10 */ 932, 971, 1038, 1169, 1208, 1247, -317, 1296, 1329, 1391, - /* 20 */ 1471, 1531, 1558, 1629, 1667, 1693, 1762, 1803, 1822, 1852, - /* 30 */ 1886, 1916, 1976, 1998, 2011, 2060, 2138, 2157, 2187, 2219, - /* 40 */ 2270, 2297, 2359, 2380, 2421, 2442, 2504, 2520, 2582, 2601, - /* 50 */ -311, 23, 327, -363, 666, 1021, 1061, 1072, -191, -147, - /* 60 */ 1100, -383, -514, -232, -375, -504, -66, -41, -426, -441, - /* 70 */ -437, 139, 163, -17, -423, -353, -384, -333, -214, -308, - /* 80 */ 348, -110, -224, -114, -352, 57, 393, 396, 473, 519, - /* 90 */ -206, 434, 614, 740, 746, 782, 441, 34, 189, -31, - /* 100 */ 791, 821, -402, -11, 866, 433, 945, -332, 955, 984, - /* 110 */ 991, 1002, 509, 1030, 1069, 1092, 26, 1116, 765, 381, - /* 120 */ 557, 242, 242, 582, -278, -261, 97, -248, -13, -338, - /* 130 */ 466, 525, 762, 776, 862, 863, 896, 901, 911, 912, - /* 140 */ 935, 939, 946, 974, 978, 985, 994, 1019, -196, -99, - /* 150 */ 122, 581, 650, 825, 818, -99, 312, 319, 423, 550, - /* 160 */ 462, 52, 920, 801, -86, 701, 177, 797, 254, 284, - /* 170 */ 815, 836, 813, 876, 970, 1031, 987, -425, -414, 554, - /* 180 */ 578, 597, 725, 689, 761, 848, 852, 881, 881, 865, - /* 190 */ 986, 1025, 1042, 1185, 881, 1162, 1162, 1196, 1215, 1204, - /* 200 */ 1147, 1089, 1099, 1168, 1248, 1176, 1162, 1270, 1328, 1238, - /* 210 */ 1334, 1290, 1257, 1279, 1281, 1162, 1213, 1223, 1187, 1225, - /* 220 */ 1222, 1301, 1342, 1291, 1272, 1370, 1287, 1284, 1373, 1294, - /* 230 */ 1374, 1309, 1386, 1393, 1347, 1408, 1355, 1360, 1414, 1415, - /* 240 */ 1417, 1359, 1365, 1366, 1368, 1411, 1416, 1427, 1436, 1428, - /* 250 */ 1441, 1442, 1447, 1453, 1452, 1458, 1455, 1369, 1444, 1449, - /* 260 */ 1406, 1451, 1460, 1389, 1459, 1463, 1461, 1405, 1464, 1409, - /* 270 */ 1465, 1466, 1477, 1467, 1485, 1454, 1462, 1469, 1474, 1475, - /* 280 */ 1478, 1479, 1480, 1481, 1484, 1486, 1482, 1490, 1491, 1493, - /* 290 */ 1434, 1437, 1492, 1412, 1418, 1431, 1505, 1435, 1445, 1448, - /* 300 */ 1494, 1515, 1495, 1524, 1498, 1387, 1468, 1388, 1496, 1394, - /* 310 */ 1404, 1395, 1410, 1413, 1421, 1497, 1420, 1424, 1399, 1425, - /* 320 */ 1430, 1566, 1499, 1470, 1502, 1582, 1578, 1581, 1522, 1543, - /* 330 */ 1545, 1546, 1547, 1528, 1550, 1532, 1591, 1553, 1541, 1597, - /* 340 */ 1501, 1559, 1551, 1554, 1614, 1585, 1615, 1616, 1569, 1571, - /* 350 */ 1576, 1577, 1580, 1584, 1593, 1594, 1595, 1599, 1601, 1602, - /* 360 */ 1607, 1620, 1623, 1624, 1627, 1628, 1630, 1633, 1636, 1637, - /* 370 */ 1608, 1638, 1651, 1619, 1656, 1659, 1655, 1671, 1676, 1621, - /* 380 */ 1641, 1588, 1587, 1632, 1639, 1664, 1665, 1658, 1672, 1674, - /* 390 */ 1702, + /* 0 */ -239, -365, -325, -19, -202, 325, 366, 705, 810, 840, + /* 10 */ 960, 991, 1027, 1156, 1237, 1318, 1342, 1361, 1429, 1494, + /* 20 */ 1469, 1537, 1605, 1563, 1642, 1729, 1751, 1778, 1815, 1842, + /* 30 */ 1864, 1891, 1928, 1969, 2004, 2036, 2055, 2101, 2133, 2197, + /* 40 */ 2221, 2246, 2286, 2310, 2351, 2391, 2418, 2437, 2502, 2515, + /* 50 */ -310, -61, -464, -362, 865, 955, 1145, 1165, -297, -271, + /* 60 */ 1201, -412, -503, -384, -382, -82, 13, -393, -385, -436, + /* 70 */ -356, -210, -21, -389, -324, -388, -247, -439, -142, 115, + /* 80 */ 148, -198, -191, -359, 89, 173, 313, 345, 403, 409, + /* 90 */ 435, 433, 440, 454, 578, 492, -337, 387, -10, 445, + /* 100 */ 583, 472, 412, 601, 393, 614, 15, 653, 675, 794, + /* 110 */ 837, 349, 844, 851, 874, 31, 877, 111, 375, 365, + /* 120 */ 565, -501, -501, -66, -111, -223, 595, -100, 120, -231, + /* 130 */ -3, 548, 753, 814, 817, 834, 836, 839, 843, 861, + /* 140 */ 881, 904, 916, 932, 937, 948, 949, 974, -405, 530, + /* 150 */ 87, 372, 704, 741, 869, 530, 806, 876, 434, 499, + /* 160 */ 673, -224, 884, 228, 64, 893, -195, 547, 644, 863, + /* 170 */ 718, 939, 871, 941, 943, -48, 919, -425, -411, 935, + /* 180 */ 999, 1009, 1040, 1007, 1093, 1134, 1075, 1012, 1012, 993, + /* 190 */ 1008, 1032, 1033, 1236, 1012, 1212, 1212, 1226, 1238, 1245, + /* 200 */ 1195, 1105, 1115, 1116, 1197, 1117, 1212, 1211, 1268, 1182, + /* 210 */ 1276, 1233, 1203, 1229, 1231, 1212, 1147, 1151, 1136, 1173, + /* 220 */ 1158, 1234, 1281, 1242, 1219, 1321, 1247, 1240, 1317, 1252, + /* 230 */ 1337, 1274, 1352, 1359, 1308, 1364, 1312, 1316, 1370, 1372, + /* 240 */ 1371, 1319, 1323, 1324, 1326, 1368, 1373, 1384, 1386, 1381, + /* 250 */ 1393, 1394, 1395, 1405, 1406, 1407, 1408, 1315, 1392, 1399, + /* 260 */ 1356, 1415, 1410, 1343, 1417, 1414, 1419, 1374, 1420, 1375, + /* 270 */ 1424, 1443, 1441, 1444, 1447, 1426, 1428, 1437, 1439, 1442, + /* 280 */ 1446, 1448, 1451, 1452, 1453, 1454, 1460, 1482, 1484, 1481, + /* 290 */ 1445, 1455, 1456, 1398, 1411, 1409, 1480, 1413, 1422, 1427, + /* 300 */ 1457, 1491, 1421, 1500, 1465, 1377, 1461, 1378, 1462, 1367, + /* 310 */ 1382, 1379, 1396, 1412, 1400, 1470, 1416, 1423, 1383, 1391, + /* 320 */ 1459, 1550, 1467, 1438, 1483, 1555, 1551, 1552, 1495, 1514, + /* 330 */ 1517, 1522, 1532, 1511, 1533, 1518, 1575, 1540, 1525, 1585, + /* 340 */ 1485, 1557, 1545, 1553, 1608, 1584, 1609, 1618, 1576, 1578, + /* 350 */ 1580, 1581, 1583, 1588, 1599, 1600, 1601, 1602, 1611, 1614, + /* 360 */ 1616, 1625, 1627, 1628, 1630, 1631, 1633, 1634, 1635, 1638, + /* 370 */ 1596, 1640, 1621, 1629, 1644, 1658, 1660, 1661, 1668, 1582, + /* 380 */ 1646, 1593, 1597, 1620, 1622, 1669, 1670, 1659, 1671, 1675, + /* 390 */ 1685, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 10 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 20 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 30 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 40 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 50 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 60 */ 2581, 2205, 2205, 2537, 2205, 2205, 2205, 2205, 2205, 2205, - /* 70 */ 2205, 2205, 2205, 2309, 2205, 2205, 2205, 2205, 2205, 2544, - /* 80 */ 2544, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 90 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 100 */ 2205, 2205, 2311, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 110 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 120 */ 2205, 2833, 2205, 2959, 2622, 2205, 2205, 2862, 2205, 2205, - /* 130 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 140 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2845, - /* 150 */ 2205, 2205, 2282, 2282, 2205, 2845, 2845, 2845, 2805, 2805, - /* 160 */ 2309, 2205, 2205, 2311, 2205, 2624, 2205, 2205, 2205, 2205, - /* 170 */ 2205, 2205, 2205, 2205, 2205, 2453, 2235, 2205, 2205, 2205, - /* 180 */ 2205, 2205, 2205, 2607, 2205, 2205, 2891, 2837, 2838, 2953, - /* 190 */ 2205, 2894, 2856, 2205, 2851, 2205, 2205, 2205, 2205, 2205, - /* 200 */ 2881, 2205, 2205, 2205, 2205, 2205, 2205, 2549, 2205, 2650, - /* 210 */ 2205, 2396, 2601, 2205, 2205, 2205, 2205, 2205, 2937, 2835, - /* 220 */ 2875, 2205, 2205, 2885, 2205, 2205, 2205, 2638, 2311, 2205, - /* 230 */ 2311, 2594, 2532, 2205, 2542, 2205, 2542, 2539, 2205, 2205, - /* 240 */ 2205, 2542, 2539, 2539, 2539, 2385, 2381, 2205, 2205, 2379, - /* 250 */ 2205, 2205, 2205, 2205, 2265, 2205, 2265, 2205, 2311, 2311, - /* 260 */ 2205, 2311, 2205, 2205, 2311, 2205, 2311, 2205, 2311, 2205, - /* 270 */ 2311, 2311, 2205, 2311, 2205, 2205, 2205, 2205, 2205, 2205, - /* 280 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 290 */ 2205, 2205, 2205, 2636, 2617, 2205, 2309, 2205, 2605, 2603, - /* 300 */ 2205, 2309, 2885, 2205, 2205, 2907, 2902, 2907, 2902, 2921, - /* 310 */ 2917, 2907, 2926, 2923, 2887, 2885, 2868, 2864, 2956, 2943, - /* 320 */ 2939, 2205, 2205, 2873, 2871, 2205, 2309, 2309, 2902, 2205, - /* 330 */ 2205, 2205, 2205, 2902, 2205, 2205, 2309, 2205, 2205, 2309, - /* 340 */ 2205, 2205, 2205, 2205, 2309, 2205, 2309, 2205, 2205, 2205, - /* 350 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 360 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 370 */ 2415, 2205, 2205, 2309, 2205, 2237, 2239, 2249, 2205, 2596, - /* 380 */ 2959, 2622, 2627, 2577, 2577, 2456, 2456, 2959, 2456, 2312, - /* 390 */ 2210, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 400 */ 2205, 2205, 2205, 2920, 2919, 2756, 2205, 2809, 2808, 2807, - /* 410 */ 2798, 2755, 2410, 2205, 2205, 2205, 2754, 2753, 2205, 2205, - /* 420 */ 2205, 2205, 2400, 2397, 2205, 2205, 2424, 2205, 2205, 2205, - /* 430 */ 2205, 2568, 2567, 2747, 2205, 2205, 2748, 2746, 2745, 2205, - /* 440 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 450 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 460 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2940, 2944, 2205, - /* 470 */ 2205, 2205, 2834, 2205, 2205, 2205, 2726, 2205, 2205, 2205, - /* 480 */ 2205, 2205, 2694, 2689, 2680, 2671, 2686, 2677, 2665, 2683, - /* 490 */ 2674, 2662, 2659, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 500 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 510 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 520 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 530 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 540 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2538, - /* 550 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 560 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 570 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 580 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 590 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 600 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 610 */ 2205, 2205, 2205, 2205, 2553, 2205, 2205, 2205, 2205, 2205, - /* 620 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 630 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 640 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2254, 2733, - /* 650 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 660 */ 2205, 2205, 2205, 2736, 2205, 2205, 2737, 2205, 2205, 2205, - /* 670 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 680 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 690 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 700 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2356, - /* 710 */ 2355, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 720 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 730 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2738, - /* 740 */ 2205, 2205, 2205, 2205, 2621, 2205, 2205, 2728, 2205, 2205, - /* 750 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 760 */ 2205, 2205, 2205, 2205, 2936, 2888, 2205, 2205, 2205, 2205, - /* 770 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 780 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2726, 2205, - /* 790 */ 2918, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2934, 2205, - /* 800 */ 2938, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2844, 2840, - /* 810 */ 2205, 2205, 2836, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 820 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 830 */ 2205, 2205, 2205, 2795, 2205, 2205, 2205, 2829, 2205, 2205, - /* 840 */ 2205, 2205, 2452, 2451, 2450, 2449, 2205, 2205, 2205, 2205, - /* 850 */ 2205, 2205, 2738, 2205, 2741, 2205, 2205, 2205, 2205, 2205, - /* 860 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2725, 2205, 2780, - /* 870 */ 2779, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 880 */ 2205, 2205, 2446, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 890 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2430, 2428, - /* 900 */ 2427, 2426, 2205, 2463, 2205, 2205, 2205, 2459, 2458, 2205, - /* 910 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 920 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2330, 2205, - /* 930 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2322, 2205, 2321, - /* 940 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 950 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 960 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2234, - /* 970 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, + /* 0 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 10 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 20 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 30 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 40 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 50 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 60 */ 2578, 2203, 2203, 2534, 2203, 2203, 2203, 2203, 2203, 2203, + /* 70 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2541, 2541, + /* 80 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 90 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 100 */ 2203, 2309, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 110 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 120 */ 2307, 2830, 2203, 2956, 2619, 2203, 2203, 2859, 2203, 2203, + /* 130 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 140 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2842, + /* 150 */ 2203, 2203, 2280, 2280, 2203, 2842, 2842, 2842, 2802, 2802, + /* 160 */ 2307, 2203, 2203, 2309, 2203, 2621, 2203, 2203, 2203, 2203, + /* 170 */ 2203, 2203, 2203, 2203, 2203, 2450, 2233, 2203, 2203, 2203, + /* 180 */ 2203, 2203, 2203, 2604, 2203, 2203, 2888, 2834, 2835, 2950, + /* 190 */ 2203, 2891, 2853, 2203, 2848, 2203, 2203, 2203, 2203, 2203, + /* 200 */ 2878, 2203, 2203, 2203, 2203, 2203, 2203, 2546, 2203, 2647, + /* 210 */ 2203, 2395, 2598, 2203, 2203, 2203, 2203, 2203, 2934, 2832, + /* 220 */ 2872, 2203, 2203, 2882, 2203, 2203, 2203, 2635, 2309, 2203, + /* 230 */ 2309, 2591, 2529, 2203, 2539, 2203, 2539, 2536, 2203, 2203, + /* 240 */ 2203, 2539, 2536, 2536, 2536, 2383, 2379, 2203, 2203, 2377, + /* 250 */ 2203, 2203, 2203, 2203, 2263, 2203, 2263, 2203, 2309, 2309, + /* 260 */ 2203, 2309, 2203, 2203, 2309, 2203, 2309, 2203, 2309, 2203, + /* 270 */ 2309, 2309, 2203, 2309, 2203, 2203, 2203, 2203, 2203, 2203, + /* 280 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 290 */ 2203, 2203, 2203, 2633, 2614, 2203, 2307, 2203, 2602, 2600, + /* 300 */ 2203, 2307, 2882, 2203, 2203, 2904, 2899, 2904, 2899, 2918, + /* 310 */ 2914, 2904, 2923, 2920, 2884, 2882, 2865, 2861, 2953, 2940, + /* 320 */ 2936, 2203, 2203, 2870, 2868, 2203, 2307, 2307, 2899, 2203, + /* 330 */ 2203, 2203, 2203, 2899, 2203, 2203, 2307, 2203, 2203, 2307, + /* 340 */ 2203, 2203, 2203, 2203, 2307, 2203, 2307, 2203, 2203, 2203, + /* 350 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 360 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 370 */ 2412, 2203, 2203, 2307, 2203, 2235, 2237, 2247, 2203, 2593, + /* 380 */ 2956, 2619, 2624, 2574, 2574, 2453, 2453, 2956, 2453, 2310, + /* 390 */ 2208, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 400 */ 2203, 2203, 2203, 2917, 2916, 2753, 2203, 2806, 2805, 2804, + /* 410 */ 2795, 2752, 2408, 2203, 2203, 2203, 2751, 2750, 2203, 2203, + /* 420 */ 2203, 2203, 2399, 2396, 2203, 2203, 2421, 2203, 2203, 2203, + /* 430 */ 2203, 2565, 2564, 2744, 2203, 2203, 2745, 2743, 2742, 2203, + /* 440 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 450 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 460 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2937, 2941, 2203, + /* 470 */ 2203, 2203, 2831, 2203, 2203, 2203, 2723, 2203, 2203, 2203, + /* 480 */ 2203, 2203, 2691, 2686, 2677, 2668, 2683, 2674, 2662, 2680, + /* 490 */ 2671, 2659, 2656, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 500 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 510 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 520 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 530 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 540 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2535, + /* 550 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 560 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 570 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 580 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 590 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 600 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 610 */ 2203, 2203, 2203, 2203, 2550, 2203, 2203, 2203, 2203, 2203, + /* 620 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 630 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 640 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2252, 2730, + /* 650 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 660 */ 2203, 2203, 2203, 2733, 2203, 2203, 2734, 2203, 2203, 2203, + /* 670 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 680 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 690 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 700 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2354, + /* 710 */ 2353, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 720 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 730 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2735, + /* 740 */ 2203, 2203, 2203, 2203, 2618, 2203, 2203, 2725, 2203, 2203, + /* 750 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 760 */ 2203, 2203, 2203, 2203, 2933, 2885, 2203, 2203, 2203, 2203, + /* 770 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 780 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2723, 2203, + /* 790 */ 2915, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2931, 2203, + /* 800 */ 2935, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2841, 2837, + /* 810 */ 2203, 2203, 2833, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 820 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 830 */ 2203, 2203, 2203, 2792, 2203, 2203, 2203, 2826, 2203, 2203, + /* 840 */ 2203, 2203, 2449, 2448, 2447, 2446, 2203, 2203, 2203, 2203, + /* 850 */ 2203, 2203, 2735, 2203, 2738, 2203, 2203, 2203, 2203, 2203, + /* 860 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2722, 2203, + /* 870 */ 2777, 2776, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 880 */ 2203, 2203, 2203, 2443, 2203, 2203, 2203, 2203, 2203, 2203, + /* 890 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2427, + /* 900 */ 2425, 2424, 2423, 2203, 2460, 2203, 2203, 2203, 2456, 2455, + /* 910 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 920 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2328, + /* 930 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2320, 2203, + /* 940 */ 2319, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 950 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 960 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 970 */ 2232, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1648,6 +1630,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ + 0, /* USING => nothing */ + 328, /* FILE => ABORT */ 0, /* STABLE => nothing */ 0, /* COLUMN => nothing */ 0, /* MODIFY => nothing */ @@ -1655,9 +1639,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* TAG => nothing */ 0, /* SET => nothing */ 0, /* NK_EQ => nothing */ - 0, /* USING => nothing */ 0, /* TAGS => nothing */ - 328, /* FILE => ABORT */ 0, /* BOOL => nothing */ 0, /* TINYINT => nothing */ 0, /* SMALLINT => nothing */ @@ -2114,16 +2096,16 @@ static const char *const yyTokenName[] = { /* 114 */ "TABLE", /* 115 */ "NK_LP", /* 116 */ "NK_RP", - /* 117 */ "STABLE", - /* 118 */ "COLUMN", - /* 119 */ "MODIFY", - /* 120 */ "RENAME", - /* 121 */ "TAG", - /* 122 */ "SET", - /* 123 */ "NK_EQ", - /* 124 */ "USING", - /* 125 */ "TAGS", - /* 126 */ "FILE", + /* 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", @@ -2417,145 +2399,144 @@ static const char *const yyTokenName[] = { /* 417 */ "tags_def_opt", /* 418 */ "table_options", /* 419 */ "multi_create_clause", - /* 420 */ "tags_def", - /* 421 */ "multi_drop_clause", - /* 422 */ "alter_table_clause", - /* 423 */ "alter_table_options", - /* 424 */ "column_name", - /* 425 */ "type_name", - /* 426 */ "column_options", - /* 427 */ "tags_literal", - /* 428 */ "create_subtable_clause", - /* 429 */ "create_from_file_clause", + /* 420 */ "tag_list_opt", + /* 421 */ "tags_def", + /* 422 */ "multi_drop_clause", + /* 423 */ "alter_table_clause", + /* 424 */ "alter_table_options", + /* 425 */ "column_name", + /* 426 */ "type_name", + /* 427 */ "column_options", + /* 428 */ "tags_literal", + /* 429 */ "create_subtable_clause", /* 430 */ "specific_cols_opt", /* 431 */ "tags_literal_list", - /* 432 */ "tag_list_opt", - /* 433 */ "drop_table_clause", - /* 434 */ "col_name_list", - /* 435 */ "tag_def_list", - /* 436 */ "tag_def", - /* 437 */ "column_def", - /* 438 */ "type_name_default_len", - /* 439 */ "duration_list", - /* 440 */ "rollup_func_list", - /* 441 */ "alter_table_option", - /* 442 */ "duration_literal", - /* 443 */ "rollup_func_name", - /* 444 */ "function_name", - /* 445 */ "col_name", - /* 446 */ "db_kind_opt", - /* 447 */ "table_kind_db_name_cond_opt", - /* 448 */ "like_pattern_opt", - /* 449 */ "db_name_cond_opt", - /* 450 */ "table_name_cond", - /* 451 */ "from_db_opt", - /* 452 */ "table_kind", - /* 453 */ "tag_item", - /* 454 */ "column_alias", - /* 455 */ "tsma_name", - /* 456 */ "tsma_func_list", - /* 457 */ "full_tsma_name", - /* 458 */ "func_list", - /* 459 */ "index_options", - /* 460 */ "full_index_name", - /* 461 */ "index_name", - /* 462 */ "sliding_opt", - /* 463 */ "sma_stream_opt", - /* 464 */ "func", - /* 465 */ "sma_func_name", - /* 466 */ "expression_list", - /* 467 */ "with_meta", - /* 468 */ "query_or_subquery", - /* 469 */ "where_clause_opt", - /* 470 */ "cgroup_name", - /* 471 */ "analyze_opt", - /* 472 */ "explain_options", - /* 473 */ "insert_query", - /* 474 */ "or_replace_opt", - /* 475 */ "agg_func_opt", - /* 476 */ "bufsize_opt", - /* 477 */ "language_opt", - /* 478 */ "full_view_name", - /* 479 */ "view_name", - /* 480 */ "stream_name", - /* 481 */ "stream_options", - /* 482 */ "col_list_opt", - /* 483 */ "tag_def_or_ref_opt", - /* 484 */ "subtable_opt", - /* 485 */ "ignore_opt", - /* 486 */ "column_stream_def_list", - /* 487 */ "column_stream_def", - /* 488 */ "stream_col_options", - /* 489 */ "expression", - /* 490 */ "on_vgroup_id", - /* 491 */ "dnode_list", - /* 492 */ "literal_func", - /* 493 */ "signed_literal", - /* 494 */ "literal_list", - /* 495 */ "table_alias", - /* 496 */ "expr_or_subquery", - /* 497 */ "pseudo_column", - /* 498 */ "column_reference", - /* 499 */ "function_expression", - /* 500 */ "case_when_expression", - /* 501 */ "star_func", - /* 502 */ "star_func_para_list", - /* 503 */ "noarg_func", - /* 504 */ "other_para_list", - /* 505 */ "star_func_para", - /* 506 */ "when_then_list", - /* 507 */ "case_when_else_opt", - /* 508 */ "common_expression", - /* 509 */ "when_then_expr", - /* 510 */ "predicate", - /* 511 */ "compare_op", - /* 512 */ "in_op", - /* 513 */ "in_predicate_value", - /* 514 */ "boolean_value_expression", - /* 515 */ "boolean_primary", - /* 516 */ "from_clause_opt", - /* 517 */ "table_reference_list", - /* 518 */ "table_reference", - /* 519 */ "table_primary", - /* 520 */ "joined_table", - /* 521 */ "alias_opt", - /* 522 */ "subquery", - /* 523 */ "parenthesized_joined_table", - /* 524 */ "join_type", - /* 525 */ "join_subtype", - /* 526 */ "join_on_clause_opt", - /* 527 */ "window_offset_clause_opt", - /* 528 */ "jlimit_clause_opt", - /* 529 */ "window_offset_literal", - /* 530 */ "query_specification", - /* 531 */ "hint_list", - /* 532 */ "set_quantifier_opt", - /* 533 */ "tag_mode_opt", - /* 534 */ "select_list", - /* 535 */ "partition_by_clause_opt", - /* 536 */ "range_opt", - /* 537 */ "every_opt", - /* 538 */ "fill_opt", - /* 539 */ "twindow_clause_opt", - /* 540 */ "group_by_clause_opt", - /* 541 */ "having_clause_opt", - /* 542 */ "select_item", - /* 543 */ "partition_list", - /* 544 */ "partition_item", - /* 545 */ "interval_sliding_duration_literal", - /* 546 */ "fill_mode", - /* 547 */ "group_by_list", - /* 548 */ "query_expression", - /* 549 */ "query_simple", - /* 550 */ "order_by_clause_opt", - /* 551 */ "slimit_clause_opt", - /* 552 */ "limit_clause_opt", - /* 553 */ "union_query_expression", - /* 554 */ "query_simple_or_subquery", - /* 555 */ "sort_specification_list", - /* 556 */ "sort_specification", - /* 557 */ "ordering_specification_opt", - /* 558 */ "null_ordering_opt", + /* 432 */ "drop_table_clause", + /* 433 */ "col_name_list", + /* 434 */ "tag_def_list", + /* 435 */ "tag_def", + /* 436 */ "column_def", + /* 437 */ "type_name_default_len", + /* 438 */ "duration_list", + /* 439 */ "rollup_func_list", + /* 440 */ "alter_table_option", + /* 441 */ "duration_literal", + /* 442 */ "rollup_func_name", + /* 443 */ "function_name", + /* 444 */ "col_name", + /* 445 */ "db_kind_opt", + /* 446 */ "table_kind_db_name_cond_opt", + /* 447 */ "like_pattern_opt", + /* 448 */ "db_name_cond_opt", + /* 449 */ "table_name_cond", + /* 450 */ "from_db_opt", + /* 451 */ "table_kind", + /* 452 */ "tag_item", + /* 453 */ "column_alias", + /* 454 */ "tsma_name", + /* 455 */ "tsma_func_list", + /* 456 */ "full_tsma_name", + /* 457 */ "func_list", + /* 458 */ "index_options", + /* 459 */ "full_index_name", + /* 460 */ "index_name", + /* 461 */ "sliding_opt", + /* 462 */ "sma_stream_opt", + /* 463 */ "func", + /* 464 */ "sma_func_name", + /* 465 */ "expression_list", + /* 466 */ "with_meta", + /* 467 */ "query_or_subquery", + /* 468 */ "where_clause_opt", + /* 469 */ "cgroup_name", + /* 470 */ "analyze_opt", + /* 471 */ "explain_options", + /* 472 */ "insert_query", + /* 473 */ "or_replace_opt", + /* 474 */ "agg_func_opt", + /* 475 */ "bufsize_opt", + /* 476 */ "language_opt", + /* 477 */ "full_view_name", + /* 478 */ "view_name", + /* 479 */ "stream_name", + /* 480 */ "stream_options", + /* 481 */ "col_list_opt", + /* 482 */ "tag_def_or_ref_opt", + /* 483 */ "subtable_opt", + /* 484 */ "ignore_opt", + /* 485 */ "column_stream_def_list", + /* 486 */ "column_stream_def", + /* 487 */ "stream_col_options", + /* 488 */ "expression", + /* 489 */ "on_vgroup_id", + /* 490 */ "dnode_list", + /* 491 */ "literal_func", + /* 492 */ "signed_literal", + /* 493 */ "literal_list", + /* 494 */ "table_alias", + /* 495 */ "expr_or_subquery", + /* 496 */ "pseudo_column", + /* 497 */ "column_reference", + /* 498 */ "function_expression", + /* 499 */ "case_when_expression", + /* 500 */ "star_func", + /* 501 */ "star_func_para_list", + /* 502 */ "noarg_func", + /* 503 */ "other_para_list", + /* 504 */ "star_func_para", + /* 505 */ "when_then_list", + /* 506 */ "case_when_else_opt", + /* 507 */ "common_expression", + /* 508 */ "when_then_expr", + /* 509 */ "predicate", + /* 510 */ "compare_op", + /* 511 */ "in_op", + /* 512 */ "in_predicate_value", + /* 513 */ "boolean_value_expression", + /* 514 */ "boolean_primary", + /* 515 */ "from_clause_opt", + /* 516 */ "table_reference_list", + /* 517 */ "table_reference", + /* 518 */ "table_primary", + /* 519 */ "joined_table", + /* 520 */ "alias_opt", + /* 521 */ "subquery", + /* 522 */ "parenthesized_joined_table", + /* 523 */ "join_type", + /* 524 */ "join_subtype", + /* 525 */ "join_on_clause_opt", + /* 526 */ "window_offset_clause_opt", + /* 527 */ "jlimit_clause_opt", + /* 528 */ "window_offset_literal", + /* 529 */ "query_specification", + /* 530 */ "hint_list", + /* 531 */ "set_quantifier_opt", + /* 532 */ "tag_mode_opt", + /* 533 */ "select_list", + /* 534 */ "partition_by_clause_opt", + /* 535 */ "range_opt", + /* 536 */ "every_opt", + /* 537 */ "fill_opt", + /* 538 */ "twindow_clause_opt", + /* 539 */ "group_by_clause_opt", + /* 540 */ "having_clause_opt", + /* 541 */ "select_item", + /* 542 */ "partition_list", + /* 543 */ "partition_item", + /* 544 */ "interval_sliding_duration_literal", + /* 545 */ "fill_mode", + /* 546 */ "group_by_list", + /* 547 */ "query_expression", + /* 548 */ "query_simple", + /* 549 */ "order_by_clause_opt", + /* 550 */ "slimit_clause_opt", + /* 551 */ "limit_clause_opt", + /* 552 */ "union_query_expression", + /* 553 */ "query_simple_or_subquery", + /* 554 */ "sort_specification_list", + /* 555 */ "sort_specification", + /* 556 */ "ordering_specification_opt", + /* 557 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2746,579 +2727,578 @@ static const char *const yyRuleName[] = { /* 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 STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 184 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 185 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 186 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 187 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 188 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 189 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", - /* 190 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 191 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 192 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", - /* 193 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 194 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 195 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 196 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 197 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 198 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", - /* 199 */ "multi_create_clause ::= create_subtable_clause", - /* 200 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 201 */ "multi_create_clause ::= create_from_file_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 multi_drop_clause", + /* 186 */ "cmd ::= DROP STABLE 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 */ "create_from_file_clause ::= not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", - /* 204 */ "multi_drop_clause ::= drop_table_clause", - /* 205 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 206 */ "drop_table_clause ::= exists_opt full_table_name", - /* 207 */ "specific_cols_opt ::=", - /* 208 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 209 */ "full_table_name ::= table_name", - /* 210 */ "full_table_name ::= db_name NK_DOT table_name", - /* 211 */ "tag_def_list ::= tag_def", - /* 212 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", - /* 213 */ "tag_def ::= column_name type_name", - /* 214 */ "column_def_list ::= column_def", - /* 215 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 216 */ "column_def ::= column_name type_name column_options", - /* 217 */ "type_name ::= BOOL", - /* 218 */ "type_name ::= TINYINT", - /* 219 */ "type_name ::= SMALLINT", - /* 220 */ "type_name ::= INT", - /* 221 */ "type_name ::= INTEGER", - /* 222 */ "type_name ::= BIGINT", - /* 223 */ "type_name ::= FLOAT", - /* 224 */ "type_name ::= DOUBLE", - /* 225 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 226 */ "type_name ::= TIMESTAMP", - /* 227 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 228 */ "type_name ::= TINYINT UNSIGNED", - /* 229 */ "type_name ::= SMALLINT UNSIGNED", - /* 230 */ "type_name ::= INT UNSIGNED", - /* 231 */ "type_name ::= BIGINT UNSIGNED", - /* 232 */ "type_name ::= JSON", - /* 233 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 234 */ "type_name ::= MEDIUMBLOB", - /* 235 */ "type_name ::= BLOB", - /* 236 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 237 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 238 */ "type_name ::= DECIMAL", - /* 239 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 240 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 241 */ "type_name_default_len ::= BINARY", - /* 242 */ "type_name_default_len ::= NCHAR", - /* 243 */ "type_name_default_len ::= VARCHAR", - /* 244 */ "type_name_default_len ::= VARBINARY", - /* 245 */ "tags_def_opt ::=", - /* 246 */ "tags_def_opt ::= tags_def", - /* 247 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", - /* 248 */ "table_options ::=", - /* 249 */ "table_options ::= table_options COMMENT NK_STRING", - /* 250 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 251 */ "table_options ::= table_options WATERMARK duration_list", - /* 252 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 253 */ "table_options ::= table_options TTL NK_INTEGER", - /* 254 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 255 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 256 */ "alter_table_options ::= alter_table_option", - /* 257 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 258 */ "alter_table_option ::= COMMENT NK_STRING", - /* 259 */ "alter_table_option ::= TTL NK_INTEGER", - /* 260 */ "duration_list ::= duration_literal", - /* 261 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 262 */ "rollup_func_list ::= rollup_func_name", - /* 263 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 264 */ "rollup_func_name ::= function_name", - /* 265 */ "rollup_func_name ::= FIRST", - /* 266 */ "rollup_func_name ::= LAST", - /* 267 */ "col_name_list ::= col_name", - /* 268 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 269 */ "col_name ::= column_name", - /* 270 */ "cmd ::= SHOW DNODES", - /* 271 */ "cmd ::= SHOW USERS", - /* 272 */ "cmd ::= SHOW USERS FULL", - /* 273 */ "cmd ::= SHOW USER PRIVILEGES", - /* 274 */ "cmd ::= SHOW db_kind_opt DATABASES", - /* 275 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", - /* 276 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 277 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 278 */ "cmd ::= SHOW MNODES", - /* 279 */ "cmd ::= SHOW QNODES", - /* 280 */ "cmd ::= SHOW ARBGROUPS", - /* 281 */ "cmd ::= SHOW FUNCTIONS", - /* 282 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 283 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 284 */ "cmd ::= SHOW STREAMS", - /* 285 */ "cmd ::= SHOW ACCOUNTS", - /* 286 */ "cmd ::= SHOW APPS", - /* 287 */ "cmd ::= SHOW CONNECTIONS", - /* 288 */ "cmd ::= SHOW LICENCES", - /* 289 */ "cmd ::= SHOW GRANTS", - /* 290 */ "cmd ::= SHOW GRANTS FULL", - /* 291 */ "cmd ::= SHOW GRANTS LOGS", - /* 292 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 293 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 294 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 295 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 296 */ "cmd ::= SHOW ENCRYPTIONS", - /* 297 */ "cmd ::= SHOW QUERIES", - /* 298 */ "cmd ::= SHOW SCORES", - /* 299 */ "cmd ::= SHOW TOPICS", - /* 300 */ "cmd ::= SHOW VARIABLES", - /* 301 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 302 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 303 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 304 */ "cmd ::= SHOW BNODES", - /* 305 */ "cmd ::= SHOW SNODES", - /* 306 */ "cmd ::= SHOW CLUSTER", - /* 307 */ "cmd ::= SHOW TRANSACTIONS", - /* 308 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 309 */ "cmd ::= SHOW CONSUMERS", - /* 310 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 311 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 312 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 313 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 314 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 315 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 316 */ "cmd ::= SHOW VNODES", - /* 317 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 318 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 319 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 320 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 321 */ "cmd ::= SHOW COMPACTS", - /* 322 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 323 */ "table_kind_db_name_cond_opt ::=", - /* 324 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 325 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 326 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 327 */ "table_kind ::= NORMAL", - /* 328 */ "table_kind ::= CHILD", - /* 329 */ "db_name_cond_opt ::=", - /* 330 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 331 */ "like_pattern_opt ::=", - /* 332 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 333 */ "table_name_cond ::= table_name", - /* 334 */ "from_db_opt ::=", - /* 335 */ "from_db_opt ::= FROM db_name", - /* 336 */ "tag_list_opt ::=", - /* 337 */ "tag_list_opt ::= tag_item", - /* 338 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 339 */ "tag_item ::= TBNAME", - /* 340 */ "tag_item ::= QTAGS", - /* 341 */ "tag_item ::= column_name", - /* 342 */ "tag_item ::= column_name column_alias", - /* 343 */ "tag_item ::= column_name AS column_alias", - /* 344 */ "db_kind_opt ::=", - /* 345 */ "db_kind_opt ::= USER", - /* 346 */ "db_kind_opt ::= SYSTEM", - /* 347 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", - /* 348 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", - /* 349 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", - /* 350 */ "cmd ::= SHOW db_name_cond_opt TSMAS", - /* 351 */ "full_tsma_name ::= tsma_name", - /* 352 */ "full_tsma_name ::= db_name NK_DOT tsma_name", - /* 353 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", - /* 354 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 355 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 356 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 357 */ "full_index_name ::= index_name", - /* 358 */ "full_index_name ::= db_name NK_DOT index_name", - /* 359 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 360 */ "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", - /* 361 */ "func_list ::= func", - /* 362 */ "func_list ::= func_list NK_COMMA func", - /* 363 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 364 */ "sma_func_name ::= function_name", - /* 365 */ "sma_func_name ::= COUNT", - /* 366 */ "sma_func_name ::= FIRST", - /* 367 */ "sma_func_name ::= LAST", - /* 368 */ "sma_func_name ::= LAST_ROW", - /* 369 */ "sma_stream_opt ::=", - /* 370 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 371 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 372 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 373 */ "with_meta ::= AS", - /* 374 */ "with_meta ::= WITH META AS", - /* 375 */ "with_meta ::= ONLY META AS", - /* 376 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 377 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 378 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 379 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 380 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 381 */ "cmd ::= DESC full_table_name", - /* 382 */ "cmd ::= DESCRIBE full_table_name", - /* 383 */ "cmd ::= RESET QUERY CACHE", - /* 384 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 385 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 386 */ "analyze_opt ::=", - /* 387 */ "analyze_opt ::= ANALYZE", - /* 388 */ "explain_options ::=", - /* 389 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 390 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 391 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 392 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 393 */ "agg_func_opt ::=", - /* 394 */ "agg_func_opt ::= AGGREGATE", - /* 395 */ "bufsize_opt ::=", - /* 396 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 397 */ "language_opt ::=", - /* 398 */ "language_opt ::= LANGUAGE NK_STRING", - /* 399 */ "or_replace_opt ::=", - /* 400 */ "or_replace_opt ::= OR REPLACE", - /* 401 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 402 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 403 */ "full_view_name ::= view_name", - /* 404 */ "full_view_name ::= db_name NK_DOT view_name", - /* 405 */ "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", - /* 406 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 407 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 408 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 409 */ "col_list_opt ::=", - /* 410 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", - /* 411 */ "column_stream_def_list ::= column_stream_def", - /* 412 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", - /* 413 */ "column_stream_def ::= column_name stream_col_options", - /* 414 */ "stream_col_options ::=", - /* 415 */ "stream_col_options ::= stream_col_options PRIMARY KEY", - /* 416 */ "tag_def_or_ref_opt ::=", - /* 417 */ "tag_def_or_ref_opt ::= tags_def", - /* 418 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", - /* 419 */ "stream_options ::=", - /* 420 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 421 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 422 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 423 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 424 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 425 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 426 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 427 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 428 */ "subtable_opt ::=", - /* 429 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 430 */ "ignore_opt ::=", - /* 431 */ "ignore_opt ::= IGNORE UNTREATED", - /* 432 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 433 */ "cmd ::= KILL QUERY NK_STRING", - /* 434 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 435 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 436 */ "cmd ::= BALANCE VGROUP", - /* 437 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 438 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", - /* 439 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 440 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 441 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 442 */ "on_vgroup_id ::=", - /* 443 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 444 */ "dnode_list ::= DNODE NK_INTEGER", - /* 445 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 446 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 447 */ "cmd ::= query_or_subquery", - /* 448 */ "cmd ::= insert_query", - /* 449 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 450 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 451 */ "tags_literal ::= NK_INTEGER", - /* 452 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", - /* 453 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", - /* 454 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 455 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", - /* 456 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", - /* 457 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 458 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", - /* 459 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", - /* 460 */ "tags_literal ::= NK_FLOAT", - /* 461 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 462 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 463 */ "tags_literal ::= NK_BIN", - /* 464 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", - /* 465 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", - /* 466 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 467 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", - /* 468 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", - /* 469 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 470 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", - /* 471 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", - /* 472 */ "tags_literal ::= NK_HEX", - /* 473 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", - /* 474 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", - /* 475 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 476 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", - /* 477 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", - /* 478 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 479 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", - /* 480 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", - /* 481 */ "tags_literal ::= NK_STRING", - /* 482 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", - /* 483 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", - /* 484 */ "tags_literal ::= NK_BOOL", - /* 485 */ "tags_literal ::= NULL", - /* 486 */ "tags_literal ::= literal_func", - /* 487 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 488 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 489 */ "tags_literal_list ::= tags_literal", - /* 490 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 491 */ "literal ::= NK_INTEGER", - /* 492 */ "literal ::= NK_FLOAT", - /* 493 */ "literal ::= NK_STRING", - /* 494 */ "literal ::= NK_BOOL", - /* 495 */ "literal ::= TIMESTAMP NK_STRING", - /* 496 */ "literal ::= duration_literal", - /* 497 */ "literal ::= NULL", - /* 498 */ "literal ::= NK_QUESTION", - /* 499 */ "duration_literal ::= NK_VARIABLE", - /* 500 */ "signed ::= NK_INTEGER", - /* 501 */ "signed ::= NK_PLUS NK_INTEGER", - /* 502 */ "signed ::= NK_MINUS NK_INTEGER", - /* 503 */ "signed ::= NK_FLOAT", - /* 504 */ "signed ::= NK_PLUS NK_FLOAT", - /* 505 */ "signed ::= NK_MINUS NK_FLOAT", - /* 506 */ "signed_literal ::= signed", - /* 507 */ "signed_literal ::= NK_STRING", - /* 508 */ "signed_literal ::= NK_BOOL", - /* 509 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 510 */ "signed_literal ::= duration_literal", - /* 511 */ "signed_literal ::= NULL", - /* 512 */ "signed_literal ::= literal_func", - /* 513 */ "signed_literal ::= NK_QUESTION", - /* 514 */ "literal_list ::= signed_literal", - /* 515 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 516 */ "db_name ::= NK_ID", - /* 517 */ "table_name ::= NK_ID", - /* 518 */ "column_name ::= NK_ID", - /* 519 */ "function_name ::= NK_ID", - /* 520 */ "view_name ::= NK_ID", - /* 521 */ "table_alias ::= NK_ID", - /* 522 */ "column_alias ::= NK_ID", - /* 523 */ "column_alias ::= NK_ALIAS", - /* 524 */ "user_name ::= NK_ID", - /* 525 */ "topic_name ::= NK_ID", - /* 526 */ "stream_name ::= NK_ID", - /* 527 */ "cgroup_name ::= NK_ID", - /* 528 */ "index_name ::= NK_ID", - /* 529 */ "tsma_name ::= NK_ID", - /* 530 */ "expr_or_subquery ::= expression", - /* 531 */ "expression ::= literal", - /* 532 */ "expression ::= pseudo_column", - /* 533 */ "expression ::= column_reference", - /* 534 */ "expression ::= function_expression", - /* 535 */ "expression ::= case_when_expression", - /* 536 */ "expression ::= NK_LP expression NK_RP", - /* 537 */ "expression ::= NK_PLUS expr_or_subquery", - /* 538 */ "expression ::= NK_MINUS expr_or_subquery", - /* 539 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 540 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 541 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 542 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 543 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 544 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 545 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 546 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 547 */ "expression_list ::= expr_or_subquery", - /* 548 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 549 */ "column_reference ::= column_name", - /* 550 */ "column_reference ::= table_name NK_DOT column_name", - /* 551 */ "column_reference ::= NK_ALIAS", - /* 552 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 553 */ "pseudo_column ::= ROWTS", - /* 554 */ "pseudo_column ::= TBNAME", - /* 555 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 556 */ "pseudo_column ::= QSTART", - /* 557 */ "pseudo_column ::= QEND", - /* 558 */ "pseudo_column ::= QDURATION", - /* 559 */ "pseudo_column ::= WSTART", - /* 560 */ "pseudo_column ::= WEND", - /* 561 */ "pseudo_column ::= WDURATION", - /* 562 */ "pseudo_column ::= IROWTS", - /* 563 */ "pseudo_column ::= ISFILLED", - /* 564 */ "pseudo_column ::= QTAGS", - /* 565 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 566 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 567 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 568 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", - /* 569 */ "function_expression ::= literal_func", - /* 570 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 571 */ "literal_func ::= NOW", - /* 572 */ "literal_func ::= TODAY", - /* 573 */ "noarg_func ::= NOW", - /* 574 */ "noarg_func ::= TODAY", - /* 575 */ "noarg_func ::= TIMEZONE", - /* 576 */ "noarg_func ::= DATABASE", - /* 577 */ "noarg_func ::= CLIENT_VERSION", - /* 578 */ "noarg_func ::= SERVER_VERSION", - /* 579 */ "noarg_func ::= SERVER_STATUS", - /* 580 */ "noarg_func ::= CURRENT_USER", - /* 581 */ "noarg_func ::= USER", - /* 582 */ "star_func ::= COUNT", - /* 583 */ "star_func ::= FIRST", - /* 584 */ "star_func ::= LAST", - /* 585 */ "star_func ::= LAST_ROW", - /* 586 */ "star_func_para_list ::= NK_STAR", - /* 587 */ "star_func_para_list ::= other_para_list", - /* 588 */ "other_para_list ::= star_func_para", - /* 589 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 590 */ "star_func_para ::= expr_or_subquery", - /* 591 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 592 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 593 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 594 */ "when_then_list ::= when_then_expr", - /* 595 */ "when_then_list ::= when_then_list when_then_expr", - /* 596 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 597 */ "case_when_else_opt ::=", - /* 598 */ "case_when_else_opt ::= ELSE common_expression", - /* 599 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 600 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 601 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 602 */ "predicate ::= expr_or_subquery IS NULL", - /* 603 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 604 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 605 */ "compare_op ::= NK_LT", - /* 606 */ "compare_op ::= NK_GT", - /* 607 */ "compare_op ::= NK_LE", - /* 608 */ "compare_op ::= NK_GE", - /* 609 */ "compare_op ::= NK_NE", - /* 610 */ "compare_op ::= NK_EQ", - /* 611 */ "compare_op ::= LIKE", - /* 612 */ "compare_op ::= NOT LIKE", - /* 613 */ "compare_op ::= MATCH", - /* 614 */ "compare_op ::= NMATCH", - /* 615 */ "compare_op ::= CONTAINS", - /* 616 */ "in_op ::= IN", - /* 617 */ "in_op ::= NOT IN", - /* 618 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 619 */ "boolean_value_expression ::= boolean_primary", - /* 620 */ "boolean_value_expression ::= NOT boolean_primary", - /* 621 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 622 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 623 */ "boolean_primary ::= predicate", - /* 624 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 625 */ "common_expression ::= expr_or_subquery", - /* 626 */ "common_expression ::= boolean_value_expression", - /* 627 */ "from_clause_opt ::=", - /* 628 */ "from_clause_opt ::= FROM table_reference_list", - /* 629 */ "table_reference_list ::= table_reference", - /* 630 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 631 */ "table_reference ::= table_primary", - /* 632 */ "table_reference ::= joined_table", - /* 633 */ "table_primary ::= table_name alias_opt", - /* 634 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 635 */ "table_primary ::= subquery alias_opt", - /* 636 */ "table_primary ::= parenthesized_joined_table", - /* 637 */ "alias_opt ::=", - /* 638 */ "alias_opt ::= table_alias", - /* 639 */ "alias_opt ::= AS table_alias", - /* 640 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 641 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 642 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 643 */ "join_type ::=", - /* 644 */ "join_type ::= INNER", - /* 645 */ "join_type ::= LEFT", - /* 646 */ "join_type ::= RIGHT", - /* 647 */ "join_type ::= FULL", - /* 648 */ "join_subtype ::=", - /* 649 */ "join_subtype ::= OUTER", - /* 650 */ "join_subtype ::= SEMI", - /* 651 */ "join_subtype ::= ANTI", - /* 652 */ "join_subtype ::= ASOF", - /* 653 */ "join_subtype ::= WINDOW", - /* 654 */ "join_on_clause_opt ::=", - /* 655 */ "join_on_clause_opt ::= ON search_condition", - /* 656 */ "window_offset_clause_opt ::=", - /* 657 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 658 */ "window_offset_literal ::= NK_VARIABLE", - /* 659 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 660 */ "jlimit_clause_opt ::=", - /* 661 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 662 */ "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", - /* 663 */ "hint_list ::=", - /* 664 */ "hint_list ::= NK_HINT", - /* 665 */ "tag_mode_opt ::=", - /* 666 */ "tag_mode_opt ::= TAGS", - /* 667 */ "set_quantifier_opt ::=", - /* 668 */ "set_quantifier_opt ::= DISTINCT", - /* 669 */ "set_quantifier_opt ::= ALL", - /* 670 */ "select_list ::= select_item", - /* 671 */ "select_list ::= select_list NK_COMMA select_item", - /* 672 */ "select_item ::= NK_STAR", - /* 673 */ "select_item ::= common_expression", - /* 674 */ "select_item ::= common_expression column_alias", - /* 675 */ "select_item ::= common_expression AS column_alias", - /* 676 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 677 */ "where_clause_opt ::=", - /* 678 */ "where_clause_opt ::= WHERE search_condition", - /* 679 */ "partition_by_clause_opt ::=", - /* 680 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 681 */ "partition_list ::= partition_item", - /* 682 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 683 */ "partition_item ::= expr_or_subquery", - /* 684 */ "partition_item ::= expr_or_subquery column_alias", - /* 685 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 686 */ "twindow_clause_opt ::=", - /* 687 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 688 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 689 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 690 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 691 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 692 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 693 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 694 */ "sliding_opt ::=", - /* 695 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 696 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 697 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 698 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 699 */ "fill_opt ::=", - /* 700 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 701 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 702 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 703 */ "fill_mode ::= NONE", - /* 704 */ "fill_mode ::= PREV", - /* 705 */ "fill_mode ::= NULL", - /* 706 */ "fill_mode ::= NULL_F", - /* 707 */ "fill_mode ::= LINEAR", - /* 708 */ "fill_mode ::= NEXT", - /* 709 */ "group_by_clause_opt ::=", - /* 710 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 711 */ "group_by_list ::= expr_or_subquery", - /* 712 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 713 */ "having_clause_opt ::=", - /* 714 */ "having_clause_opt ::= HAVING search_condition", - /* 715 */ "range_opt ::=", - /* 716 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 717 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 718 */ "every_opt ::=", - /* 719 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 720 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 721 */ "query_simple ::= query_specification", - /* 722 */ "query_simple ::= union_query_expression", - /* 723 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 724 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 725 */ "query_simple_or_subquery ::= query_simple", - /* 726 */ "query_simple_or_subquery ::= subquery", - /* 727 */ "query_or_subquery ::= query_expression", - /* 728 */ "query_or_subquery ::= subquery", - /* 729 */ "order_by_clause_opt ::=", - /* 730 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 731 */ "slimit_clause_opt ::=", - /* 732 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 733 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 734 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 735 */ "limit_clause_opt ::=", - /* 736 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 737 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 738 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 739 */ "subquery ::= NK_LP query_expression NK_RP", - /* 740 */ "subquery ::= NK_LP subquery NK_RP", - /* 741 */ "search_condition ::= common_expression", - /* 742 */ "sort_specification_list ::= sort_specification", - /* 743 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 744 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 745 */ "ordering_specification_opt ::=", - /* 746 */ "ordering_specification_opt ::= ASC", - /* 747 */ "ordering_specification_opt ::= DESC", - /* 748 */ "null_ordering_opt ::=", - /* 749 */ "null_ordering_opt ::= NULLS FIRST", - /* 750 */ "null_ordering_opt ::= NULLS LAST", - /* 751 */ "column_options ::=", - /* 752 */ "column_options ::= column_options PRIMARY KEY", - /* 753 */ "column_options ::= column_options ENCODE NK_STRING", - /* 754 */ "column_options ::= column_options COMPRESS NK_STRING", - /* 755 */ "column_options ::= column_options LEVEL NK_STRING", + /* 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 */ "specific_cols_opt ::=", + /* 207 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 208 */ "full_table_name ::= table_name", + /* 209 */ "full_table_name ::= db_name NK_DOT table_name", + /* 210 */ "tag_def_list ::= tag_def", + /* 211 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", + /* 212 */ "tag_def ::= column_name type_name", + /* 213 */ "column_def_list ::= column_def", + /* 214 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 215 */ "column_def ::= column_name type_name column_options", + /* 216 */ "type_name ::= BOOL", + /* 217 */ "type_name ::= TINYINT", + /* 218 */ "type_name ::= SMALLINT", + /* 219 */ "type_name ::= INT", + /* 220 */ "type_name ::= INTEGER", + /* 221 */ "type_name ::= BIGINT", + /* 222 */ "type_name ::= FLOAT", + /* 223 */ "type_name ::= DOUBLE", + /* 224 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 225 */ "type_name ::= TIMESTAMP", + /* 226 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 227 */ "type_name ::= TINYINT UNSIGNED", + /* 228 */ "type_name ::= SMALLINT UNSIGNED", + /* 229 */ "type_name ::= INT UNSIGNED", + /* 230 */ "type_name ::= BIGINT UNSIGNED", + /* 231 */ "type_name ::= JSON", + /* 232 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 233 */ "type_name ::= MEDIUMBLOB", + /* 234 */ "type_name ::= BLOB", + /* 235 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 236 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 237 */ "type_name ::= DECIMAL", + /* 238 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 239 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 240 */ "type_name_default_len ::= BINARY", + /* 241 */ "type_name_default_len ::= NCHAR", + /* 242 */ "type_name_default_len ::= VARCHAR", + /* 243 */ "type_name_default_len ::= VARBINARY", + /* 244 */ "tags_def_opt ::=", + /* 245 */ "tags_def_opt ::= tags_def", + /* 246 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", + /* 247 */ "table_options ::=", + /* 248 */ "table_options ::= table_options COMMENT NK_STRING", + /* 249 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 250 */ "table_options ::= table_options WATERMARK duration_list", + /* 251 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 252 */ "table_options ::= table_options TTL NK_INTEGER", + /* 253 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 254 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 255 */ "alter_table_options ::= alter_table_option", + /* 256 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 257 */ "alter_table_option ::= COMMENT NK_STRING", + /* 258 */ "alter_table_option ::= TTL NK_INTEGER", + /* 259 */ "duration_list ::= duration_literal", + /* 260 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 261 */ "rollup_func_list ::= rollup_func_name", + /* 262 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 263 */ "rollup_func_name ::= function_name", + /* 264 */ "rollup_func_name ::= FIRST", + /* 265 */ "rollup_func_name ::= LAST", + /* 266 */ "col_name_list ::= col_name", + /* 267 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 268 */ "col_name ::= column_name", + /* 269 */ "cmd ::= SHOW DNODES", + /* 270 */ "cmd ::= SHOW USERS", + /* 271 */ "cmd ::= SHOW USERS FULL", + /* 272 */ "cmd ::= SHOW USER PRIVILEGES", + /* 273 */ "cmd ::= SHOW db_kind_opt DATABASES", + /* 274 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", + /* 275 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 276 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 277 */ "cmd ::= SHOW MNODES", + /* 278 */ "cmd ::= SHOW QNODES", + /* 279 */ "cmd ::= SHOW ARBGROUPS", + /* 280 */ "cmd ::= SHOW FUNCTIONS", + /* 281 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 282 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 283 */ "cmd ::= SHOW STREAMS", + /* 284 */ "cmd ::= SHOW ACCOUNTS", + /* 285 */ "cmd ::= SHOW APPS", + /* 286 */ "cmd ::= SHOW CONNECTIONS", + /* 287 */ "cmd ::= SHOW LICENCES", + /* 288 */ "cmd ::= SHOW GRANTS", + /* 289 */ "cmd ::= SHOW GRANTS FULL", + /* 290 */ "cmd ::= SHOW GRANTS LOGS", + /* 291 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 292 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 293 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 294 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 295 */ "cmd ::= SHOW ENCRYPTIONS", + /* 296 */ "cmd ::= SHOW QUERIES", + /* 297 */ "cmd ::= SHOW SCORES", + /* 298 */ "cmd ::= SHOW TOPICS", + /* 299 */ "cmd ::= SHOW VARIABLES", + /* 300 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 301 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 302 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 303 */ "cmd ::= SHOW BNODES", + /* 304 */ "cmd ::= SHOW SNODES", + /* 305 */ "cmd ::= SHOW CLUSTER", + /* 306 */ "cmd ::= SHOW TRANSACTIONS", + /* 307 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 308 */ "cmd ::= SHOW CONSUMERS", + /* 309 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 310 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 311 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 312 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 313 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 314 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 315 */ "cmd ::= SHOW VNODES", + /* 316 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 317 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 318 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 319 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 320 */ "cmd ::= SHOW COMPACTS", + /* 321 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 322 */ "table_kind_db_name_cond_opt ::=", + /* 323 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 324 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 325 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 326 */ "table_kind ::= NORMAL", + /* 327 */ "table_kind ::= CHILD", + /* 328 */ "db_name_cond_opt ::=", + /* 329 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 330 */ "like_pattern_opt ::=", + /* 331 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 332 */ "table_name_cond ::= table_name", + /* 333 */ "from_db_opt ::=", + /* 334 */ "from_db_opt ::= FROM db_name", + /* 335 */ "tag_list_opt ::=", + /* 336 */ "tag_list_opt ::= tag_item", + /* 337 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 338 */ "tag_item ::= TBNAME", + /* 339 */ "tag_item ::= QTAGS", + /* 340 */ "tag_item ::= column_name", + /* 341 */ "tag_item ::= column_name column_alias", + /* 342 */ "tag_item ::= column_name AS column_alias", + /* 343 */ "db_kind_opt ::=", + /* 344 */ "db_kind_opt ::= USER", + /* 345 */ "db_kind_opt ::= SYSTEM", + /* 346 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", + /* 347 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", + /* 348 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", + /* 349 */ "cmd ::= SHOW db_name_cond_opt TSMAS", + /* 350 */ "full_tsma_name ::= tsma_name", + /* 351 */ "full_tsma_name ::= db_name NK_DOT tsma_name", + /* 352 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", + /* 353 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 354 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 355 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 356 */ "full_index_name ::= index_name", + /* 357 */ "full_index_name ::= db_name NK_DOT index_name", + /* 358 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 359 */ "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", + /* 360 */ "func_list ::= func", + /* 361 */ "func_list ::= func_list NK_COMMA func", + /* 362 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 363 */ "sma_func_name ::= function_name", + /* 364 */ "sma_func_name ::= COUNT", + /* 365 */ "sma_func_name ::= FIRST", + /* 366 */ "sma_func_name ::= LAST", + /* 367 */ "sma_func_name ::= LAST_ROW", + /* 368 */ "sma_stream_opt ::=", + /* 369 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 370 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 371 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 372 */ "with_meta ::= AS", + /* 373 */ "with_meta ::= WITH META AS", + /* 374 */ "with_meta ::= ONLY META AS", + /* 375 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 376 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 377 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 378 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 379 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 380 */ "cmd ::= DESC full_table_name", + /* 381 */ "cmd ::= DESCRIBE full_table_name", + /* 382 */ "cmd ::= RESET QUERY CACHE", + /* 383 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 384 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 385 */ "analyze_opt ::=", + /* 386 */ "analyze_opt ::= ANALYZE", + /* 387 */ "explain_options ::=", + /* 388 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 389 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 390 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 391 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 392 */ "agg_func_opt ::=", + /* 393 */ "agg_func_opt ::= AGGREGATE", + /* 394 */ "bufsize_opt ::=", + /* 395 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 396 */ "language_opt ::=", + /* 397 */ "language_opt ::= LANGUAGE NK_STRING", + /* 398 */ "or_replace_opt ::=", + /* 399 */ "or_replace_opt ::= OR REPLACE", + /* 400 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 401 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 402 */ "full_view_name ::= view_name", + /* 403 */ "full_view_name ::= db_name NK_DOT view_name", + /* 404 */ "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", + /* 405 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 406 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 407 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 408 */ "col_list_opt ::=", + /* 409 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", + /* 410 */ "column_stream_def_list ::= column_stream_def", + /* 411 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", + /* 412 */ "column_stream_def ::= column_name stream_col_options", + /* 413 */ "stream_col_options ::=", + /* 414 */ "stream_col_options ::= stream_col_options PRIMARY KEY", + /* 415 */ "tag_def_or_ref_opt ::=", + /* 416 */ "tag_def_or_ref_opt ::= tags_def", + /* 417 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", + /* 418 */ "stream_options ::=", + /* 419 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 420 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 421 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 422 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 423 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 424 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 425 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 426 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 427 */ "subtable_opt ::=", + /* 428 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 429 */ "ignore_opt ::=", + /* 430 */ "ignore_opt ::= IGNORE UNTREATED", + /* 431 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 432 */ "cmd ::= KILL QUERY NK_STRING", + /* 433 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 434 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 435 */ "cmd ::= BALANCE VGROUP", + /* 436 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 437 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", + /* 438 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 439 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 440 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 441 */ "on_vgroup_id ::=", + /* 442 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 443 */ "dnode_list ::= DNODE NK_INTEGER", + /* 444 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 445 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 446 */ "cmd ::= query_or_subquery", + /* 447 */ "cmd ::= insert_query", + /* 448 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 449 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 450 */ "tags_literal ::= NK_INTEGER", + /* 451 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", + /* 452 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", + /* 453 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 454 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", + /* 455 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", + /* 456 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 457 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", + /* 458 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", + /* 459 */ "tags_literal ::= NK_FLOAT", + /* 460 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 461 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 462 */ "tags_literal ::= NK_BIN", + /* 463 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", + /* 464 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", + /* 465 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 466 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", + /* 467 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", + /* 468 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 469 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", + /* 470 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", + /* 471 */ "tags_literal ::= NK_HEX", + /* 472 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", + /* 473 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", + /* 474 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 475 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", + /* 476 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", + /* 477 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 478 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", + /* 479 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", + /* 480 */ "tags_literal ::= NK_STRING", + /* 481 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", + /* 482 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", + /* 483 */ "tags_literal ::= NK_BOOL", + /* 484 */ "tags_literal ::= NULL", + /* 485 */ "tags_literal ::= literal_func", + /* 486 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 487 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 488 */ "tags_literal_list ::= tags_literal", + /* 489 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 490 */ "literal ::= NK_INTEGER", + /* 491 */ "literal ::= NK_FLOAT", + /* 492 */ "literal ::= NK_STRING", + /* 493 */ "literal ::= NK_BOOL", + /* 494 */ "literal ::= TIMESTAMP NK_STRING", + /* 495 */ "literal ::= duration_literal", + /* 496 */ "literal ::= NULL", + /* 497 */ "literal ::= NK_QUESTION", + /* 498 */ "duration_literal ::= NK_VARIABLE", + /* 499 */ "signed ::= NK_INTEGER", + /* 500 */ "signed ::= NK_PLUS NK_INTEGER", + /* 501 */ "signed ::= NK_MINUS NK_INTEGER", + /* 502 */ "signed ::= NK_FLOAT", + /* 503 */ "signed ::= NK_PLUS NK_FLOAT", + /* 504 */ "signed ::= NK_MINUS NK_FLOAT", + /* 505 */ "signed_literal ::= signed", + /* 506 */ "signed_literal ::= NK_STRING", + /* 507 */ "signed_literal ::= NK_BOOL", + /* 508 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 509 */ "signed_literal ::= duration_literal", + /* 510 */ "signed_literal ::= NULL", + /* 511 */ "signed_literal ::= literal_func", + /* 512 */ "signed_literal ::= NK_QUESTION", + /* 513 */ "literal_list ::= signed_literal", + /* 514 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 515 */ "db_name ::= NK_ID", + /* 516 */ "table_name ::= NK_ID", + /* 517 */ "column_name ::= NK_ID", + /* 518 */ "function_name ::= NK_ID", + /* 519 */ "view_name ::= NK_ID", + /* 520 */ "table_alias ::= NK_ID", + /* 521 */ "column_alias ::= NK_ID", + /* 522 */ "column_alias ::= NK_ALIAS", + /* 523 */ "user_name ::= NK_ID", + /* 524 */ "topic_name ::= NK_ID", + /* 525 */ "stream_name ::= NK_ID", + /* 526 */ "cgroup_name ::= NK_ID", + /* 527 */ "index_name ::= NK_ID", + /* 528 */ "tsma_name ::= NK_ID", + /* 529 */ "expr_or_subquery ::= expression", + /* 530 */ "expression ::= literal", + /* 531 */ "expression ::= pseudo_column", + /* 532 */ "expression ::= column_reference", + /* 533 */ "expression ::= function_expression", + /* 534 */ "expression ::= case_when_expression", + /* 535 */ "expression ::= NK_LP expression NK_RP", + /* 536 */ "expression ::= NK_PLUS expr_or_subquery", + /* 537 */ "expression ::= NK_MINUS expr_or_subquery", + /* 538 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 539 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 540 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 541 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 542 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 543 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 544 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 545 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 546 */ "expression_list ::= expr_or_subquery", + /* 547 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 548 */ "column_reference ::= column_name", + /* 549 */ "column_reference ::= table_name NK_DOT column_name", + /* 550 */ "column_reference ::= NK_ALIAS", + /* 551 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 552 */ "pseudo_column ::= ROWTS", + /* 553 */ "pseudo_column ::= TBNAME", + /* 554 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 555 */ "pseudo_column ::= QSTART", + /* 556 */ "pseudo_column ::= QEND", + /* 557 */ "pseudo_column ::= QDURATION", + /* 558 */ "pseudo_column ::= WSTART", + /* 559 */ "pseudo_column ::= WEND", + /* 560 */ "pseudo_column ::= WDURATION", + /* 561 */ "pseudo_column ::= IROWTS", + /* 562 */ "pseudo_column ::= ISFILLED", + /* 563 */ "pseudo_column ::= QTAGS", + /* 564 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 565 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 566 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 567 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", + /* 568 */ "function_expression ::= literal_func", + /* 569 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 570 */ "literal_func ::= NOW", + /* 571 */ "literal_func ::= TODAY", + /* 572 */ "noarg_func ::= NOW", + /* 573 */ "noarg_func ::= TODAY", + /* 574 */ "noarg_func ::= TIMEZONE", + /* 575 */ "noarg_func ::= DATABASE", + /* 576 */ "noarg_func ::= CLIENT_VERSION", + /* 577 */ "noarg_func ::= SERVER_VERSION", + /* 578 */ "noarg_func ::= SERVER_STATUS", + /* 579 */ "noarg_func ::= CURRENT_USER", + /* 580 */ "noarg_func ::= USER", + /* 581 */ "star_func ::= COUNT", + /* 582 */ "star_func ::= FIRST", + /* 583 */ "star_func ::= LAST", + /* 584 */ "star_func ::= LAST_ROW", + /* 585 */ "star_func_para_list ::= NK_STAR", + /* 586 */ "star_func_para_list ::= other_para_list", + /* 587 */ "other_para_list ::= star_func_para", + /* 588 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 589 */ "star_func_para ::= expr_or_subquery", + /* 590 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 591 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 592 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 593 */ "when_then_list ::= when_then_expr", + /* 594 */ "when_then_list ::= when_then_list when_then_expr", + /* 595 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 596 */ "case_when_else_opt ::=", + /* 597 */ "case_when_else_opt ::= ELSE common_expression", + /* 598 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 599 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 600 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 601 */ "predicate ::= expr_or_subquery IS NULL", + /* 602 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 603 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 604 */ "compare_op ::= NK_LT", + /* 605 */ "compare_op ::= NK_GT", + /* 606 */ "compare_op ::= NK_LE", + /* 607 */ "compare_op ::= NK_GE", + /* 608 */ "compare_op ::= NK_NE", + /* 609 */ "compare_op ::= NK_EQ", + /* 610 */ "compare_op ::= LIKE", + /* 611 */ "compare_op ::= NOT LIKE", + /* 612 */ "compare_op ::= MATCH", + /* 613 */ "compare_op ::= NMATCH", + /* 614 */ "compare_op ::= CONTAINS", + /* 615 */ "in_op ::= IN", + /* 616 */ "in_op ::= NOT IN", + /* 617 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 618 */ "boolean_value_expression ::= boolean_primary", + /* 619 */ "boolean_value_expression ::= NOT boolean_primary", + /* 620 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 621 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 622 */ "boolean_primary ::= predicate", + /* 623 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 624 */ "common_expression ::= expr_or_subquery", + /* 625 */ "common_expression ::= boolean_value_expression", + /* 626 */ "from_clause_opt ::=", + /* 627 */ "from_clause_opt ::= FROM table_reference_list", + /* 628 */ "table_reference_list ::= table_reference", + /* 629 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 630 */ "table_reference ::= table_primary", + /* 631 */ "table_reference ::= joined_table", + /* 632 */ "table_primary ::= table_name alias_opt", + /* 633 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 634 */ "table_primary ::= subquery alias_opt", + /* 635 */ "table_primary ::= parenthesized_joined_table", + /* 636 */ "alias_opt ::=", + /* 637 */ "alias_opt ::= table_alias", + /* 638 */ "alias_opt ::= AS table_alias", + /* 639 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 640 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 641 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 642 */ "join_type ::=", + /* 643 */ "join_type ::= INNER", + /* 644 */ "join_type ::= LEFT", + /* 645 */ "join_type ::= RIGHT", + /* 646 */ "join_type ::= FULL", + /* 647 */ "join_subtype ::=", + /* 648 */ "join_subtype ::= OUTER", + /* 649 */ "join_subtype ::= SEMI", + /* 650 */ "join_subtype ::= ANTI", + /* 651 */ "join_subtype ::= ASOF", + /* 652 */ "join_subtype ::= WINDOW", + /* 653 */ "join_on_clause_opt ::=", + /* 654 */ "join_on_clause_opt ::= ON search_condition", + /* 655 */ "window_offset_clause_opt ::=", + /* 656 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 657 */ "window_offset_literal ::= NK_VARIABLE", + /* 658 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 659 */ "jlimit_clause_opt ::=", + /* 660 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 661 */ "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", + /* 662 */ "hint_list ::=", + /* 663 */ "hint_list ::= NK_HINT", + /* 664 */ "tag_mode_opt ::=", + /* 665 */ "tag_mode_opt ::= TAGS", + /* 666 */ "set_quantifier_opt ::=", + /* 667 */ "set_quantifier_opt ::= DISTINCT", + /* 668 */ "set_quantifier_opt ::= ALL", + /* 669 */ "select_list ::= select_item", + /* 670 */ "select_list ::= select_list NK_COMMA select_item", + /* 671 */ "select_item ::= NK_STAR", + /* 672 */ "select_item ::= common_expression", + /* 673 */ "select_item ::= common_expression column_alias", + /* 674 */ "select_item ::= common_expression AS column_alias", + /* 675 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 676 */ "where_clause_opt ::=", + /* 677 */ "where_clause_opt ::= WHERE search_condition", + /* 678 */ "partition_by_clause_opt ::=", + /* 679 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 680 */ "partition_list ::= partition_item", + /* 681 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 682 */ "partition_item ::= expr_or_subquery", + /* 683 */ "partition_item ::= expr_or_subquery column_alias", + /* 684 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 685 */ "twindow_clause_opt ::=", + /* 686 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 687 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 688 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 689 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 690 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 691 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 692 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 693 */ "sliding_opt ::=", + /* 694 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 695 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 696 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 697 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 698 */ "fill_opt ::=", + /* 699 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 700 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 701 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 702 */ "fill_mode ::= NONE", + /* 703 */ "fill_mode ::= PREV", + /* 704 */ "fill_mode ::= NULL", + /* 705 */ "fill_mode ::= NULL_F", + /* 706 */ "fill_mode ::= LINEAR", + /* 707 */ "fill_mode ::= NEXT", + /* 708 */ "group_by_clause_opt ::=", + /* 709 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 710 */ "group_by_list ::= expr_or_subquery", + /* 711 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 712 */ "having_clause_opt ::=", + /* 713 */ "having_clause_opt ::= HAVING search_condition", + /* 714 */ "range_opt ::=", + /* 715 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 716 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 717 */ "every_opt ::=", + /* 718 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 719 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 720 */ "query_simple ::= query_specification", + /* 721 */ "query_simple ::= union_query_expression", + /* 722 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 723 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 724 */ "query_simple_or_subquery ::= query_simple", + /* 725 */ "query_simple_or_subquery ::= subquery", + /* 726 */ "query_or_subquery ::= query_expression", + /* 727 */ "query_or_subquery ::= subquery", + /* 728 */ "order_by_clause_opt ::=", + /* 729 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 730 */ "slimit_clause_opt ::=", + /* 731 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 732 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 733 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 734 */ "limit_clause_opt ::=", + /* 735 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 736 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 737 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 738 */ "subquery ::= NK_LP query_expression NK_RP", + /* 739 */ "subquery ::= NK_LP subquery NK_RP", + /* 740 */ "search_condition ::= common_expression", + /* 741 */ "sort_specification_list ::= sort_specification", + /* 742 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 743 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 744 */ "ordering_specification_opt ::=", + /* 745 */ "ordering_specification_opt ::= ASC", + /* 746 */ "ordering_specification_opt ::= DESC", + /* 747 */ "null_ordering_opt ::=", + /* 748 */ "null_ordering_opt ::= NULLS FIRST", + /* 749 */ "null_ordering_opt ::= NULLS LAST", + /* 750 */ "column_options ::=", + /* 751 */ "column_options ::= column_options PRIMARY KEY", + /* 752 */ "column_options ::= column_options ENCODE NK_STRING", + /* 753 */ "column_options ::= column_options COMPRESS NK_STRING", + /* 754 */ "column_options ::= column_options LEVEL NK_STRING", }; #endif /* NDEBUG */ @@ -3457,97 +3437,96 @@ static void yy_destructor( case 414: /* retention */ case 415: /* full_table_name */ case 418: /* table_options */ - case 422: /* alter_table_clause */ - case 423: /* alter_table_options */ - case 426: /* column_options */ - case 427: /* tags_literal */ - case 428: /* create_subtable_clause */ - case 429: /* create_from_file_clause */ - case 433: /* drop_table_clause */ - case 436: /* tag_def */ - case 437: /* column_def */ - case 442: /* duration_literal */ - case 443: /* rollup_func_name */ - case 445: /* col_name */ - case 448: /* like_pattern_opt */ - case 449: /* db_name_cond_opt */ - case 450: /* table_name_cond */ - case 451: /* from_db_opt */ - case 453: /* tag_item */ - case 457: /* full_tsma_name */ - case 459: /* index_options */ - case 460: /* full_index_name */ - case 462: /* sliding_opt */ - case 463: /* sma_stream_opt */ - case 464: /* func */ - case 468: /* query_or_subquery */ - case 469: /* where_clause_opt */ - case 472: /* explain_options */ - case 473: /* insert_query */ - case 478: /* full_view_name */ - case 481: /* stream_options */ - case 484: /* subtable_opt */ - case 487: /* column_stream_def */ - case 488: /* stream_col_options */ - case 489: /* expression */ - case 492: /* literal_func */ - case 493: /* signed_literal */ - case 496: /* expr_or_subquery */ - case 497: /* pseudo_column */ - case 498: /* column_reference */ - case 499: /* function_expression */ - case 500: /* case_when_expression */ - case 505: /* star_func_para */ - case 507: /* case_when_else_opt */ - case 508: /* common_expression */ - case 509: /* when_then_expr */ - case 510: /* predicate */ - case 513: /* in_predicate_value */ - case 514: /* boolean_value_expression */ - case 515: /* boolean_primary */ - case 516: /* from_clause_opt */ - case 517: /* table_reference_list */ - case 518: /* table_reference */ - case 519: /* table_primary */ - case 520: /* joined_table */ - case 522: /* subquery */ - case 523: /* parenthesized_joined_table */ - case 526: /* join_on_clause_opt */ - case 527: /* window_offset_clause_opt */ - case 528: /* jlimit_clause_opt */ - case 529: /* window_offset_literal */ - case 530: /* query_specification */ - case 536: /* range_opt */ - case 537: /* every_opt */ - case 538: /* fill_opt */ - case 539: /* twindow_clause_opt */ - case 541: /* having_clause_opt */ - case 542: /* select_item */ - case 544: /* partition_item */ - case 545: /* interval_sliding_duration_literal */ - case 548: /* query_expression */ - case 549: /* query_simple */ - case 551: /* slimit_clause_opt */ - case 552: /* limit_clause_opt */ - case 553: /* union_query_expression */ - case 554: /* query_simple_or_subquery */ - case 556: /* sort_specification */ + case 423: /* alter_table_clause */ + case 424: /* alter_table_options */ + case 427: /* column_options */ + case 428: /* tags_literal */ + case 429: /* create_subtable_clause */ + case 432: /* drop_table_clause */ + case 435: /* tag_def */ + case 436: /* column_def */ + case 441: /* duration_literal */ + case 442: /* rollup_func_name */ + case 444: /* col_name */ + case 447: /* like_pattern_opt */ + case 448: /* db_name_cond_opt */ + case 449: /* table_name_cond */ + case 450: /* from_db_opt */ + case 452: /* tag_item */ + case 456: /* full_tsma_name */ + case 458: /* index_options */ + case 459: /* full_index_name */ + case 461: /* sliding_opt */ + case 462: /* sma_stream_opt */ + case 463: /* func */ + case 467: /* query_or_subquery */ + case 468: /* where_clause_opt */ + case 471: /* explain_options */ + case 472: /* insert_query */ + case 477: /* full_view_name */ + case 480: /* stream_options */ + case 483: /* subtable_opt */ + case 486: /* column_stream_def */ + case 487: /* stream_col_options */ + case 488: /* expression */ + case 491: /* literal_func */ + case 492: /* signed_literal */ + case 495: /* expr_or_subquery */ + case 496: /* pseudo_column */ + case 497: /* column_reference */ + case 498: /* function_expression */ + case 499: /* case_when_expression */ + case 504: /* star_func_para */ + case 506: /* case_when_else_opt */ + case 507: /* common_expression */ + case 508: /* when_then_expr */ + case 509: /* predicate */ + case 512: /* in_predicate_value */ + case 513: /* boolean_value_expression */ + case 514: /* boolean_primary */ + case 515: /* from_clause_opt */ + case 516: /* table_reference_list */ + case 517: /* table_reference */ + case 518: /* table_primary */ + case 519: /* joined_table */ + case 521: /* subquery */ + case 522: /* parenthesized_joined_table */ + case 525: /* join_on_clause_opt */ + case 526: /* window_offset_clause_opt */ + case 527: /* jlimit_clause_opt */ + case 528: /* window_offset_literal */ + case 529: /* query_specification */ + case 535: /* range_opt */ + case 536: /* every_opt */ + case 537: /* fill_opt */ + case 538: /* twindow_clause_opt */ + case 540: /* having_clause_opt */ + case 541: /* select_item */ + case 543: /* partition_item */ + case 544: /* interval_sliding_duration_literal */ + case 547: /* query_expression */ + case 548: /* query_simple */ + case 550: /* slimit_clause_opt */ + case 551: /* limit_clause_opt */ + case 552: /* union_query_expression */ + case 553: /* query_simple_or_subquery */ + case 555: /* sort_specification */ { #line 7 "sql.y" - nodesDestroyNode((yypminor->yy54)); -#line 3538 "sql.c" + nodesDestroyNode((yypminor->yy416)); +#line 3517 "sql.c" } break; case 379: /* account_options */ case 380: /* alter_account_options */ case 382: /* alter_account_option */ case 406: /* speed_opt */ - case 467: /* with_meta */ - case 476: /* bufsize_opt */ + case 466: /* with_meta */ + case 475: /* bufsize_opt */ { #line 54 "sql.y" -#line 3550 "sql.c" +#line 3529 "sql.c" } break; case 383: /* ip_range_list */ @@ -3559,37 +3538,37 @@ static void yy_destructor( case 416: /* column_def_list */ case 417: /* tags_def_opt */ case 419: /* multi_create_clause */ - case 420: /* tags_def */ - case 421: /* multi_drop_clause */ + case 420: /* tag_list_opt */ + case 421: /* tags_def */ + case 422: /* multi_drop_clause */ case 430: /* specific_cols_opt */ case 431: /* tags_literal_list */ - case 432: /* tag_list_opt */ - case 434: /* col_name_list */ - case 435: /* tag_def_list */ - case 439: /* duration_list */ - case 440: /* rollup_func_list */ - case 458: /* func_list */ - case 466: /* expression_list */ - case 482: /* col_list_opt */ - case 483: /* tag_def_or_ref_opt */ - case 486: /* column_stream_def_list */ - case 491: /* dnode_list */ - case 494: /* literal_list */ - case 502: /* star_func_para_list */ - case 504: /* other_para_list */ - case 506: /* when_then_list */ - case 531: /* hint_list */ - case 534: /* select_list */ - case 535: /* partition_by_clause_opt */ - case 540: /* group_by_clause_opt */ - case 543: /* partition_list */ - case 547: /* group_by_list */ - case 550: /* order_by_clause_opt */ - case 555: /* sort_specification_list */ + case 433: /* col_name_list */ + case 434: /* tag_def_list */ + case 438: /* duration_list */ + case 439: /* rollup_func_list */ + case 457: /* func_list */ + case 465: /* expression_list */ + case 481: /* col_list_opt */ + case 482: /* tag_def_or_ref_opt */ + case 485: /* column_stream_def_list */ + case 490: /* dnode_list */ + case 493: /* literal_list */ + case 501: /* star_func_para_list */ + case 503: /* other_para_list */ + case 505: /* when_then_list */ + case 530: /* hint_list */ + case 533: /* select_list */ + case 534: /* partition_by_clause_opt */ + case 539: /* group_by_clause_opt */ + case 542: /* partition_list */ + case 546: /* group_by_list */ + case 549: /* order_by_clause_opt */ + case 554: /* sort_specification_list */ { #line 85 "sql.y" - nodesDestroyList((yypminor->yy652)); -#line 3592 "sql.c" + nodesDestroyList((yypminor->yy316)); +#line 3571 "sql.c" } break; case 386: /* is_import_opt */ @@ -3598,7 +3577,7 @@ static void yy_destructor( { #line 99 "sql.y" -#line 3601 "sql.c" +#line 3580 "sql.c" } break; case 388: /* user_name */ @@ -3606,25 +3585,25 @@ static void yy_destructor( case 396: /* table_name */ case 397: /* topic_name */ case 399: /* dnode_endpoint */ - case 424: /* column_name */ - case 444: /* function_name */ - case 454: /* column_alias */ - case 455: /* tsma_name */ - case 461: /* index_name */ - case 465: /* sma_func_name */ - case 470: /* cgroup_name */ - case 477: /* language_opt */ - case 479: /* view_name */ - case 480: /* stream_name */ - case 490: /* on_vgroup_id */ - case 495: /* table_alias */ - case 501: /* star_func */ - case 503: /* noarg_func */ - case 521: /* alias_opt */ + case 425: /* column_name */ + case 443: /* function_name */ + case 453: /* column_alias */ + case 454: /* tsma_name */ + case 460: /* index_name */ + case 464: /* sma_func_name */ + case 469: /* cgroup_name */ + case 476: /* language_opt */ + case 478: /* view_name */ + case 479: /* stream_name */ + case 489: /* on_vgroup_id */ + case 494: /* table_alias */ + case 500: /* star_func */ + case 502: /* noarg_func */ + case 520: /* alias_opt */ { -#line 1084 "sql.y" +#line 1082 "sql.y" -#line 3627 "sql.c" +#line 3606 "sql.c" } break; case 390: /* privileges */ @@ -3633,111 +3612,111 @@ static void yy_destructor( { #line 131 "sql.y" -#line 3636 "sql.c" +#line 3615 "sql.c" } break; case 391: /* priv_level */ { #line 148 "sql.y" -#line 3643 "sql.c" +#line 3622 "sql.c" } break; case 400: /* force_opt */ case 401: /* unsafe_opt */ case 402: /* not_exists_opt */ case 404: /* exists_opt */ - case 471: /* analyze_opt */ - case 474: /* or_replace_opt */ - case 475: /* agg_func_opt */ - case 485: /* ignore_opt */ - case 532: /* set_quantifier_opt */ - case 533: /* tag_mode_opt */ + case 470: /* analyze_opt */ + case 473: /* or_replace_opt */ + case 474: /* agg_func_opt */ + case 484: /* ignore_opt */ + case 531: /* set_quantifier_opt */ + case 532: /* tag_mode_opt */ { #line 180 "sql.y" -#line 3659 "sql.c" +#line 3638 "sql.c" } break; case 413: /* alter_db_option */ - case 441: /* alter_table_option */ + case 440: /* alter_table_option */ { #line 288 "sql.y" -#line 3667 "sql.c" +#line 3646 "sql.c" } break; - case 425: /* type_name */ - case 438: /* type_name_default_len */ + case 426: /* type_name */ + case 437: /* type_name_default_len */ { -#line 427 "sql.y" +#line 425 "sql.y" -#line 3675 "sql.c" +#line 3654 "sql.c" } break; - case 446: /* db_kind_opt */ - case 452: /* table_kind */ + case 445: /* db_kind_opt */ + case 451: /* table_kind */ { -#line 606 "sql.y" +#line 604 "sql.y" -#line 3683 "sql.c" +#line 3662 "sql.c" } break; - case 447: /* table_kind_db_name_cond_opt */ + case 446: /* table_kind_db_name_cond_opt */ { -#line 571 "sql.y" +#line 569 "sql.y" -#line 3690 "sql.c" +#line 3669 "sql.c" } break; - case 456: /* tsma_func_list */ + case 455: /* tsma_func_list */ { -#line 625 "sql.y" - nodesDestroyNode((yypminor->yy54)); -#line 3697 "sql.c" +#line 623 "sql.y" + nodesDestroyNode((yypminor->yy416)); +#line 3676 "sql.c" } break; - case 511: /* compare_op */ - case 512: /* in_op */ + case 510: /* compare_op */ + case 511: /* in_op */ { -#line 1282 "sql.y" +#line 1280 "sql.y" + +#line 3684 "sql.c" +} + break; + case 523: /* join_type */ +{ +#line 1361 "sql.y" + +#line 3691 "sql.c" +} + break; + case 524: /* join_subtype */ +{ +#line 1369 "sql.y" + +#line 3698 "sql.c" +} + break; + case 545: /* fill_mode */ +{ +#line 1485 "sql.y" #line 3705 "sql.c" } break; - case 524: /* join_type */ + case 556: /* ordering_specification_opt */ { -#line 1363 "sql.y" +#line 1570 "sql.y" #line 3712 "sql.c" } break; - case 525: /* join_subtype */ + case 557: /* null_ordering_opt */ { -#line 1371 "sql.y" +#line 1576 "sql.y" #line 3719 "sql.c" -} - break; - case 546: /* fill_mode */ -{ -#line 1487 "sql.y" - -#line 3726 "sql.c" -} - break; - case 557: /* ordering_specification_opt */ -{ -#line 1572 "sql.y" - -#line 3733 "sql.c" -} - break; - case 558: /* null_ordering_opt */ -{ -#line 1578 "sql.y" - -#line 3740 "sql.c" } break; /********* End destructor definitions *****************************************/ @@ -4209,579 +4188,578 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 408, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ 378, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ 378, /* (182) cmd ::= CREATE TABLE multi_create_clause */ - 378, /* (183) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 378, /* (184) cmd ::= DROP TABLE multi_drop_clause */ - 378, /* (185) cmd ::= DROP STABLE exists_opt full_table_name */ - 378, /* (186) cmd ::= ALTER TABLE alter_table_clause */ - 378, /* (187) cmd ::= ALTER STABLE alter_table_clause */ - 422, /* (188) alter_table_clause ::= full_table_name alter_table_options */ - 422, /* (189) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - 422, /* (190) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 422, /* (191) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 422, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - 422, /* (193) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 422, /* (194) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 422, /* (195) alter_table_clause ::= full_table_name DROP TAG column_name */ - 422, /* (196) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 422, /* (197) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 422, /* (198) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 419, /* (199) multi_create_clause ::= create_subtable_clause */ - 419, /* (200) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 419, /* (201) multi_create_clause ::= create_from_file_clause */ - 428, /* (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 */ - 429, /* (203) create_from_file_clause ::= not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - 421, /* (204) multi_drop_clause ::= drop_table_clause */ - 421, /* (205) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 433, /* (206) drop_table_clause ::= exists_opt full_table_name */ - 430, /* (207) specific_cols_opt ::= */ - 430, /* (208) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 415, /* (209) full_table_name ::= table_name */ - 415, /* (210) full_table_name ::= db_name NK_DOT table_name */ - 435, /* (211) tag_def_list ::= tag_def */ - 435, /* (212) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - 436, /* (213) tag_def ::= column_name type_name */ - 416, /* (214) column_def_list ::= column_def */ - 416, /* (215) column_def_list ::= column_def_list NK_COMMA column_def */ - 437, /* (216) column_def ::= column_name type_name column_options */ - 425, /* (217) type_name ::= BOOL */ - 425, /* (218) type_name ::= TINYINT */ - 425, /* (219) type_name ::= SMALLINT */ - 425, /* (220) type_name ::= INT */ - 425, /* (221) type_name ::= INTEGER */ - 425, /* (222) type_name ::= BIGINT */ - 425, /* (223) type_name ::= FLOAT */ - 425, /* (224) type_name ::= DOUBLE */ - 425, /* (225) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 425, /* (226) type_name ::= TIMESTAMP */ - 425, /* (227) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 425, /* (228) type_name ::= TINYINT UNSIGNED */ - 425, /* (229) type_name ::= SMALLINT UNSIGNED */ - 425, /* (230) type_name ::= INT UNSIGNED */ - 425, /* (231) type_name ::= BIGINT UNSIGNED */ - 425, /* (232) type_name ::= JSON */ - 425, /* (233) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 425, /* (234) type_name ::= MEDIUMBLOB */ - 425, /* (235) type_name ::= BLOB */ - 425, /* (236) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 425, /* (237) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 425, /* (238) type_name ::= DECIMAL */ - 425, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 425, /* (240) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 438, /* (241) type_name_default_len ::= BINARY */ - 438, /* (242) type_name_default_len ::= NCHAR */ - 438, /* (243) type_name_default_len ::= VARCHAR */ - 438, /* (244) type_name_default_len ::= VARBINARY */ - 417, /* (245) tags_def_opt ::= */ - 417, /* (246) tags_def_opt ::= tags_def */ - 420, /* (247) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 418, /* (248) table_options ::= */ - 418, /* (249) table_options ::= table_options COMMENT NK_STRING */ - 418, /* (250) table_options ::= table_options MAX_DELAY duration_list */ - 418, /* (251) table_options ::= table_options WATERMARK duration_list */ - 418, /* (252) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 418, /* (253) table_options ::= table_options TTL NK_INTEGER */ - 418, /* (254) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 418, /* (255) table_options ::= table_options DELETE_MARK duration_list */ - 423, /* (256) alter_table_options ::= alter_table_option */ - 423, /* (257) alter_table_options ::= alter_table_options alter_table_option */ - 441, /* (258) alter_table_option ::= COMMENT NK_STRING */ - 441, /* (259) alter_table_option ::= TTL NK_INTEGER */ - 439, /* (260) duration_list ::= duration_literal */ - 439, /* (261) duration_list ::= duration_list NK_COMMA duration_literal */ - 440, /* (262) rollup_func_list ::= rollup_func_name */ - 440, /* (263) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 443, /* (264) rollup_func_name ::= function_name */ - 443, /* (265) rollup_func_name ::= FIRST */ - 443, /* (266) rollup_func_name ::= LAST */ - 434, /* (267) col_name_list ::= col_name */ - 434, /* (268) col_name_list ::= col_name_list NK_COMMA col_name */ - 445, /* (269) col_name ::= column_name */ - 378, /* (270) cmd ::= SHOW DNODES */ - 378, /* (271) cmd ::= SHOW USERS */ - 378, /* (272) cmd ::= SHOW USERS FULL */ - 378, /* (273) cmd ::= SHOW USER PRIVILEGES */ - 378, /* (274) cmd ::= SHOW db_kind_opt DATABASES */ - 378, /* (275) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 378, /* (276) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 378, /* (277) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 378, /* (278) cmd ::= SHOW MNODES */ - 378, /* (279) cmd ::= SHOW QNODES */ - 378, /* (280) cmd ::= SHOW ARBGROUPS */ - 378, /* (281) cmd ::= SHOW FUNCTIONS */ - 378, /* (282) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 378, /* (283) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 378, /* (284) cmd ::= SHOW STREAMS */ - 378, /* (285) cmd ::= SHOW ACCOUNTS */ - 378, /* (286) cmd ::= SHOW APPS */ - 378, /* (287) cmd ::= SHOW CONNECTIONS */ - 378, /* (288) cmd ::= SHOW LICENCES */ - 378, /* (289) cmd ::= SHOW GRANTS */ - 378, /* (290) cmd ::= SHOW GRANTS FULL */ - 378, /* (291) cmd ::= SHOW GRANTS LOGS */ - 378, /* (292) cmd ::= SHOW CLUSTER MACHINES */ - 378, /* (293) cmd ::= SHOW CREATE DATABASE db_name */ - 378, /* (294) cmd ::= SHOW CREATE TABLE full_table_name */ - 378, /* (295) cmd ::= SHOW CREATE STABLE full_table_name */ - 378, /* (296) cmd ::= SHOW ENCRYPTIONS */ - 378, /* (297) cmd ::= SHOW QUERIES */ - 378, /* (298) cmd ::= SHOW SCORES */ - 378, /* (299) cmd ::= SHOW TOPICS */ - 378, /* (300) cmd ::= SHOW VARIABLES */ - 378, /* (301) cmd ::= SHOW CLUSTER VARIABLES */ - 378, /* (302) cmd ::= SHOW LOCAL VARIABLES */ - 378, /* (303) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 378, /* (304) cmd ::= SHOW BNODES */ - 378, /* (305) cmd ::= SHOW SNODES */ - 378, /* (306) cmd ::= SHOW CLUSTER */ - 378, /* (307) cmd ::= SHOW TRANSACTIONS */ - 378, /* (308) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 378, /* (309) cmd ::= SHOW CONSUMERS */ - 378, /* (310) cmd ::= SHOW SUBSCRIPTIONS */ - 378, /* (311) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 378, /* (312) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 378, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 378, /* (314) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 378, /* (315) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 378, /* (316) cmd ::= SHOW VNODES */ - 378, /* (317) cmd ::= SHOW db_name_cond_opt ALIVE */ - 378, /* (318) cmd ::= SHOW CLUSTER ALIVE */ - 378, /* (319) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 378, /* (320) cmd ::= SHOW CREATE VIEW full_table_name */ - 378, /* (321) cmd ::= SHOW COMPACTS */ - 378, /* (322) cmd ::= SHOW COMPACT NK_INTEGER */ - 447, /* (323) table_kind_db_name_cond_opt ::= */ - 447, /* (324) table_kind_db_name_cond_opt ::= table_kind */ - 447, /* (325) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 447, /* (326) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 452, /* (327) table_kind ::= NORMAL */ - 452, /* (328) table_kind ::= CHILD */ - 449, /* (329) db_name_cond_opt ::= */ - 449, /* (330) db_name_cond_opt ::= db_name NK_DOT */ - 448, /* (331) like_pattern_opt ::= */ - 448, /* (332) like_pattern_opt ::= LIKE NK_STRING */ - 450, /* (333) table_name_cond ::= table_name */ - 451, /* (334) from_db_opt ::= */ - 451, /* (335) from_db_opt ::= FROM db_name */ - 432, /* (336) tag_list_opt ::= */ - 432, /* (337) tag_list_opt ::= tag_item */ - 432, /* (338) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 453, /* (339) tag_item ::= TBNAME */ - 453, /* (340) tag_item ::= QTAGS */ - 453, /* (341) tag_item ::= column_name */ - 453, /* (342) tag_item ::= column_name column_alias */ - 453, /* (343) tag_item ::= column_name AS column_alias */ - 446, /* (344) db_kind_opt ::= */ - 446, /* (345) db_kind_opt ::= USER */ - 446, /* (346) db_kind_opt ::= SYSTEM */ - 378, /* (347) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - 378, /* (348) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - 378, /* (349) cmd ::= DROP TSMA exists_opt full_tsma_name */ - 378, /* (350) cmd ::= SHOW db_name_cond_opt TSMAS */ - 457, /* (351) full_tsma_name ::= tsma_name */ - 457, /* (352) full_tsma_name ::= db_name NK_DOT tsma_name */ - 456, /* (353) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - 378, /* (354) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 378, /* (355) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 378, /* (356) cmd ::= DROP INDEX exists_opt full_index_name */ - 460, /* (357) full_index_name ::= index_name */ - 460, /* (358) full_index_name ::= db_name NK_DOT index_name */ - 459, /* (359) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 459, /* (360) 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 */ - 458, /* (361) func_list ::= func */ - 458, /* (362) func_list ::= func_list NK_COMMA func */ - 464, /* (363) func ::= sma_func_name NK_LP expression_list NK_RP */ - 465, /* (364) sma_func_name ::= function_name */ - 465, /* (365) sma_func_name ::= COUNT */ - 465, /* (366) sma_func_name ::= FIRST */ - 465, /* (367) sma_func_name ::= LAST */ - 465, /* (368) sma_func_name ::= LAST_ROW */ - 463, /* (369) sma_stream_opt ::= */ - 463, /* (370) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 463, /* (371) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 463, /* (372) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 467, /* (373) with_meta ::= AS */ - 467, /* (374) with_meta ::= WITH META AS */ - 467, /* (375) with_meta ::= ONLY META AS */ - 378, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 378, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 378, /* (378) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 378, /* (379) cmd ::= DROP TOPIC exists_opt topic_name */ - 378, /* (380) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 378, /* (381) cmd ::= DESC full_table_name */ - 378, /* (382) cmd ::= DESCRIBE full_table_name */ - 378, /* (383) cmd ::= RESET QUERY CACHE */ - 378, /* (384) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 378, /* (385) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 471, /* (386) analyze_opt ::= */ - 471, /* (387) analyze_opt ::= ANALYZE */ - 472, /* (388) explain_options ::= */ - 472, /* (389) explain_options ::= explain_options VERBOSE NK_BOOL */ - 472, /* (390) explain_options ::= explain_options RATIO NK_FLOAT */ - 378, /* (391) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 378, /* (392) cmd ::= DROP FUNCTION exists_opt function_name */ - 475, /* (393) agg_func_opt ::= */ - 475, /* (394) agg_func_opt ::= AGGREGATE */ - 476, /* (395) bufsize_opt ::= */ - 476, /* (396) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 477, /* (397) language_opt ::= */ - 477, /* (398) language_opt ::= LANGUAGE NK_STRING */ - 474, /* (399) or_replace_opt ::= */ - 474, /* (400) or_replace_opt ::= OR REPLACE */ - 378, /* (401) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 378, /* (402) cmd ::= DROP VIEW exists_opt full_view_name */ - 478, /* (403) full_view_name ::= view_name */ - 478, /* (404) full_view_name ::= db_name NK_DOT view_name */ - 378, /* (405) 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 */ - 378, /* (406) cmd ::= DROP STREAM exists_opt stream_name */ - 378, /* (407) cmd ::= PAUSE STREAM exists_opt stream_name */ - 378, /* (408) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 482, /* (409) col_list_opt ::= */ - 482, /* (410) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - 486, /* (411) column_stream_def_list ::= column_stream_def */ - 486, /* (412) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - 487, /* (413) column_stream_def ::= column_name stream_col_options */ - 488, /* (414) stream_col_options ::= */ - 488, /* (415) stream_col_options ::= stream_col_options PRIMARY KEY */ - 483, /* (416) tag_def_or_ref_opt ::= */ - 483, /* (417) tag_def_or_ref_opt ::= tags_def */ - 483, /* (418) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 481, /* (419) stream_options ::= */ - 481, /* (420) stream_options ::= stream_options TRIGGER AT_ONCE */ - 481, /* (421) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 481, /* (422) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 481, /* (423) stream_options ::= stream_options WATERMARK duration_literal */ - 481, /* (424) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 481, /* (425) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 481, /* (426) stream_options ::= stream_options DELETE_MARK duration_literal */ - 481, /* (427) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 484, /* (428) subtable_opt ::= */ - 484, /* (429) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 485, /* (430) ignore_opt ::= */ - 485, /* (431) ignore_opt ::= IGNORE UNTREATED */ - 378, /* (432) cmd ::= KILL CONNECTION NK_INTEGER */ - 378, /* (433) cmd ::= KILL QUERY NK_STRING */ - 378, /* (434) cmd ::= KILL TRANSACTION NK_INTEGER */ - 378, /* (435) cmd ::= KILL COMPACT NK_INTEGER */ - 378, /* (436) cmd ::= BALANCE VGROUP */ - 378, /* (437) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 378, /* (438) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - 378, /* (439) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 378, /* (440) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 378, /* (441) cmd ::= SPLIT VGROUP NK_INTEGER */ - 490, /* (442) on_vgroup_id ::= */ - 490, /* (443) on_vgroup_id ::= ON NK_INTEGER */ - 491, /* (444) dnode_list ::= DNODE NK_INTEGER */ - 491, /* (445) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 378, /* (446) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 378, /* (447) cmd ::= query_or_subquery */ - 378, /* (448) cmd ::= insert_query */ - 473, /* (449) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 473, /* (450) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 427, /* (451) tags_literal ::= NK_INTEGER */ - 427, /* (452) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - 427, /* (453) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - 427, /* (454) tags_literal ::= NK_PLUS NK_INTEGER */ - 427, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - 427, /* (456) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - 427, /* (457) tags_literal ::= NK_MINUS NK_INTEGER */ - 427, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - 427, /* (459) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - 427, /* (460) tags_literal ::= NK_FLOAT */ - 427, /* (461) tags_literal ::= NK_PLUS NK_FLOAT */ - 427, /* (462) tags_literal ::= NK_MINUS NK_FLOAT */ - 427, /* (463) tags_literal ::= NK_BIN */ - 427, /* (464) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - 427, /* (465) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - 427, /* (466) tags_literal ::= NK_PLUS NK_BIN */ - 427, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - 427, /* (468) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - 427, /* (469) tags_literal ::= NK_MINUS NK_BIN */ - 427, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - 427, /* (471) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - 427, /* (472) tags_literal ::= NK_HEX */ - 427, /* (473) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - 427, /* (474) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - 427, /* (475) tags_literal ::= NK_PLUS NK_HEX */ - 427, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - 427, /* (477) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - 427, /* (478) tags_literal ::= NK_MINUS NK_HEX */ - 427, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - 427, /* (480) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - 427, /* (481) tags_literal ::= NK_STRING */ - 427, /* (482) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - 427, /* (483) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - 427, /* (484) tags_literal ::= NK_BOOL */ - 427, /* (485) tags_literal ::= NULL */ - 427, /* (486) tags_literal ::= literal_func */ - 427, /* (487) tags_literal ::= literal_func NK_PLUS duration_literal */ - 427, /* (488) tags_literal ::= literal_func NK_MINUS duration_literal */ - 431, /* (489) tags_literal_list ::= tags_literal */ - 431, /* (490) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 381, /* (491) literal ::= NK_INTEGER */ - 381, /* (492) literal ::= NK_FLOAT */ - 381, /* (493) literal ::= NK_STRING */ - 381, /* (494) literal ::= NK_BOOL */ - 381, /* (495) literal ::= TIMESTAMP NK_STRING */ - 381, /* (496) literal ::= duration_literal */ - 381, /* (497) literal ::= NULL */ - 381, /* (498) literal ::= NK_QUESTION */ - 442, /* (499) duration_literal ::= NK_VARIABLE */ - 412, /* (500) signed ::= NK_INTEGER */ - 412, /* (501) signed ::= NK_PLUS NK_INTEGER */ - 412, /* (502) signed ::= NK_MINUS NK_INTEGER */ - 412, /* (503) signed ::= NK_FLOAT */ - 412, /* (504) signed ::= NK_PLUS NK_FLOAT */ - 412, /* (505) signed ::= NK_MINUS NK_FLOAT */ - 493, /* (506) signed_literal ::= signed */ - 493, /* (507) signed_literal ::= NK_STRING */ - 493, /* (508) signed_literal ::= NK_BOOL */ - 493, /* (509) signed_literal ::= TIMESTAMP NK_STRING */ - 493, /* (510) signed_literal ::= duration_literal */ - 493, /* (511) signed_literal ::= NULL */ - 493, /* (512) signed_literal ::= literal_func */ - 493, /* (513) signed_literal ::= NK_QUESTION */ - 494, /* (514) literal_list ::= signed_literal */ - 494, /* (515) literal_list ::= literal_list NK_COMMA signed_literal */ - 395, /* (516) db_name ::= NK_ID */ - 396, /* (517) table_name ::= NK_ID */ - 424, /* (518) column_name ::= NK_ID */ - 444, /* (519) function_name ::= NK_ID */ - 479, /* (520) view_name ::= NK_ID */ - 495, /* (521) table_alias ::= NK_ID */ - 454, /* (522) column_alias ::= NK_ID */ - 454, /* (523) column_alias ::= NK_ALIAS */ - 388, /* (524) user_name ::= NK_ID */ - 397, /* (525) topic_name ::= NK_ID */ - 480, /* (526) stream_name ::= NK_ID */ - 470, /* (527) cgroup_name ::= NK_ID */ - 461, /* (528) index_name ::= NK_ID */ - 455, /* (529) tsma_name ::= NK_ID */ - 496, /* (530) expr_or_subquery ::= expression */ - 489, /* (531) expression ::= literal */ - 489, /* (532) expression ::= pseudo_column */ - 489, /* (533) expression ::= column_reference */ - 489, /* (534) expression ::= function_expression */ - 489, /* (535) expression ::= case_when_expression */ - 489, /* (536) expression ::= NK_LP expression NK_RP */ - 489, /* (537) expression ::= NK_PLUS expr_or_subquery */ - 489, /* (538) expression ::= NK_MINUS expr_or_subquery */ - 489, /* (539) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 489, /* (540) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 489, /* (541) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 489, /* (542) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 489, /* (543) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 489, /* (544) expression ::= column_reference NK_ARROW NK_STRING */ - 489, /* (545) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 489, /* (546) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 466, /* (547) expression_list ::= expr_or_subquery */ - 466, /* (548) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 498, /* (549) column_reference ::= column_name */ - 498, /* (550) column_reference ::= table_name NK_DOT column_name */ - 498, /* (551) column_reference ::= NK_ALIAS */ - 498, /* (552) column_reference ::= table_name NK_DOT NK_ALIAS */ - 497, /* (553) pseudo_column ::= ROWTS */ - 497, /* (554) pseudo_column ::= TBNAME */ - 497, /* (555) pseudo_column ::= table_name NK_DOT TBNAME */ - 497, /* (556) pseudo_column ::= QSTART */ - 497, /* (557) pseudo_column ::= QEND */ - 497, /* (558) pseudo_column ::= QDURATION */ - 497, /* (559) pseudo_column ::= WSTART */ - 497, /* (560) pseudo_column ::= WEND */ - 497, /* (561) pseudo_column ::= WDURATION */ - 497, /* (562) pseudo_column ::= IROWTS */ - 497, /* (563) pseudo_column ::= ISFILLED */ - 497, /* (564) pseudo_column ::= QTAGS */ - 499, /* (565) function_expression ::= function_name NK_LP expression_list NK_RP */ - 499, /* (566) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 499, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 499, /* (568) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - 499, /* (569) function_expression ::= literal_func */ - 492, /* (570) literal_func ::= noarg_func NK_LP NK_RP */ - 492, /* (571) literal_func ::= NOW */ - 492, /* (572) literal_func ::= TODAY */ - 503, /* (573) noarg_func ::= NOW */ - 503, /* (574) noarg_func ::= TODAY */ - 503, /* (575) noarg_func ::= TIMEZONE */ - 503, /* (576) noarg_func ::= DATABASE */ - 503, /* (577) noarg_func ::= CLIENT_VERSION */ - 503, /* (578) noarg_func ::= SERVER_VERSION */ - 503, /* (579) noarg_func ::= SERVER_STATUS */ - 503, /* (580) noarg_func ::= CURRENT_USER */ - 503, /* (581) noarg_func ::= USER */ - 501, /* (582) star_func ::= COUNT */ - 501, /* (583) star_func ::= FIRST */ - 501, /* (584) star_func ::= LAST */ - 501, /* (585) star_func ::= LAST_ROW */ - 502, /* (586) star_func_para_list ::= NK_STAR */ - 502, /* (587) star_func_para_list ::= other_para_list */ - 504, /* (588) other_para_list ::= star_func_para */ - 504, /* (589) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 505, /* (590) star_func_para ::= expr_or_subquery */ - 505, /* (591) star_func_para ::= table_name NK_DOT NK_STAR */ - 500, /* (592) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 500, /* (593) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 506, /* (594) when_then_list ::= when_then_expr */ - 506, /* (595) when_then_list ::= when_then_list when_then_expr */ - 509, /* (596) when_then_expr ::= WHEN common_expression THEN common_expression */ - 507, /* (597) case_when_else_opt ::= */ - 507, /* (598) case_when_else_opt ::= ELSE common_expression */ - 510, /* (599) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 510, /* (600) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 510, /* (601) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 510, /* (602) predicate ::= expr_or_subquery IS NULL */ - 510, /* (603) predicate ::= expr_or_subquery IS NOT NULL */ - 510, /* (604) predicate ::= expr_or_subquery in_op in_predicate_value */ - 511, /* (605) compare_op ::= NK_LT */ - 511, /* (606) compare_op ::= NK_GT */ - 511, /* (607) compare_op ::= NK_LE */ - 511, /* (608) compare_op ::= NK_GE */ - 511, /* (609) compare_op ::= NK_NE */ - 511, /* (610) compare_op ::= NK_EQ */ - 511, /* (611) compare_op ::= LIKE */ - 511, /* (612) compare_op ::= NOT LIKE */ - 511, /* (613) compare_op ::= MATCH */ - 511, /* (614) compare_op ::= NMATCH */ - 511, /* (615) compare_op ::= CONTAINS */ - 512, /* (616) in_op ::= IN */ - 512, /* (617) in_op ::= NOT IN */ - 513, /* (618) in_predicate_value ::= NK_LP literal_list NK_RP */ - 514, /* (619) boolean_value_expression ::= boolean_primary */ - 514, /* (620) boolean_value_expression ::= NOT boolean_primary */ - 514, /* (621) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 514, /* (622) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 515, /* (623) boolean_primary ::= predicate */ - 515, /* (624) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 508, /* (625) common_expression ::= expr_or_subquery */ - 508, /* (626) common_expression ::= boolean_value_expression */ - 516, /* (627) from_clause_opt ::= */ - 516, /* (628) from_clause_opt ::= FROM table_reference_list */ - 517, /* (629) table_reference_list ::= table_reference */ - 517, /* (630) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 518, /* (631) table_reference ::= table_primary */ - 518, /* (632) table_reference ::= joined_table */ - 519, /* (633) table_primary ::= table_name alias_opt */ - 519, /* (634) table_primary ::= db_name NK_DOT table_name alias_opt */ - 519, /* (635) table_primary ::= subquery alias_opt */ - 519, /* (636) table_primary ::= parenthesized_joined_table */ - 521, /* (637) alias_opt ::= */ - 521, /* (638) alias_opt ::= table_alias */ - 521, /* (639) alias_opt ::= AS table_alias */ - 523, /* (640) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 523, /* (641) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 520, /* (642) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 524, /* (643) join_type ::= */ - 524, /* (644) join_type ::= INNER */ - 524, /* (645) join_type ::= LEFT */ - 524, /* (646) join_type ::= RIGHT */ - 524, /* (647) join_type ::= FULL */ - 525, /* (648) join_subtype ::= */ - 525, /* (649) join_subtype ::= OUTER */ - 525, /* (650) join_subtype ::= SEMI */ - 525, /* (651) join_subtype ::= ANTI */ - 525, /* (652) join_subtype ::= ASOF */ - 525, /* (653) join_subtype ::= WINDOW */ - 526, /* (654) join_on_clause_opt ::= */ - 526, /* (655) join_on_clause_opt ::= ON search_condition */ - 527, /* (656) window_offset_clause_opt ::= */ - 527, /* (657) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 529, /* (658) window_offset_literal ::= NK_VARIABLE */ - 529, /* (659) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 528, /* (660) jlimit_clause_opt ::= */ - 528, /* (661) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 530, /* (662) 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 */ - 531, /* (663) hint_list ::= */ - 531, /* (664) hint_list ::= NK_HINT */ - 533, /* (665) tag_mode_opt ::= */ - 533, /* (666) tag_mode_opt ::= TAGS */ - 532, /* (667) set_quantifier_opt ::= */ - 532, /* (668) set_quantifier_opt ::= DISTINCT */ - 532, /* (669) set_quantifier_opt ::= ALL */ - 534, /* (670) select_list ::= select_item */ - 534, /* (671) select_list ::= select_list NK_COMMA select_item */ - 542, /* (672) select_item ::= NK_STAR */ - 542, /* (673) select_item ::= common_expression */ - 542, /* (674) select_item ::= common_expression column_alias */ - 542, /* (675) select_item ::= common_expression AS column_alias */ - 542, /* (676) select_item ::= table_name NK_DOT NK_STAR */ - 469, /* (677) where_clause_opt ::= */ - 469, /* (678) where_clause_opt ::= WHERE search_condition */ - 535, /* (679) partition_by_clause_opt ::= */ - 535, /* (680) partition_by_clause_opt ::= PARTITION BY partition_list */ - 543, /* (681) partition_list ::= partition_item */ - 543, /* (682) partition_list ::= partition_list NK_COMMA partition_item */ - 544, /* (683) partition_item ::= expr_or_subquery */ - 544, /* (684) partition_item ::= expr_or_subquery column_alias */ - 544, /* (685) partition_item ::= expr_or_subquery AS column_alias */ - 539, /* (686) twindow_clause_opt ::= */ - 539, /* (687) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 539, /* (688) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 539, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 539, /* (690) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 539, /* (691) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 539, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 539, /* (693) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 462, /* (694) sliding_opt ::= */ - 462, /* (695) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 545, /* (696) interval_sliding_duration_literal ::= NK_VARIABLE */ - 545, /* (697) interval_sliding_duration_literal ::= NK_STRING */ - 545, /* (698) interval_sliding_duration_literal ::= NK_INTEGER */ - 538, /* (699) fill_opt ::= */ - 538, /* (700) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 538, /* (701) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 538, /* (702) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 546, /* (703) fill_mode ::= NONE */ - 546, /* (704) fill_mode ::= PREV */ - 546, /* (705) fill_mode ::= NULL */ - 546, /* (706) fill_mode ::= NULL_F */ - 546, /* (707) fill_mode ::= LINEAR */ - 546, /* (708) fill_mode ::= NEXT */ - 540, /* (709) group_by_clause_opt ::= */ - 540, /* (710) group_by_clause_opt ::= GROUP BY group_by_list */ - 547, /* (711) group_by_list ::= expr_or_subquery */ - 547, /* (712) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 541, /* (713) having_clause_opt ::= */ - 541, /* (714) having_clause_opt ::= HAVING search_condition */ - 536, /* (715) range_opt ::= */ - 536, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 536, /* (717) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 537, /* (718) every_opt ::= */ - 537, /* (719) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 548, /* (720) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 549, /* (721) query_simple ::= query_specification */ - 549, /* (722) query_simple ::= union_query_expression */ - 553, /* (723) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 553, /* (724) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 554, /* (725) query_simple_or_subquery ::= query_simple */ - 554, /* (726) query_simple_or_subquery ::= subquery */ - 468, /* (727) query_or_subquery ::= query_expression */ - 468, /* (728) query_or_subquery ::= subquery */ - 550, /* (729) order_by_clause_opt ::= */ - 550, /* (730) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 551, /* (731) slimit_clause_opt ::= */ - 551, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 551, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 551, /* (734) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 552, /* (735) limit_clause_opt ::= */ - 552, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER */ - 552, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 552, /* (738) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 522, /* (739) subquery ::= NK_LP query_expression NK_RP */ - 522, /* (740) subquery ::= NK_LP subquery NK_RP */ - 398, /* (741) search_condition ::= common_expression */ - 555, /* (742) sort_specification_list ::= sort_specification */ - 555, /* (743) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 556, /* (744) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 557, /* (745) ordering_specification_opt ::= */ - 557, /* (746) ordering_specification_opt ::= ASC */ - 557, /* (747) ordering_specification_opt ::= DESC */ - 558, /* (748) null_ordering_opt ::= */ - 558, /* (749) null_ordering_opt ::= NULLS FIRST */ - 558, /* (750) null_ordering_opt ::= NULLS LAST */ - 426, /* (751) column_options ::= */ - 426, /* (752) column_options ::= column_options PRIMARY KEY */ - 426, /* (753) column_options ::= column_options ENCODE NK_STRING */ - 426, /* (754) column_options ::= column_options COMPRESS NK_STRING */ - 426, /* (755) column_options ::= column_options LEVEL NK_STRING */ + 378, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + 378, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 378, /* (185) cmd ::= DROP TABLE multi_drop_clause */ + 378, /* (186) cmd ::= DROP STABLE exists_opt full_table_name */ + 378, /* (187) cmd ::= ALTER TABLE alter_table_clause */ + 378, /* (188) cmd ::= ALTER STABLE alter_table_clause */ + 423, /* (189) alter_table_clause ::= full_table_name alter_table_options */ + 423, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + 423, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 423, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 423, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + 423, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 423, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 423, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ + 423, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 423, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 423, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 419, /* (200) multi_create_clause ::= create_subtable_clause */ + 419, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 429, /* (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 */ + 422, /* (203) multi_drop_clause ::= drop_table_clause */ + 422, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 432, /* (205) drop_table_clause ::= exists_opt full_table_name */ + 430, /* (206) specific_cols_opt ::= */ + 430, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 415, /* (208) full_table_name ::= table_name */ + 415, /* (209) full_table_name ::= db_name NK_DOT table_name */ + 434, /* (210) tag_def_list ::= tag_def */ + 434, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + 435, /* (212) tag_def ::= column_name type_name */ + 416, /* (213) column_def_list ::= column_def */ + 416, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ + 436, /* (215) column_def ::= column_name type_name column_options */ + 426, /* (216) type_name ::= BOOL */ + 426, /* (217) type_name ::= TINYINT */ + 426, /* (218) type_name ::= SMALLINT */ + 426, /* (219) type_name ::= INT */ + 426, /* (220) type_name ::= INTEGER */ + 426, /* (221) type_name ::= BIGINT */ + 426, /* (222) type_name ::= FLOAT */ + 426, /* (223) type_name ::= DOUBLE */ + 426, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 426, /* (225) type_name ::= TIMESTAMP */ + 426, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 426, /* (227) type_name ::= TINYINT UNSIGNED */ + 426, /* (228) type_name ::= SMALLINT UNSIGNED */ + 426, /* (229) type_name ::= INT UNSIGNED */ + 426, /* (230) type_name ::= BIGINT UNSIGNED */ + 426, /* (231) type_name ::= JSON */ + 426, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 426, /* (233) type_name ::= MEDIUMBLOB */ + 426, /* (234) type_name ::= BLOB */ + 426, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 426, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 426, /* (237) type_name ::= DECIMAL */ + 426, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 426, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 437, /* (240) type_name_default_len ::= BINARY */ + 437, /* (241) type_name_default_len ::= NCHAR */ + 437, /* (242) type_name_default_len ::= VARCHAR */ + 437, /* (243) type_name_default_len ::= VARBINARY */ + 417, /* (244) tags_def_opt ::= */ + 417, /* (245) tags_def_opt ::= tags_def */ + 421, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 418, /* (247) table_options ::= */ + 418, /* (248) table_options ::= table_options COMMENT NK_STRING */ + 418, /* (249) table_options ::= table_options MAX_DELAY duration_list */ + 418, /* (250) table_options ::= table_options WATERMARK duration_list */ + 418, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 418, /* (252) table_options ::= table_options TTL NK_INTEGER */ + 418, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 418, /* (254) table_options ::= table_options DELETE_MARK duration_list */ + 424, /* (255) alter_table_options ::= alter_table_option */ + 424, /* (256) alter_table_options ::= alter_table_options alter_table_option */ + 440, /* (257) alter_table_option ::= COMMENT NK_STRING */ + 440, /* (258) alter_table_option ::= TTL NK_INTEGER */ + 438, /* (259) duration_list ::= duration_literal */ + 438, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ + 439, /* (261) rollup_func_list ::= rollup_func_name */ + 439, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 442, /* (263) rollup_func_name ::= function_name */ + 442, /* (264) rollup_func_name ::= FIRST */ + 442, /* (265) rollup_func_name ::= LAST */ + 433, /* (266) col_name_list ::= col_name */ + 433, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ + 444, /* (268) col_name ::= column_name */ + 378, /* (269) cmd ::= SHOW DNODES */ + 378, /* (270) cmd ::= SHOW USERS */ + 378, /* (271) cmd ::= SHOW USERS FULL */ + 378, /* (272) cmd ::= SHOW USER PRIVILEGES */ + 378, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ + 378, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 378, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 378, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 378, /* (277) cmd ::= SHOW MNODES */ + 378, /* (278) cmd ::= SHOW QNODES */ + 378, /* (279) cmd ::= SHOW ARBGROUPS */ + 378, /* (280) cmd ::= SHOW FUNCTIONS */ + 378, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 378, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 378, /* (283) cmd ::= SHOW STREAMS */ + 378, /* (284) cmd ::= SHOW ACCOUNTS */ + 378, /* (285) cmd ::= SHOW APPS */ + 378, /* (286) cmd ::= SHOW CONNECTIONS */ + 378, /* (287) cmd ::= SHOW LICENCES */ + 378, /* (288) cmd ::= SHOW GRANTS */ + 378, /* (289) cmd ::= SHOW GRANTS FULL */ + 378, /* (290) cmd ::= SHOW GRANTS LOGS */ + 378, /* (291) cmd ::= SHOW CLUSTER MACHINES */ + 378, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ + 378, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ + 378, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ + 378, /* (295) cmd ::= SHOW ENCRYPTIONS */ + 378, /* (296) cmd ::= SHOW QUERIES */ + 378, /* (297) cmd ::= SHOW SCORES */ + 378, /* (298) cmd ::= SHOW TOPICS */ + 378, /* (299) cmd ::= SHOW VARIABLES */ + 378, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ + 378, /* (301) cmd ::= SHOW LOCAL VARIABLES */ + 378, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 378, /* (303) cmd ::= SHOW BNODES */ + 378, /* (304) cmd ::= SHOW SNODES */ + 378, /* (305) cmd ::= SHOW CLUSTER */ + 378, /* (306) cmd ::= SHOW TRANSACTIONS */ + 378, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 378, /* (308) cmd ::= SHOW CONSUMERS */ + 378, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ + 378, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 378, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 378, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 378, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 378, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 378, /* (315) cmd ::= SHOW VNODES */ + 378, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ + 378, /* (317) cmd ::= SHOW CLUSTER ALIVE */ + 378, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 378, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ + 378, /* (320) cmd ::= SHOW COMPACTS */ + 378, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ + 446, /* (322) table_kind_db_name_cond_opt ::= */ + 446, /* (323) table_kind_db_name_cond_opt ::= table_kind */ + 446, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 446, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 451, /* (326) table_kind ::= NORMAL */ + 451, /* (327) table_kind ::= CHILD */ + 448, /* (328) db_name_cond_opt ::= */ + 448, /* (329) db_name_cond_opt ::= db_name NK_DOT */ + 447, /* (330) like_pattern_opt ::= */ + 447, /* (331) like_pattern_opt ::= LIKE NK_STRING */ + 449, /* (332) table_name_cond ::= table_name */ + 450, /* (333) from_db_opt ::= */ + 450, /* (334) from_db_opt ::= FROM db_name */ + 420, /* (335) tag_list_opt ::= */ + 420, /* (336) tag_list_opt ::= tag_item */ + 420, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 452, /* (338) tag_item ::= TBNAME */ + 452, /* (339) tag_item ::= QTAGS */ + 452, /* (340) tag_item ::= column_name */ + 452, /* (341) tag_item ::= column_name column_alias */ + 452, /* (342) tag_item ::= column_name AS column_alias */ + 445, /* (343) db_kind_opt ::= */ + 445, /* (344) db_kind_opt ::= USER */ + 445, /* (345) db_kind_opt ::= SYSTEM */ + 378, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + 378, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + 378, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ + 378, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ + 456, /* (350) full_tsma_name ::= tsma_name */ + 456, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ + 455, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + 378, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 378, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 378, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ + 459, /* (356) full_index_name ::= index_name */ + 459, /* (357) full_index_name ::= db_name NK_DOT index_name */ + 458, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 458, /* (359) 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 */ + 457, /* (360) func_list ::= func */ + 457, /* (361) func_list ::= func_list NK_COMMA func */ + 463, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ + 464, /* (363) sma_func_name ::= function_name */ + 464, /* (364) sma_func_name ::= COUNT */ + 464, /* (365) sma_func_name ::= FIRST */ + 464, /* (366) sma_func_name ::= LAST */ + 464, /* (367) sma_func_name ::= LAST_ROW */ + 462, /* (368) sma_stream_opt ::= */ + 462, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 462, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 462, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 466, /* (372) with_meta ::= AS */ + 466, /* (373) with_meta ::= WITH META AS */ + 466, /* (374) with_meta ::= ONLY META AS */ + 378, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 378, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 378, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 378, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ + 378, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 378, /* (380) cmd ::= DESC full_table_name */ + 378, /* (381) cmd ::= DESCRIBE full_table_name */ + 378, /* (382) cmd ::= RESET QUERY CACHE */ + 378, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 378, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 470, /* (385) analyze_opt ::= */ + 470, /* (386) analyze_opt ::= ANALYZE */ + 471, /* (387) explain_options ::= */ + 471, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ + 471, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ + 378, /* (390) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 378, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ + 474, /* (392) agg_func_opt ::= */ + 474, /* (393) agg_func_opt ::= AGGREGATE */ + 475, /* (394) bufsize_opt ::= */ + 475, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 476, /* (396) language_opt ::= */ + 476, /* (397) language_opt ::= LANGUAGE NK_STRING */ + 473, /* (398) or_replace_opt ::= */ + 473, /* (399) or_replace_opt ::= OR REPLACE */ + 378, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 378, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ + 477, /* (402) full_view_name ::= view_name */ + 477, /* (403) full_view_name ::= db_name NK_DOT view_name */ + 378, /* (404) 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 */ + 378, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ + 378, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ + 378, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 481, /* (408) col_list_opt ::= */ + 481, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + 485, /* (410) column_stream_def_list ::= column_stream_def */ + 485, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + 486, /* (412) column_stream_def ::= column_name stream_col_options */ + 487, /* (413) stream_col_options ::= */ + 487, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ + 482, /* (415) tag_def_or_ref_opt ::= */ + 482, /* (416) tag_def_or_ref_opt ::= tags_def */ + 482, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 480, /* (418) stream_options ::= */ + 480, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ + 480, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 480, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 480, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ + 480, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 480, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 480, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ + 480, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 483, /* (427) subtable_opt ::= */ + 483, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 484, /* (429) ignore_opt ::= */ + 484, /* (430) ignore_opt ::= IGNORE UNTREATED */ + 378, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ + 378, /* (432) cmd ::= KILL QUERY NK_STRING */ + 378, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ + 378, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ + 378, /* (435) cmd ::= BALANCE VGROUP */ + 378, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 378, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + 378, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 378, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 378, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ + 489, /* (441) on_vgroup_id ::= */ + 489, /* (442) on_vgroup_id ::= ON NK_INTEGER */ + 490, /* (443) dnode_list ::= DNODE NK_INTEGER */ + 490, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 378, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 378, /* (446) cmd ::= query_or_subquery */ + 378, /* (447) cmd ::= insert_query */ + 472, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 472, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 428, /* (450) tags_literal ::= NK_INTEGER */ + 428, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + 428, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + 428, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ + 428, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + 428, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + 428, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ + 428, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + 428, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + 428, /* (459) tags_literal ::= NK_FLOAT */ + 428, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ + 428, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ + 428, /* (462) tags_literal ::= NK_BIN */ + 428, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + 428, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + 428, /* (465) tags_literal ::= NK_PLUS NK_BIN */ + 428, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + 428, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + 428, /* (468) tags_literal ::= NK_MINUS NK_BIN */ + 428, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + 428, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + 428, /* (471) tags_literal ::= NK_HEX */ + 428, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + 428, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + 428, /* (474) tags_literal ::= NK_PLUS NK_HEX */ + 428, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + 428, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + 428, /* (477) tags_literal ::= NK_MINUS NK_HEX */ + 428, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + 428, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + 428, /* (480) tags_literal ::= NK_STRING */ + 428, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + 428, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + 428, /* (483) tags_literal ::= NK_BOOL */ + 428, /* (484) tags_literal ::= NULL */ + 428, /* (485) tags_literal ::= literal_func */ + 428, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ + 428, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ + 431, /* (488) tags_literal_list ::= tags_literal */ + 431, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 381, /* (490) literal ::= NK_INTEGER */ + 381, /* (491) literal ::= NK_FLOAT */ + 381, /* (492) literal ::= NK_STRING */ + 381, /* (493) literal ::= NK_BOOL */ + 381, /* (494) literal ::= TIMESTAMP NK_STRING */ + 381, /* (495) literal ::= duration_literal */ + 381, /* (496) literal ::= NULL */ + 381, /* (497) literal ::= NK_QUESTION */ + 441, /* (498) duration_literal ::= NK_VARIABLE */ + 412, /* (499) signed ::= NK_INTEGER */ + 412, /* (500) signed ::= NK_PLUS NK_INTEGER */ + 412, /* (501) signed ::= NK_MINUS NK_INTEGER */ + 412, /* (502) signed ::= NK_FLOAT */ + 412, /* (503) signed ::= NK_PLUS NK_FLOAT */ + 412, /* (504) signed ::= NK_MINUS NK_FLOAT */ + 492, /* (505) signed_literal ::= signed */ + 492, /* (506) signed_literal ::= NK_STRING */ + 492, /* (507) signed_literal ::= NK_BOOL */ + 492, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ + 492, /* (509) signed_literal ::= duration_literal */ + 492, /* (510) signed_literal ::= NULL */ + 492, /* (511) signed_literal ::= literal_func */ + 492, /* (512) signed_literal ::= NK_QUESTION */ + 493, /* (513) literal_list ::= signed_literal */ + 493, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ + 395, /* (515) db_name ::= NK_ID */ + 396, /* (516) table_name ::= NK_ID */ + 425, /* (517) column_name ::= NK_ID */ + 443, /* (518) function_name ::= NK_ID */ + 478, /* (519) view_name ::= NK_ID */ + 494, /* (520) table_alias ::= NK_ID */ + 453, /* (521) column_alias ::= NK_ID */ + 453, /* (522) column_alias ::= NK_ALIAS */ + 388, /* (523) user_name ::= NK_ID */ + 397, /* (524) topic_name ::= NK_ID */ + 479, /* (525) stream_name ::= NK_ID */ + 469, /* (526) cgroup_name ::= NK_ID */ + 460, /* (527) index_name ::= NK_ID */ + 454, /* (528) tsma_name ::= NK_ID */ + 495, /* (529) expr_or_subquery ::= expression */ + 488, /* (530) expression ::= literal */ + 488, /* (531) expression ::= pseudo_column */ + 488, /* (532) expression ::= column_reference */ + 488, /* (533) expression ::= function_expression */ + 488, /* (534) expression ::= case_when_expression */ + 488, /* (535) expression ::= NK_LP expression NK_RP */ + 488, /* (536) expression ::= NK_PLUS expr_or_subquery */ + 488, /* (537) expression ::= NK_MINUS expr_or_subquery */ + 488, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 488, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 488, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 488, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 488, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 488, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ + 488, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 488, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 465, /* (546) expression_list ::= expr_or_subquery */ + 465, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 497, /* (548) column_reference ::= column_name */ + 497, /* (549) column_reference ::= table_name NK_DOT column_name */ + 497, /* (550) column_reference ::= NK_ALIAS */ + 497, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ + 496, /* (552) pseudo_column ::= ROWTS */ + 496, /* (553) pseudo_column ::= TBNAME */ + 496, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ + 496, /* (555) pseudo_column ::= QSTART */ + 496, /* (556) pseudo_column ::= QEND */ + 496, /* (557) pseudo_column ::= QDURATION */ + 496, /* (558) pseudo_column ::= WSTART */ + 496, /* (559) pseudo_column ::= WEND */ + 496, /* (560) pseudo_column ::= WDURATION */ + 496, /* (561) pseudo_column ::= IROWTS */ + 496, /* (562) pseudo_column ::= ISFILLED */ + 496, /* (563) pseudo_column ::= QTAGS */ + 498, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ + 498, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 498, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 498, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + 498, /* (568) function_expression ::= literal_func */ + 491, /* (569) literal_func ::= noarg_func NK_LP NK_RP */ + 491, /* (570) literal_func ::= NOW */ + 491, /* (571) literal_func ::= TODAY */ + 502, /* (572) noarg_func ::= NOW */ + 502, /* (573) noarg_func ::= TODAY */ + 502, /* (574) noarg_func ::= TIMEZONE */ + 502, /* (575) noarg_func ::= DATABASE */ + 502, /* (576) noarg_func ::= CLIENT_VERSION */ + 502, /* (577) noarg_func ::= SERVER_VERSION */ + 502, /* (578) noarg_func ::= SERVER_STATUS */ + 502, /* (579) noarg_func ::= CURRENT_USER */ + 502, /* (580) noarg_func ::= USER */ + 500, /* (581) star_func ::= COUNT */ + 500, /* (582) star_func ::= FIRST */ + 500, /* (583) star_func ::= LAST */ + 500, /* (584) star_func ::= LAST_ROW */ + 501, /* (585) star_func_para_list ::= NK_STAR */ + 501, /* (586) star_func_para_list ::= other_para_list */ + 503, /* (587) other_para_list ::= star_func_para */ + 503, /* (588) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 504, /* (589) star_func_para ::= expr_or_subquery */ + 504, /* (590) star_func_para ::= table_name NK_DOT NK_STAR */ + 499, /* (591) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 499, /* (592) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 505, /* (593) when_then_list ::= when_then_expr */ + 505, /* (594) when_then_list ::= when_then_list when_then_expr */ + 508, /* (595) when_then_expr ::= WHEN common_expression THEN common_expression */ + 506, /* (596) case_when_else_opt ::= */ + 506, /* (597) case_when_else_opt ::= ELSE common_expression */ + 509, /* (598) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 509, /* (599) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 509, /* (600) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 509, /* (601) predicate ::= expr_or_subquery IS NULL */ + 509, /* (602) predicate ::= expr_or_subquery IS NOT NULL */ + 509, /* (603) predicate ::= expr_or_subquery in_op in_predicate_value */ + 510, /* (604) compare_op ::= NK_LT */ + 510, /* (605) compare_op ::= NK_GT */ + 510, /* (606) compare_op ::= NK_LE */ + 510, /* (607) compare_op ::= NK_GE */ + 510, /* (608) compare_op ::= NK_NE */ + 510, /* (609) compare_op ::= NK_EQ */ + 510, /* (610) compare_op ::= LIKE */ + 510, /* (611) compare_op ::= NOT LIKE */ + 510, /* (612) compare_op ::= MATCH */ + 510, /* (613) compare_op ::= NMATCH */ + 510, /* (614) compare_op ::= CONTAINS */ + 511, /* (615) in_op ::= IN */ + 511, /* (616) in_op ::= NOT IN */ + 512, /* (617) in_predicate_value ::= NK_LP literal_list NK_RP */ + 513, /* (618) boolean_value_expression ::= boolean_primary */ + 513, /* (619) boolean_value_expression ::= NOT boolean_primary */ + 513, /* (620) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 513, /* (621) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 514, /* (622) boolean_primary ::= predicate */ + 514, /* (623) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 507, /* (624) common_expression ::= expr_or_subquery */ + 507, /* (625) common_expression ::= boolean_value_expression */ + 515, /* (626) from_clause_opt ::= */ + 515, /* (627) from_clause_opt ::= FROM table_reference_list */ + 516, /* (628) table_reference_list ::= table_reference */ + 516, /* (629) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 517, /* (630) table_reference ::= table_primary */ + 517, /* (631) table_reference ::= joined_table */ + 518, /* (632) table_primary ::= table_name alias_opt */ + 518, /* (633) table_primary ::= db_name NK_DOT table_name alias_opt */ + 518, /* (634) table_primary ::= subquery alias_opt */ + 518, /* (635) table_primary ::= parenthesized_joined_table */ + 520, /* (636) alias_opt ::= */ + 520, /* (637) alias_opt ::= table_alias */ + 520, /* (638) alias_opt ::= AS table_alias */ + 522, /* (639) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 522, /* (640) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 519, /* (641) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 523, /* (642) join_type ::= */ + 523, /* (643) join_type ::= INNER */ + 523, /* (644) join_type ::= LEFT */ + 523, /* (645) join_type ::= RIGHT */ + 523, /* (646) join_type ::= FULL */ + 524, /* (647) join_subtype ::= */ + 524, /* (648) join_subtype ::= OUTER */ + 524, /* (649) join_subtype ::= SEMI */ + 524, /* (650) join_subtype ::= ANTI */ + 524, /* (651) join_subtype ::= ASOF */ + 524, /* (652) join_subtype ::= WINDOW */ + 525, /* (653) join_on_clause_opt ::= */ + 525, /* (654) join_on_clause_opt ::= ON search_condition */ + 526, /* (655) window_offset_clause_opt ::= */ + 526, /* (656) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 528, /* (657) window_offset_literal ::= NK_VARIABLE */ + 528, /* (658) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 527, /* (659) jlimit_clause_opt ::= */ + 527, /* (660) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 529, /* (661) 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 */ + 530, /* (662) hint_list ::= */ + 530, /* (663) hint_list ::= NK_HINT */ + 532, /* (664) tag_mode_opt ::= */ + 532, /* (665) tag_mode_opt ::= TAGS */ + 531, /* (666) set_quantifier_opt ::= */ + 531, /* (667) set_quantifier_opt ::= DISTINCT */ + 531, /* (668) set_quantifier_opt ::= ALL */ + 533, /* (669) select_list ::= select_item */ + 533, /* (670) select_list ::= select_list NK_COMMA select_item */ + 541, /* (671) select_item ::= NK_STAR */ + 541, /* (672) select_item ::= common_expression */ + 541, /* (673) select_item ::= common_expression column_alias */ + 541, /* (674) select_item ::= common_expression AS column_alias */ + 541, /* (675) select_item ::= table_name NK_DOT NK_STAR */ + 468, /* (676) where_clause_opt ::= */ + 468, /* (677) where_clause_opt ::= WHERE search_condition */ + 534, /* (678) partition_by_clause_opt ::= */ + 534, /* (679) partition_by_clause_opt ::= PARTITION BY partition_list */ + 542, /* (680) partition_list ::= partition_item */ + 542, /* (681) partition_list ::= partition_list NK_COMMA partition_item */ + 543, /* (682) partition_item ::= expr_or_subquery */ + 543, /* (683) partition_item ::= expr_or_subquery column_alias */ + 543, /* (684) partition_item ::= expr_or_subquery AS column_alias */ + 538, /* (685) twindow_clause_opt ::= */ + 538, /* (686) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 538, /* (687) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 538, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 538, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 538, /* (690) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 538, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 538, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 461, /* (693) sliding_opt ::= */ + 461, /* (694) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 544, /* (695) interval_sliding_duration_literal ::= NK_VARIABLE */ + 544, /* (696) interval_sliding_duration_literal ::= NK_STRING */ + 544, /* (697) interval_sliding_duration_literal ::= NK_INTEGER */ + 537, /* (698) fill_opt ::= */ + 537, /* (699) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 537, /* (700) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 537, /* (701) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 545, /* (702) fill_mode ::= NONE */ + 545, /* (703) fill_mode ::= PREV */ + 545, /* (704) fill_mode ::= NULL */ + 545, /* (705) fill_mode ::= NULL_F */ + 545, /* (706) fill_mode ::= LINEAR */ + 545, /* (707) fill_mode ::= NEXT */ + 539, /* (708) group_by_clause_opt ::= */ + 539, /* (709) group_by_clause_opt ::= GROUP BY group_by_list */ + 546, /* (710) group_by_list ::= expr_or_subquery */ + 546, /* (711) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 540, /* (712) having_clause_opt ::= */ + 540, /* (713) having_clause_opt ::= HAVING search_condition */ + 535, /* (714) range_opt ::= */ + 535, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 535, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 536, /* (717) every_opt ::= */ + 536, /* (718) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 547, /* (719) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 548, /* (720) query_simple ::= query_specification */ + 548, /* (721) query_simple ::= union_query_expression */ + 552, /* (722) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 552, /* (723) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 553, /* (724) query_simple_or_subquery ::= query_simple */ + 553, /* (725) query_simple_or_subquery ::= subquery */ + 467, /* (726) query_or_subquery ::= query_expression */ + 467, /* (727) query_or_subquery ::= subquery */ + 549, /* (728) order_by_clause_opt ::= */ + 549, /* (729) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 550, /* (730) slimit_clause_opt ::= */ + 550, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 550, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 550, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 551, /* (734) limit_clause_opt ::= */ + 551, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER */ + 551, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 551, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 521, /* (738) subquery ::= NK_LP query_expression NK_RP */ + 521, /* (739) subquery ::= NK_LP subquery NK_RP */ + 398, /* (740) search_condition ::= common_expression */ + 554, /* (741) sort_specification_list ::= sort_specification */ + 554, /* (742) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 555, /* (743) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 556, /* (744) ordering_specification_opt ::= */ + 556, /* (745) ordering_specification_opt ::= ASC */ + 556, /* (746) ordering_specification_opt ::= DESC */ + 557, /* (747) null_ordering_opt ::= */ + 557, /* (748) null_ordering_opt ::= NULLS FIRST */ + 557, /* (749) null_ordering_opt ::= NULLS LAST */ + 427, /* (750) column_options ::= */ + 427, /* (751) column_options ::= column_options PRIMARY KEY */ + 427, /* (752) column_options ::= column_options ENCODE NK_STRING */ + 427, /* (753) column_options ::= column_options COMPRESS NK_STRING */ + 427, /* (754) column_options ::= column_options LEVEL NK_STRING */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4970,579 +4948,578 @@ static const signed char yyRuleInfoNRhs[] = { -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 */ - -9, /* (183) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - -3, /* (184) cmd ::= DROP TABLE multi_drop_clause */ - -4, /* (185) cmd ::= DROP STABLE exists_opt full_table_name */ - -3, /* (186) cmd ::= ALTER TABLE alter_table_clause */ - -3, /* (187) cmd ::= ALTER STABLE alter_table_clause */ - -2, /* (188) alter_table_clause ::= full_table_name alter_table_options */ - -6, /* (189) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - -4, /* (190) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -5, /* (191) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - -5, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - -5, /* (193) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -5, /* (194) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - -4, /* (195) alter_table_clause ::= full_table_name DROP TAG column_name */ - -5, /* (196) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - -5, /* (197) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (198) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - -1, /* (199) multi_create_clause ::= create_subtable_clause */ - -2, /* (200) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -1, /* (201) multi_create_clause ::= create_from_file_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 */ + -3, /* (185) cmd ::= DROP TABLE multi_drop_clause */ + -4, /* (186) cmd ::= DROP STABLE 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 */ - -8, /* (203) create_from_file_clause ::= not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - -1, /* (204) multi_drop_clause ::= drop_table_clause */ - -3, /* (205) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - -2, /* (206) drop_table_clause ::= exists_opt full_table_name */ - 0, /* (207) specific_cols_opt ::= */ - -3, /* (208) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - -1, /* (209) full_table_name ::= table_name */ - -3, /* (210) full_table_name ::= db_name NK_DOT table_name */ - -1, /* (211) tag_def_list ::= tag_def */ - -3, /* (212) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - -2, /* (213) tag_def ::= column_name type_name */ - -1, /* (214) column_def_list ::= column_def */ - -3, /* (215) column_def_list ::= column_def_list NK_COMMA column_def */ - -3, /* (216) column_def ::= column_name type_name column_options */ - -1, /* (217) type_name ::= BOOL */ - -1, /* (218) type_name ::= TINYINT */ - -1, /* (219) type_name ::= SMALLINT */ - -1, /* (220) type_name ::= INT */ - -1, /* (221) type_name ::= INTEGER */ - -1, /* (222) type_name ::= BIGINT */ - -1, /* (223) type_name ::= FLOAT */ - -1, /* (224) type_name ::= DOUBLE */ - -4, /* (225) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (226) type_name ::= TIMESTAMP */ - -4, /* (227) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (228) type_name ::= TINYINT UNSIGNED */ - -2, /* (229) type_name ::= SMALLINT UNSIGNED */ - -2, /* (230) type_name ::= INT UNSIGNED */ - -2, /* (231) type_name ::= BIGINT UNSIGNED */ - -1, /* (232) type_name ::= JSON */ - -4, /* (233) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (234) type_name ::= MEDIUMBLOB */ - -1, /* (235) type_name ::= BLOB */ - -4, /* (236) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (237) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (238) type_name ::= DECIMAL */ - -4, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (240) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -1, /* (241) type_name_default_len ::= BINARY */ - -1, /* (242) type_name_default_len ::= NCHAR */ - -1, /* (243) type_name_default_len ::= VARCHAR */ - -1, /* (244) type_name_default_len ::= VARBINARY */ - 0, /* (245) tags_def_opt ::= */ - -1, /* (246) tags_def_opt ::= tags_def */ - -4, /* (247) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 0, /* (248) table_options ::= */ - -3, /* (249) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (250) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (251) table_options ::= table_options WATERMARK duration_list */ - -5, /* (252) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (253) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (254) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (255) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (256) alter_table_options ::= alter_table_option */ - -2, /* (257) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (258) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (259) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (260) duration_list ::= duration_literal */ - -3, /* (261) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (262) rollup_func_list ::= rollup_func_name */ - -3, /* (263) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (264) rollup_func_name ::= function_name */ - -1, /* (265) rollup_func_name ::= FIRST */ - -1, /* (266) rollup_func_name ::= LAST */ - -1, /* (267) col_name_list ::= col_name */ - -3, /* (268) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (269) col_name ::= column_name */ - -2, /* (270) cmd ::= SHOW DNODES */ - -2, /* (271) cmd ::= SHOW USERS */ - -3, /* (272) cmd ::= SHOW USERS FULL */ - -3, /* (273) cmd ::= SHOW USER PRIVILEGES */ - -3, /* (274) cmd ::= SHOW db_kind_opt DATABASES */ - -4, /* (275) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (276) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (277) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (278) cmd ::= SHOW MNODES */ - -2, /* (279) cmd ::= SHOW QNODES */ - -2, /* (280) cmd ::= SHOW ARBGROUPS */ - -2, /* (281) cmd ::= SHOW FUNCTIONS */ - -5, /* (282) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (283) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (284) cmd ::= SHOW STREAMS */ - -2, /* (285) cmd ::= SHOW ACCOUNTS */ - -2, /* (286) cmd ::= SHOW APPS */ - -2, /* (287) cmd ::= SHOW CONNECTIONS */ - -2, /* (288) cmd ::= SHOW LICENCES */ - -2, /* (289) cmd ::= SHOW GRANTS */ - -3, /* (290) cmd ::= SHOW GRANTS FULL */ - -3, /* (291) cmd ::= SHOW GRANTS LOGS */ - -3, /* (292) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (293) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (294) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (295) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (296) cmd ::= SHOW ENCRYPTIONS */ - -2, /* (297) cmd ::= SHOW QUERIES */ - -2, /* (298) cmd ::= SHOW SCORES */ - -2, /* (299) cmd ::= SHOW TOPICS */ - -2, /* (300) cmd ::= SHOW VARIABLES */ - -3, /* (301) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (302) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (303) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (304) cmd ::= SHOW BNODES */ - -2, /* (305) cmd ::= SHOW SNODES */ - -2, /* (306) cmd ::= SHOW CLUSTER */ - -2, /* (307) cmd ::= SHOW TRANSACTIONS */ - -4, /* (308) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (309) cmd ::= SHOW CONSUMERS */ - -2, /* (310) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (311) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (312) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (314) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (315) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (316) cmd ::= SHOW VNODES */ - -3, /* (317) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (318) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (319) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (320) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (321) cmd ::= SHOW COMPACTS */ - -3, /* (322) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (323) table_kind_db_name_cond_opt ::= */ - -1, /* (324) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (325) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (326) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (327) table_kind ::= NORMAL */ - -1, /* (328) table_kind ::= CHILD */ - 0, /* (329) db_name_cond_opt ::= */ - -2, /* (330) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (331) like_pattern_opt ::= */ - -2, /* (332) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (333) table_name_cond ::= table_name */ - 0, /* (334) from_db_opt ::= */ - -2, /* (335) from_db_opt ::= FROM db_name */ - 0, /* (336) tag_list_opt ::= */ - -1, /* (337) tag_list_opt ::= tag_item */ - -3, /* (338) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (339) tag_item ::= TBNAME */ - -1, /* (340) tag_item ::= QTAGS */ - -1, /* (341) tag_item ::= column_name */ - -2, /* (342) tag_item ::= column_name column_alias */ - -3, /* (343) tag_item ::= column_name AS column_alias */ - 0, /* (344) db_kind_opt ::= */ - -1, /* (345) db_kind_opt ::= USER */ - -1, /* (346) db_kind_opt ::= SYSTEM */ - -11, /* (347) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - -11, /* (348) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - -4, /* (349) cmd ::= DROP TSMA exists_opt full_tsma_name */ - -3, /* (350) cmd ::= SHOW db_name_cond_opt TSMAS */ - -1, /* (351) full_tsma_name ::= tsma_name */ - -3, /* (352) full_tsma_name ::= db_name NK_DOT tsma_name */ - -4, /* (353) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - -8, /* (354) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (355) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (356) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (357) full_index_name ::= index_name */ - -3, /* (358) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (359) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (360) 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, /* (361) func_list ::= func */ - -3, /* (362) func_list ::= func_list NK_COMMA func */ - -4, /* (363) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (364) sma_func_name ::= function_name */ - -1, /* (365) sma_func_name ::= COUNT */ - -1, /* (366) sma_func_name ::= FIRST */ - -1, /* (367) sma_func_name ::= LAST */ - -1, /* (368) sma_func_name ::= LAST_ROW */ - 0, /* (369) sma_stream_opt ::= */ - -3, /* (370) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (371) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (372) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (373) with_meta ::= AS */ - -3, /* (374) with_meta ::= WITH META AS */ - -3, /* (375) with_meta ::= ONLY META AS */ - -6, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (378) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (379) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (380) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (381) cmd ::= DESC full_table_name */ - -2, /* (382) cmd ::= DESCRIBE full_table_name */ - -3, /* (383) cmd ::= RESET QUERY CACHE */ - -4, /* (384) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (385) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (386) analyze_opt ::= */ - -1, /* (387) analyze_opt ::= ANALYZE */ - 0, /* (388) explain_options ::= */ - -3, /* (389) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (390) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (391) 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, /* (392) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (393) agg_func_opt ::= */ - -1, /* (394) agg_func_opt ::= AGGREGATE */ - 0, /* (395) bufsize_opt ::= */ - -2, /* (396) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (397) language_opt ::= */ - -2, /* (398) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (399) or_replace_opt ::= */ - -2, /* (400) or_replace_opt ::= OR REPLACE */ - -6, /* (401) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (402) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (403) full_view_name ::= view_name */ - -3, /* (404) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (405) 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, /* (406) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (407) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (408) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (409) col_list_opt ::= */ - -3, /* (410) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - -1, /* (411) column_stream_def_list ::= column_stream_def */ - -3, /* (412) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - -2, /* (413) column_stream_def ::= column_name stream_col_options */ - 0, /* (414) stream_col_options ::= */ - -3, /* (415) stream_col_options ::= stream_col_options PRIMARY KEY */ - 0, /* (416) tag_def_or_ref_opt ::= */ - -1, /* (417) tag_def_or_ref_opt ::= tags_def */ - -4, /* (418) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 0, /* (419) stream_options ::= */ - -3, /* (420) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (421) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (422) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (423) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (424) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (425) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (426) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (427) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (428) subtable_opt ::= */ - -4, /* (429) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (430) ignore_opt ::= */ - -2, /* (431) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (432) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (433) cmd ::= KILL QUERY NK_STRING */ - -3, /* (434) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (435) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (436) cmd ::= BALANCE VGROUP */ - -4, /* (437) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -5, /* (438) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - -4, /* (439) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (440) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (441) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (442) on_vgroup_id ::= */ - -2, /* (443) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (444) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (445) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (446) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (447) cmd ::= query_or_subquery */ - -1, /* (448) cmd ::= insert_query */ - -7, /* (449) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (450) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (451) tags_literal ::= NK_INTEGER */ - -3, /* (452) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - -3, /* (453) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - -2, /* (454) tags_literal ::= NK_PLUS NK_INTEGER */ - -4, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (456) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - -2, /* (457) tags_literal ::= NK_MINUS NK_INTEGER */ - -4, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (459) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - -1, /* (460) tags_literal ::= NK_FLOAT */ - -2, /* (461) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (462) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (463) tags_literal ::= NK_BIN */ - -3, /* (464) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - -3, /* (465) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - -2, /* (466) tags_literal ::= NK_PLUS NK_BIN */ - -4, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - -4, /* (468) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - -2, /* (469) tags_literal ::= NK_MINUS NK_BIN */ - -4, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - -4, /* (471) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - -1, /* (472) tags_literal ::= NK_HEX */ - -3, /* (473) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - -3, /* (474) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - -2, /* (475) tags_literal ::= NK_PLUS NK_HEX */ - -4, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - -4, /* (477) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - -2, /* (478) tags_literal ::= NK_MINUS NK_HEX */ - -4, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - -4, /* (480) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - -1, /* (481) tags_literal ::= NK_STRING */ - -3, /* (482) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - -3, /* (483) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - -1, /* (484) tags_literal ::= NK_BOOL */ - -1, /* (485) tags_literal ::= NULL */ - -1, /* (486) tags_literal ::= literal_func */ - -3, /* (487) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (488) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (489) tags_literal_list ::= tags_literal */ - -3, /* (490) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (491) literal ::= NK_INTEGER */ - -1, /* (492) literal ::= NK_FLOAT */ - -1, /* (493) literal ::= NK_STRING */ - -1, /* (494) literal ::= NK_BOOL */ - -2, /* (495) literal ::= TIMESTAMP NK_STRING */ - -1, /* (496) literal ::= duration_literal */ - -1, /* (497) literal ::= NULL */ - -1, /* (498) literal ::= NK_QUESTION */ - -1, /* (499) duration_literal ::= NK_VARIABLE */ - -1, /* (500) signed ::= NK_INTEGER */ - -2, /* (501) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (502) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (503) signed ::= NK_FLOAT */ - -2, /* (504) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (505) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (506) signed_literal ::= signed */ - -1, /* (507) signed_literal ::= NK_STRING */ - -1, /* (508) signed_literal ::= NK_BOOL */ - -2, /* (509) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (510) signed_literal ::= duration_literal */ - -1, /* (511) signed_literal ::= NULL */ - -1, /* (512) signed_literal ::= literal_func */ - -1, /* (513) signed_literal ::= NK_QUESTION */ - -1, /* (514) literal_list ::= signed_literal */ - -3, /* (515) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (516) db_name ::= NK_ID */ - -1, /* (517) table_name ::= NK_ID */ - -1, /* (518) column_name ::= NK_ID */ - -1, /* (519) function_name ::= NK_ID */ - -1, /* (520) view_name ::= NK_ID */ - -1, /* (521) table_alias ::= NK_ID */ - -1, /* (522) column_alias ::= NK_ID */ - -1, /* (523) column_alias ::= NK_ALIAS */ - -1, /* (524) user_name ::= NK_ID */ - -1, /* (525) topic_name ::= NK_ID */ - -1, /* (526) stream_name ::= NK_ID */ - -1, /* (527) cgroup_name ::= NK_ID */ - -1, /* (528) index_name ::= NK_ID */ - -1, /* (529) tsma_name ::= NK_ID */ - -1, /* (530) expr_or_subquery ::= expression */ - -1, /* (531) expression ::= literal */ - -1, /* (532) expression ::= pseudo_column */ - -1, /* (533) expression ::= column_reference */ - -1, /* (534) expression ::= function_expression */ - -1, /* (535) expression ::= case_when_expression */ - -3, /* (536) expression ::= NK_LP expression NK_RP */ - -2, /* (537) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (538) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (539) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (540) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (541) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (542) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (543) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (544) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (545) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (546) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (547) expression_list ::= expr_or_subquery */ - -3, /* (548) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (549) column_reference ::= column_name */ - -3, /* (550) column_reference ::= table_name NK_DOT column_name */ - -1, /* (551) column_reference ::= NK_ALIAS */ - -3, /* (552) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (553) pseudo_column ::= ROWTS */ - -1, /* (554) pseudo_column ::= TBNAME */ - -3, /* (555) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (556) pseudo_column ::= QSTART */ - -1, /* (557) pseudo_column ::= QEND */ - -1, /* (558) pseudo_column ::= QDURATION */ - -1, /* (559) pseudo_column ::= WSTART */ - -1, /* (560) pseudo_column ::= WEND */ - -1, /* (561) pseudo_column ::= WDURATION */ - -1, /* (562) pseudo_column ::= IROWTS */ - -1, /* (563) pseudo_column ::= ISFILLED */ - -1, /* (564) pseudo_column ::= QTAGS */ - -4, /* (565) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (566) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -6, /* (568) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - -1, /* (569) function_expression ::= literal_func */ - -3, /* (570) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (571) literal_func ::= NOW */ - -1, /* (572) literal_func ::= TODAY */ - -1, /* (573) noarg_func ::= NOW */ - -1, /* (574) noarg_func ::= TODAY */ - -1, /* (575) noarg_func ::= TIMEZONE */ - -1, /* (576) noarg_func ::= DATABASE */ - -1, /* (577) noarg_func ::= CLIENT_VERSION */ - -1, /* (578) noarg_func ::= SERVER_VERSION */ - -1, /* (579) noarg_func ::= SERVER_STATUS */ - -1, /* (580) noarg_func ::= CURRENT_USER */ - -1, /* (581) noarg_func ::= USER */ - -1, /* (582) star_func ::= COUNT */ - -1, /* (583) star_func ::= FIRST */ - -1, /* (584) star_func ::= LAST */ - -1, /* (585) star_func ::= LAST_ROW */ - -1, /* (586) star_func_para_list ::= NK_STAR */ - -1, /* (587) star_func_para_list ::= other_para_list */ - -1, /* (588) other_para_list ::= star_func_para */ - -3, /* (589) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (590) star_func_para ::= expr_or_subquery */ - -3, /* (591) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (592) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (593) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (594) when_then_list ::= when_then_expr */ - -2, /* (595) when_then_list ::= when_then_list when_then_expr */ - -4, /* (596) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (597) case_when_else_opt ::= */ - -2, /* (598) case_when_else_opt ::= ELSE common_expression */ - -3, /* (599) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (600) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (601) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (602) predicate ::= expr_or_subquery IS NULL */ - -4, /* (603) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (604) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (605) compare_op ::= NK_LT */ - -1, /* (606) compare_op ::= NK_GT */ - -1, /* (607) compare_op ::= NK_LE */ - -1, /* (608) compare_op ::= NK_GE */ - -1, /* (609) compare_op ::= NK_NE */ - -1, /* (610) compare_op ::= NK_EQ */ - -1, /* (611) compare_op ::= LIKE */ - -2, /* (612) compare_op ::= NOT LIKE */ - -1, /* (613) compare_op ::= MATCH */ - -1, /* (614) compare_op ::= NMATCH */ - -1, /* (615) compare_op ::= CONTAINS */ - -1, /* (616) in_op ::= IN */ - -2, /* (617) in_op ::= NOT IN */ - -3, /* (618) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (619) boolean_value_expression ::= boolean_primary */ - -2, /* (620) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (621) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (622) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (623) boolean_primary ::= predicate */ - -3, /* (624) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (625) common_expression ::= expr_or_subquery */ - -1, /* (626) common_expression ::= boolean_value_expression */ - 0, /* (627) from_clause_opt ::= */ - -2, /* (628) from_clause_opt ::= FROM table_reference_list */ - -1, /* (629) table_reference_list ::= table_reference */ - -3, /* (630) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (631) table_reference ::= table_primary */ - -1, /* (632) table_reference ::= joined_table */ - -2, /* (633) table_primary ::= table_name alias_opt */ - -4, /* (634) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (635) table_primary ::= subquery alias_opt */ - -1, /* (636) table_primary ::= parenthesized_joined_table */ - 0, /* (637) alias_opt ::= */ - -1, /* (638) alias_opt ::= table_alias */ - -2, /* (639) alias_opt ::= AS table_alias */ - -3, /* (640) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (641) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (642) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (643) join_type ::= */ - -1, /* (644) join_type ::= INNER */ - -1, /* (645) join_type ::= LEFT */ - -1, /* (646) join_type ::= RIGHT */ - -1, /* (647) join_type ::= FULL */ - 0, /* (648) join_subtype ::= */ - -1, /* (649) join_subtype ::= OUTER */ - -1, /* (650) join_subtype ::= SEMI */ - -1, /* (651) join_subtype ::= ANTI */ - -1, /* (652) join_subtype ::= ASOF */ - -1, /* (653) join_subtype ::= WINDOW */ - 0, /* (654) join_on_clause_opt ::= */ - -2, /* (655) join_on_clause_opt ::= ON search_condition */ - 0, /* (656) window_offset_clause_opt ::= */ - -6, /* (657) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (658) window_offset_literal ::= NK_VARIABLE */ - -2, /* (659) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (660) jlimit_clause_opt ::= */ - -2, /* (661) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (662) 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, /* (663) hint_list ::= */ - -1, /* (664) hint_list ::= NK_HINT */ - 0, /* (665) tag_mode_opt ::= */ - -1, /* (666) tag_mode_opt ::= TAGS */ - 0, /* (667) set_quantifier_opt ::= */ - -1, /* (668) set_quantifier_opt ::= DISTINCT */ - -1, /* (669) set_quantifier_opt ::= ALL */ - -1, /* (670) select_list ::= select_item */ - -3, /* (671) select_list ::= select_list NK_COMMA select_item */ - -1, /* (672) select_item ::= NK_STAR */ - -1, /* (673) select_item ::= common_expression */ - -2, /* (674) select_item ::= common_expression column_alias */ - -3, /* (675) select_item ::= common_expression AS column_alias */ - -3, /* (676) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (677) where_clause_opt ::= */ - -2, /* (678) where_clause_opt ::= WHERE search_condition */ - 0, /* (679) partition_by_clause_opt ::= */ - -3, /* (680) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (681) partition_list ::= partition_item */ - -3, /* (682) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (683) partition_item ::= expr_or_subquery */ - -2, /* (684) partition_item ::= expr_or_subquery column_alias */ - -3, /* (685) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (686) twindow_clause_opt ::= */ - -6, /* (687) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (688) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (690) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (691) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (693) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (694) sliding_opt ::= */ - -4, /* (695) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (696) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (697) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (698) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (699) fill_opt ::= */ - -4, /* (700) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (701) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (702) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (703) fill_mode ::= NONE */ - -1, /* (704) fill_mode ::= PREV */ - -1, /* (705) fill_mode ::= NULL */ - -1, /* (706) fill_mode ::= NULL_F */ - -1, /* (707) fill_mode ::= LINEAR */ - -1, /* (708) fill_mode ::= NEXT */ - 0, /* (709) group_by_clause_opt ::= */ - -3, /* (710) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (711) group_by_list ::= expr_or_subquery */ - -3, /* (712) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (713) having_clause_opt ::= */ - -2, /* (714) having_clause_opt ::= HAVING search_condition */ - 0, /* (715) range_opt ::= */ - -6, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (717) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (718) every_opt ::= */ - -4, /* (719) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (720) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (721) query_simple ::= query_specification */ - -1, /* (722) query_simple ::= union_query_expression */ - -4, /* (723) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (724) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (725) query_simple_or_subquery ::= query_simple */ - -1, /* (726) query_simple_or_subquery ::= subquery */ - -1, /* (727) query_or_subquery ::= query_expression */ - -1, /* (728) query_or_subquery ::= subquery */ - 0, /* (729) order_by_clause_opt ::= */ - -3, /* (730) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (731) slimit_clause_opt ::= */ - -2, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (734) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (735) limit_clause_opt ::= */ - -2, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (738) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (739) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (740) subquery ::= NK_LP subquery NK_RP */ - -1, /* (741) search_condition ::= common_expression */ - -1, /* (742) sort_specification_list ::= sort_specification */ - -3, /* (743) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (744) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (745) ordering_specification_opt ::= */ - -1, /* (746) ordering_specification_opt ::= ASC */ - -1, /* (747) ordering_specification_opt ::= DESC */ - 0, /* (748) null_ordering_opt ::= */ - -2, /* (749) null_ordering_opt ::= NULLS FIRST */ - -2, /* (750) null_ordering_opt ::= NULLS LAST */ - 0, /* (751) column_options ::= */ - -3, /* (752) column_options ::= column_options PRIMARY KEY */ - -3, /* (753) column_options ::= column_options ENCODE NK_STRING */ - -3, /* (754) column_options ::= column_options COMPRESS NK_STRING */ - -3, /* (755) column_options ::= column_options LEVEL NK_STRING */ + -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) specific_cols_opt ::= */ + -3, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + -1, /* (208) full_table_name ::= table_name */ + -3, /* (209) full_table_name ::= db_name NK_DOT table_name */ + -1, /* (210) tag_def_list ::= tag_def */ + -3, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + -2, /* (212) tag_def ::= column_name type_name */ + -1, /* (213) column_def_list ::= column_def */ + -3, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ + -3, /* (215) column_def ::= column_name type_name column_options */ + -1, /* (216) type_name ::= BOOL */ + -1, /* (217) type_name ::= TINYINT */ + -1, /* (218) type_name ::= SMALLINT */ + -1, /* (219) type_name ::= INT */ + -1, /* (220) type_name ::= INTEGER */ + -1, /* (221) type_name ::= BIGINT */ + -1, /* (222) type_name ::= FLOAT */ + -1, /* (223) type_name ::= DOUBLE */ + -4, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + -1, /* (225) type_name ::= TIMESTAMP */ + -4, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + -2, /* (227) type_name ::= TINYINT UNSIGNED */ + -2, /* (228) type_name ::= SMALLINT UNSIGNED */ + -2, /* (229) type_name ::= INT UNSIGNED */ + -2, /* (230) type_name ::= BIGINT UNSIGNED */ + -1, /* (231) type_name ::= JSON */ + -4, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + -1, /* (233) type_name ::= MEDIUMBLOB */ + -1, /* (234) type_name ::= BLOB */ + -4, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + -4, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (237) type_name ::= DECIMAL */ + -4, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + -1, /* (240) type_name_default_len ::= BINARY */ + -1, /* (241) type_name_default_len ::= NCHAR */ + -1, /* (242) type_name_default_len ::= VARCHAR */ + -1, /* (243) type_name_default_len ::= VARBINARY */ + 0, /* (244) tags_def_opt ::= */ + -1, /* (245) tags_def_opt ::= tags_def */ + -4, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 0, /* (247) table_options ::= */ + -3, /* (248) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (249) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (250) table_options ::= table_options WATERMARK duration_list */ + -5, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (252) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (254) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (255) alter_table_options ::= alter_table_option */ + -2, /* (256) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (257) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (258) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (259) duration_list ::= duration_literal */ + -3, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (261) rollup_func_list ::= rollup_func_name */ + -3, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (263) rollup_func_name ::= function_name */ + -1, /* (264) rollup_func_name ::= FIRST */ + -1, /* (265) rollup_func_name ::= LAST */ + -1, /* (266) col_name_list ::= col_name */ + -3, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (268) col_name ::= column_name */ + -2, /* (269) cmd ::= SHOW DNODES */ + -2, /* (270) cmd ::= SHOW USERS */ + -3, /* (271) cmd ::= SHOW USERS FULL */ + -3, /* (272) cmd ::= SHOW USER PRIVILEGES */ + -3, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ + -4, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (277) cmd ::= SHOW MNODES */ + -2, /* (278) cmd ::= SHOW QNODES */ + -2, /* (279) cmd ::= SHOW ARBGROUPS */ + -2, /* (280) cmd ::= SHOW FUNCTIONS */ + -5, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (283) cmd ::= SHOW STREAMS */ + -2, /* (284) cmd ::= SHOW ACCOUNTS */ + -2, /* (285) cmd ::= SHOW APPS */ + -2, /* (286) cmd ::= SHOW CONNECTIONS */ + -2, /* (287) cmd ::= SHOW LICENCES */ + -2, /* (288) cmd ::= SHOW GRANTS */ + -3, /* (289) cmd ::= SHOW GRANTS FULL */ + -3, /* (290) cmd ::= SHOW GRANTS LOGS */ + -3, /* (291) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (295) cmd ::= SHOW ENCRYPTIONS */ + -2, /* (296) cmd ::= SHOW QUERIES */ + -2, /* (297) cmd ::= SHOW SCORES */ + -2, /* (298) cmd ::= SHOW TOPICS */ + -2, /* (299) cmd ::= SHOW VARIABLES */ + -3, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (301) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (303) cmd ::= SHOW BNODES */ + -2, /* (304) cmd ::= SHOW SNODES */ + -2, /* (305) cmd ::= SHOW CLUSTER */ + -2, /* (306) cmd ::= SHOW TRANSACTIONS */ + -4, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (308) cmd ::= SHOW CONSUMERS */ + -2, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (315) cmd ::= SHOW VNODES */ + -3, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (317) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (320) cmd ::= SHOW COMPACTS */ + -3, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (322) table_kind_db_name_cond_opt ::= */ + -1, /* (323) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (326) table_kind ::= NORMAL */ + -1, /* (327) table_kind ::= CHILD */ + 0, /* (328) db_name_cond_opt ::= */ + -2, /* (329) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (330) like_pattern_opt ::= */ + -2, /* (331) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (332) table_name_cond ::= table_name */ + 0, /* (333) from_db_opt ::= */ + -2, /* (334) from_db_opt ::= FROM db_name */ + 0, /* (335) tag_list_opt ::= */ + -1, /* (336) tag_list_opt ::= tag_item */ + -3, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (338) tag_item ::= TBNAME */ + -1, /* (339) tag_item ::= QTAGS */ + -1, /* (340) tag_item ::= column_name */ + -2, /* (341) tag_item ::= column_name column_alias */ + -3, /* (342) tag_item ::= column_name AS column_alias */ + 0, /* (343) db_kind_opt ::= */ + -1, /* (344) db_kind_opt ::= USER */ + -1, /* (345) db_kind_opt ::= SYSTEM */ + -11, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + -11, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + -4, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ + -3, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ + -1, /* (350) full_tsma_name ::= tsma_name */ + -3, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ + -4, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + -8, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (356) full_index_name ::= index_name */ + -3, /* (357) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (359) 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, /* (360) func_list ::= func */ + -3, /* (361) func_list ::= func_list NK_COMMA func */ + -4, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (363) sma_func_name ::= function_name */ + -1, /* (364) sma_func_name ::= COUNT */ + -1, /* (365) sma_func_name ::= FIRST */ + -1, /* (366) sma_func_name ::= LAST */ + -1, /* (367) sma_func_name ::= LAST_ROW */ + 0, /* (368) sma_stream_opt ::= */ + -3, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (372) with_meta ::= AS */ + -3, /* (373) with_meta ::= WITH META AS */ + -3, /* (374) with_meta ::= ONLY META AS */ + -6, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (380) cmd ::= DESC full_table_name */ + -2, /* (381) cmd ::= DESCRIBE full_table_name */ + -3, /* (382) cmd ::= RESET QUERY CACHE */ + -4, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (385) analyze_opt ::= */ + -1, /* (386) analyze_opt ::= ANALYZE */ + 0, /* (387) explain_options ::= */ + -3, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (390) 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, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (392) agg_func_opt ::= */ + -1, /* (393) agg_func_opt ::= AGGREGATE */ + 0, /* (394) bufsize_opt ::= */ + -2, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (396) language_opt ::= */ + -2, /* (397) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (398) or_replace_opt ::= */ + -2, /* (399) or_replace_opt ::= OR REPLACE */ + -6, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (402) full_view_name ::= view_name */ + -3, /* (403) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (404) 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, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (408) col_list_opt ::= */ + -3, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + -1, /* (410) column_stream_def_list ::= column_stream_def */ + -3, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + -2, /* (412) column_stream_def ::= column_name stream_col_options */ + 0, /* (413) stream_col_options ::= */ + -3, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ + 0, /* (415) tag_def_or_ref_opt ::= */ + -1, /* (416) tag_def_or_ref_opt ::= tags_def */ + -4, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 0, /* (418) stream_options ::= */ + -3, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (427) subtable_opt ::= */ + -4, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (429) ignore_opt ::= */ + -2, /* (430) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (432) cmd ::= KILL QUERY NK_STRING */ + -3, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (435) cmd ::= BALANCE VGROUP */ + -4, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -5, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + -4, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (441) on_vgroup_id ::= */ + -2, /* (442) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (443) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (446) cmd ::= query_or_subquery */ + -1, /* (447) cmd ::= insert_query */ + -7, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (450) tags_literal ::= NK_INTEGER */ + -3, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + -3, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + -2, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ + -4, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + -2, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ + -4, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + -1, /* (459) tags_literal ::= NK_FLOAT */ + -2, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (462) tags_literal ::= NK_BIN */ + -3, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + -3, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + -2, /* (465) tags_literal ::= NK_PLUS NK_BIN */ + -4, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + -4, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + -2, /* (468) tags_literal ::= NK_MINUS NK_BIN */ + -4, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + -4, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + -1, /* (471) tags_literal ::= NK_HEX */ + -3, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + -3, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + -2, /* (474) tags_literal ::= NK_PLUS NK_HEX */ + -4, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + -4, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + -2, /* (477) tags_literal ::= NK_MINUS NK_HEX */ + -4, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + -4, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + -1, /* (480) tags_literal ::= NK_STRING */ + -3, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + -3, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + -1, /* (483) tags_literal ::= NK_BOOL */ + -1, /* (484) tags_literal ::= NULL */ + -1, /* (485) tags_literal ::= literal_func */ + -3, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (488) tags_literal_list ::= tags_literal */ + -3, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (490) literal ::= NK_INTEGER */ + -1, /* (491) literal ::= NK_FLOAT */ + -1, /* (492) literal ::= NK_STRING */ + -1, /* (493) literal ::= NK_BOOL */ + -2, /* (494) literal ::= TIMESTAMP NK_STRING */ + -1, /* (495) literal ::= duration_literal */ + -1, /* (496) literal ::= NULL */ + -1, /* (497) literal ::= NK_QUESTION */ + -1, /* (498) duration_literal ::= NK_VARIABLE */ + -1, /* (499) signed ::= NK_INTEGER */ + -2, /* (500) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (501) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (502) signed ::= NK_FLOAT */ + -2, /* (503) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (504) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (505) signed_literal ::= signed */ + -1, /* (506) signed_literal ::= NK_STRING */ + -1, /* (507) signed_literal ::= NK_BOOL */ + -2, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (509) signed_literal ::= duration_literal */ + -1, /* (510) signed_literal ::= NULL */ + -1, /* (511) signed_literal ::= literal_func */ + -1, /* (512) signed_literal ::= NK_QUESTION */ + -1, /* (513) literal_list ::= signed_literal */ + -3, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (515) db_name ::= NK_ID */ + -1, /* (516) table_name ::= NK_ID */ + -1, /* (517) column_name ::= NK_ID */ + -1, /* (518) function_name ::= NK_ID */ + -1, /* (519) view_name ::= NK_ID */ + -1, /* (520) table_alias ::= NK_ID */ + -1, /* (521) column_alias ::= NK_ID */ + -1, /* (522) column_alias ::= NK_ALIAS */ + -1, /* (523) user_name ::= NK_ID */ + -1, /* (524) topic_name ::= NK_ID */ + -1, /* (525) stream_name ::= NK_ID */ + -1, /* (526) cgroup_name ::= NK_ID */ + -1, /* (527) index_name ::= NK_ID */ + -1, /* (528) tsma_name ::= NK_ID */ + -1, /* (529) expr_or_subquery ::= expression */ + -1, /* (530) expression ::= literal */ + -1, /* (531) expression ::= pseudo_column */ + -1, /* (532) expression ::= column_reference */ + -1, /* (533) expression ::= function_expression */ + -1, /* (534) expression ::= case_when_expression */ + -3, /* (535) expression ::= NK_LP expression NK_RP */ + -2, /* (536) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (537) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (546) expression_list ::= expr_or_subquery */ + -3, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (548) column_reference ::= column_name */ + -3, /* (549) column_reference ::= table_name NK_DOT column_name */ + -1, /* (550) column_reference ::= NK_ALIAS */ + -3, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (552) pseudo_column ::= ROWTS */ + -1, /* (553) pseudo_column ::= TBNAME */ + -3, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (555) pseudo_column ::= QSTART */ + -1, /* (556) pseudo_column ::= QEND */ + -1, /* (557) pseudo_column ::= QDURATION */ + -1, /* (558) pseudo_column ::= WSTART */ + -1, /* (559) pseudo_column ::= WEND */ + -1, /* (560) pseudo_column ::= WDURATION */ + -1, /* (561) pseudo_column ::= IROWTS */ + -1, /* (562) pseudo_column ::= ISFILLED */ + -1, /* (563) pseudo_column ::= QTAGS */ + -4, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -6, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + -1, /* (568) function_expression ::= literal_func */ + -3, /* (569) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (570) literal_func ::= NOW */ + -1, /* (571) literal_func ::= TODAY */ + -1, /* (572) noarg_func ::= NOW */ + -1, /* (573) noarg_func ::= TODAY */ + -1, /* (574) noarg_func ::= TIMEZONE */ + -1, /* (575) noarg_func ::= DATABASE */ + -1, /* (576) noarg_func ::= CLIENT_VERSION */ + -1, /* (577) noarg_func ::= SERVER_VERSION */ + -1, /* (578) noarg_func ::= SERVER_STATUS */ + -1, /* (579) noarg_func ::= CURRENT_USER */ + -1, /* (580) noarg_func ::= USER */ + -1, /* (581) star_func ::= COUNT */ + -1, /* (582) star_func ::= FIRST */ + -1, /* (583) star_func ::= LAST */ + -1, /* (584) star_func ::= LAST_ROW */ + -1, /* (585) star_func_para_list ::= NK_STAR */ + -1, /* (586) star_func_para_list ::= other_para_list */ + -1, /* (587) other_para_list ::= star_func_para */ + -3, /* (588) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (589) star_func_para ::= expr_or_subquery */ + -3, /* (590) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (591) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (592) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (593) when_then_list ::= when_then_expr */ + -2, /* (594) when_then_list ::= when_then_list when_then_expr */ + -4, /* (595) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (596) case_when_else_opt ::= */ + -2, /* (597) case_when_else_opt ::= ELSE common_expression */ + -3, /* (598) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (599) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (600) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (601) predicate ::= expr_or_subquery IS NULL */ + -4, /* (602) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (603) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (604) compare_op ::= NK_LT */ + -1, /* (605) compare_op ::= NK_GT */ + -1, /* (606) compare_op ::= NK_LE */ + -1, /* (607) compare_op ::= NK_GE */ + -1, /* (608) compare_op ::= NK_NE */ + -1, /* (609) compare_op ::= NK_EQ */ + -1, /* (610) compare_op ::= LIKE */ + -2, /* (611) compare_op ::= NOT LIKE */ + -1, /* (612) compare_op ::= MATCH */ + -1, /* (613) compare_op ::= NMATCH */ + -1, /* (614) compare_op ::= CONTAINS */ + -1, /* (615) in_op ::= IN */ + -2, /* (616) in_op ::= NOT IN */ + -3, /* (617) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (618) boolean_value_expression ::= boolean_primary */ + -2, /* (619) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (620) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (621) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (622) boolean_primary ::= predicate */ + -3, /* (623) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (624) common_expression ::= expr_or_subquery */ + -1, /* (625) common_expression ::= boolean_value_expression */ + 0, /* (626) from_clause_opt ::= */ + -2, /* (627) from_clause_opt ::= FROM table_reference_list */ + -1, /* (628) table_reference_list ::= table_reference */ + -3, /* (629) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (630) table_reference ::= table_primary */ + -1, /* (631) table_reference ::= joined_table */ + -2, /* (632) table_primary ::= table_name alias_opt */ + -4, /* (633) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (634) table_primary ::= subquery alias_opt */ + -1, /* (635) table_primary ::= parenthesized_joined_table */ + 0, /* (636) alias_opt ::= */ + -1, /* (637) alias_opt ::= table_alias */ + -2, /* (638) alias_opt ::= AS table_alias */ + -3, /* (639) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (640) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (641) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (642) join_type ::= */ + -1, /* (643) join_type ::= INNER */ + -1, /* (644) join_type ::= LEFT */ + -1, /* (645) join_type ::= RIGHT */ + -1, /* (646) join_type ::= FULL */ + 0, /* (647) join_subtype ::= */ + -1, /* (648) join_subtype ::= OUTER */ + -1, /* (649) join_subtype ::= SEMI */ + -1, /* (650) join_subtype ::= ANTI */ + -1, /* (651) join_subtype ::= ASOF */ + -1, /* (652) join_subtype ::= WINDOW */ + 0, /* (653) join_on_clause_opt ::= */ + -2, /* (654) join_on_clause_opt ::= ON search_condition */ + 0, /* (655) window_offset_clause_opt ::= */ + -6, /* (656) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (657) window_offset_literal ::= NK_VARIABLE */ + -2, /* (658) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (659) jlimit_clause_opt ::= */ + -2, /* (660) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (661) 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, /* (662) hint_list ::= */ + -1, /* (663) hint_list ::= NK_HINT */ + 0, /* (664) tag_mode_opt ::= */ + -1, /* (665) tag_mode_opt ::= TAGS */ + 0, /* (666) set_quantifier_opt ::= */ + -1, /* (667) set_quantifier_opt ::= DISTINCT */ + -1, /* (668) set_quantifier_opt ::= ALL */ + -1, /* (669) select_list ::= select_item */ + -3, /* (670) select_list ::= select_list NK_COMMA select_item */ + -1, /* (671) select_item ::= NK_STAR */ + -1, /* (672) select_item ::= common_expression */ + -2, /* (673) select_item ::= common_expression column_alias */ + -3, /* (674) select_item ::= common_expression AS column_alias */ + -3, /* (675) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (676) where_clause_opt ::= */ + -2, /* (677) where_clause_opt ::= WHERE search_condition */ + 0, /* (678) partition_by_clause_opt ::= */ + -3, /* (679) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (680) partition_list ::= partition_item */ + -3, /* (681) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (682) partition_item ::= expr_or_subquery */ + -2, /* (683) partition_item ::= expr_or_subquery column_alias */ + -3, /* (684) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (685) twindow_clause_opt ::= */ + -6, /* (686) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (687) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (690) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (693) sliding_opt ::= */ + -4, /* (694) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (695) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (696) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (697) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (698) fill_opt ::= */ + -4, /* (699) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (700) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (701) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (702) fill_mode ::= NONE */ + -1, /* (703) fill_mode ::= PREV */ + -1, /* (704) fill_mode ::= NULL */ + -1, /* (705) fill_mode ::= NULL_F */ + -1, /* (706) fill_mode ::= LINEAR */ + -1, /* (707) fill_mode ::= NEXT */ + 0, /* (708) group_by_clause_opt ::= */ + -3, /* (709) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (710) group_by_list ::= expr_or_subquery */ + -3, /* (711) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (712) having_clause_opt ::= */ + -2, /* (713) having_clause_opt ::= HAVING search_condition */ + 0, /* (714) range_opt ::= */ + -6, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (717) every_opt ::= */ + -4, /* (718) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (719) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (720) query_simple ::= query_specification */ + -1, /* (721) query_simple ::= union_query_expression */ + -4, /* (722) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (723) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (724) query_simple_or_subquery ::= query_simple */ + -1, /* (725) query_simple_or_subquery ::= subquery */ + -1, /* (726) query_or_subquery ::= query_expression */ + -1, /* (727) query_or_subquery ::= subquery */ + 0, /* (728) order_by_clause_opt ::= */ + -3, /* (729) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (730) slimit_clause_opt ::= */ + -2, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (734) limit_clause_opt ::= */ + -2, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (738) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (739) subquery ::= NK_LP subquery NK_RP */ + -1, /* (740) search_condition ::= common_expression */ + -1, /* (741) sort_specification_list ::= sort_specification */ + -3, /* (742) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (743) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (744) ordering_specification_opt ::= */ + -1, /* (745) ordering_specification_opt ::= ASC */ + -1, /* (746) ordering_specification_opt ::= DESC */ + 0, /* (747) null_ordering_opt ::= */ + -2, /* (748) null_ordering_opt ::= NULLS FIRST */ + -2, /* (749) null_ordering_opt ::= NULLS LAST */ + 0, /* (750) column_options ::= */ + -3, /* (751) column_options ::= column_options PRIMARY KEY */ + -3, /* (752) column_options ::= column_options ENCODE NK_STRING */ + -3, /* (753) column_options ::= column_options COMPRESS NK_STRING */ + -3, /* (754) column_options ::= column_options LEVEL NK_STRING */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -5587,19 +5564,19 @@ static YYACTIONTYPE yy_reduce( case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ #line 50 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5590 "sql.c" +#line 5567 "sql.c" yy_destructor(yypParser,379,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ #line 51 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5596 "sql.c" +#line 5573 "sql.c" yy_destructor(yypParser,380,&yymsp[0].minor); break; case 2: /* account_options ::= */ #line 55 "sql.y" { } -#line 5602 "sql.c" +#line 5579 "sql.c" break; case 3: /* account_options ::= account_options PPS literal */ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); @@ -5613,7 +5590,7 @@ static YYACTIONTYPE yy_reduce( { yy_destructor(yypParser,379,&yymsp[-2].minor); #line 56 "sql.y" { } -#line 5616 "sql.c" +#line 5593 "sql.c" yy_destructor(yypParser,381,&yymsp[0].minor); } break; @@ -5621,14 +5598,14 @@ static YYACTIONTYPE yy_reduce( { yy_destructor(yypParser,382,&yymsp[0].minor); #line 68 "sql.y" { } -#line 5624 "sql.c" +#line 5601 "sql.c" } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ { yy_destructor(yypParser,380,&yymsp[-1].minor); #line 69 "sql.y" { } -#line 5631 "sql.c" +#line 5608 "sql.c" yy_destructor(yypParser,382,&yymsp[0].minor); } break; @@ -5644,3054 +5621,3052 @@ static YYACTIONTYPE yy_reduce( case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); #line 73 "sql.y" { } -#line 5647 "sql.c" +#line 5624 "sql.c" yy_destructor(yypParser,381,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ #line 86 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5653 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5630 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ #line 87 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5659 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5636 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; case 26: /* white_list ::= HOST ip_range_list */ #line 91 "sql.y" -{ yymsp[-1].minor.yy652 = yymsp[0].minor.yy652; } -#line 5665 "sql.c" +{ yymsp[-1].minor.yy316 = yymsp[0].minor.yy316; } +#line 5642 "sql.c" break; case 27: /* white_list_opt ::= */ - case 207: /* specific_cols_opt ::= */ yytestcase(yyruleno==207); - case 245: /* tags_def_opt ::= */ yytestcase(yyruleno==245); - case 336: /* tag_list_opt ::= */ yytestcase(yyruleno==336); - case 409: /* col_list_opt ::= */ yytestcase(yyruleno==409); - case 416: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==416); - case 679: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==679); - case 709: /* group_by_clause_opt ::= */ yytestcase(yyruleno==709); - case 729: /* order_by_clause_opt ::= */ yytestcase(yyruleno==729); + case 206: /* specific_cols_opt ::= */ yytestcase(yyruleno==206); + case 244: /* tags_def_opt ::= */ yytestcase(yyruleno==244); + case 335: /* tag_list_opt ::= */ yytestcase(yyruleno==335); + case 408: /* col_list_opt ::= */ yytestcase(yyruleno==408); + case 415: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==415); + case 678: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==678); + case 708: /* group_by_clause_opt ::= */ yytestcase(yyruleno==708); + case 728: /* order_by_clause_opt ::= */ yytestcase(yyruleno==728); #line 95 "sql.y" -{ yymsp[1].minor.yy652 = NULL; } -#line 5678 "sql.c" +{ yymsp[1].minor.yy316 = NULL; } +#line 5655 "sql.c" break; case 28: /* white_list_opt ::= white_list */ - case 246: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==246); - case 417: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==417); - case 587: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==587); + case 245: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==245); + case 416: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==416); + case 586: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==586); #line 96 "sql.y" -{ yylhsminor.yy652 = yymsp[0].minor.yy652; } -#line 5686 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = yymsp[0].minor.yy316; } +#line 5663 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 29: /* is_import_opt ::= */ case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); #line 100 "sql.y" -{ yymsp[1].minor.yy535 = 0; } -#line 5693 "sql.c" +{ yymsp[1].minor.yy1043 = 0; } +#line 5670 "sql.c" 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); #line 101 "sql.y" -{ yymsp[-1].minor.yy535 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5700 "sql.c" +{ yymsp[-1].minor.yy1043 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5677 "sql.c" break; case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ #line 109 "sql.y" { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy837, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy535, yymsp[-1].minor.yy535, yymsp[-2].minor.yy535); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy652); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy1043, yymsp[-1].minor.yy1043, yymsp[-2].minor.yy1043); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy316); } -#line 5708 "sql.c" +#line 5685 "sql.c" break; case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ #line 113 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } -#line 5713 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 5690 "sql.c" break; case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ #line 114 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } -#line 5718 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 5695 "sql.c" break; case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ #line 115 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } -#line 5723 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 5700 "sql.c" break; case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ #line 116 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } -#line 5728 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } +#line 5705 "sql.c" break; case 38: /* cmd ::= ALTER USER user_name ADD white_list */ #line 117 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy652); } -#line 5733 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy316); } +#line 5710 "sql.c" break; case 39: /* cmd ::= ALTER USER user_name DROP white_list */ #line 118 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy837, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy652); } -#line 5738 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy316); } +#line 5715 "sql.c" break; case 40: /* cmd ::= DROP USER user_name */ #line 119 "sql.y" -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy837); } -#line 5743 "sql.c" +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy1109); } +#line 5720 "sql.c" break; case 41: /* sysinfo_opt ::= */ #line 123 "sql.y" -{ yymsp[1].minor.yy535 = 1; } -#line 5748 "sql.c" +{ yymsp[1].minor.yy1043 = 1; } +#line 5725 "sql.c" break; case 43: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ #line 127 "sql.y" -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy909, &yymsp[-3].minor.yy495, &yymsp[0].minor.yy837, yymsp[-2].minor.yy54); } -#line 5753 "sql.c" +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } +#line 5730 "sql.c" break; case 44: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ #line 128 "sql.y" -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy909, &yymsp[-3].minor.yy495, &yymsp[0].minor.yy837, yymsp[-2].minor.yy54); } -#line 5758 "sql.c" +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } +#line 5735 "sql.c" break; case 45: /* privileges ::= ALL */ #line 132 "sql.y" -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_ALL; } -#line 5763 "sql.c" +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALL; } +#line 5740 "sql.c" break; case 46: /* privileges ::= priv_type_list */ case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); #line 133 "sql.y" -{ yylhsminor.yy909 = yymsp[0].minor.yy909; } -#line 5769 "sql.c" - yymsp[0].minor.yy909 = yylhsminor.yy909; +{ yylhsminor.yy1089 = yymsp[0].minor.yy1089; } +#line 5746 "sql.c" + yymsp[0].minor.yy1089 = yylhsminor.yy1089; break; case 47: /* privileges ::= SUBSCRIBE */ #line 134 "sql.y" -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_SUBSCRIBE; } -#line 5775 "sql.c" +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 5752 "sql.c" break; case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ #line 139 "sql.y" -{ yylhsminor.yy909 = yymsp[-2].minor.yy909 | yymsp[0].minor.yy909; } -#line 5780 "sql.c" - yymsp[-2].minor.yy909 = yylhsminor.yy909; +{ yylhsminor.yy1089 = yymsp[-2].minor.yy1089 | yymsp[0].minor.yy1089; } +#line 5757 "sql.c" + yymsp[-2].minor.yy1089 = yylhsminor.yy1089; break; case 50: /* priv_type ::= READ */ #line 143 "sql.y" -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_READ; } -#line 5786 "sql.c" +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_READ; } +#line 5763 "sql.c" break; case 51: /* priv_type ::= WRITE */ #line 144 "sql.y" -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_WRITE; } -#line 5791 "sql.c" +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_WRITE; } +#line 5768 "sql.c" break; case 52: /* priv_type ::= ALTER */ #line 145 "sql.y" -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_ALTER; } -#line 5796 "sql.c" +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALTER; } +#line 5773 "sql.c" break; case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ #line 149 "sql.y" -{ yylhsminor.yy495.first = yymsp[-2].minor.yy0; yylhsminor.yy495.second = yymsp[0].minor.yy0; } -#line 5801 "sql.c" - yymsp[-2].minor.yy495 = yylhsminor.yy495; +{ yylhsminor.yy849.first = yymsp[-2].minor.yy0; yylhsminor.yy849.second = yymsp[0].minor.yy0; } +#line 5778 "sql.c" + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ #line 150 "sql.y" -{ yylhsminor.yy495.first = yymsp[-2].minor.yy837; yylhsminor.yy495.second = yymsp[0].minor.yy0; } -#line 5807 "sql.c" - yymsp[-2].minor.yy495 = yylhsminor.yy495; +{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy0; } +#line 5784 "sql.c" + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; case 55: /* priv_level ::= db_name NK_DOT table_name */ #line 151 "sql.y" -{ yylhsminor.yy495.first = yymsp[-2].minor.yy837; yylhsminor.yy495.second = yymsp[0].minor.yy837; } -#line 5813 "sql.c" - yymsp[-2].minor.yy495 = yylhsminor.yy495; +{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy1109; } +#line 5790 "sql.c" + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; case 56: /* priv_level ::= topic_name */ #line 152 "sql.y" -{ yylhsminor.yy495.first = yymsp[0].minor.yy837; yylhsminor.yy495.second = nil_token; } -#line 5819 "sql.c" - yymsp[0].minor.yy495 = yylhsminor.yy495; +{ yylhsminor.yy849.first = yymsp[0].minor.yy1109; yylhsminor.yy849.second = nil_token; } +#line 5796 "sql.c" + yymsp[0].minor.yy849 = yylhsminor.yy849; break; case 57: /* with_opt ::= */ case 173: /* start_opt ::= */ yytestcase(yyruleno==173); case 177: /* end_opt ::= */ yytestcase(yyruleno==177); - case 331: /* like_pattern_opt ::= */ yytestcase(yyruleno==331); - case 428: /* subtable_opt ::= */ yytestcase(yyruleno==428); - case 597: /* case_when_else_opt ::= */ yytestcase(yyruleno==597); - case 627: /* from_clause_opt ::= */ yytestcase(yyruleno==627); - case 654: /* join_on_clause_opt ::= */ yytestcase(yyruleno==654); - case 656: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==656); - case 660: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==660); - case 677: /* where_clause_opt ::= */ yytestcase(yyruleno==677); - case 686: /* twindow_clause_opt ::= */ yytestcase(yyruleno==686); - case 694: /* sliding_opt ::= */ yytestcase(yyruleno==694); - case 699: /* fill_opt ::= */ yytestcase(yyruleno==699); - case 713: /* having_clause_opt ::= */ yytestcase(yyruleno==713); - case 715: /* range_opt ::= */ yytestcase(yyruleno==715); - case 718: /* every_opt ::= */ yytestcase(yyruleno==718); - case 731: /* slimit_clause_opt ::= */ yytestcase(yyruleno==731); - case 735: /* limit_clause_opt ::= */ yytestcase(yyruleno==735); + case 330: /* like_pattern_opt ::= */ yytestcase(yyruleno==330); + case 427: /* subtable_opt ::= */ yytestcase(yyruleno==427); + case 596: /* case_when_else_opt ::= */ yytestcase(yyruleno==596); + case 626: /* from_clause_opt ::= */ yytestcase(yyruleno==626); + case 653: /* join_on_clause_opt ::= */ yytestcase(yyruleno==653); + case 655: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==655); + case 659: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==659); + case 676: /* where_clause_opt ::= */ yytestcase(yyruleno==676); + case 685: /* twindow_clause_opt ::= */ yytestcase(yyruleno==685); + case 693: /* sliding_opt ::= */ yytestcase(yyruleno==693); + case 698: /* fill_opt ::= */ yytestcase(yyruleno==698); + case 712: /* having_clause_opt ::= */ yytestcase(yyruleno==712); + case 714: /* range_opt ::= */ yytestcase(yyruleno==714); + case 717: /* every_opt ::= */ yytestcase(yyruleno==717); + case 730: /* slimit_clause_opt ::= */ yytestcase(yyruleno==730); + case 734: /* limit_clause_opt ::= */ yytestcase(yyruleno==734); #line 154 "sql.y" -{ yymsp[1].minor.yy54 = NULL; } -#line 5843 "sql.c" +{ yymsp[1].minor.yy416 = NULL; } +#line 5820 "sql.c" break; case 58: /* with_opt ::= WITH search_condition */ - case 628: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==628); - case 655: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==655); - case 678: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==678); - case 714: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==714); + case 627: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==627); + case 654: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==654); + case 677: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==677); + case 713: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==713); #line 155 "sql.y" -{ yymsp[-1].minor.yy54 = yymsp[0].minor.yy54; } -#line 5852 "sql.c" +{ yymsp[-1].minor.yy416 = yymsp[0].minor.yy416; } +#line 5829 "sql.c" break; case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ #line 158 "sql.y" { pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } -#line 5857 "sql.c" +#line 5834 "sql.c" break; case 60: /* cmd ::= CREATE DNODE dnode_endpoint */ #line 161 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy837, NULL); } -#line 5862 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy1109, NULL); } +#line 5839 "sql.c" break; case 61: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ #line 162 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0); } -#line 5867 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } +#line 5844 "sql.c" break; case 62: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ #line 163 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy325, false); } -#line 5872 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy209, false); } +#line 5849 "sql.c" break; case 63: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ #line 164 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy837, yymsp[0].minor.yy325, false); } -#line 5877 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy209, false); } +#line 5854 "sql.c" break; case 64: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ #line 165 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy325); } -#line 5882 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy209); } +#line 5859 "sql.c" break; case 65: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ #line 166 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy837, false, yymsp[0].minor.yy325); } -#line 5887 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, false, yymsp[0].minor.yy209); } +#line 5864 "sql.c" break; case 66: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ #line 167 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } -#line 5892 "sql.c" +#line 5869 "sql.c" break; case 67: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ #line 168 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5897 "sql.c" +#line 5874 "sql.c" break; case 68: /* cmd ::= ALTER ALL DNODES NK_STRING */ #line 169 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } -#line 5902 "sql.c" +#line 5879 "sql.c" break; case 69: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ #line 170 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5907 "sql.c" +#line 5884 "sql.c" break; case 70: /* cmd ::= RESTORE DNODE NK_INTEGER */ #line 171 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } -#line 5912 "sql.c" +#line 5889 "sql.c" break; 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 365: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==365); - case 366: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==366); - case 367: /* sma_func_name ::= LAST */ yytestcase(yyruleno==367); - case 368: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==368); - case 516: /* db_name ::= NK_ID */ yytestcase(yyruleno==516); - case 517: /* table_name ::= NK_ID */ yytestcase(yyruleno==517); - case 518: /* column_name ::= NK_ID */ yytestcase(yyruleno==518); - case 519: /* function_name ::= NK_ID */ yytestcase(yyruleno==519); - case 520: /* view_name ::= NK_ID */ yytestcase(yyruleno==520); - case 521: /* table_alias ::= NK_ID */ yytestcase(yyruleno==521); - case 522: /* column_alias ::= NK_ID */ yytestcase(yyruleno==522); - case 523: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==523); - case 524: /* user_name ::= NK_ID */ yytestcase(yyruleno==524); - case 525: /* topic_name ::= NK_ID */ yytestcase(yyruleno==525); - case 526: /* stream_name ::= NK_ID */ yytestcase(yyruleno==526); - case 527: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==527); - case 528: /* index_name ::= NK_ID */ yytestcase(yyruleno==528); - case 529: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==529); - case 573: /* noarg_func ::= NOW */ yytestcase(yyruleno==573); - case 574: /* noarg_func ::= TODAY */ yytestcase(yyruleno==574); - case 575: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==575); - case 576: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==576); - case 577: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==577); - case 578: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==578); - case 579: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==579); - case 580: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==580); - case 581: /* noarg_func ::= USER */ yytestcase(yyruleno==581); - case 582: /* star_func ::= COUNT */ yytestcase(yyruleno==582); - case 583: /* star_func ::= FIRST */ yytestcase(yyruleno==583); - case 584: /* star_func ::= LAST */ yytestcase(yyruleno==584); - case 585: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==585); + case 364: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==364); + case 365: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==365); + case 366: /* sma_func_name ::= LAST */ yytestcase(yyruleno==366); + case 367: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==367); + case 515: /* db_name ::= NK_ID */ yytestcase(yyruleno==515); + case 516: /* table_name ::= NK_ID */ yytestcase(yyruleno==516); + case 517: /* column_name ::= NK_ID */ yytestcase(yyruleno==517); + case 518: /* function_name ::= NK_ID */ yytestcase(yyruleno==518); + case 519: /* view_name ::= NK_ID */ yytestcase(yyruleno==519); + case 520: /* table_alias ::= NK_ID */ yytestcase(yyruleno==520); + case 521: /* column_alias ::= NK_ID */ yytestcase(yyruleno==521); + case 522: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==522); + case 523: /* user_name ::= NK_ID */ yytestcase(yyruleno==523); + case 524: /* topic_name ::= NK_ID */ yytestcase(yyruleno==524); + case 525: /* stream_name ::= NK_ID */ yytestcase(yyruleno==525); + case 526: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==526); + case 527: /* index_name ::= NK_ID */ yytestcase(yyruleno==527); + case 528: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==528); + case 572: /* noarg_func ::= NOW */ yytestcase(yyruleno==572); + case 573: /* noarg_func ::= TODAY */ yytestcase(yyruleno==573); + case 574: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==574); + case 575: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==575); + case 576: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==576); + case 577: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==577); + case 578: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==578); + case 579: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==579); + case 580: /* noarg_func ::= USER */ yytestcase(yyruleno==580); + case 581: /* star_func ::= COUNT */ yytestcase(yyruleno==581); + case 582: /* star_func ::= FIRST */ yytestcase(yyruleno==582); + case 583: /* star_func ::= LAST */ yytestcase(yyruleno==583); + case 584: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==584); #line 175 "sql.y" -{ yylhsminor.yy837 = yymsp[0].minor.yy0; } -#line 5950 "sql.c" - yymsp[0].minor.yy837 = yylhsminor.yy837; +{ yylhsminor.yy1109 = yymsp[0].minor.yy0; } +#line 5927 "sql.c" + yymsp[0].minor.yy1109 = yylhsminor.yy1109; break; case 74: /* force_opt ::= */ case 101: /* not_exists_opt ::= */ yytestcase(yyruleno==101); case 103: /* exists_opt ::= */ yytestcase(yyruleno==103); - case 386: /* analyze_opt ::= */ yytestcase(yyruleno==386); - case 393: /* agg_func_opt ::= */ yytestcase(yyruleno==393); - case 399: /* or_replace_opt ::= */ yytestcase(yyruleno==399); - case 430: /* ignore_opt ::= */ yytestcase(yyruleno==430); - case 665: /* tag_mode_opt ::= */ yytestcase(yyruleno==665); - case 667: /* set_quantifier_opt ::= */ yytestcase(yyruleno==667); + case 385: /* analyze_opt ::= */ yytestcase(yyruleno==385); + case 392: /* agg_func_opt ::= */ yytestcase(yyruleno==392); + case 398: /* or_replace_opt ::= */ yytestcase(yyruleno==398); + case 429: /* ignore_opt ::= */ yytestcase(yyruleno==429); + case 664: /* tag_mode_opt ::= */ yytestcase(yyruleno==664); + case 666: /* set_quantifier_opt ::= */ yytestcase(yyruleno==666); #line 181 "sql.y" -{ yymsp[1].minor.yy325 = false; } -#line 5964 "sql.c" +{ yymsp[1].minor.yy209 = false; } +#line 5941 "sql.c" break; case 75: /* force_opt ::= FORCE */ case 76: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==76); - case 387: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==387); - case 394: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==394); - case 666: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==666); - case 668: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==668); + case 386: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==386); + case 393: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==393); + case 665: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==665); + case 667: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==667); #line 182 "sql.y" -{ yymsp[0].minor.yy325 = true; } -#line 5974 "sql.c" +{ yymsp[0].minor.yy209 = true; } +#line 5951 "sql.c" break; case 77: /* cmd ::= ALTER CLUSTER NK_STRING */ #line 189 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5979 "sql.c" +#line 5956 "sql.c" break; case 78: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ #line 190 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5984 "sql.c" +#line 5961 "sql.c" break; case 79: /* cmd ::= ALTER LOCAL NK_STRING */ #line 193 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5989 "sql.c" +#line 5966 "sql.c" break; case 80: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ #line 194 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5994 "sql.c" +#line 5971 "sql.c" break; case 81: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ #line 197 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5999 "sql.c" +#line 5976 "sql.c" break; case 82: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ #line 198 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 6004 "sql.c" +#line 5981 "sql.c" break; case 83: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ #line 199 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 6009 "sql.c" +#line 5986 "sql.c" break; case 84: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ #line 202 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 6014 "sql.c" +#line 5991 "sql.c" break; case 85: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ #line 203 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 6019 "sql.c" +#line 5996 "sql.c" break; case 86: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ #line 206 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 6024 "sql.c" +#line 6001 "sql.c" break; case 87: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ #line 207 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 6029 "sql.c" +#line 6006 "sql.c" break; case 88: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ #line 210 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6034 "sql.c" +#line 6011 "sql.c" break; case 89: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ #line 211 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6039 "sql.c" +#line 6016 "sql.c" break; case 90: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ #line 212 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6044 "sql.c" +#line 6021 "sql.c" break; case 91: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ #line 215 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } -#line 6049 "sql.c" +#line 6026 "sql.c" break; case 92: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ #line 218 "sql.y" -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy325, &yymsp[-1].minor.yy837, yymsp[0].minor.yy54); } -#line 6054 "sql.c" +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy209, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } +#line 6031 "sql.c" break; case 93: /* cmd ::= DROP DATABASE exists_opt db_name */ #line 219 "sql.y" -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 6059 "sql.c" +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } +#line 6036 "sql.c" break; case 94: /* cmd ::= USE db_name */ #line 220 "sql.y" -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy837); } -#line 6064 "sql.c" +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } +#line 6041 "sql.c" break; case 95: /* cmd ::= ALTER DATABASE db_name alter_db_options */ #line 221 "sql.y" -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy837, yymsp[0].minor.yy54); } -#line 6069 "sql.c" +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } +#line 6046 "sql.c" break; case 96: /* cmd ::= FLUSH DATABASE db_name */ #line 222 "sql.y" -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy837); } -#line 6074 "sql.c" +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } +#line 6051 "sql.c" break; case 97: /* cmd ::= TRIM DATABASE db_name speed_opt */ #line 223 "sql.y" -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy837, yymsp[0].minor.yy332); } -#line 6079 "sql.c" +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy820); } +#line 6056 "sql.c" break; case 98: /* cmd ::= S3MIGRATE DATABASE db_name */ #line 224 "sql.y" -{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy837); } -#line 6084 "sql.c" +{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } +#line 6061 "sql.c" break; case 99: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ #line 225 "sql.y" -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy837, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 6089 "sql.c" +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 6066 "sql.c" break; case 100: /* not_exists_opt ::= IF NOT EXISTS */ #line 229 "sql.y" -{ yymsp[-2].minor.yy325 = true; } -#line 6094 "sql.c" +{ yymsp[-2].minor.yy209 = true; } +#line 6071 "sql.c" break; case 102: /* exists_opt ::= IF EXISTS */ - case 400: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==400); - case 431: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==431); + case 399: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==399); + case 430: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==430); #line 234 "sql.y" -{ yymsp[-1].minor.yy325 = true; } -#line 6101 "sql.c" +{ yymsp[-1].minor.yy209 = true; } +#line 6078 "sql.c" break; case 104: /* db_options ::= */ #line 237 "sql.y" -{ yymsp[1].minor.yy54 = createDefaultDatabaseOptions(pCxt); } -#line 6106 "sql.c" +{ yymsp[1].minor.yy416 = createDefaultDatabaseOptions(pCxt); } +#line 6083 "sql.c" break; case 105: /* db_options ::= db_options BUFFER NK_INTEGER */ #line 238 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } -#line 6111 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } +#line 6088 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 106: /* db_options ::= db_options CACHEMODEL NK_STRING */ #line 239 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } -#line 6117 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } +#line 6094 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 107: /* db_options ::= db_options CACHESIZE NK_INTEGER */ #line 240 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } -#line 6123 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } +#line 6100 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 108: /* db_options ::= db_options COMP NK_INTEGER */ #line 241 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_COMP, &yymsp[0].minor.yy0); } -#line 6129 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_COMP, &yymsp[0].minor.yy0); } +#line 6106 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 109: /* db_options ::= db_options DURATION NK_INTEGER */ case 110: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==110); #line 242 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } -#line 6136 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } +#line 6113 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 111: /* db_options ::= db_options MAXROWS NK_INTEGER */ #line 244 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } -#line 6142 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } +#line 6119 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 112: /* db_options ::= db_options MINROWS NK_INTEGER */ #line 245 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } -#line 6148 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } +#line 6125 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 113: /* db_options ::= db_options KEEP integer_list */ case 114: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==114); #line 246 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_KEEP, yymsp[0].minor.yy652); } -#line 6155 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP, yymsp[0].minor.yy316); } +#line 6132 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 115: /* db_options ::= db_options PAGES NK_INTEGER */ #line 248 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } -#line 6161 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } +#line 6138 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 116: /* db_options ::= db_options PAGESIZE NK_INTEGER */ #line 249 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } -#line 6167 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } +#line 6144 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 117: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ #line 250 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } -#line 6173 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } +#line 6150 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 118: /* db_options ::= db_options PRECISION NK_STRING */ #line 251 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } -#line 6179 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } +#line 6156 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 119: /* db_options ::= db_options REPLICA NK_INTEGER */ #line 252 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } -#line 6185 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } +#line 6162 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 120: /* db_options ::= db_options VGROUPS NK_INTEGER */ #line 254 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } -#line 6191 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } +#line 6168 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 121: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ #line 255 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } -#line 6197 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } +#line 6174 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 122: /* db_options ::= db_options RETENTIONS retention_list */ #line 256 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_RETENTIONS, yymsp[0].minor.yy652); } -#line 6203 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_RETENTIONS, yymsp[0].minor.yy316); } +#line 6180 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 123: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ #line 257 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } -#line 6209 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } +#line 6186 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 124: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ #line 258 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_WAL, &yymsp[0].minor.yy0); } -#line 6215 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL, &yymsp[0].minor.yy0); } +#line 6192 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 125: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ #line 259 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } -#line 6221 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } +#line 6198 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 126: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ #line 260 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } -#line 6227 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } +#line 6204 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 127: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ #line 261 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-3].minor.yy54, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &t); } -#line 6237 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +#line 6214 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; case 128: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ #line 266 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } -#line 6243 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } +#line 6220 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 129: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ #line 267 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-3].minor.yy54, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &t); } -#line 6253 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +#line 6230 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; case 130: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ #line 272 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } -#line 6259 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } +#line 6236 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 131: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ #line 273 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } -#line 6265 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } +#line 6242 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 132: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ #line 274 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } -#line 6271 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } +#line 6248 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 133: /* db_options ::= db_options TABLE_PREFIX signed */ #line 275 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy54); } -#line 6277 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy416); } +#line 6254 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 134: /* db_options ::= db_options TABLE_SUFFIX signed */ #line 276 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy54); } -#line 6283 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy416); } +#line 6260 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 135: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ #line 277 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } -#line 6289 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } +#line 6266 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 136: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ case 137: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==137); #line 278 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } -#line 6296 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } +#line 6273 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 138: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ #line 280 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } -#line 6302 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } +#line 6279 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 139: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ #line 281 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } -#line 6308 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } +#line 6285 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 140: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ #line 282 "sql.y" -{ yylhsminor.yy54 = setDatabaseOption(pCxt, yymsp[-2].minor.yy54, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } -#line 6314 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } +#line 6291 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 141: /* alter_db_options ::= alter_db_option */ #line 284 "sql.y" -{ yylhsminor.yy54 = createAlterDatabaseOptions(pCxt); yylhsminor.yy54 = setAlterDatabaseOption(pCxt, yylhsminor.yy54, &yymsp[0].minor.yy663); } -#line 6320 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterDatabaseOptions(pCxt); yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yylhsminor.yy416, &yymsp[0].minor.yy101); } +#line 6297 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; case 142: /* alter_db_options ::= alter_db_options alter_db_option */ #line 285 "sql.y" -{ yylhsminor.yy54 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy54, &yymsp[0].minor.yy663); } -#line 6326 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy416, &yymsp[0].minor.yy101); } +#line 6303 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; case 143: /* alter_db_option ::= BUFFER NK_INTEGER */ #line 289 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6332 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6309 "sql.c" break; case 144: /* alter_db_option ::= CACHEMODEL NK_STRING */ #line 290 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6337 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6314 "sql.c" break; case 145: /* alter_db_option ::= CACHESIZE NK_INTEGER */ #line 291 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6342 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6319 "sql.c" break; case 146: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ #line 292 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6347 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6324 "sql.c" break; case 147: /* alter_db_option ::= KEEP integer_list */ case 148: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==148); #line 293 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_KEEP; yymsp[-1].minor.yy663.pList = yymsp[0].minor.yy652; } -#line 6353 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP; yymsp[-1].minor.yy101.pList = yymsp[0].minor.yy316; } +#line 6330 "sql.c" break; case 149: /* alter_db_option ::= PAGES NK_INTEGER */ #line 295 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_PAGES; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6358 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_PAGES; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6335 "sql.c" break; case 150: /* alter_db_option ::= REPLICA NK_INTEGER */ #line 296 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6363 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6340 "sql.c" break; case 151: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ #line 298 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_WAL; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6368 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6345 "sql.c" break; case 152: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ #line 299 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6373 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6350 "sql.c" break; case 153: /* alter_db_option ::= MINROWS NK_INTEGER */ #line 300 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6378 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6355 "sql.c" break; case 154: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ #line 301 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6383 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6360 "sql.c" break; case 155: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ #line 302 "sql.y" { 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.yy663.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy663.val = t; + yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy101.val = t; } -#line 6392 "sql.c" +#line 6369 "sql.c" break; case 156: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ #line 307 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6397 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6374 "sql.c" break; case 157: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ #line 308 "sql.y" { 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.yy663.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy663.val = t; + yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy101.val = t; } -#line 6406 "sql.c" +#line 6383 "sql.c" break; case 158: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ case 159: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==159); #line 313 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6412 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6389 "sql.c" break; case 160: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ #line 315 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6417 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6394 "sql.c" break; case 161: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ #line 316 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6422 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6399 "sql.c" break; case 162: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ #line 317 "sql.y" -{ yymsp[-1].minor.yy663.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6427 "sql.c" +{ yymsp[-1].minor.yy101.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6404 "sql.c" break; case 163: /* integer_list ::= NK_INTEGER */ #line 321 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6432 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 6409 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 164: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 445: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==445); + case 444: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==444); #line 322 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6439 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 6416 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; case 165: /* variable_list ::= NK_VARIABLE */ #line 326 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6445 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6422 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 166: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ #line 327 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6451 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6428 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; case 167: /* retention_list ::= retention */ - case 199: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==199); - case 201: /* multi_create_clause ::= create_from_file_clause */ yytestcase(yyruleno==201); - case 204: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==204); - case 211: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==211); - case 214: /* column_def_list ::= column_def */ yytestcase(yyruleno==214); - case 262: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==262); - case 267: /* col_name_list ::= col_name */ yytestcase(yyruleno==267); - case 337: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==337); - case 361: /* func_list ::= func */ yytestcase(yyruleno==361); - case 411: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==411); - case 489: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==489); - case 514: /* literal_list ::= signed_literal */ yytestcase(yyruleno==514); - case 588: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==588); - case 594: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==594); - case 670: /* select_list ::= select_item */ yytestcase(yyruleno==670); - case 681: /* partition_list ::= partition_item */ yytestcase(yyruleno==681); - case 742: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==742); + case 200: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==200); + case 203: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==203); + case 210: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==210); + case 213: /* column_def_list ::= column_def */ yytestcase(yyruleno==213); + case 261: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==261); + case 266: /* col_name_list ::= col_name */ yytestcase(yyruleno==266); + case 336: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==336); + case 360: /* func_list ::= func */ yytestcase(yyruleno==360); + case 410: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==410); + case 488: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==488); + case 513: /* literal_list ::= signed_literal */ yytestcase(yyruleno==513); + case 587: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==587); + case 593: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==593); + case 669: /* select_list ::= select_item */ yytestcase(yyruleno==669); + case 680: /* partition_list ::= partition_item */ yytestcase(yyruleno==680); + case 741: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==741); #line 331 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, yymsp[0].minor.yy54); } -#line 6474 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = createNodeList(pCxt, yymsp[0].minor.yy416); } +#line 6450 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 168: /* retention_list ::= retention_list NK_COMMA retention */ - case 205: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==205); - case 212: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==212); - case 215: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==215); - case 263: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==263); - case 268: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==268); - case 338: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==338); - case 362: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==362); - case 412: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==412); - case 490: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==490); - case 515: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==515); - case 589: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==589); - case 671: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==671); - case 682: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==682); - case 743: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==743); + case 204: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==204); + case 211: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==211); + case 214: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==214); + case 262: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==262); + case 267: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==267); + case 337: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==337); + case 361: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==361); + case 411: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==411); + case 489: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==489); + case 514: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==514); + case 588: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==588); + case 670: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==670); + case 681: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==681); + case 742: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==742); #line 332 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, yymsp[0].minor.yy54); } -#line 6494 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } +#line 6470 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; case 169: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 170: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==170); #line 334 "sql.y" -{ yylhsminor.yy54 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6501 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6477 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; case 171: /* speed_opt ::= */ - case 395: /* bufsize_opt ::= */ yytestcase(yyruleno==395); + case 394: /* bufsize_opt ::= */ yytestcase(yyruleno==394); #line 339 "sql.y" -{ yymsp[1].minor.yy332 = 0; } -#line 6508 "sql.c" +{ yymsp[1].minor.yy820 = 0; } +#line 6484 "sql.c" break; case 172: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 396: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==396); + case 395: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==395); #line 340 "sql.y" -{ yymsp[-1].minor.yy332 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } -#line 6514 "sql.c" +{ yymsp[-1].minor.yy820 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +#line 6490 "sql.c" break; case 174: /* start_opt ::= START WITH NK_INTEGER */ case 178: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==178); #line 343 "sql.y" -{ yymsp[-2].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } -#line 6520 "sql.c" +{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 6496 "sql.c" break; case 175: /* start_opt ::= START WITH NK_STRING */ case 179: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==179); #line 344 "sql.y" -{ yymsp[-2].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 6526 "sql.c" +{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 6502 "sql.c" break; case 176: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 180: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==180); #line 345 "sql.y" -{ yymsp[-3].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 6532 "sql.c" +{ yymsp[-3].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 6508 "sql.c" 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 183: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==183); + 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); #line 354 "sql.y" -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy325, yymsp[-5].minor.yy54, yymsp[-3].minor.yy652, yymsp[-1].minor.yy652, yymsp[0].minor.yy54); } -#line 6538 "sql.c" +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy316, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } +#line 6514 "sql.c" break; case 182: /* cmd ::= CREATE TABLE multi_create_clause */ #line 355 "sql.y" -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy652); } -#line 6543 "sql.c" +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy316); } +#line 6519 "sql.c" break; - case 184: /* cmd ::= DROP TABLE multi_drop_clause */ -#line 358 "sql.y" -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy652); } -#line 6548 "sql.c" + case 183: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ +#line 357 "sql.y" +{ pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy316, &yymsp[0].minor.yy0); } +#line 6524 "sql.c" break; - case 185: /* cmd ::= DROP STABLE exists_opt full_table_name */ -#line 359 "sql.y" -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy325, yymsp[0].minor.yy54); } -#line 6553 "sql.c" + case 185: /* cmd ::= DROP TABLE multi_drop_clause */ +#line 360 "sql.y" +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy316); } +#line 6529 "sql.c" break; - case 186: /* cmd ::= ALTER TABLE alter_table_clause */ - case 447: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==447); - case 448: /* cmd ::= insert_query */ yytestcase(yyruleno==448); + case 186: /* cmd ::= DROP STABLE exists_opt full_table_name */ #line 361 "sql.y" -{ pCxt->pRootNode = yymsp[0].minor.yy54; } -#line 6560 "sql.c" +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } +#line 6534 "sql.c" break; - case 187: /* cmd ::= ALTER STABLE alter_table_clause */ -#line 362 "sql.y" -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy54); } -#line 6565 "sql.c" + case 187: /* cmd ::= ALTER TABLE alter_table_clause */ + case 446: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==446); + case 447: /* cmd ::= insert_query */ yytestcase(yyruleno==447); +#line 363 "sql.y" +{ pCxt->pRootNode = yymsp[0].minor.yy416; } +#line 6541 "sql.c" break; - case 188: /* alter_table_clause ::= full_table_name alter_table_options */ + case 188: /* cmd ::= ALTER STABLE alter_table_clause */ #line 364 "sql.y" -{ yylhsminor.yy54 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 6570 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy416); } +#line 6546 "sql.c" break; - case 189: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + case 189: /* alter_table_clause ::= full_table_name alter_table_options */ #line 366 "sql.y" -{ yylhsminor.yy54 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy54, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy837, yymsp[-1].minor.yy84, yymsp[0].minor.yy54); } -#line 6576 "sql.c" - yymsp[-5].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 6551 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 190: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -#line 367 "sql.y" -{ yylhsminor.yy54 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy54, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy837); } -#line 6582 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 190: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ +#line 368 "sql.y" +{ yylhsminor.yy416 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy416, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } +#line 6557 "sql.c" + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 191: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + case 191: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ #line 369 "sql.y" -{ yylhsminor.yy54 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy837, yymsp[0].minor.yy84); } -#line 6588 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy1109); } +#line 6563 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ #line 371 "sql.y" -{ yylhsminor.yy54 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy837, yymsp[0].minor.yy54); } -#line 6594 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } +#line 6569 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 193: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + case 193: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ #line 373 "sql.y" -{ yylhsminor.yy54 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy837, &yymsp[0].minor.yy837); } -#line 6600 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } +#line 6575 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 194: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + case 194: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ #line 375 "sql.y" -{ yylhsminor.yy54 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy837, yymsp[0].minor.yy84); } -#line 6606 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 6581 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 195: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -#line 376 "sql.y" -{ yylhsminor.yy54 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy54, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy837); } -#line 6612 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 195: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +#line 377 "sql.y" +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } +#line 6587 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 196: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + case 196: /* alter_table_clause ::= full_table_name DROP TAG column_name */ #line 378 "sql.y" -{ yylhsminor.yy54 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy837, yymsp[0].minor.yy84); } -#line 6618 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy1109); } +#line 6593 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 197: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + case 197: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ #line 380 "sql.y" -{ yylhsminor.yy54 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy54, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy837, &yymsp[0].minor.yy837); } -#line 6624 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } +#line 6599 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 198: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + case 198: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ #line 382 "sql.y" -{ yylhsminor.yy54 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy54, &yymsp[-2].minor.yy837, yymsp[0].minor.yy54); } -#line 6630 "sql.c" - yymsp[-5].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 6605 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 200: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 595: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==595); -#line 387 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-1].minor.yy652, yymsp[0].minor.yy54); } -#line 6637 "sql.c" - yymsp[-1].minor.yy652 = yylhsminor.yy652; + case 199: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ +#line 384 "sql.y" +{ yylhsminor.yy416 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy416, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } +#line 6611 "sql.c" + yymsp[-5].minor.yy416 = yylhsminor.yy416; + break; + case 201: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 594: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==594); +#line 389 "sql.y" +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } +#line 6618 "sql.c" + yymsp[-1].minor.yy316 = yylhsminor.yy316; break; 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 */ -#line 392 "sql.y" -{ yylhsminor.yy54 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy325, yymsp[-8].minor.yy54, yymsp[-6].minor.yy54, yymsp[-5].minor.yy652, yymsp[-2].minor.yy652, yymsp[0].minor.yy54); } -#line 6643 "sql.c" - yymsp[-9].minor.yy54 = yylhsminor.yy54; +#line 393 "sql.y" +{ yylhsminor.yy416 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy209, yymsp[-8].minor.yy416, yymsp[-6].minor.yy416, yymsp[-5].minor.yy316, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } +#line 6624 "sql.c" + yymsp[-9].minor.yy416 = yylhsminor.yy416; break; - case 203: /* create_from_file_clause ::= not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ -#line 395 "sql.y" -{ yylhsminor.yy54 = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy325, yymsp[-5].minor.yy54, yymsp[-3].minor.yy652, &yymsp[0].minor.yy0); } -#line 6649 "sql.c" - yymsp[-7].minor.yy54 = yylhsminor.yy54; + case 205: /* drop_table_clause ::= exists_opt full_table_name */ +#line 400 "sql.y" +{ yylhsminor.yy416 = createDropTableClause(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } +#line 6630 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 206: /* drop_table_clause ::= exists_opt full_table_name */ -#line 402 "sql.y" -{ yylhsminor.yy54 = createDropTableClause(pCxt, yymsp[-1].minor.yy325, yymsp[0].minor.yy54); } -#line 6655 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; + case 207: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 409: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==409); +#line 405 "sql.y" +{ yymsp[-2].minor.yy316 = yymsp[-1].minor.yy316; } +#line 6637 "sql.c" break; - case 208: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 410: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==410); + case 208: /* full_table_name ::= table_name */ + case 350: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==350); #line 407 "sql.y" -{ yymsp[-2].minor.yy652 = yymsp[-1].minor.yy652; } +{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy1109, NULL); } +#line 6643 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 209: /* full_table_name ::= db_name NK_DOT table_name */ + case 351: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==351); +#line 408 "sql.y" +{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, NULL); } +#line 6650 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 212: /* tag_def ::= column_name type_name */ +#line 414 "sql.y" +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952, NULL); } +#line 6656 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; + break; + case 215: /* column_def ::= column_name type_name column_options */ +#line 422 "sql.y" +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } #line 6662 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 209: /* full_table_name ::= table_name */ - case 351: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==351); -#line 409 "sql.y" -{ yylhsminor.yy54 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy837, NULL); } + case 216: /* type_name ::= BOOL */ +#line 426 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BOOL); } #line 6668 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; break; - case 210: /* full_table_name ::= db_name NK_DOT table_name */ - case 352: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==352); -#line 410 "sql.y" -{ yylhsminor.yy54 = createRealTableNode(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837, NULL); } -#line 6675 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 217: /* type_name ::= TINYINT */ +#line 427 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 6673 "sql.c" break; - case 213: /* tag_def ::= column_name type_name */ -#line 416 "sql.y" -{ yylhsminor.yy54 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy837, yymsp[0].minor.yy84, NULL); } -#line 6681 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; - break; - case 216: /* column_def ::= column_name type_name column_options */ -#line 424 "sql.y" -{ yylhsminor.yy54 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy837, yymsp[-1].minor.yy84, yymsp[0].minor.yy54); } -#line 6687 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 217: /* type_name ::= BOOL */ + case 218: /* type_name ::= SMALLINT */ #line 428 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BOOL); } -#line 6693 "sql.c" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 6678 "sql.c" break; - case 218: /* type_name ::= TINYINT */ + case 219: /* type_name ::= INT */ + case 220: /* type_name ::= INTEGER */ yytestcase(yyruleno==220); #line 429 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TINYINT); } -#line 6698 "sql.c" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_INT); } +#line 6684 "sql.c" break; - case 219: /* type_name ::= SMALLINT */ -#line 430 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_SMALLINT); } -#line 6703 "sql.c" - break; - case 220: /* type_name ::= INT */ - case 221: /* type_name ::= INTEGER */ yytestcase(yyruleno==221); + case 221: /* type_name ::= BIGINT */ #line 431 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 6689 "sql.c" + break; + case 222: /* type_name ::= FLOAT */ +#line 432 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 6694 "sql.c" + break; + case 223: /* type_name ::= DOUBLE */ +#line 433 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 6699 "sql.c" + break; + case 224: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +#line 434 "sql.y" +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 6704 "sql.c" + break; + case 225: /* type_name ::= TIMESTAMP */ +#line 435 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } #line 6709 "sql.c" break; - case 222: /* type_name ::= BIGINT */ -#line 433 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 226: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +#line 436 "sql.y" +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } #line 6714 "sql.c" break; - case 223: /* type_name ::= FLOAT */ -#line 434 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 227: /* type_name ::= TINYINT UNSIGNED */ +#line 437 "sql.y" +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UTINYINT); } #line 6719 "sql.c" break; - case 224: /* type_name ::= DOUBLE */ -#line 435 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 228: /* type_name ::= SMALLINT UNSIGNED */ +#line 438 "sql.y" +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_USMALLINT); } #line 6724 "sql.c" break; - case 225: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -#line 436 "sql.y" -{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 229: /* type_name ::= INT UNSIGNED */ +#line 439 "sql.y" +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UINT); } #line 6729 "sql.c" break; - case 226: /* type_name ::= TIMESTAMP */ -#line 437 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 230: /* type_name ::= BIGINT UNSIGNED */ +#line 440 "sql.y" +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UBIGINT); } #line 6734 "sql.c" break; - case 227: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -#line 438 "sql.y" -{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 231: /* type_name ::= JSON */ +#line 441 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_JSON); } #line 6739 "sql.c" break; - case 228: /* type_name ::= TINYINT UNSIGNED */ -#line 439 "sql.y" -{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 232: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +#line 442 "sql.y" +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } #line 6744 "sql.c" break; - case 229: /* type_name ::= SMALLINT UNSIGNED */ -#line 440 "sql.y" -{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 233: /* type_name ::= MEDIUMBLOB */ +#line 443 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } #line 6749 "sql.c" break; - case 230: /* type_name ::= INT UNSIGNED */ -#line 441 "sql.y" -{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UINT); } + case 234: /* type_name ::= BLOB */ +#line 444 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BLOB); } #line 6754 "sql.c" break; - case 231: /* type_name ::= BIGINT UNSIGNED */ -#line 442 "sql.y" -{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 235: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +#line 445 "sql.y" +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } #line 6759 "sql.c" break; - case 232: /* type_name ::= JSON */ -#line 443 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_JSON); } + case 236: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ +#line 446 "sql.y" +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } #line 6764 "sql.c" break; - case 233: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -#line 444 "sql.y" -{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 237: /* type_name ::= DECIMAL */ +#line 447 "sql.y" +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } #line 6769 "sql.c" break; - case 234: /* type_name ::= MEDIUMBLOB */ -#line 445 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 238: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +#line 448 "sql.y" +{ yymsp[-3].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } #line 6774 "sql.c" break; - case 235: /* type_name ::= BLOB */ -#line 446 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 239: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +#line 449 "sql.y" +{ yymsp[-5].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } #line 6779 "sql.c" break; - case 236: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -#line 447 "sql.y" -{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 240: /* type_name_default_len ::= BINARY */ +#line 453 "sql.y" +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } #line 6784 "sql.c" break; - case 237: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -#line 448 "sql.y" -{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } + case 241: /* type_name_default_len ::= NCHAR */ +#line 454 "sql.y" +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } #line 6789 "sql.c" break; - case 238: /* type_name ::= DECIMAL */ -#line 449 "sql.y" -{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 242: /* type_name_default_len ::= VARCHAR */ +#line 455 "sql.y" +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } #line 6794 "sql.c" break; - case 239: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -#line 450 "sql.y" -{ yymsp[-3].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 243: /* type_name_default_len ::= VARBINARY */ +#line 456 "sql.y" +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } #line 6799 "sql.c" break; - case 240: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -#line 451 "sql.y" -{ yymsp[-5].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6804 "sql.c" + case 246: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + case 417: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==417); +#line 465 "sql.y" +{ yymsp[-3].minor.yy316 = yymsp[-1].minor.yy316; } +#line 6805 "sql.c" break; - case 241: /* type_name_default_len ::= BINARY */ -#line 455 "sql.y" -{ yymsp[0].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } -#line 6809 "sql.c" - break; - case 242: /* type_name_default_len ::= NCHAR */ -#line 456 "sql.y" -{ yymsp[0].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } -#line 6814 "sql.c" - break; - case 243: /* type_name_default_len ::= VARCHAR */ -#line 457 "sql.y" -{ yymsp[0].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } -#line 6819 "sql.c" - break; - case 244: /* type_name_default_len ::= VARBINARY */ -#line 458 "sql.y" -{ yymsp[0].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } -#line 6824 "sql.c" - break; - case 247: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - case 418: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==418); + case 247: /* table_options ::= */ #line 467 "sql.y" -{ yymsp[-3].minor.yy652 = yymsp[-1].minor.yy652; } -#line 6830 "sql.c" +{ yymsp[1].minor.yy416 = createDefaultTableOptions(pCxt); } +#line 6810 "sql.c" break; - case 248: /* table_options ::= */ + case 248: /* table_options ::= table_options COMMENT NK_STRING */ +#line 468 "sql.y" +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } +#line 6815 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 249: /* table_options ::= table_options MAX_DELAY duration_list */ #line 469 "sql.y" -{ yymsp[1].minor.yy54 = createDefaultTableOptions(pCxt); } -#line 6835 "sql.c" +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy316); } +#line 6821 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 249: /* table_options ::= table_options COMMENT NK_STRING */ + case 250: /* table_options ::= table_options WATERMARK duration_list */ #line 470 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-2].minor.yy54, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } -#line 6840 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy316); } +#line 6827 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 250: /* table_options ::= table_options MAX_DELAY duration_list */ + case 251: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ #line 471 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-2].minor.yy54, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy652); } -#line 6846 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy316); } +#line 6833 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 251: /* table_options ::= table_options WATERMARK duration_list */ + case 252: /* table_options ::= table_options TTL NK_INTEGER */ #line 472 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-2].minor.yy54, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy652); } -#line 6852 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } +#line 6839 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 252: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + case 253: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ #line 473 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-4].minor.yy54, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy652); } -#line 6858 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_SMA, yymsp[-1].minor.yy316); } +#line 6845 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 253: /* table_options ::= table_options TTL NK_INTEGER */ + case 254: /* table_options ::= table_options DELETE_MARK duration_list */ #line 474 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-2].minor.yy54, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } -#line 6864 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy316); } +#line 6851 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 254: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -#line 475 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-4].minor.yy54, TABLE_OPTION_SMA, yymsp[-1].minor.yy652); } -#line 6870 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; - break; - case 255: /* table_options ::= table_options DELETE_MARK duration_list */ + case 255: /* alter_table_options ::= alter_table_option */ #line 476 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-2].minor.yy54, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy652); } -#line 6876 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createAlterTableOptions(pCxt); yylhsminor.yy416 = setTableOption(pCxt, yylhsminor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } +#line 6857 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 256: /* alter_table_options ::= alter_table_option */ -#line 478 "sql.y" -{ yylhsminor.yy54 = createAlterTableOptions(pCxt); yylhsminor.yy54 = setTableOption(pCxt, yylhsminor.yy54, yymsp[0].minor.yy663.type, &yymsp[0].minor.yy663.val); } -#line 6882 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 256: /* alter_table_options ::= alter_table_options alter_table_option */ +#line 477 "sql.y" +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } +#line 6863 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 257: /* alter_table_options ::= alter_table_options alter_table_option */ -#line 479 "sql.y" -{ yylhsminor.yy54 = setTableOption(pCxt, yymsp[-1].minor.yy54, yymsp[0].minor.yy663.type, &yymsp[0].minor.yy663.val); } -#line 6888 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; + case 257: /* alter_table_option ::= COMMENT NK_STRING */ +#line 481 "sql.y" +{ yymsp[-1].minor.yy101.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6869 "sql.c" break; - case 258: /* alter_table_option ::= COMMENT NK_STRING */ -#line 483 "sql.y" -{ yymsp[-1].minor.yy663.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6894 "sql.c" + case 258: /* alter_table_option ::= TTL NK_INTEGER */ +#line 482 "sql.y" +{ yymsp[-1].minor.yy101.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } +#line 6874 "sql.c" break; - case 259: /* alter_table_option ::= TTL NK_INTEGER */ -#line 484 "sql.y" -{ yymsp[-1].minor.yy663.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy663.val = yymsp[0].minor.yy0; } -#line 6899 "sql.c" + case 259: /* duration_list ::= duration_literal */ + case 546: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==546); +#line 486 "sql.y" +{ yylhsminor.yy316 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 6880 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 260: /* duration_list ::= duration_literal */ - case 547: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==547); -#line 488 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } -#line 6905 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; + case 260: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 547: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==547); +#line 487 "sql.y" +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 6887 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; - case 261: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 548: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==548); -#line 489 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } -#line 6912 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 263: /* rollup_func_name ::= function_name */ +#line 494 "sql.y" +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy1109, NULL); } +#line 6893 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 264: /* rollup_func_name ::= function_name */ -#line 496 "sql.y" -{ yylhsminor.yy54 = createFunctionNode(pCxt, &yymsp[0].minor.yy837, NULL); } -#line 6918 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 264: /* rollup_func_name ::= FIRST */ + case 265: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==265); + case 339: /* tag_item ::= QTAGS */ yytestcase(yyruleno==339); +#line 495 "sql.y" +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 6901 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 265: /* rollup_func_name ::= FIRST */ - case 266: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==266); - case 340: /* tag_item ::= QTAGS */ yytestcase(yyruleno==340); -#line 497 "sql.y" -{ yylhsminor.yy54 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 6926 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 268: /* col_name ::= column_name */ + case 340: /* tag_item ::= column_name */ yytestcase(yyruleno==340); +#line 503 "sql.y" +{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109); } +#line 6908 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 269: /* col_name ::= column_name */ - case 341: /* tag_item ::= column_name */ yytestcase(yyruleno==341); -#line 505 "sql.y" -{ yylhsminor.yy54 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy837); } -#line 6933 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 270: /* cmd ::= SHOW DNODES */ -#line 508 "sql.y" + case 269: /* cmd ::= SHOW DNODES */ +#line 506 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } -#line 6939 "sql.c" +#line 6914 "sql.c" break; - case 271: /* cmd ::= SHOW USERS */ -#line 509 "sql.y" + case 270: /* cmd ::= SHOW USERS */ +#line 507 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } -#line 6944 "sql.c" +#line 6919 "sql.c" break; - case 272: /* cmd ::= SHOW USERS FULL */ -#line 510 "sql.y" + case 271: /* cmd ::= SHOW USERS FULL */ +#line 508 "sql.y" { pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } -#line 6949 "sql.c" +#line 6924 "sql.c" break; - case 273: /* cmd ::= SHOW USER PRIVILEGES */ -#line 511 "sql.y" + case 272: /* cmd ::= SHOW USER PRIVILEGES */ +#line 509 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } -#line 6954 "sql.c" +#line 6929 "sql.c" break; - case 274: /* cmd ::= SHOW db_kind_opt DATABASES */ -#line 512 "sql.y" + case 273: /* cmd ::= SHOW db_kind_opt DATABASES */ +#line 510 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy719); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy681); } -#line 6962 "sql.c" +#line 6937 "sql.c" break; - case 275: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ -#line 516 "sql.y" + case 274: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ +#line 514 "sql.y" { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy579, yymsp[0].minor.yy54, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy925, yymsp[0].minor.yy416, OP_TYPE_LIKE); } +#line 6944 "sql.c" + break; + case 275: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +#line 517 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } +#line 6949 "sql.c" + break; + case 276: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +#line 518 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy416, NULL, OP_TYPE_LIKE); } +#line 6954 "sql.c" + break; + case 277: /* cmd ::= SHOW MNODES */ +#line 519 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } +#line 6959 "sql.c" + break; + case 278: /* cmd ::= SHOW QNODES */ +#line 521 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +#line 6964 "sql.c" + break; + case 279: /* cmd ::= SHOW ARBGROUPS */ +#line 522 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } #line 6969 "sql.c" break; - case 276: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -#line 519 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy54, yymsp[0].minor.yy54, OP_TYPE_LIKE); } + case 280: /* cmd ::= SHOW FUNCTIONS */ +#line 523 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } #line 6974 "sql.c" break; - case 277: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -#line 520 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy54, NULL, OP_TYPE_LIKE); } + case 281: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +#line 524 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } #line 6979 "sql.c" break; - case 278: /* cmd ::= SHOW MNODES */ -#line 521 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } + case 282: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +#line 525 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } #line 6984 "sql.c" break; - case 279: /* cmd ::= SHOW QNODES */ -#line 523 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } + case 283: /* cmd ::= SHOW STREAMS */ +#line 526 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } #line 6989 "sql.c" break; - case 280: /* cmd ::= SHOW ARBGROUPS */ -#line 524 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } + case 284: /* cmd ::= SHOW ACCOUNTS */ +#line 527 "sql.y" +{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } #line 6994 "sql.c" break; - case 281: /* cmd ::= SHOW FUNCTIONS */ -#line 525 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } + case 285: /* cmd ::= SHOW APPS */ +#line 528 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } #line 6999 "sql.c" break; - case 282: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -#line 526 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy54, yymsp[-1].minor.yy54, OP_TYPE_EQUAL); } + case 286: /* cmd ::= SHOW CONNECTIONS */ +#line 529 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } #line 7004 "sql.c" break; - case 283: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -#line 527 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy837), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy837), OP_TYPE_EQUAL); } -#line 7009 "sql.c" - break; - case 284: /* cmd ::= SHOW STREAMS */ -#line 528 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } -#line 7014 "sql.c" - break; - case 285: /* cmd ::= SHOW ACCOUNTS */ -#line 529 "sql.y" -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 7019 "sql.c" - break; - case 286: /* cmd ::= SHOW APPS */ + case 287: /* cmd ::= SHOW LICENCES */ + case 288: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==288); #line 530 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } -#line 7024 "sql.c" - break; - case 287: /* cmd ::= SHOW CONNECTIONS */ -#line 531 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } -#line 7029 "sql.c" - break; - case 288: /* cmd ::= SHOW LICENCES */ - case 289: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==289); -#line 532 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } +#line 7010 "sql.c" + break; + case 289: /* cmd ::= SHOW GRANTS FULL */ +#line 532 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } +#line 7015 "sql.c" + break; + case 290: /* cmd ::= SHOW GRANTS LOGS */ +#line 533 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } +#line 7020 "sql.c" + break; + case 291: /* cmd ::= SHOW CLUSTER MACHINES */ +#line 534 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } +#line 7025 "sql.c" + break; + case 292: /* cmd ::= SHOW CREATE DATABASE db_name */ +#line 535 "sql.y" +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } +#line 7030 "sql.c" + break; + case 293: /* cmd ::= SHOW CREATE TABLE full_table_name */ +#line 536 "sql.y" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy416); } #line 7035 "sql.c" break; - case 290: /* cmd ::= SHOW GRANTS FULL */ -#line 534 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } -#line 7040 "sql.c" - break; - case 291: /* cmd ::= SHOW GRANTS LOGS */ -#line 535 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } -#line 7045 "sql.c" - break; - case 292: /* cmd ::= SHOW CLUSTER MACHINES */ -#line 536 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } -#line 7050 "sql.c" - break; - case 293: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 294: /* cmd ::= SHOW CREATE STABLE full_table_name */ #line 537 "sql.y" -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy837); } -#line 7055 "sql.c" - break; - case 294: /* cmd ::= SHOW CREATE TABLE full_table_name */ -#line 538 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy54); } -#line 7060 "sql.c" - break; - case 295: /* cmd ::= SHOW CREATE STABLE full_table_name */ -#line 539 "sql.y" { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, -yymsp[0].minor.yy54); } -#line 7066 "sql.c" +yymsp[0].minor.yy416); } +#line 7041 "sql.c" break; - case 296: /* cmd ::= SHOW ENCRYPTIONS */ -#line 541 "sql.y" + case 295: /* cmd ::= SHOW ENCRYPTIONS */ +#line 539 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } -#line 7071 "sql.c" +#line 7046 "sql.c" break; - case 297: /* cmd ::= SHOW QUERIES */ -#line 542 "sql.y" + case 296: /* cmd ::= SHOW QUERIES */ +#line 540 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } -#line 7076 "sql.c" +#line 7051 "sql.c" break; - case 298: /* cmd ::= SHOW SCORES */ -#line 543 "sql.y" + case 297: /* cmd ::= SHOW SCORES */ +#line 541 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } -#line 7081 "sql.c" +#line 7056 "sql.c" break; - case 299: /* cmd ::= SHOW TOPICS */ -#line 544 "sql.y" + case 298: /* cmd ::= SHOW TOPICS */ +#line 542 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } -#line 7086 "sql.c" +#line 7061 "sql.c" break; - case 300: /* cmd ::= SHOW VARIABLES */ - case 301: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==301); -#line 545 "sql.y" + case 299: /* cmd ::= SHOW VARIABLES */ + case 300: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==300); +#line 543 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } +#line 7067 "sql.c" + break; + case 301: /* cmd ::= SHOW LOCAL VARIABLES */ +#line 545 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } +#line 7072 "sql.c" + break; + case 302: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +#line 546 "sql.y" +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy416); } +#line 7077 "sql.c" + break; + case 303: /* cmd ::= SHOW BNODES */ +#line 547 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } +#line 7082 "sql.c" + break; + case 304: /* cmd ::= SHOW SNODES */ +#line 548 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } +#line 7087 "sql.c" + break; + case 305: /* cmd ::= SHOW CLUSTER */ +#line 549 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } #line 7092 "sql.c" break; - case 302: /* cmd ::= SHOW LOCAL VARIABLES */ -#line 547 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } + case 306: /* cmd ::= SHOW TRANSACTIONS */ +#line 550 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } #line 7097 "sql.c" break; - case 303: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -#line 548 "sql.y" -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy54); } + case 307: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +#line 551 "sql.y" +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy416); } #line 7102 "sql.c" break; - case 304: /* cmd ::= SHOW BNODES */ -#line 549 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } + case 308: /* cmd ::= SHOW CONSUMERS */ +#line 552 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } #line 7107 "sql.c" break; - case 305: /* cmd ::= SHOW SNODES */ -#line 550 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } + case 309: /* cmd ::= SHOW SUBSCRIPTIONS */ +#line 553 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } #line 7112 "sql.c" break; - case 306: /* cmd ::= SHOW CLUSTER */ -#line 551 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } + case 310: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +#line 554 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } #line 7117 "sql.c" break; - case 307: /* cmd ::= SHOW TRANSACTIONS */ -#line 552 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } + case 311: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +#line 555 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } #line 7122 "sql.c" break; - case 308: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -#line 553 "sql.y" -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy54); } + case 312: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +#line 556 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416, yymsp[-3].minor.yy316); } #line 7127 "sql.c" break; - case 309: /* cmd ::= SHOW CONSUMERS */ -#line 554 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } + case 313: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +#line 557 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), yymsp[-4].minor.yy316); } #line 7132 "sql.c" break; - case 310: /* cmd ::= SHOW SUBSCRIPTIONS */ -#line 555 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } + case 314: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ +#line 558 "sql.y" +{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } #line 7137 "sql.c" break; - case 311: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -#line 556 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy54, yymsp[-1].minor.yy54, OP_TYPE_EQUAL); } + case 315: /* cmd ::= SHOW VNODES */ +#line 559 "sql.y" +{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } #line 7142 "sql.c" break; - case 312: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -#line 557 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy837), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy837), OP_TYPE_EQUAL); } + case 316: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +#line 561 "sql.y" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy416, QUERY_NODE_SHOW_DB_ALIVE_STMT); } #line 7147 "sql.c" break; - case 313: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -#line 558 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy54, yymsp[0].minor.yy54, yymsp[-3].minor.yy652); } + case 317: /* cmd ::= SHOW CLUSTER ALIVE */ +#line 562 "sql.y" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } #line 7152 "sql.c" break; - case 314: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -#line 559 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy837), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy837), yymsp[-4].minor.yy652); } + case 318: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +#line 563 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } #line 7157 "sql.c" break; - case 315: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ -#line 560 "sql.y" -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } + case 319: /* cmd ::= SHOW CREATE VIEW full_table_name */ +#line 564 "sql.y" +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy416); } #line 7162 "sql.c" break; - case 316: /* cmd ::= SHOW VNODES */ -#line 561 "sql.y" -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } + case 320: /* cmd ::= SHOW COMPACTS */ +#line 565 "sql.y" +{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } #line 7167 "sql.c" break; - case 317: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -#line 563 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy54, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 321: /* cmd ::= SHOW COMPACT NK_INTEGER */ +#line 566 "sql.y" +{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } #line 7172 "sql.c" break; - case 318: /* cmd ::= SHOW CLUSTER ALIVE */ -#line 564 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } + case 322: /* table_kind_db_name_cond_opt ::= */ +#line 570 "sql.y" +{ yymsp[1].minor.yy925.kind = SHOW_KIND_ALL; yymsp[1].minor.yy925.dbName = nil_token; } #line 7177 "sql.c" break; - case 319: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -#line 565 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy54, yymsp[0].minor.yy54, OP_TYPE_LIKE); } + case 323: /* table_kind_db_name_cond_opt ::= table_kind */ +#line 571 "sql.y" +{ yylhsminor.yy925.kind = yymsp[0].minor.yy681; yylhsminor.yy925.dbName = nil_token; } #line 7182 "sql.c" + yymsp[0].minor.yy925 = yylhsminor.yy925; break; - case 320: /* cmd ::= SHOW CREATE VIEW full_table_name */ -#line 566 "sql.y" -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy54); } -#line 7187 "sql.c" - break; - case 321: /* cmd ::= SHOW COMPACTS */ -#line 567 "sql.y" -{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } -#line 7192 "sql.c" - break; - case 322: /* cmd ::= SHOW COMPACT NK_INTEGER */ -#line 568 "sql.y" -{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 7197 "sql.c" - break; - case 323: /* table_kind_db_name_cond_opt ::= */ + case 324: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ #line 572 "sql.y" -{ yymsp[1].minor.yy579.kind = SHOW_KIND_ALL; yymsp[1].minor.yy579.dbName = nil_token; } -#line 7202 "sql.c" +{ yylhsminor.yy925.kind = SHOW_KIND_ALL; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } +#line 7188 "sql.c" + yymsp[-1].minor.yy925 = yylhsminor.yy925; break; - case 324: /* table_kind_db_name_cond_opt ::= table_kind */ + case 325: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ #line 573 "sql.y" -{ yylhsminor.yy579.kind = yymsp[0].minor.yy719; yylhsminor.yy579.dbName = nil_token; } -#line 7207 "sql.c" - yymsp[0].minor.yy579 = yylhsminor.yy579; +{ yylhsminor.yy925.kind = yymsp[-2].minor.yy681; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } +#line 7194 "sql.c" + yymsp[-2].minor.yy925 = yylhsminor.yy925; break; - case 325: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -#line 574 "sql.y" -{ yylhsminor.yy579.kind = SHOW_KIND_ALL; yylhsminor.yy579.dbName = yymsp[-1].minor.yy837; } -#line 7213 "sql.c" - yymsp[-1].minor.yy579 = yylhsminor.yy579; + case 326: /* table_kind ::= NORMAL */ +#line 577 "sql.y" +{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_NORMAL; } +#line 7200 "sql.c" break; - case 326: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -#line 575 "sql.y" -{ yylhsminor.yy579.kind = yymsp[-2].minor.yy719; yylhsminor.yy579.dbName = yymsp[-1].minor.yy837; } -#line 7219 "sql.c" - yymsp[-2].minor.yy579 = yylhsminor.yy579; + case 327: /* table_kind ::= CHILD */ +#line 578 "sql.y" +{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_CHILD; } +#line 7205 "sql.c" break; - case 327: /* table_kind ::= NORMAL */ -#line 579 "sql.y" -{ yymsp[0].minor.yy719 = SHOW_KIND_TABLES_NORMAL; } -#line 7225 "sql.c" - break; - case 328: /* table_kind ::= CHILD */ + case 328: /* db_name_cond_opt ::= */ + case 333: /* from_db_opt ::= */ yytestcase(yyruleno==333); #line 580 "sql.y" -{ yymsp[0].minor.yy719 = SHOW_KIND_TABLES_CHILD; } -#line 7230 "sql.c" +{ yymsp[1].minor.yy416 = createDefaultDatabaseCondValue(pCxt); } +#line 7211 "sql.c" break; - case 329: /* db_name_cond_opt ::= */ - case 334: /* from_db_opt ::= */ yytestcase(yyruleno==334); -#line 582 "sql.y" -{ yymsp[1].minor.yy54 = createDefaultDatabaseCondValue(pCxt); } -#line 7236 "sql.c" + case 329: /* db_name_cond_opt ::= db_name NK_DOT */ +#line 581 "sql.y" +{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy1109); } +#line 7216 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 330: /* db_name_cond_opt ::= db_name NK_DOT */ -#line 583 "sql.y" -{ yylhsminor.yy54 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy837); } -#line 7241 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; + case 331: /* like_pattern_opt ::= LIKE NK_STRING */ +#line 584 "sql.y" +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 7222 "sql.c" break; - case 332: /* like_pattern_opt ::= LIKE NK_STRING */ + case 332: /* table_name_cond ::= table_name */ #line 586 "sql.y" -{ yymsp[-1].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 7247 "sql.c" +{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } +#line 7227 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 333: /* table_name_cond ::= table_name */ -#line 588 "sql.y" -{ yylhsminor.yy54 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy837); } -#line 7252 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 334: /* from_db_opt ::= FROM db_name */ +#line 589 "sql.y" +{ yymsp[-1].minor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } +#line 7233 "sql.c" break; - case 335: /* from_db_opt ::= FROM db_name */ -#line 591 "sql.y" -{ yymsp[-1].minor.yy54 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy837); } -#line 7258 "sql.c" + case 338: /* tag_item ::= TBNAME */ +#line 597 "sql.y" +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } +#line 7238 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 339: /* tag_item ::= TBNAME */ -#line 599 "sql.y" -{ yylhsminor.yy54 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } -#line 7263 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 341: /* tag_item ::= column_name column_alias */ +#line 600 "sql.y" +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy1109), &yymsp[0].minor.yy1109); } +#line 7244 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 342: /* tag_item ::= column_name column_alias */ -#line 602 "sql.y" -{ yylhsminor.yy54 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy837), &yymsp[0].minor.yy837); } -#line 7269 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; + case 342: /* tag_item ::= column_name AS column_alias */ +#line 601 "sql.y" +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy1109), &yymsp[0].minor.yy1109); } +#line 7250 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 343: /* tag_item ::= column_name AS column_alias */ -#line 603 "sql.y" -{ yylhsminor.yy54 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy837), &yymsp[0].minor.yy837); } -#line 7275 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 343: /* db_kind_opt ::= */ +#line 605 "sql.y" +{ yymsp[1].minor.yy681 = SHOW_KIND_ALL; } +#line 7256 "sql.c" break; - case 344: /* db_kind_opt ::= */ + case 344: /* db_kind_opt ::= USER */ +#line 606 "sql.y" +{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_USER; } +#line 7261 "sql.c" + break; + case 345: /* db_kind_opt ::= SYSTEM */ #line 607 "sql.y" -{ yymsp[1].minor.yy719 = SHOW_KIND_ALL; } +{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_SYSTEM; } +#line 7266 "sql.c" + break; + case 346: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ +#line 613 "sql.y" +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy209, &yymsp[-7].minor.yy1109, yymsp[-4].minor.yy416, yymsp[-5].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 7271 "sql.c" + break; + case 347: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ +#line 615 "sql.y" +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy209, &yymsp[-6].minor.yy1109, NULL, yymsp[-4].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 7276 "sql.c" + break; + case 348: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ +#line 616 "sql.y" +{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } #line 7281 "sql.c" break; - case 345: /* db_kind_opt ::= USER */ -#line 608 "sql.y" -{ yymsp[0].minor.yy719 = SHOW_KIND_DATABASES_USER; } + case 349: /* cmd ::= SHOW db_name_cond_opt TSMAS */ +#line 617 "sql.y" +{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy416); } #line 7286 "sql.c" break; - case 346: /* db_kind_opt ::= SYSTEM */ -#line 609 "sql.y" -{ yymsp[0].minor.yy719 = SHOW_KIND_DATABASES_SYSTEM; } + case 352: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ +#line 624 "sql.y" +{ yymsp[-3].minor.yy416 = createTSMAOptions(pCxt, yymsp[-1].minor.yy316); } #line 7291 "sql.c" break; - case 347: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ -#line 615 "sql.y" -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy325, &yymsp[-7].minor.yy837, yymsp[-4].minor.yy54, yymsp[-5].minor.yy54, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } + case 353: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +#line 628 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy209, yymsp[-3].minor.yy416, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } #line 7296 "sql.c" break; - case 348: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ -#line 617 "sql.y" -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy325, &yymsp[-6].minor.yy837, NULL, yymsp[-4].minor.yy54, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } + case 354: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +#line 630 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy416, yymsp[-1].minor.yy316, NULL); } #line 7301 "sql.c" break; - case 349: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ -#line 618 "sql.y" -{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy325, yymsp[0].minor.yy54); } + case 355: /* cmd ::= DROP INDEX exists_opt full_index_name */ +#line 631 "sql.y" +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } #line 7306 "sql.c" break; - case 350: /* cmd ::= SHOW db_name_cond_opt TSMAS */ -#line 619 "sql.y" -{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy54); } -#line 7311 "sql.c" - break; - case 353: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ -#line 626 "sql.y" -{ yymsp[-3].minor.yy54 = createTSMAOptions(pCxt, yymsp[-1].minor.yy652); } -#line 7316 "sql.c" - break; - case 354: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -#line 630 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy325, yymsp[-3].minor.yy54, yymsp[-1].minor.yy54, NULL, yymsp[0].minor.yy54); } -#line 7321 "sql.c" - break; - case 355: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -#line 632 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy325, yymsp[-5].minor.yy54, yymsp[-3].minor.yy54, yymsp[-1].minor.yy652, NULL); } -#line 7326 "sql.c" - break; - case 356: /* cmd ::= DROP INDEX exists_opt full_index_name */ + case 356: /* full_index_name ::= index_name */ #line 633 "sql.y" -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy325, yymsp[0].minor.yy54); } -#line 7331 "sql.c" +{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy1109); } +#line 7311 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 357: /* full_index_name ::= index_name */ -#line 635 "sql.y" -{ yylhsminor.yy54 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy837); } -#line 7336 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 357: /* full_index_name ::= db_name NK_DOT index_name */ +#line 634 "sql.y" +{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 7317 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 358: /* full_index_name ::= db_name NK_DOT index_name */ -#line 636 "sql.y" -{ yylhsminor.yy54 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837); } -#line 7342 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 358: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +#line 637 "sql.y" +{ yymsp[-9].minor.yy416 = createIndexOption(pCxt, yymsp[-7].minor.yy316, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 7323 "sql.c" break; - case 359: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -#line 639 "sql.y" -{ yymsp[-9].minor.yy54 = createIndexOption(pCxt, yymsp[-7].minor.yy652, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), NULL, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 7348 "sql.c" + case 359: /* 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 */ +#line 640 "sql.y" +{ yymsp[-11].minor.yy416 = createIndexOption(pCxt, yymsp[-9].minor.yy316, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 7328 "sql.c" break; - case 360: /* 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 */ -#line 642 "sql.y" -{ yymsp[-11].minor.yy54 = createIndexOption(pCxt, yymsp[-9].minor.yy652, releaseRawExprNode(pCxt, yymsp[-5].minor.yy54), releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 7353 "sql.c" + case 362: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +#line 647 "sql.y" +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316); } +#line 7333 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 363: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -#line 649 "sql.y" -{ yylhsminor.yy54 = createFunctionNode(pCxt, &yymsp[-3].minor.yy837, yymsp[-1].minor.yy652); } -#line 7358 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 363: /* sma_func_name ::= function_name */ + case 637: /* alias_opt ::= table_alias */ yytestcase(yyruleno==637); +#line 651 "sql.y" +{ yylhsminor.yy1109 = yymsp[0].minor.yy1109; } +#line 7340 "sql.c" + yymsp[0].minor.yy1109 = yylhsminor.yy1109; break; - case 364: /* sma_func_name ::= function_name */ - case 638: /* alias_opt ::= table_alias */ yytestcase(yyruleno==638); -#line 653 "sql.y" -{ yylhsminor.yy837 = yymsp[0].minor.yy837; } -#line 7365 "sql.c" - yymsp[0].minor.yy837 = yylhsminor.yy837; + case 368: /* sma_stream_opt ::= */ + case 418: /* stream_options ::= */ yytestcase(yyruleno==418); +#line 657 "sql.y" +{ yymsp[1].minor.yy416 = createStreamOptions(pCxt); } +#line 7347 "sql.c" break; - case 369: /* sma_stream_opt ::= */ - case 419: /* stream_options ::= */ yytestcase(yyruleno==419); + case 369: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +#line 658 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } +#line 7352 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 370: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ #line 659 "sql.y" -{ yymsp[1].minor.yy54 = createStreamOptions(pCxt); } -#line 7372 "sql.c" +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } +#line 7358 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 370: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 371: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ #line 660 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy54)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy54); yylhsminor.yy54 = yymsp[-2].minor.yy54; } -#line 7377 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } +#line 7364 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 371: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -#line 661 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy54)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy54); yylhsminor.yy54 = yymsp[-2].minor.yy54; } -#line 7383 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 372: /* with_meta ::= AS */ +#line 665 "sql.y" +{ yymsp[0].minor.yy820 = 0; } +#line 7370 "sql.c" break; - case 372: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -#line 662 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy54)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy54); yylhsminor.yy54 = yymsp[-2].minor.yy54; } -#line 7389 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 373: /* with_meta ::= WITH META AS */ +#line 666 "sql.y" +{ yymsp[-2].minor.yy820 = 1; } +#line 7375 "sql.c" break; - case 373: /* with_meta ::= AS */ + case 374: /* with_meta ::= ONLY META AS */ #line 667 "sql.y" -{ yymsp[0].minor.yy332 = 0; } +{ yymsp[-2].minor.yy820 = 2; } +#line 7380 "sql.c" + break; + case 375: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +#line 669 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } +#line 7385 "sql.c" + break; + case 376: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +#line 671 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy209, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy820); } +#line 7390 "sql.c" + break; + case 377: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +#line 673 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy209, &yymsp[-4].minor.yy1109, yymsp[-1].minor.yy416, yymsp[-3].minor.yy820, yymsp[0].minor.yy416); } #line 7395 "sql.c" break; - case 374: /* with_meta ::= WITH META AS */ -#line 668 "sql.y" -{ yymsp[-2].minor.yy332 = 1; } + case 378: /* cmd ::= DROP TOPIC exists_opt topic_name */ +#line 675 "sql.y" +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } #line 7400 "sql.c" break; - case 375: /* with_meta ::= ONLY META AS */ -#line 669 "sql.y" -{ yymsp[-2].minor.yy332 = 2; } + case 379: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +#line 676 "sql.y" +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } #line 7405 "sql.c" break; - case 376: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -#line 671 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy325, &yymsp[-2].minor.yy837, yymsp[0].minor.yy54); } -#line 7410 "sql.c" + case 380: /* cmd ::= DESC full_table_name */ + case 381: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==381); +#line 679 "sql.y" +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy416); } +#line 7411 "sql.c" break; - case 377: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -#line 673 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy325, &yymsp[-3].minor.yy837, &yymsp[0].minor.yy837, yymsp[-2].minor.yy332); } -#line 7415 "sql.c" - break; - case 378: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -#line 675 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy325, &yymsp[-4].minor.yy837, yymsp[-1].minor.yy54, yymsp[-3].minor.yy332, yymsp[0].minor.yy54); } -#line 7420 "sql.c" - break; - case 379: /* cmd ::= DROP TOPIC exists_opt topic_name */ -#line 677 "sql.y" -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 7425 "sql.c" - break; - case 380: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -#line 678 "sql.y" -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy325, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837); } -#line 7430 "sql.c" - break; - case 381: /* cmd ::= DESC full_table_name */ - case 382: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==382); -#line 681 "sql.y" -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy54); } -#line 7436 "sql.c" - break; - case 383: /* cmd ::= RESET QUERY CACHE */ -#line 685 "sql.y" + case 382: /* cmd ::= RESET QUERY CACHE */ +#line 683 "sql.y" { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } -#line 7441 "sql.c" +#line 7416 "sql.c" break; - case 384: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 385: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==385); -#line 688 "sql.y" -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy325, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 7447 "sql.c" + case 383: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 384: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==384); +#line 686 "sql.y" +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 7422 "sql.c" break; - case 388: /* explain_options ::= */ + case 387: /* explain_options ::= */ +#line 694 "sql.y" +{ yymsp[1].minor.yy416 = createDefaultExplainOptions(pCxt); } +#line 7427 "sql.c" + break; + case 388: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +#line 695 "sql.y" +{ yylhsminor.yy416 = setExplainVerbose(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } +#line 7432 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 389: /* explain_options ::= explain_options RATIO NK_FLOAT */ #line 696 "sql.y" -{ yymsp[1].minor.yy54 = createDefaultExplainOptions(pCxt); } -#line 7452 "sql.c" +{ yylhsminor.yy416 = setExplainRatio(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } +#line 7438 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 389: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -#line 697 "sql.y" -{ yylhsminor.yy54 = setExplainVerbose(pCxt, yymsp[-2].minor.yy54, &yymsp[0].minor.yy0); } -#line 7457 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 390: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +#line 701 "sql.y" +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy209, yymsp[-9].minor.yy209, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy952, yymsp[-1].minor.yy820, &yymsp[0].minor.yy1109, yymsp[-10].minor.yy209); } +#line 7444 "sql.c" break; - case 390: /* explain_options ::= explain_options RATIO NK_FLOAT */ -#line 698 "sql.y" -{ yylhsminor.yy54 = setExplainRatio(pCxt, yymsp[-2].minor.yy54, &yymsp[0].minor.yy0); } -#line 7463 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 391: /* cmd ::= DROP FUNCTION exists_opt function_name */ +#line 702 "sql.y" +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } +#line 7449 "sql.c" break; - case 391: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -#line 703 "sql.y" -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy325, yymsp[-9].minor.yy325, &yymsp[-6].minor.yy837, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy84, yymsp[-1].minor.yy332, &yymsp[0].minor.yy837, yymsp[-10].minor.yy325); } -#line 7469 "sql.c" + case 396: /* language_opt ::= */ + case 441: /* on_vgroup_id ::= */ yytestcase(yyruleno==441); +#line 716 "sql.y" +{ yymsp[1].minor.yy1109 = nil_token; } +#line 7455 "sql.c" break; - case 392: /* cmd ::= DROP FUNCTION exists_opt function_name */ -#line 704 "sql.y" -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 7474 "sql.c" + case 397: /* language_opt ::= LANGUAGE NK_STRING */ + case 442: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==442); +#line 717 "sql.y" +{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy0; } +#line 7461 "sql.c" break; - case 397: /* language_opt ::= */ - case 442: /* on_vgroup_id ::= */ yytestcase(yyruleno==442); -#line 718 "sql.y" -{ yymsp[1].minor.yy837 = nil_token; } -#line 7480 "sql.c" + case 400: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +#line 726 "sql.y" +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy209, yymsp[-2].minor.yy416, &yymsp[-1].minor.yy0, yymsp[0].minor.yy416); } +#line 7466 "sql.c" break; - case 398: /* language_opt ::= LANGUAGE NK_STRING */ - case 443: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==443); -#line 719 "sql.y" -{ yymsp[-1].minor.yy837 = yymsp[0].minor.yy0; } -#line 7486 "sql.c" + case 401: /* cmd ::= DROP VIEW exists_opt full_view_name */ +#line 727 "sql.y" +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } +#line 7471 "sql.c" break; - case 401: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -#line 728 "sql.y" -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy325, yymsp[-2].minor.yy54, &yymsp[-1].minor.yy0, yymsp[0].minor.yy54); } -#line 7491 "sql.c" - break; - case 402: /* cmd ::= DROP VIEW exists_opt full_view_name */ + case 402: /* full_view_name ::= view_name */ #line 729 "sql.y" -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy325, yymsp[0].minor.yy54); } -#line 7496 "sql.c" +{ yylhsminor.yy416 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy1109); } +#line 7476 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 403: /* full_view_name ::= view_name */ -#line 731 "sql.y" -{ yylhsminor.yy54 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy837); } -#line 7501 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 403: /* full_view_name ::= db_name NK_DOT view_name */ +#line 730 "sql.y" +{ yylhsminor.yy416 = createViewNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 7482 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 404: /* full_view_name ::= db_name NK_DOT view_name */ -#line 732 "sql.y" -{ yylhsminor.yy54 = createViewNode(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837); } -#line 7507 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 404: /* 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 */ +#line 735 "sql.y" +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy209, &yymsp[-8].minor.yy1109, yymsp[-5].minor.yy416, yymsp[-7].minor.yy416, yymsp[-3].minor.yy316, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, yymsp[-4].minor.yy316); } +#line 7488 "sql.c" break; - case 405: /* 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 */ + case 405: /* cmd ::= DROP STREAM exists_opt stream_name */ +#line 736 "sql.y" +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } +#line 7493 "sql.c" + break; + case 406: /* cmd ::= PAUSE STREAM exists_opt stream_name */ #line 737 "sql.y" -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy325, &yymsp[-8].minor.yy837, yymsp[-5].minor.yy54, yymsp[-7].minor.yy54, yymsp[-3].minor.yy652, yymsp[-2].minor.yy54, yymsp[0].minor.yy54, yymsp[-4].minor.yy652); } -#line 7513 "sql.c" +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } +#line 7498 "sql.c" break; - case 406: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 407: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ #line 738 "sql.y" -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 7518 "sql.c" +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } +#line 7503 "sql.c" break; - case 407: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -#line 739 "sql.y" -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 7523 "sql.c" + case 412: /* column_stream_def ::= column_name stream_col_options */ +#line 751 "sql.y" +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy416); } +#line 7508 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 408: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -#line 740 "sql.y" -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy325, yymsp[-1].minor.yy325, &yymsp[0].minor.yy837); } -#line 7528 "sql.c" + case 413: /* stream_col_options ::= */ + case 750: /* column_options ::= */ yytestcase(yyruleno==750); +#line 752 "sql.y" +{ yymsp[1].minor.yy416 = createDefaultColumnOptions(pCxt); } +#line 7515 "sql.c" break; - case 413: /* column_stream_def ::= column_name stream_col_options */ + case 414: /* stream_col_options ::= stream_col_options PRIMARY KEY */ + case 751: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==751); #line 753 "sql.y" -{ yylhsminor.yy54 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy837, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy54); } -#line 7533 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_PRIMARYKEY, NULL); } +#line 7521 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 414: /* stream_col_options ::= */ - case 751: /* column_options ::= */ yytestcase(yyruleno==751); -#line 754 "sql.y" -{ yymsp[1].minor.yy54 = createDefaultColumnOptions(pCxt); } -#line 7540 "sql.c" + case 419: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 420: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==420); +#line 763 "sql.y" +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } +#line 7528 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 415: /* stream_col_options ::= stream_col_options PRIMARY KEY */ - case 752: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==752); -#line 755 "sql.y" -{ yylhsminor.yy54 = setColumnOptions(pCxt, yymsp[-2].minor.yy54, COLUMN_OPTION_PRIMARYKEY, NULL); } -#line 7546 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 420: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 421: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==421); + case 421: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ #line 765 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-2].minor.yy54, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } -#line 7553 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 7534 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 422: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + case 422: /* stream_options ::= stream_options WATERMARK duration_literal */ +#line 766 "sql.y" +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 7540 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 423: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ #line 767 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-3].minor.yy54, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } -#line 7559 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } +#line 7546 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 423: /* stream_options ::= stream_options WATERMARK duration_literal */ + case 424: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ #line 768 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-2].minor.yy54, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } -#line 7565 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } +#line 7552 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 424: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + case 425: /* stream_options ::= stream_options DELETE_MARK duration_literal */ #line 769 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-3].minor.yy54, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } -#line 7571 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 7558 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 425: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + case 426: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ #line 770 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-2].minor.yy54, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } +#line 7564 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; + break; + case 428: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 694: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==694); + case 718: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==718); +#line 773 "sql.y" +{ yymsp[-3].minor.yy416 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy416); } +#line 7572 "sql.c" + break; + case 431: /* cmd ::= KILL CONNECTION NK_INTEGER */ +#line 781 "sql.y" +{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } #line 7577 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; break; - case 426: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -#line 771 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-2].minor.yy54, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } -#line 7583 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 432: /* cmd ::= KILL QUERY NK_STRING */ +#line 782 "sql.y" +{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } +#line 7582 "sql.c" break; - case 427: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -#line 772 "sql.y" -{ yylhsminor.yy54 = setStreamOptions(pCxt, yymsp[-3].minor.yy54, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } -#line 7589 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 433: /* cmd ::= KILL TRANSACTION NK_INTEGER */ +#line 783 "sql.y" +{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } +#line 7587 "sql.c" break; - case 429: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 695: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==695); - case 719: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==719); -#line 775 "sql.y" -{ yymsp[-3].minor.yy54 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy54); } + case 434: /* cmd ::= KILL COMPACT NK_INTEGER */ +#line 784 "sql.y" +{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } +#line 7592 "sql.c" + break; + case 435: /* cmd ::= BALANCE VGROUP */ +#line 787 "sql.y" +{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } #line 7597 "sql.c" break; - case 432: /* cmd ::= KILL CONNECTION NK_INTEGER */ -#line 783 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } + case 436: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +#line 788 "sql.y" +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy1109); } #line 7602 "sql.c" break; - case 433: /* cmd ::= KILL QUERY NK_STRING */ -#line 784 "sql.y" -{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } + case 437: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ +#line 789 "sql.y" +{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy1109); } #line 7607 "sql.c" break; - case 434: /* cmd ::= KILL TRANSACTION NK_INTEGER */ -#line 785 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } + case 438: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ +#line 790 "sql.y" +{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } #line 7612 "sql.c" break; - case 435: /* cmd ::= KILL COMPACT NK_INTEGER */ -#line 786 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } + case 439: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +#line 791 "sql.y" +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy316); } #line 7617 "sql.c" break; - case 436: /* cmd ::= BALANCE VGROUP */ -#line 789 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } + case 440: /* cmd ::= SPLIT VGROUP NK_INTEGER */ +#line 792 "sql.y" +{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } #line 7622 "sql.c" break; - case 437: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -#line 790 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy837); } + case 443: /* dnode_list ::= DNODE NK_INTEGER */ +#line 801 "sql.y" +{ yymsp[-1].minor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } #line 7627 "sql.c" break; - case 438: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ -#line 791 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy837); } + case 445: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +#line 808 "sql.y" +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } #line 7632 "sql.c" break; - case 439: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ -#line 792 "sql.y" -{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + case 448: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +#line 817 "sql.y" +{ yymsp[-6].minor.yy416 = createInsertStmt(pCxt, yymsp[-4].minor.yy416, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } #line 7637 "sql.c" break; - case 440: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -#line 793 "sql.y" -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy652); } + case 449: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +#line 818 "sql.y" +{ yymsp[-3].minor.yy416 = createInsertStmt(pCxt, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } #line 7642 "sql.c" break; - case 441: /* cmd ::= SPLIT VGROUP NK_INTEGER */ -#line 794 "sql.y" -{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } -#line 7647 "sql.c" + case 450: /* tags_literal ::= NK_INTEGER */ + case 462: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==462); + case 471: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==471); +#line 821 "sql.y" +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } +#line 7649 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 444: /* dnode_list ::= DNODE NK_INTEGER */ -#line 803 "sql.y" -{ yymsp[-1].minor.yy652 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 7652 "sql.c" - break; - case 446: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -#line 810 "sql.y" -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } -#line 7657 "sql.c" - break; - case 449: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -#line 819 "sql.y" -{ yymsp[-6].minor.yy54 = createInsertStmt(pCxt, yymsp[-4].minor.yy54, yymsp[-2].minor.yy652, yymsp[0].minor.yy54); } -#line 7662 "sql.c" - break; - case 450: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -#line 820 "sql.y" -{ yymsp[-3].minor.yy54 = createInsertStmt(pCxt, yymsp[-1].minor.yy54, NULL, yymsp[0].minor.yy54); } -#line 7667 "sql.c" - break; - case 451: /* tags_literal ::= NK_INTEGER */ - case 463: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==463); - case 472: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==472); -#line 823 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } -#line 7674 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 452: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - case 453: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==453); - case 464: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==464); - case 465: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==465); - case 473: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==473); - case 474: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==474); - case 482: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==482); - case 483: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==483); -#line 824 "sql.y" + case 451: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + case 452: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==452); + case 463: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==463); + case 464: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==464); + case 472: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==472); + case 473: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==473); + case 481: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==481); + case 482: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==482); +#line 822 "sql.y" { SToken l = yymsp[-2].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy54 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy54); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); } -#line 7692 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7667 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 454: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 457: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==457); - case 466: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==466); - case 469: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==469); - case 475: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==475); - case 478: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==478); -#line 836 "sql.y" + case 453: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 456: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==456); + case 465: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==465); + case 468: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==468); + case 474: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==474); + case 477: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==477); +#line 834 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } -#line 7707 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7682 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 455: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - case 456: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==456); - case 458: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==458); - case 459: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==459); - case 467: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==467); - case 468: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==468); - case 470: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==470); - case 471: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==471); - case 476: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==476); - case 477: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==477); - case 479: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==479); - case 480: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==480); -#line 841 "sql.y" + case 454: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + case 455: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==455); + case 457: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==457); + case 458: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==458); + case 466: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==466); + case 467: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==467); + case 469: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==469); + case 470: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==470); + case 475: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==475); + case 476: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==476); + case 478: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==478); + case 479: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==479); +#line 839 "sql.y" { SToken l = yymsp[-3].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy54 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy54); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); } -#line 7729 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +#line 7704 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 460: /* tags_literal ::= NK_FLOAT */ -#line 870 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } -#line 7735 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 459: /* tags_literal ::= NK_FLOAT */ +#line 868 "sql.y" +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } +#line 7710 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 461: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 462: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==462); -#line 871 "sql.y" + case 460: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 461: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==461); +#line 869 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } -#line 7746 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7721 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 481: /* tags_literal ::= NK_STRING */ -#line 977 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } -#line 7752 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 480: /* tags_literal ::= NK_STRING */ +#line 975 "sql.y" +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } +#line 7727 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 484: /* tags_literal ::= NK_BOOL */ -#line 990 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } -#line 7758 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 483: /* tags_literal ::= NK_BOOL */ +#line 988 "sql.y" +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } +#line 7733 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 485: /* tags_literal ::= NULL */ + case 484: /* tags_literal ::= NULL */ +#line 989 "sql.y" +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } +#line 7739 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 485: /* tags_literal ::= literal_func */ #line 991 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } -#line 7764 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy416); } +#line 7745 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 486: /* tags_literal ::= literal_func */ -#line 993 "sql.y" -{ yylhsminor.yy54 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy54); } -#line 7770 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 487: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 488: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==488); -#line 994 "sql.y" + case 486: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 487: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==487); +#line 992 "sql.y" { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy54 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy54, yymsp[0].minor.yy54); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); } -#line 7782 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7757 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 491: /* literal ::= NK_INTEGER */ + case 490: /* literal ::= NK_INTEGER */ +#line 1011 "sql.y" +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } +#line 7763 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 491: /* literal ::= NK_FLOAT */ +#line 1012 "sql.y" +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } +#line 7769 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 492: /* literal ::= NK_STRING */ #line 1013 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } -#line 7788 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 7775 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 492: /* literal ::= NK_FLOAT */ + case 493: /* literal ::= NK_BOOL */ #line 1014 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } -#line 7794 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } +#line 7781 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 493: /* literal ::= NK_STRING */ + case 494: /* literal ::= TIMESTAMP NK_STRING */ #line 1015 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 7800 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } +#line 7787 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 494: /* literal ::= NK_BOOL */ + case 495: /* literal ::= duration_literal */ + case 505: /* signed_literal ::= signed */ yytestcase(yyruleno==505); + case 529: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==529); + case 530: /* expression ::= literal */ yytestcase(yyruleno==530); + case 532: /* expression ::= column_reference */ yytestcase(yyruleno==532); + case 533: /* expression ::= function_expression */ yytestcase(yyruleno==533); + case 534: /* expression ::= case_when_expression */ yytestcase(yyruleno==534); + case 568: /* function_expression ::= literal_func */ yytestcase(yyruleno==568); + case 618: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==618); + case 622: /* boolean_primary ::= predicate */ yytestcase(yyruleno==622); + case 624: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==624); + case 625: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==625); + case 628: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==628); + case 630: /* table_reference ::= table_primary */ yytestcase(yyruleno==630); + case 631: /* table_reference ::= joined_table */ yytestcase(yyruleno==631); + case 635: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==635); + case 720: /* query_simple ::= query_specification */ yytestcase(yyruleno==720); + case 721: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==721); + case 724: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==724); + case 726: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==726); #line 1016 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } -#line 7806 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 495: /* literal ::= TIMESTAMP NK_STRING */ -#line 1017 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } +{ yylhsminor.yy416 = yymsp[0].minor.yy416; } #line 7812 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 496: /* literal ::= duration_literal */ - case 506: /* signed_literal ::= signed */ yytestcase(yyruleno==506); - case 530: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==530); - case 531: /* expression ::= literal */ yytestcase(yyruleno==531); - case 533: /* expression ::= column_reference */ yytestcase(yyruleno==533); - case 534: /* expression ::= function_expression */ yytestcase(yyruleno==534); - case 535: /* expression ::= case_when_expression */ yytestcase(yyruleno==535); - case 569: /* function_expression ::= literal_func */ yytestcase(yyruleno==569); - case 619: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==619); - case 623: /* boolean_primary ::= predicate */ yytestcase(yyruleno==623); - case 625: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==625); - case 626: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==626); - case 629: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==629); - case 631: /* table_reference ::= table_primary */ yytestcase(yyruleno==631); - case 632: /* table_reference ::= joined_table */ yytestcase(yyruleno==632); - case 636: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==636); - case 721: /* query_simple ::= query_specification */ yytestcase(yyruleno==721); - case 722: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==722); - case 725: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==725); - case 727: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==727); + case 496: /* literal ::= NULL */ +#line 1017 "sql.y" +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } +#line 7818 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 497: /* literal ::= NK_QUESTION */ #line 1018 "sql.y" -{ yylhsminor.yy54 = yymsp[0].minor.yy54; } -#line 7837 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 7824 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 497: /* literal ::= NULL */ -#line 1019 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } -#line 7843 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 498: /* literal ::= NK_QUESTION */ + case 498: /* duration_literal ::= NK_VARIABLE */ + case 695: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==695); + case 696: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==696); + case 697: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==697); #line 1020 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7849 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 7833 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 499: /* duration_literal ::= NK_VARIABLE */ - case 696: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==696); - case 697: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==697); - case 698: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==698); + case 499: /* signed ::= NK_INTEGER */ #line 1022 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7858 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7839 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 500: /* signed ::= NK_INTEGER */ + case 500: /* signed ::= NK_PLUS NK_INTEGER */ +#line 1023 "sql.y" +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7845 "sql.c" + break; + case 501: /* signed ::= NK_MINUS NK_INTEGER */ #line 1024 "sql.y" -{ yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7864 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 501: /* signed ::= NK_PLUS NK_INTEGER */ -#line 1025 "sql.y" -{ yymsp[-1].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7870 "sql.c" - break; - case 502: /* signed ::= NK_MINUS NK_INTEGER */ -#line 1026 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } -#line 7879 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7854 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 503: /* signed ::= NK_FLOAT */ + case 502: /* signed ::= NK_FLOAT */ +#line 1029 "sql.y" +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7860 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 503: /* signed ::= NK_PLUS NK_FLOAT */ +#line 1030 "sql.y" +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7866 "sql.c" + break; + case 504: /* signed ::= NK_MINUS NK_FLOAT */ #line 1031 "sql.y" -{ yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7885 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 504: /* signed ::= NK_PLUS NK_FLOAT */ -#line 1032 "sql.y" -{ yymsp[-1].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7891 "sql.c" - break; - case 505: /* signed ::= NK_MINUS NK_FLOAT */ -#line 1033 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } -#line 7900 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7875 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 507: /* signed_literal ::= NK_STRING */ + case 506: /* signed_literal ::= NK_STRING */ +#line 1038 "sql.y" +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 7881 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 507: /* signed_literal ::= NK_BOOL */ +#line 1039 "sql.y" +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } +#line 7887 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 508: /* signed_literal ::= TIMESTAMP NK_STRING */ #line 1040 "sql.y" -{ yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 7906 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 7893 "sql.c" break; - case 508: /* signed_literal ::= NK_BOOL */ + case 509: /* signed_literal ::= duration_literal */ + case 511: /* signed_literal ::= literal_func */ yytestcase(yyruleno==511); + case 589: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==589); + case 672: /* select_item ::= common_expression */ yytestcase(yyruleno==672); + case 682: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==682); + case 725: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==725); + case 727: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==727); + case 740: /* search_condition ::= common_expression */ yytestcase(yyruleno==740); #line 1041 "sql.y" -{ yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } -#line 7912 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } +#line 7905 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 509: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 510: /* signed_literal ::= NULL */ #line 1042 "sql.y" -{ yymsp[-1].minor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 7918 "sql.c" +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } +#line 7911 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 510: /* signed_literal ::= duration_literal */ - case 512: /* signed_literal ::= literal_func */ yytestcase(yyruleno==512); - case 590: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==590); - case 673: /* select_item ::= common_expression */ yytestcase(yyruleno==673); - case 683: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==683); - case 726: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==726); - case 728: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==728); - case 741: /* search_condition ::= common_expression */ yytestcase(yyruleno==741); -#line 1043 "sql.y" -{ yylhsminor.yy54 = releaseRawExprNode(pCxt, yymsp[0].minor.yy54); } -#line 7930 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 511: /* signed_literal ::= NULL */ + case 512: /* signed_literal ::= NK_QUESTION */ #line 1044 "sql.y" -{ yylhsminor.yy54 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } -#line 7936 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } +#line 7917 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 513: /* signed_literal ::= NK_QUESTION */ -#line 1046 "sql.y" -{ yylhsminor.yy54 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } -#line 7942 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 531: /* expression ::= pseudo_column */ +#line 1110 "sql.y" +{ yylhsminor.yy416 = yymsp[0].minor.yy416; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy416, true); } +#line 7923 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 532: /* expression ::= pseudo_column */ -#line 1112 "sql.y" -{ yylhsminor.yy54 = yymsp[0].minor.yy54; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy54, true); } -#line 7948 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; + case 535: /* expression ::= NK_LP expression NK_RP */ + case 623: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==623); + case 739: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==739); +#line 1114 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 7931 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 536: /* expression ::= NK_LP expression NK_RP */ - case 624: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==624); - case 740: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==740); -#line 1116 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } -#line 7956 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 537: /* expression ::= NK_PLUS expr_or_subquery */ -#line 1117 "sql.y" + case 536: /* expression ::= NK_PLUS expr_or_subquery */ +#line 1115 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 7965 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7940 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 538: /* expression ::= NK_MINUS expr_or_subquery */ -#line 1121 "sql.y" + case 537: /* expression ::= NK_MINUS expr_or_subquery */ +#line 1119 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy54), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); } -#line 7974 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 7949 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 539: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ -#line 1125 "sql.y" + case 538: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ +#line 1123 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 7984 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7959 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 540: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ -#line 1130 "sql.y" + case 539: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ +#line 1128 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 7994 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7969 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 541: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ -#line 1135 "sql.y" + case 540: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ +#line 1133 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8004 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7979 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 542: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ -#line 1140 "sql.y" + case 541: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ +#line 1138 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8014 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7989 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 543: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ -#line 1145 "sql.y" + case 542: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ +#line 1143 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8024 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 7999 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 544: /* expression ::= column_reference NK_ARROW NK_STRING */ -#line 1150 "sql.y" + case 543: /* expression ::= column_reference NK_ARROW NK_STRING */ +#line 1148 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } -#line 8033 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8008 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 545: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ -#line 1154 "sql.y" + case 544: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ +#line 1152 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8043 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8018 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 546: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ -#line 1159 "sql.y" + case 545: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ +#line 1157 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8053 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8028 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 549: /* column_reference ::= column_name */ + case 548: /* column_reference ::= column_name */ +#line 1168 "sql.y" +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy1109, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109)); } +#line 8034 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 549: /* column_reference ::= table_name NK_DOT column_name */ +#line 1169 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109)); } +#line 8040 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 550: /* column_reference ::= NK_ALIAS */ #line 1170 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy837, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy837)); } -#line 8059 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 8046 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 550: /* column_reference ::= table_name NK_DOT column_name */ + case 551: /* column_reference ::= table_name NK_DOT NK_ALIAS */ #line 1171 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837, createColumnNode(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy837)); } -#line 8065 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0)); } +#line 8052 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 551: /* column_reference ::= NK_ALIAS */ -#line 1172 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 8071 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 552: /* column_reference ::= table_name NK_DOT NK_ALIAS */ + case 552: /* pseudo_column ::= ROWTS */ + case 553: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==553); + case 555: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==555); + case 556: /* pseudo_column ::= QEND */ yytestcase(yyruleno==556); + case 557: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==557); + case 558: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==558); + case 559: /* pseudo_column ::= WEND */ yytestcase(yyruleno==559); + case 560: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==560); + case 561: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==561); + case 562: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==562); + case 563: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==563); + case 570: /* literal_func ::= NOW */ yytestcase(yyruleno==570); + case 571: /* literal_func ::= TODAY */ yytestcase(yyruleno==571); #line 1173 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0)); } -#line 8077 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } +#line 8070 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 553: /* pseudo_column ::= ROWTS */ - case 554: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==554); - case 556: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==556); - case 557: /* pseudo_column ::= QEND */ yytestcase(yyruleno==557); - case 558: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==558); - case 559: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==559); - case 560: /* pseudo_column ::= WEND */ yytestcase(yyruleno==560); - case 561: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==561); - case 562: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==562); - case 563: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==563); - case 564: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==564); - case 571: /* literal_func ::= NOW */ yytestcase(yyruleno==571); - case 572: /* literal_func ::= TODAY */ yytestcase(yyruleno==572); + case 554: /* pseudo_column ::= table_name NK_DOT TBNAME */ #line 1175 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } -#line 8095 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy1109)))); } +#line 8076 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 555: /* pseudo_column ::= table_name NK_DOT TBNAME */ -#line 1177 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy837)))); } -#line 8101 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 564: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 565: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==565); +#line 1186 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316)); } +#line 8083 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 565: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 566: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==566); -#line 1188 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy837, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy837, yymsp[-1].minor.yy652)); } -#line 8108 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 566: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 567: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==567); +#line 1189 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy952)); } +#line 8090 "sql.c" + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 567: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - case 568: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==568); -#line 1191 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), yymsp[-1].minor.yy84)); } + case 569: /* literal_func ::= noarg_func NK_LP NK_RP */ +#line 1195 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy1109, NULL)); } +#line 8096 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 585: /* star_func_para_list ::= NK_STAR */ +#line 1220 "sql.y" +{ yylhsminor.yy316 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 8102 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; + break; + case 590: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 675: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==675); +#line 1229 "sql.y" +{ yylhsminor.yy416 = createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } +#line 8109 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 591: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +#line 1232 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } #line 8115 "sql.c" - yymsp[-5].minor.yy54 = yylhsminor.yy54; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 570: /* literal_func ::= noarg_func NK_LP NK_RP */ -#line 1197 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy837, NULL)); } -#line 8121 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 586: /* star_func_para_list ::= NK_STAR */ -#line 1222 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 8127 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; - break; - case 591: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 676: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==676); -#line 1231 "sql.y" -{ yylhsminor.yy54 = createColumnNode(pCxt, &yymsp[-2].minor.yy837, &yymsp[0].minor.yy0); } -#line 8134 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 592: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 592: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ #line 1234 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy652, yymsp[-1].minor.yy54)); } -#line 8140 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } +#line 8121 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 593: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -#line 1236 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), yymsp[-2].minor.yy652, yymsp[-1].minor.yy54)); } -#line 8146 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; + case 595: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +#line 1241 "sql.y" +{ yymsp[-3].minor.yy416 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } +#line 8127 "sql.c" break; - case 596: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -#line 1243 "sql.y" -{ yymsp[-3].minor.yy54 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54)); } + case 597: /* case_when_else_opt ::= ELSE common_expression */ +#line 1244 "sql.y" +{ yymsp[-1].minor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } +#line 8132 "sql.c" + break; + case 598: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 603: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==603); +#line 1247 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy848, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); + } +#line 8142 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 599: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 1254 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); + } #line 8152 "sql.c" + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 598: /* case_when_else_opt ::= ELSE common_expression */ -#line 1246 "sql.y" -{ yymsp[-1].minor.yy54 = releaseRawExprNode(pCxt, yymsp[0].minor.yy54); } -#line 8157 "sql.c" - break; - case 599: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 604: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==604); -#line 1249 "sql.y" + case 600: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 1260 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy922, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8167 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8162 "sql.c" + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 600: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 1256 "sql.y" + case 601: /* predicate ::= expr_or_subquery IS NULL */ +#line 1265 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy54), releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), NULL)); } -#line 8177 "sql.c" - yymsp[-4].minor.yy54 = yylhsminor.yy54; +#line 8171 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 601: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 1262 "sql.y" + case 602: /* predicate ::= expr_or_subquery IS NOT NULL */ +#line 1269 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy54), releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL)); } -#line 8187 "sql.c" - yymsp[-5].minor.yy54 = yylhsminor.yy54; +#line 8180 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 602: /* predicate ::= expr_or_subquery IS NULL */ -#line 1267 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), NULL)); - } -#line 8196 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 604: /* compare_op ::= NK_LT */ +#line 1281 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_THAN; } +#line 8186 "sql.c" break; - case 603: /* predicate ::= expr_or_subquery IS NOT NULL */ -#line 1271 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), NULL)); - } -#line 8205 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 605: /* compare_op ::= NK_GT */ +#line 1282 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_THAN; } +#line 8191 "sql.c" break; - case 605: /* compare_op ::= NK_LT */ + case 606: /* compare_op ::= NK_LE */ #line 1283 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_LOWER_THAN; } +{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_EQUAL; } +#line 8196 "sql.c" + break; + case 607: /* compare_op ::= NK_GE */ +#line 1284 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_EQUAL; } +#line 8201 "sql.c" + break; + case 608: /* compare_op ::= NK_NE */ +#line 1285 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_NOT_EQUAL; } +#line 8206 "sql.c" + break; + case 609: /* compare_op ::= NK_EQ */ +#line 1286 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_EQUAL; } #line 8211 "sql.c" break; - case 606: /* compare_op ::= NK_GT */ -#line 1284 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_GREATER_THAN; } + case 610: /* compare_op ::= LIKE */ +#line 1287 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_LIKE; } #line 8216 "sql.c" break; - case 607: /* compare_op ::= NK_LE */ -#line 1285 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_LOWER_EQUAL; } + case 611: /* compare_op ::= NOT LIKE */ +#line 1288 "sql.y" +{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_LIKE; } #line 8221 "sql.c" break; - case 608: /* compare_op ::= NK_GE */ -#line 1286 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_GREATER_EQUAL; } + case 612: /* compare_op ::= MATCH */ +#line 1289 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_MATCH; } #line 8226 "sql.c" break; - case 609: /* compare_op ::= NK_NE */ -#line 1287 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_NOT_EQUAL; } + case 613: /* compare_op ::= NMATCH */ +#line 1290 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_NMATCH; } #line 8231 "sql.c" break; - case 610: /* compare_op ::= NK_EQ */ -#line 1288 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_EQUAL; } + case 614: /* compare_op ::= CONTAINS */ +#line 1291 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_JSON_CONTAINS; } #line 8236 "sql.c" break; - case 611: /* compare_op ::= LIKE */ -#line 1289 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_LIKE; } + case 615: /* in_op ::= IN */ +#line 1295 "sql.y" +{ yymsp[0].minor.yy848 = OP_TYPE_IN; } #line 8241 "sql.c" break; - case 612: /* compare_op ::= NOT LIKE */ -#line 1290 "sql.y" -{ yymsp[-1].minor.yy922 = OP_TYPE_NOT_LIKE; } + case 616: /* in_op ::= NOT IN */ +#line 1296 "sql.y" +{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_IN; } #line 8246 "sql.c" break; - case 613: /* compare_op ::= MATCH */ -#line 1291 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_MATCH; } -#line 8251 "sql.c" - break; - case 614: /* compare_op ::= NMATCH */ -#line 1292 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_NMATCH; } -#line 8256 "sql.c" - break; - case 615: /* compare_op ::= CONTAINS */ -#line 1293 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_JSON_CONTAINS; } -#line 8261 "sql.c" - break; - case 616: /* in_op ::= IN */ -#line 1297 "sql.y" -{ yymsp[0].minor.yy922 = OP_TYPE_IN; } -#line 8266 "sql.c" - break; - case 617: /* in_op ::= NOT IN */ + case 617: /* in_predicate_value ::= NK_LP literal_list NK_RP */ #line 1298 "sql.y" -{ yymsp[-1].minor.yy922 = OP_TYPE_NOT_IN; } -#line 8271 "sql.c" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } +#line 8251 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 618: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -#line 1300 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy652)); } -#line 8276 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 620: /* boolean_value_expression ::= NOT boolean_primary */ -#line 1304 "sql.y" + case 619: /* boolean_value_expression ::= NOT boolean_primary */ +#line 1302 "sql.y" { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy54), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); } -#line 8285 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 8260 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 621: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ -#line 1309 "sql.y" + case 620: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ +#line 1307 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8295 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8270 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 622: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -#line 1315 "sql.y" + case 621: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ +#line 1313 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy54); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy54); - yylhsminor.yy54 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8305 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +#line 8280 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 630: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -#line 1333 "sql.y" -{ yylhsminor.yy54 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy54, yymsp[0].minor.yy54, NULL); } -#line 8311 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 629: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +#line 1331 "sql.y" +{ yylhsminor.yy416 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, NULL); } +#line 8286 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 633: /* table_primary ::= table_name alias_opt */ + case 632: /* table_primary ::= table_name alias_opt */ +#line 1337 "sql.y" +{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 8292 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; + break; + case 633: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +#line 1338 "sql.y" +{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-3].minor.yy1109, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } +#line 8298 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; + break; + case 634: /* table_primary ::= subquery alias_opt */ #line 1339 "sql.y" -{ yylhsminor.yy54 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy837, &yymsp[0].minor.yy837); } -#line 8317 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } +#line 8304 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 634: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -#line 1340 "sql.y" -{ yylhsminor.yy54 = createRealTableNode(pCxt, &yymsp[-3].minor.yy837, &yymsp[-1].minor.yy837, &yymsp[0].minor.yy837); } -#line 8323 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; + case 636: /* alias_opt ::= */ +#line 1344 "sql.y" +{ yymsp[1].minor.yy1109 = nil_token; } +#line 8310 "sql.c" break; - case 635: /* table_primary ::= subquery alias_opt */ -#line 1341 "sql.y" -{ yylhsminor.yy54 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54), &yymsp[0].minor.yy837); } -#line 8329 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; - break; - case 637: /* alias_opt ::= */ + case 638: /* alias_opt ::= AS table_alias */ #line 1346 "sql.y" -{ yymsp[1].minor.yy837 = nil_token; } -#line 8335 "sql.c" +{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy1109; } +#line 8315 "sql.c" break; - case 639: /* alias_opt ::= AS table_alias */ + case 639: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 640: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==640); #line 1348 "sql.y" -{ yymsp[-1].minor.yy837 = yymsp[0].minor.yy837; } -#line 8340 "sql.c" +{ yymsp[-2].minor.yy416 = yymsp[-1].minor.yy416; } +#line 8321 "sql.c" break; - case 640: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 641: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==641); -#line 1350 "sql.y" -{ yymsp[-2].minor.yy54 = yymsp[-1].minor.yy54; } + case 641: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ +#line 1354 "sql.y" +{ + yylhsminor.yy416 = createJoinTableNode(pCxt, yymsp[-6].minor.yy972, yymsp[-5].minor.yy630, yymsp[-7].minor.yy416, yymsp[-3].minor.yy416, yymsp[-2].minor.yy416); + yylhsminor.yy416 = addWindowOffsetClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); + yylhsminor.yy416 = addJLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); + } +#line 8330 "sql.c" + yymsp[-7].minor.yy416 = yylhsminor.yy416; + break; + case 642: /* join_type ::= */ +#line 1362 "sql.y" +{ yymsp[1].minor.yy972 = JOIN_TYPE_INNER; } +#line 8336 "sql.c" + break; + case 643: /* join_type ::= INNER */ +#line 1363 "sql.y" +{ yymsp[0].minor.yy972 = JOIN_TYPE_INNER; } +#line 8341 "sql.c" + break; + case 644: /* join_type ::= LEFT */ +#line 1364 "sql.y" +{ yymsp[0].minor.yy972 = JOIN_TYPE_LEFT; } #line 8346 "sql.c" break; - case 642: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ -#line 1356 "sql.y" -{ - yylhsminor.yy54 = createJoinTableNode(pCxt, yymsp[-6].minor.yy230, yymsp[-5].minor.yy948, yymsp[-7].minor.yy54, yymsp[-3].minor.yy54, yymsp[-2].minor.yy54); - yylhsminor.yy54 = addWindowOffsetClause(pCxt, yylhsminor.yy54, yymsp[-1].minor.yy54); - yylhsminor.yy54 = addJLimitClause(pCxt, yylhsminor.yy54, yymsp[0].minor.yy54); - } -#line 8355 "sql.c" - yymsp[-7].minor.yy54 = yylhsminor.yy54; + case 645: /* join_type ::= RIGHT */ +#line 1365 "sql.y" +{ yymsp[0].minor.yy972 = JOIN_TYPE_RIGHT; } +#line 8351 "sql.c" break; - case 643: /* join_type ::= */ -#line 1364 "sql.y" -{ yymsp[1].minor.yy230 = JOIN_TYPE_INNER; } + case 646: /* join_type ::= FULL */ +#line 1366 "sql.y" +{ yymsp[0].minor.yy972 = JOIN_TYPE_FULL; } +#line 8356 "sql.c" + break; + case 647: /* join_subtype ::= */ +#line 1370 "sql.y" +{ yymsp[1].minor.yy630 = JOIN_STYPE_NONE; } #line 8361 "sql.c" break; - case 644: /* join_type ::= INNER */ -#line 1365 "sql.y" -{ yymsp[0].minor.yy230 = JOIN_TYPE_INNER; } + case 648: /* join_subtype ::= OUTER */ +#line 1371 "sql.y" +{ yymsp[0].minor.yy630 = JOIN_STYPE_OUTER; } #line 8366 "sql.c" break; - case 645: /* join_type ::= LEFT */ -#line 1366 "sql.y" -{ yymsp[0].minor.yy230 = JOIN_TYPE_LEFT; } + case 649: /* join_subtype ::= SEMI */ +#line 1372 "sql.y" +{ yymsp[0].minor.yy630 = JOIN_STYPE_SEMI; } #line 8371 "sql.c" break; - case 646: /* join_type ::= RIGHT */ -#line 1367 "sql.y" -{ yymsp[0].minor.yy230 = JOIN_TYPE_RIGHT; } + case 650: /* join_subtype ::= ANTI */ +#line 1373 "sql.y" +{ yymsp[0].minor.yy630 = JOIN_STYPE_ANTI; } #line 8376 "sql.c" break; - case 647: /* join_type ::= FULL */ -#line 1368 "sql.y" -{ yymsp[0].minor.yy230 = JOIN_TYPE_FULL; } + case 651: /* join_subtype ::= ASOF */ +#line 1374 "sql.y" +{ yymsp[0].minor.yy630 = JOIN_STYPE_ASOF; } #line 8381 "sql.c" break; - case 648: /* join_subtype ::= */ -#line 1372 "sql.y" -{ yymsp[1].minor.yy948 = JOIN_STYPE_NONE; } + case 652: /* join_subtype ::= WINDOW */ +#line 1375 "sql.y" +{ yymsp[0].minor.yy630 = JOIN_STYPE_WIN; } #line 8386 "sql.c" break; - case 649: /* join_subtype ::= OUTER */ -#line 1373 "sql.y" -{ yymsp[0].minor.yy948 = JOIN_STYPE_OUTER; } + case 656: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ +#line 1382 "sql.y" +{ yymsp[-5].minor.yy416 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } #line 8391 "sql.c" break; - case 650: /* join_subtype ::= SEMI */ -#line 1374 "sql.y" -{ yymsp[0].minor.yy948 = JOIN_STYPE_SEMI; } -#line 8396 "sql.c" - break; - case 651: /* join_subtype ::= ANTI */ -#line 1375 "sql.y" -{ yymsp[0].minor.yy948 = JOIN_STYPE_ANTI; } -#line 8401 "sql.c" - break; - case 652: /* join_subtype ::= ASOF */ -#line 1376 "sql.y" -{ yymsp[0].minor.yy948 = JOIN_STYPE_ASOF; } -#line 8406 "sql.c" - break; - case 653: /* join_subtype ::= WINDOW */ -#line 1377 "sql.y" -{ yymsp[0].minor.yy948 = JOIN_STYPE_WIN; } -#line 8411 "sql.c" - break; - case 657: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + case 657: /* window_offset_literal ::= NK_VARIABLE */ #line 1384 "sql.y" -{ yymsp[-5].minor.yy54 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } -#line 8416 "sql.c" +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 8396 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 658: /* window_offset_literal ::= NK_VARIABLE */ -#line 1386 "sql.y" -{ yylhsminor.yy54 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 8421 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; - break; - case 659: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ -#line 1387 "sql.y" + case 658: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ +#line 1385 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy54 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + yylhsminor.yy416 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); } -#line 8431 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; +#line 8406 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 661: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 732: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==732); - case 736: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==736); -#line 1394 "sql.y" -{ yymsp[-1].minor.yy54 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 8439 "sql.c" + case 660: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 731: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==731); + case 735: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==735); +#line 1392 "sql.y" +{ yymsp[-1].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 8414 "sql.c" break; - case 662: /* 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 */ -#line 1400 "sql.y" + case 661: /* 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 */ +#line 1398 "sql.y" { - yymsp[-13].minor.yy54 = createSelectStmt(pCxt, yymsp[-11].minor.yy325, yymsp[-9].minor.yy652, yymsp[-8].minor.yy54, yymsp[-12].minor.yy652); - yymsp[-13].minor.yy54 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy54, yymsp[-10].minor.yy325); - yymsp[-13].minor.yy54 = addWhereClause(pCxt, yymsp[-13].minor.yy54, yymsp[-7].minor.yy54); - yymsp[-13].minor.yy54 = addPartitionByClause(pCxt, yymsp[-13].minor.yy54, yymsp[-6].minor.yy652); - yymsp[-13].minor.yy54 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy54, yymsp[-2].minor.yy54); - yymsp[-13].minor.yy54 = addGroupByClause(pCxt, yymsp[-13].minor.yy54, yymsp[-1].minor.yy652); - yymsp[-13].minor.yy54 = addHavingClause(pCxt, yymsp[-13].minor.yy54, yymsp[0].minor.yy54); - yymsp[-13].minor.yy54 = addRangeClause(pCxt, yymsp[-13].minor.yy54, yymsp[-5].minor.yy54); - yymsp[-13].minor.yy54 = addEveryClause(pCxt, yymsp[-13].minor.yy54, yymsp[-4].minor.yy54); - yymsp[-13].minor.yy54 = addFillClause(pCxt, yymsp[-13].minor.yy54, yymsp[-3].minor.yy54); + yymsp[-13].minor.yy416 = createSelectStmt(pCxt, yymsp[-11].minor.yy209, yymsp[-9].minor.yy316, yymsp[-8].minor.yy416, yymsp[-12].minor.yy316); + yymsp[-13].minor.yy416 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy416, yymsp[-10].minor.yy209); + yymsp[-13].minor.yy416 = addWhereClause(pCxt, yymsp[-13].minor.yy416, yymsp[-7].minor.yy416); + yymsp[-13].minor.yy416 = addPartitionByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-6].minor.yy316); + yymsp[-13].minor.yy416 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy416, yymsp[-2].minor.yy416); + yymsp[-13].minor.yy416 = addGroupByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-1].minor.yy316); + yymsp[-13].minor.yy416 = addHavingClause(pCxt, yymsp[-13].minor.yy416, yymsp[0].minor.yy416); + yymsp[-13].minor.yy416 = addRangeClause(pCxt, yymsp[-13].minor.yy416, yymsp[-5].minor.yy416); + yymsp[-13].minor.yy416 = addEveryClause(pCxt, yymsp[-13].minor.yy416, yymsp[-4].minor.yy416); + yymsp[-13].minor.yy416 = addFillClause(pCxt, yymsp[-13].minor.yy416, yymsp[-3].minor.yy416); } -#line 8455 "sql.c" +#line 8430 "sql.c" break; - case 663: /* hint_list ::= */ -#line 1415 "sql.y" -{ yymsp[1].minor.yy652 = createHintNodeList(pCxt, NULL); } -#line 8460 "sql.c" + case 662: /* hint_list ::= */ +#line 1413 "sql.y" +{ yymsp[1].minor.yy316 = createHintNodeList(pCxt, NULL); } +#line 8435 "sql.c" break; - case 664: /* hint_list ::= NK_HINT */ -#line 1416 "sql.y" -{ yylhsminor.yy652 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } -#line 8465 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; + case 663: /* hint_list ::= NK_HINT */ +#line 1414 "sql.y" +{ yylhsminor.yy316 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } +#line 8440 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 669: /* set_quantifier_opt ::= ALL */ -#line 1427 "sql.y" -{ yymsp[0].minor.yy325 = false; } -#line 8471 "sql.c" + case 668: /* set_quantifier_opt ::= ALL */ +#line 1425 "sql.y" +{ yymsp[0].minor.yy209 = false; } +#line 8446 "sql.c" break; - case 672: /* select_item ::= NK_STAR */ + case 671: /* select_item ::= NK_STAR */ +#line 1432 "sql.y" +{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } +#line 8451 "sql.c" + yymsp[0].minor.yy416 = yylhsminor.yy416; + break; + case 673: /* select_item ::= common_expression column_alias */ + case 683: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==683); #line 1434 "sql.y" -{ yylhsminor.yy54 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } -#line 8476 "sql.c" - yymsp[0].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } +#line 8458 "sql.c" + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 674: /* select_item ::= common_expression column_alias */ - case 684: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==684); -#line 1436 "sql.y" -{ yylhsminor.yy54 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54), &yymsp[0].minor.yy837); } + case 674: /* select_item ::= common_expression AS column_alias */ + case 684: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==684); +#line 1435 "sql.y" +{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), &yymsp[0].minor.yy1109); } +#line 8465 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 679: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 709: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==709); + case 729: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==729); +#line 1444 "sql.y" +{ yymsp[-2].minor.yy316 = yymsp[0].minor.yy316; } +#line 8473 "sql.c" + break; + case 686: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +#line 1457 "sql.y" +{ yymsp[-5].minor.yy416 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 8478 "sql.c" + break; + case 687: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +#line 1458 "sql.y" +{ yymsp[-3].minor.yy416 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } #line 8483 "sql.c" - yymsp[-1].minor.yy54 = yylhsminor.yy54; break; - case 675: /* select_item ::= common_expression AS column_alias */ - case 685: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==685); -#line 1437 "sql.y" -{ yylhsminor.yy54 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), &yymsp[0].minor.yy837); } -#line 8490 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 688: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1460 "sql.y" +{ yymsp[-5].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 8488 "sql.c" break; - case 680: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 710: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==710); - case 730: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==730); -#line 1446 "sql.y" -{ yymsp[-2].minor.yy652 = yymsp[0].minor.yy652; } + case 689: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1464 "sql.y" +{ yymsp[-7].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } +#line 8493 "sql.c" + break; + case 690: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +#line 1466 "sql.y" +{ yymsp[-6].minor.yy416 = createEventWindowNode(pCxt, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } #line 8498 "sql.c" break; - case 687: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -#line 1459 "sql.y" -{ yymsp[-5].minor.yy54 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } + case 691: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +#line 1468 "sql.y" +{ yymsp[-3].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } #line 8503 "sql.c" break; - case 688: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -#line 1460 "sql.y" -{ yymsp[-3].minor.yy54 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } + case 692: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +#line 1470 "sql.y" +{ yymsp[-5].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } #line 8508 "sql.c" break; - case 689: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1462 "sql.y" -{ yymsp[-5].minor.yy54 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), NULL, yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } + case 699: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +#line 1480 "sql.y" +{ yymsp[-3].minor.yy416 = createFillNode(pCxt, yymsp[-1].minor.yy882, NULL); } #line 8513 "sql.c" break; - case 690: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1466 "sql.y" -{ yymsp[-7].minor.yy54 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy54), releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), yymsp[-1].minor.yy54, yymsp[0].minor.yy54); } + case 700: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +#line 1481 "sql.y" +{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } #line 8518 "sql.c" break; - case 691: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -#line 1468 "sql.y" -{ yymsp[-6].minor.yy54 = createEventWindowNode(pCxt, yymsp[-3].minor.yy54, yymsp[0].minor.yy54); } + case 701: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +#line 1482 "sql.y" +{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } #line 8523 "sql.c" break; - case 692: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -#line 1470 "sql.y" -{ yymsp[-3].minor.yy54 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 702: /* fill_mode ::= NONE */ +#line 1486 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_NONE; } #line 8528 "sql.c" break; - case 693: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -#line 1472 "sql.y" -{ yymsp[-5].minor.yy54 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 703: /* fill_mode ::= PREV */ +#line 1487 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_PREV; } #line 8533 "sql.c" break; - case 700: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -#line 1482 "sql.y" -{ yymsp[-3].minor.yy54 = createFillNode(pCxt, yymsp[-1].minor.yy478, NULL); } + case 704: /* fill_mode ::= NULL */ +#line 1488 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_NULL; } #line 8538 "sql.c" break; - case 701: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -#line 1483 "sql.y" -{ yymsp[-5].minor.yy54 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy652)); } + case 705: /* fill_mode ::= NULL_F */ +#line 1489 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_NULL_F; } #line 8543 "sql.c" break; - case 702: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -#line 1484 "sql.y" -{ yymsp[-5].minor.yy54 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy652)); } + case 706: /* fill_mode ::= LINEAR */ +#line 1490 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_LINEAR; } #line 8548 "sql.c" break; - case 703: /* fill_mode ::= NONE */ -#line 1488 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_NONE; } + case 707: /* fill_mode ::= NEXT */ +#line 1491 "sql.y" +{ yymsp[0].minor.yy882 = FILL_MODE_NEXT; } #line 8553 "sql.c" break; - case 704: /* fill_mode ::= PREV */ -#line 1489 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_PREV; } + case 710: /* group_by_list ::= expr_or_subquery */ +#line 1500 "sql.y" +{ yylhsminor.yy316 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } #line 8558 "sql.c" + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 705: /* fill_mode ::= NULL */ -#line 1490 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_NULL; } -#line 8563 "sql.c" + case 711: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +#line 1501 "sql.y" +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } +#line 8564 "sql.c" + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; - case 706: /* fill_mode ::= NULL_F */ -#line 1491 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_NULL_F; } -#line 8568 "sql.c" + case 715: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +#line 1508 "sql.y" +{ yymsp[-5].minor.yy416 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 8570 "sql.c" break; - case 707: /* fill_mode ::= LINEAR */ -#line 1492 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_LINEAR; } -#line 8573 "sql.c" - break; - case 708: /* fill_mode ::= NEXT */ -#line 1493 "sql.y" -{ yymsp[0].minor.yy478 = FILL_MODE_NEXT; } -#line 8578 "sql.c" - break; - case 711: /* group_by_list ::= expr_or_subquery */ -#line 1502 "sql.y" -{ yylhsminor.yy652 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); } -#line 8583 "sql.c" - yymsp[0].minor.yy652 = yylhsminor.yy652; - break; - case 712: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -#line 1503 "sql.y" -{ yylhsminor.yy652 = addNodeToList(pCxt, yymsp[-2].minor.yy652, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy54))); } -#line 8589 "sql.c" - yymsp[-2].minor.yy652 = yylhsminor.yy652; - break; - case 716: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 716: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ #line 1510 "sql.y" -{ yymsp[-5].minor.yy54 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy54), releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } -#line 8595 "sql.c" +{ yymsp[-3].minor.yy416 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } +#line 8575 "sql.c" break; - case 717: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -#line 1512 "sql.y" -{ yymsp[-3].minor.yy54 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy54)); } -#line 8600 "sql.c" - break; - case 720: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ -#line 1519 "sql.y" + case 719: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ +#line 1517 "sql.y" { - yylhsminor.yy54 = addOrderByClause(pCxt, yymsp[-3].minor.yy54, yymsp[-2].minor.yy652); - yylhsminor.yy54 = addSlimitClause(pCxt, yylhsminor.yy54, yymsp[-1].minor.yy54); - yylhsminor.yy54 = addLimitClause(pCxt, yylhsminor.yy54, yymsp[0].minor.yy54); + yylhsminor.yy416 = addOrderByClause(pCxt, yymsp[-3].minor.yy416, yymsp[-2].minor.yy316); + yylhsminor.yy416 = addSlimitClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); + yylhsminor.yy416 = addLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); } -#line 8609 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +#line 8584 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 723: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 722: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +#line 1527 "sql.y" +{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } +#line 8590 "sql.c" + yymsp[-3].minor.yy416 = yylhsminor.yy416; + break; + case 723: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ #line 1529 "sql.y" -{ yylhsminor.yy54 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy54, yymsp[0].minor.yy54); } -#line 8615 "sql.c" - yymsp[-3].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); } +#line 8596 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 724: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -#line 1531 "sql.y" -{ yylhsminor.yy54 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy54, yymsp[0].minor.yy54); } -#line 8621 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 732: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 736: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==736); +#line 1544 "sql.y" +{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } +#line 8603 "sql.c" break; - case 733: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 737: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==737); -#line 1546 "sql.y" -{ yymsp[-3].minor.yy54 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 8628 "sql.c" + case 733: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 737: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==737); +#line 1545 "sql.y" +{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } +#line 8609 "sql.c" break; - case 734: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 738: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==738); -#line 1547 "sql.y" -{ yymsp[-3].minor.yy54 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } -#line 8634 "sql.c" + case 738: /* subquery ::= NK_LP query_expression NK_RP */ +#line 1553 "sql.y" +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy416); } +#line 8614 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 739: /* subquery ::= NK_LP query_expression NK_RP */ -#line 1555 "sql.y" -{ yylhsminor.yy54 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy54); } -#line 8639 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 743: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +#line 1567 "sql.y" +{ yylhsminor.yy416 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), yymsp[-1].minor.yy506, yymsp[0].minor.yy1045); } +#line 8620 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 744: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -#line 1569 "sql.y" -{ yylhsminor.yy54 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy54), yymsp[-1].minor.yy760, yymsp[0].minor.yy503); } -#line 8645 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; + case 744: /* ordering_specification_opt ::= */ +#line 1571 "sql.y" +{ yymsp[1].minor.yy506 = ORDER_ASC; } +#line 8626 "sql.c" break; - case 745: /* ordering_specification_opt ::= */ + case 745: /* ordering_specification_opt ::= ASC */ +#line 1572 "sql.y" +{ yymsp[0].minor.yy506 = ORDER_ASC; } +#line 8631 "sql.c" + break; + case 746: /* ordering_specification_opt ::= DESC */ #line 1573 "sql.y" -{ yymsp[1].minor.yy760 = ORDER_ASC; } +{ yymsp[0].minor.yy506 = ORDER_DESC; } +#line 8636 "sql.c" + break; + case 747: /* null_ordering_opt ::= */ +#line 1577 "sql.y" +{ yymsp[1].minor.yy1045 = NULL_ORDER_DEFAULT; } +#line 8641 "sql.c" + break; + case 748: /* null_ordering_opt ::= NULLS FIRST */ +#line 1578 "sql.y" +{ yymsp[-1].minor.yy1045 = NULL_ORDER_FIRST; } +#line 8646 "sql.c" + break; + case 749: /* null_ordering_opt ::= NULLS LAST */ +#line 1579 "sql.y" +{ yymsp[-1].minor.yy1045 = NULL_ORDER_LAST; } #line 8651 "sql.c" break; - case 746: /* ordering_specification_opt ::= ASC */ -#line 1574 "sql.y" -{ yymsp[0].minor.yy760 = ORDER_ASC; } + case 752: /* column_options ::= column_options ENCODE NK_STRING */ +#line 1587 "sql.y" +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } #line 8656 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 747: /* ordering_specification_opt ::= DESC */ -#line 1575 "sql.y" -{ yymsp[0].minor.yy760 = ORDER_DESC; } -#line 8661 "sql.c" + case 753: /* column_options ::= column_options COMPRESS NK_STRING */ +#line 1588 "sql.y" +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } +#line 8662 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 748: /* null_ordering_opt ::= */ -#line 1579 "sql.y" -{ yymsp[1].minor.yy503 = NULL_ORDER_DEFAULT; } -#line 8666 "sql.c" - break; - case 749: /* null_ordering_opt ::= NULLS FIRST */ -#line 1580 "sql.y" -{ yymsp[-1].minor.yy503 = NULL_ORDER_FIRST; } -#line 8671 "sql.c" - break; - case 750: /* null_ordering_opt ::= NULLS LAST */ -#line 1581 "sql.y" -{ yymsp[-1].minor.yy503 = NULL_ORDER_LAST; } -#line 8676 "sql.c" - break; - case 753: /* column_options ::= column_options ENCODE NK_STRING */ + case 754: /* column_options ::= column_options LEVEL NK_STRING */ #line 1589 "sql.y" -{ yylhsminor.yy54 = setColumnOptions(pCxt, yymsp[-2].minor.yy54, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } -#line 8681 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 754: /* column_options ::= column_options COMPRESS NK_STRING */ -#line 1590 "sql.y" -{ yylhsminor.yy54 = setColumnOptions(pCxt, yymsp[-2].minor.yy54, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } -#line 8687 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; - break; - case 755: /* column_options ::= column_options LEVEL NK_STRING */ -#line 1591 "sql.y" -{ yylhsminor.yy54 = setColumnOptions(pCxt, yymsp[-2].minor.yy54, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } -#line 8693 "sql.c" - yymsp[-2].minor.yy54 = yylhsminor.yy54; +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } +#line 8668 "sql.c" + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; default: break; @@ -8764,7 +8739,7 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } -#line 8767 "sql.c" +#line 8742 "sql.c" /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 66fa405a3a..0cba28e254 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -539,7 +539,7 @@ static int32_t createJoinLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect pJoin->pJLimit = nodesCloneNode(pJoinTable->pJLimit); pJoin->addPrimEqCond = nodesCloneNode(pJoinTable->addPrimCond); pJoin->node.pChildren = nodesMakeList(); - pJoin->seqWinGroup = (JOIN_STYPE_WIN == pJoinTable->subType) && (pSelect->hasAggFuncs || pSelect->hasIndefiniteRowsFunc); + pJoin->seqWinGroup = (JOIN_STYPE_WIN == pJoinTable->subType) && (pSelect->hasAggFuncs || pSelect->hasIndefiniteRowsFunc); if (NULL == pJoin->node.pChildren) { code = TSDB_CODE_OUT_OF_MEMORY; @@ -619,7 +619,7 @@ static int32_t createJoinLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect } } -#else +#else // set the output if (TSDB_CODE_SUCCESS == code) { SNodeList* pColList = NULL; @@ -762,7 +762,7 @@ static int32_t addWinJoinPrimKeyToAggFuncs(SSelectStmt* pSelect, SNodeList** pLi pCol->hasIndex = (pColSchema != NULL && IS_IDX_ON(pColSchema)); pCol->node.resType.type = pColSchema->type; pCol->node.resType.bytes = pColSchema->bytes; - pCol->node.resType.precision = pProbeTable->pMeta->tableInfo.precision; + pCol->node.resType.precision = pProbeTable->pMeta->tableInfo.precision; SNode* pFunc = (SNode*)createGroupKeyAggFunc(pCol); @@ -841,7 +841,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, pAgg->isGroupTb = pAgg->pGroupKeys ? keysHasTbname(pAgg->pGroupKeys) : 0; pAgg->isPartTb = pSelect->pPartitionByList ? keysHasTbname(pSelect->pPartitionByList) : 0; pAgg->hasGroup = pAgg->pGroupKeys || pSelect->pPartitionByList; - + if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pAgg; } else { @@ -1708,6 +1708,7 @@ static int32_t getMsgType(ENodeType sqlType) { switch (sqlType) { case QUERY_NODE_CREATE_TABLE_STMT: case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + case QUERY_NODE_CREATE_SUBTABLE_FROM_FILE_CLAUSE: return TDMT_VND_CREATE_TABLE; case QUERY_NODE_DROP_TABLE_STMT: return TDMT_VND_DROP_TABLE; From cfda747613ec9f50e18bf29c96a32d81da893242 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Thu, 11 Jul 2024 21:00:08 +0800 Subject: [PATCH 18/40] fix: match cache release --- source/libs/scalar/src/filter.c | 6 +- source/libs/scalar/src/scalar.c | 4 +- source/libs/scalar/src/sclvector.c | 9 +- source/util/src/tcompare.c | 150 +++++++++++++++-------------- tests/system-test/2-query/match.py | 17 +--- 5 files changed, 93 insertions(+), 93 deletions(-) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 72e38c7a0d..0a59cd2219 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -3217,6 +3217,7 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, SColumnInfoData *pRes continue; } + terrno = TSDB_CODE_SUCCESS; void *colData = colDataGetData((SColumnInfoData *)info->cunits[uidx].colData, i); // match/nmatch for nchar type need convert from ucs4 to mbs if (info->cunits[uidx].dataType == TSDB_DATA_TYPE_NCHAR && @@ -3235,6 +3236,7 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, SColumnInfoData *pRes p[i] = filterDoCompare(gDataCompare[info->cunits[uidx].func], info->cunits[uidx].optr, colData, info->cunits[uidx].valData); } + if (terrno != TSDB_CODE_SUCCESS) break; if (p[i] == 0) { all = false; @@ -3358,8 +3360,9 @@ int32_t filterSetExecFunc(SFilterInfo *info) { return TSDB_CODE_SUCCESS; } + terrno = TSDB_CODE_SUCCESS; info->func = filterExecuteImplMisc; - return TSDB_CODE_SUCCESS; + return terrno; } int32_t filterPreprocess(SFilterInfo *info) { @@ -4744,6 +4747,7 @@ int32_t filterExecute(SFilterInfo *info, SSDataBlock *pSrc, SColumnInfoData **p, } bool keepAll = (*info->func)(info, pSrc->info.rows, *p, statis, numOfCols, &output.numOfQualified); + if (terrno != TSDB_CODE_SUCCESS) return terrno; // todo this should be return during filter procedure if (keepAll) { diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index 50de5e760d..f9b9f3bcdb 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -1650,8 +1650,8 @@ static int32_t sclGetCompOperatorResType(SOperatorNode *pOp) { return TSDB_CODE_TSC_INVALID_OPERATION; } SDataType rdt = ((SExprNode *)(pOp->pRight))->resType; - if (ldt.type == TSDB_DATA_TYPE_VARBINARY || !IS_VAR_DATA_TYPE(ldt.type) || QUERY_NODE_VALUE != nodeType(pOp->pRight) || - (!IS_STR_DATA_TYPE(rdt.type) && (rdt.type != TSDB_DATA_TYPE_NULL))) { + if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || + (rdt.type != TSDB_DATA_TYPE_NCHAR && rdt.type != TSDB_DATA_TYPE_VARCHAR && rdt.type != TSDB_DATA_TYPE_NULL)) { return TSDB_CODE_TSC_INVALID_OPERATION; } } diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index 673919b2f5..39c6a0cd67 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -1667,7 +1667,6 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa } } else { for (int32_t i = startIndex; i < numOfRows && i >= 0; i += step) { - if (terrno != TSDB_CODE_SUCCESS) break; int32_t leftIndex = (i >= pLeft->numOfRows) ? 0 : i; int32_t rightIndex = (i >= pRight->numOfRows) ? 0 : i; @@ -1676,11 +1675,11 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa pRes[i] = false; continue; } - char *pLeftData = colDataGetData(pLeft->columnData, leftIndex); char *pRightData = colDataGetData(pRight->columnData, rightIndex); - + terrno = TSDB_CODE_SUCCESS; pRes[i] = filterDoCompare(fp, optr, pLeftData, pRightData); + if (terrno != TSDB_CODE_SUCCESS) break; if (pRes[i]) { ++num; } @@ -1689,7 +1688,6 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa } else { // if (GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_JSON || GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_JSON) { for (int32_t i = startIndex; i < numOfRows && i >= startIndex; i += step) { - if (terrno != TSDB_CODE_SUCCESS) break; int32_t leftIndex = (i >= pLeft->numOfRows) ? 0 : i; int32_t rightIndex = (i >= pRight->numOfRows) ? 0 : i; @@ -1716,7 +1714,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa if (!pLeftData || !pRightData) { result = false; } - + terrno = TSDB_CODE_SUCCESS; if (!result) { colDataSetInt8(pOut->columnData, i, (int8_t *)&result); } else { @@ -1726,6 +1724,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa ++num; } } + if (terrno != TSDB_CODE_SUCCESS) break; if (freeLeft) { taosMemoryFreeClear(pLeftData); diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index fde07b4ba8..ebc6f860a4 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -24,6 +24,7 @@ #include "tutil.h" #include "types.h" #include "osString.h" +#include "ttimer.h" int32_t setChkInBytes1(const void *pLeft, const void *pRight) { return NULL != taosHashGet((SHashObj *)pRight, pLeft, 1) ? 1 : 0; @@ -1205,77 +1206,87 @@ int32_t comparestrRegexNMatch(const void *pLeft, const void *pRight) { typedef struct UsingRegex { regex_t pRegex; - int32_t usingCount; int32_t lastUsedTime; } UsingRegex; typedef struct RegexCache { SHashObj *regexHash; int32_t regexCaheSize; - TdThreadRwlock regexLock; + void *regexCacheTimer; + void *timer; int32_t lastClearTime; } RegexCache; static RegexCache sRegexCache; #define MAX_REGEX_CACHE_SIZE 20 #define REGEX_CACHE_CLEAR_TIME 30 -int32_t InitRegexCache() { - if (taosThreadRwlockInit(&sRegexCache.regexLock, NULL) != 0) { - uError("failed to create RegexCache lock"); - return -1; - } - sRegexCache.regexHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); - if (sRegexCache.regexHash == NULL) { - uError("failed to create RegexCache"); - return -1; - } - sRegexCache.regexCaheSize = MAX_REGEX_CACHE_SIZE; - sRegexCache.lastClearTime = taosGetTimestampSec(); - return 0; -} - -void DestroyRegexCache(){ - UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); - while ((ppUsingRegex != NULL)) { - regfree(&(*ppUsingRegex)->pRegex); - taosMemoryFree(*ppUsingRegex); - ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); - } - taosHashCleanup(sRegexCache.regexHash); - taosThreadRwlockDestroy(&sRegexCache.regexLock); -} - -static void clearOlderRegex() { +static void checkRegexCache(void* param, void* tmrId) { if (taosGetTimestampSec() - sRegexCache.lastClearTime < REGEX_CACHE_CLEAR_TIME || taosHashGetSize(sRegexCache.regexHash) < sRegexCache.regexCaheSize) { return; } - taosThreadRwlockWrlock(&sRegexCache.regexLock); + if (taosHashGetSize(sRegexCache.regexHash) >= sRegexCache.regexCaheSize) { UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); while ((ppUsingRegex != NULL)) { - if ((*ppUsingRegex)->usingCount == 0 && - taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { - regfree(&(*ppUsingRegex)->pRegex); - taosMemoryFree(*ppUsingRegex); + if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { taosHashRelease(sRegexCache.regexHash, ppUsingRegex); sRegexCache.lastClearTime = taosGetTimestampSec(); } ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } } - taosThreadRwlockUnlock(&sRegexCache.regexLock); + + taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, NULL, &tmrId); } -static UsingRegex *getRegComp(const char *pPattern) { - taosThreadRwlockRdlock(&sRegexCache.regexLock); - UsingRegex **ppUsingRegex = (UsingRegex **)taosHashGet(sRegexCache.regexHash, pPattern, strlen(pPattern)); - if (ppUsingRegex != NULL) { - (*ppUsingRegex)->usingCount++; - taosThreadRwlockUnlock(&sRegexCache.regexLock); - return *ppUsingRegex; +void regexCacheFree(void *ppUsingRegex) { + regfree(&(*(UsingRegex **)ppUsingRegex)->pRegex); + taosMemoryFree(*(UsingRegex **)ppUsingRegex); +} + +int32_t InitRegexCache() { + sRegexCache.regexHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); + if (sRegexCache.regexHash == NULL) { + uError("failed to create RegexCache"); + return -1; + } + taosHashSetFreeFp(sRegexCache.regexHash, regexCacheFree); + sRegexCache.regexCaheSize = MAX_REGEX_CACHE_SIZE; + sRegexCache.lastClearTime = taosGetTimestampSec(); + + sRegexCache.regexCacheTimer = taosTmrInit(0, 0, 0, "REGEXCACHE"); + if (sRegexCache.regexCacheTimer == NULL) { + uError("failed to create regex cache check timer"); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + + sRegexCache.timer = taosTmrStart(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, NULL, sRegexCache.regexCacheTimer); + if (sRegexCache.timer == NULL) { + uError("failed to start regex cache timer"); + return -1; + } + + return 0; +} + +void DestroyRegexCache(){ + UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); + taosTmrStopA(&sRegexCache.timer); + while ((ppUsingRegex != NULL)) { + regexCacheFree(ppUsingRegex); + ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); + } + taosHashCleanup(sRegexCache.regexHash); +} + +static UsingRegex **getRegComp(const char *pPattern) { + UsingRegex **ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); + if (ppUsingRegex != NULL) { + (*ppUsingRegex)->lastUsedTime = taosGetTimestampSec(); + return ppUsingRegex; } - taosThreadRwlockUnlock(&sRegexCache.regexLock); UsingRegex *pUsingRegex = taosMemoryMalloc(sizeof(UsingRegex)); if (pUsingRegex == NULL) { @@ -1294,54 +1305,49 @@ static UsingRegex *getRegComp(const char *pPattern) { return NULL; } - taosThreadRwlockWrlock(&sRegexCache.regexLock); - int code = taosHashPut(sRegexCache.regexHash, pPattern, strlen(pPattern), &pUsingRegex, sizeof(UsingRegex *)); - if (code != 0) { - if( terrno == TSDB_CODE_DUP_KEY) { - regfree(&pUsingRegex->pRegex); - taosMemoryFree(pUsingRegex); - - UsingRegex **ppUsingRegex = (UsingRegex **)taosHashGet(sRegexCache.regexHash, pPattern, strlen(pPattern)); - if(ppUsingRegex) { - pUsingRegex = (*ppUsingRegex); + while (true) { + int code = taosHashPut(sRegexCache.regexHash, pPattern, strlen(pPattern), &pUsingRegex, sizeof(UsingRegex *)); + if (code != 0) { + if (terrno == TSDB_CODE_DUP_KEY) { + ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); + if (ppUsingRegex) { + if (*ppUsingRegex != pUsingRegex) { + regexCacheFree(&pUsingRegex); + } + pUsingRegex = (*ppUsingRegex); + break; + } else { + continue; + } } else { - uError("Failed to get regex pattern %s from cache, exception internal error.", pPattern); - taosThreadRwlockUnlock(&sRegexCache.regexLock); - terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; - return NULL; - } - } else { + regexCacheFree(&pUsingRegex); uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); - taosThreadRwlockUnlock(&sRegexCache.regexLock); terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; return NULL; + } } } - atomic_add_fetch_32(&pUsingRegex->usingCount, 1); - taosThreadRwlockUnlock(&sRegexCache.regexLock); - - clearOlderRegex(); - return pUsingRegex; + pUsingRegex->lastUsedTime = taosGetTimestampSec(); + return ppUsingRegex; } -void recycleRegex(UsingRegex *regex){ - atomic_add_fetch_32(®ex->usingCount, -1); - regex->lastUsedTime = taosGetTimestampSec(); +void releaseRegComp(UsingRegex **regex){ + taosHashRelease(sRegexCache.regexHash, regex); } static int32_t doExecRegexMatch(const char *pString, const char *pPattern) { int32_t ret = 0; char msgbuf[256] = {0}; - UsingRegex *pUsingRegex = getRegComp(pPattern); + UsingRegex **pUsingRegex = getRegComp(pPattern); if (pUsingRegex == NULL) { return 1; } regmatch_t pmatch[1]; - ret = regexec(&pUsingRegex->pRegex, pString, 1, pmatch, 0); - recycleRegex(pUsingRegex); + ret = regexec(&(*pUsingRegex)->pRegex, pString, 1, pmatch, 0); + releaseRegComp(pUsingRegex); if (ret != 0 && ret != REG_NOMATCH) { - regerror(ret, &pUsingRegex->pRegex, msgbuf, sizeof(msgbuf)); + regerror(ret, &(*pUsingRegex)->pRegex, msgbuf, sizeof(msgbuf)); uDebug("Failed to match %s with pattern %s, reason %s", pString, pPattern, msgbuf) } diff --git a/tests/system-test/2-query/match.py b/tests/system-test/2-query/match.py index 2e47f079e2..62de846cb7 100644 --- a/tests/system-test/2-query/match.py +++ b/tests/system-test/2-query/match.py @@ -38,18 +38,6 @@ class TDTestCase: def stopTest(self): tdSql.execute("drop database if exists db") - def insertData(self, threadID): - cursor = self.conn.cursor() - print("Thread %d: starting" % threadID) - base = 200000 * threadID - for i in range(200): - query = "insert into tb values" - for j in range(1000): - query += "(%d, %d, 'test')" % (self.ts + base + i * 1000 + j, base + i * 1000 + j) - cursor.execute(query) - cursor.close() - print("Thread %d: finishing" % threadID) - def threadTest(self, threadID): print(f"Thread {threadID} starting...") tdsqln = tdCom.newTdSql() @@ -68,6 +56,8 @@ class TDTestCase: tdsqln.query("select * from db.t1x where c1 match '%__c'") tdsqln.checkRows(0) + + tdsqln.error("select * from db.t1x where c1 match '*d'") print(f"Thread {threadID} finished.") @@ -91,7 +81,7 @@ class TDTestCase: tdSql.query("select * from db.t1x where c1 match '%__c'") tdSql.checkRows(0) - + tdSql.error("select * from db.t1x where c1 match '*d'") threads = [] for i in range(10): t = threading.Thread(target=self.threadTest, args=(i,)) @@ -122,6 +112,7 @@ class TDTestCase: tdSql.checkRows(2) tdSql.query("select * from db.t3x where c1 match '中文'") tdSql.checkRows(5) + tdSql.error("select * from db.t1x where c1 match '*d'") for thread in threads: print(f"Thread waitting for finish...") From c25bc3f2ca84ea03867684bf2a62e44c170fced9 Mon Sep 17 00:00:00 2001 From: sima Date: Thu, 11 Jul 2024 11:41:06 +0800 Subject: [PATCH 19/40] fix:[TS-5150] Fix stddev wrong result with null type. --- source/libs/function/src/builtinsimpl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index d5117e0eec..aab5a52776 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1441,6 +1441,9 @@ _stddev_over: } static void stddevTransferInfo(SStddevRes* pInput, SStddevRes* pOutput) { + if (IS_NULL_TYPE(pInput->type)) { + return; + } pOutput->type = pInput->type; if (IS_SIGNED_NUMERIC_TYPE(pOutput->type)) { pOutput->quadraticISum += pInput->quadraticISum; From d5eb7202f3b933f29e373e5503b29bf6e38b67ea Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Fri, 12 Jul 2024 02:54:59 +0000 Subject: [PATCH 20/40] fix compile error --- source/libs/transport/src/thttp.c | 115 +++++++++++++++++------------- 1 file changed, 64 insertions(+), 51 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 32f3bcea36..05928804b3 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -76,8 +76,8 @@ static void httpHandleReq(SHttpMsg* msg); static void httpHandleQuit(SHttpMsg* msg); static int32_t httpSendQuit(SHttpModule* http, int64_t chanId); -static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, - EHttpCompFlag flag, int64_t chanId); +static int32_t httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId, SHttpMsg** httpMsg); static void httpDestroyMsg(SHttpMsg* msg); static bool httpFailFastShoudIgnoreMsg(SHashObj* pTable, char* server, int16_t port); @@ -90,35 +90,44 @@ static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, int32_t contLen, EHttpCompFlag flag, int64_t chanId); static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t contLen, char* pHead, int32_t headLen, - EHttpCompFlag flag) { + + EHttpCompFlag flag) { + int32_t code = 0; + int32_t len = 0; if (flag == HTTP_FLAT) { - return snprintf(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); + if (len < 0 || len >= headLen) { + code = TSDB_CODE_OUT_OF_RANGE; + } } else if (flag == HTTP_GZIP) { - return snprintf(pHead, headLen, + len = snprintf(pHead, headLen, "POST %s HTTP/1.1\n" "Host: %s\n" "Content-Type: application/json\n" "Content-Encoding: gzip\n" "Content-Length: %d\n\n", uri, server, contLen); + if (len < 0 || len >= headLen) { + code = TSDB_CODE_OUT_OF_RANGE; + } } else { - terrno = TSDB_CODE_INVALID_CFG; - return terrno; + return TSDB_CODE_INVALID_PARA; } + return 0; } static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) { - int32_t code = -1; + int32_t code = 0; int32_t destLen = srcLen; void* pDest = taosMemoryMalloc(destLen); if (pDest == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code= TSDB_CODE_OUT_OF_MEMORY; goto _OVER; } @@ -127,7 +136,7 @@ static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) { gzipStream.zfree = (free_func)0; gzipStream.opaque = (voidpf)0; if (deflateInit2(&gzipStream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, MAX_WBITS + 16, 8, Z_DEFAULT_STRATEGY) != Z_OK) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto _OVER; } @@ -138,13 +147,13 @@ static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) { while (gzipStream.avail_in != 0 && gzipStream.total_out < (uLong)(destLen)) { if (deflate(&gzipStream, Z_FULL_FLUSH) != Z_OK) { - terrno = TSDB_CODE_COMPRESS_ERROR; + code = TSDB_CODE_COMPRESS_ERROR; goto _OVER; } } if (gzipStream.avail_in != 0) { - terrno = TSDB_CODE_COMPRESS_ERROR; + code = TSDB_CODE_COMPRESS_ERROR; goto _OVER; } @@ -154,18 +163,18 @@ static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) { break; } if (err != Z_OK) { - terrno = TSDB_CODE_COMPRESS_ERROR; + code = TSDB_CODE_COMPRESS_ERROR; goto _OVER; } } if (deflateEnd(&gzipStream) != Z_OK) { - terrno = TSDB_CODE_COMPRESS_ERROR; + code = TSDB_CODE_COMPRESS_ERROR; goto _OVER; } if (gzipStream.total_out >= srcLen) { - terrno = TSDB_CODE_COMPRESS_ERROR; + code = TSDB_CODE_COMPRESS_ERROR; goto _OVER; } @@ -175,10 +184,7 @@ _OVER: if (code == 0) { memcpy(pSrc, pDest, gzipStream.total_out); code = gzipStream.total_out; - } else { - code = terrno; - } - + } taosMemoryFree(pDest); return code; } @@ -206,24 +212,24 @@ static void* httpThread(void* arg) { return NULL; } -static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, - EHttpCompFlag flag, int64_t chanId) { +static int32_t httpCreateMsg(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, + EHttpCompFlag flag, int64_t chanId, SHttpMsg** httpMsg) { if (server == NULL || uri == NULL) { tError("http-report failed to report to invalid addr, chanId:%" PRId64 "", chanId); - terrno = TSDB_CODE_INVALID_PARA; - return NULL; + *httpMsg = NULL; + return TSDB_CODE_INVALID_PARA; } if (pCont == NULL || contLen == 0) { tError("http-report failed to report empty packet, chanId:%" PRId64 "", chanId); - terrno = TSDB_CODE_INVALID_PARA; - return NULL; + *httpMsg = NULL; + return TSDB_CODE_INVALID_PARA; } SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg)); if (msg == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return NULL; + *httpMsg = NULL; + return TSDB_CODE_OUT_OF_MEMORY; } msg->port = port; @@ -232,8 +238,8 @@ static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t por msg->cont = taosMemoryMalloc(contLen); if (msg->server == NULL || msg->uri == NULL || msg->cont == NULL) { httpDestroyMsg(msg); - terrno = TSDB_CODE_OUT_OF_MEMORY; - return NULL; + *httpMsg = NULL; + return TSDB_CODE_OUT_OF_MEMORY; } memcpy(msg->cont, pCont, contLen); @@ -241,7 +247,8 @@ static SHttpMsg* httpCreateMsg(const char* server, const char* uri, uint16_t por msg->flag = flag; msg->quit = 0; msg->chanId = chanId; - return msg; + *httpMsg = msg; + return 0; } static void httpDestroyMsg(SHttpMsg* msg) { if (msg == NULL) return; @@ -477,10 +484,11 @@ static void httpHandleReq(SHttpMsg* msg) { int64_t chanId = msg->chanId; int32_t ignore = false; char* header = NULL; - terrno = 0; + int32_t code = 0; SHttpModule* http = taosAcquireRef(httpRefMgt, chanId); if (http == NULL) { + code = terrno; goto END; } if (httpFailFastShoudIgnoreMsg(http->connStatusTable, msg->server, msg->port)) { @@ -500,6 +508,7 @@ static void httpHandleReq(SHttpMsg* msg) { msg->flag = HTTP_FLAT; } if (dstLen < 0) { + code = dstLen; goto END; } } @@ -507,18 +516,19 @@ static void httpHandleReq(SHttpMsg* msg) { int32_t cap = 2048; header = taosMemoryCalloc(1, cap); if (header == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto END; } int32_t headLen = taosBuildHttpHeader(msg->server, msg->uri, msg->len, header, cap, msg->flag); - if (headLen < 0 || headLen >= cap) { + if (headLen < 0) { + code = headLen; goto END; } uv_buf_t* wb = taosMemoryCalloc(2, sizeof(uv_buf_t)); if (wb == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto END; } @@ -528,7 +538,7 @@ static void httpHandleReq(SHttpMsg* msg) { SHttpClient* cli = taosMemoryCalloc(1, sizeof(SHttpClient)); if (cli == NULL) { taosMemoryFree(wb); - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto END; } @@ -593,9 +603,8 @@ static void httpHandleReq(SHttpMsg* msg) { END: if (ignore == false) { tError("http-report failed to report to addr: %s:%d, chanId:%" PRId64 ", reason:%s", msg->server, msg->port, chanId, - tstrerror(terrno)); + tstrerror(code)); } - terrno = 0; httpDestroyMsg(msg); taosMemoryFree(header); taosReleaseRef(httpRefMgt, chanId); @@ -625,26 +634,27 @@ void httpModuleDestroy2(SHttpModule* http) { static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag, int64_t chanId) { - int32_t ret = 0; SHttpModule* load = NULL; - SHttpMsg* msg = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId); - if (msg == NULL) { + SHttpMsg *msg = NULL; + int32_t code = httpCreateMsg(server, uri, port, pCont, contLen, flag, chanId,&msg); + if (code != 0) { goto _ERROR; } load = taosAcquireRef(httpRefMgt, chanId); if (load == NULL) { + code = terrno; goto _ERROR; } if (atomic_load_8(&load->quit)) { - terrno = TSDB_CODE_HTTP_MODULE_QUIT; + code = TSDB_CODE_HTTP_MODULE_QUIT; goto _ERROR; } - ret = transAsyncSend(load->asyncPool, &(msg->q)); - if (ret < 0) { - terrno = TSDB_CODE_HTTP_MODULE_QUIT; + code = transAsyncSend(load->asyncPool, &(msg->q)); + if (code != 0) { + code = TSDB_CODE_HTTP_MODULE_QUIT; goto _ERROR; } msg = NULL; @@ -652,7 +662,7 @@ static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri, _ERROR: httpDestroyMsg(msg); if (load != NULL) taosReleaseRef(httpRefMgt, chanId); - return ret = terrno; + return code; } int32_t taosSendHttpReportByChan(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, @@ -682,33 +692,35 @@ void transHttpEnvDestroy() { } int64_t transInitHttpChanImpl() { + int32_t code = 0; SHttpModule* http = taosMemoryCalloc(1, sizeof(SHttpModule)); if (http == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto _ERROR; } http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); if (http->connStatusTable == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto _ERROR; } http->loop = taosMemoryMalloc(sizeof(uv_loop_t)); if (http->loop == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; goto _ERROR; } int err = uv_loop_init(http->loop); if (err != 0) { tError("http-report failed init uv, reason:%s", uv_strerror(err)); - terrno = TSDB_CODE_THIRDPARTY_ERROR; + code = TSDB_CODE_THIRDPARTY_ERROR; goto _ERROR; } http->asyncPool = transAsyncPoolCreate(http->loop, 1, http, httpAsyncCb); if (http->asyncPool == NULL) { + code = terrno; goto _ERROR; } @@ -716,7 +728,7 @@ int64_t transInitHttpChanImpl() { err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http); if (err != 0) { - terrno = TAOS_SYSTEM_ERROR(errno); + code = TAOS_SYSTEM_ERROR(errno); goto _ERROR; } @@ -728,7 +740,7 @@ int64_t transInitHttpChanImpl() { _ERROR: httpModuleDestroy2(http); - return terrno; + return code; } int64_t taosInitHttpChan() { taosThreadOnce(&transHttpInit, transHttpEnvInit); @@ -742,6 +754,7 @@ void taosDestroyHttpChan(int64_t chanId) { SHttpModule* load = taosAcquireRef(httpRefMgt, chanId); if (load == NULL) { tError("http-report failed to destroy chanId %" PRId64 ", reason:%s", chanId, tstrerror(terrno)); + ret = terrno; return; } From 0d7bd8e3af28c0480957592202355f70da199838 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Fri, 12 Jul 2024 03:01:19 +0000 Subject: [PATCH 21/40] fix compile error --- source/libs/transport/src/thttp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 05928804b3..ba12774c18 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -116,9 +116,9 @@ static int32_t taosBuildHttpHeader(const char* server, const char* uri, int32_t code = TSDB_CODE_OUT_OF_RANGE; } } else { - return TSDB_CODE_INVALID_PARA; + code = TSDB_CODE_INVALID_PARA; } - return 0; + return code; } static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) { From 57f826608a5cf2848cb57e6554b0d4ddf542b78e Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Fri, 12 Jul 2024 11:48:48 +0800 Subject: [PATCH 22/40] checkout regex pattern at client --- include/libs/nodes/querynodes.h | 1 + include/util/tcompare.h | 1 + source/libs/nodes/src/nodesUtilFuncs.c | 11 ++++++++ source/libs/scalar/src/filter.c | 6 +--- source/libs/scalar/src/scalar.c | 6 ++++ source/libs/scalar/src/sclvector.c | 4 --- source/util/src/tcompare.c | 38 ++++++++++++++------------ tests/system-test/2-query/match.py | 1 + 8 files changed, 42 insertions(+), 26 deletions(-) diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 34b42fd9e1..0c4c7819ab 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -618,6 +618,7 @@ bool nodesIsArithmeticOp(const SOperatorNode* pOp); bool nodesIsComparisonOp(const SOperatorNode* pOp); bool nodesIsJsonOp(const SOperatorNode* pOp); bool nodesIsRegularOp(const SOperatorNode* pOp); +bool nodesIsMatchRegularOp(const SOperatorNode* pOp); bool nodesIsBitwiseOp(const SOperatorNode* pOp); bool nodesExprHasColumn(SNode* pNode); diff --git a/include/util/tcompare.h b/include/util/tcompare.h index 4f574a9b79..80f992f646 100644 --- a/include/util/tcompare.h +++ b/include/util/tcompare.h @@ -48,6 +48,7 @@ typedef struct SPatternCompareInfo { int32_t InitRegexCache(); void DestroyRegexCache(); int32_t patternMatch(const char *pattern, size_t psize, const char *str, size_t ssize, const SPatternCompareInfo *pInfo); +int32_t checkRegexPattern(const char *pPattern); int32_t wcsPatternMatch(const TdUcs4 *pattern, size_t psize, const TdUcs4 *str, size_t ssize, const SPatternCompareInfo *pInfo); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index f118c15b7a..5ec8adafe9 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -2205,6 +2205,17 @@ bool nodesIsRegularOp(const SOperatorNode* pOp) { return false; } +bool nodesIsMatchRegularOp(const SOperatorNode* pOp) { + switch (pOp->opType) { + case OP_TYPE_MATCH: + case OP_TYPE_NMATCH: + return true; + default: + break; + } + return false; +} + bool nodesIsBitwiseOp(const SOperatorNode* pOp) { switch (pOp->opType) { case OP_TYPE_BIT_AND: diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 0a59cd2219..72e38c7a0d 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -3217,7 +3217,6 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, SColumnInfoData *pRes continue; } - terrno = TSDB_CODE_SUCCESS; void *colData = colDataGetData((SColumnInfoData *)info->cunits[uidx].colData, i); // match/nmatch for nchar type need convert from ucs4 to mbs if (info->cunits[uidx].dataType == TSDB_DATA_TYPE_NCHAR && @@ -3236,7 +3235,6 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, SColumnInfoData *pRes p[i] = filterDoCompare(gDataCompare[info->cunits[uidx].func], info->cunits[uidx].optr, colData, info->cunits[uidx].valData); } - if (terrno != TSDB_CODE_SUCCESS) break; if (p[i] == 0) { all = false; @@ -3360,9 +3358,8 @@ int32_t filterSetExecFunc(SFilterInfo *info) { return TSDB_CODE_SUCCESS; } - terrno = TSDB_CODE_SUCCESS; info->func = filterExecuteImplMisc; - return terrno; + return TSDB_CODE_SUCCESS; } int32_t filterPreprocess(SFilterInfo *info) { @@ -4747,7 +4744,6 @@ int32_t filterExecute(SFilterInfo *info, SSDataBlock *pSrc, SColumnInfoData **p, } bool keepAll = (*info->func)(info, pSrc->info.rows, *p, statis, numOfCols, &output.numOfQualified); - if (terrno != TSDB_CODE_SUCCESS) return terrno; // todo this should be return during filter procedure if (keepAll) { diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index f9b9f3bcdb..8d1f8dd9b1 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -1654,6 +1654,12 @@ static int32_t sclGetCompOperatorResType(SOperatorNode *pOp) { (rdt.type != TSDB_DATA_TYPE_NCHAR && rdt.type != TSDB_DATA_TYPE_VARCHAR && rdt.type != TSDB_DATA_TYPE_NULL)) { return TSDB_CODE_TSC_INVALID_OPERATION; } + if (nodesIsMatchRegularOp(pOp)) { + SValueNode* node = (SValueNode*)(pOp->pRight); + if(checkRegexPattern(node->literal) != TSDB_CODE_SUCCESS){ + return TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR; + } + } } pOp->node.resType.type = TSDB_DATA_TYPE_BOOL; pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes; diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index 39c6a0cd67..16c06c2452 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -1677,9 +1677,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa } char *pLeftData = colDataGetData(pLeft->columnData, leftIndex); char *pRightData = colDataGetData(pRight->columnData, rightIndex); - terrno = TSDB_CODE_SUCCESS; pRes[i] = filterDoCompare(fp, optr, pLeftData, pRightData); - if (terrno != TSDB_CODE_SUCCESS) break; if (pRes[i]) { ++num; } @@ -1714,7 +1712,6 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa if (!pLeftData || !pRightData) { result = false; } - terrno = TSDB_CODE_SUCCESS; if (!result) { colDataSetInt8(pOut->columnData, i, (int8_t *)&result); } else { @@ -1724,7 +1721,6 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa ++num; } } - if (terrno != TSDB_CODE_SUCCESS) break; if (freeLeft) { taosMemoryFreeClear(pLeftData); diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index ebc6f860a4..4c4e859480 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1211,27 +1211,23 @@ typedef struct UsingRegex { typedef struct RegexCache { SHashObj *regexHash; - int32_t regexCaheSize; void *regexCacheTimer; void *timer; - int32_t lastClearTime; } RegexCache; static RegexCache sRegexCache; #define MAX_REGEX_CACHE_SIZE 20 #define REGEX_CACHE_CLEAR_TIME 30 static void checkRegexCache(void* param, void* tmrId) { - if (taosGetTimestampSec() - sRegexCache.lastClearTime < REGEX_CACHE_CLEAR_TIME || - taosHashGetSize(sRegexCache.regexHash) < sRegexCache.regexCaheSize) { + if (taosHashGetSize(sRegexCache.regexHash) < MAX_REGEX_CACHE_SIZE) { return; } - if (taosHashGetSize(sRegexCache.regexHash) >= sRegexCache.regexCaheSize) { + if (taosHashGetSize(sRegexCache.regexHash) >= MAX_REGEX_CACHE_SIZE) { UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); while ((ppUsingRegex != NULL)) { if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { taosHashRelease(sRegexCache.regexHash, ppUsingRegex); - sRegexCache.lastClearTime = taosGetTimestampSec(); } ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } @@ -1252,9 +1248,6 @@ int32_t InitRegexCache() { return -1; } taosHashSetFreeFp(sRegexCache.regexHash, regexCacheFree); - sRegexCache.regexCaheSize = MAX_REGEX_CACHE_SIZE; - sRegexCache.lastClearTime = taosGetTimestampSec(); - sRegexCache.regexCacheTimer = taosTmrInit(0, 0, 0, "REGEXCACHE"); if (sRegexCache.regexCacheTimer == NULL) { uError("failed to create regex cache check timer"); @@ -1272,15 +1265,28 @@ int32_t InitRegexCache() { } void DestroyRegexCache(){ - UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); taosTmrStopA(&sRegexCache.timer); - while ((ppUsingRegex != NULL)) { - regexCacheFree(ppUsingRegex); - ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); - } taosHashCleanup(sRegexCache.regexHash); } +int32_t checkRegexPattern(const char *pPattern) { + if (pPattern == NULL) { + return TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR; + } + + regex_t regex; + int32_t cflags = REG_EXTENDED; + int32_t ret = regcomp(®ex, pPattern, cflags); + if (ret != 0) { + char msgbuf[256] = {0}; + regerror(ret, ®ex, msgbuf, tListLen(msgbuf)); + uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf); + return TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR; + } + regfree(®ex); + return TSDB_CODE_SUCCESS; +} + static UsingRegex **getRegComp(const char *pPattern) { UsingRegex **ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); if (ppUsingRegex != NULL) { @@ -1291,7 +1297,6 @@ static UsingRegex **getRegComp(const char *pPattern) { UsingRegex *pUsingRegex = taosMemoryMalloc(sizeof(UsingRegex)); if (pUsingRegex == NULL) { uError("Failed to Malloc when compile regex pattern %s.", pPattern); - terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } int32_t cflags = REG_EXTENDED; @@ -1301,7 +1306,6 @@ static UsingRegex **getRegComp(const char *pPattern) { regerror(ret, &pUsingRegex->pRegex, msgbuf, tListLen(msgbuf)); uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf); taosMemoryFree(pUsingRegex); - terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR; return NULL; } @@ -1309,6 +1313,7 @@ static UsingRegex **getRegComp(const char *pPattern) { int code = taosHashPut(sRegexCache.regexHash, pPattern, strlen(pPattern), &pUsingRegex, sizeof(UsingRegex *)); if (code != 0) { if (terrno == TSDB_CODE_DUP_KEY) { + terrno = TSDB_CODE_SUCCESS; ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); if (ppUsingRegex) { if (*ppUsingRegex != pUsingRegex) { @@ -1322,7 +1327,6 @@ static UsingRegex **getRegComp(const char *pPattern) { } else { regexCacheFree(&pUsingRegex); uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); - terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; return NULL; } } diff --git a/tests/system-test/2-query/match.py b/tests/system-test/2-query/match.py index 62de846cb7..cd2ed5d96b 100644 --- a/tests/system-test/2-query/match.py +++ b/tests/system-test/2-query/match.py @@ -71,6 +71,7 @@ class TDTestCase: tdSql.query(f"select distinct table_name from information_schema.ins_columns where table_name match 't.*{i}x'") tdSql.checkRows(0) + tdSql.error("select * from db.t1x where c1 match '*d'") tdSql.query("insert into db.t1x values(now, 'abc'), (now+1s, 'a%c'),(now+2s, 'a_c'),(now+3s, '_c'),(now+4s, '%c')") tdSql.query("select * from db.t1x") From 2604a17fef44165ec56b2ab83c1425abc8619059 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Fri, 12 Jul 2024 12:04:23 +0800 Subject: [PATCH 23/40] fix: invalid operation --- source/libs/scalar/src/scalar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index 8d1f8dd9b1..a9ee40f8b0 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -1650,8 +1650,8 @@ static int32_t sclGetCompOperatorResType(SOperatorNode *pOp) { return TSDB_CODE_TSC_INVALID_OPERATION; } SDataType rdt = ((SExprNode *)(pOp->pRight))->resType; - if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || - (rdt.type != TSDB_DATA_TYPE_NCHAR && rdt.type != TSDB_DATA_TYPE_VARCHAR && rdt.type != TSDB_DATA_TYPE_NULL)) { + if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || + (rdt.type != TSDB_DATA_TYPE_NCHAR && rdt.type != TSDB_DATA_TYPE_VARCHAR)) { return TSDB_CODE_TSC_INVALID_OPERATION; } if (nodesIsMatchRegularOp(pOp)) { From eed684e0723582540056f36e486978ef8a2c4a80 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Fri, 12 Jul 2024 14:16:55 +0800 Subject: [PATCH 24/40] fix: match check --- source/libs/scalar/src/scalar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index a9ee40f8b0..8f9ea4d36c 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -1650,8 +1650,8 @@ static int32_t sclGetCompOperatorResType(SOperatorNode *pOp) { return TSDB_CODE_TSC_INVALID_OPERATION; } SDataType rdt = ((SExprNode *)(pOp->pRight))->resType; - if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || - (rdt.type != TSDB_DATA_TYPE_NCHAR && rdt.type != TSDB_DATA_TYPE_VARCHAR)) { + if (ldt.type == TSDB_DATA_TYPE_VARBINARY || !IS_VAR_DATA_TYPE(ldt.type) || QUERY_NODE_VALUE != nodeType(pOp->pRight) || + (!IS_STR_DATA_TYPE(rdt.type) && (rdt.type != TSDB_DATA_TYPE_NULL))) { return TSDB_CODE_TSC_INVALID_OPERATION; } if (nodesIsMatchRegularOp(pOp)) { From e527f2fd0b3d5226c9f5d102d2e4d6de71f4afcd Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 12 Jul 2024 15:22:39 +0800 Subject: [PATCH 25/40] fix: validate function return value --- include/util/tarray.h | 2 +- source/client/src/clientHb.c | 3 +- source/common/src/tdatablock.c | 4 +- source/common/src/tmsg.c | 6 +- source/dnode/mnode/impl/src/mndDef.c | 4 +- source/dnode/mnode/impl/src/mndStreamUtil.c | 3 +- source/dnode/vnode/src/tq/tqSink.c | 9 +- source/dnode/vnode/src/tq/tqUtil.c | 12 +- source/dnode/vnode/src/tsdb/tsdbCache.c | 3 +- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 3 +- source/dnode/vnode/src/tsdb/tsdbReadUtil.c | 24 ++- source/libs/executor/src/executil.c | 6 +- source/libs/executor/src/streamfilloperator.c | 3 +- .../executor/src/streamtimewindowoperator.c | 3 +- source/libs/executor/src/timewindowoperator.c | 3 +- source/libs/qworker/inc/qwInt.h | 2 +- source/libs/qworker/src/qwMsg.c | 4 +- source/libs/qworker/src/qwUtil.c | 15 +- source/libs/qworker/src/qworker.c | 140 +++++++++++------- source/libs/stream/src/streamCheckStatus.c | 4 +- source/libs/stream/src/streamMsg.c | 6 +- source/libs/stream/src/streamTask.c | 15 +- source/util/src/tarray.c | 6 +- source/util/src/tconfig.c | 3 +- 24 files changed, 184 insertions(+), 99 deletions(-) diff --git a/include/util/tarray.h b/include/util/tarray.h index e494f78f48..cef09e40f8 100644 --- a/include/util/tarray.h +++ b/include/util/tarray.h @@ -205,7 +205,7 @@ void taosArrayClearEx(SArray* pArray, void (*fp)(void*)); void taosArrayClearP(SArray* pArray, void (*fp)(void*)); -void* taosArrayDestroy(SArray* pArray); +void taosArrayDestroy(SArray* pArray); void taosArrayDestroyP(SArray* pArray, FDelete fp); diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 1b7b9263a5..a7d459ff31 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -1398,7 +1398,8 @@ void hbMgrCleanUp() { taosThreadMutexLock(&clientHbMgr.lock); appHbMgrCleanup(); - clientHbMgr.appHbMgrs = taosArrayDestroy(clientHbMgr.appHbMgrs); + taosArrayDestroy(clientHbMgr.appHbMgrs); + clientHbMgr.appHbMgrs = NULL; taosThreadMutexUnlock(&clientHbMgr.lock); } diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 809721d606..7710dbdb3f 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1512,7 +1512,9 @@ void blockDataFreeRes(SSDataBlock* pBlock) { colDataDestroy(pColInfoData); } - pBlock->pDataBlock = taosArrayDestroy(pBlock->pDataBlock); + taosArrayDestroy(pBlock->pDataBlock); + pBlock->pDataBlock = NULL; + taosMemoryFreeClear(pBlock->pBlockAgg); memset(&pBlock->info, 0, sizeof(SDataBlockInfo)); } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 7e89753241..fa79d16970 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -9505,7 +9505,8 @@ int32_t tDecodeMqDataRsp(SDecoder *pDecoder, void *pRsp) { static void tDeleteMqDataRspCommon(void *rsp) { SMqDataRspCommon *pRsp = rsp; - pRsp->blockDataLen = taosArrayDestroy(pRsp->blockDataLen); + taosArrayDestroy(pRsp->blockDataLen); + pRsp->blockDataLen = NULL; taosArrayDestroyP(pRsp->blockData, (FDelete)taosMemoryFree); pRsp->blockData = NULL; taosArrayDestroyP(pRsp->blockSchema, (FDelete)tDeleteSchemaWrapper); @@ -9558,7 +9559,8 @@ void tDeleteSTaosxRsp(void *rsp) { tDeleteMqDataRspCommon(rsp); STaosxRsp *pRsp = (STaosxRsp *)rsp; - pRsp->createTableLen = taosArrayDestroy(pRsp->createTableLen); + taosArrayDestroy(pRsp->createTableLen); + pRsp->createTableLen = NULL; taosArrayDestroyP(pRsp->createTableReq, (FDelete)taosMemoryFree); pRsp->createTableReq = NULL; } diff --git a/source/dnode/mnode/impl/src/mndDef.c b/source/dnode/mnode/impl/src/mndDef.c index 5164557184..9dc5f920ad 100644 --- a/source/dnode/mnode/impl/src/mndDef.c +++ b/source/dnode/mnode/impl/src/mndDef.c @@ -195,7 +195,9 @@ void *freeStreamTasks(SArray *pTaskLevel) { taosArrayDestroy(pLevel); } - return taosArrayDestroy(pTaskLevel); + taosArrayDestroy(pTaskLevel); + + return NULL; } void tFreeStreamObj(SStreamObj *pStream) { diff --git a/source/dnode/mnode/impl/src/mndStreamUtil.c b/source/dnode/mnode/impl/src/mndStreamUtil.c index c4adbd0fc3..e4e30bdf10 100644 --- a/source/dnode/mnode/impl/src/mndStreamUtil.c +++ b/source/dnode/mnode/impl/src/mndStreamUtil.c @@ -978,7 +978,8 @@ void mndAddConsensusTasks(SCheckpointConsensusInfo *pInfo, const SRestoreCheckpo } void mndClearConsensusRspEntry(SCheckpointConsensusInfo* pInfo) { - pInfo->pTaskList = taosArrayDestroy(pInfo->pTaskList); + taosArrayDestroy(pInfo->pTaskList); + pInfo->pTaskList = NULL; } int64_t mndClearConsensusCheckpointId(SHashObj* pHash, int64_t streamId) { diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index 5f3e1e3d14..1c8f102725 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -249,7 +249,8 @@ static int32_t doBuildAndSendCreateTableMsg(SVnode* pVnode, char* stbFullName, S } tTagNew(tagArray, 1, false, (STag**)&pCreateTbReq->ctb.pTag); - tagArray = taosArrayDestroy(tagArray); + taosArrayDestroy(tagArray); + tagArray = NULL; if (pCreateTbReq->ctb.pTag == NULL) { tdDestroySVCreateTbReq(pCreateTbReq); code = TSDB_CODE_OUT_OF_MEMORY; @@ -505,7 +506,8 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat pTableData->aRowP = taosArrayInit(numOfRows, sizeof(SRow*)); if (pTableData->aRowP == NULL || pVals == NULL) { - pTableData->aRowP = taosArrayDestroy(pTableData->aRowP); + taosArrayDestroy(pTableData->aRowP); + pTableData->aRowP = NULL; taosArrayDestroy(pVals); code = TSDB_CODE_OUT_OF_MEMORY; tqError("s-task:%s failed to prepare write stream res blocks, code:%s", id, tstrerror(code)); @@ -530,7 +532,8 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat if (ts < earlyTs) { tqError("s-task:%s ts:%" PRId64 " of generated results out of valid time range %" PRId64 " , discarded", id, ts, earlyTs); - pTableData->aRowP = taosArrayDestroy(pTableData->aRowP); + taosArrayDestroy(pTableData->aRowP); + pTableData->aRowP = NULL; taosArrayDestroy(pVals); return TSDB_CODE_SUCCESS; } diff --git a/source/dnode/vnode/src/tq/tqUtil.c b/source/dnode/vnode/src/tq/tqUtil.c index 5290c39d42..eb1da51b45 100644 --- a/source/dnode/vnode/src/tq/tqUtil.c +++ b/source/dnode/vnode/src/tq/tqUtil.c @@ -54,19 +54,23 @@ static int32_t tqInitTaosxRsp(SMqDataRspCommon* pRsp, STqOffsetVal pOffset) { if (pRsp->blockData == NULL || pRsp->blockDataLen == NULL || pRsp->blockTbName == NULL || pRsp->blockSchema == NULL) { if (pRsp->blockData != NULL) { - pRsp->blockData = taosArrayDestroy(pRsp->blockData); + taosArrayDestroy(pRsp->blockData); + pRsp->blockData = NULL; } if (pRsp->blockDataLen != NULL) { - pRsp->blockDataLen = taosArrayDestroy(pRsp->blockDataLen); + taosArrayDestroy(pRsp->blockDataLen); + pRsp->blockDataLen = NULL; } if (pRsp->blockTbName != NULL) { - pRsp->blockTbName = taosArrayDestroy(pRsp->blockTbName); + taosArrayDestroy(pRsp->blockTbName); + pRsp->blockTbName = NULL; } if (pRsp->blockSchema != NULL) { - pRsp->blockSchema = taosArrayDestroy(pRsp->blockSchema); + taosArrayDestroy(pRsp->blockSchema); + pRsp->blockSchema = NULL; } return -1; } diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 4597a44845..38dd945b28 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -3187,7 +3187,8 @@ static void clearLastFileSet(SFSNextRowIter *state) { int32_t iter = 0; while ((pe = tSimpleHashIterate(state->pr->pTableMap, pe, &iter)) != NULL) { STableLoadInfo *pInfo = *(STableLoadInfo **)pe; - pInfo->pTombData = taosArrayDestroy(pInfo->pTombData); + taosArrayDestroy(pInfo->pTombData); + pInfo->pTombData = NULL; } } } diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 4d6ebf721e..817468c6b6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -311,7 +311,8 @@ void* tsdbCacherowsReaderClose(void* pReader) { int32_t iter = 0; while ((pe = tSimpleHashIterate(p->pTableMap, pe, &iter)) != NULL) { STableLoadInfo* pInfo = *(STableLoadInfo**)pe; - pInfo->pTombData = taosArrayDestroy(pInfo->pTombData); + taosArrayDestroy(pInfo->pTombData); + pInfo->pTombData = NULL; } tSimpleHashCleanup(p->pTableMap); diff --git a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c index 273ec6d797..4bd9bee050 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c @@ -308,7 +308,8 @@ void resetAllDataBlockScanInfo(SSHashObj* pTableMap, int64_t ts, int32_t step) { pInfo->iiter.iter = tsdbTbDataIterDestroy(pInfo->iiter.iter); } - pInfo->delSkyline = taosArrayDestroy(pInfo->delSkyline); + taosArrayDestroy(pInfo->delSkyline); + pInfo->delSkyline = NULL; pInfo->lastProcKey.ts = ts; // todo check the nextProcKey info pInfo->sttKeyInfo.nextProcKey.ts = ts + step; @@ -329,11 +330,16 @@ void clearBlockScanInfo(STableBlockScanInfo* p) { p->iiter.iter = tsdbTbDataIterDestroy(p->iiter.iter); } - p->delSkyline = taosArrayDestroy(p->delSkyline); - p->pBlockList = taosArrayDestroy(p->pBlockList); - p->pBlockIdxList = taosArrayDestroy(p->pBlockIdxList); - p->pMemDelData = taosArrayDestroy(p->pMemDelData); - p->pFileDelData = taosArrayDestroy(p->pFileDelData); + taosArrayDestroy(p->delSkyline); + p->delSkyline = NULL; + taosArrayDestroy(p->pBlockList); + p->pBlockList = NULL; + taosArrayDestroy(p->pBlockIdxList); + p->pBlockIdxList = NULL; + taosArrayDestroy(p->pMemDelData); + p->pMemDelData = NULL; + taosArrayDestroy(p->pFileDelData); + p->pFileDelData = NULL; clearRowKey(&p->lastProcKey); clearRowKey(&p->sttRange.skey); @@ -579,7 +585,8 @@ int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIter, int3 } taosArrayAddAll(pBlockIter->blockList, pTableScanInfo->pBlockList); - pTableScanInfo->pBlockList = taosArrayDestroy(pTableScanInfo->pBlockList); + taosArrayDestroy(pTableScanInfo->pBlockList); + pTableScanInfo->pBlockList = NULL; int64_t et = taosGetTimestampUs(); tsdbDebug("%p create blocks info struct completed for one table, %d blocks not sorted, elapsed time:%.2f ms %s", @@ -624,7 +631,8 @@ int32_t initBlockIterator(STsdbReader* pReader, SDataBlockIter* pBlockIter, int3 for (int32_t i = 0; i < numOfTables; ++i) { STableBlockScanInfo* pTableScanInfo = taosArrayGetP(pTableList, i); - pTableScanInfo->pBlockList = taosArrayDestroy(pTableScanInfo->pBlockList); + taosArrayDestroy(pTableScanInfo->pBlockList); + pTableScanInfo->pBlockList = NULL; } int64_t et = taosGetTimestampUs(); diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 173ef0b829..c623e94a12 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -96,7 +96,8 @@ void cleanupGroupResInfo(SGroupResInfo* pGroupResInfo) { pGroupResInfo->freeItem = false; pGroupResInfo->pRows = NULL; } else { - pGroupResInfo->pRows = taosArrayDestroy(pGroupResInfo->pRows); + taosArrayDestroy(pGroupResInfo->pRows); + pGroupResInfo->pRows = NULL; } pGroupResInfo->index = 0; } @@ -2102,7 +2103,8 @@ void* tableListDestroy(STableListInfo* pTableListInfo) { return NULL; } - pTableListInfo->pTableList = taosArrayDestroy(pTableListInfo->pTableList); + taosArrayDestroy(pTableListInfo->pTableList); + pTableListInfo->pTableList = NULL; taosMemoryFreeClear(pTableListInfo->groupOffset); taosHashCleanup(pTableListInfo->map); diff --git a/source/libs/executor/src/streamfilloperator.c b/source/libs/executor/src/streamfilloperator.c index c1a38b66ba..5f188c2c8a 100644 --- a/source/libs/executor/src/streamfilloperator.c +++ b/source/libs/executor/src/streamfilloperator.c @@ -129,7 +129,8 @@ static void destroyStreamFillOperatorInfo(void* param) { pInfo->pRes = blockDataDestroy(pInfo->pRes); pInfo->pSrcBlock = blockDataDestroy(pInfo->pSrcBlock); pInfo->pDelRes = blockDataDestroy(pInfo->pDelRes); - pInfo->matchInfo.pList = taosArrayDestroy(pInfo->matchInfo.pList); + taosArrayDestroy(pInfo->matchInfo.pList); + pInfo->matchInfo.pList = NULL; taosMemoryFree(pInfo); } diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index d68108b9a5..d3f90c3134 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -406,7 +406,8 @@ void clearGroupResInfo(SGroupResInfo* pGroupResInfo) { } pGroupResInfo->freeItem = false; } - pGroupResInfo->pRows = taosArrayDestroy(pGroupResInfo->pRows); + taosArrayDestroy(pGroupResInfo->pRows); + pGroupResInfo->pRows = NULL; pGroupResInfo->index = 0; } diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index bad15d1834..23bd2b87a1 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1136,7 +1136,8 @@ void destroyIntervalOperatorInfo(void* param) { tdListFree(pInfo->binfo.resultRowInfo.openWindow); - pInfo->pInterpCols = taosArrayDestroy(pInfo->pInterpCols); + taosArrayDestroy(pInfo->pInterpCols); + pInfo->pInterpCols = NULL; taosArrayDestroyEx(pInfo->pPrevValues, freeItem); pInfo->pPrevValues = NULL; diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 2222f9cb31..dfd00dc5a7 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -391,7 +391,7 @@ void qwReleaseTaskCtx(SQWorker *mgmt, void *ctx); int32_t qwKillTaskHandle(SQWTaskCtx *ctx, int32_t rspCode); int32_t qwUpdateTaskStatus(QW_FPARAMS_DEF, int8_t status, bool dynamicTask); int32_t qwDropTask(QW_FPARAMS_DEF); -void qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx); +int32_t qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx); int32_t qwOpenRef(void); void qwSetHbParam(int64_t refId, SQWHbParam **pParam); int32_t qwUpdateTimeInQueue(SQWorker *mgmt, int64_t ts, EQueueType type); diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index d30b100147..fad4b1efa8 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -495,9 +495,9 @@ int32_t qWorkerProcessCQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in QW_SCH_TASK_DLOG("processCQuery start, node:%p, handle:%p", node, pMsg->info.handle); - QW_ERR_RET(qwProcessCQuery(QW_FPARAMS(), &qwMsg)); + code = qwProcessCQuery(QW_FPARAMS(), &qwMsg); - QW_SCH_TASK_DLOG("processCQuery end, node:%p", node); + QW_SCH_TASK_DLOG("processCQuery end, node:%p, code:0x%x", node, code); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index f00c4aef30..619e2576cd 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -503,14 +503,16 @@ void qwSetHbParam(int64_t refId, SQWHbParam **pParam) { *pParam = &gQwMgmt.param[paramIdx]; } -void qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) { +int32_t qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) { char dbFName[TSDB_DB_FNAME_LEN]; char tbName[TSDB_TABLE_NAME_LEN]; STbVerInfo tbInfo; int32_t i = 0; + int32_t code = TSDB_CODE_SUCCESS; while (true) { - if (qGetQueryTableSchemaVersion(pTaskInfo, dbFName, tbName, &tbInfo.sversion, &tbInfo.tversion, i) < 0) { + code = qGetQueryTableSchemaVersion(pTaskInfo, dbFName, tbName, &tbInfo.sversion, &tbInfo.tversion, i); + if (TSDB_CODE_SUCCESS != code) { break; } @@ -522,12 +524,19 @@ void qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) { if (NULL == ctx->tbInfo) { ctx->tbInfo = taosArrayInit(1, sizeof(tbInfo)); + if (NULL == ctx->tbInfo) { + QW_ERR_RET(terrno); + } } - taosArrayPush(ctx->tbInfo, &tbInfo); + if (NULL == taosArrayPush(ctx->tbInfo, &tbInfo)) { + QW_ERR_RET(terrno); + } i++; } + + QW_RET(code); } void qwCloseRef(void) { diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index c2cd07e9ed..8ab095bc32 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -18,10 +18,11 @@ SQWorkerMgmt gQwMgmt = { .qwNum = 0, }; -int32_t qwStopAllTasks(SQWorker *mgmt) { +void qwStopAllTasks(SQWorker *mgmt) { uint64_t qId, tId, sId; int32_t eId; int64_t rId = 0; + int32_t code = TSDB_CODE_SUCCESS; void *pIter = taosHashIterate(mgmt->ctxHash, NULL); while (pIter) { @@ -44,22 +45,29 @@ int32_t qwStopAllTasks(SQWorker *mgmt) { } if (QW_QUERY_RUNNING(ctx)) { - qwKillTaskHandle(ctx, TSDB_CODE_VND_STOPPED); - QW_TASK_DLOG_E("task running, async killed"); + code = qwKillTaskHandle(ctx, TSDB_CODE_VND_STOPPED); + if (TSDB_CODE_SUCCESS != code) { + QW_TASK_ELOG("task running, async kill failed, error: %x", code); + } else { + QW_TASK_DLOG_E("task running, async killed"); + } } else if (QW_FETCH_RUNNING(ctx)) { QW_UPDATE_RSP_CODE(ctx, TSDB_CODE_VND_STOPPED); QW_SET_EVENT_RECEIVED(ctx, QW_EVENT_DROP); QW_TASK_DLOG_E("task fetching, update drop received"); } else { - qwDropTask(QW_FPARAMS()); + code = qwDropTask(QW_FPARAMS()); + if (TSDB_CODE_SUCCESS != code) { + QW_TASK_ELOG("task drop failed, error: %x", code); + } else { + QW_TASK_DLOG_E("task dropped"); + } } QW_UNLOCK(QW_WRITE, &ctx->lock); pIter = taosHashIterate(mgmt->ctxHash, pIter); } - - return TSDB_CODE_SUCCESS; } int32_t qwProcessHbLinkBroken(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *req) { @@ -111,7 +119,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) { int32_t qwSendQueryRsp(QW_FPARAMS_DEF, int32_t msgType, SQWTaskCtx *ctx, int32_t rspCode, bool quickRsp) { if ((!quickRsp) || QUERY_RSP_POLICY_QUICK == tsQueryRspPolicy) { if (!ctx->localExec) { - qwBuildAndSendQueryRsp(msgType, &ctx->ctrlConnInfo, rspCode, ctx); + QW_ERR_RET(qwBuildAndSendQueryRsp(msgType, &ctx->ctrlConnInfo, rspCode, ctx)); QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", ctx->ctrlConnInfo.handle, rspCode, tstrerror(rspCode)); } @@ -140,6 +148,10 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { } SArray *pResList = taosArrayInit(4, POINTER_BYTES); + if (NULL == pResList) { + QW_ERR_RET(terrno); + } + while (true) { QW_TASK_DLOG("start to execTask, loopIdx:%d", i++); @@ -165,6 +177,9 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { size_t numOfResBlock = taosArrayGetSize(pResList); for (int32_t j = 0; j < numOfResBlock; ++j) { SSDataBlock *pRes = taosArrayGetP(pResList, j); + if (NULL == pRes) { + QW_ERR_JRET(TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR); + } SInputData inputData = {.pData = pRes}; code = dsPutDataBlock(sinkHandle, &inputData, &qcontinue); @@ -226,7 +241,9 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { } _return: + taosArrayDestroy(pResList); + QW_RET(code); } @@ -241,7 +258,8 @@ bool qwTaskNotInExec(SQWTaskCtx *ctx) { int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo) { int32_t taskNum = 0; - + int32_t code = TSDB_CODE_SUCCESS; + hbInfo->connInfo = sch->hbConnInfo; hbInfo->rsp.epId = sch->hbEpId; @@ -272,7 +290,11 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo) status.status = taskStatus->status; status.refId = taskStatus->refId; - taosArrayPush(hbInfo->rsp.taskStatus, &status); + if (NULL == taosArrayPush(hbInfo->rsp.taskStatus, &status)) { + taosHashCancelIterate(sch->tasksHash, pIter); + code = terrno; + break; + } ++i; pIter = taosHashIterate(sch->tasksHash, pIter); @@ -280,7 +302,7 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo) QW_UNLOCK(QW_READ, &sch->tasksLock); - return TSDB_CODE_SUCCESS; + return code; } int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, int32_t *pRawDataLen, void **rspMsg, @@ -320,7 +342,7 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, pOutput->numOfRows); if (!ctx->dynamicTask) { - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask); + QW_ERR_RET(qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask)); } if (NULL == pRsp) { @@ -375,7 +397,7 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, if (DS_BUF_EMPTY == pOutput->bufStatus && pOutput->queryEnd) { QW_TASK_DLOG("task all data fetched and done, fetched blocks %d rows %" PRId64, pOutput->numOfBlocks, pOutput->numOfRows); - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask); + QW_ERR_RET(qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask)); break; } @@ -464,7 +486,7 @@ int32_t qwQuickRspFetchReq(QW_FPARAMS_DEF, SQWTaskCtx *ctx, SQWMsg *qwMsg, int32 qwMsg->connInfo = ctx->dataConnInfo; QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_FETCH); - qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, rsp, dataLen, code); + QW_ERR_RET(qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, rsp, dataLen, code)); rsp = NULL; QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), @@ -650,7 +672,7 @@ int32_t qwHandlePostPhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inp _return: if (TSDB_CODE_SUCCESS == code && QW_PHASE_POST_QUERY == phase) { - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_PART_SUCC, ctx->dynamicTask); + code = qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_PART_SUCC, ctx->dynamicTask); ctx->queryGotData = true; } @@ -660,7 +682,7 @@ _return: qwDbgSimulateRedirect(&qwMsg, ctx, &rsped); qwDbgSimulateDead(QW_FPARAMS(), ctx, &rsped); if (!rsped) { - qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); + code = qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); } } @@ -672,7 +694,7 @@ _return: } if (code) { - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); + code = qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); } QW_UNLOCK(QW_WRITE, &ctx->lock); @@ -687,11 +709,11 @@ _return: int32_t qwAbortPrerocessQuery(QW_FPARAMS_DEF) { QW_ERR_RET(qwDropTask(QW_FPARAMS())); - QW_RET(TSDB_CODE_SUCCESS); + return TSDB_CODE_SUCCESS; } int32_t qwPreprocessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { - int32_t code = 0; + int32_t code = TSDB_CODE_SUCCESS; SQWTaskCtx *ctx = NULL; QW_ERR_JRET(qwRegisterQueryBrokenLinkArg(QW_FPARAMS(), &qwMsg->connInfo)); @@ -706,7 +728,7 @@ int32_t qwPreprocessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { QW_ERR_JRET(qwAddTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_INIT)); - qwSendQueryRsp(QW_FPARAMS(), qwMsg->msgType + 1, ctx, code, true); + QW_ERR_JRET(qwSendQueryRsp(QW_FPARAMS(), qwMsg->msgType + 1, ctx, code, true)); _return: @@ -715,7 +737,7 @@ _return: qwReleaseTaskCtx(mgmt, ctx); } - QW_RET(TSDB_CODE_SUCCESS); + return TSDB_CODE_SUCCESS; } int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) { @@ -761,7 +783,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) { atomic_store_ptr(&ctx->taskHandle, pTaskInfo); atomic_store_ptr(&ctx->sinkHandle, sinkHandle); - qwSaveTbVersionInfo(pTaskInfo, ctx); + QW_ERR_JRET(qwSaveTbVersionInfo(pTaskInfo, ctx)); if (!ctx->dynamicTask) { QW_ERR_JRET(qwExecTask(QW_FPARAMS(), ctx, NULL)); @@ -778,7 +800,7 @@ _return: input.msgType = qwMsg->msgType; code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); - qwQuickRspFetchReq(QW_FPARAMS(), ctx, qwMsg, code); + QW_ERR_RET(qwQuickRspFetchReq(QW_FPARAMS(), ctx, qwMsg, code)); QW_RET(TSDB_CODE_SUCCESS); } @@ -829,7 +851,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { qwMsg->connInfo = ctx->dataConnInfo; QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_FETCH); - qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, rsp, dataLen, code); + QW_ERR_JRET(qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, rsp, dataLen, code)); rsp = NULL; QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, @@ -851,9 +873,14 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { rsp = NULL; qwMsg->connInfo = ctx->dataConnInfo; - qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, NULL, 0, code); - QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), - 0); + code = qwBuildAndSendFetchRsp(ctx->fetchMsgType + 1, &qwMsg->connInfo, NULL, 0, code); + if (TSDB_CODE_SUCCESS != code) { + QW_TASK_ELOG("fetch rsp send fail, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), + 0); + } else { + QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), + 0); + } } QW_LOCK(QW_WRITE, &ctx->lock); @@ -869,7 +896,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { } while (true); input.code = code; - qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_CQUERY, &input, NULL); + QW_ERR_RET(qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_CQUERY, &input, NULL)); QW_RET(TSDB_CODE_SUCCESS); } @@ -922,7 +949,7 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) { } else if (QW_QUERY_RUNNING(ctx)) { atomic_store_8((int8_t *)&ctx->queryContinue, 1); } else if (0 == atomic_load_8((int8_t *)&ctx->queryInQueue)) { - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_EXEC, ctx->dynamicTask); + QW_ERR_JRET(qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_EXEC, ctx->dynamicTask)); atomic_store_8((int8_t *)&ctx->queryInQueue, 1); QW_ERR_JRET(qwBuildAndSendCQueryMsg(QW_FPARAMS(), &qwMsg->connInfo)); @@ -952,9 +979,14 @@ _return: } if (!rsped) { - qwBuildAndSendFetchRsp(qwMsg->msgType + 1, &qwMsg->connInfo, rsp, dataLen, code); - QW_TASK_DLOG("fetch rsp send, msgType:%s, handle:%p, code:%x - %s, dataLen:%d", TMSG_INFO(qwMsg->msgType + 1), - qwMsg->connInfo.handle, code, tstrerror(code), dataLen); + code = qwBuildAndSendFetchRsp(qwMsg->msgType + 1, &qwMsg->connInfo, rsp, dataLen, code); + if (TSDB_CODE_SUCCESS != code) { + QW_TASK_ELOG("fetch rsp send fail, msgType:%s, handle:%p, code:%x - %s, dataLen:%d", TMSG_INFO(qwMsg->msgType + 1), + qwMsg->connInfo.handle, code, tstrerror(code), dataLen); + } else { + QW_TASK_DLOG("fetch rsp send, msgType:%s, handle:%p, code:%x - %s, dataLen:%d", TMSG_INFO(qwMsg->msgType + 1), + qwMsg->connInfo.handle, code, tstrerror(code), dataLen); + } } else { qwFreeFetchRsp(rsp); rsp = NULL; @@ -985,7 +1017,7 @@ int32_t qwProcessDrop(QW_FPARAMS_DEF, SQWMsg *qwMsg) { if (QW_QUERY_RUNNING(ctx)) { QW_ERR_JRET(qwKillTaskHandle(ctx, TSDB_CODE_TSC_QUERY_CANCELLED)); - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_DROP, ctx->dynamicTask); + QW_ERR_JRET(qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_DROP, ctx->dynamicTask)); } else { QW_ERR_JRET(qwDropTask(QW_FPARAMS())); dropped = true; @@ -1001,7 +1033,7 @@ _return: if (code) { if (ctx) { QW_UPDATE_RSP_CODE(ctx, code); - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); + (void)qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); // task already failed, no more error handling } else { tmsgReleaseHandle(&qwMsg->connInfo, TAOS_CONN_SERVER); } @@ -1035,7 +1067,7 @@ int32_t qwProcessNotify(QW_FPARAMS_DEF, SQWMsg *qwMsg) { if (QW_QUERY_RUNNING(ctx)) { QW_ERR_JRET(qwKillTaskHandle(ctx, TSDB_CODE_TSC_QUERY_CANCELLED)); - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask); + QW_ERR_JRET(qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask)); } switch (qwMsg->msgType) { @@ -1055,7 +1087,7 @@ _return: if (code) { if (ctx) { QW_UPDATE_RSP_CODE(ctx, code); - qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); + (void)qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); // task already failed, no more error handling } } @@ -1104,7 +1136,7 @@ int32_t qwProcessHb(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *req) { _return: memcpy(&rsp.epId, &req->epId, sizeof(req->epId)); - qwBuildAndSendHbRsp(&qwMsg->connInfo, &rsp, code); + code = qwBuildAndSendHbRsp(&qwMsg->connInfo, &rsp, code); if (code) { tmsgReleaseHandle(&qwMsg->connInfo, TAOS_CONN_SERVER); @@ -1125,7 +1157,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { int64_t refId = hbParam->refId; SQWorker *mgmt = qwAcquire(refId); if (NULL == mgmt) { - QW_DLOG("qwAcquire %" PRIx64 "failed", refId); + QW_DLOG("qwAcquire %" PRIx64 "failed, code:0x%x", refId, terrno); return; } @@ -1137,7 +1169,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { qwDbgDumpMgmtInfo(mgmt); if (gQWDebug.forceStop) { - (void)qwStopAllTasks(mgmt); + qwStopAllTasks(mgmt); } QW_LOCK(QW_READ, &mgmt->schLock); @@ -1145,8 +1177,8 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { int32_t schNum = taosHashGetSize(mgmt->schHash); if (schNum <= 0) { QW_UNLOCK(QW_READ, &mgmt->schLock); - taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); - qwRelease(refId); + (void)taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); // ignore error + (void)qwRelease(refId); // ignore error return; } @@ -1156,9 +1188,9 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { QW_UNLOCK(QW_READ, &mgmt->schLock); taosMemoryFree(rspList); taosArrayDestroy(pExpiredSch); - QW_ELOG("calloc %d SQWHbInfo failed", schNum); - taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); - qwRelease(refId); + QW_ELOG("calloc %d SQWHbInfo failed, code:%x", schNum, terrno); + (void)taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); // ignore error + (void)qwRelease(refId); // ignore error return; } @@ -1174,7 +1206,11 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) { if (sch1->hbBrokenTs > 0 && ((currentMs - sch1->hbBrokenTs) > QW_SCH_TIMEOUT_MSEC) && taosHashGetSize(sch1->tasksHash) <= 0) { - taosArrayPush(pExpiredSch, sId); + if (NULL == taosArrayPush(pExpiredSch, sId)) { + QW_ELOG("add sId 0x%" PRIx64 " to expiredSch failed, code:%x", *sId, terrno); + taosHashCancelIterate(mgmt->schHash, pIter); + break; + } } pIter = taosHashIterate(mgmt->schHash, pIter); @@ -1196,7 +1232,7 @@ _return: QW_UNLOCK(QW_READ, &mgmt->schLock); for (int32_t j = 0; j < i; ++j) { - qwBuildAndSendHbRsp(&rspList[j].connInfo, &rspList[j].rsp, code); + (void)qwBuildAndSendHbRsp(&rspList[j].connInfo, &rspList[j].rsp, code); // ignore error /*QW_DLOG("hb rsp send, handle:%p, code:%x - %s, taskNum:%d", rspList[j].connInfo.handle, code, tstrerror(code),*/ /*(rspList[j].rsp.taskStatus ? (int32_t)taosArrayGetSize(rspList[j].rsp.taskStatus) : 0));*/ tFreeSSchedulerHbRsp(&rspList[j].rsp); @@ -1209,8 +1245,8 @@ _return: taosMemoryFreeClear(rspList); taosArrayDestroy(pExpiredSch); - taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); - qwRelease(refId); + (void)taosTmrReset(qwProcessHbTimerEvent, QW_DEFAULT_HEARTBEAT_MSEC, param, mgmt->timer, &mgmt->hbTimer); // ignore error + (void)qwRelease(refId); // ignore error } int32_t qwProcessDelete(QW_FPARAMS_DEF, SQWMsg *qwMsg, SDeleteRes *pRes) { @@ -1333,7 +1369,7 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, void **qWorkerMgmt, const S _return: if (mgmt->refId >= 0) { - qwRelease(mgmt->refId); + qwRelease(mgmt->refId); // ignore error } else { taosHashCleanup(mgmt->schHash); taosHashCleanup(mgmt->ctxHash); @@ -1353,7 +1389,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { atomic_store_8(&mgmt->nodeStopped, 1); - (void)qwStopAllTasks(mgmt); + qwStopAllTasks(mgmt); } void qWorkerDestroy(void **qWorkerMgmt) { @@ -1383,7 +1419,7 @@ int32_t qWorkerGetStat(SReadHandle *handle, void *qWorkerMgmt, SQWorkerStat *pSt SQWorker *mgmt = (SQWorker *)qWorkerMgmt; SDataSinkStat sinkStat = {0}; - dsDataSinkGetCacheSize(&sinkStat); + QW_ERR_RET(dsDataSinkGetCacheSize(&sinkStat)); pStat->cacheDataSize = sinkStat.cachedSize; pStat->queryProcessed = QW_STAT_GET(mgmt->stat.msgStat.queryProcessed); @@ -1427,6 +1463,10 @@ int32_t qWorkerProcessLocalQuery(void *pMgmt, uint64_t sId, uint64_t qId, uint64 ctx->explainRes = explainRes; rHandle.pMsgCb = taosMemoryCalloc(1, sizeof(SMsgCb)); + if (NULL == rHandle.pMsgCb) { + QW_ERR_JRET(terrno); + } + rHandle.pMsgCb->clientRpc = qwMsg->connInfo.handle; code = qCreateExecTask(&rHandle, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, 0, NULL, OPTR_EXEC_MODEL_BATCH); diff --git a/source/libs/stream/src/streamCheckStatus.c b/source/libs/stream/src/streamCheckStatus.c index 226a06be7e..620f5f1248 100644 --- a/source/libs/stream/src/streamCheckStatus.c +++ b/source/libs/stream/src/streamCheckStatus.c @@ -308,7 +308,9 @@ int32_t streamTaskStopMonitorCheckRsp(STaskCheckInfo* pInfo, const char* id) { void streamTaskCleanupCheckInfo(STaskCheckInfo* pInfo) { ASSERT(pInfo->inCheckProcess == 0); - pInfo->pList = taosArrayDestroy(pInfo->pList); + taosArrayDestroy(pInfo->pList); + pInfo->pList = NULL; + if (pInfo->checkRspTmr != NULL) { /*bool ret = */ taosTmrStop(pInfo->checkRspTmr); pInfo->checkRspTmr = NULL; diff --git a/source/libs/stream/src/streamMsg.c b/source/libs/stream/src/streamMsg.c index 40582b5144..1cc48f02b6 100644 --- a/source/libs/stream/src/streamMsg.c +++ b/source/libs/stream/src/streamMsg.c @@ -438,11 +438,13 @@ void tCleanupStreamHbMsg(SStreamHbMsg* pMsg) { } if (pMsg->pUpdateNodes != NULL) { - pMsg->pUpdateNodes = taosArrayDestroy(pMsg->pUpdateNodes); + taosArrayDestroy(pMsg->pUpdateNodes); + pMsg->pUpdateNodes = NULL; } if (pMsg->pTaskStatus != NULL) { - pMsg->pTaskStatus = taosArrayDestroy(pMsg->pTaskStatus); + taosArrayDestroy(pMsg->pTaskStatus); + pMsg->pTaskStatus = NULL; } pMsg->msgId = -1; diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index 9bcad87264..4cbe0cb136 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -280,10 +280,12 @@ void tFreeStreamTask(SStreamTask* pTask) { taosMemoryFree(pTask->outputInfo.pTokenBucket); taosThreadMutexDestroy(&pTask->lock); - pTask->msgInfo.pSendInfo = taosArrayDestroy(pTask->msgInfo.pSendInfo); + taosArrayDestroy(pTask->msgInfo.pSendInfo); + pTask->msgInfo.pSendInfo = NULL; taosThreadMutexDestroy(&pTask->msgInfo.lock); - pTask->outputInfo.pNodeEpsetUpdateList = taosArrayDestroy(pTask->outputInfo.pNodeEpsetUpdateList); + taosArrayDestroy(pTask->outputInfo.pNodeEpsetUpdateList); + pTask->outputInfo.pNodeEpsetUpdateList = NULL; if ((pTask->status.removeBackendFiles) && (pTask->pMeta != NULL)) { char* path = taosMemoryCalloc(1, strlen(pTask->pMeta->path) + 128); @@ -1055,9 +1057,12 @@ void streamTaskDestroyActiveChkptInfo(SActiveCheckpointInfo* pInfo) { } taosThreadMutexDestroy(&pInfo->lock); - pInfo->pDispatchTriggerList = taosArrayDestroy(pInfo->pDispatchTriggerList); - pInfo->pReadyMsgList = taosArrayDestroy(pInfo->pReadyMsgList); - pInfo->pCheckpointReadyRecvList = taosArrayDestroy(pInfo->pCheckpointReadyRecvList); + taosArrayDestroy(pInfo->pDispatchTriggerList); + pInfo->pDispatchTriggerList = NULL; + taosArrayDestroy(pInfo->pReadyMsgList); + pInfo->pReadyMsgList = NULL; + taosArrayDestroy(pInfo->pCheckpointReadyRecvList); + pInfo->pCheckpointReadyRecvList = NULL; if (pInfo->pChkptTriggerTmr != NULL) { taosTmrStop(pInfo->pChkptTriggerTmr); diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index d9686d77f8..4c056178c2 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -34,14 +34,12 @@ SArray* taosArrayInit(size_t size, size_t elemSize) { SArray* pArray = taosMemoryMalloc(sizeof(SArray)); if (pArray == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } pArray->size = 0; pArray->pData = taosMemoryCalloc(size, elemSize); if (pArray->pData == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; taosMemoryFree(pArray); return NULL; } @@ -387,13 +385,11 @@ void taosArrayClearP(SArray* pArray, void (*fp)(void*)) { taosArrayClear(pArray); } -void* taosArrayDestroy(SArray* pArray) { +void taosArrayDestroy(SArray* pArray) { if (pArray) { taosMemoryFree(pArray->pData); taosMemoryFree(pArray); } - - return NULL; } void taosArrayDestroyP(SArray* pArray, FDelete fp) { diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index adde3a3331..3ab0f83238 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -96,7 +96,8 @@ void cfgItemFreeVal(SConfigItem *pItem) { } if (pItem->array) { - pItem->array = taosArrayDestroy(pItem->array); + taosArrayDestroy(pItem->array); + pItem->array = NULL; } } From 3e85d0c54626ec9519060cd5044294d36b341e8c Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Sat, 13 Jul 2024 11:39:25 +0800 Subject: [PATCH 26/40] fix: timer --- source/util/src/tcompare.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 4c4e859480..6433018293 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1219,6 +1219,7 @@ static RegexCache sRegexCache; #define REGEX_CACHE_CLEAR_TIME 30 static void checkRegexCache(void* param, void* tmrId) { + taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, NULL, &tmrId); if (taosHashGetSize(sRegexCache.regexHash) < MAX_REGEX_CACHE_SIZE) { return; } @@ -1232,8 +1233,6 @@ static void checkRegexCache(void* param, void* tmrId) { ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } } - - taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, NULL, &tmrId); } void regexCacheFree(void *ppUsingRegex) { From 22f69837b34feab600de869b20cb367c17b6f4aa Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Sat, 13 Jul 2024 15:22:16 +0800 Subject: [PATCH 27/40] clear timer --- source/util/src/tcompare.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 6433018293..b138028519 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1211,7 +1211,7 @@ typedef struct UsingRegex { typedef struct RegexCache { SHashObj *regexHash; - void *regexCacheTimer; + void *regexCacheTmr; void *timer; } RegexCache; static RegexCache sRegexCache; @@ -1219,7 +1219,7 @@ static RegexCache sRegexCache; #define REGEX_CACHE_CLEAR_TIME 30 static void checkRegexCache(void* param, void* tmrId) { - taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, NULL, &tmrId); + taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, sRegexCache.regexCacheTmr, &tmrId); if (taosHashGetSize(sRegexCache.regexHash) < MAX_REGEX_CACHE_SIZE) { return; } @@ -1236,6 +1236,7 @@ static void checkRegexCache(void* param, void* tmrId) { } void regexCacheFree(void *ppUsingRegex) { + uInfo("[regex cache] regexCacheFree %p", ppUsingRegex); regfree(&(*(UsingRegex **)ppUsingRegex)->pRegex); taosMemoryFree(*(UsingRegex **)ppUsingRegex); } @@ -1247,14 +1248,14 @@ int32_t InitRegexCache() { return -1; } taosHashSetFreeFp(sRegexCache.regexHash, regexCacheFree); - sRegexCache.regexCacheTimer = taosTmrInit(0, 0, 0, "REGEXCACHE"); - if (sRegexCache.regexCacheTimer == NULL) { + sRegexCache.regexCacheTmr = taosTmrInit(0, 0, 0, "REGEXCACHE"); + if (sRegexCache.regexCacheTmr == NULL) { uError("failed to create regex cache check timer"); terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } - sRegexCache.timer = taosTmrStart(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, NULL, sRegexCache.regexCacheTimer); + sRegexCache.timer = taosTmrStart(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, NULL, sRegexCache.regexCacheTmr); if (sRegexCache.timer == NULL) { uError("failed to start regex cache timer"); return -1; @@ -1264,8 +1265,10 @@ int32_t InitRegexCache() { } void DestroyRegexCache(){ + uInfo("[regex cache] destory regex cache"); taosTmrStopA(&sRegexCache.timer); taosHashCleanup(sRegexCache.regexHash); + taosTmrCleanUp(sRegexCache.regexCacheTmr); } int32_t checkRegexPattern(const char *pPattern) { From e88277592a1dcfec14918d72c4bace8b3dfecf9e Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Sat, 13 Jul 2024 18:13:21 +0800 Subject: [PATCH 28/40] log level --- source/util/src/tcompare.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index b138028519..c7b6d78868 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1236,7 +1236,6 @@ static void checkRegexCache(void* param, void* tmrId) { } void regexCacheFree(void *ppUsingRegex) { - uInfo("[regex cache] regexCacheFree %p", ppUsingRegex); regfree(&(*(UsingRegex **)ppUsingRegex)->pRegex); taosMemoryFree(*(UsingRegex **)ppUsingRegex); } From 4c2c9a71d5c29286203eb9b33764b227f5dc7cad Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 15 Jul 2024 10:05:57 +0800 Subject: [PATCH 29/40] fix: table info issue --- include/libs/executor/executor.h | 2 +- source/libs/executor/src/executor.c | 8 ++++++-- source/libs/qworker/src/qwUtil.c | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index a461ceef2a..082e824e5a 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -152,7 +152,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, * @return */ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* tableName, int32_t* sversion, - int32_t* tversion, int32_t idx); + int32_t* tversion, int32_t idx, bool* tbGet); /** * The main task execution function, including query on both table and multiple tables, diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index c0d089e7c2..4aff0e69a3 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -479,12 +479,14 @@ int32_t qUpdateTableListForStreamScanner(qTaskInfo_t tinfo, const SArray* tableI } int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* tableName, int32_t* sversion, - int32_t* tversion, int32_t idx) { + int32_t* tversion, int32_t idx, bool* tbGet) { + *tbGet = false; + ASSERT(tinfo != NULL && dbName != NULL && tableName != NULL); SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; if (taosArrayGetSize(pTaskInfo->schemaInfos) <= idx) { - return -1; + return TSDB_CODE_SUCCESS; } SSchemaInfo* pSchemaInfo = taosArrayGet(pTaskInfo->schemaInfos, idx); @@ -502,6 +504,8 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table tableName[0] = 0; } + *tbGet = true; + return TSDB_CODE_SUCCESS; } diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 619e2576cd..06559093a8 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -509,10 +509,12 @@ int32_t qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) { STbVerInfo tbInfo; int32_t i = 0; int32_t code = TSDB_CODE_SUCCESS; + bool tbGet = false; while (true) { - code = qGetQueryTableSchemaVersion(pTaskInfo, dbFName, tbName, &tbInfo.sversion, &tbInfo.tversion, i); - if (TSDB_CODE_SUCCESS != code) { + tbGet = false; + code = qGetQueryTableSchemaVersion(pTaskInfo, dbFName, tbName, &tbInfo.sversion, &tbInfo.tversion, i, &tbGet); + if (TSDB_CODE_SUCCESS != code || !tbGet) { break; } From 38e66c58eb8cd6f419c6eb57a4e2cfc9363b9c91 Mon Sep 17 00:00:00 2001 From: zhiyong Date: Sun, 14 Jul 2024 16:05:32 +0800 Subject: [PATCH 30/40] add ci case TD-30948 --- tests/army/query/function/cast.py | 183 ++++++++++++++++++++++++++++++ tests/army/query/queryBugs.py | 9 +- tests/parallel_test/cases.task | 1 + 3 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 tests/army/query/function/cast.py diff --git a/tests/army/query/function/cast.py b/tests/army/query/function/cast.py new file mode 100644 index 0000000000..66718ce715 --- /dev/null +++ b/tests/army/query/function/cast.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- + +from frame.log import * +from frame.cases import * +from frame.sql import * +from frame.caseBase import * +from frame import * + + +class TDTestCase(TBase): + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), True) + self.dbname = "cast_db" + self._datetime_epoch = datetime.datetime.fromtimestamp(0) + + def cast_without_from(self): + # int + int_num = 2147483648 + tdSql.query(f"select cast({int_num} as int) re;") + tdSql.checkData(0, 0, -int_num) + + tdSql.query(f"select cast(2147483647 as int) re;") + tdSql.checkData(0, 0, 2147483647) + + tdSql.query(f"select cast({int_num} as int unsigned) re;") + tdSql.checkData(0, 0, int_num) + + tdSql.query(f"select cast({int_num} as bigint) re;") + tdSql.checkData(0, 0, int_num) + + tdSql.query(f"select cast({int_num} as bigint unsigned) re;") + tdSql.checkData(0, 0, int_num) + + tdSql.query(f"select cast({int_num} as smallint) re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast({int_num} as smallint unsigned) re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast({int_num} as tinyint) re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast({int_num} as tinyint unsigned) re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast({int_num} as float) re;") + tdSql.checkData(0, 0, '2147483648.0') + + tdSql.query(f"select cast({int_num} as double) re;") + tdSql.checkData(0, 0, '2147483648.0') + + tdSql.query(f"select cast({int_num} as bool) as re;") + tdSql.checkData(0, 0, True) + + tdSql.query(f"select cast({int_num} as timestamp) as re;") + tdSql.checkData(0, 0, self._datetime_epoch + datetime.timedelta(seconds=int(int_num) / 1000)) + + tdSql.query(f"select cast({int_num} as varchar(10)) as re;") + tdSql.checkData(0, 0, int_num) + + tdSql.query(f"select cast({int_num} as binary(10)) as re;") + tdSql.checkData(0, 0, int_num) + + sql = f"select cast({int_num} as nchar(10));" + tdSql.query(sql) + tdSql.checkData(0, 0, int_num) + + # float + float_1001 = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019 + + tdSql.query(f"select cast({float_1001} as int) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as int unsigned) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as tinyint) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as tinyint unsigned) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as smallint) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as smallint unsigned) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as bigint) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as bigint unsigned) as re;") + tdSql.checkData(0, 0, 3) + + tdSql.query(f"select cast({float_1001} as double) as re;") + tdSql.checkData(0, 0, 3.141592653589793) + + tdSql.query(f"select cast({float_1001} as float) as re;") + tdSql.checkData(0, 0, 3.1415927) + + tdSql.query(f"select cast({float_1001} as bool) as re;") + tdSql.checkData(0, 0, True) + + tdSql.query(f"select cast({float_1001} as timestamp) as re;") + tdSql.checkData(0, 0, self._datetime_epoch + datetime.timedelta(seconds=int(float_1001) / 1000)) + + sql = f"select cast({float_1001} as varchar(5)) as re;" + tdSql.query(sql) + tdSql.checkData(0, 0, 3.141) + + sql = f"select cast({float_1001} as binary(10)) as re;" + tdSql.query(sql) + tdSql.checkData(0, 0, 3.141593) + + tdSql.query(f"select cast({float_1001} as nchar(5));") + tdSql.checkData(0, 0, 3.141) + + # str + str_410 = "bcdefghigk" * 41 + big_str = "bcdefghigk" * 6552 + + tdSql.query(f"select cast('{str_410}' as binary(3)) as re;") + tdSql.checkData(0, 0, "bcd") + + tdSql.query(f"select cast('{str_410}' as varchar(2)) as re;") + tdSql.checkData(0, 0, "bc") + + tdSql.query(f"select cast('{str_410}' as nchar(10));") + tdSql.checkData(0, 0, "bcdefghigk") + + tdSql.query(f"select cast('北京' as nchar(10));") + tdSql.checkData(0, 0, "北京") + + tdSql.query(f"select cast('{str_410}' as int) as re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as int unsigned) as re;") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as tinyint) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as tinyint unsigned) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as smallint) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as smallint unsigned) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as bigint) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as bigint unsigned) as re") + tdSql.checkData(0, 0, 0) + + tdSql.query(f"select cast('{str_410}' as float) as re;") + tdSql.checkData(0, 0, 0.0000000) + + tdSql.query(f"select cast('{str_410}' as double) as re;") + tdSql.checkData(0, 0, 0.000000000000000) + + tdSql.query(f"select cast('{str_410}' as bool) as re") + tdSql.checkData(0, 0, False) + + tdSql.query( f"select cast('{str_410}' as timestamp) as re") + tdSql.checkData(0, 0, "1970-01-01 08:00:00.000") + + + def run(self): + # self.prepare_data() + # self.all_test() + # tdSql.execute(f"flush database {self.dbname}") + # self.all_test() + self.cast_without_from() + + tdLog.success(f"{__file__} successfully executed") + + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/army/query/queryBugs.py b/tests/army/query/queryBugs.py index f6075f6063..20ecb23881 100644 --- a/tests/army/query/queryBugs.py +++ b/tests/army/query/queryBugs.py @@ -36,7 +36,7 @@ class TDTestCase(TBase): "create table db.st(ts timestamp, age int) tags(area tinyint);", "insert into db.t1 using db.st tags(100) values('2024-01-01 10:00:01', 1);", "insert into db.t2 using db.st tags(110) values('2024-01-01 10:00:02', 2);", - "insert into db.t3 using db.st tags(3) values('2024-01-01 10:00:03', 3);" + "insert into db.t3 using db.st tags(3) values('2024-01-01 10:00:03', 3);", ] tdSql.executes(sqls) @@ -44,7 +44,7 @@ class TDTestCase(TBase): results = [ ["2024-01-01 10:00:01", 1, 100], ["2024-01-01 10:00:02", 2, 110], - ["2024-01-01 10:00:03", 3, 3] + ["2024-01-01 10:00:03", 3, 3], ] tdSql.checkDataMem(sql, results) @@ -99,11 +99,12 @@ class TDTestCase(TBase): for i in range(1, 10): new_ts = base_ts + i * 1000 num = i * 100 + v1, v2 = i * 10, i * 11 sqls = [ - f"insert into ntb1 values({new_ts}, 'nihao{num}', {10*i}, {10*i}, {10*i});", + f"insert into ntb1 values({new_ts}, 'nihao{num}', {v1}, {v1}, {v1});", f"insert into ntb1 values({new_ts + 1}, 'nihao{num + 1}', NULL, NULL, NULL);", f"delete from ntb1 where ts = {new_ts};", - f"insert into ntb1 values({new_ts + 2}, 'nihao{num + 2}', {11*i}, {11*i}, {11*i});", + f"insert into ntb1 values({new_ts + 2}, 'nihao{num + 2}', {v2}, {v2}, {v2});", ] tdSql.executes(sqls) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 4338187791..69709a201a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -15,6 +15,7 @@ ,,n,army,python3 ./test.py -f 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 +,,y,army,./pytest.sh python3 ./test.py -f query/function/cast.py ,,y,army,./pytest.sh python3 ./test.py -f query/test_join.py ,,y,army,./pytest.sh python3 ./test.py -f query/test_compare.py ,,y,army,./pytest.sh python3 ./test.py -f insert/test_column_tag_boundary.py From a82b0b805d66960c93133acd083ed47ad45e6e0d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 15 Jul 2024 13:50:04 +0800 Subject: [PATCH 31/40] fix: error handling issue --- source/libs/qworker/src/qwDbg.c | 4 ++-- source/libs/qworker/src/qwMsg.c | 27 +++++++++++++++++++++++++-- source/libs/qworker/src/qworker.c | 7 +++++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/source/libs/qworker/src/qwDbg.c b/source/libs/qworker/src/qwDbg.c index d28667d247..17b2849684 100644 --- a/source/libs/qworker/src/qwDbg.c +++ b/source/libs/qworker/src/qwDbg.c @@ -260,8 +260,8 @@ void qwDbgSimulateDead(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *rsped) { if (++ignoreTime > 10 && 0 == taosRand() % 9) { if (ctx->fetchMsgType == TDMT_SCH_FETCH) { - qwBuildAndSendErrorRsp(TDMT_SCH_LINK_BROKEN, &ctx->ctrlConnInfo, TSDB_CODE_RPC_BROKEN_LINK); - qwBuildAndSendErrorRsp(ctx->fetchMsgType + 1, &ctx->dataConnInfo, TSDB_CODE_QRY_TASK_CTX_NOT_EXIST); + (void)qwBuildAndSendErrorRsp(TDMT_SCH_LINK_BROKEN, &ctx->ctrlConnInfo, TSDB_CODE_RPC_BROKEN_LINK); // ignore error + (void)qwBuildAndSendErrorRsp(ctx->fetchMsgType + 1, &ctx->dataConnInfo, TSDB_CODE_QRY_TASK_CTX_NOT_EXIST); // ignore error *rsped = true; taosSsleep(3); diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index fad4b1efa8..473dd41228 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -105,8 +105,19 @@ int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SArray *pExecList) { SExplainRsp rsp = {.numOfPlans = taosArrayGetSize(pExecList), .subplanInfo = pInfo}; int32_t contLen = tSerializeSExplainRsp(NULL, 0, &rsp); + if (contLen < 0) { + qError("tSerializeSExplainRsp failed, error: %x", terrno); + QW_RET(terrno); + } void *pRsp = rpcMallocCont(contLen); - tSerializeSExplainRsp(pRsp, contLen, &rsp); + if (NULL == pRsp) { + QW_RET(terrno); + } + contLen = tSerializeSExplainRsp(pRsp, contLen, &rsp); + if (contLen < 0) { + qError("tSerializeSExplainRsp second failed, error: %x", terrno); + QW_RET(terrno); + } SRpcMsg rpcRsp = { .msgType = TDMT_SCH_EXPLAIN_RSP, @@ -123,8 +134,20 @@ int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SArray *pExecList) { int32_t qwBuildAndSendHbRsp(SRpcHandleInfo *pConn, SSchedulerHbRsp *pStatus, int32_t code) { int32_t contLen = tSerializeSSchedulerHbRsp(NULL, 0, pStatus); + if (contLen < 0) { + qError("tSerializeSSchedulerHbRsp failed, error: %x", terrno); + QW_RET(terrno); + } + void *pRsp = rpcMallocCont(contLen); - tSerializeSSchedulerHbRsp(pRsp, contLen, pStatus); + if (NULL == pRsp) { + QW_RET(terrno); + } + contLen = tSerializeSSchedulerHbRsp(pRsp, contLen, pStatus); + if (contLen < 0) { + qError("tSerializeSSchedulerHbRsp second failed, error: %x", terrno); + QW_RET(terrno); + } SRpcMsg rpcRsp = { .msgType = TDMT_SCH_QUERY_HEARTBEAT_RSP, diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 8ab095bc32..084ee7efe3 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -682,7 +682,10 @@ _return: qwDbgSimulateRedirect(&qwMsg, ctx, &rsped); qwDbgSimulateDead(QW_FPARAMS(), ctx, &rsped); if (!rsped) { - code = qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); + int32_t newCode = qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); + if (TSDB_CODE_SUCCESS != newCode && TSDB_CODE_SUCCESS == code) { + code = newCode; + } } } @@ -694,7 +697,7 @@ _return: } if (code) { - code = qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); + (void)qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_FAIL, ctx->dynamicTask); // already in error, ignore new error } QW_UNLOCK(QW_WRITE, &ctx->lock); From a8c39cdd1139c23958132b7ca19bbb06e7dbf99a Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 15 Jul 2024 14:48:21 +0800 Subject: [PATCH 32/40] enh: add return code processing --- source/libs/qworker/src/qwDbg.c | 21 +++++++++++--- source/libs/qworker/src/qwMsg.c | 48 +++++++++++++++++++------------ source/libs/qworker/src/qwUtil.c | 43 +++++++++++++++++++++------ source/libs/qworker/src/qworker.c | 2 +- 4 files changed, 82 insertions(+), 32 deletions(-) diff --git a/source/libs/qworker/src/qwDbg.c b/source/libs/qworker/src/qwDbg.c index 17b2849684..b7a4b718e2 100644 --- a/source/libs/qworker/src/qwDbg.c +++ b/source/libs/qworker/src/qwDbg.c @@ -173,8 +173,21 @@ int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int if (pEpSet) { contLen = tSerializeSEpSet(NULL, 0, pEpSet); + if (contLen < 0) { + qError("tSerializeSEpSet failed, code:%x", terrno); + return terrno; + } rsp = rpcMallocCont(contLen); - tSerializeSEpSet(rsp, contLen, pEpSet); + if (NULL == rsp) { + qError("rpcMallocCont %d failed, code:%x", contLen, terrno); + return terrno; + } + + contLen = tSerializeSEpSet(rsp, contLen, pEpSet); + if (contLen < 0) { + qError("tSerializeSEpSet second failed, code:%x", terrno); + return terrno; + } } SRpcMsg rpcRsp = { @@ -216,20 +229,20 @@ void qwDbgSimulateRedirect(SQWMsg *qwMsg, SQWTaskCtx *ctx, bool *rsped) { epSet.eps[2].port = 7300; ctx->phase = QW_PHASE_POST_QUERY; - qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, &epSet); + (void)qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, &epSet); // ignore error *rsped = true; return; } if (TDMT_SCH_MERGE_QUERY == qwMsg->msgType && (0 == taosRand() % 3)) { QW_SET_PHASE(ctx, QW_PHASE_POST_QUERY); - qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, NULL); + (void)qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, NULL); // ignore error *rsped = true; return; } if ((TDMT_SCH_FETCH == qwMsg->msgType) && (0 == taosRand() % 9)) { - qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, NULL); + (void)qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_SYN_NOT_LEADER, NULL); // ignore error *rsped = true; return; } diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 473dd41228..9f4a540f3c 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -166,6 +166,9 @@ int32_t qwBuildAndSendFetchRsp(int32_t rspType, SRpcHandleInfo *pConn, SRetrieve int32_t code) { if (NULL == pRsp) { pRsp = (SRetrieveTableRsp *)rpcMallocCont(sizeof(SRetrieveTableRsp)); + if (NULL == pRsp) { + QW_RET(terrno); + } memset(pRsp, 0, sizeof(SRetrieveTableRsp)); dataLength = 0; } @@ -187,6 +190,9 @@ int32_t qwBuildAndSendFetchRsp(int32_t rspType, SRpcHandleInfo *pConn, SRetrieve #if 0 int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code) { STaskCancelRsp *pRsp = (STaskCancelRsp *)rpcMallocCont(sizeof(STaskCancelRsp)); + if (NULL == pRsp) { + QW_RET(terrno); + } pRsp->code = code; SRpcMsg rpcRsp = { @@ -203,6 +209,9 @@ int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code) { int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code) { STaskDropRsp *pRsp = (STaskDropRsp *)rpcMallocCont(sizeof(STaskDropRsp)); + if (NULL == pRsp) { + QW_RET(terrno); + } pRsp->code = code; SRpcMsg rpcRsp = { @@ -428,6 +437,7 @@ int32_t qWorkerAbortPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg) { QW_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT); } + int32_t code = 0; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; SSubQueryMsg msg = {0}; if (tDeserializeSSubQueryMsg(pMsg->pCont, pMsg->contLen, &msg) < 0) { @@ -442,8 +452,8 @@ int32_t qWorkerAbortPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg) { int32_t eId = msg.execId; QW_SCH_TASK_DLOG("Abort prerocessQuery start, handle:%p", pMsg->info.handle); - qwAbortPrerocessQuery(QW_FPARAMS()); - QW_SCH_TASK_DLOG("Abort prerocessQuery end, handle:%p", pMsg->info.handle); + code = qwAbortPrerocessQuery(QW_FPARAMS()); + QW_SCH_TASK_DLOG("Abort prerocessQuery end, handle:%p, code:%x", pMsg->info.handle, code); tFreeSSubQueryMsg(&msg); @@ -458,7 +468,7 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int int32_t code = 0; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, QUERY_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, QUERY_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.queryProcessed, 1); SSubQueryMsg msg = {0}; @@ -500,7 +510,7 @@ int32_t qWorkerProcessCQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in SQWTaskCtx *handles = NULL; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, QUERY_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, QUERY_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.cqueryProcessed, 1); if (NULL == msg || pMsg->contLen < sizeof(*msg)) { @@ -533,7 +543,7 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int SResFetchReq req = {0}; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.fetchProcessed, 1); if (tDeserializeSResFetchReq(pMsg->pCont, pMsg->contLen, &req) < 0) { @@ -551,9 +561,9 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int QW_SCH_TASK_DLOG("processFetch start, node:%p, handle:%p", node, pMsg->info.handle); - QW_ERR_RET(qwProcessFetch(QW_FPARAMS(), &qwMsg)); + int32_t code = qwProcessFetch(QW_FPARAMS(), &qwMsg); - QW_SCH_TASK_DLOG("processFetch end, node:%p", node); + QW_SCH_TASK_DLOG("processFetch end, node:%p, code:%x", node, code); return TSDB_CODE_SUCCESS; } @@ -561,7 +571,7 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int int32_t qWorkerProcessRspMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int64_t ts) { SQWorker *mgmt = (SQWorker *)qWorkerMgmt; if (mgmt) { - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.rspProcessed, 1); } @@ -580,7 +590,7 @@ int32_t qWorkerProcessCancelMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in int32_t code = 0; STaskCancelReq *msg = pMsg->pCont; - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.cancelProcessed, 1); if (NULL == msg || pMsg->contLen < sizeof(*msg)) { @@ -621,7 +631,7 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int6 int32_t code = 0; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.dropProcessed, 1); STaskDropReq msg = {0}; @@ -644,9 +654,9 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int6 QW_SCH_TASK_DLOG("processDrop start, node:%p, handle:%p", node, pMsg->info.handle); - QW_ERR_RET(qwProcessDrop(QW_FPARAMS(), &qwMsg)); + code = qwProcessDrop(QW_FPARAMS(), &qwMsg); - QW_SCH_TASK_DLOG("processDrop end, node:%p", node); + QW_SCH_TASK_DLOG("processDrop end, node:%p, code:%x", node, code); return TSDB_CODE_SUCCESS; } @@ -659,7 +669,7 @@ int32_t qWorkerProcessNotifyMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in int32_t code = 0; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.notifyProcessed, 1); STaskNotifyReq msg = {0}; @@ -678,9 +688,9 @@ int32_t qWorkerProcessNotifyMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in QW_SCH_TASK_DLOG("processNotify start, node:%p, handle:%p", node, pMsg->info.handle); - QW_ERR_RET(qwProcessNotify(QW_FPARAMS(), &qwMsg)); + code = qwProcessNotify(QW_FPARAMS(), &qwMsg); - QW_SCH_TASK_DLOG("processNotify end, node:%p", node); + QW_SCH_TASK_DLOG("processNotify end, node:%p, code:%x", node, code); return TSDB_CODE_SUCCESS; } @@ -695,7 +705,7 @@ int32_t qWorkerProcessHbMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int64_ SSchedulerHbReq req = {0}; SQWorker *mgmt = (SQWorker *)qWorkerMgmt; - qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE); + QW_ERR_RET(qwUpdateTimeInQueue(mgmt, ts, FETCH_QUEUE)); QW_STAT_INC(mgmt->stat.msgStat.hbProcessed, 1); if (NULL == pMsg->pCont) { @@ -717,9 +727,9 @@ int32_t qWorkerProcessHbMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int64_ QW_SCH_DLOG("processHb start, node:%p, handle:%p", node, pMsg->info.handle); - QW_ERR_RET(qwProcessHb(mgmt, &qwMsg, &req)); + code = qwProcessHb(mgmt, &qwMsg, &req); - QW_SCH_DLOG("processHb end, node:%p", node); + QW_SCH_DLOG("processHb end, node:%p, code:%x", node, code); return TSDB_CODE_SUCCESS; } @@ -735,7 +745,7 @@ int32_t qWorkerProcessDeleteMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, SD QW_STAT_INC(mgmt->stat.msgStat.deleteProcessed, 1); - tDeserializeSVDeleteReq(pMsg->pCont, pMsg->contLen, &req); + QW_ERR_RET(tDeserializeSVDeleteReq(pMsg->pCont, pMsg->contLen, &req)); uint64_t sId = req.sId; uint64_t qId = req.queryId; diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 06559093a8..0451532cbe 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -323,34 +323,52 @@ static void freeExplainExecItem(void *param) { int32_t qwSendExplainResponse(QW_FPARAMS_DEF, SQWTaskCtx *ctx) { + int32_t code = TSDB_CODE_SUCCESS; qTaskInfo_t taskHandle = ctx->taskHandle; ctx->explainRsped = true; SArray *execInfoList = taosArrayInit(4, sizeof(SExplainExecInfo)); - QW_ERR_RET(qGetExplainExecInfo(taskHandle, execInfoList)); + if (NULL == execInfoList) { + QW_ERR_JRET(terrno); + } + + QW_ERR_JRET(qGetExplainExecInfo(taskHandle, execInfoList)); if (ctx->localExec) { SExplainLocalRsp localRsp = {0}; localRsp.rsp.numOfPlans = taosArrayGetSize(execInfoList); SExplainExecInfo *pExec = taosMemoryCalloc(localRsp.rsp.numOfPlans, sizeof(SExplainExecInfo)); + if (NULL == pExec) { + QW_ERR_JRET(terrno); + } memcpy(pExec, taosArrayGet(execInfoList, 0), localRsp.rsp.numOfPlans * sizeof(SExplainExecInfo)); localRsp.rsp.subplanInfo = pExec; localRsp.qId = qId; localRsp.tId = tId; localRsp.rId = rId; localRsp.eId = eId; - taosArrayPush(ctx->explainRes, &localRsp); + if (NULL == taosArrayPush(ctx->explainRes, &localRsp)) { + QW_ERR_JRET(terrno); + } + taosArrayDestroy(execInfoList); + execInfoList = NULL; } else { SRpcHandleInfo connInfo = ctx->ctrlConnInfo; connInfo.ahandle = NULL; int32_t code = qwBuildAndSendExplainRsp(&connInfo, execInfoList); taosArrayDestroyEx(execInfoList, freeExplainExecItem); + execInfoList = NULL; + QW_ERR_RET(code); } - return TSDB_CODE_SUCCESS; +_return: + + taosArrayDestroyEx(execInfoList, freeExplainExecItem); + + return code; } @@ -544,7 +562,7 @@ int32_t qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) { void qwCloseRef(void) { taosWLockLatch(&gQwMgmt.lock); if (atomic_load_32(&gQwMgmt.qwNum) <= 0 && gQwMgmt.qwRef >= 0) { - taosCloseRef(gQwMgmt.qwRef); + (void)taosCloseRef(gQwMgmt.qwRef); // ignore error gQwMgmt.qwRef = -1; } taosWUnLockLatch(&gQwMgmt.lock); @@ -561,7 +579,7 @@ void qwDestroyImpl(void *pMgmt) { int32_t schStatusCount = 0; qDebug("start to destroy qworker, type:%d, id:%d, handle:%p", nodeType, nodeId, mgmt); - taosTmrStop(mgmt->hbTimer); + (void)taosTmrStop(mgmt->hbTimer); //ignore error mgmt->hbTimer = NULL; taosTmrCleanUp(mgmt->timer); @@ -652,24 +670,33 @@ int64_t qwGetTimeInQueue(SQWorker *mgmt, EQueueType type) { return pStat->num ? (pStat->total / pStat->num) : 0; default: qError("unsupported queue type %d", type); + break; } return -1; } void qwClearExpiredSch(SQWorker *mgmt, SArray *pExpiredSch) { + int32_t code = TSDB_CODE_SUCCESS; int32_t num = taosArrayGetSize(pExpiredSch); for (int32_t i = 0; i < num; ++i) { uint64_t *sId = taosArrayGet(pExpiredSch, i); SQWSchStatus *pSch = NULL; - if (qwAcquireScheduler(mgmt, *sId, QW_WRITE, &pSch)) { + if (NULL == sId) { + qError("get the %dth sch failed, code:%x", i, terrno); + break; + } + + code = qwAcquireScheduler(mgmt, *sId, QW_WRITE, &pSch); + if (TSDB_CODE_SUCCESS != code) { + qError("acquire sch %" PRIx64 " failed, code:%x", *sId, code); continue; } if (taosHashGetSize(pSch->tasksHash) <= 0) { qwDestroySchStatus(pSch); - taosHashRemove(mgmt->schHash, sId, sizeof(*sId)); - qDebug("sch %" PRIx64 " destroyed", *sId); + code = taosHashRemove(mgmt->schHash, sId, sizeof(*sId)); + qDebug("sch %" PRIx64 " destroy result code:%x", *sId, code); } qwReleaseScheduler(QW_WRITE, mgmt); diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 084ee7efe3..5840cc0245 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -1372,7 +1372,7 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, void **qWorkerMgmt, const S _return: if (mgmt->refId >= 0) { - qwRelease(mgmt->refId); // ignore error + (void)qwRelease(mgmt->refId); // ignore error } else { taosHashCleanup(mgmt->schHash); taosHashCleanup(mgmt->ctxHash); From a5073355bbf8be73bb46d48494ad97dcab7aefa1 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Mon, 15 Jul 2024 14:56:23 +0800 Subject: [PATCH 33/40] fix: regex hash --- source/util/src/tcompare.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index c7b6d78868..94c4e27487 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1228,7 +1228,7 @@ static void checkRegexCache(void* param, void* tmrId) { UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); while ((ppUsingRegex != NULL)) { if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { - taosHashRelease(sRegexCache.regexHash, ppUsingRegex); + taosHashRemove(sRegexCache.regexHash, ppUsingRegex); } ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } @@ -1312,24 +1312,20 @@ static UsingRegex **getRegComp(const char *pPattern) { while (true) { int code = taosHashPut(sRegexCache.regexHash, pPattern, strlen(pPattern), &pUsingRegex, sizeof(UsingRegex *)); - if (code != 0) { - if (terrno == TSDB_CODE_DUP_KEY) { - terrno = TSDB_CODE_SUCCESS; - ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); - if (ppUsingRegex) { - if (*ppUsingRegex != pUsingRegex) { - regexCacheFree(&pUsingRegex); - } - pUsingRegex = (*ppUsingRegex); - break; - } else { - continue; - } - } else { + if (code != 0 && code != TSDB_CODE_DUP_KEY) { + regexCacheFree(&pUsingRegex); + uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); + return NULL; + } + ppUsingRegex = (UsingRegex **)taosHashAcquire(sRegexCache.regexHash, pPattern, strlen(pPattern)); + if (ppUsingRegex) { + if (*ppUsingRegex != pUsingRegex) { regexCacheFree(&pUsingRegex); - uError("Failed to put regex pattern %s into cache, exception internal error.", pPattern); - return NULL; } + pUsingRegex = (*ppUsingRegex); + break; + } else { + continue; } } pUsingRegex->lastUsedTime = taosGetTimestampSec(); From 50d7a458e524b00e3c2e70b6240aaf2d207b55ac Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 15 Jul 2024 15:40:39 +0800 Subject: [PATCH 34/40] fix: qworker ut cases --- source/libs/qworker/test/qworkerTests.cpp | 167 ++++++++++++++-------- 1 file changed, 105 insertions(+), 62 deletions(-) diff --git a/source/libs/qworker/test/qworkerTests.cpp b/source/libs/qworker/test/qworkerTests.cpp index 4a0d74a6e3..b60e285cb4 100644 --- a/source/libs/qworker/test/qworkerTests.cpp +++ b/source/libs/qworker/test/qworkerTests.cpp @@ -130,7 +130,7 @@ void qwtBuildFetchReqMsg(SResFetchReq *fetchMsg, SRpcMsg *fetchRpc) { fetchRpc->contLen = sizeof(SResFetchReq); } -void qwtBuildDropReqMsg(STaskDropReq *dropMsg, SRpcMsg *dropRpc) { +int qwtBuildDropReqMsg(STaskDropReq *dropMsg, SRpcMsg *dropRpc) { dropMsg->sId = 1; dropMsg->queryId = atomic_load_64(&qwtTestQueryId); dropMsg->taskId = 1; @@ -164,6 +164,10 @@ int32_t qwtStringToPlan(const char *str, SSubplan **subplan) { int32_t qwtPutReqToFetchQueue(void *node, struct SRpcMsg *pMsg) { taosWLockLatch(&qwtTestFetchQueueLock); struct SRpcMsg *newMsg = (struct SRpcMsg *)taosMemoryCalloc(1, sizeof(struct SRpcMsg)); + if (NULL == newMsg) { + printf("malloc failed"); + assert(0); + } memcpy(newMsg, pMsg, sizeof(struct SRpcMsg)); qwtTestFetchQueue[qwtTestFetchQueueWIdx++] = newMsg; if (qwtTestFetchQueueWIdx >= qwtTestFetchQueueSize) { @@ -178,7 +182,10 @@ int32_t qwtPutReqToFetchQueue(void *node, struct SRpcMsg *pMsg) { } taosWUnLockLatch(&qwtTestFetchQueueLock); - tsem_post(&qwtTestFetchSem); + if (tsem_post(&qwtTestFetchSem) < 0) { + printf("tsem_post failed, errno:%d", errno); + assert(0); + } return 0; } @@ -186,6 +193,10 @@ int32_t qwtPutReqToFetchQueue(void *node, struct SRpcMsg *pMsg) { int32_t qwtPutReqToQueue(void *node, EQueueType qtype, struct SRpcMsg *pMsg) { taosWLockLatch(&qwtTestQueryQueueLock); struct SRpcMsg *newMsg = (struct SRpcMsg *)taosMemoryCalloc(1, sizeof(struct SRpcMsg)); + if (NULL == newMsg) { + printf("malloc failed"); + assert(0); + } memcpy(newMsg, pMsg, sizeof(struct SRpcMsg)); qwtTestQueryQueue[qwtTestQueryQueueWIdx++] = newMsg; if (qwtTestQueryQueueWIdx >= qwtTestQueryQueueSize) { @@ -200,22 +211,34 @@ int32_t qwtPutReqToQueue(void *node, EQueueType qtype, struct SRpcMsg *pMsg) { } taosWUnLockLatch(&qwtTestQueryQueueLock); - tsem_post(&qwtTestQuerySem); + if (tsem_post(&qwtTestQuerySem) < 0) { + printf("tsem_post failed, errno:%d", errno); + assert(0); + } return 0; } void qwtSendReqToDnode(void *pVnode, struct SEpSet *epSet, struct SRpcMsg *pReq) {} -void qwtRpcSendResponse(const SRpcMsg *pRsp) { +int qwtRpcSendResponse(const SRpcMsg *pRsp) { + int32_t code = 0; switch (pRsp->msgType) { case TDMT_SCH_QUERY_RSP: case TDMT_SCH_MERGE_QUERY_RSP: { SQueryTableRsp *rsp = (SQueryTableRsp *)pRsp->pCont; if (pRsp->code) { - qwtBuildDropReqMsg(&qwtdropMsg, &qwtdropRpc); - qwtPutReqToFetchQueue((void *)0x1, &qwtdropRpc); + code = qwtBuildDropReqMsg(&qwtdropMsg, &qwtdropRpc); + if (code) { + assert(0); + return code; + } + code = qwtPutReqToFetchQueue((void *)0x1, &qwtdropRpc); + if (code) { + assert(0); + return code; + } } rpcFreeCont(rsp); @@ -227,13 +250,25 @@ void qwtRpcSendResponse(const SRpcMsg *pRsp) { if (0 == pRsp->code && 0 == rsp->completed) { qwtBuildFetchReqMsg(&qwtfetchMsg, &qwtfetchRpc); - qwtPutReqToFetchQueue((void *)0x1, &qwtfetchRpc); + code = qwtPutReqToFetchQueue((void *)0x1, &qwtfetchRpc); + if (code) { + assert(0); + return code; + } rpcFreeCont(rsp); return; } - qwtBuildDropReqMsg(&qwtdropMsg, &qwtdropRpc); - qwtPutReqToFetchQueue((void *)0x1, &qwtdropRpc); + code = qwtBuildDropReqMsg(&qwtdropMsg, &qwtdropRpc); + if (code) { + assert(0); + return code; + } + code = qwtPutReqToFetchQueue((void *)0x1, &qwtdropRpc); + if (code) { + assert(0); + return code; + } rpcFreeCont(rsp); break; @@ -245,9 +280,11 @@ void qwtRpcSendResponse(const SRpcMsg *pRsp) { qwtTestCaseFinished = true; break; } + default: + break; } - return; + return code; } int32_t qwtCreateExecTask(void *tsdb, int32_t vgId, uint64_t taskId, struct SSubplan *pPlan, qTaskInfo_t *pTaskInfo, @@ -292,6 +329,9 @@ int32_t qwtExecTask(qTaskInfo_t tinfo, SSDataBlock **pRes, uint64_t *useconds) { if (endExec) { *pRes = (SSDataBlock *)taosMemoryCalloc(1, sizeof(SSDataBlock)); + if (NULL == *pRes) { + return terrno; + } (*pRes)->info.rows = taosRand() % 1000 + 1; } else { *pRes = NULL; @@ -631,7 +671,7 @@ void *queryThread(void *param) { while (!qwtTestStop) { qwtBuildQueryReqMsg(&queryRpc); - qWorkerProcessQueryMsg(mockPointer, mgmt, &queryRpc, 0); + (void)qWorkerProcessQueryMsg(mockPointer, mgmt, &queryRpc, 0); // ignore error if (qwtTestEnableSleep) { taosUsleep(taosRand() % 5); } @@ -653,7 +693,7 @@ void *fetchThread(void *param) { while (!qwtTestStop) { qwtBuildFetchReqMsg(&fetchMsg, &fetchRpc); - code = qWorkerProcessFetchMsg(mockPointer, mgmt, &fetchRpc, 0); + (void)qWorkerProcessFetchMsg(mockPointer, mgmt, &fetchRpc, 0); // ignore error if (qwtTestEnableSleep) { taosUsleep(taosRand() % 5); } @@ -674,8 +714,11 @@ void *dropThread(void *param) { STaskDropReq dropMsg = {0}; while (!qwtTestStop) { - qwtBuildDropReqMsg(&dropMsg, &dropRpc); - code = qWorkerProcessDropMsg(mockPointer, mgmt, &dropRpc, 0); + if (0 != qwtBuildDropReqMsg(&dropMsg, &dropRpc)) { + break; + } + (void)qWorkerProcessDropMsg(mockPointer, mgmt, &dropRpc, 0); // ignore error + if (qwtTestEnableSleep) { taosUsleep(taosRand() % 5); } @@ -700,7 +743,7 @@ void *qwtclientThread(void *param) { qwtTestCaseFinished = false; qwtBuildQueryReqMsg(&queryRpc); - qwtPutReqToQueue((void *)0x1, QUERY_QUEUE, &queryRpc); + (void)qwtPutReqToQueue((void *)0x1, QUERY_QUEUE, &queryRpc); //ignore error while (!qwtTestCaseFinished) { taosUsleep(1); @@ -752,9 +795,9 @@ void *queryQueueThread(void *param) { } if (TDMT_SCH_QUERY == queryRpc->msgType) { - qWorkerProcessQueryMsg(mockPointer, mgmt, queryRpc, 0); + (void)qWorkerProcessQueryMsg(mockPointer, mgmt, queryRpc, 0); //ignore error } else if (TDMT_SCH_QUERY_CONTINUE == queryRpc->msgType) { - qWorkerProcessCQueryMsg(mockPointer, mgmt, queryRpc, 0); + (void)qWorkerProcessCQueryMsg(mockPointer, mgmt, queryRpc, 0); //ignore error } else { printf("unknown msg in query queue, type:%d\n", queryRpc->msgType); assert(0); @@ -810,16 +853,16 @@ void *fetchQueueThread(void *param) { switch (fetchRpc->msgType) { case TDMT_SCH_FETCH: case TDMT_SCH_MERGE_FETCH: - qWorkerProcessFetchMsg(mockPointer, mgmt, fetchRpc, 0); + (void)qWorkerProcessFetchMsg(mockPointer, mgmt, fetchRpc, 0); //ignore error break; case TDMT_SCH_CANCEL_TASK: //qWorkerProcessCancelMsg(mockPointer, mgmt, fetchRpc, 0); break; case TDMT_SCH_DROP_TASK: - qWorkerProcessDropMsg(mockPointer, mgmt, fetchRpc, 0); + (void)qWorkerProcessDropMsg(mockPointer, mgmt, fetchRpc, 0); //ignore error break; case TDMT_SCH_TASK_NOTIFY: - qWorkerProcessNotifyMsg(mockPointer, mgmt, fetchRpc, 0); + (void)qWorkerProcessNotifyMsg(mockPointer, mgmt, fetchRpc, 0); //ignore error break; default: printf("unknown msg type:%d in fetch queue", fetchRpc->msgType); @@ -853,7 +896,7 @@ TEST(seqTest, normalCase) { qwtBuildQueryReqMsg(&queryRpc); qwtBuildFetchReqMsg(&qwtfetchMsg, &fetchRpc); - qwtBuildDropReqMsg(&qwtdropMsg, &dropRpc); + (void)qwtBuildDropReqMsg(&qwtdropMsg, &dropRpc); //ignore error stubSetStringToPlan(); stubSetRpcSendResponse(); @@ -898,7 +941,7 @@ TEST(seqTest, cancelFirst) { qwtInitLogFile(); qwtBuildQueryReqMsg(&queryRpc); - qwtBuildDropReqMsg(&qwtdropMsg, &dropRpc); + (void)qwtBuildDropReqMsg(&qwtdropMsg, &dropRpc); //ignore error stubSetStringToPlan(); stubSetRpcSendResponse(); @@ -954,7 +997,7 @@ TEST(seqTest, randCase) { if (r >= 0 && r < maxr / 5) { printf("Query,%d\n", t++); qwtBuildQueryReqMsg(&queryRpc); - code = qWorkerProcessQueryMsg(mockPointer, mgmt, &queryRpc, 0); + (void)qWorkerProcessQueryMsg(mockPointer, mgmt, &queryRpc, 0); //ignore error } else if (r >= maxr / 5 && r < maxr * 2 / 5) { // printf("Ready,%d\n", t++); // qwtBuildReadyReqMsg(&readyMsg, &readyRpc); @@ -965,14 +1008,14 @@ TEST(seqTest, randCase) { } else if (r >= maxr * 2 / 5 && r < maxr * 3 / 5) { printf("Fetch,%d\n", t++); qwtBuildFetchReqMsg(&fetchMsg, &fetchRpc); - code = qWorkerProcessFetchMsg(mockPointer, mgmt, &fetchRpc, 0); + (void)qWorkerProcessFetchMsg(mockPointer, mgmt, &fetchRpc, 0); //ignore error if (qwtTestEnableSleep) { taosUsleep(1); } } else if (r >= maxr * 3 / 5 && r < maxr * 4 / 5) { printf("Drop,%d\n", t++); - qwtBuildDropReqMsg(&dropMsg, &dropRpc); - code = qWorkerProcessDropMsg(mockPointer, mgmt, &dropRpc, 0); + (void)qwtBuildDropReqMsg(&dropMsg, &dropRpc); //ignore error + (void)qWorkerProcessDropMsg(mockPointer, mgmt, &dropRpc, 0); //ignore error if (qwtTestEnableSleep) { taosUsleep(1); } @@ -1018,14 +1061,14 @@ TEST(seqTest, multithreadRand) { ASSERT_EQ(code, 0); TdThreadAttr thattr; - taosThreadAttrInit(&thattr); + (void)taosThreadAttrInit(&thattr); //ignore error TdThread t1, t2, t3, t4, t5, t6; - taosThreadCreate(&(t1), &thattr, queryThread, mgmt); - // taosThreadCreate(&(t2), &thattr, readyThread, NULL); - taosThreadCreate(&(t3), &thattr, fetchThread, NULL); - taosThreadCreate(&(t4), &thattr, dropThread, NULL); - taosThreadCreate(&(t6), &thattr, fetchQueueThread, mgmt); + (void)taosThreadCreate(&(t1), &thattr, queryThread, mgmt); //ignore error + // (void)taosThreadCreate(&(t2), &thattr, readyThread, NULL); //ignore error + (void)taosThreadCreate(&(t3), &thattr, fetchThread, NULL); //ignore error + (void)taosThreadCreate(&(t4), &thattr, dropThread, NULL); //ignore error + (void)taosThreadCreate(&(t6), &thattr, fetchQueueThread, mgmt); //ignore error while (true) { if (qwtTestDeadLoop) { @@ -1083,16 +1126,16 @@ TEST(rcTest, shortExecshortDelay) { qwtTestMaxExecTaskUsec = 0; qwtTestReqMaxDelayUsec = 0; - tsem_init(&qwtTestQuerySem, 0, 0); - tsem_init(&qwtTestFetchSem, 0, 0); + (void)tsem_init(&qwtTestQuerySem, 0, 0); //ignore error + (void)tsem_init(&qwtTestFetchSem, 0, 0); //ignore error TdThreadAttr thattr; - taosThreadAttrInit(&thattr); + (void)taosThreadAttrInit(&thattr); //ignore error TdThread t1, t2, t3, t4, t5; - taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); - taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); - taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); + (void)taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); //ignore error + (void)taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); //ignore error + (void)taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); //ignore error while (true) { if (qwtTestDeadLoop) { @@ -1114,8 +1157,8 @@ TEST(rcTest, shortExecshortDelay) { if (qwtTestCaseFinished) { if (qwtTestQuitThreadNum < 3) { - tsem_post(&qwtTestQuerySem); - tsem_post(&qwtTestFetchSem); + (void)tsem_post(&qwtTestQuerySem); //ignore error + (void)tsem_post(&qwtTestFetchSem); //ignore error taosUsleep(10); } @@ -1166,16 +1209,16 @@ TEST(rcTest, longExecshortDelay) { qwtTestMaxExecTaskUsec = 1000000; qwtTestReqMaxDelayUsec = 0; - tsem_init(&qwtTestQuerySem, 0, 0); - tsem_init(&qwtTestFetchSem, 0, 0); + (void)tsem_init(&qwtTestQuerySem, 0, 0); //ignore error + (void)tsem_init(&qwtTestFetchSem, 0, 0); //ignore error TdThreadAttr thattr; - taosThreadAttrInit(&thattr); + (void)taosThreadAttrInit(&thattr); //ignore error TdThread t1, t2, t3, t4, t5; - taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); - taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); - taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); + (void)taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); //ignore error + (void)taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); //ignore error + (void)taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); //ignore error while (true) { if (qwtTestDeadLoop) { @@ -1197,8 +1240,8 @@ TEST(rcTest, longExecshortDelay) { if (qwtTestCaseFinished) { if (qwtTestQuitThreadNum < 3) { - tsem_post(&qwtTestQuerySem); - tsem_post(&qwtTestFetchSem); + (void)tsem_post(&qwtTestQuerySem); //ignore error + (void)tsem_post(&qwtTestFetchSem); //ignore error taosUsleep(10); } @@ -1249,16 +1292,16 @@ TEST(rcTest, shortExeclongDelay) { qwtTestMaxExecTaskUsec = 0; qwtTestReqMaxDelayUsec = 1000000; - tsem_init(&qwtTestQuerySem, 0, 0); - tsem_init(&qwtTestFetchSem, 0, 0); + (void)tsem_init(&qwtTestQuerySem, 0, 0); //ignore error + (void)tsem_init(&qwtTestFetchSem, 0, 0); //ignore error TdThreadAttr thattr; - taosThreadAttrInit(&thattr); + (void)taosThreadAttrInit(&thattr); //ignore error TdThread t1, t2, t3, t4, t5; - taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); - taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); - taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); + (void)taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); //ignore error + (void)taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); //ignore error + (void)taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); //ignore error while (true) { if (qwtTestDeadLoop) { @@ -1280,8 +1323,8 @@ TEST(rcTest, shortExeclongDelay) { if (qwtTestCaseFinished) { if (qwtTestQuitThreadNum < 3) { - tsem_post(&qwtTestQuerySem); - tsem_post(&qwtTestFetchSem); + (void)tsem_post(&qwtTestQuerySem); //ignore error + (void)tsem_post(&qwtTestFetchSem); //ignore error taosUsleep(10); } @@ -1327,16 +1370,16 @@ TEST(rcTest, dropTest) { code = qWorkerInit(NODE_TYPE_VNODE, 1, &mgmt, &msgCb); ASSERT_EQ(code, 0); - tsem_init(&qwtTestQuerySem, 0, 0); - tsem_init(&qwtTestFetchSem, 0, 0); + (void)tsem_init(&qwtTestQuerySem, 0, 0); //ignore error + (void)tsem_init(&qwtTestFetchSem, 0, 0); //ignore error TdThreadAttr thattr; - taosThreadAttrInit(&thattr); + (void)taosThreadAttrInit(&thattr); //ignore error TdThread t1, t2, t3, t4, t5; - taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); - taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); - taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); + (void)taosThreadCreate(&(t1), &thattr, qwtclientThread, mgmt); //ignore error + (void)taosThreadCreate(&(t2), &thattr, queryQueueThread, mgmt); //ignore error + (void)taosThreadCreate(&(t3), &thattr, fetchQueueThread, mgmt); //ignore error while (true) { if (qwtTestDeadLoop) { From 8907acec366da77248a5e33dd2a3c1e9fb62476e Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 16:06:47 +0800 Subject: [PATCH 35/40] define some macro --- include/util/tutil.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index d1a18dc3e8..5360454501 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -56,7 +56,7 @@ void taosIpPort2String(uint32_t ip, uint16_t port, char *str); void *tmemmem(const char *haystack, int hlen, const char *needle, int nlen); -int32_t parseCfgReal(const char* str, double* out); +int32_t parseCfgReal(const char *str, double *out); static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, size_t inLen, char *target) { T_MD5_CTX context; @@ -84,9 +84,9 @@ static FORCE_INLINE void taosEncryptPass_c(uint8_t *inBuf, size_t len, char *tar static FORCE_INLINE int32_t taosCreateMD5Hash(char *pBuf, int32_t len) { T_MD5_CTX ctx; tMD5Init(&ctx); - tMD5Update(&ctx, (uint8_t*)pBuf, len); + tMD5Update(&ctx, (uint8_t *)pBuf, len); tMD5Final(&ctx); - char* p = pBuf; + char *p = pBuf; int32_t resLen = 0; for (uint8_t i = 0; i < tListLen(ctx.digest); ++i) { resLen += snprintf(p, 3, "%02x", ctx.digest[i]); @@ -147,6 +147,29 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, #define TCONTAINER_OF(ptr, type, member) ((type *)((char *)(ptr)-offsetof(type, member))) +#define TAOS_CHECK_RETURN(CMD) \ + do { \ + int32_t code = (CMD); \ + if (code != TSDB_CODE_SUCCESS) { \ + return (terrno = code); \ + } \ + } while (0) + +#define TAOS_CHECK_GOTO(CODE, LINO, LABEL) \ + do { \ + if ((CODE) != TSDB_CODE_SUCCESS) { \ + if ((LINO) != NULL) { \ + *(LINO) = __LINE__; \ + } \ + goto LABEL; \ + } \ + } while (0) + +#define TAOS_RETURN(code) \ + do { \ + return (terrno = (code)); \ + } while (0) + #ifdef __cplusplus } #endif From bc70d8e3384b460f00f784996f0640c5abc99bf3 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 16:08:20 +0800 Subject: [PATCH 36/40] more define --- include/util/tutil.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index 5360454501..e6d9b4fdd9 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -147,11 +147,16 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, #define TCONTAINER_OF(ptr, type, member) ((type *)((char *)(ptr)-offsetof(type, member))) +#define TAOS_RETURN(code) \ + do { \ + return (terrno = (code)); \ + } while (0) + #define TAOS_CHECK_RETURN(CMD) \ do { \ int32_t code = (CMD); \ if (code != TSDB_CODE_SUCCESS) { \ - return (terrno = code); \ + TAOS_RETURN(code); \ } \ } while (0) @@ -165,11 +170,6 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, } \ } while (0) -#define TAOS_RETURN(code) \ - do { \ - return (terrno = (code)); \ - } while (0) - #ifdef __cplusplus } #endif From d6ba420eb8e8fa58992147ec1d5a7332591ad953 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 16:29:08 +0800 Subject: [PATCH 37/40] more fix --- include/util/tutil.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index e6d9b4fdd9..d3003c27ba 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -163,8 +163,8 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, #define TAOS_CHECK_GOTO(CODE, LINO, LABEL) \ do { \ if ((CODE) != TSDB_CODE_SUCCESS) { \ - if ((LINO) != NULL) { \ - *(LINO) = __LINE__; \ + if (LINO) { \ + *((int32_t *)(LINO)) = __LINE__; \ } \ goto LABEL; \ } \ From ae67829b674d4bdfb29a3e10fc344b7a382071bd Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Mon, 15 Jul 2024 16:32:32 +0800 Subject: [PATCH 38/40] fix: hash remove --- source/util/src/tcompare.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 94c4e27487..09599cead4 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1228,7 +1228,9 @@ static void checkRegexCache(void* param, void* tmrId) { UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL); while ((ppUsingRegex != NULL)) { if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) { - taosHashRemove(sRegexCache.regexHash, ppUsingRegex); + size_t len = 0; + char* key = (char*)taosHashGetKey(ppUsingRegex, &len); + taosHashRemove(sRegexCache.regexHash, key, len); } ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex); } From b81493b7b426a1328b9971d781c5eacd115a4364 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 15 Jul 2024 17:32:36 +0800 Subject: [PATCH 39/40] fix: compile issues --- source/libs/qworker/test/qworkerTests.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/libs/qworker/test/qworkerTests.cpp b/source/libs/qworker/test/qworkerTests.cpp index b60e285cb4..d292b271c5 100644 --- a/source/libs/qworker/test/qworkerTests.cpp +++ b/source/libs/qworker/test/qworkerTests.cpp @@ -137,23 +137,25 @@ int qwtBuildDropReqMsg(STaskDropReq *dropMsg, SRpcMsg *dropRpc) { int32_t msgSize = tSerializeSTaskDropReq(NULL, 0, dropMsg); if (msgSize < 0) { - return; + return terrno; } char *msg = (char*)taosMemoryCalloc(1, msgSize); if (NULL == msg) { - return; + return terrno; } if (tSerializeSTaskDropReq(msg, msgSize, dropMsg) < 0) { taosMemoryFree(msg); - return; + return terrno; } dropRpc->msgType = TDMT_SCH_DROP_TASK; dropRpc->pCont = msg; dropRpc->contLen = msgSize; + + return TSDB_CODE_SUCCESS; } int32_t qwtStringToPlan(const char *str, SSubplan **subplan) { @@ -256,7 +258,7 @@ int qwtRpcSendResponse(const SRpcMsg *pRsp) { return code; } rpcFreeCont(rsp); - return; + return code; } code = qwtBuildDropReqMsg(&qwtdropMsg, &qwtdropRpc); From f3e2ba31dd767fa66f3d3f614693ff7cad5886a5 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 19:29:27 +0800 Subject: [PATCH 40/40] change the macro --- include/util/tutil.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index d3003c27ba..d1fc11d0fe 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -160,14 +160,15 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, } \ } while (0) -#define TAOS_CHECK_GOTO(CODE, LINO, LABEL) \ - do { \ - if ((CODE) != TSDB_CODE_SUCCESS) { \ - if (LINO) { \ - *((int32_t *)(LINO)) = __LINE__; \ - } \ - goto LABEL; \ - } \ +#define TAOS_CHECK_GOTO(CMD, LINO, LABEL) \ + do { \ + code = (CMD); \ + if (code != TSDB_CODE_SUCCESS) { \ + if (LINO) { \ + *((int32_t *)(LINO)) = __LINE__; \ + } \ + goto LABEL; \ + } \ } while (0) #ifdef __cplusplus