diff --git a/README-CN.md b/README-CN.md index 437d671bb9..a5d239a532 100644 --- a/README-CN.md +++ b/README-CN.md @@ -60,7 +60,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev 为了在 Ubuntu/Debian 系统上编译 [taos-tools](https://github.com/taosdata/taos-tools) 需要安装如下软件: ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config ``` ### CentOS 7.9 @@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel ``` -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` #### CentOS 8/Rocky Linux @@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` 注意:由于 snappy 缺乏 pkg-config 支持(参考 [链接](https://github.com/google/snappy/pull/86)),会导致 cmake 提示无法发现 libsnappy,实际上工作正常。 diff --git a/README.md b/README.md index 6aec756ec7..05c1c075f0 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev To build the [taosTools](https://github.com/taosdata/taos-tools) on Ubuntu/Debian, the following packages need to be installed. ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config ``` ### CentOS 7.9 @@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel #### CentOS 7.9 ``` -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` #### CentOS 8/Rocky Linux @@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` Note: Since snappy lacks pkg-config support (refer to [link](https://github.com/google/snappy/pull/86)), it leads a cmake prompt libsnappy not found. But snappy still works well. diff --git a/cmake/cmake.version b/cmake/cmake.version index 9faa7c75dd..b4084bd095 100644 --- a/cmake/cmake.version +++ b/cmake/cmake.version @@ -2,7 +2,7 @@ IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "3.0.1.8") + SET(TD_VER_NUMBER "3.0.2.0") ENDIF () IF (DEFINED VERCOMPATIBLE) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 2a7b76d768..75679a8ff5 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG e07f41b + GIT_TAG 566540d SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 2d7bcf6592..d468e0acd3 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG e62c5ea + GIT_TAG 121c8a3 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index a12406fe43..0aec22fbc0 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -27,7 +27,6 @@ database_option: { | PRECISION {'ms' | 'us' | 'ns'} | REPLICA value | RETENTIONS ingestion_duration:keep_duration ... - | STRICT {'off' | 'on'} | WAL_LEVEL {1 | 2} | VGROUPS value | SINGLE_STABLE {0 | 1} @@ -61,9 +60,6 @@ database_option: { - PRECISION: specifies the precision at which a database records timestamps. Enter ms for milliseconds, us for microseconds, or ns for nanoseconds. The default value is ms. - REPLICA: specifies the number of replicas that are made of the database. Enter 1 or 3. The default value is 1. The value of the REPLICA parameter cannot exceed the number of dnodes in the cluster. - RETENTIONS: specifies the retention period for data aggregated at various intervals. For example, RETENTIONS 15s:7d,1m:21d,15m:50d indicates that data aggregated every 15 seconds is retained for 7 days, data aggregated every 1 minute is retained for 21 days, and data aggregated every 15 minutes is retained for 50 days. You must enter three aggregation intervals and corresponding retention periods. -- STRICT: specifies whether strong data consistency is enabled. The default value is off. - - on: Strong consistency is enabled and implemented through the Raft consensus algorithm. In this mode, an operation is considered successful once it is confirmed by half of the nodes in the cluster. - - off: Strong consistency is disabled. In this mode, an operation is considered successful when it is initiated by the local node. - WAL_LEVEL: specifies whether fsync is enabled. The default value is 1. - 1: WAL is enabled but fsync is disabled. - 2: WAL and fsync are both enabled. diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx index 7b3440ebac..c37738b3f8 100644 --- a/docs/en/14-reference/03-connector/04-java.mdx +++ b/docs/en/14-reference/03-connector/04-java.mdx @@ -878,8 +878,10 @@ The source code of the sample application is under `TDengine/examples/JDBC`: | taos-jdbcdriver version | major changes | | :---------------------: | :--------------------------------------------: | +| 3.0.3 | fix timestamp resolution error for REST connection in jdk17+ version | | 3.0.1 - 3.0.2 | fix the resultSet data is parsed incorrectly sometimes. 3.0.1 is compiled on JDK 11, you are advised to use 3.0.2 in the JDK 8 environment | | 3.0.0 | Support for TDengine 3.0 | +| 2.0.42 | fix wasNull interface return value in WebSocket connection | | 2.0.41 | fix decode method of username and password in REST connection | | 2.0.39 - 2.0.40 | Add REST connection/request timeout parameters | | 2.0.38 | JDBC REST connections add bulk pull function | diff --git a/docs/en/14-reference/04-taosadapter.md b/docs/en/14-reference/04-taosadapter.md index ad00584360..870cebb103 100644 --- a/docs/en/14-reference/04-taosadapter.md +++ b/docs/en/14-reference/04-taosadapter.md @@ -59,6 +59,7 @@ Usage of taosAdapter: --collectd.port int collectd server port. Env "TAOS_ADAPTER_COLLECTD_PORT" (default 6045) --collectd.user string collectd user. Env "TAOS_ADAPTER_COLLECTD_USER" (default "root") --collectd.worker int collectd write worker. Env "TAOS_ADAPTER_COLLECTD_WORKER" (default 10) + --collectd.ttl int collectd data ttl. Env "TAOS_ADAPTER_COLLECTD_TTL" (default 0, means no ttl) -c, --config string config path default /etc/taos/taosadapter.toml --cors.allowAllOrigins cors allow all origins. Env "TAOS_ADAPTER_CORS_ALLOW_ALL_ORIGINS" (default true) --cors.allowCredentials cors allow credentials. Env "TAOS_ADAPTER_CORS_ALLOW_Credentials" @@ -100,6 +101,7 @@ Usage of taosAdapter: --node_exporter.responseTimeout duration node_exporter response timeout. Env "TAOS_ADAPTER_NODE_EXPORTER_RESPONSE_TIMEOUT" (default 5s) --node_exporter.urls strings node_exporter urls. Env "TAOS_ADAPTER_NODE_EXPORTER_URLS" (default [http://localhost:9100]) --node_exporter.user string node_exporter user. Env "TAOS_ADAPTER_NODE_EXPORTER_USER" (default "root") + --node_exporter.ttl int node_exporter data ttl. Env "TAOS_ADAPTER_NODE_EXPORTER_TTL"(default 0, means no ttl) --opentsdb.enable enable opentsdb. Env "TAOS_ADAPTER_OPENTSDB_ENABLE" (default true) --opentsdb_telnet.batchSize int opentsdb_telnet batch size. Env "TAOS_ADAPTER_OPENTSDB_TELNET_BATCH_SIZE" (default 1) --opentsdb_telnet.dbs strings opentsdb_telnet db names. Env "TAOS_ADAPTER_OPENTSDB_TELNET_DBS" (default [opentsdb_telnet,collectd_tsdb,icinga2_tsdb,tcollector_tsdb]) @@ -110,6 +112,7 @@ Usage of taosAdapter: --opentsdb_telnet.ports ints opentsdb telnet tcp port. Env "TAOS_ADAPTER_OPENTSDB_TELNET_PORTS" (default [6046,6047,6048,6049]) --opentsdb_telnet.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TCP_KEEP_ALIVE" --opentsdb_telnet.user string opentsdb_telnet user. Env "TAOS_ADAPTER_OPENTSDB_TELNET_USER" (default "root") + --opentsdb_telnet.ttl int opentsdb_telnet data ttl. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TTL"(default 0, means no ttl) --pool.idleTimeout duration Set idle connection timeout. Env "TAOS_ADAPTER_POOL_IDLE_TIMEOUT" (default 1h0m0s) --pool.maxConnect int max connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_CONNECT" (default 4000) --pool.maxIdle int max idle connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_IDLE" (default 4000) @@ -131,6 +134,7 @@ Usage of taosAdapter: --statsd.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_STATSD_TCP_KEEP_ALIVE" --statsd.user string statsd user. Env "TAOS_ADAPTER_STATSD_USER" (default "root") --statsd.worker int statsd write worker. Env "TAOS_ADAPTER_STATSD_WORKER" (default 10) + --statsd.ttl int statsd data ttl. Env "TAOS_ADAPTER_STATSD_TTL" (default 0, means no ttl) --taosConfigDir string load taos client config path. Env "TAOS_ADAPTER_TAOS_CONFIG_FILE" --version Print the version and exit ``` @@ -195,6 +199,7 @@ Support InfluxDB query parameters as follows. - `precision` The time precision used by TDengine - `u` TDengine user name - `p` TDengine password +- `ttl` The time to live of automatically created sub-table. This value cannot be updated. TDengine will use the ttl value of the frist data of sub-table to create sub-table. For more information, please refer [Create Table](/taos-sql/table/#create-table) Note: InfluxDB token authorization is not supported at present. Only Basic authorization and query parameter validation are supported. Example: curl --request POST http://127.0.0.1:6041/influxdb/v1/write?db=test --user "root:taosdata" --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000" diff --git a/docs/en/14-reference/05-taosbenchmark.md b/docs/en/14-reference/05-taosbenchmark.md index 6e08671e34..19feeb6740 100644 --- a/docs/en/14-reference/05-taosbenchmark.md +++ b/docs/en/14-reference/05-taosbenchmark.md @@ -204,6 +204,12 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) - **-a/--replica ** : Specify the number of replicas when creating the database. The default value is 1. +- **-k/--keep-trying ** : + Keep trying if failed to insert, default is no. Available with v3.0.9+. + +- **-z/--trying-interval ** : + Specify interval between keep trying insert. Valid value is a postive number. Only valid when keep trying be enabled. Available with v3.0.9+. + - **-V/--version** : Show version information only. Users should not use it with other parameters. @@ -231,6 +237,10 @@ The parameters listed in this section apply to all function modes. `filetype` must be set to `insert` in the insertion scenario. See [General Configuration Parameters](#General Configuration Parameters) +- ** keep_trying ** : Keep trying if failed to insert, default is no. Available with v3.0.9+. + +- ** trying_interval ** : Specify interval between keep trying insert. Valid value is a postive number. Only valid when keep trying be enabled. Available with v3.0.9+. + #### Database related configuration parameters The parameters related to database creation are configured in `dbinfo` in the json configuration file, as follows. The other parameters correspond to the database parameters specified when `create database` in [../../taos-sql/database]. diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md index e73441a96b..9c63b4dc03 100644 --- a/docs/en/14-reference/06-taosdump.md +++ b/docs/en/14-reference/06-taosdump.md @@ -19,7 +19,7 @@ Users should not use taosdump to back up raw data, environment settings, hardwar There are two ways to install taosdump: -- Install the taosTools official installer. Please find taosTools from [All download links](https://www.tdengine.com/all-downloads) page and download and install it. +- Install the taosTools official installer. Please find taosTools from [Release History](https://docs.taosdata.com/releases/tools/) page and download and install it. - Compile taos-tools separately and install it. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details. diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md index bb5516ae70..b6bfa4bc7d 100644 --- a/docs/en/14-reference/12-config/index.md +++ b/docs/en/14-reference/12-config/index.md @@ -153,11 +153,11 @@ The parameters described in this document by the effect that they have on the sy | Meaning | Execution policy for query statements | | Unit | None | | Default | 1 | -| Notes | 1: Run queries on vnodes and not on qnodes | +| Value Range | 1: Run queries on vnodes and not on qnodes 2: Run subtasks without scan operators on qnodes and subtasks with scan operators on vnodes. -3: Only run scan operators on vnodes; run all other operators on qnodes. +3: Only run scan operators on vnodes; run all other operators on qnodes. | ### querySmaOptimize @@ -173,6 +173,14 @@ The parameters described in this document by the effect that they have on the sy 1: Enable SMA indexing and perform queries from suitable statements on precomputation results.| +### countAlwaysReturnValue + +| Attribute | Description | +| -------- | -------------------------------- | +| Applicable | Server only | +| Meaning | count()/hyperloglog() return value or not if the result data is NULL | +| Vlue Range | 0:Return empty line,1:Return 0 | +| Default | 1 | ### maxNumOfDistinctRes @@ -307,6 +315,14 @@ The charset that takes effect is UTF-8. | Meaning | All data files are stored in this directory | | Default Value | /var/lib/taos | +### tempDir + +| Attribute | Description | +| -------- | ------------------------------------------ | +| Applicable | Server only | +| Meaning | The directory where to put all the temporary files generated during system running | +| Default | /tmp | + ### minimalTmpDirGB | Attribute | Description | @@ -336,89 +352,6 @@ The charset that takes effect is UTF-8. | Value Range | 0-4096 | | Default Value | 2x the CPU cores | -## Time Parameters - -### statusInterval - -| Attribute | Description | -| -------- | --------------------------- | -| Applicable | Server Only | -| Meaning | the interval of dnode reporting status to mnode | -| Unit | second | -| Value Range | 1-10 | -| Default Value | 1 | - -### shellActivityTimer - -| Attribute | Description | -| -------- | --------------------------------- | -| Applicable | Server and Client | -| Meaning | The interval for TDengine CLI to send heartbeat to mnode | -| Unit | second | -| Value Range | 1-120 | -| Default Value | 3 | - -## Performance Optimization Parameters - -### numOfCommitThreads - -| Attribute | Description | -| -------- | ---------------------- | -| Applicable | Server Only | -| Meaning | Maximum of threads for committing to disk | -| Default Value | | - -## Compression Parameters - -### compressMsgSize - -| Attribute | Description | -| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Applicable | Server Only | -| Meaning | The threshold for message size to compress the message. | Set the value to 64330 bytes for good message compression. | -| Unit | bytes | -| Value Range | 0: already compress; >0: compress when message exceeds it; -1: always uncompress | -| Default Value | -1 | - -### compressColData - -| Attribute | Description | -| -------- | --------------------------------------------------------------------------------------- | -| Applicable | Server Only | -| Meaning | The threshold for size of column data to trigger compression for the query result | -| Unit | bytes | -| Value Range | 0: always compress; >0: only compress when the size of any column data exceeds the threshold; -1: always uncompress | -| Default Value | -1 | -| Default Value | -1 | -| Note | available from version 2.3.0.0 | | - -## Continuous Query Parameters | - -### minSlidingTime - -| Attribute | Description | -| ------------- | -------------------------------------------------------- | -| Applicable | Server Only | -| Meaning | Minimum sliding time of time window | -| Unit | millisecond or microsecond , depending on time precision | -| Value Range | 10-1000000 | -| Default Value | 10 | - -### minIntervalTime - -| Attribute | Description | -| ------------- | --------------------------- | -| Applicable | Server Only | -| Meaning | Minimum size of time window | -| Unit | millisecond | -| Value Range | 1-1000000 | -| Default Value | 10 | - -:::info -To prevent system resource from being exhausted by multiple concurrent streams, a random delay is applied on each stream automatically. `maxFirstStreamCompDelay` is the maximum delay time before a continuous query is started the first time. `streamCompDelayRatio` is the ratio for calculating delay time, with the size of the time window as base. `maxStreamCompDelay` is the maximum delay time. The actual delay time is a random time not bigger than `maxStreamCompDelay`. If a continuous query fails, `retryStreamComDelay` is the delay time before retrying it, also not bigger than `maxStreamCompDelay`. - -::: - ## Log Parameters ### logDir @@ -665,6 +598,18 @@ To prevent system resource from being exhausted by multiple concurrent streams, | Value Range | 0: not consistent; 1: consistent. | | Default | 1 | +## Compress Parameters + +### compressMsgSize + +| Attribute | Description | +| -------- | ----------------------------- | +| Applicable | Both Client and Server side | +| Meaning | Whether RPC message is compressed | +| Value Range | -1: none message is compressed; 0: all messages are compressed; N (N>0): messages exceeding N bytes are compressed | +| Default | -1 | + + ## Other Parameters ### enableCoreFile @@ -686,172 +631,60 @@ To prevent system resource from being exhausted by multiple concurrent streams, | Value Range | 0: disable UDF; 1: enabled UDF | | Default Value | 1 | -## Parameter Comparison of TDengine 2.x and 3.0 -| # | **Parameter** | **In 2.x** | **In 3.0** | -| --- | :-----------------: | --------------- | --------------- | -| 1 | firstEp | Yes | Yes | -| 2 | secondEp | Yes | Yes | -| 3 | fqdn | Yes | Yes | -| 4 | serverPort | Yes | Yes | -| 5 | maxShellConns | Yes | Yes | -| 6 | monitor | Yes | Yes | -| 7 | monitorFqdn | No | Yes | -| 8 | monitorPort | No | Yes | -| 9 | monitorInterval | Yes | Yes | -| 10 | monitorMaxLogs | No | Yes | -| 11 | monitorComp | No | Yes | -| 12 | telemetryReporting | Yes | Yes | -| 13 | telemetryInterval | No | Yes | -| 14 | telemetryServer | No | Yes | -| 15 | telemetryPort | No | Yes | -| 16 | queryPolicy | No | Yes | -| 17 | querySmaOptimize | No | Yes | -| 18 | queryRsmaTolerance | No | Yes | -| 19 | queryBufferSize | Yes | Yes | -| 20 | maxNumOfDistinctRes | Yes | Yes | -| 21 | minSlidingTime | Yes | Yes | -| 22 | minIntervalTime | Yes | Yes | -| 23 | countAlwaysReturnValue | Yes | Yes | -| 24 | dataDir | Yes | Yes | -| 25 | minimalDataDirGB | Yes | Yes | -| 26 | supportVnodes | No | Yes | -| 27 | tempDir | Yes | Yes | -| 28 | minimalTmpDirGB | Yes | Yes | -| 29 | compressMsgSize | Yes | Yes | -| 30 | compressColData | Yes | Yes | -| 31 | smlChildTableName | Yes | Yes | -| 32 | smlTagName | Yes | Yes | -| 33 | smlDataFormat | No | Yes | -| 34 | statusInterval | Yes | Yes | -| 35 | shellActivityTimer | Yes | Yes | -| 36 | transPullupInterval | No | Yes | -| 37 | mqRebalanceInterval | No | Yes | -| 38 | ttlUnit | No | Yes | -| 39 | ttlPushInterval | No | Yes | -| 40 | numOfTaskQueueThreads | No | Yes | -| 41 | numOfRpcThreads | No | Yes | -| 42 | numOfCommitThreads | Yes | Yes | -| 43 | numOfMnodeReadThreads | No | Yes | -| 44 | numOfVnodeQueryThreads | No | Yes | -| 45 | numOfVnodeStreamThreads | No | Yes | -| 46 | numOfVnodeFetchThreads | No | Yes | -| 47 | numOfVnodeRsmaThreads | No | Yes | -| 48 | numOfQnodeQueryThreads | No | Yes | -| 49 | numOfQnodeFetchThreads | No | Yes | -| 50 | numOfSnodeSharedThreads | No | Yes | -| 51 | numOfSnodeUniqueThreads | No | Yes | -| 52 | rpcQueueMemoryAllowed | No | Yes | -| 53 | logDir | Yes | Yes | -| 54 | minimalLogDirGB | Yes | Yes | -| 55 | numOfLogLines | Yes | Yes | -| 56 | asyncLog | Yes | Yes | -| 57 | logKeepDays | Yes | Yes | -| 60 | debugFlag | Yes | Yes | -| 61 | tmrDebugFlag | Yes | Yes | -| 62 | uDebugFlag | Yes | Yes | -| 63 | rpcDebugFlag | Yes | Yes | -| 64 | jniDebugFlag | Yes | Yes | -| 65 | qDebugFlag | Yes | Yes | -| 66 | cDebugFlag | Yes | Yes | -| 67 | dDebugFlag | Yes | Yes | -| 68 | vDebugFlag | Yes | Yes | -| 69 | mDebugFlag | Yes | Yes | -| 70 | wDebugFlag | Yes | Yes | -| 71 | sDebugFlag | Yes | Yes | -| 72 | tsdbDebugFlag | Yes | Yes | -| 73 | tqDebugFlag | No | Yes | -| 74 | fsDebugFlag | Yes | Yes | -| 75 | udfDebugFlag | No | Yes | -| 76 | smaDebugFlag | No | Yes | -| 77 | idxDebugFlag | No | Yes | -| 78 | tdbDebugFlag | No | Yes | -| 79 | metaDebugFlag | No | Yes | -| 80 | timezone | Yes | Yes | -| 81 | locale | Yes | Yes | -| 82 | charset | Yes | Yes | -| 83 | udf | Yes | Yes | -| 84 | enableCoreFile | Yes | Yes | -| 85 | arbitrator | Yes | No | -| 86 | numOfThreadsPerCore | Yes | No | -| 87 | numOfMnodes | Yes | No | -| 88 | vnodeBak | Yes | No | -| 89 | balance | Yes | No | -| 90 | balanceInterval | Yes | No | -| 91 | offlineThreshold | Yes | No | -| 92 | role | Yes | No | -| 93 | dnodeNopLoop | Yes | No | -| 94 | keepTimeOffset | Yes | No | -| 95 | rpcTimer | Yes | No | -| 96 | rpcMaxTime | Yes | No | -| 97 | rpcForceTcp | Yes | No | -| 98 | tcpConnTimeout | Yes | No | -| 99 | syncCheckInterval | Yes | No | -| 100 | maxTmrCtrl | Yes | No | -| 101 | monitorReplica | Yes | No | -| 102 | smlTagNullName | Yes | No | -| 103 | keepColumnName | Yes | No | -| 104 | ratioOfQueryCores | Yes | No | -| 105 | maxStreamCompDelay | Yes | No | -| 106 | maxFirstStreamCompDelay | Yes | No | -| 107 | retryStreamCompDelay | Yes | No | -| 108 | streamCompDelayRatio | Yes | No | -| 109 | maxVgroupsPerDb | Yes | No | -| 110 | maxTablesPerVnode | Yes | No | -| 111 | minTablesPerVnode | Yes | No | -| 112 | tableIncStepPerVnode | Yes | No | -| 113 | cache | Yes | No | -| 114 | blocks | Yes | No | -| 115 | days | Yes | No | -| 116 | keep | Yes | No | -| 117 | minRows | Yes | No | -| 118 | maxRows | Yes | No | -| 119 | quorum | Yes | No | -| 120 | comp | Yes | No | -| 121 | walLevel | Yes | No | -| 122 | fsync | Yes | No | -| 123 | replica | Yes | No | -| 124 | partitions | Yes | No | -| 125 | quorum | Yes | No | -| 126 | update | Yes | No | -| 127 | cachelast | Yes | No | -| 128 | maxSQLLength | Yes | No | -| 129 | maxWildCardsLength | Yes | No | -| 130 | maxRegexStringLen | Yes | No | -| 131 | maxNumOfOrderedRes | Yes | No | -| 132 | maxConnections | Yes | No | -| 133 | mnodeEqualVnodeNum | Yes | No | -| 134 | http | Yes | No | -| 135 | httpEnableRecordSql | Yes | No | -| 136 | httpMaxThreads | Yes | No | -| 137 | restfulRowLimit | Yes | No | -| 138 | httpDbNameMandatory | Yes | No | -| 139 | httpKeepAlive | Yes | No | -| 140 | enableRecordSql | Yes | No | -| 141 | maxBinaryDisplayWidth | Yes | No | -| 142 | stream | Yes | No | -| 143 | retrieveBlockingModel | Yes | No | -| 144 | tsdbMetaCompactRatio | Yes | No | -| 145 | defaultJSONStrType | Yes | No | -| 146 | walFlushSize | Yes | No | -| 147 | keepTimeOffset | Yes | No | -| 148 | flowctrl | Yes | No | -| 149 | slaveQuery | Yes | No | -| 150 | adjustMaster | Yes | No | -| 151 | topicBinaryLen | Yes | No | -| 152 | telegrafUseFieldNum | Yes | No | -| 153 | deadLockKillQuery | Yes | No | -| 154 | clientMerge | Yes | No | -| 155 | sdbDebugFlag | Yes | No | -| 156 | odbcDebugFlag | Yes | No | -| 157 | httpDebugFlag | Yes | No | -| 158 | monDebugFlag | Yes | No | -| 159 | cqDebugFlag | Yes | No | -| 160 | shortcutFlag | Yes | No | -| 161 | probeSeconds | Yes | No | -| 162 | probeKillSeconds | Yes | No | -| 163 | probeInterval | Yes | No | -| 164 | lossyColumns | Yes | No | -| 165 | fPrecision | Yes | No | -| 166 | dPrecision | Yes | No | -| 167 | maxRange | Yes | No | -| 168 | range | Yes | No | + +## 3.0 Parameters + +| # | **参数** | **Applicable to 2.x ** | **Applicable to 3.0 ** | Current behavior in 3.0 | +| --- | :---------------------: | --------------- | --------------- | ------------------------------------------------- | +| 1 | firstEp | Yes | Yes | | +| 2 | secondEp | Yes | Yes | | +| 3 | fqdn | Yes | Yes | | +| 4 | serverPort | Yes | Yes | | +| 5 | maxShellConns | Yes | Yes | | +| 6 | monitor | Yes | Yes | | +| 7 | monitorFqdn | No | Yes | | +| 8 | monitorPort | No | Yes | | +| 9 | monitorInterval | Yes | Yes | | +| 10 | queryPolicy | No | Yes | | +| 11 | querySmaOptimize | No | Yes | | +| 12 | maxNumOfDistinctRes | Yes | Yes | | +| 15 | countAlwaysReturnValue | Yes | Yes | | +| 16 | dataDir | Yes | Yes | | +| 17 | minimalDataDirGB | Yes | Yes | | +| 18 | supportVnodes | No | Yes | | +| 19 | tempDir | Yes | Yes | | +| 20 | minimalTmpDirGB | Yes | Yes | | +| 21 | smlChildTableName | Yes | Yes | | +| 22 | smlTagName | Yes | Yes | | +| 23 | smlDataFormat | No | Yes | | +| 24 | statusInterval | Yes | Yes | | +| 25 | logDir | Yes | Yes | | +| 26 | minimalLogDirGB | Yes | Yes | | +| 27 | numOfLogLines | Yes | Yes | | +| 28 | asyncLog | Yes | Yes | | +| 29 | logKeepDays | Yes | Yes | | +| 30 | debugFlag | Yes | Yes | | +| 31 | tmrDebugFlag | Yes | Yes | | +| 32 | uDebugFlag | Yes | Yes | | +| 33 | rpcDebugFlag | Yes | Yes | | +| 34 | jniDebugFlag | Yes | Yes | | +| 35 | qDebugFlag | Yes | Yes | | +| 36 | cDebugFlag | Yes | Yes | | +| 37 | dDebugFlag | Yes | Yes | | +| 38 | vDebugFlag | Yes | Yes | | +| 39 | mDebugFlag | Yes | Yes | | +| 40 | wDebugFlag | Yes | Yes | | +| 41 | sDebugFlag | Yes | Yes | | +| 42 | tsdbDebugFlag | Yes | Yes | | +| 43 | tqDebugFlag | No | Yes | | +| 44 | fsDebugFlag | Yes | Yes | | +| 45 | udfDebugFlag | No | Yes | | +| 46 | smaDebugFlag | No | Yes | | +| 47 | idxDebugFlag | No | Yes | | +| 48 | tdbDebugFlag | No | Yes | | +| 49 | metaDebugFlag | No | Yes | | +| 50 | timezone | Yes | Yes | | +| 51 | locale | Yes | Yes | | +| 52 | charset | Yes | Yes | | +| 53 | udf | Yes | Yes | | +| 54 | enableCoreFile | Yes | Yes | | diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index 32bdc21e7c..e33970c407 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://w import Release from "/components/ReleaseV3"; +## 3.0.2.0 + + + ## 3.0.1.8 diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md index 7126b5a997..f2212bb2d4 100644 --- a/docs/en/28-releases/02-tools.md +++ b/docs/en/28-releases/02-tools.md @@ -10,6 +10,10 @@ For other historical version installers, please visit [here](https://www.taosdat import Release from "/components/ReleaseV3"; +## 2.3.2 + + + ## 2.3.0 diff --git a/docs/examples/csharp/wsConnect/Program.cs b/docs/examples/csharp/wsConnect/Program.cs index f9a56c842f..a534bb8a65 100644 --- a/docs/examples/csharp/wsConnect/Program.cs +++ b/docs/examples/csharp/wsConnect/Program.cs @@ -5,22 +5,24 @@ namespace Examples { public class WSConnExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { Console.WriteLine("Establish connect success."); + // close connection. + LibTaosWS.WSClose(wsConn); } - // close connection. - LibTaosWS.WSClose(wsConn); + return 0; } } -} \ No newline at end of file +} diff --git a/docs/examples/csharp/wsInsert/Program.cs b/docs/examples/csharp/wsInsert/Program.cs index 1f2d0a6725..7fa6af805c 100644 --- a/docs/examples/csharp/wsInsert/Program.cs +++ b/docs/examples/csharp/wsInsert/Program.cs @@ -5,7 +5,7 @@ namespace Examples { public class WSInsertExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); @@ -13,7 +13,8 @@ namespace Examples // Assert if connection is validate if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { @@ -36,6 +37,8 @@ namespace Examples // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } static void ValidInsert(string desc, IntPtr wsRes) @@ -43,7 +46,7 @@ namespace Examples int code = LibTaosWS.WSErrorNo(wsRes); if (code != 0) { - throw new Exception($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); } else { @@ -55,4 +58,4 @@ namespace Examples } // Establish connect success. // create table success affect 0 rows, cost 3717542 nanoseconds -// insert data success affect 8 rows, cost 2613637 nanoseconds \ No newline at end of file +// insert data success affect 8 rows, cost 2613637 nanoseconds diff --git a/docs/examples/csharp/wsQuery/Program.cs b/docs/examples/csharp/wsQuery/Program.cs index a220cae903..8ee900a05a 100644 --- a/docs/examples/csharp/wsQuery/Program.cs +++ b/docs/examples/csharp/wsQuery/Program.cs @@ -7,13 +7,14 @@ namespace Examples { public class WSQueryExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { @@ -28,7 +29,9 @@ namespace Examples int code = LibTaosWS.WSErrorNo(wsRes); if (code != 0) { - throw new Exception($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + LibTaosWS.WSFreeResult(wsRes); + return -1; } // get meta data @@ -58,6 +61,8 @@ namespace Examples // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } } } @@ -71,4 +76,4 @@ namespace Examples // 1538548685000 | 10.3 | 219 | 0.31 | California.SanFrancisco | 2 | // 1538548695000 | 12.6 | 218 | 0.33 | California.SanFrancisco | 2 | // 1538548696800 | 12.3 | 221 | 0.31 | California.SanFrancisco | 2 | -// 1538548696650 | 10.3 | 218 | 0.25 | California.SanFrancisco | 3 | \ No newline at end of file +// 1538548696650 | 10.3 | 218 | 0.25 | California.SanFrancisco | 3 | diff --git a/docs/examples/csharp/wsStmt/Program.cs b/docs/examples/csharp/wsStmt/Program.cs index 8af807ec39..f8673357db 100644 --- a/docs/examples/csharp/wsStmt/Program.cs +++ b/docs/examples/csharp/wsStmt/Program.cs @@ -7,7 +7,7 @@ namespace Examples { public class WSStmtExample { - static void Main(string[] args) + static int Main(string[] args) { const string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; const string table = "meters"; @@ -21,7 +21,8 @@ namespace Examples IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception($"get WS connection failed"); + Console.WriteLine($"get WS connection failed"); + return -1; } else { @@ -66,18 +67,20 @@ namespace Examples } else { - throw new Exception("Init STMT failed..."); + Console.WriteLine("Init STMT failed..."); } // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } static void ValidStmtStep(int code, IntPtr wsStmt, string desc) { if (code != 0) { - throw new Exception($"{desc} failed,reason: {LibTaosWS.WSErrorStr(wsStmt)}, code: {code}"); + Console.WriteLine($"{desc} failed,reason: {LibTaosWS.WSErrorStr(wsStmt)}, code: {code}"); } else { @@ -92,4 +95,4 @@ namespace Examples // WSStmtBindParamBatch success... // WSStmtAddBatch success... // WSStmtExecute success... -// WS STMT insert 5 rows... \ No newline at end of file +// WS STMT insert 5 rows... diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx index 1ee59d2df4..fc6dc57138 100644 --- a/docs/zh/08-connector/14-java.mdx +++ b/docs/zh/08-connector/14-java.mdx @@ -68,39 +68,38 @@ TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对 ### 安装连接器 - + - 目前 taos-jdbcdriver 已经发布到 [Sonatype Repository](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver) - 仓库,且各大仓库都已同步。 +目前 taos-jdbcdriver 已经发布到 [Sonatype Repository](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver) 仓库,且各大仓库都已同步。 - - [sonatype](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver) - - [mvnrepository](https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver) - - [maven.aliyun](https://maven.aliyun.com/mvn/search) +- [sonatype](https://search.maven.org/artifact/com.taosdata.jdbc/taos-jdbcdriver) +- [mvnrepository](https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver) +- [maven.aliyun](https://maven.aliyun.com/mvn/search) - Maven 项目中,在 pom.xml 中添加以下依赖: +Maven 项目中,在 pom.xml 中添加以下依赖: - ```xml-dtd - - com.taosdata.jdbc - taos-jdbcdriver - 3.0.0 - - ``` +```xml-dtd + + com.taosdata.jdbc + taos-jdbcdriver + 3.0.0 + +``` - - + + - 可以通过下载 TDengine 的源码,自己编译最新版本的 Java connector +可以通过下载 TDengine 的源码,自己编译最新版本的 Java connector - ```shell - git clone https://github.com/taosdata/taos-connector-jdbc.git - cd taos-connector-jdbc - mvn clean install -Dmaven.test.skip=true - ``` +```shell +git clone https://github.com/taosdata/taos-connector-jdbc.git +cd taos-connector-jdbc +mvn clean install -Dmaven.test.skip=true +``` - 编译后,在 target 目录下会产生 taos-jdbcdriver-3.0.*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。 +编译后,在 target 目录下会产生 taos-jdbcdriver-3.0.*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。 - + ## 建立连接 @@ -111,125 +110,117 @@ TDengine 的 JDBC URL 规范格式为: 对于建立连接,原生连接与 REST 连接有细微不同。 - + - ```java - Class.forName("com.taosdata.jdbc.TSDBDriver"); - String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata"; - Connection conn = DriverManager.getConnection(jdbcUrl); - ``` +```java +Class.forName("com.taosdata.jdbc.TSDBDriver"); +String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata"; +Connection conn = DriverManager.getConnection(jdbcUrl); +``` - 以上示例,使用了 JDBC 原生连接的 TSDBDriver,建立了到 hostname 为 taosdemo.com,端口为 6030(TDengine 的默认端口),数据库名为 test 的连接。这个 URL - 中指定用户名(user)为 root,密码(password)为 taosdata。 +以上示例,使用了 JDBC 原生连接的 TSDBDriver,建立了到 hostname 为 taosdemo.com,端口为 6030(TDengine 的默认端口),数据库名为 test 的连接。这个 URL +中指定用户名(user)为 root,密码(password)为 taosdata。 - **注意**:使用 JDBC 原生连接,taos-jdbcdriver 需要依赖客户端驱动(Linux 下是 libtaos.so;Windows 下是 taos.dll;macOS 下是 libtaos.dylib)。 +**注意**:使用 JDBC 原生连接,taos-jdbcdriver 需要依赖客户端驱动(Linux 下是 libtaos.so;Windows 下是 taos.dll;macOS 下是 libtaos.dylib)。 - url 中的配置参数如下: +url 中的配置参数如下: - - user:登录 TDengine 用户名,默认值 'root'。 - - password:用户登录密码,默认值 'taosdata'。 - - cfgdir:客户端配置文件目录路径,Linux OS 上默认值 `/etc/taos`,Windows OS 上默认值 `C:/TDengine/cfg`。 - - charset:客户端使用的字符集,默认值为系统字符集。 - - locale:客户端语言环境,默认值系统当前 locale。 - - timezone:客户端使用的时区,默认值为系统当前时区。 - - batchfetch: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:true。开启批量拉取同时获取一批数据在查询数据量较大时批量拉取可以有效的提升查询性能。 - - batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 SQL 执行失败将继续执行下面的 SQL。false:不再执行失败 SQL - 后的任何语句。默认值为:false。 +- user:登录 TDengine 用户名,默认值 'root'。 +- password:用户登录密码,默认值 'taosdata'。 +- cfgdir:客户端配置文件目录路径,Linux OS 上默认值 `/etc/taos`,Windows OS 上默认值 `C:/TDengine/cfg`。 +- charset:客户端使用的字符集,默认值为系统字符集。 +- locale:客户端语言环境,默认值系统当前 locale。 +- timezone:客户端使用的时区,默认值为系统当前时区。 +- batchfetch: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:true。开启批量拉取同时获取一批数据在查询数据量较大时批量拉取可以有效的提升查询性能。 +- batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 SQL 执行失败将继续执行下面的 SQL。false:不再执行失败 SQL 后的任何语句。默认值为:false。 - JDBC 原生连接的使用请参见[视频教程](https://www.taosdata.com/blog/2020/11/11/1955.html)。 +JDBC 原生连接的使用请参见[视频教程](https://www.taosdata.com/blog/2020/11/11/1955.html)。 - **使用 TDengine 客户端驱动配置文件建立连接 ** +**使用 TDengine 客户端驱动配置文件建立连接 ** - 当使用 JDBC 原生连接连接 TDengine 集群时,可以使用 TDengine 客户端驱动配置文件,在配置文件中指定集群的 firstEp、secondEp 等参数。如下所示: +当使用 JDBC 原生连接连接 TDengine 集群时,可以使用 TDengine 客户端驱动配置文件,在配置文件中指定集群的 firstEp、secondEp 等参数。如下所示: - 1. 在 Java 应用中不指定 hostname 和 port +1. 在 Java 应用中不指定 hostname 和 port - ```java - public Connection getConn() throws Exception{ - Class.forName("com.taosdata.jdbc.TSDBDriver"); - String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata"; - Properties connProps = new Properties(); - connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); - connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); - connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); - Connection conn = DriverManager.getConnection(jdbcUrl, connProps); - return conn; - } - ``` +```java +public Connection getConn() throws Exception{ + Class.forName("com.taosdata.jdbc.TSDBDriver"); + String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata"; + Properties connProps = new Properties(); + connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); + connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); + connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); + Connection conn = DriverManager.getConnection(jdbcUrl, connProps); + return conn; +} +``` - 2. 在配置文件中指定 firstEp 和 secondEp +2. 在配置文件中指定 firstEp 和 secondEp - ```shell - # first fully qualified domain name (FQDN) for TDengine system - firstEp cluster_node1:6030 +```shell +# first fully qualified domain name (FQDN) for TDengine system +firstEp cluster_node1:6030 - # second fully qualified domain name (FQDN) for TDengine system, for cluster only - secondEp cluster_node2:6030 +# second fully qualified domain name (FQDN) for TDengine system, for cluster only +secondEp cluster_node2:6030 - # default system charset - # charset UTF-8 +# default system charset +# charset UTF-8 - # system locale - # locale en_US.UTF-8 - ``` +# system locale +# locale en_US.UTF-8 +``` - 以上示例,jdbc 会使用客户端的配置文件,建立到 hostname 为 cluster_node1、端口为 6030、数据库名为 test 的连接。当集群中 firstEp 节点失效时,JDBC 会尝试使用 secondEp - 连接集群。 +以上示例,jdbc 会使用客户端的配置文件,建立到 hostname 为 cluster_node1、端口为 6030、数据库名为 test 的连接。当集群中 firstEp 节点失效时,JDBC 会尝试使用 secondEp 连接集群。 - TDengine 中,只要保证 firstEp 和 secondEp 中一个节点有效,就可以正常建立到集群的连接。 +TDengine 中,只要保证 firstEp 和 secondEp 中一个节点有效,就可以正常建立到集群的连接。 - > **注意**:这里的配置文件指的是调用 JDBC Connector 的应用程序所在机器上的配置文件,Linux OS 上默认值 /etc/taos/taos.cfg ,Windows OS 上默认值 - C://TDengine/cfg/taos.cfg。 +> **注意**:这里的配置文件指的是调用 JDBC Connector 的应用程序所在机器上的配置文件,Linux OS 上默认值 /etc/taos/taos.cfg ,Windows OS 上默认值 C://TDengine/cfg/taos.cfg。 - - + + - ```java - Class.forName("com.taosdata.jdbc.rs.RestfulDriver"); - String jdbcUrl = "jdbc:TAOS-RS://taosdemo.com:6041/test?user=root&password=taosdata"; - Connection conn = DriverManager.getConnection(jdbcUrl); - ``` +```java +Class.forName("com.taosdata.jdbc.rs.RestfulDriver"); +String jdbcUrl = "jdbc:TAOS-RS://taosdemo.com:6041/test?user=root&password=taosdata"; +Connection conn = DriverManager.getConnection(jdbcUrl); +``` - 以上示例,使用了 JDBC REST 连接的 RestfulDriver,建立了到 hostname 为 taosdemo.com,端口为 6041,数据库名为 test 的连接。这个 URL 中指定用户名(user)为 - root,密码(password)为 taosdata。 +以上示例,使用了 JDBC REST 连接的 RestfulDriver,建立了到 hostname 为 taosdemo.com,端口为 6041,数据库名为 test 的连接。这个 URL 中指定用户名(user)为 root,密码(password)为 taosdata。 - 使用 JDBC REST 连接,不需要依赖客户端驱动。与 JDBC 原生连接相比,仅需要: +使用 JDBC REST 连接,不需要依赖客户端驱动。与 JDBC 原生连接相比,仅需要: - 1. driverClass 指定为“com.taosdata.jdbc.rs.RestfulDriver”; - 2. jdbcUrl 以“jdbc:TAOS-RS://”开头; - 3. 使用 6041 作为连接端口。 +1. driverClass 指定为“com.taosdata.jdbc.rs.RestfulDriver”; +2. jdbcUrl 以“jdbc:TAOS-RS://”开头; +3. 使用 6041 作为连接端口。 - url 中的配置参数如下: +url 中的配置参数如下: - - user:登录 TDengine 用户名,默认值 'root'。 - - password:用户登录密码,默认值 'taosdata'。 - - batchfetch: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。逐行拉取结果集使用 HTTP 方式进行数据传输。JDBC REST - 连接支持批量拉取数据功能。taos-jdbcdriver 与 TDengine 之间通过 WebSocket 连接进行数据传输。相较于 HTTP,WebSocket 可以使 JDBC REST 连接支持大数据量查询,并提升查询性能。 - - charset: 当开启批量拉取数据时,指定解析字符串数据的字符集。 - - batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 SQL 执行失败,继续执行下面的 SQL 了。false:不再执行失败 SQL - 后的任何语句。默认值为:false。 - - httpConnectTimeout: 连接超时时间,单位 ms, 默认值为 5000。 - - httpSocketTimeout: socket 超时时间,单位 ms,默认值为 5000。仅在 batchfetch 设置为 false 时生效。 - - messageWaitTimeout: 消息超时时间, 单位 ms, 默认值为 3000。 仅在 batchfetch 设置为 true 时生效。 - - useSSL: 连接中是否使用 SSL。 +- user:登录 TDengine 用户名,默认值 'root'。 +- password:用户登录密码,默认值 'taosdata'。 +- batchfetch: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。逐行拉取结果集使用 HTTP 方式进行数据传输。JDBC REST 连接支持批量拉取数据功能。taos-jdbcdriver 与 TDengine 之间通过 WebSocket 连接进行数据传输。相较于 HTTP,WebSocket 可以使 JDBC REST 连接支持大数据量查询,并提升查询性能。 +- charset: 当开启批量拉取数据时,指定解析字符串数据的字符集。 +- batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 SQL 执行失败,继续执行下面的 SQL 了。false:不再执行失败 SQL 后的任何语句。默认值为:false。 +- httpConnectTimeout: 连接超时时间,单位 ms, 默认值为 5000。 +- httpSocketTimeout: socket 超时时间,单位 ms,默认值为 5000。仅在 batchfetch 设置为 false 时生效。 +- messageWaitTimeout: 消息超时时间, 单位 ms, 默认值为 3000。 仅在 batchfetch 设置为 true 时生效。 +- useSSL: 连接中是否使用 SSL。 - **注意**:部分配置项(比如:locale、timezone)在 REST 连接中不生效。 +**注意**:部分配置项(比如:locale、timezone)在 REST 连接中不生效。 - :::note +:::note - - 与原生连接方式不同,REST 接口是无状态的。在使用 JDBC REST 连接时,需要在 SQL 中指定表、超级表的数据库名称。例如: +- 与原生连接方式不同,REST 接口是无状态的。在使用 JDBC REST 连接时,需要在 SQL 中指定表、超级表的数据库名称。例如: - ```sql - INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('California.SanFrancisco') VALUES(now, 24.6); - ``` +```sql +INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('California.SanFrancisco') VALUES(now, 24.6); +``` - - 如果在 url 中指定了 dbname,那么,JDBC REST 连接会默认使用/rest/sql/dbname 作为 restful 请求的 url,在 SQL 中不需要指定 dbname。例如:url 为 - jdbc:TAOS-RS://127.0.0.1:6041/test,那么,可以执行 sql:insert into t1 using weather(ts, temperature) - tags('California.SanFrancisco') values(now, 24.6); +- 如果在 url 中指定了 dbname,那么,JDBC REST 连接会默认使用/rest/sql/dbname 作为 restful 请求的 url,在 SQL 中不需要指定 dbname。例如:url 为 jdbc:TAOS-RS://127.0.0.1:6041/test,那么,可以执行 sql:insert into t1 using weather(ts, temperature) tags('California.SanFrancisco') values(now, 24.6); - ::: +::: - + ### 指定 URL 和 Properties 获取连接 @@ -890,8 +881,10 @@ public static void main(String[] args) throws Exception { | taos-jdbcdriver 版本 | 主要变化 | | :------------------: | :----------------------------: | +| 3.0.3 | 修复 REST 连接在 jdk17+ 版本时间戳解析错误问题 | | 3.0.1 - 3.0.2 | 修复一些情况下结果集数据解析错误的问题。3.0.1 在 JDK 11 环境编译,JDK 8 环境下建议使用 3.0.2 版本 | | 3.0.0 | 支持 TDengine 3.0 | +| 2.0.42 | 修在 WebSocket 连接中 wasNull 接口返回值 | | 2.0.41 | 修正 REST 连接中用户名和密码转码方式 | | 2.0.39 - 2.0.40 | 增加 REST 连接/请求 超时设置 | | 2.0.38 | JDBC REST 连接增加批量拉取功能 | @@ -928,7 +921,7 @@ public static void main(String[] args) throws Exception { **原因**:taos-jdbcdriver 3.0.1 版本需要在 JDK 11+ 环境使用。 -**解决方法**: 更换 taos-jdbcdriver 3.0.2 版本。 +**解决方法**: 更换 taos-jdbcdriver 3.0.2+ 版本。 其它问题请参考 [FAQ](../../../train-faq/faq) diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index 3918f240b4..232a6c7326 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -27,7 +27,6 @@ database_option: { | PRECISION {'ms' | 'us' | 'ns'} | REPLICA value | RETENTIONS ingestion_duration:keep_duration ... - | STRICT {'off' | 'on'} | WAL_LEVEL {1 | 2} | VGROUPS value | SINGLE_STABLE {0 | 1} @@ -61,9 +60,6 @@ database_option: { - PRECISION:数据库的时间戳精度。ms 表示毫秒,us 表示微秒,ns 表示纳秒,默认 ms 毫秒。 - REPLICA:表示数据库副本数,取值为 1 或 3,默认为 1。在集群中使用,副本数必须小于或等于 DNODE 的数目。 - RETENTIONS:表示数据的聚合周期和保存时长,如 RETENTIONS 15s:7d,1m:21d,15m:50d 表示数据原始采集周期为 15 秒,原始数据保存 7 天;按 1 分钟聚合的数据保存 21 天;按 15 分钟聚合的数据保存 50 天。目前支持且只支持三级存储周期。 -- STRICT:表示数据同步的一致性要求,默认为 off。 - - on 表示强一致,即运行标准的 raft 协议,半数提交返回成功。 - - off 表示弱一致,本地提交即返回成功。 - WAL_LEVEL:WAL 级别,默认为 1。 - 1:写 WAL,但不执行 fsync。 - 2:写 WAL,而且执行 fsync。 diff --git a/docs/zh/14-reference/04-taosadapter.md b/docs/zh/14-reference/04-taosadapter.md index 4e1e7b7ace..0909ddf639 100644 --- a/docs/zh/14-reference/04-taosadapter.md +++ b/docs/zh/14-reference/04-taosadapter.md @@ -59,6 +59,7 @@ Usage of taosAdapter: --collectd.port int collectd server port. Env "TAOS_ADAPTER_COLLECTD_PORT" (default 6045) --collectd.user string collectd user. Env "TAOS_ADAPTER_COLLECTD_USER" (default "root") --collectd.worker int collectd write worker. Env "TAOS_ADAPTER_COLLECTD_WORKER" (default 10) + --collectd.ttl int collectd data ttl. Env "TAOS_ADAPTER_COLLECTD_TTL" (default 0, means no ttl) -c, --config string config path default /etc/taos/taosadapter.toml --cors.allowAllOrigins cors allow all origins. Env "TAOS_ADAPTER_CORS_ALLOW_ALL_ORIGINS" (default true) --cors.allowCredentials cors allow credentials. Env "TAOS_ADAPTER_CORS_ALLOW_Credentials" @@ -100,6 +101,7 @@ Usage of taosAdapter: --node_exporter.responseTimeout duration node_exporter response timeout. Env "TAOS_ADAPTER_NODE_EXPORTER_RESPONSE_TIMEOUT" (default 5s) --node_exporter.urls strings node_exporter urls. Env "TAOS_ADAPTER_NODE_EXPORTER_URLS" (default [http://localhost:9100]) --node_exporter.user string node_exporter user. Env "TAOS_ADAPTER_NODE_EXPORTER_USER" (default "root") + --node_exporter.ttl int node_exporter data ttl. Env "TAOS_ADAPTER_NODE_EXPORTER_TTL"(default 0, means no ttl) --opentsdb.enable enable opentsdb. Env "TAOS_ADAPTER_OPENTSDB_ENABLE" (default true) --opentsdb_telnet.batchSize int opentsdb_telnet batch size. Env "TAOS_ADAPTER_OPENTSDB_TELNET_BATCH_SIZE" (default 1) --opentsdb_telnet.dbs strings opentsdb_telnet db names. Env "TAOS_ADAPTER_OPENTSDB_TELNET_DBS" (default [opentsdb_telnet,collectd_tsdb,icinga2_tsdb,tcollector_tsdb]) @@ -110,6 +112,7 @@ Usage of taosAdapter: --opentsdb_telnet.ports ints opentsdb telnet tcp port. Env "TAOS_ADAPTER_OPENTSDB_TELNET_PORTS" (default [6046,6047,6048,6049]) --opentsdb_telnet.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TCP_KEEP_ALIVE" --opentsdb_telnet.user string opentsdb_telnet user. Env "TAOS_ADAPTER_OPENTSDB_TELNET_USER" (default "root") + --opentsdb_telnet.ttl int opentsdb_telnet data ttl. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TTL"(default 0, means no ttl) --pool.idleTimeout duration Set idle connection timeout. Env "TAOS_ADAPTER_POOL_IDLE_TIMEOUT" (default 1h0m0s) --pool.maxConnect int max connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_CONNECT" (default 4000) --pool.maxIdle int max idle connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_IDLE" (default 4000) @@ -131,6 +134,7 @@ Usage of taosAdapter: --statsd.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_STATSD_TCP_KEEP_ALIVE" --statsd.user string statsd user. Env "TAOS_ADAPTER_STATSD_USER" (default "root") --statsd.worker int statsd write worker. Env "TAOS_ADAPTER_STATSD_WORKER" (default 10) + --statsd.ttl int statsd data ttl. Env "TAOS_ADAPTER_STATSD_TTL" (default 0, means no ttl) --taosConfigDir string load taos client config path. Env "TAOS_ADAPTER_TAOS_CONFIG_FILE" --version Print the version and exit ``` @@ -195,6 +199,7 @@ AllowWebSockets - `precision` TDengine 使用的时间精度 - `u` TDengine 用户名 - `p` TDengine 密码 +- `ttl` 自动创建的子表生命周期,以子表的第一条数据的 TTL 参数为准,不可更新。更多信息请参考[创建表文档](taos-sql/table/#创建表)的 TTL 参数。 注意: 目前不支持 InfluxDB 的 token 验证方式,仅支持 Basic 验证和查询参数验证。 示例: curl --request POST http://127.0.0.1:6041/influxdb/v1/write?db=test --user "root:taosdata" --data-binary "measurement,host=host1 field1=2i,field2=2.0 1577836800000000000" diff --git a/docs/zh/14-reference/05-taosbenchmark.md b/docs/zh/14-reference/05-taosbenchmark.md index 76dd5f12d8..9091e71d1f 100644 --- a/docs/zh/14-reference/05-taosbenchmark.md +++ b/docs/zh/14-reference/05-taosbenchmark.md @@ -204,6 +204,10 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) - **-a/--replica ** : 创建数据库时指定其副本数,默认值为 1 。 +- ** -k/--keep-trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 + +- ** -z/--trying-interval ** : 失败重试间隔时间,单位为毫秒,仅在 -k 指定重试后有效。需使用 v3.0.9 以上版本。 + - **-V/--version** : 显示版本信息并退出。不能与其它参数混用。 @@ -231,6 +235,10 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) 插入场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) +- ** keep_trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 + +- ** trying_interval ** : 失败重试间隔时间,单位为毫秒,仅在 keep_trying 指定重试后有效。需使用 v3.0.9 以上版本。 + #### 数据库相关配置参数 创建数据库时的相关参数在 json 配置文件中的 `dbinfo` 中配置,个别具体参数如下。其余参数均与 TDengine 中 `create database` 时所指定的数据库参数相对应,详见[../../taos-sql/database] diff --git a/docs/zh/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md index 625499a949..8a031d1473 100644 --- a/docs/zh/14-reference/06-taosdump.md +++ b/docs/zh/14-reference/06-taosdump.md @@ -22,7 +22,7 @@ taosdump 是一个逻辑备份工具,它不应被用于备份任何原始数 taosdump 有两种安装方式: -- 安装 taosTools 官方安装包, 请从[所有下载链接](https://www.taosdata.com/all-downloads)页面找到 taosTools 并下载安装。 +- 安装 taosTools 官方安装包, 请从[发布历史页面](https://docs.taosdata.com/releases/tools/)页面找到 taosTools 并下载安装。 - 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。 diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index 145c5eed93..bc62a536e5 100644 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -134,15 +134,6 @@ taos --dump-config | 取值范围 | 1-200000 | | 缺省值 | 30 | -### telemetryReporting - -| 属性 | 说明 | -| -------- | ---------------------------------------- | -| 适用范围 | 仅服务端适用 | -| 含义 | 是否允许 TDengine 采集和上报基本使用信息 | -| 取值范围 | 0:不允许 1:允许 | -| 缺省值 | 1 | - ## 查询相关 ### queryPolicy @@ -191,6 +182,15 @@ taos --dump-config | 取值范围 | 0 表示包含函数名,1 表示不包含函数名。 | | 缺省值 | 0 | +### countAlwaysReturnValue + +| 属性 | 说明 | +| -------- | -------------------------------- | +| 适用范围 | 仅服务端适用 | +| 含义 | count/hyperloglog函数在数据为空或者NULL的情况下是否返回值 | +| 取值范围 | 0:返回空行,1:返回 0 | +| 缺省值 | 1 | + ## 区域相关 ### timezone @@ -306,12 +306,20 @@ charset 的有效值是 UTF-8。 | 含义 | 数据文件目录,所有的数据文件都将写入该目录 | | 缺省值 | /var/lib/taos | +### tempDir + +| 属性 | 说明 | +| -------- | ------------------------------------------ | +| 适用范围 | 仅服务端适用 | +| 含义 | 该参数指定所有系统运行过程中的临时文件生成的目录 | +| 缺省值 | /tmp | + ### minimalTmpDirGB | 属性 | 说明 | | -------- | ------------------------------------------------ | | 适用范围 | 服务端和客户端均适用 | -| 含义 | 当日志文件夹的磁盘大小小于该值时,停止写临时文件 | +| 含义 | tempDir 所指定的临时文件目录所需要保留的最小空间 | | 单位 | GB | | 缺省值 | 1.0 | @@ -320,7 +328,7 @@ charset 的有效值是 UTF-8。 | 属性 | 说明 | | -------- | ------------------------------------------------ | | 适用范围 | 仅服务端适用 | -| 含义 | 当日志文件夹的磁盘大小小于该值时,停止写时序数据 | +| 含义 | dataDir 指定的时序数据存储目录所需要保留的最小 | | 单位 | GB | | 缺省值 | 2.0 | @@ -335,27 +343,7 @@ charset 的有效值是 UTF-8。 | 取值范围 | 0-4096 | | 缺省值 | CPU 核数的 2 倍 | -## 时间相关 - -### statusInterval - -| 属性 | 说明 | -| -------- | --------------------------- | -| 适用范围 | 仅服务端适用 | -| 含义 | dnode 向 mnode 报告状态间隔 | -| 单位 | 秒 | -| 取值范围 | 1-10 | -| 缺省值 | 1 | - -### shellActivityTimer - -| 属性 | 说明 | -| -------- | --------------------------------- | -| 适用范围 | 服务端和客户端均适用 | -| 含义 | shell 客户端向 mnode 发送心跳间隔 | -| 单位 | 秒 | -| 取值范围 | 1-120 | -| 缺省值 | 3 | +## 时间相关 | ## 性能调优 @@ -367,28 +355,6 @@ charset 的有效值是 UTF-8。 | 含义 | 设置写入线程的最大数量 | | 缺省值 | | -## 压缩相关 - -### compressMsgSize - -| 属性 | 说明 | -| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| 适用范围 | 仅服务端适用 | -| 含义 | 客户端与服务器之间进行消息通讯过程中,对通讯的消息进行压缩的阈值。如果要压缩消息,建议设置为 64330 字节,即大于 64330 字节的消息体才进行压缩。 | -| 单位 | bytes | -| 取值范围 | `0 `表示对所有的消息均进行压缩 >0: 超过该值的消息才进行压缩 -1: 不压缩 | -| 缺省值 | -1 | - -### compressColData - -| 属性 | 说明 | -| -------- | --------------------------------------------------------------------------------------- | -| 适用范围 | 仅服务端适用 | -| 含义 | 客户端与服务器之间进行消息通讯过程中,对服务器端查询结果进行列压缩的阈值。 | -| 单位 | bytes | -| 取值范围 | 0: 对所有查询结果均进行压缩 >0: 查询结果中任意列大小超过该值的消息才进行压缩 -1: 不压缩 | -| 缺省值 | -1 | - ## 日志相关 ### logDir @@ -613,7 +579,7 @@ charset 的有效值是 UTF-8。 | 属性 | 说明 | | -------- | ------------------------- | | 适用范围 | 仅客户端适用 | -| 含义 | schemaless 自定义的子表名 | +| 含义 | schemaless 自定义的子表名的 key | | 类型 | 字符串 | | 缺省值 | 无 | @@ -656,12 +622,18 @@ charset 的有效值是 UTF-8。 | 取值范围 | 0: 不启动;1:启动 | | 缺省值 | 1 | -## 2.X 与 3.0 配置参数对比 +## 压缩参数 -:::note -对于 2.x 版本中适用但在 3.0 版本中废弃的参数,其当前行为会有特别说明 +### compressMsgSize -::: +| 属性 | 说明 | +| -------- | ----------------------------- | +| 适用于 | 服务端和客户端均适用 | +| 含义 | 是否对 RPC 消息进行压缩 | +| 取值范围 | -1: 所有消息都不压缩; 0: 所有消息都压缩; N (N>0): 只有大于 N 个字节的消息才压缩 | +| 缺省值 | -1 | + +## 3.0 中有效的配置参数列表 | # | **参数** | **适用于 2.X ** | **适用于 3.0 ** | 3.0 版本的当前行为 | | --- | :---------------------: | --------------- | --------------- | ------------------------------------------------- | @@ -674,159 +646,134 @@ charset 的有效值是 UTF-8。 | 7 | monitorFqdn | 否 | 是 | | | 8 | monitorPort | 否 | 是 | | | 9 | monitorInterval | 是 | 是 | | -| 10 | monitorMaxLogs | 否 | 是 | | -| 11 | monitorComp | 否 | 是 | | -| 12 | telemetryReporting | 是 | 是 | | -| 13 | telemetryInterval | 否 | 是 | | -| 14 | telemetryServer | 否 | 是 | | -| 15 | telemetryPort | 否 | 是 | | -| 16 | queryPolicy | 否 | 是 | | -| 17 | querySmaOptimize | 否 | 是 | | -| 18 | queryRsmaTolerance | 否 | 是 | | -| 19 | queryBufferSize | 是 | 是 | | -| 20 | maxNumOfDistinctRes | 是 | 是 | | -| 21 | minSlidingTime | 是 | 是 | | -| 22 | minIntervalTime | 是 | 是 | | -| 23 | countAlwaysReturnValue | 是 | 是 | | -| 24 | dataDir | 是 | 是 | | -| 25 | minimalDataDirGB | 是 | 是 | | -| 26 | supportVnodes | 否 | 是 | | -| 27 | tempDir | 是 | 是 | | -| 28 | minimalTmpDirGB | 是 | 是 | | -| 29 | compressMsgSize | 是 | 是 | | -| 30 | compressColData | 是 | 是 | | -| 31 | smlChildTableName | 是 | 是 | | -| 32 | smlTagName | 是 | 是 | | -| 33 | smlDataFormat | 否 | 是 | | -| 34 | statusInterval | 是 | 是 | | -| 35 | shellActivityTimer | 是 | 是 | | -| 36 | transPullupInterval | 否 | 是 | | -| 37 | mqRebalanceInterval | 否 | 是 | | -| 38 | ttlUnit | 否 | 是 | | -| 39 | ttlPushInterval | 否 | 是 | | -| 40 | numOfTaskQueueThreads | 否 | 是 | | -| 41 | numOfRpcThreads | 否 | 是 | | -| 42 | numOfCommitThreads | 是 | 是 | | -| 43 | numOfMnodeReadThreads | 否 | 是 | | -| 44 | numOfVnodeQueryThreads | 否 | 是 | | -| 45 | numOfVnodeStreamThreads | 否 | 是 | | -| 46 | numOfVnodeFetchThreads | 否 | 是 | | -| 47 | numOfVnodeRsmaThreads | 否 | 是 | | -| 48 | numOfQnodeQueryThreads | 否 | 是 | | -| 49 | numOfQnodeFetchThreads | 否 | 是 | | -| 50 | numOfSnodeSharedThreads | 否 | 是 | | -| 51 | numOfSnodeUniqueThreads | 否 | 是 | | -| 52 | rpcQueueMemoryAllowed | 否 | 是 | | -| 53 | logDir | 是 | 是 | | -| 54 | minimalLogDirGB | 是 | 是 | | -| 55 | numOfLogLines | 是 | 是 | | -| 56 | asyncLog | 是 | 是 | | -| 57 | logKeepDays | 是 | 是 | | -| 60 | debugFlag | 是 | 是 | | -| 61 | tmrDebugFlag | 是 | 是 | | -| 62 | uDebugFlag | 是 | 是 | | -| 63 | rpcDebugFlag | 是 | 是 | | -| 64 | jniDebugFlag | 是 | 是 | | -| 65 | qDebugFlag | 是 | 是 | | -| 66 | cDebugFlag | 是 | 是 | | -| 67 | dDebugFlag | 是 | 是 | | -| 68 | vDebugFlag | 是 | 是 | | -| 69 | mDebugFlag | 是 | 是 | | -| 70 | wDebugFlag | 是 | 是 | | -| 71 | sDebugFlag | 是 | 是 | | -| 72 | tsdbDebugFlag | 是 | 是 | | -| 73 | tqDebugFlag | 否 | 是 | | -| 74 | fsDebugFlag | 是 | 是 | | -| 75 | udfDebugFlag | 否 | 是 | | -| 76 | smaDebugFlag | 否 | 是 | | -| 77 | idxDebugFlag | 否 | 是 | | -| 78 | tdbDebugFlag | 否 | 是 | | -| 79 | metaDebugFlag | 否 | 是 | | -| 80 | timezone | 是 | 是 | | -| 81 | locale | 是 | 是 | | -| 82 | charset | 是 | 是 | | -| 83 | udf | 是 | 是 | | -| 84 | enableCoreFile | 是 | 是 | | -| 85 | arbitrator | 是 | 否 | 通过 RAFT 协议选主 | -| 86 | numOfThreadsPerCore | 是 | 否 | 有其它参数设置多种线程池的大小 | -| 87 | numOfMnodes | 是 | 否 | 通过 create mnode 命令动态创建 mnode | -| 88 | vnodeBak | 是 | 否 | 3.0 行为未知 | -| 89 | balance | 是 | 否 | 负载均衡功能由 split/merge vgroups 实现 | -| 90 | balanceInterval | 是 | 否 | 随着 balance 参数失效 | -| 91 | offlineThreshold | 是 | 否 | 3.0 行为未知 | -| 92 | role | 是 | 否 | 由 supportVnode 决定是否能够创建 | -| 93 | dnodeNopLoop | 是 | 否 | 2.6 文档中未找到此参数 | -| 94 | keepTimeOffset | 是 | 否 | 2.6 文档中未找到此参数 | -| 95 | rpcTimer | 是 | 否 | 3.0 行为未知 | -| 96 | rpcMaxTime | 是 | 否 | 3.0 行为未知 | -| 97 | rpcForceTcp | 是 | 否 | 默认为 TCP | -| 98 | tcpConnTimeout | 是 | 否 | 3.0 行为未知 | -| 99 | syncCheckInterval | 是 | 否 | 3.0 行为未知 | -| 100 | maxTmrCtrl | 是 | 否 | 3.0 行为未知 | -| 101 | monitorReplica | 是 | 否 | 由 RAFT 协议管理多副本 | -| 102 | smlTagNullName | 是 | 否 | 3.0 行为未知 | -| 103 | keepColumnName | 是 | 否 | 3.0 行为未知 | -| 104 | ratioOfQueryCores | 是 | 否 | 由 线程池 相关配置参数决定 | -| 105 | maxStreamCompDelay | 是 | 否 | 3.0 行为未知 | -| 106 | maxFirstStreamCompDelay | 是 | 否 | 3.0 行为未知 | -| 107 | retryStreamCompDelay | 是 | 否 | 3.0 行为未知 | -| 108 | streamCompDelayRatio | 是 | 否 | 3.0 行为未知 | -| 109 | maxVgroupsPerDb | 是 | 否 | 由 create db 的参数 vgroups 指定实际 vgroups 数量 | -| 110 | maxTablesPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | -| 111 | minTablesPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | -| 112 | tableIncStepPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | -| 113 | cache | 是 | 否 | 由 buffer 代替 cache\*blocks | -| 114 | blocks | 是 | 否 | 由 buffer 代替 cache\*blocks | -| 115 | days | 是 | 否 | 由 create db 的参数 duration 取代 | -| 116 | keep | 是 | 否 | 由 create db 的参数 keep 取代 | -| 117 | minRows | 是 | 否 | 由 create db 的参数 minRows 取代 | -| 118 | maxRows | 是 | 否 | 由 create db 的参数 maxRows 取代 | -| 119 | quorum | 是 | 否 | 由 RAFT 协议决定 | -| 120 | comp | 是 | 否 | 由 create db 的参数 comp 取代 | -| 121 | walLevel | 是 | 否 | 由 create db 的参数 wal_level 取代 | -| 122 | fsync | 是 | 否 | 由 create db 的参数 wal_fsync_period 取代 | -| 123 | replica | 是 | 否 | 由 create db 的参数 replica 取代 | -| 124 | partitions | 是 | 否 | 3.0 行为未知 | -| 125 | update | 是 | 否 | 允许更新部分列 | -| 126 | cachelast | 是 | 否 | 由 create db 的参数 cacheModel 取代 | -| 127 | maxSQLLength | 是 | 否 | SQL 上限为 1MB,无需参数控制 | -| 128 | maxWildCardsLength | 是 | 否 | 3.0 行为未知 | -| 129 | maxRegexStringLen | 是 | 否 | 3.0 行为未知 | -| 130 | maxNumOfOrderedRes | 是 | 否 | 3.0 行为未知 | -| 131 | maxConnections | 是 | 否 | 取决于系统配置和系统处理能力,详见后面的 Note | -| 132 | mnodeEqualVnodeNum | 是 | 否 | 3.0 行为未知 | -| 133 | http | 是 | 否 | http 服务由 taosAdapter 提供 | -| 134 | httpEnableRecordSql | 是 | 否 | taosd 不提供 http 服务 | -| 135 | httpMaxThreads | 是 | 否 | taosd 不提供 http 服务 | -| 136 | restfulRowLimit | 是 | 否 | taosd 不提供 http 服务 | -| 137 | httpDbNameMandatory | 是 | 否 | taosd 不提供 http 服务 | -| 138 | httpKeepAlive | 是 | 否 | taosd 不提供 http 服务 | -| 139 | enableRecordSql | 是 | 否 | 3.0 行为未知 | -| 140 | maxBinaryDisplayWidth | 是 | 否 | 3.0 行为未知 | -| 141 | stream | 是 | 否 | 默认启用连续查询 | -| 142 | retrieveBlockingModel | 是 | 否 | 3.0 行为未知 | -| 143 | tsdbMetaCompactRatio | 是 | 否 | 3.0 行为未知 | -| 144 | defaultJSONStrType | 是 | 否 | 3.0 行为未知 | -| 145 | walFlushSize | 是 | 否 | 3.0 行为未知 | -| 146 | keepTimeOffset | 是 | 否 | 3.0 行为未知 | -| 147 | flowctrl | 是 | 否 | 3.0 行为未知 | -| 148 | slaveQuery | 是 | 否 | 3.0 行为未知: slave vnode 是否能够处理查询? | -| 149 | adjustMaster | 是 | 否 | 3.0 行为未知 | -| 150 | topicBinaryLen | 是 | 否 | 3.0 行为未知 | -| 151 | telegrafUseFieldNum | 是 | 否 | 3.0 行为未知 | -| 152 | deadLockKillQuery | 是 | 否 | 3.0 行为未知 | -| 153 | clientMerge | 是 | 否 | 3.0 行为未知 | -| 154 | sdbDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 155 | odbcDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 156 | httpDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 157 | monDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 158 | cqDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 159 | shortcutFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | -| 160 | probeSeconds | 是 | 否 | 3.0 行为未知 | -| 161 | probeKillSeconds | 是 | 否 | 3.0 行为未知 | -| 162 | probeInterval | 是 | 否 | 3.0 行为未知 | -| 163 | lossyColumns | 是 | 否 | 3.0 行为未知 | -| 164 | fPrecision | 是 | 否 | 3.0 行为未知 | -| 165 | dPrecision | 是 | 否 | 3.0 行为未知 | -| 166 | maxRange | 是 | 否 | 3.0 行为未知 | -| 167 | range | 是 | 否 | 3.0 行为未知 | +| 10 | queryPolicy | 否 | 是 | | +| 11 | querySmaOptimize | 否 | 是 | | +| 12 | maxNumOfDistinctRes | 是 | 是 | | +| 15 | countAlwaysReturnValue | 是 | 是 | | +| 16 | dataDir | 是 | 是 | | +| 17 | minimalDataDirGB | 是 | 是 | | +| 18 | supportVnodes | 否 | 是 | | +| 19 | tempDir | 是 | 是 | | +| 20 | minimalTmpDirGB | 是 | 是 | | +| 21 | smlChildTableName | 是 | 是 | | +| 22 | smlTagName | 是 | 是 | | +| 23 | smlDataFormat | 否 | 是 | | +| 24 | statusInterval | 是 | 是 | | +| 25 | logDir | 是 | 是 | | +| 26 | minimalLogDirGB | 是 | 是 | | +| 27 | numOfLogLines | 是 | 是 | | +| 28 | asyncLog | 是 | 是 | | +| 29 | logKeepDays | 是 | 是 | | +| 30 | debugFlag | 是 | 是 | | +| 31 | tmrDebugFlag | 是 | 是 | | +| 32 | uDebugFlag | 是 | 是 | | +| 33 | rpcDebugFlag | 是 | 是 | | +| 34 | jniDebugFlag | 是 | 是 | | +| 35 | qDebugFlag | 是 | 是 | | +| 36 | cDebugFlag | 是 | 是 | | +| 37 | dDebugFlag | 是 | 是 | | +| 38 | vDebugFlag | 是 | 是 | | +| 39 | mDebugFlag | 是 | 是 | | +| 40 | wDebugFlag | 是 | 是 | | +| 41 | sDebugFlag | 是 | 是 | | +| 42 | tsdbDebugFlag | 是 | 是 | | +| 43 | tqDebugFlag | 否 | 是 | | +| 44 | fsDebugFlag | 是 | 是 | | +| 45 | udfDebugFlag | 否 | 是 | | +| 46 | smaDebugFlag | 否 | 是 | | +| 47 | idxDebugFlag | 否 | 是 | | +| 48 | tdbDebugFlag | 否 | 是 | | +| 49 | metaDebugFlag | 否 | 是 | | +| 50 | timezone | 是 | 是 | | +| 51 | locale | 是 | 是 | | +| 52 | charset | 是 | 是 | | +| 53 | udf | 是 | 是 | | +| 54 | enableCoreFile | 是 | 是 | | + +## 2.x->3.0 的废弃参数 + +| # | **参数** | **适用于 2.X ** | **适用于 3.0 ** | 3.0 版本的当前行为 | +| --- | :---------------------: | --------------- | --------------- | ------------------------------------------------- | +| 1 | arbitrator | 是 | 否 | 通过 RAFT 协议选主 | +| 2 | numOfThreadsPerCore | 是 | 否 | 有其它参数设置多种线程池的大小 | +| 3 | numOfMnodes | 是 | 否 | 通过 create mnode 命令动态创建 mnode | +| 4 | vnodeBak | 是 | 否 | 3.0 行为未知 | +| 5 | balance | 是 | 否 | 负载均衡功能由 split/merge vgroups 实现 | +| 6 | balanceInterval | 是 | 否 | 随着 balance 参数失效 | +| 7 | offlineThreshold | 是 | 否 | 3.0 行为未知 | +| 8 | role | 是 | 否 | 由 supportVnode 决定是否能够创建 | +| 9 | dnodeNopLoop | 是 | 否 | 2.6 文档中未找到此参数 | +| 10 | keepTimeOffset | 是 | 否 | 2.6 文档中未找到此参数 | +| 11 | rpcTimer | 是 | 否 | 3.0 行为未知 | +| 12 | rpcMaxTime | 是 | 否 | 3.0 行为未知 | +| 13 | rpcForceTcp | 是 | 否 | 默认为 TCP | +| 14 | tcpConnTimeout | 是 | 否 | 3.0 行为未知 | +| 15 | syncCheckInterval | 是 | 否 | 3.0 行为未知 | +| 16 | maxTmrCtrl | 是 | 否 | 3.0 行为未知 | +| 17 | monitorReplica | 是 | 否 | 由 RAFT 协议管理多副本 | +| 18 | smlTagNullName | 是 | 否 | 3.0 行为未知 | +| 19 | keepColumnName | 是 | 否 | 3.0 行为未知 | +| 20 | ratioOfQueryCores | 是 | 否 | 由 线程池 相关配置参数决定 | +| 21 | maxStreamCompDelay | 是 | 否 | 3.0 行为未知 | +| 22 | maxFirstStreamCompDelay | 是 | 否 | 3.0 行为未知 | +| 23 | retryStreamCompDelay | 是 | 否 | 3.0 行为未知 | +| 24 | streamCompDelayRatio | 是 | 否 | 3.0 行为未知 | +| 25 | maxVgroupsPerDb | 是 | 否 | 由 create db 的参数 vgroups 指定实际 vgroups 数量 | +| 26 | maxTablesPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | +| 27 | minTablesPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | +| 28 | tableIncStepPerVnode | 是 | 否 | DB 中的所有表近似平均分配到各个 vgroup | +| 29 | cache | 是 | 否 | 由 buffer 代替 cache\*blocks | +| 30 | blocks | 是 | 否 | 由 buffer 代替 cache\*blocks | +| 31 | days | 是 | 否 | 由 create db 的参数 duration 取代 | +| 32 | keep | 是 | 否 | 由 create db 的参数 keep 取代 | +| 33 | minRows | 是 | 否 | 由 create db 的参数 minRows 取代 | +| 34 | maxRows | 是 | 否 | 由 create db 的参数 maxRows 取代 | +| 35 | quorum | 是 | 否 | 由 RAFT 协议决定 | +| 36 | comp | 是 | 否 | 由 create db 的参数 comp 取代 | +| 37 | walLevel | 是 | 否 | 由 create db 的参数 wal_level 取代 | +| 38 | fsync | 是 | 否 | 由 create db 的参数 wal_fsync_period 取代 | +| 39 | replica | 是 | 否 | 由 create db 的参数 replica 取代 | +| 40 | partitions | 是 | 否 | 3.0 行为未知 | +| 41 | update | 是 | 否 | 允许更新部分列 | +| 42 | cachelast | 是 | 否 | 由 create db 的参数 cacheModel 取代 | +| 43 | maxSQLLength | 是 | 否 | SQL 上限为 1MB,无需参数控制 | +| 44 | maxWildCardsLength | 是 | 否 | 3.0 行为未知 | +| 45 | maxRegexStringLen | 是 | 否 | 3.0 行为未知 | +| 46 | maxNumOfOrderedRes | 是 | 否 | 3.0 行为未知 | +| 47 | maxConnections | 是 | 否 | 取决于系统配置和系统处理能力,详见后面的 Note | +| 48 | mnodeEqualVnodeNum | 是 | 否 | 3.0 行为未知 | +| 49 | http | 是 | 否 | http 服务由 taosAdapter 提供 | +| 50 | httpEnableRecordSql | 是 | 否 | taosd 不提供 http 服务 | +| 51 | httpMaxThreads | 是 | 否 | taosd 不提供 http 服务 | +| 52 | restfulRowLimit | 是 | 否 | taosd 不提供 http 服务 | +| 53 | httpDbNameMandatory | 是 | 否 | taosd 不提供 http 服务 | +| 54 | httpKeepAlive | 是 | 否 | taosd 不提供 http 服务 | +| 55 | enableRecordSql | 是 | 否 | 3.0 行为未知 | +| 56 | maxBinaryDisplayWidth | 是 | 否 | 3.0 行为未知 | +| 57 | stream | 是 | 否 | 默认启用连续查询 | +| 58 | retrieveBlockingModel | 是 | 否 | 3.0 行为未知 | +| 59 | tsdbMetaCompactRatio | 是 | 否 | 3.0 行为未知 | +| 60 | defaultJSONStrType | 是 | 否 | 3.0 行为未知 | +| 61 | walFlushSize | 是 | 否 | 3.0 行为未知 | +| 62 | keepTimeOffset | 是 | 否 | 3.0 行为未知 | +| 63 | flowctrl | 是 | 否 | 3.0 行为未知 | +| 64 | slaveQuery | 是 | 否 | 3.0 行为未知: slave vnode 是否能够处理查询? | +| 65 | adjustMaster | 是 | 否 | 3.0 行为未知 | +| 66 | topicBinaryLen | 是 | 否 | 3.0 行为未知 | +| 67 | telegrafUseFieldNum | 是 | 否 | 3.0 行为未知 | +| 68 | deadLockKillQuery | 是 | 否 | 3.0 行为未知 | +| 69 | clientMerge | 是 | 否 | 3.0 行为未知 | +| 70 | sdbDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 71 | odbcDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 72 | httpDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 73 | monDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 74 | cqDebugFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 75 | shortcutFlag | 是 | 否 | 参考 3.0 的 DebugFlag 系列参数 | +| 76 | probeSeconds | 是 | 否 | 3.0 行为未知 | +| 77 | probeKillSeconds | 是 | 否 | 3.0 行为未知 | +| 78 | probeInterval | 是 | 否 | 3.0 行为未知 | +| 79 | lossyColumns | 是 | 否 | 3.0 行为未知 | +| 80 | fPrecision | 是 | 否 | 3.0 行为未知 | +| 81 | dPrecision | 是 | 否 | 3.0 行为未知 | +| 82 | maxRange | 是 | 否 | 3.0 行为未知 | +| 83 | range | 是 | 否 | 3.0 行为未知 | diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index 7ed9e0c5a0..0ea34829a5 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -10,11 +10,14 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do import Release from "/components/ReleaseV3"; +## 3.0.2.0 + + + ## 3.0.1.8 - ## 3.0.1.7 diff --git a/docs/zh/28-releases/02-tools.md b/docs/zh/28-releases/02-tools.md index 67ca3fae67..6471826b50 100644 --- a/docs/zh/28-releases/02-tools.md +++ b/docs/zh/28-releases/02-tools.md @@ -10,6 +10,10 @@ taosTools 各版本安装包下载链接如下: import Release from "/components/ReleaseV3"; +## 2.3.2 + + + ## 2.3.0 diff --git a/include/client/taos.h b/include/client/taos.h index 69774b750f..379363c51d 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -149,7 +149,7 @@ DLL_EXPORT TAOS *taos_connect(const char *ip, const char *user, const char DLL_EXPORT TAOS *taos_connect_auth(const char *ip, const char *user, const char *auth, const char *db, uint16_t port); DLL_EXPORT void taos_close(TAOS *taos); -const char *taos_data_type(int type); +DLL_EXPORT const char *taos_data_type(int type); DLL_EXPORT TAOS_STMT *taos_stmt_init(TAOS *taos); DLL_EXPORT TAOS_STMT *taos_stmt_init_with_reqid(TAOS *taos, int64_t reqid); diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 25dcda8d2c..01b4712285 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -70,6 +70,11 @@ static inline bool vnodeIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || (type == TDMT_VND_UPDATE_TAG_VAL); } + +static inline bool syncUtilUserCommit(tmsg_t msgType) { + return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; +} + /* ------------------------ OTHER DEFINITIONS ------------------------ */ // IE type #define TSDB_IE_TYPE_SEC 1 @@ -507,6 +512,8 @@ typedef struct { char* pComment; char* pAst1; char* pAst2; + int64_t deleteMark1; + int64_t deleteMark2; } SMCreateStbReq; int32_t tSerializeSMCreateStbReq(void* buf, int32_t bufLen, SMCreateStbReq* pReq); @@ -2020,6 +2027,7 @@ typedef struct { typedef struct { int64_t maxdelay[2]; int64_t watermark[2]; + int64_t deleteMark[2]; int32_t qmsgLen[2]; char* qmsg[2]; // pAst:qmsg:SRetention => trigger aggr task1/2 } SRSmaParam; @@ -2741,6 +2749,7 @@ typedef struct { char* tagsFilter; char* sql; char* ast; + int64_t deleteMark; } SMCreateSmaReq; int32_t tSerializeSMCreateSmaReq(void* buf, int32_t bufLen, SMCreateSmaReq* pReq); diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index ccf91600db..a09c87eea8 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -147,195 +147,198 @@ #define TK_ROLLUP 129 #define TK_TTL 130 #define TK_SMA 131 -#define TK_FIRST 132 -#define TK_LAST 133 -#define TK_SHOW 134 -#define TK_PRIVILEGES 135 -#define TK_DATABASES 136 -#define TK_TABLES 137 -#define TK_STABLES 138 -#define TK_MNODES 139 -#define TK_QNODES 140 -#define TK_FUNCTIONS 141 -#define TK_INDEXES 142 -#define TK_ACCOUNTS 143 -#define TK_APPS 144 -#define TK_CONNECTIONS 145 -#define TK_LICENCES 146 -#define TK_GRANTS 147 -#define TK_QUERIES 148 -#define TK_SCORES 149 -#define TK_TOPICS 150 -#define TK_VARIABLES 151 -#define TK_CLUSTER 152 -#define TK_BNODES 153 -#define TK_SNODES 154 -#define TK_TRANSACTIONS 155 -#define TK_DISTRIBUTED 156 -#define TK_CONSUMERS 157 -#define TK_SUBSCRIPTIONS 158 -#define TK_VNODES 159 -#define TK_LIKE 160 -#define TK_TBNAME 161 -#define TK_QTAGS 162 -#define TK_AS 163 -#define TK_INDEX 164 -#define TK_FUNCTION 165 -#define TK_INTERVAL 166 -#define TK_TOPIC 167 -#define TK_WITH 168 -#define TK_META 169 -#define TK_CONSUMER 170 -#define TK_GROUP 171 -#define TK_DESC 172 -#define TK_DESCRIBE 173 -#define TK_RESET 174 -#define TK_QUERY 175 -#define TK_CACHE 176 -#define TK_EXPLAIN 177 -#define TK_ANALYZE 178 -#define TK_VERBOSE 179 -#define TK_NK_BOOL 180 -#define TK_RATIO 181 -#define TK_NK_FLOAT 182 -#define TK_OUTPUTTYPE 183 -#define TK_AGGREGATE 184 -#define TK_BUFSIZE 185 -#define TK_STREAM 186 -#define TK_INTO 187 -#define TK_TRIGGER 188 -#define TK_AT_ONCE 189 -#define TK_WINDOW_CLOSE 190 -#define TK_IGNORE 191 -#define TK_EXPIRED 192 -#define TK_FILL_HISTORY 193 -#define TK_SUBTABLE 194 -#define TK_KILL 195 -#define TK_CONNECTION 196 -#define TK_TRANSACTION 197 -#define TK_BALANCE 198 -#define TK_VGROUP 199 -#define TK_MERGE 200 -#define TK_REDISTRIBUTE 201 -#define TK_SPLIT 202 -#define TK_DELETE 203 -#define TK_INSERT 204 -#define TK_NULL 205 -#define TK_NK_QUESTION 206 -#define TK_NK_ARROW 207 -#define TK_ROWTS 208 -#define TK_QSTART 209 -#define TK_QEND 210 -#define TK_QDURATION 211 -#define TK_WSTART 212 -#define TK_WEND 213 -#define TK_WDURATION 214 -#define TK_IROWTS 215 -#define TK_CAST 216 -#define TK_NOW 217 -#define TK_TODAY 218 -#define TK_TIMEZONE 219 -#define TK_CLIENT_VERSION 220 -#define TK_SERVER_VERSION 221 -#define TK_SERVER_STATUS 222 -#define TK_CURRENT_USER 223 -#define TK_COUNT 224 -#define TK_LAST_ROW 225 -#define TK_CASE 226 -#define TK_END 227 -#define TK_WHEN 228 -#define TK_THEN 229 -#define TK_ELSE 230 -#define TK_BETWEEN 231 -#define TK_IS 232 -#define TK_NK_LT 233 -#define TK_NK_GT 234 -#define TK_NK_LE 235 -#define TK_NK_GE 236 -#define TK_NK_NE 237 -#define TK_MATCH 238 -#define TK_NMATCH 239 -#define TK_CONTAINS 240 -#define TK_IN 241 -#define TK_JOIN 242 -#define TK_INNER 243 -#define TK_SELECT 244 -#define TK_DISTINCT 245 -#define TK_WHERE 246 -#define TK_PARTITION 247 -#define TK_BY 248 -#define TK_SESSION 249 -#define TK_STATE_WINDOW 250 -#define TK_SLIDING 251 -#define TK_FILL 252 -#define TK_VALUE 253 -#define TK_NONE 254 -#define TK_PREV 255 -#define TK_LINEAR 256 -#define TK_NEXT 257 -#define TK_HAVING 258 -#define TK_RANGE 259 -#define TK_EVERY 260 -#define TK_ORDER 261 -#define TK_SLIMIT 262 -#define TK_SOFFSET 263 -#define TK_LIMIT 264 -#define TK_OFFSET 265 -#define TK_ASC 266 -#define TK_NULLS 267 -#define TK_ABORT 268 -#define TK_AFTER 269 -#define TK_ATTACH 270 -#define TK_BEFORE 271 -#define TK_BEGIN 272 -#define TK_BITAND 273 -#define TK_BITNOT 274 -#define TK_BITOR 275 -#define TK_BLOCKS 276 -#define TK_CHANGE 277 -#define TK_COMMA 278 -#define TK_COMPACT 279 -#define TK_CONCAT 280 -#define TK_CONFLICT 281 -#define TK_COPY 282 -#define TK_DEFERRED 283 -#define TK_DELIMITERS 284 -#define TK_DETACH 285 -#define TK_DIVIDE 286 -#define TK_DOT 287 -#define TK_EACH 288 -#define TK_FAIL 289 -#define TK_FILE 290 -#define TK_FOR 291 -#define TK_GLOB 292 -#define TK_ID 293 -#define TK_IMMEDIATE 294 -#define TK_IMPORT 295 -#define TK_INITIALLY 296 -#define TK_INSTEAD 297 -#define TK_ISNULL 298 -#define TK_KEY 299 -#define TK_MODULES 300 -#define TK_NK_BITNOT 301 -#define TK_NK_SEMI 302 -#define TK_NOTNULL 303 -#define TK_OF 304 -#define TK_PLUS 305 -#define TK_PRIVILEGE 306 -#define TK_RAISE 307 -#define TK_REPLACE 308 -#define TK_RESTRICT 309 -#define TK_ROW 310 -#define TK_SEMI 311 -#define TK_STAR 312 -#define TK_STATEMENT 313 -#define TK_STRING 314 -#define TK_TIMES 315 -#define TK_UPDATE 316 -#define TK_VALUES 317 -#define TK_VARIABLE 318 -#define TK_VIEW 319 -#define TK_WAL 320 +#define TK_DELETE_MARK 132 +#define TK_FIRST 133 +#define TK_LAST 134 +#define TK_SHOW 135 +#define TK_PRIVILEGES 136 +#define TK_DATABASES 137 +#define TK_TABLES 138 +#define TK_STABLES 139 +#define TK_MNODES 140 +#define TK_QNODES 141 +#define TK_FUNCTIONS 142 +#define TK_INDEXES 143 +#define TK_ACCOUNTS 144 +#define TK_APPS 145 +#define TK_CONNECTIONS 146 +#define TK_LICENCES 147 +#define TK_GRANTS 148 +#define TK_QUERIES 149 +#define TK_SCORES 150 +#define TK_TOPICS 151 +#define TK_VARIABLES 152 +#define TK_CLUSTER 153 +#define TK_BNODES 154 +#define TK_SNODES 155 +#define TK_TRANSACTIONS 156 +#define TK_DISTRIBUTED 157 +#define TK_CONSUMERS 158 +#define TK_SUBSCRIPTIONS 159 +#define TK_VNODES 160 +#define TK_LIKE 161 +#define TK_TBNAME 162 +#define TK_QTAGS 163 +#define TK_AS 164 +#define TK_INDEX 165 +#define TK_FUNCTION 166 +#define TK_INTERVAL 167 +#define TK_TOPIC 168 +#define TK_WITH 169 +#define TK_META 170 +#define TK_CONSUMER 171 +#define TK_GROUP 172 +#define TK_DESC 173 +#define TK_DESCRIBE 174 +#define TK_RESET 175 +#define TK_QUERY 176 +#define TK_CACHE 177 +#define TK_EXPLAIN 178 +#define TK_ANALYZE 179 +#define TK_VERBOSE 180 +#define TK_NK_BOOL 181 +#define TK_RATIO 182 +#define TK_NK_FLOAT 183 +#define TK_OUTPUTTYPE 184 +#define TK_AGGREGATE 185 +#define TK_BUFSIZE 186 +#define TK_STREAM 187 +#define TK_INTO 188 +#define TK_TRIGGER 189 +#define TK_AT_ONCE 190 +#define TK_WINDOW_CLOSE 191 +#define TK_IGNORE 192 +#define TK_EXPIRED 193 +#define TK_FILL_HISTORY 194 +#define TK_SUBTABLE 195 +#define TK_KILL 196 +#define TK_CONNECTION 197 +#define TK_TRANSACTION 198 +#define TK_BALANCE 199 +#define TK_VGROUP 200 +#define TK_MERGE 201 +#define TK_REDISTRIBUTE 202 +#define TK_SPLIT 203 +#define TK_DELETE 204 +#define TK_INSERT 205 +#define TK_NULL 206 +#define TK_NK_QUESTION 207 +#define TK_NK_ARROW 208 +#define TK_ROWTS 209 +#define TK_QSTART 210 +#define TK_QEND 211 +#define TK_QDURATION 212 +#define TK_WSTART 213 +#define TK_WEND 214 +#define TK_WDURATION 215 +#define TK_IROWTS 216 +#define TK_CAST 217 +#define TK_NOW 218 +#define TK_TODAY 219 +#define TK_TIMEZONE 220 +#define TK_CLIENT_VERSION 221 +#define TK_SERVER_VERSION 222 +#define TK_SERVER_STATUS 223 +#define TK_CURRENT_USER 224 +#define TK_COUNT 225 +#define TK_LAST_ROW 226 +#define TK_CASE 227 +#define TK_END 228 +#define TK_WHEN 229 +#define TK_THEN 230 +#define TK_ELSE 231 +#define TK_BETWEEN 232 +#define TK_IS 233 +#define TK_NK_LT 234 +#define TK_NK_GT 235 +#define TK_NK_LE 236 +#define TK_NK_GE 237 +#define TK_NK_NE 238 +#define TK_MATCH 239 +#define TK_NMATCH 240 +#define TK_CONTAINS 241 +#define TK_IN 242 +#define TK_JOIN 243 +#define TK_INNER 244 +#define TK_SELECT 245 +#define TK_DISTINCT 246 +#define TK_WHERE 247 +#define TK_PARTITION 248 +#define TK_BY 249 +#define TK_SESSION 250 +#define TK_STATE_WINDOW 251 +#define TK_EVENT_WINDOW 252 +#define TK_START 253 +#define TK_SLIDING 254 +#define TK_FILL 255 +#define TK_VALUE 256 +#define TK_NONE 257 +#define TK_PREV 258 +#define TK_LINEAR 259 +#define TK_NEXT 260 +#define TK_HAVING 261 +#define TK_RANGE 262 +#define TK_EVERY 263 +#define TK_ORDER 264 +#define TK_SLIMIT 265 +#define TK_SOFFSET 266 +#define TK_LIMIT 267 +#define TK_OFFSET 268 +#define TK_ASC 269 +#define TK_NULLS 270 +#define TK_ABORT 271 +#define TK_AFTER 272 +#define TK_ATTACH 273 +#define TK_BEFORE 274 +#define TK_BEGIN 275 +#define TK_BITAND 276 +#define TK_BITNOT 277 +#define TK_BITOR 278 +#define TK_BLOCKS 279 +#define TK_CHANGE 280 +#define TK_COMMA 281 +#define TK_COMPACT 282 +#define TK_CONCAT 283 +#define TK_CONFLICT 284 +#define TK_COPY 285 +#define TK_DEFERRED 286 +#define TK_DELIMITERS 287 +#define TK_DETACH 288 +#define TK_DIVIDE 289 +#define TK_DOT 290 +#define TK_EACH 291 +#define TK_FAIL 292 +#define TK_FILE 293 +#define TK_FOR 294 +#define TK_GLOB 295 +#define TK_ID 296 +#define TK_IMMEDIATE 297 +#define TK_IMPORT 298 +#define TK_INITIALLY 299 +#define TK_INSTEAD 300 +#define TK_ISNULL 301 +#define TK_KEY 302 +#define TK_MODULES 303 +#define TK_NK_BITNOT 304 +#define TK_NK_SEMI 305 +#define TK_NOTNULL 306 +#define TK_OF 307 +#define TK_PLUS 308 +#define TK_PRIVILEGE 309 +#define TK_RAISE 310 +#define TK_REPLACE 311 +#define TK_RESTRICT 312 +#define TK_ROW 313 +#define TK_SEMI 314 +#define TK_STAR 315 +#define TK_STATEMENT 316 +#define TK_STRING 317 +#define TK_TIMES 318 +#define TK_UPDATE 319 +#define TK_VALUES 320 +#define TK_VARIABLE 321 +#define TK_VIEW 322 +#define TK_WAL 323 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index 6154882756..a95db86d3f 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -211,6 +211,8 @@ int32_t catalogGetCachedSTableMeta(SCatalog* pCtg, const SName* pTableName, STab int32_t catalogGetCachedTableHashVgroup(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, bool* exists); +int32_t catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta); + /** * Force refresh DB's local cached vgroup info. * @param pCtg (input, got with catalogGetHandle) diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index e69c6e747d..b1054e7b85 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -133,6 +133,9 @@ typedef struct STableOptions { SNodeList* pWatermark; int64_t watermark1; int64_t watermark2; + SNodeList* pDeleteMark; + int64_t deleteMark1; + int64_t deleteMark2; SNodeList* pRollupFuncs; int32_t ttl; SNodeList* pSma; @@ -383,6 +386,7 @@ typedef struct SStreamOptions { int8_t triggerType; SNode* pDelay; SNode* pWatermark; + SNode* pDeleteMark; int8_t fillHistory; int8_t ignoreExpired; } SStreamOptions; diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index f94e0c98dc..1f266cd0ef 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -112,6 +112,7 @@ typedef enum ENodeType { QUERY_NODE_COLUMN_REF, QUERY_NODE_WHEN_THEN, QUERY_NODE_CASE_WHEN, + QUERY_NODE_EVENT_WINDOW, // Statement nodes are used in parser and planner module. QUERY_NODE_SET_OPERATOR = 100, @@ -234,7 +235,6 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN, QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN, QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN, - QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN, QUERY_NODE_PHYSICAL_PLAN_PROJECT, QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN, QUERY_NODE_PHYSICAL_PLAN_HASH_AGG, @@ -265,7 +265,10 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT, QUERY_NODE_PHYSICAL_PLAN_DELETE, QUERY_NODE_PHYSICAL_SUBPLAN, - QUERY_NODE_PHYSICAL_PLAN + QUERY_NODE_PHYSICAL_PLAN, + QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN, + QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT, + QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT } ENodeType; /** diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 574d41db58..6f700c75ed 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -91,6 +91,7 @@ typedef struct SScanLogicNode { SNode* pTagIndexCond; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; SArray* pSmaIndexes; SNodeList* pGroupTags; @@ -184,7 +185,12 @@ typedef struct SMergeLogicNode { bool groupSort; } SMergeLogicNode; -typedef enum EWindowType { WINDOW_TYPE_INTERVAL = 1, WINDOW_TYPE_SESSION, WINDOW_TYPE_STATE } EWindowType; +typedef enum EWindowType { + WINDOW_TYPE_INTERVAL = 1, + WINDOW_TYPE_SESSION, + WINDOW_TYPE_STATE, + WINDOW_TYPE_EVENT +} EWindowType; typedef enum EWindowAlgorithm { INTERVAL_ALGO_HASH = 1, @@ -211,8 +217,11 @@ typedef struct SWindowLogicNode { SNode* pTspk; SNode* pTsEnd; SNode* pStateExpr; + SNode* pStartCond; + SNode* pEndCond; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EWindowAlgorithm windowAlgo; EOrder inputTsOrder; @@ -440,6 +449,7 @@ typedef struct SWinodwPhysiNode { SNode* pTsEnd; // window end timestamp int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EOrder inputTsOrder; EOrder outputTsOrder; @@ -495,6 +505,14 @@ typedef struct SStateWinodwPhysiNode { typedef SStateWinodwPhysiNode SStreamStateWinodwPhysiNode; +typedef struct SEventWinodwPhysiNode { + SWinodwPhysiNode window; + SNode* pStartCond; + SNode* pEndCond; +} SEventWinodwPhysiNode; + +typedef SEventWinodwPhysiNode SStreamEventWinodwPhysiNode; + typedef struct SSortPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of order_by_clause and parameter expression of aggregate function diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 9f980fd0db..5805f4968b 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -223,6 +223,13 @@ typedef struct SIntervalWindowNode { SNode* pFill; } SIntervalWindowNode; +typedef struct SEventWindowNode { + ENodeType type; // QUERY_NODE_EVENT_WINDOW + SNode* pCol; // timestamp primary key + SNode* pStartCond; + SNode* pEndCond; +} SEventWindowNode; + typedef enum EFillMode { FILL_MODE_NONE = 1, FILL_MODE_VALUE, diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index 82f5c478c1..f7bd68393e 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -34,6 +34,7 @@ typedef struct SPlanContext { bool showRewrite; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; char* pMsg; int32_t msgLen; diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index ffb982af8e..91ec5f52e5 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -262,24 +262,23 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t (NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \ NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code)) -#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || (_code) == TSDB_CODE_VND_STOPPED) +#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || (_code) == TSDB_CODE_VND_STOPPED || (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) #define SYNC_SELF_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_RESTORING || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR) -#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) (false) // used later +#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_MNODE_NOT_FOUND) + +#define NO_RET_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) #define NEED_REDIRECT_ERROR(_code) \ - ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ - (_code) == TSDB_CODE_MNODE_NOT_FOUND || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ - SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) || \ - (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) + (NO_RET_REDIRECT_ERROR(_code) || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ + SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) + #define NEED_CLIENT_RM_TBLMETA_REQ(_type) \ ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_MND_CREATE_STB || (_type) == TDMT_VND_DROP_TABLE || \ (_type) == TDMT_MND_DROP_STB) #define NEED_SCHEDULER_REDIRECT_ERROR(_code) \ - ((_code) == TSDB_CODE_MNODE_NOT_FOUND || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ - SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) || \ - (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) + (SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) #define REQUEST_TOTAL_EXEC_TIMES 2 diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 7f9b240f63..4cf4800472 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -25,7 +25,7 @@ extern "C" { #include "tlrucache.h" #include "tmsgcb.h" -#define SYNC_RESP_TTL_MS 10000000 +#define SYNC_RESP_TTL_MS 30000 #define SYNC_SPEED_UP_HB_TIMER 400 #define SYNC_SPEED_UP_AFTER_MS (1000 * 20) #define SYNC_SLOW_DOWN_RANGE 100 @@ -47,6 +47,7 @@ extern "C" { #define SYNC_HEARTBEAT_SLOW_MS 1500 #define SYNC_HEARTBEAT_REPLY_SLOW_MS 1500 +#define SYNC_SNAP_RESEND_MS 1000 * 60 #define SYNC_MAX_BATCH_SIZE 1 #define SYNC_INDEX_BEGIN 0 diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index d761813db1..87f753e6aa 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -72,6 +72,7 @@ typedef struct SRpcMsg { typedef void (*RpcCfp)(void *parent, SRpcMsg *, SEpSet *epset); typedef bool (*RpcRfp)(int32_t code, tmsg_t msgType); typedef bool (*RpcTfp)(int32_t code, tmsg_t msgType); +typedef bool (*RpcFFfp)(tmsg_t msgType); typedef void (*RpcDfp)(void *ahandle); typedef struct SRpcInit { @@ -90,6 +91,9 @@ typedef struct SRpcInit { int32_t retryMaxInterval; // retry max interval int64_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size int8_t encryption; // encrypt or not @@ -107,6 +111,8 @@ typedef struct SRpcInit { // destroy client ahandle; RpcDfp dfp; + // fail fast fp + RpcFFfp ffp; void *parent; } SRpcInit; diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index 936f11c41a..a1ae1e429d 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -33,16 +33,16 @@ extern "C" { #define wTrace(...) { if (wDebugFlag & DEBUG_TRACE) { taosPrintLog("WAL ", DEBUG_TRACE, wDebugFlag, __VA_ARGS__); }} // clang-format on -#define WAL_PROTO_VER 0 -#define WAL_NOSUFFIX_LEN 20 -#define WAL_SUFFIX_AT (WAL_NOSUFFIX_LEN + 1) -#define WAL_LOG_SUFFIX "log" -#define WAL_INDEX_SUFFIX "idx" -#define WAL_REFRESH_MS 1000 -#define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12) -#define WAL_FILE_LEN (WAL_PATH_LEN + 32) -#define WAL_MAGIC 0xFAFBFCFDF4F3F2F1ULL -#define WAL_SCAN_BUF_SIZE (1024 * 1024 * 3) +#define WAL_PROTO_VER 0 +#define WAL_NOSUFFIX_LEN 20 +#define WAL_SUFFIX_AT (WAL_NOSUFFIX_LEN + 1) +#define WAL_LOG_SUFFIX "log" +#define WAL_INDEX_SUFFIX "idx" +#define WAL_REFRESH_MS 1000 +#define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12) +#define WAL_FILE_LEN (WAL_PATH_LEN + 32) +#define WAL_MAGIC 0xFAFBFCFDF4F3F2F1ULL +#define WAL_SCAN_BUF_SIZE (1024 * 1024 * 3) typedef enum { TAOS_WAL_WRITE = 1, @@ -107,6 +107,8 @@ typedef struct SWal { TdFilePtr pIdxFile; int32_t writeCur; SArray *fileInfoSet; // SArray + // gc + SArray *toDeleteFiles; // SArray // status int64_t totSize; int64_t lastRollSeq; diff --git a/include/os/os.h b/include/os/os.h index 0688eeb9ad..b27fa84406 100644 --- a/include/os/os.h +++ b/include/os/os.h @@ -27,6 +27,7 @@ extern "C" { #if !defined(WINDOWS) #include +#include #include #include #include diff --git a/include/os/osDef.h b/include/os/osDef.h index 0bf9c6184e..c18728c9a7 100644 --- a/include/os/osDef.h +++ b/include/os/osDef.h @@ -120,12 +120,6 @@ void syslog(int unused, const char *format, ...); #define POINTER_SHIFT(p, b) ((void *)((char *)(p) + (b))) #define POINTER_DISTANCE(p1, p2) ((char *)(p1) - (char *)(p2)) -#ifndef NDEBUG -#define ASSERT(x) assert(x) -#else -#define ASSERT(x) -#endif - #ifndef UNUSED #define UNUSED(x) ((void)(x)) #endif diff --git a/include/os/osDir.h b/include/os/osDir.h index 40012f8141..73871602c5 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -62,6 +62,7 @@ int32_t taosRealPath(char *dirname, char *realPath, int32_t maxlen); bool taosIsDir(const char *dirname); char *taosDirName(char *dirname); char *taosDirEntryBaseName(char *dirname); +void taosGetCwd(char *buf, int32_t len); TdDirPtr taosOpenDir(const char *dirname); TdDirEntryPtr taosReadDir(TdDirPtr pDir); diff --git a/include/os/osString.h b/include/os/osString.h index 4c3fbe46c3..b609c9d351 100644 --- a/include/os/osString.h +++ b/include/os/osString.h @@ -62,7 +62,7 @@ typedef int32_t TdUcs4; int32_t taosUcs4len(TdUcs4 *ucs4); int64_t taosStr2int64(const char *str); -void taosConvInit(void); +int32_t taosConvInit(void); void taosConvDestroy(); int32_t taosUcs4ToMbs(TdUcs4 *ucs4, int32_t ucs4_max_len, char *mbs); bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs4_max_len, int32_t *len); diff --git a/include/os/osSystem.h b/include/os/osSystem.h index eca984c41a..8f1f5c58d5 100644 --- a/include/os/osSystem.h +++ b/include/os/osSystem.h @@ -46,6 +46,29 @@ void taosSetTerminalMode(); int32_t taosGetOldTerminalMode(); void taosResetTerminalMode(); +#if !defined(WINDOWS) +#define taosPrintTrace(flags, level, dflag) \ + { \ + void* array[100]; \ + int32_t size = backtrace(array, 100); \ + char** strings = backtrace_symbols(array, size); \ + if (strings != NULL) { \ + taosPrintLog(flags, level, dflag, "obtained %d stack frames", size); \ + for (int32_t i = 0; i < size; i++) { \ + taosPrintLog(flags, level, dflag, "frame:%d, %s", i, strings[i]); \ + } \ + } \ + \ + taosMemoryFree(strings); \ + } +#else +#define taosPrintTrace(flags, level, dflag) \ + { \ + taosPrintLog(flags, level, dflag, \ + "backtrace not implemented on windows, so detailed stack information cannot be printed"); \ + } +#endif + #ifdef __cplusplus } #endif diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 739e14790d..e352cfb569 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -72,7 +72,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0102) // #define TSDB_CODE_COM_INVALID_CFG_MSG TAOS_DEF_ERROR_CODE(0, 0x0103) // 2.x #define TSDB_CODE_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0104) // -#define TSDB_CODE_REF_NO_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0105) // internal +// #define TSDB_CODE_REF_NO_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0105) // 2.x #define TSDB_CODE_REF_FULL TAOS_DEF_ERROR_CODE(0, 0x0106) // internal #define TSDB_CODE_REF_ID_REMOVED TAOS_DEF_ERROR_CODE(0, 0x0107) // internal #define TSDB_CODE_REF_INVALID_ID TAOS_DEF_ERROR_CODE(0, 0x0108) // internal @@ -163,7 +163,7 @@ int32_t* taosGetErrno(); // #define TSDB_CODE_MND_ACTION_NEED_REPROCESSEDTAOS_DEF_ERROR_CODE(0, 0x0302) // 2.x #define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303) // #define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0304) // 2.x -#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0305) +// #define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0305) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_VERSION TAOS_DEF_ERROR_CODE(0, 0x0306) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x0307) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_TYPE TAOS_DEF_ERROR_CODE(0, 0x0308) // 2.x @@ -171,27 +171,28 @@ int32_t* taosGetErrno(); // #define TSDB_CODE_MND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x030A) // 2.x #define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x030B) #define TSDB_CODE_MND_INVALID_QUERY_ID TAOS_DEF_ERROR_CODE(0, 0x030C) -#define TSDB_CODE_MND_INVALID_STREAM_ID TAOS_DEF_ERROR_CODE(0, 0x030D) +// #define TSDB_CODE_MND_INVALID_STREAM_ID TAOS_DEF_ERROR_CODE(0, 0x030D) // 2.x #define TSDB_CODE_MND_INVALID_CONN_ID TAOS_DEF_ERROR_CODE(0, 0x030E) -#define TSDB_CODE_MND_MNODE_IS_RUNNING TAOS_DEF_ERROR_CODE(0, 0x0310) -#define TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC TAOS_DEF_ERROR_CODE(0, 0x0311) -#define TSDB_CODE_MND_FAILED_TO_START_SYNC TAOS_DEF_ERROR_CODE(0, 0x0312) -#define TSDB_CODE_MND_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0313) -#define TSDB_CODE_MND_FAILED_TO_INIT_STEP TAOS_DEF_ERROR_CODE(0, 0x0314) +// #define TSDB_CODE_MND_MNODE_IS_RUNNING TAOS_DEF_ERROR_CODE(0, 0x0310) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC TAOS_DEF_ERROR_CODE(0, 0x0311) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_START_SYNC TAOS_DEF_ERROR_CODE(0, 0x0312) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0313) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_INIT_STEP TAOS_DEF_ERROR_CODE(0, 0x0314) // 2.x #define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) // mnode-sdb -#define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) -// #define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0321) // 2.x -#define TSDB_CODE_SDB_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0322) +#define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) // internal +// #define TSDB_CODE_MND_SDB_ERROR TAOS_DEF_ERROR_CODE(0, 0x0321) // 2.x +#define TSDB_CODE_SDB_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0322) // internal #define TSDB_CODE_SDB_OBJ_NOT_THERE TAOS_DEF_ERROR_CODE(0, 0x0323) -#define TSDB_CODE_SDB_INVALID_KEY_TYPE TAOS_DEF_ERROR_CODE(0, 0x0325) -#define TSDB_CODE_SDB_INVALID_ACTION_TYPE TAOS_DEF_ERROR_CODE(0, 0x0326) -#define TSDB_CODE_SDB_INVALID_STATUS_TYPE TAOS_DEF_ERROR_CODE(0, 0x0327) -#define TSDB_CODE_SDB_INVALID_DATA_VER TAOS_DEF_ERROR_CODE(0, 0x0328) -#define TSDB_CODE_SDB_INVALID_DATA_LEN TAOS_DEF_ERROR_CODE(0, 0x0329) +// #define TSDB_CODE_MND_SDB_INVAID_META_ROW TAOS_DEF_ERROR_CODE(0, 0x0324) // 2.x +// #define TSDB_CODE_SDB_INVALID_KEY_TYPE TAOS_DEF_ERROR_CODE(0, 0x0325) // 2.x +#define TSDB_CODE_SDB_INVALID_ACTION_TYPE TAOS_DEF_ERROR_CODE(0, 0x0326) // internal +// #define TSDB_CODE_SDB_INVALID_STATUS_TYPE TAOS_DEF_ERROR_CODE(0, 0x0327) // unused +#define TSDB_CODE_SDB_INVALID_DATA_VER TAOS_DEF_ERROR_CODE(0, 0x0328) // internal +#define TSDB_CODE_SDB_INVALID_DATA_LEN TAOS_DEF_ERROR_CODE(0, 0x0329) // internal #define TSDB_CODE_SDB_INVALID_DATA_CONTENT TAOS_DEF_ERROR_CODE(0, 0x032A) -#define TSDB_CODE_SDB_INVALID_WAl_VER TAOS_DEF_ERROR_CODE(0, 0x032B) +// #define TSDB_CODE_SDB_INVALID_WAl_VER TAOS_DEF_ERROR_CODE(0, 0x032B) // unused #define TSDB_CODE_SDB_OBJ_CREATING TAOS_DEF_ERROR_CODE(0, 0x032C) #define TSDB_CODE_SDB_OBJ_DROPPING TAOS_DEF_ERROR_CODE(0, 0x032D) @@ -512,7 +513,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_TQ_INVALID_CONFIG TAOS_DEF_ERROR_CODE(0, 0x0A00) #define TSDB_CODE_TQ_INIT_FAILED TAOS_DEF_ERROR_CODE(0, 0x0A01) #define TSDB_CODE_TQ_NO_DISK_PERMISSIONS TAOS_DEF_ERROR_CODE(0, 0x0A03) -#define TSDB_CODE_TQ_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0A04) +// #define TSDB_CODE_TQ_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0A04) // #define TSDB_CODE_TQ_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0A05) #define TSDB_CODE_TQ_FILE_ALREADY_EXISTS TAOS_DEF_ERROR_CODE(0, 0x0A06) #define TSDB_CODE_TQ_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0A07) @@ -698,7 +699,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_RSMA_INVALID_ENV TAOS_DEF_ERROR_CODE(0, 0x3150) #define TSDB_CODE_RSMA_INVALID_STAT TAOS_DEF_ERROR_CODE(0, 0x3151) #define TSDB_CODE_RSMA_QTASKINFO_CREATE TAOS_DEF_ERROR_CODE(0, 0x3152) -#define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153) +// #define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153) #define TSDB_CODE_RSMA_REMOVE_EXISTS TAOS_DEF_ERROR_CODE(0, 0x3154) #define TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP TAOS_DEF_ERROR_CODE(0, 0x3155) #define TSDB_CODE_RSMA_EMPTY_INFO TAOS_DEF_ERROR_CODE(0, 0x3156) diff --git a/include/util/tcoding.h b/include/util/tcoding.h index 38eb0d8fc6..b1bd09e123 100644 --- a/include/util/tcoding.h +++ b/include/util/tcoding.h @@ -17,6 +17,7 @@ #define _TD_UTIL_CODING_H_ #include "os.h" +#include "tlog.h" #ifdef __cplusplus extern "C" { diff --git a/include/util/tdef.h b/include/util/tdef.h index 6ce7b737a8..e0089014aa 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -280,7 +280,7 @@ typedef enum ELogicConditionType { #define TSDB_DNODE_ROLE_MGMT 1 #define TSDB_DNODE_ROLE_VNODE 2 -#define TSDB_MAX_REPLICA 5 +#define TSDB_MAX_REPLICA 5 #define TSDB_SYNC_LOG_BUFFER_SIZE 4096 #define TSDB_TBNAME_COLUMN_INDEX (-1) @@ -307,8 +307,9 @@ typedef enum ELogicConditionType { #define TSDB_MIN_DURATION_PER_FILE 60 // unit minute #define TSDB_MAX_DURATION_PER_FILE (3650 * 1440) #define TSDB_DEFAULT_DURATION_PER_FILE (10 * 1440) -#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute -#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved. +#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute +#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved. +#define TSDB_MAX_KEEP_NS (365 * 292 * 1440) // data in db to be reserved. #define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years #define TSDB_MIN_MINROWS_FBLOCK 10 #define TSDB_MAX_MINROWS_FBLOCK 1000 @@ -381,13 +382,16 @@ typedef enum ELogicConditionType { #define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 #define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 -#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond -#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) -#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond -#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) -#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 -#define TSDB_MIN_TABLE_TTL 0 -#define TSDB_DEFAULT_TABLE_TTL 0 +#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond +#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) +#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) +#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 +#define TSDB_MIN_ROLLUP_DELETE_MARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_DELETE_MARK INT64_MAX +#define TSDB_DEFAULT_ROLLUP_DELETE_MARK 900000 // 900s +#define TSDB_MIN_TABLE_TTL 0 +#define TSDB_DEFAULT_TABLE_TTL 0 #define TSDB_MIN_EXPLAIN_RATIO 0 #define TSDB_MAX_EXPLAIN_RATIO 1 diff --git a/include/util/tlog.h b/include/util/tlog.h index 68b004cda7..e6ef7f388f 100644 --- a/include/util/tlog.h +++ b/include/util/tlog.h @@ -38,6 +38,7 @@ typedef void (*LogFp)(int64_t ts, ELogLevel level, const char *content); extern bool tsLogEmbedded; extern bool tsAsyncLog; +extern bool tsAssert; extern int32_t tsNumOfLogLines; extern int32_t tsLogKeepDays; extern LogFp tsLogFp; @@ -82,6 +83,10 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons #endif ; +bool taosAssert(bool condition, const char *file, int32_t line, const char *format, ...); +#define ASSERTS(condition, ...) taosAssert(condition, __FILE__, __LINE__, __VA_ARGS__) +#define ASSERT(condition) ASSERTS(condition, "assert info not provided") + // clang-format off #define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }} #define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }} diff --git a/include/util/tqueue.h b/include/util/tqueue.h index 8b46bbd064..1f6b205cdf 100644 --- a/include/util/tqueue.h +++ b/include/util/tqueue.h @@ -65,6 +65,7 @@ typedef struct STaosQnode { STaosQnode *next; STaosQueue *queue; int64_t timestamp; + int64_t dataSize; int32_t size; int8_t itype; int8_t reserved[3]; @@ -103,7 +104,7 @@ typedef struct STaosQall { STaosQueue *taosOpenQueue(); void taosCloseQueue(STaosQueue *queue); void taosSetQueueFp(STaosQueue *queue, FItem itemFp, FItems itemsFp); -void *taosAllocateQitem(int32_t size, EQItype itype); +void *taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize); void taosFreeQitem(void *pItem); void taosWriteQitem(STaosQueue *queue, void *pItem); int32_t taosReadQitem(STaosQueue *queue, void **ppItem); diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index 4e32e9ad8f..edec338c55 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -187,7 +187,7 @@ if [[ $productName == "TDengine" ]]; then git clone --depth 1 https://github.com/taosdata/taos-connector-dotnet ${install_dir}/connector/dotnet rm -rf ${install_dir}/connector/dotnet/.git ||: # cp -r ${connector_dir}/nodejs ${install_dir}/connector - git clone --depth 1 https://github.com/taosdata/libtaos-rs ${install_dir}/connector/rust + git clone --depth 1 https://github.com/taosdata/taos-connector-rust ${install_dir}/connector/rust rm -rf ${install_dir}/connector/rust/.git ||: fi fi diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 2776683a24..4169bed3eb 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -318,7 +318,7 @@ if [ "$verMode" == "cluster" ] || [ "$verMode" == "cloud" ]; then git clone --depth 1 https://github.com/taosdata/taos-connector-dotnet ${install_dir}/connector/dotnet rm -rf ${install_dir}/connector/dotnet/.git ||: - git clone --depth 1 https://github.com/taosdata/libtaos-rs ${install_dir}/connector/rust + git clone --depth 1 https://github.com/taosdata/taos-connector-rust ${install_dir}/connector/rust rm -rf ${install_dir}/connector/rust/.git ||: # cp -r ${connector_dir}/python ${install_dir}/connector @@ -379,4 +379,4 @@ if [ -n "${taostools_bin_files}" ]; then fi fi -cd ${curr_dir} \ No newline at end of file +cd ${curr_dir} diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index f4b18a373b..c694a6c1a0 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -231,10 +231,9 @@ void destroyTscObj(void *pObj) { tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj, pTscObj->pAppInfo->numOfConns); - int64_t connNum = atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); - if (0 == connNum) { - destroyAppInst(pTscObj->pAppInfo); - } + // In any cases, we should not free app inst here. Or an race condition rises. + /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj); @@ -397,8 +396,8 @@ void taos_init_imp(void) { deltaToUtcInitOnce(); if (taosCreateLog("taoslog", 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) { - tscInitRes = -1; - return; + // ignore create log failed, only print + printf(" WARING: Create taoslog failed. configDir=%s\n", configDir); } if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) { @@ -408,7 +407,9 @@ void taos_init_imp(void) { initQueryModuleMsgHandle(); - taosConvInit(); + if (taosConvInit() != 0) { + ASSERTS(0, "failed to init conv"); + } rpcInit(); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index e6584f4a00..e26512d065 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -190,8 +190,9 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->body.param = param; STscObj* pTscObj = (*pRequest)->pTscObj; - if (taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, - sizeof((*pRequest)->self))) { + int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, + sizeof((*pRequest)->self)); + if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 9f3c78aba2..87f5e5fa40 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -21,12 +21,12 @@ #include "os.h" #include "query.h" #include "scheduler.h" +#include "tdatablock.h" #include "tglobal.h" #include "tmsg.h" #include "tref.h" #include "trpc.h" #include "version.h" -#include "tdatablock.h" #define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_RELEASED 0 @@ -178,16 +178,18 @@ void taos_free_result(TAOS_RES *res) { return; } + tscDebug("taos free res %p", res); + if (TD_RES_QUERY(res)) { SRequestObj *pRequest = (SRequestObj *)res; tscDebug("0x%" PRIx64 " taos_free_result start to free query", pRequest->requestId); destroyRequest(pRequest); } else if (TD_RES_TMQ_METADATA(res)) { SMqTaosxRspObj *pRsp = (SMqTaosxRspObj *)res; - if (pRsp->rsp.blockData) taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); - if (pRsp->rsp.blockDataLen) taosArrayDestroy(pRsp->rsp.blockDataLen); - if (pRsp->rsp.withTbName) taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); - if (pRsp->rsp.withSchema) taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->rsp.blockDataLen); + taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); // taosx taosArrayDestroy(pRsp->rsp.createTableLen); taosArrayDestroyP(pRsp->rsp.createTableReq, taosMemoryFree); @@ -197,10 +199,10 @@ void taos_free_result(TAOS_RES *res) { taosMemoryFree(pRsp); } else if (TD_RES_TMQ(res)) { SMqRspObj *pRsp = (SMqRspObj *)res; - if (pRsp->rsp.blockData) taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); - if (pRsp->rsp.blockDataLen) taosArrayDestroy(pRsp->rsp.blockDataLen); - if (pRsp->rsp.withTbName) taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); - if (pRsp->rsp.withSchema) taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->rsp.blockDataLen); + taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); pRsp->resInfo.pRspMsg = NULL; doFreeReqResultInfo(&pRsp->resInfo); taosMemoryFree(pRsp); @@ -796,9 +798,11 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c SQuery *pQuery = pRequest->pQuery; pRequest->metric.ctgEnd = taosGetTimestampUs(); - qDebug("0x%" PRIx64 " start to continue parse, reqId:0x%" PRIx64, pRequest->self, pRequest->requestId); + qDebug("0x%" PRIx64 " start to continue parse, reqId:0x%" PRIx64 ", code:%s", pRequest->self, pRequest->requestId, + tstrerror(code)); if (code == TSDB_CODE_SUCCESS) { + //pWrapper->pCatalogReq->forceUpdate = false; code = qContinueParseSql(pWrapper->pParseCtx, pWrapper->pCatalogReq, pResultMeta, pQuery); } @@ -879,6 +883,11 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { if (pRequest->retry++ > REQUEST_TOTAL_EXEC_TIMES) { code = pRequest->prevCode; + terrno = code; + pRequest->code = code; + tscDebug("call sync query cb with code: %s", tstrerror(code)); + pRequest->body.queryFp(pRequest->body.param, pRequest, code); + return; } if (TSDB_CODE_SUCCESS == code) { @@ -929,6 +938,17 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { tscError("0x%" PRIx64 " error happens, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code, tstrerror(code), pRequest->requestId); destorySqlCallbackWrapper(pWrapper); + qDestroyQuery(pRequest->pQuery); + pRequest->pQuery = NULL; + + if (NEED_CLIENT_HANDLE_ERROR(code)) { + tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, + pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); + pRequest->prevCode = code; + doAsyncQuery(pRequest, true); + return; + } + terrno = code; pRequest->code = code; pRequest->body.queryFp(pRequest->body.param, pRequest, code); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index ade0c95227..939acd2b6e 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -691,7 +691,7 @@ void tmqAssignAskEpTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__ASK_EP; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -703,7 +703,7 @@ void tmqAssignDelayedCommitTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__COMMIT; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -715,7 +715,7 @@ void tmqAssignDelayedReportTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__REPORT; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -814,24 +814,55 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) { return 0; } +static void tmqFreeRspWrapper(SMqRspWrapper* rspWrapper) { + if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__END_RSP) { + // do nothing + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__EP_RSP) { + SMqAskEpRspWrapper* pEpRspWrapper = (SMqAskEpRspWrapper*)rspWrapper; + tDeleteSMqAskEpRsp(&pEpRspWrapper->msg); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosArrayDestroyP(pRsp->dataRsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->dataRsp.blockDataLen); + taosArrayDestroyP(pRsp->dataRsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->dataRsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_META_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosMemoryFree(pRsp->metaRsp.metaRsp); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__TAOSX_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosArrayDestroyP(pRsp->taosxRsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->taosxRsp.blockDataLen); + taosArrayDestroyP(pRsp->taosxRsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->taosxRsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + // taosx + taosArrayDestroy(pRsp->taosxRsp.createTableLen); + taosArrayDestroyP(pRsp->taosxRsp.createTableReq, taosMemoryFree); + } +} + void tmqClearUnhandleMsg(tmq_t* tmq) { - SMqRspWrapper* msg = NULL; + SMqRspWrapper* rspWrapper = NULL; while (1) { - taosGetQitem(tmq->qall, (void**)&msg); - if (msg) - taosFreeQitem(msg); - else + taosGetQitem(tmq->qall, (void**)&rspWrapper); + if (rspWrapper) { + tmqFreeRspWrapper(rspWrapper); + taosFreeQitem(rspWrapper); + } else { break; + } } - msg = NULL; + rspWrapper = NULL; taosReadAllQitems(tmq->mqueue, tmq->qall); while (1) { - taosGetQitem(tmq->qall, (void**)&msg); - if (msg) - taosFreeQitem(msg); - else + taosGetQitem(tmq->qall, (void**)&rspWrapper); + if (rspWrapper) { + tmqFreeRspWrapper(rspWrapper); + taosFreeQitem(rspWrapper); + } else { break; + } } } @@ -875,6 +906,7 @@ void tmqFreeImpl(void* handle) { tmq_t* tmq = (tmq_t*)handle; // TODO stop timer + tmqClearUnhandleMsg(tmq); if (tmq->mqueue) taosCloseQueue(tmq->mqueue); if (tmq->delayedTask) taosCloseQueue(tmq->delayedTask); if (tmq->qall) taosFreeQall(tmq->qall); @@ -884,8 +916,7 @@ void tmqFreeImpl(void* handle) { int32_t sz = taosArrayGetSize(tmq->clientTopics); for (int32_t i = 0; i < sz; i++) { SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i); - if (pTopic->schema.nCols) taosMemoryFreeClear(pTopic->schema.pSchema); - int32_t vgSz = taosArrayGetSize(pTopic->vgs); + taosMemoryFreeClear(pTopic->schema.pSchema); taosArrayDestroy(pTopic->vgs); } taosArrayDestroy(tmq->clientTopics); @@ -1140,7 +1171,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { goto CREATE_MSG_FAIL; } if (code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) { - SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM); + SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0); if (pRspWrapper == NULL) { tscWarn("msg discard from vgId:%d, epoch %d since out of memory", vgId, epoch); goto CREATE_MSG_FAIL; @@ -1173,7 +1204,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { // handle meta rsp int8_t rspType = ((SMqRspHead*)pMsg->pData)->mqMsgType; - SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM); + SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0); if (pRspWrapper == NULL) { taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pEpSet); @@ -1215,6 +1246,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pEpSet); + tscDebug("consumer:%" PRId64 ", put poll res into mqueue %p", tmq->consumerId, pRspWrapper); + taosWriteQitem(tmq->mqueue, pRspWrapper); tsem_post(&tmq->rspSem); @@ -1304,7 +1337,6 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) { for (int32_t i = 0; i < sz; i++) { SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i); if (pTopic->schema.nCols) taosMemoryFreeClear(pTopic->schema.pSchema); - int32_t vgSz = taosArrayGetSize(pTopic->vgs); taosArrayDestroy(pTopic->vgs); } taosArrayDestroy(tmq->clientTopics); @@ -1362,7 +1394,7 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) { tmqUpdateEp(tmq, head->epoch, &rsp); tDeleteSMqAskEpRsp(&rsp); } else { - SMqAskEpRspWrapper* pWrapper = taosAllocateQitem(sizeof(SMqAskEpRspWrapper), DEF_QITEM); + SMqAskEpRspWrapper* pWrapper = taosAllocateQitem(sizeof(SMqAskEpRspWrapper), DEF_QITEM, 0); if (pWrapper == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; code = -1; @@ -1410,7 +1442,7 @@ int32_t tmqAskEp(tmq_t* tmq, bool async) { return -1; } void* pReq = taosMemoryCalloc(1, tlen); - if (tlen < 0) { + if (pReq == NULL) { tscError("failed to malloc askEpReq msg, size:%d", tlen); return -1; } @@ -1643,6 +1675,7 @@ int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper, bool* pReset) tDeleteSMqAskEpRsp(rspMsg); *pReset = true; } else { + tmqFreeRspWrapper(rspWrapper); *pReset = false; } } else { @@ -1665,6 +1698,8 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } } + tscDebug("consumer:%" PRId64 " handle rsp %p", tmq->consumerId, rspWrapper); + if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__END_RSP) { taosFreeQitem(rspWrapper); terrno = TSDB_CODE_TQ_NO_COMMITTED_OFFSET; @@ -1692,6 +1727,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } else { tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->dataRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_META_RSP) { @@ -1710,6 +1746,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } else { tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->metaRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__TAOSX_RSP) { @@ -1738,8 +1775,9 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { taosFreeQitem(pollRspWrapper); return pRsp; } else { - tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d\n", + tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->taosxRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else { @@ -1791,7 +1829,7 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) { while (1) { tmqHandleAllDelayedTask(tmq); if (tmqPollImpl(tmq, timeout) < 0) { - tscDebug("return since poll err"); + tscDebug("consumer:%" PRId64 " return since poll err", tmq->consumerId); /*return NULL;*/ } diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index dfd0b68039..4f726ab194 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1946,9 +1946,9 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf) int32_t len = 0; len += snprintf(dumpBuf + len, size - len, "===stream===%s|block type %d|child id %d|group id:%" PRIu64 "|uid:%" PRId64 - "|rows:%d|version:%" PRIu64 "\n", + "|rows:%d|version:%" PRIu64 "|cal start:%" PRIu64 "|cal end:%" PRIu64 "\n", flag, (int32_t)pDataBlock->info.type, pDataBlock->info.childId, pDataBlock->info.id.groupId, - pDataBlock->info.id.uid, pDataBlock->info.rows, pDataBlock->info.version); + pDataBlock->info.id.uid, pDataBlock->info.rows, pDataBlock->info.version, pDataBlock->info.calWin.skey, pDataBlock->info.calWin.ekey); if (len >= size - 1) return dumpBuf; for (int32_t j = 0; j < rows; j++) { diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3bcfddb8b2..7e9b28939b 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -333,6 +333,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { if (cfgAddTimezone(pCfg, "timezone", tsTimezoneStr) != 0) return -1; if (cfgAddLocale(pCfg, "locale", tsLocale) != 0) return -1; if (cfgAddCharset(pCfg, "charset", tsCharset) != 0) return -1; + if (cfgAddBool(pCfg, "assert", 1, 1) != 0) return -1; if (cfgAddBool(pCfg, "enableCoreFile", 1, 1) != 0) return -1; if (cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, 1) != 0) return -1; @@ -407,7 +408,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { tsNumOfQnodeQueryThreads = tsNumOfCores * 2; tsNumOfQnodeQueryThreads = TMAX(tsNumOfQnodeQueryThreads, 4); - if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 1, 1024, 0) != 0) return -1; + if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 4, 1024, 0) != 0) return -1; // tsNumOfQnodeFetchThreads = tsNumOfCores / 2; // tsNumOfQnodeFetchThreads = TMAX(tsNumOfQnodeFetchThreads, 4); @@ -693,6 +694,8 @@ static void taosSetSystemCfg(SConfig *pCfg) { bool enableCore = cfgGetItem(pCfg, "enableCoreFile")->bval; taosSetCoreDump(enableCore); + tsAssert = cfgGetItem(pCfg, "assert")->bval; + // todo tsVersion = 30000000; } @@ -788,6 +791,8 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { case 'a': { if (strcasecmp("asyncLog", name) == 0) { tsAsyncLog = cfgGetItem(pCfg, "asyncLog")->bval; + } else if (strcasecmp("assert", name) == 0) { + tsAssert = cfgGetItem(pCfg, "assert")->bval; } break; } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 5b16a55ae3..95625e8d93 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -28,6 +28,8 @@ #undef TD_MSG_SEG_CODE_ #include "tmsgdef.h" +#include "tlog.h" + int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) { if (pMsg == NULL) { terrno = TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP; @@ -551,6 +553,8 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (pReq->ast2Len > 0) { if (tEncodeBinary(&encoder, pReq->pAst2, pReq->ast2Len) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark1) < 0) return -1; + if (tEncodeI64(&encoder, pReq->deleteMark2) < 0) return -1; tEndEncode(&encoder); @@ -644,6 +648,9 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tDecodeCStrTo(&decoder, pReq->pAst2) < 0) return -1; } + if (tDecodeI64(&decoder, &pReq->deleteMark1) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->deleteMark2) < 0) return -1; + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -822,6 +829,7 @@ int32_t tSerializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pReq if (pReq->astLen > 0) { if (tEncodeBinary(&encoder, pReq->ast, pReq->astLen) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -870,7 +878,7 @@ int32_t tDeserializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pR if (pReq->ast == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1; } - + if (tDecodeI64(&decoder, &pReq->deleteMark) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -992,7 +1000,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { if (tEncodeI32(&encoder, vlen) < 0) return -1; for (int32_t i = 0; i < vlen; ++i) { SVnodeLoad *pload = taosArrayGet(pReq->pVloads, i); - int64_t reserved = 0; + int64_t reserved = 0; if (tEncodeI32(&encoder, pload->vgId) < 0) return -1; if (tEncodeI8(&encoder, pload->syncState) < 0) return -1; if (tEncodeI8(&encoder, pload->syncRestore) < 0) return -1; diff --git a/source/common/src/trow.c b/source/common/src/trow.c index 52ebd7f879..ca2c056743 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "trow.h" +#include "tlog.h" const uint8_t tdVTypeByte[2][3] = {{ // 2 bits diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c index a106a09a69..ec05ef4c44 100644 --- a/source/common/src/ttime.c +++ b/source/common/src/ttime.c @@ -23,6 +23,8 @@ #define _DEFAULT_SOURCE #include "ttime.h" +#include "tlog.h" + /* * mktime64 - Converts date to seconds. * Converts Gregorian date to seconds since 1970-01-01 00:00:00. diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 188677656a..a8103351b4 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -17,6 +17,7 @@ #include "dmMgmt.h" #include "mnode.h" #include "tconfig.h" +#include "tglobal.h" // clang-format off #define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'." @@ -45,9 +46,30 @@ static struct { SArray *pArgs; // SConfigPair } global = {0}; -static void dmStopDnode(int signum, void *info, void *ctx) { dmStop(); } +static void dmSetDebugFlag(int32_t signum, void *sigInfo, void *context) { taosSetAllDebugFlag(143, true); } +static void dmSetAssert(int32_t signum, void *sigInfo, void *context) { tsAssert = 1; } + +static void dmStopDnode(int signum, void *sigInfo, void *context) { + // taosIgnSignal(SIGUSR1); + // taosIgnSignal(SIGUSR2); + taosIgnSignal(SIGTERM); + taosIgnSignal(SIGHUP); + taosIgnSignal(SIGINT); + taosIgnSignal(SIGABRT); + taosIgnSignal(SIGBREAK); + + dInfo("shut down signal is %d", signum); +#ifndef WINDOWS + dInfo("sender PID:%d cmdline:%s", ((siginfo_t *)sigInfo)->si_pid, + taosGetCmdlineByPID(((siginfo_t *)sigInfo)->si_pid)); +#endif + + dmStop(); +} static void dmSetSignalHandle() { + taosSetSignal(SIGUSR1, dmSetDebugFlag); + taosSetSignal(SIGUSR2, dmSetAssert); taosSetSignal(SIGTERM, dmStopDnode); taosSetSignal(SIGHUP, dmStopDnode); taosSetSignal(SIGINT, dmStopDnode); @@ -105,6 +127,19 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) { return 0; } +static void dmPrintArgs(int32_t argc, char const *argv[]) { + char path[1024] = {0}; + taosGetCwd(path, sizeof(path)); + + char args[1024] = {0}; + int32_t arglen = snprintf(args, sizeof(args), "%s", argv[0]); + for (int32_t i = 1; i < argc; ++i) { + arglen = arglen + snprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]); + } + + dInfo("startup path:%s args:%s", path, args); +} + static void dmGenerateGrant() { mndGenerateMachineCode(); } static void dmPrintVersion() { @@ -194,6 +229,8 @@ int mainWindows(int argc, char **argv) { return -1; } + dmPrintArgs(argc, argv); + if (taosInitCfg(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) { dError("failed to start since read config error"); taosCloseLog(); @@ -201,7 +238,12 @@ int mainWindows(int argc, char **argv) { return -1; } - taosConvInit(); + if (taosConvInit() != 0) { + dError("failed to init conv"); + taosCloseLog(); + taosCleanupArgs(); + return -1; + } if (global.dumpConfig) { dmDumpCfg(); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index a7ad983b0c..39eeeb32ea 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -103,7 +103,12 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { tSerializeSStatusReq(pHead, contLen, &req); tFreeSStatusReq(&req); - SRpcMsg rpcMsg = {.pCont = pHead, .contLen = contLen, .msgType = TDMT_MND_STATUS, .info.ahandle = (void *)0x9527}; + SRpcMsg rpcMsg = {.pCont = pHead, + .contLen = contLen, + .msgType = TDMT_MND_STATUS, + .info.ahandle = (void *)0x9527, + .info.refId = 0, + .info.noResp = 0}; SRpcMsg rpcRsp = {0}; dTrace("send status req to mnode, dnodeVer:%" PRId64 " statusSeq:%d", req.dnodeVer, req.statusSeq); @@ -150,7 +155,8 @@ static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) { SServerStatusRsp statusRsp = {0}; SMonMloadInfo minfo = {0}; (*pMgmt->getMnodeLoadsFp)(&minfo); - if (minfo.isMnode && (minfo.load.syncState == TAOS_SYNC_STATE_ERROR || minfo.load.syncState == TAOS_SYNC_STATE_OFFLINE)) { + if (minfo.isMnode && + (minfo.load.syncState == TAOS_SYNC_STATE_ERROR || minfo.load.syncState == TAOS_SYNC_STATE_OFFLINE)) { pStatus->statusCode = TSDB_SRV_STATUS_SERVICE_DEGRADED; snprintf(pStatus->details, sizeof(pStatus->details), "mnode sync state is %s", syncStr(minfo.load.syncState)); return; diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index 30ef7b9542..80c040a5e8 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -20,7 +20,9 @@ static void *dmStatusThreadFp(void *param) { SDnodeMgmt *pMgmt = param; int64_t lastTime = taosGetTimestampMs(); setThreadName("dnode-status"); - + + const static int16_t TRIM_FREQ = 30; + int32_t trimCount = 0; while (1) { taosMsleep(200); if (pMgmt->pData->dropped || pMgmt->pData->stopped) break; @@ -28,9 +30,13 @@ static void *dmStatusThreadFp(void *param) { int64_t curTime = taosGetTimestampMs(); float interval = (curTime - lastTime) / 1000.0f; if (interval >= tsStatusInterval) { - taosMemoryTrim(0); dmSendStatusReq(pMgmt); lastTime = curTime; + + trimCount = (trimCount + 1) % TRIM_FREQ; + if (trimCount == 0) { + taosMemoryTrim(0); + } } } diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index 857fbcbce5..095857825d 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -159,12 +159,12 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { } if (pWorker == NULL) return -1; - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) return -1; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); pRpc->pCont = NULL; - dTrace("msg:%p, is created and will put into %s queue, type:%s", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType)); + dTrace("msg:%p, is created and will put into %s queue, type:%s len:%d", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType), pRpc->contLen); int32_t code = mmPutMsgToWorker(pMgmt, pWorker, pMsg); if (code != 0) { dTrace("msg:%p, is freed", pMsg); diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c index 3e5ad65db7..28da0f9c5f 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c @@ -58,19 +58,19 @@ int32_t qmPutNodeMsgToFetchQueue(SQnodeMgmt *pMgmt, SRpcMsg *pMsg) { } int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) return -1; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); pRpc->pCont = NULL; switch (qtype) { case QUERY_QUEUE: - dTrace("msg:%p, is created and will put into qnode-query queue", pMsg); + dTrace("msg:%p, is created and will put into qnode-query queue, len:%d", pMsg, pRpc->contLen); taosWriteQitem(pMgmt->queryWorker.queue, pMsg); return 0; case READ_QUEUE: case FETCH_QUEUE: - dTrace("msg:%p, is created and will put into qnode-fetch queue", pMsg); + dTrace("msg:%p, is created and will put into qnode-fetch queue, len:%d", pMsg, pRpc->contLen); taosWriteQitem(pMgmt->fetchWorker.queue, pMsg); return 0; default: diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index 2d2a121795..9bd5be5201 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -130,7 +130,7 @@ void smStopWorker(SSnodeMgmt *pMgmt) { } int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) { rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; @@ -139,8 +139,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { SSnode *pSnode = pMgmt->pSnode; if (pSnode == NULL) { - dError("snode: msg:%p failed to put into vnode queue since %s, type:%s qtype:%d", pMsg, terrstr(), - TMSG_INFO(pMsg->msgType), qtype); + dError("msg:%p failed to put into snode queue since %s, type:%s qtype:%d len:%d", pMsg, terrstr(), + TMSG_INFO(pMsg->msgType), qtype, pRpc->contLen); taosFreeQitem(pMsg); rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; @@ -161,7 +161,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { smPutNodeMsgToWriteQueue(pMgmt, pMsg); break; default: - ASSERT(0); + ASSERTS(0, "msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(), + TMSG_INFO(pMsg->msgType), qtype); } return 0; } diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index 08ea880b97..7e3915f3d1 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -233,7 +233,7 @@ int32_t vmPutMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) { rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; @@ -241,7 +241,7 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { } SMsgHead *pHead = pRpc->pCont; - dTrace("vgId:%d, msg:%p is created, type:%s", pHead->vgId, pMsg, TMSG_INFO(pRpc->msgType)); + dTrace("vgId:%d, msg:%p is created, type:%s len:%d", pHead->vgId, pMsg, TMSG_INFO(pRpc->msgType), pRpc->contLen); pHead->contLen = htonl(pHead->contLen); pHead->vgId = htonl(pHead->vgId); diff --git a/source/dnode/mgmt/node_mgmt/src/dmNodes.c b/source/dnode/mgmt/node_mgmt/src/dmNodes.c index 6893e486bb..981797834a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmNodes.c +++ b/source/dnode/mgmt/node_mgmt/src/dmNodes.c @@ -149,10 +149,13 @@ int32_t dmRunDnode(SDnode *pDnode) { return 0; } - if (count == 0) osUpdate(); - - count %= 10; - count++; + if (count == 10) { + osUpdate(); + count = 0; + } else { + count++; + } + taosMsleep(100); } } diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 12aba130d5..4fa09a46b7 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -48,6 +48,11 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) { return (*msgFp)(pWrapper->pMgmt, pMsg); } +static bool dmFailFastFp(tmsg_t msgType) { + // add more msg type later + return msgType == TDMT_SYNC_HEARTBEAT || msgType == TDMT_SYNC_APPEND_ENTRIES; +} + static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { SDnodeTrans *pTrans = &pDnode->trans; int32_t code = -1; @@ -136,11 +141,11 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { } pRpc->info.wrapper = pWrapper; - pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) goto _OVER; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); - dGTrace("msg:%p, is created, type:%s handle:%p", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle); + dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, pRpc->contLen); code = dmProcessNodeMsg(pWrapper, pMsg); @@ -260,6 +265,10 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.retryMaxInterval = tsRedirectMaxPeriod; rpcInit.retryMaxTimouet = tsMaxRetryWaitTime; + rpcInit.failFastInterval = 1000; // interval threshold(ms) + rpcInit.failFastThreshold = 3; // failed threshold + rpcInit.ffp = dmFailFastFp; + pTrans->clientRpc = rpcOpen(&rpcInit); if (pTrans->clientRpc == NULL) { dError("failed to init dnode rpc client"); @@ -292,6 +301,7 @@ int32_t dmInitServer(SDnode *pDnode) { rpcInit.connType = TAOS_CONN_SERVER; rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.parent = pDnode; + rpcInit.compressSize = tsCompressMsgSize; pTrans->serverRpc = rpcOpen(&rpcInit); if (pTrans->serverRpc == NULL) { diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 9961828747..3c42f7b832 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -473,6 +473,7 @@ void* tDecodeSMqOffsetObj(void* buf, SMqOffsetObj* pOffset); typedef struct { char name[TSDB_TOPIC_FNAME_LEN]; char db[TSDB_DB_FNAME_LEN]; + char createUser[TSDB_USER_LEN]; int64_t createTime; int64_t updateTime; int64_t uid; @@ -644,6 +645,7 @@ typedef struct { // 3.0.20 int64_t checkpointFreq; // ms int64_t currentTick; // do not serialize + int64_t deleteMark; } SStreamObj; int32_t tEncodeSStreamObj(SEncoder* pEncoder, const SStreamObj* pObj); diff --git a/source/dnode/mnode/impl/inc/mndScheduler.h b/source/dnode/mnode/impl/inc/mndScheduler.h index db81d8843e..23085c53ee 100644 --- a/source/dnode/mnode/impl/inc/mndScheduler.h +++ b/source/dnode/mnode/impl/inc/mndScheduler.h @@ -28,7 +28,7 @@ void mndCleanupScheduler(SMnode* pMnode); int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscribeObj* pSub); int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark); + int64_t watermark, int64_t deleteMark); int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 76bff9a70f..37e2c35225 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -554,7 +554,8 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { goto SUBSCRIBE_OVER; } - if (mndCheckDbPrivilegeByName(pMnode, pMsg->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { + if (mndCheckTopicPrivilege(pMnode, pMsg->info.conn.user, MND_OPER_SUBSCRIBE, pTopic) != 0) { + mndReleaseTopic(pMnode, pTopic); goto SUBSCRIBE_OVER; } diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 5fa86dffe2..43155124c1 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -825,7 +825,13 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { dbObj.cfgVersion++; dbObj.updateTime = taosGetTimestampMs(); code = mndAlterDb(pMnode, pReq, pDb, &dbObj); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; + + if (dbObj.cfg.replications != pDb->cfg.replications) { + // return quickly, operation executed asynchronously + mInfo("db:%s, alter db replica from %d to %d", pDb->name, pDb->cfg.replications, dbObj.cfg.replications); + } else { + if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; + } _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index df25e44bee..0538d70101 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -383,9 +383,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pGid->syncCanRead != pVload->syncCanRead) { mInfo( "vgId:%d, state changed by status msg, old state:%s restored:%d canRead:%d new state:%s restored:%d " - "canRead:%d", + "canRead:%d, dnode:%d", pVgroup->vgId, syncStr(pGid->syncState), pGid->syncRestore, pGid->syncCanRead, - syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead); + syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead, pDnode->id); pGid->syncState = pVload->syncState; pGid->syncRestore = pVload->syncRestore; pGid->syncCanRead = pVload->syncCanRead; diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index fe76ba31d7..ffc357b2e8 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -769,7 +769,7 @@ static int32_t mndRetrieveQueries(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p } int32_t numOfQueries = taosArrayGetSize(pConn->pQueries); - for (int32_t i = 0; i < numOfQueries; ++i) { + for (int32_t i = 0; i < numOfQueries && numOfRows < rows; ++i) { SQueryDesc *pQuery = taosArrayGet(pConn->pQueries, i); cols = 0; diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index f71bd1c626..af1a29def0 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -42,7 +42,7 @@ static int32_t mndAddTaskToTaskSet(SArray* pArray, SStreamTask* pTask) { } int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark) { + int64_t watermark, int64_t deleteMark) { SNode* pAst = NULL; SQueryPlan* pPlan = NULL; terrno = TSDB_CODE_SUCCESS; @@ -64,6 +64,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 .rSmaQuery = true, .triggerType = triggerType, .watermark = watermark, + .deleteMark = deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index ec2e844ba5..6a7e2aaa51 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -198,9 +198,9 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { } if (retrieveReq.showId == 0) { - STableMetaRsp *pMeta = (STableMetaRsp *)taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); + STableMetaRsp *pMeta = taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { - pMeta = (STableMetaRsp *)taosHashGet(pMnode->perfsMeta, retrieveReq.tb, strlen(retrieveReq.tb)); + pMeta = taosHashGet(pMnode->perfsMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { terrno = TSDB_CODE_MND_INVALID_SYS_TABLENAME; mError("failed to process show-retrieve req:%p since %s", pShow, terrstr()); diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index f9d0a9b9ba..e6a6e6ae5b 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -534,6 +534,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea streamObj.sql = strdup(pCreate->sql); streamObj.smaId = smaObj.uid; streamObj.watermark = pCreate->watermark; + streamObj.deleteMark = pCreate->deleteMark; streamObj.fillHistory = STREAM_FILL_HISTORY_ON; streamObj.trigger = STREAM_TRIGGER_WINDOW_CLOSE; streamObj.triggerParam = pCreate->maxDelay; @@ -574,6 +575,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea .streamQuery = true, .triggerType = streamObj.trigger, .watermark = streamObj.watermark, + .deleteMark = streamObj.deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 2ed4fde509..c611cfb6e1 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -450,13 +450,15 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt req.rsmaParam.watermark[1] = pStb->watermark[1]; if (pStb->ast1Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[0], &req.rsmaParam.qmsgLen[0], pStb->pAst1, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0], + req.rsmaParam.deleteMark[0]) < 0) { goto _err; } } if (pStb->ast2Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[1], &req.rsmaParam.qmsgLen[1], pStb->pAst2, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1], + req.rsmaParam.deleteMark[1]) < 0) { goto _err; } } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 895d7fedc4..10b1e36496 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -119,7 +119,13 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta } int32_t mndSyncCommitMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta *pMeta) { - int32_t code = mndProcessWriteMsg(pFsm, pMsg, pMeta); + int32_t code = 0; + if (!syncUtilUserCommit(pMsg->msgType)) { + goto _out; + } + code = mndProcessWriteMsg(pFsm, pMsg, pMeta); + +_out: rpcFreeCont(pMsg->pCont); pMsg->pCont = NULL; return code; @@ -143,9 +149,13 @@ void mndRestoreFinish(const SSyncFSM *pFsm) { SMnode *pMnode = pFsm->data; if (!pMnode->deploy) { - mInfo("vgId:1, sync restore finished, and will handle outstanding transactions"); - mndTransPullup(pMnode); - mndSetRestored(pMnode, true); + if (!pMnode->restored) { + mInfo("vgId:1, sync restore finished, and will handle outstanding transactions"); + mndTransPullup(pMnode); + mndSetRestored(pMnode, true); + } else { + mInfo("vgId:1, sync restore finished, repeat call"); + } } else { mInfo("vgId:1, sync restore finished"); } diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index eea74c6dd8..e271eedd17 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -28,7 +28,7 @@ #include "parser.h" #include "tname.h" -#define MND_TOPIC_VER_NUMBER 1 +#define MND_TOPIC_VER_NUMBER 2 #define MND_TOPIC_RESERVE_SIZE 64 static int32_t mndTopicActionInsert(SSdb *pSdb, SMqTopicObj *pTopic); @@ -93,6 +93,7 @@ SSdbRaw *mndTopicActionEncode(SMqTopicObj *pTopic) { int32_t dataPos = 0; SDB_SET_BINARY(pRaw, dataPos, pTopic->name, TSDB_TOPIC_FNAME_LEN, TOPIC_ENCODE_OVER); SDB_SET_BINARY(pRaw, dataPos, pTopic->db, TSDB_DB_FNAME_LEN, TOPIC_ENCODE_OVER); + SDB_SET_BINARY(pRaw, dataPos, pTopic->createUser, TSDB_USER_LEN, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->createTime, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->updateTime, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->uid, TOPIC_ENCODE_OVER); @@ -159,7 +160,7 @@ SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) { int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto TOPIC_DECODE_OVER; - if (sver != MND_TOPIC_VER_NUMBER) { + if (sver != 1 && sver != 2) { terrno = TSDB_CODE_SDB_INVALID_DATA_VER; goto TOPIC_DECODE_OVER; } @@ -174,6 +175,9 @@ SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) { int32_t dataPos = 0; SDB_GET_BINARY(pRaw, dataPos, pTopic->name, TSDB_TOPIC_FNAME_LEN, TOPIC_DECODE_OVER); SDB_GET_BINARY(pRaw, dataPos, pTopic->db, TSDB_DB_FNAME_LEN, TOPIC_DECODE_OVER); + if (sver >= 2) { + SDB_GET_BINARY(pRaw, dataPos, pTopic->createUser, TSDB_USER_LEN, TOPIC_DECODE_OVER); + } SDB_GET_INT64(pRaw, dataPos, &pTopic->createTime, TOPIC_DECODE_OVER); SDB_GET_INT64(pRaw, dataPos, &pTopic->updateTime, TOPIC_DECODE_OVER); SDB_GET_INT64(pRaw, dataPos, &pTopic->uid, TOPIC_DECODE_OVER); @@ -358,11 +362,18 @@ static int32_t extractTopicTbInfo(SNode *pAst, SMqTopicObj *pTopic) { return 0; } -static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb) { +static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb, + const char *userName) { mInfo("topic:%s to create", pCreate->name); SMqTopicObj topicObj = {0}; tstrncpy(topicObj.name, pCreate->name, TSDB_TOPIC_FNAME_LEN); tstrncpy(topicObj.db, pDb->name, TSDB_DB_FNAME_LEN); + tstrncpy(topicObj.createUser, userName, TSDB_USER_LEN); + + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC, &topicObj) != 0) { + return -1; + } + topicObj.createTime = taosGetTimestampMs(); topicObj.updateTime = topicObj.createTime; topicObj.uid = mndGenerateUid(pCreate->name, strlen(pCreate->name)); @@ -574,11 +585,7 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) { goto _OVER; } - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC) != 0) { - goto _OVER; - } - - code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb); + code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb, pReq->info.conn.user); if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; _OVER: @@ -634,7 +641,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } } - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC) != 0) { + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC, pTopic) != 0) { mndReleaseTopic(pMnode, pTopic); return -1; } @@ -698,10 +705,6 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } #endif - if (mndCheckDbPrivilegeByName(pMnode, pReq->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { - return -1; - } - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pReq, "drop-topic"); mndTransSetDbName(pTrans, pTopic->db, NULL); if (pTrans == NULL) { diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b4ea8ee125..4a6f0d14da 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -507,7 +507,7 @@ static int32_t mndGetAvailableDnode(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup for (int32_t v = 0; v < pVgroup->replica; ++v) { SVnodeGid *pVgid = &pVgroup->vnodeGid[v]; SDnodeObj *pDnode = taosArrayGet(pArray, v); - if (pDnode == NULL || pDnode->numOfVnodes > pDnode->numOfSupportVnodes) { + if (pDnode == NULL || pDnode->numOfVnodes >= pDnode->numOfSupportVnodes) { terrno = TSDB_CODE_MND_NO_ENOUGH_DNODES; return -1; } @@ -891,7 +891,7 @@ static int32_t mndAddVnodeToVgroup(SMnode *pMnode, STrans *pTrans, SVgObj *pVgro } if (used) continue; - if (pDnode == NULL || pDnode->numOfVnodes > pDnode->numOfSupportVnodes) { + if (pDnode == NULL || pDnode->numOfVnodes >= pDnode->numOfSupportVnodes) { terrno = TSDB_CODE_MND_NO_ENOUGH_DNODES; return -1; } @@ -1126,34 +1126,61 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, } if (!force) { - mInfo("vgId:%d, will add 1 vnode", pVgroup->vgId); - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; - for (int32_t i = 0; i < newVg.replica - 1; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; - } - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - - mInfo("vgId:%d, will remove 1 vnode", pVgroup->vgId); - newVg.replica--; - SVnodeGid del = newVg.vnodeGid[vnIndex]; - newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; - memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - { - SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); - if (pRaw == NULL) return -1; - if (mndTransAppendRedolog(pTrans, pRaw) != 0) { - sdbFreeRaw(pRaw); - return -1; + if (newVg.replica == 1) { + mInfo("vgId:%d, will add 1 vnode, replca:1", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + for (int32_t i = 0; i < newVg.replica - 1; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } - (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); - } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; - for (int32_t i = 0; i < newVg.replica; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:2", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; + } else { // new replica == 3 + mInfo("vgId:%d, will add 1 vnode, replca:3", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:4", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica; ++i) { + if (i == vnIndex) continue; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } else { mInfo("vgId:%d, will add 1 vnode and force remove 1 vnode", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index c4040644b1..99260ffefd 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -174,7 +174,7 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, void *pTableL void tsdbReaderClose(STsdbReader *pReader); bool tsdbNextDataBlock(STsdbReader *pReader); void tsdbRetrieveDataBlockInfo(const STsdbReader *pReader, int32_t *rows, uint64_t *uid, STimeWindow *pWindow); -int32_t tsdbRetrieveDatablockSMA(STsdbReader *pReader, SColumnDataAgg ***pBlockSMA, bool *allHave); +int32_t tsdbRetrieveDatablockSMA(STsdbReader *pReader, SSDataBlock* pDataBlock, bool *allHave); SSDataBlock *tsdbRetrieveDataBlock(STsdbReader *pTsdbReadHandle, SArray *pColumnIdList); int32_t tsdbReaderReset(STsdbReader *pReader, SQueryTableDataCond *pCond); int32_t tsdbGetFileBlocksDistInfo(STsdbReader *pReader, STableBlockDistInfo *pTableBlockInfo); diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 6a704d0425..37dcec4f85 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -32,9 +32,9 @@ typedef struct SMetaStbStatsEntry { } SMetaStbStatsEntry; typedef struct STagFilterResEntry { - uint64_t suid; // uid for super table - SList list; // the linked list of md5 digest, extracted from the serialized tag query condition - uint32_t qTimes;// queried times for current super table + uint64_t suid; // uid for super table + SList list; // the linked list of md5 digest, extracted from the serialized tag query condition + uint32_t qTimes; // queried times for current super table } STagFilterResEntry; struct SMetaCache { @@ -126,13 +126,14 @@ int32_t metaCacheOpen(SMeta* pMeta) { goto _err2; } - pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5*1024*1024, -1, 0.5); + pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5 * 1024 * 1024, -1, 0.5); if (pCache->sTagFilterResCache.pUidResCache == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err2; } - pCache->sTagFilterResCache.pTableEntry = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); + pCache->sTagFilterResCache.pTableEntry = + taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); if (pCache->sTagFilterResCache.pTableEntry == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err2; @@ -419,7 +420,8 @@ int32_t metaStatsCacheGet(SMeta* pMeta, int64_t uid, SMetaStbStats* pInfo) { return code; } -int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray* pList1, bool* acquireRes) { +int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray* pList1, + bool* acquireRes) { uint64_t* pBuf = pMeta->pCache->sTagFilterResCache.keyBuf; // generate the composed key for LRU cache @@ -428,8 +430,8 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK pBuf[0] = suid; memcpy(&pBuf[1], pKey, keyLen); - int32_t len = keyLen + sizeof(uint64_t); - LRUHandle *pHandle = taosLRUCacheLookup(pCache, pBuf, len); + int32_t len = keyLen + sizeof(uint64_t); + LRUHandle* pHandle = taosLRUCacheLookup(pCache, pBuf, len); if (pHandle == NULL) { *acquireRes = 0; return TSDB_CODE_SUCCESS; @@ -439,7 +441,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK *acquireRes = 1; const char* p = taosLRUCacheValue(pMeta->pCache->sTagFilterResCache.pUidResCache, pHandle); - int32_t size = *(int32_t*) p; + int32_t size = *(int32_t*)p; taosArrayAddBatch(pList1, p + sizeof(int32_t), size); (*pEntry)->qTimes += 1; @@ -454,7 +456,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK SListNode* pNode = NULL; while ((pNode = tdListNext(&iter)) != NULL) { - memcpy(pBuf + sizeof(suid), pNode->data, keyLen); + memcpy(&pBuf[1], pNode->data, keyLen); // check whether it is existed in LRU cache, and remove it from linked list if not. LRUHandle* pRes = taosLRUCacheLookup(pCache, pBuf, len); @@ -467,12 +469,15 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK // remove the keys, of which query uid lists have been replaced already. size_t s = taosArrayGetSize(pList); - for(int32_t i = 0; i < s; ++i) { + for (int32_t i = 0; i < s; ++i) { SListNode** p1 = taosArrayGet(pList, i); tdListPopNode(&(*pEntry)->list, *p1); + taosMemoryFree(*p1); } - (*pEntry)->qTimes = 0; // reset the query times + (*pEntry)->qTimes = 0; // reset the query times + + taosArrayDestroy(pList); } } @@ -487,7 +492,8 @@ static void freePayload(const void* key, size_t keyLen, void* value) { } // check both the payload size and selectivity ratio -int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, int32_t payloadLen, double selectivityRatio) { +int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, + int32_t payloadLen, double selectivityRatio) { if (selectivityRatio > tsSelectivityRatio) { metaDebug("vgId:%d, suid:%" PRIu64 " failed to add to uid list cache, due to selectivity ratio %.2f less than threshold %.2f", @@ -525,9 +531,10 @@ int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int ASSERT(sizeof(uint64_t) + keyLen == 24); // add to cache. - taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, freePayload, NULL, TAOS_LRU_PRIORITY_LOW); - metaDebug("vgId:%d, suid:%"PRIu64" list cache added into cache, total:%d, tables:%d", TD_VID(pMeta->pVnode), - suid, (int32_t) taosLRUCacheGetUsage(pCache), taosHashGetSize(pTableEntry)); + taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, freePayload, NULL, + TAOS_LRU_PRIORITY_LOW); + metaDebug("vgId:%d, suid:%" PRIu64 " list cache added into cache, total:%d, tables:%d", TD_VID(pMeta->pVnode), suid, + (int32_t)taosLRUCacheGetUsage(pCache), taosHashGetSize(pTableEntry)); return TSDB_CODE_SUCCESS; } @@ -539,7 +546,7 @@ int32_t metaUidCacheClear(SMeta* pMeta, uint64_t suid) { return TSDB_CODE_SUCCESS; } - int32_t keyLen = sizeof(uint64_t) * 3; + int32_t keyLen = sizeof(uint64_t) * 3; uint64_t p[3] = {0}; p[0] = suid; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 587b0c556f..9b60583e67 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -549,8 +549,8 @@ int metaTtlDropTable(SMeta *pMeta, int64_t ttl, SArray *tbUids) { } static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME) { - int64_t ttlDays; - int64_t ctime; + int64_t ttlDays = 0; + int64_t ctime = 0; if (pME->type == TSDB_CHILD_TABLE) { ctime = pME->ctbEntry.ctime; ttlDays = pME->ctbEntry.ttlDays; @@ -1572,6 +1572,10 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) { goto end; } + if (stbEntry.stbEntry.schemaTag.pSchema == NULL) { + goto end; + } + pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[0]; STagVal tagVal = {.cid = pTagColumn->colId}; diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 6bd2ae3435..ba99e5515d 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -763,7 +763,7 @@ static int32_t tdExecuteRSmaImplAsync(SSma *pSma, const void *pMsg, int32_t inpu tb_uid_t suid) { const SSubmitReq *pReq = (const SSubmitReq *)pMsg; - void *qItem = taosAllocateQitem(pReq->header.contLen, DEF_QITEM); + void *qItem = taosAllocateQitem(pReq->header.contLen, DEF_QITEM, 0); if (!qItem) { return TSDB_CODE_FAILED; } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 191fc1b49c..09717c823e 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -725,9 +725,15 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } taosWUnLockLatch(&pTq->pushLock); - code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); - if (code != 0) { - tqError("cannot process tq delete req %s, since no such handle", pReq->subKey); + STqHandle* pHandle = taosHashGet(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); + if (pHandle) { + if (pHandle->pRef) { + walCloseRef(pTq->pVnode->pWal, pHandle->pRef->refId); + } + code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); + if (code != 0) { + tqError("cannot process tq delete req %s, since no such handle", pReq->subKey); + } } code = tqOffsetDelete(pTq->pOffsetStore, pReq->subKey); @@ -736,7 +742,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) { - ASSERT(0); + tqError("cannot process tq delete req %s, since no such offset in tdb", pReq->subKey); } return 0; } @@ -1265,7 +1271,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { qDebug("delete req enqueue stream task: %d, ver: %" PRId64, pTask->taskId, ver); if (!failed) { - SStreamRefDataBlock* pRefBlock = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM); + SStreamRefDataBlock* pRefBlock = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM, 0); pRefBlock->type = STREAM_INPUT__REF_DATA_BLOCK; pRefBlock->pBlock = pDelBlock; pRefBlock->dataRef = pRef; @@ -1297,7 +1303,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { } #if 0 - SStreamDataBlock* pStreamBlock = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pStreamBlock = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); pStreamBlock->type = STREAM_INPUT__DATA_BLOCK; pStreamBlock->blocks = taosArrayInit(0, sizeof(SSDataBlock)); SSDataBlock block = {0}; diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 7309ea3407..5b09ce5eb6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -952,12 +952,17 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs SArray *pDelIdxArray = taosArrayInit(32, sizeof(SDelIdx)); code = tsdbReadDelIdx(pDelFReader, pDelIdxArray); - if (code) goto _err; + if (code) { + taosArrayDestroy(pDelIdxArray); + tsdbDelFReaderClose(&pDelFReader); + goto _err; + } SDelIdx *delIdx = taosArraySearch(pDelIdxArray, &(SDelIdx){.suid = suid, .uid = uid}, tCmprDelIdx, TD_EQ); code = getTableDelSkyline(pMem, pIMem, pDelFReader, delIdx, pIter->pSkyline); if (code) { + taosArrayDestroy(pDelIdxArray); tsdbDelFReaderClose(&pDelFReader); goto _err; } diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index 906e3b2638..8ec59ea959 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -53,6 +53,7 @@ typedef struct { // -------------- TSKEY nextKey; // reset by each table commit int32_t commitFid; + int32_t expLevel; TSKEY minKey; TSKEY maxKey; // commit file data @@ -503,6 +504,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) { // memory pCommitter->commitFid = tsdbKeyFid(pCommitter->nextKey, pCommitter->minutes, pCommitter->precision); + pCommitter->expLevel = tsdbFidLevel(pCommitter->commitFid, &pCommitter->pTsdb->keepCfg, taosGetTimestampSec()); tsdbFidKeyRange(pCommitter->commitFid, pCommitter->minutes, pCommitter->precision, &pCommitter->minKey, &pCommitter->maxKey); #if 0 @@ -556,7 +558,10 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) { } } else { SDiskID did = {0}; - tfsAllocDisk(pTsdb->pVnode->pTfs, 0, &did); + if (tfsAllocDisk(pTsdb->pVnode->pTfs, pCommitter->expLevel, &did) < 0) { + code = terrno; + TSDB_CHECK_CODE(code, lino, _exit); + } tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, did); wSet.diskId = did; wSet.nSttF = 1; diff --git a/source/dnode/vnode/src/tsdb/tsdbFS.c b/source/dnode/vnode/src/tsdb/tsdbFS.c index 72d9c4f69e..7dc839773f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS.c @@ -962,6 +962,7 @@ int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet) { } } + pDFileSet->diskId = pSet->diskId; goto _exit; } } diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 01fbcf657f..ad264b8bb3 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -121,7 +121,7 @@ static SBlockData *loadLastBlock(SLDataIter *pIter, const char *idStr) { return &pInfo->blockData[1]; } - if (pIter->pSttBlk == NULL) { + if (pIter->pSttBlk == NULL || pInfo->pSchema == NULL) { return NULL; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 5dd9293118..139347fd69 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -214,6 +214,7 @@ static bool hasDataInLastBlock(SLastBlockReader* pLastBlockReader); static int32_t doBuildDataBlock(STsdbReader* pReader); static TSDBKEY getCurrentKeyInBuf(STableBlockScanInfo* pScanInfo, STsdbReader* pReader); static bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo); +static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter); static bool outOfTimeWindow(int64_t ts, STimeWindow* pWindow) { return (ts > pWindow->ekey) || (ts < pWindow->skey); } @@ -2477,8 +2478,39 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { SDataBlk* pBlock = getCurrentBlock(&pReader->status.blockIter); if (pDumpInfo->rowIndex >= pBlock->nRow || pDumpInfo->rowIndex < 0) { - setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); - break; + + int32_t nextIndex = -1; + SBlockIndex bIndex = {0}; + bool hasNeighbor = getNeighborBlockOfSameTable(pBlockInfo, pBlockScanInfo, &nextIndex, pReader->order, &bIndex); + if (!hasNeighbor) { // do nothing + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } + + if (overlapWithNeighborBlock(pBlock, &bIndex, pReader->order)) { // load next block + SReaderStatus* pStatus = &pReader->status; + SDataBlockIter* pBlockIter = &pStatus->blockIter; + + // 1. find the next neighbor block in the scan block list + SFileDataBlockInfo fb = {.uid = pBlockInfo->uid, .tbBlockIdx = nextIndex}; + int32_t neighborIndex = findFileBlockInfoIndex(pBlockIter, &fb); + + // 2. remove it from the scan block list + setFileBlockActiveInBlockIter(pBlockIter, neighborIndex, step); + + // 3. load the neighbor block, and set it to be the currently accessed file data block + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pBlockInfo->uid); + if (code != TSDB_CODE_SUCCESS) { + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } + + // 4. check the data values + initBlockDumpInfo(pReader, pBlockIter); + } else { + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } } } } @@ -2758,7 +2790,8 @@ static int32_t doLoadLastBlockSequentially(STsdbReader* pReader) { while (1) { // load the last data block of current table STableBlockScanInfo* pScanInfo = *(STableBlockScanInfo**)pStatus->pTableIter; - bool hasVal = initLastBlockReader(pLastBlockReader, pScanInfo, pReader); + + bool hasVal = initLastBlockReader(pLastBlockReader, pScanInfo, pReader); if (!hasVal) { bool hasNexTable = moveToNextTable(pOrderedCheckInfo, pStatus); if (!hasNexTable) { @@ -2888,7 +2921,7 @@ static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) { } // set the correct start position in case of the first/last file block, according to the query time window -static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { +void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { SDataBlk* pBlock = getCurrentBlock(pBlockIter); SReaderStatus* pStatus = &pReader->status; @@ -3097,7 +3130,7 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32 return false; } else if (pKey->ts == last->ts) { TSDBKEY* prev = taosArrayGet(pDelList, num - 2); - return (prev->version >= pKey->version); + return (prev->version >= pKey->version && prev->version <= pVerRange->maxVer && prev->version >= pVerRange->minVer); } } else { TSDBKEY* pCurrent = taosArrayGet(pDelList, *index); @@ -3791,6 +3824,8 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL } // NOTE: the endVersion in pCond is the data version not schema version, so pCond->endVersion is not correct here. + // no valid error code set in metaGetTbTSchema, so let's set the error code here. + // we should proceed in case of tmq processing. if (pCond->suid != 0) { pReader->pSchema = metaGetTbTSchema(pReader->pTsdb->pVnode->pMeta, pReader->suid, -1, 1); if (pReader->pSchema == NULL) { @@ -3808,7 +3843,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL updateBlockSMAInfo(pReader->pSchema, &pReader->suppInfo); } - STsdbReader* p = (pReader->innerReader[0] != NULL)? pReader->innerReader[0]:pReader; + STsdbReader* p = (pReader->innerReader[0] != NULL) ? pReader->innerReader[0] : pReader; pReader->status.pTableMap = createDataBlockScanInfo(p, &pReader->blockInfoBuf, pTableList, numOfTables); if (pReader->status.pTableMap == NULL) { tsdbReaderClose(p); @@ -3856,10 +3891,11 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL tsdbDebug("%p total numOfTable:%d in this query %s", pReader, numOfTables, pReader->idStr); return code; - _err: +_err: tsdbError("failed to create data reader, code:%s %s", tstrerror(code), idstr); + tsdbReaderClose(pReader); return code; - } +} void tsdbReaderClose(STsdbReader* pReader) { if (pReader == NULL) { @@ -4055,8 +4091,34 @@ void tsdbRetrieveDataBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64 } } -int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockSMA, bool* allHave) { + +static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_t numOfCols, + SColumnDataAgg* pTsAgg) { + // do fill all null column value SMA info + int32_t i = 0, j = 0; + int32_t size = (int32_t) taosArrayGetSize(pSup->pColAgg); + taosArrayInsert(pSup->pColAgg, 0, pTsAgg); + + while (j < numOfCols && i < size) { + SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); + if (pAgg->colId == pSup->colId[j]) { + i += 1; + j += 1; + } else if (pAgg->colId < pSup->colId[j]) { + i += 1; + } else if (pSup->colId[j] < pAgg->colId) { + if (pSup->colId[j] != PRIMARYKEY_TIMESTAMP_COL_ID) { + SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = numOfRows}; + taosArrayInsert(pSup->pColAgg, i ,&nullColAgg); + } + j += 1; + } + } +} + +int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SSDataBlock* pDataBlock, bool* allHave) { int32_t code = 0; + SColumnDataAgg ***pBlockSMA = &pDataBlock->pBlockAgg; *allHave = false; if (pReader->type == TIMEWINDOW_RANGE_EXTERNAL) { @@ -4104,12 +4166,22 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS int32_t i = 0, j = 0; size_t size = taosArrayGetSize(pSup->pColAgg); + // ensure capacity + if(pDataBlock->pDataBlock) { + size_t colsNum = taosArrayGetSize(pDataBlock->pDataBlock); + taosArrayEnsureCap(pSup->pColAgg, colsNum); + } + SSDataBlock* pResBlock = pReader->pResBlock; if (pResBlock->pBlockAgg == NULL) { size_t num = taosArrayGetSize(pResBlock->pDataBlock); pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg)); } + // do fill all null column value SMA info + doFillNullColSMA(pSup, pBlock->nRow, numOfCols, pTsAgg); + + i = 0, j = 0; while (j < numOfCols && i < size) { SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); if (pAgg->colId == pSup->colId[j]) { @@ -4119,15 +4191,8 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS } else if (pAgg->colId < pSup->colId[j]) { i += 1; } else if (pSup->colId[j] < pAgg->colId) { - if (pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID) { - pResBlock->pBlockAgg[pSup->slotId[j]] = &pSup->tsColAgg; - } else { - // all date in this block are null - SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = pBlock->nRow}; - taosArrayPush(pSup->pColAgg, &nullColAgg); - - pResBlock->pBlockAgg[pSup->slotId[j]] = taosArrayGetLast(pSup->pColAgg); - } + ASSERT(pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID); + pResBlock->pBlockAgg[pSup->slotId[j]] = &pSup->tsColAgg; j += 1; } } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index f4bdeeb387..8be4904349 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -155,7 +155,7 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) { if (rowVer >= pReader->sver && rowVer <= pReader->ever) { pIter->rInfo.suid = pIter->bData.suid; - pIter->rInfo.uid = pIter->bData.uid; + pIter->rInfo.uid = pIter->bData.uid ? pIter->bData.uid : pIter->bData.aUid[pIter->iRow]; pIter->rInfo.row = tsdbRowFromBlockData(&pIter->bData, pIter->iRow); goto _add_iter; } @@ -179,16 +179,14 @@ _err: return code; } -static SRowInfo* tsdbSnapGetRow(STsdbSnapReader* pReader) { return pReader->pIter ? &pReader->pIter->rInfo : NULL; } - static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { int32_t code = 0; if (pReader->pIter) { - SFDataIter* pIter = pReader->pIter; - + SFDataIter* pIter = NULL; while (true) { _find_row: + pIter = pReader->pIter; for (pIter->iRow++; pIter->iRow < pIter->bData.nRow; pIter->iRow++) { int64_t rowVer = pIter->bData.aVersion[pIter->iRow]; @@ -224,6 +222,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { } pReader->pIter = NULL; + break; } else if (pIter->type == SNAP_STT_FILE_ITER) { for (pIter->iSttBlk++; pIter->iSttBlk < taosArrayGetSize(pIter->aSttBlk); pIter->iSttBlk++) { SSttBlk* pSttBlk = (SSttBlk*)taosArrayGet(pIter->aSttBlk, pIter->iSttBlk); @@ -238,6 +237,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { } pReader->pIter = NULL; + break; } else { ASSERT(0); } @@ -269,6 +269,20 @@ _err: return code; } +static SRowInfo* tsdbSnapGetRow(STsdbSnapReader* pReader) { + if (pReader->pIter) { + return &pReader->pIter->rInfo; + } else { + tsdbSnapNextRow(pReader); + + if (pReader->pIter) { + return &pReader->pIter->rInfo; + } else { + return NULL; + } + } +} + static int32_t tsdbSnapCmprData(STsdbSnapReader* pReader, uint8_t** ppData) { int32_t code = 0; @@ -1356,7 +1370,7 @@ _exit: taosMemoryFree(pWriter); } } else { - tsdbDebug("vgId:%d, tsdb snapshot writer open for %s succeed", TD_VID(pTsdb->pVnode), pTsdb->path); + tsdbInfo("vgId:%d %s done", TD_VID(pTsdb->pVnode), __func__); *ppWriter = pWriter; } return code; @@ -1421,7 +1435,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) { for (int32_t iBuf = 0; iBuf < sizeof(pWriter->aBuf) / sizeof(uint8_t*); iBuf++) { tFree(pWriter->aBuf[iBuf]); } - tsdbInfo("vgId:%d, vnode snapshot tsdb writer close for %s", TD_VID(pWriter->pTsdb->pVnode), pWriter->pTsdb->path); + tsdbInfo("vgId:%d %s done", TD_VID(pWriter->pTsdb->pVnode), __func__); taosMemoryFree(pWriter); *ppWriter = NULL; return code; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index d8c8a3e1b2..0fc42f3744 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -190,9 +190,13 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp version); ASSERT(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm); + ASSERT(pVnode->state.applied + 1 == version); + pVnode->state.applied = version; pVnode->state.applyTerm = pMsg->info.conn.applyTerm; + if (!syncUtilUserCommit(pMsg->msgType)) goto _exit; + // skip header pReq = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)); len = pMsg->contLen - sizeof(SMsgHead); diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 1c2139c95d..aa215a852f 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -606,16 +606,7 @@ void vnodeSyncPreClose(SVnode *pVnode) { vInfo("vgId:%d, pre close sync", pVnode->config.vgId); syncLeaderTransfer(pVnode->sync); syncPreStop(pVnode->sync); -#if 0 - while (syncSnapshotRecving(pVnode->sync)) { - vInfo("vgId:%d, snapshot is recving", pVnode->config.vgId); - taosMsleep(300); - } - while (syncSnapshotSending(pVnode->sync)) { - vInfo("vgId:%d, snapshot is sending", pVnode->config.vgId); - taosMsleep(300); - } -#endif + taosThreadMutexLock(&pVnode->lock); if (pVnode->blocked) { vInfo("vgId:%d, post block after close sync", pVnode->config.vgId); diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h index ba99906589..6e072a9630 100644 --- a/source/libs/catalog/inc/catalogInt.h +++ b/source/libs/catalog/inc/catalogInt.h @@ -547,6 +547,14 @@ typedef struct SCtgOperation { #define ctgDebug(param, ...) qDebug("CTG:%p " param, pCtg, __VA_ARGS__) #define ctgTrace(param, ...) qTrace("CTG:%p " param, pCtg, __VA_ARGS__) +#define ctgTaskFatal(param, ...) qFatal("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskError(param, ...) qError("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskWarn(param, ...) qWarn("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskInfo(param, ...) qInfo("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskDebug(param, ...) qDebug("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskTrace(param, ...) qTrace("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) + + #define CTG_LOCK_DEBUG(...) \ do { \ if (gCTGDebug.lockEnable) { \ @@ -790,6 +798,9 @@ SName* ctgGetFetchName(SArray* pNames, SCtgFetch* pFetch); int32_t ctgdGetOneHandle(SCatalog **pHandle); int ctgVgInfoComp(const void* lp, const void* rp); int32_t ctgMakeVgArray(SDBVgInfo* dbInfo); +int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const char *tbName, SCtgDBCache **pDb, SCtgTbCache **pTb); +int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCtgTbCache **pTb, STableMeta **pTableMeta, char* dbFName); +void ctgReleaseVgMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache *pCache); extern SCatalogMgmt gCtgMgmt; extern SCtgDebug gCTGDebug; diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 1b9bf7f99c..e9e0bae8d7 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -551,6 +551,35 @@ _return: CTG_RET(code); } +int32_t ctgGetCachedTbVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta) { + int32_t code = 0; + char db[TSDB_DB_FNAME_LEN] = {0}; + tNameGetFullDbName(pTableName, db); + SCtgDBCache *dbCache = NULL; + SCtgTbCache *tbCache = NULL; + + CTG_ERR_RET(ctgAcquireVgMetaFromCache(pCtg, db, pTableName->tname, &dbCache, &tbCache)); + + if (NULL == dbCache || NULL == tbCache) { + *pTableMeta = NULL; + return TSDB_CODE_SUCCESS; + } + + CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, pTableName, pVgroup)); + + SCtgTbMetaCtx ctx = {0}; + ctx.pName = (SName*)pTableName; + ctx.flag = CTG_FLAG_UNKNOWN_STB; + CTG_ERR_JRET(ctgCopyTbMeta(pCtg, &ctx, &dbCache, &tbCache, pTableMeta, db)); + +_return: + + ctgReleaseVgMetaToCache(pCtg, dbCache, tbCache); + + CTG_RET(code); +} + + int32_t ctgRemoveTbMeta(SCatalog* pCtg, SName* pTableName) { int32_t code = 0; @@ -1118,6 +1147,13 @@ int32_t catalogGetCachedTableHashVgroup(SCatalog* pCtg, const SName* pTableName, CTG_API_LEAVE(ctgGetTbHashVgroup(pCtg, NULL, pTableName, pVgroup, exists)); } +int32_t catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta) { + CTG_API_ENTER(); + + CTG_API_LEAVE(ctgGetCachedTbVgMeta(pCtg, pTableName, pVgroup, pTableMeta)); +} + + #if 0 int32_t catalogGetAllMeta(SCatalog* pCtg, SRequestConnInfo* pConn, const SCatalogReq* pReq, SMetaData* pRsp) { CTG_API_ENTER(); diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 7138e0ce16..5b01ac1fb9 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -1094,6 +1094,9 @@ _return: ctgReleaseVgInfoToCache(pCtg, dbCache); } + if (code) { + ctgTaskError("Get table %d.%s.%s meta failed with error %s", pName->acctId, pName->dbname, pName->tname, tstrerror(code)); + } if (pTask->res || code) { ctgHandleTaskEnd(pTask, code); } @@ -1124,7 +1127,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu SVgroupInfo vgInfo = {0}; CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, pOut->dbVgroup, pName, &vgInfo)); - ctgDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); + ctgTaskDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); *vgId = vgInfo.vgId; CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, pName, &vgInfo, NULL, tReq)); @@ -1144,7 +1147,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu SVgroupInfo vgInfo = {0}; CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, pName, &vgInfo)); - ctgDebug("will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); + ctgTaskDebug("will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); *vgId = vgInfo.vgId; CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, pName, &vgInfo, NULL, tReq)); @@ -1162,7 +1165,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu return TSDB_CODE_SUCCESS; } - ctgError("no tbmeta got, tbName:%s", tNameGetTableName(pName)); + ctgTaskError("no tbmeta got, tbName:%s", tNameGetTableName(pName)); ctgRemoveTbMetaFromCache(pCtg, pName, false); CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST); @@ -1180,7 +1183,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu STableMetaOutput* pOut = (STableMetaOutput*)pMsgCtx->out; if (CTG_IS_META_NULL(pOut->metaType)) { - ctgError("no tbmeta got, tbNmae:%s", tNameGetTableName(pName)); + ctgTaskError("no tbmeta got, tbNmae:%s", tNameGetTableName(pName)); ctgRemoveTbMetaFromCache(pCtg, pName, false); CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST); } @@ -1190,7 +1193,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu } if (CTG_IS_META_TABLE(pOut->metaType) && TSDB_SUPER_TABLE == pOut->tbMeta->tableType) { - ctgDebug("will continue to refresh tbmeta since got stb, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("will continue to refresh tbmeta since got stb, tbName:%s", tNameGetTableName(pName)); taosMemoryFreeClear(pOut->tbMeta); @@ -1207,11 +1210,11 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu STableMeta* stbMeta = NULL; (void)ctgReadTbMetaFromCache(pCtg, &stbCtx, &stbMeta); if (stbMeta && stbMeta->sversion >= pOut->tbMeta->sversion) { - ctgDebug("use cached stb meta, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("use cached stb meta, tbName:%s", tNameGetTableName(pName)); exist = 1; taosMemoryFreeClear(stbMeta); } else { - ctgDebug("need to get/update stb meta, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("need to get/update stb meta, tbName:%s", tNameGetTableName(pName)); taosMemoryFreeClear(pOut->tbMeta); taosMemoryFreeClear(stbMeta); } @@ -1225,7 +1228,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu break; } default: - ctgError("invalid reqType %d", reqType); + ctgTaskError("invalid reqType %d", reqType); CTG_ERR_JRET(TSDB_CODE_INVALID_MSG); } @@ -1280,6 +1283,7 @@ _return: TSWAP(pTask->res, ctx->pResList); taskDone = true; } + ctgTaskError("Get table %d.%s.%s meta failed with error %s", pName->acctId, pName->dbname, pName->tname, tstrerror(code)); } if (pTask->res && taskDone) { diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index f41058584f..47cb0ef559 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -130,7 +130,7 @@ void ctgReleaseVgInfoToCache(SCatalog *pCtg, SCtgDBCache *dbCache) { } void ctgReleaseTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache *pCache) { - if (pCache) { + if (pCache && dbCache) { CTG_UNLOCK(CTG_READ, &pCache->metaLock); taosHashRelease(dbCache->tbCache, pCache); } @@ -151,6 +151,18 @@ void ctgReleaseTbIndexToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache } } +void ctgReleaseVgMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache *pCache) { + if (pCache && dbCache) { + CTG_UNLOCK(CTG_READ, &pCache->metaLock); + taosHashRelease(dbCache->tbCache, pCache); + } + + if (dbCache) { + ctgRUnlockVgInfo(dbCache); + ctgReleaseDBCache(pCtg, dbCache); + } +} + int32_t ctgAcquireVgInfoFromCache(SCatalog *pCtg, const char *dbFName, SCtgDBCache **pCache) { SCtgDBCache *dbCache = NULL; ctgAcquireDBCache(pCtg, dbFName, &dbCache); @@ -226,6 +238,75 @@ _return: return TSDB_CODE_SUCCESS; } +int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const char *tbName, SCtgDBCache **pDb, SCtgTbCache **pTb) { + SCtgDBCache *dbCache = NULL; + SCtgTbCache *tbCache = NULL; + bool vgInCache = false; + + ctgAcquireDBCache(pCtg, dbFName, &dbCache); + if (NULL == dbCache) { + ctgDebug("db %s not in cache", dbFName); + CTG_CACHE_STAT_INC(numOfVgMiss, 1); + goto _return; + } + + ctgRLockVgInfo(pCtg, dbCache, &vgInCache); + if (!vgInCache) { + ctgDebug("vgInfo of db %s not in cache", dbFName); + CTG_CACHE_STAT_INC(numOfVgMiss, 1); + goto _return; + } + + *pDb = dbCache; + + CTG_CACHE_STAT_INC(numOfVgHit, 1); + + ctgDebug("Got db vgInfo from cache, dbFName:%s", dbFName); + + tbCache = taosHashAcquire(dbCache->tbCache, tbName, strlen(tbName)); + if (NULL == tbCache) { + ctgDebug("tb %s not in cache, dbFName:%s", tbName, dbFName); + CTG_CACHE_STAT_INC(numOfMetaMiss, 1); + goto _return; + } + + CTG_LOCK(CTG_READ, &tbCache->metaLock); + if (NULL == tbCache->pMeta) { + ctgDebug("tb %s meta not in cache, dbFName:%s", tbName, dbFName); + CTG_CACHE_STAT_INC(numOfMetaMiss, 1); + goto _return; + } + + *pTb = tbCache; + + ctgDebug("tb %s meta got in cache, dbFName:%s", tbName, dbFName); + + CTG_CACHE_STAT_INC(numOfMetaHit, 1); + + return TSDB_CODE_SUCCESS; + +_return: + + if (tbCache) { + CTG_UNLOCK(CTG_READ, &tbCache->metaLock); + taosHashRelease(dbCache->tbCache, tbCache); + } + + if (vgInCache) { + ctgRUnlockVgInfo(dbCache); + } + + if (dbCache) { + ctgReleaseDBCache(pCtg, dbCache); + } + + *pDb = NULL; + *pTb = NULL; + + return TSDB_CODE_SUCCESS; +} + + /* int32_t ctgAcquireStbMetaFromCache(SCatalog *pCtg, char *dbFName, uint64_t suid, SCtgDBCache **pDb, SCtgTbCache **pTb) { SCtgDBCache *dbCache = NULL; @@ -378,6 +459,78 @@ int32_t ctgTbMetaExistInCache(SCatalog *pCtg, char *dbFName, char *tbName, int32 return TSDB_CODE_SUCCESS; } +int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCtgTbCache **pTb, STableMeta **pTableMeta, char* dbFName) { + SCtgDBCache *dbCache = *pDb; + SCtgTbCache *tbCache = *pTb; + STableMeta *tbMeta = tbCache->pMeta; + ctx->tbInfo.inCache = true; + ctx->tbInfo.dbId = dbCache->dbId; + ctx->tbInfo.suid = tbMeta->suid; + ctx->tbInfo.tbType = tbMeta->tableType; + + if (tbMeta->tableType != TSDB_CHILD_TABLE) { + int32_t metaSize = CTG_META_SIZE(tbMeta); + *pTableMeta = taosMemoryCalloc(1, metaSize); + if (NULL == *pTableMeta) { + CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + memcpy(*pTableMeta, tbMeta, metaSize); + + ctgDebug("Got tb %s meta from cache, type:%d, dbFName:%s", ctx->pName->tname, tbMeta->tableType, dbFName); + return TSDB_CODE_SUCCESS; + } + + // PROCESS FOR CHILD TABLE + + int32_t metaSize = sizeof(SCTableMeta); + *pTableMeta = taosMemoryCalloc(1, metaSize); + if (NULL == *pTableMeta) { + CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + memcpy(*pTableMeta, tbMeta, metaSize); + + //ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); + + if (tbCache) { + CTG_UNLOCK(CTG_READ, &tbCache->metaLock); + taosHashRelease(dbCache->tbCache, tbCache); + *pTb = NULL; + } + + ctgDebug("Got ctb %s meta from cache, will continue to get its stb meta, type:%d, dbFName:%s", ctx->pName->tname, + ctx->tbInfo.tbType, dbFName); + + ctgAcquireStbMetaFromCache(dbCache, pCtg, dbFName, ctx->tbInfo.suid, &tbCache); + if (NULL == tbCache) { + taosMemoryFreeClear(*pTableMeta); + *pDb = NULL; + ctgDebug("stb 0x%" PRIx64 " meta not in cache", ctx->tbInfo.suid); + return TSDB_CODE_SUCCESS; + } + + *pTb = tbCache; + + STableMeta *stbMeta = tbCache->pMeta; + if (stbMeta->suid != ctx->tbInfo.suid) { + ctgError("stb suid 0x%" PRIx64 " in stbCache mis-match, expected suid 0x%" PRIx64, stbMeta->suid, ctx->tbInfo.suid); + taosMemoryFreeClear(*pTableMeta); + CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR); + } + + metaSize = CTG_META_SIZE(stbMeta); + *pTableMeta = taosMemoryRealloc(*pTableMeta, metaSize); + if (NULL == *pTableMeta) { + CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + memcpy(&(*pTableMeta)->sversion, &stbMeta->sversion, metaSize - sizeof(SCTableMeta)); + + return TSDB_CODE_SUCCESS; +} + + int32_t ctgReadTbMetaFromCache(SCatalog *pCtg, SCtgTbMetaCtx *ctx, STableMeta **pTableMeta) { int32_t code = 0; SCtgDBCache *dbCache = NULL; @@ -397,70 +550,7 @@ int32_t ctgReadTbMetaFromCache(SCatalog *pCtg, SCtgTbMetaCtx *ctx, STableMeta ** return TSDB_CODE_SUCCESS; } - STableMeta *tbMeta = tbCache->pMeta; - ctx->tbInfo.inCache = true; - ctx->tbInfo.dbId = dbCache->dbId; - ctx->tbInfo.suid = tbMeta->suid; - ctx->tbInfo.tbType = tbMeta->tableType; - - if (tbMeta->tableType != TSDB_CHILD_TABLE) { - int32_t metaSize = CTG_META_SIZE(tbMeta); - *pTableMeta = taosMemoryCalloc(1, metaSize); - if (NULL == *pTableMeta) { - ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); - } - - memcpy(*pTableMeta, tbMeta, metaSize); - - ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - ctgDebug("Got tb %s meta from cache, type:%d, dbFName:%s", ctx->pName->tname, tbMeta->tableType, dbFName); - return TSDB_CODE_SUCCESS; - } - - // PROCESS FOR CHILD TABLE - - int32_t metaSize = sizeof(SCTableMeta); - *pTableMeta = taosMemoryCalloc(1, metaSize); - if (NULL == *pTableMeta) { - CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); - } - - memcpy(*pTableMeta, tbMeta, metaSize); - - //ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - - if (tbCache) { - CTG_UNLOCK(CTG_READ, &tbCache->metaLock); - taosHashRelease(dbCache->tbCache, tbCache); - } - - ctgDebug("Got ctb %s meta from cache, will continue to get its stb meta, type:%d, dbFName:%s", ctx->pName->tname, - ctx->tbInfo.tbType, dbFName); - - ctgAcquireStbMetaFromCache(dbCache, pCtg, dbFName, ctx->tbInfo.suid, &tbCache); - if (NULL == tbCache) { - //ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - taosMemoryFreeClear(*pTableMeta); - ctgDebug("stb 0x%" PRIx64 " meta not in cache", ctx->tbInfo.suid); - return TSDB_CODE_SUCCESS; - } - - STableMeta *stbMeta = tbCache->pMeta; - if (stbMeta->suid != ctx->tbInfo.suid) { - ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - ctgError("stb suid 0x%" PRIx64 " in stbCache mis-match, expected suid 0x%" PRIx64, stbMeta->suid, ctx->tbInfo.suid); - CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR); - } - - metaSize = CTG_META_SIZE(stbMeta); - *pTableMeta = taosMemoryRealloc(*pTableMeta, metaSize); - if (NULL == *pTableMeta) { - ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); - CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); - } - - memcpy(&(*pTableMeta)->sversion, &stbMeta->sversion, metaSize - sizeof(SCTableMeta)); + CTG_ERR_JRET(ctgCopyTbMeta(pCtg, ctx, &dbCache, &tbCache, pTableMeta, dbFName)); ctgReleaseTbMetaToCache(pCtg, dbCache, tbCache); diff --git a/source/libs/executor/src/dataDeleter.c b/source/libs/executor/src/dataDeleter.c index 12fb449238..eff7a5ef93 100644 --- a/source/libs/executor/src/dataDeleter.c +++ b/source/libs/executor/src/dataDeleter.c @@ -133,7 +133,7 @@ static int32_t getStatus(SDataDeleterHandle* pDeleter) { static int32_t putDataBlock(SDataSinkHandle* pHandle, const SInputData* pInput, bool* pContinue) { SDataDeleterHandle* pDeleter = (SDataDeleterHandle*)pHandle; - SDataDeleterBuf* pBuf = taosAllocateQitem(sizeof(SDataDeleterBuf), DEF_QITEM); + SDataDeleterBuf* pBuf = taosAllocateQitem(sizeof(SDataDeleterBuf), DEF_QITEM, 0); if (NULL == pBuf) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c index c45226e02b..c2fa438c80 100644 --- a/source/libs/executor/src/dataDispatcher.c +++ b/source/libs/executor/src/dataDispatcher.c @@ -126,7 +126,7 @@ static int32_t getStatus(SDataDispatchHandle* pDispatcher) { static int32_t putDataBlock(SDataSinkHandle* pHandle, const SInputData* pInput, bool* pContinue) { SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle; - SDataDispatchBuf* pBuf = taosAllocateQitem(sizeof(SDataDispatchBuf), DEF_QITEM); + SDataDispatchBuf* pBuf = taosAllocateQitem(sizeof(SDataDispatchBuf), DEF_QITEM, 0); if (NULL == pBuf) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2032cb9fce..fc3cfbd0f6 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -439,7 +439,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } } - removeInvalidTable(uidList, tags); + if (suid != 0) { + removeInvalidTable(uidList, tags); + } int32_t rows = taosArrayGetSize(uidList); if (rows == 0) { @@ -1604,7 +1606,7 @@ int32_t initQueryTableDataCond(SQueryTableDataCond* pCond, const STableScanPhysi pCond->numOfCols = LIST_LENGTH(pTableScanNode->scan.pScanCols); pCond->colList = taosMemoryCalloc(pCond->numOfCols, sizeof(SColumnInfo)); - pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t)*pCond->numOfCols); + pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t) * pCond->numOfCols); if (pCond->colList == NULL || pCond->pSlotList == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; taosMemoryFreeClear(pCond->colList); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index bd22e864cd..043cc396b5 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1580,6 +1580,7 @@ void destroyOperatorInfo(SOperatorInfo* pOperator) { int32_t optrDefaultBufFn(SOperatorInfo* pOperator) { if (pOperator->blocking) { ASSERT(0); + return 0; } else { return 0; } diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 2cd1bd7dec..1a43ddecdd 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -314,7 +314,8 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = j - num; - applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, + pOperator->exprSupp.numOfExprs); // assign the group keys or user input constant values if required doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); @@ -331,7 +332,8 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = pBlock->info.rows - num; - applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, + pOperator->exprSupp.numOfExprs); doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); } } @@ -469,8 +471,8 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* initResultRowInfo(&pInfo->binfo.resultRowInfo); setOperatorInfo(pOperator, "GroupbyAggOperator", 0, true, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = - createOperatorFpSet(optrDummyOpenFn, hashGroupbyAggregate, NULL, destroyGroupOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, hashGroupbyAggregate, NULL, destroyGroupOperatorInfo, + optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { goto _error; @@ -776,6 +778,12 @@ static void destroyPartitionOperatorInfo(void* param) { taosArrayDestroy(pInfo->pGroupColVals); taosMemoryFree(pInfo->keyBuf); + + int32_t size = taosArrayGetSize(pInfo->sortedGroupArray); + for (int32_t i = 0; i < size; i++) { + SDataGroupInfo* pGp = taosArrayGet(pInfo->sortedGroupArray, i); + taosArrayDestroy(pGp->pPageList); + } taosArrayDestroy(pInfo->sortedGroupArray); void* pGroupIter = taosHashIterate(pInfo->pGroupSet, NULL); @@ -850,7 +858,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition pOperator->exprSupp.numOfExprs = numOfCols; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = + createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); return pOperator; @@ -1141,8 +1150,8 @@ SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStr pInfo, pTaskInfo); pOperator->exprSupp.numOfExprs = numOfCols; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->fpSet = - createOperatorFpSet(optrDummyOpenFn, doStreamHashPartition, NULL, destroyStreamPartitionOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doStreamHashPartition, NULL, + destroyStreamPartitionOperatorInfo, optrDefaultBufFn, NULL); initParDownStream(downstream, &pInfo->partitionSup, &pInfo->scalarSup); code = appendDownstream(pOperator, &downstream, 1); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 04f5f4ecfe..eae2ff3c72 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -224,7 +224,7 @@ static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg** pColsA static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo) { bool allColumnsHaveAgg = true; - int32_t code = tsdbRetrieveDatablockSMA(pTableScanInfo->dataReader, &pBlock->pBlockAgg, &allColumnsHaveAgg); + int32_t code = tsdbRetrieveDatablockSMA(pTableScanInfo->dataReader, pBlock, &allColumnsHaveAgg); if (code != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, code); } @@ -1218,27 +1218,56 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS if (rows == 0) { return TSDB_CODE_SUCCESS; } + + SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); + + uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; + ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); + TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + int64_t version = pSrcBlock->info.version - 1; + + if (pInfo->partitionSup.needCalc && srcStartTsCol[0] != srcEndTsCol[0]) { + uint64_t srcUid = srcUidData[0]; + TSKEY startTs = srcStartTsCol[0]; + TSKEY endTs = srcEndTsCol[0]; + SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, srcUid, startTs, endTs, version); + printDataBlock(pPreRes, "pre res"); + blockDataCleanup(pSrcBlock); + int32_t code = blockDataEnsureCapacity(pSrcBlock, pPreRes->info.rows); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + SColumnInfoData* pTsCol = (SColumnInfoData*)taosArrayGet(pPreRes->pDataBlock, pInfo->primaryTsIndex); + rows = pPreRes->info.rows; + + for (int32_t i = 0; i < rows; i++) { + uint64_t groupId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, i); + appendOneRowToStreamSpecialBlock(pSrcBlock, ((TSKEY*)pTsCol->pData) + i, ((TSKEY*)pTsCol->pData) + i, &srcUid, + &groupId, NULL); + } + printDataBlock(pSrcBlock, "new delete"); + } + uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; + srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + srcUidData = (uint64_t*)pSrcUidCol->pData; + int32_t code = blockDataEnsureCapacity(pDestBlock, rows); if (code != TSDB_CODE_SUCCESS) { return code; } - SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); - SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); - SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); - uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; - SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); - uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; - ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); - TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; - TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; SColumnInfoData* pStartTsCol = taosArrayGet(pDestBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pDestBlock->pDataBlock, END_TS_COLUMN_INDEX); SColumnInfoData* pDeUidCol = taosArrayGet(pDestBlock->pDataBlock, UID_COLUMN_INDEX); SColumnInfoData* pGpCol = taosArrayGet(pDestBlock->pDataBlock, GROUPID_COLUMN_INDEX); SColumnInfoData* pCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); - int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < rows;) { uint64_t srcUid = srcUidData[i]; uint64_t groupId = srcGp[i]; @@ -1653,13 +1682,6 @@ static void setBlockGroupIdByUid(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { uint64_t groupId = getGroupIdByUid(pInfo, uidCol[i]); colDataAppend(pGpCol, i, (const char*)&groupId, false); } - } else { - // SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, uidCol[i], startTsCol, ts, maxVersion); - // if (!pPreRes || pPreRes->info.rows == 0) { - // return 0; - // } - // ASSERT(pPreRes->info.rows == 1); - // return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); } } @@ -3032,8 +3054,10 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* if (pSupp->dbNameSlotId != -1) { ASSERT(strlen(dbName)); SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->dbNameSlotId); - char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varDbName), dbName, strlen(dbName)); + + char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + tstrncpy(varDataVal(varDbName), dbName, TSDB_DB_NAME_LEN); + varDataSetLen(varDbName, strlen(dbName)); colDataAppend(colInfoData, 0, varDbName, false); } @@ -3042,7 +3066,7 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->stbNameSlotId); if (strlen(stbName) != 0) { char varStbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varStbName), stbName, strlen(stbName)); + strncpy(varDataVal(varStbName), stbName, TSDB_TABLE_NAME_LEN); varDataSetLen(varStbName, strlen(stbName)); colDataAppend(colInfoData, 0, varStbName, false); } else { diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 2374d80bbf..a82dc13318 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -49,10 +49,10 @@ static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock if (!colDataIsNull_s(pColInfoData, rowIndex)) { pkey->isNull = false; char* val = colDataGetData(pColInfoData, rowIndex); - if (!IS_VAR_DATA_TYPE(pkey->type)) { - memcpy(pkey->pData, val, pkey->bytes); - } else { + if (IS_VAR_DATA_TYPE(pkey->type)) { memcpy(pkey->pData, val, varDataLen(val)); + } else { + memcpy(pkey->pData, val, pkey->bytes); } } else { pkey->isNull = true; @@ -91,18 +91,37 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, i); + + if (!IS_MATHABLE_TYPE(pColInfoData->info.type)) { + continue; + } + // null value is represented by using key = INT64_MIN for now. // TODO: optimize to ignore null values for linear interpolation. if (!pLinearInfo->isStartSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { + pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + } } pLinearInfo->isStartSet = true; } else if (!pLinearInfo->isEndSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); + } } pLinearInfo->isEndSet = true; } else { @@ -111,7 +130,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo if (!colDataIsNull_s(pColInfoData, rowIndex)) { pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); + } + } else { pLinearInfo->end.key = INT64_MIN; } diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index d9a011a892..2af551b832 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -23,6 +23,7 @@ #include "ttime.h" #define IS_FINAL_OP(op) ((op)->isFinal) +#define DEAULT_DELETE_MARK (1000LL * 60LL * 60LL * 24LL * 365LL * 10LL); typedef struct SSessionAggOperatorInfo { SOptrBasicInfo binfo; @@ -56,6 +57,7 @@ typedef enum SResultTsInterpType { typedef struct SPullWindowInfo { STimeWindow window; uint64_t groupId; + STimeWindow calWin; } SPullWindowInfo; typedef struct SOpenWindowInfo { @@ -793,17 +795,18 @@ int32_t comparePullWinKey(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; SPullWindowInfo* pos = taosArrayGet(res, index); SPullWindowInfo* pData = (SPullWindowInfo*)pKey; - if (pData->window.skey == pos->window.skey) { - if (pData->groupId > pos->groupId) { - return 1; - } else if (pData->groupId < pos->groupId) { - return -1; - } - return 0; - } else if (pData->window.skey > pos->window.skey) { + if (pData->groupId > pos->groupId) { return 1; + } else if (pData->groupId < pos->groupId) { + return -1; } - return -1; + + if (pData->window.skey > pos->window.ekey) { + return 1; + } else if (pData->window.ekey < pos->window.skey) { + return -1; + } + return 0; } static int32_t savePullWindow(SPullWindowInfo* pPullInfo, SArray* pPullWins) { @@ -812,10 +815,16 @@ static int32_t savePullWindow(SPullWindowInfo* pPullInfo, SArray* pPullWins) { if (index == -1) { index = 0; } else { - if (comparePullWinKey(pPullInfo, pPullWins, index) > 0) { - index++; - } else { + int32_t code = comparePullWinKey(pPullInfo, pPullWins, index); + if (code == 0) { + SPullWindowInfo* pos = taosArrayGet(pPullWins ,index); + pos->window.skey = TMIN(pos->window.skey, pPullInfo->window.skey); + pos->window.ekey = TMAX(pos->window.ekey, pPullInfo->window.ekey); + pos->calWin.skey = TMIN(pos->calWin.skey, pPullInfo->calWin.skey); + pos->calWin.ekey = TMAX(pos->calWin.ekey, pPullInfo->calWin.ekey); return TSDB_CODE_SUCCESS; + } else if (code > 0 ){ + index++; } } if (taosArrayInsert(pPullWins, index, pPullInfo) == NULL) { @@ -863,19 +872,20 @@ static void removeResults(SArray* pWins, SHashObj* pUpdatedMap) { int32_t compareWinRes(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; - SWinKey* pos = taosArrayGet(res, index); - SResKeyPos* pData = (SResKeyPos*)pKey; - if (*(int64_t*)pData->key == pos->ts) { - if (pData->groupId > pos->groupId) { - return 1; - } else if (pData->groupId < pos->groupId) { - return -1; - } - return 0; - } else if (*(int64_t*)pData->key > pos->ts) { + SWinKey* pDataPos = taosArrayGet(res, index); + SResKeyPos* pRKey = (SResKeyPos*)pKey; + if (pRKey->groupId > pDataPos->groupId) { return 1; + } else if (pRKey->groupId < pDataPos->groupId) { + return -1; } - return -1; + + if (*(int64_t*)pRKey->key > pDataPos->ts) { + return 1; + } else if (*(int64_t*)pRKey->key < pDataPos->ts){ + return -1; + } + return 0; } static void removeDeleteResults(SHashObj* pUpdatedMap, SArray* pDelWins) { @@ -1400,19 +1410,21 @@ static int32_t getAllIntervalWindow(SSHashObj* pHashMap, SHashObj* resWins) { int32_t compareWinKey(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; - SWinKey* pos = taosArrayGet(res, index); - SWinKey* pData = (SWinKey*)pKey; - if (pData->ts == pos->ts) { - if (pData->groupId > pos->groupId) { - return 1; - } else if (pData->groupId < pos->groupId) { - return -1; - } - return 0; - } else if (pData->ts > pos->ts) { + SWinKey* pDataPos = taosArrayGet(res, index); + SWinKey* pWKey = (SWinKey*)pKey; + + if (pWKey->groupId > pDataPos->groupId) { return 1; + } else if (pWKey->groupId < pDataPos->groupId) { + return -1; } - return -1; + + if (pWKey->ts > pDataPos->ts) { + return 1; + } else if (pWKey->ts < pDataPos->ts) { + return -1; + } + return 0; } static int32_t closeStreamIntervalWindow(SSHashObj* pHashMap, STimeWindowAggSupp* pTwSup, SInterval* pInterval, @@ -2252,8 +2264,8 @@ static void doBuildPullDataBlock(SArray* array, int32_t* pIndex, SSDataBlock* pB colDataAppend(pStartTs, pBlock->info.rows, (const char*)&pWin->window.skey, false); colDataAppend(pEndTs, pBlock->info.rows, (const char*)&pWin->window.ekey, false); colDataAppend(pGroupId, pBlock->info.rows, (const char*)&pWin->groupId, false); - colDataAppend(pCalStartTs, pBlock->info.rows, (const char*)&pWin->window.skey, false); - colDataAppend(pCalEndTs, pBlock->info.rows, (const char*)&pWin->window.ekey, false); + colDataAppend(pCalStartTs, pBlock->info.rows, (const char*)&pWin->calWin.skey, false); + colDataAppend(pCalEndTs, pBlock->info.rows, (const char*)&pWin->calWin.ekey, false); pBlock->info.rows++; } if ((*pIndex) == size) { @@ -2263,27 +2275,33 @@ static void doBuildPullDataBlock(SArray* array, int32_t* pIndex, SSDataBlock* pB blockDataUpdateTsWindow(pBlock, 0); } -void processPullOver(SSDataBlock* pBlock, SHashObj* pMap) { +void processPullOver(SSDataBlock* pBlock, SHashObj* pMap, SInterval* pInterval) { SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); TSKEY* tsData = (TSKEY*)pStartCol->pData; + SColumnInfoData* pEndCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); + TSKEY* tsEndData = (TSKEY*)pEndCol->pData; SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); uint64_t* groupIdData = (uint64_t*)pGroupCol->pData; int32_t chId = getChildIndex(pBlock); for (int32_t i = 0; i < pBlock->info.rows; i++) { - SWinKey winRes = {.ts = tsData[i], .groupId = groupIdData[i]}; - void* chIds = taosHashGet(pMap, &winRes, sizeof(SWinKey)); - if (chIds) { - SArray* chArray = *(SArray**)chIds; - int32_t index = taosArraySearchIdx(chArray, &chId, compareInt32Val, TD_EQ); - if (index != -1) { - qDebug("===stream===window %" PRId64 " delete child id %d", winRes.ts, chId); - taosArrayRemove(chArray, index); - if (taosArrayGetSize(chArray) == 0) { - // pull data is over - taosArrayDestroy(chArray); - taosHashRemove(pMap, &winRes, sizeof(SWinKey)); + TSKEY winTs = tsData[i]; + while (winTs < tsEndData[i]) { + SWinKey winRes = {.ts = winTs, .groupId = groupIdData[i]}; + void* chIds = taosHashGet(pMap, &winRes, sizeof(SWinKey)); + if (chIds) { + SArray* chArray = *(SArray**)chIds; + int32_t index = taosArraySearchIdx(chArray, &chId, compareInt32Val, TD_EQ); + if (index != -1) { + qDebug("===stream===window %" PRId64 " delete child id %d", winRes.ts, chId); + taosArrayRemove(chArray, index); + if (taosArrayGetSize(chArray) == 0) { + // pull data is over + taosArrayDestroy(chArray); + taosHashRemove(pMap, &winRes, sizeof(SWinKey)); + } } } + winTs = taosTimeAdd(winTs, pInterval->sliding, pInterval->slidingUnit, pInterval->precision); } } } @@ -2296,12 +2314,13 @@ static void addRetriveWindow(SArray* wins, SStreamIntervalOperatorInfo* pInfo) { if (needDeleteWindowBuf(&nextWin, &pInfo->twAggSup) && !pInfo->ignoreExpiredData) { void* chIds = taosHashGet(pInfo->pPullDataMap, winKey, sizeof(SWinKey)); if (!chIds) { - SPullWindowInfo pull = {.window = nextWin, .groupId = winKey->groupId}; + SPullWindowInfo pull = {.window = nextWin, .groupId = winKey->groupId, .calWin.skey = nextWin.skey, .calWin.ekey = nextWin.skey}; // add pull data request - savePullWindow(&pull, pInfo->pPullWins); - int32_t size1 = taosArrayGetSize(pInfo->pChildren); - addPullWindow(pInfo->pPullDataMap, winKey, size1); - qDebug("===stream===prepare retrive for delete %" PRId64 ", size:%d", winKey->ts, size1); + if (savePullWindow(&pull, pInfo->pPullWins) == TSDB_CODE_SUCCESS) { + int32_t size1 = taosArrayGetSize(pInfo->pChildren); + addPullWindow(pInfo->pPullDataMap, winKey, size1); + qDebug("===stream===prepare retrive for delete %" PRId64 ", size:%d", winKey->ts, size1); + } } } } @@ -2371,12 +2390,13 @@ static void doStreamIntervalAggImpl(SOperatorInfo* pOperatorInfo, SSDataBlock* p }; void* chIds = taosHashGet(pInfo->pPullDataMap, &winRes, sizeof(SWinKey)); if (isDeletedStreamWindow(&nextWin, groupId, pInfo->pState, &pInfo->twAggSup) && !chIds) { - SPullWindowInfo pull = {.window = nextWin, .groupId = groupId}; + SPullWindowInfo pull = {.window = nextWin, .groupId = groupId, .calWin.skey = nextWin.skey, .calWin.ekey = nextWin.skey}; // add pull data request - savePullWindow(&pull, pInfo->pPullWins); - int32_t size = taosArrayGetSize(pInfo->pChildren); - addPullWindow(pInfo->pPullDataMap, &winRes, size); - qDebug("===stream===prepare retrive %" PRId64 ", size:%d", winRes.ts, size); + if (savePullWindow(&pull, pInfo->pPullWins) == TSDB_CODE_SUCCESS) { + int32_t size = taosArrayGetSize(pInfo->pChildren); + addPullWindow(pInfo->pPullDataMap, &winRes, size); + qDebug("===stream===prepare retrive %" PRId64 ", size:%d", winRes.ts, size); + } } else { int32_t index = -1; SArray* chArray = NULL; @@ -2557,7 +2577,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } continue; } else if (pBlock->info.type == STREAM_PULL_OVER && IS_FINAL_OP(pInfo)) { - processPullOver(pBlock, pInfo->pPullDataMap); + processPullOver(pBlock, pInfo->pPullDataMap, &pInfo->interval); continue; } @@ -2635,6 +2655,15 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { return NULL; } +int64_t getDeleteMark(SIntervalPhysiNode* pIntervalPhyNode) { + if (pIntervalPhyNode->window.deleteMark <= 0) { + return DEAULT_DELETE_MARK; + } + int64_t deleteMark = TMAX(pIntervalPhyNode->window.deleteMark,pIntervalPhyNode->window.watermark); + deleteMark = TMAX(deleteMark, pIntervalPhyNode->interval); + return deleteMark; +} + SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, int32_t numOfChild) { SIntervalPhysiNode* pIntervalPhyNode = (SIntervalPhysiNode*)pPhyNode; @@ -2656,9 +2685,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, .calTrigger = pIntervalPhyNode->window.triggerType, .maxTs = INT64_MIN, .minTs = INT64_MAX, - // for test 315360000000 - .deleteMark = 1000LL * 60LL * 60LL * 24LL * 365LL * 10LL, - // .deleteMark = INT64_MAX, + .deleteMark = getDeleteMark(pIntervalPhyNode), .deleteMarkSaved = 0, .calTriggerSaved = 0, }; @@ -4802,7 +4829,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys .calTrigger = pIntervalPhyNode->window.triggerType, .maxTs = INT64_MIN, .minTs = INT64_MAX, - .deleteMark = INT64_MAX, + .deleteMark = getDeleteMark(pIntervalPhyNode), }; ASSERT(twAggSupp.calTrigger != STREAM_TRIGGER_MAX_DELAY); diff --git a/source/libs/executor/src/tlinearhash.c b/source/libs/executor/src/tlinearhash.c index 4204692514..d97f81c994 100644 --- a/source/libs/executor/src/tlinearhash.c +++ b/source/libs/executor/src/tlinearhash.c @@ -17,6 +17,7 @@ #include "taoserror.h" #include "tdef.h" #include "tpagedbuf.h" +#include "tlog.h" #define LHASH_CAP_RATIO 0.85 diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 20de7f73bf..111da6d6ba 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -423,6 +423,8 @@ typedef struct SGroupKeyInfo { (_p).val = (_v); \ } while (0) +static int32_t firstLastTransferInfoImpl(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst); + bool functionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (pResultInfo->initialized) { return false; @@ -457,11 +459,12 @@ int32_t firstCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SFirstLastRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || pDBuf->ts > pSBuf->ts)) { - memcpy(pDBuf->buf, pSBuf->buf, bytes); - pDBuf->ts = pSBuf->ts; - pDResInfo->numOfRes = 1; + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pSBuf, pDBuf, true)) { + pDBuf->hasResult = true; } + + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); + pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; } @@ -501,7 +504,7 @@ static int32_t getNumOfElems(SqlFunctionCtx* pCtx) { */ SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows) { + if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows && !IS_VAR_DATA_TYPE(pInputCol->info.type)) { numOfElem = pInput->numOfRows - pInput->pColumnDataAgg[0]->numOfNull; ASSERT(numOfElem >= 0); } else { @@ -1274,17 +1277,8 @@ int32_t stddevCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SStddevRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); int16_t type = pDBuf->type == TSDB_DATA_TYPE_NULL ? pSBuf->type : pDBuf->type; - if (IS_SIGNED_NUMERIC_TYPE(type)) { - pDBuf->isum += pSBuf->isum; - pDBuf->quadraticISum += pSBuf->quadraticISum; - } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { - pDBuf->usum += pSBuf->usum; - pDBuf->quadraticUSum += pSBuf->quadraticUSum; - } else { - pDBuf->dsum += pSBuf->dsum; - pDBuf->quadraticDSum += pSBuf->quadraticDSum; - } - pDBuf->count += pSBuf->count; + stddevTransferInfo(pSBuf, pDBuf); + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; @@ -2289,16 +2283,15 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) { return TSDB_CODE_SUCCESS; } -static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst, - int32_t rowIndex) { +static int32_t firstLastTransferInfoImpl(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst) { if (pOutput->hasResult) { if (isFirst) { if (pInput->ts > pOutput->ts) { - return; + return TSDB_CODE_FAILED; } } else { if (pInput->ts < pOutput->ts) { - return; + return TSDB_CODE_FAILED; } } } @@ -2308,9 +2301,15 @@ static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, S pOutput->bytes = pInput->bytes; memcpy(pOutput->buf, pInput->buf, pOutput->bytes); - firstlastSaveTupleData(pCtx->pSrcBlock, rowIndex, pCtx, pOutput); + return TSDB_CODE_SUCCESS; +} - pOutput->hasResult = true; +static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst, + int32_t rowIndex) { + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pInput, pOutput, isFirst)) { + firstlastSaveTupleData(pCtx->pSrcBlock, rowIndex, pCtx, pOutput); + pOutput->hasResult = true; + } } static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuery) { @@ -2378,7 +2377,6 @@ int32_t firstLastPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return 1; } -// todo rewrite: int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); SFirstLastRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); @@ -2387,11 +2385,12 @@ int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SFirstLastRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || pDBuf->ts < pSBuf->ts)) { - memcpy(pDBuf->buf, pSBuf->buf, bytes); - pDBuf->ts = pSBuf->ts; - pDResInfo->numOfRes = 1; + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pSBuf, pDBuf, false)) { + pDBuf->hasResult = true; } + + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); + pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; } diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index e5727f1472..9c3e1f5604 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -22,6 +22,7 @@ #include "tpagedbuf.h" #include "tpercentile.h" #include "ttypes.h" +#include "tlog.h" #define DEFAULT_NUM_OF_SLOT 1024 @@ -367,11 +368,13 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) { pSlot->info.data = NULL; } - SArray *pPageIdList = (SArray *)taosHashGet(pBucket->groupPagesMap, &groupId, sizeof(groupId)); - if (pPageIdList == NULL) { - SArray *pList = taosArrayInit(4, sizeof(int32_t)); - taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pList, POINTER_BYTES); - pPageIdList = pList; + SArray *pPageIdList; + void *p = taosHashGet(pBucket->groupPagesMap, &groupId, sizeof(groupId)); + if (p == NULL) { + pPageIdList = taosArrayInit(4, sizeof(int32_t)); + taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pPageIdList, POINTER_BYTES); + } else { + pPageIdList = *(SArray **)p; } pSlot->info.data = getNewBufPage(pBucket->pBuffer, &pageId); diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index c78ec5b999..32e57565d4 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -88,11 +88,13 @@ static int32_t udfSpawnUdfd(SUdfdData *pData) { } #ifdef WINDOWS if (strlen(path) == 0) { - strcat(path, "udfd.exe"); - } else { - strcat(path, "\\udfd.exe"); + strcat(path, "C:\\TDengine"); } + strcat(path, "\\udfd.exe"); #else + if (strlen(path) == 0) { + strcat(path, "/usr/bin"); + } strcat(path, "/udfd"); #endif char *argsUdfd[] = {path, "-c", configDir, NULL}; diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index afadf7401d..2f3db636c8 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -1019,8 +1019,8 @@ int main(int argc, char *argv[]) { } if (udfdInitLog() != 0) { + // ignore create log failed, because this error no matter printf("failed to start since init log error\n"); - return -1; } if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) { diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 5b3e8ce5a9..aab018c879 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -295,6 +295,13 @@ static int32_t stateWindowNodeCopy(const SStateWindowNode* pSrc, SStateWindowNod return TSDB_CODE_SUCCESS; } +static int32_t eventWindowNodeCopy(const SEventWindowNode* pSrc, SEventWindowNode* pDst) { + CLONE_NODE_FIELD(pCol); + CLONE_NODE_FIELD(pStartCond); + CLONE_NODE_FIELD(pEndCond); + return TSDB_CODE_SUCCESS; +} + static int32_t sessionWindowNodeCopy(const SSessionWindowNode* pSrc, SSessionWindowNode* pDst) { CLONE_NODE_FIELD_EX(pCol, SColumnNode*); CLONE_NODE_FIELD_EX(pGap, SValueNode*); @@ -378,6 +385,7 @@ static int32_t logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { CLONE_NODE_FIELD(pTagIndexCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); + COPY_SCALAR_FIELD(deleteMark); COPY_SCALAR_FIELD(igExpired); CLONE_NODE_LIST_FIELD(pGroupTags); COPY_SCALAR_FIELD(groupSort); @@ -461,8 +469,11 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p CLONE_NODE_FIELD(pTspk); CLONE_NODE_FIELD(pTsEnd); CLONE_NODE_FIELD(pStateExpr); + CLONE_NODE_FIELD(pStartCond); + CLONE_NODE_FIELD(pEndCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); + COPY_SCALAR_FIELD(deleteMark); COPY_SCALAR_FIELD(igExpired); COPY_SCALAR_FIELD(windowAlgo); COPY_SCALAR_FIELD(inputTsOrder); @@ -707,6 +718,9 @@ SNode* nodesCloneNode(const SNode* pNode) { case QUERY_NODE_STATE_WINDOW: code = stateWindowNodeCopy((const SStateWindowNode*)pNode, (SStateWindowNode*)pDst); break; + case QUERY_NODE_EVENT_WINDOW: + code = eventWindowNodeCopy((const SEventWindowNode*)pNode, (SEventWindowNode*)pDst); + break; case QUERY_NODE_SESSION_WINDOW: code = sessionWindowNodeCopy((const SSessionWindowNode*)pNode, (SSessionWindowNode*)pDst); break; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 352e78c2fc..38884a37e0 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -85,6 +85,8 @@ const char* nodesNodeName(ENodeType type) { return "WhenThen"; case QUERY_NODE_CASE_WHEN: return "CaseWhen"; + case QUERY_NODE_EVENT_WINDOW: + return "EventWindow"; case QUERY_NODE_SET_OPERATOR: return "SetOperator"; case QUERY_NODE_SELECT_STMT: @@ -233,6 +235,10 @@ const char* nodesNodeName(ENodeType type) { return "PhysiLastRowScan"; case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: return "PhysiTableCountScan"; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + return "PhysiMergeEventWindow"; + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return "PhysiStreamEventWindow"; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return "PhysiProject"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -819,6 +825,7 @@ static const char* jkWindowLogicPlanTspk = "Tspk"; static const char* jkWindowLogicPlanStateExpr = "StateExpr"; static const char* jkWindowLogicPlanTriggerType = "TriggerType"; static const char* jkWindowLogicPlanWatermark = "Watermark"; +static const char* jkWindowLogicPlanDeleteMark = "DeleteMark"; static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { const SWindowLogicNode* pNode = (const SWindowLogicNode*)pObj; @@ -860,6 +867,9 @@ static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanDeleteMark, pNode->deleteMark); + } return code; } @@ -904,6 +914,9 @@ static int32_t jsonToLogicWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanDeleteMark, &pNode->deleteMark); + } return code; } @@ -2004,6 +2017,7 @@ static const char* jkWindowPhysiPlanTsPk = "TsPk"; static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; +static const char* jkWindowPhysiPlanDeleteMark = "DeleteMark"; static const char* jkWindowPhysiPlanIgnoreExpired = "IgnoreExpired"; static const char* jkWindowPhysiPlanInputTsOrder = "InputTsOrder"; static const char* jkWindowPhysiPlanOutputTsOrder = "outputTsOrder"; @@ -2031,6 +2045,9 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanDeleteMark, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanIgnoreExpired, pNode->igExpired); } @@ -2069,6 +2086,9 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanDeleteMark, &pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonGetTinyIntValue(pJson, jkWindowPhysiPlanIgnoreExpired, &pNode->igExpired); } @@ -2258,6 +2278,37 @@ static int32_t jsonToPhysiStateWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkEventWindowPhysiPlanStartCond = "StartCond"; +static const char* jkEventWindowPhysiPlanEndCond = "EndCond"; + +static int32_t physiEventWindowNodeToJson(const void* pObj, SJson* pJson) { + const SEventWinodwPhysiNode* pNode = (const SEventWinodwPhysiNode*)pObj; + + int32_t code = physiWindowNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowPhysiPlanStartCond, nodeToJson, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowPhysiPlanEndCond, nodeToJson, pNode->pEndCond); + } + + return code; +} + +static int32_t jsonToPhysiEventWindowNode(const SJson* pJson, void* pObj) { + SEventWinodwPhysiNode* pNode = (SEventWinodwPhysiNode*)pObj; + + int32_t code = jsonToPhysiWindowNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowPhysiPlanStartCond, &pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowPhysiPlanEndCond, &pNode->pEndCond); + } + + return code; +} + static const char* jkPartitionPhysiPlanExprs = "Exprs"; static const char* jkPartitionPhysiPlanPartitionKeys = "PartitionKeys"; static const char* jkPartitionPhysiPlanTargets = "Targets"; @@ -3532,6 +3583,18 @@ static int32_t groupingSetNodeToJson(const void* pObj, SJson* pJson) { return code; } +static int32_t jsonToGroupingSetNode(const SJson* pJson, void* pObj) { + SGroupingSetNode* pNode = (SGroupingSetNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + tjsonGetNumberValue(pJson, jkGroupingSetType, pNode->groupingSetType, code); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkGroupingSetParameter, &pNode->pParameterList); + } + + return code; +} + static const char* jkOrderByExprExpr = "Expr"; static const char* jkOrderByExprOrder = "Order"; static const char* jkOrderByExprNullOrder = "NullOrder"; @@ -3634,6 +3697,36 @@ static int32_t jsonToSessionWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkEventWindowTsPrimaryKey = "TsPrimaryKey"; +static const char* jkEventWindowStartCond = "StartCond"; +static const char* jkEventWindowEndCond = "EndCond"; + +static int32_t eventWindowNodeToJson(const void* pObj, SJson* pJson) { + const SEventWindowNode* pNode = (const SEventWindowNode*)pObj; + + int32_t code = tjsonAddObject(pJson, jkEventWindowTsPrimaryKey, nodeToJson, pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowStartCond, nodeToJson, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowEndCond, nodeToJson, pNode->pEndCond); + } + return code; +} + +static int32_t jsonToEventWindowNode(const SJson* pJson, void* pObj) { + SEventWindowNode* pNode = (SEventWindowNode*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkEventWindowTsPrimaryKey, &pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowStartCond, &pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowEndCond, &pNode->pEndCond); + } + return code; +} + static const char* jkIntervalWindowInterval = "Interval"; static const char* jkIntervalWindowOffset = "Offset"; static const char* jkIntervalWindowSliding = "Sliding"; @@ -4589,6 +4682,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return whenThenNodeToJson(pObj, pJson); case QUERY_NODE_CASE_WHEN: return caseWhenNodeToJson(pObj, pJson); + case QUERY_NODE_EVENT_WINDOW: + return eventWindowNodeToJson(pObj, pJson); case QUERY_NODE_SET_OPERATOR: return setOperatorToJson(pObj, pJson); case QUERY_NODE_SELECT_STMT: @@ -4686,6 +4781,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return physiStateWindowNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return physiEventWindowNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -4729,6 +4827,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRealTableNode(pJson, pObj); case QUERY_NODE_TEMP_TABLE: return jsonToTempTableNode(pJson, pObj); + case QUERY_NODE_GROUPING_SET: + return jsonToGroupingSetNode(pJson, pObj); case QUERY_NODE_ORDER_BY_EXPR: return jsonToOrderByExprNode(pJson, pObj); case QUERY_NODE_LIMIT: @@ -4759,6 +4859,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToWhenThenNode(pJson, pObj); case QUERY_NODE_CASE_WHEN: return jsonToCaseWhenNode(pJson, pObj); + case QUERY_NODE_EVENT_WINDOW: + return jsonToEventWindowNode(pJson, pObj); case QUERY_NODE_SET_OPERATOR: return jsonToSetOperator(pJson, pObj); case QUERY_NODE_SELECT_STMT: @@ -4843,6 +4945,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return jsonToPhysiStateWindowNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return jsonToPhysiEventWindowNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index bf6cd33af7..cb441053ce 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -2607,6 +2607,7 @@ enum { PHY_WINDOW_CODE_TS_END, PHY_WINDOW_CODE_TRIGGER_TYPE, PHY_WINDOW_CODE_WATERMARK, + PHY_WINDOW_CODE_DELETE_MARK, PHY_WINDOW_CODE_IG_EXPIRED, PHY_WINDOW_CODE_INPUT_TS_ORDER, PHY_WINDOW_CODE_OUTPUT_TS_ORDER, @@ -2635,6 +2636,9 @@ static int32_t physiWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_WATERMARK, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_DELETE_MARK, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI8(pEncoder, PHY_WINDOW_CODE_IG_EXPIRED, pNode->igExpired); } @@ -2679,6 +2683,9 @@ static int32_t msgToPhysiWindowNode(STlvDecoder* pDecoder, void* pObj) { case PHY_WINDOW_CODE_WATERMARK: code = tlvDecodeI64(pTlv, &pNode->watermark); break; + case PHY_WINDOW_CODE_DELETE_MARK: + code = tlvDecodeI64(pTlv, &pNode->deleteMark); + break; case PHY_WINDOW_CODE_IG_EXPIRED: code = tlvDecodeI8(pTlv, &pNode->igExpired); break; @@ -2920,6 +2927,46 @@ static int32_t msgToPhysiStateWindowNode(STlvDecoder* pDecoder, void* pObj) { return code; } +enum { PHY_EVENT_CODE_WINDOW = 1, PHY_EVENT_CODE_START_COND, PHY_EVENT_CODE_END_COND }; + +static int32_t physiEventWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { + const SEventWinodwPhysiNode* pNode = (const SEventWinodwPhysiNode*)pObj; + + int32_t code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_WINDOW, physiWindowNodeToMsg, &pNode->window); + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_START_COND, nodeToMsg, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_END_COND, nodeToMsg, pNode->pEndCond); + } + + return code; +} + +static int32_t msgToPhysiEventWindowNode(STlvDecoder* pDecoder, void* pObj) { + SEventWinodwPhysiNode* pNode = (SEventWinodwPhysiNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + STlv* pTlv = NULL; + tlvForEach(pDecoder, pTlv, code) { + switch (pTlv->type) { + case PHY_EVENT_CODE_WINDOW: + code = tlvDecodeObjFromTlv(pTlv, msgToPhysiWindowNode, &pNode->window); + break; + case PHY_EVENT_CODE_START_COND: + code = msgToNodeFromTlv(pTlv, (void**)&pNode->pStartCond); + break; + case PHY_EVENT_CODE_END_COND: + code = msgToNodeFromTlv(pTlv, (void**)&pNode->pEndCond); + break; + default: + break; + } + } + + return code; +} + enum { PHY_PARTITION_CODE_BASE_NODE = 1, PHY_PARTITION_CODE_EXPR, PHY_PARTITION_CODE_KEYS, PHY_PARTITION_CODE_TARGETS }; static int32_t physiPartitionNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { @@ -3691,6 +3738,10 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: code = physiStateWindowNodeToMsg(pObj, pEncoder); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + code = physiEventWindowNodeToMsg(pObj, pEncoder); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = physiPartitionNodeToMsg(pObj, pEncoder); break; @@ -3830,6 +3881,10 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: code = msgToPhysiStateWindowNode(pDecoder, pObj); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + code = msgToPhysiEventWindowNode(pDecoder, pObj); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = msgToPhysiPartitionNode(pDecoder, pObj); break; diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index 106812d55f..ce575ede8a 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -165,6 +165,17 @@ static EDealRes dispatchExpr(SNode* pNode, ETraversalOrder order, FNodeWalker wa } break; } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + res = walkExpr(pEvent->pCol, order, walker, pContext); + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = walkExpr(pEvent->pStartCond, order, walker, pContext); + } + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = walkExpr(pEvent->pEndCond, order, walker, pContext); + } + break; + } default: break; } @@ -329,6 +340,17 @@ static EDealRes rewriteExpr(SNode** pRawNode, ETraversalOrder order, FNodeRewrit } break; } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + res = rewriteExpr(&pEvent->pCol, order, rewriter, pContext); + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = rewriteExpr(&pEvent->pStartCond, order, rewriter, pContext); + } + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = rewriteExpr(&pEvent->pEndCond, order, rewriter, pContext); + } + break; + } default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index de51e9d9f3..7980c58dcf 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -299,6 +299,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SWhenThenNode)); case QUERY_NODE_CASE_WHEN: return makeNode(type, sizeof(SCaseWhenNode)); + case QUERY_NODE_EVENT_WINDOW: + return makeNode(type, sizeof(SEventWindowNode)); case QUERY_NODE_SET_OPERATOR: return makeNode(type, sizeof(SSetOperator)); case QUERY_NODE_SELECT_STMT: @@ -535,6 +537,10 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SStateWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return makeNode(type, sizeof(SStreamStateWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + return makeNode(type, sizeof(SEventWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return makeNode(type, sizeof(SStreamEventWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return makeNode(type, sizeof(SPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -596,6 +602,13 @@ static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) { nodesDestroyNode(pNode->pTsEnd); } +static void destroyPartitionPhysiNode(SPartitionPhysiNode* pNode) { + destroyPhysiNode((SPhysiNode*)pNode); + nodesDestroyList(pNode->pExprs); + nodesDestroyList(pNode->pPartitionKeys); + nodesDestroyList(pNode->pTargets); +} + static void destroyScanPhysiNode(SScanPhysiNode* pNode) { destroyPhysiNode((SPhysiNode*)pNode); nodesDestroyList(pNode->pScanCols); @@ -733,6 +746,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pOptions->pWatermark); nodesDestroyList(pOptions->pRollupFuncs); nodesDestroyList(pOptions->pSma); + nodesDestroyList(pOptions->pDeleteMark); break; } case QUERY_NODE_INDEX_OPTIONS: { @@ -750,22 +764,30 @@ void nodesDestroyNode(SNode* pNode) { SStreamOptions* pOptions = (SStreamOptions*)pNode; nodesDestroyNode(pOptions->pDelay); nodesDestroyNode(pOptions->pWatermark); + nodesDestroyNode(pOptions->pDeleteMark); break; } case QUERY_NODE_LEFT_VALUE: // no pointer field case QUERY_NODE_COLUMN_REF: // no pointer field break; case QUERY_NODE_WHEN_THEN: { - SWhenThenNode* pStmt = (SWhenThenNode*)pNode; - nodesDestroyNode(pStmt->pWhen); - nodesDestroyNode(pStmt->pThen); + SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode; + nodesDestroyNode(pWhenThen->pWhen); + nodesDestroyNode(pWhenThen->pThen); break; } case QUERY_NODE_CASE_WHEN: { - SCaseWhenNode* pStmt = (SCaseWhenNode*)pNode; - nodesDestroyNode(pStmt->pCase); - nodesDestroyNode(pStmt->pElse); - nodesDestroyList(pStmt->pWhenThenList); + SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)pNode; + nodesDestroyNode(pCaseWhen->pCase); + nodesDestroyNode(pCaseWhen->pElse); + nodesDestroyList(pCaseWhen->pWhenThenList); + break; + } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + nodesDestroyNode(pEvent->pCol); + nodesDestroyNode(pEvent->pStartCond); + nodesDestroyNode(pEvent->pEndCond); break; } case QUERY_NODE_SET_OPERATOR: { @@ -905,6 +927,8 @@ void nodesDestroyNode(SNode* pNode) { SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pNode; nodesDestroyNode((SNode*)pStmt->pOptions); nodesDestroyNode(pStmt->pQuery); + nodesDestroyList(pStmt->pTags); + nodesDestroyNode(pStmt->pSubtable); break; } case QUERY_NODE_DROP_STREAM_STMT: // no pointer field @@ -1020,6 +1044,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pLogicNode->pTagIndexCond); taosArrayDestroyEx(pLogicNode->pSmaIndexes, destroySmaIndex); nodesDestroyList(pLogicNode->pGroupTags); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_JOIN: { @@ -1092,6 +1118,8 @@ void nodesDestroyNode(SNode* pNode) { SPartitionLogicNode* pLogicNode = (SPartitionLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); nodesDestroyList(pLogicNode->pPartitionKeys); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: { @@ -1122,10 +1150,10 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: - case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: destroyScanPhysiNode((SScanPhysiNode*)pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: { + case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: { SLastRowScanPhysiNode* pPhyNode = (SLastRowScanPhysiNode*)pNode; destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pGroupTags); @@ -1139,6 +1167,8 @@ void nodesDestroyNode(SNode* pNode) { destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pDynamicScanFuncs); nodesDestroyList(pPhyNode->pGroupTags); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_PROJECT: { @@ -1215,13 +1245,23 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pStateKey); break; } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: { + SEventWinodwPhysiNode* pPhyNode = (SEventWinodwPhysiNode*)pNode; + destroyWinodwPhysiNode((SWinodwPhysiNode*)pPhyNode); + nodesDestroyNode(pPhyNode->pStartCond); + nodesDestroyNode(pPhyNode->pEndCond); + break; + } + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); + break; + } case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: { - SPartitionPhysiNode* pPhyNode = (SPartitionPhysiNode*)pNode; - destroyPhysiNode((SPhysiNode*)pPhyNode); - nodesDestroyList(pPhyNode->pExprs); - nodesDestroyList(pPhyNode->pPartitionKeys); - nodesDestroyList(pPhyNode->pTargets); + SStreamPartitionPhysiNode* pPhyNode = (SStreamPartitionPhysiNode*)pNode; + destroyPartitionPhysiNode((SPartitionPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: { diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index a6c56f3ae4..c74ec9c147 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -72,7 +72,8 @@ typedef enum ETableOptionType { TABLE_OPTION_WATERMARK, TABLE_OPTION_ROLLUP, TABLE_OPTION_TTL, - TABLE_OPTION_SMA + TABLE_OPTION_SMA, + TABLE_OPTION_DELETE_MARK } ETableOptionType; typedef struct SAlterOption { @@ -115,6 +116,7 @@ SNode* createLimitNode(SAstCreateContext* pCxt, const SToken* pLimit, const STok SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order, ENullOrder nullOrder); SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap); SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr); +SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond); SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill); SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 6521161244..343dd855e6 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -232,7 +232,7 @@ alter_db_option(A) ::= KEEP integer_list(B). alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; } alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; } alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } -alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } +//alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; } @@ -362,6 +362,7 @@ table_options(A) ::= table_options(B) WATERMARK duration_list(C). table_options(A) ::= table_options(B) ROLLUP NK_LP rollup_func_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); } table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); } table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); } +table_options(A) ::= table_options(B) DELETE_MARK duration_list(C). { A = setTableOption(pCxt, B, TABLE_OPTION_DELETE_MARK, C); } alter_table_options(A) ::= alter_table_option(B). { A = createAlterTableOptions(pCxt); A = setTableOption(pCxt, A, B.type, &B.val); } alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). { A = setTableOption(pCxt, B, C.type, &C.val); } @@ -475,8 +476,9 @@ func_list(A) ::= func_list(B) NK_COMMA func(C). func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } sma_stream_opt(A) ::= . { A = createStreamOptions(pCxt); } -sma_stream_opt(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } -sma_stream_opt(A) ::= stream_options(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) DELETE_MARK duration_literal(C). { ((SStreamOptions*)B)->pDeleteMark = releaseRawExprNode(pCxt, C); A = B; } /************************************************ create/drop topic ***************************************************/ cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS query_or_subquery(C). { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, A, &B, C); } @@ -962,6 +964,8 @@ twindow_clause_opt(A) ::= twindow_clause_opt(A) ::= INTERVAL NK_LP duration_literal(B) NK_COMMA duration_literal(C) NK_RP sliding_opt(D) fill_opt(E). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C), D, E); } +twindow_clause_opt(A) ::= + EVENT_WINDOW START WITH search_condition(B) END WITH search_condition(C). { A = createEventWindowNode(pCxt, B, C); } sliding_opt(A) ::= . { A = NULL; } sliding_opt(A) ::= SLIDING NK_LP duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 40fb422c49..446f758ed7 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -605,6 +605,20 @@ SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr) { return (SNode*)state; } +SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond) { + CHECK_PARSER_STATUS(pCxt); + SEventWindowNode* pEvent = (SEventWindowNode*)nodesMakeNode(QUERY_NODE_EVENT_WINDOW); + CHECK_OUT_OF_MEM(pEvent); + pEvent->pCol = createPrimaryKeyCol(pCxt, NULL); + if (NULL == pEvent->pCol) { + nodesDestroyNode((SNode*)pEvent); + CHECK_OUT_OF_MEM(NULL); + } + pEvent->pStartCond = pStartCond; + pEvent->pEndCond = pEndCond; + return (SNode*)pEvent; +} + SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill) { CHECK_PARSER_STATUS(pCxt); @@ -1124,6 +1138,9 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType case TABLE_OPTION_SMA: ((STableOptions*)pOptions)->pSma = pVal; break; + case TABLE_OPTION_DELETE_MARK: + ((STableOptions*)pOptions)->pDeleteMark = pVal; + break; default: break; } diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index df7a3953f2..36420599b3 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -44,6 +44,7 @@ typedef struct SInsertParseContext { SParsedDataColInfo tags; // for stmt bool missCache; bool usingDuplicateTable; + bool forceUpdate; } SInsertParseContext; typedef int32_t (*_row_append_fn_t)(SMsgBuf* pMsgBuf, const void* value, int32_t len, void* param); @@ -562,7 +563,8 @@ static int32_t parseTagValue(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt static void buildCreateTbReq(SVnodeModifOpStmt* pStmt, STag* pTag, SArray* pTagName) { insBuildCreateTbReq(&pStmt->createTblReq, pStmt->targetTableName.tname, pTag, pStmt->pTableMeta->suid, - pStmt->usingTableName.tname, pTagName, pStmt->pTableMeta->tableInfo.numOfTags, TSDB_DEFAULT_TABLE_TTL); + pStmt->usingTableName.tname, pTagName, pStmt->pTableMeta->tableInfo.numOfTags, + TSDB_DEFAULT_TABLE_TTL); } static int32_t checkAndTrimValue(SToken* pToken, char* tmpTokenBuf, SMsgBuf* pMsgBuf) { @@ -828,14 +830,69 @@ static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, boo return code; } +static int32_t getTableMetaAndVgroupImpl(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool* pMissCache) { + SVgroupInfo vg; + int32_t code = catalogGetCachedTableVgMeta(pCxt->pCatalog, &pStmt->targetTableName, &vg, &pStmt->pTableMeta); + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStmt->pTableMeta) { + code = taosHashPut(pStmt->pVgroupsHashObj, (const char*)&vg.vgId, sizeof(vg.vgId), (char*)&vg, sizeof(vg)); + } + *pMissCache = (NULL == pStmt->pTableMeta); + } + return code; +} + +static int32_t getTableMetaAndVgroup(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool* pMissCache) { + SParseContext* pComCxt = pCxt->pComCxt; + int32_t code = TSDB_CODE_SUCCESS; + if (pComCxt->async) { + code = getTableMetaAndVgroupImpl(pComCxt, pStmt, pMissCache); + } else { + code = getTableMeta(pCxt, &pStmt->targetTableName, false, &pStmt->pTableMeta, pMissCache); + if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { + code = getTableVgroup(pCxt->pComCxt, pStmt, false, &pCxt->missCache); + } + } + return code; +} + +static int32_t collectUseTable(const SName* pName, SHashObj* pTable) { + char fullName[TSDB_TABLE_FNAME_LEN]; + tNameExtractFullName(pName, fullName); + return taosHashPut(pTable, fullName, strlen(fullName), pName, sizeof(SName)); +} + +static int32_t collectUseDatabase(const SName* pName, SHashObj* pDbs) { + char dbFName[TSDB_DB_FNAME_LEN] = {0}; + tNameGetFullDbName(pName, dbFName); + return taosHashPut(pDbs, dbFName, strlen(dbFName), dbFName, sizeof(dbFName)); +} + static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { + if (pCxt->forceUpdate) { + pCxt->missCache = true; + return TSDB_CODE_SUCCESS; + } + int32_t code = checkAuth(pCxt->pComCxt, &pStmt->targetTableName, &pCxt->missCache); +#if 0 if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableMeta(pCxt, &pStmt->targetTableName, false, &pStmt->pTableMeta, &pCxt->missCache); } if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableVgroup(pCxt->pComCxt, pStmt, false, &pCxt->missCache); } +#else + if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { + code = getTableMetaAndVgroup(pCxt, pStmt, &pCxt->missCache); + } +#endif + if (TSDB_CODE_SUCCESS == code && !pCxt->pComCxt->async) { + code = collectUseDatabase(&pStmt->targetTableName, pStmt->pDbFNameHashObj); + if (TSDB_CODE_SUCCESS == code) { + code = collectUseTable(&pStmt->targetTableName, pStmt->pTableNameHashObj); + } + } return code; } @@ -844,6 +901,11 @@ static int32_t preParseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpSt } static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { + if (pCxt->forceUpdate) { + pCxt->missCache = true; + return TSDB_CODE_SUCCESS; + } + int32_t code = checkAuth(pCxt->pComCxt, &pStmt->targetTableName, &pCxt->missCache); if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableMeta(pCxt, &pStmt->usingTableName, true, &pStmt->pTableMeta, &pCxt->missCache); @@ -851,6 +913,12 @@ static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableVgroup(pCxt->pComCxt, pStmt, true, &pCxt->missCache); } + if (TSDB_CODE_SUCCESS == code && !pCxt->pComCxt->async) { + code = collectUseDatabase(&pStmt->usingTableName, pStmt->pDbFNameHashObj); + if (TSDB_CODE_SUCCESS == code) { + code = collectUseTable(&pStmt->usingTableName, pStmt->pTableNameHashObj); + } + } return code; } @@ -922,11 +990,10 @@ static int32_t getTableDataBlocks(SInsertParseContext* pCxt, SVnodeModifOpStmt* if (pStmt->usingTableProcessing) { pStmt->pTableMeta->uid = 0; } - - return insGetDataBlockFromList(pStmt->pTableBlockHashObj, &uid, sizeof(pStmt->pTableMeta->uid), - TSDB_DEFAULT_PAYLOAD_SIZE, sizeof(SSubmitBlk), - getTableInfo(pStmt->pTableMeta).rowSize, pStmt->pTableMeta, pDataBuf, NULL, - &pStmt->createTblReq); + + return insGetDataBlockFromList( + pStmt->pTableBlockHashObj, &uid, sizeof(pStmt->pTableMeta->uid), TSDB_DEFAULT_PAYLOAD_SIZE, sizeof(SSubmitBlk), + getTableInfo(pStmt->pTableMeta).rowSize, pStmt->pTableMeta, pDataBuf, NULL, &pStmt->createTblReq); } char tbFName[TSDB_TABLE_FNAME_LEN]; tNameExtractFullName(&pStmt->targetTableName, tbFName); @@ -1529,8 +1596,9 @@ static int32_t setStmtInfo(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) memcpy(tags, &pCxt->tags, sizeof(pCxt->tags)); SStmtCallback* pStmtCb = pCxt->pComCxt->pStmtCb; - int32_t code = (*pStmtCb->setInfoFn)(pStmtCb->pStmt, pStmt->pTableMeta, tags, &pStmt->targetTableName, pStmt->usingTableProcessing, - pStmt->pVgroupsHashObj, pStmt->pTableBlockHashObj, pStmt->usingTableName.tname); + int32_t code = (*pStmtCb->setInfoFn)(pStmtCb->pStmt, pStmt->pTableMeta, tags, &pStmt->targetTableName, + pStmt->usingTableProcessing, pStmt->pVgroupsHashObj, pStmt->pTableBlockHashObj, + pStmt->usingTableName.tname); memset(&pCxt->tags, 0, sizeof(pCxt->tags)); pStmt->pVgroupsHashObj = NULL; @@ -1765,16 +1833,25 @@ static int32_t initInsertQuery(SInsertParseContext* pCxt, SCatalogReq* pCatalogR static int32_t setRefreshMate(SQuery* pQuery) { SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; - SName* pTable = taosHashIterate(pStmt->pTableNameHashObj, NULL); - while (NULL != pTable) { - taosArrayPush(pQuery->pTableList, pTable); - pTable = taosHashIterate(pStmt->pTableNameHashObj, pTable); + + if (taosHashGetSize(pStmt->pTableNameHashObj) > 0) { + taosArrayDestroy(pQuery->pTableList); + pQuery->pTableList = taosArrayInit(taosHashGetSize(pStmt->pTableNameHashObj), sizeof(SName)); + SName* pTable = taosHashIterate(pStmt->pTableNameHashObj, NULL); + while (NULL != pTable) { + taosArrayPush(pQuery->pTableList, pTable); + pTable = taosHashIterate(pStmt->pTableNameHashObj, pTable); + } } - char* pDb = taosHashIterate(pStmt->pDbFNameHashObj, NULL); - while (NULL != pDb) { - taosArrayPush(pQuery->pDbList, pDb); - pDb = taosHashIterate(pStmt->pDbFNameHashObj, pDb); + if (taosHashGetSize(pStmt->pDbFNameHashObj) > 0) { + taosArrayDestroy(pQuery->pDbList); + pQuery->pDbList = taosArrayInit(taosHashGetSize(pStmt->pDbFNameHashObj), TSDB_DB_FNAME_LEN); + char* pDb = taosHashIterate(pStmt->pDbFNameHashObj, NULL); + while (NULL != pDb) { + taosArrayPush(pQuery->pDbList, pDb); + pDb = taosHashIterate(pStmt->pDbFNameHashObj, pDb); + } } return TSDB_CODE_SUCCESS; @@ -1888,28 +1965,28 @@ static int32_t buildInsertCatalogReq(SInsertParseContext* pCxt, SVnodeModifOpStm } static int32_t setNextStageInfo(SInsertParseContext* pCxt, SQuery* pQuery, SCatalogReq* pCatalogReq) { + SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; if (pCxt->missCache) { - parserDebug("0x%" PRIx64 " %d rows have been inserted before cache miss", pCxt->pComCxt->requestId, - ((SVnodeModifOpStmt*)pQuery->pRoot)->totalRowsNum); + parserDebug("0x%" PRIx64 " %d rows of %d tables have been inserted before cache miss", pCxt->pComCxt->requestId, + pStmt->totalRowsNum, pStmt->totalTbNum); pQuery->execStage = QUERY_EXEC_STAGE_PARSE; - return buildInsertCatalogReq(pCxt, (SVnodeModifOpStmt*)pQuery->pRoot, pCatalogReq); + return buildInsertCatalogReq(pCxt, pStmt, pCatalogReq); } - parserDebug("0x%" PRIx64 " %d rows have been inserted", pCxt->pComCxt->requestId, - ((SVnodeModifOpStmt*)pQuery->pRoot)->totalRowsNum); + parserDebug("0x%" PRIx64 " %d rows of %d tables have been inserted", pCxt->pComCxt->requestId, pStmt->totalRowsNum, + pStmt->totalTbNum); pQuery->execStage = QUERY_EXEC_STAGE_SCHEDULE; return TSDB_CODE_SUCCESS; } int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatalogReq, const SMetaData* pMetaData) { - SInsertParseContext context = { - .pComCxt = pCxt, - .msg = {.buf = pCxt->pMsg, .len = pCxt->msgLen}, - .missCache = false, - .usingDuplicateTable = false, - }; + SInsertParseContext context = {.pComCxt = pCxt, + .msg = {.buf = pCxt->pMsg, .len = pCxt->msgLen}, + .missCache = false, + .usingDuplicateTable = false, + .forceUpdate = (NULL != pCatalogReq ? pCatalogReq->forceUpdate : false)}; int32_t code = initInsertQuery(&context, pCatalogReq, pMetaData, pQuery); if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 7123173161..1f9e4e9ab1 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -74,6 +74,7 @@ static SKeyword keywordTable[] = { {"DATABASES", TK_DATABASES}, {"DBS", TK_DBS}, {"DELETE", TK_DELETE}, + {"DELETE_MARK", TK_DELETE_MARK}, {"DESC", TK_DESC}, {"DESCRIBE", TK_DESCRIBE}, {"DISTINCT", TK_DISTINCT}, @@ -89,6 +90,7 @@ static SKeyword keywordTable[] = { {"EXISTS", TK_EXISTS}, {"EXPIRED", TK_EXPIRED}, {"EXPLAIN", TK_EXPLAIN}, + {"EVENT_WINDOW", TK_EVENT_WINDOW}, {"EVERY", TK_EVERY}, {"FILE", TK_FILE}, {"FILL", TK_FILL}, @@ -194,15 +196,16 @@ static SKeyword keywordTable[] = { {"SNODES", TK_SNODES}, {"SOFFSET", TK_SOFFSET}, {"SPLIT", TK_SPLIT}, - {"STT_TRIGGER", TK_STT_TRIGGER}, {"STABLE", TK_STABLE}, {"STABLES", TK_STABLES}, + {"START", TK_START}, {"STATE", TK_STATE}, {"STATE_WINDOW", TK_STATE_WINDOW}, {"STORAGE", TK_STORAGE}, {"STREAM", TK_STREAM}, {"STREAMS", TK_STREAMS}, {"STRICT", TK_STRICT}, + {"STT_TRIGGER", TK_STT_TRIGGER}, {"SUBSCRIBE", TK_SUBSCRIBE}, {"SUBSCRIPTIONS", TK_SUBSCRIPTIONS}, {"SUBTABLE", TK_SUBTABLE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 049d18e20a..d805c76d77 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3143,6 +3143,15 @@ static int32_t translateSessionWindow(STranslateContext* pCxt, SSelectStmt* pSel return TSDB_CODE_SUCCESS; } +static int32_t translateEventWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { + if (QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && + !isGlobalTimeLineQuery(((STempTableNode*)pSelect->pFromTable)->pSubquery)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TIMELINE_QUERY, + "EVENT_WINDOW requires valid time series input"); + } + return TSDB_CODE_SUCCESS; +} + static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { switch (nodeType(pSelect->pWindow)) { case QUERY_NODE_STATE_WINDOW: @@ -3151,6 +3160,8 @@ static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSe return translateSessionWindow(pCxt, pSelect); case QUERY_NODE_INTERVAL_WINDOW: return translateIntervalWindow(pCxt, pSelect); + case QUERY_NODE_EVENT_WINDOW: + return translateEventWindow(pCxt, pSelect); default: break; } @@ -3804,10 +3815,11 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } -static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int64_t val, int64_t minVal, + int64_t maxVal) { if (val >= 0 && (val < minVal || val > maxVal)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, "Invalid option %s: %d valid range: [%d, %d]", pName, val, + return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, + "Invalid option %s: %" PRId64 " valid range: [%" PRId64 ", %" PRId64 "]", pName, val, minVal, maxVal); } return TSDB_CODE_SUCCESS; @@ -3818,8 +3830,8 @@ static int32_t checkDbRangeOption(STranslateContext* pCxt, const char* pName, in return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal); } -static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int64_t val, int64_t minVal, + int64_t maxVal) { return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal); } @@ -3878,12 +3890,17 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt pOptions->keep[2] = getBigintFromValueNode((SValueNode*)nodesListGetNode(pOptions->pKeep, 2)); } + int64_t tsdbMaxKeep = TSDB_MAX_KEEP; + if (pOptions->precision == TSDB_TIME_PRECISION_NANO) { + tsdbMaxKeep = TSDB_MAX_KEEP_NS; + } + if (pOptions->keep[0] < TSDB_MIN_KEEP || pOptions->keep[1] < TSDB_MIN_KEEP || pOptions->keep[2] < TSDB_MIN_KEEP || - pOptions->keep[0] > TSDB_MAX_KEEP || pOptions->keep[1] > TSDB_MAX_KEEP || pOptions->keep[2] > TSDB_MAX_KEEP) { + pOptions->keep[0] > tsdbMaxKeep || pOptions->keep[1] > tsdbMaxKeep || pOptions->keep[2] > tsdbMaxKeep) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option keep: %" PRId64 ", %" PRId64 ", %" PRId64 " valid range: [%dm, %dm]", pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, - TSDB_MAX_KEEP); + tsdbMaxKeep); } if (!((pOptions->keep[0] <= pOptions->keep[1]) && (pOptions->keep[1] <= pOptions->keep[2]))) { @@ -4035,7 +4052,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName TSDB_MAX_MINROWS_FBLOCK); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbKeepOption(pCxt, pOptions); + code = checkDbPrecisionOption(pCxt, pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = checkDbKeepOption(pCxt, pOptions); // use precision } if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "pages", pOptions->pages, TSDB_MIN_PAGES_PER_VNODE, TSDB_MAX_PAGES_PER_VNODE); @@ -4048,9 +4068,6 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName code = checkDbRangeOption(pCxt, "tsdbPagesize", pOptions->tsdbPageSize, TSDB_MIN_TSDB_PAGESIZE, TSDB_MAX_TSDB_PAGESIZE); } - if (TSDB_CODE_SUCCESS == code) { - code = checkDbPrecisionOption(pCxt, pOptions); - } if (TSDB_CODE_SUCCESS == code) { code = checkDbEnumOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); } @@ -4463,6 +4480,37 @@ static int32_t checkTableWatermarkOption(STranslateContext* pCxt, STableOptions* return code; } +static int32_t getTableDeleteMarkOption(STranslateContext* pCxt, SValueNode* pVal, int64_t* pMaxDelay) { + return getTableDelayOrWatermarkOption(pCxt, "delete_mark", TSDB_MIN_ROLLUP_DELETE_MARK, TSDB_MAX_ROLLUP_DELETE_MARK, + pVal, pMaxDelay); +} + +static int32_t checkTableDeleteMarkOption(STranslateContext* pCxt, STableOptions* pOptions, bool createStable, + SDbCfgInfo* pDbCfg) { + if (NULL == pOptions->pDeleteMark) { + return TSDB_CODE_SUCCESS; + } + + if (!createStable || NULL == pDbCfg->pRetensions) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, + "Invalid option delete_mark: Only supported for create super table in databases " + "configured with the 'RETENTIONS' option"); + } + + if (LIST_LENGTH(pOptions->pDeleteMark) > 2) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, "Invalid option delete_mark"); + } + + int32_t code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 0), &pOptions->deleteMark1); + if (TSDB_CODE_SUCCESS == code && 2 == LIST_LENGTH(pOptions->pDeleteMark)) { + code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 1), &pOptions->deleteMark2); + } + + return code; +} + static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt, bool createStable) { if (NULL != strchr(pStmt->tableName, '.')) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, @@ -4482,6 +4530,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt if (TSDB_CODE_SUCCESS == code) { code = checkTableWatermarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); } + if (TSDB_CODE_SUCCESS == code) { + code = checkTableDeleteMarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); + } if (TSDB_CODE_SUCCESS == code) { code = checkTableRollupOption(pCxt, pStmt->pOptions->pRollupFuncs, createStable, &dbCfg); } @@ -4749,6 +4800,8 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm pReq->delay2 = pStmt->pOptions->maxDelay2; pReq->watermark1 = pStmt->pOptions->watermark1; pReq->watermark2 = pStmt->pOptions->watermark2; + pReq->deleteMark1 = pStmt->pOptions->deleteMark1; + pReq->deleteMark2 = pStmt->pOptions->deleteMark2; pReq->colVer = 1; pReq->tagVer = 1; pReq->source = TD_REQ_FROM_APP; @@ -5144,20 +5197,34 @@ static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStm (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->datum.i : pReq->interval); pReq->slidingUnit = (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->unit : pReq->intervalUnit); + + int32_t code = TSDB_CODE_SUCCESS; if (NULL != pStmt->pOptions->pStreamOptions) { SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - pReq->maxDelay = (NULL != pStreamOpt->pDelay ? ((SValueNode*)pStreamOpt->pDelay)->datum.i : -1); - pReq->watermark = (NULL != pStreamOpt->pWatermark ? ((SValueNode*)pStreamOpt->pWatermark)->datum.i - : TSDB_DEFAULT_ROLLUP_WATERMARK); - if (pReq->watermark < TSDB_MIN_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MIN_ROLLUP_WATERMARK; + if (NULL != pStreamOpt->pDelay) { + code = getTableMaxDelayOption(pCxt, (SValueNode*)pStreamOpt->pDelay, &pReq->maxDelay); + } else { + pReq->maxDelay = -1; } - if (pReq->watermark > TSDB_MAX_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MAX_ROLLUP_WATERMARK; + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pWatermark) { + code = getTableWatermarkOption(pCxt, (SValueNode*)pStreamOpt->pWatermark, &pReq->watermark); + } else { + pReq->watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + } + } + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pDeleteMark) { + code = getTableDeleteMarkOption(pCxt, (SValueNode*)pStreamOpt->pDeleteMark, &pReq->deleteMark); + } else { + pReq->deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + } } } - int32_t code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + if (TSDB_CODE_SUCCESS == code) { + code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + } if (TSDB_CODE_SUCCESS == code) { code = getSmaIndexSql(pCxt, &pReq->sql, &pReq->sqlLen); } @@ -5185,16 +5252,6 @@ static int32_t checkCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pS code = doTranslateValue(pCxt, (SValueNode*)pStmt->pOptions->pSliding); } - if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pOptions->pStreamOptions) { - SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - if (NULL != pStreamOpt->pWatermark) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pWatermark); - } - if (TSDB_CODE_SUCCESS == code && NULL != pStreamOpt->pDelay) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pDelay); - } - } - return code; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 616793e897..c9dec76a0a 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 456 +#define YYNOCODE 459 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOrder yy50; - int64_t yy93; - SNode* yy104; - bool yy185; - int32_t yy196; - EJoinType yy228; - EFillMode yy246; - SAlterOption yy557; - SNodeList* yy616; - SDataType yy640; - EOperatorType yy668; - int8_t yy695; - SToken yy737; - ENullOrder yy793; + EOperatorType yy20; + SNode* yy74; + ENullOrder yy109; + SToken yy317; + EOrder yy326; + bool yy335; + int8_t yy449; + int64_t yy531; + EJoinType yy630; + SAlterOption yy767; + EFillMode yy828; + int32_t yy856; + SNodeList* yy874; + SDataType yy898; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 707 -#define YYNRULE 538 -#define YYNTOKEN 321 -#define YY_MAX_SHIFT 706 -#define YY_MIN_SHIFTREDUCE 1049 -#define YY_MAX_SHIFTREDUCE 1586 -#define YY_ERROR_ACTION 1587 -#define YY_ACCEPT_ACTION 1588 -#define YY_NO_ACTION 1589 -#define YY_MIN_REDUCE 1590 -#define YY_MAX_REDUCE 2127 +#define YYNSTATE 715 +#define YYNRULE 540 +#define YYNTOKEN 324 +#define YY_MAX_SHIFT 714 +#define YY_MIN_SHIFTREDUCE 1057 +#define YY_MAX_SHIFTREDUCE 1596 +#define YY_ERROR_ACTION 1597 +#define YY_ACCEPT_ACTION 1598 +#define YY_NO_ACTION 1599 +#define YY_MIN_REDUCE 1600 +#define YY_MAX_REDUCE 2139 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,703 +216,714 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2544) +#define YY_ACTTAB_COUNT (2586) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 396, 2103, 349, 1858, 455, 2098, 456, 1626, 33, 274, - /* 10 */ 156, 578, 43, 41, 1517, 464, 168, 456, 1626, 1747, - /* 20 */ 357, 2102, 1368, 36, 35, 2099, 2101, 42, 40, 39, - /* 30 */ 38, 37, 595, 1447, 158, 1366, 1943, 329, 1844, 1698, - /* 40 */ 524, 540, 36, 35, 579, 2098, 42, 40, 39, 38, - /* 50 */ 37, 1394, 540, 522, 348, 520, 2098, 1855, 1442, 25, - /* 60 */ 2104, 174, 370, 16, 156, 2099, 561, 1961, 1791, 1792, - /* 70 */ 1374, 2104, 174, 1748, 2103, 575, 2099, 561, 2098, 572, - /* 80 */ 1912, 595, 612, 43, 41, 42, 40, 39, 38, 37, - /* 90 */ 159, 357, 1602, 1368, 2102, 1797, 12, 322, 2099, 2100, - /* 100 */ 11, 10, 350, 540, 1447, 1942, 1366, 2098, 62, 1977, - /* 110 */ 131, 1795, 100, 1944, 616, 1946, 1947, 611, 703, 606, - /* 120 */ 258, 603, 2104, 174, 171, 212, 2030, 2099, 561, 1442, - /* 130 */ 351, 2026, 1449, 1450, 16, 39, 38, 37, 473, 1476, - /* 140 */ 163, 1374, 2045, 402, 176, 1930, 490, 486, 482, 478, - /* 150 */ 209, 362, 2056, 80, 1790, 1792, 1926, 46, 58, 1797, - /* 160 */ 85, 1423, 1432, 1252, 1253, 1797, 326, 12, 2042, 255, - /* 170 */ 2038, 571, 361, 124, 570, 1795, 1741, 2098, 1393, 226, - /* 180 */ 1369, 1795, 1367, 317, 1922, 1928, 340, 81, 555, 703, - /* 190 */ 207, 1840, 559, 174, 1477, 606, 1490, 2099, 561, 1613, - /* 200 */ 58, 461, 182, 1449, 1450, 1372, 1373, 457, 1422, 1425, - /* 210 */ 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, - /* 220 */ 1443, 1444, 1445, 1446, 1448, 1451, 2, 510, 509, 508, - /* 230 */ 560, 595, 1423, 1432, 2098, 128, 504, 1395, 82, 319, - /* 240 */ 503, 502, 585, 1912, 583, 1588, 501, 507, 1514, 559, - /* 250 */ 174, 1369, 500, 1367, 2099, 561, 206, 200, 1612, 205, - /* 260 */ 438, 550, 469, 1468, 1543, 32, 355, 1471, 1472, 1473, - /* 270 */ 1474, 1475, 1479, 1480, 1481, 1482, 1372, 1373, 198, 1422, - /* 280 */ 1425, 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, - /* 290 */ 1441, 1443, 1444, 1445, 1446, 1448, 1451, 2, 170, 9, - /* 300 */ 43, 41, 1912, 506, 505, 177, 177, 46, 357, 372, - /* 310 */ 1368, 1784, 547, 1541, 1542, 1544, 1545, 190, 189, 1305, - /* 320 */ 1306, 1447, 1943, 1366, 1210, 638, 637, 636, 1214, 635, - /* 330 */ 1216, 1217, 634, 1219, 631, 1393, 1225, 628, 1227, 1228, - /* 340 */ 625, 622, 391, 97, 556, 551, 1442, 1101, 177, 1100, - /* 350 */ 540, 16, 454, 1961, 2098, 459, 1632, 132, 1374, 674, - /* 360 */ 672, 613, 211, 393, 389, 1737, 1912, 567, 612, 2104, - /* 370 */ 174, 43, 41, 1452, 2099, 561, 29, 1961, 1102, 357, - /* 380 */ 257, 1368, 36, 35, 12, 554, 42, 40, 39, 38, - /* 390 */ 37, 1942, 1447, 463, 1366, 1977, 459, 1632, 160, 1944, - /* 400 */ 616, 1946, 1947, 611, 596, 606, 703, 1943, 36, 35, - /* 410 */ 2045, 58, 42, 40, 39, 38, 37, 1442, 123, 264, - /* 420 */ 1449, 1450, 647, 50, 553, 494, 36, 35, 539, 1374, - /* 430 */ 42, 40, 39, 38, 37, 1745, 2041, 1170, 1961, 541, - /* 440 */ 2067, 147, 146, 644, 643, 642, 613, 91, 579, 1423, - /* 450 */ 1432, 1912, 58, 612, 560, 44, 2050, 1510, 2098, 36, - /* 460 */ 35, 1856, 1394, 42, 40, 39, 38, 37, 1369, 1738, - /* 470 */ 1367, 1396, 1172, 559, 174, 1611, 1942, 703, 2099, 561, - /* 480 */ 1977, 1345, 1346, 161, 1944, 616, 1946, 1947, 611, 1513, - /* 490 */ 606, 1449, 1450, 1372, 1373, 47, 1422, 1425, 1426, 1427, - /* 500 */ 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, 1444, - /* 510 */ 1445, 1446, 1448, 1451, 2, 1553, 1082, 1610, 1609, 1912, - /* 520 */ 1423, 1432, 1591, 113, 1087, 1088, 112, 111, 110, 109, - /* 530 */ 108, 107, 106, 105, 104, 562, 2119, 265, 266, 1369, - /* 540 */ 9, 1367, 7, 113, 1722, 1608, 112, 111, 110, 109, - /* 550 */ 108, 107, 106, 105, 104, 1084, 1393, 1087, 1088, 177, - /* 560 */ 649, 1912, 1912, 155, 1372, 1373, 1478, 1422, 1425, 1426, - /* 570 */ 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, - /* 580 */ 1444, 1445, 1446, 1448, 1451, 2, 43, 41, 568, 1912, - /* 590 */ 706, 515, 1392, 1101, 357, 1100, 1368, 1840, 319, 596, - /* 600 */ 177, 585, 596, 583, 281, 1521, 525, 1447, 184, 1366, - /* 610 */ 1943, 1393, 58, 52, 235, 641, 123, 596, 1607, 167, - /* 620 */ 225, 9, 572, 499, 1102, 696, 692, 688, 684, 279, - /* 630 */ 1745, 179, 1442, 1745, 360, 518, 80, 30, 168, 1374, - /* 640 */ 512, 1961, 156, 177, 1374, 224, 661, 1483, 1745, 613, - /* 650 */ 127, 1747, 647, 131, 1912, 1659, 612, 43, 41, 1740, - /* 660 */ 1845, 1723, 1912, 596, 1606, 357, 98, 1368, 1721, 272, - /* 670 */ 44, 147, 146, 644, 643, 642, 1734, 400, 1447, 1942, - /* 680 */ 1366, 1605, 64, 1977, 1730, 63, 100, 1944, 616, 1946, - /* 690 */ 1947, 611, 703, 606, 1745, 395, 134, 394, 143, 2001, - /* 700 */ 2030, 363, 592, 1442, 351, 2026, 1449, 1450, 1912, 156, - /* 710 */ 535, 574, 172, 2038, 2039, 1374, 129, 2043, 1747, 1732, - /* 720 */ 510, 509, 508, 473, 186, 1912, 1457, 572, 128, 504, - /* 730 */ 649, 1604, 1393, 503, 502, 1423, 1432, 1601, 260, 501, - /* 740 */ 507, 12, 1590, 36, 35, 500, 1396, 42, 40, 39, - /* 750 */ 38, 37, 1424, 1396, 1369, 1339, 1367, 229, 131, 227, - /* 760 */ 177, 77, 1775, 703, 76, 1736, 122, 121, 120, 119, - /* 770 */ 118, 117, 116, 115, 114, 1912, 1926, 1449, 1450, 1372, - /* 780 */ 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, 1431, - /* 790 */ 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, 1451, - /* 800 */ 2, 316, 498, 1391, 1922, 1928, 1423, 1432, 1600, 1840, - /* 810 */ 432, 2045, 598, 445, 2002, 606, 444, 173, 2038, 2039, - /* 820 */ 188, 129, 2043, 1797, 497, 1369, 1656, 1367, 1599, 1899, - /* 830 */ 1598, 416, 1533, 446, 31, 133, 418, 2040, 2001, 1796, - /* 840 */ 36, 35, 1597, 1596, 42, 40, 39, 38, 37, 1728, - /* 850 */ 1372, 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, - /* 860 */ 1431, 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, - /* 870 */ 1451, 2, 1912, 1424, 1912, 36, 35, 379, 330, 42, - /* 880 */ 40, 39, 38, 37, 1393, 645, 1912, 1912, 1788, 183, - /* 890 */ 406, 680, 679, 678, 677, 367, 234, 676, 675, 135, - /* 900 */ 670, 669, 668, 667, 666, 665, 664, 663, 149, 659, - /* 910 */ 658, 657, 366, 365, 654, 653, 652, 651, 650, 442, - /* 920 */ 1595, 1943, 437, 436, 435, 434, 431, 430, 429, 428, - /* 930 */ 427, 423, 422, 421, 420, 331, 413, 412, 411, 2102, - /* 940 */ 408, 407, 328, 157, 600, 596, 2002, 596, 292, 36, - /* 950 */ 35, 564, 1961, 42, 40, 39, 38, 37, 596, 401, - /* 960 */ 575, 410, 290, 66, 1912, 1912, 65, 612, 1854, 369, - /* 970 */ 312, 2103, 424, 145, 1943, 1594, 1745, 1853, 1745, 312, - /* 980 */ 1593, 596, 11, 10, 194, 451, 449, 1720, 1395, 1745, - /* 990 */ 1942, 572, 596, 646, 1977, 425, 1788, 100, 1944, 616, - /* 1000 */ 1946, 1947, 611, 6, 606, 1961, 139, 1827, 230, 171, - /* 1010 */ 540, 2030, 1745, 613, 2098, 351, 2026, 1699, 1912, 1912, - /* 1020 */ 612, 58, 131, 1745, 1912, 1424, 51, 596, 286, 2104, - /* 1030 */ 174, 1775, 596, 217, 2099, 561, 215, 2057, 1931, 1583, - /* 1040 */ 607, 471, 596, 1942, 233, 219, 472, 1977, 218, 1926, - /* 1050 */ 100, 1944, 616, 1946, 1947, 611, 364, 606, 1745, 99, - /* 1060 */ 596, 1943, 2118, 1745, 2030, 1576, 354, 353, 351, 2026, - /* 1070 */ 662, 640, 1715, 1745, 1742, 1377, 1382, 1922, 1928, 2064, - /* 1080 */ 596, 175, 2038, 2039, 83, 129, 2043, 1447, 606, 1375, - /* 1090 */ 1603, 1745, 1961, 403, 536, 647, 67, 74, 73, 399, - /* 1100 */ 613, 48, 181, 3, 1943, 1912, 404, 612, 137, 2070, - /* 1110 */ 125, 1745, 1442, 548, 147, 146, 644, 643, 642, 1376, - /* 1120 */ 315, 1930, 596, 387, 1374, 385, 381, 377, 374, 371, - /* 1130 */ 1942, 257, 1926, 1582, 1977, 1961, 576, 100, 1944, 616, - /* 1140 */ 1946, 1947, 611, 613, 606, 75, 1646, 96, 1912, 2118, - /* 1150 */ 612, 2030, 252, 1745, 1639, 351, 2026, 93, 419, 210, - /* 1160 */ 1922, 1928, 352, 528, 221, 596, 2092, 220, 511, 177, - /* 1170 */ 565, 606, 602, 1942, 596, 1943, 513, 1977, 60, 269, - /* 1180 */ 100, 1944, 616, 1946, 1947, 611, 596, 606, 591, 596, - /* 1190 */ 1637, 1933, 2118, 246, 2030, 1962, 1745, 563, 351, 2026, - /* 1200 */ 593, 596, 368, 594, 540, 1745, 1961, 1510, 2098, 2049, - /* 1210 */ 1585, 1586, 516, 223, 613, 275, 222, 1745, 1943, 1912, - /* 1220 */ 1745, 612, 1380, 2104, 174, 239, 45, 262, 2099, 561, - /* 1230 */ 140, 1540, 1745, 144, 1383, 145, 1378, 60, 1849, 1627, - /* 1240 */ 1935, 1785, 573, 2060, 1942, 254, 1130, 251, 1977, 1961, - /* 1250 */ 45, 100, 1944, 616, 1946, 1947, 611, 613, 606, 1386, - /* 1260 */ 1388, 1943, 1912, 2005, 612, 2030, 1379, 45, 620, 351, - /* 1270 */ 2026, 604, 1440, 1441, 1443, 1444, 1445, 1446, 241, 1316, - /* 1280 */ 267, 1131, 4, 588, 1633, 1943, 271, 1942, 1203, 655, - /* 1290 */ 1484, 1977, 1961, 144, 100, 1944, 616, 1946, 1947, 611, - /* 1300 */ 613, 606, 1, 1433, 145, 1912, 2003, 612, 2030, 373, - /* 1310 */ 378, 1150, 351, 2026, 656, 327, 1961, 126, 144, 1368, - /* 1320 */ 285, 1231, 282, 1332, 613, 187, 405, 1396, 1850, 1912, - /* 1330 */ 1942, 612, 1366, 698, 1977, 334, 1148, 100, 1944, 616, - /* 1340 */ 1946, 1947, 611, 1943, 606, 409, 1235, 440, 414, 599, - /* 1350 */ 1391, 2030, 426, 1842, 1942, 351, 2026, 1242, 1977, 433, - /* 1360 */ 447, 101, 1944, 616, 1946, 1947, 611, 1374, 606, 439, - /* 1370 */ 1240, 148, 441, 448, 1961, 2030, 191, 450, 452, 2029, - /* 1380 */ 2026, 1397, 613, 453, 462, 1399, 1943, 1912, 465, 612, - /* 1390 */ 197, 199, 466, 1398, 467, 1400, 468, 335, 202, 333, - /* 1400 */ 332, 470, 496, 204, 474, 78, 498, 79, 208, 1104, - /* 1410 */ 491, 492, 1942, 493, 1943, 703, 1977, 1961, 495, 101, - /* 1420 */ 1944, 616, 1946, 1947, 611, 613, 606, 102, 497, 1735, - /* 1430 */ 1912, 318, 612, 2030, 214, 1731, 216, 601, 2026, 527, - /* 1440 */ 150, 151, 529, 1733, 1729, 1961, 152, 153, 228, 530, - /* 1450 */ 1889, 231, 537, 610, 549, 614, 582, 5, 1912, 1977, - /* 1460 */ 612, 2061, 101, 1944, 616, 1946, 1947, 611, 283, 606, - /* 1470 */ 534, 2071, 544, 1943, 2076, 546, 2030, 1369, 237, 1367, - /* 1480 */ 321, 2026, 240, 1942, 531, 2075, 341, 1977, 558, 552, - /* 1490 */ 307, 1944, 616, 1946, 1947, 611, 609, 606, 597, 1995, - /* 1500 */ 545, 543, 1372, 1373, 1961, 542, 250, 569, 342, 566, - /* 1510 */ 2121, 245, 613, 1510, 130, 1395, 2046, 1912, 345, 612, - /* 1520 */ 577, 141, 142, 580, 581, 1888, 1860, 586, 259, 347, - /* 1530 */ 88, 1943, 589, 248, 164, 2052, 249, 247, 1746, 590, - /* 1540 */ 90, 57, 1942, 2011, 92, 1789, 1977, 284, 1716, 101, - /* 1550 */ 1944, 616, 1946, 1947, 611, 2097, 606, 253, 287, 1943, - /* 1560 */ 618, 278, 1961, 2030, 699, 700, 49, 301, 2027, 310, - /* 1570 */ 613, 309, 702, 289, 291, 1912, 1906, 612, 1905, 311, - /* 1580 */ 71, 1904, 1903, 72, 1900, 1943, 375, 376, 1360, 1361, - /* 1590 */ 1961, 180, 1898, 380, 382, 383, 384, 1897, 613, 386, - /* 1600 */ 1942, 1896, 388, 1912, 1977, 612, 1895, 160, 1944, 616, - /* 1610 */ 1946, 1947, 611, 1894, 606, 390, 1961, 1335, 392, 1334, - /* 1620 */ 1871, 1870, 397, 1869, 613, 398, 1868, 1296, 1942, 1912, - /* 1630 */ 1835, 612, 1977, 1834, 1832, 300, 1944, 616, 1946, 1947, - /* 1640 */ 611, 136, 606, 1831, 1830, 1833, 1829, 1828, 1826, 2068, - /* 1650 */ 1825, 1824, 185, 415, 1942, 1943, 1823, 417, 1977, 1822, - /* 1660 */ 1821, 161, 1944, 616, 1946, 1947, 611, 1820, 606, 1819, - /* 1670 */ 1818, 1817, 1816, 1815, 1943, 1298, 1802, 138, 1807, 557, - /* 1680 */ 1814, 1813, 1812, 1811, 1810, 1809, 1961, 1808, 1806, 1805, - /* 1690 */ 1804, 346, 443, 1799, 613, 1803, 1801, 1800, 1798, 1912, - /* 1700 */ 1178, 612, 1661, 1660, 1658, 1961, 1622, 192, 195, 1932, - /* 1710 */ 193, 458, 169, 610, 2120, 1090, 69, 1621, 1912, 1089, - /* 1720 */ 612, 460, 1884, 1878, 1942, 1867, 196, 1866, 1977, 203, - /* 1730 */ 70, 308, 1944, 616, 1946, 1947, 611, 1943, 606, 201, - /* 1740 */ 1852, 1724, 1657, 1942, 1655, 475, 477, 1977, 1653, 479, - /* 1750 */ 307, 1944, 616, 1946, 1947, 611, 476, 606, 1943, 1996, - /* 1760 */ 480, 1651, 1649, 1123, 483, 481, 484, 485, 1961, 487, - /* 1770 */ 489, 1636, 488, 356, 1635, 1618, 613, 1726, 1246, 1245, - /* 1780 */ 1943, 1912, 1725, 612, 59, 1169, 1168, 1167, 1166, 1961, - /* 1790 */ 1165, 671, 1160, 673, 358, 1162, 1647, 613, 1161, 1159, - /* 1800 */ 336, 1943, 1912, 1640, 612, 337, 1942, 1638, 514, 338, - /* 1810 */ 1977, 1961, 213, 308, 1944, 616, 1946, 1947, 611, 613, - /* 1820 */ 606, 517, 1617, 1943, 1912, 519, 612, 1942, 1616, 521, - /* 1830 */ 1615, 1977, 1961, 523, 308, 1944, 616, 1946, 1947, 611, - /* 1840 */ 613, 606, 1352, 103, 1943, 1912, 1883, 612, 24, 526, - /* 1850 */ 1341, 1877, 1865, 1977, 1961, 532, 303, 1944, 616, 1946, - /* 1860 */ 1947, 611, 613, 606, 1863, 17, 2103, 1912, 26, 612, - /* 1870 */ 1942, 56, 14, 1555, 1977, 1961, 53, 293, 1944, 616, - /* 1880 */ 1946, 1947, 611, 613, 606, 232, 238, 1943, 1912, 236, - /* 1890 */ 612, 162, 1942, 533, 154, 339, 1977, 1539, 1532, 294, - /* 1900 */ 1944, 616, 1946, 1947, 611, 538, 606, 244, 242, 27, - /* 1910 */ 243, 28, 1933, 1942, 84, 1943, 61, 1977, 1961, 19, - /* 1920 */ 295, 1944, 616, 1946, 1947, 611, 613, 606, 1575, 1576, - /* 1930 */ 1570, 1912, 1569, 612, 343, 1574, 1573, 344, 1507, 1506, - /* 1940 */ 256, 1943, 18, 165, 1864, 1862, 1961, 55, 1861, 20, - /* 1950 */ 1350, 261, 1537, 263, 613, 1349, 1942, 54, 584, 1912, - /* 1960 */ 1977, 612, 1859, 299, 1944, 616, 1946, 1947, 611, 15, - /* 1970 */ 606, 587, 1961, 268, 86, 1851, 87, 89, 270, 93, - /* 1980 */ 613, 273, 21, 1459, 1942, 1912, 10, 612, 1977, 1384, - /* 1990 */ 1469, 304, 1944, 616, 1946, 1947, 611, 8, 606, 1943, - /* 2000 */ 1458, 1437, 1980, 605, 166, 1435, 34, 178, 1434, 1407, - /* 2010 */ 1942, 615, 13, 22, 1977, 1415, 1943, 296, 1944, 616, - /* 2020 */ 1946, 1947, 611, 1232, 606, 23, 617, 619, 621, 359, - /* 2030 */ 1961, 623, 1229, 1226, 626, 624, 627, 629, 613, 1220, - /* 2040 */ 1218, 632, 630, 1912, 1224, 612, 633, 1961, 1223, 1209, - /* 2050 */ 1222, 1221, 94, 1241, 95, 613, 276, 639, 1237, 1943, - /* 2060 */ 1912, 68, 612, 1156, 1121, 1155, 648, 1154, 1942, 1153, - /* 2070 */ 1152, 1176, 1977, 1151, 1149, 305, 1944, 616, 1946, 1947, - /* 2080 */ 611, 1147, 606, 1943, 1146, 1942, 1145, 277, 660, 1977, - /* 2090 */ 1961, 1143, 297, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2100 */ 1142, 1141, 1140, 1912, 1139, 612, 1138, 1137, 1127, 1136, - /* 2110 */ 1173, 1171, 1133, 1132, 1961, 1129, 1128, 1654, 1126, 681, - /* 2120 */ 1652, 1650, 613, 682, 683, 685, 1943, 1912, 1942, 612, - /* 2130 */ 687, 691, 1977, 689, 1648, 306, 1944, 616, 1946, 1947, - /* 2140 */ 611, 693, 606, 1943, 686, 690, 695, 694, 1634, 697, - /* 2150 */ 1079, 1614, 1942, 280, 701, 705, 1977, 1961, 704, 298, - /* 2160 */ 1944, 616, 1946, 1947, 611, 613, 606, 1370, 288, 1943, - /* 2170 */ 1912, 1589, 612, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2180 */ 1589, 1589, 613, 1589, 1589, 1589, 1943, 1912, 1589, 612, - /* 2190 */ 1589, 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2200 */ 1961, 1589, 313, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2210 */ 1589, 1589, 1942, 1912, 1589, 612, 1977, 1961, 1589, 314, - /* 2220 */ 1944, 616, 1946, 1947, 611, 613, 606, 1589, 1589, 1943, - /* 2230 */ 1912, 1589, 612, 1589, 1589, 1589, 1589, 1589, 1942, 1589, - /* 2240 */ 1589, 1589, 1977, 1589, 1589, 1955, 1944, 616, 1946, 1947, - /* 2250 */ 611, 1943, 606, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2260 */ 1961, 1589, 1954, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2270 */ 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, - /* 2280 */ 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2290 */ 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, 1942, 1589, - /* 2300 */ 1589, 1589, 1977, 1589, 1589, 1953, 1944, 616, 1946, 1947, - /* 2310 */ 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2320 */ 1942, 1589, 1589, 1589, 1977, 1589, 1589, 323, 1944, 616, - /* 2330 */ 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, - /* 2340 */ 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2350 */ 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, - /* 2360 */ 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, - /* 2370 */ 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, - /* 2380 */ 1589, 612, 1942, 1589, 1589, 1589, 1977, 1589, 1589, 324, - /* 2390 */ 1944, 616, 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, - /* 2400 */ 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, 1589, - /* 2410 */ 1589, 320, 1944, 616, 1946, 1947, 611, 1943, 606, 1589, - /* 2420 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2430 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2440 */ 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2450 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2460 */ 1943, 1912, 1589, 612, 1589, 1589, 1942, 1589, 1589, 1589, - /* 2470 */ 1977, 1589, 1589, 325, 1944, 616, 1946, 1947, 611, 1589, - /* 2480 */ 606, 1589, 1589, 1589, 1589, 1589, 614, 1589, 1589, 1589, - /* 2490 */ 1977, 1961, 1589, 303, 1944, 616, 1946, 1947, 611, 613, - /* 2500 */ 606, 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, - /* 2510 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2520 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1942, - /* 2530 */ 1589, 1589, 1589, 1977, 1589, 1589, 302, 1944, 616, 1946, - /* 2540 */ 1947, 611, 1589, 606, + /* 0 */ 1954, 460, 1743, 461, 1636, 571, 590, 35, 276, 2110, + /* 10 */ 160, 1807, 45, 43, 1526, 1708, 353, 2115, 331, 1865, + /* 20 */ 362, 2110, 1377, 1600, 570, 175, 603, 1805, 354, 2111, + /* 30 */ 572, 1972, 159, 1456, 1612, 1375, 157, 2114, 1403, 586, + /* 40 */ 54, 2111, 2113, 401, 1923, 1756, 619, 124, 123, 122, + /* 50 */ 121, 120, 119, 118, 117, 116, 466, 1754, 1451, 602, + /* 60 */ 38, 37, 462, 18, 44, 42, 41, 40, 39, 1953, + /* 70 */ 1383, 171, 469, 1988, 461, 1636, 102, 1955, 623, 1957, + /* 80 */ 1958, 618, 571, 613, 1794, 547, 2110, 2056, 172, 2110, + /* 90 */ 2041, 1523, 1745, 169, 356, 2037, 14, 60, 603, 1954, + /* 100 */ 1941, 570, 175, 1937, 2116, 175, 2111, 572, 177, 2111, + /* 110 */ 572, 1937, 125, 2053, 334, 1854, 2067, 115, 711, 499, + /* 120 */ 114, 113, 112, 111, 110, 109, 108, 107, 106, 1754, + /* 130 */ 1972, 1933, 1939, 1458, 1459, 48, 1598, 1807, 620, 1933, + /* 140 */ 1939, 345, 613, 1923, 355, 619, 45, 43, 1910, 1563, + /* 150 */ 613, 1260, 1261, 1805, 362, 1731, 1377, 367, 1807, 1954, + /* 160 */ 1800, 1802, 1432, 1441, 1109, 366, 1108, 1456, 1953, 1375, + /* 170 */ 603, 1109, 1988, 1108, 1805, 102, 1955, 623, 1957, 1958, + /* 180 */ 618, 1378, 613, 1376, 180, 136, 212, 143, 2012, 2041, + /* 190 */ 1972, 260, 1451, 356, 2037, 1110, 384, 18, 586, 377, + /* 200 */ 602, 1754, 1110, 1923, 1383, 619, 1381, 1382, 602, 1431, + /* 210 */ 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, + /* 220 */ 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, 1953, 60, + /* 230 */ 14, 87, 1988, 1954, 227, 102, 1955, 623, 1957, 1958, + /* 240 */ 618, 547, 613, 1402, 648, 2110, 178, 172, 82, 2041, + /* 250 */ 1090, 561, 711, 356, 2037, 44, 42, 41, 40, 39, + /* 260 */ 2116, 175, 129, 655, 1972, 2111, 572, 1458, 1459, 267, + /* 270 */ 268, 1749, 620, 64, 266, 2068, 48, 1923, 1402, 619, + /* 280 */ 45, 43, 148, 147, 652, 651, 650, 145, 362, 1092, + /* 290 */ 1377, 1095, 1096, 1954, 84, 322, 1432, 1441, 532, 583, + /* 300 */ 530, 1456, 1953, 1375, 459, 528, 1988, 464, 1642, 102, + /* 310 */ 1955, 623, 1957, 1958, 618, 1378, 613, 1376, 526, 60, + /* 320 */ 524, 2016, 1732, 2041, 1972, 1729, 1451, 356, 2037, 590, + /* 330 */ 133, 18, 620, 1522, 567, 562, 556, 1923, 1383, 619, + /* 340 */ 1381, 1382, 1866, 1431, 1434, 1435, 1436, 1437, 1438, 1439, + /* 350 */ 1440, 615, 611, 1449, 1450, 1452, 1453, 1454, 1455, 1457, + /* 360 */ 1460, 2, 1953, 11, 14, 60, 1988, 1801, 1802, 102, + /* 370 */ 1955, 623, 1957, 1958, 618, 2115, 613, 60, 178, 2110, + /* 380 */ 1807, 2130, 49, 2041, 478, 1623, 711, 356, 2037, 257, + /* 390 */ 2049, 582, 407, 126, 581, 2114, 1806, 2110, 2075, 2111, + /* 400 */ 2112, 1458, 1459, 38, 37, 603, 228, 44, 42, 41, + /* 410 */ 40, 39, 570, 175, 45, 43, 1461, 2111, 572, 125, + /* 420 */ 1313, 1314, 362, 478, 1377, 178, 504, 1954, 1530, 1923, + /* 430 */ 1432, 1441, 320, 655, 1402, 1456, 1754, 1375, 2056, 468, + /* 440 */ 38, 37, 464, 1642, 44, 42, 41, 40, 39, 1378, + /* 450 */ 566, 1376, 148, 147, 652, 651, 650, 145, 1972, 1466, + /* 460 */ 1451, 400, 187, 399, 2052, 1402, 620, 589, 178, 1354, + /* 470 */ 1355, 1923, 1383, 619, 1381, 1382, 27, 1431, 1434, 1435, + /* 480 */ 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, 1450, 1452, + /* 490 */ 1453, 1454, 1455, 1457, 1460, 2, 1953, 169, 46, 79, + /* 500 */ 1988, 1403, 78, 102, 1955, 623, 1957, 1958, 618, 547, + /* 510 */ 613, 510, 509, 2110, 178, 2130, 1972, 2041, 655, 1855, + /* 520 */ 711, 356, 2037, 1622, 565, 1402, 178, 82, 2116, 175, + /* 530 */ 213, 178, 2088, 2111, 572, 1458, 1459, 148, 147, 652, + /* 540 */ 651, 650, 145, 13, 12, 164, 603, 1621, 45, 43, + /* 550 */ 1750, 495, 491, 487, 483, 210, 362, 1837, 1377, 603, + /* 560 */ 405, 682, 680, 564, 1432, 1441, 396, 1923, 1593, 1456, + /* 570 */ 1404, 1375, 1601, 406, 38, 37, 1433, 1754, 44, 42, + /* 580 */ 41, 40, 39, 1378, 2056, 1376, 1405, 398, 394, 443, + /* 590 */ 1754, 1923, 83, 115, 1451, 208, 114, 113, 112, 111, + /* 600 */ 110, 109, 108, 107, 106, 1553, 1383, 1433, 1381, 1382, + /* 610 */ 2051, 1431, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, + /* 620 */ 611, 1449, 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, + /* 630 */ 359, 358, 46, 2115, 1401, 603, 1177, 38, 37, 1499, + /* 640 */ 1391, 44, 42, 41, 40, 39, 657, 191, 190, 415, + /* 650 */ 1404, 1456, 157, 1384, 711, 558, 1551, 1552, 1554, 1555, + /* 660 */ 1620, 1757, 207, 201, 1592, 206, 1754, 31, 474, 1458, + /* 670 */ 1459, 1179, 1619, 38, 37, 99, 1451, 44, 42, 41, + /* 680 */ 40, 39, 45, 43, 199, 41, 40, 39, 1383, 134, + /* 690 */ 362, 11, 1377, 514, 513, 512, 714, 1746, 1432, 1441, + /* 700 */ 1405, 130, 508, 1456, 1923, 1375, 507, 603, 603, 424, + /* 710 */ 283, 1730, 506, 511, 259, 1487, 1923, 1378, 505, 1376, + /* 720 */ 1618, 429, 430, 1617, 408, 168, 1542, 1586, 1451, 1405, + /* 730 */ 237, 704, 700, 696, 692, 281, 609, 409, 1754, 1754, + /* 740 */ 1383, 135, 1381, 1382, 2012, 1431, 1434, 1435, 1436, 1437, + /* 750 */ 1438, 1439, 1440, 615, 611, 1449, 1450, 1452, 1453, 1454, + /* 760 */ 1455, 1457, 1460, 2, 1923, 1616, 14, 1923, 1739, 603, + /* 770 */ 365, 603, 100, 657, 1383, 274, 368, 11, 157, 9, + /* 780 */ 319, 1669, 1400, 476, 157, 477, 32, 1756, 711, 437, + /* 790 */ 1615, 1614, 450, 1756, 259, 449, 1492, 1095, 1096, 1392, + /* 800 */ 1754, 1387, 1754, 1458, 1459, 1611, 1610, 33, 599, 1923, + /* 810 */ 421, 669, 451, 38, 37, 423, 1609, 44, 42, 41, + /* 820 */ 40, 39, 38, 37, 1395, 1397, 44, 42, 41, 40, + /* 830 */ 39, 1608, 1432, 1441, 1923, 1923, 611, 1449, 1450, 1452, + /* 840 */ 1453, 1454, 1455, 8, 184, 262, 514, 513, 512, 1923, + /* 850 */ 1923, 1378, 93, 1376, 130, 508, 1607, 335, 1666, 507, + /* 860 */ 1923, 605, 1348, 2013, 231, 506, 511, 1850, 607, 411, + /* 870 */ 2013, 505, 2114, 236, 1747, 1923, 1381, 1382, 183, 1431, + /* 880 */ 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, + /* 890 */ 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, 229, 447, + /* 900 */ 1923, 1784, 442, 441, 440, 439, 436, 435, 434, 433, + /* 910 */ 432, 428, 427, 426, 425, 336, 418, 417, 416, 1944, + /* 920 */ 413, 412, 333, 688, 687, 686, 685, 372, 583, 684, + /* 930 */ 683, 137, 678, 677, 676, 675, 674, 673, 672, 671, + /* 940 */ 150, 667, 666, 665, 371, 370, 662, 661, 660, 659, + /* 950 */ 658, 158, 1606, 1605, 1402, 235, 296, 38, 37, 133, + /* 960 */ 1377, 44, 42, 41, 40, 39, 1942, 603, 1946, 503, + /* 970 */ 294, 68, 649, 1375, 67, 1798, 603, 1937, 156, 38, + /* 980 */ 37, 1751, 1954, 44, 42, 41, 40, 39, 1850, 1850, + /* 990 */ 141, 502, 195, 456, 454, 85, 1923, 1923, 1754, 185, + /* 1000 */ 189, 653, 339, 575, 1798, 1933, 1939, 1754, 1383, 1604, + /* 1010 */ 603, 654, 327, 1972, 1798, 1741, 613, 585, 173, 2049, + /* 1020 */ 2050, 620, 131, 2054, 543, 670, 1923, 1724, 619, 60, + /* 1030 */ 1217, 645, 644, 643, 1221, 642, 1223, 1224, 641, 1226, + /* 1040 */ 638, 1754, 1232, 635, 1234, 1235, 632, 629, 1519, 290, + /* 1050 */ 1603, 1953, 1784, 1923, 1485, 1988, 711, 603, 102, 1955, + /* 1060 */ 623, 1957, 1958, 618, 340, 613, 338, 337, 101, 501, + /* 1070 */ 2130, 587, 2041, 503, 1954, 1386, 356, 2037, 603, 2061, + /* 1080 */ 1519, 583, 1656, 603, 603, 603, 603, 554, 1754, 50, + /* 1090 */ 69, 3, 271, 146, 1923, 502, 1433, 598, 600, 601, + /* 1100 */ 277, 139, 610, 127, 515, 1972, 76, 75, 404, 1754, + /* 1110 */ 1486, 182, 133, 620, 1754, 1754, 1754, 1754, 1923, 1378, + /* 1120 */ 619, 1376, 1385, 218, 220, 583, 216, 219, 603, 318, + /* 1130 */ 1595, 1596, 392, 574, 390, 386, 382, 379, 376, 578, + /* 1140 */ 77, 62, 369, 1953, 1381, 1382, 53, 1988, 241, 542, + /* 1150 */ 102, 1955, 623, 1957, 1958, 618, 133, 613, 1649, 1754, + /* 1160 */ 375, 1954, 2130, 222, 2041, 47, 221, 224, 356, 2037, + /* 1170 */ 223, 174, 2049, 2050, 1647, 131, 2054, 1737, 178, 2104, + /* 1180 */ 517, 34, 360, 1480, 1481, 1482, 1483, 1484, 1488, 1489, + /* 1190 */ 1490, 1491, 1972, 52, 1550, 1613, 520, 232, 546, 264, + /* 1200 */ 620, 243, 547, 614, 1954, 1923, 2110, 619, 142, 144, + /* 1210 */ 647, 146, 62, 13, 12, 176, 2049, 2050, 1324, 131, + /* 1220 */ 2054, 2116, 175, 1389, 2081, 576, 2111, 572, 1709, 254, + /* 1230 */ 1953, 663, 1954, 47, 1988, 1972, 47, 102, 1955, 623, + /* 1240 */ 1957, 1958, 618, 620, 613, 1477, 664, 1643, 1923, 2130, + /* 1250 */ 619, 2041, 269, 1158, 627, 356, 2037, 98, 1138, 559, + /* 1260 */ 211, 595, 273, 1972, 1210, 1493, 2060, 95, 1156, 248, + /* 1270 */ 1388, 620, 144, 1953, 1973, 1954, 1923, 1988, 619, 146, + /* 1280 */ 102, 1955, 623, 1957, 1958, 618, 1442, 613, 128, 289, + /* 1290 */ 144, 373, 2014, 1139, 2041, 1859, 706, 1637, 356, 2037, + /* 1300 */ 374, 1953, 1795, 2071, 584, 1988, 1972, 1238, 102, 1955, + /* 1310 */ 623, 1957, 1958, 618, 620, 613, 256, 253, 1, 1923, + /* 1320 */ 606, 619, 2041, 4, 378, 1242, 356, 2037, 383, 1341, + /* 1330 */ 535, 284, 1249, 332, 188, 410, 1405, 1860, 414, 445, + /* 1340 */ 1954, 1247, 547, 149, 1953, 419, 2110, 1400, 1988, 431, + /* 1350 */ 1852, 103, 1955, 623, 1957, 1958, 618, 438, 613, 452, + /* 1360 */ 444, 2116, 175, 579, 1954, 2041, 2111, 572, 446, 2040, + /* 1370 */ 2037, 1972, 547, 453, 1406, 458, 2110, 192, 455, 620, + /* 1380 */ 457, 467, 1408, 1954, 1923, 198, 619, 470, 1407, 471, + /* 1390 */ 472, 2116, 175, 1409, 200, 1972, 2111, 572, 473, 203, + /* 1400 */ 475, 205, 80, 620, 479, 1112, 81, 209, 1923, 1953, + /* 1410 */ 619, 496, 497, 1988, 1972, 498, 103, 1955, 623, 1957, + /* 1420 */ 1958, 618, 620, 613, 105, 534, 500, 1923, 1744, 619, + /* 1430 */ 2041, 321, 2072, 1953, 608, 2037, 1954, 1988, 215, 1740, + /* 1440 */ 162, 1955, 623, 1957, 1958, 618, 217, 613, 151, 152, + /* 1450 */ 1742, 1738, 621, 230, 153, 1900, 1988, 1954, 154, 103, + /* 1460 */ 1955, 623, 1957, 1958, 618, 1899, 613, 1972, 537, 538, + /* 1470 */ 536, 285, 541, 2041, 233, 617, 544, 326, 2037, 2082, + /* 1480 */ 1923, 551, 619, 557, 560, 593, 346, 2087, 1972, 239, + /* 1490 */ 242, 563, 573, 2131, 2086, 7, 620, 569, 549, 2063, + /* 1500 */ 552, 1923, 550, 619, 577, 1953, 252, 1519, 250, 1988, + /* 1510 */ 1954, 1941, 312, 1955, 623, 1957, 1958, 618, 616, 613, + /* 1520 */ 604, 2006, 1937, 249, 247, 347, 1953, 580, 132, 1404, + /* 1530 */ 1988, 2109, 588, 161, 1955, 623, 1957, 1958, 618, 2057, + /* 1540 */ 613, 1972, 165, 251, 350, 261, 591, 286, 592, 620, + /* 1550 */ 1933, 1939, 357, 1871, 1923, 1870, 619, 1869, 352, 2133, + /* 1560 */ 287, 613, 255, 1954, 596, 90, 92, 597, 288, 1755, + /* 1570 */ 59, 94, 2022, 625, 548, 2078, 1799, 291, 707, 1953, + /* 1580 */ 1725, 708, 280, 1988, 1954, 710, 103, 1955, 623, 1957, + /* 1590 */ 1958, 618, 51, 613, 1972, 315, 295, 300, 323, 293, + /* 1600 */ 2041, 324, 620, 1917, 314, 2038, 1954, 1923, 1916, 619, + /* 1610 */ 304, 73, 1915, 1914, 74, 1972, 1911, 380, 381, 1369, + /* 1620 */ 1370, 181, 385, 620, 1909, 387, 388, 389, 1923, 1908, + /* 1630 */ 619, 391, 1953, 1907, 393, 1906, 1988, 1972, 1905, 161, + /* 1640 */ 1955, 623, 1957, 1958, 618, 620, 613, 395, 1344, 397, + /* 1650 */ 1923, 1343, 619, 1953, 1882, 1881, 403, 1988, 402, 1880, + /* 1660 */ 306, 1955, 623, 1957, 1958, 618, 1879, 613, 1304, 1845, + /* 1670 */ 1844, 1842, 1954, 138, 1841, 1953, 1840, 1843, 1839, 1988, + /* 1680 */ 186, 2079, 162, 1955, 623, 1957, 1958, 618, 1838, 613, + /* 1690 */ 519, 1836, 1954, 1835, 1834, 420, 1833, 422, 1832, 1831, + /* 1700 */ 1830, 1829, 1828, 1972, 568, 529, 1827, 1826, 351, 1825, + /* 1710 */ 1824, 620, 1823, 1822, 1821, 1820, 1923, 1819, 619, 226, + /* 1720 */ 1818, 140, 1817, 1972, 1816, 1815, 1814, 1813, 1812, 1811, + /* 1730 */ 1306, 617, 1810, 448, 522, 2132, 1923, 1809, 619, 516, + /* 1740 */ 1808, 1953, 1671, 193, 225, 1988, 1185, 1954, 313, 1955, + /* 1750 */ 623, 1957, 1958, 618, 1670, 613, 1668, 1632, 71, 1098, + /* 1760 */ 196, 1953, 1097, 1954, 1631, 1988, 1895, 170, 312, 1955, + /* 1770 */ 623, 1957, 1958, 618, 194, 613, 197, 2007, 1972, 1889, + /* 1780 */ 1943, 66, 463, 361, 65, 465, 620, 1878, 72, 202, + /* 1790 */ 204, 1923, 1877, 619, 1972, 1862, 1733, 1667, 1131, 363, + /* 1800 */ 1665, 481, 620, 480, 482, 1663, 1954, 1923, 484, 619, + /* 1810 */ 486, 485, 1661, 490, 1659, 488, 1953, 489, 492, 1646, + /* 1820 */ 1988, 494, 1645, 313, 1955, 623, 1957, 1958, 618, 493, + /* 1830 */ 613, 1628, 1953, 1735, 214, 61, 1988, 1972, 1254, 313, + /* 1840 */ 1955, 623, 1957, 1958, 618, 620, 613, 1253, 1734, 1954, + /* 1850 */ 1923, 1176, 619, 1175, 679, 1174, 1168, 681, 1173, 1170, + /* 1860 */ 1657, 1169, 1167, 341, 1650, 1954, 342, 518, 1648, 343, + /* 1870 */ 521, 1627, 1626, 523, 525, 533, 1625, 527, 104, 1988, + /* 1880 */ 1972, 1359, 308, 1955, 623, 1957, 1958, 618, 620, 613, + /* 1890 */ 531, 1358, 1894, 1923, 26, 619, 1972, 1350, 1361, 1888, + /* 1900 */ 539, 1876, 1874, 55, 620, 155, 2115, 540, 1565, 1923, + /* 1910 */ 234, 619, 16, 19, 58, 344, 1954, 545, 1953, 245, + /* 1920 */ 553, 5, 1988, 30, 28, 297, 1955, 623, 1957, 1958, + /* 1930 */ 618, 246, 613, 1954, 1953, 555, 238, 1944, 1988, 6, + /* 1940 */ 240, 298, 1955, 623, 1957, 1958, 618, 1972, 613, 1549, + /* 1950 */ 163, 63, 20, 244, 21, 620, 1541, 29, 1580, 86, + /* 1960 */ 1923, 1579, 619, 1585, 1972, 348, 1584, 1583, 349, 258, + /* 1970 */ 1586, 1516, 620, 57, 1515, 166, 1875, 1923, 1873, 619, + /* 1980 */ 1872, 22, 594, 263, 1547, 1953, 1861, 265, 1954, 1988, + /* 1990 */ 17, 270, 299, 1955, 623, 1957, 1958, 618, 56, 613, + /* 2000 */ 88, 89, 1953, 91, 95, 275, 1988, 1954, 23, 305, + /* 2010 */ 1955, 623, 1957, 1958, 618, 272, 613, 1468, 10, 1972, + /* 2020 */ 12, 1467, 1393, 1991, 167, 1424, 179, 620, 624, 626, + /* 2030 */ 612, 1954, 1923, 1446, 619, 1478, 364, 1444, 1972, 36, + /* 2040 */ 622, 1443, 15, 24, 630, 25, 620, 1416, 1239, 628, + /* 2050 */ 631, 1923, 1236, 619, 1233, 633, 634, 1953, 1227, 636, + /* 2060 */ 1225, 1988, 1972, 637, 309, 1955, 623, 1957, 1958, 618, + /* 2070 */ 620, 613, 639, 1216, 646, 1923, 1953, 619, 640, 1231, + /* 2080 */ 1988, 96, 278, 301, 1955, 623, 1957, 1958, 618, 1954, + /* 2090 */ 613, 1230, 1229, 1228, 97, 1248, 1244, 656, 70, 1129, + /* 2100 */ 1953, 1164, 1163, 1162, 1988, 1954, 1161, 310, 1955, 623, + /* 2110 */ 1957, 1958, 618, 1160, 613, 1159, 1157, 1155, 1154, 1153, + /* 2120 */ 1972, 668, 1183, 279, 1149, 1151, 1150, 1148, 620, 1147, + /* 2130 */ 1146, 1145, 1144, 1923, 1180, 619, 1972, 1135, 1178, 1141, + /* 2140 */ 1664, 1140, 690, 1137, 620, 1136, 1134, 689, 1954, 1923, + /* 2150 */ 1662, 619, 691, 693, 1660, 695, 697, 694, 1953, 699, + /* 2160 */ 1658, 701, 1988, 703, 1954, 302, 1955, 623, 1957, 1958, + /* 2170 */ 618, 698, 613, 702, 1953, 282, 705, 1087, 1988, 1972, + /* 2180 */ 1644, 311, 1955, 623, 1957, 1958, 618, 620, 613, 1624, + /* 2190 */ 709, 712, 1923, 1379, 619, 1972, 292, 713, 1599, 1599, + /* 2200 */ 1599, 1599, 1599, 620, 1599, 1599, 1599, 1954, 1923, 1599, + /* 2210 */ 619, 1599, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, + /* 2220 */ 1599, 1988, 1599, 1954, 303, 1955, 623, 1957, 1958, 618, + /* 2230 */ 1599, 613, 1599, 1953, 1599, 1599, 1599, 1988, 1972, 1599, + /* 2240 */ 316, 1955, 623, 1957, 1958, 618, 620, 613, 1599, 1599, + /* 2250 */ 1599, 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, + /* 2260 */ 1599, 1599, 620, 1599, 1599, 1599, 1954, 1923, 1599, 619, + /* 2270 */ 1599, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, 1599, + /* 2280 */ 1988, 1599, 1599, 317, 1955, 623, 1957, 1958, 618, 1599, + /* 2290 */ 613, 1599, 1953, 1599, 1599, 1599, 1988, 1972, 1599, 1966, + /* 2300 */ 1955, 623, 1957, 1958, 618, 620, 613, 1599, 1599, 1599, + /* 2310 */ 1923, 1599, 619, 1599, 1599, 1599, 1599, 1954, 1599, 1599, + /* 2320 */ 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + /* 2330 */ 1599, 1599, 1599, 1599, 1954, 1953, 1599, 1599, 1599, 1988, + /* 2340 */ 1599, 1599, 1965, 1955, 623, 1957, 1958, 618, 1972, 613, + /* 2350 */ 1599, 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, + /* 2360 */ 1954, 1923, 1599, 619, 1599, 1972, 1599, 1599, 1599, 1599, + /* 2370 */ 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, + /* 2380 */ 619, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, 1599, + /* 2390 */ 1988, 1972, 1599, 1964, 1955, 623, 1957, 1958, 618, 620, + /* 2400 */ 613, 1599, 1599, 1953, 1923, 1599, 619, 1988, 1599, 1599, + /* 2410 */ 328, 1955, 623, 1957, 1958, 618, 1954, 613, 1599, 1599, + /* 2420 */ 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1953, + /* 2430 */ 1599, 1599, 1954, 1988, 1599, 1599, 329, 1955, 623, 1957, + /* 2440 */ 1958, 618, 1599, 613, 1599, 1599, 1599, 1972, 1599, 1599, + /* 2450 */ 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, + /* 2460 */ 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, 1599, + /* 2470 */ 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, 619, 1599, + /* 2480 */ 1599, 1599, 1599, 1599, 1599, 1953, 1954, 1599, 1599, 1988, + /* 2490 */ 1599, 1599, 325, 1955, 623, 1957, 1958, 618, 1599, 613, + /* 2500 */ 1599, 1953, 1954, 1599, 1599, 1988, 1599, 1599, 330, 1955, + /* 2510 */ 623, 1957, 1958, 618, 1599, 613, 1599, 1972, 1599, 1599, + /* 2520 */ 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, + /* 2530 */ 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, 1599, + /* 2540 */ 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, 619, 1599, + /* 2550 */ 1599, 1599, 1599, 1599, 1599, 621, 1599, 1599, 1599, 1988, + /* 2560 */ 1599, 1599, 308, 1955, 623, 1957, 1958, 618, 1599, 613, + /* 2570 */ 1599, 1953, 1599, 1599, 1599, 1988, 1599, 1599, 307, 1955, + /* 2580 */ 623, 1957, 1958, 618, 1599, 613, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 385, 426, 347, 0, 328, 430, 330, 331, 415, 416, - /* 10 */ 355, 385, 12, 13, 14, 328, 355, 330, 331, 364, - /* 20 */ 20, 446, 22, 8, 9, 450, 451, 12, 13, 14, - /* 30 */ 15, 16, 20, 33, 339, 35, 324, 376, 377, 344, - /* 40 */ 21, 426, 8, 9, 370, 430, 12, 13, 14, 15, - /* 50 */ 16, 20, 426, 34, 380, 36, 430, 383, 58, 44, - /* 60 */ 445, 446, 385, 63, 355, 450, 451, 355, 369, 370, - /* 70 */ 70, 445, 446, 364, 426, 363, 450, 451, 430, 332, - /* 80 */ 368, 20, 370, 12, 13, 12, 13, 14, 15, 16, - /* 90 */ 323, 20, 325, 22, 446, 355, 96, 63, 450, 451, - /* 100 */ 1, 2, 362, 426, 33, 393, 35, 430, 4, 397, - /* 110 */ 363, 371, 400, 401, 402, 403, 404, 405, 118, 407, - /* 120 */ 58, 63, 445, 446, 412, 33, 414, 450, 451, 58, - /* 130 */ 418, 419, 132, 133, 63, 14, 15, 16, 62, 105, - /* 140 */ 48, 70, 399, 332, 432, 357, 54, 55, 56, 57, - /* 150 */ 58, 366, 440, 338, 369, 370, 368, 96, 96, 355, - /* 160 */ 98, 161, 162, 132, 133, 355, 362, 96, 425, 422, - /* 170 */ 423, 424, 362, 426, 427, 371, 361, 430, 20, 128, - /* 180 */ 180, 371, 182, 372, 396, 397, 398, 95, 20, 118, - /* 190 */ 98, 363, 445, 446, 160, 407, 97, 450, 451, 324, - /* 200 */ 96, 14, 374, 132, 133, 205, 206, 20, 208, 209, + /* 0 */ 327, 331, 359, 333, 334, 429, 373, 418, 419, 433, + /* 10 */ 342, 358, 12, 13, 14, 347, 383, 429, 365, 386, + /* 20 */ 20, 433, 22, 0, 448, 449, 335, 374, 350, 453, + /* 30 */ 454, 358, 326, 33, 328, 35, 358, 449, 20, 366, + /* 40 */ 349, 453, 454, 387, 371, 367, 373, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 14, 366, 58, 20, + /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 396, + /* 70 */ 70, 357, 331, 400, 333, 334, 403, 404, 405, 406, + /* 80 */ 407, 408, 429, 410, 370, 429, 433, 402, 415, 433, + /* 90 */ 417, 4, 360, 358, 421, 422, 96, 96, 335, 327, + /* 100 */ 360, 448, 449, 371, 448, 449, 453, 454, 435, 453, + /* 110 */ 454, 371, 349, 428, 379, 380, 443, 21, 118, 356, + /* 120 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 366, + /* 130 */ 358, 399, 400, 133, 134, 96, 324, 358, 366, 399, + /* 140 */ 400, 401, 410, 371, 365, 373, 12, 13, 0, 97, + /* 150 */ 410, 133, 134, 374, 20, 0, 22, 369, 358, 327, + /* 160 */ 372, 373, 162, 163, 20, 365, 22, 33, 396, 35, + /* 170 */ 335, 20, 400, 22, 374, 403, 404, 405, 406, 407, + /* 180 */ 408, 181, 410, 183, 349, 413, 35, 415, 416, 417, + /* 190 */ 358, 58, 58, 421, 422, 51, 48, 63, 366, 387, + /* 200 */ 20, 366, 51, 371, 70, 373, 206, 207, 20, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 65, 66, 67, - /* 230 */ 426, 20, 161, 162, 430, 73, 74, 20, 187, 188, - /* 240 */ 78, 79, 191, 368, 193, 321, 84, 85, 4, 445, - /* 250 */ 446, 180, 90, 182, 450, 451, 164, 165, 324, 167, - /* 260 */ 80, 166, 170, 205, 205, 231, 232, 233, 234, 235, - /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 186, 208, - /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 354, 228, - /* 300 */ 12, 13, 368, 341, 342, 244, 244, 96, 20, 385, - /* 310 */ 22, 367, 253, 254, 255, 256, 257, 137, 138, 161, - /* 320 */ 162, 33, 324, 35, 109, 110, 111, 112, 113, 114, - /* 330 */ 115, 116, 117, 118, 119, 20, 121, 122, 123, 124, - /* 340 */ 125, 126, 175, 336, 249, 250, 58, 20, 244, 22, - /* 350 */ 426, 63, 329, 355, 430, 332, 333, 350, 70, 341, - /* 360 */ 342, 363, 35, 196, 197, 358, 368, 44, 370, 445, - /* 370 */ 446, 12, 13, 14, 450, 451, 2, 355, 51, 20, - /* 380 */ 163, 22, 8, 9, 96, 363, 12, 13, 14, 15, - /* 390 */ 16, 393, 33, 329, 35, 397, 332, 333, 400, 401, - /* 400 */ 402, 403, 404, 405, 332, 407, 118, 324, 8, 9, - /* 410 */ 399, 96, 12, 13, 14, 15, 16, 58, 346, 127, - /* 420 */ 132, 133, 108, 163, 402, 353, 8, 9, 168, 70, - /* 430 */ 12, 13, 14, 15, 16, 363, 425, 35, 355, 441, - /* 440 */ 442, 127, 128, 129, 130, 131, 363, 336, 370, 161, - /* 450 */ 162, 368, 96, 370, 426, 96, 242, 243, 430, 8, - /* 460 */ 9, 383, 20, 12, 13, 14, 15, 16, 180, 358, - /* 470 */ 182, 20, 70, 445, 446, 324, 393, 118, 450, 451, - /* 480 */ 397, 189, 190, 400, 401, 402, 403, 404, 405, 245, - /* 490 */ 407, 132, 133, 205, 206, 96, 208, 209, 210, 211, - /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 510 */ 222, 223, 224, 225, 226, 97, 4, 324, 324, 368, - /* 520 */ 161, 162, 0, 21, 45, 46, 24, 25, 26, 27, - /* 530 */ 28, 29, 30, 31, 32, 452, 453, 127, 128, 180, - /* 540 */ 228, 182, 230, 21, 0, 324, 24, 25, 26, 27, - /* 550 */ 28, 29, 30, 31, 32, 43, 20, 45, 46, 244, - /* 560 */ 62, 368, 368, 163, 205, 206, 160, 208, 209, 210, - /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 265, 368, - /* 590 */ 19, 4, 20, 20, 20, 22, 22, 363, 188, 332, - /* 600 */ 244, 191, 332, 193, 33, 14, 19, 33, 374, 35, - /* 610 */ 324, 20, 96, 346, 163, 107, 346, 332, 324, 48, - /* 620 */ 33, 228, 332, 353, 51, 54, 55, 56, 57, 58, - /* 630 */ 363, 346, 58, 363, 347, 48, 338, 231, 355, 70, - /* 640 */ 53, 355, 355, 244, 70, 58, 70, 241, 363, 363, - /* 650 */ 352, 364, 108, 363, 368, 0, 370, 12, 13, 361, - /* 660 */ 377, 0, 368, 332, 324, 20, 95, 22, 0, 98, - /* 670 */ 96, 127, 128, 129, 130, 131, 356, 346, 33, 393, - /* 680 */ 35, 324, 95, 397, 356, 98, 400, 401, 402, 403, - /* 690 */ 404, 405, 118, 407, 363, 179, 410, 181, 412, 413, - /* 700 */ 414, 347, 131, 58, 418, 419, 132, 133, 368, 355, - /* 710 */ 389, 421, 422, 423, 424, 70, 426, 427, 364, 356, - /* 720 */ 65, 66, 67, 62, 58, 368, 14, 332, 73, 74, - /* 730 */ 62, 324, 20, 78, 79, 161, 162, 324, 167, 84, - /* 740 */ 85, 96, 0, 8, 9, 90, 20, 12, 13, 14, - /* 750 */ 15, 16, 161, 20, 180, 184, 182, 186, 363, 348, - /* 760 */ 244, 95, 351, 118, 98, 357, 24, 25, 26, 27, - /* 770 */ 28, 29, 30, 31, 32, 368, 368, 132, 133, 205, - /* 780 */ 206, 368, 208, 209, 210, 211, 212, 213, 214, 215, - /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 800 */ 226, 18, 108, 20, 396, 397, 161, 162, 324, 363, - /* 810 */ 27, 399, 411, 30, 413, 407, 33, 422, 423, 424, - /* 820 */ 374, 426, 427, 355, 130, 180, 0, 182, 324, 0, - /* 830 */ 324, 48, 97, 50, 2, 410, 53, 425, 413, 371, - /* 840 */ 8, 9, 324, 324, 12, 13, 14, 15, 16, 356, - /* 850 */ 205, 206, 368, 208, 209, 210, 211, 212, 213, 214, - /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - /* 870 */ 225, 226, 368, 161, 368, 8, 9, 48, 95, 12, - /* 880 */ 13, 14, 15, 16, 20, 365, 368, 368, 368, 163, - /* 890 */ 107, 65, 66, 67, 68, 69, 163, 71, 72, 73, - /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 136, - /* 920 */ 324, 324, 139, 140, 141, 142, 143, 144, 145, 146, - /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 3, - /* 940 */ 157, 158, 159, 18, 411, 332, 413, 332, 23, 8, - /* 950 */ 9, 44, 355, 12, 13, 14, 15, 16, 332, 346, - /* 960 */ 363, 346, 37, 38, 368, 368, 41, 370, 382, 385, - /* 970 */ 384, 3, 346, 44, 324, 324, 363, 382, 363, 384, - /* 980 */ 324, 332, 1, 2, 59, 60, 61, 0, 20, 363, - /* 990 */ 393, 332, 332, 365, 397, 346, 368, 400, 401, 402, - /* 1000 */ 403, 404, 405, 39, 407, 355, 346, 0, 356, 412, - /* 1010 */ 426, 414, 363, 363, 430, 418, 419, 344, 368, 368, - /* 1020 */ 370, 96, 363, 363, 368, 161, 97, 332, 348, 445, - /* 1030 */ 446, 351, 332, 100, 450, 451, 103, 440, 357, 172, - /* 1040 */ 356, 346, 332, 393, 58, 100, 346, 397, 103, 368, - /* 1050 */ 400, 401, 402, 403, 404, 405, 346, 407, 363, 134, - /* 1060 */ 332, 324, 412, 363, 414, 97, 12, 13, 418, 419, - /* 1070 */ 343, 356, 345, 363, 346, 35, 22, 396, 397, 429, - /* 1080 */ 332, 422, 423, 424, 98, 426, 427, 33, 407, 35, - /* 1090 */ 325, 363, 355, 22, 346, 108, 107, 172, 173, 174, - /* 1100 */ 363, 42, 177, 44, 324, 368, 35, 370, 42, 378, - /* 1110 */ 44, 363, 58, 443, 127, 128, 129, 130, 131, 35, - /* 1120 */ 195, 357, 332, 198, 70, 200, 201, 202, 203, 204, - /* 1130 */ 393, 163, 368, 266, 397, 355, 346, 400, 401, 402, - /* 1140 */ 403, 404, 405, 363, 407, 156, 0, 96, 368, 412, - /* 1150 */ 370, 414, 454, 363, 0, 418, 419, 106, 151, 334, - /* 1160 */ 396, 397, 398, 385, 100, 332, 429, 103, 22, 244, - /* 1170 */ 263, 407, 118, 393, 332, 324, 22, 397, 44, 346, - /* 1180 */ 400, 401, 402, 403, 404, 405, 332, 407, 346, 332, - /* 1190 */ 0, 47, 412, 437, 414, 355, 363, 261, 418, 419, - /* 1200 */ 346, 332, 334, 346, 426, 363, 355, 243, 430, 429, - /* 1210 */ 132, 133, 22, 100, 363, 346, 103, 363, 324, 368, - /* 1220 */ 363, 370, 182, 445, 446, 44, 44, 44, 450, 451, - /* 1230 */ 44, 97, 363, 44, 180, 44, 182, 44, 378, 331, - /* 1240 */ 96, 367, 428, 378, 393, 447, 35, 420, 397, 355, - /* 1250 */ 44, 400, 401, 402, 403, 404, 405, 363, 407, 205, - /* 1260 */ 206, 324, 368, 412, 370, 414, 182, 44, 44, 418, - /* 1270 */ 419, 217, 218, 219, 220, 221, 222, 223, 97, 97, - /* 1280 */ 97, 70, 246, 97, 0, 324, 97, 393, 97, 13, - /* 1290 */ 97, 397, 355, 44, 400, 401, 402, 403, 404, 405, - /* 1300 */ 363, 407, 431, 97, 44, 368, 412, 370, 414, 395, - /* 1310 */ 48, 35, 418, 419, 13, 394, 355, 44, 44, 22, - /* 1320 */ 97, 97, 387, 178, 363, 42, 375, 20, 378, 368, - /* 1330 */ 393, 370, 35, 49, 397, 37, 35, 400, 401, 402, - /* 1340 */ 403, 404, 405, 324, 407, 375, 97, 160, 373, 412, - /* 1350 */ 20, 414, 332, 332, 393, 418, 419, 97, 397, 375, - /* 1360 */ 94, 400, 401, 402, 403, 404, 405, 70, 407, 373, - /* 1370 */ 97, 97, 373, 340, 355, 414, 332, 332, 332, 418, - /* 1380 */ 419, 20, 363, 326, 326, 20, 324, 368, 391, 370, - /* 1390 */ 338, 338, 370, 20, 333, 20, 386, 99, 338, 101, - /* 1400 */ 102, 333, 104, 338, 332, 338, 108, 338, 338, 52, - /* 1410 */ 335, 335, 393, 326, 324, 118, 397, 355, 355, 400, - /* 1420 */ 401, 402, 403, 404, 405, 363, 407, 332, 130, 355, - /* 1430 */ 368, 326, 370, 414, 355, 355, 355, 418, 419, 194, - /* 1440 */ 355, 355, 392, 355, 355, 355, 355, 355, 336, 185, - /* 1450 */ 368, 336, 332, 363, 252, 393, 251, 258, 368, 397, - /* 1460 */ 370, 378, 400, 401, 402, 403, 404, 405, 391, 407, - /* 1470 */ 370, 378, 368, 324, 436, 368, 414, 180, 381, 182, - /* 1480 */ 418, 419, 381, 393, 390, 436, 368, 397, 171, 368, - /* 1490 */ 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - /* 1500 */ 260, 259, 205, 206, 355, 247, 395, 264, 267, 262, - /* 1510 */ 455, 438, 363, 243, 363, 20, 399, 368, 333, 370, - /* 1520 */ 332, 381, 381, 368, 368, 368, 368, 368, 336, 368, - /* 1530 */ 336, 324, 165, 434, 436, 439, 433, 435, 363, 379, - /* 1540 */ 336, 96, 393, 417, 96, 368, 397, 351, 345, 400, - /* 1550 */ 401, 402, 403, 404, 405, 449, 407, 448, 332, 324, - /* 1560 */ 359, 336, 355, 414, 36, 327, 388, 349, 419, 349, - /* 1570 */ 363, 349, 326, 337, 322, 368, 0, 370, 0, 384, - /* 1580 */ 187, 0, 0, 42, 0, 324, 35, 199, 35, 35, - /* 1590 */ 355, 35, 0, 199, 35, 35, 199, 0, 363, 199, - /* 1600 */ 393, 0, 35, 368, 397, 370, 0, 400, 401, 402, - /* 1610 */ 403, 404, 405, 0, 407, 22, 355, 182, 35, 180, - /* 1620 */ 0, 0, 176, 0, 363, 175, 0, 47, 393, 368, - /* 1630 */ 0, 370, 397, 0, 0, 400, 401, 402, 403, 404, - /* 1640 */ 405, 42, 407, 0, 0, 0, 0, 0, 0, 442, - /* 1650 */ 0, 0, 151, 35, 393, 324, 0, 151, 397, 0, - /* 1660 */ 0, 400, 401, 402, 403, 404, 405, 0, 407, 0, - /* 1670 */ 0, 0, 0, 0, 324, 22, 0, 42, 0, 444, - /* 1680 */ 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, - /* 1690 */ 0, 360, 135, 0, 363, 0, 0, 0, 0, 368, - /* 1700 */ 35, 370, 0, 0, 0, 355, 0, 58, 42, 47, - /* 1710 */ 58, 47, 44, 363, 453, 14, 39, 0, 368, 14, - /* 1720 */ 370, 47, 0, 0, 393, 0, 40, 0, 397, 171, - /* 1730 */ 39, 400, 401, 402, 403, 404, 405, 324, 407, 39, - /* 1740 */ 0, 0, 0, 393, 0, 35, 39, 397, 0, 35, - /* 1750 */ 400, 401, 402, 403, 404, 405, 48, 407, 324, 409, - /* 1760 */ 48, 0, 0, 64, 35, 39, 48, 39, 355, 35, - /* 1770 */ 39, 0, 48, 360, 0, 0, 363, 0, 35, 22, - /* 1780 */ 324, 368, 0, 370, 105, 35, 35, 22, 35, 355, - /* 1790 */ 35, 44, 22, 44, 360, 35, 0, 363, 35, 35, - /* 1800 */ 22, 324, 368, 0, 370, 22, 393, 0, 50, 22, - /* 1810 */ 397, 355, 103, 400, 401, 402, 403, 404, 405, 363, - /* 1820 */ 407, 35, 0, 324, 368, 35, 370, 393, 0, 35, - /* 1830 */ 0, 397, 355, 22, 400, 401, 402, 403, 404, 405, - /* 1840 */ 363, 407, 97, 20, 324, 368, 0, 370, 96, 393, - /* 1850 */ 35, 0, 0, 397, 355, 22, 400, 401, 402, 403, - /* 1860 */ 404, 405, 363, 407, 0, 44, 3, 368, 96, 370, - /* 1870 */ 393, 44, 248, 97, 397, 355, 163, 400, 401, 402, - /* 1880 */ 403, 404, 405, 363, 407, 165, 97, 324, 368, 96, - /* 1890 */ 370, 96, 393, 163, 183, 163, 397, 97, 97, 400, - /* 1900 */ 401, 402, 403, 404, 405, 169, 407, 47, 96, 96, - /* 1910 */ 44, 44, 47, 393, 96, 324, 3, 397, 355, 44, - /* 1920 */ 400, 401, 402, 403, 404, 405, 363, 407, 97, 97, - /* 1930 */ 35, 368, 35, 370, 35, 35, 35, 35, 97, 97, - /* 1940 */ 47, 324, 248, 47, 0, 0, 355, 44, 0, 96, - /* 1950 */ 35, 97, 97, 96, 363, 35, 393, 242, 192, 368, - /* 1960 */ 397, 370, 0, 400, 401, 402, 403, 404, 405, 248, - /* 1970 */ 407, 166, 355, 96, 96, 0, 39, 96, 164, 106, - /* 1980 */ 363, 47, 44, 227, 393, 368, 2, 370, 397, 22, - /* 1990 */ 205, 400, 401, 402, 403, 404, 405, 229, 407, 324, - /* 2000 */ 227, 97, 96, 96, 47, 97, 96, 47, 97, 97, - /* 2010 */ 393, 207, 96, 96, 397, 22, 324, 400, 401, 402, - /* 2020 */ 403, 404, 405, 97, 407, 96, 107, 35, 96, 35, - /* 2030 */ 355, 35, 97, 97, 35, 96, 96, 35, 363, 97, - /* 2040 */ 97, 35, 96, 368, 120, 370, 96, 355, 120, 22, - /* 2050 */ 120, 120, 96, 35, 96, 363, 44, 108, 22, 324, - /* 2060 */ 368, 96, 370, 35, 64, 35, 63, 35, 393, 35, - /* 2070 */ 35, 70, 397, 35, 35, 400, 401, 402, 403, 404, - /* 2080 */ 405, 35, 407, 324, 35, 393, 35, 44, 93, 397, - /* 2090 */ 355, 35, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2100 */ 35, 22, 35, 368, 22, 370, 35, 35, 22, 35, - /* 2110 */ 70, 35, 35, 35, 355, 35, 35, 0, 35, 35, - /* 2120 */ 0, 0, 363, 48, 39, 35, 324, 368, 393, 370, - /* 2130 */ 39, 39, 397, 35, 0, 400, 401, 402, 403, 404, - /* 2140 */ 405, 35, 407, 324, 48, 48, 39, 48, 0, 35, - /* 2150 */ 35, 0, 393, 22, 21, 20, 397, 355, 21, 400, - /* 2160 */ 401, 402, 403, 404, 405, 363, 407, 22, 22, 324, - /* 2170 */ 368, 456, 370, 456, 355, 456, 456, 456, 456, 456, - /* 2180 */ 456, 456, 363, 456, 456, 456, 324, 368, 456, 370, - /* 2190 */ 456, 456, 456, 456, 456, 393, 456, 456, 456, 397, - /* 2200 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2210 */ 456, 456, 393, 368, 456, 370, 397, 355, 456, 400, - /* 2220 */ 401, 402, 403, 404, 405, 363, 407, 456, 456, 324, - /* 2230 */ 368, 456, 370, 456, 456, 456, 456, 456, 393, 456, - /* 2240 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2250 */ 405, 324, 407, 456, 456, 393, 456, 456, 456, 397, - /* 2260 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2270 */ 456, 456, 456, 368, 456, 370, 456, 456, 456, 456, - /* 2280 */ 456, 456, 355, 456, 456, 456, 456, 456, 456, 456, - /* 2290 */ 363, 456, 456, 456, 456, 368, 456, 370, 393, 456, - /* 2300 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2310 */ 405, 456, 407, 324, 456, 456, 456, 456, 456, 456, - /* 2320 */ 393, 456, 456, 456, 397, 456, 456, 400, 401, 402, - /* 2330 */ 403, 404, 405, 456, 407, 324, 456, 456, 456, 456, - /* 2340 */ 456, 456, 456, 456, 355, 456, 456, 456, 456, 456, - /* 2350 */ 456, 456, 363, 456, 456, 456, 456, 368, 456, 370, - /* 2360 */ 456, 456, 456, 456, 456, 456, 355, 456, 456, 456, - /* 2370 */ 456, 456, 456, 456, 363, 456, 456, 456, 456, 368, - /* 2380 */ 456, 370, 393, 456, 456, 456, 397, 456, 456, 400, - /* 2390 */ 401, 402, 403, 404, 405, 456, 407, 324, 456, 456, - /* 2400 */ 456, 456, 456, 456, 393, 456, 456, 456, 397, 456, - /* 2410 */ 456, 400, 401, 402, 403, 404, 405, 324, 407, 456, - /* 2420 */ 456, 456, 456, 456, 456, 456, 456, 456, 355, 456, - /* 2430 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2440 */ 456, 368, 456, 370, 456, 456, 456, 456, 355, 456, - /* 2450 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2460 */ 324, 368, 456, 370, 456, 456, 393, 456, 456, 456, - /* 2470 */ 397, 456, 456, 400, 401, 402, 403, 404, 405, 456, - /* 2480 */ 407, 456, 456, 456, 456, 456, 393, 456, 456, 456, - /* 2490 */ 397, 355, 456, 400, 401, 402, 403, 404, 405, 363, - /* 2500 */ 407, 456, 456, 456, 368, 456, 370, 456, 456, 456, - /* 2510 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - /* 2520 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 393, - /* 2530 */ 456, 456, 456, 397, 456, 456, 400, 401, 402, 403, - /* 2540 */ 404, 405, 456, 407, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 396, 96, + /* 230 */ 96, 98, 400, 327, 128, 403, 404, 405, 406, 407, + /* 240 */ 408, 429, 410, 20, 107, 433, 245, 415, 341, 417, + /* 250 */ 4, 167, 118, 421, 422, 12, 13, 14, 15, 16, + /* 260 */ 448, 449, 355, 108, 358, 453, 454, 133, 134, 127, + /* 270 */ 128, 364, 366, 4, 132, 443, 96, 371, 20, 373, + /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 43, + /* 290 */ 22, 45, 46, 327, 188, 189, 162, 163, 192, 335, + /* 300 */ 194, 33, 396, 35, 332, 21, 400, 335, 336, 403, + /* 310 */ 404, 405, 406, 407, 408, 181, 410, 183, 34, 96, + /* 320 */ 36, 415, 0, 417, 358, 0, 58, 421, 422, 373, + /* 330 */ 366, 63, 366, 246, 250, 251, 252, 371, 70, 373, + /* 340 */ 206, 207, 386, 209, 210, 211, 212, 213, 214, 215, + /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 360 */ 226, 227, 396, 229, 96, 96, 400, 372, 373, 403, + /* 370 */ 404, 405, 406, 407, 408, 429, 410, 96, 245, 433, + /* 380 */ 358, 415, 96, 417, 62, 327, 118, 421, 422, 425, + /* 390 */ 426, 427, 335, 429, 430, 449, 374, 433, 432, 453, + /* 400 */ 454, 133, 134, 8, 9, 335, 127, 12, 13, 14, + /* 410 */ 15, 16, 448, 449, 12, 13, 14, 453, 454, 349, + /* 420 */ 162, 163, 20, 62, 22, 245, 356, 327, 14, 371, + /* 430 */ 162, 163, 375, 108, 20, 33, 366, 35, 402, 332, + /* 440 */ 8, 9, 335, 336, 12, 13, 14, 15, 16, 181, + /* 450 */ 20, 183, 127, 128, 129, 130, 131, 132, 358, 14, + /* 460 */ 58, 180, 58, 182, 428, 20, 366, 387, 245, 190, + /* 470 */ 191, 371, 70, 373, 206, 207, 44, 209, 210, 211, + /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 490 */ 222, 223, 224, 225, 226, 227, 396, 358, 96, 95, + /* 500 */ 400, 20, 98, 403, 404, 405, 406, 407, 408, 429, + /* 510 */ 410, 344, 345, 433, 245, 415, 358, 417, 108, 380, + /* 520 */ 118, 421, 422, 327, 366, 20, 245, 341, 448, 449, + /* 530 */ 33, 245, 432, 453, 454, 133, 134, 127, 128, 129, + /* 540 */ 130, 131, 132, 1, 2, 48, 335, 327, 12, 13, + /* 550 */ 364, 54, 55, 56, 57, 58, 20, 0, 22, 335, + /* 560 */ 349, 344, 345, 405, 162, 163, 176, 371, 173, 33, + /* 570 */ 20, 35, 0, 349, 8, 9, 162, 366, 12, 13, + /* 580 */ 14, 15, 16, 181, 402, 183, 20, 197, 198, 80, + /* 590 */ 366, 371, 95, 21, 58, 98, 24, 25, 26, 27, + /* 600 */ 28, 29, 30, 31, 32, 206, 70, 162, 206, 207, + /* 610 */ 428, 209, 210, 211, 212, 213, 214, 215, 216, 217, + /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + /* 630 */ 12, 13, 96, 3, 20, 335, 35, 8, 9, 97, + /* 640 */ 22, 12, 13, 14, 15, 16, 62, 138, 139, 349, + /* 650 */ 20, 33, 358, 35, 118, 256, 257, 258, 259, 260, + /* 660 */ 327, 367, 165, 166, 269, 168, 366, 2, 171, 133, + /* 670 */ 134, 70, 327, 8, 9, 339, 58, 12, 13, 14, + /* 680 */ 15, 16, 12, 13, 187, 14, 15, 16, 70, 353, + /* 690 */ 20, 229, 22, 65, 66, 67, 19, 361, 162, 163, + /* 700 */ 20, 73, 74, 33, 371, 35, 78, 335, 335, 152, + /* 710 */ 33, 0, 84, 85, 164, 161, 371, 181, 90, 183, + /* 720 */ 327, 349, 349, 327, 22, 48, 97, 97, 58, 20, + /* 730 */ 164, 54, 55, 56, 57, 58, 118, 35, 366, 366, + /* 740 */ 70, 413, 206, 207, 416, 209, 210, 211, 212, 213, + /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + /* 760 */ 224, 225, 226, 227, 371, 327, 96, 371, 359, 335, + /* 770 */ 350, 335, 95, 62, 70, 98, 350, 229, 358, 231, + /* 780 */ 18, 0, 20, 349, 358, 349, 232, 367, 118, 27, + /* 790 */ 327, 327, 30, 367, 164, 33, 242, 45, 46, 181, + /* 800 */ 366, 183, 366, 133, 134, 327, 327, 2, 131, 371, + /* 810 */ 48, 70, 50, 8, 9, 53, 327, 12, 13, 14, + /* 820 */ 15, 16, 8, 9, 206, 207, 12, 13, 14, 15, + /* 830 */ 16, 327, 162, 163, 371, 371, 218, 219, 220, 221, + /* 840 */ 222, 223, 224, 39, 164, 168, 65, 66, 67, 371, + /* 850 */ 371, 181, 339, 183, 73, 74, 327, 95, 0, 78, + /* 860 */ 371, 414, 185, 416, 187, 84, 85, 366, 414, 107, + /* 870 */ 416, 90, 3, 164, 361, 371, 206, 207, 377, 209, + /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 351, 137, + /* 900 */ 371, 354, 140, 141, 142, 143, 144, 145, 146, 147, + /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 47, + /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 335, 71, + /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + /* 950 */ 92, 18, 327, 327, 20, 58, 23, 8, 9, 366, + /* 960 */ 22, 12, 13, 14, 15, 16, 360, 335, 96, 108, + /* 970 */ 37, 38, 368, 35, 41, 371, 335, 371, 164, 8, + /* 980 */ 9, 349, 327, 12, 13, 14, 15, 16, 366, 366, + /* 990 */ 349, 130, 59, 60, 61, 98, 371, 371, 366, 377, + /* 1000 */ 377, 368, 37, 44, 371, 399, 400, 366, 70, 327, + /* 1010 */ 335, 368, 63, 358, 371, 359, 410, 424, 425, 426, + /* 1020 */ 427, 366, 429, 430, 349, 346, 371, 348, 373, 96, + /* 1030 */ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + /* 1040 */ 119, 366, 121, 122, 123, 124, 125, 126, 244, 351, + /* 1050 */ 327, 396, 354, 371, 105, 400, 118, 335, 403, 404, + /* 1060 */ 405, 406, 407, 408, 99, 410, 101, 102, 135, 104, + /* 1070 */ 415, 349, 417, 108, 327, 35, 421, 422, 335, 243, + /* 1080 */ 244, 335, 0, 335, 335, 335, 335, 432, 366, 42, + /* 1090 */ 107, 44, 349, 44, 371, 130, 162, 349, 349, 349, + /* 1100 */ 349, 42, 63, 44, 22, 358, 173, 174, 175, 366, + /* 1110 */ 161, 178, 366, 366, 366, 366, 366, 366, 371, 181, + /* 1120 */ 373, 183, 35, 100, 100, 335, 103, 103, 335, 196, + /* 1130 */ 133, 134, 199, 264, 201, 202, 203, 204, 205, 44, + /* 1140 */ 157, 44, 349, 396, 206, 207, 97, 400, 44, 391, + /* 1150 */ 403, 404, 405, 406, 407, 408, 366, 410, 0, 366, + /* 1160 */ 387, 327, 415, 100, 417, 44, 103, 100, 421, 422, + /* 1170 */ 103, 425, 426, 427, 0, 429, 430, 359, 245, 432, + /* 1180 */ 22, 232, 233, 234, 235, 236, 237, 238, 239, 240, + /* 1190 */ 241, 242, 358, 164, 97, 328, 22, 359, 169, 44, + /* 1200 */ 366, 97, 429, 359, 327, 371, 433, 373, 44, 44, + /* 1210 */ 359, 44, 44, 1, 2, 425, 426, 427, 97, 429, + /* 1220 */ 430, 448, 449, 183, 381, 266, 453, 454, 347, 457, + /* 1230 */ 396, 13, 327, 44, 400, 358, 44, 403, 404, 405, + /* 1240 */ 406, 407, 408, 366, 410, 206, 13, 0, 371, 415, + /* 1250 */ 373, 417, 97, 35, 44, 421, 422, 96, 35, 446, + /* 1260 */ 337, 97, 97, 358, 97, 97, 432, 106, 35, 440, + /* 1270 */ 183, 366, 44, 396, 358, 327, 371, 400, 373, 44, + /* 1280 */ 403, 404, 405, 406, 407, 408, 97, 410, 44, 97, + /* 1290 */ 44, 337, 415, 70, 417, 381, 49, 334, 421, 422, + /* 1300 */ 387, 396, 370, 381, 431, 400, 358, 97, 403, 404, + /* 1310 */ 405, 406, 407, 408, 366, 410, 450, 423, 434, 371, + /* 1320 */ 415, 373, 417, 247, 398, 97, 421, 422, 48, 179, + /* 1330 */ 387, 389, 97, 397, 42, 378, 20, 381, 378, 161, + /* 1340 */ 327, 97, 429, 97, 396, 376, 433, 20, 400, 335, + /* 1350 */ 335, 403, 404, 405, 406, 407, 408, 378, 410, 94, + /* 1360 */ 376, 448, 449, 268, 327, 417, 453, 454, 376, 421, + /* 1370 */ 422, 358, 429, 343, 20, 329, 433, 335, 335, 366, + /* 1380 */ 335, 329, 20, 327, 371, 341, 373, 393, 20, 373, + /* 1390 */ 336, 448, 449, 20, 341, 358, 453, 454, 388, 341, + /* 1400 */ 336, 341, 341, 366, 335, 52, 341, 341, 371, 396, + /* 1410 */ 373, 338, 338, 400, 358, 329, 403, 404, 405, 406, + /* 1420 */ 407, 408, 366, 410, 335, 195, 358, 371, 358, 373, + /* 1430 */ 417, 329, 381, 396, 421, 422, 327, 400, 358, 358, + /* 1440 */ 403, 404, 405, 406, 407, 408, 358, 410, 358, 358, + /* 1450 */ 358, 358, 396, 339, 358, 371, 400, 327, 358, 403, + /* 1460 */ 404, 405, 406, 407, 408, 371, 410, 358, 186, 392, + /* 1470 */ 395, 393, 373, 417, 339, 366, 335, 421, 422, 381, + /* 1480 */ 371, 371, 373, 371, 255, 254, 371, 439, 358, 384, + /* 1490 */ 384, 371, 455, 456, 439, 261, 366, 172, 248, 442, + /* 1500 */ 263, 371, 262, 373, 265, 396, 398, 244, 437, 400, + /* 1510 */ 327, 360, 403, 404, 405, 406, 407, 408, 409, 410, + /* 1520 */ 411, 412, 371, 438, 441, 270, 396, 267, 366, 20, + /* 1530 */ 400, 452, 335, 403, 404, 405, 406, 407, 408, 402, + /* 1540 */ 410, 358, 439, 436, 336, 339, 371, 384, 371, 366, + /* 1550 */ 399, 400, 401, 371, 371, 371, 373, 371, 371, 458, + /* 1560 */ 384, 410, 451, 327, 166, 339, 339, 382, 354, 366, + /* 1570 */ 96, 96, 420, 362, 444, 445, 371, 335, 36, 396, + /* 1580 */ 348, 330, 339, 400, 327, 329, 403, 404, 405, 406, + /* 1590 */ 407, 408, 390, 410, 358, 394, 325, 352, 385, 340, + /* 1600 */ 417, 385, 366, 0, 352, 422, 327, 371, 0, 373, + /* 1610 */ 352, 188, 0, 0, 42, 358, 0, 35, 200, 35, + /* 1620 */ 35, 35, 200, 366, 0, 35, 35, 200, 371, 0, + /* 1630 */ 373, 200, 396, 0, 35, 0, 400, 358, 0, 403, + /* 1640 */ 404, 405, 406, 407, 408, 366, 410, 22, 183, 35, + /* 1650 */ 371, 181, 373, 396, 0, 0, 176, 400, 177, 0, + /* 1660 */ 403, 404, 405, 406, 407, 408, 0, 410, 47, 0, + /* 1670 */ 0, 0, 327, 42, 0, 396, 0, 0, 0, 400, + /* 1680 */ 152, 445, 403, 404, 405, 406, 407, 408, 0, 410, + /* 1690 */ 4, 0, 327, 0, 0, 35, 0, 152, 0, 0, + /* 1700 */ 0, 0, 0, 358, 447, 19, 0, 0, 363, 0, + /* 1710 */ 0, 366, 0, 0, 0, 0, 371, 0, 373, 33, + /* 1720 */ 0, 42, 0, 358, 0, 0, 0, 0, 0, 0, + /* 1730 */ 22, 366, 0, 136, 48, 456, 371, 0, 373, 53, + /* 1740 */ 0, 396, 0, 58, 58, 400, 35, 327, 403, 404, + /* 1750 */ 405, 406, 407, 408, 0, 410, 0, 0, 39, 14, + /* 1760 */ 42, 396, 14, 327, 0, 400, 0, 44, 403, 404, + /* 1770 */ 405, 406, 407, 408, 58, 410, 40, 412, 358, 0, + /* 1780 */ 47, 95, 47, 363, 98, 47, 366, 0, 39, 39, + /* 1790 */ 172, 371, 0, 373, 358, 0, 0, 0, 64, 363, + /* 1800 */ 0, 48, 366, 35, 39, 0, 327, 371, 35, 373, + /* 1810 */ 39, 48, 0, 39, 0, 35, 396, 48, 35, 0, + /* 1820 */ 400, 39, 0, 403, 404, 405, 406, 407, 408, 48, + /* 1830 */ 410, 0, 396, 0, 103, 105, 400, 358, 35, 403, + /* 1840 */ 404, 405, 406, 407, 408, 366, 410, 22, 0, 327, + /* 1850 */ 371, 35, 373, 35, 44, 35, 22, 44, 35, 35, + /* 1860 */ 0, 35, 35, 22, 0, 327, 22, 50, 0, 22, + /* 1870 */ 35, 0, 0, 35, 35, 396, 0, 22, 20, 400, + /* 1880 */ 358, 35, 403, 404, 405, 406, 407, 408, 366, 410, + /* 1890 */ 193, 35, 0, 371, 96, 373, 358, 35, 97, 0, + /* 1900 */ 22, 0, 0, 164, 366, 184, 3, 164, 97, 371, + /* 1910 */ 166, 373, 249, 44, 44, 164, 327, 170, 396, 44, + /* 1920 */ 228, 169, 400, 44, 96, 403, 404, 405, 406, 407, + /* 1930 */ 408, 47, 410, 327, 396, 253, 96, 47, 400, 169, + /* 1940 */ 97, 403, 404, 405, 406, 407, 408, 358, 410, 97, + /* 1950 */ 96, 3, 249, 96, 44, 366, 97, 96, 35, 96, + /* 1960 */ 371, 35, 373, 97, 358, 35, 35, 35, 35, 47, + /* 1970 */ 97, 97, 366, 44, 97, 47, 0, 371, 0, 373, + /* 1980 */ 0, 96, 167, 97, 97, 396, 0, 96, 327, 400, + /* 1990 */ 249, 96, 403, 404, 405, 406, 407, 408, 243, 410, + /* 2000 */ 96, 39, 396, 96, 106, 47, 400, 327, 44, 403, + /* 2010 */ 404, 405, 406, 407, 408, 165, 410, 228, 230, 358, + /* 2020 */ 2, 228, 22, 96, 47, 22, 47, 366, 107, 35, + /* 2030 */ 96, 327, 371, 97, 373, 206, 35, 97, 358, 96, + /* 2040 */ 208, 97, 96, 96, 35, 96, 366, 97, 97, 96, + /* 2050 */ 96, 371, 97, 373, 97, 35, 96, 396, 97, 35, + /* 2060 */ 97, 400, 358, 96, 403, 404, 405, 406, 407, 408, + /* 2070 */ 366, 410, 35, 22, 108, 371, 396, 373, 96, 120, + /* 2080 */ 400, 96, 44, 403, 404, 405, 406, 407, 408, 327, + /* 2090 */ 410, 120, 120, 120, 96, 35, 22, 63, 96, 64, + /* 2100 */ 396, 35, 35, 35, 400, 327, 35, 403, 404, 405, + /* 2110 */ 406, 407, 408, 35, 410, 35, 35, 35, 35, 35, + /* 2120 */ 358, 93, 70, 44, 22, 35, 35, 35, 366, 22, + /* 2130 */ 35, 35, 35, 371, 70, 373, 358, 22, 35, 35, + /* 2140 */ 0, 35, 48, 35, 366, 35, 35, 35, 327, 371, + /* 2150 */ 0, 373, 39, 35, 0, 39, 35, 48, 396, 39, + /* 2160 */ 0, 35, 400, 39, 327, 403, 404, 405, 406, 407, + /* 2170 */ 408, 48, 410, 48, 396, 22, 35, 35, 400, 358, + /* 2180 */ 0, 403, 404, 405, 406, 407, 408, 366, 410, 0, + /* 2190 */ 21, 21, 371, 22, 373, 358, 22, 20, 459, 459, + /* 2200 */ 459, 459, 459, 366, 459, 459, 459, 327, 371, 459, + /* 2210 */ 373, 459, 459, 459, 459, 459, 459, 396, 459, 459, + /* 2220 */ 459, 400, 459, 327, 403, 404, 405, 406, 407, 408, + /* 2230 */ 459, 410, 459, 396, 459, 459, 459, 400, 358, 459, + /* 2240 */ 403, 404, 405, 406, 407, 408, 366, 410, 459, 459, + /* 2250 */ 459, 371, 459, 373, 358, 459, 459, 459, 459, 459, + /* 2260 */ 459, 459, 366, 459, 459, 459, 327, 371, 459, 373, + /* 2270 */ 459, 459, 459, 459, 459, 459, 396, 459, 459, 459, + /* 2280 */ 400, 459, 459, 403, 404, 405, 406, 407, 408, 459, + /* 2290 */ 410, 459, 396, 459, 459, 459, 400, 358, 459, 403, + /* 2300 */ 404, 405, 406, 407, 408, 366, 410, 459, 459, 459, + /* 2310 */ 371, 459, 373, 459, 459, 459, 459, 327, 459, 459, + /* 2320 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2330 */ 459, 459, 459, 459, 327, 396, 459, 459, 459, 400, + /* 2340 */ 459, 459, 403, 404, 405, 406, 407, 408, 358, 410, + /* 2350 */ 459, 459, 459, 459, 459, 459, 366, 459, 459, 459, + /* 2360 */ 327, 371, 459, 373, 459, 358, 459, 459, 459, 459, + /* 2370 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, + /* 2380 */ 373, 459, 459, 459, 459, 459, 396, 459, 459, 459, + /* 2390 */ 400, 358, 459, 403, 404, 405, 406, 407, 408, 366, + /* 2400 */ 410, 459, 459, 396, 371, 459, 373, 400, 459, 459, + /* 2410 */ 403, 404, 405, 406, 407, 408, 327, 410, 459, 459, + /* 2420 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 396, + /* 2430 */ 459, 459, 327, 400, 459, 459, 403, 404, 405, 406, + /* 2440 */ 407, 408, 459, 410, 459, 459, 459, 358, 459, 459, + /* 2450 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, + /* 2460 */ 371, 459, 373, 358, 459, 459, 459, 459, 459, 459, + /* 2470 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, + /* 2480 */ 459, 459, 459, 459, 459, 396, 327, 459, 459, 400, + /* 2490 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, + /* 2500 */ 459, 396, 327, 459, 459, 400, 459, 459, 403, 404, + /* 2510 */ 405, 406, 407, 408, 459, 410, 459, 358, 459, 459, + /* 2520 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, + /* 2530 */ 371, 459, 373, 358, 459, 459, 459, 459, 459, 459, + /* 2540 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, + /* 2550 */ 459, 459, 459, 459, 459, 396, 459, 459, 459, 400, + /* 2560 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, + /* 2570 */ 459, 396, 459, 459, 459, 400, 459, 459, 403, 404, + /* 2580 */ 405, 406, 407, 408, 459, 410, }; -#define YY_SHIFT_COUNT (706) +#define YY_SHIFT_COUNT (714) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2151) +#define YY_SHIFT_MAX (2189) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 925, 0, 71, 0, 288, 288, 288, 288, 288, 288, - /* 10 */ 288, 288, 288, 359, 574, 574, 645, 574, 574, 574, - /* 20 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 30 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 40 */ 574, 574, 574, 574, 574, 574, 61, 315, 211, 516, - /* 50 */ 62, 356, 399, 356, 211, 211, 1054, 1054, 356, 1054, - /* 60 */ 1054, 104, 356, 12, 12, 512, 512, 158, 31, 187, - /* 70 */ 187, 12, 12, 12, 12, 12, 12, 12, 12, 12, - /* 80 */ 12, 76, 12, 12, 168, 12, 442, 12, 12, 536, - /* 90 */ 12, 12, 536, 12, 536, 536, 536, 12, 498, 783, - /* 100 */ 34, 34, 162, 502, 1297, 1297, 1297, 1297, 1297, 1297, - /* 110 */ 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, - /* 120 */ 1297, 1297, 1297, 1298, 968, 158, 31, 661, 402, 217, - /* 130 */ 217, 217, 668, 312, 312, 402, 572, 572, 572, 508, - /* 140 */ 442, 3, 3, 393, 536, 536, 569, 569, 508, 576, - /* 150 */ 215, 215, 215, 215, 215, 215, 215, 571, 655, 522, - /* 160 */ 451, 867, 59, 327, 95, 591, 712, 573, 726, 479, - /* 170 */ 694, 733, 214, 964, 936, 214, 1059, 244, 864, 1036, - /* 180 */ 1262, 1145, 1283, 1307, 1283, 1187, 1330, 1330, 1283, 1187, - /* 190 */ 1187, 1266, 1330, 1330, 1330, 1361, 1361, 1365, 76, 442, - /* 200 */ 76, 1373, 1375, 76, 1373, 76, 76, 76, 1330, 76, - /* 210 */ 1357, 1357, 1361, 536, 536, 536, 536, 536, 536, 536, - /* 220 */ 536, 536, 536, 536, 1330, 1361, 569, 1245, 1365, 498, - /* 230 */ 1264, 442, 498, 1330, 1307, 1307, 569, 1202, 1205, 569, - /* 240 */ 1202, 1205, 569, 569, 536, 1199, 1317, 1202, 1240, 1242, - /* 250 */ 1258, 1036, 1241, 1243, 1247, 1270, 572, 1495, 1330, 1373, - /* 260 */ 498, 1205, 569, 569, 569, 569, 569, 1205, 569, 1367, - /* 270 */ 498, 508, 498, 572, 1445, 1448, 569, 576, 1330, 498, - /* 280 */ 1528, 1361, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 826, - /* 290 */ 92, 742, 587, 418, 15, 735, 374, 832, 400, 941, - /* 300 */ 941, 544, 941, 941, 941, 941, 941, 941, 941, 987, - /* 310 */ 314, 51, 410, 73, 73, 167, 666, 180, 19, 292, - /* 320 */ 121, 99, 406, 121, 121, 121, 929, 829, 1071, 1066, - /* 330 */ 989, 1007, 933, 945, 1064, 1113, 1146, 1154, 1190, 986, - /* 340 */ 1134, 1181, 1078, 907, 323, 260, 1182, 1183, 1186, 1189, - /* 350 */ 1191, 981, 1193, 1040, 1084, 58, 1206, 1144, 1223, 1224, - /* 360 */ 1249, 1260, 1273, 1274, 1051, 1276, 1301, 1211, 1284, 1576, - /* 370 */ 1578, 1393, 1581, 1582, 1541, 1584, 1551, 1388, 1553, 1554, - /* 380 */ 1556, 1394, 1592, 1559, 1560, 1397, 1597, 1400, 1601, 1567, - /* 390 */ 1606, 1593, 1613, 1583, 1435, 1439, 1620, 1621, 1446, 1450, - /* 400 */ 1623, 1626, 1580, 1630, 1633, 1634, 1599, 1643, 1644, 1645, - /* 410 */ 1646, 1647, 1648, 1650, 1651, 1501, 1618, 1656, 1506, 1659, - /* 420 */ 1660, 1667, 1669, 1670, 1671, 1672, 1673, 1680, 1681, 1682, - /* 430 */ 1683, 1684, 1685, 1687, 1635, 1678, 1688, 1689, 1690, 1695, - /* 440 */ 1653, 1676, 1696, 1697, 1557, 1693, 1698, 1665, 1702, 1649, - /* 450 */ 1703, 1652, 1704, 1706, 1666, 1677, 1668, 1662, 1701, 1664, - /* 460 */ 1705, 1674, 1717, 1686, 1691, 1722, 1723, 1725, 1700, 1558, - /* 470 */ 1727, 1740, 1741, 1699, 1742, 1744, 1710, 1708, 1707, 1748, - /* 480 */ 1714, 1712, 1726, 1761, 1729, 1718, 1728, 1762, 1734, 1724, - /* 490 */ 1731, 1771, 1774, 1775, 1777, 1679, 1709, 1743, 1757, 1782, - /* 500 */ 1750, 1751, 1765, 1753, 1755, 1747, 1749, 1760, 1763, 1770, - /* 510 */ 1764, 1796, 1778, 1803, 1783, 1758, 1807, 1787, 1786, 1822, - /* 520 */ 1790, 1828, 1794, 1830, 1811, 1823, 1745, 1752, 1846, 1713, - /* 530 */ 1815, 1851, 1711, 1833, 1730, 1720, 1852, 1864, 1732, 1736, - /* 540 */ 1863, 1821, 1624, 1772, 1776, 1793, 1789, 1827, 1800, 1795, - /* 550 */ 1812, 1813, 1801, 1866, 1860, 1865, 1818, 1867, 1694, 1831, - /* 560 */ 1832, 1913, 1875, 1721, 1895, 1897, 1899, 1900, 1901, 1902, - /* 570 */ 1841, 1842, 1893, 1715, 1903, 1896, 1944, 1945, 1948, 1853, - /* 580 */ 1854, 1855, 1857, 1915, 1920, 1766, 1962, 1877, 1805, 1878, - /* 590 */ 1975, 1937, 1814, 1881, 1873, 1662, 1934, 1938, 1756, 1768, - /* 600 */ 1773, 1984, 1967, 1785, 1906, 1904, 1907, 1908, 1910, 1911, - /* 610 */ 1957, 1916, 1917, 1960, 1912, 1993, 1804, 1929, 1919, 1926, - /* 620 */ 1992, 1994, 1932, 1935, 1996, 1939, 1936, 1999, 1940, 1942, - /* 630 */ 2002, 1946, 1943, 2006, 1950, 1924, 1928, 1930, 1931, 2027, - /* 640 */ 1949, 1956, 1958, 2018, 1965, 2012, 2012, 2036, 2000, 2003, - /* 650 */ 2028, 2030, 2032, 2034, 2035, 2038, 2039, 2046, 2049, 2051, - /* 660 */ 2001, 1995, 2043, 2056, 2065, 2079, 2067, 2082, 2071, 2072, - /* 670 */ 2074, 2040, 1747, 2076, 1749, 2077, 2078, 2080, 2081, 2086, - /* 680 */ 2083, 2117, 2084, 2075, 2085, 2120, 2090, 2096, 2091, 2121, - /* 690 */ 2098, 2097, 2092, 2134, 2106, 2099, 2107, 2148, 2114, 2115, - /* 700 */ 2151, 2131, 2133, 2145, 2146, 2137, 2135, + /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, + /* 10 */ 268, 268, 268, 268, 268, 402, 536, 536, 670, 536, + /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 40 */ 536, 536, 536, 536, 536, 536, 536, 536, 180, 223, + /* 50 */ 39, 281, 133, 1, 286, 1, 39, 39, 618, 618, + /* 60 */ 1, 618, 618, 269, 1, 188, 188, 246, 246, 258, + /* 70 */ 18, 42, 42, 188, 188, 188, 188, 188, 188, 188, + /* 80 */ 188, 188, 188, 361, 188, 188, 430, 188, 481, 188, + /* 90 */ 188, 505, 188, 188, 505, 188, 505, 505, 505, 188, + /* 100 */ 584, 762, 949, 949, 96, 628, 938, 938, 938, 938, + /* 110 */ 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, + /* 120 */ 938, 938, 938, 938, 938, 965, 630, 258, 18, 322, + /* 130 */ 601, 550, 550, 550, 711, 548, 548, 601, 614, 614, + /* 140 */ 614, 137, 481, 462, 505, 704, 505, 704, 704, 137, + /* 150 */ 741, 921, 921, 921, 921, 921, 921, 921, 677, 572, + /* 160 */ 781, 566, 395, 399, 151, 84, 414, 445, 144, 680, + /* 170 */ 752, 861, 709, 836, 804, 869, 836, 1047, 87, 934, + /* 180 */ 1076, 1280, 1150, 1292, 1316, 1292, 1178, 1327, 1327, 1292, + /* 190 */ 1178, 1178, 1265, 1327, 1327, 1327, 1354, 1354, 1362, 361, + /* 200 */ 481, 361, 1368, 1373, 361, 1368, 361, 361, 361, 1327, + /* 210 */ 361, 1353, 1353, 1354, 505, 505, 505, 505, 505, 505, + /* 220 */ 505, 505, 505, 505, 505, 1327, 1354, 704, 704, 1230, + /* 230 */ 1362, 584, 1282, 481, 584, 1327, 1316, 1316, 704, 1229, + /* 240 */ 1231, 704, 1229, 1231, 704, 704, 505, 1234, 1325, 1229, + /* 250 */ 1237, 1240, 1250, 1076, 1255, 1260, 1239, 1263, 614, 1509, + /* 260 */ 1327, 1368, 584, 1231, 704, 704, 704, 704, 704, 1231, + /* 270 */ 704, 1398, 584, 137, 584, 614, 1474, 1475, 704, 741, + /* 280 */ 1327, 584, 1542, 1354, 2586, 2586, 2586, 2586, 2586, 2586, + /* 290 */ 2586, 2586, 2586, 858, 497, 23, 1686, 52, 432, 629, + /* 300 */ 155, 665, 805, 814, 325, 971, 971, 971, 971, 971, + /* 310 */ 971, 971, 971, 971, 410, 106, 243, 243, 390, 404, + /* 320 */ 509, 284, 279, 142, 142, 671, 542, 554, 671, 671, + /* 330 */ 671, 1049, 148, 702, 1059, 983, 557, 1023, 1024, 1063, + /* 340 */ 1067, 1082, 1158, 1174, 897, 1097, 1104, 997, 959, 1095, + /* 350 */ 1029, 1121, 1155, 1164, 1165, 1167, 1212, 1168, 1040, 1087, + /* 360 */ 1039, 1189, 872, 1192, 1210, 1228, 1235, 1244, 1246, 1161, + /* 370 */ 1218, 1233, 1223, 1247, 1603, 1608, 1423, 1612, 1613, 1572, + /* 380 */ 1616, 1582, 1418, 1584, 1585, 1586, 1422, 1624, 1590, 1591, + /* 390 */ 1427, 1629, 1431, 1633, 1599, 1635, 1625, 1638, 1614, 1465, + /* 400 */ 1470, 1654, 1655, 1481, 1480, 1659, 1666, 1621, 1669, 1670, + /* 410 */ 1671, 1631, 1674, 1676, 1677, 1678, 1688, 1691, 1693, 1694, + /* 420 */ 1528, 1660, 1696, 1545, 1698, 1699, 1700, 1701, 1702, 1706, + /* 430 */ 1707, 1709, 1710, 1712, 1713, 1714, 1715, 1717, 1720, 1679, + /* 440 */ 1722, 1724, 1725, 1726, 1727, 1708, 1728, 1729, 1732, 1597, + /* 450 */ 1737, 1740, 1711, 1742, 1685, 1754, 1716, 1756, 1757, 1718, + /* 460 */ 1719, 1723, 1733, 1745, 1735, 1748, 1738, 1764, 1736, 1749, + /* 470 */ 1766, 1779, 1787, 1750, 1618, 1792, 1795, 1796, 1734, 1797, + /* 480 */ 1800, 1768, 1753, 1765, 1805, 1773, 1763, 1771, 1812, 1780, + /* 490 */ 1769, 1774, 1814, 1783, 1781, 1782, 1819, 1822, 1831, 1833, + /* 500 */ 1730, 1731, 1803, 1825, 1848, 1816, 1818, 1820, 1823, 1810, + /* 510 */ 1813, 1824, 1826, 1834, 1827, 1860, 1841, 1864, 1844, 1817, + /* 520 */ 1868, 1847, 1835, 1871, 1838, 1872, 1839, 1876, 1855, 1858, + /* 530 */ 1846, 1856, 1697, 1801, 1798, 1892, 1739, 1862, 1899, 1721, + /* 540 */ 1878, 1743, 1744, 1901, 1902, 1751, 1747, 1903, 1869, 1663, + /* 550 */ 1828, 1811, 1840, 1752, 1692, 1770, 1682, 1843, 1870, 1852, + /* 560 */ 1854, 1857, 1861, 1859, 1875, 1884, 1890, 1863, 1879, 1703, + /* 570 */ 1866, 1873, 1948, 1910, 1741, 1923, 1926, 1930, 1931, 1932, + /* 580 */ 1933, 1874, 1877, 1922, 1755, 1929, 1928, 1976, 1978, 1980, + /* 590 */ 1885, 1886, 1887, 1891, 1895, 1815, 1904, 1986, 1962, 1850, + /* 600 */ 1907, 1898, 1733, 1958, 1964, 1789, 1788, 1793, 2018, 2000, + /* 610 */ 1829, 1927, 1936, 1934, 1940, 1943, 1944, 1977, 1946, 1947, + /* 620 */ 1979, 1950, 2003, 1832, 1949, 1921, 1951, 1994, 2001, 1953, + /* 630 */ 1955, 2009, 1954, 1957, 2020, 1960, 1961, 2024, 1967, 1963, + /* 640 */ 2037, 1982, 1959, 1971, 1972, 1973, 2051, 1966, 1985, 2038, + /* 650 */ 1998, 2060, 2002, 2038, 2038, 2074, 2035, 2034, 2066, 2067, + /* 660 */ 2068, 2071, 2078, 2080, 2081, 2082, 2083, 2084, 2052, 2028, + /* 670 */ 2079, 2090, 2091, 2102, 2092, 2107, 2095, 2096, 2097, 2064, + /* 680 */ 1810, 2103, 1813, 2104, 2106, 2108, 2110, 2115, 2111, 2140, + /* 690 */ 2112, 2094, 2113, 2150, 2118, 2109, 2116, 2154, 2121, 2123, + /* 700 */ 2120, 2160, 2126, 2125, 2124, 2180, 2141, 2142, 2189, 2153, + /* 710 */ 2169, 2171, 2174, 2170, 2177, }; -#define YY_REDUCE_COUNT (288) -#define YY_REDUCE_MIN (-425) -#define YY_REDUCE_MAX (2136) +#define YY_REDUCE_COUNT (292) +#define YY_REDUCE_MIN (-424) +#define YY_REDUCE_MAX (2175) static const short yy_reduce_ofst[] = { - /* 0 */ -76, -288, 286, 597, 650, 737, 780, 851, 894, 937, - /* 10 */ 961, 1019, 1062, 1090, -2, 83, 1149, 1207, 1235, 1261, - /* 20 */ 1331, 1350, 1413, 1434, 1456, 1477, 1499, 1520, 1563, 1591, - /* 30 */ 1617, 1675, 1692, 1735, 1759, 1802, 1819, 1845, 1862, 1905, - /* 40 */ 1927, 1989, 2011, 2073, 2093, 2136, -253, -196, 290, -385, - /* 50 */ -374, -323, 584, 778, 395, 659, -212, 764, 28, 408, - /* 60 */ 681, -425, -352, 72, 270, -324, -313, -339, -215, 23, - /* 70 */ 64, 267, 285, 331, 613, 615, 626, 649, 695, 700, - /* 80 */ 728, 298, 660, 748, 22, 790, -326, 833, 842, -345, - /* 90 */ 854, 857, -260, 869, 287, -190, 354, 710, 7, -189, - /* 100 */ -407, -407, -305, -233, -125, -66, 151, 193, 194, 221, - /* 110 */ 294, 340, 357, 407, 413, 484, 504, 506, 518, 519, - /* 120 */ 596, 651, 656, -56, -257, 283, -301, -185, -38, -257, - /* 130 */ 11, 412, 111, 401, 533, 18, -172, 234, 446, 411, - /* 140 */ 78, 586, 595, 425, -291, 468, 520, 628, 680, 727, - /* 150 */ 320, 328, 363, 493, 652, 684, 715, 321, 673, 765, - /* 160 */ 731, 698, 670, 825, 756, 840, 840, 868, 860, 908, - /* 170 */ 874, 865, 814, 814, 798, 814, 827, 871, 840, 914, - /* 180 */ 921, 935, 951, 950, 970, 975, 1020, 1021, 984, 996, - /* 190 */ 999, 1033, 1044, 1045, 1046, 1057, 1058, 997, 1052, 1022, - /* 200 */ 1053, 1061, 1010, 1060, 1068, 1065, 1067, 1069, 1072, 1070, - /* 210 */ 1075, 1076, 1087, 1063, 1074, 1079, 1080, 1081, 1085, 1086, - /* 220 */ 1088, 1089, 1091, 1092, 1095, 1105, 1082, 1050, 1077, 1112, - /* 230 */ 1094, 1100, 1115, 1120, 1083, 1093, 1104, 1038, 1097, 1107, - /* 240 */ 1049, 1101, 1118, 1121, 840, 1096, 1073, 1098, 1102, 1099, - /* 250 */ 1103, 1111, 1055, 1106, 1109, 814, 1151, 1117, 1188, 1185, - /* 260 */ 1192, 1140, 1155, 1156, 1157, 1158, 1159, 1141, 1161, 1160, - /* 270 */ 1194, 1196, 1204, 1175, 1126, 1201, 1177, 1203, 1226, 1225, - /* 280 */ 1238, 1246, 1178, 1195, 1218, 1220, 1222, 1236, 1252, + /* 0 */ -188, -327, -228, -168, -34, 100, 655, 747, 834, -94, + /* 10 */ 877, 905, 948, 1013, 1056, 1109, 1130, 1037, 1183, 1236, + /* 20 */ 1257, 1279, 1345, 1365, 1420, 1436, 1479, 1522, 1538, 1589, + /* 30 */ 1606, 1661, 1680, 1704, 1762, 1778, 1821, 1837, 1880, 1896, + /* 40 */ 1939, 1990, 2007, 2033, 2089, 2105, 2159, 2175, -36, -347, + /* 50 */ 593, -344, 80, 773, 913, 943, 746, 790, -260, 1151, + /* 60 */ -424, -268, 606, -412, -54, -237, 70, -330, -259, -265, + /* 70 */ -212, -28, 107, -309, -165, 211, 224, 300, 372, 373, + /* 80 */ 434, 436, 632, -93, 641, 675, 158, 722, -367, 743, + /* 90 */ 748, -322, 749, 750, -221, 751, 420, -200, 426, 793, + /* 100 */ 336, 57, -411, -411, -294, -332, 58, 196, 220, 333, + /* 110 */ 345, 393, 396, 438, 463, 464, 478, 479, 489, 504, + /* 120 */ 529, 625, 626, 682, 723, -286, -315, 139, -5, 186, + /* 130 */ 167, -315, 36, 182, 513, 447, 454, 217, 501, 622, + /* 140 */ 623, 547, -44, 328, 294, 604, 22, 633, 643, 698, + /* 150 */ 679, -357, 409, 656, 818, 838, 844, 851, 758, 867, + /* 160 */ 881, 843, 772, 813, 923, 829, 916, 916, 954, 914, + /* 170 */ 963, 932, 922, 873, 873, 866, 873, 894, 884, 916, + /* 180 */ 926, 936, 942, 957, 956, 960, 969, 1014, 1015, 979, + /* 190 */ 984, 992, 1030, 1042, 1043, 1045, 1046, 1052, 994, 1044, + /* 200 */ 1016, 1053, 1054, 1010, 1058, 1064, 1060, 1061, 1065, 1069, + /* 210 */ 1066, 1073, 1074, 1086, 1068, 1070, 1080, 1081, 1088, 1090, + /* 220 */ 1091, 1092, 1093, 1096, 1100, 1089, 1102, 1084, 1094, 1075, + /* 230 */ 1078, 1114, 1077, 1099, 1135, 1141, 1051, 1098, 1110, 1048, + /* 240 */ 1105, 1112, 1055, 1106, 1115, 1120, 916, 1057, 1083, 1103, + /* 250 */ 1085, 1071, 1107, 1108, 1101, 1079, 1111, 873, 1162, 1137, + /* 260 */ 1197, 1208, 1206, 1163, 1175, 1177, 1182, 1184, 1186, 1176, + /* 270 */ 1187, 1185, 1226, 1214, 1227, 1203, 1152, 1211, 1205, 1232, + /* 280 */ 1242, 1243, 1251, 1256, 1202, 1201, 1213, 1216, 1245, 1252, + /* 290 */ 1258, 1259, 1271, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 10 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 20 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 30 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 40 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 50 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 60 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1843, 1587, 1587, - /* 70 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 80 */ 1587, 1665, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 90 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1663, 1836, - /* 100 */ 2032, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 110 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 120 */ 1587, 1587, 1587, 1587, 2044, 1587, 1587, 1665, 1587, 2044, - /* 130 */ 2044, 2044, 1663, 2004, 2004, 1587, 1587, 1587, 1587, 1774, - /* 140 */ 1587, 1885, 1885, 1587, 1587, 1587, 1587, 1587, 1774, 1587, - /* 150 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1879, 1587, 1587, - /* 160 */ 2069, 2122, 1587, 1587, 2072, 1587, 1587, 1587, 1848, 1587, - /* 170 */ 1727, 2059, 2036, 2050, 2106, 2037, 2034, 2053, 1587, 2063, - /* 180 */ 1587, 1872, 1841, 1587, 1841, 1838, 1587, 1587, 1841, 1838, - /* 190 */ 1838, 1718, 1587, 1587, 1587, 1587, 1587, 1587, 1665, 1587, - /* 200 */ 1665, 1587, 1587, 1665, 1587, 1665, 1665, 1665, 1587, 1665, - /* 210 */ 1644, 1644, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 220 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1892, 1587, 1663, - /* 230 */ 1881, 1587, 1663, 1587, 1587, 1587, 1587, 2079, 2077, 1587, - /* 240 */ 2079, 2077, 1587, 1587, 1587, 2091, 2087, 2079, 2095, 2093, - /* 250 */ 2065, 2063, 2125, 2112, 2108, 2050, 1587, 1587, 1587, 1587, - /* 260 */ 1663, 2077, 1587, 1587, 1587, 1587, 1587, 2077, 1587, 1587, - /* 270 */ 1663, 1587, 1663, 1587, 1587, 1743, 1587, 1587, 1587, 1663, - /* 280 */ 1619, 1587, 1874, 1885, 1777, 1777, 1777, 1666, 1592, 1587, - /* 290 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 2090, - /* 300 */ 2089, 1587, 1960, 1587, 2008, 2007, 2006, 1997, 1959, 1587, - /* 310 */ 1739, 1587, 1587, 1958, 1957, 1587, 1587, 1587, 1587, 1587, - /* 320 */ 1951, 1587, 1587, 1952, 1950, 1949, 1587, 1587, 1587, 1587, - /* 330 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 340 */ 1587, 1587, 1587, 2109, 2113, 1587, 1587, 1587, 1587, 1587, - /* 350 */ 1587, 2033, 1587, 1587, 1587, 1587, 1587, 1934, 1587, 1587, - /* 360 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 370 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 380 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 390 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 400 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 410 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 420 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 430 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 440 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 450 */ 1587, 1587, 1587, 1587, 1587, 1587, 1624, 1939, 1587, 1587, - /* 460 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 470 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 480 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 490 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 500 */ 1587, 1587, 1587, 1587, 1587, 1705, 1704, 1587, 1587, 1587, - /* 510 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 520 */ 1587, 1587, 1587, 1587, 1587, 1587, 1942, 1587, 1587, 1587, - /* 530 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 540 */ 2105, 2066, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 550 */ 1587, 1587, 1587, 1587, 1587, 1934, 1587, 2088, 1587, 1587, - /* 560 */ 2103, 1587, 2107, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 570 */ 2043, 2039, 1587, 1587, 2035, 1587, 1587, 1587, 1587, 1587, - /* 580 */ 1587, 1587, 1587, 1587, 1587, 1587, 1889, 1587, 1587, 1587, - /* 590 */ 1587, 1587, 1587, 1587, 1587, 1933, 1587, 1994, 1587, 1587, - /* 600 */ 1587, 2028, 1587, 1587, 1979, 1587, 1587, 1587, 1587, 1587, - /* 610 */ 1587, 1587, 1587, 1587, 1942, 1587, 1945, 1587, 1587, 1587, - /* 620 */ 1587, 1587, 1771, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 630 */ 1587, 1587, 1587, 1587, 1587, 1756, 1754, 1753, 1752, 1587, - /* 640 */ 1749, 1587, 1587, 1587, 1587, 1780, 1779, 1587, 1587, 1587, - /* 650 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 660 */ 1587, 1587, 1685, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 670 */ 1587, 1587, 1676, 1587, 1675, 1587, 1587, 1587, 1587, 1587, - /* 680 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 690 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 700 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, + /* 0 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 10 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 20 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 30 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 40 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 50 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 60 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1853, + /* 70 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 80 */ 1597, 1597, 1597, 1675, 1597, 1597, 1597, 1597, 1597, 1597, + /* 90 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 100 */ 1673, 1846, 2043, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 110 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 120 */ 1597, 1597, 1597, 1597, 1597, 1597, 2055, 1597, 1597, 1675, + /* 130 */ 1597, 2055, 2055, 2055, 1673, 2015, 2015, 1597, 1597, 1597, + /* 140 */ 1597, 1783, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1783, + /* 150 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1890, 1597, + /* 160 */ 1597, 2080, 2134, 1597, 1597, 2083, 1597, 1597, 1597, 1858, + /* 170 */ 1597, 1736, 2070, 2047, 2061, 2118, 2048, 2045, 2064, 1597, + /* 180 */ 2074, 1597, 1883, 1851, 1597, 1851, 1848, 1597, 1597, 1851, + /* 190 */ 1848, 1848, 1727, 1597, 1597, 1597, 1597, 1597, 1597, 1675, + /* 200 */ 1597, 1675, 1597, 1597, 1675, 1597, 1675, 1675, 1675, 1597, + /* 210 */ 1675, 1654, 1654, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 220 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1903, + /* 230 */ 1597, 1673, 1892, 1597, 1673, 1597, 1597, 1597, 1597, 2091, + /* 240 */ 2089, 1597, 2091, 2089, 1597, 1597, 1597, 2103, 2099, 2091, + /* 250 */ 2107, 2105, 2076, 2074, 2137, 2124, 2120, 2061, 1597, 1597, + /* 260 */ 1597, 1597, 1673, 2089, 1597, 1597, 1597, 1597, 1597, 2089, + /* 270 */ 1597, 1597, 1673, 1597, 1673, 1597, 1597, 1752, 1597, 1597, + /* 280 */ 1597, 1673, 1629, 1597, 1885, 1896, 1868, 1868, 1786, 1786, + /* 290 */ 1786, 1676, 1602, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 300 */ 1597, 1597, 1597, 1597, 1597, 2102, 2101, 1971, 1597, 2019, + /* 310 */ 2018, 2017, 2008, 1970, 1748, 1597, 1969, 1968, 1597, 1597, + /* 320 */ 1597, 1597, 1597, 1864, 1863, 1962, 1597, 1597, 1963, 1961, + /* 330 */ 1960, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 340 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 2121, 2125, + /* 350 */ 1597, 1597, 1597, 1597, 1597, 1597, 2044, 1597, 1597, 1597, + /* 360 */ 1597, 1597, 1945, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 370 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 380 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 390 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 400 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 410 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 420 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 430 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 440 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 450 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 460 */ 1597, 1634, 1950, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 470 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 480 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 490 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 500 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1715, + /* 510 */ 1714, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 520 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 530 */ 1597, 1597, 1597, 1953, 1597, 1597, 1597, 1597, 1597, 1597, + /* 540 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 2117, 2077, 1597, + /* 550 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 560 */ 1597, 1597, 1597, 1597, 1597, 1597, 1945, 1597, 2100, 1597, + /* 570 */ 1597, 2115, 1597, 2119, 1597, 1597, 1597, 1597, 1597, 1597, + /* 580 */ 1597, 2054, 2050, 1597, 1597, 2046, 1597, 1597, 1597, 1597, + /* 590 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 600 */ 1597, 1597, 1944, 1597, 2005, 1597, 1597, 1597, 2039, 1597, + /* 610 */ 1597, 1990, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 620 */ 1597, 1953, 1597, 1956, 1597, 1597, 1597, 1597, 1597, 1780, + /* 630 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 640 */ 1597, 1597, 1765, 1763, 1762, 1761, 1597, 1758, 1597, 1793, + /* 650 */ 1597, 1597, 1597, 1789, 1788, 1597, 1597, 1597, 1597, 1597, + /* 660 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 670 */ 1695, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 680 */ 1686, 1597, 1685, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 690 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 700 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, + /* 710 */ 1597, 1597, 1597, 1597, 1597, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1064,6 +1075,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* ROLLUP => nothing */ 0, /* TTL => nothing */ 0, /* SMA => nothing */ + 0, /* DELETE_MARK => nothing */ 0, /* FIRST => nothing */ 0, /* LAST => nothing */ 0, /* SHOW => nothing */ @@ -1159,7 +1171,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 268, /* END => ABORT */ + 271, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1183,6 +1195,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* BY => nothing */ 0, /* SESSION => nothing */ 0, /* STATE_WINDOW => nothing */ + 0, /* EVENT_WINDOW => nothing */ + 0, /* START => nothing */ 0, /* SLIDING => nothing */ 0, /* FILL => nothing */ 0, /* VALUE => nothing */ @@ -1201,58 +1215,58 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 268, /* AFTER => ABORT */ - 268, /* ATTACH => ABORT */ - 268, /* BEFORE => ABORT */ - 268, /* BEGIN => ABORT */ - 268, /* BITAND => ABORT */ - 268, /* BITNOT => ABORT */ - 268, /* BITOR => ABORT */ - 268, /* BLOCKS => ABORT */ - 268, /* CHANGE => ABORT */ - 268, /* COMMA => ABORT */ - 268, /* COMPACT => ABORT */ - 268, /* CONCAT => ABORT */ - 268, /* CONFLICT => ABORT */ - 268, /* COPY => ABORT */ - 268, /* DEFERRED => ABORT */ - 268, /* DELIMITERS => ABORT */ - 268, /* DETACH => ABORT */ - 268, /* DIVIDE => ABORT */ - 268, /* DOT => ABORT */ - 268, /* EACH => ABORT */ - 268, /* FAIL => ABORT */ - 268, /* FILE => ABORT */ - 268, /* FOR => ABORT */ - 268, /* GLOB => ABORT */ - 268, /* ID => ABORT */ - 268, /* IMMEDIATE => ABORT */ - 268, /* IMPORT => ABORT */ - 268, /* INITIALLY => ABORT */ - 268, /* INSTEAD => ABORT */ - 268, /* ISNULL => ABORT */ - 268, /* KEY => ABORT */ - 268, /* MODULES => ABORT */ - 268, /* NK_BITNOT => ABORT */ - 268, /* NK_SEMI => ABORT */ - 268, /* NOTNULL => ABORT */ - 268, /* OF => ABORT */ - 268, /* PLUS => ABORT */ - 268, /* PRIVILEGE => ABORT */ - 268, /* RAISE => ABORT */ - 268, /* REPLACE => ABORT */ - 268, /* RESTRICT => ABORT */ - 268, /* ROW => ABORT */ - 268, /* SEMI => ABORT */ - 268, /* STAR => ABORT */ - 268, /* STATEMENT => ABORT */ - 268, /* STRING => ABORT */ - 268, /* TIMES => ABORT */ - 268, /* UPDATE => ABORT */ - 268, /* VALUES => ABORT */ - 268, /* VARIABLE => ABORT */ - 268, /* VIEW => ABORT */ - 268, /* WAL => ABORT */ + 271, /* AFTER => ABORT */ + 271, /* ATTACH => ABORT */ + 271, /* BEFORE => ABORT */ + 271, /* BEGIN => ABORT */ + 271, /* BITAND => ABORT */ + 271, /* BITNOT => ABORT */ + 271, /* BITOR => ABORT */ + 271, /* BLOCKS => ABORT */ + 271, /* CHANGE => ABORT */ + 271, /* COMMA => ABORT */ + 271, /* COMPACT => ABORT */ + 271, /* CONCAT => ABORT */ + 271, /* CONFLICT => ABORT */ + 271, /* COPY => ABORT */ + 271, /* DEFERRED => ABORT */ + 271, /* DELIMITERS => ABORT */ + 271, /* DETACH => ABORT */ + 271, /* DIVIDE => ABORT */ + 271, /* DOT => ABORT */ + 271, /* EACH => ABORT */ + 271, /* FAIL => ABORT */ + 271, /* FILE => ABORT */ + 271, /* FOR => ABORT */ + 271, /* GLOB => ABORT */ + 271, /* ID => ABORT */ + 271, /* IMMEDIATE => ABORT */ + 271, /* IMPORT => ABORT */ + 271, /* INITIALLY => ABORT */ + 271, /* INSTEAD => ABORT */ + 271, /* ISNULL => ABORT */ + 271, /* KEY => ABORT */ + 271, /* MODULES => ABORT */ + 271, /* NK_BITNOT => ABORT */ + 271, /* NK_SEMI => ABORT */ + 271, /* NOTNULL => ABORT */ + 271, /* OF => ABORT */ + 271, /* PLUS => ABORT */ + 271, /* PRIVILEGE => ABORT */ + 271, /* RAISE => ABORT */ + 271, /* REPLACE => ABORT */ + 271, /* RESTRICT => ABORT */ + 271, /* ROW => ABORT */ + 271, /* SEMI => ABORT */ + 271, /* STAR => ABORT */ + 271, /* STATEMENT => ABORT */ + 271, /* STRING => ABORT */ + 271, /* TIMES => ABORT */ + 271, /* UPDATE => ABORT */ + 271, /* VALUES => ABORT */ + 271, /* VARIABLE => ABORT */ + 271, /* VIEW => ABORT */ + 271, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1472,330 +1486,333 @@ static const char *const yyTokenName[] = { /* 129 */ "ROLLUP", /* 130 */ "TTL", /* 131 */ "SMA", - /* 132 */ "FIRST", - /* 133 */ "LAST", - /* 134 */ "SHOW", - /* 135 */ "PRIVILEGES", - /* 136 */ "DATABASES", - /* 137 */ "TABLES", - /* 138 */ "STABLES", - /* 139 */ "MNODES", - /* 140 */ "QNODES", - /* 141 */ "FUNCTIONS", - /* 142 */ "INDEXES", - /* 143 */ "ACCOUNTS", - /* 144 */ "APPS", - /* 145 */ "CONNECTIONS", - /* 146 */ "LICENCES", - /* 147 */ "GRANTS", - /* 148 */ "QUERIES", - /* 149 */ "SCORES", - /* 150 */ "TOPICS", - /* 151 */ "VARIABLES", - /* 152 */ "CLUSTER", - /* 153 */ "BNODES", - /* 154 */ "SNODES", - /* 155 */ "TRANSACTIONS", - /* 156 */ "DISTRIBUTED", - /* 157 */ "CONSUMERS", - /* 158 */ "SUBSCRIPTIONS", - /* 159 */ "VNODES", - /* 160 */ "LIKE", - /* 161 */ "TBNAME", - /* 162 */ "QTAGS", - /* 163 */ "AS", - /* 164 */ "INDEX", - /* 165 */ "FUNCTION", - /* 166 */ "INTERVAL", - /* 167 */ "TOPIC", - /* 168 */ "WITH", - /* 169 */ "META", - /* 170 */ "CONSUMER", - /* 171 */ "GROUP", - /* 172 */ "DESC", - /* 173 */ "DESCRIBE", - /* 174 */ "RESET", - /* 175 */ "QUERY", - /* 176 */ "CACHE", - /* 177 */ "EXPLAIN", - /* 178 */ "ANALYZE", - /* 179 */ "VERBOSE", - /* 180 */ "NK_BOOL", - /* 181 */ "RATIO", - /* 182 */ "NK_FLOAT", - /* 183 */ "OUTPUTTYPE", - /* 184 */ "AGGREGATE", - /* 185 */ "BUFSIZE", - /* 186 */ "STREAM", - /* 187 */ "INTO", - /* 188 */ "TRIGGER", - /* 189 */ "AT_ONCE", - /* 190 */ "WINDOW_CLOSE", - /* 191 */ "IGNORE", - /* 192 */ "EXPIRED", - /* 193 */ "FILL_HISTORY", - /* 194 */ "SUBTABLE", - /* 195 */ "KILL", - /* 196 */ "CONNECTION", - /* 197 */ "TRANSACTION", - /* 198 */ "BALANCE", - /* 199 */ "VGROUP", - /* 200 */ "MERGE", - /* 201 */ "REDISTRIBUTE", - /* 202 */ "SPLIT", - /* 203 */ "DELETE", - /* 204 */ "INSERT", - /* 205 */ "NULL", - /* 206 */ "NK_QUESTION", - /* 207 */ "NK_ARROW", - /* 208 */ "ROWTS", - /* 209 */ "QSTART", - /* 210 */ "QEND", - /* 211 */ "QDURATION", - /* 212 */ "WSTART", - /* 213 */ "WEND", - /* 214 */ "WDURATION", - /* 215 */ "IROWTS", - /* 216 */ "CAST", - /* 217 */ "NOW", - /* 218 */ "TODAY", - /* 219 */ "TIMEZONE", - /* 220 */ "CLIENT_VERSION", - /* 221 */ "SERVER_VERSION", - /* 222 */ "SERVER_STATUS", - /* 223 */ "CURRENT_USER", - /* 224 */ "COUNT", - /* 225 */ "LAST_ROW", - /* 226 */ "CASE", - /* 227 */ "END", - /* 228 */ "WHEN", - /* 229 */ "THEN", - /* 230 */ "ELSE", - /* 231 */ "BETWEEN", - /* 232 */ "IS", - /* 233 */ "NK_LT", - /* 234 */ "NK_GT", - /* 235 */ "NK_LE", - /* 236 */ "NK_GE", - /* 237 */ "NK_NE", - /* 238 */ "MATCH", - /* 239 */ "NMATCH", - /* 240 */ "CONTAINS", - /* 241 */ "IN", - /* 242 */ "JOIN", - /* 243 */ "INNER", - /* 244 */ "SELECT", - /* 245 */ "DISTINCT", - /* 246 */ "WHERE", - /* 247 */ "PARTITION", - /* 248 */ "BY", - /* 249 */ "SESSION", - /* 250 */ "STATE_WINDOW", - /* 251 */ "SLIDING", - /* 252 */ "FILL", - /* 253 */ "VALUE", - /* 254 */ "NONE", - /* 255 */ "PREV", - /* 256 */ "LINEAR", - /* 257 */ "NEXT", - /* 258 */ "HAVING", - /* 259 */ "RANGE", - /* 260 */ "EVERY", - /* 261 */ "ORDER", - /* 262 */ "SLIMIT", - /* 263 */ "SOFFSET", - /* 264 */ "LIMIT", - /* 265 */ "OFFSET", - /* 266 */ "ASC", - /* 267 */ "NULLS", - /* 268 */ "ABORT", - /* 269 */ "AFTER", - /* 270 */ "ATTACH", - /* 271 */ "BEFORE", - /* 272 */ "BEGIN", - /* 273 */ "BITAND", - /* 274 */ "BITNOT", - /* 275 */ "BITOR", - /* 276 */ "BLOCKS", - /* 277 */ "CHANGE", - /* 278 */ "COMMA", - /* 279 */ "COMPACT", - /* 280 */ "CONCAT", - /* 281 */ "CONFLICT", - /* 282 */ "COPY", - /* 283 */ "DEFERRED", - /* 284 */ "DELIMITERS", - /* 285 */ "DETACH", - /* 286 */ "DIVIDE", - /* 287 */ "DOT", - /* 288 */ "EACH", - /* 289 */ "FAIL", - /* 290 */ "FILE", - /* 291 */ "FOR", - /* 292 */ "GLOB", - /* 293 */ "ID", - /* 294 */ "IMMEDIATE", - /* 295 */ "IMPORT", - /* 296 */ "INITIALLY", - /* 297 */ "INSTEAD", - /* 298 */ "ISNULL", - /* 299 */ "KEY", - /* 300 */ "MODULES", - /* 301 */ "NK_BITNOT", - /* 302 */ "NK_SEMI", - /* 303 */ "NOTNULL", - /* 304 */ "OF", - /* 305 */ "PLUS", - /* 306 */ "PRIVILEGE", - /* 307 */ "RAISE", - /* 308 */ "REPLACE", - /* 309 */ "RESTRICT", - /* 310 */ "ROW", - /* 311 */ "SEMI", - /* 312 */ "STAR", - /* 313 */ "STATEMENT", - /* 314 */ "STRING", - /* 315 */ "TIMES", - /* 316 */ "UPDATE", - /* 317 */ "VALUES", - /* 318 */ "VARIABLE", - /* 319 */ "VIEW", - /* 320 */ "WAL", - /* 321 */ "cmd", - /* 322 */ "account_options", - /* 323 */ "alter_account_options", - /* 324 */ "literal", - /* 325 */ "alter_account_option", - /* 326 */ "user_name", - /* 327 */ "sysinfo_opt", - /* 328 */ "privileges", - /* 329 */ "priv_level", - /* 330 */ "priv_type_list", - /* 331 */ "priv_type", - /* 332 */ "db_name", - /* 333 */ "topic_name", - /* 334 */ "dnode_endpoint", - /* 335 */ "force_opt", - /* 336 */ "not_exists_opt", - /* 337 */ "db_options", - /* 338 */ "exists_opt", - /* 339 */ "alter_db_options", - /* 340 */ "speed_opt", - /* 341 */ "integer_list", - /* 342 */ "variable_list", - /* 343 */ "retention_list", - /* 344 */ "alter_db_option", - /* 345 */ "retention", - /* 346 */ "full_table_name", - /* 347 */ "column_def_list", - /* 348 */ "tags_def_opt", - /* 349 */ "table_options", - /* 350 */ "multi_create_clause", - /* 351 */ "tags_def", - /* 352 */ "multi_drop_clause", - /* 353 */ "alter_table_clause", - /* 354 */ "alter_table_options", - /* 355 */ "column_name", - /* 356 */ "type_name", - /* 357 */ "signed_literal", - /* 358 */ "create_subtable_clause", - /* 359 */ "specific_cols_opt", - /* 360 */ "expression_list", - /* 361 */ "drop_table_clause", - /* 362 */ "col_name_list", - /* 363 */ "table_name", - /* 364 */ "column_def", - /* 365 */ "duration_list", - /* 366 */ "rollup_func_list", - /* 367 */ "alter_table_option", - /* 368 */ "duration_literal", - /* 369 */ "rollup_func_name", - /* 370 */ "function_name", - /* 371 */ "col_name", - /* 372 */ "db_name_cond_opt", - /* 373 */ "like_pattern_opt", - /* 374 */ "table_name_cond", - /* 375 */ "from_db_opt", - /* 376 */ "tag_list_opt", - /* 377 */ "tag_item", - /* 378 */ "column_alias", - /* 379 */ "index_options", - /* 380 */ "func_list", - /* 381 */ "sliding_opt", - /* 382 */ "sma_stream_opt", - /* 383 */ "func", - /* 384 */ "stream_options", - /* 385 */ "query_or_subquery", - /* 386 */ "cgroup_name", - /* 387 */ "analyze_opt", - /* 388 */ "explain_options", - /* 389 */ "agg_func_opt", - /* 390 */ "bufsize_opt", - /* 391 */ "stream_name", - /* 392 */ "subtable_opt", - /* 393 */ "expression", - /* 394 */ "dnode_list", - /* 395 */ "where_clause_opt", - /* 396 */ "signed", - /* 397 */ "literal_func", - /* 398 */ "literal_list", - /* 399 */ "table_alias", - /* 400 */ "expr_or_subquery", - /* 401 */ "pseudo_column", - /* 402 */ "column_reference", - /* 403 */ "function_expression", - /* 404 */ "case_when_expression", - /* 405 */ "star_func", - /* 406 */ "star_func_para_list", - /* 407 */ "noarg_func", - /* 408 */ "other_para_list", - /* 409 */ "star_func_para", - /* 410 */ "when_then_list", - /* 411 */ "case_when_else_opt", - /* 412 */ "common_expression", - /* 413 */ "when_then_expr", - /* 414 */ "predicate", - /* 415 */ "compare_op", - /* 416 */ "in_op", - /* 417 */ "in_predicate_value", - /* 418 */ "boolean_value_expression", - /* 419 */ "boolean_primary", - /* 420 */ "from_clause_opt", - /* 421 */ "table_reference_list", - /* 422 */ "table_reference", - /* 423 */ "table_primary", - /* 424 */ "joined_table", - /* 425 */ "alias_opt", - /* 426 */ "subquery", - /* 427 */ "parenthesized_joined_table", - /* 428 */ "join_type", - /* 429 */ "search_condition", - /* 430 */ "query_specification", - /* 431 */ "set_quantifier_opt", - /* 432 */ "select_list", - /* 433 */ "partition_by_clause_opt", - /* 434 */ "range_opt", - /* 435 */ "every_opt", - /* 436 */ "fill_opt", - /* 437 */ "twindow_clause_opt", - /* 438 */ "group_by_clause_opt", - /* 439 */ "having_clause_opt", - /* 440 */ "select_item", - /* 441 */ "partition_list", - /* 442 */ "partition_item", - /* 443 */ "fill_mode", - /* 444 */ "group_by_list", - /* 445 */ "query_expression", - /* 446 */ "query_simple", - /* 447 */ "order_by_clause_opt", - /* 448 */ "slimit_clause_opt", - /* 449 */ "limit_clause_opt", - /* 450 */ "union_query_expression", - /* 451 */ "query_simple_or_subquery", - /* 452 */ "sort_specification_list", - /* 453 */ "sort_specification", - /* 454 */ "ordering_specification_opt", - /* 455 */ "null_ordering_opt", + /* 132 */ "DELETE_MARK", + /* 133 */ "FIRST", + /* 134 */ "LAST", + /* 135 */ "SHOW", + /* 136 */ "PRIVILEGES", + /* 137 */ "DATABASES", + /* 138 */ "TABLES", + /* 139 */ "STABLES", + /* 140 */ "MNODES", + /* 141 */ "QNODES", + /* 142 */ "FUNCTIONS", + /* 143 */ "INDEXES", + /* 144 */ "ACCOUNTS", + /* 145 */ "APPS", + /* 146 */ "CONNECTIONS", + /* 147 */ "LICENCES", + /* 148 */ "GRANTS", + /* 149 */ "QUERIES", + /* 150 */ "SCORES", + /* 151 */ "TOPICS", + /* 152 */ "VARIABLES", + /* 153 */ "CLUSTER", + /* 154 */ "BNODES", + /* 155 */ "SNODES", + /* 156 */ "TRANSACTIONS", + /* 157 */ "DISTRIBUTED", + /* 158 */ "CONSUMERS", + /* 159 */ "SUBSCRIPTIONS", + /* 160 */ "VNODES", + /* 161 */ "LIKE", + /* 162 */ "TBNAME", + /* 163 */ "QTAGS", + /* 164 */ "AS", + /* 165 */ "INDEX", + /* 166 */ "FUNCTION", + /* 167 */ "INTERVAL", + /* 168 */ "TOPIC", + /* 169 */ "WITH", + /* 170 */ "META", + /* 171 */ "CONSUMER", + /* 172 */ "GROUP", + /* 173 */ "DESC", + /* 174 */ "DESCRIBE", + /* 175 */ "RESET", + /* 176 */ "QUERY", + /* 177 */ "CACHE", + /* 178 */ "EXPLAIN", + /* 179 */ "ANALYZE", + /* 180 */ "VERBOSE", + /* 181 */ "NK_BOOL", + /* 182 */ "RATIO", + /* 183 */ "NK_FLOAT", + /* 184 */ "OUTPUTTYPE", + /* 185 */ "AGGREGATE", + /* 186 */ "BUFSIZE", + /* 187 */ "STREAM", + /* 188 */ "INTO", + /* 189 */ "TRIGGER", + /* 190 */ "AT_ONCE", + /* 191 */ "WINDOW_CLOSE", + /* 192 */ "IGNORE", + /* 193 */ "EXPIRED", + /* 194 */ "FILL_HISTORY", + /* 195 */ "SUBTABLE", + /* 196 */ "KILL", + /* 197 */ "CONNECTION", + /* 198 */ "TRANSACTION", + /* 199 */ "BALANCE", + /* 200 */ "VGROUP", + /* 201 */ "MERGE", + /* 202 */ "REDISTRIBUTE", + /* 203 */ "SPLIT", + /* 204 */ "DELETE", + /* 205 */ "INSERT", + /* 206 */ "NULL", + /* 207 */ "NK_QUESTION", + /* 208 */ "NK_ARROW", + /* 209 */ "ROWTS", + /* 210 */ "QSTART", + /* 211 */ "QEND", + /* 212 */ "QDURATION", + /* 213 */ "WSTART", + /* 214 */ "WEND", + /* 215 */ "WDURATION", + /* 216 */ "IROWTS", + /* 217 */ "CAST", + /* 218 */ "NOW", + /* 219 */ "TODAY", + /* 220 */ "TIMEZONE", + /* 221 */ "CLIENT_VERSION", + /* 222 */ "SERVER_VERSION", + /* 223 */ "SERVER_STATUS", + /* 224 */ "CURRENT_USER", + /* 225 */ "COUNT", + /* 226 */ "LAST_ROW", + /* 227 */ "CASE", + /* 228 */ "END", + /* 229 */ "WHEN", + /* 230 */ "THEN", + /* 231 */ "ELSE", + /* 232 */ "BETWEEN", + /* 233 */ "IS", + /* 234 */ "NK_LT", + /* 235 */ "NK_GT", + /* 236 */ "NK_LE", + /* 237 */ "NK_GE", + /* 238 */ "NK_NE", + /* 239 */ "MATCH", + /* 240 */ "NMATCH", + /* 241 */ "CONTAINS", + /* 242 */ "IN", + /* 243 */ "JOIN", + /* 244 */ "INNER", + /* 245 */ "SELECT", + /* 246 */ "DISTINCT", + /* 247 */ "WHERE", + /* 248 */ "PARTITION", + /* 249 */ "BY", + /* 250 */ "SESSION", + /* 251 */ "STATE_WINDOW", + /* 252 */ "EVENT_WINDOW", + /* 253 */ "START", + /* 254 */ "SLIDING", + /* 255 */ "FILL", + /* 256 */ "VALUE", + /* 257 */ "NONE", + /* 258 */ "PREV", + /* 259 */ "LINEAR", + /* 260 */ "NEXT", + /* 261 */ "HAVING", + /* 262 */ "RANGE", + /* 263 */ "EVERY", + /* 264 */ "ORDER", + /* 265 */ "SLIMIT", + /* 266 */ "SOFFSET", + /* 267 */ "LIMIT", + /* 268 */ "OFFSET", + /* 269 */ "ASC", + /* 270 */ "NULLS", + /* 271 */ "ABORT", + /* 272 */ "AFTER", + /* 273 */ "ATTACH", + /* 274 */ "BEFORE", + /* 275 */ "BEGIN", + /* 276 */ "BITAND", + /* 277 */ "BITNOT", + /* 278 */ "BITOR", + /* 279 */ "BLOCKS", + /* 280 */ "CHANGE", + /* 281 */ "COMMA", + /* 282 */ "COMPACT", + /* 283 */ "CONCAT", + /* 284 */ "CONFLICT", + /* 285 */ "COPY", + /* 286 */ "DEFERRED", + /* 287 */ "DELIMITERS", + /* 288 */ "DETACH", + /* 289 */ "DIVIDE", + /* 290 */ "DOT", + /* 291 */ "EACH", + /* 292 */ "FAIL", + /* 293 */ "FILE", + /* 294 */ "FOR", + /* 295 */ "GLOB", + /* 296 */ "ID", + /* 297 */ "IMMEDIATE", + /* 298 */ "IMPORT", + /* 299 */ "INITIALLY", + /* 300 */ "INSTEAD", + /* 301 */ "ISNULL", + /* 302 */ "KEY", + /* 303 */ "MODULES", + /* 304 */ "NK_BITNOT", + /* 305 */ "NK_SEMI", + /* 306 */ "NOTNULL", + /* 307 */ "OF", + /* 308 */ "PLUS", + /* 309 */ "PRIVILEGE", + /* 310 */ "RAISE", + /* 311 */ "REPLACE", + /* 312 */ "RESTRICT", + /* 313 */ "ROW", + /* 314 */ "SEMI", + /* 315 */ "STAR", + /* 316 */ "STATEMENT", + /* 317 */ "STRING", + /* 318 */ "TIMES", + /* 319 */ "UPDATE", + /* 320 */ "VALUES", + /* 321 */ "VARIABLE", + /* 322 */ "VIEW", + /* 323 */ "WAL", + /* 324 */ "cmd", + /* 325 */ "account_options", + /* 326 */ "alter_account_options", + /* 327 */ "literal", + /* 328 */ "alter_account_option", + /* 329 */ "user_name", + /* 330 */ "sysinfo_opt", + /* 331 */ "privileges", + /* 332 */ "priv_level", + /* 333 */ "priv_type_list", + /* 334 */ "priv_type", + /* 335 */ "db_name", + /* 336 */ "topic_name", + /* 337 */ "dnode_endpoint", + /* 338 */ "force_opt", + /* 339 */ "not_exists_opt", + /* 340 */ "db_options", + /* 341 */ "exists_opt", + /* 342 */ "alter_db_options", + /* 343 */ "speed_opt", + /* 344 */ "integer_list", + /* 345 */ "variable_list", + /* 346 */ "retention_list", + /* 347 */ "alter_db_option", + /* 348 */ "retention", + /* 349 */ "full_table_name", + /* 350 */ "column_def_list", + /* 351 */ "tags_def_opt", + /* 352 */ "table_options", + /* 353 */ "multi_create_clause", + /* 354 */ "tags_def", + /* 355 */ "multi_drop_clause", + /* 356 */ "alter_table_clause", + /* 357 */ "alter_table_options", + /* 358 */ "column_name", + /* 359 */ "type_name", + /* 360 */ "signed_literal", + /* 361 */ "create_subtable_clause", + /* 362 */ "specific_cols_opt", + /* 363 */ "expression_list", + /* 364 */ "drop_table_clause", + /* 365 */ "col_name_list", + /* 366 */ "table_name", + /* 367 */ "column_def", + /* 368 */ "duration_list", + /* 369 */ "rollup_func_list", + /* 370 */ "alter_table_option", + /* 371 */ "duration_literal", + /* 372 */ "rollup_func_name", + /* 373 */ "function_name", + /* 374 */ "col_name", + /* 375 */ "db_name_cond_opt", + /* 376 */ "like_pattern_opt", + /* 377 */ "table_name_cond", + /* 378 */ "from_db_opt", + /* 379 */ "tag_list_opt", + /* 380 */ "tag_item", + /* 381 */ "column_alias", + /* 382 */ "index_options", + /* 383 */ "func_list", + /* 384 */ "sliding_opt", + /* 385 */ "sma_stream_opt", + /* 386 */ "func", + /* 387 */ "query_or_subquery", + /* 388 */ "cgroup_name", + /* 389 */ "analyze_opt", + /* 390 */ "explain_options", + /* 391 */ "agg_func_opt", + /* 392 */ "bufsize_opt", + /* 393 */ "stream_name", + /* 394 */ "stream_options", + /* 395 */ "subtable_opt", + /* 396 */ "expression", + /* 397 */ "dnode_list", + /* 398 */ "where_clause_opt", + /* 399 */ "signed", + /* 400 */ "literal_func", + /* 401 */ "literal_list", + /* 402 */ "table_alias", + /* 403 */ "expr_or_subquery", + /* 404 */ "pseudo_column", + /* 405 */ "column_reference", + /* 406 */ "function_expression", + /* 407 */ "case_when_expression", + /* 408 */ "star_func", + /* 409 */ "star_func_para_list", + /* 410 */ "noarg_func", + /* 411 */ "other_para_list", + /* 412 */ "star_func_para", + /* 413 */ "when_then_list", + /* 414 */ "case_when_else_opt", + /* 415 */ "common_expression", + /* 416 */ "when_then_expr", + /* 417 */ "predicate", + /* 418 */ "compare_op", + /* 419 */ "in_op", + /* 420 */ "in_predicate_value", + /* 421 */ "boolean_value_expression", + /* 422 */ "boolean_primary", + /* 423 */ "from_clause_opt", + /* 424 */ "table_reference_list", + /* 425 */ "table_reference", + /* 426 */ "table_primary", + /* 427 */ "joined_table", + /* 428 */ "alias_opt", + /* 429 */ "subquery", + /* 430 */ "parenthesized_joined_table", + /* 431 */ "join_type", + /* 432 */ "search_condition", + /* 433 */ "query_specification", + /* 434 */ "set_quantifier_opt", + /* 435 */ "select_list", + /* 436 */ "partition_by_clause_opt", + /* 437 */ "range_opt", + /* 438 */ "every_opt", + /* 439 */ "fill_opt", + /* 440 */ "twindow_clause_opt", + /* 441 */ "group_by_clause_opt", + /* 442 */ "having_clause_opt", + /* 443 */ "select_item", + /* 444 */ "partition_list", + /* 445 */ "partition_item", + /* 446 */ "fill_mode", + /* 447 */ "group_by_list", + /* 448 */ "query_expression", + /* 449 */ "query_simple", + /* 450 */ "order_by_clause_opt", + /* 451 */ "slimit_clause_opt", + /* 452 */ "limit_clause_opt", + /* 453 */ "union_query_expression", + /* 454 */ "query_simple_or_subquery", + /* 455 */ "sort_specification_list", + /* 456 */ "sort_specification", + /* 457 */ "ordering_specification_opt", + /* 458 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1921,82 +1938,82 @@ static const char *const yyRuleName[] = { /* 115 */ "alter_db_option ::= KEEP variable_list", /* 116 */ "alter_db_option ::= PAGES NK_INTEGER", /* 117 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 118 */ "alter_db_option ::= STRICT NK_STRING", - /* 119 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 120 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 121 */ "integer_list ::= NK_INTEGER", - /* 122 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 123 */ "variable_list ::= NK_VARIABLE", - /* 124 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 125 */ "retention_list ::= retention", - /* 126 */ "retention_list ::= retention_list NK_COMMA retention", - /* 127 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 128 */ "speed_opt ::=", - /* 129 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 130 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 131 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 132 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 133 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 134 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 135 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 136 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 137 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 138 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 139 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 140 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 141 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 142 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 143 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 144 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 145 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 146 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 147 */ "multi_create_clause ::= create_subtable_clause", - /* 148 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 149 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 150 */ "multi_drop_clause ::= drop_table_clause", - /* 151 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 152 */ "drop_table_clause ::= exists_opt full_table_name", - /* 153 */ "specific_cols_opt ::=", - /* 154 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 155 */ "full_table_name ::= table_name", - /* 156 */ "full_table_name ::= db_name NK_DOT table_name", - /* 157 */ "column_def_list ::= column_def", - /* 158 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 159 */ "column_def ::= column_name type_name", - /* 160 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 161 */ "type_name ::= BOOL", - /* 162 */ "type_name ::= TINYINT", - /* 163 */ "type_name ::= SMALLINT", - /* 164 */ "type_name ::= INT", - /* 165 */ "type_name ::= INTEGER", - /* 166 */ "type_name ::= BIGINT", - /* 167 */ "type_name ::= FLOAT", - /* 168 */ "type_name ::= DOUBLE", - /* 169 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 170 */ "type_name ::= TIMESTAMP", - /* 171 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 172 */ "type_name ::= TINYINT UNSIGNED", - /* 173 */ "type_name ::= SMALLINT UNSIGNED", - /* 174 */ "type_name ::= INT UNSIGNED", - /* 175 */ "type_name ::= BIGINT UNSIGNED", - /* 176 */ "type_name ::= JSON", - /* 177 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 178 */ "type_name ::= MEDIUMBLOB", - /* 179 */ "type_name ::= BLOB", - /* 180 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 181 */ "type_name ::= DECIMAL", - /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 183 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 184 */ "tags_def_opt ::=", - /* 185 */ "tags_def_opt ::= tags_def", - /* 186 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 187 */ "table_options ::=", - /* 188 */ "table_options ::= table_options COMMENT NK_STRING", - /* 189 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 190 */ "table_options ::= table_options WATERMARK duration_list", - /* 191 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 192 */ "table_options ::= table_options TTL NK_INTEGER", - /* 193 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 118 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 119 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 120 */ "integer_list ::= NK_INTEGER", + /* 121 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 122 */ "variable_list ::= NK_VARIABLE", + /* 123 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 124 */ "retention_list ::= retention", + /* 125 */ "retention_list ::= retention_list NK_COMMA retention", + /* 126 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 127 */ "speed_opt ::=", + /* 128 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 129 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 130 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 131 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 132 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 133 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 134 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 135 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 136 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 137 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 138 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 139 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 140 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 141 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 142 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 143 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 144 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 145 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 146 */ "multi_create_clause ::= create_subtable_clause", + /* 147 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 148 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 149 */ "multi_drop_clause ::= drop_table_clause", + /* 150 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 151 */ "drop_table_clause ::= exists_opt full_table_name", + /* 152 */ "specific_cols_opt ::=", + /* 153 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 154 */ "full_table_name ::= table_name", + /* 155 */ "full_table_name ::= db_name NK_DOT table_name", + /* 156 */ "column_def_list ::= column_def", + /* 157 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 158 */ "column_def ::= column_name type_name", + /* 159 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 160 */ "type_name ::= BOOL", + /* 161 */ "type_name ::= TINYINT", + /* 162 */ "type_name ::= SMALLINT", + /* 163 */ "type_name ::= INT", + /* 164 */ "type_name ::= INTEGER", + /* 165 */ "type_name ::= BIGINT", + /* 166 */ "type_name ::= FLOAT", + /* 167 */ "type_name ::= DOUBLE", + /* 168 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 169 */ "type_name ::= TIMESTAMP", + /* 170 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 171 */ "type_name ::= TINYINT UNSIGNED", + /* 172 */ "type_name ::= SMALLINT UNSIGNED", + /* 173 */ "type_name ::= INT UNSIGNED", + /* 174 */ "type_name ::= BIGINT UNSIGNED", + /* 175 */ "type_name ::= JSON", + /* 176 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 177 */ "type_name ::= MEDIUMBLOB", + /* 178 */ "type_name ::= BLOB", + /* 179 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 180 */ "type_name ::= DECIMAL", + /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 183 */ "tags_def_opt ::=", + /* 184 */ "tags_def_opt ::= tags_def", + /* 185 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 186 */ "table_options ::=", + /* 187 */ "table_options ::= table_options COMMENT NK_STRING", + /* 188 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 189 */ "table_options ::= table_options WATERMARK duration_list", + /* 190 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 191 */ "table_options ::= table_options TTL NK_INTEGER", + /* 192 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 193 */ "table_options ::= table_options DELETE_MARK duration_list", /* 194 */ "alter_table_options ::= alter_table_option", /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", /* 196 */ "alter_table_option ::= COMMENT NK_STRING", @@ -2072,275 +2089,277 @@ static const char *const yyRuleName[] = { /* 266 */ "func_list ::= func_list NK_COMMA func", /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", /* 268 */ "sma_stream_opt ::=", - /* 269 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 270 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 271 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 276 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 277 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 278 */ "cmd ::= DESC full_table_name", - /* 279 */ "cmd ::= DESCRIBE full_table_name", - /* 280 */ "cmd ::= RESET QUERY CACHE", - /* 281 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 282 */ "analyze_opt ::=", - /* 283 */ "analyze_opt ::= ANALYZE", - /* 284 */ "explain_options ::=", - /* 285 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 286 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 287 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 288 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 289 */ "agg_func_opt ::=", - /* 290 */ "agg_func_opt ::= AGGREGATE", - /* 291 */ "bufsize_opt ::=", - /* 292 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 293 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 294 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 295 */ "stream_options ::=", - /* 296 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 297 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 298 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 299 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 300 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 301 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 302 */ "subtable_opt ::=", - /* 303 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 304 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 305 */ "cmd ::= KILL QUERY NK_STRING", - /* 306 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 307 */ "cmd ::= BALANCE VGROUP", - /* 308 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 309 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 310 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 311 */ "dnode_list ::= DNODE NK_INTEGER", - /* 312 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 313 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 314 */ "cmd ::= query_or_subquery", - /* 315 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 316 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 317 */ "literal ::= NK_INTEGER", - /* 318 */ "literal ::= NK_FLOAT", - /* 319 */ "literal ::= NK_STRING", - /* 320 */ "literal ::= NK_BOOL", - /* 321 */ "literal ::= TIMESTAMP NK_STRING", - /* 322 */ "literal ::= duration_literal", - /* 323 */ "literal ::= NULL", - /* 324 */ "literal ::= NK_QUESTION", - /* 325 */ "duration_literal ::= NK_VARIABLE", - /* 326 */ "signed ::= NK_INTEGER", - /* 327 */ "signed ::= NK_PLUS NK_INTEGER", - /* 328 */ "signed ::= NK_MINUS NK_INTEGER", - /* 329 */ "signed ::= NK_FLOAT", - /* 330 */ "signed ::= NK_PLUS NK_FLOAT", - /* 331 */ "signed ::= NK_MINUS NK_FLOAT", - /* 332 */ "signed_literal ::= signed", - /* 333 */ "signed_literal ::= NK_STRING", - /* 334 */ "signed_literal ::= NK_BOOL", - /* 335 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 336 */ "signed_literal ::= duration_literal", - /* 337 */ "signed_literal ::= NULL", - /* 338 */ "signed_literal ::= literal_func", - /* 339 */ "signed_literal ::= NK_QUESTION", - /* 340 */ "literal_list ::= signed_literal", - /* 341 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 342 */ "db_name ::= NK_ID", - /* 343 */ "table_name ::= NK_ID", - /* 344 */ "column_name ::= NK_ID", - /* 345 */ "function_name ::= NK_ID", - /* 346 */ "table_alias ::= NK_ID", - /* 347 */ "column_alias ::= NK_ID", - /* 348 */ "user_name ::= NK_ID", - /* 349 */ "topic_name ::= NK_ID", - /* 350 */ "stream_name ::= NK_ID", - /* 351 */ "cgroup_name ::= NK_ID", - /* 352 */ "expr_or_subquery ::= expression", - /* 353 */ "expression ::= literal", - /* 354 */ "expression ::= pseudo_column", - /* 355 */ "expression ::= column_reference", - /* 356 */ "expression ::= function_expression", - /* 357 */ "expression ::= case_when_expression", - /* 358 */ "expression ::= NK_LP expression NK_RP", - /* 359 */ "expression ::= NK_PLUS expr_or_subquery", - /* 360 */ "expression ::= NK_MINUS expr_or_subquery", - /* 361 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 366 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 367 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 368 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 369 */ "expression_list ::= expr_or_subquery", - /* 370 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 371 */ "column_reference ::= column_name", - /* 372 */ "column_reference ::= table_name NK_DOT column_name", - /* 373 */ "pseudo_column ::= ROWTS", - /* 374 */ "pseudo_column ::= TBNAME", - /* 375 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 376 */ "pseudo_column ::= QSTART", - /* 377 */ "pseudo_column ::= QEND", - /* 378 */ "pseudo_column ::= QDURATION", - /* 379 */ "pseudo_column ::= WSTART", - /* 380 */ "pseudo_column ::= WEND", - /* 381 */ "pseudo_column ::= WDURATION", - /* 382 */ "pseudo_column ::= IROWTS", - /* 383 */ "pseudo_column ::= QTAGS", - /* 384 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 385 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 386 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 387 */ "function_expression ::= literal_func", - /* 388 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 389 */ "literal_func ::= NOW", - /* 390 */ "noarg_func ::= NOW", - /* 391 */ "noarg_func ::= TODAY", - /* 392 */ "noarg_func ::= TIMEZONE", - /* 393 */ "noarg_func ::= DATABASE", - /* 394 */ "noarg_func ::= CLIENT_VERSION", - /* 395 */ "noarg_func ::= SERVER_VERSION", - /* 396 */ "noarg_func ::= SERVER_STATUS", - /* 397 */ "noarg_func ::= CURRENT_USER", - /* 398 */ "noarg_func ::= USER", - /* 399 */ "star_func ::= COUNT", - /* 400 */ "star_func ::= FIRST", - /* 401 */ "star_func ::= LAST", - /* 402 */ "star_func ::= LAST_ROW", - /* 403 */ "star_func_para_list ::= NK_STAR", - /* 404 */ "star_func_para_list ::= other_para_list", - /* 405 */ "other_para_list ::= star_func_para", - /* 406 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 407 */ "star_func_para ::= expr_or_subquery", - /* 408 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 409 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 410 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 411 */ "when_then_list ::= when_then_expr", - /* 412 */ "when_then_list ::= when_then_list when_then_expr", - /* 413 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 414 */ "case_when_else_opt ::=", - /* 415 */ "case_when_else_opt ::= ELSE common_expression", - /* 416 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 417 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 418 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery IS NULL", - /* 420 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 421 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 422 */ "compare_op ::= NK_LT", - /* 423 */ "compare_op ::= NK_GT", - /* 424 */ "compare_op ::= NK_LE", - /* 425 */ "compare_op ::= NK_GE", - /* 426 */ "compare_op ::= NK_NE", - /* 427 */ "compare_op ::= NK_EQ", - /* 428 */ "compare_op ::= LIKE", - /* 429 */ "compare_op ::= NOT LIKE", - /* 430 */ "compare_op ::= MATCH", - /* 431 */ "compare_op ::= NMATCH", - /* 432 */ "compare_op ::= CONTAINS", - /* 433 */ "in_op ::= IN", - /* 434 */ "in_op ::= NOT IN", - /* 435 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 436 */ "boolean_value_expression ::= boolean_primary", - /* 437 */ "boolean_value_expression ::= NOT boolean_primary", - /* 438 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 439 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 440 */ "boolean_primary ::= predicate", - /* 441 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 442 */ "common_expression ::= expr_or_subquery", - /* 443 */ "common_expression ::= boolean_value_expression", - /* 444 */ "from_clause_opt ::=", - /* 445 */ "from_clause_opt ::= FROM table_reference_list", - /* 446 */ "table_reference_list ::= table_reference", - /* 447 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 448 */ "table_reference ::= table_primary", - /* 449 */ "table_reference ::= joined_table", - /* 450 */ "table_primary ::= table_name alias_opt", - /* 451 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 452 */ "table_primary ::= subquery alias_opt", - /* 453 */ "table_primary ::= parenthesized_joined_table", - /* 454 */ "alias_opt ::=", - /* 455 */ "alias_opt ::= table_alias", - /* 456 */ "alias_opt ::= AS table_alias", - /* 457 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 458 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 459 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 460 */ "join_type ::=", - /* 461 */ "join_type ::= INNER", - /* 462 */ "query_specification ::= SELECT set_quantifier_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", - /* 463 */ "set_quantifier_opt ::=", - /* 464 */ "set_quantifier_opt ::= DISTINCT", - /* 465 */ "set_quantifier_opt ::= ALL", - /* 466 */ "select_list ::= select_item", - /* 467 */ "select_list ::= select_list NK_COMMA select_item", - /* 468 */ "select_item ::= NK_STAR", - /* 469 */ "select_item ::= common_expression", - /* 470 */ "select_item ::= common_expression column_alias", - /* 471 */ "select_item ::= common_expression AS column_alias", - /* 472 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 473 */ "where_clause_opt ::=", - /* 474 */ "where_clause_opt ::= WHERE search_condition", - /* 475 */ "partition_by_clause_opt ::=", - /* 476 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 477 */ "partition_list ::= partition_item", - /* 478 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 479 */ "partition_item ::= expr_or_subquery", - /* 480 */ "partition_item ::= expr_or_subquery column_alias", - /* 481 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 482 */ "twindow_clause_opt ::=", - /* 483 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 484 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 485 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 487 */ "sliding_opt ::=", - /* 488 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 489 */ "fill_opt ::=", - /* 490 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 491 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 492 */ "fill_mode ::= NONE", - /* 493 */ "fill_mode ::= PREV", - /* 494 */ "fill_mode ::= NULL", - /* 495 */ "fill_mode ::= LINEAR", - /* 496 */ "fill_mode ::= NEXT", - /* 497 */ "group_by_clause_opt ::=", - /* 498 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 499 */ "group_by_list ::= expr_or_subquery", - /* 500 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 501 */ "having_clause_opt ::=", - /* 502 */ "having_clause_opt ::= HAVING search_condition", - /* 503 */ "range_opt ::=", - /* 504 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 505 */ "every_opt ::=", - /* 506 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 507 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 508 */ "query_simple ::= query_specification", - /* 509 */ "query_simple ::= union_query_expression", - /* 510 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 512 */ "query_simple_or_subquery ::= query_simple", - /* 513 */ "query_simple_or_subquery ::= subquery", - /* 514 */ "query_or_subquery ::= query_expression", - /* 515 */ "query_or_subquery ::= subquery", - /* 516 */ "order_by_clause_opt ::=", - /* 517 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 518 */ "slimit_clause_opt ::=", - /* 519 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 522 */ "limit_clause_opt ::=", - /* 523 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 526 */ "subquery ::= NK_LP query_expression NK_RP", - /* 527 */ "subquery ::= NK_LP subquery NK_RP", - /* 528 */ "search_condition ::= common_expression", - /* 529 */ "sort_specification_list ::= sort_specification", - /* 530 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 531 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 532 */ "ordering_specification_opt ::=", - /* 533 */ "ordering_specification_opt ::= ASC", - /* 534 */ "ordering_specification_opt ::= DESC", - /* 535 */ "null_ordering_opt ::=", - /* 536 */ "null_ordering_opt ::= NULLS FIRST", - /* 537 */ "null_ordering_opt ::= NULLS LAST", + /* 269 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 270 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 271 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 277 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 278 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 279 */ "cmd ::= DESC full_table_name", + /* 280 */ "cmd ::= DESCRIBE full_table_name", + /* 281 */ "cmd ::= RESET QUERY CACHE", + /* 282 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 283 */ "analyze_opt ::=", + /* 284 */ "analyze_opt ::= ANALYZE", + /* 285 */ "explain_options ::=", + /* 286 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 287 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 288 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 289 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 290 */ "agg_func_opt ::=", + /* 291 */ "agg_func_opt ::= AGGREGATE", + /* 292 */ "bufsize_opt ::=", + /* 293 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 294 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 295 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 296 */ "stream_options ::=", + /* 297 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 298 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 299 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 300 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 301 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 302 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 303 */ "subtable_opt ::=", + /* 304 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 305 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 306 */ "cmd ::= KILL QUERY NK_STRING", + /* 307 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 308 */ "cmd ::= BALANCE VGROUP", + /* 309 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 310 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 311 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 312 */ "dnode_list ::= DNODE NK_INTEGER", + /* 313 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 314 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 315 */ "cmd ::= query_or_subquery", + /* 316 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 317 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 318 */ "literal ::= NK_INTEGER", + /* 319 */ "literal ::= NK_FLOAT", + /* 320 */ "literal ::= NK_STRING", + /* 321 */ "literal ::= NK_BOOL", + /* 322 */ "literal ::= TIMESTAMP NK_STRING", + /* 323 */ "literal ::= duration_literal", + /* 324 */ "literal ::= NULL", + /* 325 */ "literal ::= NK_QUESTION", + /* 326 */ "duration_literal ::= NK_VARIABLE", + /* 327 */ "signed ::= NK_INTEGER", + /* 328 */ "signed ::= NK_PLUS NK_INTEGER", + /* 329 */ "signed ::= NK_MINUS NK_INTEGER", + /* 330 */ "signed ::= NK_FLOAT", + /* 331 */ "signed ::= NK_PLUS NK_FLOAT", + /* 332 */ "signed ::= NK_MINUS NK_FLOAT", + /* 333 */ "signed_literal ::= signed", + /* 334 */ "signed_literal ::= NK_STRING", + /* 335 */ "signed_literal ::= NK_BOOL", + /* 336 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 337 */ "signed_literal ::= duration_literal", + /* 338 */ "signed_literal ::= NULL", + /* 339 */ "signed_literal ::= literal_func", + /* 340 */ "signed_literal ::= NK_QUESTION", + /* 341 */ "literal_list ::= signed_literal", + /* 342 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 343 */ "db_name ::= NK_ID", + /* 344 */ "table_name ::= NK_ID", + /* 345 */ "column_name ::= NK_ID", + /* 346 */ "function_name ::= NK_ID", + /* 347 */ "table_alias ::= NK_ID", + /* 348 */ "column_alias ::= NK_ID", + /* 349 */ "user_name ::= NK_ID", + /* 350 */ "topic_name ::= NK_ID", + /* 351 */ "stream_name ::= NK_ID", + /* 352 */ "cgroup_name ::= NK_ID", + /* 353 */ "expr_or_subquery ::= expression", + /* 354 */ "expression ::= literal", + /* 355 */ "expression ::= pseudo_column", + /* 356 */ "expression ::= column_reference", + /* 357 */ "expression ::= function_expression", + /* 358 */ "expression ::= case_when_expression", + /* 359 */ "expression ::= NK_LP expression NK_RP", + /* 360 */ "expression ::= NK_PLUS expr_or_subquery", + /* 361 */ "expression ::= NK_MINUS expr_or_subquery", + /* 362 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 366 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 367 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 368 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 369 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 370 */ "expression_list ::= expr_or_subquery", + /* 371 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 372 */ "column_reference ::= column_name", + /* 373 */ "column_reference ::= table_name NK_DOT column_name", + /* 374 */ "pseudo_column ::= ROWTS", + /* 375 */ "pseudo_column ::= TBNAME", + /* 376 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 377 */ "pseudo_column ::= QSTART", + /* 378 */ "pseudo_column ::= QEND", + /* 379 */ "pseudo_column ::= QDURATION", + /* 380 */ "pseudo_column ::= WSTART", + /* 381 */ "pseudo_column ::= WEND", + /* 382 */ "pseudo_column ::= WDURATION", + /* 383 */ "pseudo_column ::= IROWTS", + /* 384 */ "pseudo_column ::= QTAGS", + /* 385 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 386 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 387 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 388 */ "function_expression ::= literal_func", + /* 389 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 390 */ "literal_func ::= NOW", + /* 391 */ "noarg_func ::= NOW", + /* 392 */ "noarg_func ::= TODAY", + /* 393 */ "noarg_func ::= TIMEZONE", + /* 394 */ "noarg_func ::= DATABASE", + /* 395 */ "noarg_func ::= CLIENT_VERSION", + /* 396 */ "noarg_func ::= SERVER_VERSION", + /* 397 */ "noarg_func ::= SERVER_STATUS", + /* 398 */ "noarg_func ::= CURRENT_USER", + /* 399 */ "noarg_func ::= USER", + /* 400 */ "star_func ::= COUNT", + /* 401 */ "star_func ::= FIRST", + /* 402 */ "star_func ::= LAST", + /* 403 */ "star_func ::= LAST_ROW", + /* 404 */ "star_func_para_list ::= NK_STAR", + /* 405 */ "star_func_para_list ::= other_para_list", + /* 406 */ "other_para_list ::= star_func_para", + /* 407 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 408 */ "star_func_para ::= expr_or_subquery", + /* 409 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 410 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 411 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 412 */ "when_then_list ::= when_then_expr", + /* 413 */ "when_then_list ::= when_then_list when_then_expr", + /* 414 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 415 */ "case_when_else_opt ::=", + /* 416 */ "case_when_else_opt ::= ELSE common_expression", + /* 417 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 418 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 420 */ "predicate ::= expr_or_subquery IS NULL", + /* 421 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 422 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 423 */ "compare_op ::= NK_LT", + /* 424 */ "compare_op ::= NK_GT", + /* 425 */ "compare_op ::= NK_LE", + /* 426 */ "compare_op ::= NK_GE", + /* 427 */ "compare_op ::= NK_NE", + /* 428 */ "compare_op ::= NK_EQ", + /* 429 */ "compare_op ::= LIKE", + /* 430 */ "compare_op ::= NOT LIKE", + /* 431 */ "compare_op ::= MATCH", + /* 432 */ "compare_op ::= NMATCH", + /* 433 */ "compare_op ::= CONTAINS", + /* 434 */ "in_op ::= IN", + /* 435 */ "in_op ::= NOT IN", + /* 436 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 437 */ "boolean_value_expression ::= boolean_primary", + /* 438 */ "boolean_value_expression ::= NOT boolean_primary", + /* 439 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 440 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 441 */ "boolean_primary ::= predicate", + /* 442 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 443 */ "common_expression ::= expr_or_subquery", + /* 444 */ "common_expression ::= boolean_value_expression", + /* 445 */ "from_clause_opt ::=", + /* 446 */ "from_clause_opt ::= FROM table_reference_list", + /* 447 */ "table_reference_list ::= table_reference", + /* 448 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 449 */ "table_reference ::= table_primary", + /* 450 */ "table_reference ::= joined_table", + /* 451 */ "table_primary ::= table_name alias_opt", + /* 452 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 453 */ "table_primary ::= subquery alias_opt", + /* 454 */ "table_primary ::= parenthesized_joined_table", + /* 455 */ "alias_opt ::=", + /* 456 */ "alias_opt ::= table_alias", + /* 457 */ "alias_opt ::= AS table_alias", + /* 458 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 459 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 460 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 461 */ "join_type ::=", + /* 462 */ "join_type ::= INNER", + /* 463 */ "query_specification ::= SELECT set_quantifier_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", + /* 464 */ "set_quantifier_opt ::=", + /* 465 */ "set_quantifier_opt ::= DISTINCT", + /* 466 */ "set_quantifier_opt ::= ALL", + /* 467 */ "select_list ::= select_item", + /* 468 */ "select_list ::= select_list NK_COMMA select_item", + /* 469 */ "select_item ::= NK_STAR", + /* 470 */ "select_item ::= common_expression", + /* 471 */ "select_item ::= common_expression column_alias", + /* 472 */ "select_item ::= common_expression AS column_alias", + /* 473 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 474 */ "where_clause_opt ::=", + /* 475 */ "where_clause_opt ::= WHERE search_condition", + /* 476 */ "partition_by_clause_opt ::=", + /* 477 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 478 */ "partition_list ::= partition_item", + /* 479 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 480 */ "partition_item ::= expr_or_subquery", + /* 481 */ "partition_item ::= expr_or_subquery column_alias", + /* 482 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 483 */ "twindow_clause_opt ::=", + /* 484 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 485 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 488 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 489 */ "sliding_opt ::=", + /* 490 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 491 */ "fill_opt ::=", + /* 492 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 493 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 494 */ "fill_mode ::= NONE", + /* 495 */ "fill_mode ::= PREV", + /* 496 */ "fill_mode ::= NULL", + /* 497 */ "fill_mode ::= LINEAR", + /* 498 */ "fill_mode ::= NEXT", + /* 499 */ "group_by_clause_opt ::=", + /* 500 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 501 */ "group_by_list ::= expr_or_subquery", + /* 502 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 503 */ "having_clause_opt ::=", + /* 504 */ "having_clause_opt ::= HAVING search_condition", + /* 505 */ "range_opt ::=", + /* 506 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 507 */ "every_opt ::=", + /* 508 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 509 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 510 */ "query_simple ::= query_specification", + /* 511 */ "query_simple ::= union_query_expression", + /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 513 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 514 */ "query_simple_or_subquery ::= query_simple", + /* 515 */ "query_simple_or_subquery ::= subquery", + /* 516 */ "query_or_subquery ::= query_expression", + /* 517 */ "query_or_subquery ::= subquery", + /* 518 */ "order_by_clause_opt ::=", + /* 519 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 520 */ "slimit_clause_opt ::=", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 524 */ "limit_clause_opt ::=", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 528 */ "subquery ::= NK_LP query_expression NK_RP", + /* 529 */ "subquery ::= NK_LP subquery NK_RP", + /* 530 */ "search_condition ::= common_expression", + /* 531 */ "sort_specification_list ::= sort_specification", + /* 532 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 533 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 534 */ "ordering_specification_opt ::=", + /* 535 */ "ordering_specification_opt ::= ASC", + /* 536 */ "ordering_specification_opt ::= DESC", + /* 537 */ "null_ordering_opt ::=", + /* 538 */ "null_ordering_opt ::= NULLS FIRST", + /* 539 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2467,193 +2486,193 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 321: /* cmd */ - case 324: /* literal */ - case 337: /* db_options */ - case 339: /* alter_db_options */ - case 345: /* retention */ - case 346: /* full_table_name */ - case 349: /* table_options */ - case 353: /* alter_table_clause */ - case 354: /* alter_table_options */ - case 357: /* signed_literal */ - case 358: /* create_subtable_clause */ - case 361: /* drop_table_clause */ - case 364: /* column_def */ - case 368: /* duration_literal */ - case 369: /* rollup_func_name */ - case 371: /* col_name */ - case 372: /* db_name_cond_opt */ - case 373: /* like_pattern_opt */ - case 374: /* table_name_cond */ - case 375: /* from_db_opt */ - case 377: /* tag_item */ - case 379: /* index_options */ - case 381: /* sliding_opt */ - case 382: /* sma_stream_opt */ - case 383: /* func */ - case 384: /* stream_options */ - case 385: /* query_or_subquery */ - case 388: /* explain_options */ - case 392: /* subtable_opt */ - case 393: /* expression */ - case 395: /* where_clause_opt */ - case 396: /* signed */ - case 397: /* literal_func */ - case 400: /* expr_or_subquery */ - case 401: /* pseudo_column */ - case 402: /* column_reference */ - case 403: /* function_expression */ - case 404: /* case_when_expression */ - case 409: /* star_func_para */ - case 411: /* case_when_else_opt */ - case 412: /* common_expression */ - case 413: /* when_then_expr */ - case 414: /* predicate */ - case 417: /* in_predicate_value */ - case 418: /* boolean_value_expression */ - case 419: /* boolean_primary */ - case 420: /* from_clause_opt */ - case 421: /* table_reference_list */ - case 422: /* table_reference */ - case 423: /* table_primary */ - case 424: /* joined_table */ - case 426: /* subquery */ - case 427: /* parenthesized_joined_table */ - case 429: /* search_condition */ - case 430: /* query_specification */ - case 434: /* range_opt */ - case 435: /* every_opt */ - case 436: /* fill_opt */ - case 437: /* twindow_clause_opt */ - case 439: /* having_clause_opt */ - case 440: /* select_item */ - case 442: /* partition_item */ - case 445: /* query_expression */ - case 446: /* query_simple */ - case 448: /* slimit_clause_opt */ - case 449: /* limit_clause_opt */ - case 450: /* union_query_expression */ - case 451: /* query_simple_or_subquery */ - case 453: /* sort_specification */ + case 324: /* cmd */ + case 327: /* literal */ + case 340: /* db_options */ + case 342: /* alter_db_options */ + case 348: /* retention */ + case 349: /* full_table_name */ + case 352: /* table_options */ + case 356: /* alter_table_clause */ + case 357: /* alter_table_options */ + case 360: /* signed_literal */ + case 361: /* create_subtable_clause */ + case 364: /* drop_table_clause */ + case 367: /* column_def */ + case 371: /* duration_literal */ + case 372: /* rollup_func_name */ + case 374: /* col_name */ + case 375: /* db_name_cond_opt */ + case 376: /* like_pattern_opt */ + case 377: /* table_name_cond */ + case 378: /* from_db_opt */ + case 380: /* tag_item */ + case 382: /* index_options */ + case 384: /* sliding_opt */ + case 385: /* sma_stream_opt */ + case 386: /* func */ + case 387: /* query_or_subquery */ + case 390: /* explain_options */ + case 394: /* stream_options */ + case 395: /* subtable_opt */ + case 396: /* expression */ + case 398: /* where_clause_opt */ + case 399: /* signed */ + case 400: /* literal_func */ + case 403: /* expr_or_subquery */ + case 404: /* pseudo_column */ + case 405: /* column_reference */ + case 406: /* function_expression */ + case 407: /* case_when_expression */ + case 412: /* star_func_para */ + case 414: /* case_when_else_opt */ + case 415: /* common_expression */ + case 416: /* when_then_expr */ + case 417: /* predicate */ + case 420: /* in_predicate_value */ + case 421: /* boolean_value_expression */ + case 422: /* boolean_primary */ + case 423: /* from_clause_opt */ + case 424: /* table_reference_list */ + case 425: /* table_reference */ + case 426: /* table_primary */ + case 427: /* joined_table */ + case 429: /* subquery */ + case 430: /* parenthesized_joined_table */ + case 432: /* search_condition */ + case 433: /* query_specification */ + case 437: /* range_opt */ + case 438: /* every_opt */ + case 439: /* fill_opt */ + case 440: /* twindow_clause_opt */ + case 442: /* having_clause_opt */ + case 443: /* select_item */ + case 445: /* partition_item */ + case 448: /* query_expression */ + case 449: /* query_simple */ + case 451: /* slimit_clause_opt */ + case 452: /* limit_clause_opt */ + case 453: /* union_query_expression */ + case 454: /* query_simple_or_subquery */ + case 456: /* sort_specification */ { - nodesDestroyNode((yypminor->yy104)); + nodesDestroyNode((yypminor->yy74)); } break; - case 322: /* account_options */ - case 323: /* alter_account_options */ - case 325: /* alter_account_option */ - case 340: /* speed_opt */ - case 390: /* bufsize_opt */ + case 325: /* account_options */ + case 326: /* alter_account_options */ + case 328: /* alter_account_option */ + case 343: /* speed_opt */ + case 392: /* bufsize_opt */ { } break; - case 326: /* user_name */ - case 329: /* priv_level */ - case 332: /* db_name */ - case 333: /* topic_name */ - case 334: /* dnode_endpoint */ - case 355: /* column_name */ - case 363: /* table_name */ - case 370: /* function_name */ - case 378: /* column_alias */ - case 386: /* cgroup_name */ - case 391: /* stream_name */ - case 399: /* table_alias */ - case 405: /* star_func */ - case 407: /* noarg_func */ - case 425: /* alias_opt */ + case 329: /* user_name */ + case 332: /* priv_level */ + case 335: /* db_name */ + case 336: /* topic_name */ + case 337: /* dnode_endpoint */ + case 358: /* column_name */ + case 366: /* table_name */ + case 373: /* function_name */ + case 381: /* column_alias */ + case 388: /* cgroup_name */ + case 393: /* stream_name */ + case 402: /* table_alias */ + case 408: /* star_func */ + case 410: /* noarg_func */ + case 428: /* alias_opt */ { } break; - case 327: /* sysinfo_opt */ + case 330: /* sysinfo_opt */ { } break; - case 328: /* privileges */ - case 330: /* priv_type_list */ - case 331: /* priv_type */ + case 331: /* privileges */ + case 333: /* priv_type_list */ + case 334: /* priv_type */ { } break; - case 335: /* force_opt */ - case 336: /* not_exists_opt */ - case 338: /* exists_opt */ - case 387: /* analyze_opt */ - case 389: /* agg_func_opt */ - case 431: /* set_quantifier_opt */ + case 338: /* force_opt */ + case 339: /* not_exists_opt */ + case 341: /* exists_opt */ + case 389: /* analyze_opt */ + case 391: /* agg_func_opt */ + case 434: /* set_quantifier_opt */ { } break; - case 341: /* integer_list */ - case 342: /* variable_list */ - case 343: /* retention_list */ - case 347: /* column_def_list */ - case 348: /* tags_def_opt */ - case 350: /* multi_create_clause */ - case 351: /* tags_def */ - case 352: /* multi_drop_clause */ - case 359: /* specific_cols_opt */ - case 360: /* expression_list */ - case 362: /* col_name_list */ - case 365: /* duration_list */ - case 366: /* rollup_func_list */ - case 376: /* tag_list_opt */ - case 380: /* func_list */ - case 394: /* dnode_list */ - case 398: /* literal_list */ - case 406: /* star_func_para_list */ - case 408: /* other_para_list */ - case 410: /* when_then_list */ - case 432: /* select_list */ - case 433: /* partition_by_clause_opt */ - case 438: /* group_by_clause_opt */ - case 441: /* partition_list */ - case 444: /* group_by_list */ - case 447: /* order_by_clause_opt */ - case 452: /* sort_specification_list */ + case 344: /* integer_list */ + case 345: /* variable_list */ + case 346: /* retention_list */ + case 350: /* column_def_list */ + case 351: /* tags_def_opt */ + case 353: /* multi_create_clause */ + case 354: /* tags_def */ + case 355: /* multi_drop_clause */ + case 362: /* specific_cols_opt */ + case 363: /* expression_list */ + case 365: /* col_name_list */ + case 368: /* duration_list */ + case 369: /* rollup_func_list */ + case 379: /* tag_list_opt */ + case 383: /* func_list */ + case 397: /* dnode_list */ + case 401: /* literal_list */ + case 409: /* star_func_para_list */ + case 411: /* other_para_list */ + case 413: /* when_then_list */ + case 435: /* select_list */ + case 436: /* partition_by_clause_opt */ + case 441: /* group_by_clause_opt */ + case 444: /* partition_list */ + case 447: /* group_by_list */ + case 450: /* order_by_clause_opt */ + case 455: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy616)); + nodesDestroyList((yypminor->yy874)); } break; - case 344: /* alter_db_option */ - case 367: /* alter_table_option */ + case 347: /* alter_db_option */ + case 370: /* alter_table_option */ { } break; - case 356: /* type_name */ + case 359: /* type_name */ { } break; - case 415: /* compare_op */ - case 416: /* in_op */ + case 418: /* compare_op */ + case 419: /* in_op */ { } break; - case 428: /* join_type */ + case 431: /* join_type */ { } break; - case 443: /* fill_mode */ + case 446: /* fill_mode */ { } break; - case 454: /* ordering_specification_opt */ + case 457: /* ordering_specification_opt */ { } break; - case 455: /* null_ordering_opt */ + case 458: /* null_ordering_opt */ { } @@ -2952,544 +2971,546 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 321, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 321, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 322, 0 }, /* (2) account_options ::= */ - { 322, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 322, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 322, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 322, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 322, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 322, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 322, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 322, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 322, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 323, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 323, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 325, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 325, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 325, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 325, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 325, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 325, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 325, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 325, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 325, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 325, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 321, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 321, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 321, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 321, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 321, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 327, 0 }, /* (29) sysinfo_opt ::= */ - { 327, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 321, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 321, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 328, -1 }, /* (33) privileges ::= ALL */ - { 328, -1 }, /* (34) privileges ::= priv_type_list */ - { 328, -1 }, /* (35) privileges ::= SUBSCRIBE */ - { 330, -1 }, /* (36) priv_type_list ::= priv_type */ - { 330, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 331, -1 }, /* (38) priv_type ::= READ */ - { 331, -1 }, /* (39) priv_type ::= WRITE */ - { 329, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 329, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ - { 329, -1 }, /* (42) priv_level ::= topic_name */ - { 321, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ - { 321, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 321, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ - { 321, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ - { 321, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 321, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 321, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ - { 321, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 334, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ - { 334, -1 }, /* (52) dnode_endpoint ::= NK_ID */ - { 334, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ - { 335, 0 }, /* (54) force_opt ::= */ - { 335, -1 }, /* (55) force_opt ::= FORCE */ - { 321, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ - { 321, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 321, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 321, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ - { 321, -2 }, /* (68) cmd ::= USE db_name */ - { 321, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 321, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ - { 321, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ - { 336, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ - { 336, 0 }, /* (73) not_exists_opt ::= */ - { 338, -2 }, /* (74) exists_opt ::= IF EXISTS */ - { 338, 0 }, /* (75) exists_opt ::= */ - { 337, 0 }, /* (76) db_options ::= */ - { 337, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ - { 337, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ - { 337, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 337, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ - { 337, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ - { 337, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ - { 337, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ - { 337, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ - { 337, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ - { 337, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ - { 337, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ - { 337, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ - { 337, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ - { 337, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ - { 337, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 337, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 337, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 337, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 337, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 337, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 337, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 337, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 337, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 337, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 337, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 337, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 337, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 339, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 339, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 344, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 344, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 344, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 344, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 344, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 344, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 344, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 344, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 344, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ - { 344, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 344, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 341, -1 }, /* (121) integer_list ::= NK_INTEGER */ - { 341, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 342, -1 }, /* (123) variable_list ::= NK_VARIABLE */ - { 342, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 343, -1 }, /* (125) retention_list ::= retention */ - { 343, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ - { 345, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 340, 0 }, /* (128) speed_opt ::= */ - { 340, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 321, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 321, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ - { 321, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 321, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ - { 321, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ - { 321, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ - { 321, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ - { 353, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ - { 353, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 353, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 353, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 353, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 353, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 353, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 353, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 353, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 353, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 350, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ - { 350, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 358, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 352, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ - { 352, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 361, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ - { 359, 0 }, /* (153) specific_cols_opt ::= */ - { 359, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 346, -1 }, /* (155) full_table_name ::= table_name */ - { 346, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ - { 347, -1 }, /* (157) column_def_list ::= column_def */ - { 347, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ - { 364, -2 }, /* (159) column_def ::= column_name type_name */ - { 364, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ - { 356, -1 }, /* (161) type_name ::= BOOL */ - { 356, -1 }, /* (162) type_name ::= TINYINT */ - { 356, -1 }, /* (163) type_name ::= SMALLINT */ - { 356, -1 }, /* (164) type_name ::= INT */ - { 356, -1 }, /* (165) type_name ::= INTEGER */ - { 356, -1 }, /* (166) type_name ::= BIGINT */ - { 356, -1 }, /* (167) type_name ::= FLOAT */ - { 356, -1 }, /* (168) type_name ::= DOUBLE */ - { 356, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (170) type_name ::= TIMESTAMP */ - { 356, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ - { 356, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ - { 356, -2 }, /* (174) type_name ::= INT UNSIGNED */ - { 356, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ - { 356, -1 }, /* (176) type_name ::= JSON */ - { 356, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (178) type_name ::= MEDIUMBLOB */ - { 356, -1 }, /* (179) type_name ::= BLOB */ - { 356, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (181) type_name ::= DECIMAL */ - { 356, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 356, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 348, 0 }, /* (184) tags_def_opt ::= */ - { 348, -1 }, /* (185) tags_def_opt ::= tags_def */ - { 351, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 349, 0 }, /* (187) table_options ::= */ - { 349, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ - { 349, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ - { 349, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ - { 349, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 349, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ - { 349, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 354, -1 }, /* (194) alter_table_options ::= alter_table_option */ - { 354, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ - { 367, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ - { 367, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ - { 365, -1 }, /* (198) duration_list ::= duration_literal */ - { 365, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ - { 366, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ - { 366, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 369, -1 }, /* (202) rollup_func_name ::= function_name */ - { 369, -1 }, /* (203) rollup_func_name ::= FIRST */ - { 369, -1 }, /* (204) rollup_func_name ::= LAST */ - { 362, -1 }, /* (205) col_name_list ::= col_name */ - { 362, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ - { 371, -1 }, /* (207) col_name ::= column_name */ - { 321, -2 }, /* (208) cmd ::= SHOW DNODES */ - { 321, -2 }, /* (209) cmd ::= SHOW USERS */ - { 321, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ - { 321, -2 }, /* (211) cmd ::= SHOW DATABASES */ - { 321, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 321, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 321, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 321, -2 }, /* (215) cmd ::= SHOW MNODES */ - { 321, -2 }, /* (216) cmd ::= SHOW QNODES */ - { 321, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ - { 321, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 321, -2 }, /* (219) cmd ::= SHOW STREAMS */ - { 321, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ - { 321, -2 }, /* (221) cmd ::= SHOW APPS */ - { 321, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ - { 321, -2 }, /* (223) cmd ::= SHOW LICENCES */ - { 321, -2 }, /* (224) cmd ::= SHOW GRANTS */ - { 321, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ - { 321, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ - { 321, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ - { 321, -2 }, /* (228) cmd ::= SHOW QUERIES */ - { 321, -2 }, /* (229) cmd ::= SHOW SCORES */ - { 321, -2 }, /* (230) cmd ::= SHOW TOPICS */ - { 321, -2 }, /* (231) cmd ::= SHOW VARIABLES */ - { 321, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ - { 321, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ - { 321, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 321, -2 }, /* (235) cmd ::= SHOW BNODES */ - { 321, -2 }, /* (236) cmd ::= SHOW SNODES */ - { 321, -2 }, /* (237) cmd ::= SHOW CLUSTER */ - { 321, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ - { 321, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 321, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ - { 321, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ - { 321, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 321, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 321, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ - { 321, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ - { 372, 0 }, /* (246) db_name_cond_opt ::= */ - { 372, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ - { 373, 0 }, /* (248) like_pattern_opt ::= */ - { 373, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ - { 374, -1 }, /* (250) table_name_cond ::= table_name */ - { 375, 0 }, /* (251) from_db_opt ::= */ - { 375, -2 }, /* (252) from_db_opt ::= FROM db_name */ - { 376, 0 }, /* (253) tag_list_opt ::= */ - { 376, -1 }, /* (254) tag_list_opt ::= tag_item */ - { 376, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 377, -1 }, /* (256) tag_item ::= TBNAME */ - { 377, -1 }, /* (257) tag_item ::= QTAGS */ - { 377, -1 }, /* (258) tag_item ::= column_name */ - { 377, -2 }, /* (259) tag_item ::= column_name column_alias */ - { 377, -3 }, /* (260) tag_item ::= column_name AS column_alias */ - { 321, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 321, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ - { 379, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 379, -12 }, /* (264) 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 */ - { 380, -1 }, /* (265) func_list ::= func */ - { 380, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ - { 383, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ - { 382, 0 }, /* (268) sma_stream_opt ::= */ - { 382, -3 }, /* (269) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 382, -3 }, /* (270) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 321, -6 }, /* (271) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 321, -7 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 321, -9 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 321, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 321, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 321, -4 }, /* (276) cmd ::= DROP TOPIC exists_opt topic_name */ - { 321, -7 }, /* (277) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 321, -2 }, /* (278) cmd ::= DESC full_table_name */ - { 321, -2 }, /* (279) cmd ::= DESCRIBE full_table_name */ - { 321, -3 }, /* (280) cmd ::= RESET QUERY CACHE */ - { 321, -4 }, /* (281) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (282) analyze_opt ::= */ - { 387, -1 }, /* (283) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (284) explain_options ::= */ - { 388, -3 }, /* (285) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (286) explain_options ::= explain_options RATIO NK_FLOAT */ - { 321, -10 }, /* (287) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 321, -4 }, /* (288) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (289) agg_func_opt ::= */ - { 389, -1 }, /* (290) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (291) bufsize_opt ::= */ - { 390, -2 }, /* (292) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 321, -11 }, /* (293) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 321, -4 }, /* (294) cmd ::= DROP STREAM exists_opt stream_name */ - { 384, 0 }, /* (295) stream_options ::= */ - { 384, -3 }, /* (296) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 384, -3 }, /* (297) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 384, -4 }, /* (298) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 384, -3 }, /* (299) stream_options ::= stream_options WATERMARK duration_literal */ - { 384, -4 }, /* (300) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 384, -3 }, /* (301) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 392, 0 }, /* (302) subtable_opt ::= */ - { 392, -4 }, /* (303) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 321, -3 }, /* (304) cmd ::= KILL CONNECTION NK_INTEGER */ - { 321, -3 }, /* (305) cmd ::= KILL QUERY NK_STRING */ - { 321, -3 }, /* (306) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 321, -2 }, /* (307) cmd ::= BALANCE VGROUP */ - { 321, -4 }, /* (308) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 321, -4 }, /* (309) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 321, -3 }, /* (310) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 394, -2 }, /* (311) dnode_list ::= DNODE NK_INTEGER */ - { 394, -3 }, /* (312) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 321, -4 }, /* (313) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 321, -1 }, /* (314) cmd ::= query_or_subquery */ - { 321, -7 }, /* (315) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 321, -4 }, /* (316) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 324, -1 }, /* (317) literal ::= NK_INTEGER */ - { 324, -1 }, /* (318) literal ::= NK_FLOAT */ - { 324, -1 }, /* (319) literal ::= NK_STRING */ - { 324, -1 }, /* (320) literal ::= NK_BOOL */ - { 324, -2 }, /* (321) literal ::= TIMESTAMP NK_STRING */ - { 324, -1 }, /* (322) literal ::= duration_literal */ - { 324, -1 }, /* (323) literal ::= NULL */ - { 324, -1 }, /* (324) literal ::= NK_QUESTION */ - { 368, -1 }, /* (325) duration_literal ::= NK_VARIABLE */ - { 396, -1 }, /* (326) signed ::= NK_INTEGER */ - { 396, -2 }, /* (327) signed ::= NK_PLUS NK_INTEGER */ - { 396, -2 }, /* (328) signed ::= NK_MINUS NK_INTEGER */ - { 396, -1 }, /* (329) signed ::= NK_FLOAT */ - { 396, -2 }, /* (330) signed ::= NK_PLUS NK_FLOAT */ - { 396, -2 }, /* (331) signed ::= NK_MINUS NK_FLOAT */ - { 357, -1 }, /* (332) signed_literal ::= signed */ - { 357, -1 }, /* (333) signed_literal ::= NK_STRING */ - { 357, -1 }, /* (334) signed_literal ::= NK_BOOL */ - { 357, -2 }, /* (335) signed_literal ::= TIMESTAMP NK_STRING */ - { 357, -1 }, /* (336) signed_literal ::= duration_literal */ - { 357, -1 }, /* (337) signed_literal ::= NULL */ - { 357, -1 }, /* (338) signed_literal ::= literal_func */ - { 357, -1 }, /* (339) signed_literal ::= NK_QUESTION */ - { 398, -1 }, /* (340) literal_list ::= signed_literal */ - { 398, -3 }, /* (341) literal_list ::= literal_list NK_COMMA signed_literal */ - { 332, -1 }, /* (342) db_name ::= NK_ID */ - { 363, -1 }, /* (343) table_name ::= NK_ID */ - { 355, -1 }, /* (344) column_name ::= NK_ID */ - { 370, -1 }, /* (345) function_name ::= NK_ID */ - { 399, -1 }, /* (346) table_alias ::= NK_ID */ - { 378, -1 }, /* (347) column_alias ::= NK_ID */ - { 326, -1 }, /* (348) user_name ::= NK_ID */ - { 333, -1 }, /* (349) topic_name ::= NK_ID */ - { 391, -1 }, /* (350) stream_name ::= NK_ID */ - { 386, -1 }, /* (351) cgroup_name ::= NK_ID */ - { 400, -1 }, /* (352) expr_or_subquery ::= expression */ - { 393, -1 }, /* (353) expression ::= literal */ - { 393, -1 }, /* (354) expression ::= pseudo_column */ - { 393, -1 }, /* (355) expression ::= column_reference */ - { 393, -1 }, /* (356) expression ::= function_expression */ - { 393, -1 }, /* (357) expression ::= case_when_expression */ - { 393, -3 }, /* (358) expression ::= NK_LP expression NK_RP */ - { 393, -2 }, /* (359) expression ::= NK_PLUS expr_or_subquery */ - { 393, -2 }, /* (360) expression ::= NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (361) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 393, -3 }, /* (362) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (363) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 393, -3 }, /* (364) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 393, -3 }, /* (365) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 393, -3 }, /* (366) expression ::= column_reference NK_ARROW NK_STRING */ - { 393, -3 }, /* (367) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 393, -3 }, /* (368) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 360, -1 }, /* (369) expression_list ::= expr_or_subquery */ - { 360, -3 }, /* (370) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 402, -1 }, /* (371) column_reference ::= column_name */ - { 402, -3 }, /* (372) column_reference ::= table_name NK_DOT column_name */ - { 401, -1 }, /* (373) pseudo_column ::= ROWTS */ - { 401, -1 }, /* (374) pseudo_column ::= TBNAME */ - { 401, -3 }, /* (375) pseudo_column ::= table_name NK_DOT TBNAME */ - { 401, -1 }, /* (376) pseudo_column ::= QSTART */ - { 401, -1 }, /* (377) pseudo_column ::= QEND */ - { 401, -1 }, /* (378) pseudo_column ::= QDURATION */ - { 401, -1 }, /* (379) pseudo_column ::= WSTART */ - { 401, -1 }, /* (380) pseudo_column ::= WEND */ - { 401, -1 }, /* (381) pseudo_column ::= WDURATION */ - { 401, -1 }, /* (382) pseudo_column ::= IROWTS */ - { 401, -1 }, /* (383) pseudo_column ::= QTAGS */ - { 403, -4 }, /* (384) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 403, -4 }, /* (385) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 403, -6 }, /* (386) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 403, -1 }, /* (387) function_expression ::= literal_func */ - { 397, -3 }, /* (388) literal_func ::= noarg_func NK_LP NK_RP */ - { 397, -1 }, /* (389) literal_func ::= NOW */ - { 407, -1 }, /* (390) noarg_func ::= NOW */ - { 407, -1 }, /* (391) noarg_func ::= TODAY */ - { 407, -1 }, /* (392) noarg_func ::= TIMEZONE */ - { 407, -1 }, /* (393) noarg_func ::= DATABASE */ - { 407, -1 }, /* (394) noarg_func ::= CLIENT_VERSION */ - { 407, -1 }, /* (395) noarg_func ::= SERVER_VERSION */ - { 407, -1 }, /* (396) noarg_func ::= SERVER_STATUS */ - { 407, -1 }, /* (397) noarg_func ::= CURRENT_USER */ - { 407, -1 }, /* (398) noarg_func ::= USER */ - { 405, -1 }, /* (399) star_func ::= COUNT */ - { 405, -1 }, /* (400) star_func ::= FIRST */ - { 405, -1 }, /* (401) star_func ::= LAST */ - { 405, -1 }, /* (402) star_func ::= LAST_ROW */ - { 406, -1 }, /* (403) star_func_para_list ::= NK_STAR */ - { 406, -1 }, /* (404) star_func_para_list ::= other_para_list */ - { 408, -1 }, /* (405) other_para_list ::= star_func_para */ - { 408, -3 }, /* (406) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 409, -1 }, /* (407) star_func_para ::= expr_or_subquery */ - { 409, -3 }, /* (408) star_func_para ::= table_name NK_DOT NK_STAR */ - { 404, -4 }, /* (409) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 404, -5 }, /* (410) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 410, -1 }, /* (411) when_then_list ::= when_then_expr */ - { 410, -2 }, /* (412) when_then_list ::= when_then_list when_then_expr */ - { 413, -4 }, /* (413) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 411, 0 }, /* (414) case_when_else_opt ::= */ - { 411, -2 }, /* (415) case_when_else_opt ::= ELSE common_expression */ - { 414, -3 }, /* (416) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 414, -5 }, /* (417) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -6 }, /* (418) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -3 }, /* (419) predicate ::= expr_or_subquery IS NULL */ - { 414, -4 }, /* (420) predicate ::= expr_or_subquery IS NOT NULL */ - { 414, -3 }, /* (421) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 415, -1 }, /* (422) compare_op ::= NK_LT */ - { 415, -1 }, /* (423) compare_op ::= NK_GT */ - { 415, -1 }, /* (424) compare_op ::= NK_LE */ - { 415, -1 }, /* (425) compare_op ::= NK_GE */ - { 415, -1 }, /* (426) compare_op ::= NK_NE */ - { 415, -1 }, /* (427) compare_op ::= NK_EQ */ - { 415, -1 }, /* (428) compare_op ::= LIKE */ - { 415, -2 }, /* (429) compare_op ::= NOT LIKE */ - { 415, -1 }, /* (430) compare_op ::= MATCH */ - { 415, -1 }, /* (431) compare_op ::= NMATCH */ - { 415, -1 }, /* (432) compare_op ::= CONTAINS */ - { 416, -1 }, /* (433) in_op ::= IN */ - { 416, -2 }, /* (434) in_op ::= NOT IN */ - { 417, -3 }, /* (435) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 418, -1 }, /* (436) boolean_value_expression ::= boolean_primary */ - { 418, -2 }, /* (437) boolean_value_expression ::= NOT boolean_primary */ - { 418, -3 }, /* (438) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 418, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 419, -1 }, /* (440) boolean_primary ::= predicate */ - { 419, -3 }, /* (441) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 412, -1 }, /* (442) common_expression ::= expr_or_subquery */ - { 412, -1 }, /* (443) common_expression ::= boolean_value_expression */ - { 420, 0 }, /* (444) from_clause_opt ::= */ - { 420, -2 }, /* (445) from_clause_opt ::= FROM table_reference_list */ - { 421, -1 }, /* (446) table_reference_list ::= table_reference */ - { 421, -3 }, /* (447) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 422, -1 }, /* (448) table_reference ::= table_primary */ - { 422, -1 }, /* (449) table_reference ::= joined_table */ - { 423, -2 }, /* (450) table_primary ::= table_name alias_opt */ - { 423, -4 }, /* (451) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 423, -2 }, /* (452) table_primary ::= subquery alias_opt */ - { 423, -1 }, /* (453) table_primary ::= parenthesized_joined_table */ - { 425, 0 }, /* (454) alias_opt ::= */ - { 425, -1 }, /* (455) alias_opt ::= table_alias */ - { 425, -2 }, /* (456) alias_opt ::= AS table_alias */ - { 427, -3 }, /* (457) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 427, -3 }, /* (458) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 424, -6 }, /* (459) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 428, 0 }, /* (460) join_type ::= */ - { 428, -1 }, /* (461) join_type ::= INNER */ - { 430, -12 }, /* (462) query_specification ::= SELECT set_quantifier_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 */ - { 431, 0 }, /* (463) set_quantifier_opt ::= */ - { 431, -1 }, /* (464) set_quantifier_opt ::= DISTINCT */ - { 431, -1 }, /* (465) set_quantifier_opt ::= ALL */ - { 432, -1 }, /* (466) select_list ::= select_item */ - { 432, -3 }, /* (467) select_list ::= select_list NK_COMMA select_item */ - { 440, -1 }, /* (468) select_item ::= NK_STAR */ - { 440, -1 }, /* (469) select_item ::= common_expression */ - { 440, -2 }, /* (470) select_item ::= common_expression column_alias */ - { 440, -3 }, /* (471) select_item ::= common_expression AS column_alias */ - { 440, -3 }, /* (472) select_item ::= table_name NK_DOT NK_STAR */ - { 395, 0 }, /* (473) where_clause_opt ::= */ - { 395, -2 }, /* (474) where_clause_opt ::= WHERE search_condition */ - { 433, 0 }, /* (475) partition_by_clause_opt ::= */ - { 433, -3 }, /* (476) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 441, -1 }, /* (477) partition_list ::= partition_item */ - { 441, -3 }, /* (478) partition_list ::= partition_list NK_COMMA partition_item */ - { 442, -1 }, /* (479) partition_item ::= expr_or_subquery */ - { 442, -2 }, /* (480) partition_item ::= expr_or_subquery column_alias */ - { 442, -3 }, /* (481) partition_item ::= expr_or_subquery AS column_alias */ - { 437, 0 }, /* (482) twindow_clause_opt ::= */ - { 437, -6 }, /* (483) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 437, -4 }, /* (484) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 437, -6 }, /* (485) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 437, -8 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 381, 0 }, /* (487) sliding_opt ::= */ - { 381, -4 }, /* (488) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 436, 0 }, /* (489) fill_opt ::= */ - { 436, -4 }, /* (490) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 436, -6 }, /* (491) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 443, -1 }, /* (492) fill_mode ::= NONE */ - { 443, -1 }, /* (493) fill_mode ::= PREV */ - { 443, -1 }, /* (494) fill_mode ::= NULL */ - { 443, -1 }, /* (495) fill_mode ::= LINEAR */ - { 443, -1 }, /* (496) fill_mode ::= NEXT */ - { 438, 0 }, /* (497) group_by_clause_opt ::= */ - { 438, -3 }, /* (498) group_by_clause_opt ::= GROUP BY group_by_list */ - { 444, -1 }, /* (499) group_by_list ::= expr_or_subquery */ - { 444, -3 }, /* (500) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 439, 0 }, /* (501) having_clause_opt ::= */ - { 439, -2 }, /* (502) having_clause_opt ::= HAVING search_condition */ - { 434, 0 }, /* (503) range_opt ::= */ - { 434, -6 }, /* (504) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 435, 0 }, /* (505) every_opt ::= */ - { 435, -4 }, /* (506) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 445, -4 }, /* (507) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 446, -1 }, /* (508) query_simple ::= query_specification */ - { 446, -1 }, /* (509) query_simple ::= union_query_expression */ - { 450, -4 }, /* (510) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 450, -3 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 451, -1 }, /* (512) query_simple_or_subquery ::= query_simple */ - { 451, -1 }, /* (513) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (514) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (515) query_or_subquery ::= subquery */ - { 447, 0 }, /* (516) order_by_clause_opt ::= */ - { 447, -3 }, /* (517) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 448, 0 }, /* (518) slimit_clause_opt ::= */ - { 448, -2 }, /* (519) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 448, -4 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 448, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 449, 0 }, /* (522) limit_clause_opt ::= */ - { 449, -2 }, /* (523) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 449, -4 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 449, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 426, -3 }, /* (526) subquery ::= NK_LP query_expression NK_RP */ - { 426, -3 }, /* (527) subquery ::= NK_LP subquery NK_RP */ - { 429, -1 }, /* (528) search_condition ::= common_expression */ - { 452, -1 }, /* (529) sort_specification_list ::= sort_specification */ - { 452, -3 }, /* (530) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 453, -3 }, /* (531) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 454, 0 }, /* (532) ordering_specification_opt ::= */ - { 454, -1 }, /* (533) ordering_specification_opt ::= ASC */ - { 454, -1 }, /* (534) ordering_specification_opt ::= DESC */ - { 455, 0 }, /* (535) null_ordering_opt ::= */ - { 455, -2 }, /* (536) null_ordering_opt ::= NULLS FIRST */ - { 455, -2 }, /* (537) null_ordering_opt ::= NULLS LAST */ + { 324, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 324, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 325, 0 }, /* (2) account_options ::= */ + { 325, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 325, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 325, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 325, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 325, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 325, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 325, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 325, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 325, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 326, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 326, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 328, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 328, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 328, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 328, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 328, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 328, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 328, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 328, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 328, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 328, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 324, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 324, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 324, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 324, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 324, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 330, 0 }, /* (29) sysinfo_opt ::= */ + { 330, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 324, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 324, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 331, -1 }, /* (33) privileges ::= ALL */ + { 331, -1 }, /* (34) privileges ::= priv_type_list */ + { 331, -1 }, /* (35) privileges ::= SUBSCRIBE */ + { 333, -1 }, /* (36) priv_type_list ::= priv_type */ + { 333, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 334, -1 }, /* (38) priv_type ::= READ */ + { 334, -1 }, /* (39) priv_type ::= WRITE */ + { 332, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 332, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ + { 332, -1 }, /* (42) priv_level ::= topic_name */ + { 324, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ + { 324, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 324, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ + { 324, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ + { 324, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 324, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 324, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ + { 324, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 337, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ + { 337, -1 }, /* (52) dnode_endpoint ::= NK_ID */ + { 337, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ + { 338, 0 }, /* (54) force_opt ::= */ + { 338, -1 }, /* (55) force_opt ::= FORCE */ + { 324, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ + { 324, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 324, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 324, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ + { 324, -2 }, /* (68) cmd ::= USE db_name */ + { 324, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 324, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ + { 324, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ + { 339, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ + { 339, 0 }, /* (73) not_exists_opt ::= */ + { 341, -2 }, /* (74) exists_opt ::= IF EXISTS */ + { 341, 0 }, /* (75) exists_opt ::= */ + { 340, 0 }, /* (76) db_options ::= */ + { 340, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ + { 340, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ + { 340, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 340, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ + { 340, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ + { 340, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ + { 340, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ + { 340, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ + { 340, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ + { 340, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ + { 340, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ + { 340, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 340, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { 340, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ + { 340, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ + { 340, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ + { 340, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ + { 340, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 340, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ + { 340, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 340, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 340, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 340, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 340, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 340, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 340, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 340, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 340, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 340, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 340, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 340, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 342, -1 }, /* (108) alter_db_options ::= alter_db_option */ + { 342, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ + { 347, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ + { 347, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ + { 347, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 347, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 347, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ + { 347, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ + { 347, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ + { 347, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ + { 347, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 347, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 344, -1 }, /* (120) integer_list ::= NK_INTEGER */ + { 344, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 345, -1 }, /* (122) variable_list ::= NK_VARIABLE */ + { 345, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 346, -1 }, /* (124) retention_list ::= retention */ + { 346, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */ + { 348, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 343, 0 }, /* (127) speed_opt ::= */ + { 343, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 324, -9 }, /* (129) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 324, -3 }, /* (130) cmd ::= CREATE TABLE multi_create_clause */ + { 324, -9 }, /* (131) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 324, -3 }, /* (132) cmd ::= DROP TABLE multi_drop_clause */ + { 324, -4 }, /* (133) cmd ::= DROP STABLE exists_opt full_table_name */ + { 324, -3 }, /* (134) cmd ::= ALTER TABLE alter_table_clause */ + { 324, -3 }, /* (135) cmd ::= ALTER STABLE alter_table_clause */ + { 356, -2 }, /* (136) alter_table_clause ::= full_table_name alter_table_options */ + { 356, -5 }, /* (137) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 356, -4 }, /* (138) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 356, -5 }, /* (139) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 356, -5 }, /* (140) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 356, -5 }, /* (141) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 356, -4 }, /* (142) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 356, -5 }, /* (143) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 356, -5 }, /* (144) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 356, -6 }, /* (145) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 353, -1 }, /* (146) multi_create_clause ::= create_subtable_clause */ + { 353, -2 }, /* (147) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 361, -10 }, /* (148) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 355, -1 }, /* (149) multi_drop_clause ::= drop_table_clause */ + { 355, -2 }, /* (150) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 364, -2 }, /* (151) drop_table_clause ::= exists_opt full_table_name */ + { 362, 0 }, /* (152) specific_cols_opt ::= */ + { 362, -3 }, /* (153) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 349, -1 }, /* (154) full_table_name ::= table_name */ + { 349, -3 }, /* (155) full_table_name ::= db_name NK_DOT table_name */ + { 350, -1 }, /* (156) column_def_list ::= column_def */ + { 350, -3 }, /* (157) column_def_list ::= column_def_list NK_COMMA column_def */ + { 367, -2 }, /* (158) column_def ::= column_name type_name */ + { 367, -4 }, /* (159) column_def ::= column_name type_name COMMENT NK_STRING */ + { 359, -1 }, /* (160) type_name ::= BOOL */ + { 359, -1 }, /* (161) type_name ::= TINYINT */ + { 359, -1 }, /* (162) type_name ::= SMALLINT */ + { 359, -1 }, /* (163) type_name ::= INT */ + { 359, -1 }, /* (164) type_name ::= INTEGER */ + { 359, -1 }, /* (165) type_name ::= BIGINT */ + { 359, -1 }, /* (166) type_name ::= FLOAT */ + { 359, -1 }, /* (167) type_name ::= DOUBLE */ + { 359, -4 }, /* (168) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (169) type_name ::= TIMESTAMP */ + { 359, -4 }, /* (170) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 359, -2 }, /* (171) type_name ::= TINYINT UNSIGNED */ + { 359, -2 }, /* (172) type_name ::= SMALLINT UNSIGNED */ + { 359, -2 }, /* (173) type_name ::= INT UNSIGNED */ + { 359, -2 }, /* (174) type_name ::= BIGINT UNSIGNED */ + { 359, -1 }, /* (175) type_name ::= JSON */ + { 359, -4 }, /* (176) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (177) type_name ::= MEDIUMBLOB */ + { 359, -1 }, /* (178) type_name ::= BLOB */ + { 359, -4 }, /* (179) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (180) type_name ::= DECIMAL */ + { 359, -4 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 359, -6 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 351, 0 }, /* (183) tags_def_opt ::= */ + { 351, -1 }, /* (184) tags_def_opt ::= tags_def */ + { 354, -4 }, /* (185) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 352, 0 }, /* (186) table_options ::= */ + { 352, -3 }, /* (187) table_options ::= table_options COMMENT NK_STRING */ + { 352, -3 }, /* (188) table_options ::= table_options MAX_DELAY duration_list */ + { 352, -3 }, /* (189) table_options ::= table_options WATERMARK duration_list */ + { 352, -5 }, /* (190) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 352, -3 }, /* (191) table_options ::= table_options TTL NK_INTEGER */ + { 352, -5 }, /* (192) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 352, -3 }, /* (193) table_options ::= table_options DELETE_MARK duration_list */ + { 357, -1 }, /* (194) alter_table_options ::= alter_table_option */ + { 357, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ + { 370, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ + { 370, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ + { 368, -1 }, /* (198) duration_list ::= duration_literal */ + { 368, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ + { 369, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ + { 369, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 372, -1 }, /* (202) rollup_func_name ::= function_name */ + { 372, -1 }, /* (203) rollup_func_name ::= FIRST */ + { 372, -1 }, /* (204) rollup_func_name ::= LAST */ + { 365, -1 }, /* (205) col_name_list ::= col_name */ + { 365, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ + { 374, -1 }, /* (207) col_name ::= column_name */ + { 324, -2 }, /* (208) cmd ::= SHOW DNODES */ + { 324, -2 }, /* (209) cmd ::= SHOW USERS */ + { 324, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ + { 324, -2 }, /* (211) cmd ::= SHOW DATABASES */ + { 324, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 324, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 324, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 324, -2 }, /* (215) cmd ::= SHOW MNODES */ + { 324, -2 }, /* (216) cmd ::= SHOW QNODES */ + { 324, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ + { 324, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 324, -2 }, /* (219) cmd ::= SHOW STREAMS */ + { 324, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ + { 324, -2 }, /* (221) cmd ::= SHOW APPS */ + { 324, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ + { 324, -2 }, /* (223) cmd ::= SHOW LICENCES */ + { 324, -2 }, /* (224) cmd ::= SHOW GRANTS */ + { 324, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ + { 324, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ + { 324, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ + { 324, -2 }, /* (228) cmd ::= SHOW QUERIES */ + { 324, -2 }, /* (229) cmd ::= SHOW SCORES */ + { 324, -2 }, /* (230) cmd ::= SHOW TOPICS */ + { 324, -2 }, /* (231) cmd ::= SHOW VARIABLES */ + { 324, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ + { 324, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ + { 324, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 324, -2 }, /* (235) cmd ::= SHOW BNODES */ + { 324, -2 }, /* (236) cmd ::= SHOW SNODES */ + { 324, -2 }, /* (237) cmd ::= SHOW CLUSTER */ + { 324, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ + { 324, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 324, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ + { 324, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ + { 324, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 324, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 324, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ + { 324, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ + { 375, 0 }, /* (246) db_name_cond_opt ::= */ + { 375, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ + { 376, 0 }, /* (248) like_pattern_opt ::= */ + { 376, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ + { 377, -1 }, /* (250) table_name_cond ::= table_name */ + { 378, 0 }, /* (251) from_db_opt ::= */ + { 378, -2 }, /* (252) from_db_opt ::= FROM db_name */ + { 379, 0 }, /* (253) tag_list_opt ::= */ + { 379, -1 }, /* (254) tag_list_opt ::= tag_item */ + { 379, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 380, -1 }, /* (256) tag_item ::= TBNAME */ + { 380, -1 }, /* (257) tag_item ::= QTAGS */ + { 380, -1 }, /* (258) tag_item ::= column_name */ + { 380, -2 }, /* (259) tag_item ::= column_name column_alias */ + { 380, -3 }, /* (260) tag_item ::= column_name AS column_alias */ + { 324, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 324, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ + { 382, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 382, -12 }, /* (264) 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 */ + { 383, -1 }, /* (265) func_list ::= func */ + { 383, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ + { 386, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ + { 385, 0 }, /* (268) sma_stream_opt ::= */ + { 385, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 385, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 385, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 324, -6 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 324, -7 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 324, -9 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 324, -7 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 324, -9 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 324, -4 }, /* (277) cmd ::= DROP TOPIC exists_opt topic_name */ + { 324, -7 }, /* (278) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 324, -2 }, /* (279) cmd ::= DESC full_table_name */ + { 324, -2 }, /* (280) cmd ::= DESCRIBE full_table_name */ + { 324, -3 }, /* (281) cmd ::= RESET QUERY CACHE */ + { 324, -4 }, /* (282) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 389, 0 }, /* (283) analyze_opt ::= */ + { 389, -1 }, /* (284) analyze_opt ::= ANALYZE */ + { 390, 0 }, /* (285) explain_options ::= */ + { 390, -3 }, /* (286) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 390, -3 }, /* (287) explain_options ::= explain_options RATIO NK_FLOAT */ + { 324, -10 }, /* (288) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 324, -4 }, /* (289) cmd ::= DROP FUNCTION exists_opt function_name */ + { 391, 0 }, /* (290) agg_func_opt ::= */ + { 391, -1 }, /* (291) agg_func_opt ::= AGGREGATE */ + { 392, 0 }, /* (292) bufsize_opt ::= */ + { 392, -2 }, /* (293) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 324, -11 }, /* (294) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 324, -4 }, /* (295) cmd ::= DROP STREAM exists_opt stream_name */ + { 394, 0 }, /* (296) stream_options ::= */ + { 394, -3 }, /* (297) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 394, -3 }, /* (298) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 394, -4 }, /* (299) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 394, -3 }, /* (300) stream_options ::= stream_options WATERMARK duration_literal */ + { 394, -4 }, /* (301) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 394, -3 }, /* (302) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 395, 0 }, /* (303) subtable_opt ::= */ + { 395, -4 }, /* (304) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 324, -3 }, /* (305) cmd ::= KILL CONNECTION NK_INTEGER */ + { 324, -3 }, /* (306) cmd ::= KILL QUERY NK_STRING */ + { 324, -3 }, /* (307) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 324, -2 }, /* (308) cmd ::= BALANCE VGROUP */ + { 324, -4 }, /* (309) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 324, -4 }, /* (310) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 324, -3 }, /* (311) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 397, -2 }, /* (312) dnode_list ::= DNODE NK_INTEGER */ + { 397, -3 }, /* (313) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 324, -4 }, /* (314) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 324, -1 }, /* (315) cmd ::= query_or_subquery */ + { 324, -7 }, /* (316) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 324, -4 }, /* (317) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 327, -1 }, /* (318) literal ::= NK_INTEGER */ + { 327, -1 }, /* (319) literal ::= NK_FLOAT */ + { 327, -1 }, /* (320) literal ::= NK_STRING */ + { 327, -1 }, /* (321) literal ::= NK_BOOL */ + { 327, -2 }, /* (322) literal ::= TIMESTAMP NK_STRING */ + { 327, -1 }, /* (323) literal ::= duration_literal */ + { 327, -1 }, /* (324) literal ::= NULL */ + { 327, -1 }, /* (325) literal ::= NK_QUESTION */ + { 371, -1 }, /* (326) duration_literal ::= NK_VARIABLE */ + { 399, -1 }, /* (327) signed ::= NK_INTEGER */ + { 399, -2 }, /* (328) signed ::= NK_PLUS NK_INTEGER */ + { 399, -2 }, /* (329) signed ::= NK_MINUS NK_INTEGER */ + { 399, -1 }, /* (330) signed ::= NK_FLOAT */ + { 399, -2 }, /* (331) signed ::= NK_PLUS NK_FLOAT */ + { 399, -2 }, /* (332) signed ::= NK_MINUS NK_FLOAT */ + { 360, -1 }, /* (333) signed_literal ::= signed */ + { 360, -1 }, /* (334) signed_literal ::= NK_STRING */ + { 360, -1 }, /* (335) signed_literal ::= NK_BOOL */ + { 360, -2 }, /* (336) signed_literal ::= TIMESTAMP NK_STRING */ + { 360, -1 }, /* (337) signed_literal ::= duration_literal */ + { 360, -1 }, /* (338) signed_literal ::= NULL */ + { 360, -1 }, /* (339) signed_literal ::= literal_func */ + { 360, -1 }, /* (340) signed_literal ::= NK_QUESTION */ + { 401, -1 }, /* (341) literal_list ::= signed_literal */ + { 401, -3 }, /* (342) literal_list ::= literal_list NK_COMMA signed_literal */ + { 335, -1 }, /* (343) db_name ::= NK_ID */ + { 366, -1 }, /* (344) table_name ::= NK_ID */ + { 358, -1 }, /* (345) column_name ::= NK_ID */ + { 373, -1 }, /* (346) function_name ::= NK_ID */ + { 402, -1 }, /* (347) table_alias ::= NK_ID */ + { 381, -1 }, /* (348) column_alias ::= NK_ID */ + { 329, -1 }, /* (349) user_name ::= NK_ID */ + { 336, -1 }, /* (350) topic_name ::= NK_ID */ + { 393, -1 }, /* (351) stream_name ::= NK_ID */ + { 388, -1 }, /* (352) cgroup_name ::= NK_ID */ + { 403, -1 }, /* (353) expr_or_subquery ::= expression */ + { 396, -1 }, /* (354) expression ::= literal */ + { 396, -1 }, /* (355) expression ::= pseudo_column */ + { 396, -1 }, /* (356) expression ::= column_reference */ + { 396, -1 }, /* (357) expression ::= function_expression */ + { 396, -1 }, /* (358) expression ::= case_when_expression */ + { 396, -3 }, /* (359) expression ::= NK_LP expression NK_RP */ + { 396, -2 }, /* (360) expression ::= NK_PLUS expr_or_subquery */ + { 396, -2 }, /* (361) expression ::= NK_MINUS expr_or_subquery */ + { 396, -3 }, /* (362) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 396, -3 }, /* (363) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 396, -3 }, /* (364) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 396, -3 }, /* (365) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 396, -3 }, /* (366) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 396, -3 }, /* (367) expression ::= column_reference NK_ARROW NK_STRING */ + { 396, -3 }, /* (368) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 396, -3 }, /* (369) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 363, -1 }, /* (370) expression_list ::= expr_or_subquery */ + { 363, -3 }, /* (371) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 405, -1 }, /* (372) column_reference ::= column_name */ + { 405, -3 }, /* (373) column_reference ::= table_name NK_DOT column_name */ + { 404, -1 }, /* (374) pseudo_column ::= ROWTS */ + { 404, -1 }, /* (375) pseudo_column ::= TBNAME */ + { 404, -3 }, /* (376) pseudo_column ::= table_name NK_DOT TBNAME */ + { 404, -1 }, /* (377) pseudo_column ::= QSTART */ + { 404, -1 }, /* (378) pseudo_column ::= QEND */ + { 404, -1 }, /* (379) pseudo_column ::= QDURATION */ + { 404, -1 }, /* (380) pseudo_column ::= WSTART */ + { 404, -1 }, /* (381) pseudo_column ::= WEND */ + { 404, -1 }, /* (382) pseudo_column ::= WDURATION */ + { 404, -1 }, /* (383) pseudo_column ::= IROWTS */ + { 404, -1 }, /* (384) pseudo_column ::= QTAGS */ + { 406, -4 }, /* (385) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 406, -4 }, /* (386) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 406, -6 }, /* (387) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 406, -1 }, /* (388) function_expression ::= literal_func */ + { 400, -3 }, /* (389) literal_func ::= noarg_func NK_LP NK_RP */ + { 400, -1 }, /* (390) literal_func ::= NOW */ + { 410, -1 }, /* (391) noarg_func ::= NOW */ + { 410, -1 }, /* (392) noarg_func ::= TODAY */ + { 410, -1 }, /* (393) noarg_func ::= TIMEZONE */ + { 410, -1 }, /* (394) noarg_func ::= DATABASE */ + { 410, -1 }, /* (395) noarg_func ::= CLIENT_VERSION */ + { 410, -1 }, /* (396) noarg_func ::= SERVER_VERSION */ + { 410, -1 }, /* (397) noarg_func ::= SERVER_STATUS */ + { 410, -1 }, /* (398) noarg_func ::= CURRENT_USER */ + { 410, -1 }, /* (399) noarg_func ::= USER */ + { 408, -1 }, /* (400) star_func ::= COUNT */ + { 408, -1 }, /* (401) star_func ::= FIRST */ + { 408, -1 }, /* (402) star_func ::= LAST */ + { 408, -1 }, /* (403) star_func ::= LAST_ROW */ + { 409, -1 }, /* (404) star_func_para_list ::= NK_STAR */ + { 409, -1 }, /* (405) star_func_para_list ::= other_para_list */ + { 411, -1 }, /* (406) other_para_list ::= star_func_para */ + { 411, -3 }, /* (407) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 412, -1 }, /* (408) star_func_para ::= expr_or_subquery */ + { 412, -3 }, /* (409) star_func_para ::= table_name NK_DOT NK_STAR */ + { 407, -4 }, /* (410) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 407, -5 }, /* (411) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 413, -1 }, /* (412) when_then_list ::= when_then_expr */ + { 413, -2 }, /* (413) when_then_list ::= when_then_list when_then_expr */ + { 416, -4 }, /* (414) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 414, 0 }, /* (415) case_when_else_opt ::= */ + { 414, -2 }, /* (416) case_when_else_opt ::= ELSE common_expression */ + { 417, -3 }, /* (417) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 417, -5 }, /* (418) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 417, -6 }, /* (419) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 417, -3 }, /* (420) predicate ::= expr_or_subquery IS NULL */ + { 417, -4 }, /* (421) predicate ::= expr_or_subquery IS NOT NULL */ + { 417, -3 }, /* (422) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 418, -1 }, /* (423) compare_op ::= NK_LT */ + { 418, -1 }, /* (424) compare_op ::= NK_GT */ + { 418, -1 }, /* (425) compare_op ::= NK_LE */ + { 418, -1 }, /* (426) compare_op ::= NK_GE */ + { 418, -1 }, /* (427) compare_op ::= NK_NE */ + { 418, -1 }, /* (428) compare_op ::= NK_EQ */ + { 418, -1 }, /* (429) compare_op ::= LIKE */ + { 418, -2 }, /* (430) compare_op ::= NOT LIKE */ + { 418, -1 }, /* (431) compare_op ::= MATCH */ + { 418, -1 }, /* (432) compare_op ::= NMATCH */ + { 418, -1 }, /* (433) compare_op ::= CONTAINS */ + { 419, -1 }, /* (434) in_op ::= IN */ + { 419, -2 }, /* (435) in_op ::= NOT IN */ + { 420, -3 }, /* (436) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 421, -1 }, /* (437) boolean_value_expression ::= boolean_primary */ + { 421, -2 }, /* (438) boolean_value_expression ::= NOT boolean_primary */ + { 421, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 421, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 422, -1 }, /* (441) boolean_primary ::= predicate */ + { 422, -3 }, /* (442) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 415, -1 }, /* (443) common_expression ::= expr_or_subquery */ + { 415, -1 }, /* (444) common_expression ::= boolean_value_expression */ + { 423, 0 }, /* (445) from_clause_opt ::= */ + { 423, -2 }, /* (446) from_clause_opt ::= FROM table_reference_list */ + { 424, -1 }, /* (447) table_reference_list ::= table_reference */ + { 424, -3 }, /* (448) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 425, -1 }, /* (449) table_reference ::= table_primary */ + { 425, -1 }, /* (450) table_reference ::= joined_table */ + { 426, -2 }, /* (451) table_primary ::= table_name alias_opt */ + { 426, -4 }, /* (452) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 426, -2 }, /* (453) table_primary ::= subquery alias_opt */ + { 426, -1 }, /* (454) table_primary ::= parenthesized_joined_table */ + { 428, 0 }, /* (455) alias_opt ::= */ + { 428, -1 }, /* (456) alias_opt ::= table_alias */ + { 428, -2 }, /* (457) alias_opt ::= AS table_alias */ + { 430, -3 }, /* (458) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 430, -3 }, /* (459) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 427, -6 }, /* (460) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 431, 0 }, /* (461) join_type ::= */ + { 431, -1 }, /* (462) join_type ::= INNER */ + { 433, -12 }, /* (463) query_specification ::= SELECT set_quantifier_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 */ + { 434, 0 }, /* (464) set_quantifier_opt ::= */ + { 434, -1 }, /* (465) set_quantifier_opt ::= DISTINCT */ + { 434, -1 }, /* (466) set_quantifier_opt ::= ALL */ + { 435, -1 }, /* (467) select_list ::= select_item */ + { 435, -3 }, /* (468) select_list ::= select_list NK_COMMA select_item */ + { 443, -1 }, /* (469) select_item ::= NK_STAR */ + { 443, -1 }, /* (470) select_item ::= common_expression */ + { 443, -2 }, /* (471) select_item ::= common_expression column_alias */ + { 443, -3 }, /* (472) select_item ::= common_expression AS column_alias */ + { 443, -3 }, /* (473) select_item ::= table_name NK_DOT NK_STAR */ + { 398, 0 }, /* (474) where_clause_opt ::= */ + { 398, -2 }, /* (475) where_clause_opt ::= WHERE search_condition */ + { 436, 0 }, /* (476) partition_by_clause_opt ::= */ + { 436, -3 }, /* (477) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 444, -1 }, /* (478) partition_list ::= partition_item */ + { 444, -3 }, /* (479) partition_list ::= partition_list NK_COMMA partition_item */ + { 445, -1 }, /* (480) partition_item ::= expr_or_subquery */ + { 445, -2 }, /* (481) partition_item ::= expr_or_subquery column_alias */ + { 445, -3 }, /* (482) partition_item ::= expr_or_subquery AS column_alias */ + { 440, 0 }, /* (483) twindow_clause_opt ::= */ + { 440, -6 }, /* (484) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 440, -4 }, /* (485) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 440, -6 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 440, -8 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 440, -7 }, /* (488) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + { 384, 0 }, /* (489) sliding_opt ::= */ + { 384, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 439, 0 }, /* (491) fill_opt ::= */ + { 439, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 439, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 446, -1 }, /* (494) fill_mode ::= NONE */ + { 446, -1 }, /* (495) fill_mode ::= PREV */ + { 446, -1 }, /* (496) fill_mode ::= NULL */ + { 446, -1 }, /* (497) fill_mode ::= LINEAR */ + { 446, -1 }, /* (498) fill_mode ::= NEXT */ + { 441, 0 }, /* (499) group_by_clause_opt ::= */ + { 441, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ + { 447, -1 }, /* (501) group_by_list ::= expr_or_subquery */ + { 447, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 442, 0 }, /* (503) having_clause_opt ::= */ + { 442, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ + { 437, 0 }, /* (505) range_opt ::= */ + { 437, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 438, 0 }, /* (507) every_opt ::= */ + { 438, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 448, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 449, -1 }, /* (510) query_simple ::= query_specification */ + { 449, -1 }, /* (511) query_simple ::= union_query_expression */ + { 453, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 453, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 454, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ + { 454, -1 }, /* (515) query_simple_or_subquery ::= subquery */ + { 387, -1 }, /* (516) query_or_subquery ::= query_expression */ + { 387, -1 }, /* (517) query_or_subquery ::= subquery */ + { 450, 0 }, /* (518) order_by_clause_opt ::= */ + { 450, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 451, 0 }, /* (520) slimit_clause_opt ::= */ + { 451, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 451, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 451, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 452, 0 }, /* (524) limit_clause_opt ::= */ + { 452, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 452, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 452, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 429, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ + { 429, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ + { 432, -1 }, /* (530) search_condition ::= common_expression */ + { 455, -1 }, /* (531) sort_specification_list ::= sort_specification */ + { 455, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 456, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 457, 0 }, /* (534) ordering_specification_opt ::= */ + { 457, -1 }, /* (535) ordering_specification_opt ::= ASC */ + { 457, -1 }, /* (536) ordering_specification_opt ::= DESC */ + { 458, 0 }, /* (537) null_ordering_opt ::= */ + { 458, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ + { 458, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3578,11 +3599,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,322,&yymsp[0].minor); + yy_destructor(yypParser,325,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,323,&yymsp[0].minor); + yy_destructor(yypParser,326,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3596,20 +3617,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,322,&yymsp[-2].minor); +{ yy_destructor(yypParser,325,&yymsp[-2].minor); { } - yy_destructor(yypParser,324,&yymsp[0].minor); + yy_destructor(yypParser,327,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,325,&yymsp[0].minor); +{ yy_destructor(yypParser,328,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,323,&yymsp[-1].minor); +{ yy_destructor(yypParser,326,&yymsp[-1].minor); { } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,328,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3623,80 +3644,80 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,324,&yymsp[0].minor); + yy_destructor(yypParser,327,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy0, yymsp[0].minor.yy695); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy0, yymsp[0].minor.yy449); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy317); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy695 = 1; } +{ yymsp[1].minor.yy449 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy695 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy449 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy93 = yymsp[0].minor.yy93; } - yymsp[0].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy531 = yymsp[0].minor.yy531; } + yymsp[0].minor.yy531 = yylhsminor.yy531; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy93 = yymsp[-2].minor.yy93 | yymsp[0].minor.yy93; } - yymsp[-2].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy531 = yymsp[-2].minor.yy531 | yymsp[0].minor.yy531; } + yymsp[-2].minor.yy531 = yylhsminor.yy531; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy317 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy317 = yylhsminor.yy317; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy737; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy317 = yymsp[-2].minor.yy317; } + yymsp[-2].minor.yy317 = yylhsminor.yy317; break; case 42: /* priv_level ::= topic_name */ - case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); -{ yylhsminor.yy737 = yymsp[0].minor.yy737; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 456: /* alias_opt ::= table_alias */ yytestcase(yyruleno==456); +{ yylhsminor.yy317 = yymsp[0].minor.yy317; } + yymsp[0].minor.yy317 = yylhsminor.yy317; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy737, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy317, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy335); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy335); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3713,45 +3734,45 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 342: /* db_name ::= NK_ID */ yytestcase(yyruleno==342); - case 343: /* table_name ::= NK_ID */ yytestcase(yyruleno==343); - case 344: /* column_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* function_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* table_alias ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* column_alias ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* user_name ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* topic_name ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* stream_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==351); - case 390: /* noarg_func ::= NOW */ yytestcase(yyruleno==390); - case 391: /* noarg_func ::= TODAY */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= USER */ yytestcase(yyruleno==398); - case 399: /* star_func ::= COUNT */ yytestcase(yyruleno==399); - case 400: /* star_func ::= FIRST */ yytestcase(yyruleno==400); - case 401: /* star_func ::= LAST */ yytestcase(yyruleno==401); - case 402: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==402); -{ yylhsminor.yy737 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 343: /* db_name ::= NK_ID */ yytestcase(yyruleno==343); + case 344: /* table_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* column_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* function_name ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* table_alias ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* column_alias ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* user_name ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* topic_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* stream_name ::= NK_ID */ yytestcase(yyruleno==351); + case 352: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==352); + case 391: /* noarg_func ::= NOW */ yytestcase(yyruleno==391); + case 392: /* noarg_func ::= TODAY */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==398); + case 399: /* noarg_func ::= USER */ yytestcase(yyruleno==399); + case 400: /* star_func ::= COUNT */ yytestcase(yyruleno==400); + case 401: /* star_func ::= FIRST */ yytestcase(yyruleno==401); + case 402: /* star_func ::= LAST */ yytestcase(yyruleno==402); + case 403: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==403); +{ yylhsminor.yy317 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy317 = yylhsminor.yy317; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 282: /* analyze_opt ::= */ yytestcase(yyruleno==282); - case 289: /* agg_func_opt ::= */ yytestcase(yyruleno==289); - case 463: /* set_quantifier_opt ::= */ yytestcase(yyruleno==463); -{ yymsp[1].minor.yy185 = false; } + case 283: /* analyze_opt ::= */ yytestcase(yyruleno==283); + case 290: /* agg_func_opt ::= */ yytestcase(yyruleno==290); + case 464: /* set_quantifier_opt ::= */ yytestcase(yyruleno==464); +{ yymsp[1].minor.yy335 = false; } break; case 55: /* force_opt ::= FORCE */ - case 283: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==283); - case 290: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==290); - case 464: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==464); -{ yymsp[0].minor.yy185 = true; } + case 284: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==284); + case 291: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==291); + case 465: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==465); +{ yymsp[0].minor.yy335 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3784,498 +3805,499 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy185, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy335, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy196); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy856); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy185 = true; } +{ yymsp[-2].minor.yy335 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy185 = true; } +{ yymsp[-1].minor.yy335 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy74 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_KEEP, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_KEEP, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 92: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 95: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_RETENTIONS, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_RETENTIONS, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 100: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 102: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 108: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy104 = createAlterDatabaseOptions(pCxt); yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yylhsminor.yy104, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createAlterDatabaseOptions(pCxt); yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yylhsminor.yy74, &yymsp[0].minor.yy767); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 109: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy104, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy74, &yymsp[0].minor.yy767); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 110: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 114: /* alter_db_option ::= KEEP integer_list */ case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); -{ yymsp[-1].minor.yy557.type = DB_OPTION_KEEP; yymsp[-1].minor.yy557.pList = yymsp[0].minor.yy616; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_KEEP; yymsp[-1].minor.yy767.pList = yymsp[0].minor.yy874; } break; case 116: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_PAGES; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_PAGES; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; - case 118: /* alter_db_option ::= STRICT NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STRICT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_WAL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; - case 119: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_WAL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; - case 120: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 120: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 121: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 121: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 313: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==313); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 122: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 123: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy616 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 123: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; - break; - case 125: /* retention_list ::= retention */ - case 147: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==147); - case 150: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==150); - case 157: /* column_def_list ::= column_def */ yytestcase(yyruleno==157); + case 124: /* retention_list ::= retention */ + case 146: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==146); + case 149: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==149); + case 156: /* column_def_list ::= column_def */ yytestcase(yyruleno==156); case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); case 265: /* func_list ::= func */ yytestcase(yyruleno==265); - case 340: /* literal_list ::= signed_literal */ yytestcase(yyruleno==340); - case 405: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==405); - case 411: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==411); - case 466: /* select_list ::= select_item */ yytestcase(yyruleno==466); - case 477: /* partition_list ::= partition_item */ yytestcase(yyruleno==477); - case 529: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==529); -{ yylhsminor.yy616 = createNodeList(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 341: /* literal_list ::= signed_literal */ yytestcase(yyruleno==341); + case 406: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==406); + case 412: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==412); + case 467: /* select_list ::= select_item */ yytestcase(yyruleno==467); + case 478: /* partition_list ::= partition_item */ yytestcase(yyruleno==478); + case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); +{ yylhsminor.yy874 = createNodeList(pCxt, yymsp[0].minor.yy74); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 126: /* retention_list ::= retention_list NK_COMMA retention */ - case 158: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==158); + case 125: /* retention_list ::= retention_list NK_COMMA retention */ + case 157: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==157); case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); - case 341: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==341); - case 406: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==406); - case 467: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==467); - case 478: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==478); - case 530: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==530); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 342: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==342); + case 407: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==407); + case 468: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==468); + case 479: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==479); + case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy104 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 126: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ +{ yylhsminor.yy74 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 128: /* speed_opt ::= */ - case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); -{ yymsp[1].minor.yy196 = 0; } + case 127: /* speed_opt ::= */ + case 292: /* bufsize_opt ::= */ yytestcase(yyruleno==292); +{ yymsp[1].minor.yy856 = 0; } break; - case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); -{ yymsp[-1].minor.yy196 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 128: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 293: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==293); +{ yymsp[-1].minor.yy856 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 130: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 132: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==132); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-5].minor.yy104, yymsp[-3].minor.yy616, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } + case 129: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 131: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==131); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-5].minor.yy74, yymsp[-3].minor.yy874, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } break; - case 131: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy616); } + case 130: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); } break; - case 133: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy616); } + case 132: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); } break; - case 134: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } + case 133: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } break; - case 135: /* cmd ::= ALTER TABLE alter_table_clause */ - case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); -{ pCxt->pRootNode = yymsp[0].minor.yy104; } + case 134: /* cmd ::= ALTER TABLE alter_table_clause */ + case 315: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==315); +{ pCxt->pRootNode = yymsp[0].minor.yy74; } break; - case 136: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy104); } + case 135: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy74); } break; - case 137: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy104 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 136: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy74 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 138: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 137: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 139: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 138: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 140: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 139: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 141: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 140: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 142: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 141: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 143: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 142: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 144: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 143: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 145: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 144: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 146: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy104 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy104, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 145: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ +{ yylhsminor.yy74 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy74, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 148: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 151: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==151); - case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy616 = yylhsminor.yy616; + case 147: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 150: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==150); + case 413: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==413); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy874 = yylhsminor.yy874; break; - case 149: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy104 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy185, yymsp[-8].minor.yy104, yymsp[-6].minor.yy104, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-9].minor.yy104 = yylhsminor.yy104; + case 148: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ +{ yylhsminor.yy74 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy335, yymsp[-8].minor.yy74, yymsp[-6].minor.yy74, yymsp[-5].minor.yy874, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-9].minor.yy74 = yylhsminor.yy74; break; - case 152: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy104 = createDropTableClause(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 151: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy74 = createDropTableClause(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 153: /* specific_cols_opt ::= */ - case 184: /* tags_def_opt ::= */ yytestcase(yyruleno==184); + case 152: /* specific_cols_opt ::= */ + case 183: /* tags_def_opt ::= */ yytestcase(yyruleno==183); case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); - case 475: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==475); - case 497: /* group_by_clause_opt ::= */ yytestcase(yyruleno==497); - case 516: /* order_by_clause_opt ::= */ yytestcase(yyruleno==516); -{ yymsp[1].minor.yy616 = NULL; } + case 476: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==476); + case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); + case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); +{ yymsp[1].minor.yy874 = NULL; } break; - case 154: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy616 = yymsp[-1].minor.yy616; } + case 153: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 155: /* full_table_name ::= table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 154: /* full_table_name ::= table_name */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy317, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 156: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 155: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, NULL); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 159: /* column_def ::= column_name type_name */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640, NULL); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 158: /* column_def ::= column_name type_name */ +{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898, NULL); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 160: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-2].minor.yy640, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 159: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-2].minor.yy898, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 161: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 160: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 162: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 161: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 163: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 162: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 164: /* type_name ::= INT */ - case 165: /* type_name ::= INTEGER */ yytestcase(yyruleno==165); -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_INT); } + case 163: /* type_name ::= INT */ + case 164: /* type_name ::= INTEGER */ yytestcase(yyruleno==164); +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 166: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 165: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 167: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 166: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 168: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 167: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 169: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 168: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 170: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 169: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 171: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 170: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 172: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 171: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 173: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 172: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 174: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UINT); } + case 173: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 175: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 174: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 176: /* type_name ::= JSON */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_JSON); } + case 175: /* type_name ::= JSON */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 177: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 176: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 178: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 177: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 179: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 178: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 180: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 179: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 181: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 180: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 183: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 185: /* tags_def_opt ::= tags_def */ - case 404: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==404); -{ yylhsminor.yy616 = yymsp[0].minor.yy616; } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 184: /* tags_def_opt ::= tags_def */ + case 405: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==405); +{ yylhsminor.yy874 = yymsp[0].minor.yy874; } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 186: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy616 = yymsp[-1].minor.yy616; } + case 185: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 187: /* table_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultTableOptions(pCxt); } + case 186: /* table_options ::= */ +{ yymsp[1].minor.yy74 = createDefaultTableOptions(pCxt); } break; - case 188: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 187: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 189: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 188: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 190: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 189: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 191: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 190: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy874); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 192: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 191: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 193: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_SMA, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 192: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_SMA, yymsp[-1].minor.yy874); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 193: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 194: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy104 = createAlterTableOptions(pCxt); yylhsminor.yy104 = setTableOption(pCxt, yylhsminor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createAlterTableOptions(pCxt); yylhsminor.yy74 = setTableOption(pCxt, yylhsminor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 195: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 196: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 197: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy767.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; case 198: /* duration_list ::= duration_literal */ - case 369: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==369); -{ yylhsminor.yy616 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 370: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==370); +{ yylhsminor.yy874 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 370: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==370); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 371: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==371); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; case 202: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy317, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 203: /* rollup_func_name ::= FIRST */ case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 207: /* col_name ::= column_name */ case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 208: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -4290,13 +4312,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); } break; case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); } break; case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy104, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy74, NULL, OP_TYPE_LIKE); } break; case 215: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -4308,7 +4330,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); } break; case 219: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -4327,13 +4349,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy74); } break; case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy74); } break; case 228: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -4352,7 +4374,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy74); } break; case 235: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } @@ -4367,7 +4389,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy74); } break; case 240: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -4376,10 +4398,10 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); } break; case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104, yymsp[-3].minor.yy616); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74, yymsp[-3].minor.yy874); } break; case 244: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } @@ -4389,729 +4411,736 @@ static YYACTIONTYPE yy_reduce( break; case 246: /* db_name_cond_opt ::= */ case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); -{ yymsp[1].minor.yy104 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy74 = createDefaultDatabaseCondValue(pCxt); } break; case 247: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 248: /* like_pattern_opt ::= */ - case 302: /* subtable_opt ::= */ yytestcase(yyruleno==302); - case 414: /* case_when_else_opt ::= */ yytestcase(yyruleno==414); - case 444: /* from_clause_opt ::= */ yytestcase(yyruleno==444); - case 473: /* where_clause_opt ::= */ yytestcase(yyruleno==473); - case 482: /* twindow_clause_opt ::= */ yytestcase(yyruleno==482); - case 487: /* sliding_opt ::= */ yytestcase(yyruleno==487); - case 489: /* fill_opt ::= */ yytestcase(yyruleno==489); - case 501: /* having_clause_opt ::= */ yytestcase(yyruleno==501); - case 503: /* range_opt ::= */ yytestcase(yyruleno==503); - case 505: /* every_opt ::= */ yytestcase(yyruleno==505); - case 518: /* slimit_clause_opt ::= */ yytestcase(yyruleno==518); - case 522: /* limit_clause_opt ::= */ yytestcase(yyruleno==522); -{ yymsp[1].minor.yy104 = NULL; } + case 303: /* subtable_opt ::= */ yytestcase(yyruleno==303); + case 415: /* case_when_else_opt ::= */ yytestcase(yyruleno==415); + case 445: /* from_clause_opt ::= */ yytestcase(yyruleno==445); + case 474: /* where_clause_opt ::= */ yytestcase(yyruleno==474); + case 483: /* twindow_clause_opt ::= */ yytestcase(yyruleno==483); + case 489: /* sliding_opt ::= */ yytestcase(yyruleno==489); + case 491: /* fill_opt ::= */ yytestcase(yyruleno==491); + case 503: /* having_clause_opt ::= */ yytestcase(yyruleno==503); + case 505: /* range_opt ::= */ yytestcase(yyruleno==505); + case 507: /* every_opt ::= */ yytestcase(yyruleno==507); + case 520: /* slimit_clause_opt ::= */ yytestcase(yyruleno==520); + case 524: /* limit_clause_opt ::= */ yytestcase(yyruleno==524); +{ yymsp[1].minor.yy74 = NULL; } break; case 249: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 250: /* table_name_cond ::= table_name */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 252: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } +{ yymsp[-1].minor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } break; case 256: /* tag_item ::= TBNAME */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 259: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy317), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 260: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy317), &yymsp[0].minor.yy317); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy185, yymsp[-3].minor.yy104, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy335, yymsp[-3].minor.yy74, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); } break; case 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } break; case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy104 = createIndexOption(pCxt, yymsp[-7].minor.yy616, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } +{ yymsp[-9].minor.yy74 = createIndexOption(pCxt, yymsp[-7].minor.yy874, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy104 = createIndexOption(pCxt, yymsp[-9].minor.yy616, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } +{ yymsp[-11].minor.yy74 = createIndexOption(pCxt, yymsp[-9].minor.yy874, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; case 267: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; case 268: /* sma_stream_opt ::= */ - case 295: /* stream_options ::= */ yytestcase(yyruleno==295); -{ yymsp[1].minor.yy104 = createStreamOptions(pCxt); } + case 296: /* stream_options ::= */ yytestcase(yyruleno==296); +{ yymsp[1].minor.yy74 = createStreamOptions(pCxt); } break; - case 269: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 299: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==299); -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 269: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 300: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==300); +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 270: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 270: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 271: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } + case 271: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy737, false); } + case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); } break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[0].minor.yy737, true); } + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy317, false); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, yymsp[0].minor.yy104, false); } + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[0].minor.yy317, true); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, yymsp[0].minor.yy104, true); } + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, yymsp[0].minor.yy74, false); } break; - case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, yymsp[0].minor.yy74, true); } break; - case 277: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } + case 277: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 278: /* cmd ::= DESC full_table_name */ - case 279: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==279); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy104); } + case 278: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; - case 280: /* cmd ::= RESET QUERY CACHE */ + case 279: /* cmd ::= DESC full_table_name */ + case 280: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==280); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy74); } + break; + case 281: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 281: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy185, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 282: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy335, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 284: /* explain_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultExplainOptions(pCxt); } + case 285: /* explain_options ::= */ +{ yymsp[1].minor.yy74 = createDefaultExplainOptions(pCxt); } break; - case 285: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy104 = setExplainVerbose(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 286: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy74 = setExplainVerbose(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 286: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy104 = setExplainRatio(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 287: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy74 = setExplainRatio(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 287: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-8].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy640, yymsp[0].minor.yy196); } + case 288: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-8].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy898, yymsp[0].minor.yy856); } break; - case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 289: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 293: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy185, &yymsp[-7].minor.yy737, yymsp[-4].minor.yy104, yymsp[-6].minor.yy104, yymsp[-3].minor.yy616, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } + case 294: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy335, &yymsp[-7].minor.yy317, yymsp[-4].minor.yy74, yymsp[-6].minor.yy74, yymsp[-3].minor.yy874, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } break; - case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 295: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 296: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 297: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 297: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 298: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 298: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 299: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy74)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-3].minor.yy74; } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 300: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 301: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy74)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-3].minor.yy74; } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 301: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 302: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 303: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 488: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==488); - case 506: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==506); -{ yymsp[-3].minor.yy104 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy104); } + case 304: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 490: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); + case 508: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==508); +{ yymsp[-3].minor.yy74 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy74); } break; - case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 305: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 305: /* cmd ::= KILL QUERY NK_STRING */ + case 306: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 307: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= BALANCE VGROUP */ + case 308: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 309: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy616); } + case 310: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); } break; - case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 311: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 311: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 312: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 314: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 315: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy104, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } + case 316: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy74, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } break; - case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } + case 317: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); } break; - case 317: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 318: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 318: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 319: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 319: /* literal ::= NK_STRING */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 320: /* literal ::= NK_STRING */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 320: /* literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 321: /* literal ::= NK_BOOL */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 321: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 322: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 322: /* literal ::= duration_literal */ - case 332: /* signed_literal ::= signed */ yytestcase(yyruleno==332); - case 352: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==352); - case 353: /* expression ::= literal */ yytestcase(yyruleno==353); - case 354: /* expression ::= pseudo_column */ yytestcase(yyruleno==354); - case 355: /* expression ::= column_reference */ yytestcase(yyruleno==355); - case 356: /* expression ::= function_expression */ yytestcase(yyruleno==356); - case 357: /* expression ::= case_when_expression */ yytestcase(yyruleno==357); - case 387: /* function_expression ::= literal_func */ yytestcase(yyruleno==387); - case 436: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==436); - case 440: /* boolean_primary ::= predicate */ yytestcase(yyruleno==440); - case 442: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==442); - case 443: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==443); - case 446: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==446); - case 448: /* table_reference ::= table_primary */ yytestcase(yyruleno==448); - case 449: /* table_reference ::= joined_table */ yytestcase(yyruleno==449); - case 453: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==453); - case 508: /* query_simple ::= query_specification */ yytestcase(yyruleno==508); - case 509: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==509); - case 512: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==512); - case 514: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==514); -{ yylhsminor.yy104 = yymsp[0].minor.yy104; } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 323: /* literal ::= duration_literal */ + case 333: /* signed_literal ::= signed */ yytestcase(yyruleno==333); + case 353: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==353); + case 354: /* expression ::= literal */ yytestcase(yyruleno==354); + case 355: /* expression ::= pseudo_column */ yytestcase(yyruleno==355); + case 356: /* expression ::= column_reference */ yytestcase(yyruleno==356); + case 357: /* expression ::= function_expression */ yytestcase(yyruleno==357); + case 358: /* expression ::= case_when_expression */ yytestcase(yyruleno==358); + case 388: /* function_expression ::= literal_func */ yytestcase(yyruleno==388); + case 437: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==437); + case 441: /* boolean_primary ::= predicate */ yytestcase(yyruleno==441); + case 443: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==443); + case 444: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==444); + case 447: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==447); + case 449: /* table_reference ::= table_primary */ yytestcase(yyruleno==449); + case 450: /* table_reference ::= joined_table */ yytestcase(yyruleno==450); + case 454: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==454); + case 510: /* query_simple ::= query_specification */ yytestcase(yyruleno==510); + case 511: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==511); + case 514: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==514); + case 516: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==516); +{ yylhsminor.yy74 = yymsp[0].minor.yy74; } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 323: /* literal ::= NULL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 324: /* literal ::= NULL */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 324: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 325: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 325: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 326: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 326: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 327: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 327: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 328: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 328: /* signed ::= NK_MINUS NK_INTEGER */ + case 329: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 329: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 330: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 330: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 331: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 331: /* signed ::= NK_MINUS NK_FLOAT */ + case 332: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 333: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 334: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 334: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 335: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 336: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 336: /* signed_literal ::= duration_literal */ - case 338: /* signed_literal ::= literal_func */ yytestcase(yyruleno==338); - case 407: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==407); - case 469: /* select_item ::= common_expression */ yytestcase(yyruleno==469); - case 479: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==479); - case 513: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==513); - case 515: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==515); - case 528: /* search_condition ::= common_expression */ yytestcase(yyruleno==528); -{ yylhsminor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 337: /* signed_literal ::= duration_literal */ + case 339: /* signed_literal ::= literal_func */ yytestcase(yyruleno==339); + case 408: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==408); + case 470: /* select_item ::= common_expression */ yytestcase(yyruleno==470); + case 480: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==480); + case 515: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==515); + case 517: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==517); + case 530: /* search_condition ::= common_expression */ yytestcase(yyruleno==530); +{ yylhsminor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 337: /* signed_literal ::= NULL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 338: /* signed_literal ::= NULL */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 339: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 340: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy74 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 358: /* expression ::= NK_LP expression NK_RP */ - case 441: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==441); - case 527: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==527); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 359: /* expression ::= NK_LP expression NK_RP */ + case 442: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==442); + case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 359: /* expression ::= NK_PLUS expr_or_subquery */ + case 360: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 360: /* expression ::= NK_MINUS expr_or_subquery */ + case 361: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 362: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 366: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 367: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 368: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 369: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 371: /* column_reference ::= column_name */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy737, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 372: /* column_reference ::= column_name */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy317, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 372: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 373: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 373: /* pseudo_column ::= ROWTS */ - case 374: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==374); - case 376: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==376); - case 377: /* pseudo_column ::= QEND */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= WEND */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==383); - case 389: /* literal_func ::= NOW */ yytestcase(yyruleno==389); -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 374: /* pseudo_column ::= ROWTS */ + case 375: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==375); + case 377: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==377); + case 378: /* pseudo_column ::= QEND */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WEND */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==383); + case 384: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==384); + case 390: /* literal_func ::= NOW */ yytestcase(yyruleno==390); +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 375: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy737)))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 376: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy317)))); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 384: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 385: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==385); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 385: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 386: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==386); +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874)); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 386: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy640)); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 387: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy898)); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 388: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy737, NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 389: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy317, NULL)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 403: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy616 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 404: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy874 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 408: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 472: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==472); -{ yylhsminor.yy104 = createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 409: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 473: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==473); +{ yylhsminor.yy74 = createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 409: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 410: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 410: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 411: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 413: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy104 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } + case 414: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy74 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } break; - case 415: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } + case 416: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } break; - case 416: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 421: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==421); + case 417: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 422: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==422); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy668, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 418: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 419: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 419: /* predicate ::= expr_or_subquery IS NULL */ + case 420: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 421: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 422: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_THAN; } + case 423: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 423: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_THAN; } + case 424: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 424: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_EQUAL; } + case 425: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 425: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_EQUAL; } + case 426: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 426: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy668 = OP_TYPE_NOT_EQUAL; } + case 427: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 427: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy668 = OP_TYPE_EQUAL; } + case 428: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 428: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LIKE; } + case 429: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 429: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_LIKE; } + case 430: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 430: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_MATCH; } + case 431: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 431: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_NMATCH; } + case 432: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 432: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy668 = OP_TYPE_JSON_CONTAINS; } + case 433: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 433: /* in_op ::= IN */ -{ yymsp[0].minor.yy668 = OP_TYPE_IN; } + case 434: /* in_op ::= IN */ +{ yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 434: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_IN; } + case 435: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 435: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 436: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 437: /* boolean_value_expression ::= NOT boolean_primary */ + case 438: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 439: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 440: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 445: /* from_clause_opt ::= FROM table_reference_list */ - case 474: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==474); - case 502: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==502); -{ yymsp[-1].minor.yy104 = yymsp[0].minor.yy104; } + case 446: /* from_clause_opt ::= FROM table_reference_list */ + case 475: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==475); + case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); +{ yymsp[-1].minor.yy74 = yymsp[0].minor.yy74; } break; - case 447: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 448: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy74 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, NULL); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 450: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 451: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 451: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 452: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 452: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy104 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 453: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy74 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 454: /* alias_opt ::= */ -{ yymsp[1].minor.yy737 = nil_token; } + case 455: /* alias_opt ::= */ +{ yymsp[1].minor.yy317 = nil_token; } break; - case 456: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy737 = yymsp[0].minor.yy737; } + case 457: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy317 = yymsp[0].minor.yy317; } break; - case 457: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 458: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==458); -{ yymsp[-2].minor.yy104 = yymsp[-1].minor.yy104; } + case 458: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 459: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==459); +{ yymsp[-2].minor.yy74 = yymsp[-1].minor.yy74; } break; - case 459: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, yymsp[-4].minor.yy228, yymsp[-5].minor.yy104, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 460: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy74 = createJoinTableNode(pCxt, yymsp[-4].minor.yy630, yymsp[-5].minor.yy74, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 460: /* join_type ::= */ -{ yymsp[1].minor.yy228 = JOIN_TYPE_INNER; } + case 461: /* join_type ::= */ +{ yymsp[1].minor.yy630 = JOIN_TYPE_INNER; } break; - case 461: /* join_type ::= INNER */ -{ yymsp[0].minor.yy228 = JOIN_TYPE_INNER; } + case 462: /* join_type ::= INNER */ +{ yymsp[0].minor.yy630 = JOIN_TYPE_INNER; } break; - case 462: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 463: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy104 = createSelectStmt(pCxt, yymsp[-10].minor.yy185, yymsp[-9].minor.yy616, yymsp[-8].minor.yy104); - yymsp[-11].minor.yy104 = addWhereClause(pCxt, yymsp[-11].minor.yy104, yymsp[-7].minor.yy104); - yymsp[-11].minor.yy104 = addPartitionByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-6].minor.yy616); - yymsp[-11].minor.yy104 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy104, yymsp[-2].minor.yy104); - yymsp[-11].minor.yy104 = addGroupByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-1].minor.yy616); - yymsp[-11].minor.yy104 = addHavingClause(pCxt, yymsp[-11].minor.yy104, yymsp[0].minor.yy104); - yymsp[-11].minor.yy104 = addRangeClause(pCxt, yymsp[-11].minor.yy104, yymsp[-5].minor.yy104); - yymsp[-11].minor.yy104 = addEveryClause(pCxt, yymsp[-11].minor.yy104, yymsp[-4].minor.yy104); - yymsp[-11].minor.yy104 = addFillClause(pCxt, yymsp[-11].minor.yy104, yymsp[-3].minor.yy104); + yymsp[-11].minor.yy74 = createSelectStmt(pCxt, yymsp[-10].minor.yy335, yymsp[-9].minor.yy874, yymsp[-8].minor.yy74); + yymsp[-11].minor.yy74 = addWhereClause(pCxt, yymsp[-11].minor.yy74, yymsp[-7].minor.yy74); + yymsp[-11].minor.yy74 = addPartitionByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-6].minor.yy874); + yymsp[-11].minor.yy74 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy74, yymsp[-2].minor.yy74); + yymsp[-11].minor.yy74 = addGroupByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-1].minor.yy874); + yymsp[-11].minor.yy74 = addHavingClause(pCxt, yymsp[-11].minor.yy74, yymsp[0].minor.yy74); + yymsp[-11].minor.yy74 = addRangeClause(pCxt, yymsp[-11].minor.yy74, yymsp[-5].minor.yy74); + yymsp[-11].minor.yy74 = addEveryClause(pCxt, yymsp[-11].minor.yy74, yymsp[-4].minor.yy74); + yymsp[-11].minor.yy74 = addFillClause(pCxt, yymsp[-11].minor.yy74, yymsp[-3].minor.yy74); } break; - case 465: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy185 = false; } + case 466: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy335 = false; } break; - case 468: /* select_item ::= NK_STAR */ -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 469: /* select_item ::= NK_STAR */ +{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 470: /* select_item ::= common_expression column_alias */ - case 480: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==480); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 471: /* select_item ::= common_expression column_alias */ + case 481: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==481); +{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 471: /* select_item ::= common_expression AS column_alias */ - case 481: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==481); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 472: /* select_item ::= common_expression AS column_alias */ + case 482: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==482); +{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 476: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 498: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==498); - case 517: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==517); -{ yymsp[-2].minor.yy616 = yymsp[0].minor.yy616; } + case 477: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 500: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==500); + case 519: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==519); +{ yymsp[-2].minor.yy874 = yymsp[0].minor.yy874; } break; - case 483: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy104 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 484: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy74 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } break; - case 484: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy104 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 485: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy74 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } break; - case 485: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 490: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy104 = createFillNode(pCxt, yymsp[-1].minor.yy246, NULL); } + case 488: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy74 = createEventWindowNode(pCxt, yymsp[-3].minor.yy74, yymsp[0].minor.yy74); } break; - case 491: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy104 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } + case 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy74 = createFillNode(pCxt, yymsp[-1].minor.yy828, NULL); } break; - case 492: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy246 = FILL_MODE_NONE; } + case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy74 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } break; - case 493: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy246 = FILL_MODE_PREV; } + case 494: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy828 = FILL_MODE_NONE; } break; - case 494: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy246 = FILL_MODE_NULL; } + case 495: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy828 = FILL_MODE_PREV; } break; - case 495: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy246 = FILL_MODE_LINEAR; } + case 496: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy828 = FILL_MODE_NULL; } break; - case 496: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy246 = FILL_MODE_NEXT; } + case 497: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy828 = FILL_MODE_LINEAR; } break; - case 499: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy616 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 498: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy828 = FILL_MODE_NEXT; } break; - case 500: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 501: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy874 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 504: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy104 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 507: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy74 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } + break; + case 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy104 = addOrderByClause(pCxt, yymsp[-3].minor.yy104, yymsp[-2].minor.yy616); - yylhsminor.yy104 = addSlimitClause(pCxt, yylhsminor.yy104, yymsp[-1].minor.yy104); - yylhsminor.yy104 = addLimitClause(pCxt, yylhsminor.yy104, yymsp[0].minor.yy104); + yylhsminor.yy74 = addOrderByClause(pCxt, yymsp[-3].minor.yy74, yymsp[-2].minor.yy874); + yylhsminor.yy74 = addSlimitClause(pCxt, yylhsminor.yy74, yymsp[-1].minor.yy74); + yylhsminor.yy74 = addLimitClause(pCxt, yylhsminor.yy74, yymsp[0].minor.yy74); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 510: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 511: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 513: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 519: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 523: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==523); -{ yymsp[-1].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==525); +{ yymsp[-1].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==524); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==526); +{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==525); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==527); +{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 526: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 528: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy74); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 531: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy104 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), yymsp[-1].minor.yy50, yymsp[0].minor.yy793); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 533: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy74 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), yymsp[-1].minor.yy326, yymsp[0].minor.yy109); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 532: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy50 = ORDER_ASC; } + case 534: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy326 = ORDER_ASC; } break; - case 533: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy50 = ORDER_ASC; } + case 535: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy326 = ORDER_ASC; } break; - case 534: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy50 = ORDER_DESC; } + case 536: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy326 = ORDER_DESC; } break; - case 535: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy793 = NULL_ORDER_DEFAULT; } + case 537: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } break; - case 536: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_FIRST; } + case 538: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } break; - case 537: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_LAST; } + case 539: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index cc51beb842..ae702ec02f 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -248,6 +248,13 @@ int32_t __catalogGetCachedTableHashVgroup(SCatalog* pCtg, const SName* pTableNam return code; } +int32_t __catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta) { + int32_t code = g_mockCatalogService->catalogGetTableMeta(pTableName, pTableMeta, true); + if (code) return code; + code = g_mockCatalogService->catalogGetTableHashVgroup(pTableName, pVgroup, true); + return code; +} + int32_t __catalogGetTableDistVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTableName, SArray** pVgList) { return g_mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgList); @@ -316,6 +323,7 @@ void initMetaDataEnv() { stub.set(catalogGetCachedSTableMeta, __catalogGetCachedTableMeta); stub.set(catalogGetTableHashVgroup, __catalogGetTableHashVgroup); stub.set(catalogGetCachedTableHashVgroup, __catalogGetCachedTableHashVgroup); + stub.set(catalogGetCachedTableVgMeta, __catalogGetCachedTableVgMeta); stub.set(catalogGetTableDistVgInfo, __catalogGetTableDistVgInfo); stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion); stub.set(catalogGetDBVgList, __catalogGetDBVgList); diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 634fd3e127..334d12b95f 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -375,9 +375,68 @@ TEST_F(ParserInitialCTest, createFunction) { TEST_F(ParserInitialCTest, createSmaIndex) { useDb("root", "test"); + SMCreateSmaReq expect = {0}; + + auto setCreateSmacReq = [&](const char* pIndexName, const char* pStbName, int64_t interval, int8_t intervalUnit, + int64_t offset = 0, int64_t sliding = -1, int8_t slidingUnit = -1, int8_t igExists = 0) { + memset(&expect, 0, sizeof(SMCreateSmaReq)); + strcpy(expect.name, pIndexName); + strcpy(expect.stb, pStbName); + expect.igExists = igExists; + expect.intervalUnit = intervalUnit; + expect.slidingUnit = slidingUnit < 0 ? intervalUnit : slidingUnit; + expect.timezone = 0; + expect.dstVgId = 1; + expect.interval = interval; + expect.offset = offset; + expect.sliding = sliding < 0 ? interval : sliding; + expect.maxDelay = -1; + expect.watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + expect.deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + }; + + auto setOptionsForCreateSmacReq = [&](int64_t maxDelay, int64_t watermark, int64_t deleteMark) { + expect.maxDelay = maxDelay; + expect.watermark = watermark; + expect.deleteMark = deleteMark; + }; + + setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { + ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_INDEX_STMT); + SMCreateSmaReq req = {0}; + ASSERT_TRUE(TSDB_CODE_SUCCESS == tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req)); + + ASSERT_EQ(std::string(req.name), std::string(expect.name)); + ASSERT_EQ(std::string(req.stb), std::string(expect.stb)); + ASSERT_EQ(req.igExists, expect.igExists); + ASSERT_EQ(req.intervalUnit, expect.intervalUnit); + ASSERT_EQ(req.slidingUnit, expect.slidingUnit); + ASSERT_EQ(req.timezone, expect.timezone); + ASSERT_EQ(req.dstVgId, expect.dstVgId); + ASSERT_EQ(req.interval, expect.interval); + ASSERT_EQ(req.offset, expect.offset); + ASSERT_EQ(req.sliding, expect.sliding); + ASSERT_EQ(req.maxDelay, expect.maxDelay); + ASSERT_EQ(req.watermark, expect.watermark); + ASSERT_EQ(req.deleteMark, expect.deleteMark); + ASSERT_GT(req.exprLen, 0); + ASSERT_EQ(req.tagsFilterLen, 0); + ASSERT_GT(req.sqlLen, 0); + ASSERT_GT(req.astLen, 0); + ASSERT_NE(req.expr, nullptr); + ASSERT_EQ(req.tagsFilter, nullptr); + ASSERT_NE(req.sql, nullptr); + ASSERT_NE(req.ast, nullptr); + tFreeSMCreateSmaReq(&req); + }); + + setCreateSmacReq("0.test.index1", "0.test.t1", 10 * MILLISECOND_PER_SECOND, 's'); run("CREATE SMA INDEX index1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); - run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(10s)"); + setCreateSmacReq("0.test.index2", "0.test.st1", 5 * MILLISECOND_PER_SECOND, 's'); + setOptionsForCreateSmacReq(10 * MILLISECOND_PER_SECOND, 20 * MILLISECOND_PER_SECOND, 1000 * MILLISECOND_PER_SECOND); + run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(5s) WATERMARK 20s MAX_DELAY 10s " + "DELETE_MARK 1000s"); } TEST_F(ParserInitialCTest, createMnode) { @@ -408,23 +467,26 @@ TEST_F(ParserInitialCTest, createStable) { memset(&expect, 0, sizeof(SMCreateStbReq)); }; - auto setCreateStbReqFunc = [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, - int64_t delay2 = -1, int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { - int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); - expect.name[len] = '\0'; - expect.igExists = igExists; - expect.delay1 = delay1; - expect.delay2 = delay2; - expect.watermark1 = watermark1; - expect.watermark2 = watermark2; - // expect.ttl = ttl; - if (nullptr != pComment) { - expect.pComment = strdup(pComment); - expect.commentLen = strlen(pComment); - } - }; + auto setCreateStbReqFunc = + [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, int64_t delay2 = -1, + int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, + int64_t deleteMark1 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, int64_t deleteMark2 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, + int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { + int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); + expect.name[len] = '\0'; + expect.igExists = igExists; + expect.delay1 = delay1; + expect.delay2 = delay2; + expect.watermark1 = watermark1; + expect.watermark2 = watermark2; + expect.deleteMark1 = deleteMark1; + expect.deleteMark2 = deleteMark2; + // expect.ttl = ttl; + if (nullptr != pComment) { + expect.pComment = strdup(pComment); + expect.commentLen = strlen(pComment); + } + }; auto addFieldToCreateStbReqFunc = [&](bool col, const char* pFieldName, uint8_t type, int32_t bytes = 0, int8_t flags = COL_SMA_ON) { @@ -511,7 +573,8 @@ TEST_F(ParserInitialCTest, createStable) { clearCreateStbReq(); setCreateStbReqFunc("rollup_db", "t1", 1, 100 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_MINUTE, 10, - 1 * MILLISECOND_PER_MINUTE, 100, "test create table"); + 1 * MILLISECOND_PER_MINUTE, 1000 * MILLISECOND_PER_SECOND, 200 * MILLISECOND_PER_MINUTE, 100, + "test create table"); addFieldToCreateStbReqFunc(true, "ts", TSDB_DATA_TYPE_TIMESTAMP, 0, 0); addFieldToCreateStbReqFunc(true, "c1", TSDB_DATA_TYPE_INT); addFieldToCreateStbReqFunc(true, "c2", TSDB_DATA_TYPE_UINT); @@ -549,7 +612,8 @@ TEST_F(ParserInitialCTest, createStable) { "TAGS (a1 TIMESTAMP, a2 INT, a3 INT UNSIGNED, a4 BIGINT, a5 BIGINT UNSIGNED, a6 FLOAT, a7 DOUBLE, " "a8 BINARY(20), a9 SMALLINT, a10 SMALLINT UNSIGNED COMMENT 'test column comment', a11 TINYINT, " "a12 TINYINT UNSIGNED, a13 BOOL, a14 NCHAR(30), a15 VARCHAR(50)) " - "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m"); + "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m " + "DELETE_MARK 1000s,200m"); clearCreateStbReq(); } diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index dd5e283a55..205c70e0df 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -702,6 +702,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm if (pCxt->pPlanCxt->streamQuery) { pWindow->triggerType = pCxt->pPlanCxt->triggerType; pWindow->watermark = pCxt->pPlanCxt->watermark; + pWindow->deleteMark = pCxt->pPlanCxt->deleteMark; pWindow->igExpired = pCxt->pPlanCxt->igExpired; } pWindow->inputTsOrder = ORDER_ASC; @@ -813,6 +814,29 @@ static int32_t createWindowLogicNodeByInterval(SLogicPlanContext* pCxt, SInterva return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); } +static int32_t createWindowLogicNodeByEvent(SLogicPlanContext* pCxt, SEventWindowNode* pEvent, SSelectStmt* pSelect, + SLogicNode** pLogicNode) { + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + if (NULL == pWindow) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + pWindow->winType = WINDOW_TYPE_EVENT; + pWindow->node.groupAction = getGroupAction(pCxt, pSelect); + pWindow->node.requireDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_IN_BLOCK : getRequireDataOrder(true, pSelect); + pWindow->node.resultDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_GLOBAL : pWindow->node.requireDataOrder; + pWindow->pStartCond = nodesCloneNode(pEvent->pStartCond); + pWindow->pEndCond = nodesCloneNode(pEvent->pEndCond); + pWindow->pTspk = nodesCloneNode(pEvent->pCol); + if (NULL == pWindow->pStartCond || NULL == pWindow->pEndCond || NULL == pWindow->pTspk) { + nodesDestroyNode((SNode*)pWindow); + return TSDB_CODE_OUT_OF_MEMORY; + } + return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); +} + static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; @@ -825,6 +849,8 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele return createWindowLogicNodeBySession(pCxt, (SSessionWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_INTERVAL_WINDOW: return createWindowLogicNodeByInterval(pCxt, (SIntervalWindowNode*)pSelect->pWindow, pSelect, pLogicNode); + case QUERY_NODE_EVENT_WINDOW: + return createWindowLogicNodeByEvent(pCxt, (SEventWindowNode*)pSelect->pWindow, pSelect, pLogicNode); default: break; } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index c370e2c84b..e1687fc3a5 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -330,6 +330,7 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) { pScan->slidingUnit = ((SWindowLogicNode*)pParent)->slidingUnit; pScan->triggerType = ((SWindowLogicNode*)pParent)->triggerType; pScan->watermark = ((SWindowLogicNode*)pParent)->watermark; + pScan->deleteMark = ((SWindowLogicNode*)pParent)->deleteMark; pScan->igExpired = ((SWindowLogicNode*)pParent)->igExpired; } } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 53c1d24df9..78ae3c1c3b 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1139,6 +1139,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* SWindowLogicNode* pWindowLogicNode) { pWindow->triggerType = pWindowLogicNode->triggerType; pWindow->watermark = pWindowLogicNode->watermark; + pWindow->deleteMark = pWindowLogicNode->deleteMark; pWindow->igExpired = pWindowLogicNode->igExpired; pWindow->inputTsOrder = pWindowLogicNode->inputTsOrder; pWindow->outputTsOrder = pWindowLogicNode->outputTsOrder; @@ -1296,6 +1297,33 @@ static int32_t createStateWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC return code; } +static int32_t createEventWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, + SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { + SEventWinodwPhysiNode* pEvent = (SEventWinodwPhysiNode*)makePhysiNode( + pCxt, (SLogicNode*)pWindowLogicNode, + (pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT : QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT)); + if (NULL == pEvent) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); + int32_t code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pStartCond, &pEvent->pStartCond); + if (TSDB_CODE_SUCCESS == code) { + code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pEndCond, &pEvent->pEndCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = createWindowPhysiNodeFinalize(pCxt, pChildren, &pEvent->window, pWindowLogicNode); + } + + if (TSDB_CODE_SUCCESS == code) { + *pPhyNode = (SPhysiNode*)pEvent; + } else { + nodesDestroyNode((SNode*)pEvent); + } + + return code; +} + static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { switch (pWindowLogicNode->winType) { @@ -1305,6 +1333,8 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr return createSessionWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); case WINDOW_TYPE_STATE: return createStateWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); + case WINDOW_TYPE_EVENT: + return createEventWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); default: break; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index f5782dc937..f6b1babf95 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -729,6 +729,18 @@ static int32_t stbSplSplitState(SSplitContext* pCxt, SStableSplitInfo* pInfo) { } } +static int32_t stbSplSplitEventForStream(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + return TSDB_CODE_PLAN_INTERNAL_ERROR; +} + +static int32_t stbSplSplitEvent(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + if (pCxt->pPlanCxt->streamQuery) { + return stbSplSplitEventForStream(pCxt, pInfo); + } else { + return stbSplSplitSessionOrStateForBatch(pCxt, pInfo); + } +} + static bool stbSplIsPartTableWinodw(SWindowLogicNode* pWindow) { return stbSplHasPartTbname(stbSplGetPartKeys((SLogicNode*)nodesListGetNode(pWindow->node.pChildren, 0))); } @@ -741,6 +753,8 @@ static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitI return stbSplSplitSession(pCxt, pInfo); case WINDOW_TYPE_STATE: return stbSplSplitState(pCxt, pInfo); + case WINDOW_TYPE_EVENT: + return stbSplSplitEvent(pCxt, pInfo); default: break; } diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index a13e959a36..72931413cc 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -197,6 +197,15 @@ static int32_t adjustStateDataRequirement(SWindowLogicNode* pWindow, EDataOrderL return TSDB_CODE_SUCCESS; } +static int32_t adjustEventDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { + if (requirement <= pWindow->node.resultDataOrder) { + return TSDB_CODE_SUCCESS; + } + pWindow->node.resultDataOrder = requirement; + pWindow->node.requireDataOrder = requirement; + return TSDB_CODE_SUCCESS; +} + static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { switch (pWindow->winType) { case WINDOW_TYPE_INTERVAL: @@ -205,6 +214,8 @@ static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrder return adjustSessionDataRequirement(pWindow, requirement); case WINDOW_TYPE_STATE: return adjustStateDataRequirement(pWindow, requirement); + case WINDOW_TYPE_EVENT: + return adjustEventDataRequirement(pWindow, requirement); default: break; } diff --git a/source/libs/planner/test/planEventTest.cpp b/source/libs/planner/test/planEventTest.cpp new file mode 100644 index 0000000000..c4db145998 --- /dev/null +++ b/source/libs/planner/test/planEventTest.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "planTestUtil.h" +#include "planner.h" + +using namespace std; + +class PlanEventTest : public PlannerTestBase {}; + +TEST_F(PlanEventTest, basic) { + useDb("root", "test"); + + run("SELECT COUNT(*) FROM t1 EVENT_WINDOW START WITH c1 > 10 END WITH c2 = 'abc'"); +} + +TEST_F(PlanEventTest, stable) { + useDb("root", "test"); + + run("SELECT COUNT(*) FROM st1 EVENT_WINDOW START WITH c1 > 10 END WITH c2 = 'abc'"); +} diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp index 3ed23d6cb2..4741d241b5 100644 --- a/source/libs/planner/test/planOtherTest.cpp +++ b/source/libs/planner/test/planOtherTest.cpp @@ -51,7 +51,7 @@ TEST_F(PlanOtherTest, createStreamUseSTable) { TEST_F(PlanOtherTest, createSmaIndex) { useDb("root", "test"); - run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); + run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s) DELETE_MARK 1000s"); run("SELECT SUM(c4) FROM t1 INTERVAL(10s)"); diff --git a/source/libs/planner/test/planTestUtil.cpp b/source/libs/planner/test/planTestUtil.cpp index b3620cedfb..d89e669a90 100644 --- a/source/libs/planner/test/planTestUtil.cpp +++ b/source/libs/planner/test/planTestUtil.cpp @@ -444,6 +444,7 @@ class PlannerTestBaseImpl { tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req); g_mockCatalogService->createSmaIndex(&req); nodesStringToNode(req.ast, &pCxt->pAstRoot); + pCxt->deleteMark = req.deleteMark; tFreeSMCreateSmaReq(&req); nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = pCxt->pAstRoot; diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index af361323a7..9d8fad6fea 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -31,7 +31,7 @@ extern "C" { #define QW_DEFAULT_SCHEDULER_NUMBER 100 #define QW_DEFAULT_TASK_NUMBER 10000 -#define QW_DEFAULT_SCH_TASK_NUMBER 10000 +#define QW_DEFAULT_SCH_TASK_NUMBER 3000 #define QW_DEFAULT_SHORT_RUN_TIMES 2 #define QW_DEFAULT_HEARTBEAT_MSEC 5000 #define QW_SCH_TIMEOUT_MSEC 180000 @@ -247,7 +247,7 @@ typedef struct SQWorkerMgmt { #define QW_ERR_RET(c) \ do { \ - int32_t _code = (c); \ + int32_t _code = (c); \ if (_code != TSDB_CODE_SUCCESS) { \ terrno = _code; \ return _code; \ @@ -255,7 +255,7 @@ typedef struct SQWorkerMgmt { } while (0) #define QW_RET(c) \ do { \ - int32_t _code = (c); \ + int32_t _code = (c); \ if (_code != TSDB_CODE_SUCCESS) { \ terrno = _code; \ } \ @@ -263,7 +263,7 @@ typedef struct SQWorkerMgmt { } while (0) #define QW_ERR_JRET(c) \ do { \ - code = (c); \ + code = (c); \ if (code != TSDB_CODE_SUCCESS) { \ terrno = code; \ goto _return; \ diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index ce3b493638..f3d073634d 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -281,7 +281,7 @@ void qwFreeTaskHandle(qTaskInfo_t *taskHandle) { int32_t qwKillTaskHandle(SQWTaskCtx *ctx, int32_t rspCode) { int32_t code = 0; - + // Note: free/kill may in RC qTaskInfo_t taskHandle = atomic_load_ptr(&ctx->taskHandle); if (taskHandle && atomic_val_compare_exchange_ptr(&ctx->taskHandle, taskHandle, NULL)) { @@ -463,6 +463,8 @@ void qwDestroyImpl(void *pMgmt) { int8_t nodeType = mgmt->nodeType; int32_t nodeId = mgmt->nodeId; + int32_t taskCount = 0; + int32_t schStatusCount = 0; qDebug("start to destroy qworker, type:%d, id:%d, handle:%p", nodeType, nodeId, mgmt); taosTmrStop(mgmt->hbTimer); @@ -472,6 +474,7 @@ void qwDestroyImpl(void *pMgmt) { uint64_t qId, tId; int32_t eId; void *pIter = taosHashIterate(mgmt->ctxHash, NULL); + while (pIter) { SQWTaskCtx *ctx = (SQWTaskCtx *)pIter; void *key = taosHashGetKey(pIter, NULL); @@ -480,6 +483,7 @@ void qwDestroyImpl(void *pMgmt) { qwFreeTaskCtx(ctx); QW_TASK_DLOG_E("task ctx freed"); pIter = taosHashIterate(mgmt->ctxHash, pIter); + taskCount++; } taosHashCleanup(mgmt->ctxHash); @@ -487,7 +491,9 @@ void qwDestroyImpl(void *pMgmt) { while (pIter) { SQWSchStatus *sch = (SQWSchStatus *)pIter; qwDestroySchStatus(sch); + pIter = taosHashIterate(mgmt->schHash, pIter); + schStatusCount++; } taosHashCleanup(mgmt->schHash); @@ -499,7 +505,8 @@ void qwDestroyImpl(void *pMgmt) { qwCloseRef(); - qDebug("qworker destroyed, type:%d, id:%d, handle:%p", nodeType, nodeId, mgmt); + qDebug("qworker destroyed, type:%d, id:%d, handle:%p, taskCount:%d, schStatusCount: %d", nodeType, nodeId, mgmt, + taskCount, schStatusCount); } int32_t qwOpenRef(void) { diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index c5db4105d7..81f73b1226 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -8,9 +8,9 @@ #include "qwMsg.h" #include "tcommon.h" #include "tdatablock.h" +#include "tglobal.h" #include "tmsg.h" #include "tname.h" -#include "tglobal.h" SQWorkerMgmt gQwMgmt = { .lock = 0, @@ -117,7 +117,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { if (queryStop) { *queryStop = true; } - + return TSDB_CODE_SUCCESS; } @@ -275,7 +275,7 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, QW_ERR_RET(code); } - QW_TASK_DLOG("no more data in sink and query end, fetched blocks %d rows %"PRId64, pOutput->numOfBlocks, + QW_TASK_DLOG("no more data in sink and query end, fetched blocks %d rows %" PRId64, pOutput->numOfBlocks, pOutput->numOfRows); qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC); @@ -327,12 +327,14 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, } if (0 == ctx->level) { - QW_TASK_DLOG("task fetched blocks %d rows %"PRId64", level %d", pOutput->numOfBlocks, pOutput->numOfRows, ctx->level); + QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 ", level %d", pOutput->numOfBlocks, pOutput->numOfRows, + ctx->level); break; } if (pOutput->numOfRows >= QW_MIN_RES_ROWS) { - QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 " reaches the min rows", pOutput->numOfBlocks, pOutput->numOfRows); + QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 " reaches the min rows", pOutput->numOfBlocks, + pOutput->numOfRows); break; } } @@ -538,7 +540,7 @@ _return: SQWMsg qwMsg = {.msgType = ctx->msgType, .connInfo = ctx->ctrlConnInfo}; qwDbgSimulateRedirect(&qwMsg, ctx, &rsped); qwDbgSimulateDead(QW_FPARAMS(), ctx, &rsped); - if (!rsped) { + if (!rsped) { qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); } } @@ -650,8 +652,8 @@ _return: code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); if (QUERY_RSP_POLICY_QUICK == tsQueryRspPolicy && ctx != NULL && QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) { - void *rsp = NULL; - int32_t dataLen = 0; + void *rsp = NULL; + int32_t dataLen = 0; SOutputData sOutput = {0}; if (qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput)) { return TSDB_CODE_SUCCESS; @@ -671,8 +673,8 @@ _return: qwBuildAndSendFetchRsp(ctx->fetchType, &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), dataLen); + QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), + dataLen); } } @@ -689,7 +691,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { do { ctx = NULL; - + QW_ERR_JRET(qwHandlePrePhaseEvents(QW_FPARAMS(), QW_PHASE_PRE_CQUERY, &input, NULL)); QW_ERR_JRET(qwGetTaskCtx(QW_FPARAMS(), &ctx)); @@ -748,7 +750,8 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { } QW_LOCK(QW_WRITE, &ctx->lock); - if ((queryStop && (0 == atomic_load_8((int8_t *)&ctx->queryContinue))) || code || 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { + if ((queryStop && (0 == atomic_load_8((int8_t *)&ctx->queryContinue))) || code || + 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { // Note: query is not running anymore QW_SET_PHASE(ctx, 0); QW_UNLOCK(QW_WRITE, &ctx->lock); @@ -1176,7 +1179,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { QW_DLOG("start to stop all tasks, taskNum:%d", taosHashGetSize(mgmt->ctxHash)); uint64_t qId, tId; - int32_t eId; + int32_t eId; void *pIter = taosHashIterate(mgmt->ctxHash, NULL); while (pIter) { SQWTaskCtx *ctx = (SQWTaskCtx *)pIter; @@ -1186,7 +1189,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { QW_LOCK(QW_WRITE, &ctx->lock); QW_TASK_DLOG_E("start to force stop task"); - + if (QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP) || QW_EVENT_PROCESSED(ctx, QW_EVENT_DROP)) { QW_TASK_WLOG_E("task already dropping"); QW_UNLOCK(QW_WRITE, &ctx->lock); @@ -1194,7 +1197,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { pIter = taosHashIterate(mgmt->ctxHash, pIter); continue; } - + if (QW_QUERY_RUNNING(ctx)) { qwKillTaskHandle(ctx, TSDB_CODE_VND_STOPPED); } else if (!QW_EVENT_PROCESSED(ctx, QW_EVENT_DROP)) { diff --git a/source/libs/scheduler/inc/schInt.h b/source/libs/scheduler/inc/schInt.h index 77aafa9a27..48df7e36a3 100644 --- a/source/libs/scheduler/inc/schInt.h +++ b/source/libs/scheduler/inc/schInt.h @@ -293,6 +293,7 @@ typedef struct SSchJob { void *chkKillParam; SSchTask *fetchTask; int32_t errCode; + int32_t redirectCode; SRWLatch resLock; SExecResult execRes; void *fetchRes; // TODO free it or not @@ -331,6 +332,9 @@ extern SSchedulerMgmt schMgmt; ((_job)->attr.localExec && SCH_IS_QUERY_JOB(_job) && (!SCH_IS_INSERT_JOB(_job)) && \ (!SCH_IS_DATA_BIND_QRY_TASK(_task))) +#define SCH_UPDATE_REDICT_CODE(job, _code) atomic_val_compare_exchange_32(&((job)->redirectCode), 0, _code) +#define SCH_GET_REDICT_CODE(job, _code) (((!NO_RET_REDIRECT_ERROR(_code)) || (job)->redirectCode == 0) ? (_code) : (job)->redirectCode) + #define SCH_SET_TASK_STATUS(task, st) atomic_store_8(&(task)->status, st) #define SCH_GET_TASK_STATUS(task) atomic_load_8(&(task)->status) #define SCH_GET_TASK_STATUS_STR(task) jobTaskStatusStr(SCH_GET_TASK_STATUS(task)) @@ -373,7 +377,7 @@ extern SSchedulerMgmt schMgmt; #define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode) #define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) #define SCH_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \ - (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)))) + (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)) || (_task)->redirectCtx.inRedirect)) #define SCH_REDIRECT_MSGTYPE(_msgType) \ ((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \ (_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH) diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 2d41cc287c..d422f0e88f 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -481,6 +481,10 @@ _return: } int32_t schProcessOnJobFailure(SSchJob *pJob, int32_t errCode) { + if (TSDB_CODE_SCH_IGNORE_ERROR == errCode) { + return TSDB_CODE_SCH_IGNORE_ERROR; + } + schUpdateJobErrCode(pJob, errCode); int32_t code = atomic_load_32(&pJob->errCode); diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 560ce0bdc3..c23b461b47 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -156,6 +156,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa SCH_RET(schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode)); } + pTask->redirectCtx.inRedirect = false; + switch (msgType) { case TDMT_VND_COMMIT_RSP: { SCH_ERR_JRET(rspCode); diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index 0f15002d9b..8e60222ca6 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -340,7 +340,7 @@ int32_t schRescheduleTask(SSchJob *pJob, SSchTask *pTask) { return TSDB_CODE_SUCCESS; } -int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet) { +int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet, int32_t rspCode) { SSchRedirectCtx *pCtx = &pTask->redirectCtx; if (!pCtx->inRedirect) { pCtx->inRedirect = true; @@ -362,17 +362,12 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet) } pCtx->totalTimes++; + pCtx->roundTimes++; if (SCH_IS_DATA_BIND_TASK(pTask) && pEpSet) { pCtx->roundTotal = pEpSet->numOfEps; - pCtx->roundTimes = 0; - - pTask->delayExecMs = 0; - - goto _return; } - pCtx->roundTimes++; if (pCtx->roundTimes >= pCtx->roundTotal) { int64_t nowTs = taosGetTimestampMs(); @@ -380,7 +375,7 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet) if (lastTime > tsMaxRetryWaitTime) { SCH_TASK_DLOG("task no more redirect retry since timeout, now:%" PRId64 ", start:%" PRId64 ", max:%d, total:%d", nowTs, pCtx->startTs, tsMaxRetryWaitTime, pCtx->totalTimes); - SCH_ERR_RET(TSDB_CODE_TIMEOUT_ERROR); + SCH_ERR_RET(SCH_GET_REDICT_CODE(pJob, rspCode)); } pCtx->periodMs *= tsRedirectFactor; @@ -415,7 +410,11 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf *pData, int32 pTask->retryTimes = 0; } - SCH_ERR_JRET(schChkUpdateRedirectCtx(pJob, pTask, pData ? pData->pEpSet : NULL)); + if (!NO_RET_REDIRECT_ERROR(rspCode)) { + SCH_UPDATE_REDICT_CODE(pJob, rspCode); + } + + SCH_ERR_JRET(schChkUpdateRedirectCtx(pJob, pTask, pData ? pData->pEpSet : NULL, rspCode)); pTask->waitRetry = true; diff --git a/source/libs/stream/src/stream.c b/source/libs/stream/src/stream.c index 79549675a3..5b542dd54b 100644 --- a/source/libs/stream/src/stream.c +++ b/source/libs/stream/src/stream.c @@ -56,7 +56,7 @@ void streamSchedByTimer(void* param, void* tmrId) { } if (atomic_load_8(&pTask->triggerStatus) == TASK_TRIGGER_STATUS__ACTIVE) { - SStreamTrigger* trigger = taosAllocateQitem(sizeof(SStreamTrigger), DEF_QITEM); + SStreamTrigger* trigger = taosAllocateQitem(sizeof(SStreamTrigger), DEF_QITEM, 0); if (trigger == NULL) return; trigger->type = STREAM_INPUT__GET_RES; trigger->pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock)); @@ -112,7 +112,7 @@ int32_t streamSchedExec(SStreamTask* pTask) { } int32_t streamTaskEnqueue(SStreamTask* pTask, const SStreamDispatchReq* pReq, SRpcMsg* pRsp) { - SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); int8_t status; // enqueue @@ -150,7 +150,7 @@ int32_t streamTaskEnqueue(SStreamTask* pTask, const SStreamDispatchReq* pReq, SR } int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq, SRpcMsg* pRsp) { - SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); int8_t status = TASK_INPUT_STATUS__NORMAL; // enqueue diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c index 2fea5b9eca..6cc684dddf 100644 --- a/source/libs/stream/src/streamData.c +++ b/source/libs/stream/src/streamData.c @@ -67,7 +67,7 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock } SStreamDataSubmit* streamDataSubmitNew(SSubmitReq* pReq) { - SStreamDataSubmit* pDataSubmit = (SStreamDataSubmit*)taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); + SStreamDataSubmit* pDataSubmit = (SStreamDataSubmit*)taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM, 0); if (pDataSubmit == NULL) return NULL; pDataSubmit->dataRef = (int32_t*)taosMemoryMalloc(sizeof(int32_t)); if (pDataSubmit->dataRef == NULL) goto FAIL; @@ -81,7 +81,7 @@ FAIL: } SStreamMergedSubmit* streamMergedSubmitNew() { - SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)taosAllocateQitem(sizeof(SStreamMergedSubmit), DEF_QITEM); + SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)taosAllocateQitem(sizeof(SStreamMergedSubmit), DEF_QITEM, 0); if (pMerged == NULL) return NULL; pMerged->reqs = taosArrayInit(0, sizeof(void*)); pMerged->dataRefs = taosArrayInit(0, sizeof(void*)); @@ -107,7 +107,7 @@ static FORCE_INLINE void streamDataSubmitRefInc(SStreamDataSubmit* pDataSubmit) } SStreamDataSubmit* streamSubmitRefClone(SStreamDataSubmit* pSubmit) { - SStreamDataSubmit* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); + SStreamDataSubmit* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM, 0); if (pSubmitClone == NULL) { return NULL; } diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 6a83a9a4da..20608a6cf3 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -54,6 +54,7 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray* /*ASSERT(false);*/ qError("unexpected stream execution, stream %" PRId64 " task: %d, since %s", pTask->streamId, pTask->taskId, terrstr()); + continue; } if (output == NULL) { if (pItem->type == STREAM_INPUT__DATA_RETRIEVE) { @@ -126,7 +127,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) { taosArrayDestroy(pRes); break; } - SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); if (qRes == NULL) { taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -234,7 +235,7 @@ int32_t streamExecForAll(SStreamTask* pTask) { qDebug("stream task %d exec end", pTask->taskId); if (taosArrayGetSize(pRes) != 0) { - SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); if (qRes == NULL) { taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); streamFreeQitem(input); diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index cf63df371d..3bd94dbab5 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -46,6 +46,7 @@ typedef struct SyncClientRequest { uint32_t originalRpcType; // origin RpcMsg msgType uint64_t seqNum; bool isWeak; + int16_t reserved; uint32_t dataLen; // origin RpcMsg.contLen char data[]; // origin RpcMsg.pCont } SyncClientRequest; @@ -56,6 +57,7 @@ typedef struct SyncClientRequestReply { uint32_t msgType; int32_t errCode; SRaftId leaderHint; + int16_t reserved; } SyncClientRequestReply; typedef struct SyncRequestVote { @@ -68,6 +70,7 @@ typedef struct SyncRequestVote { SyncTerm term; SyncIndex lastLogIndex; SyncTerm lastLogTerm; + int16_t reserved; } SyncRequestVote; typedef struct SyncRequestVoteReply { @@ -79,6 +82,7 @@ typedef struct SyncRequestVoteReply { // private data SyncTerm term; bool voteGranted; + int16_t reserved; } SyncRequestVoteReply; typedef struct SyncAppendEntries { @@ -94,6 +98,7 @@ typedef struct SyncAppendEntries { SyncTerm prevLogTerm; SyncIndex commitIndex; SyncTerm privateTerm; + int16_t reserved; uint32_t dataLen; char data[]; } SyncAppendEntries; @@ -111,6 +116,7 @@ typedef struct SyncAppendEntriesReply { SyncIndex matchIndex; SyncIndex lastSendIndex; int64_t startTime; + int16_t reserved; } SyncAppendEntriesReply; typedef struct SyncHeartbeat { @@ -126,6 +132,7 @@ typedef struct SyncHeartbeat { SyncTerm privateTerm; SyncTerm minMatchIndex; int64_t timeStamp; + int16_t reserved; } SyncHeartbeat; typedef struct SyncHeartbeatReply { @@ -140,6 +147,7 @@ typedef struct SyncHeartbeatReply { SyncTerm privateTerm; int64_t startTime; int64_t timeStamp; + int16_t reserved; } SyncHeartbeatReply; typedef struct SyncPreSnapshot { @@ -151,6 +159,7 @@ typedef struct SyncPreSnapshot { // private data SyncTerm term; + int16_t reserved; } SyncPreSnapshot; typedef struct SyncPreSnapshotReply { @@ -163,6 +172,7 @@ typedef struct SyncPreSnapshotReply { // private data SyncTerm term; SyncIndex snapStart; + int16_t reserved; } SyncPreSnapshotReply; typedef struct SyncApplyMsg { @@ -190,6 +200,7 @@ typedef struct SyncSnapshotSend { SSyncCfg lastConfig; int64_t startTime; int32_t seq; + int16_t reserved; uint32_t dataLen; char data[]; } SyncSnapshotSend; @@ -208,6 +219,7 @@ typedef struct SyncSnapshotRsp { int32_t ack; int32_t code; SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid + int16_t reserved; } SyncSnapshotRsp; typedef struct SyncLeaderTransfer { diff --git a/source/libs/sync/inc/syncSnapshot.h b/source/libs/sync/inc/syncSnapshot.h index 1f9675a3cd..ee83636192 100644 --- a/source/libs/sync/inc/syncSnapshot.h +++ b/source/libs/sync/inc/syncSnapshot.h @@ -44,6 +44,7 @@ typedef struct SSyncSnapshotSender { SyncTerm term; int64_t startTime; int64_t endTime; + int64_t lastSendTime; bool finish; // init when create diff --git a/source/libs/sync/inc/syncUtil.h b/source/libs/sync/inc/syncUtil.h index f198f3809d..be14ef91a4 100644 --- a/source/libs/sync/inc/syncUtil.h +++ b/source/libs/sync/inc/syncUtil.h @@ -79,7 +79,6 @@ char* syncUtilPrintBin2(char* ptr, uint32_t len); void syncUtilMsgHtoN(void* msg); void syncUtilMsgNtoH(void* msg); bool syncUtilUserPreCommit(tmsg_t msgType); -bool syncUtilUserCommit(tmsg_t msgType); bool syncUtilUserRollback(tmsg_t msgType); void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...); diff --git a/source/libs/sync/src/syncCommit.c b/source/libs/sync/src/syncCommit.c index 07b1101256..5fdcbeb91c 100644 --- a/source/libs/sync/src/syncCommit.c +++ b/source/libs/sync/src/syncCommit.c @@ -84,7 +84,7 @@ void syncOneReplicaAdvance(SSyncNode* pSyncNode) { } void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) { - ASSERT(false && "deprecated"); + ASSERTS(false, "deprecated"); if (pSyncNode == NULL) { sError("pSyncNode is NULL"); return; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index b89383bef3..6fabab18cb 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { } syncNodeStartHeartbeatTimer(pSyncNode); - syncNodeReplicate(pSyncNode); + //syncNodeReplicate(pSyncNode); } syncNodeRelease(pSyncNode); @@ -791,9 +791,9 @@ static int32_t syncHbTimerStop(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer) { } int32_t syncNodeLogStoreRestoreOnNeed(SSyncNode* pNode) { - ASSERT(pNode->pLogStore != NULL && "log store not created"); - ASSERT(pNode->pFsm != NULL && "pFsm not registered"); - ASSERT(pNode->pFsm->FpGetSnapshotInfo != NULL && "FpGetSnapshotInfo not registered"); + ASSERTS(pNode->pLogStore != NULL, "log store not created"); + ASSERTS(pNode->pFsm != NULL, "pFsm not registered"); + ASSERTS(pNode->pFsm->FpGetSnapshotInfo != NULL, "FpGetSnapshotInfo not registered"); SSnapshot snapshot; if (pNode->pFsm->FpGetSnapshotInfo(pNode->pFsm, &snapshot) < 0) { sError("vgId:%d, failed to get snapshot info since %s", pNode->vgId, terrstr()); @@ -1144,8 +1144,8 @@ void syncNodeMaybeUpdateCommitBySnapshot(SSyncNode* pSyncNode) { } int32_t syncNodeRestore(SSyncNode* pSyncNode) { - ASSERT(pSyncNode->pLogStore != NULL && "log store not created"); - ASSERT(pSyncNode->pLogBuf != NULL && "ring log buffer not created"); + ASSERTS(pSyncNode->pLogStore != NULL, "log store not created"); + ASSERTS(pSyncNode->pLogBuf != NULL, "ring log buffer not created"); SyncIndex lastVer = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); SyncIndex commitIndex = pSyncNode->pLogStore->syncLogCommitIndex(pSyncNode->pLogStore); @@ -1221,6 +1221,26 @@ int32_t syncNodeStartStandBy(SSyncNode* pSyncNode) { } void syncNodePreClose(SSyncNode* pSyncNode) { + if (pSyncNode != NULL && pSyncNode->pFsm != NULL && pSyncNode->pFsm->FpApplyQueueItems != NULL) { + while (1) { + int32_t aqItems = pSyncNode->pFsm->FpApplyQueueItems(pSyncNode->pFsm); + sTrace("vgId:%d, pre close, %d items in apply queue", pSyncNode->vgId, aqItems); + if (aqItems == 0 || aqItems == -1) { + break; + } + taosMsleep(20); + } + } + + if (pSyncNode->pNewNodeReceiver != NULL) { + if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver); + } + + snapshotReceiverDestroy(pSyncNode->pNewNodeReceiver); + pSyncNode->pNewNodeReceiver = NULL; + } + // stop elect timer syncNodeStopElectTimer(pSyncNode); @@ -1819,7 +1839,8 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { #endif // close receiver - if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + if (pSyncNode != NULL && pSyncNode->pNewNodeReceiver != NULL && + snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver); } @@ -2643,7 +2664,7 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn int32_t code = syncNodeAppend(ths, pEntry); if (code < 0 && ths->vgId != 1 && vnodeIsMsgBlock(pEntry->originalRpcType)) { - ASSERT(false && "failed to append blocking msg"); + ASSERTS(false, "failed to append blocking msg"); } return code; } diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 5d6905f99e..7bd8d75dd1 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -50,7 +50,7 @@ int32_t syncLogBufferAppend(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt // initial log buffer with at least one item, e.g. commitIndex SSyncRaftEntry* pMatch = pBuf->entries[(index - 1 + pBuf->size) % pBuf->size].pItem; - ASSERT(pMatch != NULL && "no matched log entry"); + ASSERTS(pMatch != NULL, "no matched log entry"); ASSERT(pMatch->index + 1 == index); SSyncLogBufEntry tmp = {.pItem = pEntry, .prevLogIndex = pMatch->index, .prevLogTerm = pMatch->term}; @@ -86,14 +86,14 @@ SyncTerm syncLogReplMgrGetPrevLogTerm(SSyncLogReplMgr* pMgr, SSyncNode* pNode, S if (prevIndex >= pBuf->startIndex) { pEntry = pBuf->entries[(prevIndex + pBuf->size) % pBuf->size].pItem; - ASSERT(pEntry != NULL && "no log entry found"); + ASSERTS(pEntry != NULL, "no log entry found"); prevLogTerm = pEntry->term; return prevLogTerm; } if (pMgr && pMgr->startIndex <= prevIndex && prevIndex < pMgr->endIndex) { int64_t timeMs = pMgr->states[(prevIndex + pMgr->size) % pMgr->size].timeMs; - ASSERT(timeMs != 0 && "no log entry found"); + ASSERTS(timeMs != 0, "no log entry found"); prevLogTerm = pMgr->states[(prevIndex + pMgr->size) % pMgr->size].term; ASSERT(prevIndex == 0 || prevLogTerm != 0); return prevLogTerm; @@ -141,9 +141,9 @@ int32_t syncLogValidateAlignmentOfCommit(SSyncNode* pNode, SyncIndex commitIndex } int32_t syncLogBufferInitWithoutLock(SSyncLogBuffer* pBuf, SSyncNode* pNode) { - ASSERT(pNode->pLogStore != NULL && "log store not created"); - ASSERT(pNode->pFsm != NULL && "pFsm not registered"); - ASSERT(pNode->pFsm->FpGetSnapshotInfo != NULL && "FpGetSnapshotInfo not registered"); + ASSERTS(pNode->pLogStore != NULL, "log store not created"); + ASSERTS(pNode->pFsm != NULL, "pFsm not registered"); + ASSERTS(pNode->pFsm->FpGetSnapshotInfo != NULL, "FpGetSnapshotInfo not registered"); SSnapshot snapshot; if (pNode->pFsm->FpGetSnapshotInfo(pNode->pFsm, &snapshot) < 0) { @@ -437,7 +437,7 @@ _out: } int32_t syncLogFsmExecute(SSyncNode* pNode, SSyncFSM* pFsm, ESyncState role, SyncTerm term, SSyncRaftEntry* pEntry) { - ASSERT(pFsm->FpCommitCb != NULL && "No commit cb registered for the FSM"); + ASSERTS(pFsm->FpCommitCb != NULL, "No commit cb registered for the FSM"); if ((pNode->replicaNum == 1) && pNode->restoreFinish && pNode->vgId != 1) { return 0; @@ -513,13 +513,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm if (!syncUtilUserCommit(pEntry->originalRpcType)) { sInfo("vgId:%d, commit sync barrier. index: %" PRId64 ", term:%" PRId64 ", type: %s", vgId, pEntry->index, pEntry->term, TMSG_INFO(pEntry->originalRpcType)); - pBuf->commitIndex = index; - if (!inBuf) { - syncEntryDestroy(pEntry); - pEntry = NULL; - } - continue; } + if (syncLogFsmExecute(pNode, pFsm, role, term, pEntry) != 0) { sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 ", role: %d, current term: %" PRId64, @@ -905,7 +900,7 @@ int32_t syncNodeLogReplMgrInit(SSyncNode* pNode) { ASSERT(pNode->logReplMgrs[i] == NULL); pNode->logReplMgrs[i] = syncLogReplMgrCreate(); pNode->logReplMgrs[i]->peerId = i; - ASSERT(pNode->logReplMgrs[i] != NULL && "Out of memory."); + ASSERTS(pNode->logReplMgrs[i] != NULL, "Out of memory."); } return 0; } diff --git a/source/libs/sync/src/syncRaftLog.c b/source/libs/sync/src/syncRaftLog.c index f51fe344df..018ac5bb7d 100644 --- a/source/libs/sync/src/syncRaftLog.c +++ b/source/libs/sync/src/syncRaftLog.c @@ -234,18 +234,17 @@ int32_t raftLogGetEntry(struct SSyncLogStore* pLogStore, SyncIndex index, SSyncR *ppEntry = NULL; - // SWalReadHandle* pWalHandle = walOpenReadHandle(pWal); + int64_t ts1 = taosGetTimestampNs(); + taosThreadMutexLock(&(pData->mutex)); + SWalReader* pWalHandle = pData->pWalHandle; if (pWalHandle == NULL) { terrno = TSDB_CODE_SYN_INTERNAL_ERROR; sError("vgId:%d, wal handle is NULL", pData->pSyncNode->vgId); - + taosThreadMutexUnlock(&(pData->mutex)); return -1; } - int64_t ts1 = taosGetTimestampNs(); - taosThreadMutexLock(&(pData->mutex)); - int64_t ts2 = taosGetTimestampNs(); code = walReadVer(pWalHandle, index); int64_t ts3 = taosGetTimestampNs(); diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index b8ecbe7515..540f40a4c0 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -103,6 +103,7 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { pSender->sendingMS = 0; pSender->term = pSender->pSyncNode->pRaftStore->currentTerm; pSender->startTime = taosGetTimestampMs(); + pSender->lastSendTime = pSender->startTime; pSender->finish = false; // build begin msg @@ -201,6 +202,8 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) { syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); + pSender->lastSendTime = taosGetTimestampMs(); + // event log if (pSender->seq == SYNC_SNAPSHOT_SEQ_END) { sSTrace(pSender, "snapshot sender finish"); @@ -213,33 +216,36 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) { // send snapshot data from cache int32_t snapshotReSend(SSyncSnapshotSender *pSender) { // send current block data + + // build msg + SRpcMsg rpcMsg = {0}; + (void)syncBuildSnapshotSend(&rpcMsg, pSender->blockLen, pSender->pSyncNode->vgId); + + SyncSnapshotSend *pMsg = rpcMsg.pCont; + pMsg->srcId = pSender->pSyncNode->myRaftId; + pMsg->destId = (pSender->pSyncNode->replicasId)[pSender->replicaIndex]; + pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pMsg->beginIndex = pSender->snapshotParam.start; + pMsg->lastIndex = pSender->snapshot.lastApplyIndex; + pMsg->lastTerm = pSender->snapshot.lastApplyTerm; + pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; + pMsg->lastConfig = pSender->lastConfig; + pMsg->seq = pSender->seq; + if (pSender->pCurrentBlock != NULL && pSender->blockLen > 0) { - // build msg - SRpcMsg rpcMsg = {0}; - (void)syncBuildSnapshotSend(&rpcMsg, pSender->blockLen, pSender->pSyncNode->vgId); - - SyncSnapshotSend *pMsg = rpcMsg.pCont; - pMsg->srcId = pSender->pSyncNode->myRaftId; - pMsg->destId = (pSender->pSyncNode->replicasId)[pSender->replicaIndex]; - pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; - pMsg->beginIndex = pSender->snapshotParam.start; - pMsg->lastIndex = pSender->snapshot.lastApplyIndex; - pMsg->lastTerm = pSender->snapshot.lastApplyTerm; - pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; - pMsg->lastConfig = pSender->lastConfig; - pMsg->seq = pSender->seq; - // pMsg->privateTerm = pSender->privateTerm; memcpy(pMsg->data, pSender->pCurrentBlock, pSender->blockLen); - - // send msg - syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); - syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); - - // event log - sSTrace(pSender, "snapshot sender resend"); } + // send msg + syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); + syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); + + pSender->lastSendTime = taosGetTimestampMs(); + + // event log + sSTrace(pSender, "snapshot sender resend"); + return 0; } @@ -339,6 +345,8 @@ bool snapshotReceiverIsStart(SSyncSnapshotReceiver *pReceiver) { return pReceive void snapshotReceiverForceStop(SSyncSnapshotReceiver *pReceiver) { // force close, abandon incomplete data if (pReceiver->pWriter != NULL) { + // event log + sRTrace(pReceiver, "snapshot receiver force stop"); int32_t ret = pReceiver->pSyncNode->pFsm->FpSnapshotStopWrite(pReceiver->pSyncNode->pFsm, pReceiver->pWriter, false, &(pReceiver->snapshot)); ASSERT(ret == 0); @@ -348,7 +356,7 @@ void snapshotReceiverForceStop(SSyncSnapshotReceiver *pReceiver) { pReceiver->start = false; // event log - sRTrace(pReceiver, "snapshot receiver force stop"); + // sRTrace(pReceiver, "snapshot receiver force stop"); } int32_t snapshotReceiverStartWriter(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *pBeginMsg) { @@ -669,6 +677,7 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs sNTrace(pSyncNode, "snapshot receiver finish waitting for true time, now:%" PRId64 ", stime:%" PRId64, timeNow, pMsg->startTime); taosMsleep(10); + timeNow = taosGetTimestampMs(); } int32_t code = snapshotReceiverFinish(pReceiver, pMsg); diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index cf933d98b2..16e593d0e4 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -19,6 +19,8 @@ #include "syncRaftCfg.h" #include "syncRaftLog.h" #include "syncReplication.h" +#include "syncRespMgr.h" +#include "syncSnapshot.h" #include "syncUtil.h" static void syncNodeCleanConfigIndex(SSyncNode* ths) { @@ -69,6 +71,20 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { } int64_t timeNow = taosGetTimestampMs(); + + for (int i = 0; i < ths->peersNum; ++i) { + SSyncSnapshotSender* pSender = syncNodeGetSnapshotSender(ths, &(ths->peersId[i])); + if (pSender != NULL) { + if (ths->isStart && ths->state == TAOS_SYNC_STATE_LEADER && pSender->start && + timeNow - pSender->lastSendTime > SYNC_SNAP_RESEND_MS) { + snapshotReSend(pSender); + } else { + sTrace("vgId:%d, do not resend: nstart%d, now:%" PRId64 ", lstsend:%" PRId64 ", diff:%" PRId64, ths->vgId, + ths->isStart, timeNow, pSender->lastSendTime, timeNow - pSender->lastSendTime); + } + } + } + if (atomic_load_64(&ths->snapshottingIndex) != SYNC_INDEX_INVALID) { // end timeout wal snapshot if (timeNow - ths->snapshottingTime > SYNC_DEL_WAL_MS && @@ -85,11 +101,9 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { } } -#if 0 if (!syncNodeIsMnode(ths)) { syncRespClean(ths->pSyncRespMgr); } -#endif return 0; } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 7787438dfe..a034e6ad83 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -160,8 +160,6 @@ void syncUtilMsgNtoH(void* msg) { bool syncUtilUserPreCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } -bool syncUtilUserCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } - bool syncUtilUserRollback(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } void syncCfg2SimpleStr(const SSyncCfg* pCfg, char* buf, int32_t bufLen) { @@ -568,7 +566,7 @@ void syncLogSendSyncSnapshotSend(SSyncNode* pSyncNode, const SyncSnapshotSend* p syncUtilU642Addr(pMsg->destId.addr, host, sizeof(host), &port); sNTrace(pSyncNode, - "send sync-snapshot-send from %s:%d {term:%" PRId64 ", begin:%" PRId64 ", end:%" PRId64 ", lterm:%" PRId64 + "send sync-snapshot-send to %s:%d {term:%" PRId64 ", begin:%" PRId64 ", end:%" PRId64 ", lterm:%" PRId64 ", stime:%" PRId64 ", seq:%d}, %s", host, port, pMsg->term, pMsg->beginIndex, pMsg->lastIndex, pMsg->lastTerm, pMsg->startTime, pMsg->seq, s); } @@ -595,7 +593,7 @@ void syncLogSendSyncSnapshotRsp(SSyncNode* pSyncNode, const SyncSnapshotRsp* pMs syncUtilU642Addr(pMsg->destId.addr, host, sizeof(host), &port); sNTrace(pSyncNode, - "send sync-snapshot-rsp from %s:%d {term:%" PRId64 ", begin:%" PRId64 ", lst:%" PRId64 ", lterm:%" PRId64 + "send sync-snapshot-rsp to %s:%d {term:%" PRId64 ", begin:%" PRId64 ", lst:%" PRId64 ", lterm:%" PRId64 ", stime:%" PRId64 ", ack:%d}, %s", host, port, pMsg->term, pMsg->snapBeginIndex, pMsg->lastIndex, pMsg->lastTerm, pMsg->startTime, pMsg->ack, s); } diff --git a/source/libs/sync/test/syncAppendEntriesReplyTest.cpp b/source/libs/sync/test/syncAppendEntriesReplyTest.cpp index 1eb803e846..e1a8a5c832 100644 --- a/source/libs/sync/test/syncAppendEntriesReplyTest.cpp +++ b/source/libs/sync/test/syncAppendEntriesReplyTest.cpp @@ -19,7 +19,7 @@ SyncAppendEntriesReply *createMsg() { pMsg->success = true; pMsg->matchIndex = 77; pMsg->term = 33; - pMsg->privateTerm = 44; + // pMsg->privateTerm = 44; pMsg->startTime = taosGetTimestampMs(); return pMsg; } diff --git a/source/libs/sync/test/syncTest.cpp b/source/libs/sync/test/syncTest.cpp index 9ae79e11fb..7b636085f2 100644 --- a/source/libs/sync/test/syncTest.cpp +++ b/source/libs/sync/test/syncTest.cpp @@ -1,5 +1,5 @@ #include "syncTest.h" -#include +// #include /* typedef enum { diff --git a/source/libs/sync/test/sync_test_lib/inc/syncIO.h b/source/libs/sync/test/sync_test_lib/inc/syncIO.h index 19f896182e..98b013b46d 100644 --- a/source/libs/sync/test/sync_test_lib/inc/syncIO.h +++ b/source/libs/sync/test/sync_test_lib/inc/syncIO.h @@ -81,6 +81,8 @@ int32_t syncIOQTimerStop(); int32_t syncIOPingTimerStart(); int32_t syncIOPingTimerStop(); +void syncEntryDestory(SSyncRaftEntry* pEntry); + #ifdef __cplusplus } #endif diff --git a/source/libs/sync/test/sync_test_lib/src/syncIO.c b/source/libs/sync/test/sync_test_lib/src/syncIO.c index 2c24451713..4b305f823f 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncIO.c +++ b/source/libs/sync/test/sync_test_lib/src/syncIO.c @@ -97,7 +97,7 @@ int32_t syncIOEqMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { syncRpcMsgLog2(logBuf, pMsg); SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); STaosQueue *pMsgQ = gSyncIO->pMsgQ; @@ -381,7 +381,7 @@ static void syncIOProcessRequest(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) { syncRpcMsgLog2((char *)"==syncIOProcessRequest==", pMsg); SSyncIO *io = pParent; SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); taosWriteQitem(io->pMsgQ, pTemp); } @@ -441,7 +441,7 @@ static void syncIOTickQ(void *param, void *tmrId) { SRpcMsg rpcMsg; syncPingReply2RpcMsg(pMsg, &rpcMsg); SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, &rpcMsg, sizeof(SRpcMsg)); syncRpcMsgLog2((char *)"==syncIOTickQ==", &rpcMsg); taosWriteQitem(io->pMsgQ, pTemp); @@ -469,3 +469,5 @@ static void syncIOTickPing(void *param, void *tmrId) { taosTmrReset(syncIOTickPing, io->pingTimerMS, io, io->timerMgr, &io->pingTimer); } + +void syncEntryDestory(SSyncRaftEntry* pEntry) {} \ No newline at end of file diff --git a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c index 1ea7629601..3b6007df6b 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c @@ -1583,8 +1583,8 @@ cJSON* syncAppendEntriesReply2Json(const SyncAppendEntriesReply* pMsg) { cJSON_AddNumberToObject(pDestId, "vgId", pMsg->destId.vgId); cJSON_AddItemToObject(pRoot, "destId", pDestId); - snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm); - cJSON_AddStringToObject(pRoot, "privateTerm", u64buf); + // snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm); + // cJSON_AddStringToObject(pRoot, "privateTerm", u64buf); snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->term); cJSON_AddStringToObject(pRoot, "term", u64buf); diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index c728e29641..10a99bb1fa 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -81,6 +81,8 @@ void tdbFree(void *); typedef struct hashset_st *hashset_t; +void hashset_destroy(hashset_t set); + struct STxn { int flags; int64_t txnId; diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 8c62f89b64..5c1f264460 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -110,6 +110,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbBegin(pEnv, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED); if (ret < 0) { + tdbOsFree(pBt); return -1; } @@ -119,6 +120,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbPagerFetchPage(pPager, &pgno, &pPage, tdbBtreeInitPage, &zArg, txn); if (ret < 0) { tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } @@ -126,6 +128,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg if (ret < 0) { tdbError("failed to write page since %s", terrstr()); tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } @@ -138,6 +141,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbTbInsert(pPager->pEnv->pMainDb, tbname, strlen(tbname) + 1, &pBt->info, sizeof(pBt->info), txn); if (ret < 0) { tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } } diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index f638ec25a3..648e99d6a5 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -379,9 +379,6 @@ int tdbPagerPostCommit(SPager *pPager, TXN *pTxn) { return -1; } - if (pTxn->jPageSet) { - hashset_destroy(pTxn->jPageSet); - } // pPager->inTran = 0; return 0; @@ -549,8 +546,6 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } - hashset_destroy(pTxn->jPageSet); - // pPager->inTran = 0; return 0; @@ -725,14 +720,16 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage pgno = TDB_PAGE_PGNO(pPage); - tdbTrace("tdbttl init pager:%p, pgno:%d, loadPage:%d, size:%d", pPager, pgno, loadPage, pPager->dbOrigSize); + tdbTrace("tdb/pager:%p, pgno:%d, loadPage:%d, size:%d", pPager, pgno, loadPage, pPager->dbOrigSize); if (loadPage && pgno <= pPager->dbOrigSize) { init = 1; nRead = tdbOsPRead(pPager->fd, pPage->pData, pPage->pageSize, ((i64)pPage->pageSize) * (pgno - 1)); - tdbTrace("tdbttl pager:%p, pgno:%d, nRead:%" PRId64, pPager, pgno, nRead); + tdbTrace("tdb/pager:%p, pgno:%d, nRead:%" PRId64, pPager, pgno, nRead); if (nRead < pPage->pageSize) { ASSERT(0); + tdbError("tdb/pager:%p, pgno:%d, nRead:%" PRId64 "pgSize:%" PRId32, pPager, pgno, nRead, pPage->pageSize); + TDB_UNLOCK_PAGE(pPage); return -1; } } else { @@ -922,6 +919,8 @@ int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) { char *name = tdbDirEntryBaseName(tdbGetDirEntryName(pDirEntry)); if (strncmp(TDB_MAINDB_NAME "-journal", name, 16) == 0) { if (tdbPagerRestore(pPager, pBt, name) < 0) { + tdbCloseDir(&pDir); + tdbError("failed to restore file due to %s. jFileName:%s", strerror(errno), name); return -1; } @@ -946,6 +945,8 @@ int tdbPagerRollback(SPager *pPager) { if (strncmp(TDB_MAINDB_NAME "-journal", name, 16) == 0) { if (tdbOsRemove(name) < 0 && errno != ENOENT) { + tdbCloseDir(&pDir); + tdbError("failed to remove file due to %s. jFileName:%s", strerror(errno), name); terrno = TAOS_SYSTEM_ERROR(errno); return -1; diff --git a/source/libs/tdb/src/db/tdbTxn.c b/source/libs/tdb/src/db/tdbTxn.c index 77c87d18f2..055d9c7f98 100644 --- a/source/libs/tdb/src/db/tdbTxn.c +++ b/source/libs/tdb/src/db/tdbTxn.c @@ -30,6 +30,11 @@ int tdbTxnOpen(TXN *pTxn, int64_t txnid, void *(*xMalloc)(void *, size_t), void int tdbTxnClose(TXN *pTxn) { if (pTxn) { + if (pTxn->jPageSet) { + hashset_destroy(pTxn->jPageSet); + pTxn->jPageSet = NULL; + } + tdbOsFree(pTxn); } diff --git a/source/libs/tdb/test/tdbExOVFLTest.cpp b/source/libs/tdb/test/tdbExOVFLTest.cpp index f4f09b20b8..b16bc643d3 100644 --- a/source/libs/tdb/test/tdbExOVFLTest.cpp +++ b/source/libs/tdb/test/tdbExOVFLTest.cpp @@ -8,6 +8,7 @@ #include #include #include +#include "tlog.h" typedef struct SPoolMem { int64_t size; diff --git a/source/libs/tdb/test/tdbTest.cpp b/source/libs/tdb/test/tdbTest.cpp index 54e80a0009..cd02eb8d5e 100644 --- a/source/libs/tdb/test/tdbTest.cpp +++ b/source/libs/tdb/test/tdbTest.cpp @@ -8,6 +8,7 @@ #include #include #include +#include "tlog.h" typedef struct SPoolMem { int64_t size; diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h index 833937aa41..57aba67b1d 100644 --- a/source/libs/transport/inc/transportInt.h +++ b/source/libs/transport/inc/transportInt.h @@ -57,10 +57,14 @@ typedef struct { int32_t retryMaxInterval; // retry max interval int32_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + void (*cfp)(void* parent, SRpcMsg*, SEpSet*); bool (*retry)(int32_t code, tmsg_t msgType); bool (*startTimer)(int32_t code, tmsg_t msgType); void (*destroyFp)(void* ahandle); + bool (*failFastFp)(tmsg_t msgType); int index; void* parent; diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index c6a5cfdc95..0eac12f7c5 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -56,11 +56,15 @@ void* rpcOpen(const SRpcInit* pInit) { pRpc->retryMaxInterval = pInit->retryMaxInterval; pRpc->retryMaxTimouet = pInit->retryMaxTimouet; + pRpc->failFastThreshold = pInit->failFastThreshold; + pRpc->failFastInterval = pInit->failFastInterval; + // register callback handle pRpc->cfp = pInit->cfp; pRpc->retry = pInit->rfp; pRpc->startTimer = pInit->tfp; pRpc->destroyFp = pInit->dfp; + pRpc->failFastFp = pInit->ffp; pRpc->numOfThreads = pInit->numOfThreads > TSDB_MAX_RPC_THREADS ? TSDB_MAX_RPC_THREADS : pInit->numOfThreads; if (pRpc->numOfThreads <= 0) { diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 7339d487d1..03e3fb52c4 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -84,6 +84,8 @@ typedef struct SCliThrd { SHashObj* fqdn2ipCache; SCvtAddr cvtAddr; + SHashObj* failFastCache; + SCliMsg* stopMsg; bool quit; @@ -96,6 +98,13 @@ typedef struct SCliObj { SCliThrd** pThreadObj; } SCliObj; +typedef struct { + int32_t reinit; + int64_t timestamp; + int32_t count; + int32_t threshold; + int64_t interval; +} SFailFastItem; // conn pool // add expire timeout and capacity limit static void* createConnPool(int size); @@ -276,6 +285,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) { } destroyCmsg(msg); } + memset(&conn->ctx, 0, sizeof(conn->ctx)); } bool cliMaySendCachedMsg(SCliConn* conn) { if (!transQueueEmpty(&conn->cliMsgs)) { @@ -580,6 +590,7 @@ static void addConnToPool(void* pool, SCliConn* conn) { } static int32_t allocConnRef(SCliConn* conn, bool update) { if (update) { + transReleaseExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId); conn->refId = -1; } @@ -688,6 +699,7 @@ static void cliDestroyConn(SCliConn* conn, bool clear) { tTrace("%s conn %p remove from conn pool", CONN_GET_INST_LABEL(conn), conn); QUEUE_REMOVE(&conn->q); QUEUE_INIT(&conn->q); + transReleaseExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId); conn->refId = -1; @@ -722,6 +734,7 @@ static void cliDestroy(uv_handle_t* handle) { conn->timer = NULL; } + transReleaseExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId); taosMemoryFree(conn->ip); taosMemoryFree(conn->stream); @@ -853,7 +866,7 @@ void cliSend(SCliConn* pConn) { int status = uv_write(req, (uv_stream_t*)pConn->stream, &wb, 1, cliSendCb); if (status != 0) { - tGError("%s conn %p failed to sent msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), + tGError("%s conn %p failed to send msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), uv_err_name(status)); cliHandleExcept(pConn); } @@ -863,7 +876,6 @@ _RETURN: } void cliConnCb(uv_connect_t* req, int status) { - // impl later SCliConn* pConn = req->data; SCliThrd* pThrd = pConn->hostThrd; @@ -875,7 +887,33 @@ void cliConnCb(uv_connect_t* req, int status) { } if (status != 0) { - tError("%s conn %p failed to connect server:%s", CONN_GET_INST_LABEL(pConn), pConn, uv_strerror(status)); + SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); + STrans* pTransInst = pThrd->pTransInst; + + tError("%s msg %s failed to send, conn %p failed to connect to %s:%d, reason: %s", CONN_GET_INST_LABEL(pConn), + pMsg ? TMSG_INFO(pMsg->msg.msgType) : 0, pConn, pConn->ip, pConn->port, uv_strerror(status)); + if (pMsg != NULL && REQUEST_NO_RESP(&pMsg->msg) && + (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { + char* ip = pConn->ip; + uint32_t port = pConn->port; + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + int64_t cTimestamp = taosGetTimestampMs(); + if (item != NULL) { + int32_t elapse = cTimestamp - item->timestamp; + if (elapse >= 0 && elapse <= pTransInst->failFastInterval) { + item->count++; + } else { + item->count = 1; + item->timestamp = cTimestamp; + } + } else { + SFailFastItem item = {.count = 1, .timestamp = cTimestamp}; + taosHashPut(pThrd->failFastCache, key, strlen(key), &item, sizeof(SFailFastItem)); + } + } cliHandleExcept(pConn); return; } @@ -1018,15 +1056,31 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { cliMayCvtFqdnToIp(&pCtx->epSet, &pThrd->cvtAddr); - char tbuf[256] = {0}; - EPSET_DEBUG_STR(&pCtx->epSet, tbuf); - if (!EPSET_IS_VALID(&pCtx->epSet)) { tError("invalid epset"); destroyCmsg(pMsg); return; } + if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { + char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet); + uint32_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet); + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + if (item != NULL) { + int32_t elapse = (int32_t)(taosGetTimestampMs() - item->timestamp); + if (item->count >= pTransInst->failFastThreshold && (elapse >= 0 && elapse <= pTransInst->failFastInterval)) { + STraceId* trace = &(pMsg->msg.info.traceId); + tGTrace("%s, msg %s cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, + TMSG_INFO(pMsg->msg.msgType), ip, port, item->count, elapse); + destroyCmsg(pMsg); + return; + } + } + } + bool ignore = false; SCliConn* conn = cliGetConn(pMsg, pThrd, &ignore); if (ignore == true) { @@ -1299,6 +1353,8 @@ static SCliThrd* createThrdObj(void* trans) { pThrd->destroyAhandleFp = pTransInst->destroyFp; pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->quit = false; return pThrd; } @@ -1325,6 +1381,7 @@ static void destroyThrdObj(SCliThrd* pThrd) { taosMemoryFree(pThrd->prepare); taosMemoryFree(pThrd->loop); taosHashCleanup(pThrd->fqdn2ipCache); + taosHashCleanup(pThrd->failFastCache); taosMemoryFree(pThrd); } @@ -1437,18 +1494,35 @@ FORCE_INLINE bool cliTryExtractEpSet(STransMsg* pResp, SEpSet* dst) { bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) { bool noDelay = true; if (hasEpSet == false) { - // assert(pResp->contLen == 0); if (pResp->contLen == 0) { if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { noDelay = false; } else { EPSET_FORWARD_INUSE(&pCtx->epSet); } - } else { - if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { - noDelay = false; + } else if (pResp->contLen != 0) { + SEpSet epSet; + int32_t valid = tDeserializeSEpSet(pResp->pCont, pResp->contLen, &epSet); + if (valid < 0) { + tDebug("get invalid epset, epset equal, continue"); + if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { + noDelay = false; + } else { + EPSET_FORWARD_INUSE(&pCtx->epSet); + } } else { - EPSET_FORWARD_INUSE(&pCtx->epSet); + if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) { + tDebug("epset not equal, retry new epset"); + pCtx->epSet = epSet; + noDelay = false; + } else { + if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { + noDelay = false; + } else { + tDebug("epset equal, continue"); + EPSET_FORWARD_INUSE(&pCtx->epSet); + } + } } } } else { @@ -1528,7 +1602,7 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { addConnToPool(pThrd->pool, pConn); } else if (code == TSDB_CODE_SYN_RESTORING) { tTrace("code str %s, contlen:%d 0", tstrerror(code), pResp->contLen); - noDelay = cliResetEpset(pCtx, pResp, false); + noDelay = cliResetEpset(pCtx, pResp, true); addConnToPool(pThrd->pool, pConn); transFreeMsg(pResp->pCont); } else { @@ -1552,9 +1626,9 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pCtx->retryNextInterval = pCtx->retryMaxInterval; } - if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { - return false; - } + // if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { + // return false; + // } } else { pCtx->retryNextInterval = 0; pCtx->epsetRetryCnt++; diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index ad8d57c97a..09f9a78ab8 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -282,6 +282,9 @@ void transCtxCleanup(STransCtx* ctx) { } void transCtxMerge(STransCtx* dst, STransCtx* src) { + if (src->args == NULL || src->freeFunc == NULL) { + return; + } if (dst->args == NULL) { dst->args = src->args; dst->brokenVal = src->brokenVal; diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 73c6dc4011..2b1f68d5f6 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -1195,6 +1195,8 @@ void transCloseServer(void* arg) { sendQuitToWorkThrd(srv->pThreadObj[i]); destroyWorkThrd(srv->pThreadObj[i]); } + } else { + uv_loop_close(srv->loop); } taosMemoryFree(srv->pThreadObj); diff --git a/source/libs/transport/test/svrBench.c b/source/libs/transport/test/svrBench.c index 464559c1e0..4e2395b17b 100644 --- a/source/libs/transport/test/svrBench.c +++ b/source/libs/transport/test/svrBench.c @@ -128,7 +128,7 @@ void *processShellMsg(void *arg) { void processRequestMsg(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) { SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); int32_t idx = balance % multiQ->numOfThread; diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 64dde15e76..8e6628bb21 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -24,7 +24,9 @@ bool FORCE_INLINE walLogExist(SWal* pWal, int64_t ver) { return !walIsEmpty(pWal) && walGetFirstVer(pWal) <= ver && walGetLastVer(pWal) >= ver; } -bool FORCE_INLINE walIsEmpty(SWal* pWal) { return pWal->vers.firstVer == -1; } +bool FORCE_INLINE walIsEmpty(SWal* pWal) { + return (pWal->vers.firstVer == -1 || pWal->vers.lastVer < pWal->vers.firstVer); // [firstVer, lastVer + 1) +} int64_t FORCE_INLINE walGetFirstVer(SWal* pWal) { return pWal->vers.firstVer; } diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index a683ceb2b1..702d05f576 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -121,7 +121,16 @@ SWal *walOpen(const char *path, SWalCfg *pCfg) { pWal->writeCur = -1; pWal->fileInfoSet = taosArrayInit(8, sizeof(SWalFileInfo)); if (pWal->fileInfoSet == NULL) { - wError("vgId:%d, path:%s, failed to init taosArray %s", pWal->cfg.vgId, pWal->path, strerror(errno)); + wError("vgId:%d, failed to init taosArray of fileInfoSet due to %s. path:%s", pWal->cfg.vgId, strerror(errno), + pWal->path); + goto _err; + } + + // init gc + pWal->toDeleteFiles = taosArrayInit(8, sizeof(SWalFileInfo)); + if (pWal->toDeleteFiles == NULL) { + wError("vgId:%d, failed to init taosArray of toDeleteFiles due to %s. path:%s", pWal->cfg.vgId, strerror(errno), + pWal->path); goto _err; } @@ -203,6 +212,8 @@ void walClose(SWal *pWal) { pWal->pIdxFile = NULL; taosArrayDestroy(pWal->fileInfoSet); pWal->fileInfoSet = NULL; + taosArrayDestroy(pWal->toDeleteFiles); + pWal->toDeleteFiles = NULL; void *pIter = NULL; while (1) { @@ -212,6 +223,7 @@ void walClose(SWal *pWal) { taosMemoryFree(pRef); } taosHashCleanup(pWal->pRefHash); + pWal->pRefHash = NULL; taosThreadMutexUnlock(&pWal->mutex); taosRemoveRef(tsWal.refSetId, pWal->refId); diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c index 76266d338b..ed02d29e3b 100644 --- a/source/libs/wal/src/walRead.c +++ b/source/libs/wal/src/walRead.c @@ -489,7 +489,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) { int32_t code; bool seeked = false; - if (pReader->pWal->vers.firstVer == -1) { + if (walIsEmpty(pReader->pWal)) { terrno = TSDB_CODE_WAL_LOG_NOT_EXIST; return -1; } diff --git a/source/libs/wal/src/walRef.c b/source/libs/wal/src/walRef.c index eae5d9f1a7..e86111109c 100644 --- a/source/libs/wal/src/walRef.c +++ b/source/libs/wal/src/walRef.c @@ -32,15 +32,18 @@ SWalRef *walOpenRef(SWal *pWal) { return pRef; } -#if 1 void walCloseRef(SWal *pWal, int64_t refId) { SWalRef **ppRef = taosHashGet(pWal->pRefHash, &refId, sizeof(int64_t)); if (ppRef == NULL) return; SWalRef *pRef = *ppRef; + if (pRef) { + wDebug("vgId:%d, wal close ref %" PRId64 ", refId %" PRId64, pWal->cfg.vgId, pRef->refVer, pRef->refId); + } else { + wDebug("vgId:%d, wal close ref null, refId %" PRId64, pWal->cfg.vgId, refId); + } taosHashRemove(pWal->pRefHash, &refId, sizeof(int64_t)); taosMemoryFree(pRef); } -#endif int32_t walRefVer(SWalRef *pRef, int64_t ver) { SWal *pWal = pRef->pWal; diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 2dde0de39b..a5c7bf1abd 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -120,9 +120,9 @@ int32_t walRollback(SWal *pWal, int64_t ver) { return -1; } - // delete files + // delete files in descending order int fileSetSize = taosArrayGetSize(pWal->fileInfoSet); - for (int i = pWal->writeCur + 1; i < fileSetSize; i++) { + for (int i = fileSetSize - 1; i >= pWal->writeCur + 1; i--) { walBuildLogName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr); wDebug("vgId:%d, wal remove file %s for rollback", pWal->cfg.vgId, fnameStr); taosRemoveFile(fnameStr); @@ -217,14 +217,9 @@ int32_t walRollback(SWal *pWal, int64_t ver) { pWal->vers.lastVer = ver - 1; if (pWal->vers.lastVer < pWal->vers.firstVer) { ASSERT(pWal->vers.lastVer == pWal->vers.firstVer - 1); - pWal->vers.firstVer = -1; } ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer = ver - 1; ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize = entry.offset; - if (((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer < ver - 1) { - ASSERT(((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize == 0); - ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->firstVer = -1; - } taosCloseFile(&pIdxFile); taosCloseFile(&pLogFile); @@ -338,6 +333,7 @@ int32_t walEndSnapshot(SWal *pWal) { } else { wDebug("vgId:%d, wal no remove", pWal->cfg.vgId); } + // iterate files, until the searched result for (SWalFileInfo *iter = pWal->fileInfoSet->pData; iter < pInfo; iter++) { wDebug("vgId:%d, wal check remove file %" PRId64 "(file size %" PRId64 " close ts %" PRId64 @@ -350,34 +346,17 @@ int32_t walEndSnapshot(SWal *pWal) { wDebug("vgId:%d, check pass", pWal->cfg.vgId); deleteCnt++; newTotSize -= iter->fileSize; + taosArrayPush(pWal->toDeleteFiles, iter); } wDebug("vgId:%d, check not pass", pWal->cfg.vgId); } - wDebug("vgId:%d, wal should delete %d files", pWal->cfg.vgId, deleteCnt); - int32_t actualDelete = 0; - char fnameStr[WAL_FILE_LEN]; - // remove file - for (int i = 0; i < deleteCnt; i++) { - pInfo = taosArrayGet(pWal->fileInfoSet, i); - walBuildLogName(pWal, pInfo->firstVer, fnameStr); - wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); - if (taosRemoveFile(fnameStr) < 0) { - goto UPDATE_META; - } - walBuildIdxName(pWal, pInfo->firstVer, fnameStr); - wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); - if (taosRemoveFile(fnameStr) < 0) { - ASSERT(0); - } - actualDelete++; - } UPDATE_META: // make new array, remove files - taosArrayPopFrontBatch(pWal->fileInfoSet, actualDelete); + taosArrayPopFrontBatch(pWal->fileInfoSet, deleteCnt); if (taosArrayGetSize(pWal->fileInfoSet) == 0) { pWal->writeCur = -1; - pWal->vers.firstVer = -1; + pWal->vers.firstVer = pWal->vers.lastVer + 1; } else { pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer; } @@ -392,6 +371,26 @@ int32_t walEndSnapshot(SWal *pWal) { goto END; } + // delete files + deleteCnt = taosArrayGetSize(pWal->toDeleteFiles); + wDebug("vgId:%d, wal should delete %d files", pWal->cfg.vgId, deleteCnt); + char fnameStr[WAL_FILE_LEN]; + for (int i = 0; i < deleteCnt; i++) { + pInfo = taosArrayGet(pWal->toDeleteFiles, i); + walBuildLogName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); + if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) { + wError("vgId:%d, failed to remove log file %s due to %s", pWal->cfg.vgId, fnameStr, strerror(errno)); + goto END; + } + walBuildIdxName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); + if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) { + ASSERT(0); + } + } + taosArrayClear(pWal->toDeleteFiles); + END: taosThreadMutexUnlock(&pWal->mutex); return code; @@ -489,9 +488,7 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); ASSERT(pFileInfo != NULL); - if (pFileInfo->firstVer == -1) { - pFileInfo->firstVer = index; - } + ASSERT(pFileInfo->firstVer != -1); pWal->writeHead.head.version = index; pWal->writeHead.head.bodyLen = bodyLen; pWal->writeHead.head.msgType = msgType; @@ -527,7 +524,10 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy } // set status - if (pWal->vers.firstVer == -1) pWal->vers.firstVer = index; + if (pWal->vers.firstVer == -1) { + ASSERT(index == 0); + pWal->vers.firstVer = 0; + } pWal->vers.lastVer = index; pWal->totSize += sizeof(SWalCkHead) + bodyLen; pFileInfo->lastVer = index; diff --git a/source/os/src/osDir.c b/source/os/src/osDir.c index 421901184b..331d241745 100644 --- a/source/os/src/osDir.c +++ b/source/os/src/osDir.c @@ -163,7 +163,7 @@ int32_t taosMulMkDir(const char *dirname) { code = mkdir(temp, 0755); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } *pos = TD_DIRSEP[0]; @@ -179,7 +179,7 @@ int32_t taosMulMkDir(const char *dirname) { code = mkdir(temp, 0755); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } } @@ -225,7 +225,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) { code = mkdir(temp, mode); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } *pos = TD_DIRSEP[0]; @@ -241,7 +241,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) { code = mkdir(temp, mode); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } } @@ -394,8 +394,8 @@ char *taosDirEntryBaseName(char *name) { char *pPoint = strrchr(name, '/'); if (pPoint != NULL) { if (*(pPoint + 1) == '\0') { - *pPoint = '\0'; - return taosDirEntryBaseName(name); + *pPoint = '\0'; + return taosDirEntryBaseName(name); } return pPoint + 1; } @@ -497,3 +497,12 @@ int32_t taosCloseDir(TdDirPtr *ppDir) { return 0; #endif } + +void taosGetCwd(char *buf, int32_t len) { +#if !defined(WINDOWS) + char *unused __attribute__((unused)); + unused = getcwd(buf, len - 1); +#else + strncpy(buf, "not implemented on windows", len - 1); +#endif +} diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index 68365be481..8c2170239f 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -313,7 +313,7 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) { assert(!(tdFileOptions & TD_FILE_EXCL)); fp = fopen(path, mode); if (fp == NULL) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return NULL; } } else { @@ -336,14 +336,14 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) { fd = open(path, access, S_IRWXU | S_IRWXG | S_IRWXO); #endif if (fd == -1) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return NULL; } } TdFilePtr pFile = (TdFilePtr)taosMemoryMalloc(sizeof(TdFile)); if (pFile == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + // terrno = TSDB_CODE_OUT_OF_MEMORY; if (fd >= 0) close(fd); if (fp != NULL) fclose(fp); return NULL; diff --git a/source/os/src/osMemory.c b/source/os/src/osMemory.c index 230ca5b968..2e68bd5ccd 100644 --- a/source/os/src/osMemory.c +++ b/source/os/src/osMemory.c @@ -348,7 +348,7 @@ void taosMemoryTrim(int32_t size) { void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) { #ifdef USE_TD_MEMORY - ASSERT(0); + assert(0); #else #if defined(LINUX) void* p = memalign(alignment, size); diff --git a/source/os/src/osString.c b/source/os/src/osString.c index e2d8ce95db..f03778de2f 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -143,15 +143,17 @@ SConv *gConv = NULL; int32_t convUsed = 0; int32_t gConvMaxNum = 0; -void taosConvInit(void) { +int32_t taosConvInit(void) { gConvMaxNum = 512; gConv = taosMemoryCalloc(gConvMaxNum, sizeof(SConv)); for (int32_t i = 0; i < gConvMaxNum; ++i) { gConv[i].conv = iconv_open(DEFAULT_UNICODE_ENCODEC, tsCharset); if ((iconv_t)-1 == gConv[i].conv || (iconv_t)0 == gConv[i].conv) { - ASSERT(0); + return -1; } } + + return 0; } void taosConvDestroy() { diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 7ec1da0530..eb989d6957 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -97,6 +97,7 @@ LONG WINAPI exceptionHandler(LPEXCEPTION_POINTERS exception); #include #include +#include #else @@ -275,34 +276,34 @@ int32_t taosGetEmail(char *email, int32_t maxLen) { #endif } + + int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen) { #ifdef WINDOWS snprintf(releaseName, maxLen, "Windows"); return 0; #elif defined(_TD_DARWIN_64) - char line[1024]; - size_t size = 0; - int32_t code = -1; + char osversion[32]; + size_t osversion_len = sizeof(osversion) - 1; + int osversion_name[] = { CTL_KERN, KERN_OSRELEASE }; - TdFilePtr pFile = taosOpenFile("/etc/os-release", TD_FILE_READ | TD_FILE_STREAM); - if (pFile == NULL) return false; - - while ((size = taosGetsFile(pFile, sizeof(line), line)) != -1) { - line[size - 1] = '\0'; - if (strncmp(line, "PRETTY_NAME", 11) == 0) { - const char *p = strchr(line, '=') + 1; - if (*p == '"') { - p++; - line[size - 2] = 0; - } - tstrncpy(releaseName, p, maxLen); - code = 0; - break; - } + if (sysctl(osversion_name, 2, osversion, &osversion_len, NULL, 0) == -1) { + return -1; } - taosCloseFile(&pFile); - return code; + uint32_t major, minor; + if (sscanf(osversion, "%u.%u", &major, &minor) != 2) { + return -1; + } + if (major >= 20) { + major -= 9; // macOS 11 and newer + sprintf(releaseName, "macOS %u.%u", major, minor); + } else { + major -= 4; // macOS 10.1.1 and newer + sprintf(releaseName, "macOS 10.%d.%d", major, minor); + } + + return 0; #else char line[1024]; size_t size = 0; @@ -353,6 +354,10 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) { code = 0; done |= 1; } + int endPos = strlen(cpuModel)-1; + if (cpuModel[endPos] == '\n') { + cpuModel[endPos] = '\0'; + } taosCloseCmd(&pCmd); pCmd = taosOpenCmd("sysctl -n machdep.cpu.core_count"); @@ -617,14 +622,14 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) { return 0; } else { // printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } #elif defined(_TD_DARWIN_64) struct statvfs info; if (statvfs(dataDir, &info)) { // printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } else { diskSize->total = info.f_blocks * info.f_frsize; @@ -635,7 +640,7 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) { #else struct statvfs info; if (statvfs(dataDir, &info)) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } else { diskSize->total = info.f_blocks * info.f_frsize; diff --git a/source/os/src/osTime.c b/source/os/src/osTime.c index 68dfba14e9..cd4324a592 100644 --- a/source/os/src/osTime.c +++ b/source/os/src/osTime.c @@ -572,7 +572,7 @@ int32_t taosClockGetTime(int clock_id, struct timespec *pTS) { offsetInitFinished = true; } else { while (!offsetInitFinished) - ; // Ensure initialization is completed. + ; // Ensure initialization is completed. } GetSystemTimeAsFileTime(&f); diff --git a/source/util/src/talgo.c b/source/util/src/talgo.c index 4d6875d263..057d3a620c 100644 --- a/source/util/src/talgo.c +++ b/source/util/src/talgo.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "talgo.h" +#include "tlog.h" #define doswap(__left, __right, __size, __buf) \ do { \ diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 3d05f80acf..609a386367 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -293,7 +293,7 @@ static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value, } SDiskCfg cfg = {0}; - tstrncpy(cfg.dir, value, sizeof(cfg.dir)); + tstrncpy(cfg.dir, pItem->str, sizeof(cfg.dir)); cfg.level = level ? atoi(level) : 0; cfg.primary = primary ? atoi(primary) : 1; void *ret = taosArrayPush(pItem->array, &cfg); @@ -660,12 +660,13 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_VAR); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_VAR); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_VAR); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } uInfo("load from env variables cfg success"); @@ -702,12 +703,13 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_CMD); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_CMD); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_CMD); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } uInfo("load from env cmd cfg success"); @@ -766,12 +768,13 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_FILE); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_FILE); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } taosCloseFile(&pFile); @@ -825,12 +828,13 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_CFG_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } taosCloseFile(&pFile); @@ -989,12 +993,14 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) { paGetToken(value2 + vlen2 + 1, &value3, &vlen3); if (vlen3 != 0) value3[vlen3] = 0; } + + code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_APOLLO_URL); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } tjsonDelete(pJson); diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 479cb027c7..656d775ea4 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -57,7 +57,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TIME_UNSYNCED, "Client and server's t TAOS_DEFINE_ERROR(TSDB_CODE_OPS_NOT_SUPPORT, "Operation not supported") TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_MEMORY, "Out of Memory") TAOS_DEFINE_ERROR(TSDB_CODE_FILE_CORRUPTED, "Data file corrupted") -TAOS_DEFINE_ERROR(TSDB_CODE_REF_NO_MEMORY, "Ref out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_REF_FULL, "too many Ref Objs") TAOS_DEFINE_ERROR(TSDB_CODE_REF_ID_REMOVED, "Ref ID is removed") TAOS_DEFINE_ERROR(TSDB_CODE_REF_INVALID_ID, "Invalid Ref ID") @@ -140,29 +139,19 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_NOT_STABLE_ERROR, "Table is not a super // mnode-common TAOS_DEFINE_ERROR(TSDB_CODE_MND_NO_RIGHTS, "Insufficient privilege for operation") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONNECTION, "Invalid message connection") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SHOWOBJ, "Data expired") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_QUERY_ID, "Invalid query id") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_ID, "Invalid stream id") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONN_ID, "Invalid connection id") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_MNODE_IS_RUNNING, "mnode is alreay running") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC, "failed to config sync") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_START_SYNC, "failed to start sync") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_CREATE_DIR, "failed to create mnode dir") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_INIT_STEP, "failed to init components") TAOS_DEFINE_ERROR(TSDB_CODE_MND_USER_DISABLED, "User is disabled") // mnode-sdb TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_ALREADY_THERE, "Object already there") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_TABLE_TYPE, "Invalid table type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_NOT_THERE, "Object not there") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_KEY_TYPE, "Invalid key type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_ACTION_TYPE, "Invalid action type") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_STATUS_TYPE, "Invalid status type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_VER, "Invalid raw data version") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_LEN, "Invalid raw data len") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_CONTENT, "Invalid raw data content") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_WAl_VER, "Invalid wal version") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_CREATING, "Object is creating") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_DROPPING, "Object is dropping") @@ -418,7 +407,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SYN_INTERNAL_ERROR, "Sync internal error") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_INVALID_CONFIG, "TQ invalid config") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_INIT_FAILED, "TQ init falied") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_DISK_PERMISSIONS, "TQ no disk permissions") -TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FILE_CORRUPTED, "TQ file corrupted") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FILE_ALREADY_EXISTS, "TQ file already exists") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FAILED_TO_CREATE_DIR, "TQ failed to create dir") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_META_NO_SUCH_KEY, "TQ meta no such key") @@ -596,7 +584,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_NO_INDEX_IN_CACHE, "No tsma index in ca TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_ENV, "Invalid rsma env") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_QTASKINFO_CREATE, "Rsma qtaskinfo creation error") -TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_FILE_CORRUPTED, "Rsma file corrupted") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_REMOVE_EXISTS, "Rsma remove exists") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP, "Rsma fetch msg is messed up") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_EMPTY_INFO, "Rsma info is empty") diff --git a/source/util/src/tjson.c b/source/util/src/tjson.c index cc823decf4..48638af8d5 100644 --- a/source/util/src/tjson.c +++ b/source/util/src/tjson.c @@ -181,7 +181,7 @@ int32_t tjsonGetObjectValueString(const SJson* pJson, char** pValueString) { int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } strcpy(pVal, p); return TSDB_CODE_SUCCESS; @@ -190,7 +190,7 @@ int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } *pVal = strdup(p); return TSDB_CODE_SUCCESS; @@ -199,7 +199,7 @@ int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal) int32_t tjsonGetBigIntValue(const SJson* pJson, const char* pName, int64_t* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } #ifdef WINDOWS sscanf(p, "%" PRId64, pVal); @@ -233,7 +233,7 @@ int32_t tjsonGetTinyIntValue(const SJson* pJson, const char* pName, int8_t* pVal int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } #ifdef WINDOWS sscanf(p, "%" PRIu64, pVal); @@ -259,6 +259,9 @@ int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pV int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal) { const SJson* pObject = tjsonGetObjectItem(pJson, pName); + if (NULL == pObject) { + return TSDB_CODE_SUCCESS; + } if (!cJSON_IsBool(pObject)) { return TSDB_CODE_FAILED; } @@ -268,6 +271,9 @@ int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal) { int32_t tjsonGetDoubleValue(const SJson* pJson, const char* pName, double* pVal) { const SJson* pObject = tjsonGetObjectItem(pJson, pName); + if (NULL == pObject) { + return TSDB_CODE_SUCCESS; + } if (!cJSON_IsNumber(pObject)) { return TSDB_CODE_FAILED; } @@ -282,7 +288,7 @@ SJson* tjsonGetArrayItem(const SJson* pJson, int32_t index) { return cJSON_GetAr int32_t tjsonToObject(const SJson* pJson, const char* pName, FToObject func, void* pObj) { SJson* pJsonObj = tjsonGetObjectItem(pJson, pName); if (NULL == pJsonObj) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } return func(pJsonObj, pObj); } @@ -294,7 +300,7 @@ int32_t tjsonMakeObject(const SJson* pJson, const char* pName, FToObject func, v SJson* pJsonObj = tjsonGetObjectItem(pJson, pName); if (NULL == pJsonObj) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } *pObj = taosMemoryCalloc(1, objSize); if (NULL == *pObj) { diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index fc9d90c985..747187254f 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -72,6 +72,7 @@ static int32_t tsDaylightActive; /* Currently in daylight saving time. */ bool tsLogEmbedded = 0; bool tsAsyncLog = true; +bool tsAssert = true; int32_t tsNumOfLogLines = 10000000; int32_t tsLogKeepDays = 0; LogFp tsLogFp = NULL; @@ -496,7 +497,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons if (!osLogSpaceAvailable()) return; if (!(dflag & DEBUG_FILE) && !(dflag & DEBUG_SCREEN)) return; - char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); + char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); int32_t len = taosBuildLogHead(buffer, flags); va_list argpointer; @@ -778,3 +779,37 @@ cmp_end: return ret; } + +bool taosAssert(bool condition, const char *file, int32_t line, const char *format, ...) { + if (condition) return false; + + const char *flags = "UTL FATAL "; + ELogLevel level = DEBUG_FATAL; + int32_t dflag = 255; // tsLogEmbedded ? 255 : uDebugFlag + char buffer[LOG_MAX_LINE_BUFFER_SIZE]; + int32_t len = taosBuildLogHead(buffer, flags); + + va_list argpointer; + va_start(argpointer, format); + len = len + vsnprintf(buffer + len, LOG_MAX_LINE_BUFFER_SIZE - len, format, argpointer); + va_end(argpointer); + buffer[len++] = '\n'; + buffer[len] = 0; + taosPrintLogImp(1, 255, buffer, len); + + taosPrintLog(flags, level, dflag, "tAssert at file %s:%d exit:%d", file, line, tsAssert); + taosPrintTrace(flags, level, dflag); + + if (tsAssert) { + // taosCloseLog(); + taosMsleep(300); + +#ifdef NDEBUG + abort(); +#else + assert(0); +#endif + } + + return true; +} \ No newline at end of file diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c index 0f992184b5..42b6358893 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -109,20 +109,24 @@ int64_t taosQueueMemorySize(STaosQueue *queue) { return memOfItems; } -void *taosAllocateQitem(int32_t size, EQItype itype) { +void *taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize) { STaosQnode *pNode = taosMemoryCalloc(1, sizeof(STaosQnode) + size); if (pNode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } + pNode->dataSize = dataSize; pNode->size = size; pNode->itype = itype; pNode->timestamp = taosGetTimestampUs(); if (itype == RPC_QITEM) { - int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size); + int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); if (alloced > tsRpcQueueMemoryAllowed) { + uError("failed to alloc qitem, size:%" PRId64 " alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, + tsRpcQueueMemoryUsed); + atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); taosMemoryFree(pNode); terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE; return NULL; @@ -139,8 +143,8 @@ void taosFreeQitem(void *pItem) { if (pItem == NULL) return; STaosQnode *pNode = (STaosQnode *)((char *)pItem - sizeof(STaosQnode)); - if (pNode->itype > 0) { - int64_t alloced = atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, pNode->size); + if (pNode->itype == RPC_QITEM) { + int64_t alloced = atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, pNode->size + pNode->dataSize); uTrace("item:%p, node:%p is freed, alloc:%" PRId64, pItem, pNode, alloced); } else { uTrace("item:%p, node:%p is freed", pItem, pNode); diff --git a/source/util/src/tref.c b/source/util/src/tref.c index b4322464e2..75a16b0ad7 100644 --- a/source/util/src/tref.c +++ b/source/util/src/tref.c @@ -67,14 +67,14 @@ int32_t taosOpenRef(int32_t max, RefFp fp) { nodeList = taosMemoryCalloc(sizeof(SRefNode *), (size_t)max); if (nodeList == NULL) { - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } lockedBy = taosMemoryCalloc(sizeof(int64_t), (size_t)max); if (lockedBy == NULL) { taosMemoryFree(nodeList); - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } @@ -164,7 +164,7 @@ int64_t taosAddRef(int32_t rsetId, void *p) { pNode = taosMemoryCalloc(sizeof(SRefNode), 1); if (pNode == NULL) { - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } diff --git a/source/util/test/hashTest.cpp b/source/util/test/hashTest.cpp index 76fb9c7067..00379a755b 100644 --- a/source/util/test/hashTest.cpp +++ b/source/util/test/hashTest.cpp @@ -6,6 +6,7 @@ #include "taos.h" #include "taosdef.h" #include "thash.h" +#include "tlog.h" namespace { diff --git a/tests/docs-examples-test/csharp.sh b/tests/docs-examples-test/csharp.sh index 21c19b9b3d..c08ffd6d62 100644 --- a/tests/docs-examples-test/csharp.sh +++ b/tests/docs-examples-test/csharp.sh @@ -28,10 +28,10 @@ taos -s "drop database if exists test" dotnet run --project optsJSON/optsJSON.csproj taos -s "create database if not exists test" -# dotnet run --project wsConnect/wsConnect.csproj -# dotnet run --project wsInsert/wsInsert.csproj -# dotnet run --project wsStmt/wsStmt.csproj -# dotnet run --project wsQuery/wsQuery.csproj +dotnet run --project wsConnect/wsConnect.csproj +dotnet run --project wsInsert/wsInsert.csproj +dotnet run --project wsStmt/wsStmt.csproj +dotnet run --project wsQuery/wsQuery.csproj taos -s "drop database if exists test" -taos -s "drop database if exists power" \ No newline at end of file +taos -s "drop database if exists power" diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c90b2499a4..4cbba106ba 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,6 +10,7 @@ ,,y,script,./test.sh -f tsim/user/password.sim ,,y,script,./test.sh -f tsim/user/privilege_db.sim ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim +,,y,script,./test.sh -f tsim/user/privilege_topic.sim ,,y,script,./test.sh -f tsim/db/alter_option.sim ,,y,script,./test.sh -f tsim/db/alter_replica_13.sim ,,y,script,./test.sh -f tsim/db/alter_replica_31.sim @@ -1022,9 +1023,9 @@ ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py -#,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py -#,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py @@ -1037,4 +1038,4 @@ ,,n,docs-examples-test,bash node.sh ,,n,docs-examples-test,bash csharp.sh ,,n,docs-examples-test,bash jdbc.sh -,,n,docs-examples-test,bash go.sh +#,,n,docs-examples-test,bash go.sh diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index 74aa7baf0b..60df188d7b 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -79,6 +79,9 @@ int64_t bpTs; #define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t))) typedef struct { + bool singleTbInsert; + int32_t singleTbIdx; + int64_t* tsData; bool* boolData; int8_t* tinyData; @@ -116,6 +119,7 @@ int insertMBMETest4(TAOS_STMT *stmt, TAOS *taos); int insertMPMETest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos); +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos); int queryColumnTest(TAOS_STMT *stmt, TAOS *taos); int queryMiscTest(TAOS_STMT *stmt, TAOS *taos); @@ -130,6 +134,7 @@ typedef struct { int32_t *colList; // full table column list int32_t testType; int32_t autoCreateTbl; + bool duplicateValue; bool fullCol; int32_t (*runFn)(TAOS_STMT*, TAOS*); int32_t tblNum; @@ -143,46 +148,47 @@ typedef struct { } CaseCfg; CaseCfg gCase[] = { - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1}, + {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1}, + {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1}, // 11 - {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, // 22 - {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:AUTO1-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, false, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:AUTO2-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, false, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1}, +// {"insert:AUTO3-NTB", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, true, insertAUTOTest3, 10, 10, 2, 0, 0, 0, 1, -1}, - {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2}, - {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2}, + {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2}, + {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2}, -// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2}, -// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2}, +// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2}, +// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2}, }; @@ -232,7 +238,7 @@ CaseCtrl gCaseCtrl = { .numericParam = false, .rowNum = 0, .bindColNum = 0, - .bindTagNum = 14, + .bindTagNum = 0, .bindRowNum = 0, .bindColTypeNum = 0, .bindColTypeList = NULL, @@ -244,7 +250,7 @@ CaseCtrl gCaseCtrl = { .funcIdxList = NULL, .checkParamNum = false, .runTimes = 0, - .caseIdx = 23, + .caseIdx = 24, .caseNum = 1, .caseRunIdx = -1, .caseRunNum = -1, @@ -382,7 +388,11 @@ bool colExists(TAOS_MULTI_BIND* pBind, int32_t dataType) { void generateInsertSQL(BindData *data) { int32_t len = 0; if (gCurCase->tblNum > 1) { - len = sprintf(data->sql, "insert into ? "); + if (data->singleTbInsert) { + len = sprintf(data->sql, "insert into %s%d ", bpTbPrefix, data->singleTbIdx); + } else { + len = sprintf(data->sql, "insert into ? "); + } } else { len = sprintf(data->sql, "insert into %s0 ", bpTbPrefix); } @@ -938,7 +948,14 @@ int32_t prepareInsertData(BindData *data) { } for (int32_t i = 0; i < allRowNum; ++i) { - data->tsData[i] = bpTs++; + if (gCurCase->duplicateValue) { + data->tsData[i] = bpTs; + if (i % 2 == 1) { + bpTs++; + } + } else { + data->tsData[i] = bpTs++; + } data->boolData[i] = (bool)(i % 2); data->tinyData[i] = (int8_t)i; data->utinyData[i] = (uint8_t)(i+1); @@ -1251,6 +1268,9 @@ void bpCheckParamNum(TAOS_STMT *stmt) { void bpCheckAffectedRows(TAOS_STMT *stmt, int32_t times) { int32_t rows = taos_stmt_affected_rows(stmt); int32_t insertNum = gCurCase->rowNum * gCurCase->tblNum * times; + if (gCurCase->duplicateValue) { + insertNum /= 2; + } if (insertNum != rows) { printf("!!!affected rows %d mis-match with insert num %d\n", rows, insertNum); exit(1); @@ -2014,6 +2034,65 @@ int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos) { return 0; } +/* normal table [prepare [bind add exec]] */ +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos) { + int32_t loop = 0; + + while (gCurCase->bindColNum > 0) { + BindData data = {0}; + data.singleTbInsert = true; + prepareInsertData(&data); + + int32_t bindTimes = gCurCase->rowNum/gCurCase->bindRowNum; + for (int32_t t = 0; t< gCurCase->tblNum; ++t) { + data.singleTbIdx = t; + generateInsertSQL(&data); + + int code = taos_stmt_prepare(stmt, data.sql, 0); + if (code != 0){ + printf("!!!failed to execute taos_stmt_prepare. error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + + for (int32_t b = 0; b bindColNum + b*gCurCase->bindColNum)) { + exit(1); + } + + if (taos_stmt_add_batch(stmt)) { + printf("!!!taos_stmt_add_batch error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + + if (taos_stmt_execute(stmt) != 0) { + printf("!!!taos_stmt_execute error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + } + } + + bpCheckIsInsert(stmt, 1); + + destroyData(&data); + + gCurCase->bindColNum -= 2; + gCurCase->fullCol = false; + loop++; + } + + bpCheckAffectedRows(stmt, loop); + + gExecLoopTimes = loop; + + return 0; +} + /* select * from table */ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos) { @@ -2160,7 +2239,7 @@ void prepareCheckResult(TAOS *taos, bool silent) { sprintf(buf, "%s%d", bpTbPrefix, 0); } - prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->rowNum * gExecLoopTimes, silent); + prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->duplicateValue ? (gCurCase->rowNum * gExecLoopTimes / 2) : (gCurCase->rowNum * gExecLoopTimes), silent); } gExecLoopTimes = 1; @@ -2749,6 +2828,7 @@ void runAll(TAOS *taos) { printf("%s Begin\n", gCaseCtrl.caseCatalog); runCaseList(taos); +#if 0 strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); gCaseCtrl.precision = TIME_PRECISION_MICRO; @@ -2805,6 +2885,8 @@ void runAll(TAOS *taos) { runCaseList(taos); gCaseCtrl.bindColNum = 0; +#endif + /* strcpy(gCaseCtrl.caseCatalog, "Bind Col Type Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); diff --git a/tests/script/coverage_test.sh b/tests/script/coverage_test.sh index 3983f533da..b395047a1c 100755 --- a/tests/script/coverage_test.sh +++ b/tests/script/coverage_test.sh @@ -122,6 +122,9 @@ function runSimCases() { function runPythonCases() { echo "=== Run python cases ===" + + cd $TDENGINE_DIR/tests/parallel_test + sed -i '/compatibility.py/d' cases.task cd $TDENGINE_DIR/tests/system-test runCasesOneByOne ../parallel_test/cases.task system-test diff --git a/tests/script/tsim/db/alter_replica_13.sim b/tests/script/tsim/db/alter_replica_13.sim index 4eafb86198..d75acb50ad 100644 --- a/tests/script/tsim/db/alter_replica_13.sim +++ b/tests/script/tsim/db/alter_replica_13.sim @@ -116,6 +116,25 @@ endi print ============= step4: alter database sql alter database db replica 3 +$wt = 0 +stepwt1: + $wt = $wt + 1 + sleep 1000 + if $wt == 200 then + print ====> dnode not ready! + return -1 + endi +sql show transactions +if $rows != 0 then + print wait 1 seconds to alter + goto stepwt1 +endi + +sql show db.vgroups +print ---> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data27 $data28 $data29 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data26 $data37 $data38 $data39 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data36 $data47 $data48 $data49 $leaderIndex = 0 diff --git a/tests/script/tsim/db/alter_replica_31.sim b/tests/script/tsim/db/alter_replica_31.sim index 47e1fda79f..74e8007791 100644 --- a/tests/script/tsim/db/alter_replica_31.sim +++ b/tests/script/tsim/db/alter_replica_31.sim @@ -148,6 +148,26 @@ endi print ============= step3: alter database sql alter database db replica 1 +$wt = 0 + stepwt1: + $wt = $wt + 1 + sleep 1000 + if $wt == 200 then + print ====> dnode not ready! + return -1 + endi +sql show transactions +if $rows != 0 then + print wait 1 seconds to alter + goto stepwt1 +endi + +sql show db.vgroups +print ---> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data27 $data28 $data29 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data26 $data37 $data38 $data39 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data36 $data47 $data48 $data49 + $hasleader = 0 $x = 0 diff --git a/tests/script/tsim/dnode/balance2.sim b/tests/script/tsim/dnode/balance2.sim index f677d3925c..3f5a42d4d3 100644 --- a/tests/script/tsim/dnode/balance2.sim +++ b/tests/script/tsim/dnode/balance2.sim @@ -4,11 +4,11 @@ system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 system sh/deploy.sh -n dnode5 -i 5 -system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode5 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode5 -c supportVnodes -v 5 print ========== step1 system sh/exec.sh -n dnode1 -s start diff --git a/tests/script/tsim/stream/session1.sim b/tests/script/tsim/stream/session1.sim index ee6eefde26..f535fd619f 100644 --- a/tests/script/tsim/stream/session1.sim +++ b/tests/script/tsim/stream/session1.sim @@ -197,4 +197,98 @@ if $data01 != 1 then return -1 endi +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1 from t1 where a > 5 session(ts, 5s); +sql insert into t1 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 +loop13: +sleep 200 + +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 0 then + print =====rows=$rows + goto loop13 +endi + +sql insert into t1 values(1648791213000,6,2,3,1.0); + +$loop_count = 0 +loop14: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop14 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); + +$loop_count = 0 +loop15: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 0 then + print =====rows=$rows + goto loop15 +endi + + +sql insert into t1 values(1648791223000,2,2,3,1.0); +sql insert into t1 values(1648791223000,10,2,3,1.0); +sql insert into t1 values(1648791233000,10,2,3,1.0); + +$loop_count = 0 +loop16: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows + goto loop16 +endi + +sql insert into t1 values(1648791233000,2,2,3,1.0); + +$loop_count = 0 +loop17: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/sliding.sim b/tests/script/tsim/stream/sliding.sim index 49e22db1b1..c9a1ddd922 100644 --- a/tests/script/tsim/stream/sliding.sim +++ b/tests/script/tsim/stream/sliding.sim @@ -461,7 +461,7 @@ sql insert into t2 values(1648791213004,4,10,10,4.1); $loop_count = 0 loop2: -sleep 100 +sleep 200 $loop_count = $loop_count + 1 if $loop_count == 10 then @@ -519,7 +519,7 @@ print step 6 $loop_count = 0 loop3: -# sleep 300 +sleep 300 $loop_count = $loop_count + 1 if $loop_count == 10 then @@ -618,6 +618,60 @@ if $data41 != 2 then goto loop4 endi +sql insert into t1 values(1648791343003,4,4,4,3.1); +sql insert into t1 values(1648791213004,4,5,5,4.1); + +loop5: +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt3; + +# row 0 +if $rows != 7 then + print =====rows=$rows + goto loop5 +endi + +if $data01 != 4 then + print =====data01=$data01 + goto loop5 +endi + +if $data11 != 6 then + print =====data11=$data11 + goto loop5 +endi + +if $data21 != 4 then + print =====data21=$data21 + goto loop5 +endi + +if $data31 != 4 then + print =====data31=$data31 + goto loop5 +endi + +if $data41 != 2 then + print =====data41=$data41 + goto loop5 +endi + +if $data51 != 1 then + print =====data51=$data51 + goto loop5 +endi + +if $data61 != 1 then + print =====data61=$data61 + goto loop5 +endi + $loop_all = $loop_all + 1 print ============loop_all=$loop_all diff --git a/tests/script/tsim/stream/state0.sim b/tests/script/tsim/stream/state0.sim index 7c922658c9..ea7528b1cb 100644 --- a/tests/script/tsim/stream/state0.sim +++ b/tests/script/tsim/stream/state0.sim @@ -552,7 +552,7 @@ sql use test4; sql create table st (ts timestamp, c1 tinyint, c2 smallint) tags (t1 tinyint) ; sql create table t1 using st tags (-81) ; sql create table t2 using st tags (-81) ; -sql create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS start, min(c1),count(c1) from t1 state_window(c1); +sql create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1); sql insert into t1 (ts, c1) values (1668073288209, 11); sql insert into t1 (ts, c1) values (1668073288210, 11); @@ -567,7 +567,7 @@ loop7: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -606,7 +606,7 @@ loop8: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -640,7 +640,7 @@ loop8: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -679,7 +679,7 @@ loop9: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim index 79e3754c2f..b708fdab64 100644 --- a/tests/script/tsim/user/privilege_db.sim +++ b/tests/script/tsim/user/privilege_db.sim @@ -6,8 +6,8 @@ sql connect print =============== create db sql create database d1 vgroups 1; sql use d1 -sql create table stb (ts timestamp, i int) tags (j int) -sql create topic topic_1 as select ts, i from stb +sql create table d1_stb (ts timestamp, i int) tags (j int) +sql create topic d1_topic_1 as select ts, i from d1_stb sql create database d2 vgroups 1; sql create database d3 vgroups 1; @@ -72,7 +72,6 @@ sql REVOKE read,write ON d1.* from user1; sql REVOKE read,write ON d2.* from user1; sql REVOKE read,write ON *.* from user1; - print =============== create users sql create user u1 PASS 'taosdata' sql select * from information_schema.ins_users @@ -92,7 +91,17 @@ sql_error drop database d1; sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) -sql create stable d2.st (ts timestamp, i int) tags (j int) -sql_error create topic topic_2 as select ts, i from stb +sql use d2 +sql create table d2_stb (ts timestamp, i int) tags (j int) + +# Insufficient privilege for operation +sql_error create topic d2_topic_1 as select ts, i from d2_stb + +sql use d1 +# Insufficient privilege for operation +sql_error drop topic d1_topic_1 +sql create topic d1_topic_2 as select ts, i from d1_stb + +sql drop topic d1_topic_2 system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/user/privilege_topic.sim b/tests/script/tsim/user/privilege_topic.sim new file mode 100644 index 0000000000..9ce5bebec3 --- /dev/null +++ b/tests/script/tsim/user/privilege_topic.sim @@ -0,0 +1,156 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print =============== create db +sql create database root_d1 vgroups 1; +sql create database root_d2 vgroups 1; +sql create database root_d3 vgroups 1; + +sql show user privileges +if $rows != 1 then + return -1 +endi +if $data(root)[1] != all then + return -1 +endi +if $data(root)[2] != all then + return -1 +endi + +print =============== create users +sql create user user1 PASS 'taosdata' +sql create user user2 PASS 'taosdata' +sql create user user3 PASS 'taosdata' +sql create user user4 PASS 'taosdata' +sql create user user5 PASS 'taosdata' +sql create user user6 PASS 'taosdata' +sql alter user user1 sysinfo 0 + +sql select * from information_schema.ins_users +if $rows != 7 then + return -1 +endi + +sql GRANT read ON root_d1.* to user1; +sql GRANT write ON root_d2.* to user2; +sql GRANT read ON root_d3.* to user3; +sql GRANT write ON root_d3.* to user3; + +sql show user privileges +if $rows != 5 then + return -1 +endi +if $data(user1)[1] != read then + return -1 +endi +if $data(user1)[2] != root_d1 then + return -1 +endi +if $data(user2)[1] != write then + return -1 +endi +if $data(user2)[2] != root_d2 then + return -1 +endi + +print =============== create topis +sql use root_d1 +sql create table root_d1_stb (ts timestamp, i int) tags (j int) +sql create topic root_d1_topic1 as select ts, i from root_d1_stb +sql create topic root_d1_topic2 as select ts, i from root_d1_stb +sql create topic root_d1_topic3 as select ts, i from root_d1_stb +sql create topic root_d1_topic4 as select ts, i from root_d1_stb + +sql show user privileges +if $rows != 5 then + return -1 +endi + +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi +if $data(user6)[1] != subscribe then + return -1 +endi +if $data(user6)[2] != root_d1_topic3 then + return -1 +endi + +sql REVOKE subscribe ON root_d1_topic3 from user6 +sql show user privileges +if $rows != 7 then + return -1 +endi +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi + +print =============== repeat revoke/grant or invalid revoke/grant +sql GRANT subscribe ON root_d1_topic1 to user4 +sql GRANT subscribe ON root_d1_topic2 to user4 +sql GRANT subscribe ON root_d1_topic3 to user4 +sql GRANT subscribe ON root_d1_topic1 to user5 +sql GRANT subscribe ON root_d1_topic2 to user5 +sql GRANT subscribe ON root_d1_topic3 to user5 +sql GRANT subscribe ON root_d1_topic1 to user6 +sql GRANT subscribe ON root_d1_topic2 to user6 +sql GRANT subscribe ON root_d1_topic3 to user6 +sql REVOKE subscribe ON root_d1_topic1 from user4 +sql REVOKE subscribe ON root_d1_topic2 from user4 +sql REVOKE subscribe ON root_d1_topic3 from user4 +sql REVOKE subscribe ON root_d1_topic1 from user5 +sql REVOKE subscribe ON root_d1_topic2 from user5 +sql REVOKE subscribe ON root_d1_topic3 from user5 +sql REVOKE subscribe ON root_d1_topic1 from user6 +sql REVOKE subscribe ON root_d1_topic2 from user6 +sql REVOKE subscribe ON root_d1_topic3 from user6 + +print =============== invalid revoke/grant +sql_error GRANT subscribe ON root_d1_topicx from user5 +sql_error REVOKE subscribe ON root_d1_topicx from user5 + +print =============== check +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +print =============== re connect +print user u1 login +sql close +sql connect user1 + +sql_error show user privileges + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/vnode/replica3_repeat.sim b/tests/script/tsim/vnode/replica3_repeat.sim index 8efba515ae..10e18d01d0 100644 --- a/tests/script/tsim/vnode/replica3_repeat.sim +++ b/tests/script/tsim/vnode/replica3_repeat.sim @@ -85,6 +85,7 @@ print ======== step3 system sh/exec.sh -n dnode2 -s stop sleep 3000 +$t = 0 $x = 0 loop: @@ -126,8 +127,8 @@ print ======== step8 $lastRows = $data00 print ======== loop Times $x -if $x < 2 then - $x = $x + 1 +if $t < 2 then + $t = $t + 1 goto loop endi @@ -138,4 +139,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT system sh/exec.sh -n dnode5 -s stop -x SIGINT system sh/exec.sh -n dnode6 -s stop -x SIGINT system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/tsim/vnode/stable_balance_replica1.sim b/tests/script/tsim/vnode/stable_balance_replica1.sim index f124979397..84190a3be0 100644 --- a/tests/script/tsim/vnode/stable_balance_replica1.sim +++ b/tests/script/tsim/vnode/stable_balance_replica1.sim @@ -3,10 +3,10 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 -system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 5 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 5 $dbPrefix = br1_db $tbPrefix = br1_tb diff --git a/tests/system-test/0-others/taosdShell.py b/tests/system-test/0-others/taosdShell.py index 7ad7e4d0ef..2125b5eebe 100644 --- a/tests/system-test/0-others/taosdShell.py +++ b/tests/system-test/0-others/taosdShell.py @@ -136,7 +136,7 @@ class TDTestCase: tdSql.query("use source_db") tdSql.query("create table if not exists source_db.stb (ts timestamp, k int) tags (a int);") tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);") - tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS start, min(k), max(k), sum(k) from source_db.stb interval(10m);") + tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS startts, min(k), max(k), sum(k) from source_db.stb interval(10m);") #TD-19944 -Q=3 diff --git a/tests/system-test/1-insert/database_pre_suf.py b/tests/system-test/1-insert/database_pre_suf.py index 862edbdde9..488dfebff5 100755 --- a/tests/system-test/1-insert/database_pre_suf.py +++ b/tests/system-test/1-insert/database_pre_suf.py @@ -108,7 +108,7 @@ class TDTestCase: # create stream - tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''') + tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''') # insert data for i in range(num_random*n): @@ -187,20 +187,20 @@ class TDTestCase: sleep(5) # stream data check - tdSql.query("select start,wend,max_int from stream_max_stable_1 ;") + tdSql.query("select startts,wend,max_int from stream_max_stable_1 ;") tdSql.checkRows(20) tdSql.query("select sum(max_int) from stream_max_stable_1 ;") stream_data_1 = tdSql.queryResult[0][0] tdSql.query("select sum(min_int) from stream_max_stable_1 ;") stream_data_2 = tdSql.queryResult[0][0] - tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));") + tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));") sql_data_1 = tdSql.queryResult[0][0] sql_data_2 = tdSql.queryResult[0][1] self.stream_value_check(stream_data_1,sql_data_1) self.stream_value_check(stream_data_2,sql_data_2) - tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));") + tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));") sql_data_1 = tdSql.queryResult[0][0] sql_data_2 = tdSql.queryResult[0][1] diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c index 94bb909e29..ebcd6b9002 100644 --- a/tools/shell/src/shellWebsocket.c +++ b/tools/shell/src/shellWebsocket.c @@ -223,11 +223,14 @@ void shellRunSingleCommandWebsocketImp(char *command) { if (code == TSDB_CODE_WS_SEND_TIMEOUT || code == TSDB_CODE_WS_RECV_TIMEOUT) { fprintf(stderr, "Hint: use -t to increase the timeout in seconds\n"); } else if (code == TSDB_CODE_WS_INTERNAL_ERRO || code == TSDB_CODE_WS_CLOSED) { - fprintf(stderr, "TDengine server is down, will try to reconnect\n"); shell.ws_conn = NULL; } ws_free_result(res); - if (reconnectNum == 0) continue; + if (reconnectNum == 0) { + continue; + } else { + fprintf(stderr, "TDengine server is disconnected, will try to reconnect\n"); + } return; } break; diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 47b7adbf18..df416b3822 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -20,6 +20,7 @@ #include #include "taos.h" #include "types.h" +#include "tlog.h" int smlProcess_influx_Test() { TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);