diff --git a/README.md b/README.md
index 3b7e978a17acf51f4d204720eb45e14c56c77cfa..5d4bb309a439ec69fb8e8bc698b57782431050a9 100644
--- a/README.md
+++ b/README.md
@@ -365,6 +365,6 @@ Please follow the [contribution guidelines](CONTRIBUTING.md) to contribute to th
For more information about TDengine, you can follow us on social media and join our Discord server:
- [Discord](https://discord.com/invite/VZdSuUg4pS)
-- [Twitter](https://twitter.com/TaosData)
+- [Twitter](https://twitter.com/TDengineDB)
- [LinkedIn](https://www.linkedin.com/company/tdengine/)
-- [YouTube](https://www.youtube.com/channel/UCmp-1U6GS_3V3hjir6Uq5DQ)
+- [YouTube](https://www.youtube.com/@tdengine)
diff --git a/cmake/cmake.define b/cmake/cmake.define
index 10f217254152db82518099560ef902b2ebabf499..5b65738c700bd7fa862da6284881ada17f245302 100644
--- a/cmake/cmake.define
+++ b/cmake/cmake.define
@@ -121,7 +121,7 @@ ELSE ()
MESSAGE(STATUS "Compile with Address Sanitizer!")
ELSE ()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-reserved-user-defined-literal -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
ENDIF ()
# disable all assert
diff --git a/cmake/cmake.version b/cmake/cmake.version
index 42de285c8eefb58f61ac4fc77fe9fd309ca4d926..5150ee3b75e2ac429961850995d06b5b2fd40cc9 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.3.1")
+ SET(TD_VER_NUMBER "3.0.3.2")
ENDIF ()
IF (DEFINED VERCOMPATIBLE)
diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in
index 2de3881dd289ebf247aa0b70d514b97527af039a..b427177e5b812a149aa306e870dcd0c033da41a2 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 273a3fe
+ GIT_TAG 63635fc
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
diff --git a/docs/doxgen/vnode_write.md b/docs/doxgen/vnode_write.md
index 7b8dbd6535587d9fdf204d92fa63c6298038df8a..0f1150a33113e26bbd60ef5462eb603074710c0f 100644
--- a/docs/doxgen/vnode_write.md
+++ b/docs/doxgen/vnode_write.md
@@ -204,7 +204,7 @@ group vnodeProcessReqs()
s -> s:
note right
save the requests in log store
- and wait for comfirmation or
+ and wait for confirmation or
other cases
end note
@@ -236,7 +236,7 @@ s -> s: syncAppendReqToLogStore()
s -> v: walWrite()
alt has meta req
- <- s: comfirmation
+ <- s: confirmation
else
s -> v: vnodeApplyReqs()
end
diff --git a/docs/en/02-intro/index.md b/docs/en/02-intro/index.md
index 95dd4324f145800c139272381d2a07a40a2b5ce9..79d170eeb9abd42f13a5625fc807c11d03a7c598 100644
--- a/docs/en/02-intro/index.md
+++ b/docs/en/02-intro/index.md
@@ -123,11 +123,11 @@ As a high-performance, scalable and SQL supported time-series database, TDengine
## Comparison with other databases
-- [Writing Performance Comparison of TDengine and InfluxDB ](https://tdengine.com/2022/02/23/4975.html)
-- [Query Performance Comparison of TDengine and InfluxDB](https://tdengine.com/2022/02/24/5120.html)
-- [TDengine vs OpenTSDB](https://tdengine.com/2019/09/12/710.html)
-- [TDengine vs Cassandra](https://tdengine.com/2019/09/12/708.html)
-- [TDengine vs InfluxDB](https://tdengine.com/2019/09/12/706.html)
+- [Writing Performance Comparison of TDengine and InfluxDB ](https://tdengine.com/performance-comparison-of-tdengine-and-influxdb/)
+- [Query Performance Comparison of TDengine and InfluxDB](https://tdengine.com/query-performance-comparison-test-report-tdengine-vs-influxdb/)
+- [TDengine vs OpenTSDB](https://tdengine.com/performance-tdengine-vs-opentsdb/)
+- [TDengine vs Cassandra](https://tdengine.com/performance-tdengine-vs-cassandra/)
+- [TDengine vs InfluxDB](https://tdengine.com/performance-tdengine-vs-influxdb/)
## More readings
- [Introduction to Time-Series Database](https://tdengine.com/tsdb/)
diff --git a/docs/en/05-get-started/03-package.md b/docs/en/05-get-started/03-package.md
index a0c1d939831395da596ecf15247c46b5a5188a14..3282f600ac81fd6a4cc45fb8c09e3c036570cc18 100644
--- a/docs/en/05-get-started/03-package.md
+++ b/docs/en/05-get-started/03-package.md
@@ -188,7 +188,7 @@ You can use the TDengine CLI to monitor your TDengine deployment and execute ad
-After the installation is complete, run `C:\TDengine\taosd.exe` to start TDengine Server.
+After the installation is complete, please run `sc start taosd` or run `C:\TDengine\taosd.exe` with administrator privilege to start TDengine Server.
## Command Line Interface (CLI)
@@ -202,16 +202,18 @@ After the installation is complete, double-click the /applications/TDengine to s
The following `launchctl` commands can help you manage TDengine service:
-- Start TDengine Server: `launchctl start com.tdengine.taosd`
+- Start TDengine Server: `sudo launchctl start com.tdengine.taosd`
-- Stop TDengine Server: `launchctl stop com.tdengine.taosd`
+- Stop TDengine Server: `sudo launchctl stop com.tdengine.taosd`
-- Check TDengine Server status: `launchctl list | grep taosd`
+- Check TDengine Server status: `sudo launchctl list | grep taosd`
:::info
-
-- The `launchctl` command does not require _root_ privileges. You don't need to use the `sudo` command.
-- The first content returned by the `launchctl list | grep taosd` command is the PID of the program, if '-' indicates that the TDengine service is not running.
+- Please use `sudo` to run `launchctl` to manage _com.tdengine.taosd_ with administrator privileges.
+- The administrator privilege is required for service management to enhance security.
+- Troubleshooting:
+- The first column returned by the command `launchctl list | grep taosd` is the PID of the program. If it's `-`, that means the TDengine service is not running.
+- If the service is abnormal, please check the `launchd.log` file from the system log or the `taosdlog` from the `/var/log/taos directory` for more information.
:::
diff --git a/docs/en/07-develop/03-insert-data/60-high-volume.md b/docs/en/07-develop/03-insert-data/60-high-volume.md
index d5afa8ef6ec120fa73854f5ca170504d7dd69b39..d6a00481383035c0babc6fab94e8359b4806ff72 100644
--- a/docs/en/07-develop/03-insert-data/60-high-volume.md
+++ b/docs/en/07-develop/03-insert-data/60-high-volume.md
@@ -28,7 +28,7 @@ From the perspective of application program, you need to consider:
- Writing to known existing tables is more efficient than writing to uncertain tables in automatic creating mode because the later needs to check whether the table exists or not before actually writing data into it.
- Writing in SQL is more efficient than writing in schemaless mode because schemaless writing creates table automatically and may alter table schema.
-Application programs need to take care of the above factors and try to take advantage of them. The application progam should write to single table in each write batch. The batch size needs to be tuned to a proper value on a specific system. The number of concurrent connections needs to be tuned to a proper value too to achieve the best writing throughput.
+Application programs need to take care of the above factors and try to take advantage of them. The application program should write to single table in each write batch. The batch size needs to be tuned to a proper value on a specific system. The number of concurrent connections needs to be tuned to a proper value too to achieve the best writing throughput.
### Data Source
diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx
index dc0f07d3d518eb1501a5fb3b21d8b4479d59c9e4..7465cc0a12ecc9c92a48a2308fe101d057f80492 100644
--- a/docs/en/07-develop/07-tmq.mdx
+++ b/docs/en/07-develop/07-tmq.mdx
@@ -7,6 +7,7 @@ title: Data Subscription
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Java from "./_sub_java.mdx";
+import JavaWS from "./_sub_java_ws.mdx"
import Python from "./_sub_python.mdx";
import Go from "./_sub_go.mdx";
import Rust from "./_sub_rust.mdx";
@@ -22,7 +23,7 @@ By subscribing to a topic, a consumer can obtain the latest data in that topic i
To implement these features, TDengine indexes its write-ahead log (WAL) file for fast random access and provides configurable methods for replacing and retaining this file. You can define a retention period and size for this file. For information, see the CREATE DATABASE statement. In this way, the WAL file is transformed into a persistent storage engine that remembers the order in which events occur. However, note that configuring an overly long retention period for your WAL files makes database compression inefficient. TDengine then uses the WAL file instead of the time-series database as its storage engine for queries in the form of topics. TDengine reads the data from the WAL file; uses a unified query engine instance to perform filtering, transformations, and other operations; and finally pushes the data to consumers.
-
+Tips:The default data subscription is to consume data from the wal. If the wal is deleted, the consumed data will be incomplete. At this time, you can set the parameter experimental.snapshot.enable to true to obtain all data from the tsdb, but in this way, the consumption order of the data cannot be guaranteed. Therefore, it is recommended to set a reasonable retention policy for WAL based on your consumption situation to ensure that you can subscribe all data from WAL.
## Data Schema and API
@@ -284,17 +285,17 @@ You configure the following parameters when creating a consumer:
| Parameter | Type | Description | Remarks |
| :----------------------------: | :-----: | -------------------------------------------------------- | ------------------------------------------- |
-| `td.connect.ip` | string | Used in establishing a connection; same as `taos_connect` | |
-| `td.connect.user` | string | Used in establishing a connection; same as `taos_connect` | |
-| `td.connect.pass` | string | Used in establishing a connection; same as `taos_connect` | |
-| `td.connect.port` | string | Used in establishing a connection; same as `taos_connect` | |
+| `td.connect.ip` | string | Used in establishing a connection; same as `taos_connect` | Only valid for establishing native connection |
+| `td.connect.user` | string | Used in establishing a connection; same as `taos_connect` | Only valid for establishing native connection |
+| `td.connect.pass` | string | Used in establishing a connection; same as `taos_connect` | Only valid for establishing native connection |
+| `td.connect.port` | string | Used in establishing a connection; same as `taos_connect` | Only valid for establishing native connection |
| `group.id` | string | Consumer group ID; consumers with the same ID are in the same group | **Required**. Maximum length: 192. |
| `client.id` | string | Client ID | Maximum length: 192. |
| `auto.offset.reset` | enum | Initial offset for the consumer group | Specify `earliest`, `latest`, or `none`(default) |
-| `enable.auto.commit` | boolean | Commit automatically | Specify `true` or `false`. |
+| `enable.auto.commit` | boolean | Commit automatically; true: user application doesn't need to explicitly commit; false: user application need to handle commit by itself | Default value is true |
| `auto.commit.interval.ms` | integer | Interval for automatic commits, in milliseconds |
-| `experimental.snapshot.enable` | boolean | Specify whether to consume messages from the WAL or from TSBS | |
-| `msg.with.table.name` | boolean | Specify whether to deserialize table names from messages |
+| `experimental.snapshot.enable` | boolean | Specify whether to consume data in TSDB; true: both data in WAL and in TSDB can be consumed; false: only data in WAL can be consumed | default value: false |
+| `msg.with.table.name` | boolean | Specify whether to deserialize table names from messages | default value: false
The method of specifying these parameters depends on the language used:
@@ -415,7 +416,8 @@ Python programs use the following parameters:
| `enable.auto.commit` | string | Commit automatically | pecify `true` or `false` |
| `auto.commit.interval.ms` | string | Interval for automatic commits, in milliseconds | |
| `auto.offset.reset` | string | Initial offset for the consumer group | Specify `earliest`, `latest`, or `none`(default) |
-| `experimental.snapshot.enable` | string | Specify whether to consume messages from the WAL or from TSDB | Specify `true` or `false` |
+| `experimental.snapshot.enable` | string | Specify whether it's allowed to consume messages from the WAL or from TSDB | Specify `true` or `false` |
+| `enable.heartbeat.background` | string | Backend heartbeat; if enabled, the consumer does not go offline even if it has not polled for a long time | Specify `true` or `false` |
@@ -804,7 +806,14 @@ The following section shows sample code in various languages.
-
+
+
+
+
+
+
+
+
diff --git a/docs/en/07-develop/09-udf.md b/docs/en/07-develop/09-udf.md
index 553a7b932b013a1f4d2b5e4e291f71c28b64039f..dc42743b51778593e40993e8da1dd1e6c3c8a122 100644
--- a/docs/en/07-develop/09-udf.md
+++ b/docs/en/07-develop/09-udf.md
@@ -65,11 +65,11 @@ int32_t aggfn_init() {
}
// aggregate start function. The intermediate value or the state(@interBuf) is initialized in this function. The function name shall be concatenation of udf name and _start suffix
-// @param interbuf intermediate value to intialize
+// @param interbuf intermediate value to initialize
// @return error number defined in taoserror.h
int32_t aggfn_start(SUdfInterBuf* interBuf) {
// initialize intermediate value in interBuf
- return TSDB_CODE_SUCESS;
+ return TSDB_CODE_SUCCESS;
}
// aggregate reduce function. This function aggregate old state(@interbuf) and one data bock(inputBlock) and output a new state(@newInterBuf).
diff --git a/docs/en/07-develop/_sub_java.mdx b/docs/en/07-develop/_sub_java.mdx
index 965161651c188bedc01c58a11d127035e11b885d..c0e9e6c9371123c737e40d7a5f9a6736e8edf44e 100644
--- a/docs/en/07-develop/_sub_java.mdx
+++ b/docs/en/07-develop/_sub_java.mdx
@@ -1,31 +1,9 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-
-
-
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java}}
- ```
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
- ```
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
- ```
-
-
-
-
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java}}
- ```
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
- ```
- ```java
- {{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
- ```
-
-
-
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
+```
diff --git a/docs/en/07-develop/_sub_java_ws.mdx b/docs/en/07-develop/_sub_java_ws.mdx
new file mode 100644
index 0000000000000000000000000000000000000000..2a48713358fdb5d018e62bb17215521dbc5a491a
--- /dev/null
+++ b/docs/en/07-develop/_sub_java_ws.mdx
@@ -0,0 +1,9 @@
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
+```
diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md
index a1c46875aa59b7ce6eb099d4c13a20a1a68e560b..ec007d68302f719ec09b1b13f58a1a6bddb2748c 100644
--- a/docs/en/12-taos-sql/02-database.md
+++ b/docs/en/12-taos-sql/02-database.md
@@ -35,8 +35,8 @@ database_option: {
| TABLE_SUFFIX value
| TSDB_PAGESIZE value
| WAL_RETENTION_PERIOD value
- | WAL_ROLL_PERIOD value
| WAL_RETENTION_SIZE value
+ | WAL_ROLL_PERIOD value
| WAL_SEGMENT_SIZE value
}
```
@@ -75,11 +75,10 @@ database_option: {
- TABLE_PREFIX:The prefix length in the table name that is ignored when distributing table to vnode based on table name.
- TABLE_SUFFIX:The suffix length in the table name that is ignored when distributing table to vnode based on table name.
- TSDB_PAGESIZE: The page size of the data storage engine in a vnode. The unit is KB. The default is 4 KB. The range is 1 to 16384, that is, 1 KB to 16 MB.
-- WAL_RETENTION_PERIOD: specifies the maximum time of which WAL files are to be kept after consumption. This parameter is used for data subscription. Enter a time in seconds. The default value 0. A value of 0 indicates that WAL files are not required to keep after consumption. -1: the time of WAL files to keep has no upper limit.
-- WAL_RETENTION_SIZE: specifies the maximum total size of which WAL files are to be kept after consumption. This parameter is used for data subscription. Enter a size in KB. The default value is 0. A value of 0 indicates that WAL files are not required to keep after consumption. -1: the total size of WAL files to keep has no upper limit.
+- WAL_RETENTION_PERIOD: specifies the maximum time of which WAL files are to be kept for consumption. This parameter is used for data subscription. Enter a time in seconds. The default value 0. A value of 0 indicates that WAL files are not required to keep for consumption. Alter it with a proper value at first to create topics.
+- WAL_RETENTION_SIZE: specifies the maximum total size of which WAL files are to be kept for consumption. This parameter is used for data subscription. Enter a size in KB. The default value is 0. A value of 0 indicates that the total size of WAL files to keep for consumption has no upper limit.
- WAL_ROLL_PERIOD: specifies the time after which WAL files are rotated. After this period elapses, a new WAL file is created. The default value is 0. A value of 0 indicates that a new WAL file is created only after TSDB data in memory are flushed to disk.
- WAL_SEGMENT_SIZE: specifies the maximum size of a WAL file. After the current WAL file reaches this size, a new WAL file is created. The default value is 0. A value of 0 indicates that a new WAL file is created only after TSDB data in memory are flushed to disk.
-
### Example Statement
```sql
@@ -123,6 +122,8 @@ alter_database_option: {
| WAL_LEVEL value
| WAL_FSYNC_PERIOD value
| KEEP value
+ | WAL_RETENTION_PERIOD value
+ | WAL_RETENTION_SIZE value
}
```
@@ -179,6 +180,14 @@ TRIM DATABASE db_name;
The preceding SQL statement deletes data that has expired and orders the remaining data in accordance with the storage configuration.
+## Flush Data
+
+```sql
+FLUSH DATABASE db_name;
+```
+
+Flush data from memory onto disk. Before shutting down a node, executing this command can avoid data restore after restarting and speed up the startup process.
+
## Redistribute Vgroup
```sql
diff --git a/docs/en/12-taos-sql/04-stable.md b/docs/en/12-taos-sql/04-stable.md
index 5b316d0d2460b497655e7f29acb897301b5b4769..a1d103eaf04a30214a8c1ef88e43a949710bcdbc 100644
--- a/docs/en/12-taos-sql/04-stable.md
+++ b/docs/en/12-taos-sql/04-stable.md
@@ -13,12 +13,11 @@ create_definition:
col_name column_definition
column_definition:
- type_name [COMMENT 'string_value']
+ type_name
```
**More explanations**
- Each supertable can have a maximum of 4096 columns, including tags. The minimum number of columns is 3: a timestamp column used as the key, one tag column, and one data column.
-- When you create a supertable, you can add comments to columns and tags.
- The TAGS keyword defines the tag columns for the supertable. The following restrictions apply to tag columns:
- A tag column can use the TIMESTAMP data type, but the values in the column must be fixed numbers. Timestamps including formulae, such as "now + 10s", cannot be stored in a tag column.
- The name of a tag column cannot be the same as the name of any other column.
@@ -34,7 +33,7 @@ column_definition:
SHOW STABLES [LIKE tb_name_wildcard];
```
-The preceding SQL statement shows all supertables in the current TDengine database, including the name, creation time, number of columns, number of tags, and number of subtabels for each supertable.
+The preceding SQL statement shows all supertables in the current TDengine database, including the name, creation time, number of columns, number of tags, and number of subtables for each supertable.
### View the CREATE Statement for a Supertable
diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md
index 3099e3a541861ad236135a5bef1255db7d4394b9..de7294f7a9dbc78b854dffa25ffd0e7edd7e7b66 100644
--- a/docs/en/12-taos-sql/06-select.md
+++ b/docs/en/12-taos-sql/06-select.md
@@ -248,13 +248,13 @@ You can also use the NULLS keyword to specify the position of null values. Ascen
The LIMIT keyword controls the number of results that are displayed. You can also use the OFFSET keyword to specify the result to display first. `LIMIT` and `OFFSET` are executed after `ORDER BY` in the query execution. You can include an offset in a LIMIT clause. For example, LIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh results.
-In a statement that includes a PARTITON BY clause, the LIMIT keyword is performed on each partition, not on the entire set of results.
+In a statement that includes a PARTITION BY/GROUP BY clause, the LIMIT keyword is performed on each partition/group, not on the entire set of results.
## SLIMIT
-The SLIMIT keyword is used with a PARTITION BY clause to control the number of partitions that are displayed. You can include an offset in a SLIMIT clause. For example, SLIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh partitions.
+The SLIMIT keyword is used with a PARTITION BY/GROUP BY clause to control the number of partitions/groups that are displayed. You can include an offset in a SLIMIT clause. For example, SLIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh partitions/groups.
-Note: If you include an ORDER BY clause, only one partition can be displayed.
+Note: If you include an ORDER BY clause, only one partition/group can be displayed.
## Special Query
diff --git a/docs/en/12-taos-sql/07-tag-index.md b/docs/en/12-taos-sql/07-tag-index.md
new file mode 100644
index 0000000000000000000000000000000000000000..cb2a61d3e813ad130476f8f3309d30b7e208a009
--- /dev/null
+++ b/docs/en/12-taos-sql/07-tag-index.md
@@ -0,0 +1,51 @@
+---
+sidebar_label: Tag Index
+title: Tag Index
+description: Use Tag Index to Improve Query Performance
+---
+
+## Introduction
+
+Prior to TDengine 3.0.3.0 (excluded),only one index is created by default on the first tag of each super talbe, but it's not allowed to dynamically create index on any other tags. From version 3.0.30, you can dynamically create index on any tag of any type. The index created automatically by TDengine is still valid. Query performance can benefit from indexes if you use properly.
+
+## Syntax
+
+1. The syntax of creating an index
+
+```sql
+CREATE INDEX index_name ON tbl_name (tagColName)
+```
+
+In the above statement, `index_name` if the name of the index, `tbl_name` is the name of the super table,`tagColName` is the name of the tag on which the index is being created. `tagColName` can be any type supported by TDengine.
+
+2. The syntax of drop an index
+
+```sql
+DROP INDEX index_name
+```
+
+In the above statement, `index_name` is the name of an existing index. If the index doesn't exist, the command would fail but doesn't generate any impact to the system.
+
+3. The syntax of show indexes in the system
+
+```sql
+SELECT * FROM information_schema.INS_INDEXES
+```
+
+You can also add filter conditions to limit the results.
+
+## Detailed Specification
+
+1. Indexes can improve query performance significantly if they are used properly. The operators supported by tag index include `=`, `>`, `>=`, `<`, `<=`. If you use these operators with tags, indexes can improve query performance significantly. However, for operators not in this scope, indexes don't help. More and more operators will be added in future.
+
+2. Only one index can be created on each tag, error would be reported if you try to create more than one indexes on same tag.
+
+3. Each time you can create an index on a single tag, you are not allowed to create indexes on multiple tags together.
+
+4. The name of each index must be unique across the whole system, regardless of the type of the index, e.g. tag index or sma index.
+
+5. There is no limit on the number of indexes, but each index may add some burden on the metadata subsystem. So too many indexes may decrease the efficiency of reading or writing metadata and then decrease the system performance. So it's better not to add unnecessary indexes.
+
+6. You can' create index on a normal table or a child table.
+
+7. If the unique values of a tag column are too few, it's better not to create index on such tag columns, the benefit would be very small.
\ No newline at end of file
diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md
index b32d2af5bb0787c748dc84a922700c2db43c1d00..8dfa9c2851c16ac16d43559555e492991b44dd15 100644
--- a/docs/en/12-taos-sql/10-function.md
+++ b/docs/en/12-taos-sql/10-function.md
@@ -666,13 +666,13 @@ If you input a specific column, the number of non-null values in the column is r
ELAPSED(ts_primary_key [, time_unit])
```
-**Description**:`elapsed` function can be used to calculate the continuous time length in which there is valid data. If it's used with `INTERVAL` clause, the returned result is the calcualted time length within each time window. If it's used without `INTERVAL` caluse, the returned result is the calculated time length within the specified time range. Please be noted that the return value of `elapsed` is the number of `time_unit` in the calculated time length.
+**Description**:`elapsed` function can be used to calculate the continuous time length in which there is valid data. If it's used with `INTERVAL` clause, the returned result is the calculated time length within each time window. If it's used without `INTERVAL` caluse, the returned result is the calculated time length within the specified time range. Please be noted that the return value of `elapsed` is the number of `time_unit` in the calculated time length.
**Return value type**: Double if the input value is not NULL;
**Return value type**: TIMESTAMP
-**Applicable tables**: table, STable, outter in nested query
+**Applicable tables**: table, STable, outer in nested query
**Explanations**:
- `ts_primary_key` parameter can only be the first column of a table, i.e. timestamp primary key.
@@ -754,7 +754,7 @@ HYPERLOGLOG(expr)
**Description**:
The cardinal number of a specific column is returned by using hyperloglog algorithm. The benefit of using hyperloglog algorithm is that the memory usage is under control when the data volume is huge.
- However, when the data volume is very small, the result may be not accurate, it's recommented to use `select count(data) from (select unique(col) as data from table)` in this case.
+ However, when the data volume is very small, the result may be not accurate, it's recommended to use `select count(data) from (select unique(col) as data from table)` in this case.
**Return value type**: Integer
@@ -801,7 +801,7 @@ PERCENTILE(expr, p [, p1] ...)
**Description**: The value whose rank in a specific column matches the specified percentage. If such a value matching the specified percentage doesn't exist in the column, an interpolation value will be returned.
-**Return value type**: This function takes 2 minumum and 11 maximum parameters, and it can simultaneously return 10 percentiles at most. If 2 parameters are given, a single percentile is returned and the value type is DOUBLE.
+**Return value type**: This function takes 2 minimum and 11 maximum parameters, and it can simultaneously return 10 percentiles at most. If 2 parameters are given, a single percentile is returned and the value type is DOUBLE.
If more than 2 parameters are given, the return value type is a VARCHAR string, the format of which is a JSON ARRAY containing all return values.
**Applicable column types**: Numeric
@@ -811,7 +811,7 @@ PERCENTILE(expr, p [, p1] ...)
**More explanations**:
- _p_ is in range [0,100], when _p_ is 0, the result is same as using function MIN; when _p_ is 100, the result is same as function MAX.
-- When calculating multiple percentiles of a specific column, a single PERCENTILE function with multiple parameters is adviced, as this can largely reduce the query response time.
+- When calculating multiple percentiles of a specific column, a single PERCENTILE function with multiple parameters is advised, as this can largely reduce the query response time.
For example, using SELECT percentile(col, 90, 95, 99) FROM table will perform better than SELECT percentile(col, 90), percentile(col, 95), percentile(col, 99) from table.
## Selection Functions
@@ -884,6 +884,15 @@ INTERP(expr)
- Pseudocolumn `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.2.0).
- Pseudocolumn `_isfilled` can be used along with `INTERP` to indicate whether the results are original records or data points generated by interpolation algorithm(support after version 3.0.3.0).
+**Example**
+
+- We use the smart meters example used in this documentation to illustrate how to use the INTERP function.
+- We want to downsample every 1 hour and use a linear fill for missing values. Note the order in which the "partition by" clause and the "range", "every" and "fill" parameters are used.
+
+```sql
+SELECT _irowts,INTERP(current) FROM test.meters PARTITION BY TBNAME RANGE('2017-07-22 00:00:00','2017-07-24 12:25:00') EVERY(1h) FILL(LINEAR)
+```
+
### LAST
```sql
diff --git a/docs/en/12-taos-sql/12-distinguished.md b/docs/en/12-taos-sql/12-distinguished.md
index 536fd8ffc3968996b8e31b5a2864fd730a7624a7..01d7065905359dd312346f54293c5cf8d8f04afb 100644
--- a/docs/en/12-taos-sql/12-distinguished.md
+++ b/docs/en/12-taos-sql/12-distinguished.md
@@ -21,7 +21,7 @@ part_list can be any scalar expression, such as a column, constant, scalar funct
A PARTITION BY clause is processed as follows:
- The PARTITION BY clause must occur after the WHERE clause
-- The PARTITION BY caluse partitions the data according to the specified dimentions, then perform computation on each partition. The performed computation is determined by the rest of the statement - a window clause, GROUP BY clause, or SELECT clause.
+- The PARTITION BY caluse partitions the data according to the specified dimensions, then perform computation on each partition. The performed computation is determined by the rest of the statement - a window clause, GROUP BY clause, or SELECT clause.
- The PARTITION BY clause can be used together with a window clause or GROUP BY clause. In this case, the window or GROUP BY clause takes effect on every partition. For example, the following statement partitions the table by the location tag, performs downsampling over a 10 minute window, and returns the maximum value:
```sql
@@ -32,15 +32,15 @@ The most common usage of PARTITION BY is partitioning the data in subtables by t
## Windowed Queries
-Aggregation by time window is supported in TDengine. For example, in the case where temperature sensors report the temperature every seconds, the average temperature for every 10 minutes can be retrieved by performing a query with a time window. Window related clauses are used to divide the data set to be queried into subsets and then aggregation is performed across the subsets. There are three kinds of windows: time window, status window, and session window. There are two kinds of time windows: sliding window and flip time/tumbling window. The query syntax is as follows:
+Aggregation by time window is supported in TDengine. For example, in the case where temperature sensors report the temperature every seconds, the average temperature for every 10 minutes can be retrieved by performing a query with a time window. Window related clauses are used to divide the data set to be queried into subsets and then aggregation is performed across the subsets. There are four kinds of windows: time window, status window, session window, and event window. There are two kinds of time windows: sliding window and flip time/tumbling window. The syntax of window clause is as follows:
```sql
-SELECT select_list FROM tb_name
- [WHERE where_condition]
- [SESSION(ts_col, tol_val)]
- [STATE_WINDOW(col)]
- [INTERVAL(interval [, offset]) [SLIDING sliding]]
- [FILL({NONE | VALUE | PREV | NULL | LINEAR | NEXT})]
+window_clause: {
+ SESSION(ts_col, tol_val)
+ | STATE_WINDOW(col)
+ | INTERVAL(interval [, offset]) [SLIDING sliding] [FILL({NONE | VALUE | PREV | NULL | LINEAR | NEXT})]
+ | EVENT_WINDOW START WITH start_trigger_condition END WITH end_trigger_condition
+}
```
The following restrictions apply:
@@ -75,6 +75,16 @@ These pseudocolumns occur after the aggregation clause.
5. LINEAR:Fill with the closest non-NULL value, `FILL(LINEAR)`
6. NEXT:Fill with the next non-NULL value, `FILL(NEXT)`
+In the above filling modes, except for `NONE` mode, the `fill` clause will be ignored if there is no data in the defined time range, i.e. no data would be filled and the query result would be empty. This behavior is reasonable when the filling mode is `PREV`, `NEXT`, `LINEAR`, because filling can't be performed if there is not any data. For filling modes `NULL` and `VALUE`, however, filling can be performed even though there is not any data, filling or not depends on the choice of user's application. To accomplish the need of this force filling behavior and not break the behavior of existing filling modes, TDengine added two new filling modes since version 3.0.3.0.
+
+1. NULL_F: Fill `NULL` by force
+2. VALUE_F: Fill `VALUE` by force
+
+The detailed beaviors of `NULL`, `NULL_F`, `VALUE`, and VALUE_F are described below:
+- When used with `INTERVAL`: `NULL_F` and `VALUE_F` are filling by force;`NULL` and `VALUE` don't fill by force. The behavior of each filling mode is exactly same as what the name suggests.
+- When used with `INTERVAL` in stream processing: `NULL_F` and `NULL` are same, i.e. don't fill by force; `VALUE_F` and `VALUE` and same, i.e. don't fill by force. It's suggested that there is no filling by force in stream processing.
+- When used with `INTERP`: `NULL` and `NULL_F` and same, i.e. filling by force; `VALUE` and `VALUE_F` are same, i.e. filling by force. It's suggested that there is always filling by force when used with `INTERP`.
+
:::info
1. A huge volume of interpolation output may be returned using `FILL`, so it's recommended to specify the time range when using `FILL`. The maximum number of interpolation values that can be returned in a single query is 10,000,000.
@@ -105,7 +115,7 @@ SELECT COUNT(*) FROM temp_tb_1 INTERVAL(1m) SLIDING(2m);
When using time windows, note the following:
-- The window length for aggregation depends on the value of INTERVAL. The minimum interval is 10 ms. You can configure a window as an offset from UTC 0:00. The offset cannot be smaler than the interval. You can use SLIDING to specify the length of time that the window moves forward.
+- The window length for aggregation depends on the value of INTERVAL. The minimum interval is 10 ms. You can configure a window as an offset from UTC 0:00. The offset cannot be smaller than the interval. You can use SLIDING to specify the length of time that the window moves forward.
Please note that the `timezone` parameter should be configured to be the same value in the `taos.cfg` configuration file on client side and server side.
- The result set is in ascending order of timestamp when you aggregate by time window.
@@ -146,6 +156,26 @@ If the time interval between two continuous rows are within the time interval sp
SELECT COUNT(*), FIRST(ts) FROM temp_tb_1 SESSION(ts, tol_val);
```
+### Event Window
+
+Event window is determined according to the window start condition and the window close condition. The window is started when `start_trigger_condition` is evaluated to true, the window is closed when `end_trigger_condition` is evaluated to true. `start_trigger_condition` and `end_trigger_condition` can be any conditional expressions supported by TDengine and can include multiple columns.
+
+There may be only one row of data in an event window, when a row meets both the `start_trigger_condition` and the `end_trigger_condition`.
+
+The window is treated as invalid or non-existing if the `end_trigger_condition` can't be met. There will be no output in case that a window can't be closed.
+
+If the event window query is performed on a super table, TDengine consolidates all the data of all child tables into a single timeline then perform event window based query.
+
+If you want to perform event window based query on the result set of a sub-query, the result set of the sub-query should be arranged in the order of timestamp and include the column of timestamp.
+
+For example, the diagram below illustrates the event windows generated by the query below:
+
+```sql
+select _wstart, _wend, count(*) from t event_window start with c1 > 0 end with c2 < 10
+```
+
+
+
### Examples
A table of intelligent meters can be created by the SQL statement below:
diff --git a/docs/en/12-taos-sql/17-json.md b/docs/en/12-taos-sql/17-json.md
index b2494e0cc1a1829d0389b2cf634e5d8575817f57..843858c0c76211346278fc078e7d04de5adecd7f 100644
--- a/docs/en/12-taos-sql/17-json.md
+++ b/docs/en/12-taos-sql/17-json.md
@@ -55,7 +55,7 @@ description: This document describes the JSON data type in TDengine.
4. Tag Operations
- The value of a JSON tag can be altered. Please note that the full JSON will be overriden when doing this.
+ The value of a JSON tag can be altered. Please note that the full JSON will be overridden when doing this.
The name of a JSON tag can be altered.
diff --git a/docs/en/12-taos-sql/22-meta.md b/docs/en/12-taos-sql/22-meta.md
index d2bc72f047a7e18c120a39e426caea70fd711018..81284aeaedf89044a4a253e845d70e7fd67f4168 100644
--- a/docs/en/12-taos-sql/22-meta.md
+++ b/docs/en/12-taos-sql/22-meta.md
@@ -179,6 +179,20 @@ Provides information about standard tables and subtables.
| 5 | tag_type | BINARY(64) | Tag type |
| 6 | tag_value | BINARY(16384) | Tag value |
+## INS_COLUMNS
+
+| # | **列名** | **数据类型** | **说明** |
+| --- | :---------: | ------------- | ---------------------- |
+| 1 | table_name | BINARY(192) | Table name |
+| 2 | db_name | BINARY(64) | Database name |
+| 3 | table_type | BINARY(21) | Table type |
+| 4 | col_name | BINARY(64) | Column name |
+| 5 | col_type | BINARY(32) | Column type |
+| 6 | col_length | INT | Column length |
+| 7 | col_precision | INT | Column precision |
+| 8 | col_scale | INT | Column scale |
+| 9 | col_nullable | INT | Column nullable |
+
## INS_USERS
Provides information about TDengine users.
@@ -274,9 +288,9 @@ Provides dnode configuration information.
| 1 | stream_name | BINARY(64) | Stream name |
| 2 | create_time | TIMESTAMP | Creation time |
| 3 | sql | BINARY(1024) | SQL statement used to create the stream |
-| 4 | status | BIANRY(20) | Current status |
+| 4 | status | BINARY(20) | Current status |
| 5 | source_db | BINARY(64) | Source database |
-| 6 | target_db | BIANRY(64) | Target database |
+| 6 | target_db | BINARY(64) | Target database |
| 7 | target_table | BINARY(192) | Target table |
| 8 | watermark | BIGINT | Watermark (see stream processing documentation). It should be noted that `watermark` is a TDengine keyword and needs to be escaped with ` when used as a column name. |
| 9 | trigger | INT | Method of triggering the result push (see stream processing documentation). It should be noted that `trigger` is a TDengine keyword and needs to be escaped with ` when used as a column name. |
diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md
index dc1db956a0db1eead3a6c729e51c140b5be30c37..e2aff7a878893eda03c998d963840ffa046e6405 100644
--- a/docs/en/12-taos-sql/24-show.md
+++ b/docs/en/12-taos-sql/24-show.md
@@ -4,7 +4,7 @@ sidebar_label: SHOW Statement
description: This document describes how to use the SHOW statement in TDengine.
---
-`SHOW` command can be used to get brief system information. To get details about metatadata, information, and status in the system, please use `select` to query the tables in database `INFORMATION_SCHEMA`.
+`SHOW` command can be used to get brief system information. To get details about metadata, information, and status in the system, please use `select` to query the tables in database `INFORMATION_SCHEMA`.
## SHOW APPS
@@ -86,10 +86,10 @@ SHOW FUNCTIONS;
Shows all user-defined functions in the system.
-## SHOW LICENSE
+## SHOW LICENCES
```sql
-SHOW LICENSE;
+SHOW LICENCES;
SHOW GRANTS;
```
@@ -308,9 +308,11 @@ Query OK, 24 row(s) in set (0.002444s)
- The above show the block distribution percentage according to the number of rows in each block. In the above example, we can get below information:
- - `_block_dist: 3483 ||||||||||||||||| 1 (20.00%)` means there is one block whose rows is between 3,483 and 3,681.
- - `_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%)` means there are 4 blocks whose rows is between 3,881 and 4,096. - The number of blocks whose rows fall in other range is zero.
+The above show the block distribution percentage according to the number of rows in each block. In the above example, we can get below information:
+- `_block_dist: 3483 ||||||||||||||||| 1 (20.00%)` means there is one block whose rows is between 3,483 and 3,681.
+- `_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%)` means there are 4 blocks whose rows is between 3,881 and 4,096. - The number of blocks whose rows fall in other range is zero.
+
+Note that only the information about the data blocks in the data file will be displayed here, and the information about the data in the stt file will not be displayed.
## SHOW TAGS
@@ -359,7 +361,7 @@ Shows the working configuration of the parameters that must be the same on each
SHOW [db_name.]VGROUPS;
```
-Shows information about all vgroups in the system or about the vgroups for a specified database.
+Shows information about all vgroups in the current database.
## SHOW VNODES
diff --git a/docs/en/12-taos-sql/29-changes.md b/docs/en/12-taos-sql/29-changes.md
index 341791d6755aa66fddd98561823ee0e5ac74ba3f..a695a2cae18f28e090816ec98a978674a028df30 100644
--- a/docs/en/12-taos-sql/29-changes.md
+++ b/docs/en/12-taos-sql/29-changes.md
@@ -27,7 +27,7 @@ The following data types can be used in the schema for standard tables.
| - | :------- | :-------- | :------- |
| 1 | ALTER ACCOUNT | Deprecated| This Enterprise Edition-only statement has been removed. It returns the error "This statement is no longer supported."
| 2 | ALTER ALL DNODES | Added | Modifies the configuration of all dnodes.
-| 3 | ALTER DATABASE | Modified | DeprecatedQUORUM: Specified the required number of confirmations. STRICT is now used to specify strong or weak consistency. The STRICT parameter cannot be modified. BLOCKS: Specified the memory blocks used by each vnode. BUFFER is now used to specify the size of the write cache pool for each vnode. UPDATE: Specified whether update operations were supported. All databases now support updating data in certain columns. CACHELAST: Specified how to cache the newest row of data. CACHEMODEL now replaces CACHELAST. COMP: Cannot be modified. Added CACHEMODEL: Specifies whether to cache the latest subtable data. CACHESIZE: Specifies the size of the cache for the newest subtable data. WAL_FSYNC_PERIOD: Replaces the FSYNC parameter. WAL_LEVEL: Replaces the WAL parameter. Modified REPLICA: Cannot be modified. KEEP: Now supports units.
+| 3 | ALTER DATABASE | Modified | DeprecatedQUORUM: Specified the required number of confirmations. STRICT is now used to specify strong or weak consistency. The STRICT parameter cannot be modified. BLOCKS: Specified the memory blocks used by each vnode. BUFFER is now used to specify the size of the write cache pool for each vnode. UPDATE: Specified whether update operations were supported. All databases now support updating data in certain columns. CACHELAST: Specified how to cache the newest row of data. CACHEMODEL now replaces CACHELAST. COMP: Cannot be modified. Added CACHEMODEL: Specifies whether to cache the latest subtable data. CACHESIZE: Specifies the size of the cache for the newest subtable data. WAL_FSYNC_PERIOD: Replaces the FSYNC parameter. WAL_LEVEL: Replaces the WAL parameter. WAL_RETENTION_PERIOD: specifies the time after which WAL files are deleted. This parameter is used for data subscription. WAL_RETENTION_SIZE: specifies the size at which WAL files are deleted. This parameter is used for data subscription. Modified REPLICA: Cannot be modified. KEEP: Now supports units.
| 4 | ALTER STABLE | Modified | DeprecatedCHANGE TAG: Modified the name of a tag. Replaced by RENAME TAG. Added RENAME TAG: Replaces CHANGE TAG. COMMENT: Specifies comments for a supertable.
| 5 | ALTER TABLE | Modified | DeprecatedCHANGE TAG: Modified the name of a tag. Replaced by RENAME TAG. Added RENAME TAG: Replaces CHANGE TAG. COMMENT: Specifies comments for a standard table. TTL: Specifies the time-to-live for a standard table.
| 6 | ALTER USER | Modified | DeprecatedPRIVILEGE: Specified user permissions. Replaced by GRANT and REVOKE. Added ENABLE: Enables or disables a user. SYSINFO: Specifies whether a user can query system information.
diff --git a/docs/en/12-taos-sql/event_window.webp b/docs/en/12-taos-sql/event_window.webp
new file mode 100644
index 0000000000000000000000000000000000000000..0a3a344b03194f245aa879b801fa4edb38f85445
Binary files /dev/null and b/docs/en/12-taos-sql/event_window.webp differ
diff --git a/docs/en/13-operation/01-pkg-install.md b/docs/en/13-operation/01-pkg-install.md
index 6e6c4aaebf7da8ed633cbb89233f9028f56d8302..561013947100a0c938154c37fa9e11b17fd428b6 100644
--- a/docs/en/13-operation/01-pkg-install.md
+++ b/docs/en/13-operation/01-pkg-install.md
@@ -15,14 +15,14 @@ About details of installing TDenine, please refer to [Installation Guide](../../
## Uninstall
-
+
-Apt-get package of TDengine can be uninstalled as below:
+Uninstall package of TDengine by apt-get can be uninstalled as below:
```bash
$ sudo apt-get remove tdengine
Reading package lists... Done
-Building dependency tree
+Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
tdengine
@@ -35,7 +35,7 @@ TDengine is removed successfully!
```
-Apt-get package of taosTools can be uninstalled as below:
+If you have installed taos-tools, please uninstall it first before uninstall TDengine. The command of uninstall is following:
```
$ sudo apt remove taostools
@@ -111,8 +111,20 @@ taos tools is uninstalled successfully!
```
+
Run C:\TDengine\unins000.exe to uninstall TDengine on a Windows system.
+
+
+
+
+TDengine can be uninstalled as below:
+
+```
+$ rmtaos
+TDengine is removed successfully!
+```
+
@@ -150,13 +162,13 @@ There are two aspects in upgrade operation: upgrade installation package and upg
To upgrade a package, follow the steps mentioned previously to first uninstall the old version then install the new version.
-Upgrading a running server is much more complex. First please check the version number of the old version and the new version. The version number of TDengine consists of 4 sections, only if the first 3 sections match can the old version be upgraded to the new version. The steps of upgrading a running server are as below:
+Upgrading a running server is much more complex. First please check the version number of the old version and the new version. The version number of TDengine consists of 4 sections, only if the first 2 sections match can the old version be upgraded to the new version. The steps of upgrading a running server are as below:
- Stop inserting data
-- Make sure all data is persisted to disk
+- Make sure all data is persisted to disk, please use command `flush database`
- Stop the cluster of TDengine
- Uninstall old version and install new version
- Start the cluster of TDengine
-- Execute simple queries, such as the ones executed prior to installing the new package, to make sure there is no data loss
+- Execute simple queries, such as the ones executed prior to installing the new package, to make sure there is no data loss
- Run some simple data insertion statements to make sure the cluster works well
- Restore business services
diff --git a/docs/en/13-operation/03-tolerance.md b/docs/en/13-operation/03-tolerance.md
index 4f33748e68a0b51be619fe7aa8cc3b2152c71bf2..c8d2c3f3f62f3eeba950de335ef636d08d19f180 100644
--- a/docs/en/13-operation/03-tolerance.md
+++ b/docs/en/13-operation/03-tolerance.md
@@ -18,14 +18,8 @@ To achieve absolutely no data loss, set wal_level to 2 and wal_fsync_period to 0
## Disaster Recovery
-TDengine uses replication to provide high availability.
+TDengine provides disaster recovery by using taosX to replicate data between two TDengine clusters which are deployed in two distant data centers. Assume there are two TDengine clusters, A and B, A is the source and B is the target, and A takes the workload of writing and querying. You can deploy `taosX` in the data center where cluster A resides in, `taosX` consumes the data written into cluster A and writes into cluster B. If the data center of cluster A is disrupted because of disaster, you can switch to cluster B to take the workload of data writing and querying, and deploy a `taosX` in the data center of cluster B to replicate data from cluster B to cluster A if cluster A has been recovered, or another cluster C if cluster A has not been recovered.
-A TDengine cluster is managed by mnodes. You can configure up to three mnodes to ensure high availability. The data replication between mnode replicas is performed in a synchronous way to guarantee metadata consistency.
+You can use the data replication feature of `taosX` to build more complicated disaster recovery solution.
-The number of replicas for time series data in TDengine is associated with each database. There can be many databases in a cluster and each database can be configured with a different number of replicas. When creating a database, the parameter `replica` is used to specify the number of replicas. To achieve high availability, set `replica` to 3.
-
-The number of dnodes in a TDengine cluster must NOT be lower than the number of replicas for any database, otherwise it would fail when trying to create a table.
-
-As long as the dnodes of a TDengine cluster are deployed on different physical machines and the replica number is higher than 1, high availability can be achieved without any other assistance. For disaster recovery, dnodes of a TDengine cluster should be deployed in geographically different data centers.
-
-Alternatively, you can use taosX to synchronize the data from one TDengine cluster to another cluster in a remote location. However, taosX is only available in TDengine enterprise version, for more information please contact tdengine.com.
+taosX is only provided in TDengine enterprise edition, for more details please contact business@tdengine.com.
diff --git a/docs/en/14-reference/02-rest-api/02-rest-api.mdx b/docs/en/14-reference/02-rest-api/02-rest-api.mdx
index b138d69bfc277401723e5b75b874b42914963f48..1691b8be8b53480199898ab4ec6b5917eba7979f 100644
--- a/docs/en/14-reference/02-rest-api/02-rest-api.mdx
+++ b/docs/en/14-reference/02-rest-api/02-rest-api.mdx
@@ -68,7 +68,7 @@ The following return value results indicate that the verification passed.
## HTTP request URL format
```text
-http://:/rest/sql/[db_name][?tz=timezone]
+http://:/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
Parameter Description:
@@ -77,6 +77,7 @@ Parameter Description:
- port: httpPort configuration item in the configuration file, default is 6041.
- db_name: Optional parameter that specifies the default database name for the executed SQL command.
- tz: Optional parameter that specifies the timezone of the returned time, following the IANA Time Zone rules, e.g. `America/New_York`.
+- req_id: Optional parameter that specifies the request id for tracing.
For example, `http://h1.taos.com:6041/rest/sql/test` is a URL to `h1.taos.com:6041` and sets the default database name to `test`.
@@ -99,13 +100,13 @@ The HTTP request's BODY is a complete SQL command, and the data table in the SQL
Use `curl` to initiate an HTTP request with a custom authentication method, with the following syntax.
```bash
-curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone]
+curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
or
```bash
-curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone]
+curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
where `TOKEN` is the string after Base64 encoding of `{username}:{password}`, e.g. `root:taosdata` is encoded as `cm9vdDp0YW9zZGF0YQ==`..
@@ -114,14 +115,41 @@ where `TOKEN` is the string after Base64 encoding of `{username}:{password}`, e.
### HTTP Response Code
-| **Response Code** | **Description** |
-|-------------------|----------------|
-| 200 | Success. (Also used for C interface errors.) |
-| 400 | Parameter error |
-| 401 | Authentication failure |
-| 404 | Interface not found |
-| 500 | Internal error |
-| 503 | Insufficient system resources |
+Starting from `TDengine 3.0.3.0`, `taosAdapter` provides a configuration parameter `httpCodeServerError` to set whether to return a non-200 http status code when the C interface returns an error
+
+| **Description** | **httpCodeServerError false** | **httpCodeServerError true** |
+|--------------------|---------------------------- ------|---------------------------------------|
+| taos_errno() returns 0 | 200 | 200 |
+| taos_errno() returns non-0 | 200 (except authentication error) | 500 (except authentication error and 400/502 error) |
+| Parameter error | 400 (only handle HTTP request URL parameter error) | 400 (handle HTTP request URL parameter error and taosd return error) |
+| Authentication error | 401 | 401 |
+| Interface does not exist | 404 | 404 |
+| Cluster unavailable error | 502 | 502 |
+| Insufficient system resources | 503 | 503 |
+
+The C error codes that return http code 400 are:
+
+- TSDB_CODE_TSC_SQL_SYNTAX_ERROR ( 0x0216 )
+- TSDB_CODE_TSC_LINE_SYNTAX_ERROR (0x021B)
+- TSDB_CODE_PAR_SYNTAX_ERROR (0x2600)
+- TSDB_CODE_TDB_TIMESTAMP_OUT_OF_RANGE (0x060B)
+- TSDB_CODE_TSC_VALUE_OUT_OF_RANGE (0x0224)
+- TSDB_CODE_PAR_INVALID_FILL_TIME_RANGE (0x263B)
+
+The error code that returns http code 401 are:
+
+- TSDB_CODE_MND_USER_ALREADY_EXIST (0x0350)
+- TSDB_CODE_MND_USER_NOT_EXIST (0x0351)
+- TSDB_CODE_MND_INVALID_USER_FORMAT (0x0352)
+- TSDB_CODE_MND_INVALID_PASS_FORMAT (0x0353)
+- TSDB_CODE_MND_NO_USER_FROM_CONN (0x0354)
+- TSDB_CODE_MND_TOO_MANY_USERS (0x0355)
+- TSDB_CODE_MND_INVALID_ALTER_OPER (0x0356)
+- TSDB_CODE_MND_AUTH_FAILURE (0x0357)
+
+The error code that returns http code 403 are:
+
+- TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED (0x0020)
### HTTP body structure
@@ -269,7 +297,6 @@ Response body:
```json
{
- "status": "succ",
"code": 0,
"desc": "/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"
}
diff --git a/docs/en/14-reference/03-connector/03-cpp.mdx b/docs/en/14-reference/03-connector/03-cpp.mdx
index 3bd7b7f4c6ad0c2ca3cf5c05fa72d1b27f714653..b543879b3cf8814d21d0a6f940762c67cc2519b0 100644
--- a/docs/en/14-reference/03-connector/03-cpp.mdx
+++ b/docs/en/14-reference/03-connector/03-cpp.mdx
@@ -176,6 +176,14 @@ The base API is used to do things like create database connections and provide a
Set the current default database to `db`.
+- `int taos_get_current_db(TAOS *taos, char *database, int len, int *required)`
+
+ - The variables database and len are applied by the user outside and allocated space. The current database name and length will be assigned to database and len.
+ - As long as the db name is not assigned to the database normally (including truncation), an error will be returned with the return value of -1, and then the user can use taos_errstr(NULL) to get error message.
+ - If database==NULL or len<=0, returns an error, the space required to store the db (including the last '\0') in the variable required
+ - If len is less than the space required to store the db (including the last '\0'), an error is returned. The truncated data assigned in the database ends with '\0'.
+ - If len is greater than or equal to the space required to store the db (including the last '\0'), return normal 0, and assign the db name ending with '\0' in the database.
+
- `void taos_close(TAOS *taos)`
Closes the connection, where `taos` is the handle returned by `taos_connect()`.
@@ -404,5 +412,17 @@ In addition to writing data using the SQL method or the parameter binding API, w
Note that the timestamp resolution parameter only takes effect when the protocol type is `SML_LINE_PROTOCOL`.
For OpenTSDB's text protocol, timestamp resolution follows its official resolution rules - time precision is confirmed by the number of characters contained in the timestamp.
- **Supported Versions**
- This feature interface is supported from version 2.3.0.0.
+ schemaless 其他相关的接口
+- `TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision)`
+- `TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl)`
+- `TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl)`
+- `TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl, int64_t reqid)`
+
+ **Description**
+ - The above seven interfaces are extension interfaces, which are mainly used to pass ttl and reqid parameters, and can be used as needed.
+ - Withing _raw interfaces represent data through the passed parameters lines and len. In order to solve the problem that the original interface data contains '\0' and is truncated. The totalRows pointer returns the number of parsed data rows.
+ - Withing _ttl interfaces can pass the ttl parameter to control the ttl expiration time of the table.
+ - Withing _reqid interfaces can track the entire call chain by passing the reqid parameter.
diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx
index 36992da636a6773ede98ebca2ed6b981187afa93..fd4b4641d75e2116267b3f7f13a995079913f663 100644
--- a/docs/en/14-reference/03-connector/04-java.mdx
+++ b/docs/en/14-reference/03-connector/04-java.mdx
@@ -300,7 +300,7 @@ stmt.executeUpdate("create table if not exists tb (ts timestamp, temperature int
> **Note**: If you do not use `use db` to specify the database, all subsequent operations on the table need to add the database name as a prefix, such as db.tb.
-### 插入数据
+### Insert data
```java
// insert data
@@ -725,7 +725,7 @@ consumer.close()
For more information, see [Data Subscription](../../../develop/tmq).
-### Usage examples
+#### Full Sample Code
diff --git a/docs/en/14-reference/03-connector/05-go.mdx b/docs/en/14-reference/03-connector/05-go.mdx
index da2f54708f550bc4ba9f35da81ad59a575bda169..0088f230069b15f12e455b5b6d2d6fa261fc5a14 100644
--- a/docs/en/14-reference/03-connector/05-go.mdx
+++ b/docs/en/14-reference/03-connector/05-go.mdx
@@ -120,7 +120,7 @@ _taosSql_ implements Go's `database/sql/driver` interface via cgo. You can use t
Use `taosSql` as `driverName` and use a correct [DSN](#DSN) as `dataSourceName`, DSN supports the following parameters.
-* configPath specifies the `taos.cfg` directory
+* cfg specifies the `taos.cfg` directory
For example:
diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx
index 6e848596107f3dd8a0e99b4bf8fe1dc9530021a4..ad522e9d2b26ff02ee06bb7438acc12d315529c4 100644
--- a/docs/en/14-reference/03-connector/06-rust.mdx
+++ b/docs/en/14-reference/03-connector/06-rust.mdx
@@ -39,7 +39,7 @@ The Rust Connector is still under rapid development and is not guaranteed to be
* Install the Rust development toolchain
* If using the native connection, please install the TDengine client driver. Please refer to [install client driver](/reference/connector#install-client-driver)
-# Add taos dependency
+### Add taos dependency
Depending on the connection method, add the [taos][taos] dependency in your Rust project as follows:
@@ -282,7 +282,7 @@ In the application code, use `pool.get()? ` to get a connection object [Taos].
let taos = pool.get()?;
```
-# Connectors
+### Connectors
The [Taos][struct.Taos] object provides an API to perform operations on multiple databases.
diff --git a/docs/en/14-reference/03-connector/07-python.mdx b/docs/en/14-reference/03-connector/07-python.mdx
index 146da268a8b7b4ebf799f3441efcd2d454afd65d..bfbdd929c263a59df42e1f310b267ba1521032c2 100644
--- a/docs/en/14-reference/03-connector/07-python.mdx
+++ b/docs/en/14-reference/03-connector/07-python.mdx
@@ -10,10 +10,11 @@ import TabItem from "@theme/TabItem";
`taospy` is the official Python connector for TDengine. taospy provides a rich API that makes it easy for Python applications to use TDengine. `taospy` wraps both the [native interface](/reference/connector/cpp) and [REST interface](/reference/rest-api) of TDengine, which correspond to the `taos` and `taosrest` modules of the `taospy` package, respectively.
In addition to wrapping the native and REST interfaces, `taospy` also provides a set of programming interfaces that conforms to the [Python Data Access Specification (PEP 249)](https://peps.python.org/pep-0249/). It is easy to integrate `taospy` with many third-party tools, such as [SQLAlchemy](https://www.sqlalchemy.org/) and [pandas](https://pandas.pydata.org/).
-The direct connection to the server using the native interface provided by the client driver is referred to hereinafter as a "native connection"; the connection to the server using the REST interface provided by taosAdapter is referred to hereinafter as a "REST connection".
+`taos-ws-py` is an optional package to enable using WebSocket to connect TDengine.
-The source code for the Python connector is hosted on [GitHub](https://github.com/taosdata/taos-connector-python).
+The direct connection to the server using the native interface provided by the client driver is referred to hereinafter as a "native connection"; the connection to the server using the REST or WebSocket interface provided by taosAdapter is referred to hereinafter as a "REST connection" or "WebSocket connection".
+The source code for the Python connector is hosted on [GitHub](https://github.com/taosdata/taos-connector-python).
## Supported platforms
- The [supported platforms](/reference/connector/#supported-platforms) for the native connection are the same as the ones supported by the TDengine client.
@@ -32,7 +33,7 @@ We recommend using the latest version of `taospy`, regardless of the version of
### Preparation
-1. Install Python. The recent taospy package requires Python 3.6+. The earlier versions of taospy require Python 3.7+. The taos-ws-py package requires Python 3.7+. If Python is not available on your system, refer to the [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) to install it.
+1. Install Python. The recent taospy package requires Python 3.6.2+. The earlier versions of taospy require Python 3.7+. The taos-ws-py package requires Python 3.7+. If Python is not available on your system, refer to the [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) to install it.
2. Install [pip](https://pypi.org/project/pip/). In most cases, the Python installer comes with the pip utility. If not, please refer to [pip documentation](https://pip.pypa.io/en/stable/installation/) to install it.
If you use a native connection, you will also need to [Install Client Driver](/reference/connector#Install-Client-Driver). The client install package includes the TDengine client dynamic link library (`libtaos.so` or `taos.dll`) and the TDengine CLI.
@@ -114,6 +115,15 @@ For REST connections, verifying that the `taosrest` module can be imported succe
import taosrest
```
+
+
+
+For WebSocket connection, verifying that the `taosws` module can be imported successfully can be done in the Python Interactive Shell by typing.
+
+```python
+import taosws
+```
+
@@ -182,6 +192,28 @@ If the test is successful, it will output the server version information, e.g.
}
```
+
+
+
+For WebSocket connection, make sure the cluster and taosAdapter component, are running. This can be testetd using the following `curl` command.
+
+```
+curl -i -N -d "show databases" -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: :" -H "Origin: http://:" http://:/rest/sql
+```
+
+The FQDN above is the FQDN of the machine running taosAdapter, PORT is the port taosAdapter listening, default is `6041`.
+
+If the test is successful, it will output the server version information, e.g.
+
+```json
+HTTP/1.1 200 OK
+Content-Type: application/json; charset=utf-8
+Date: Tue, 21 Mar 2023 09:29:17 GMT
+Transfer-Encoding: chunked
+
+{"status":"succ","head":["server_version()"],"column_meta":[["server_version()",8,8]],"data":[["2.6.0.27"]],"rows":1}
+```
+
@@ -228,6 +260,16 @@ All arguments to the `connect()` function are optional keyword arguments. The fo
- `password`: TDengine user password. The default is `taosdata`.
- `timeout`: HTTP request timeout. Enter a value in seconds. The default is `socket._GLOBAL_DEFAULT_TIMEOUT`. Usually, no configuration is needed.
+
+
+
+
+```python
+{{#include docs/examples/python/connect_websocket_examples.py:connect}}
+```
+
+The parameter of `connect()` is the url of TDengine, and the protocol is `taosws` or `ws`.
+
@@ -298,7 +340,95 @@ The `RestClient` class is a direct wrapper for the [REST API](/reference/rest-ap
For a more detailed description of the `sql()` method, please refer to [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html).
+
+
+
+```python
+{{#include docs/examples/python/connect_websocket_examples.py:basic}}
+```
+
+- `conn.execute`: can use to execute arbitrary SQL statements, and return the number of rows affected.
+- `conn.query`: can use to execute query SQL statements, and return the query results.
+
+
+
+
+### Usage with req_id
+
+By using the optional req_id parameter, you can specify a request ID that can be used for tracing.
+
+
+
+
+##### TaosConnection class
+
+The `TaosConnection` class contains both an implementation of the PEP249 Connection interface (e.g., the `cursor()` method and the `close()` method) and many extensions (e.g., the `execute()`, `query()`, `schemaless_insert()`, and `subscribe()` methods).
+
+```python title="execute method"
+{{#include docs/examples/python/connection_usage_native_reference_with_req_id.py:insert}}
+```
+
+```python title="query method"
+{{#include docs/examples/python/connection_usage_native_reference_with_req_id.py:query}}
+```
+
+:::tip
+The queried results can only be fetched once. For example, only one of `fetch_all()` and `fetch_all_into_dict()` can be used in the example above. Repeated fetches will result in an empty list.
+:::
+
+##### Use of TaosResult class
+
+In the above example of using the `TaosConnection` class, we have shown two ways to get the result of a query: `fetch_all()` and `fetch_all_into_dict()`. In addition, `TaosResult` also provides methods to iterate through the result set by rows (`rows_iter`) or by data blocks (`blocks_iter`). Using these two methods will be more efficient in scenarios where the query has a large amount of data.
+
+```python title="blocks_iter method"
+{{#include docs/examples/python/result_set_with_req_id_examples.py}}
+```
+##### Use of the TaosCursor class
+
+The `TaosConnection` class and the `TaosResult` class already implement all the functionality of the native interface. If you are familiar with the interfaces in the PEP249 specification, you can also use the methods provided by the `TaosCursor` class.
+
+```python title="Use of TaosCursor"
+{{#include docs/examples/python/cursor_usage_native_reference_with_req_id.py}}
+```
+
+:::note
+The TaosCursor class uses native connections for write and query operations. In a client-side multi-threaded scenario, this cursor instance must remain thread exclusive and cannot be shared across threads for use, otherwise, it will result in errors in the returned results.
+
+:::
+
+
+
+
+##### Use of TaosRestCursor class
+
+The `TaosRestCursor` class is an implementation of the PEP249 Cursor interface.
+
+```python title="Use of TaosRestCursor"
+{{#include docs/examples/python/connect_rest_with_req_id_examples.py:basic}}
+```
+- `cursor.execute`: Used to execute arbitrary SQL statements.
+- `cursor.rowcount` : For write operations, returns the number of successful rows written. For query operations, returns the number of rows in the result set.
+- `cursor.description` : Returns the description of the field. Please refer to [TaosRestCursor](https://docs.taosdata.com/api/taospy/taosrest/cursor.html) for the specific format of the description information.
+
+##### Use of the RestClient class
+
+The `RestClient` class is a direct wrapper for the [REST API](/reference/rest-api). It contains only a `sql()` method for executing arbitrary SQL statements and returning the result.
+
+```python title="Use of RestClient"
+{{#include docs/examples/python/rest_client_with_req_id_example.py}}
+```
+
+For a more detailed description of the `sql()` method, please refer to [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html).
+
+
+
+```python
+{{#include docs/examples/python/connect_websocket_with_req_id_examples.py:basic}}
+```
+
+- `conn.execute`: can use to execute arbitrary SQL statements, and return the number of rows affected.
+- `conn.query`: can use to execute query SQL statements, and return the query results.
@@ -319,6 +449,13 @@ For a more detailed description of the `sql()` method, please refer to [RestClie
{{#include docs/examples/python/conn_rest_pandas.py}}
```
+
+
+
+```python
+{{#include docs/examples/python/conn_websocket_pandas.py}}
+```
+
diff --git a/docs/en/14-reference/03-connector/09-csharp.mdx b/docs/en/14-reference/03-connector/09-csharp.mdx
index e984967fb7048bf4a89d5528be7f6c977820d255..fdc0824973eb83d3d544be239ea954e29b5ba265 100644
--- a/docs/en/14-reference/03-connector/09-csharp.mdx
+++ b/docs/en/14-reference/03-connector/09-csharp.mdx
@@ -94,7 +94,7 @@ In this scenario, modifying your project file is required in order to copy the W
-
+
diff --git a/docs/en/14-reference/03-connector/10-php.mdx b/docs/en/14-reference/03-connector/10-php.mdx
index fd00d11239315bbab6e59d838d472d3496ff8342..6cc45ded49b90edbbea2d83ff91da7cf1ad89ce7 100644
--- a/docs/en/14-reference/03-connector/10-php.mdx
+++ b/docs/en/14-reference/03-connector/10-php.mdx
@@ -87,7 +87,7 @@ In this section a few sample programs which use TDengine PHP connector to access
> Any error would throw exception: `TDengine\Exception\TDengineException`
-### Establish Conection
+### Establish Connection
Establish Connection
diff --git a/docs/en/14-reference/03-connector/_linux_install.mdx b/docs/en/14-reference/03-connector/_linux_install.mdx
index 97f6cd333961d24bd015a2ebcf7223f89fecca2c..398593cfe6b23cbb3269182a68fb7563e2964484 100644
--- a/docs/en/14-reference/03-connector/_linux_install.mdx
+++ b/docs/en/14-reference/03-connector/_linux_install.mdx
@@ -14,7 +14,7 @@ import PkgListV3 from "/components/PkgListV3";
Once the package is unzipped, you will see the following files in the directory:
- _ install_client.sh_: install script
- - _ taos.tar.gz_: client driver package
+ - _ package.tar.gz_: client driver package
- _ driver_: TDengine client driver
- _examples_: some example programs of different programming languages (C/C#/go/JDBC/MATLAB/python/R)
You can run `install_client.sh` to install it.
diff --git a/docs/en/14-reference/03-connector/_windows_install.mdx b/docs/en/14-reference/03-connector/_windows_install.mdx
index a96e02feeafe6c0f0937a407d7d8d3a882a5e2d3..723f685b5deb066c81c50601f2a436f8e0c6f300 100644
--- a/docs/en/14-reference/03-connector/_windows_install.mdx
+++ b/docs/en/14-reference/03-connector/_windows_install.mdx
@@ -11,7 +11,7 @@ import PkgListV3 from "/components/PkgListV3";
The default installation path is C:\TDengine, including the following files (directories).
- _taos.exe_: TDengine CLI command-line program
- - _taosadapter.exe_: server-side executable that provides RESTful services and accepts writing requests from a variety of other softwares
+ - _taosadapter.exe_: server-side executable that provides RESTful services and accepts writing requests from a variety of other software
- _taosBenchmark.exe_: TDengine testing tool
- _cfg_: configuration file directory
- _driver_: client driver dynamic link library
diff --git a/docs/en/14-reference/03-connector/index.mdx b/docs/en/14-reference/03-connector/index.mdx
index 2df73b8592c496ca1e3e715c86a9fbb83420f425..a35d5bc2d1ed4a69f9750a1153d15efe815f674d 100644
--- a/docs/en/14-reference/03-connector/index.mdx
+++ b/docs/en/14-reference/03-connector/index.mdx
@@ -61,7 +61,7 @@ The different database framework specifications for various programming language
| **Connection Management** | Support | Support | Support | Support | Support | Support |
| **Regular Query** | Support | Support | Support | Support | Support | Support |
| **Parameter Binding** | Not Supported | Not Supported | Support | Support | Not Supported | Support |
-| **Subscription (TMQ) ** | Not Supported | Support | Support | Not Supported | Not Supported | Support |
+| **Subscription (TMQ) ** | Supported | Support | Support | Not Supported | Not Supported | Support |
| **Schemaless** | Not Supported | Not Supported | Not Supported | Not Supported | Not Supported | Not Supported |
| **Bulk Pulling (based on WebSocket) ** | Support | Support | Support | Support | Support | Support |
| **DataFrame** | Not Supported | Support | Not Supported | Not Supported | Not Supported | Not Supported |
diff --git a/docs/en/14-reference/04-taosadapter.md b/docs/en/14-reference/04-taosadapter.md
index c1ec97b647c228b7302391f768033792e236c79b..7ab894a1c72651e3568f3effa351b044c397b2dd 100644
--- a/docs/en/14-reference/04-taosadapter.md
+++ b/docs/en/14-reference/04-taosadapter.md
@@ -58,9 +58,9 @@ Usage of taosAdapter:
--collectd.enable enable collectd. Env "TAOS_ADAPTER_COLLECTD_ENABLE" (default true)
--collectd.password string collectd password. Env "TAOS_ADAPTER_COLLECTD_PASSWORD" (default "taosdata")
--collectd.port int collectd server port. Env "TAOS_ADAPTER_COLLECTD_PORT" (default 6045)
+ --collectd.ttl int collectd data ttl. Env "TAOS_ADAPTER_COLLECTD_TTL"
--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"
@@ -68,8 +68,9 @@ Usage of taosAdapter:
--cors.allowOrigins stringArray cors allow origins. Env "TAOS_ADAPTER_ALLOW_ORIGINS"
--cors.allowWebSockets cors allow WebSockets. Env "TAOS_ADAPTER_CORS_ALLOW_WebSockets"
--cors.exposeHeaders stringArray cors expose headers. Env "TAOS_ADAPTER_Expose_Headers"
- --debug enable debug mode. Env "TAOS_ADAPTER_DEBUG"
+ --debug enable debug mode. Env "TAOS_ADAPTER_DEBUG" (default true)
--help Print this help message and exit
+ --httpCodeServerError Use a non-200 http status code when taosd returns an error. Env "TAOS_ADAPTER_HTTP_CODE_SERVER_ERROR"
--influxdb.enable enable influxdb. Env "TAOS_ADAPTER_INFLUXDB_ENABLE" (default true)
--log.enableRecordHttpSql whether to record http sql. Env "TAOS_ADAPTER_LOG_ENABLE_RECORD_HTTP_SQL"
--log.path string log path. Env "TAOS_ADAPTER_LOG_PATH" (default "/var/log/taos")
@@ -80,14 +81,17 @@ Usage of taosAdapter:
--log.sqlRotationSize string record sql log rotation size(KB MB GB), must be a positive integer. Env "TAOS_ADAPTER_LOG_SQL_ROTATION_SIZE" (default "1GB")
--log.sqlRotationTime duration record sql log rotation time. Env "TAOS_ADAPTER_LOG_SQL_ROTATION_TIME" (default 24h0m0s)
--logLevel string log level (panic fatal error warn warning info debug trace). Env "TAOS_ADAPTER_LOG_LEVEL" (default "info")
- --monitor.collectDuration duration Set monitor duration. Env "TAOS_MONITOR_COLLECT_DURATION" (default 3s)
- --monitor.identity string The identity of the current instance, or 'hostname:port' if it is empty. Env "TAOS_MONITOR_IDENTITY"
- --monitor.incgroup Whether running in cgroup. Env "TAOS_MONITOR_INCGROUP"
- --monitor.password string TDengine password. Env "TAOS_MONITOR_PASSWORD" (default "taosdata") --monitor.pauseAllMemoryThreshold float Memory percentage threshold for pause all. Env "TAOS_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (default 80)
- --monitor.pauseQueryMemoryThreshold float Memory percentage threshold for pause query. Env "TAOS_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (default 70)
- --monitor.user string TDengine user. Env "TAOS_MONITOR_USER" (default "root")
- --monitor.writeInterval duration Set write to TDengine interval. Env "TAOS_MONITOR_WRITE_INTERVAL" (default 30s)
- --monitor.writeToTD Whether write metrics to TDengine. Env "TAOS_MONITOR_WRITE_TO_TD"
+ --monitor.collectDuration duration Set monitor duration. Env "TAOS_ADAPTER_MONITOR_COLLECT_DURATION" (default 3s)
+ --monitor.disable Whether to disable monitoring. Env "TAOS_ADAPTER_MONITOR_DISABLE"
+ --monitor.disableCollectClientIP Whether to disable collecting clientIP. Env "TAOS_ADAPTER_MONITOR_DISABLE_COLLECT_CLIENT_IP"
+ --monitor.identity string The identity of the current instance, or 'hostname:port' if it is empty. Env "TAOS_ADAPTER_MONITOR_IDENTITY"
+ --monitor.incgroup Whether running in cgroup. Env "TAOS_ADAPTER_MONITOR_INCGROUP"
+ --monitor.password string TDengine password. Env "TAOS_ADAPTER_MONITOR_PASSWORD" (default "taosdata")
+ --monitor.pauseAllMemoryThreshold float Memory percentage threshold for pause all. Env "TAOS_ADAPTER_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (default 80)
+ --monitor.pauseQueryMemoryThreshold float Memory percentage threshold for pause query. Env "TAOS_ADAPTER_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (default 70)
+ --monitor.user string TDengine user. Env "TAOS_ADAPTER_MONITOR_USER" (default "root")
+ --monitor.writeInterval duration Set write to TDengine interval. Env "TAOS_ADAPTER_MONITOR_WRITE_INTERVAL" (default 30s)
+ --monitor.writeToTD Whether write metrics to TDengine. Env "TAOS_ADAPTER_MONITOR_WRITE_TO_TD"
--node_exporter.caCertFile string node_exporter ca cert file path. Env "TAOS_ADAPTER_NODE_EXPORTER_CA_CERT_FILE"
--node_exporter.certFile string node_exporter cert file path. Env "TAOS_ADAPTER_NODE_EXPORTER_CERT_FILE"
--node_exporter.db string node_exporter db name. Env "TAOS_ADAPTER_NODE_EXPORTER_DB" (default "node_exporter")
@@ -100,9 +104,9 @@ Usage of taosAdapter:
--node_exporter.keyFile string node_exporter cert key file path. Env "TAOS_ADAPTER_NODE_EXPORTER_KEY_FILE"
--node_exporter.password string node_exporter password. Env "TAOS_ADAPTER_NODE_EXPORTER_PASSWORD" (default "taosdata")
--node_exporter.responseTimeout duration node_exporter response timeout. Env "TAOS_ADAPTER_NODE_EXPORTER_RESPONSE_TIMEOUT" (default 5s)
+ --node_exporter.ttl int node_exporter data ttl. Env "TAOS_ADAPTER_NODE_EXPORTER_TTL"
--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])
@@ -112,11 +116,11 @@ Usage of taosAdapter:
--opentsdb_telnet.password string opentsdb_telnet password. Env "TAOS_ADAPTER_OPENTSDB_TELNET_PASSWORD" (default "taosdata")
--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.ttl int opentsdb_telnet data ttl. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TTL"
--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)
+ --pool.idleTimeout duration Set idle connection timeout. Env "TAOS_ADAPTER_POOL_IDLE_TIMEOUT"
+ --pool.maxConnect int max connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_CONNECT"
+ --pool.maxIdle int max idle connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_IDLE"
-P, --port int http port. Env "TAOS_ADAPTER_PORT" (default 6041)
--prometheus.enable enable prometheus. Env "TAOS_ADAPTER_PROMETHEUS_ENABLE" (default true)
--restfulRowLimit int restful returns the maximum number of rows (-1 means no limit). Env "TAOS_ADAPTER_RESTFUL_ROW_LIMIT" (default -1)
@@ -133,9 +137,9 @@ Usage of taosAdapter:
--statsd.port int statsd server port. Env "TAOS_ADAPTER_STATSD_PORT" (default 6044)
--statsd.protocol string statsd protocol [tcp or udp]. Env "TAOS_ADAPTER_STATSD_PROTOCOL" (default "udp")
--statsd.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_STATSD_TCP_KEEP_ALIVE"
+ --statsd.ttl int statsd data ttl. Env "TAOS_ADAPTER_STATSD_TTL"
--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
```
@@ -324,6 +328,10 @@ This parameter controls the number of results returned by the following interfac
- `http://:6041/rest/sql`
- `http://:6041/prometheus/v1/remote_read/:db`
+## Configure http return code
+
+taosAdapter uses the parameter `httpCodeServerError` to set whether to return a non-200 http status code http status code other than when the C interface returns an error. When set to true, different http status codes will be returned according to the error code returned by C. For details, see [RESTful API](https://docs.tdengine.com/reference/rest-api/) HTTP Response Code chapter.
+
## Troubleshooting
You can check the taosAdapter running status with the `systemctl status taosadapter` command.
diff --git a/docs/en/14-reference/05-taosbenchmark.md b/docs/en/14-reference/05-taosbenchmark.md
index 9828d71ece98ca6de2f079f5599f2eed7fcea891..f49424d3ba817be1d338ab78fb5738f859a5a235 100644
--- a/docs/en/14-reference/05-taosbenchmark.md
+++ b/docs/en/14-reference/05-taosbenchmark.md
@@ -208,7 +208,10 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
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+.
+ Specify interval between keep trying insert. Valid value is a positive number. Only valid when keep trying be enabled. Available with v3.0.9+.
+
+- **-v/--vgroups ** :
+ Specify vgroups number for creating a database, only valid with daemon version 3.0+
- **-V/--version** :
Show version information only. Users should not use it with other parameters.
@@ -239,7 +242,15 @@ The parameters listed in this section apply to all function modes.
- ** 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+.
+- ** trying_interval ** : Specify interval between keep trying insert. Valid value is a positive number. Only valid when keep trying be enabled. Available with v3.0.9+.
+
+- ** childtable_from and childtable_to ** : specify the child table range to create. The range is [childtable_from, childtable_to).
+
+- ** continue_if_fail ** : allow the user to specify the reaction if the insertion failed.
+
+ - "continue_if_fail" : "no" // means taosBenchmark will exit if it fails to insert as default reaction behavior.
+ - "continue_if_fail" : "yes" // means taosBenchmark will warn the user if it fails to insert but continue to insert the next record.
+ - "continue_if_fail": "smart" // means taosBenchmark will try to create the non-existent child table if it fails to insert.
#### Database related configuration parameters
@@ -352,7 +363,7 @@ The configuration parameters for specifying super table tag columns and data col
- **min**: The minimum value of the column/label of the data type. The generated value will equal or large than the minimum value.
-- **max**: The maximum value of the column/label of the data type. The generated value will less than the maxium value.
+- **max**: The maximum value of the column/label of the data type. The generated value will less than the maximum value.
- **values**: The value field of the nchar/binary column/label, which will be chosen randomly from the values.
@@ -392,11 +403,11 @@ See [General Configuration Parameters](#General Configuration Parameters) for de
#### Configuration parameters for executing the specified query statement
-The configuration parameters for querying the sub-tables or the normal tables are set in `specified_table_query`.
+The configuration parameters for querying the specified table (it can be a super table, a sub-table or a normal table) are set in `specified_table_query`.
- **query_interval** : The query interval in seconds, the default value is 0.
-- **threads**: The number of threads to execute the query SQL, the default value is 1.
+- **threads/concurrent**: The number of threads to execute the query SQL, the default value is 1.
- **sqls**.
- **sql**: the SQL command to be executed.
@@ -423,9 +434,9 @@ The configuration parameters of the super table query are set in `super_table_qu
#### Configuration parameters for executing the specified subscription statement
-The configuration parameters for subscribing to a sub-table or a generic table are set in `specified_table_query`.
+The configuration parameters for subscribing to a specified table (it can be a super table, a sub-table or a generic table) are set in `specified_table_query`.
-- **threads**: The number of threads to execute SQL, default is 1.
+- **threads/concurrent**: The number of threads to execute SQL, default is 1.
- **interval**: The time interval to execute the subscription, in seconds, default is 0.
diff --git a/docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json b/docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
index f651983528ca824b4e6b14586aac5a5bfb4ecab8..43f29bda4445d0559b60d51a6d421442e9d38d4d 100644
--- a/docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
+++ b/docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
@@ -1590,7 +1590,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1919,7 +1919,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1977,7 +1977,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2825,7 +2825,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
- "title": "Requets Count per Minutes $fqdn",
+ "title": "Requests Count per Minutes $fqdn",
"tooltip": {
"shared": true,
"sort": 0,
diff --git a/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
index b4254c428b28a0084e54b5e3c509dd2e0ec651b9..660875262edfe4b4211075839b60dfcdcb26d198 100644
--- a/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
+++ b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
@@ -1566,7 +1566,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1933,7 +1933,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2000,7 +2000,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2961,7 +2961,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
- "title": "Requets Count per Minutes $fqdn",
+ "title": "Requests Count per Minutes $fqdn",
"tooltip": {
"shared": true,
"sort": 0,
@@ -3355,4 +3355,4 @@
"title": "TDengine",
"uid": "tdengine",
"version": 8
-}
\ No newline at end of file
+}
diff --git a/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json
index 7696cfce3fcca3dd5f9278c91d3df2c1b32b9c97..e3bad31fab4e9110da505621d8ea7444584b33cb 100644
--- a/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json
+++ b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json
@@ -186,7 +186,7 @@
},
{
"datasource": "TDengine",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"gridPos": {
"h": 6,
"w": 8,
@@ -253,7 +253,7 @@
],
"timeFrom": null,
"timeShift": null,
- "title": "taosd memery",
+ "title": "taosd memory",
"type": "gauge"
},
{
diff --git a/docs/en/14-reference/08-taos-shell.md b/docs/en/14-reference/08-taos-shell.md
index 7833ac861fea5fb2dfd66ccc9ec2db8f0ddeff3f..e66da7ec1768227d5ec50ce039bd8f794cf90c48 100644
--- a/docs/en/14-reference/08-taos-shell.md
+++ b/docs/en/14-reference/08-taos-shell.md
@@ -61,12 +61,14 @@ And many more parameters.
- -c CONFIGDIR: Specify the directory where configuration file exists. The default is `/etc/taos`, and the default name of the configuration file in this directory is `taos.cfg`
- -C: Print the configuration parameters of `taos.cfg` in the default directory or specified by -c
- -d DATABASE: Specify the database to use when connecting to the server
+- -E dsn: connect to the TDengine Cloud or a server which provides WebSocket connection
- -f FILE: Execute the SQL script file in non-interactive mode Note that each SQL statement in the script file must be only one line.
- -k: Test the operational status of the server. 0: unavailable; 1: network ok; 2: service ok; 3: service degraded; 4: exiting
- -l PKTLEN: Test package size to be used for network testing
- -n NETROLE: test scope for network connection test, default is `client`. The value can be `client` or `server`.
- -N PKTNUM: Number of packets used for network testing
- -r: output the timestamp format as unsigned 64-bits integer (uint64_t in C language)
+- -R: Use RESTful mode when connecting
- -s COMMAND: execute SQL commands in non-interactive mode
- -t: Test the boot status of the server. The statuses of -k apply.
- -w DISPLAYWIDTH: Specify the number of columns of the server display.
diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md
index 7075dc771eccc83a7cabb6807f34667de8f5fcc7..430487a3af9f8729e199251b9cb6c913ee059769 100644
--- a/docs/en/14-reference/12-config/index.md
+++ b/docs/en/14-reference/12-config/index.md
@@ -29,7 +29,7 @@ taos -C
taos --dump-config
```
-# Configuration Parameters
+## Configuration Parameters
:::note
The parameters described in this document by the effect that they have on the system.
@@ -83,7 +83,7 @@ The parameters described in this document by the effect that they have on the sy
| :------- | :----------- | :----------------------------------------------- | :--------------------------------------------------------------------------------------------- |
| TCP | 6030 | Communication between client and server. In a multi-node cluster, communication between nodes. serverPort |
| TCP | 6041 | REST connection between client and server | Prior to 2.4.0.0: serverPort+11; After 2.4.0.0 refer to [taosAdapter](/reference/taosadapter/) |
-| TCP | 6043 | Service Port of TaosKeeper | The parameter of TaosKeeper |
+| TCP | 6043 | Service Port of taosKeeper | The parameter of taosKeeper |
| TCP | 6044 | Data access port for StatsD | Configurable through taosAdapter parameters.
| UDP | 6045 | Data access for statsd | Configurable through taosAdapter parameters.
| TCP | 6060 | Port of Monitoring Service in Enterprise version | |
@@ -99,6 +99,9 @@ The parameters described in this document by the effect that they have on the sy
## Monitoring Parameters
+:::note
+Please note the `taoskeeper` needs to be installed and running to create the `log` database and receiving metrics sent by `taosd` as the full monitoring solution.
+
### monitor
| Attribute | Description |
@@ -599,7 +602,7 @@ The charset that takes effect is UTF-8.
| Applicable | Client only |
| Meaning | Whether schemaless columns are consistently ordered, depat, discarded since 3.0.3.0|
| Value Range | 0: not consistent; 1: consistent. |
-| Default | 1 |
+| Default | 0 |
## Compress Parameters
diff --git a/docs/en/14-reference/12-directory.md b/docs/en/14-reference/12-directory.md
index 651892c8b29447647d8edef12af58c469de951b1..439fcf37f683d33c85f0c469f62379a6a38f3938 100644
--- a/docs/en/14-reference/12-directory.md
+++ b/docs/en/14-reference/12-directory.md
@@ -24,7 +24,7 @@ All executable files of TDengine are in the _/usr/local/taos/bin_ directory by d
- _taosdump_: data import and export tool
- _taosBenchmark_: TDengine testing tool
- _remove.sh_: script to uninstall TDengine, please execute it carefully, link to the **rmtaos** command in the /usr/bin directory. Will remove the TDengine installation directory `/usr/local/taos`, but will keep `/etc/taos`, `/var/lib/taos`, `/var/log/taos`
-- _taosadapter_: server-side executable that provides RESTful services and accepts writing requests from a variety of other softwares
+- _taosadapter_: server-side executable that provides RESTful services and accepts writing requests from a variety of other software
- _TDinsight.sh_: script to download TDinsight and install it
- _set_core.sh_: script for setting up the system to generate core dump files for easy debugging
- _taosd-dump-cfg.gdb_: script to facilitate debugging of taosd's gdb execution.
diff --git a/docs/en/14-reference/13-schemaless/13-schemaless.md b/docs/en/14-reference/13-schemaless/13-schemaless.md
index caedd76df8e41b4246891f686d61ed61af671d7e..3f75364081d7ec242d96a30f3adf0861637a06eb 100644
--- a/docs/en/14-reference/13-schemaless/13-schemaless.md
+++ b/docs/en/14-reference/13-schemaless/13-schemaless.md
@@ -84,7 +84,7 @@ You can configure smlChildTableName in taos.cfg to specify table names, for exam
:::tip
All processing logic of schemaless will still follow TDengine's underlying restrictions on data structures, such as the total length of each row of data cannot exceed
-16KB. See [TDengine SQL Boundary Limits](/taos-sql/limit) for specific constraints in this area.
+48KB, and the total length of tag value cannot exceed 16KB. See [TDengine SQL Boundary Limits](/taos-sql/limit) for specific constraints in this area.
:::
@@ -131,7 +131,7 @@ create stable st (_ts timestamp, c1 bigint, c2 bool, c3 binary(6), c4 bigint) ta
This section describes the impact on the schema caused by different data being written.
-If you use line protocol to write to a specific tag field and then later change the field type, a schema error will ocur. This triggers an error on the write API. This is shown as follows:
+If you use line protocol to write to a specific tag field and then later change the field type, a schema error will occur. This triggers an error on the write API. This is shown as follows:
```json
st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4 1626006833639000000
diff --git a/docs/en/14-reference/14-taosKeeper.md b/docs/en/14-reference/14-taosKeeper.md
index 16c591154705521fc194a13ddcf6d2bbb5552470..895bd82e1924a59227bc8193c277b96eccd6cd66 100644
--- a/docs/en/14-reference/14-taosKeeper.md
+++ b/docs/en/14-reference/14-taosKeeper.md
@@ -4,23 +4,24 @@ title: taosKeeper
description: This document describes how to use taosKeeper, a tool for exporting TDengine monitoring metrics.
---
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+
## Introduction
taosKeeper is a tool for TDengine that exports monitoring metrics. With taosKeeper, you can easily monitor the operational status of your TDengine deployment. taosKeeper uses the TDengine REST API. It is not necessary to install TDengine Client to use taosKeeper.
## Installation
-
+There are two ways to install taosKeeper:
Methods of installing taosKeeper:
-
-
-- You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details. -->
-You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details.
+- Installing the official TDengine installer will automatically install taosKeeper. Please refer to [TDengine installation](/operation/pkg-install) for details.
-## Run
+- You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details.
+## Configuration and Launch
-### Configuration and running methods
+### Configuration
taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: [Command-line arguments](#command-line-arguments-in-detail), [environment variable](#environment-variable-in-detail) and [configuration file](#configuration-file-parameters-in-detail). The precedence of those is Command-line, environment variable and configuration file.
@@ -33,28 +34,81 @@ monitorFqdn localhost # taoskeeper's FQDN
For more information, see [TDengine Monitoring Configuration](../config/#monitoring).
-### Command-Line Parameters
+### Quick Launch
-You can use command-line parameters to run taosKeeper and control its behavior:
+
+
-```shell
-$ taosKeeper
+After the installation is complete, run the following command to start the taoskeeper service:
+
+```bash
+systemctl start taoskeeper
```
-### Environment variable
-You can use Environment variable to run taosKeeper and control its behavior:
+Run the following command to confirm that taoskeeper is running normally:
-```shell
-$ export TAOS_KEEPER_TDENGINE_HOST=192.168.64.3
-
-$ taoskeeper
+```bash
+systemctl status taoskeeper
+```
+
+Output similar to the following indicates that taoskeeper is running normally:
+
+```
+Active: active (running)
+```
+
+Output similar to the following indicates that taoskeeper has not started successfully:
+
+```
+Active: inactive (dead)
```
-you can run `taoskeeper -h` for more detail.
+The following `systemctl` commands can help you manage taoskeeper service:
+
+- Start taoskeeper Server: `systemctl start taoskeeper`
+
+- Stop taoskeeper Server: `systemctl stop taoskeeper`
+
+- Restart taoskeeper Server: `systemctl restart taoskeeper`
+
+- Check taoskeeper Server status: `systemctl status taoskeeper`
+
+:::info
+
+- The `systemctl` command requires _root_ privileges. If you are not logged in as the _root_ user, use the `sudo` command.
+- The `systemctl stop taoskeeper` command will instantly stop taoskeeper Server.
+- If your system does not include `systemd`, you can run `/usr/local/taos/bin/taoskeeper` to start taoskeeper manually.
+
+:::
+
-### Configuration File
+
-You can quickly launch taosKeeper with the following commands. If you do not specify a configuration file, `/etc/taos/keeper.toml` is used by default. If this file does not specify configurations, the default values are used.
+After the installation is complete, run `launchctl start com.tdengine.taoskeeper` to start taoskeeper Server.
+
+The following `launchctl` commands can help you manage taoskeeper service:
+
+- Start taoskeeper Server: `sudo launchctl start com.tdengine.taoskeeper`
+
+- Stop taoskeeper Server: `sudo launchctl stop com.tdengine.taoskeeper`
+
+- Check taoskeeper Server status: `sudo launchctl list | grep taoskeeper`
+
+:::info
+- Please use `sudo` to run `launchctl` to manage _com.tdengine.taoskeeper_ with administrator privileges.
+- The administrator privilege is required for service management to enhance security.
+- Troubleshooting:
+- The first column returned by the command `launchctl list | grep taoskeeper` is the PID of the program. If it's `-`, that means the taoskeeper service is not running.
+- If the service is abnormal, please check the `launchd.log` file from the system log.
+
+:::
+
+
+
+
+#### Launch With Configuration File
+
+You can quickly launch taosKeeper with the following commands. If you do not specify a configuration file, `/etc/taos/keeper.toml` is used by default. If this file does not specify configurations, the default values are used.
```shell
$ taoskeeper -c
@@ -132,19 +186,36 @@ $ curl http://127.0.0.1:6043/metrics
Sample result set (excerpt):
```shell
-# HELP taos_cluster_info_connections_total
+# HELP taos_cluster_info_connections_total
# TYPE taos_cluster_info_connections_total counter
taos_cluster_info_connections_total{cluster_id="5981392874047724755"} 16
-# HELP taos_cluster_info_dbs_total
+# HELP taos_cluster_info_dbs_total
# TYPE taos_cluster_info_dbs_total counter
taos_cluster_info_dbs_total{cluster_id="5981392874047724755"} 2
-# HELP taos_cluster_info_dnodes_alive
+# HELP taos_cluster_info_dnodes_alive
# TYPE taos_cluster_info_dnodes_alive counter
taos_cluster_info_dnodes_alive{cluster_id="5981392874047724755"} 1
-# HELP taos_cluster_info_dnodes_total
+# HELP taos_cluster_info_dnodes_total
# TYPE taos_cluster_info_dnodes_total counter
taos_cluster_info_dnodes_total{cluster_id="5981392874047724755"} 1
-# HELP taos_cluster_info_first_ep
+# HELP taos_cluster_info_first_ep
# TYPE taos_cluster_info_first_ep gauge
taos_cluster_info_first_ep{cluster_id="5981392874047724755",value="hlb:6030"} 1
-```
\ No newline at end of file
+```
+
+### check_health
+
+```
+$ curl -i http://127.0.0.1:6043/check_health
+```
+
+Response:
+
+```
+HTTP/1.1 200 OK
+Content-Type: application/json; charset=utf-8
+Date: Mon, 03 Apr 2023 07:20:38 GMT
+Content-Length: 19
+
+{"version":"1.0.0"}
+```
diff --git a/docs/en/14-reference/_statsd.mdx b/docs/en/14-reference/_statsd.mdx
index d068304a1dce52da9e89a1c19a5cca3956b7f0ce..b15c9640db210ca9f42295327430373e2fc6b8fc 100644
--- a/docs/en/14-reference/_statsd.mdx
+++ b/docs/en/14-reference/_statsd.mdx
@@ -31,7 +31,7 @@ The default database name written by taosAdapter is `statsd`. To specify a diffe
### Configuring StatsD
-To use StatsD, you need to download its [source code](https://github.com/statsd/statsd). Please refer to the example file `exampleConfig.js` in the root directory of the source download to modify the configuration file. In , please fill in the domain name or IP address of the server running taosAdapter, and , please fill in the port where taosAdapter receives StatsD data (default is 6044).
+To use StatsD, you need to download its [source code](https://github.com/statsd/statsd). Please refer to the example file `exampleConfig.js` in the root directory of the source download to modify the configuration file. In , please fill in the domain name or IP address of the server running taosAdapter, and , please fill in the port where taosAdapter receives StatsD data (default is 6044).
```
backends section add ". /backends/repeater"
diff --git a/docs/en/20-third-party/01-grafana.mdx b/docs/en/20-third-party/01-grafana.mdx
index 5a2942b14497401ef1a2cb8f31ad2773f6b828e3..b0e9dea707fb2fb326329895921850cd6d721b6d 100644
--- a/docs/en/20-third-party/01-grafana.mdx
+++ b/docs/en/20-third-party/01-grafana.mdx
@@ -77,7 +77,7 @@ sudo -u grafana grafana-cli plugins install tdengine-datasource
You can also download zip files from [GitHub](https://github.com/taosdata/grafanaplugin/releases/tag/latest) or [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) and install manually. The commands are as follows:
```bash
-GF_VERSION=3.2.7
+GF_VERSION=3.3.1
# from GitHub
wget https://github.com/taosdata/grafanaplugin/releases/download/v$GF_VERSION/tdengine-datasource-$GF_VERSION.zip
# from Grafana
diff --git a/docs/en/20-third-party/11-kafka.md b/docs/en/20-third-party/11-kafka.md
index 0998862b2d75b98fb65ff414d000535b0c8b7ea5..9e322d2a5b0234a24c880a5656a25d35933af845 100644
--- a/docs/en/20-third-party/11-kafka.md
+++ b/docs/en/20-third-party/11-kafka.md
@@ -77,7 +77,7 @@ Development: false
### Install from source code
```
-git clone https://github.com/taosdata/kafka-connect-tdengine.git
+git clone --branch 3.0 https://github.com/taosdata/kafka-connect-tdengine.git
cd kafka-connect-tdengine
mvn clean package
unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip
diff --git a/docs/en/21-tdinternal/03-high-availability.md b/docs/en/21-tdinternal/03-high-availability.md
index a0f6ca4ffe15ba5901709ffa3c6d64b8697fa93a..e2a1e358b0ceddd995216e2c86bedc8982385df3 100644
--- a/docs/en/21-tdinternal/03-high-availability.md
+++ b/docs/en/21-tdinternal/03-high-availability.md
@@ -28,4 +28,4 @@ SHOW MNODES;
The end point and role/status (leader, follower, candidate, offline) of all mnodes can be shown by the above command. When the first dnode is started in a cluster, there must be one mnode in this dnode. Without at least one mnode, the cluster cannot work.
-From TDengine 3.0.0, RAFT procotol is used to guarantee the high availability, so the number of mnodes is should be 1 or 3.
+From TDengine 3.0.0, RAFT protocol is used to guarantee the high availability, so the number of mnodes is should be 1 or 3.
diff --git a/docs/en/21-tdinternal/04-load-balance.md b/docs/en/21-tdinternal/04-load-balance.md
index 73da1c1dd65ffb3251c86ff936f5b5b26dc9d1cb..474272c46d216dafb84f6d89cf25784eefe7331e 100644
--- a/docs/en/21-tdinternal/04-load-balance.md
+++ b/docs/en/21-tdinternal/04-load-balance.md
@@ -14,8 +14,8 @@ create database db0 vgroups 100;
The proper value of `vgroups` depends on available system resources. Assuming there is only one database to be created in the system, then the number of `vgroups` is determined by the available resources from all dnodes. In principle more vgroups can be created if you have more CPU and memory. Disk I/O is another important factor to consider. Once the bottleneck shows on disk I/O, more vgroups may downgrad the system performance significantly. If multiple databases are to be created in the system, then the total number of `vroups` of all the databases are dependent on the available system resources. It needs to be careful to distribute vgroups among these databases, you need to consider the number of tables, data writing frequency, size of each data row for all these databases. A recommended practice is to firstly choose a starting number for `vgroups`, for example double of the number of CPU cores, then try to adjust and optimize system configurations to find the best setting for `vgroups`, then distribute these vgroups among databases.
-Furthermode, TDengine distributes the vgroups of each database equally among all dnodes. In case of replica 3, the distrubtion is even more complex, TDengine tries its best to prevent any dnode from becoming a bottleneck.
+Furthermode, TDengine distributes the vgroups of each database equally among all dnodes. In case of replica 3, the distribution is even more complex, TDengine tries its best to prevent any dnode from becoming a bottleneck.
TDegnine utilizes the above ways to achieve load balance in a cluster, and finally achieve higher throughput.
-Once the load balance is achieved, after some operations like deleting tables or droping databases, the load across all dnodes may become inbalanced, the method of rebalance will be provided in later versions. However, even without explicit rebalancing, TDengine will try its best to achieve new balance without manual interfering when a new database is created.
\ No newline at end of file
+Once the load balance is achieved, after some operations like deleting tables or dropping databases, the load across all dnodes may become imbalanced, the method of rebalance will be provided in later versions. However, even without explicit rebalancing, TDengine will try its best to achieve new balance without manual interfering when a new database is created.
diff --git a/docs/en/25-application/01-telegraf.md b/docs/en/25-application/01-telegraf.md
index e043aebcb64f6e3b26b1e79964c5875e3b64ee6f..b84b30bb71fe2231228007f95154a181000ac566 100644
--- a/docs/en/25-application/01-telegraf.md
+++ b/docs/en/25-application/01-telegraf.md
@@ -67,7 +67,7 @@ sudo systemctl start telegraf
Log in to the Grafana interface using a web browser at `IP:3000`, with the system's initial username and password being `admin/admin`.
Click on the gear icon on the left and select `Plugins`, you should find the TDengine data source plugin icon.
-Click on the plus icon on the left and select `Import` to get the data from `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json`, download the dashboard JSON file and import it. You will then see the dashboard in the following screen.
+Click on the plus icon on the left and select `Import` to get the data from `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v3.json` (for TDengine 3.0. for TDengine 2.x, please use `telegraf-dashboard-v2.json`), download the dashboard JSON file and import it. You will then see the dashboard in the following screen.

diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md
index 6a6210806274d5b6e2e8efe12d281e908d2d0c96..b160058d02c22dc824b0e960ad61cbe596999a70 100644
--- a/docs/en/28-releases/01-tdengine.md
+++ b/docs/en/28-releases/01-tdengine.md
@@ -10,6 +10,22 @@ For TDengine 2.x installation packages by version, please visit [here](https://w
import Release from "/components/ReleaseV3";
+## 3.0.3.2
+
+
+
+## 3.0.3.1
+
+
+
+## 3.0.3.1
+
+
+
+## 3.0.3.0
+
+
+
## 3.0.2.6
diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md
index 91eb0c9b8d1ee5ed3b0e774c3d2d78e3bd4c03ba..17581b780a8cba5e0e73ef7d0ff8da8e54f0de56 100644
--- a/docs/en/28-releases/02-tools.md
+++ b/docs/en/28-releases/02-tools.md
@@ -10,6 +10,22 @@ For other historical version installers, please visit [here](https://www.taosdat
import Release from "/components/ReleaseV3";
+## 2.4.11
+
+
+
+## 2.4.10
+
+
+
+## 2.4.9
+
+
+
+## 2.4.8
+
+
+
## 2.4.6
diff --git a/docs/examples/c/tmq_example.c b/docs/examples/c/tmq_example.c
index a3bade308a4ce41f556878d90861e299893315c4..d958428b8ffec9064166ddfd502cc0e2dbd9a200 100644
--- a/docs/examples/c/tmq_example.c
+++ b/docs/examples/c/tmq_example.c
@@ -70,7 +70,7 @@ static int32_t init_env() {
taos_free_result(pRes);
// create database
- pRes = taos_query(pConn, "create database tmqdb");
+ pRes = taos_query(pConn, "create database tmqdb wal_retention_period 3600");
if (taos_errno(pRes) != 0) {
printf("error in create tmqdb, reason:%s\n", taos_errstr(pRes));
return -1;
diff --git a/docs/examples/csharp/influxdbLine/Program.cs b/docs/examples/csharp/influxdbLine/Program.cs
index fa3cb21fe04977b5081c922d623dee5514056770..a620c016090c9177966f8361eac0e65d23192bd8 100644
--- a/docs/examples/csharp/influxdbLine/Program.cs
+++ b/docs/examples/csharp/influxdbLine/Program.cs
@@ -48,7 +48,7 @@ namespace TDengineExample
static void PrepareDatabase(IntPtr conn)
{
- IntPtr res = TDengine.Query(conn, "CREATE DATABASE test");
+ IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600");
if (TDengine.ErrorNo(res) != 0)
{
throw new Exception("failed to create database, reason: " + TDengine.Error(res));
diff --git a/docs/examples/csharp/optsJSON/Program.cs b/docs/examples/csharp/optsJSON/Program.cs
index b67b5af62bf0a1fd9028125da0b665f723f2e4ec..8dcc1dce92be2f134ce68910c916896c07fc4003 100644
--- a/docs/examples/csharp/optsJSON/Program.cs
+++ b/docs/examples/csharp/optsJSON/Program.cs
@@ -54,7 +54,7 @@ namespace TDengineExample
static void PrepareDatabase(IntPtr conn)
{
- IntPtr res = TDengine.Query(conn, "CREATE DATABASE test");
+ IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600");
if (TDengine.ErrorNo(res) != 0)
{
throw new Exception("failed to create database, reason: " + TDengine.Error(res));
diff --git a/docs/examples/csharp/optsTelnet/Program.cs b/docs/examples/csharp/optsTelnet/Program.cs
index e73ceb041accf88222176342d46fe1a669584211..ccd29d0cfc62ac1a59bea8465630595c2e65b5c0 100644
--- a/docs/examples/csharp/optsTelnet/Program.cs
+++ b/docs/examples/csharp/optsTelnet/Program.cs
@@ -58,7 +58,7 @@ namespace TDengineExample
static void PrepareDatabase(IntPtr conn)
{
- IntPtr res = TDengine.Query(conn, "CREATE DATABASE test");
+ IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600");
if (TDengine.ErrorNo(res) != 0)
{
throw new Exception("failed to create database, reason: " + TDengine.Error(res));
diff --git a/docs/examples/csharp/sqlInsert/Program.cs b/docs/examples/csharp/sqlInsert/Program.cs
index f23a6e1663023d1d2fafb3e92e0b605f8ac55e52..25a945a45952d596153707bb4ea8d6c6e327b098 100644
--- a/docs/examples/csharp/sqlInsert/Program.cs
+++ b/docs/examples/csharp/sqlInsert/Program.cs
@@ -11,7 +11,7 @@ namespace TDengineExample
IntPtr conn = GetConnection();
try
{
- IntPtr res = TDengine.Query(conn, "CREATE DATABASE power");
+ IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600");
CheckRes(conn, res, "failed to create database");
res = TDengine.Query(conn, "USE power");
CheckRes(conn, res, "failed to change database");
diff --git a/docs/examples/csharp/stmtInsert/Program.cs b/docs/examples/csharp/stmtInsert/Program.cs
index 80cadb2ff8b596a0484d05ff15aeaa50f22ff859..2e856a49bbbbae5424a517363e3ae1360ba6a0c7 100644
--- a/docs/examples/csharp/stmtInsert/Program.cs
+++ b/docs/examples/csharp/stmtInsert/Program.cs
@@ -76,7 +76,7 @@ namespace TDengineExample
static void PrepareSTable()
{
- IntPtr res = TDengine.Query(conn, "CREATE DATABASE power");
+ IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600");
CheckResPtr(res, "failed to create database");
res = TDengine.Query(conn, "USE power");
CheckResPtr(res, "failed to change database");
diff --git a/docs/examples/go/sub/main.go b/docs/examples/go/sub/main.go
index 334b8f290bd7d00e522ea1738a7822bdfea1d80d..cb24e351ab8cc5265cefbed9565d9a404aadf08d 100644
--- a/docs/examples/go/sub/main.go
+++ b/docs/examples/go/sub/main.go
@@ -15,7 +15,7 @@ func main() {
panic(err)
}
defer db.Close()
- _, err = db.Exec("create database if not exists example_tmq")
+ _, err = db.Exec("create database if not exists example_tmq wal_retention_period 3600")
if err != nil {
panic(err)
}
diff --git a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java
index e9af5e9ce0c0473f4513cbb949dcbd9f433c0c92..8da6f77bae432dee987d4567229c2fbebd657be8 100644
--- a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java
+++ b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java
@@ -35,7 +35,7 @@ public class SubscribeDemo {
try (Statement statement = connection.createStatement()) {
statement.executeUpdate("drop topic if exists " + TOPIC);
statement.executeUpdate("drop database if exists " + DB_NAME);
- statement.executeUpdate("create database " + DB_NAME);
+ statement.executeUpdate("create database " + DB_NAME + " wal_retention_period 3600");
statement.executeUpdate("use " + DB_NAME);
statement.executeUpdate(
"CREATE TABLE `meters` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` INT, `location` BINARY(24))");
diff --git a/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java b/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java
index d953a7364160a686d67b4390f3370999b02ce5d4..83cb04f55244aacf860573a42ddc952e1e522803 100644
--- a/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java
+++ b/docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java
@@ -35,7 +35,7 @@ public class WebsocketSubscribeDemo {
Statement statement = connection.createStatement()) {
statement.executeUpdate("drop topic if exists " + TOPIC);
statement.executeUpdate("drop database if exists " + DB_NAME);
- statement.executeUpdate("create database " + DB_NAME);
+ statement.executeUpdate("create database " + DB_NAME + " wal_retention_period 3600");
statement.executeUpdate("use " + DB_NAME);
statement.executeUpdate(
"CREATE TABLE `meters` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` INT, `location` BINARY(24))");
diff --git a/docs/examples/java/src/main/java/com/taos/example/highvolume/DataBaseMonitor.java b/docs/examples/java/src/main/java/com/taos/example/highvolume/DataBaseMonitor.java
index 04b149a4b96441ecfd1b0bdde54c9ed71349cab2..8678f65231153b1e05fb0141cd63272ee6941f9a 100644
--- a/docs/examples/java/src/main/java/com/taos/example/highvolume/DataBaseMonitor.java
+++ b/docs/examples/java/src/main/java/com/taos/example/highvolume/DataBaseMonitor.java
@@ -36,28 +36,17 @@ public class DataBaseMonitor {
stmt.execute("CREATE STABLE test.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)");
}
- public Long count() throws SQLException {
- if (!stmt.isClosed()) {
- ResultSet result = stmt.executeQuery("SELECT count(*) from test.meters");
+ public long count() throws SQLException {
+ try (ResultSet result = stmt.executeQuery("SELECT count(*) from test.meters")) {
result.next();
return result.getLong(1);
}
- return null;
}
- /**
- * show test.stables;
- *
- * name | created_time | columns | tags | tables |
- * ============================================================================================
- * meters | 2022-07-20 08:39:30.902 | 4 | 2 | 620000 |
- */
- public Long getTableCount() throws SQLException {
- if (!stmt.isClosed()) {
- ResultSet result = stmt.executeQuery("show test.stables");
+ public long getTableCount() throws SQLException {
+ try (ResultSet result = stmt.executeQuery("select count(*) from information_schema.ins_tables where db_name = 'test';")) {
result.next();
- return result.getLong(5);
+ return result.getLong(1);
}
- return null;
}
}
\ No newline at end of file
diff --git a/docs/examples/java/src/main/java/com/taos/example/highvolume/SQLWriter.java b/docs/examples/java/src/main/java/com/taos/example/highvolume/SQLWriter.java
index c2989acdbe3d0f56d7451ac86051a55955ce14de..dc820f161c8ae3a49f692b97ba6eaebbda304f90 100644
--- a/docs/examples/java/src/main/java/com/taos/example/highvolume/SQLWriter.java
+++ b/docs/examples/java/src/main/java/com/taos/example/highvolume/SQLWriter.java
@@ -42,7 +42,7 @@ public class SQLWriter {
/**
* Maximum SQL length.
*/
- private int maxSQLLength;
+ private int maxSQLLength = 800_000;
/**
* Map from table name to column values. For example:
@@ -81,14 +81,6 @@ public class SQLWriter {
conn = getConnection();
stmt = conn.createStatement();
stmt.execute("use test");
- ResultSet rs = stmt.executeQuery("show variables");
- while (rs.next()) {
- String configName = rs.getString(1);
- if ("maxSQLLength".equals(configName)) {
- maxSQLLength = Integer.parseInt(rs.getString(2));
- logger.info("maxSQLLength={}", maxSQLLength);
- }
- }
}
/**
@@ -149,7 +141,7 @@ public class SQLWriter {
} catch (SQLException e) {
// convert to error code defined in taoserror.h
int errorCode = e.getErrorCode() & 0xffff;
- if (errorCode == 0x362 || errorCode == 0x218) {
+ if (errorCode == 0x2603) {
// Table does not exist
createTables();
executeSQL(sql);
diff --git a/docs/examples/python/conn_websocket_pandas.py b/docs/examples/python/conn_websocket_pandas.py
new file mode 100644
index 0000000000000000000000000000000000000000..5cad5384b251b7016f895d4d0e8792e42bfc395f
--- /dev/null
+++ b/docs/examples/python/conn_websocket_pandas.py
@@ -0,0 +1,39 @@
+import pandas
+from sqlalchemy import create_engine, text
+import taos
+
+taos_conn = taos.connect()
+taos_conn.execute('drop database if exists power')
+taos_conn.execute('create database if not exists power wal_retention_period 3600')
+taos_conn.execute("use power")
+taos_conn.execute(
+ "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)")
+# insert data
+taos_conn.execute("""INSERT INTO power.d1001 USING power.meters TAGS('California.SanFrancisco', 2)
+VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000)
+('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000)
+ power.d1002 USING power.meters TAGS('California.SanFrancisco', 3)
+ VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000)
+ power.d1003 USING power.meters TAGS('California.LosAngeles', 2)
+ VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000)
+ power.d1004 USING power.meters TAGS('California.LosAngeles', 3)
+ VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)""")
+
+engine = create_engine("taosws://root:taosdata@localhost:6041")
+conn = engine.connect()
+df: pandas.DataFrame = pandas.read_sql(text("SELECT * FROM power.meters"), conn)
+conn.close()
+
+# print index
+print(df.index)
+# print data type of element in ts column
+print(type(df.ts[0]))
+print(df.head(3))
+
+# output:
+# RangeIndex(start=0, stop=8, step=1)
+#
+# ts current ... location groupid
+# 0 2018-10-03 14:38:05.000 10.3 ... California.SanFrancisco 2
+# 1 2018-10-03 14:38:15.000 12.6 ... California.SanFrancisco 2
+# 2 2018-10-03 14:38:16.800 12.3 ... California.SanFrancisco 2
diff --git a/docs/examples/python/connect_rest_with_req_id_examples.py b/docs/examples/python/connect_rest_with_req_id_examples.py
new file mode 100644
index 0000000000000000000000000000000000000000..3feb574fa60d5701aa040b606846cb6cf7a28aaa
--- /dev/null
+++ b/docs/examples/python/connect_rest_with_req_id_examples.py
@@ -0,0 +1,44 @@
+# ANCHOR: connect
+from taosrest import connect, TaosRestConnection, TaosRestCursor
+
+conn = connect(url="http://localhost:6041",
+ user="root",
+ password="taosdata",
+ timeout=30)
+
+# ANCHOR_END: connect
+# ANCHOR: basic
+# create STable
+cursor = conn.cursor()
+cursor.execute("DROP DATABASE IF EXISTS power", req_id=1)
+cursor.execute("CREATE DATABASE power", req_id=2)
+cursor.execute(
+ "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)", req_id=3)
+
+# insert data
+cursor.execute("""INSERT INTO power.d1001 USING power.meters TAGS('California.SanFrancisco', 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000)
+ power.d1002 USING power.meters TAGS('California.SanFrancisco', 3) VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000)
+ power.d1003 USING power.meters TAGS('California.LosAngeles', 2) VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000)
+ power.d1004 USING power.meters TAGS('California.LosAngeles', 3) VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)""", req_id=4)
+print("inserted row count:", cursor.rowcount)
+
+# query data
+cursor.execute("SELECT * FROM power.meters LIMIT 3", req_id=5)
+# get total rows
+print("queried row count:", cursor.rowcount)
+# get column names from cursor
+column_names = [meta[0] for meta in cursor.description]
+# get rows
+data = cursor.fetchall()
+print(column_names)
+for row in data:
+ print(row)
+
+# output:
+# inserted row count: 8
+# queried row count: 3
+# ['ts', 'current', 'voltage', 'phase', 'location', 'groupid']
+# [datetime.datetime(2018, 10, 3, 14, 38, 5, 500000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 11.8, 221, 0.28, 'california.losangeles', 2]
+# [datetime.datetime(2018, 10, 3, 14, 38, 16, 600000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 13.4, 223, 0.29, 'california.losangeles', 2]
+# [datetime.datetime(2018, 10, 3, 14, 38, 5, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 10.8, 223, 0.29, 'california.losangeles', 3]
+# ANCHOR_END: basic
diff --git a/docs/examples/python/connect_websocket_examples.py b/docs/examples/python/connect_websocket_examples.py
new file mode 100644
index 0000000000000000000000000000000000000000..29452bbf9d32b2e630575ef4f51fd2d10b59495a
--- /dev/null
+++ b/docs/examples/python/connect_websocket_examples.py
@@ -0,0 +1,29 @@
+# ANCHOR: connect
+import taosws
+
+conn = taosws.connect("taosws://root:taosdata@localhost:6041")
+# ANCHOR_END: connect
+
+# ANCHOR: basic
+conn.execute("drop database if exists connwspy")
+conn.execute("create database if not exists connwspy wal_retention_period 3600")
+conn.execute("use connwspy")
+conn.execute("create table if not exists stb (ts timestamp, c1 int) tags (t1 int)")
+conn.execute("create table if not exists tb1 using stb tags (1)")
+conn.execute("insert into tb1 values (now, 1)")
+conn.execute("insert into tb1 values (now, 2)")
+conn.execute("insert into tb1 values (now, 3)")
+
+r = conn.execute("select * from stb")
+result = conn.query("select * from stb")
+num_of_fields = result.field_count
+print(num_of_fields)
+
+for row in result:
+ print(row)
+
+# output:
+# 3
+# ('2023-02-28 15:56:13.329 +08:00', 1, 1)
+# ('2023-02-28 15:56:13.333 +08:00', 2, 1)
+# ('2023-02-28 15:56:13.337 +08:00', 3, 1)
diff --git a/docs/examples/python/connect_websocket_with_req_id_examples.py b/docs/examples/python/connect_websocket_with_req_id_examples.py
new file mode 100644
index 0000000000000000000000000000000000000000..f5f76c8446649e8b9b77b754d45eca0cb5d5a210
--- /dev/null
+++ b/docs/examples/python/connect_websocket_with_req_id_examples.py
@@ -0,0 +1,29 @@
+# ANCHOR: connect
+import taosws
+
+conn = taosws.connect("taosws://root:taosdata@localhost:6041")
+# ANCHOR_END: connect
+
+# ANCHOR: basic
+conn.execute("drop database if exists connwspy", req_id=1)
+conn.execute("create database if not exists connwspy", req_id=2)
+conn.execute("use connwspy", req_id=3)
+conn.execute("create table if not exists stb (ts timestamp, c1 int) tags (t1 int)", req_id=4)
+conn.execute("create table if not exists tb1 using stb tags (1)", req_id=5)
+conn.execute("insert into tb1 values (now, 1)", req_id=6)
+conn.execute("insert into tb1 values (now, 2)", req_id=7)
+conn.execute("insert into tb1 values (now, 3)", req_id=8)
+
+r = conn.execute("select * from stb", req_id=9)
+result = conn.query("select * from stb", req_id=10)
+num_of_fields = result.field_count
+print(num_of_fields)
+
+for row in result:
+ print(row)
+
+# output:
+# 3
+# ('2023-02-28 15:56:13.329 +08:00', 1, 1)
+# ('2023-02-28 15:56:13.333 +08:00', 2, 1)
+# ('2023-02-28 15:56:13.337 +08:00', 3, 1)
diff --git a/docs/examples/python/connection_usage_native_reference_with_req_id.py b/docs/examples/python/connection_usage_native_reference_with_req_id.py
new file mode 100644
index 0000000000000000000000000000000000000000..24d0914ad54eb9545ab56468230201f3e2bd3484
--- /dev/null
+++ b/docs/examples/python/connection_usage_native_reference_with_req_id.py
@@ -0,0 +1,45 @@
+import taos
+
+# ANCHOR: insert
+conn = taos.connect()
+# Execute a sql, ignore the result set, just get affected rows. It's useful for DDL and DML statement.
+conn.execute("DROP DATABASE IF EXISTS test", req_id=1)
+conn.execute("CREATE DATABASE test", req_id=2)
+# change database. same as execute "USE db"
+conn.select_db("test")
+conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)", req_id=3)
+affected_row = conn.execute("INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+1m, 23.5) (now+2m, 24.4)", req_id=4)
+print("affected_row", affected_row)
+# output:
+# affected_row 3
+# ANCHOR_END: insert
+
+# ANCHOR: query
+# Execute a sql and get its result set. It's useful for SELECT statement
+result = conn.query("SELECT * from weather", req_id=5)
+
+# Get fields from result
+fields = result.fields
+for field in fields:
+ print(field) # {name: ts, type: 9, bytes: 8}
+
+# output:
+# {name: ts, type: 9, bytes: 8}
+# {name: temperature, type: 6, bytes: 4}
+# {name: location, type: 4, bytes: 4}
+
+# Get data from result as list of tuple
+data = result.fetch_all()
+print(data)
+# output:
+# [(datetime.datetime(2022, 4, 27, 9, 4, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 5, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 6, 25, 367000), 24.399999618530273, 1)]
+
+# Or get data from result as a list of dict
+# map_data = result.fetch_all_into_dict()
+# print(map_data)
+# output:
+# [{'ts': datetime.datetime(2022, 4, 27, 9, 1, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 2, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 3, 15, 343000), 'temperature': 24.399999618530273, 'location': 1}]
+# ANCHOR_END: query
+
+
+conn.close()
\ No newline at end of file
diff --git a/docs/examples/python/cursor_usage_native_reference_with_req_id.py b/docs/examples/python/cursor_usage_native_reference_with_req_id.py
new file mode 100644
index 0000000000000000000000000000000000000000..15207ee6bc97fdb00918b98439fff785770f1334
--- /dev/null
+++ b/docs/examples/python/cursor_usage_native_reference_with_req_id.py
@@ -0,0 +1,32 @@
+import taos
+
+conn = taos.connect()
+cursor = conn.cursor()
+
+cursor.execute("DROP DATABASE IF EXISTS test", req_id=1)
+cursor.execute("CREATE DATABASE test", req_id=2)
+cursor.execute("USE test", req_id=3)
+cursor.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)", req_id=4)
+
+for i in range(1000):
+ location = str(i % 10)
+ tb = "t" + location
+ cursor.execute(f"INSERT INTO {tb} USING weather TAGS({location}) VALUES (now+{i}a, 23.5) (now+{i + 1}a, 23.5)", req_id=5+i)
+
+cursor.execute("SELECT count(*) FROM weather", req_id=1005)
+data = cursor.fetchall()
+print("count:", data[0][0])
+cursor.execute("SELECT tbname, * FROM weather LIMIT 2", req_id=1006)
+col_names = [meta[0] for meta in cursor.description]
+print(col_names)
+rows = cursor.fetchall()
+print(rows)
+
+cursor.close()
+conn.close()
+
+# output:
+# count: 2000
+# ['tbname', 'ts', 'temperature', 'location']
+# row_count: -1
+# [('t0', datetime.datetime(2022, 4, 27, 14, 54, 24, 392000), 23.5, 0), ('t0', datetime.datetime(2022, 4, 27, 14, 54, 24, 393000), 23.5, 0)]
diff --git a/docs/examples/python/kafka_example_common.py b/docs/examples/python/kafka_example_common.py
index 566748c94e2542aabe8265ed55c85e4b725d69bb..1c735abfc080f63f5bc4126a7f44474dbf5d157c 100644
--- a/docs/examples/python/kafka_example_common.py
+++ b/docs/examples/python/kafka_example_common.py
@@ -5,7 +5,7 @@ LOCATIONS = ['California.SanFrancisco', 'California.LosAngles', 'California.SanD
'California.PaloAlto', 'California.Campbell', 'California.MountainView', 'California.Sunnyvale',
'California.SantaClara', 'California.Cupertino']
-CREATE_DATABASE_SQL = 'create database if not exists {} keep 365 duration 10 buffer 16 wal_level 1'
+CREATE_DATABASE_SQL = 'create database if not exists {} keep 365 duration 10 buffer 16 wal_level 1 wal_retention_period 3600'
USE_DATABASE_SQL = 'use {}'
DROP_TABLE_SQL = 'drop table if exists meters'
DROP_DATABASE_SQL = 'drop database if exists {}'
diff --git a/docs/examples/python/rest_client_with_req_id_example.py b/docs/examples/python/rest_client_with_req_id_example.py
new file mode 100644
index 0000000000000000000000000000000000000000..918398e51eb8c5e33c6fed3b7e05afdbd1c66878
--- /dev/null
+++ b/docs/examples/python/rest_client_with_req_id_example.py
@@ -0,0 +1,9 @@
+from taosrest import RestClient
+
+client = RestClient("http://localhost:6041", user="root", password="taosdata")
+res: dict = client.sql("SELECT ts, current FROM power.meters LIMIT 1", req_id=1)
+print(res)
+
+# output:
+# {'status': 'succ', 'head': ['ts', 'current'], 'column_meta': [['ts', 9, 8], ['current', 6, 4]], 'data': [[datetime.datetime(2018, 10, 3, 14, 38, 5, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 10.3]], 'rows': 1}
+
diff --git a/docs/examples/python/result_set_with_req_id_examples.py b/docs/examples/python/result_set_with_req_id_examples.py
new file mode 100644
index 0000000000000000000000000000000000000000..90ae2f4f2671bf00669adc69270dc943a02c16aa
--- /dev/null
+++ b/docs/examples/python/result_set_with_req_id_examples.py
@@ -0,0 +1,33 @@
+import taos
+
+conn = taos.connect()
+conn.execute("DROP DATABASE IF EXISTS test", req_id=1)
+conn.execute("CREATE DATABASE test", req_id=2)
+conn.select_db("test")
+conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)", req_id=3)
+# prepare data
+for i in range(2000):
+ location = str(i % 10)
+ tb = "t" + location
+ conn.execute(f"INSERT INTO {tb} USING weather TAGS({location}) VALUES (now+{i}a, 23.5) (now+{i + 1}a, 23.5)", req_id=4+i)
+
+result: taos.TaosResult = conn.query("SELECT * FROM weather", req_id=2004)
+
+block_index = 0
+blocks: taos.TaosBlocks = result.blocks_iter()
+for rows, length in blocks:
+ print("block ", block_index, " length", length)
+ print("first row in this block:", rows[0])
+ block_index += 1
+
+conn.close()
+
+# possible output:
+# block 0 length 1200
+# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 46000), 23.5, 0)
+# block 1 length 1200
+# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 76000), 23.5, 3)
+# block 2 length 1200
+# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 99000), 23.5, 6)
+# block 3 length 400
+# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 122000), 23.5, 9)
diff --git a/docs/examples/python/tmq_example.py b/docs/examples/python/tmq_example.py
index 6f7fb87c89ce4cb96793d09a837f60ad54ae69bc..5b462fa1536d34a11824eed09310f1068735a7dc 100644
--- a/docs/examples/python/tmq_example.py
+++ b/docs/examples/python/tmq_example.py
@@ -6,7 +6,7 @@ def init_tmq_env(db, topic):
conn = taos.connect()
conn.execute("drop topic if exists {}".format(topic))
conn.execute("drop database if exists {}".format(db))
- conn.execute("create database if not exists {}".format(db))
+ conn.execute("create database if not exists {} wal_retention_period 3600".format(db))
conn.select_db(db)
conn.execute(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))")
diff --git a/docs/zh/04-concept/index.md b/docs/zh/04-concept/index.md
index 2cba68edcd152f5059845b9e25342b3f335f3b8b..b389b8d1ce2597c44f8164c0edc0dedc53d79efe 100644
--- a/docs/zh/04-concept/index.md
+++ b/docs/zh/04-concept/index.md
@@ -149,7 +149,7 @@ TDengine 建议用数据采集点的名字(如上表中的 d1001)来做表
3. 子表一定属于一张超级表,但普通表不属于任何超级表
4. 普通表无法转为子表,子表也无法转为普通表。
-超级表与与基于超级表建立的子表之间的关系表现在:
+超级表与基于超级表建立的子表之间的关系表现在:
1. 一张超级表包含有多张子表,这些子表具有相同的采集量 Schema,但带有不同的标签值。
2. 不能通过子表调整数据或标签的模式,对于超级表的数据模式修改立即对所有的子表生效。
diff --git a/docs/zh/05-get-started/03-package.md b/docs/zh/05-get-started/03-package.md
index 7edb9b62f468f7388a2343f38d919c307a3edb35..af5f1acae6e9958eddc814b9c8307c6a16d255ad 100644
--- a/docs/zh/05-get-started/03-package.md
+++ b/docs/zh/05-get-started/03-package.md
@@ -186,7 +186,7 @@ Active: inactive (dead)
-安装后,在 `C:\TDengine` 目录下,运行 `taosd.exe` 来启动 TDengine 服务进程。
+安装后,可以在拥有管理员权限的 cmd 窗口执行 `sc start taosd` 或在 `C:\TDengine` 目录下,运行 `taosd.exe` 来启动 TDengine 服务进程。
## TDengine 命令行(CLI)
@@ -196,20 +196,22 @@ Active: inactive (dead)
-安装后,在应用程序目录下,双击 TDengine 图标来启动程序,也可以运行 `launchctl start com.tdengine.taosd` 来启动 TDengine 服务进程。
+安装后,在应用程序目录下,双击 TDengine 图标来启动程序,也可以运行 `sudo launchctl start com.tdengine.taosd` 来启动 TDengine 服务进程。
-如下 `launchctl` 命令可以帮助你管理 TDengine 服务:
+如下 `launchctl` 命令用于管理 TDengine 服务:
-- 启动服务进程:`launchctl start com.tdengine.taosd`
+- 启动服务进程:`sudo launchctl start com.tdengine.taosd`
-- 停止服务进程:`launchctl stop com.tdengine.taosd`
+- 停止服务进程:`sudo launchctl stop com.tdengine.taosd`
-- 查看服务状态:`launchctl list | grep taosd`
+- 查看服务状态:`sudo launchctl list | grep taosd`
:::info
-- `launchctl` 命令不需要管理员权限,请不要在前面加 `sudo`。
-- `launchctl list | grep taosd` 指令返回的第一个内容是程序的 PID,若为 `-` 则说明 TDengine 服务未运行。
+- `launchctl` 命令管理`com.tdengine.taosd`需要管理员权限,务必在前面加 `sudo` 来增强安全性。
+- `sudo launchctl list | grep taosd` 指令返回的第一列是 `taosd` 程序的 PID,若为 `-` 则说明 TDengine 服务未运行。
+- 故障排查:
+- 如果服务异常请查看系统日志 `launchd.log` 或者 `/var/log/taos` 目录下 `taosdlog` 日志获取更多信息。
:::
diff --git a/docs/zh/05-get-started/index.md b/docs/zh/05-get-started/index.md
index ea586ff9baf83c370e773bfe6f60f37cac11a9b8..16172277b5accef4e0e5c707d1bb7f09ace23446 100644
--- a/docs/zh/05-get-started/index.md
+++ b/docs/zh/05-get-started/index.md
@@ -4,7 +4,7 @@ description: '快速设置 TDengine 环境并体验其高效写入和查询'
---
import xiaot from './xiaot.webp'
-import xiaot_new from './xiaot-new.webp'
+import xiaot_new from './xiaot-03.webp'
import channel from './channel.webp'
import official_account from './official-account.webp'
@@ -19,17 +19,6 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
```
-## 学习 TDengine 知识地图
-
-TDengine 知识地图中涵盖了 TDengine 的各种知识点,揭示了各概念实体之间的调用关系和数据流向。学习和了解 TDengine 知识地图有助于你快速掌握 TDengine 的知识体系。
-
-
-
-
-图 1. TDengine 知识地图
-
-
-
## 加入 TDengine 官方社区
微信扫描以下二维码,学习了解 TDengine 的最新技术,与大家共同交流物联网大数据技术应用、TDengine 使用问题和技巧等话题。
diff --git a/docs/zh/05-get-started/xiaot-03.webp b/docs/zh/05-get-started/xiaot-03.webp
new file mode 100644
index 0000000000000000000000000000000000000000..c115346e9e84ffb990aec5947b2107b5daf6e19b
Binary files /dev/null and b/docs/zh/05-get-started/xiaot-03.webp differ
diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx
index 5771e5053aa3cc79274d1c5b23c7f01965b7a9e2..036c9aa86e5c91903a74bffd1f9c59a13a97c116 100644
--- a/docs/zh/07-develop/07-tmq.mdx
+++ b/docs/zh/07-develop/07-tmq.mdx
@@ -7,6 +7,7 @@ title: 数据订阅
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Java from "./_sub_java.mdx";
+import JavaWS from "./_sub_java_ws.mdx";
import Python from "./_sub_python.mdx";
import Go from "./_sub_go.mdx";
import Rust from "./_sub_rust.mdx";
@@ -24,6 +25,7 @@ import CDemo from "./_sub_c.mdx";
本文档不对消息队列本身的基础知识做介绍,如果需要了解,请自行搜索。
+注意:默认是从wal消费数据,如果wal被删除,消费到的数据会不全,此时可以将参数 experimental.snapshot.enable 设置为true,从tsdb获取全部数据,但是这样的话就不能保证数据的消费顺序。所以建议根据自己的消费情况合理的设置wal的保留策略,保证可以从wal里订阅到全部数据。
## 主要数据结构和 API
不同语言下, TMQ 订阅相关的 API 及数据结构如下:
@@ -282,17 +284,17 @@ CREATE TOPIC topic_name AS DATABASE db_name;
| 参数名称 | 类型 | 参数说明 | 备注 |
| :----------------------------: | :-----: | -------------------------------------------------------- | ------------------------------------------- |
-| `td.connect.ip` | string | 用于创建连接,同 `taos_connect` | |
-| `td.connect.user` | string | 用于创建连接,同 `taos_connect` | |
-| `td.connect.pass` | string | 用于创建连接,同 `taos_connect` | |
-| `td.connect.port` | integer | 用于创建连接,同 `taos_connect` | |
+| `td.connect.ip` | string | 用于创建连接,同 `taos_connect` | 仅用于建立原生连接 |
+| `td.connect.user` | string | 用于创建连接,同 `taos_connect` | 仅用于建立原生连接 |
+| `td.connect.pass` | string | 用于创建连接,同 `taos_connect` | 仅用于建立原生连接 |
+| `td.connect.port` | integer | 用于创建连接,同 `taos_connect` | 仅用于建立原生连接 |
| `group.id` | string | 消费组 ID,同一消费组共享消费进度 | **必填项**。最大长度:192。 |
| `client.id` | string | 客户端 ID | 最大长度:192。 |
-| `auto.offset.reset` | enum | 消费组订阅的初始位置 | 可选:`earliest`(default), `latest`, `none` |
-| `enable.auto.commit` | boolean | 是否启用消费位点自动提交 | 合法值:`true`, `false`。 |
-| `auto.commit.interval.ms` | integer | 以毫秒为单位的消费记录自动提交消费位点时间间 | 默认 5000 m |
-| `experimental.snapshot.enable` | boolean | 是否允许从 TSDB 消费数据 | 实验功能,默认关闭 |
-| `msg.with.table.name` | boolean | 是否允许从消息中解析表名, 不适用于列订阅(列订阅时可将 tbname 作为列写入 subquery 语句) | |
+| `auto.offset.reset` | enum | 消费组订阅的初始位置 | `earliest`: default;从头开始订阅; `latest`: 仅从最新数据开始订阅; `none`: 没有提交的 offset 无法订阅 |
+| `enable.auto.commit` | boolean | 是否启用消费位点自动提交,true: 自动提交,客户端应用无需commit;false:客户端应用需要自行commit | 默认值为 true |
+| `auto.commit.interval.ms` | integer | 消费记录自动提交消费位点时间间隔,单位为毫秒 | 默认值为 5000 |
+| `experimental.snapshot.enable` | boolean | 是否允许从 TSDB 消费数据。当其关闭时,只能消费依据 WAL 保留策略仍然在WAL中的数据;当其打开时,除WAL中的数据以外,也能够消费已经从WAL中删除但落盘到TSDB中的数据 | 实验功能,默认关闭 |
+| `msg.with.table.name` | boolean | 是否允许从消息中解析表名, 不适用于列订阅(列订阅时可将 tbname 作为列写入 subquery 语句) |默认关闭 |
对于不同编程语言,其设置方式如下:
@@ -804,7 +806,14 @@ SHOW SUBSCRIPTIONS;
-
+
+
+
+
+
+
+
+
diff --git a/docs/zh/07-develop/09-udf.md b/docs/zh/07-develop/09-udf.md
index 7a3a3822d5f619337dc0c81482903b51f26a5e96..2eb4b3dee32d7326476bbca350c951ccd0482d71 100644
--- a/docs/zh/07-develop/09-udf.md
+++ b/docs/zh/07-develop/09-udf.md
@@ -65,11 +65,11 @@ int32_t aggfn_init() {
}
// aggregate start function. The intermediate value or the state(@interBuf) is initialized in this function. The function name shall be concatenation of udf name and _start suffix
-// @param interbuf intermediate value to intialize
+// @param interbuf intermediate value to initialize
// @return error number defined in taoserror.h
int32_t aggfn_start(SUdfInterBuf* interBuf) {
// initialize intermediate value in interBuf
- return TSDB_CODE_SUCESS;
+ return TSDB_CODE_SUCCESS;
}
// aggregate reduce function. This function aggregate old state(@interbuf) and one data bock(inputBlock) and output a new state(@newInterBuf).
diff --git a/docs/zh/07-develop/_sub_java.mdx b/docs/zh/07-develop/_sub_java.mdx
index a0505dabad08dd4a76f67139cde3125da8f830b3..60810ec27513b4ffd6142f6a58f09a31b65a878e 100644
--- a/docs/zh/07-develop/_sub_java.mdx
+++ b/docs/zh/07-develop/_sub_java.mdx
@@ -1,9 +1,3 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-
-
-
```java
{{#include docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java}}
```
@@ -12,20 +6,3 @@ import TabItem from '@theme/TabItem';
```
```java
{{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
-```
-
-
-
-
-```java
-{{#include docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java}}
-```
-```java
-{{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
-```
-```java
-{{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
-```
-
-
-
diff --git a/docs/zh/07-develop/_sub_java_ws.mdx b/docs/zh/07-develop/_sub_java_ws.mdx
new file mode 100644
index 0000000000000000000000000000000000000000..5a4211d05901c572cf7e3f7afd48f955395a159d
--- /dev/null
+++ b/docs/zh/07-develop/_sub_java_ws.mdx
@@ -0,0 +1,9 @@
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/WebsocketSubscribeDemo.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/MetersDeserializer.java}}
+```
+```java
+{{#include docs/examples/java/src/main/java/com/taos/example/Meters.java}}
+```
\ No newline at end of file
diff --git a/docs/zh/08-connector/02-rest-api.mdx b/docs/zh/08-connector/02-rest-api.mdx
index af2ec1b1c2f2c677efa3e0a5c5ca2e16fa3c9b27..a081595bca5f66bff3c60808126516633f92614b 100644
--- a/docs/zh/08-connector/02-rest-api.mdx
+++ b/docs/zh/08-connector/02-rest-api.mdx
@@ -69,7 +69,7 @@ curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" \
## HTTP 请求格式
```text
-http://:/rest/sql/[db_name][?tz=timezone]
+http://:/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
参数说明:
@@ -78,6 +78,7 @@ http://:/rest/sql/[db_name][?tz=timezone]
- port: 配置文件中 httpPort 配置项,缺省为 6041。
- db_name: 可选参数,指定本次所执行的 SQL 语句的默认数据库库名。
- tz: 可选参数,指定返回时间的时区,遵照 IANA Time Zone 规则,如 `America/New_York`。
+- req_id: 可选参数,指定请求 id,可以用于 tracing。
例如:`http://h1.taos.com:6041/rest/sql/test` 是指向地址为 `h1.taos.com:6041` 的 URL,并将默认使用的数据库库名设置为 `test`。
@@ -100,13 +101,13 @@ HTTP 请求的 BODY 里就是一个完整的 SQL 语句,SQL 语句中的数据
使用 `curl` 通过自定义身份认证方式来发起一个 HTTP Request,语法如下:
```bash
-curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone]
+curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
或者,
```bash
-curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone]
+curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone[&req_id=req_id]]
```
其中,`TOKEN` 为 `{username}:{password}` 经过 Base64 编码之后的字符串,例如 `root:taosdata` 编码后为 `cm9vdDp0YW9zZGF0YQ==`。
@@ -115,14 +116,41 @@ curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timez
### HTTP 响应码
-| **response code** | **说明** |
-|-------------------|----------------|
-| 200 | 正确返回和 C 接口错误返回 |
-| 400 | 参数错误返回 |
-| 401 | 鉴权失败 |
-| 404 | 接口不存在 |
-| 500 | 内部错误 |
-| 503 | 系统资源不足 |
+从 `TDengine 3.0.3.0` 开始 `taosAdapter` 提供配置参数 `httpCodeServerError` 用来设置当 C 接口返回错误时是否返回非 200 的http状态码
+
+| **说明** | **httpCodeServerError false** | **httpCodeServerError true** |
+|--------------------|-------------------------------|---------------------------------------|
+| taos_errno() 返回 0 | 200 | 200 |
+| taos_errno() 返回 非0 | 200(除鉴权错误) | 500 (除鉴权错误和 400/502 错误) |
+| 参数错误 | 400 (仅处理 HTTP 请求 URL 参数错误) | 400 (处理 HTTP 请求 URL 参数错误和 taosd 返回错误) |
+| 鉴权错误 | 401 | 401 |
+| 接口不存在 | 404 | 404 |
+| 集群不可用错误 | 502 | 502 |
+| 系统资源不足 | 503 | 503 |
+
+返回 400 的 C 错误码为:
+
+- TSDB_CODE_TSC_SQL_SYNTAX_ERROR ( 0x0216)
+- TSDB_CODE_TSC_LINE_SYNTAX_ERROR (0x021B)
+- TSDB_CODE_PAR_SYNTAX_ERROR (0x2600)
+- TSDB_CODE_TDB_TIMESTAMP_OUT_OF_RANGE (0x060B)
+- TSDB_CODE_TSC_VALUE_OUT_OF_RANGE (0x0224)
+- TSDB_CODE_PAR_INVALID_FILL_TIME_RANGE (0x263B)
+
+返回 401 的错误码为:
+
+- TSDB_CODE_MND_USER_ALREADY_EXIST (0x0350)
+- TSDB_CODE_MND_USER_NOT_EXIST ( 0x0351)
+- TSDB_CODE_MND_INVALID_USER_FORMAT (0x0352)
+- TSDB_CODE_MND_INVALID_PASS_FORMAT (0x0353)
+- TSDB_CODE_MND_NO_USER_FROM_CONN (0x0354)
+- TSDB_CODE_MND_TOO_MANY_USERS (0x0355)
+- TSDB_CODE_MND_INVALID_ALTER_OPER (0x0356)
+- TSDB_CODE_MND_AUTH_FAILURE (0x0357)
+
+返回 403 的错误码为:
+
+- TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED (0x0020)
### HTTP body 结构
@@ -270,7 +298,6 @@ curl http://192.168.0.1:6041/rest/login/root/taosdata
```json
{
- "status": "succ",
"code": 0,
"desc": "/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"
}
diff --git a/docs/zh/08-connector/10-cpp.mdx b/docs/zh/08-connector/10-cpp.mdx
index 35d30303c2b2b70da270cc0f49a8e867d8d43e99..9c5095f09cce0a833757da377e8c19be7a7e310d 100644
--- a/docs/zh/08-connector/10-cpp.mdx
+++ b/docs/zh/08-connector/10-cpp.mdx
@@ -263,6 +263,14 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
- `int taos_select_db(TAOS *taos, const char *db)`
将当前的缺省数据库设置为 `db`。
+
+- `int taos_get_current_db(TAOS *taos, char *database, int len, int *required)`
+
+ - database,len为用户在外面申请的空间,内部会把当前db赋值到database里。
+ - 只要是没有正常把db名赋值到database中(包括截断),返回错误,返回值为-1,然后用户可以通过 taos_errstr(NULL) 来获取错误提示。
+ - 如果,database == NULL 或者 len<=0 返回错误,required里保存存储db需要的空间(包含最后的'\0')
+ - 如果,len 小于 存储db需要的空间(包含最后的'\0'),返回错误,database里赋值截断的数据,以'\0'结尾。
+ - 如果,len 大于等于 存储db需要的空间(包含最后的'\0'),返回正常0,database里赋值以'\0‘结尾的db名。
- `void taos_close(TAOS *taos)`
@@ -302,7 +310,7 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
- `TAOS_FIELD *taos_fetch_fields(TAOS_RES *res)`
- 获取查询结果集每列数据的属性(列的名称、列的数据类型、列的长度),与 `taos_num_fileds()` 配合使用,可用来解析 `taos_fetch_row()` 返回的一个元组(一行)的数据。 `TAOS_FIELD` 的结构如下:
+ 获取查询结果集每列数据的属性(列的名称、列的数据类型、列的长度),与 `taos_num_fields()` 配合使用,可用来解析 `taos_fetch_row()` 返回的一个元组(一行)的数据。 `TAOS_FIELD` 的结构如下:
```c
typedef struct taosField {
@@ -493,5 +501,17 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
需要注意的是,时间戳分辨率参数只在协议类型为 `SML_LINE_PROTOCOL` 的时候生效。
对于 OpenTSDB 的文本协议,时间戳的解析遵循其官方解析规则 — 按照时间戳包含的字符的数量来确认时间精度。
- **支持版本**
- 该功能接口从 2.3.0.0 版本开始支持。
+ **schemaless 其他相关的接口**
+- `TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision)`
+- `TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl)`
+- `TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl, int64_t reqid)`
+- `TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl)`
+- `TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl, int64_t reqid)`
+
+ **说明**
+ - 上面这7个接口是扩展接口,主要用于在schemaless写入时传递ttl、reqid参数,可以根据需要使用。
+ - 带_raw的接口通过传递的参数lines指针和长度len来表示数据,为了解决原始接口数据包含'\0'而被截断的问题。totalRows指针返回解析出来的数据行数。
+ - 带_ttl的接口可以传递ttl参数来控制建表的ttl到期时间。
+ - 带_reqid的接口可以通过传递reqid参数来追踪整个的调用链。
diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx
index 061475f51e0cf9c25ba09d670e9ceef0bd2bab71..d1c12583659e2f6dd2a63357669b92c3b1ff29b1 100644
--- a/docs/zh/08-connector/14-java.mdx
+++ b/docs/zh/08-connector/14-java.mdx
@@ -17,7 +17,7 @@ import TabItem from '@theme/TabItem';
- JDBC 原生连接:Java 应用在物理节点 1(pnode1)上使用 TSDBDriver 直接调用客户端驱动(libtaos.so 或 taos.dll)的 API 将写入和查询请求发送到位于物理节点 2(pnode2)上的 taosd 实例。
- JDBC REST 连接:Java 应用通过 RestfulDriver 将 SQL 封装成一个 REST 请求,发送给物理节点 2 的 REST 服务器(taosAdapter),通过 REST 服务器请求 taosd 并返回结果。
-使用 REST 连接,不依赖 TDengine 客户端驱动,可以跨平台,更加方便灵活,但性能比原生连接器低约 30%。
+使用 REST 连接,不依赖 TDengine 客户端驱动,可以跨平台,更加方便灵活。
:::info
TDengine 的 JDBC 驱动实现尽可能与关系型数据库驱动保持一致,但 TDengine 与关系对象型数据库的使用场景和技术特征存在差异,所以`taos-jdbcdriver` 与传统的 JDBC driver 也存在一定差异。在使用时需要注意以下几点:
@@ -728,7 +728,7 @@ consumer.close()
详情请参考:[数据订阅](../../../develop/tmq)
-### 使用示例如下:
+#### 完整示例
diff --git a/docs/zh/08-connector/20-go.mdx b/docs/zh/08-connector/20-go.mdx
index 2aa1a58e49f34b412f12bd0d67586dc6e56cf0bc..fd6df992b530fdce4427e34ef8bc227f449eaac7 100644
--- a/docs/zh/08-connector/20-go.mdx
+++ b/docs/zh/08-connector/20-go.mdx
@@ -122,7 +122,7 @@ _taosSql_ 通过 cgo 实现了 Go 的 `database/sql/driver` 接口。只需要
使用 `taosSql` 作为 `driverName` 并且使用一个正确的 [DSN](#DSN) 作为 `dataSourceName`,DSN 支持的参数:
-* configPath 指定 taos.cfg 目录
+* cfg 指定 taos.cfg 目录
示例:
diff --git a/docs/zh/08-connector/30-python.mdx b/docs/zh/08-connector/30-python.mdx
index b2f2118f39c8e89742cbde2301416d9b4dbacdbe..5395610df3ce5535293f8017f5e14c403e9a8279 100644
--- a/docs/zh/08-connector/30-python.mdx
+++ b/docs/zh/08-connector/30-python.mdx
@@ -10,7 +10,9 @@ import TabItem from "@theme/TabItem";
`taospy` 是 TDengine 的官方 Python 连接器。`taospy` 提供了丰富的 API, 使得 Python 应用可以很方便地使用 TDengine。`taospy` 对 TDengine 的[原生接口](../cpp)和 [REST 接口](../rest-api)都进行了封装, 分别对应 `taospy` 包的 `taos` 模块 和 `taosrest` 模块。
除了对原生接口和 REST 接口的封装,`taospy` 还提供了符合 [Python 数据访问规范(PEP 249)](https://peps.python.org/pep-0249/) 的编程接口。这使得 `taospy` 和很多第三方工具集成变得简单,比如 [SQLAlchemy](https://www.sqlalchemy.org/) 和 [pandas](https://pandas.pydata.org/)。
-使用客户端驱动提供的原生接口直接与服务端建立的连接的方式下文中称为“原生连接”;使用 taosAdapter 提供的 REST 接口与服务端建立的连接的方式下文中称为“REST 连接”。
+`taos-ws-py` 是使用 WebSocket 方式连接 TDengine 的 Python 连接器包。可以选装。
+
+使用客户端驱动提供的原生接口直接与服务端建立的连接的方式下文中称为“原生连接”;使用 taosAdapter 提供的 REST 接口或 WebSocket 接口与服务端建立的连接的方式下文中称为“REST 连接”或“WebSocket 连接”。
Python 连接器的源码托管在 [GitHub](https://github.com/taosdata/taos-connector-python)。
@@ -115,6 +117,15 @@ import taos
import taosrest
```
+
+
+
+对于 WebSocket 连接,只需验证是否能成功导入 `taosws` 模块。可在 Python 交互式 Shell 中输入:
+
+```python
+import taosws
+```
+
@@ -183,6 +194,27 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()"
}
```
+
+
+
+对于 WebSocket 连接, 除了确保集群已经启动,还要确保 taosAdapter 组件已经启动。可以使用如下 curl 命令测试:
+
+```
+curl -i -N -d "show databases" -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: :" -H "Origin: http://:" http://:/rest/sql
+```
+
+上面的 FQDN 为运行 taosAdapter 的机器的 FQDN, PORT 为 taosAdapter 配置的监听端口, 默认为 6041。
+如果测试成功,会输出服务器版本信息,比如:
+
+```json
+HTTP/1.1 200 OK
+Content-Type: application/json; charset=utf-8
+Date: Tue, 21 Mar 2023 09:29:17 GMT
+Transfer-Encoding: chunked
+
+{"status":"succ","head":["server_version()"],"column_meta":[["server_version()",8,8]],"data":[["2.6.0.27"]],"rows":1}
+```
+
@@ -229,6 +261,16 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()"
- `password`: TDengine 用户密码。默认是 taosdata。
- `timeout`: HTTP 请求超时时间。单位为秒。默认为 `socket._GLOBAL_DEFAULT_TIMEOUT`。 一般无需配置。
+
+
+
+
+```python
+{{#include docs/examples/python/connect_websocket_examples.py:connect}}
+```
+
+`connect()` 函数参数为连接 url,协议为 `taosws` 或 `ws`
+
@@ -298,8 +340,94 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
```
对于 `sql()` 方法更详细的介绍, 请参考 [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html)。
+
+
+```python
+{{#include docs/examples/python/connect_websocket_examples.py:basic}}
+```
+- `conn.execute`: 用来执行任意 SQL 语句,返回影响的行数
+- `conn.query`: 用来执行查询 SQL 语句,返回查询结果
+
+
+
+
+### 与 req_id 一起使用
+
+使用可选的 req_id 参数,指定请求 id,可以用于 tracing
+
+
+
+
+##### TaosConnection 类的使用
+
+`TaosConnection` 类既包含对 PEP249 Connection 接口的实现(如:`cursor`方法和 `close` 方法),也包含很多扩展功能(如: `execute`、 `query`、`schemaless_insert` 和 `subscribe` 方法。
+
+```python title="execute 方法"
+{{#include docs/examples/python/connection_usage_native_reference_with_req_id.py:insert}}
+```
+
+```python title="query 方法"
+{{#include docs/examples/python/connection_usage_native_reference_with_req_id.py:query}}
+```
+
+:::tip
+查询结果只能获取一次。比如上面的示例中 `fetch_all()` 和 `fetch_all_into_dict()` 只能用一个。重复获取得到的结果为空列表。
+:::
+
+##### TaosResult 类的使用
+
+上面 `TaosConnection` 类的使用示例中,我们已经展示了两种获取查询结果的方法: `fetch_all()` 和 `fetch_all_into_dict()`。除此之外 `TaosResult` 还提供了按行迭代(`rows_iter`)或按数据块迭代(`blocks_iter`)结果集的方法。在查询数据量较大的场景,使用这两个方法会更高效。
+
+```python title="blocks_iter 方法"
+{{#include docs/examples/python/result_set_with_req_id_examples.py}}
+```
+##### TaosCursor 类的使用
+
+`TaosConnection` 类和 `TaosResult` 类已经实现了原生接口的所有功能。如果你对 PEP249 规范中的接口比较熟悉也可以使用 `TaosCursor` 类提供的方法。
+
+```python title="TaosCursor 的使用"
+{{#include docs/examples/python/cursor_usage_native_reference_with_req_id.py}}
+```
+
+:::note
+TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线程的场景下,这个游标实例必须保持线程独享,不能跨线程共享使用,否则会导致返回结果出现错误。
+
+:::
+
+
+
+
+##### TaosRestCursor 类的使用
+
+`TaosRestCursor` 类是对 PEP249 Cursor 接口的实现。
+
+```python title="TaosRestCursor 的使用"
+{{#include docs/examples/python/connect_rest_with_req_id_examples.py:basic}}
+```
+- `cursor.execute` : 用来执行任意 SQL 语句。
+- `cursor.rowcount`: 对于写入操作返回写入成功记录数。对于查询操作,返回结果集行数。
+- `cursor.description` : 返回字段的描述信息。关于描述信息的具体格式请参考[TaosRestCursor](https://docs.taosdata.com/api/taospy/taosrest/cursor.html)。
+
+##### RestClient 类的使用
+
+`RestClient` 类是对于 [REST API](../rest-api) 的直接封装。它只包含一个 `sql()` 方法用于执行任意 SQL 语句, 并返回执行结果。
+
+```python title="RestClient 的使用"
+{{#include docs/examples/python/rest_client_with_req_id_example.py}}
+```
+
+对于 `sql()` 方法更详细的介绍, 请参考 [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html)。
+
+
+
+```python
+{{#include docs/examples/python/connect_websocket_with_req_id_examples.py:basic}}
+```
+
+- `conn.execute`: 用来执行任意 SQL 语句,返回影响的行数
+- `conn.query`: 用来执行查询 SQL 语句,返回查询结果
@@ -320,6 +448,13 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
{{#include docs/examples/python/conn_rest_pandas.py}}
```
+
+
+
+```python
+{{#include docs/examples/python/conn_websocket_pandas.py}}
+```
+
@@ -335,15 +470,17 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
```python
{{#include docs/examples/python/tmq_example.py}}
```
+
-
+
除了原生的连接方式,Python 连接器还支持通过 websocket 订阅 TMQ 数据。
```python
{{#include docs/examples/python/tmq_websocket_example.py}}
```
+
@@ -366,7 +503,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
```python
{{#include docs/examples/python/handle_exception.py}}
```
-
+``
### 关于纳秒 (nanosecond)
由于目前 Python 对 nanosecond 支持的不完善(见下面的链接),目前的实现方式是在 nanosecond 精度时返回整数,而不是 ms 和 us 返回的 datetime 类型,应用开发者需要自行处理,建议使用 pandas 的 to_datetime()。未来如果 Python 正式完整支持了纳秒,Python 连接器可能会修改相关接口。
diff --git a/docs/zh/08-connector/40-csharp.mdx b/docs/zh/08-connector/40-csharp.mdx
index 80a831bab9d7343eaa85242c2e0e5e85c9f0d864..3a945e77fd3295061847063e7c2d0de4a67790a5 100644
--- a/docs/zh/08-connector/40-csharp.mdx
+++ b/docs/zh/08-connector/40-csharp.mdx
@@ -96,7 +96,7 @@ dotnet add package TDengine.Connector
-
+
diff --git a/docs/zh/08-connector/_linux_install.mdx b/docs/zh/08-connector/_linux_install.mdx
index 0b1f415f54d28e65a519d35ab94a84b3aa8338ba..b16ab2ac5b0696ee8e4077706e80f6e4267faf1b 100644
--- a/docs/zh/08-connector/_linux_install.mdx
+++ b/docs/zh/08-connector/_linux_install.mdx
@@ -14,7 +14,7 @@ import PkgListV3 from "/components/PkgListV3";
解压软件包之后,会在解压目录下看到以下文件(目录):
- _ install_client.sh_:安装脚本,用于应用驱动程序
- - _ taos.tar.gz_:应用驱动安装包
+ - _ package.tar.gz_:应用驱动安装包
- _ driver_:TDengine 应用驱动 driver
- _examples_: 各种编程语言的示例程序(c/C#/go/JDBC/MATLAB/python/R)
运行 install_client.sh 进行安装。
diff --git a/docs/zh/08-connector/index.md b/docs/zh/08-connector/index.md
index f3f0f23b34d0b75b69d8dd866566ac98f306f13f..eb1f3a9a9a728f666f9964ef51795b76991d1fcc 100644
--- a/docs/zh/08-connector/index.md
+++ b/docs/zh/08-connector/index.md
@@ -60,7 +60,7 @@ TDengine 版本更新往往会增加新的功能特性,列表中的连接器
| **连接管理** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
| **普通查询** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
| **参数绑定** | 暂不支持 | 暂不支持 | 支持 | 支持 | 暂不支持 | 支持 |
-| **数据订阅(TMQ)** | 暂不支持 | 支持 | 支持 | 暂不支持 | 暂不支持 | 支持 |
+| **数据订阅(TMQ)** | 支持 | 支持 | 支持 | 暂不支持 | 暂不支持 | 支持 |
| **Schemaless** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 |
| **批量拉取(基于 WebSocket)** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
| **DataFrame** | 不支持 | 支持 | 不支持 | 不支持 | 不支持 | 不支持 |
diff --git a/docs/zh/10-deployment/03-k8s.md b/docs/zh/10-deployment/03-k8s.md
index 0cae59657c2a0199d3452bc37d36f2c537944d21..39ca56f3d978062f175ef8196ad1affe4bcd562b 100644
--- a/docs/zh/10-deployment/03-k8s.md
+++ b/docs/zh/10-deployment/03-k8s.md
@@ -102,7 +102,7 @@ spec:
# Must set if you want a cluster.
- name: TAOS_FIRST_EP
value: "$(STS_NAME)-0.$(SERVICE_NAME).$(STS_NAMESPACE).svc.cluster.local:$(TAOS_SERVER_PORT)"
- # TAOS_FQND should always be setted in k8s env.
+ # TAOS_FQND should always be set in k8s env.
- name: TAOS_FQDN
value: "$(POD_NAME).$(SERVICE_NAME).$(STS_NAMESPACE).svc.cluster.local"
volumeMounts:
diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md
index 9e346fdca8ca82a046b02f3d49a1b27ad8457b9d..b54998e08d33869d113ae883b14f929e5381f168 100644
--- a/docs/zh/12-taos-sql/02-database.md
+++ b/docs/zh/12-taos-sql/02-database.md
@@ -35,8 +35,8 @@ database_option: {
| TABLE_SUFFIX value
| TSDB_PAGESIZE value
| WAL_RETENTION_PERIOD value
- | WAL_ROLL_PERIOD value
| WAL_RETENTION_SIZE value
+ | WAL_ROLL_PERIOD value
| WAL_SEGMENT_SIZE value
}
```
@@ -75,11 +75,10 @@ database_option: {
- TABLE_PREFIX:内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的前缀的长度。
- TABLE_SUFFIX:内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的后缀的长度。
- TSDB_PAGESIZE:一个 VNODE 中时序数据存储引擎的页大小,单位为 KB,默认为 4 KB。范围为 1 到 16384,即 1 KB到 16 MB。
-- WAL_RETENTION_PERIOD:数据订阅已消费WAL日志,WAL文件的最大额外保留的时长策略。单位为 s。默认为 0,表示无需额外保留。-1, 表示额外保留,时间无上限。
-- WAL_RETENTION_SIZE:数据订阅已消费WAL日志,WAL文件的最大额外保留的累计大小策略。单位为 KB。默认为 0,表示无需额外保留。-1, 表示额外保留,累计大小无上限。
+- WAL_RETENTION_PERIOD: 为了数据订阅消费,需要WAL日志文件额外保留的最大时长策略。WAL日志清理,不受订阅客户端消费状态影响。单位为 s。默认为 0,表示无需为订阅保留。新建订阅,应先设置恰当的时长策略。
+- WAL_RETENTION_SIZE:为了数据订阅消费,需要WAL日志文件额外保留的最大累计大小策略。单位为 KB。默认为 0,表示累计大小无上限。
- WAL_ROLL_PERIOD:wal 文件切换时长,单位为 s。当WAL文件创建并写入后,经过该时间,会自动创建一个新的WAL文件。默认为 0,即仅在TSDB落盘时创建新文件。
- WAL_SEGMENT_SIZE:wal 单个文件大小,单位为 KB。当前写入文件大小超过上限后会自动创建一个新的WAL文件。默认为 0,即仅在TSDB落盘时创建新文件。
-
### 创建数据库示例
```sql
@@ -179,6 +178,14 @@ TRIM DATABASE db_name;
删除过期数据,并根据多级存储的配置归整数据。
+## 落盘内存数据
+
+```sql
+FLUSH DATABASE db_name;
+```
+
+落盘内存中的数据。在关闭节点之前,执行这条命令可以避免重启后的数据回放,加速启动过程。
+
## 调整VGROUP中VNODE的分布
```sql
@@ -194,3 +201,11 @@ BALANCE VGROUP
```
自动调整集群所有vgroup中的vnode分布,相当于在vnode级别对集群进行数据的负载均衡操作。
+
+## 查看数据库工作状态
+
+```sql
+SHOW db_name.ALIVE;
+```
+
+查询数据库 db_name 的可用状态,返回值 0:不可用 1:完全可用 2:部分可用(即数据库包含的 VNODE 部分节点可用,部分节点不可用)
diff --git a/docs/zh/12-taos-sql/04-stable.md b/docs/zh/12-taos-sql/04-stable.md
index c5933228decfb3eb865cad058fa6fbba77fefb58..74ef52ee7c53d6c619a47d7e6453b56f152104a2 100644
--- a/docs/zh/12-taos-sql/04-stable.md
+++ b/docs/zh/12-taos-sql/04-stable.md
@@ -13,12 +13,11 @@ create_definition:
col_name column_definition
column_definition:
- type_name [COMMENT 'string_value']
+ type_name
```
**使用说明**
- 超级表中列的最大个数为 4096,需要注意,这里的 4096 是包含 TAG 列在内的,最小个数为 3,包含一个时间戳主键、一个 TAG 列和一个数据列。
-- 建表时可以给列或标签附加注释。
- TAGS语法指定超级表的标签列,标签列需要遵循以下约定:
- TAGS 中的 TIMESTAMP 列写入数据时需要提供给定值,而暂不支持四则运算,例如 NOW + 10s 这类表达式。
- TAGS 列名不能与其他列名相同。
diff --git a/docs/zh/12-taos-sql/07-tag-index.md b/docs/zh/12-taos-sql/07-tag-index.md
new file mode 100644
index 0000000000000000000000000000000000000000..ae16b0b2ec4db26361c4b241fd6188bfe0df9b5e
--- /dev/null
+++ b/docs/zh/12-taos-sql/07-tag-index.md
@@ -0,0 +1,51 @@
+---
+sidebar_label: 标签索引
+title: 标签索引
+description: 使用标签索引提升查询性能
+---
+
+## 简介
+
+在 TDengine 3.0.3.0 版本之前(不含),默认在第一列 TAG 上建立索引,但不支持给其它列动态添加索引。从 3.0.3.0 版本开始,可以动态地为其它 TAG 列添加索引。对于第一个 TAG 列上自动建立的索引,其在查询中默认生效,且用户无法对其进行任何干预。适当地使用索引能够有效地提升查询性能。
+
+## 语法
+
+创建索引的语法如下
+
+```sql
+CREATE INDEX index_name ON tbl_name (tagColName)
+```
+
+其中 `index_name` 为索引名称, `tbl_name` 为超级表名称,`tagColName` 为要在其上建立索引的 tag 列的名称。`tagColName` 的类型不受限制,即任何类型的 tag 列都可以建立索引。
+
+删除索引的语法如下
+
+```sql
+DROP INDEX index_name
+```
+
+其中 `index_name` 为已经建立的某个索引的名称,如果该索引不存在则该命令执行失败,但不会对系统产生任何其它影响。
+
+查看系统中已经存在的索引
+
+```sql
+SELECT * FROM information_schema.INS_INDEXES
+```
+
+也可以为上面的查询语句加上过滤条件以缩小查询范围。
+
+## 使用说明
+
+1. 索引使用得当能够提升数据过滤的效率,目前支持的过滤算子有 `=`, `>`, `>=`, `<`, `<=`。如果查询过滤条件中使用了这些算子,则索引能够明显提升查询效率。但如果查询过滤条件中使用的是其它算子,则索引起不到作用,查询效率没有变化。未来会逐步添加更多的算子。
+
+2. 针对一个 tag 列只能建立一个索引,如果重复创建索引则会报错。
+
+3. 每次只能针对一个 tag 列建立一个索引,不能同时对多个 tag 建立索引。
+
+4. 整个系统中不管是哪种类型的索引,其名称必须唯一。
+
+5. 对索引个数没有限制,但每增加一个索引都会导致系统中的元数据增加,过多的索引会降低元数据存取的效率从而降低整个系统的性能。所以请尽量避免添加不必要的索引。
+
+6. 不支持对普通和子表建立索引。
+
+7. 如果某个 tag 列的唯一值较少时,不建议对其建立索引,这种情况下收效甚微。
\ No newline at end of file
diff --git a/docs/zh/12-taos-sql/12-distinguished.md b/docs/zh/12-taos-sql/12-distinguished.md
index d36c852e7975dbe602166d8c7d12027043c2e302..f750124049c5b0dabecb359fe8c1b9d28ca1f431 100644
--- a/docs/zh/12-taos-sql/12-distinguished.md
+++ b/docs/zh/12-taos-sql/12-distinguished.md
@@ -31,15 +31,17 @@ select max(current) from meters partition by location interval(10m)
## 窗口切分查询
-TDengine 支持按时间窗口切分方式进行聚合结果查询,比如温度传感器每秒采集一次数据,但需查询每隔 10 分钟的温度平均值。这种场景下可以使用窗口子句来获得需要的查询结果。窗口子句用于针对查询的数据集合按照窗口切分成为查询子集并进行聚合,窗口包含时间窗口(time window)、状态窗口(status window)、会话窗口(session window)三种窗口。其中时间窗口又可划分为滑动时间窗口和翻转时间窗口。窗口切分查询语法如下:
+TDengine 支持按时间窗口切分方式进行聚合结果查询,比如温度传感器每秒采集一次数据,但需查询每隔 10 分钟的温度平均值。这种场景下可以使用窗口子句来获得需要的查询结果。窗口子句用于针对查询的数据集合按照窗口切分成为查询子集并进行聚合,窗口包含时间窗口(time window)、状态窗口(status window)、会话窗口(session window)、条件窗口(event window)四种窗口。其中时间窗口又可划分为滑动时间窗口和翻转时间窗口。
+
+窗口子句语法如下:
```sql
-SELECT select_list FROM tb_name
- [WHERE where_condition]
- [SESSION(ts_col, tol_val)]
- [STATE_WINDOW(col)]
- [INTERVAL(interval [, offset]) [SLIDING sliding]]
- [FILL({NONE | VALUE | PREV | NULL | LINEAR | NEXT})]
+window_clause: {
+ SESSION(ts_col, tol_val)
+ | STATE_WINDOW(col)
+ | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [FILL(fill_mod_and_val)]
+ | EVENT_WINDOW START WITH start_trigger_condition END WITH end_trigger_condition
+}
```
在上述语法中的具体限制如下
@@ -67,6 +69,16 @@ FILL 语句指定某一窗口区间数据缺失的情况下的填充模式。填
5. LINEAR 填充:根据前后距离最近的非 NULL 值做线性插值填充。例如:FILL(LINEAR)。
6. NEXT 填充:使用下一个非 NULL 值填充数据。例如:FILL(NEXT)。
+以上填充模式中,除了 NONE 模式默认不填充值之外,其他模式在查询的整个时间范围内如果没有数据 FILL 子句将被忽略,即不产生填充数据,查询结果为空。这种行为在部分模式(PREV、NEXT、LINEAR)下具有合理性,因为在这些模式下没有数据意味着无法产生填充数值。而对另外一些模式(NULL、VALUE)来说,理论上是可以产生填充数值的,至于需不需要输出填充数值,取决于应用的需求。所以为了满足这类需要强制填充数据或 NULL 的应用的需求,同时不破坏现有填充模式的行为兼容性,从 3.0.3.0 版本开始,增加了两种新的填充模式:
+
+7. NULL_F: 强制填充 NULL 值
+8. VALUE_F: 强制填充 VALUE 值
+
+NULL, NULL_F, VALUE, VALUE_F 这几种填充模式针对不同场景区别如下:
+- INTERVAL 子句: NULL_F, VALUE_F 为强制填充模式;NULL, VALUE 为非强制模式。在这种模式下下各自的语义与名称相符
+- 流计算中的 INTERVAL 子句:NULL_F 与 NULL 行为相同,均为非强制模式;VALUE_F 与 VALUE 行为相同,均为非强制模式。即流计算中的 INTERVAL 没有强制模式
+- INTERP 子句:NULL 与 NULL_F 行为相同,均为强制模式;VALUE 与 VALUE_F 行为相同,均为强制模式。即 INTERP 中没有非强制模式。
+
:::info
1. 使用 FILL 语句的时候可能生成大量的填充输出,务必指定查询的时间区间。针对每次查询,系统可返回不超过 1 千万条具有插值的结果。
@@ -138,6 +150,24 @@ SELECT tbname, _wstart, CASE WHEN voltage >= 205 and voltage <= 235 THEN 1 ELSE
SELECT COUNT(*), FIRST(ts) FROM temp_tb_1 SESSION(ts, tol_val);
```
+### 事件窗口
+
+事件窗口根据开始条件和结束条件来划定窗口,当start_trigger_condition满足时则窗口开始,直到end_trigger_condition满足时窗口关闭。start_trigger_condition和end_trigger_condition可以是任意 TDengine 支持的条件表达式,且可以包含不同的列。
+
+事件窗口可以仅包含一条数据。即当一条数据同时满足start_trigger_condition和end_trigger_condition,且当前不在一个窗口内时,这条数据自己构成了一个窗口。
+
+事件窗口无法关闭时,不构成一个窗口,不会被输出。即有数据满足start_trigger_condition,此时窗口打开,但后续数据都不能满足end_trigger_condition,这个窗口无法被关闭,这部分数据不够成一个窗口,不会被输出。
+
+如果直接在超级表上进行事件窗口查询,TDengine 会将超级表的数据汇总成一条时间线,然后进行事件窗口的计算。
+如果需要对子查询的结果集进行事件窗口查询,那么子查询的结果集需要满足按时间线输出的要求,且可以输出有效的时间戳列。
+
+以下面的 SQL 语句为例,事件窗口切分如图所示:
+```sql
+select _wstart, _wend, count(*) from t event_window start with c1 > 0 end with c2 < 10
+```
+
+
+
### 时间戳伪列
窗口聚合查询结果中,如果 SQL 语句中没有指定输出查询结果中的时间戳列,那么最终结果中不会自动包含窗口的时间列信息。如果需要在结果中输出聚合结果所对应的时间窗口信息,需要在 SELECT 子句中使用时间戳相关的伪列: 时间窗口起始时间 (\_WSTART), 时间窗口结束时间 (\_WEND), 时间窗口持续时间 (\_WDURATION), 以及查询整体窗口相关的伪列: 查询窗口起始时间(\_QSTART) 和查询窗口结束时间(\_QEND)。需要注意的是时间窗口起始时间和结束时间均是闭区间,时间窗口持续时间是数据当前时间分辨率下的数值。例如,如果当前数据库的时间分辨率是毫秒,那么结果中 500 就表示当前时间窗口的持续时间是 500毫秒 (500 ms)。
diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md
index 8fd704ef551c9ebda61678bd129917e67cbfbef8..d416febd55521853812fbe6952d403f4d265ac4e 100644
--- a/docs/zh/12-taos-sql/20-keywords.md
+++ b/docs/zh/12-taos-sql/20-keywords.md
@@ -269,7 +269,7 @@ description: TDengine 保留关键字的详细列表
- SPLIT
- STABLE
- STABLES
-- STAR
+- START
- STATE
- STATE_WINDOW
- STATEMENT
diff --git a/docs/zh/12-taos-sql/21-node.md b/docs/zh/12-taos-sql/21-node.md
index 4116343730eee014047de99291c868b792153cd7..778d699099b3a564d57cbe0d0374dbdcb0fde0dc 100644
--- a/docs/zh/12-taos-sql/21-node.md
+++ b/docs/zh/12-taos-sql/21-node.md
@@ -119,6 +119,14 @@ DROP QNODE ON DNODE dnode_id;
删除 ID 为 dnode_id 的 DNODE 上的 QNODE,但并不会影响该 dnode 的状态。
+## 查询集群状态
+
+```sql
+SHOW CLUSTER ALIVE;
+```
+
+查询当前集群的状态是否可用,返回值: 0:不可用 1:完全可用 2:部分可用(集群中部分节点下线,但其它节点仍可以正常使用)
+
## 修改客户端配置
如果将客户端也看作广义的集群的一部分,可以通过如下命令动态修改客户端配置参数。
diff --git a/docs/zh/12-taos-sql/22-meta.md b/docs/zh/12-taos-sql/22-meta.md
index c05dbf9c2afa0e477cff3029146b87482fbb6c36..1f2e3fb7d5742a01abae8fb9caf13ef090312cdc 100644
--- a/docs/zh/12-taos-sql/22-meta.md
+++ b/docs/zh/12-taos-sql/22-meta.md
@@ -166,7 +166,7 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数
| 7 | vgroup_id | INT | vgroup id |
| 8 | ttl | INT | 表的生命周期。需要注意,`ttl` 为 TDengine 关键字,作为列名使用时需要使用 ` 进行转义。 |
| 9 | table_comment | BINARY(1024) | 表注释 |
-| 10 | type | BINARY(20) | 表类型 |
+| 10 | type | BINARY(21) | 表类型 |
## INS_TAGS
@@ -179,6 +179,20 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数
| 5 | tag_type | BINARY(64) | tag 的类型 |
| 6 | tag_value | BINARY(16384) | tag 的值 |
+## INS_COLUMNS
+
+| # | **列名** | **数据类型** | **说明** |
+| --- | :---------: | ------------- | ---------------------- |
+| 1 | table_name | BINARY(192) | 表名 |
+| 2 | db_name | BINARY(64) | 该表所在的数据库的名称 |
+| 3 | table_type | BINARY(21) | 表类型 |
+| 4 | col_name | BINARY(64) | 列 的名称 |
+| 5 | col_type | BINARY(32) | 列 的类型 |
+| 6 | col_length | INT | 列 的长度 |
+| 7 | col_precision | INT | 列 的精度 |
+| 8 | col_scale | INT | 列 的比例 |
+| 9 | col_nullable | INT | 列 是否可以为空 |
+
## INS_USERS
提供系统中创建的用户的相关信息。
@@ -274,9 +288,9 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数
| 1 | stream_name | BINARY(64) | 流计算名称 |
| 2 | create_time | TIMESTAMP | 创建时间 |
| 3 | sql | BINARY(1024) | 创建流计算时提供的 SQL 语句 |
-| 4 | status | BIANRY(20) | 流当前状态 |
+| 4 | status | BINARY(20) | 流当前状态 |
| 5 | source_db | BINARY(64) | 源数据库 |
-| 6 | target_db | BIANRY(64) | 目的数据库 |
+| 6 | target_db | BINARY(64) | 目的数据库 |
| 7 | target_table | BINARY(192) | 流计算写入的目标表 |
| 8 | watermark | BIGINT | watermark,详见 SQL 手册流式计算。需要注意,`watermark` 为 TDengine 关键字,作为列名使用时需要使用 ` 进行转义。 |
| 9 | trigger | INT | 计算结果推送模式,详见 SQL 手册流式计算。需要注意,`trigger` 为 TDengine 关键字,作为列名使用时需要使用 ` 进行转义。 |
diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md
index 901548e13270d07da0c9eaec19a0c011d8be189e..c85efa2376f3f3d78b2775a6e1408a307b212607 100644
--- a/docs/zh/12-taos-sql/24-show.md
+++ b/docs/zh/12-taos-sql/24-show.md
@@ -86,10 +86,10 @@ SHOW FUNCTIONS;
显示用户定义的自定义函数。
-## SHOW LICENSE
+## SHOW LICENCES
```sql
-SHOW LICENSE;
+SHOW LICENCES;
SHOW GRANTS;
```
@@ -204,7 +204,7 @@ Compression_Ratio: 数据压缩率 23.98%
_block_dist: Total_Rows=[20000] Inmem_Rows=[0] MinRows=[3616] MaxRows=[4096] Average_Rows=[4000]
-Total_Rows: 统计表 d0 的所有行数 为20000 行(该数值仅供参考,不是精确的行数。获得精确的行数需要使用 count 函数)
+Total_Rows: 统计表 d0 的存储在磁盘上行数 20000 行(该数值仅供参考,不是精确的行数。获得精确的行数需要使用 count 函数)
Inmem_Rows: 存储在写缓存中的数据行数(没有落盘),0 行表示内存缓存中没有数据
@@ -253,8 +253,9 @@ Query OK, 24 row(s) in set (0.002444s)
- 上面是块中包含数据行数的块儿分布情况图,这里的 0100 0299 0498 … 表示的是每个块中包含的数据行数,上面的意思就是这个表的 5 个块,分布在 3483 ~3681 行的块有 1 个,占整个块的 20%,分布在 3881 ~ 4096(最大行数)的块数为 4 个,占整个块的 80%, 其它区域内分布块数为 0。
+上面是块中包含数据行数的块儿分布情况图,这里的 0100 0299 0498 … 表示的是每个块中包含的数据行数,上面的意思就是这个表的 5 个块,分布在 3483 ~3681 行的块有 1 个,占整个块的 20%,分布在 3881 ~ 4096(最大行数)的块数为 4 个,占整个块的 80%, 其它区域内分布块数为 0。
+需要注意,这里只会显示 data 文件中数据块的信息,stt 文件中的数据的信息不会被显示。
## SHOW TAGS
@@ -303,7 +304,7 @@ SHOW DNODE dnode_id VARIABLES;
SHOW [db_name.]VGROUPS;
```
-显示当前系统中所有 VGROUP 或某个 db 的 VGROUPS 的信息。
+显示当前数据库中所有 VGROUP 的信息。
## SHOW VNODES
diff --git a/docs/zh/12-taos-sql/26-udf.md b/docs/zh/12-taos-sql/26-udf.md
index cb349109a7d8758e336ec33ef9d70ece39be61f0..7697944f9a266279d1a13c6d392d8f6f3c16160d 100644
--- a/docs/zh/12-taos-sql/26-udf.md
+++ b/docs/zh/12-taos-sql/26-udf.md
@@ -41,7 +41,7 @@ CREATE AGGREGATE FUNCTION function_name AS library_path OUTPUTTYPE output_type [
```sql
CREATE AGGREGATE FUNCTION l2norm AS "/home/taos/udf_example/libl2norm.so" OUTPUTTYPE DOUBLE bufsize 8;
```
-关于如何开发自定义函数,请参考 [UDF使用说明](../../develop/udf)。
+关于如何开发自定义函数,请参考 [UDF使用说明](/develop/udf)。
## 管理 UDF
diff --git a/docs/zh/12-taos-sql/29-changes.md b/docs/zh/12-taos-sql/29-changes.md
index 9d67533cdea5c055c8d3ff58000fb80ac640e271..af45d84ff22b32325f0eabfbcb4794f30c71c79b 100644
--- a/docs/zh/12-taos-sql/29-changes.md
+++ b/docs/zh/12-taos-sql/29-changes.md
@@ -27,7 +27,7 @@ description: "TDengine 3.0 版本的语法变更说明"
| - | :------- | :-------- | :------- |
| 1 | ALTER ACCOUNT | 废除 | 2.x中为企业版功能,3.0不再支持。语法暂时保留了,执行报“This statement is no longer supported”错误。
| 2 | ALTER ALL DNODES | 新增 | 修改所有DNODE的参数。
-| 3 | ALTER DATABASE | 调整 | 废除QUORUM:写入需要的副本确认数。3.0版本使用STRICT来指定强一致还是弱一致。3.0.0版本STRICT暂不支持修改。 BLOCKS:VNODE使用的内存块数。3.0版本使用BUFFER来表示VNODE写入内存池的大小。 UPDATE:更新操作的支持模式。3.0版本所有数据库都支持部分列更新。 CACHELAST:缓存最新一行数据的模式。3.0版本用CACHEMODEL代替。 COMP:3.0版本暂不支持修改。 新增 CACHEMODEL:表示是否在内存中缓存子表的最近数据。 CACHESIZE:表示缓存子表最近数据的内存大小。 WAL_FSYNC_PERIOD:代替原FSYNC参数。 WAL_LEVEL:代替原WAL参数。 调整 REPLICA:3.0.0版本暂不支持修改。 KEEP:3.0版本新增支持带单位的设置方式。
+| 3 | ALTER DATABASE | 调整 | 废除QUORUM:写入需要的副本确认数。3.0版本使用STRICT来指定强一致还是弱一致。3.0.0版本STRICT暂不支持修改。 BLOCKS:VNODE使用的内存块数。3.0版本使用BUFFER来表示VNODE写入内存池的大小。 UPDATE:更新操作的支持模式。3.0版本所有数据库都支持部分列更新。 CACHELAST:缓存最新一行数据的模式。3.0版本用CACHEMODEL代替。 COMP:3.0版本暂不支持修改。 新增 CACHEMODEL:表示是否在内存中缓存子表的最近数据。 CACHESIZE:表示缓存子表最近数据的内存大小。 WAL_FSYNC_PERIOD:代替原FSYNC参数。 WAL_LEVEL:代替原WAL参数。 WAL_RETENTION_PERIOD:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。 WAL_RETENTION_SIZE:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。 调整 REPLICA:3.0.0版本暂不支持修改。 KEEP:3.0版本新增支持带单位的设置方式。
| 4 | ALTER STABLE | 调整 | 废除CHANGE TAG:修改标签列的名称。3.0版本使用RENAME TAG代替。 新增 RENAME TAG:代替原CHANGE TAG子句。 COMMENT:修改超级表的注释。
| 5 | ALTER TABLE | 调整 | 废除CHANGE TAG:修改标签列的名称。3.0版本使用RENAME TAG代替。 新增 RENAME TAG:代替原CHANGE TAG子句。 COMMENT:修改表的注释。 TTL:修改表的生命周期。
| 6 | ALTER USER | 调整 | 废除PRIVILEGE:修改用户权限。3.0版本使用GRANT和REVOKE来授予和回收权限。 新增 ENABLE:启用或停用此用户。 SYSINFO:修改用户是否可查看系统信息。
diff --git a/docs/zh/12-taos-sql/event_window.webp b/docs/zh/12-taos-sql/event_window.webp
new file mode 100644
index 0000000000000000000000000000000000000000..6d2ac0820433ecb89f3e22f7070b94aa0635c885
Binary files /dev/null and b/docs/zh/12-taos-sql/event_window.webp differ
diff --git a/docs/zh/14-reference/04-taosadapter.md b/docs/zh/14-reference/04-taosadapter.md
index 5c155bdd6ebe9f1a4a38886f30b753cbda4ab6ab..b8c5f9d647fcf920e454fabbf4da9c527b038a76 100644
--- a/docs/zh/14-reference/04-taosadapter.md
+++ b/docs/zh/14-reference/04-taosadapter.md
@@ -58,9 +58,9 @@ Usage of taosAdapter:
--collectd.enable enable collectd. Env "TAOS_ADAPTER_COLLECTD_ENABLE" (default true)
--collectd.password string collectd password. Env "TAOS_ADAPTER_COLLECTD_PASSWORD" (default "taosdata")
--collectd.port int collectd server port. Env "TAOS_ADAPTER_COLLECTD_PORT" (default 6045)
+ --collectd.ttl int collectd data ttl. Env "TAOS_ADAPTER_COLLECTD_TTL"
--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"
@@ -68,8 +68,9 @@ Usage of taosAdapter:
--cors.allowOrigins stringArray cors allow origins. Env "TAOS_ADAPTER_ALLOW_ORIGINS"
--cors.allowWebSockets cors allow WebSockets. Env "TAOS_ADAPTER_CORS_ALLOW_WebSockets"
--cors.exposeHeaders stringArray cors expose headers. Env "TAOS_ADAPTER_Expose_Headers"
- --debug enable debug mode. Env "TAOS_ADAPTER_DEBUG"
+ --debug enable debug mode. Env "TAOS_ADAPTER_DEBUG" (default true)
--help Print this help message and exit
+ --httpCodeServerError Use a non-200 http status code when taosd returns an error. Env "TAOS_ADAPTER_HTTP_CODE_SERVER_ERROR"
--influxdb.enable enable influxdb. Env "TAOS_ADAPTER_INFLUXDB_ENABLE" (default true)
--log.enableRecordHttpSql whether to record http sql. Env "TAOS_ADAPTER_LOG_ENABLE_RECORD_HTTP_SQL"
--log.path string log path. Env "TAOS_ADAPTER_LOG_PATH" (default "/var/log/taos")
@@ -80,14 +81,17 @@ Usage of taosAdapter:
--log.sqlRotationSize string record sql log rotation size(KB MB GB), must be a positive integer. Env "TAOS_ADAPTER_LOG_SQL_ROTATION_SIZE" (default "1GB")
--log.sqlRotationTime duration record sql log rotation time. Env "TAOS_ADAPTER_LOG_SQL_ROTATION_TIME" (default 24h0m0s)
--logLevel string log level (panic fatal error warn warning info debug trace). Env "TAOS_ADAPTER_LOG_LEVEL" (default "info")
- --monitor.collectDuration duration Set monitor duration. Env "TAOS_MONITOR_COLLECT_DURATION" (default 3s)
- --monitor.identity string The identity of the current instance, or 'hostname:port' if it is empty. Env "TAOS_MONITOR_IDENTITY"
- --monitor.incgroup Whether running in cgroup. Env "TAOS_MONITOR_INCGROUP"
- --monitor.password string TDengine password. Env "TAOS_MONITOR_PASSWORD" (default "taosdata") --monitor.pauseAllMemoryThreshold float Memory percentage threshold for pause all. Env "TAOS_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (default 80)
- --monitor.pauseQueryMemoryThreshold float Memory percentage threshold for pause query. Env "TAOS_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (default 70)
- --monitor.user string TDengine user. Env "TAOS_MONITOR_USER" (default "root")
- --monitor.writeInterval duration Set write to TDengine interval. Env "TAOS_MONITOR_WRITE_INTERVAL" (default 30s)
- --monitor.writeToTD Whether write metrics to TDengine. Env "TAOS_MONITOR_WRITE_TO_TD"
+ --monitor.collectDuration duration Set monitor duration. Env "TAOS_ADAPTER_MONITOR_COLLECT_DURATION" (default 3s)
+ --monitor.disable Whether to disable monitoring. Env "TAOS_ADAPTER_MONITOR_DISABLE"
+ --monitor.disableCollectClientIP Whether to disable collecting clientIP. Env "TAOS_ADAPTER_MONITOR_DISABLE_COLLECT_CLIENT_IP"
+ --monitor.identity string The identity of the current instance, or 'hostname:port' if it is empty. Env "TAOS_ADAPTER_MONITOR_IDENTITY"
+ --monitor.incgroup Whether running in cgroup. Env "TAOS_ADAPTER_MONITOR_INCGROUP"
+ --monitor.password string TDengine password. Env "TAOS_ADAPTER_MONITOR_PASSWORD" (default "taosdata")
+ --monitor.pauseAllMemoryThreshold float Memory percentage threshold for pause all. Env "TAOS_ADAPTER_MONITOR_PAUSE_ALL_MEMORY_THRESHOLD" (default 80)
+ --monitor.pauseQueryMemoryThreshold float Memory percentage threshold for pause query. Env "TAOS_ADAPTER_MONITOR_PAUSE_QUERY_MEMORY_THRESHOLD" (default 70)
+ --monitor.user string TDengine user. Env "TAOS_ADAPTER_MONITOR_USER" (default "root")
+ --monitor.writeInterval duration Set write to TDengine interval. Env "TAOS_ADAPTER_MONITOR_WRITE_INTERVAL" (default 30s)
+ --monitor.writeToTD Whether write metrics to TDengine. Env "TAOS_ADAPTER_MONITOR_WRITE_TO_TD"
--node_exporter.caCertFile string node_exporter ca cert file path. Env "TAOS_ADAPTER_NODE_EXPORTER_CA_CERT_FILE"
--node_exporter.certFile string node_exporter cert file path. Env "TAOS_ADAPTER_NODE_EXPORTER_CERT_FILE"
--node_exporter.db string node_exporter db name. Env "TAOS_ADAPTER_NODE_EXPORTER_DB" (default "node_exporter")
@@ -100,9 +104,9 @@ Usage of taosAdapter:
--node_exporter.keyFile string node_exporter cert key file path. Env "TAOS_ADAPTER_NODE_EXPORTER_KEY_FILE"
--node_exporter.password string node_exporter password. Env "TAOS_ADAPTER_NODE_EXPORTER_PASSWORD" (default "taosdata")
--node_exporter.responseTimeout duration node_exporter response timeout. Env "TAOS_ADAPTER_NODE_EXPORTER_RESPONSE_TIMEOUT" (default 5s)
+ --node_exporter.ttl int node_exporter data ttl. Env "TAOS_ADAPTER_NODE_EXPORTER_TTL"
--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])
@@ -112,11 +116,11 @@ Usage of taosAdapter:
--opentsdb_telnet.password string opentsdb_telnet password. Env "TAOS_ADAPTER_OPENTSDB_TELNET_PASSWORD" (default "taosdata")
--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.ttl int opentsdb_telnet data ttl. Env "TAOS_ADAPTER_OPENTSDB_TELNET_TTL"
--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)
+ --pool.idleTimeout duration Set idle connection timeout. Env "TAOS_ADAPTER_POOL_IDLE_TIMEOUT"
+ --pool.maxConnect int max connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_CONNECT"
+ --pool.maxIdle int max idle connections to taosd. Env "TAOS_ADAPTER_POOL_MAX_IDLE"
-P, --port int http port. Env "TAOS_ADAPTER_PORT" (default 6041)
--prometheus.enable enable prometheus. Env "TAOS_ADAPTER_PROMETHEUS_ENABLE" (default true)
--restfulRowLimit int restful returns the maximum number of rows (-1 means no limit). Env "TAOS_ADAPTER_RESTFUL_ROW_LIMIT" (default -1)
@@ -133,9 +137,9 @@ Usage of taosAdapter:
--statsd.port int statsd server port. Env "TAOS_ADAPTER_STATSD_PORT" (default 6044)
--statsd.protocol string statsd protocol [tcp or udp]. Env "TAOS_ADAPTER_STATSD_PROTOCOL" (default "udp")
--statsd.tcpKeepAlive enable tcp keep alive. Env "TAOS_ADAPTER_STATSD_TCP_KEEP_ALIVE"
+ --statsd.ttl int statsd data ttl. Env "TAOS_ADAPTER_STATSD_TTL"
--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
```
@@ -323,6 +327,10 @@ taosAdapter 通过参数 `restfulRowLimit` 来控制结果的返回条数,-1
- `http://:6041/rest/sql`
- `http://:6041/prometheus/v1/remote_read/:db`
+## 配置 http 返回码
+
+taosAdapter 通过参数 `httpCodeServerError` 来设置当 C 接口返回错误时是否返回非 200 的 http 状态码。当设置为 true 时将根据 C 返回的错误码返回不同 http 状态码。具体见 [HTTP 响应码](../../connector/rest-api/#http-响应码)。
+
## 故障解决
您可以通过命令 `systemctl status taosadapter` 来检查 taosAdapter 运行状态。
diff --git a/docs/zh/14-reference/05-taosbenchmark.md b/docs/zh/14-reference/05-taosbenchmark.md
index 9091e71d1f9b118660d5f75ef9be5627143393b0..c5d98767f9134c8eeb9bbc1ee2fb887370d9da54 100644
--- a/docs/zh/14-reference/05-taosbenchmark.md
+++ b/docs/zh/14-reference/05-taosbenchmark.md
@@ -208,6 +208,9 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- ** -z/--trying-interval ** : 失败重试间隔时间,单位为毫秒,仅在 -k 指定重试后有效。需使用 v3.0.9 以上版本。
+- **-v/--vgroups ** :
+ 创建数据库时指定 vgroups 数,仅对 TDengine v3.0+ 有效。
+
- **-V/--version** :
显示版本信息并退出。不能与其它参数混用。
@@ -238,6 +241,13 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
- ** keep_trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。
- ** trying_interval ** : 失败重试间隔时间,单位为毫秒,仅在 keep_trying 指定重试后有效。需使用 v3.0.9 以上版本。
+- ** childtable_from 和 childtable_to ** : 指定写入子表范围,开闭区间为 [childtable_from, childtable_to).
+
+- ** continue_if_fail ** : 允许用户定义失败后行为
+
+ “continue_if_fail”: “no”, 失败 taosBenchmark 自动退出,默认行为
+ “continue_if_fail”: “yes”, 失败 taosBenchmark 警告用户,并继续写入
+ “continue_if_fail”: “smart”, 如果子表不存在失败,taosBenchmark 会建立子表并继续写入
#### 数据库相关配置参数
@@ -390,11 +400,11 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
#### 执行指定查询语句的配置参数
-查询子表或者普通表的配置参数在 `specified_table_query` 中设置。
+查询指定表(可以指定超级表、子表或普通表)的配置参数在 `specified_table_query` 中设置。
- **query_interval** : 查询时间间隔,单位是秒,默认值为 0。
-- **threads** : 执行查询 SQL 的线程数,默认值为 1。
+- **threads/concurrent** : 执行查询 SQL 的线程数,默认值为 1。
- **sqls**:
- **sql**: 执行的 SQL 命令,必填。
@@ -421,7 +431,7 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
#### 执行指定订阅语句的配置参数
-订阅子表或者普通表的配置参数在 `specified_table_query` 中设置。
+订阅指定表(可以指定超级表、子表或者普通表)的配置参数在 `specified_table_query` 中设置。
- **threads/concurrent** : 执行 SQL 的线程数,默认为 1。
diff --git a/docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json b/docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
index f651983528ca824b4e6b14586aac5a5bfb4ecab8..43f29bda4445d0559b60d51a6d421442e9d38d4d 100644
--- a/docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
+++ b/docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json
@@ -1590,7 +1590,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1919,7 +1919,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1977,7 +1977,7 @@
},
{
"datasource": "${DS_TDENGINE}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2825,7 +2825,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
- "title": "Requets Count per Minutes $fqdn",
+ "title": "Requests Count per Minutes $fqdn",
"tooltip": {
"shared": true,
"sort": 0,
diff --git a/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
index b4254c428b28a0084e54b5e3c509dd2e0ec651b9..660875262edfe4b4211075839b60dfcdcb26d198 100644
--- a/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
+++ b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json
@@ -1566,7 +1566,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -1933,7 +1933,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2000,7 +2000,7 @@
},
{
"datasource": "${ds}",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"fieldConfig": {
"defaults": {
"color": {
@@ -2961,7 +2961,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
- "title": "Requets Count per Minutes $fqdn",
+ "title": "Requests Count per Minutes $fqdn",
"tooltip": {
"shared": true,
"sort": 0,
@@ -3355,4 +3355,4 @@
"title": "TDengine",
"uid": "tdengine",
"version": 8
-}
\ No newline at end of file
+}
diff --git a/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json
index 7696cfce3fcca3dd5f9278c91d3df2c1b32b9c97..e3bad31fab4e9110da505621d8ea7444584b33cb 100644
--- a/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json
+++ b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json
@@ -186,7 +186,7 @@
},
{
"datasource": "TDengine",
- "description": "taosd max memery last 10 minutes",
+ "description": "taosd max memory last 10 minutes",
"gridPos": {
"h": 6,
"w": 8,
@@ -253,7 +253,7 @@
],
"timeFrom": null,
"timeShift": null,
- "title": "taosd memery",
+ "title": "taosd memory",
"type": "gauge"
},
{
diff --git a/docs/zh/14-reference/07-tdinsight/index.mdx b/docs/zh/14-reference/07-tdinsight/index.mdx
index 319fa8df536d81fdb2cf016d3fafb99edee32d61..b4eda61ebdb4f6ab9b8b650571a35196c76eda56 100644
--- a/docs/zh/14-reference/07-tdinsight/index.mdx
+++ b/docs/zh/14-reference/07-tdinsight/index.mdx
@@ -43,10 +43,8 @@ sudo apt-get update
sudo apt-get install grafana
```
-### 在 CentOS / RHEL 上安装 Grafana
-
-
+
您可以从官方 YUM 镜像仓库安装。
@@ -79,7 +77,37 @@ sudo yum install \
-
+### 安装 TDengine 数据源插件
+
+
+
+
+从 GitHub 安装 TDengine 最新版数据源插件。
+
+```bash
+get_latest_release() {
+ curl --silent "https://api.github.com/repos/taosdata/grafanaplugin/releases/latest" |
+ grep '"tag_name":' |
+ sed -E 's/.*"v([^"]+)".*/\1/'
+}
+TDENGINE_PLUGIN_VERSION=$(get_latest_release)
+sudo grafana-cli \
+ --pluginUrl https://github.com/taosdata/grafanaplugin/releases/download/v$TDENGINE_PLUGIN_VERSION/tdengine-datasource-$TDENGINE_PLUGIN_VERSION.zip \
+ plugins install tdengine-datasource
+```
+
+:::note
+3.1.6 和更早版本插件需要在配置文件 `/etc/grafana/grafana.ini` 中添加如下设置,以启用未签名插件。
+
+```ini
+[plugins]
+allow_loading_unsigned_plugins = tdengine-datasource
+```
+
+:::
+
+
+
我们提供了一个自动化安装脚本 [`TDinsight.sh`](https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh) 脚本以便用户快速进行安装配置。
@@ -175,33 +203,7 @@ sudo ./TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -
特别地,当您使用 Grafana Cloud 或其他组织时,`-O` 可用于设置组织 ID。 `-G` 可指定 Grafana 插件安装目录。 `-e` 参数将仪表盘设置为可编辑。
-
-
-### 安装 TDengine 数据源插件
-
-从 GitHub 安装 TDengine 最新版数据源插件。
-
-```bash
-get_latest_release() {
- curl --silent "https://api.github.com/repos/taosdata/grafanaplugin/releases/latest" |
- grep '"tag_name":' |
- sed -E 's/.*"v([^"]+)".*/\1/'
-}
-TDENGINE_PLUGIN_VERSION=$(get_latest_release)
-sudo grafana-cli \
- --pluginUrl https://github.com/taosdata/grafanaplugin/releases/download/v$TDENGINE_PLUGIN_VERSION/tdengine-datasource-$TDENGINE_PLUGIN_VERSION.zip \
- plugins install tdengine-datasource
-```
-
-:::note
-3.1.6 和更早版本插件需要在配置文件 `/etc/grafana/grafana.ini` 中添加如下设置,以启用未签名插件。
-
-```ini
-[plugins]
-allow_loading_unsigned_plugins = tdengine-datasource
-```
-
-:::
+
### 启动 Grafana 服务
@@ -233,8 +235,7 @@ sudo systemctl enable grafana-server

-
-
+
### 导入仪表盘
diff --git a/docs/zh/14-reference/08-taos-shell.md b/docs/zh/14-reference/08-taos-shell.md
index 5ac5f6f479e52aa7dd9a606a8eeb19e8c11a8a3c..3423cf35bbeb54c526e2bbad7ec3eae230cce07b 100644
--- a/docs/zh/14-reference/08-taos-shell.md
+++ b/docs/zh/14-reference/08-taos-shell.md
@@ -61,12 +61,14 @@ taos> SET MAX_BINARY_DISPLAY_WIDTH ;
- -c CONFIGDIR: 指定配置文件目录,Linux 环境下默认为 `/etc/taos`,该目录下的配置文件默认名称为 `taos.cfg`
- -C: 打印 -c 指定的目录中 `taos.cfg` 的配置参数
- -d DATABASE: 指定连接到服务端时使用的数据库
+- -E dsn: 使用 WebSocket DSN 连接云服务或者提供 WebSocket 连接的服务端
- -f FILE: 以非交互模式执行 SQL 脚本文件。文件中一个 SQL 语句只能占一行
- -k: 测试服务端运行状态,0: unavailable,1: network ok,2: service ok,3: service degraded,4: exiting
- -l PKTLEN: 网络测试时使用的测试包大小
- -n NETROLE: 网络连接测试时的测试范围,默认为 `client`, 可选值为 `client`、`server`
- -N PKTNUM: 网络测试时使用的测试包数量
- -r: 将时间输出出无符号 64 位整数类型(即 C 语音中 uint64_t)
+- -R: 使用 RESTful 模式连接服务端
- -s COMMAND: 以非交互模式执行的 SQL 命令
- -t: 测试服务端启动状态,状态同-k
- -w DISPLAYWIDTH: 客户端列显示宽度
diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md
index eed8b9ca7dc0d0e6d8801b64071377062b523358..e5efd77f8050ae2305a02a5bd70367d259cb971c 100644
--- a/docs/zh/14-reference/12-config/index.md
+++ b/docs/zh/14-reference/12-config/index.md
@@ -29,7 +29,7 @@ taos -C
taos --dump-config
```
-# 配置参数详细列表
+## 配置参数详细列表
:::note
本节内容覆盖产品的配置参数,适用于服务端的参数按其对产品行为的影响进行分类,这其中有部分参数也同时适用于客户端;但有少量参数仅适用于客户端,这部分参数进行了单独归类。
@@ -83,7 +83,7 @@ taos --dump-config
| :--- | :-------- | :---------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| TCP | 6030 | 客户端与服务端之间通讯,多节点集群的节点间通讯。 | 由配置文件设置 serverPort 决定。 |
| TCP | 6041 | 客户端与服务端之间的 RESTful 通讯。 | 随 serverPort 端口变化。注意 taosAdapter 配置或有不同,请参考相应[文档](/reference/taosadapter/)。 |
-| TCP | 6043 | TaosKeeper 监控服务端口。 | 随 TaosKeeper 启动参数设置变化。 |
+| TCP | 6043 | taosKeeper 监控服务端口。 | 随 taosKeeper 启动参数设置变化。 |
| TCP | 6044 | 支持 StatsD 的数据接入端口。 | 随 taosAdapter 启动参数设置变化|
| UDP | 6045 | 支持 collectd 数据接入端口。 | 随 taosAdapter 启动参数设置变化 |
| TCP | 6060 | 企业版内 Monitor 服务的网络端口。 | |
@@ -99,12 +99,15 @@ taos --dump-config
## 监控相关
+:::note
+请注意,完整的监控功能需要安装并运行 `taoskeeper` 服务。taoskeeper 负责接收监控指标数据并创建 `log` 库。
+
### monitor
| 属性 | 说明 |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | 服务器内部的系统监控开关。监控主要负责收集物理节点的负载状况,包括 CPU、内存、硬盘、网络带宽的监控记录,监控信息将通过 HTTP 协议发送给由 `monitorFqdn` 和 `monitorProt` 指定的 TaosKeeper 监控服务 |
+| 含义 | 服务器内部的系统监控开关。监控主要负责收集物理节点的负载状况,包括 CPU、内存、硬盘、网络带宽的监控记录,监控信息将通过 HTTP 协议发送给由 `monitorFqdn` 和 `monitorProt` 指定的 taosKeeper 监控服务 |
| 取值范围 | 0:关闭监控服务, 1:激活监控服务。 |
| 缺省值 | 0 |
@@ -113,7 +116,7 @@ taos --dump-config
| 属性 | 说明 |
| -------- | -------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | TaosKeeper 监控服务的 FQDN |
+| 含义 | taosKeeper 监控服务的 FQDN |
| 缺省值 | 无 |
### monitorPort
@@ -121,7 +124,7 @@ taos --dump-config
| 属性 | 说明 |
| -------- | --------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | TaosKeeper 监控服务的端口号 |
+| 含义 | taosKeeper 监控服务的端口号 |
| 缺省值 | 6043 |
### monitorInterval
@@ -355,8 +358,6 @@ charset 的有效值是 UTF-8。
| 取值范围 | 0-4096 |
| 缺省值 | CPU 核数的 2 倍 |
-## 时间相关 |
-
## 性能调优
### numOfCommitThreads
@@ -611,7 +612,7 @@ charset 的有效值是 UTF-8。
| 适用范围 | 仅客户端适用 |
| 含义 | schemaless 列数据是否顺序一致,从3.0.3.0开始,该配置废弃 |
| 值域 | 0:不一致;1: 一致 |
-| 缺省值 | 1 |
+| 缺省值 | 0 |
## 其他
diff --git a/docs/zh/14-reference/13-schemaless/13-schemaless.md b/docs/zh/14-reference/13-schemaless/13-schemaless.md
index 3d0bac25d20953733d842e8057f2c0c24deb831e..e5f232c1fc506a6e37cb128cab129a7fe539d60a 100644
--- a/docs/zh/14-reference/13-schemaless/13-schemaless.md
+++ b/docs/zh/14-reference/13-schemaless/13-schemaless.md
@@ -87,7 +87,7 @@ st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000
:::tip
无模式所有的处理逻辑,仍会遵循 TDengine 对数据结构的底层限制,例如每行数据的总长度不能超过
-16KB。这方面的具体限制约束请参见 [TDengine SQL 边界限制](/taos-sql/limit)
+48KB,标签值的总长度不超过16KB。这方面的具体限制约束请参见 [TDengine SQL 边界限制](/taos-sql/limit)
:::
diff --git a/docs/zh/14-reference/14-taosKeeper.md b/docs/zh/14-reference/14-taosKeeper.md
index bbd5b1b9116ea0a8d2dab4c26c37d0d07cb17d78..12b609584a65d729c93e256b3918bd04d03e2010 100644
--- a/docs/zh/14-reference/14-taosKeeper.md
+++ b/docs/zh/14-reference/14-taosKeeper.md
@@ -4,23 +4,25 @@ title: taosKeeper
description: TDengine 3.0 版本监控指标的导出工具
---
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+
## 简介
-TaosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。
+taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。
## 安装
-
+taosKeeper 有两种安装方式:
taosKeeper 安装方式:
-
+- 安装 TDengine 官方安装包的同时会自动安装 taosKeeper, 详情请参考[ TDengine 安装](/operation/pkg-install)。
-
- 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。
-## 运行
+## 配置和运行方式
-### 配置和运行方式
+### 配置
taosKeeper 需要在操作系统终端执行,该工具支持三种配置方式:[命令行参数](#命令行参数启动)、[环境变量](#环境变量启动) 和 [配置文件](#配置文件启动)。优先级为:命令行参数、环境变量、配置文件参数。
@@ -34,29 +36,82 @@ monitorFqdn localhost # taoskeeper 服务的 FQDN
TDengine 监控配置相关,具体请参考:[TDengine 监控配置](../config/#监控相关)。
-### 命令行参数启动
+### 启动
-在使用命令行参数运行 taosKeeper 并控制其行为。
+
+
-```shell
-$ taosKeeper
+安装后,请使用 `systemctl` 命令来启动 taoskeeper 的服务进程。
+
+```bash
+systemctl start taoskeeper
```
-### 环境变量启动
+检查服务是否正常工作:
-通过设置环境变量达到控制启动参数的目的,通常在容器中运行时使用。
+```bash
+systemctl status taoskeeper
+```
+
+如果服务进程处于活动状态,则 status 指令会显示如下的相关信息:
+
+```
+Active: active (running)
+```
+
+如果后台服务进程处于停止状态,则 status 指令会显示如下的相关信息:
-```shell
-$ export TAOS_KEEPER_TDENGINE_HOST=192.168.64.3
-
-$ taoskeeper
```
+Active: inactive (dead)
+```
+
+如下 `systemctl` 命令可以帮助你管理 taoskeeper 服务:
+
+- 启动服务进程:`systemctl start taoskeeper`
+
+- 停止服务进程:`systemctl stop taoskeeper`
+
+- 重启服务进程:`systemctl restart taoskeeper`
+
+- 查看服务状态:`systemctl status taoskeeper`
+
+:::info
+
+- `systemctl` 命令需要 _root_ 权限来运行,如果您非 _root_ 用户,请在命令前添加 `sudo`。
+- 如果系统中不支持 `systemd`,也可以用手动运行 `/usr/local/taos/bin/taoskeeper` 方式启动 taoskeeper 服务。
+- 故障排查:
+- 如果服务异常请查看系统日志获取更多信息。
+:::
+
+
+
-具体参数列表请参照 `taoskeeper -h` 输入结果。
+安装后,可以运行 `sudo launchctl start com.tdengine.taoskeeper` 来启动 taoskeeper 服务进程。
-### 配置文件启动
+如下 `launchctl` 命令用于管理 taoskeeper 服务:
-执行以下命令即可快速体验 taosKeeper。当不指定 taosKeeper 配置文件时,优先使用 `/etc/taos/keeper.toml` 配置,否则将使用默认配置。
+- 启动服务进程:`sudo launchctl start com.tdengine.taoskeeper`
+
+- 停止服务进程:`sudo launchctl stop com.tdengine.taoskeeper`
+
+- 查看服务状态:`sudo launchctl list | grep taoskeeper`
+
+:::info
+
+- `launchctl` 命令管理`com.tdengine.taoskeeper`需要管理员权限,务必在前面加 `sudo` 来增强安全性。
+- `sudo launchctl list | grep taoskeeper` 指令返回的第一列是 `taoskeeper` 程序的 PID,若为 `-` 则说明 taoskeeper 服务未运行。
+- 故障排查:
+- 如果服务异常请查看系统日志获取更多信息。
+
+:::
+
+
+
+
+
+#### 配置文件启动
+
+执行以下命令即可快速体验 taosKeeper。当不指定 taosKeeper 配置文件时,优先使用 `/etc/taos/keeper.toml` 配置,否则将使用默认配置。
```shell
$ taoskeeper -c
@@ -134,19 +189,36 @@ $ curl http://127.0.0.1:6043/metrics
部分结果集:
```shell
-# HELP taos_cluster_info_connections_total
+# HELP taos_cluster_info_connections_total
# TYPE taos_cluster_info_connections_total counter
taos_cluster_info_connections_total{cluster_id="5981392874047724755"} 16
-# HELP taos_cluster_info_dbs_total
+# HELP taos_cluster_info_dbs_total
# TYPE taos_cluster_info_dbs_total counter
taos_cluster_info_dbs_total{cluster_id="5981392874047724755"} 2
-# HELP taos_cluster_info_dnodes_alive
+# HELP taos_cluster_info_dnodes_alive
# TYPE taos_cluster_info_dnodes_alive counter
taos_cluster_info_dnodes_alive{cluster_id="5981392874047724755"} 1
-# HELP taos_cluster_info_dnodes_total
+# HELP taos_cluster_info_dnodes_total
# TYPE taos_cluster_info_dnodes_total counter
taos_cluster_info_dnodes_total{cluster_id="5981392874047724755"} 1
-# HELP taos_cluster_info_first_ep
+# HELP taos_cluster_info_first_ep
# TYPE taos_cluster_info_first_ep gauge
taos_cluster_info_first_ep{cluster_id="5981392874047724755",value="hlb:6030"} 1
```
+
+### check_health
+
+```
+$ curl -i http://127.0.0.1:6043/check_health
+```
+
+返回结果:
+
+```
+HTTP/1.1 200 OK
+Content-Type: application/json; charset=utf-8
+Date: Mon, 03 Apr 2023 07:20:38 GMT
+Content-Length: 19
+
+{"version":"1.0.0"}
+```
diff --git a/docs/zh/14-reference/_statsd.mdx b/docs/zh/14-reference/_statsd.mdx
index dc4f19b37c6111b394f183fb57ca487828b66e70..21c2e29f64865df9ad421a8219ca7b5cef86380e 100644
--- a/docs/zh/14-reference/_statsd.mdx
+++ b/docs/zh/14-reference/_statsd.mdx
@@ -31,7 +31,7 @@ deleteTimings = true
### 配置 StatsD
-使用 StatsD 需要下载其[源代码](https://github.com/statsd/statsd)。其配置文件请参考其源代码下载到本地的根目录下的示例文件 `exampleConfig.js` 进行修改。其中 填写运行 taosAdapter 的服务器域名或 IP 地址,请填写 taosAdapter 接收 StatsD 数据的端口(默认为 6044)。
+使用 StatsD 需要下载其[源代码](https://github.com/statsd/statsd)。其配置文件请参考其源代码下载到本地的根目录下的示例文件 `exampleConfig.js` 进行修改。其中 填写运行 taosAdapter 的服务器域名或 IP 地址,请填写 taosAdapter 接收 StatsD 数据的端口(默认为 6044)。
```
backends 部分添加 "./backends/repeater"
diff --git a/docs/zh/17-operation/01-pkg-install.md b/docs/zh/17-operation/01-pkg-install.md
index 6d93c1697b1e0936b3f6539d3b1fb95db0baa956..6272c14db79537dd65c93e424097b9c31e88ddb9 100644
--- a/docs/zh/17-operation/01-pkg-install.md
+++ b/docs/zh/17-operation/01-pkg-install.md
@@ -141,8 +141,20 @@ taos tools is uninstalled successfully!
```
+
在 C:\TDengine 目录下,通过运行 unins000.exe 卸载程序来卸载 TDengine。
+
+
+
+
+卸载 TDengine 命令如下:
+
+```
+$ rmtaos
+TDengine is removed successfully!
+```
+
diff --git a/docs/zh/17-operation/03-tolerance.md b/docs/zh/17-operation/03-tolerance.md
index 79cf10c39a7028e04e7c1ebbea54738dcdc528af..bf2a651c1a9a68411a2348eccda7e0e44db75214 100644
--- a/docs/zh/17-operation/03-tolerance.md
+++ b/docs/zh/17-operation/03-tolerance.md
@@ -19,12 +19,8 @@ TDengine 接收到应用的请求数据包时,先将请求的原始数据包
## 灾备
-TDengine 的集群通过多个副本的机制,来提供系统的高可用性,同时具备一定的灾备能力。
+TDengine 灾备是通过在异地的两个数据中心中设置两个 TDengine 集群并利用 taosX 的数据复制能力来实现的。假定两个集群为集群 A 和集群 B,其中集群 A 为源集群,承担写入请求并提供查询服务。则在集群 A 所在数据中心中可以配置 taosX 利用 TDengine 提供的数据订阅能力,实时消费集群 A 中新写入的数据,并同步到集群 B。如果发生了灾难导致集群 A 所在数据中心不可用,则可以启用集群 B 作为数据写入和查询的主节点,并在集群 B 所处数据中心中配置 taosX 将数据复制到已经恢复的集群 A 或者新建的集群 C。
-TDengine 集群是由 mnode 负责管理的,为保证 mnode 的高可靠,可以配置 三个 mnode 副本。为保证元数据的强一致性,mnode 副本之间通过同步方式进行数据复制,保证了元数据的强一致性。
+利用 taosX 的数据复制能力也可以构造出更复杂的灾备方案。
-TDengine 集群中的时序数据的副本数是与数据库关联的,一个集群里可以有多个数据库,每个数据库可以配置不同的副本数。创建数据库时,通过参数 replica 指定副本数。为了支持高可靠,需要设置副本数为 3。
-
-TDengine 集群的节点数必须大于等于副本数,否则创建表时将报错。
-
-当 TDengine 集群中的节点部署在不同的物理机上,并设置多个副本数时,就实现了系统的高可靠性,无需再使用其他软件或工具。TDengine 企业版还可以将副本部署在不同机房,从而实现异地容灾。
+taosX 只在 TDengine 企业版中提供,关于其具体细节,请联系 business@taosdata.com
diff --git a/docs/zh/20-third-party/01-grafana.mdx b/docs/zh/20-third-party/01-grafana.mdx
index 5927dc4fcacc0b947e3a4c44778d9d5979bfc196..7980736a1c62150df1c2742c788aabde9b1dbc3b 100644
--- a/docs/zh/20-third-party/01-grafana.mdx
+++ b/docs/zh/20-third-party/01-grafana.mdx
@@ -77,7 +77,7 @@ sudo -u grafana grafana-cli plugins install tdengine-datasource
或者从 [GitHub](https://github.com/taosdata/grafanaplugin/releases/tag/latest) 或 [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) 下载 .zip 文件到本地并解压到 Grafana 插件目录。命令行下载示例如下:
```bash
-GF_VERSION=3.2.9
+GF_VERSION=3.3.1
# from GitHub
wget https://github.com/taosdata/grafanaplugin/releases/download/v$GF_VERSION/tdengine-datasource-$GF_VERSION.zip
# from Grafana
diff --git a/docs/zh/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md
index cc2247f25ebacbc8f5290c2442860f264fad39f1..7fb7738a4f629ccda5dd2aca3c65bf7cb5a90efe 100644
--- a/docs/zh/20-third-party/11-kafka.md
+++ b/docs/zh/20-third-party/11-kafka.md
@@ -79,7 +79,7 @@ Development: false
### 从源码安装
```
-git clone https://github.com/taosdata/kafka-connect-tdengine.git
+git clone --branch 3.0 https://github.com/taosdata/kafka-connect-tdengine.git
cd kafka-connect-tdengine
mvn clean package
unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip
diff --git a/docs/zh/25-application/01-telegraf.md b/docs/zh/25-application/01-telegraf.md
index ec263d77927d2960ef684d9d94c9cad4073429b9..07a3067a4f25d6a47d44603afb9929f967d490b5 100644
--- a/docs/zh/25-application/01-telegraf.md
+++ b/docs/zh/25-application/01-telegraf.md
@@ -67,7 +67,7 @@ sudo systemctl start telegraf
使用 Web 浏览器访问 `IP:3000` 登录 Grafana 界面,系统初始用户名密码为 admin/admin。
点击左侧齿轮图标并选择 `Plugins`,应该可以找到 TDengine data source 插件图标。
-点击左侧加号图标并选择 `Import`,从 `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json` 下载 dashboard JSON 文件后导入。之后可以看到如下界面的仪表盘:
+点击左侧加号图标并选择 `Import`,从 `https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v3.json` (适配 TDengine 3.0, 如果使用 TDengine 2.x, 请下载 `telegraf-dashboard-v2.json`) 下载 dashboard JSON 文件后导入。之后可以看到如下界面的仪表盘:

diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md
index c9505d95a58ef03d5d374d952c4b66c3d5e37828..b4441ad078059f51d8632e0db9c8007db9eb804e 100644
--- a/docs/zh/28-releases/01-tdengine.md
+++ b/docs/zh/28-releases/01-tdengine.md
@@ -10,6 +10,19 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do
import Release from "/components/ReleaseV3";
+## 3.0.3.2
+
+
+
+## 3.0.3.1
+
+
+
+## 3.0.3.0
+
+
+
+
## 3.0.2.6
diff --git a/docs/zh/28-releases/02-tools.md b/docs/zh/28-releases/02-tools.md
index 69d35f95c85c743b7f0f0ff035c23ed96c26b021..cce6834f12af02568632949bde044b81ea718808 100644
--- a/docs/zh/28-releases/02-tools.md
+++ b/docs/zh/28-releases/02-tools.md
@@ -10,6 +10,22 @@ taosTools 各版本安装包下载链接如下:
import Release from "/components/ReleaseV3";
+## 2.4.11
+
+
+
+## 2.4.10
+
+
+
+## 2.4.9
+
+
+
+## 2.4.8
+
+
+
## 2.4.6
diff --git a/examples/lua/OpenResty/rest/tdpool/init.lua b/examples/lua/OpenResty/rest/tdpool/init.lua
index ebf8e91756539cc8af5db38232a40bf42aeaa245..c0c6d5659013b4a4586c286741a20867fafd9c9f 100644
--- a/examples/lua/OpenResty/rest/tdpool/init.lua
+++ b/examples/lua/OpenResty/rest/tdpool/init.lua
@@ -1,16 +1,15 @@
local _M = {}
local driver = require "luaconnector51"
-local water_mark = 0
-local occupied = 0
-local connection_pool = {}
+td_pool_watermark = 0
+td_pool_occupied = 0
+td_connection_pool = {}
-function _M.new(o,config)
+function _M.new(o, config)
o = o or {}
- o.connection_pool = connection_pool
- o.water_mark = water_mark
- o.occupied = occupied
- if #connection_pool == 0 then
-
+ o.connection_pool = td_connection_pool
+ o.watermark = td_pool_watermark
+ o.occupied = td_pool_occupied
+ if #td_connection_pool == 0 then
for i = 1, config.connection_pool_size do
local res = driver.connect(config)
if res.code ~= 0 then
@@ -18,8 +17,8 @@ function _M.new(o,config)
return nil
else
local object = {obj = res.conn, state = 0}
- table.insert(o.connection_pool,i, object)
- ngx.log(ngx.INFO, "add connection, now pool size:"..#(o.connection_pool))
+ table.insert(td_connection_pool, i, object)
+ ngx.log(ngx.INFO, "add connection, now pool size:"..#(td_connection_pool))
end
end
@@ -32,13 +31,13 @@ function _M:get_connection()
local connection_obj
- for i = 1, #connection_pool do
- connection_obj = connection_pool[i]
+ for i = 1, #td_connection_pool do
+ connection_obj = td_connection_pool[i]
if connection_obj.state == 0 then
connection_obj.state = 1
- occupied = occupied +1
- if occupied > water_mark then
- water_mark = occupied
+ td_pool_occupied = td_pool_occupied + 1
+ if td_pool_occupied > td_pool_watermark then
+ td_pool_watermark = td_pool_occupied
end
return connection_obj["obj"]
end
@@ -49,21 +48,27 @@ function _M:get_connection()
return nil
end
-function _M:get_water_mark()
+function _M:get_watermark()
+
+ return td_pool_watermark
+end
+
+
+function _M:get_current_load()
- return water_mark
+ return td_pool_occupied
end
function _M:release_connection(conn)
local connection_obj
- for i = 1, #connection_pool do
- connection_obj = connection_pool[i]
+ for i = 1, #td_connection_pool do
+ connection_obj = td_connection_pool[i]
if connection_obj["obj"] == conn then
connection_obj["state"] = 0
- occupied = occupied -1
+ td_pool_occupied = td_pool_occupied -1
return
end
end
diff --git a/examples/lua/OpenResty/rest/test.lua b/examples/lua/OpenResty/rest/test.lua
index 48aeef3fb4dd8c9a0dc18e8039b4b8c781760666..cb4a1479f34600f6e43802c6c7d82754a93433ad 100644
--- a/examples/lua/OpenResty/rest/test.lua
+++ b/examples/lua/OpenResty/rest/test.lua
@@ -4,8 +4,21 @@ local Pool = require "tdpool"
local config = require "config"
ngx.say("start time:"..os.time())
-local pool = Pool.new(Pool,config)
-local conn = pool:get_connection()
+local pool = Pool.new(Pool, config)
+local another_pool = Pool.new(Pool, config)
+local conn, conn1, conn2
+conn = pool:get_connection()
+conn1 = pool:get_connection()
+conn2 = pool:get_connection()
+local temp_conn = another_pool:get_connection()
+ngx.say("pool size:"..config.connection_pool_size)
+ngx.say("pool watermark:"..pool:get_watermark())
+ngx.say("pool current load:"..pool:get_current_load())
+pool:release_connection(conn1)
+pool:release_connection(conn2)
+another_pool:release_connection(temp_conn)
+ngx.say("pool watermark:"..pool:get_watermark())
+ngx.say("pool current load:"..pool:get_current_load())
local res = driver.query(conn,"drop database if exists nginx")
if res.code ~=0 then
@@ -31,7 +44,6 @@ end
res = driver.query(conn,"create table m1 (ts timestamp, speed int,owner binary(20))")
if res.code ~=0 then
ngx.say("create table---failed: "..res.error)
-
else
ngx.say("create table--- pass.")
end
@@ -83,8 +95,5 @@ while not flag do
-- ngx.say("i am here once...")
ngx.sleep(0.001) -- time unit is second
end
-
-ngx.say("pool water_mark:"..pool:get_water_mark())
-
pool:release_connection(conn)
ngx.say("end time:"..os.time())
diff --git a/examples/lua/build.sh b/examples/lua/build.sh
index 1e6fef632ceb828c9e0eca1a02dc4a6654906474..5e856f3e9ef0c18b309c1b6fa66f8c79b7dec2dd 100755
--- a/examples/lua/build.sh
+++ b/examples/lua/build.sh
@@ -4,5 +4,5 @@ if [ "$lua_header_installed" = "0" ]; then
sudo apt install -y liblua5.3-dev
fi
-gcc -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos -I/usr/include/lua5.3 -I../../include/client
+gcc -g -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos -I/usr/include/lua5.3 -I../../include/client
diff --git a/examples/lua/lua51/lua_connector51.c b/examples/lua/lua51/lua_connector51.c
index 8a9051dd0cb3da0fd82e752132d499a5935be758..c5ef9126a644cae83a730f5d39d501713aff9db5 100644
--- a/examples/lua/lua51/lua_connector51.c
+++ b/examples/lua/lua51/lua_connector51.c
@@ -67,7 +67,7 @@ static int l_connect(lua_State *L){
taos = taos_connect(host, user,password,database, port);
if (taos == NULL) {
- printf("failed to connect server, reason:%s\n", taos_errstr(taos));
+ //printf("failed to connect server, reason:%s\n", taos_errstr(taos));
lua_pushinteger(L, -1);
lua_setfield(L, table_index, "code");
@@ -79,7 +79,7 @@ static int l_connect(lua_State *L){
// printf("success to connect server\n");
lua_pushinteger(L, 0);
lua_setfield(L, table_index, "code");
- lua_pushstring(L, taos_errstr(taos));
+ lua_pushstring(L, "success");
lua_setfield(L, table_index, "error");
lua_pushlightuserdata(L,taos);
lua_setfield(L, table_index, "conn");
diff --git a/examples/lua/lua_connector.c b/examples/lua/lua_connector.c
index c3d8bcb99548c787953cd27bcbb90b6c63ee5a4a..5d8226f2623f6451ef77b71dac1a6583ba6c460b 100644
--- a/examples/lua/lua_connector.c
+++ b/examples/lua/lua_connector.c
@@ -67,8 +67,7 @@ static int l_connect(lua_State *L){
taos = taos_connect(host, user,password,database, port);
if (taos == NULL) {
- printf("failed to connect server, reason:%s\n", taos_errstr(taos));
-
+// printf("failed to connect server, reason:%s\n", taos_errstr(NULL));
lua_pushinteger(L, -1);
lua_setfield(L, table_index, "code");
lua_pushstring(L, taos_errstr(taos));
@@ -79,7 +78,7 @@ static int l_connect(lua_State *L){
// printf("success to connect server\n");
lua_pushinteger(L, 0);
lua_setfield(L, table_index, "code");
- lua_pushstring(L, taos_errstr(taos));
+ lua_pushstring(L, "success");
lua_setfield(L, table_index, "error");
lua_pushlightuserdata(L,taos);
lua_setfield(L, table_index, "conn");
diff --git a/examples/python/taosdemo/taosdemo.py b/examples/python/taosdemo/taosdemo.py
index d55023bdbf119544a788aa6246c9d63dbf024872..13896bf54117d80d67a840fdb1158e3cbf793229 100755
--- a/examples/python/taosdemo/taosdemo.py
+++ b/examples/python/taosdemo/taosdemo.py
@@ -21,7 +21,7 @@ import json
import random
import time
import datetime
-from multiprocessing import Manager, Pool, Lock
+from multiprocessing import Manager, Pool
from multipledispatch import dispatch
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
@@ -102,12 +102,7 @@ def restful_execute(host: str, port: int, user: str, password: str, cmd: str):
v_print("resp status: %d", resp.status_code)
if debug:
- v_print(
- "resp text: %s",
- json.dumps(
- resp.json(),
- sort_keys=True,
- indent=2))
+ v_print("resp text: %s", json.dumps(resp.json(), sort_keys=True, indent=2))
else:
print("resp: %s" % json.dumps(resp.json()))
@@ -115,34 +110,29 @@ def restful_execute(host: str, port: int, user: str, password: str, cmd: str):
def query_func(process: int, thread: int, cmd: str):
v_print("%d process %d thread cmd: %s", process, thread, cmd)
- if oneMoreHost != "NotSupported" and random.randint(
- 0, 1) == 1:
+ if oneMoreHost != "NotSupported" and random.randint(0, 1) == 1:
v_print("%s", "Send to second host")
if native:
- cursor2.execute(cmd)
+ cursor.execute(cmd)
else:
- restful_execute(
- oneMoreHost, port, user, password, cmd)
+ restful_execute(oneMoreHost, port, user, password, cmd)
else:
v_print("%s%s%s", "Send ", cmd, " to the host")
if native:
pass
-# cursor.execute(cmd)
+ # cursor.execute(cmd)
else:
- restful_execute(
- host, port, user, password, cmd)
+ restful_execute(host, port, user, password, cmd)
def query_data_process(cmd: str):
# establish connection if native
if native:
- v_print("host:%s, user:%s passwd:%s configDir:%s ", host, user, password, configDir)
+ v_print("host:%s, user:%s passwd:xxxxxx configDir:%s ", host, user, configDir)
try:
conn = taos.connect(
- host=host,
- user=user,
- password=password,
- config=configDir)
+ host=host, user=user, password=password, config=configDir
+ )
v_print("conn: %s", str(conn.__class__))
except Exception as e:
print("Error: %s" % e.args[0])
@@ -160,6 +150,7 @@ def query_data_process(cmd: str):
try:
cursor.execute(cmd)
cols = cursor.description
+ print(cols)
data = cursor.fetchall()
for col in data:
@@ -170,12 +161,7 @@ def query_data_process(cmd: str):
sys.exit(1)
else:
- restful_execute(
- host,
- port,
- user,
- password,
- cmd)
+ restful_execute(host, port, user, password, cmd)
if native:
cursor.close()
@@ -186,21 +172,21 @@ def create_stb():
for i in range(0, numOfStb):
if native:
cursor.execute(
- "CREATE TABLE IF NOT EXISTS %s%d (ts timestamp, value float) TAGS (uuid binary(50))" %
- (stbName, i))
+ "CREATE TABLE IF NOT EXISTS %s%d (ts timestamp, value float) TAGS (uuid binary(50))"
+ % (stbName, i)
+ )
else:
restful_execute(
host,
port,
user,
password,
- "CREATE TABLE IF NOT EXISTS %s%d (ts timestamp, value float) TAGS (uuid binary(50))" %
- (stbName, i)
+ "CREATE TABLE IF NOT EXISTS %s%d (ts timestamp, value float) TAGS (uuid binary(50))"
+ % (stbName, i),
)
def use_database():
-
if native:
cursor.execute("USE %s" % current_db)
else:
@@ -212,15 +198,15 @@ def create_databases():
v_print("will create database db%d", int(i))
if native:
- cursor.execute(
- "CREATE DATABASE IF NOT EXISTS %s%d" % (dbName, i))
+ cursor.execute("CREATE DATABASE IF NOT EXISTS %s%d" % (dbName, i))
else:
restful_execute(
host,
port,
user,
password,
- "CREATE DATABASE IF NOT EXISTS %s%d" % (dbName, i))
+ "CREATE DATABASE IF NOT EXISTS %s%d" % (dbName, i),
+ )
def drop_tables():
@@ -243,17 +229,11 @@ def drop_databases():
v_print("will drop database db%d", int(i))
if native:
- cursor.execute(
- "DROP DATABASE IF EXISTS %s%d" %
- (dbName, i))
+ cursor.execute("DROP DATABASE IF EXISTS %s%d" % (dbName, i))
else:
restful_execute(
- host,
- port,
- user,
- password,
- "DROP DATABASE IF EXISTS %s%d" %
- (dbName, i))
+ host, port, user, password, "DROP DATABASE IF EXISTS %s%d" % (dbName, i)
+ )
def insert_func(process: int, thread: int):
@@ -266,13 +246,11 @@ def insert_func(process: int, thread: int):
# establish connection if native
if native:
- v_print("host:%s, user:%s passwd:%s configDir:%s ", host, user, password, configDir)
+ v_print("host:%s, user:%s passwd:xxxxxx configDir:%s ", host, user, configDir)
try:
conn = taos.connect(
- host=host,
- user=user,
- password=password,
- config=configDir)
+ host=host, user=user, password=password, config=configDir
+ )
v_print("conn: %s", str(conn.__class__))
except Exception as e:
print("Error: %s" % e.args[0])
@@ -291,26 +269,29 @@ def insert_func(process: int, thread: int):
row = 0
while row < numOfRec:
v_print("row: %d", row)
- sqlCmd = ['INSERT INTO ']
+ sqlCmd = ["INSERT INTO "]
try:
- sqlCmd.append(
- "%s.%s%d " % (current_db, tbName, thread))
+ sqlCmd.append("%s.%s%d " % (current_db, tbName, thread))
- if (numOfStb > 0 and autosubtable):
- sqlCmd.append("USING %s.%s%d TAGS('%s') " %
- (current_db, stbName, numOfStb - 1, uuid))
+ if numOfStb > 0 and autosubtable:
+ sqlCmd.append(
+ "USING %s.%s%d TAGS('%s') "
+ % (current_db, stbName, numOfStb - 1, uuid)
+ )
- start_time = datetime.datetime(
- 2021, 1, 25) + datetime.timedelta(seconds=row)
+ start_time = datetime.datetime(2021, 1, 25) + datetime.timedelta(
+ seconds=row
+ )
sqlCmd.append("VALUES ")
for batchIter in range(0, batch):
- sqlCmd.append("('%s', %f) " %
- (
- start_time +
- datetime.timedelta(
- milliseconds=batchIter),
- random.random()))
+ sqlCmd.append(
+ "('%s', %f) "
+ % (
+ start_time + datetime.timedelta(milliseconds=batchIter),
+ random.random(),
+ )
+ )
row = row + 1
if row >= numOfRec:
v_print("BREAK, row: %d numOfRec:%d", row, numOfRec)
@@ -319,23 +300,21 @@ def insert_func(process: int, thread: int):
except Exception as e:
print("Error: %s" % e.args[0])
- cmd = ' '.join(sqlCmd)
+ cmd = " ".join(sqlCmd)
if measure:
exec_start_time = datetime.datetime.now()
if native:
affectedRows = cursor.execute(cmd)
+ print("affectedRows: %d" % affectedRows)
else:
- restful_execute(
- host, port, user, password, cmd)
+ restful_execute(host, port, user, password, cmd)
if measure:
exec_end_time = datetime.datetime.now()
exec_delta = exec_end_time - exec_start_time
- v_print(
- "consume %d microseconds",
- exec_delta.microseconds)
+ v_print("consume %d microseconds", exec_delta.microseconds)
v_print("cmd: %s, length:%d", cmd, len(cmd))
@@ -355,51 +334,39 @@ def create_tb():
if native:
cursor.execute("USE %s%d" % (dbName, i))
else:
- restful_execute(
- host, port, user, password, "USE %s%d" %
- (dbName, i))
+ restful_execute(host, port, user, password, "USE %s%d" % (dbName, i))
for j in range(0, numOfTb):
if native:
cursor.execute(
- "CREATE TABLE %s%d (ts timestamp, value float)" %
- (tbName, j))
+ "CREATE TABLE %s%d (ts timestamp, value float)" % (tbName, j)
+ )
else:
restful_execute(
host,
port,
user,
password,
- "CREATE TABLE %s%d (ts timestamp, value float)" %
- (tbName, j))
+ "CREATE TABLE %s%d (ts timestamp, value float)" % (tbName, j),
+ )
def insert_data_process(lock, i: int, begin: int, end: int):
lock.acquire()
tasks = end - begin
- v_print("insert_data_process:%d table from %d to %d, tasks %d", i, begin, end, tasks)
+ v_print(
+ "insert_data_process:%d table from %d to %d, tasks %d", i, begin, end, tasks
+ )
- if (threads < (end - begin)):
+ if threads < (end - begin):
for j in range(begin, end, threads):
with ThreadPoolExecutor(max_workers=threads) as executor:
k = end if ((j + threads) > end) else (j + threads)
- workers = [
- executor.submit(
- insert_func,
- i,
- n) for n in range(
- j,
- k)]
+ workers = [executor.submit(insert_func, i, n) for n in range(j, k)]
wait(workers, return_when=ALL_COMPLETED)
else:
with ThreadPoolExecutor(max_workers=threads) as executor:
- workers = [
- executor.submit(
- insert_func,
- i,
- j) for j in range(
- begin,
- end)]
+ workers = [executor.submit(insert_func, i, j) for j in range(begin, end)]
wait(workers, return_when=ALL_COMPLETED)
lock.release()
@@ -409,22 +376,18 @@ def query_db(i):
if native:
cursor.execute("USE %s%d" % (dbName, i))
else:
- restful_execute(
- host, port, user, password, "USE %s%d" %
- (dbName, i))
+ restful_execute(host, port, user, password, "USE %s%d" % (dbName, i))
for j in range(0, numOfTb):
if native:
- cursor.execute(
- "SELECT COUNT(*) FROM %s%d" % (tbName, j))
+ cursor.execute("SELECT COUNT(*) FROM %s%d" % (tbName, j))
else:
restful_execute(
- host, port, user, password, "SELECT COUNT(*) FROM %s%d" %
- (tbName, j))
+ host, port, user, password, "SELECT COUNT(*) FROM %s%d" % (tbName, j)
+ )
def printConfig():
-
print("###################################################################")
print("# Use native interface: %s" % native)
print("# Server IP: %s" % host)
@@ -435,7 +398,6 @@ def printConfig():
print("# Configuration Dir: %s" % configDir)
print("# User: %s" % user)
- print("# Password: %s" % password)
print("# Number of Columns per record: %s" % colsPerRecord)
print("# Number of Threads: %s" % threads)
print("# Number of Processes: %s" % processes)
@@ -455,13 +417,14 @@ def printConfig():
print("# Query command: %s" % queryCmd)
print("# Insert Only: %s" % insertOnly)
print("# Verbose output %s" % verbose)
- print("# Test time: %s" %
- datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
+ print(
+ "# Test time: %s"
+ % datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S")
+ )
print("###################################################################")
if __name__ == "__main__":
-
native = False
verbose = False
debug = False
@@ -497,73 +460,131 @@ if __name__ == "__main__":
skipPrompt = False
try:
- opts, args = getopt.gnu_getopt(sys.argv[1:],
- 'Nh:p:u:P:d:a:m:Ms:Q:T:C:r:l:t:n:c:xOR:D:vgyH',
- [
- 'native', 'host', 'port', 'user', 'password', 'dbname', 'replica', 'tbname',
- 'stable', 'stbname', 'query', 'threads', 'processes',
- 'recPerReq', 'colsPerRecord', 'numOfTb', 'numOfRec', 'config',
- 'insertOnly', 'outOfOrder', 'rateOOOO', 'deleteMethod',
- 'verbose', 'debug', 'skipPrompt', 'help'
- ])
+ opts, args = getopt.gnu_getopt(
+ sys.argv[1:],
+ "Nh:p:u:P:d:a:m:Ms:Q:T:C:r:l:t:n:c:xOR:D:vgyH",
+ [
+ "native",
+ "host",
+ "port",
+ "user",
+ "password",
+ "dbname",
+ "replica",
+ "tbname",
+ "stable",
+ "stbname",
+ "query",
+ "threads",
+ "processes",
+ "recPerReq",
+ "colsPerRecord",
+ "numOfTb",
+ "numOfRec",
+ "config",
+ "insertOnly",
+ "outOfOrder",
+ "rateOOOO",
+ "deleteMethod",
+ "verbose",
+ "debug",
+ "skipPrompt",
+ "help",
+ ],
+ )
except getopt.GetoptError as err:
- print('ERROR:', err)
- print('Try `taosdemo.py --help` for more options.')
+ print("ERROR:", err)
+ print("Try `taosdemo.py --help` for more options.")
sys.exit(1)
if bool(opts) is False:
- print('Try `taosdemo.py --help` for more options.')
+ print("Try `taosdemo.py --help` for more options.")
sys.exit(1)
for key, value in opts:
- if key in ['-H', '--help']:
- print('')
+ if key in ["-H", "--help"]:
+ print("")
+ print("taosdemo.py for TDengine")
+ print("")
+ print("Author: Shuduo Sang ")
+ print("")
+
+ print("\t-H, --help Show usage.")
+ print("")
+
+ print(
+ "\t-N, --native flag, Use native interface if set. Default is using RESTful interface."
+ )
+ print(
+ "\t-h, --host host, The host to connect to TDengine. Default is localhost."
+ )
+ print(
+ "\t-p, --port port, The TCP/IP port number to use for the connection. Default is 0."
+ )
print(
- 'taosdemo.py for TDengine')
- print('')
- print('Author: Shuduo Sang ')
- print('')
-
- print('\t-H, --help Show usage.')
- print('')
-
- print('\t-N, --native flag, Use native interface if set. Default is using RESTful interface.')
- print('\t-h, --host host, The host to connect to TDengine. Default is localhost.')
- print('\t-p, --port port, The TCP/IP port number to use for the connection. Default is 0.')
- print('\t-u, --user user, The user name to use when connecting to the server. Default is \'root\'.')
- print('\t-P, --password password, The password to use when connecting to the server. Default is \'taosdata\'.')
- print('\t-l, --colsPerRec num_of_columns_per_record, The number of columns per record. Default is 3.')
+ "\t-u, --user user, The user name to use when connecting to the server. Default is 'root'."
+ )
+ print(
+ "\t-P, --password password, The password to use when connecting to the server. Default is 'taosdata'."
+ )
+ print(
+ "\t-l, --colsPerRec num_of_columns_per_record, The number of columns per record. Default is 3."
+ )
+ print(
+ "\t-d, --dbname database, Destination database. Default is 'test'."
+ )
+ print(
+ "\t-a, --replica replica, Set the replica parameters of the database, Default 1, min: 1, max: 5."
+ )
print(
- '\t-d, --dbname database, Destination database. Default is \'test\'.')
- print('\t-a, --replica replica, Set the replica parameters of the database, Default 1, min: 1, max: 5.')
+ "\t-m, --tbname table_prefix, Table prefix name. Default is 't'."
+ )
print(
- '\t-m, --tbname table_prefix, Table prefix name. Default is \'t\'.')
+ "\t-M, --stable flag, Use super table. Default is no"
+ )
print(
- '\t-M, --stable flag, Use super table. Default is no')
+ "\t-s, --stbname stable_prefix, STable prefix name. Default is 'st'"
+ )
print(
- '\t-s, --stbname stable_prefix, STable prefix name. Default is \'st\'')
- print('\t-Q, --query [NO|EACHTB|command] query, Execute query command. set \'EACHTB\' means select * from each table')
+ "\t-Q, --query [NO|EACHTB|command] query, Execute query command. set 'EACHTB' means select * from each table"
+ )
print(
- '\t-T, --threads num_of_threads, The number of threads. Default is 1.')
+ "\t-T, --threads num_of_threads, The number of threads. Default is 1."
+ )
print(
- '\t-C, --processes num_of_processes, The number of threads. Default is 1.')
- print('\t-r, --batch num_of_records_per_req, The number of records per request. Default is 1000.')
+ "\t-C, --processes num_of_processes, The number of threads. Default is 1."
+ )
+ print(
+ "\t-r, --batch num_of_records_per_req, The number of records per request. Default is 1000."
+ )
print(
- '\t-t, --numOfTb num_of_tables, The number of tables. Default is 1.')
- print('\t-n, --numOfRec num_of_records_per_table, The number of records per table. Default is 1.')
- print('\t-c, --config config_directory, Configuration directory. Default is \'/etc/taos/\'.')
- print('\t-x, --inserOnly flag, Insert only flag.')
- print('\t-O, --outOfOrder out of order data insert, 0: In order, 1: Out of order. Default is in order.')
- print('\t-R, --rateOOOO rate, Out of order data\'s rate--if order=1 Default 10, min: 0, max: 50.')
- print('\t-D, --deleteMethod Delete data methods 0: don\'t delete, 1: delete by table, 2: delete by stable, 3: delete by database.')
- print('\t-v, --verbose Print verbose output')
- print('\t-g, --debug Print debug output')
+ "\t-t, --numOfTb num_of_tables, The number of tables. Default is 1."
+ )
print(
- '\t-y, --skipPrompt Skip read key for continous test, default is not skip')
- print('')
+ "\t-n, --numOfRec num_of_records_per_table, The number of records per table. Default is 1."
+ )
+ print(
+ "\t-c, --config config_directory, Configuration directory. Default is '/etc/taos/'."
+ )
+ print("\t-x, --inserOnly flag, Insert only flag.")
+ print(
+ "\t-O, --outOfOrder out of order data insert, 0: In order, 1: Out of order. Default is in order."
+ )
+ print(
+ "\t-R, --rateOOOO rate, Out of order data's rate--if order=1 Default 10, min: 0, max: 50."
+ )
+ print(
+ "\t-D, --deleteMethod Delete data methods 0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database."
+ )
+ print("\t-v, --verbose Print verbose output")
+ print("\t-g, --debug Print debug output")
+ print(
+ "\t-y, --skipPrompt Skip read key for continous test, default is not skip"
+ )
+ print("")
sys.exit(0)
- if key in ['-N', '--native']:
+ if key in ["-N", "--native"]:
try:
import taos
except Exception as e:
@@ -571,104 +592,104 @@ if __name__ == "__main__":
sys.exit(1)
native = True
- if key in ['-h', '--host']:
+ if key in ["-h", "--host"]:
host = value
- if key in ['-p', '--port']:
+ if key in ["-p", "--port"]:
port = int(value)
- if key in ['-u', '--user']:
+ if key in ["-u", "--user"]:
user = value
- if key in ['-P', '--password']:
+ if key in ["-P", "--password"]:
password = value
else:
password = defaultPass
- if key in ['-d', '--dbname']:
+ if key in ["-d", "--dbname"]:
dbName = value
- if key in ['-a', '--replica']:
+ if key in ["-a", "--replica"]:
replica = int(value)
if replica < 1:
print("FATAL: number of replica need > 0")
sys.exit(1)
- if key in ['-m', '--tbname']:
+ if key in ["-m", "--tbname"]:
tbName = value
- if key in ['-M', '--stable']:
+ if key in ["-M", "--stable"]:
useStable = True
numOfStb = 1
- if key in ['-s', '--stbname']:
+ if key in ["-s", "--stbname"]:
stbName = value
- if key in ['-Q', '--query']:
+ if key in ["-Q", "--query"]:
queryCmd = str(value)
- if key in ['-T', '--threads']:
+ if key in ["-T", "--threads"]:
threads = int(value)
if threads < 1:
print("FATAL: number of threads must be larger than 0")
sys.exit(1)
- if key in ['-C', '--processes']:
+ if key in ["-C", "--processes"]:
processes = int(value)
if processes < 1:
print("FATAL: number of processes must be larger than 0")
sys.exit(1)
- if key in ['-r', '--batch']:
+ if key in ["-r", "--batch"]:
batch = int(value)
- if key in ['-l', '--colsPerRec']:
+ if key in ["-l", "--colsPerRec"]:
colsPerRec = int(value)
- if key in ['-t', '--numOfTb']:
+ if key in ["-t", "--numOfTb"]:
numOfTb = int(value)
v_print("numOfTb is %d", numOfTb)
- if key in ['-n', '--numOfRec']:
+ if key in ["-n", "--numOfRec"]:
numOfRec = int(value)
v_print("numOfRec is %d", numOfRec)
if numOfRec < 1:
print("FATAL: number of records must be larger than 0")
sys.exit(1)
-
- if key in ['-c', '--config']:
+ if key in ["-c", "--config"]:
configDir = value
v_print("config dir: %s", configDir)
- if key in ['-x', '--insertOnly']:
+ if key in ["-x", "--insertOnly"]:
insertOnly = True
v_print("insert only: %d", insertOnly)
- if key in ['-O', '--outOfOrder']:
+ if key in ["-O", "--outOfOrder"]:
outOfOrder = int(value)
v_print("out of order is %d", outOfOrder)
- if key in ['-R', '--rateOOOO']:
+ if key in ["-R", "--rateOOOO"]:
rateOOOO = int(value)
v_print("the rate of out of order is %d", rateOOOO)
- if key in ['-D', '--deleteMethod']:
+ if key in ["-D", "--deleteMethod"]:
deleteMethod = int(value)
if (deleteMethod < 0) or (deleteMethod > 3):
print(
- "inputed delete method is %d, valid value is 0~3, set to default 0" %
- deleteMethod)
+ "inputed delete method is %d, valid value is 0~3, set to default 0"
+ % deleteMethod
+ )
deleteMethod = 0
v_print("the delete method is %d", deleteMethod)
- if key in ['-v', '--verbose']:
+ if key in ["-v", "--verbose"]:
verbose = True
- if key in ['-g', '--debug']:
+ if key in ["-g", "--debug"]:
debug = True
- if key in ['-y', '--skipPrompt']:
+ if key in ["-y", "--skipPrompt"]:
skipPrompt = True
if verbose:
@@ -679,13 +700,11 @@ if __name__ == "__main__":
# establish connection first if native
if native:
- v_print("host:%s, user:%s passwd:%s configDir:%s ", host, user, password, configDir)
+ v_print("host:%s, user:%s passwd:xxxxxx configDir:%s ", host, user, configDir)
try:
conn = taos.connect(
- host=host,
- user=user,
- password=password,
- config=configDir)
+ host=host, user=user, password=password, config=configDir
+ )
v_print("conn: %s", str(conn.__class__))
except Exception as e:
print("Error: %s" % e.args[0])
@@ -705,7 +724,7 @@ if __name__ == "__main__":
drop_tables()
print("Drop tables done.")
elif deleteMethod == 2:
- drop_stables()
+ drop_stable()
print("Drop super tables done.")
elif deleteMethod == 3:
drop_databases()
@@ -725,7 +744,7 @@ if __name__ == "__main__":
if numOfStb > 0:
create_stb()
- if (autosubtable == False):
+ if autosubtable is False:
create_tb_using_stb()
else:
create_tb()
@@ -734,7 +753,9 @@ if __name__ == "__main__":
end_time = time.time()
print(
"Total time consumed {} seconds for create table.".format(
- (end_time - start_time_begin)))
+ (end_time - start_time_begin)
+ )
+ )
if native:
cursor.close()
@@ -758,10 +779,8 @@ if __name__ == "__main__":
remainder = numOfTb % processes
v_print(
- "num of tables: %d, quotient: %d, remainder: %d",
- numOfTb,
- quotient,
- remainder)
+ "num of tables: %d, quotient: %d, remainder: %d", numOfTb, quotient, remainder
+ )
for i in range(processes):
begin = end
@@ -770,7 +789,15 @@ if __name__ == "__main__":
end = begin + quotient + 1
else:
end = begin + quotient
- pool.apply_async(insert_data_process, args=(lock, i, begin, end,))
+ pool.apply_async(
+ insert_data_process,
+ args=(
+ lock,
+ i,
+ begin,
+ end,
+ ),
+ )
pool.close()
pool.join()
@@ -780,8 +807,9 @@ if __name__ == "__main__":
end_time = time.time()
print(
"Total time consumed {} seconds for insert data.".format(
- (end_time - start_time)))
-
+ (end_time - start_time)
+ )
+ )
# query data
if queryCmd != "NO":
@@ -790,8 +818,6 @@ if __name__ == "__main__":
if measure:
end_time = time.time()
- print(
- "Total time consumed {} seconds.".format(
- (end_time - start_time_begin)))
+ print("Total time consumed {} seconds.".format((end_time - start_time_begin)))
print("done")
diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index ce441502cbf26928bd4d69600103efdce83f98f3..999cc17767cbb6de851fad7b817fdcde70ddf146 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -846,6 +846,8 @@ typedef struct {
int8_t replications;
int32_t sstTrigger;
int32_t minRows;
+ int32_t walRetentionPeriod;
+ int32_t walRetentionSize;
} SAlterDbReq;
int32_t tSerializeSAlterDbReq(void* buf, int32_t bufLen, SAlterDbReq* pReq);
@@ -1052,6 +1054,7 @@ typedef struct {
int64_t signature;
char* pComment;
char* pCode;
+ int8_t orReplace;
} SCreateFuncReq;
int32_t tSerializeSCreateFuncReq(void* buf, int32_t bufLen, SCreateFuncReq* pReq);
@@ -1321,6 +1324,9 @@ typedef struct {
// 1st modification
int16_t sttTrigger;
int32_t minRows;
+ // 2nd modification
+ int32_t walRetentionPeriod;
+ int32_t walRetentionSize;
} SAlterVnodeConfigReq;
int32_t tSerializeSAlterVnodeConfigReq(void* buf, int32_t bufLen, SAlterVnodeConfigReq* pReq);
@@ -1656,6 +1662,20 @@ typedef struct {
int32_t tSerializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistributeVgroupReq* pReq);
int32_t tDeserializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistributeVgroupReq* pReq);
+typedef struct {
+ int32_t useless;
+} SBalanceVgroupLeaderReq;
+
+int32_t tSerializeSBalanceVgroupLeaderReq(void* buf, int32_t bufLen, SBalanceVgroupLeaderReq* pReq);
+int32_t tDeserializeSBalanceVgroupLeaderReq(void* buf, int32_t bufLen, SBalanceVgroupLeaderReq* pReq);
+
+typedef struct {
+ int32_t vgId;
+} SForceBecomeFollowerReq;
+
+int32_t tSerializeSForceBecomeFollowerReq(void* buf, int32_t bufLen, SForceBecomeFollowerReq* pReq);
+int32_t tDeserializeSForceBecomeFollowerReq(void* buf, int32_t bufLen, SForceBecomeFollowerReq* pReq);
+
typedef struct {
int32_t vgId;
} SSplitVgroupReq;
@@ -3187,9 +3207,9 @@ typedef struct {
SArray* blockTbName;
SArray* blockSchema;
// the following attributes are extended from SMqDataRsp
- int32_t createTableNum;
- SArray* createTableLen;
- SArray* createTableReq;
+ int32_t createTableNum;
+ SArray* createTableLen;
+ SArray* createTableReq;
} STaosxRsp;
int32_t tEncodeSTaosxRsp(SEncoder* pEncoder, const STaosxRsp* pRsp);
diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h
index 96d18d1abc6d0720662ff06079b4b042313538f2..6cf6140815cf1663392950b0ee119b0ae65db126 100644
--- a/include/common/tmsgdef.h
+++ b/include/common/tmsgdef.h
@@ -175,6 +175,7 @@ enum {
// TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHECKPOINT_TIMER, "stream-checkpoint-tmr", NULL, NULL)
// TD_DEF_MSG_TYPE(TDMT_MND_STREAM_BEGIN_CHECKPOINT, "stream-begin-checkpoint", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_MAX_MSG, "mnd-max", NULL, NULL)
+ TD_DEF_MSG_TYPE(TDMT_MND_BALANCE_VGROUP_LEADER, "balance-vgroup-leader", NULL, NULL)
TD_NEW_MSG_SEG(TDMT_VND_MSG)
TD_DEF_MSG_TYPE(TDMT_VND_SUBMIT, "submit", SSubmitReq, SSubmitRsp)
@@ -286,6 +287,7 @@ enum {
TD_DEF_MSG_TYPE(TDMT_SYNC_PRE_SNAPSHOT, "sync-pre-snapshot", NULL, NULL) // no longer used
TD_DEF_MSG_TYPE(TDMT_SYNC_PRE_SNAPSHOT_REPLY, "sync-pre-snapshot-reply", NULL, NULL) // no longer used
TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL)
+ TD_DEF_MSG_TYPE(TDMT_SYNC_FORCE_FOLLOWER, "sync-force-become-follower", NULL, NULL)
TD_NEW_MSG_SEG(TDMT_VND_STREAM_MSG)
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TRIGGER, "vnode-stream-trigger", NULL, NULL)
diff --git a/include/common/ttime.h b/include/common/ttime.h
index 4a7c47d1725dcc3dd1fde1e5c17a021e992156fb..f189959f22ca4bee4b07518aff00e7bbc527fb87 100644
--- a/include/common/ttime.h
+++ b/include/common/ttime.h
@@ -64,7 +64,7 @@ static FORCE_INLINE int64_t taosGetTimestampToday(int32_t precision) {
: 1000000000;
time_t t = taosTime(NULL);
struct tm tm;
- taosLocalTime(&t, &tm);
+ taosLocalTime(&t, &tm, NULL);
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index a0593e7d4b725e0eb5d128ae216ef1c6e9eb0b74..fc66363603fb177b98b805bd84daefeaafaaff75 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -207,142 +207,144 @@
#define TK_OUTPUTTYPE 189
#define TK_AGGREGATE 190
#define TK_BUFSIZE 191
-#define TK_STREAM 192
-#define TK_INTO 193
-#define TK_TRIGGER 194
-#define TK_AT_ONCE 195
-#define TK_WINDOW_CLOSE 196
-#define TK_IGNORE 197
-#define TK_EXPIRED 198
-#define TK_FILL_HISTORY 199
-#define TK_UPDATE 200
-#define TK_SUBTABLE 201
-#define TK_KILL 202
-#define TK_CONNECTION 203
-#define TK_TRANSACTION 204
-#define TK_BALANCE 205
-#define TK_VGROUP 206
-#define TK_MERGE 207
-#define TK_REDISTRIBUTE 208
-#define TK_SPLIT 209
-#define TK_DELETE 210
-#define TK_INSERT 211
-#define TK_NULL 212
-#define TK_NK_QUESTION 213
-#define TK_NK_ARROW 214
-#define TK_ROWTS 215
-#define TK_QSTART 216
-#define TK_QEND 217
-#define TK_QDURATION 218
-#define TK_WSTART 219
-#define TK_WEND 220
-#define TK_WDURATION 221
-#define TK_IROWTS 222
-#define TK_ISFILLED 223
-#define TK_CAST 224
-#define TK_NOW 225
-#define TK_TODAY 226
-#define TK_TIMEZONE 227
-#define TK_CLIENT_VERSION 228
-#define TK_SERVER_VERSION 229
-#define TK_SERVER_STATUS 230
-#define TK_CURRENT_USER 231
-#define TK_CASE 232
-#define TK_WHEN 233
-#define TK_THEN 234
-#define TK_ELSE 235
-#define TK_BETWEEN 236
-#define TK_IS 237
-#define TK_NK_LT 238
-#define TK_NK_GT 239
-#define TK_NK_LE 240
-#define TK_NK_GE 241
-#define TK_NK_NE 242
-#define TK_MATCH 243
-#define TK_NMATCH 244
-#define TK_CONTAINS 245
-#define TK_IN 246
-#define TK_JOIN 247
-#define TK_INNER 248
-#define TK_SELECT 249
-#define TK_DISTINCT 250
-#define TK_WHERE 251
-#define TK_PARTITION 252
-#define TK_BY 253
-#define TK_SESSION 254
-#define TK_STATE_WINDOW 255
-#define TK_EVENT_WINDOW 256
-#define TK_SLIDING 257
-#define TK_FILL 258
-#define TK_VALUE 259
-#define TK_VALUE_F 260
-#define TK_NONE 261
-#define TK_PREV 262
-#define TK_NULL_F 263
-#define TK_LINEAR 264
-#define TK_NEXT 265
-#define TK_HAVING 266
-#define TK_RANGE 267
-#define TK_EVERY 268
-#define TK_ORDER 269
-#define TK_SLIMIT 270
-#define TK_SOFFSET 271
-#define TK_LIMIT 272
-#define TK_OFFSET 273
-#define TK_ASC 274
-#define TK_NULLS 275
-#define TK_ABORT 276
-#define TK_AFTER 277
-#define TK_ATTACH 278
-#define TK_BEFORE 279
-#define TK_BEGIN 280
-#define TK_BITAND 281
-#define TK_BITNOT 282
-#define TK_BITOR 283
-#define TK_BLOCKS 284
-#define TK_CHANGE 285
-#define TK_COMMA 286
-#define TK_CONCAT 287
-#define TK_CONFLICT 288
-#define TK_COPY 289
-#define TK_DEFERRED 290
-#define TK_DELIMITERS 291
-#define TK_DETACH 292
-#define TK_DIVIDE 293
-#define TK_DOT 294
-#define TK_EACH 295
-#define TK_FAIL 296
-#define TK_FILE 297
-#define TK_FOR 298
-#define TK_GLOB 299
-#define TK_ID 300
-#define TK_IMMEDIATE 301
-#define TK_IMPORT 302
-#define TK_INITIALLY 303
-#define TK_INSTEAD 304
-#define TK_ISNULL 305
-#define TK_KEY 306
-#define TK_MODULES 307
-#define TK_NK_BITNOT 308
-#define TK_NK_SEMI 309
-#define TK_NOTNULL 310
-#define TK_OF 311
-#define TK_PLUS 312
-#define TK_PRIVILEGE 313
-#define TK_RAISE 314
-#define TK_REPLACE 315
-#define TK_RESTRICT 316
-#define TK_ROW 317
-#define TK_SEMI 318
-#define TK_STAR 319
-#define TK_STATEMENT 320
-#define TK_STRICT 321
-#define TK_STRING 322
-#define TK_TIMES 323
-#define TK_VALUES 324
-#define TK_VARIABLE 325
-#define TK_VIEW 326
-#define TK_WAL 327
+#define TK_LANGUAGE 192
+#define TK_REPLACE 193
+#define TK_STREAM 194
+#define TK_INTO 195
+#define TK_TRIGGER 196
+#define TK_AT_ONCE 197
+#define TK_WINDOW_CLOSE 198
+#define TK_IGNORE 199
+#define TK_EXPIRED 200
+#define TK_FILL_HISTORY 201
+#define TK_UPDATE 202
+#define TK_SUBTABLE 203
+#define TK_KILL 204
+#define TK_CONNECTION 205
+#define TK_TRANSACTION 206
+#define TK_BALANCE 207
+#define TK_VGROUP 208
+#define TK_LEADER 209
+#define TK_MERGE 210
+#define TK_REDISTRIBUTE 211
+#define TK_SPLIT 212
+#define TK_DELETE 213
+#define TK_INSERT 214
+#define TK_NULL 215
+#define TK_NK_QUESTION 216
+#define TK_NK_ARROW 217
+#define TK_ROWTS 218
+#define TK_QSTART 219
+#define TK_QEND 220
+#define TK_QDURATION 221
+#define TK_WSTART 222
+#define TK_WEND 223
+#define TK_WDURATION 224
+#define TK_IROWTS 225
+#define TK_ISFILLED 226
+#define TK_CAST 227
+#define TK_NOW 228
+#define TK_TODAY 229
+#define TK_TIMEZONE 230
+#define TK_CLIENT_VERSION 231
+#define TK_SERVER_VERSION 232
+#define TK_SERVER_STATUS 233
+#define TK_CURRENT_USER 234
+#define TK_CASE 235
+#define TK_WHEN 236
+#define TK_THEN 237
+#define TK_ELSE 238
+#define TK_BETWEEN 239
+#define TK_IS 240
+#define TK_NK_LT 241
+#define TK_NK_GT 242
+#define TK_NK_LE 243
+#define TK_NK_GE 244
+#define TK_NK_NE 245
+#define TK_MATCH 246
+#define TK_NMATCH 247
+#define TK_CONTAINS 248
+#define TK_IN 249
+#define TK_JOIN 250
+#define TK_INNER 251
+#define TK_SELECT 252
+#define TK_DISTINCT 253
+#define TK_WHERE 254
+#define TK_PARTITION 255
+#define TK_BY 256
+#define TK_SESSION 257
+#define TK_STATE_WINDOW 258
+#define TK_EVENT_WINDOW 259
+#define TK_SLIDING 260
+#define TK_FILL 261
+#define TK_VALUE 262
+#define TK_VALUE_F 263
+#define TK_NONE 264
+#define TK_PREV 265
+#define TK_NULL_F 266
+#define TK_LINEAR 267
+#define TK_NEXT 268
+#define TK_HAVING 269
+#define TK_RANGE 270
+#define TK_EVERY 271
+#define TK_ORDER 272
+#define TK_SLIMIT 273
+#define TK_SOFFSET 274
+#define TK_LIMIT 275
+#define TK_OFFSET 276
+#define TK_ASC 277
+#define TK_NULLS 278
+#define TK_ABORT 279
+#define TK_AFTER 280
+#define TK_ATTACH 281
+#define TK_BEFORE 282
+#define TK_BEGIN 283
+#define TK_BITAND 284
+#define TK_BITNOT 285
+#define TK_BITOR 286
+#define TK_BLOCKS 287
+#define TK_CHANGE 288
+#define TK_COMMA 289
+#define TK_CONCAT 290
+#define TK_CONFLICT 291
+#define TK_COPY 292
+#define TK_DEFERRED 293
+#define TK_DELIMITERS 294
+#define TK_DETACH 295
+#define TK_DIVIDE 296
+#define TK_DOT 297
+#define TK_EACH 298
+#define TK_FAIL 299
+#define TK_FILE 300
+#define TK_FOR 301
+#define TK_GLOB 302
+#define TK_ID 303
+#define TK_IMMEDIATE 304
+#define TK_IMPORT 305
+#define TK_INITIALLY 306
+#define TK_INSTEAD 307
+#define TK_ISNULL 308
+#define TK_KEY 309
+#define TK_MODULES 310
+#define TK_NK_BITNOT 311
+#define TK_NK_SEMI 312
+#define TK_NOTNULL 313
+#define TK_OF 314
+#define TK_PLUS 315
+#define TK_PRIVILEGE 316
+#define TK_RAISE 317
+#define TK_RESTRICT 318
+#define TK_ROW 319
+#define TK_SEMI 320
+#define TK_STAR 321
+#define TK_STATEMENT 322
+#define TK_STRICT 323
+#define TK_STRING 324
+#define TK_TIMES 325
+#define TK_VALUES 326
+#define TK_VARIABLE 327
+#define TK_VIEW 328
+#define TK_WAL 329
#define TK_NK_SPACE 600
#define TK_NK_COMMENT 601
diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h
index 8d63306a881b306c061606569ec3c02aee1548b0..91b6fa51a2682296a8da3d935d7c34d098f6b1ab 100644
--- a/include/libs/executor/executor.h
+++ b/include/libs/executor/executor.h
@@ -78,7 +78,8 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers, int32_t v
* @param SReadHandle
* @return
*/
-qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int32_t vgId, int32_t* numOfCols, uint64_t id);
+qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int32_t vgId, int32_t* numOfCols,
+ uint64_t id);
/**
* set the task Id, usually used by message queue process
diff --git a/include/libs/function/taosudf.h b/include/libs/function/taosudf.h
index 1b1339340b1dc13d85740e953400ac6c0ee85f40..b4daa895fd1a66ae01db72704c37c7a8707a8ace 100644
--- a/include/libs/function/taosudf.h
+++ b/include/libs/function/taosudf.h
@@ -80,10 +80,6 @@ typedef struct SUdfInterBuf {
} SUdfInterBuf;
typedef void *UdfcFuncHandle;
-// dynamic lib init and destroy
-typedef int32_t (*TUdfInitFunc)();
-typedef int32_t (*TUdfDestroyFunc)();
-
#define UDF_MEMORY_EXP_GROWTH 1.5
#define NBIT (3u)
#define BitPos(_n) ((_n) & ((1 << NBIT) - 1))
@@ -153,6 +149,8 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
allocCapacity *= UDF_MEMORY_EXP_GROWTH;
}
+ int32_t existedRows = data->numOfRows;
+
if (IS_VAR_DATA_TYPE(meta->type)) {
char *tmp = (char *)realloc(data->varLenCol.varOffsets, sizeof(int32_t) * allocCapacity);
if (tmp == NULL) {
@@ -160,6 +158,7 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
}
data->varLenCol.varOffsets = (int32_t *)tmp;
data->varLenCol.varOffsetsLen = sizeof(int32_t) * allocCapacity;
+ memset(&data->varLenCol.varOffsets[existedRows], 0, sizeof(int32_t) * (allocCapacity - existedRows));
// for payload, add data in udfColDataAppend
} else {
char *tmp = (char *)realloc(data->fixLenCol.nullBitmap, BitmapLen(allocCapacity));
@@ -168,6 +167,9 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
}
data->fixLenCol.nullBitmap = tmp;
data->fixLenCol.nullBitmapLen = BitmapLen(allocCapacity);
+ int32_t oldLen = BitmapLen(existedRows);
+ memset(&data->fixLenCol.nullBitmap[oldLen], 0, BitmapLen(allocCapacity) - oldLen);
+
if (meta->type == TSDB_DATA_TYPE_NULL) {
return TSDB_CODE_SUCCESS;
}
@@ -194,6 +196,7 @@ static FORCE_INLINE void udfColDataSetNull(SUdfColumn *pColumn, int32_t row) {
udfColDataSetNull_f(pColumn, row);
}
pColumn->hasNull = true;
+ pColumn->colData.numOfRows = ((int32_t)(row + 1) > pColumn->colData.numOfRows) ? (int32_t)(row + 1) : pColumn->colData.numOfRows;
}
static FORCE_INLINE int32_t udfColDataSet(SUdfColumn *pColumn, uint32_t currentRow, const char *pData, bool isNull) {
@@ -252,6 +255,10 @@ static FORCE_INLINE int32_t udfColDataSet(SUdfColumn *pColumn, uint32_t currentR
return 0;
}
+// dynamic lib init and destroy for C UDF
+typedef int32_t (*TUdfInitFunc)();
+typedef int32_t (*TUdfDestroyFunc)();
+
typedef int32_t (*TUdfScalarProcFunc)(SUdfDataBlock *block, SUdfColumn *resultCol);
typedef int32_t (*TUdfAggStartFunc)(SUdfInterBuf *buf);
@@ -259,6 +266,41 @@ typedef int32_t (*TUdfAggProcessFunc)(SUdfDataBlock *block, SUdfInterBuf *interB
typedef int32_t (*TUdfAggMergeFunc)(SUdfInterBuf *inputBuf1, SUdfInterBuf *inputBuf2, SUdfInterBuf *outputBuf);
typedef int32_t (*TUdfAggFinishFunc)(SUdfInterBuf *buf, SUdfInterBuf *resultData);
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct SScriptUdfEnvItem {
+ const char *name;
+ const char *value;
+} SScriptUdfEnvItem;
+
+typedef enum EUdfFuncType { UDF_FUNC_TYPE_SCALAR = 1, UDF_FUNC_TYPE_AGG = 2 } EUdfFuncType;
+
+typedef struct SScriptUdfInfo {
+ const char *name;
+
+ EUdfFuncType funcType;
+ int8_t scriptType;
+ int8_t outputType;
+ int32_t outputLen;
+ int32_t bufSize;
+
+ const char *path;
+} SScriptUdfInfo;
+
+typedef int32_t (*TScriptUdfScalarProcFunc)(SUdfDataBlock *block, SUdfColumn *resultCol, void *udfCtx);
+
+typedef int32_t (*TScriptUdfAggStartFunc)(SUdfInterBuf *buf, void *udfCtx);
+typedef int32_t (*TScriptUdfAggProcessFunc)(SUdfDataBlock *block, SUdfInterBuf *interBuf, SUdfInterBuf *newInterBuf,
+ void *udfCtx);
+typedef int32_t (*TScriptUdfAggMergeFunc)(SUdfInterBuf *inputBuf1, SUdfInterBuf *inputBuf2, SUdfInterBuf *outputBuf,
+ void *udfCtx);
+typedef int32_t (*TScriptUdfAggFinishFunc)(SUdfInterBuf *buf, SUdfInterBuf *resultData, void *udfCtx);
+typedef int32_t (*TScriptUdfInitFunc)(SScriptUdfInfo *info, void **pUdfCtx);
+typedef int32_t (*TScriptUdfDestoryFunc)(void *udfCtx);
+
+// the following function is for open/close script plugin.
+typedef int32_t (*TScriptOpenFunc)(SScriptUdfEnvItem *items, int numItems);
+typedef int32_t (*TScriptCloseFunc)();
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libs/monitor/monitor.h b/include/libs/monitor/monitor.h
index 1da801be0d95cbe72d1f5fab2a84d2aee92d07c2..607179c4464f157aca7d757403775b634b694d8b 100644
--- a/include/libs/monitor/monitor.h
+++ b/include/libs/monitor/monitor.h
@@ -116,6 +116,8 @@ typedef struct {
int32_t vnodes_total;
int32_t vnodes_alive;
int32_t connections_total;
+ int32_t topics_toal;
+ int32_t streams_total;
SArray *dnodes; // array of SMonDnodeDesc
SArray *mnodes; // array of SMonMnodeDesc
} SMonClusterInfo;
diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h
index bcbc5f4cf488b1ce1dc864ff6d6d865ca0979c27..3ae3900a5c501944676ed34de35c92da1cd8670a 100644
--- a/include/libs/nodes/cmdnodes.h
+++ b/include/libs/nodes/cmdnodes.h
@@ -438,12 +438,14 @@ typedef struct SDropStreamStmt {
typedef struct SCreateFunctionStmt {
ENodeType type;
+ bool orReplace;
bool ignoreExists;
char funcName[TSDB_FUNC_NAME_LEN];
bool isAgg;
char libraryPath[PATH_MAX];
SDataType outputDt;
int32_t bufSize;
+ int8_t language;
} SCreateFunctionStmt;
typedef struct SDropFunctionStmt {
@@ -465,6 +467,10 @@ typedef struct SBalanceVgroupStmt {
ENodeType type;
} SBalanceVgroupStmt;
+typedef struct SBalanceVgroupLeaderStmt {
+ ENodeType type;
+} SBalanceVgroupLeaderStmt;
+
typedef struct SMergeVgroupStmt {
ENodeType type;
int32_t vgId1;
diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h
index a2e4c76adccc91d5a1f8689643f3d7a93089eba0..3556a8ac9520bdfd7b58fa490c3b333aa034e9ed 100644
--- a/include/libs/nodes/nodes.h
+++ b/include/libs/nodes/nodes.h
@@ -209,7 +209,8 @@ typedef enum ENodeType {
QUERY_NODE_INSERT_STMT,
QUERY_NODE_QUERY,
QUERY_NODE_SHOW_DB_ALIVE_STMT,
- QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT,
+ QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT,
+ QUERY_NODE_BALANCE_VGROUP_LEADER_STMT,
// logic plan node
QUERY_NODE_LOGIC_PLAN_SCAN = 1000,
diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h
index 1cd32f05ad6acd1939e45860ae60a8e4bdd08d08..fdb4506cf3c00d04b6f5981601eb6915d3cd381b 100644
--- a/include/libs/sync/sync.h
+++ b/include/libs/sync/sync.h
@@ -246,6 +246,7 @@ bool syncIsReadyForRead(int64_t rid);
bool syncSnapshotSending(int64_t rid);
bool syncSnapshotRecving(int64_t rid);
int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq);
+int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg);
SSyncState syncGetState(int64_t rid);
void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet);
diff --git a/include/os/osDir.h b/include/os/osDir.h
index 73871602c5e7818f0d9b050280d7326ee39678ef..55c7a15764cf68a15e37602d1182a56d859091b1 100644
--- a/include/os/osDir.h
+++ b/include/os/osDir.h
@@ -31,21 +31,49 @@
extern "C" {
#endif
+#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
+#include "cus_name.h"
+#endif
+
#ifdef WINDOWS
+
#define TD_TMP_DIR_PATH "C:\\Windows\\Temp\\"
+#ifdef CUS_NAME
+#define TD_CFG_DIR_PATH "C:\\"CUS_NAME"\\cfg\\"
+#define TD_DATA_DIR_PATH "C:\\"CUS_NAME"\\data\\"
+#define TD_LOG_DIR_PATH "C:\\"CUS_NAME"\\log\\"
+#else
#define TD_CFG_DIR_PATH "C:\\TDengine\\cfg\\"
#define TD_DATA_DIR_PATH "C:\\TDengine\\data\\"
#define TD_LOG_DIR_PATH "C:\\TDengine\\log\\"
+#endif // CUS_NAME
+
#elif defined(_TD_DARWIN_64)
+
+#ifdef CUS_PROMPT
+#define TD_TMP_DIR_PATH "/tmp/"CUS_PROMPT"d/"
+#define TD_CFG_DIR_PATH "/etc/"CUS_PROMPT"/"
+#define TD_DATA_DIR_PATH "/var/lib/"CUS_PROMPT"/"
+#define TD_LOG_DIR_PATH "/var/log/"CUS_PROMPT"/"
+#else
#define TD_TMP_DIR_PATH "/tmp/taosd/"
#define TD_CFG_DIR_PATH "/etc/taos/"
#define TD_DATA_DIR_PATH "/var/lib/taos/"
#define TD_LOG_DIR_PATH "/var/log/taos/"
+#endif // CUS_PROMPT
+
#else
+
#define TD_TMP_DIR_PATH "/tmp/"
+#ifdef CUS_PROMPT
+#define TD_CFG_DIR_PATH "/etc/"CUS_PROMPT"/"
+#define TD_DATA_DIR_PATH "/var/lib/"CUS_PROMPT"/"
+#define TD_LOG_DIR_PATH "/var/log/"CUS_PROMPT"/"
+#else
#define TD_CFG_DIR_PATH "/etc/taos/"
#define TD_DATA_DIR_PATH "/var/lib/taos/"
#define TD_LOG_DIR_PATH "/var/log/taos/"
+#endif // CUS_PROMPT
#endif
typedef struct TdDir *TdDirPtr;
diff --git a/include/os/osTime.h b/include/os/osTime.h
index 0a0a54119b4a40b79e54b7183b0cdc57cac03ca7..51a285a1393171ea59940498a4c8134afa270366 100644
--- a/include/os/osTime.h
+++ b/include/os/osTime.h
@@ -91,7 +91,7 @@ static FORCE_INLINE int64_t taosGetMonoTimestampMs() {
}
char *taosStrpTime(const char *buf, const char *fmt, struct tm *tm);
-struct tm *taosLocalTime(const time_t *timep, struct tm *result);
+struct tm *taosLocalTime(const time_t *timep, struct tm *result, char *buf);
struct tm *taosLocalTimeNolock(struct tm *result, const time_t *timep, int dst);
time_t taosTime(time_t *t);
time_t taosMktime(struct tm *timep);
diff --git a/include/util/cus_name.h b/include/util/cus_name.h
new file mode 100644
index 0000000000000000000000000000000000000000..16f677f855ba07403d292e4e64dd6060fb2ccf31
--- /dev/null
+++ b/include/util/cus_name.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef _CUS_NAME_H_
+#define _CUS_NAME_H_
+
+#ifndef CUS_NAME
+#define CUS_NAME "TDengine"
+#endif
+
+#ifndef CUS_PROMPT
+#define CUS_PROMPT "taos"
+#endif
+
+#ifndef CUS_EMAIL
+#define CUS_EMAIL ""
+#endif
+
+#endif // _CUS_NAME_H_
diff --git a/include/util/taoserror.h b/include/util/taoserror.h
index 6489304bdaf1bdac3fc4f6a74d63fc35e8dc1a2c..80e17ccfd6dd97bdb4c15af545c0c18dac8ec4d1 100644
--- a/include/util/taoserror.h
+++ b/include/util/taoserror.h
@@ -223,6 +223,7 @@ int32_t* taosGetErrno();
// #define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x033C) // 2.x
// #define TSDB_CODE_MND_DNODE_ID_NOT_CONFIGUREDTAOS_DEF_ERROR_CODE(0, 0x033D) // 2.x
// #define TSDB_CODE_MND_DNODE_EP_NOT_CONFIGUREDTAOS_DEF_ERROR_CODE(0, 0x033E) // 2.x
+#define TSDB_CODE_MND_DNODE_DIFF_CLUSTER TAOS_DEF_ERROR_CODE(0, 0x033F) // internal
// mnode-acct
#define TSDB_CODE_MND_ACCT_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0340)
@@ -288,6 +289,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_INVALID_DB_ACCT TAOS_DEF_ERROR_CODE(0, 0x0389) // internal
#define TSDB_CODE_MND_DB_OPTION_UNCHANGED TAOS_DEF_ERROR_CODE(0, 0x038A) //
#define TSDB_CODE_MND_DB_INDEX_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x038B)
+#define TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO TAOS_DEF_ERROR_CODE(0, 0x038C)
// #define TSDB_CODE_MND_INVALID_DB_OPTION_DAYS TAOS_DEF_ERROR_CODE(0, 0x0390) // 2.x
// #define TSDB_CODE_MND_INVALID_DB_OPTION_KEEP TAOS_DEF_ERROR_CODE(0, 0x0391) // 2.x
// #define TSDB_CODE_MND_INVALID_TOPIC TAOS_DEF_ERROR_CODE(0, 0x0392) // 2.x
@@ -715,6 +717,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_UDF_NO_FUNC_HANDLE TAOS_DEF_ERROR_CODE(0, 0x2908)
#define TSDB_CODE_UDF_INVALID_BUFSIZE TAOS_DEF_ERROR_CODE(0, 0x2909)
#define TSDB_CODE_UDF_INVALID_OUTPUT_TYPE TAOS_DEF_ERROR_CODE(0, 0x290A)
+#define TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED TAOS_DEF_ERROR_CODE(0, 0x290B)
+#define TSDB_CODE_UDF_FUNC_EXEC_FAILURE TAOS_DEF_ERROR_CODE(0, 0x290C)
// sml
#define TSDB_CODE_SML_INVALID_PROTOCOL_TYPE TAOS_DEF_ERROR_CODE(0, 0x3000)
diff --git a/include/util/tdef.h b/include/util/tdef.h
index b5b2d7817e08b5a0d75cbad26854cfa5980b80f1..e5000891c95e3a2b9722c86434b1010490377e2a 100644
--- a/include/util/tdef.h
+++ b/include/util/tdef.h
@@ -202,11 +202,11 @@ typedef enum ELogicConditionType {
#define TSDB_FUNC_NAME_LEN 65
#define TSDB_FUNC_COMMENT_LEN 1024 * 1024
#define TSDB_FUNC_CODE_LEN 10 * 1024 * 1024
-#define TSDB_FUNC_BUF_SIZE 512
+#define TSDB_FUNC_BUF_SIZE 4096 * 64
#define TSDB_FUNC_TYPE_SCALAR 1
#define TSDB_FUNC_TYPE_AGGREGATE 2
#define TSDB_FUNC_SCRIPT_BIN_LIB 0
-#define TSDB_FUNC_SCRIPT_LUA 1
+#define TSDB_FUNC_SCRIPT_PYTHON 1
#define TSDB_FUNC_MAX_RETRIEVE 1024
#define TSDB_INDEX_NAME_LEN 65 // 64 + 1 '\0'
diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg
index a98dc5a2365939da1726a5165921ad416599228a..2159899aa277f550adf76eb7c107bf3da17c9ab1 100644
--- a/packaging/cfg/taos.cfg
+++ b/packaging/cfg/taos.cfg
@@ -1,7 +1,6 @@
########################################################
# #
# Configuration #
-# Any questions, please email support@taosdata.com #
# #
########################################################
@@ -13,7 +12,7 @@
############### 1. Cluster End point ############################
-# The end point of the first dnode in the cluster to be connected to when this dnode or a CLI `taos` is started
+# The end point of the first dnode in the cluster to be connected to when this dnode or the CLI utility is started
# firstEp hostname:6030
# The end point of the second dnode to be connected to if the firstEp is not available
@@ -25,7 +24,7 @@
# The FQDN of the host on which this dnode will be started. It can be IP address
# fqdn hostname
-# The port for external access after this dnode is started
+# The port for external access after this dnode is started
# serverPort 6030
# The maximum number of connections a dnode can accept
@@ -96,7 +95,7 @@
# if free disk space is less than this value, this dnode will fail to start
# minimalDataDirGB 2.0
-# enable/disable system monitor
+# enable/disable system monitor
# monitor 1
# The following parameter is used to limit the maximum number of lines in log files.
@@ -114,8 +113,8 @@
# The following parameters are used for debug purpose only by this dnode.
# debugFlag is a 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
-# Available debug levels are:
-# 131: output warning and error
+# Available debug levels are:
+# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
@@ -130,7 +129,7 @@
# debug flag for util
# uDebugFlag 131
-# debug flag for rpc
+# debug flag for rpc
# rpcDebugFlag 131
# debug flag for jni
@@ -139,7 +138,7 @@
# debug flag for query
# qDebugFlag 131
-# debug flag for taosc driver
+# debug flag for client driver
# cDebugFlag 131
# debug flag for dnode messages
diff --git a/packaging/cfg/taosd.service b/packaging/cfg/taosd.service
index fff4b74e62a6da8f2bda9a6306a79132d7585e42..52c4b1d1e2d7aeb3447633353f48b2363c16efaa 100644
--- a/packaging/cfg/taosd.service
+++ b/packaging/cfg/taosd.service
@@ -1,5 +1,5 @@
[Unit]
-Description=TDengine server service
+Description=server service
After=network-online.target
Wants=network-online.target
diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh
index a3f8b53d33dc09a23ae340c1ee5ea0c33bcfa933..858a6ac6685e2f43f98b8f41a1c91cd2f3b68c50 100755
--- a/packaging/tools/install.sh
+++ b/packaging/tools/install.sh
@@ -4,7 +4,7 @@
# is required to use systemd to manage services at boot
set -e
-#set -x
+# set -x
verMode=edge
pagMode=full
@@ -34,21 +34,25 @@ benchmarkName="taosBenchmark"
dumpName="taosdump"
demoName="taosdemo"
xname="taosx"
-explorerName="${clientName}-explorer"
clientName2="taos"
-serverName2="taosd"
+serverName2="${clientName2}d"
+configFile2="${clientName2}.cfg"
productName2="TDengine"
emailName2="taosdata.com"
+xname2="${clientName2}x"
+adapterName2="${clientName2}adapter"
+explorerName="${clientName2}-explorer"
benchmarkName2="${clientName2}Benchmark"
+demoName2="${clientName2}demo"
dumpName2="${clientName2}dump"
uninstallScript2="rm${clientName2}"
historyFile="${clientName2}_history"
logDir="/var/log/${clientName2}"
configDir="/etc/${clientName2}"
-installDir="/usr/local/${clientName}"
+installDir="/usr/local/${clientName2}"
data_dir=${dataDir}
log_dir=${logDir}
@@ -206,15 +210,15 @@ function install_main_path() {
function install_bin() {
# Remove links
- ${csudo}rm -f ${bin_link_dir}/${clientName} || :
- ${csudo}rm -f ${bin_link_dir}/${serverName} || :
+ ${csudo}rm -f ${bin_link_dir}/${clientName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${serverName2} || :
${csudo}rm -f ${bin_link_dir}/${udfdName} || :
${csudo}rm -f ${bin_link_dir}/${adapterName} || :
- ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
- ${csudo}rm -f ${bin_link_dir}/${demoName} || :
- ${csudo}rm -f ${bin_link_dir}/${benchmarkName} || :
- ${csudo}rm -f ${bin_link_dir}/${dumpName} || :
- ${csudo}rm -f ${bin_link_dir}/${xname} || :
+ ${csudo}rm -f ${bin_link_dir}/${uninstallScript2} || :
+ ${csudo}rm -f ${bin_link_dir}/${demoName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${dumpName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${xname2} || :
${csudo}rm -f ${bin_link_dir}/${explorerName} || :
${csudo}rm -f ${bin_link_dir}/set_core || :
${csudo}rm -f ${bin_link_dir}/TDinsight.sh || :
@@ -222,24 +226,23 @@ function install_bin() {
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link
- [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || :
- [ -x ${install_main_dir}/bin/${serverName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${serverName} ${bin_link_dir}/${serverName} || :
+ [ -x ${install_main_dir}/bin/${clientName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${clientName2} ${bin_link_dir}/${clientName2} || :
+ [ -x ${install_main_dir}/bin/${serverName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${serverName2} ${bin_link_dir}/${serverName2} || :
[ -x ${install_main_dir}/bin/${udfdName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${udfdName} ${bin_link_dir}/${udfdName} || :
- [ -x ${install_main_dir}/bin/${adapterName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${adapterName} ${bin_link_dir}/${adapterName} || :
- [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${demoName} || :
- [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${benchmarkName} || :
- [ -x ${install_main_dir}/bin/${dumpName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${dumpName} || :
- [ -x ${install_main_dir}/bin/${xname} ] && ${csudo}ln -sf ${install_main_dir}/bin/${xname} ${bin_link_dir}/${xname} || :
+ [ -x ${install_main_dir}/bin/${adapterName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${adapterName2} ${bin_link_dir}/${adapterName2} || :
+ [ -x ${install_main_dir}/bin/${benchmarkName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName2} ${bin_link_dir}/${demoName2} || :
+ [ -x ${install_main_dir}/bin/${benchmarkName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName2} ${bin_link_dir}/${benchmarkName2} || :
+ [ -x ${install_main_dir}/bin/${dumpName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${dumpName2} ${bin_link_dir}/${dumpName2} || :
+ [ -x ${install_main_dir}/bin/${xname2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${xname2} ${bin_link_dir}/${xname2} || :
[ -x ${install_main_dir}/bin/${explorerName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${explorerName} ${bin_link_dir}/${explorerName} || :
[ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || :
- [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || :
- [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
+ if [ "$clientName2" == "${clientName}" ]; then
+ [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || :
+ fi
+ [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
- [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName2} || :
- [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${benchmarkName2} || :
- [ -x ${install_main_dir}/bin/${dumpName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${dumpName2} || :
- [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript2} || :
+ [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript2} || :
fi
}
@@ -399,7 +402,7 @@ function set_hostname() {
${csudo}sed -i -r "s/#*\s*(HOSTNAME=\s*).*/\1$newHostname/" /etc/sysconfig/network || :
fi
- ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${cfg_install_dir}/${configFile}
+ ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${cfg_install_dir}/${configFile2}
serverFqdn=$newHostname
if [[ -e /etc/hosts ]]; then
@@ -433,7 +436,7 @@ function set_ipAsFqdn() {
echo -e -n "${GREEN}Unable to get local ip, use 127.0.0.1${NC}"
localFqdn="127.0.0.1"
# Write the local FQDN to configuration file
- ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile}
+ ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile2}
serverFqdn=$localFqdn
echo
return
@@ -455,7 +458,7 @@ function set_ipAsFqdn() {
read -p "Please choose an IP from local IP list:" localFqdn
else
# Write the local FQDN to configuration file
- ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile}
+ ${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile2}
serverFqdn=$localFqdn
break
fi
@@ -519,15 +522,15 @@ function install_adapter_config() {
function install_config() {
- if [ ! -f "${cfg_install_dir}/${configFile}" ]; then
+ if [ ! -f "${cfg_install_dir}/${configFile2}" ]; then
${csudo}mkdir -p ${cfg_install_dir}
- [ -f ${script_dir}/cfg/${configFile} ] && ${csudo}cp ${script_dir}/cfg/${configFile} ${cfg_install_dir}
+ [ -f ${script_dir}/cfg/${configFile2} ] && ${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir}
${csudo}chmod 644 ${cfg_install_dir}/*
else
- ${csudo}cp -f ${script_dir}/cfg/${configFile} ${cfg_install_dir}/${configFile}.new
+ ${csudo}cp -f ${script_dir}/cfg/${configFile2} ${cfg_install_dir}/${configFile2}.new
fi
- ${csudo}ln -sf ${cfg_install_dir}/${configFile} ${install_main_dir}/cfg
+ ${csudo}ln -sf ${cfg_install_dir}/${configFile2} ${install_main_dir}/cfg
[ ! -z $1 ] && return 0 || : # only install client
@@ -548,7 +551,7 @@ function install_config() {
read firstEp
while true; do
if [ ! -z "$firstEp" ]; then
- ${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/${configFile}
+ ${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/${configFile2}
break
else
break
@@ -600,8 +603,8 @@ function install_web() {
function clean_service_on_sysvinit() {
- if ps aux | grep -v grep | grep ${serverName} &>/dev/null; then
- ${csudo}service ${serverName} stop || :
+ if ps aux | grep -v grep | grep ${serverName2} &>/dev/null; then
+ ${csudo}service ${serverName2} stop || :
fi
if ps aux | grep -v grep | grep tarbitrator &>/dev/null; then
@@ -609,30 +612,30 @@ function clean_service_on_sysvinit() {
fi
if ((${initd_mod} == 1)); then
- if [ -e ${service_config_dir}/${serverName} ]; then
- ${csudo}chkconfig --del ${serverName} || :
+ if [ -e ${service_config_dir}/${serverName2} ]; then
+ ${csudo}chkconfig --del ${serverName2} || :
fi
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}chkconfig --del tarbitratord || :
fi
elif ((${initd_mod} == 2)); then
- if [ -e ${service_config_dir}/${serverName} ]; then
- ${csudo}insserv -r ${serverName} || :
+ if [ -e ${service_config_dir}/${serverName2} ]; then
+ ${csudo}insserv -r ${serverName2} || :
fi
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}insserv -r tarbitratord || :
fi
elif ((${initd_mod} == 3)); then
- if [ -e ${service_config_dir}/${serverName} ]; then
- ${csudo}update-rc.d -f ${serverName} remove || :
+ if [ -e ${service_config_dir}/${serverName2} ]; then
+ ${csudo}update-rc.d -f ${serverName2} remove || :
fi
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}update-rc.d -f tarbitratord remove || :
fi
fi
- ${csudo}rm -f ${service_config_dir}/${serverName} || :
+ ${csudo}rm -f ${service_config_dir}/${serverName2} || :
${csudo}rm -f ${service_config_dir}/tarbitratord || :
if $(which init &>/dev/null); then
@@ -653,24 +656,24 @@ function install_service_on_sysvinit() {
fi
if ((${initd_mod} == 1)); then
- ${csudo}chkconfig --add ${serverName} || :
- ${csudo}chkconfig --level 2345 ${serverName} on || :
+ ${csudo}chkconfig --add ${serverName2} || :
+ ${csudo}chkconfig --level 2345 ${serverName2} on || :
elif ((${initd_mod} == 2)); then
- ${csudo}insserv ${serverName} || :
- ${csudo}insserv -d ${serverName} || :
+ ${csudo}insserv ${serverName2} || :
+ ${csudo}insserv -d ${serverName2} || :
elif ((${initd_mod} == 3)); then
- ${csudo}update-rc.d ${serverName} defaults || :
+ ${csudo}update-rc.d ${serverName2} defaults || :
fi
}
function clean_service_on_systemd() {
- taosd_service_config="${service_config_dir}/${serverName}.service"
- if systemctl is-active --quiet ${serverName}; then
+ service_config="${service_config_dir}/${serverName2}.service"
+ if systemctl is-active --quiet ${serverName2}; then
echo "${productName} is running, stopping it..."
- ${csudo}systemctl stop ${serverName} &>/dev/null || echo &>/dev/null
+ ${csudo}systemctl stop ${serverName2} &>/dev/null || echo &>/dev/null
fi
- ${csudo}systemctl disable ${serverName} &>/dev/null || echo &>/dev/null
- ${csudo}rm -f ${taosd_service_config}
+ ${csudo}systemctl disable ${serverName2} &>/dev/null || echo &>/dev/null
+ ${csudo}rm -f ${service_config}
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
if systemctl is-active --quiet tarbitratord; then
@@ -687,19 +690,19 @@ function clean_service_on_systemd() {
function install_service_on_systemd() {
clean_service_on_systemd
- [ -f ${script_dir}/cfg/${serverName}.service ] &&
- ${csudo}cp ${script_dir}/cfg/${serverName}.service \
+ [ -f ${script_dir}/cfg/${serverName2}.service ] &&
+ ${csudo}cp ${script_dir}/cfg/${serverName2}.service \
${service_config_dir}/ || :
# if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
- # [ -f ${script_dir}/cfg/${serverName}.service ] &&
- # ${csudo}cp ${script_dir}/cfg/${serverName}.service \
+ # [ -f ${script_dir}/cfg/${serverName2}.service ] &&
+ # ${csudo}cp ${script_dir}/cfg/${serverName2}.service \
# ${service_config_dir}/${serverName2}.service || :
# fi
${csudo}systemctl daemon-reload
- ${csudo}systemctl enable ${serverName}
+ ${csudo}systemctl enable ${serverName2}
${csudo}systemctl daemon-reload
}
@@ -719,7 +722,7 @@ function install_service() {
elif ((${service_mod} == 1)); then
install_service_on_sysvinit
else
- kill_process ${serverName}
+ kill_process ${serverName2}
fi
}
@@ -756,10 +759,10 @@ function is_version_compatible() {
if [ -f ${script_dir}/driver/vercomp.txt ]; then
min_compatible_version=$(cat ${script_dir}/driver/vercomp.txt)
else
- min_compatible_version=$(${script_dir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 5)
+ min_compatible_version=$(${script_dir}/bin/${serverName2} -V | head -1 | cut -d ' ' -f 5)
fi
- exist_version=$(${installDir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 3)
+ exist_version=$(${installDir}/bin/${serverName2} -V | head -1 | cut -d ' ' -f 3)
vercomp $exist_version "3.0.0.0"
case $? in
2)
@@ -829,13 +832,13 @@ function updateProduct() {
echo -e "${GREEN}Start to update ${productName2}...${NC}"
# Stop the service if running
- if ps aux | grep -v grep | grep ${serverName} &>/dev/null; then
+ if ps aux | grep -v grep | grep ${serverName2} &>/dev/null; then
if ((${service_mod} == 0)); then
- ${csudo}systemctl stop ${serverName} || :
+ ${csudo}systemctl stop ${serverName2} || :
elif ((${service_mod} == 1)); then
- ${csudo}service ${serverName} stop || :
+ ${csudo}service ${serverName2} stop || :
else
- kill_process ${serverName}
+ kill_process ${serverName2}
fi
sleep 1
fi
@@ -862,21 +865,21 @@ function updateProduct() {
openresty_work=false
echo
- echo -e "${GREEN_DARK}To configure ${productName2} ${NC}: edit ${cfg_install_dir}/${configFile}"
- [ -f ${configDir}/taosadapter.toml ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To configure ${clientName2} Adapter ${NC}: edit ${configDir}/taosadapter.toml"
+ echo -e "${GREEN_DARK}To configure ${productName2} ${NC}: edit ${cfg_install_dir}/${configFile2}"
+ [ -f ${configDir}/${clientName2}adapter.toml ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To configure ${clientName2} Adapter ${NC}: edit ${configDir}/${clientName2}adapter.toml"
if ((${service_mod} == 0)); then
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}systemctl start ${serverName}${NC}"
- [ -f ${service_config_dir}/taosadapter.service ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}systemctl start taosadapter ${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}systemctl start ${serverName2}${NC}"
+ [ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}systemctl start ${clientName2}adapter ${NC}"
elif ((${service_mod} == 1)); then
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}service ${serverName} start${NC}"
- [ -f ${service_config_dir}/taosadapter.service ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}service taosadapter start${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}service ${serverName2} start${NC}"
+ [ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}service ${clientName2}adapter start${NC}"
else
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ./${serverName}${NC}"
- [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: taosadapter &${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ./${serverName2}${NC}"
+ [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${clientName2}adapter &${NC}"
fi
if [ ${openresty_work} = 'true' ]; then
@@ -887,7 +890,7 @@ function updateProduct() {
if ((${prompt_force} == 1)); then
echo ""
- echo -e "${RED}Please run '${serverName} --force-keep-file' at first time for the exist ${productName2} $exist_version!${NC}"
+ echo -e "${RED}Please run '${serverName2} --force-keep-file' at first time for the exist ${productName2} $exist_version!${NC}"
fi
echo
echo -e "\033[44;32;1m${productName2} is updated successfully!${NC}"
@@ -899,7 +902,7 @@ function updateProduct() {
echo -e "\033[44;32;1m${productName2} client is updated successfully!${NC}"
fi
- rm -rf $(tar -tf ${tarName} | grep -v "^\./$")
+ rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
}
function installProduct() {
@@ -944,21 +947,21 @@ function installProduct() {
# Ask if to start the service
echo
- echo -e "${GREEN_DARK}To configure ${productName2} ${NC}: edit ${cfg_install_dir}/${configFile}"
- [ -f ${configDir}/taosadapter.toml ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To configure ${clientName2} Adapter ${NC}: edit ${configDir}/taosadapter.toml"
+ echo -e "${GREEN_DARK}To configure ${productName2} ${NC}: edit ${cfg_install_dir}/${configFile2}"
+ [ -f ${configDir}/${clientName2}adapter.toml ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To configure ${clientName2} Adapter ${NC}: edit ${configDir}/${clientName2}adapter.toml"
if ((${service_mod} == 0)); then
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}systemctl start ${serverName}${NC}"
- [ -f ${service_config_dir}/taosadapter.service ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}systemctl start taosadapter ${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}systemctl start ${serverName2}${NC}"
+ [ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}systemctl start ${clientName2}adapter ${NC}"
elif ((${service_mod} == 1)); then
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}service ${serverName} start${NC}"
- [ -f ${service_config_dir}/taosadapter.service ] && [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}service taosadapter start${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${csudo}service ${serverName2} start${NC}"
+ [ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${csudo}service ${clientName2}adapter start${NC}"
else
- echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${serverName}${NC}"
- [ -f ${installDir}/bin/taosadapter ] && \
- echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: taosadapter &${NC}"
+ echo -e "${GREEN_DARK}To start ${productName2} ${NC}: ${serverName2}${NC}"
+ [ -f ${installDir}/bin/${clientName2}adapter ] && \
+ echo -e "${GREEN_DARK}To start ${clientName2} Adapter ${NC}: ${clientName2}adapter &${NC}"
fi
if [ ! -z "$firstEp" ]; then
@@ -991,7 +994,7 @@ function installProduct() {
fi
touch ~/.${historyFile}
- rm -rf $(tar -tf ${tarName} | grep -v "^\./$")
+ rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
}
## ==============================Main program starts from here============================
@@ -1002,7 +1005,7 @@ if [ "$verType" == "server" ]; then
echo -e "\033[44;31;5mThe default data directory ${data_dir} contains old data of ${productName2} 2.x, please clear it before installing!\033[0m"
else
# Install server and client
- if [ -x ${bin_dir}/${serverName} ]; then
+ if [ -x ${bin_dir}/${serverName2} ]; then
update_flag=1
updateProduct
else
@@ -1012,7 +1015,7 @@ if [ "$verType" == "server" ]; then
elif [ "$verType" == "client" ]; then
interactiveFqdn=no
# Only install client
- if [ -x ${bin_dir}/${clientName} ]; then
+ if [ -x ${bin_dir}/${clientName2} ]; then
update_flag=1
updateProduct client
else
diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh
index d941fbc0cbcd0be6f8c17be15eb0170edecd27b9..53b9c80f10082a1aa70dc6aec54ea54b25be66f1 100755
--- a/packaging/tools/install_client.sh
+++ b/packaging/tools/install_client.sh
@@ -95,7 +95,7 @@ function install_main_path() {
${csudo}mkdir -p ${install_main_dir}/cfg
${csudo}mkdir -p ${install_main_dir}/bin
${csudo}mkdir -p ${install_main_dir}/driver
- if [ $productName == "TDengine" ]; then
+ if [ "$productName2" == "TDengine" ]; then
${csudo}mkdir -p ${install_main_dir}/examples
fi
${csudo}mkdir -p ${install_main_dir}/include
@@ -118,18 +118,19 @@ function install_bin() {
#Make link
[ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName} || :
if [ "$osType" != "Darwin" ]; then
- [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo}ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
+ [ -x ${install_main_dir}/bin/${demoName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${demoName2} ${bin_link_dir}/${demoName2} || :
fi
[ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript} || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
#Make link
- [ -x ${install_main_dir}/bin/${clientName} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName} ${bin_link_dir}/${clientName2} || :
+ [ -x ${install_main_dir}/bin/${clientName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${clientName2} ${bin_link_dir}/${clientName2} || :
if [ "$osType" != "Darwin" ]; then
- [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo}ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/${demoName2} || :
+ [ -x ${install_main_dir}/bin/${demoName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${demoName2} ${bin_link_dir}/${demoName2} || :
+ [ -x ${install_main_dir}/bin/${benchmarkName2} ] && ${csudo}ln -s ${install_main_dir}/bin/${benchmarkName2} ${bin_link_dir}/${benchmarkName2} || :
fi
- [ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript2} || :
+ [ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/${uninstallScript2} || :
fi
}
@@ -305,7 +306,7 @@ function update_TDengine() {
echo
echo -e "\033[44;32;1m${productName2} client is updated successfully!${NC}"
- rm -rf $(tar -tf ${tarName})
+ rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
}
function install_TDengine() {
@@ -332,7 +333,7 @@ function install_TDengine() {
echo
echo -e "\033[44;32;1m${productName2} client is installed successfully!${NC}"
- rm -rf $(tar -tf ${tarName})
+ rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
}
diff --git a/packaging/tools/make_install.bat b/packaging/tools/make_install.bat
index 6dc7c356cd99350d9648543cf5963da560c0dfbc..41113c9ae45ca73c9623bffff9b921fdf4525f3f 100644
--- a/packaging/tools/make_install.bat
+++ b/packaging/tools/make_install.bat
@@ -94,6 +94,9 @@ if %Enterprise% == TRUE (
if exist %binary_dir%\\build\\bin\\create_table.exe (
copy %binary_dir%\\build\\bin\\create_table.exe %target_dir% > nul
)
+ if exist %binary_dir%\\build\\bin\\*explorer.exe (
+ copy %binary_dir%\\build\\bin\\*explorer.exe %target_dir% > nul
+ )
)
copy %binary_dir%\\build\\bin\\taosd.exe %target_dir% > nul
@@ -121,9 +124,18 @@ call :stop_delete
call :check_svc taosd
call :check_svc taosadapter
-copy /y C:\\TDengine\\driver\\taos.dll C:\\Windows\\System32 > nul
-if exist C:\\TDengine\\driver\\taosws.dll (
- copy /y C:\\TDengine\\driver\\taosws.dll C:\\Windows\\System32 > nul
+if exist c:\\windows\\sysnative (
+ echo x86
+ copy /y C:\\TDengine\\driver\\taos.dll %windir%\\sysnative > nul
+ if exist C:\\TDengine\\driver\\taosws.dll (
+ copy /y C:\\TDengine\\driver\\taosws.dll %windir%\\sysnative > nul
+ )
+) else (
+ echo x64
+ copy /y C:\\TDengine\\driver\\taos.dll C:\\Windows\\System32 > nul
+ if exist C:\\TDengine\\driver\\taosws.dll (
+ copy /y C:\\TDengine\\driver\\taosws.dll C:\\Windows\\System32 > nul
+ )
)
rem // create services
diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh
index f6fc64d875108d6bc6ef66c8037651b885ba4eb6..98c5245cd39367203d7a8d8387b56846d1e19083 100755
--- a/packaging/tools/make_install.sh
+++ b/packaging/tools/make_install.sh
@@ -200,6 +200,7 @@ function install_bin() {
[ -f ${binary_dir}/build/bin/taosadapter ] && ${csudo}cp -r ${binary_dir}/build/bin/taosadapter ${install_main_dir}/bin || :
[ -f ${binary_dir}/build/bin/udfd ] && ${csudo}cp -r ${binary_dir}/build/bin/udfd ${install_main_dir}/bin || :
[ -f ${binary_dir}/build/bin/taosx ] && ${csudo}cp -r ${binary_dir}/build/bin/taosx ${install_main_dir}/bin || :
+ [ -f ${binary_dir}/build/bin/*explorer ] && ${csudo}cp -r ${binary_dir}/build/bin/*explorer ${install_main_dir}/bin || :
${csudo}cp -r ${binary_dir}/build/bin/${serverName} ${install_main_dir}/bin || :
${csudo}cp -r ${script_dir}/remove.sh ${install_main_dir}/bin || :
@@ -212,6 +213,7 @@ function install_bin() {
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo}ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump > /dev/null 2>&1 || :
[ -f ${install_main_dir}/bin/taosBenchmark ] && ${csudo}ln -sf ${install_main_dir}/bin/taosBenchmark ${install_main_dir}/bin/taosdemo > /dev/null 2>&1 || :
[ -x ${install_main_dir}/bin/taosx ] && ${csudo}ln -s ${install_main_dir}/bin/taosx ${bin_link_dir}/taosx > /dev/null 2>&1 || :
+ [ -x ${install_main_dir}/bin/*explorer ] && ${csudo}ln -s ${install_main_dir}/bin/*explorer ${bin_link_dir}/*explorer > /dev/null 2>&1 || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} > /dev/null 2>&1 || :
fi
}
diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh
index f46de0f94b6c78d0d7da241a7cfe3311af1ef466..b473f3b52728714276b8493ea0bc96094e880e34 100755
--- a/packaging/tools/makeclient.sh
+++ b/packaging/tools/makeclient.sh
@@ -2,7 +2,7 @@
#
# Generate tar.gz package for linux client in all os system
set -e
-# set -x
+set -x
curr_dir=$(pwd)
compile_dir=$1
@@ -23,9 +23,12 @@ clientName2="${12}"
productName="TDengine"
clientName="taos"
+benchmarkName="taosBenchmark"
configFile="taos.cfg"
tarName="package.tar.gz"
+benchmarkName2="${clientName2}Benchmark"
+
if [ "$osType" != "Darwin" ]; then
script_dir="$(dirname $(readlink -f $0))"
top_dir="$(readlink -f ${script_dir}/../..)"
@@ -53,11 +56,12 @@ fi
# Directories and files.
-if [ "$verMode" == "cluster" ]; then
- sed -i 's/verMode=edge/verMode=cluster/g' ${script_dir}/remove_client.sh
- sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" ${script_dir}/remove_client.sh
- sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" ${script_dir}/remove_client.sh
-fi
+#if [ "$verMode" == "cluster" ]; then
+# sed -i 's/verMode=edge/verMode=cluster/g' ${script_dir}/remove_client.sh
+# sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" ${script_dir}/remove_client.sh
+# sed -i "s/configFile2=\"taos\"/configFile2=\"${clientName2}\"/g" ${script_dir}/remove_client.sh
+# sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" ${script_dir}/remove_client.sh
+#fi
if [ "$osType" != "Darwin" ]; then
if [ "$pagMode" == "lite" ]; then
@@ -66,6 +70,7 @@ if [ "$osType" != "Darwin" ]; then
${script_dir}/remove_client.sh"
else
bin_files="${build_dir}/bin/${clientName} \
+ ${build_dir}/bin/${benchmarkName} \
${script_dir}/remove_client.sh \
${script_dir}/set_core.sh \
${script_dir}/get_client.sh"
@@ -153,6 +158,7 @@ if [ "$verMode" == "cluster" ]; then
sed -i 's/verMode=edge/verMode=cluster/g' install_client_temp.sh
sed -i "s/serverName2=\"taosd\"/serverName2=\"${serverName2}\"/g" install_client_temp.sh
sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" install_client_temp.sh
+ sed -i "s/configFile2=\"taos.cfg\"/configFile2=\"${clientName2}.cfg\"/g" install_client_temp.sh
sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" install_client_temp.sh
sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusEmail2}\"/g" install_client_temp.sh
diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh
index a2dec155e898b3f9800f0107936776b479414608..1a1622cb9368c00a40105daa653639b94e46fb94 100755
--- a/packaging/tools/makepkg.sh
+++ b/packaging/tools/makepkg.sh
@@ -54,6 +54,8 @@ if [ -d ${top_dir}/tools/taos-tools/packaging/deb ]; then
taostools_ver=$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags|grep -v taos | tail -1)
[ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0"
+
+ taostools_ver=$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags|grep -v taos | tail -1)
taostools_install_dir="${release_dir}/${clientName2}Tools-${taostools_ver}"
cd ${curr_dir}
@@ -96,7 +98,7 @@ else
${taostools_bin_files} \
${taosx_bin} \
${explorer_bin_files} \
- ${build_dir}/bin/taosadapter \
+ ${build_dir}/bin/${clientName}adapter \
${build_dir}/bin/udfd \
${script_dir}/remove.sh \
${script_dir}/set_core.sh \
@@ -135,12 +137,12 @@ mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/${configFile} ${install_dir}/cfg/${configFile}
-if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then
- cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || :
+if [ -f "${compile_dir}/test/cfg/${clientName}adapter.toml" ]; then
+ cp ${compile_dir}/test/cfg/${clientName}adapter.toml ${install_dir}/cfg || :
fi
-if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
- cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || :
+if [ -f "${compile_dir}/test/cfg/${clientName}adapter.service" ]; then
+ cp ${compile_dir}/test/cfg/${clientName}adapter.service ${install_dir}/cfg || :
fi
if [ -f "${cfg_dir}/${serverName}.service" ]; then
@@ -152,16 +154,16 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${se
mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm
if [ $adapterName != "taosadapter" ]; then
- mv ${install_dir}/cfg/taosadapter.toml ${install_dir}/cfg/$adapterName.toml
+ mv ${install_dir}/cfg/${clientName2}adapter.toml ${install_dir}/cfg/$adapterName.toml
sed -i "s/path = \"\/var\/log\/taos\"/path = \"\/var\/log\/${productName}\"/g" ${install_dir}/cfg/$adapterName.toml
sed -i "s/password = \"taosdata\"/password = \"${defaultPasswd}\"/g" ${install_dir}/cfg/$adapterName.toml
- mv ${install_dir}/cfg/taosadapter.service ${install_dir}/cfg/$adapterName.service
+ mv ${install_dir}/cfg/${clientName2}adapter.service ${install_dir}/cfg/$adapterName.service
sed -i "s/TDengine/${productName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosAdapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosadapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
- mv ${install_dir}/bin/taosadapter ${install_dir}/bin/${adapterName}
+ mv ${install_dir}/bin/${clientName2}adapter ${install_dir}/bin/${adapterName}
mv ${install_dir}/bin/taosd-dump-cfg.gdb ${install_dir}/bin/${serverName}-dump-cfg.gdb
fi
@@ -233,8 +235,10 @@ if [ "$verMode" == "cluster" ]; then
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
sed -i "s/serverName2=\"taosd\"/serverName2=\"${serverName2}\"/g" remove_temp.sh
sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" remove_temp.sh
+ sed -i "s/configFile2=\"taos.cfg\"/configFile2=\"${clientName2}.cfg\"/g" remove_temp.sh
sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" remove_temp.sh
- sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusEmail2}\"/g" remove_temp.sh
+ cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
+ sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusDomain}\"/g" remove_temp.sh
mv remove_temp.sh ${install_dir}/bin/remove.sh
fi
if [ "$verMode" == "cloud" ]; then
@@ -262,8 +266,10 @@ if [ "$verMode" == "cluster" ]; then
sed -i 's/verMode=edge/verMode=cluster/g' install_temp.sh
sed -i "s/serverName2=\"taosd\"/serverName2=\"${serverName2}\"/g" install_temp.sh
sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" install_temp.sh
+ sed -i "s/configFile2=\"taos.cfg\"/configFile2=\"${clientName2}.cfg\"/g" install_temp.sh
sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" install_temp.sh
- sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusEmail2}\"/g" install_temp.sh
+ cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
+ sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusDomain}\"/g" install_temp.sh
mv install_temp.sh ${install_dir}/install.sh
fi
if [ "$verMode" == "cloud" ]; then
diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh
index 35c28feb6ad30b462e9c6134d958d765c97364af..3a013ade2cef2859151971d5da70ea4e0df6e681 100755
--- a/packaging/tools/post.sh
+++ b/packaging/tools/post.sh
@@ -238,6 +238,7 @@ function install_bin() {
${csudo}rm -f ${bin_link_dir}/taosdump || :
${csudo}rm -f ${bin_link_dir}/rmtaos || :
${csudo}rm -f ${bin_link_dir}/set_core || :
+ ${csudo}rm -f ${bin_link_dir}/*explorer || :
${csudo}chmod 0555 ${bin_dir}/*
@@ -273,6 +274,9 @@ function install_bin() {
if [ -x ${bin_dir}/taoskeeper ]; then
${csudo}ln -sf ${bin_dir}/taoskeeper ${bin_link_dir}/taoskeeper 2>>${install_log_path} || return 1
fi
+ if [ -x ${bin_dir}/*explorer ]; then
+ ${csudo}ln -s ${bin_dir}/*explorer ${bin_link_dir}/*explorer 2>>${install_log_path} || return 1
+ fi
log_print "install bin success"
}
diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh
index 2479e48670bacb014c9209c8db11c8b0e09f5889..8ed3bd74b9f6b822c15bf568256f5f80f2b8b618 100755
--- a/packaging/tools/remove.sh
+++ b/packaging/tools/remove.sh
@@ -40,11 +40,16 @@ serverName2="taosd"
clientName2="taos"
productName2="TDengine"
+adapterName2="${clientName2}adapter"
+demoName2="${clientName2}demo"
benchmarkName2="${clientName2}Benchmark"
dumpName2="${clientName2}dump"
+keeperName2="${clientName2}keeper"
+xName2="${clientName2}x"
+explorerName2="${clientName2}-explorer"
uninstallScript2="rm${clientName2}"
-installDir="/usr/local/${clientName}"
+installDir="/usr/local/${clientName2}"
#install main path
install_main_dir=${installDir}
@@ -55,8 +60,8 @@ local_bin_link_dir="/usr/local/bin"
service_config_dir="/etc/systemd/system"
-taos_service_name=${serverName}
-taosadapter_service_name="taosadapter"
+taos_service_name=${serverName2}
+taosadapter_service_name="${clientName2}adapter"
tarbitrator_service_name="tarbitratord"
csudo=""
if command -v sudo >/dev/null; then
@@ -84,14 +89,14 @@ else
fi
function kill_taosadapter() {
- pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}')
+ pid=$(ps -ef | grep "${adapterName2}" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
}
function kill_taosd() {
- pid=$(ps -ef | grep ${serverName} | grep -v "grep" | awk '{print $2}')
+ pid=$(ps -ef | grep ${serverName2} | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
@@ -109,17 +114,17 @@ function clean_bin() {
${csudo}rm -f ${bin_link_dir}/${clientName} || :
${csudo}rm -f ${bin_link_dir}/${serverName} || :
${csudo}rm -f ${bin_link_dir}/udfd || :
- ${csudo}rm -f ${bin_link_dir}/taosadapter || :
- ${csudo}rm -f ${bin_link_dir}/taosBenchmark || :
- ${csudo}rm -f ${bin_link_dir}/taosdemo || :
- ${csudo}rm -f ${bin_link_dir}/taosdump || :
- ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
+ ${csudo}rm -f ${bin_link_dir}/${adapterName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${demoName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${dumpName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}rm -f ${bin_link_dir}/set_core || :
${csudo}rm -f ${bin_link_dir}/TDinsight.sh || :
- ${csudo}rm -f ${bin_link_dir}/taoskeeper || :
- ${csudo}rm -f ${bin_link_dir}/taosx || :
- ${csudo}rm -f ${bin_link_dir}/taos-explorer || :
+ ${csudo}rm -f ${bin_link_dir}/${keeperName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${xName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${explorerName2} || :
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
${csudo}rm -f ${bin_link_dir}/${clientName2} || :
@@ -130,8 +135,8 @@ function clean_bin() {
}
function clean_local_bin() {
- ${csudo}rm -f ${local_bin_link_dir}/taosBenchmark || :
- ${csudo}rm -f ${local_bin_link_dir}/taosdemo || :
+ ${csudo}rm -f ${local_bin_link_dir}/${benchmarkName2} || :
+ ${csudo}rm -f ${local_bin_link_dir}/${demoName2} || :
}
function clean_lib() {
@@ -173,7 +178,7 @@ function clean_service_on_systemd() {
${csudo}systemctl disable ${taos_service_name} &>/dev/null || echo &>/dev/null
${csudo}rm -f ${taosd_service_config}
- taosadapter_service_config="${service_config_dir}/taosadapter.service"
+ taosadapter_service_config="${service_config_dir}/${clientName2}adapter.service"
if systemctl is-active --quiet ${taosadapter_service_name}; then
echo "${productName2} ${clientName2}Adapter is running, stopping it..."
${csudo}systemctl stop ${taosadapter_service_name} &>/dev/null || echo &>/dev/null
@@ -235,8 +240,8 @@ function clean_service_on_sysvinit() {
function clean_service_on_launchctl() {
${csudouser}launchctl unload -w /Library/LaunchDaemons/com.taosdata.taosd.plist > /dev/null 2>&1 || :
${csudo}rm /Library/LaunchDaemons/com.taosdata.taosd.plist > /dev/null 2>&1 || :
- ${csudouser}launchctl unload -w /Library/LaunchDaemons/com.taosdata.taosadapter.plist > /dev/null 2>&1 || :
- ${csudo}rm /Library/LaunchDaemons/com.taosdata.taosadapter.plist > /dev/null 2>&1 || :
+ ${csudouser}launchctl unload -w /Library/LaunchDaemons/com.taosdata.${clientName2}adapter.plist > /dev/null 2>&1 || :
+ ${csudo}rm /Library/LaunchDaemons/com.taosdata.${clientName2}adapter.plist > /dev/null 2>&1 || :
}
function clean_service() {
diff --git a/packaging/tools/remove_client.sh b/packaging/tools/remove_client.sh
index 10a0fb5e02a7fbc10b05765d4036e76b0bd1e4c8..2bdb56fac210982048d630469fbb10942bc15f69 100755
--- a/packaging/tools/remove_client.sh
+++ b/packaging/tools/remove_client.sh
@@ -15,11 +15,12 @@ uninstallScript="rmtaos"
clientName2="taos"
productName2="TDengine"
-benchmarkName2="${clientName}Benchmark"
-dumpName2="${clientName}dump"
-uninstallScript2="rm${clientName}"
+benchmarkName2="${clientName2}Benchmark"
+demoName2="${clientName2}demo"
+dumpName2="${clientName2}dump"
+uninstallScript2="rm${clientName2}"
-installDir="/usr/local/${clientName}"
+installDir="/usr/local/${clientName2}"
#install main path
install_main_dir=${installDir}
@@ -44,14 +45,17 @@ function kill_client() {
function clean_bin() {
# Remove link
- ${csudo}rm -f ${bin_link_dir}/${clientName} || :
- ${csudo}rm -f ${bin_link_dir}/taosdemo || :
- ${csudo}rm -f ${bin_link_dir}/taosdump || :
+ ${csudo}rm -f ${bin_link_dir}/${clientName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${demoName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${dumpName2} || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
${csudo}rm -f ${bin_link_dir}/set_core || :
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
${csudo}rm -f ${bin_link_dir}/${clientName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${demoName2} || :
+ ${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || :
${csudo}rm -f ${bin_link_dir}/${dumpName2} || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript2} || :
fi
diff --git a/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h b/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
index a88bf0f7a6bfd74bc92a82e57a44c5fc2957f6a8..2921afc3f827d233b2b4a6fd0d2886e97dfaf325 100644
--- a/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
+++ b/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
@@ -75,6 +75,14 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
*/
JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(JNIEnv *, jobject, jbyteArray, jlong);
+/*
+ * Class: com_taosdata_jdbc_TSDBJNIConnector
+ * Method: executeQueryWithReqId
+ * Signature: ([BJJ)I
+ */
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryWithReqId(JNIEnv *, jobject, jbyteArray,
+ jlong, jlong);
+
/*
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method: getErrCodeImp
@@ -186,6 +194,14 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
*/
JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtImp(JNIEnv *, jobject, jbyteArray, jlong);
+/*
+ * Class: com_taosdata_jdbc_TSDBJNIConnector
+ * Method: prepareStmtWithReqId
+ * Signature: ([BJJ)I
+ */
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtWithReqId(JNIEnv *, jobject, jbyteArray,
+ jlong, jlong);
+
/*
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method: setBindTableNameImp
@@ -260,6 +276,32 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_insertLinesImp(JN
JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertImp(JNIEnv *, jobject, jobjectArray,
jlong, jint, jint);
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithReqId(JNIEnv *, jobject, jlong,
+ jobjectArray, jint, jint,
+ jlong);
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithTtl(JNIEnv *, jobject, jlong,
+ jobjectArray, jint, jint, jint);
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithTtlAndReqId(JNIEnv *, jobject,
+ jlong, jobjectArray,
+ jint, jint, jint,
+ jlong);
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRaw(JNIEnv *, jobject, jlong, jstring,
+ jint, jint);
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithReqId(JNIEnv *, jobject, jlong,
+ jstring, jint, jint,
+ jlong);
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithTtl(JNIEnv *, jobject, jlong,
+ jstring, jint, jint, jint);
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithTtlAndReqId(JNIEnv *, jobject,
+ jlong, jstring,
+ jint, jint, jint,
+ jlong);
/**
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method: getTableVgID
diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c
index de08ba66cc76505b951653735f918faf8b2885de..874ac12f5c97befe568e6c6488ca52f1fb32f34c 100644
--- a/source/client/src/clientEnv.c
+++ b/source/client/src/clientEnv.c
@@ -30,6 +30,10 @@
#include "tsched.h"
#include "ttime.h"
+#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
+#include "cus_name.h"
+#endif
+
#define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_RELEASED 0
@@ -541,9 +545,15 @@ void taos_init_imp(void) {
deltaToUtcInitOnce();
- if (taosCreateLog("taoslog", 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) {
+ char logDirName[64] = {0};
+#ifdef CUS_PROMPT
+ snprintf(logDirName, 64, "%slog", CUS_PROMPT);
+#else
+ snprintf(logDirName, 64, "taoslog");
+#endif
+ if (taosCreateLog(logDirName, 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) {
// ignore create log failed, only print
- printf(" WARING: Create taoslog failed:%s. configDir=%s\n", strerror(errno), configDir);
+ printf(" WARING: Create %s failed:%s. configDir=%s\n", logDirName, strerror(errno), configDir);
}
if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) {
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index 9e5d9080b43c37c93b1666839307ea5f8e7584ed..dac44bd9c4511261124d43d19db214cac3300b49 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -1545,7 +1545,7 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4)
}
pRequest->code =
- setQueryResultFromRsp(&pRequest->body.resInfo, (SRetrieveTableRsp*)pResInfo->pData, convertUcs4, true);
+ setQueryResultFromRsp(&pRequest->body.resInfo, (const SRetrieveTableRsp*)pResInfo->pData, convertUcs4, true);
if (pRequest->code != TSDB_CODE_SUCCESS) {
pResultInfo->numOfRows = 0;
return NULL;
diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c
index 1658a0dd3259c6e03535d4b02f96d3f69e730fdf..2f4bafe26aa29a48e7c51c82275f14dba15a400d 100644
--- a/source/client/src/clientJniConnector.c
+++ b/source/client/src/clientJniConnector.c
@@ -55,7 +55,7 @@ jclass g_tmqClass;
jmethodID g_createConsumerErrorCallback;
jmethodID g_topicListCallback;
-jclass g_consumerClass;
+jclass g_consumerClass;
// deprecated
jmethodID g_commitCallback;
@@ -331,13 +331,58 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(
int32_t code = taos_errno(tres);
if (code != TSDB_CODE_SUCCESS) {
- jniError("jobj:%p, conn:%p, code:%s, msg:%s", jobj, tscon, tstrerror(code), taos_errstr(tres));
+ jniError("jobj:%p, conn:%p, code:0x%x, msg:%s", jobj, tscon, code, taos_errstr(tres));
} else {
if (taos_is_update_query(tres)) {
int32_t affectRows = taos_affected_rows(tres);
- jniDebug("jobj:%p, conn:%p, code:%s, affect rows:%d", jobj, tscon, tstrerror(code), affectRows);
+ jniDebug("jobj:%p, conn:%p, code:0x%x, affect rows:%d", jobj, tscon, code, affectRows);
} else {
- jniDebug("jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniDebug("jobj:%p, conn:%p, code:0x%x", jobj, tscon, code);
+ }
+ }
+
+ taosMemoryFreeClear(str);
+ return (jlong)tres;
+}
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryWithReqId(JNIEnv *env, jobject jobj,
+ jbyteArray jsql, jlong con,
+ jlong reqId) {
+ TAOS *tscon = (TAOS *)con;
+ if (tscon == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ return JNI_CONNECTION_NULL;
+ }
+
+ if (jsql == NULL) {
+ jniError("jobj:%p, conn:%p, empty sql string", jobj, tscon);
+ return JNI_SQL_NULL;
+ }
+
+ jsize len = (*env)->GetArrayLength(env, jsql);
+
+ char *str = (char *)taosMemoryCalloc(1, sizeof(char) * (len + 1));
+ if (str == NULL) {
+ jniError("jobj:%p, conn:%p, alloc memory failed", jobj, tscon);
+ return JNI_OUT_OF_MEMORY;
+ }
+
+ (*env)->GetByteArrayRegion(env, jsql, 0, len, (jbyte *)str);
+ if ((*env)->ExceptionCheck(env)) {
+ // todo handle error
+ }
+
+ TAOS_RES *tres = taos_query_with_reqid(tscon, str, reqId);
+ int32_t code = taos_errno(tres);
+
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("jobj:%p, conn:%p, code:0x%x, msg:%s", jobj, tscon, code, taos_errstr(tres));
+ } else {
+ if (taos_is_update_query(tres)) {
+ int32_t affectRows = taos_affected_rows(tres);
+ jniDebug("jobj:%p, conn:%p, code:0x%x, affect rows:%d", jobj, tscon, code, affectRows);
+ } else {
+ jniDebug("jobj:%p, conn:%p, code:0x%x", jobj, tscon, code);
}
}
@@ -489,7 +534,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
numOfFields);
return JNI_FETCH_END;
} else {
- jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: %d, msg:%s", jobj, tscon, code,
+ jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: 0x%x, msg:%s", jobj, tscon, code,
taos_errstr(result));
return JNI_RESULT_SET_NULL;
}
@@ -575,9 +620,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI
TAOS_RES *tres = (TAOS_RES *)res;
int32_t numOfFields = taos_num_fields(tres);
- if(numOfFields <= 0){
- jniError("jobj:%p, conn:%p, query interrupted. taos_num_fields error code:%d, msg:%s", jobj, tscon, numOfFields,
- taos_errstr(tres));
+ if (numOfFields <= 0) {
+ jniError("jobj:%p, conn:%p, query interrupted. taos_num_fields error code: 0x%x, msg:%s", jobj, tscon,
+ taos_errno(tres), taos_errstr(tres));
return JNI_RESULT_SET_NULL;
}
@@ -589,7 +634,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI
jniDebug("jobj:%p, conn:%p, resultset:%p, no data to retrieve", jobj, tscon, (void *)res);
return JNI_FETCH_END;
} else {
- jniError("jobj:%p, conn:%p, query interrupted. fetch block error code:%d, msg:%s", jobj, tscon, error_code,
+ jniError("jobj:%p, conn:%p, query interrupted. fetch block error code: 0x%x, msg:%s", jobj, tscon, error_code,
taos_errstr(tres));
return JNI_RESULT_SET_NULL;
}
@@ -639,7 +684,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
}
int code = taos_validate_sql(tscon, str);
- jniDebug("jobj:%p, conn:%p, code is %d", jobj, tscon, code);
+ jniDebug("jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
taosMemoryFreeClear(str);
return code;
@@ -704,7 +749,45 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtImp(J
int32_t code = taos_stmt_prepare(pStmt, str, len);
taosMemoryFreeClear(str);
if (code != TSDB_CODE_SUCCESS) {
- jniError("prepareStmt jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniError("prepareStmt jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
+ return JNI_TDENGINE_ERROR;
+ }
+
+ return (jlong)pStmt;
+}
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtWithReqId(JNIEnv *env, jobject jobj,
+ jbyteArray jsql, jlong con,
+ jlong reqId) {
+ TAOS *tscon = (TAOS *)con;
+ if (tscon == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ return JNI_CONNECTION_NULL;
+ }
+
+ if (jsql == NULL) {
+ jniError("jobj:%p, conn:%p, empty sql string", jobj, tscon);
+ return JNI_SQL_NULL;
+ }
+
+ jsize len = (*env)->GetArrayLength(env, jsql);
+
+ char *str = (char *)taosMemoryCalloc(1, sizeof(char) * (len + 1));
+ if (str == NULL) {
+ jniError("jobj:%p, conn:%p, alloc memory failed", jobj, tscon);
+ return JNI_OUT_OF_MEMORY;
+ }
+
+ (*env)->GetByteArrayRegion(env, jsql, 0, len, (jbyte *)str);
+ if ((*env)->ExceptionCheck(env)) {
+ // todo handle error
+ }
+
+ TAOS_STMT *pStmt = taos_stmt_init_with_reqid(tscon, reqId);
+ int32_t code = taos_stmt_prepare(pStmt, str, len);
+ taosMemoryFreeClear(str);
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("prepareStmtWithReqId jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
return JNI_TDENGINE_ERROR;
}
@@ -732,7 +815,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setBindTableNameI
if (code != TSDB_CODE_SUCCESS) {
(*env)->ReleaseStringUTFChars(env, jname, name);
- jniError("bindTableName jobj:%p, conn:%p, code:%s", jobj, tsconn, tstrerror(code));
+ jniError("bindTableName jobj:%p, conn:%p, code: 0x%x", jobj, tsconn, code);
return JNI_TDENGINE_ERROR;
}
@@ -807,7 +890,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setTableNameTagsI
(*env)->ReleaseStringUTFChars(env, tableName, name);
if (code != TSDB_CODE_SUCCESS) {
- jniError("tableNameTags jobj:%p, conn:%p, code:%s", jobj, tsconn, tstrerror(code));
+ jniError("tableNameTags jobj:%p, conn:%p, code: 0x%x", jobj, tsconn, code);
return JNI_TDENGINE_ERROR;
}
return JNI_SUCCESS;
@@ -873,7 +956,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_bindColDataImp(
taosMemoryFreeClear(b);
if (code != TSDB_CODE_SUCCESS) {
- jniError("bindColData jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniError("bindColData jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
return JNI_TDENGINE_ERROR;
}
@@ -896,7 +979,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_addBatchImp(JNIEn
int32_t code = taos_stmt_add_batch(pStmt);
if (code != TSDB_CODE_SUCCESS) {
- jniError("add batch jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniError("add batch jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
return JNI_TDENGINE_ERROR;
}
@@ -920,7 +1003,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeBatchImp(J
int32_t code = taos_stmt_execute(pStmt);
if (code != TSDB_CODE_SUCCESS) {
- jniError("excute batch jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniError("excute batch jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
return JNI_TDENGINE_ERROR;
}
@@ -944,7 +1027,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeStmt(JNIEnv
int32_t code = taos_stmt_close(pStmt);
if (code != TSDB_CODE_SUCCESS) {
- jniError("close stmt jobj:%p, conn:%p, code:%s", jobj, tscon, tstrerror(code));
+ jniError("close stmt jobj:%p, conn:%p, code: 0x%x", jobj, tscon, code);
return JNI_TDENGINE_ERROR;
}
@@ -1006,12 +1089,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_insertLinesImp(JN
TAOS_RES *tres = schemalessInsert(env, jobj, lines, taos, protocol, precision);
- if (tres == NULL) {
- return JNI_OUT_OF_MEMORY;
- }
int code = taos_errno(tres);
if (code != TSDB_CODE_SUCCESS) {
- jniError("jobj:%p, conn:%p, code:%s, msg:%s", jobj, taos, tstrerror(code), taos_errstr(tres));
+ jniError("jobj:%p, conn:%p, code: 0x%x, msg:%s", jobj, taos, code, taos_errstr(tres));
taos_free_result(tres);
return JNI_TDENGINE_ERROR;
}
@@ -1030,12 +1110,247 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsert
}
TAOS_RES *tres = schemalessInsert(env, jobj, lines, taos, protocol, precision);
- if (tres == NULL) {
+
+ return (jlong)tres;
+}
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithReqId(
+ JNIEnv *env, jobject jobj, jlong conn, jobjectArray lines, jint protocol, jint precision, jlong reqId) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ return JNI_CONNECTION_NULL;
+ }
+
+ int numLines = (*env)->GetArrayLength(env, lines);
+ char **c_lines = taosMemoryCalloc(numLines, sizeof(char *));
+ if (c_lines == NULL) {
+ jniError("c_lines:%p, alloc memory failed", c_lines);
+ return JNI_OUT_OF_MEMORY;
+ }
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ c_lines[i] = (char *)(*env)->GetStringUTFChars(env, line, 0);
+ }
+
+ TAOS_RES *tres = taos_schemaless_insert_with_reqid(taos, c_lines, numLines, protocol, precision, reqId);
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ (*env)->ReleaseStringUTFChars(env, line, c_lines[i]);
+ }
+
+ taosMemoryFreeClear(c_lines);
+
+ return (jlong)tres;
+}
+
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithTtl(JNIEnv *env, jobject jobj,
+ jlong conn, jobjectArray lines,
+ jint protocol, jint precision,
+ jint ttl) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ return JNI_CONNECTION_NULL;
+ }
+
+ int numLines = (*env)->GetArrayLength(env, lines);
+ char **c_lines = taosMemoryCalloc(numLines, sizeof(char *));
+ if (c_lines == NULL) {
+ jniError("c_lines:%p, alloc memory failed", c_lines);
return JNI_OUT_OF_MEMORY;
}
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ c_lines[i] = (char *)(*env)->GetStringUTFChars(env, line, 0);
+ }
+
+ TAOS_RES *tres = taos_schemaless_insert_ttl(taos, c_lines, numLines, protocol, precision, ttl);
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ (*env)->ReleaseStringUTFChars(env, line, c_lines[i]);
+ }
+
+ taosMemoryFreeClear(c_lines);
+
return (jlong)tres;
}
+JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertWithTtlAndReqId(
+ JNIEnv *env, jobject jobj, jlong conn, jobjectArray lines, jint protocol, jint precision, jint ttl, jlong reqId) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ return JNI_CONNECTION_NULL;
+ }
+
+ int numLines = (*env)->GetArrayLength(env, lines);
+ char **c_lines = taosMemoryCalloc(numLines, sizeof(char *));
+ if (c_lines == NULL) {
+ jniError("c_lines:%p, alloc memory failed", c_lines);
+ return JNI_OUT_OF_MEMORY;
+ }
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ c_lines[i] = (char *)(*env)->GetStringUTFChars(env, line, 0);
+ }
+
+ TAOS_RES *tres = taos_schemaless_insert_ttl_with_reqid(taos, c_lines, numLines, protocol, precision, ttl, reqId);
+
+ for (int i = 0; i < numLines; ++i) {
+ jstring line = (jstring)((*env)->GetObjectArrayElement(env, lines, i));
+ (*env)->ReleaseStringUTFChars(env, line, c_lines[i]);
+ }
+
+ taosMemoryFreeClear(c_lines);
+
+ return (jlong)tres;
+}
+
+JNIEXPORT jobject createSchemalessResp(JNIEnv *env, int totalRows, int code, const char *msg) {
+ // find class
+ jclass schemaless_clazz = (*env)->FindClass(env, "com/taosdata/jdbc/SchemalessResp");
+ // find methods
+ jmethodID init_method = (*env)->GetMethodID(env, schemaless_clazz, "", "()V");
+ jmethodID setCode_method = (*env)->GetMethodID(env, schemaless_clazz, "setCode", "(I)V");
+ jmethodID setMsg_method = (*env)->GetMethodID(env, schemaless_clazz, "setMsg", "(Ljava/lang/String;)V");
+ jmethodID setTotalRows_method = (*env)->GetMethodID(env, schemaless_clazz, "setTotalRows", "(I)V");
+ // new schemaless
+ jobject schemaless_obj = (*env)->NewObject(env, schemaless_clazz, init_method);
+ // set code
+ (*env)->CallVoidMethod(env, schemaless_obj, setCode_method, code);
+ // set totalRows
+ (*env)->CallVoidMethod(env, schemaless_obj, setTotalRows_method, totalRows);
+ // set message
+ jstring message = (*env)->NewStringUTF(env, msg);
+ (*env)->CallVoidMethod(env, schemaless_obj, setMsg_method, message);
+
+ return schemaless_obj;
+}
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRaw(JNIEnv *env, jobject jobj,
+ jlong conn, jstring data,
+ jint protocol, jint precision) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ char *msg = "JNI connection is NULL";
+ return createSchemalessResp(env, 0, JNI_CONNECTION_NULL, msg);
+ }
+
+ char *line = (char *)(*env)->GetStringUTFChars(env, data, NULL);
+ jint len = (*env)->GetStringUTFLength(env, data);
+ int32_t totalRows;
+ TAOS_RES *tres = taos_schemaless_insert_raw(taos, line, len, &totalRows, protocol, precision);
+
+ (*env)->ReleaseStringUTFChars(env, data, line);
+
+ // if (tres == NULL) {
+ // jniError("jobj:%p, schemaless raw insert failed", jobj);
+ // char *msg = "JNI schemaless raw insert return null";
+ // return createSchemalessResp(env, 0, JNI_TDENGINE_ERROR, msg);
+ // }
+
+ int code = taos_errno(tres);
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("jobj:%p, conn:%p, code: 0x%x, msg:%s", jobj, taos, code, taos_errstr(tres));
+ taos_free_result(tres);
+ return createSchemalessResp(env, 0, code, taos_errstr(tres));
+ }
+ taos_free_result(tres);
+
+ return createSchemalessResp(env, totalRows, JNI_SUCCESS, NULL);
+}
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithReqId(
+ JNIEnv *env, jobject jobj, jlong conn, jstring data, jint protocol, jint precision, jlong reqId) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ char *msg = "JNI connection is NULL";
+ return createSchemalessResp(env, 0, JNI_CONNECTION_NULL, msg);
+ }
+
+ char *line = (char *)(*env)->GetStringUTFChars(env, data, NULL);
+ jint len = (*env)->GetStringUTFLength(env, data);
+ int32_t totalRows;
+ TAOS_RES *tres = taos_schemaless_insert_raw_with_reqid(taos, line, len, &totalRows, protocol, precision, reqId);
+
+ (*env)->ReleaseStringUTFChars(env, data, line);
+
+ int code = taos_errno(tres);
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("jobj:%p, conn:%p, code: 0x%x, msg:%s", jobj, taos, code, taos_errstr(tres));
+ taos_free_result(tres);
+ return createSchemalessResp(env, 0, code, taos_errstr(tres));
+ }
+ taos_free_result(tres);
+
+ return createSchemalessResp(env, totalRows, JNI_SUCCESS, NULL);
+}
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithTtl(JNIEnv *env, jobject jobj,
+ jlong conn, jstring data,
+ jint protocol,
+ jint precision, jint ttl) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ char *msg = "JNI connection is NULL";
+ return createSchemalessResp(env, 0, JNI_CONNECTION_NULL, msg);
+ }
+
+ char *line = (char *)(*env)->GetStringUTFChars(env, data, NULL);
+ jint len = (*env)->GetStringUTFLength(env, data);
+ int32_t totalRows;
+ TAOS_RES *tres = taos_schemaless_insert_raw_ttl(taos, line, len, &totalRows, protocol, precision, ttl);
+
+ (*env)->ReleaseStringUTFChars(env, data, line);
+
+ int code = taos_errno(tres);
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("jobj:%p, conn:%p, code: 0x%x, msg:%s", jobj, taos, code, taos_errstr(tres));
+ taos_free_result(tres);
+ return createSchemalessResp(env, 0, code, taos_errstr(tres));
+ }
+ taos_free_result(tres);
+
+ return createSchemalessResp(env, totalRows, JNI_SUCCESS, NULL);
+}
+
+JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertRawWithTtlAndReqId(
+ JNIEnv *env, jobject jobj, jlong conn, jstring data, jint protocol, jint precision, jint ttl, jlong reqId) {
+ TAOS *taos = (TAOS *)conn;
+ if (taos == NULL) {
+ jniError("jobj:%p, connection already closed", jobj);
+ char *msg = "JNI connection is NULL";
+ return createSchemalessResp(env, 0, JNI_CONNECTION_NULL, msg);
+ }
+
+ char *line = (char *)(*env)->GetStringUTFChars(env, data, NULL);
+ jint len = (*env)->GetStringUTFLength(env, data);
+ int32_t totalRows;
+ TAOS_RES *tres =
+ taos_schemaless_insert_raw_ttl_with_reqid(taos, line, len, &totalRows, protocol, precision, ttl, reqId);
+
+ (*env)->ReleaseStringUTFChars(env, data, line);
+
+ int code = taos_errno(tres);
+ if (code != TSDB_CODE_SUCCESS) {
+ jniError("jobj:%p, conn:%p, code: 0x%x, msg:%s", jobj, taos, code, taos_errstr(tres));
+ taos_free_result(tres);
+ return createSchemalessResp(env, 0, code, taos_errstr(tres));
+ }
+ taos_free_result(tres);
+
+ return createSchemalessResp(env, totalRows, JNI_SUCCESS, NULL);
+}
+
// TABLE_VG_ID_FID_CACHE cache resp object for getTableVgID
typedef struct TABLE_VG_ID_FIELD_CACHE {
int cached;
diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c
index 4fdc6081e57bf639523d960e12b7db45ff7afec4..60c7b44b3d078e4102c6a6a5920f4fce61f8afbc 100644
--- a/source/client/src/clientMain.c
+++ b/source/client/src/clientMain.c
@@ -1022,7 +1022,7 @@ static void fetchCallback(void *pResult, void *param, int32_t code) {
}
pRequest->code =
- setQueryResultFromRsp(pResultInfo, (SRetrieveTableRsp *)pResultInfo->pData, pResultInfo->convertUcs4, true);
+ setQueryResultFromRsp(pResultInfo, (const SRetrieveTableRsp *)pResultInfo->pData, pResultInfo->convertUcs4, true);
if (pRequest->code != TSDB_CODE_SUCCESS) {
pResultInfo->numOfRows = 0;
pRequest->code = code;
diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c
index b1299c16e8129ca65fd7c4cba9cc2186e2360edf..a09780dc153db0512d3c2678646397a68cafb53e 100644
--- a/source/client/src/clientRawBlockWrite.c
+++ b/source/client/src/clientRawBlockWrite.c
@@ -25,9 +25,7 @@
#include "tref.h"
#include "ttimer.h"
-static tb_uid_t processSuid(tb_uid_t suid, char* db){
- return suid + MurmurHash3_32(db, strlen(db));
-}
+static tb_uid_t processSuid(tb_uid_t suid, char* db) { return suid + MurmurHash3_32(db, strlen(db)); }
static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* schemaTag, char* name, int64_t id,
int8_t t) {
@@ -183,7 +181,7 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) {
}
string = cJSON_PrintUnformatted(json);
- end:
+end:
cJSON_Delete(json);
tFreeSMAltertbReq(&req);
return string;
@@ -205,7 +203,7 @@ static char* processCreateStb(SMqMetaRsp* metaRsp) {
}
string = buildCreateTableJson(&req.schemaRow, &req.schemaTag, req.name, req.suid, TSDB_SUPER_TABLE);
uDebug("processCreateStb %s", string);
- _err:
+_err:
tDecoderClear(&coder);
return string;
}
@@ -227,7 +225,7 @@ static char* processAlterStb(SMqMetaRsp* metaRsp) {
string = buildAlterSTableJson(req.alterOriData, req.alterOriDataLen);
uDebug("processAlterStb %s", string);
- _err:
+_err:
tDecoderClear(&coder);
return string;
}
@@ -309,7 +307,7 @@ static void buildChildElement(cJSON* json, SVCreateTbReq* pCreateReq) {
cJSON_AddItemToArray(tags, tag);
}
- end:
+end:
cJSON_AddItemToObject(json, "tags", tags);
taosArrayDestroy(pTagVals);
}
@@ -363,12 +361,13 @@ static char* processCreateTable(SMqMetaRsp* metaRsp) {
if (pCreateReq->type == TSDB_CHILD_TABLE) {
string = buildCreateCTableJson(req.pReqs, req.nReqs);
} else if (pCreateReq->type == TSDB_NORMAL_TABLE) {
- string = buildCreateTableJson(&pCreateReq->ntb.schemaRow, NULL, pCreateReq->name, pCreateReq->uid, TSDB_NORMAL_TABLE);
+ string =
+ buildCreateTableJson(&pCreateReq->ntb.schemaRow, NULL, pCreateReq->name, pCreateReq->uid, TSDB_NORMAL_TABLE);
}
uDebug("processCreateTable :%s", string);
}
- _exit:
+_exit:
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pCreateReq = req.pReqs + iReq;
taosMemoryFreeClear(pCreateReq->comment);
@@ -408,7 +407,7 @@ static char* processAutoCreateTable(STaosxRsp* rsp) {
}
string = buildCreateCTableJson(pCreateReq, rsp->createTableNum);
uDebug("processAutoCreateTable :%s", string);
- _exit:
+_exit:
for (int i = 0; i < rsp->createTableNum; i++) {
tDecoderClear(&decoder[i]);
taosMemoryFreeClear(pCreateReq[i].comment);
@@ -535,7 +534,7 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
string = cJSON_PrintUnformatted(json);
uDebug("processAlterTable :%s", string);
- _exit:
+_exit:
cJSON_Delete(json);
tDecoderClear(&decoder);
return string;
@@ -569,7 +568,7 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
string = cJSON_PrintUnformatted(json);
uDebug("processDropSTable :%s", string);
- _exit:
+_exit:
cJSON_Delete(json);
tDecoderClear(&decoder);
return string;
@@ -609,7 +608,7 @@ static char* processDeleteTable(SMqMetaRsp* metaRsp) {
string = cJSON_PrintUnformatted(json);
uDebug("processDeleteTable :%s", string);
- _exit:
+_exit:
cJSON_Delete(json);
tDecoderClear(&coder);
return string;
@@ -652,7 +651,7 @@ static char* processDropTable(SMqMetaRsp* metaRsp) {
string = cJSON_PrintUnformatted(json);
uDebug("processDropTable :%s", string);
- _exit:
+_exit:
cJSON_Delete(json);
tDecoderClear(&decoder);
return string;
@@ -709,7 +708,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
pReq.source = TD_REQ_FROM_TAOX;
pReq.igExists = true;
- uDebug("taosCreateStb name:%s suid:%"PRId64" processSuid:%"PRId64, req.name, req.suid, pReq.suid);
+ uDebug("taosCreateStb name:%s suid:%" PRId64 " processSuid:%" PRId64, req.name, req.suid, pReq.suid);
STscObj* pTscObj = pRequest->pTscObj;
SName tableName;
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -742,7 +741,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
taosMemoryFree(pCmdMsg.pMsg);
- end:
+end:
destroyRequest(pRequest);
tFreeSMCreateStbReq(&pReq);
tDecoderClear(&coder);
@@ -776,20 +775,20 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
goto end;
}
- SCatalog* pCatalog = NULL;
+ SCatalog* pCatalog = NULL;
code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp)};
- SName pName = {0};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp)};
+ SName pName = {0};
toName(pRequest->pTscObj->acctId, pRequest->pDb, req.name, &pName);
- STableMeta *pTableMeta = NULL;
+ STableMeta* pTableMeta = NULL;
code = catalogGetTableMeta(pCatalog, &conn, &pName, &pTableMeta);
- if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST){
+ if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
code = TSDB_CODE_SUCCESS;
taosMemoryFreeClear(pTableMeta);
goto end;
@@ -804,9 +803,9 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
// build drop stable
pReq.igNotExists = true;
pReq.source = TD_REQ_FROM_TAOX;
-// pReq.suid = processSuid(req.suid, pRequest->pDb);
+ // pReq.suid = processSuid(req.suid, pRequest->pDb);
- uDebug("taosDropStb name:%s suid:%"PRId64" new suid:%"PRId64, req.name, req.suid, pReq.suid);
+ uDebug("taosDropStb name:%s suid:%" PRId64 " new suid:%" PRId64, req.name, req.suid, pReq.suid);
STscObj* pTscObj = pRequest->pTscObj;
SName tableName = {0};
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -831,7 +830,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
launchQueryImpl(pRequest, &pQuery, true, NULL);
if (pRequest->code == TSDB_CODE_SUCCESS) {
-// SCatalog* pCatalog = NULL;
+ // SCatalog* pCatalog = NULL;
catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
catalogRemoveTableMeta(pCatalog, &tableName);
}
@@ -839,7 +838,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
taosMemoryFree(pCmdMsg.pMsg);
- end:
+end:
destroyRequest(pRequest);
tDecoderClear(&coder);
return code;
@@ -901,9 +900,9 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp(pVgroupHashmap, destroyCreateTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
pRequest->tableList = taosArrayInit(req.nReqs, sizeof(SName));
// loop to create table
@@ -924,8 +923,8 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
if (pCreateReq->type == TSDB_CHILD_TABLE) {
STableMeta* pTableMeta = NULL;
SName sName = {0};
- tb_uid_t oldSuid = pCreateReq->ctb.suid;
-// pCreateReq->ctb.suid = processSuid(pCreateReq->ctb.suid, pRequest->pDb);
+ tb_uid_t oldSuid = pCreateReq->ctb.suid;
+ // pCreateReq->ctb.suid = processSuid(pCreateReq->ctb.suid, pRequest->pDb);
toName(pTscObj->acctId, pRequest->pDb, pCreateReq->ctb.stbName, &sName);
code = catalogGetTableMeta(pCatalog, &conn, &sName, &pTableMeta);
if (code != TSDB_CODE_SUCCESS) {
@@ -933,7 +932,8 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
goto end;
}
pCreateReq->ctb.suid = pTableMeta->uid;
- uDebug("taosCreateTable name:%s sname:%s suid:%"PRId64" new suid:%"PRId64, pCreateReq->name, pCreateReq->ctb.stbName, oldSuid, pCreateReq->ctb.suid);
+ uDebug("taosCreateTable name:%s sname:%s suid:%" PRId64 " new suid:%" PRId64, pCreateReq->name,
+ pCreateReq->ctb.stbName, oldSuid, pCreateReq->ctb.suid);
for (int32_t i = 0; i < taosArrayGetSize(pCreateReq->ctb.tagName); i++) {
char* tName = taosArrayGet(pCreateReq->ctb.tagName, i);
@@ -987,7 +987,7 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
- end:
+end:
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pCreateReq = req.pReqs + iReq;
taosMemoryFreeClear(pCreateReq->comment);
@@ -1058,15 +1058,15 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp(pVgroupHashmap, destroyDropTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
pRequest->tableList = taosArrayInit(req.nReqs, sizeof(SName));
// loop to create table
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pDropReq = req.pReqs + iReq;
pDropReq->igNotExists = true;
-// pDropReq->suid = processSuid(pDropReq->suid, pRequest->pDb);
+ // pDropReq->suid = processSuid(pDropReq->suid, pRequest->pDb);
SVgroupInfo pInfo = {0};
SName pName = {0};
@@ -1076,9 +1076,9 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
goto end;
}
- STableMeta *pTableMeta = NULL;
+ STableMeta* pTableMeta = NULL;
code = catalogGetTableMeta(pCatalog, &conn, &pName, &pTableMeta);
- if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST){
+ if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
code = TSDB_CODE_SUCCESS;
taosMemoryFreeClear(pTableMeta);
continue;
@@ -1090,7 +1090,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
tb_uid_t oldSuid = pDropReq->suid;
pDropReq->suid = pTableMeta->suid;
taosMemoryFreeClear(pTableMeta);
- uDebug("taosDropTable name:%s suid:%"PRId64" new suid:%"PRId64, pDropReq->name, oldSuid, pDropReq->suid);
+ uDebug("taosDropTable name:%s suid:%" PRId64 " new suid:%" PRId64, pDropReq->name, oldSuid, pDropReq->suid);
taosArrayPush(pRequest->tableList, &pName);
SVgroupDropTableBatch* pTableBatch = taosHashGet(pVgroupHashmap, &pInfo.vgId, sizeof(pInfo.vgId));
@@ -1106,7 +1106,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
}
}
- if (taosHashGetSize(pVgroupHashmap) == 0){
+ if (taosHashGetSize(pVgroupHashmap) == 0) {
goto end;
}
SArray* pBufArray = serializeVgroupsDropTableBatch(pVgroupHashmap);
@@ -1132,7 +1132,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
}
code = pRequest->code;
- end:
+end:
taosHashCleanup(pVgroupHashmap);
destroyRequest(pRequest);
tDecoderClear(&coder);
@@ -1201,7 +1201,7 @@ static int32_t taosDeleteData(TAOS* taos, void* meta, int32_t metaLen) {
}
taos_free_result(res);
- end:
+end:
tDecoderClear(&coder);
return code;
}
@@ -1249,9 +1249,9 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
}
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
SVgroupInfo pInfo = {0};
SName pName = {0};
@@ -1311,7 +1311,7 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
code = handleAlterTbExecRes(pRes->res, pCatalog);
}
}
- end:
+end:
taosArrayDestroy(pArray);
if (pVgData) taosMemoryFreeClear(pVgData->pData);
taosMemoryFreeClear(pVgData);
@@ -1373,7 +1373,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch
uError("WriteRaw:catalogGetTableMeta failed. table name: %s", tbname);
goto end;
}
-// uError("td23101 0vgId:%d, vgId:%d, name:%s, uid:%"PRIu64, vgData.vgId, pTableMeta->vgId, tbname, pTableMeta->uid);
+ // uError("td23101 0vgId:%d, vgId:%d, name:%s, uid:%"PRIu64, vgData.vgId, pTableMeta->vgId, tbname, pTableMeta->uid);
pQuery = smlInitHandle();
if (pQuery == NULL) {
@@ -1382,7 +1382,8 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch
}
pVgHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
taosHashPut(pVgHash, (const char*)&vgData.vgId, sizeof(vgData.vgId), (char*)&vgData, sizeof(vgData));
-// uError("td23101 1vgId:%d, numEps:%d, name:%s, uid:%"PRIu64, vgData.vgId, vgData.epSet.numOfEps, tbname, pTableMeta->uid);
+ // uError("td23101 1vgId:%d, numEps:%d, name:%s, uid:%"PRIu64, vgData.vgId, vgData.epSet.numOfEps, tbname,
+ // pTableMeta->uid);
code = rawBlockBindData(pQuery, pTableMeta, pData, NULL, fields, numFields, false);
if (code != TSDB_CODE_SUCCESS) {
@@ -1399,7 +1400,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch
launchQueryImpl(pRequest, pQuery, true, NULL);
code = pRequest->code;
- end:
+end:
taosMemoryFreeClear(pTableMeta);
qDestroyQuery(pQuery);
destroyRequest(pRequest);
@@ -1481,7 +1482,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname)
launchQueryImpl(pRequest, pQuery, true, NULL);
code = pRequest->code;
- end:
+end:
taosMemoryFreeClear(pTableMeta);
qDestroyQuery(pQuery);
destroyRequest(pRequest);
@@ -1613,7 +1614,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
launchQueryImpl(pRequest, pQuery, true, NULL);
code = pRequest->code;
- end:
+end:
tDeleteSMqDataRsp(&rspObj.rsp);
tDecoderClear(&decoder);
qDestroyQuery(pQuery);
@@ -1723,7 +1724,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
}
if (strcmp(tbName, pCreateReq.name) == 0) {
cloneSVreateTbReq(&pCreateReq, &pCreateReqDst);
-// pCreateReqDst->ctb.suid = processSuid(pCreateReqDst->ctb.suid, pRequest->pDb);
+ // pCreateReqDst->ctb.suid = processSuid(pCreateReqDst->ctb.suid, pRequest->pDb);
tDecoderClear(&decoderTmp);
tDestroySVCreateTbReq(&pCreateReq, TSDB_MSG_FLG_DECODE);
break;
@@ -1792,7 +1793,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
launchQueryImpl(pRequest, pQuery, true, NULL);
code = pRequest->code;
- end:
+end:
tDeleteSTaosxRsp(&rspObj.rsp);
tDecoderClear(&decoder);
qDestroyQuery(pQuery);
diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c
index a4ecc3c3df8ab358b3be9b958932ee2bdfd439de..ef7bd546c1a911200e1fa0e878ba21b43e0b19e0 100644
--- a/source/client/src/clientSml.c
+++ b/source/client/src/clientSml.c
@@ -256,7 +256,7 @@ cleanup:
kvVal->type = TSDB_DATA_TYPE_FLOAT; \
kvVal->f = (float)result;
-#define SET_BIGINT \
+#define SET_BIGINT \
errno = 0; \
int64_t tmp = taosStr2Int64(pVal, &endptr, 10); \
if (errno == ERANGE) { \
@@ -282,7 +282,7 @@ cleanup:
kvVal->type = TSDB_DATA_TYPE_SMALLINT; \
kvVal->i = result;
-#define SET_UBIGINT \
+#define SET_UBIGINT \
errno = 0; \
uint64_t tmp = taosStr2UInt64(pVal, &endptr, 10); \
if (errno == ERANGE || result < 0) { \
@@ -627,8 +627,8 @@ static int32_t smlBuildFieldsList(SSmlHandle *info, SSchema *schemaField, SHashO
for (int j = 0; j < taosArrayGetSize(cols); ++j) {
SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, j);
ESchemaAction action = SCHEMA_ACTION_NULL;
- int code = smlGenerateSchemaAction(schemaField, schemaHash, kv, isTag, &action, info);
- if(code != 0){
+ int code = smlGenerateSchemaAction(schemaField, schemaHash, kv, isTag, &action, info);
+ if (code != 0) {
return code;
}
if (action == SCHEMA_ACTION_ADD_COLUMN || action == SCHEMA_ACTION_ADD_TAG) {
@@ -639,11 +639,11 @@ static int32_t smlBuildFieldsList(SSmlHandle *info, SSchema *schemaField, SHashO
taosArrayPush(results, &field);
} else if (action == SCHEMA_ACTION_CHANGE_COLUMN_SIZE || action == SCHEMA_ACTION_CHANGE_TAG_SIZE) {
uint16_t *index = (uint16_t *)taosHashGet(schemaHash, kv->key, kv->keyLen);
- if(index == NULL){
+ if (index == NULL) {
uError("smlBuildFieldsList get error, key:%s", kv->key);
return TSDB_CODE_SML_INVALID_DATA;
}
- uint16_t newIndex = *index;
+ uint16_t newIndex = *index;
if (isTag) newIndex -= numOfCols;
SField *field = (SField *)taosArrayGet(results, newIndex);
field->bytes = getBytes(kv->type, kv->length);
@@ -740,7 +740,8 @@ end:
}
static int32_t smlModifyDBSchemas(SSmlHandle *info) {
- uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas start, format:%d, needModifySchema:%d", info->id, info->dataFormat, info->needModifySchema);
+ uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas start, format:%d, needModifySchema:%d", info->id, info->dataFormat,
+ info->needModifySchema);
if (info->dataFormat && !info->needModifySchema) {
return TSDB_CODE_SUCCESS;
}
@@ -810,7 +811,8 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
goto end;
}
if (action != SCHEMA_ACTION_NULL) {
- uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas change table tag, table:%s, action:%d", info->id, pName.tname, action);
+ uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas change table tag, table:%s, action:%d", info->id, pName.tname,
+ action);
SArray *pColumns =
taosArrayInit(taosArrayGetSize(sTableData->cols) + pTableMeta->tableInfo.numOfColumns, sizeof(SField));
SArray *pTags =
@@ -828,7 +830,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
}
}
code = smlBuildFieldsList(info, pTableMeta->schema, hashTmp, sTableData->tags, pTags,
- pTableMeta->tableInfo.numOfColumns, true);
+ pTableMeta->tableInfo.numOfColumns, true);
if (code != TSDB_CODE_SUCCESS) {
uError("SML:0x%" PRIx64 " smlBuildFieldsList tag2 failed. %s", info->id, pName.tname);
goto end;
@@ -862,7 +864,8 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
goto end;
}
if (action != SCHEMA_ACTION_NULL) {
- uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas change table col, table:%s, action:%d", info->id, pName.tname, action);
+ uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas change table col, table:%s, action:%d", info->id, pName.tname,
+ action);
SArray *pColumns =
taosArrayInit(taosArrayGetSize(sTableData->cols) + pTableMeta->tableInfo.numOfColumns, sizeof(SField));
SArray *pTags =
@@ -881,7 +884,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
}
code = smlBuildFieldsList(info, pTableMeta->schema, hashTmp, sTableData->cols, pColumns,
- pTableMeta->tableInfo.numOfColumns, false);
+ pTableMeta->tableInfo.numOfColumns, false);
if (code != TSDB_CODE_SUCCESS) {
uError("SML:0x%" PRIx64 " smlBuildFieldsList col2 failed. %s", info->id, pName.tname);
goto end;
@@ -929,10 +932,11 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
}
sTableData->tableMeta = pTableMeta;
- uDebug("SML:0x%" PRIx64 "modify schema uid:%" PRIu64 ", sversion:%d, tversion:%d", info->id, pTableMeta->uid, pTableMeta->sversion, pTableMeta->tversion)
- tmp = (SSmlSTableMeta **)taosHashIterate(info->superTables, tmp);
+ uDebug("SML:0x%" PRIx64 "modify schema uid:%" PRIu64 ", sversion:%d, tversion:%d", info->id, pTableMeta->uid,
+ pTableMeta->sversion, pTableMeta->tversion) tmp = (SSmlSTableMeta **)taosHashIterate(info->superTables, tmp);
}
- uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas end success, format:%d, needModifySchema:%d", info->id, info->dataFormat, info->needModifySchema);
+ uDebug("SML:0x%" PRIx64 " smlModifyDBSchemas end success, format:%d, needModifySchema:%d", info->id, info->dataFormat,
+ info->needModifySchema);
return 0;
@@ -940,7 +944,8 @@ end:
taosHashCleanup(hashTmp);
taosMemoryFreeClear(pTableMeta);
catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1);
- uError("SML:0x%" PRIx64 " smlModifyDBSchemas end failed:%d:%s, format:%d, needModifySchema:%d", info->id, code, tstrerror(code), info->dataFormat, info->needModifySchema);
+ uError("SML:0x%" PRIx64 " smlModifyDBSchemas end failed:%d:%s, format:%d, needModifySchema:%d", info->id, code,
+ tstrerror(code), info->dataFormat, info->needModifySchema);
return code;
}
@@ -1118,7 +1123,7 @@ SSmlHandle *smlBuildSmlInfo(TAOS *taos) {
}
if (taos != NULL) {
info->taos = acquireTscObj(*(int64_t *)taos);
- if(info->taos == NULL){
+ if (info->taos == NULL) {
goto cleanup;
}
code = catalogGetHandle(info->taos->pAppInfo->clusterId, &info->pCatalog);
@@ -1161,7 +1166,9 @@ static int32_t smlPushCols(SArray *colsArray, SArray *cols) {
for (size_t i = 0; i < taosArrayGetSize(cols); i++) {
SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, i);
taosHashPut(kvHash, kv->key, kv->keyLen, &kv, POINTER_BYTES);
- if(terrno == TSDB_CODE_DUP_KEY){return terrno;}
+ if (terrno == TSDB_CODE_DUP_KEY) {
+ return terrno;
+ }
}
taosArrayPush(colsArray, &kvHash);
@@ -1169,23 +1176,25 @@ static int32_t smlPushCols(SArray *colsArray, SArray *cols) {
}
static int32_t smlParseLineBottom(SSmlHandle *info) {
- uDebug("SML:0x%" PRIx64 " smlParseLineBottom start, format:%d, linenum:%d", info->id, info->dataFormat, info->lineNum);
+ uDebug("SML:0x%" PRIx64 " smlParseLineBottom start, format:%d, linenum:%d", info->id, info->dataFormat,
+ info->lineNum);
if (info->dataFormat) return TSDB_CODE_SUCCESS;
for (int32_t i = 0; i < info->lineNum; i++) {
SSmlLineInfo *elements = info->lines + i;
SSmlTableInfo *tinfo = NULL;
if (info->protocol == TSDB_SML_LINE_PROTOCOL) {
- SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measure, elements->measureTagsLen);
- if(tmp) tinfo = *tmp;
+ SSmlTableInfo **tmp =
+ (SSmlTableInfo **)taosHashGet(info->childTables, elements->measure, elements->measureTagsLen);
+ if (tmp) tinfo = *tmp;
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
- SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
+ SSmlTableInfo **tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
elements->measureLen + elements->tagsLen);
- if(tmp) tinfo = *tmp;
+ if (tmp) tinfo = *tmp;
} else {
- SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
+ SSmlTableInfo **tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
elements->measureLen + elements->tagsLen);
- if(tmp) tinfo = *tmp;
+ if (tmp) tinfo = *tmp;
}
if (tinfo == NULL) {
@@ -1212,7 +1221,8 @@ static int32_t smlParseLineBottom(SSmlHandle *info) {
SSmlSTableMeta **tableMeta =
(SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
if (tableMeta) { // update meta
- uDebug("SML:0x%" PRIx64 " smlParseLineBottom update meta, format:%d, linenum:%d", info->id, info->dataFormat, info->lineNum);
+ uDebug("SML:0x%" PRIx64 " smlParseLineBottom update meta, format:%d, linenum:%d", info->id, info->dataFormat,
+ info->lineNum);
ret = smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, elements->colArray, false, &info->msgBuf);
if (ret == TSDB_CODE_SUCCESS) {
ret = smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, tinfo->tags, true, &info->msgBuf);
@@ -1227,10 +1237,13 @@ static int32_t smlParseLineBottom(SSmlHandle *info) {
// uError("SML:0x%" PRIx64 " smlUpdateMeta failed", info->id);
// return ret;
// }
- uDebug("SML:0x%" PRIx64 " smlParseLineBottom add meta, format:%d, linenum:%d", info->id, info->dataFormat, info->lineNum);
+ uDebug("SML:0x%" PRIx64 " smlParseLineBottom add meta, format:%d, linenum:%d", info->id, info->dataFormat,
+ info->lineNum);
SSmlSTableMeta *meta = smlBuildSTableMeta(info->dataFormat);
smlInsertMeta(meta->tagHash, meta->tags, tinfo->tags);
- if(terrno == TSDB_CODE_DUP_KEY){return terrno;}
+ if (terrno == TSDB_CODE_DUP_KEY) {
+ return terrno;
+ }
smlInsertMeta(meta->colHash, meta->cols, elements->colArray);
taosHashPut(info->superTables, elements->measure, elements->measureLen, &meta, POINTER_BYTES);
}
@@ -1244,11 +1257,12 @@ static int32_t smlInsertData(SSmlHandle *info) {
int32_t code = TSDB_CODE_SUCCESS;
uDebug("SML:0x%" PRIx64 " smlInsertData start, format:%d", info->id, info->dataFormat);
- if(info->pRequest->dbList == NULL){
+ if (info->pRequest->dbList == NULL) {
info->pRequest->dbList = taosArrayInit(1, TSDB_DB_FNAME_LEN);
}
- void* data = taosArrayReserve(info->pRequest->dbList, 1);
- memcpy(data, info->pRequest->pDb, TSDB_DB_FNAME_LEN > strlen(info->pRequest->pDb) ? strlen(info->pRequest->pDb) : TSDB_DB_FNAME_LEN);
+ void *data = taosArrayReserve(info->pRequest->dbList, 1);
+ memcpy(data, info->pRequest->pDb,
+ TSDB_DB_FNAME_LEN > strlen(info->pRequest->pDb) ? strlen(info->pRequest->pDb) : TSDB_DB_FNAME_LEN);
SSmlTableInfo **oneTable = (SSmlTableInfo **)taosHashIterate(info->childTables, NULL);
while (oneTable) {
@@ -1258,7 +1272,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
tstrncpy(pName.dbname, info->pRequest->pDb, sizeof(pName.dbname));
memcpy(pName.tname, tableData->childTableName, strlen(tableData->childTableName));
- if(info->pRequest->tableList == NULL){
+ if (info->pRequest->tableList == NULL) {
info->pRequest->tableList = taosArrayInit(1, sizeof(SName));
}
taosArrayPush(info->pRequest->tableList, &pName);
@@ -1287,7 +1301,8 @@ static int32_t smlInsertData(SSmlHandle *info) {
// use tablemeta of stable to save vgid and uid of child table
(*pMeta)->tableMeta->vgId = vg.vgId;
(*pMeta)->tableMeta->uid = tableData->uid; // one table merge data block together according uid
- uDebug("SML:0x%" PRIx64 " smlInsertData table:%s, uid:%" PRIu64 ", format:%d", info->id, pName.tname, tableData->uid, info->dataFormat);
+ uDebug("SML:0x%" PRIx64 " smlInsertData table:%s, uid:%" PRIu64 ", format:%d", info->id, pName.tname,
+ tableData->uid, info->dataFormat);
code = smlBindData(info->pQuery, info->dataFormat, tableData->tags, (*pMeta)->cols, tableData->cols,
(*pMeta)->tableMeta, tableData->childTableName, tableData->sTableName, tableData->sTableNameLen,
@@ -1310,7 +1325,8 @@ static int32_t smlInsertData(SSmlHandle *info) {
atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1);
launchQueryImpl(info->pRequest, info->pQuery, true, NULL);
- uDebug("SML:0x%" PRIx64 " smlInsertData end, format:%d, code:%d,%s", info->id, info->dataFormat, info->pRequest->code, tstrerror(info->pRequest->code));
+ uDebug("SML:0x%" PRIx64 " smlInsertData end, format:%d, code:%d,%s", info->id, info->dataFormat, info->pRequest->code,
+ tstrerror(info->pRequest->code));
return info->pRequest->code;
}
@@ -1321,11 +1337,11 @@ static void smlPrintStatisticInfo(SSmlHandle *info) {
" smlInsertLines result, code:%d, msg:%s, lineNum:%d,stable num:%d,ctable num:%d,create stable num:%d,alter stable tag num:%d,alter stable col num:%d \
parse cost:%" PRId64 ",schema cost:%" PRId64 ",bind cost:%" PRId64 ",rpc cost:%" PRId64 ",total cost:%" PRId64
"",
- info->id, info->cost.code, tstrerror(info->cost.code), info->cost.lineNum, info->cost.numOfSTables, info->cost.numOfCTables,
- info->cost.numOfCreateSTables, info->cost.numOfAlterTagSTables, info->cost.numOfAlterColSTables,
- info->cost.schemaTime - info->cost.parseTime, info->cost.insertBindTime - info->cost.schemaTime,
- info->cost.insertRpcTime - info->cost.insertBindTime, info->cost.endTime - info->cost.insertRpcTime,
- info->cost.endTime - info->cost.parseTime);
+ info->id, info->cost.code, tstrerror(info->cost.code), info->cost.lineNum, info->cost.numOfSTables,
+ info->cost.numOfCTables, info->cost.numOfCreateSTables, info->cost.numOfAlterTagSTables,
+ info->cost.numOfAlterColSTables, info->cost.schemaTime - info->cost.parseTime,
+ info->cost.insertBindTime - info->cost.schemaTime, info->cost.insertRpcTime - info->cost.insertBindTime,
+ info->cost.endTime - info->cost.insertRpcTime, info->cost.endTime - info->cost.parseTime);
}
int32_t smlClearForRerun(SSmlHandle *info) {
@@ -1402,14 +1418,15 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
}
}
- char cTmp = 0; // for print tmp if is raw
- if(info->isRawLine){
+ char cTmp = 0; // for print tmp if is raw
+ if (info->isRawLine) {
cTmp = tmp[len - 1];
tmp[len - 1] = '\0';
}
- uDebug("SML:0x%" PRIx64 " smlParseLine israw:%d, numLines:%d, protocol:%d, len:%d, sql:%s", info->id, info->isRawLine, numLines, info->protocol, len, tmp);
- if(info->isRawLine){
+ uDebug("SML:0x%" PRIx64 " smlParseLine israw:%d, numLines:%d, protocol:%d, len:%d, sql:%s", info->id,
+ info->isRawLine, numLines, info->protocol, len, tmp);
+ if (info->isRawLine) {
tmp[len - 1] = cTmp;
}
@@ -1505,9 +1522,9 @@ TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine,
return NULL;
}
SRequestObj *request = NULL;
- SSmlHandle *info = NULL;
- int cnt = 0;
- while(1){
+ SSmlHandle *info = NULL;
+ int cnt = 0;
+ while (1) {
request = (SRequestObj *)createRequest(*(int64_t *)taos, TSDB_SQL_INSERT, reqid);
if (request == NULL) {
uError("SML:taos_schemaless_insert error request is null");
@@ -1561,15 +1578,16 @@ TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine,
request->code = code;
info->cost.endTime = taosGetTimestampUs();
info->cost.code = code;
- if(code == TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER || code == TSDB_CODE_SDB_OBJ_CREATING
- || code == TSDB_CODE_PAR_VALUE_TOO_LONG || code == TSDB_CODE_MND_TRANS_CONFLICT){
- if(cnt++ >= 10){
- uInfo("SML:%"PRIx64" retry:%d/10 end code:%d, msg:%s", info->id, cnt, code, tstrerror(code));
+ if (code == TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER || code == TSDB_CODE_SDB_OBJ_CREATING ||
+ code == TSDB_CODE_PAR_VALUE_TOO_LONG || code == TSDB_CODE_MND_TRANS_CONFLICT) {
+ if (cnt++ >= 10) {
+ uInfo("SML:%" PRIx64 " retry:%d/10 end code:%d, msg:%s", info->id, cnt, code, tstrerror(code));
break;
}
taosMsleep(100);
refreshMeta(request->pTscObj, request);
- uInfo("SML:%"PRIx64" retry:%d/10,ver is old retry or object is creating code:%d, msg:%s", info->id, cnt, code, tstrerror(code));
+ uInfo("SML:%" PRIx64 " retry:%d/10,ver is old retry or object is creating code:%d, msg:%s", info->id, cnt, code,
+ tstrerror(code));
smlDestroyInfo(info);
info = NULL;
taos_free_result(request);
diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c
index 59a407656d47d2016fe00afb350851b89ae4e3fb..9e43765b5b93cac7ef90ac6a11684305d9647c19 100644
--- a/source/client/src/clientTmq.c
+++ b/source/client/src/clientTmq.c
@@ -24,8 +24,8 @@
#include "tref.h"
#include "ttimer.h"
-#define EMPTY_BLOCK_POLL_IDLE_DURATION 10
-#define DEFAULT_AUTO_COMMIT_INTERVAL 5000
+#define EMPTY_BLOCK_POLL_IDLE_DURATION 10
+#define DEFAULT_AUTO_COMMIT_INTERVAL 5000
typedef void (*__tmq_askep_fn_t)(tmq_t* pTmq, int32_t code, SDataBuf* pBuf, void* pParam);
@@ -94,8 +94,8 @@ struct tmq_t {
int32_t epSkipCnt;
#endif
// poll info
- int64_t pollCnt;
- int64_t totalRows;
+ int64_t pollCnt;
+ int64_t totalRows;
// timer
tmr_h hbLiveTimer;
@@ -106,8 +106,8 @@ struct tmq_t {
SArray* clientTopics; // SArray
STaosQueue* mqueue; // queue of rsp
STaosQall* qall;
- STaosQueue* delayedTask; // delayed task queue for heartbeat and auto commit
- TdThreadMutex lock; // used to protect the operation on each topic, when updating the epsets.
+ STaosQueue* delayedTask; // delayed task queue for heartbeat and auto commit
+ TdThreadMutex lock; // used to protect the operation on each topic, when updating the epsets.
tsem_t rspSem;
};
@@ -142,7 +142,7 @@ typedef struct {
int32_t vgId;
int32_t vgStatus;
int32_t vgSkipCnt;
- int64_t emptyBlockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
+ int64_t emptyBlockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
SEpSet epSet;
} SMqClientVg;
@@ -155,7 +155,7 @@ typedef struct {
typedef struct {
int8_t tmqRspType;
- int32_t epoch; // epoch can be used to guard the vgHandle
+ int32_t epoch; // epoch can be used to guard the vgHandle
int32_t vgId;
SMqClientVg* vgHandle;
SMqClientTopic* topicHandle;
@@ -189,7 +189,7 @@ typedef struct {
SMqClientTopic* pTopic;
int32_t vgId;
tsem_t rspSem;
- uint64_t requestId; // request id for debug purpose
+ uint64_t requestId; // request id for debug purpose
} SMqPollCbParam;
typedef struct {
@@ -201,7 +201,7 @@ typedef struct {
tmq_commit_cb* callbackFn;
/*SArray* successfulOffsets;*/
/*SArray* failedOffsets;*/
- void* userParam;
+ void* userParam;
} SMqCommitCbParamSet;
typedef struct {
@@ -217,9 +217,9 @@ static int32_t makeTopicVgroupKey(char* dst, const char* topicName, int32_t vg);
static int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet);
static int32_t doSendCommitMsg(tmq_t* tmq, SMqClientVg* pVg, const char* pTopicName, SMqCommitCbParamSet* pParamSet,
int32_t index, int32_t totalVgroups);
-static void commitRspCountDown(SMqCommitCbParamSet* pParamSet, int64_t consumerId, const char* pTopic, int32_t vgId);
-static void asyncAskEp(tmq_t* pTmq, __tmq_askep_fn_t askEpFn, void* param);
-static void addToQueueCallbackFn(tmq_t* pTmq, int32_t code, SDataBuf* pDataBuf, void* param);
+static void commitRspCountDown(SMqCommitCbParamSet* pParamSet, int64_t consumerId, const char* pTopic, int32_t vgId);
+static void asyncAskEp(tmq_t* pTmq, __tmq_askep_fn_t askEpFn, void* param);
+static void addToQueueCallbackFn(tmq_t* pTmq, int32_t code, SDataBuf* pDataBuf, void* param);
tmq_conf_t* tmq_conf_new() {
tmq_conf_t* conf = taosMemoryCalloc(1, sizeof(tmq_conf_t));
@@ -325,16 +325,16 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
}
if (strcasecmp(key, "enable.heartbeat.background") == 0) {
-// if (strcasecmp(value, "true") == 0) {
-// conf->hbBgEnable = true;
-// return TMQ_CONF_OK;
-// } else if (strcasecmp(value, "false") == 0) {
-// conf->hbBgEnable = false;
-// return TMQ_CONF_OK;
-// } else {
- tscError("the default value of enable.heartbeat.background is true, can not be seted");
- return TMQ_CONF_INVALID;
-// }
+ // if (strcasecmp(value, "true") == 0) {
+ // conf->hbBgEnable = true;
+ // return TMQ_CONF_OK;
+ // } else if (strcasecmp(value, "false") == 0) {
+ // conf->hbBgEnable = false;
+ // return TMQ_CONF_OK;
+ // } else {
+ tscError("the default value of enable.heartbeat.background is true, can not be seted");
+ return TMQ_CONF_INVALID;
+ // }
}
if (strcasecmp(key, "td.connect.ip") == 0) {
@@ -364,9 +364,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
return TMQ_CONF_UNKNOWN;
}
-tmq_list_t* tmq_list_new() {
- return (tmq_list_t*)taosArrayInit(0, sizeof(void*));
-}
+tmq_list_t* tmq_list_new() { return (tmq_list_t*)taosArrayInit(0, sizeof(void*)); }
int32_t tmq_list_append(tmq_list_t* list, const char* src) {
SArray* container = &list->container;
@@ -394,12 +392,13 @@ char** tmq_list_to_c_array(const tmq_list_t* list) {
return container->pData;
}
-static SMqClientVg* foundClientVg(SArray* pTopicList, const char* pName, int32_t vgId, int32_t* index, int32_t* numOfVgroups) {
+static SMqClientVg* foundClientVg(SArray* pTopicList, const char* pName, int32_t vgId, int32_t* index,
+ int32_t* numOfVgroups) {
int32_t numOfTopics = taosArrayGetSize(pTopicList);
*index = -1;
*numOfVgroups = 0;
- for(int32_t i = 0; i < numOfTopics; ++i) {
+ for (int32_t i = 0; i < numOfTopics; ++i) {
SMqClientTopic* pTopic = taosArrayGet(pTopicList, i);
if (strcmp(pTopic->topicName, pName) != 0) {
continue;
@@ -425,35 +424,36 @@ static int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
SMqCommitCbParam* pParam = (SMqCommitCbParam*)param;
SMqCommitCbParamSet* pParamSet = (SMqCommitCbParamSet*)pParam->params;
-// if (code != TSDB_CODE_SUCCESS) { // if commit offset failed, let's try again
-// taosThreadMutexLock(&pParam->pTmq->lock);
-// int32_t numOfVgroups, index;
-// SMqClientVg* pVg = foundClientVg(pParam->pTmq->clientTopics, pParam->topicName, pParam->vgId, &index, &numOfVgroups);
-// if (pVg == NULL) {
-// tscDebug("consumer:0x%" PRIx64
-// " subKey:%s vgId:%d commit failed, code:%s has been transferred to other consumer, no need retry ordinal:%d/%d",
-// pParam->pTmq->consumerId, pParam->pOffset->subKey, pParam->vgId, tstrerror(code), index + 1, numOfVgroups);
-// } else { // let's retry the commit
-// int32_t code1 = doSendCommitMsg(pParam->pTmq, pVg, pParam->topicName, pParamSet, index, numOfVgroups);
-// if (code1 != TSDB_CODE_SUCCESS) { // retry failed.
-// tscError("consumer:0x%" PRIx64 " topic:%s vgId:%d offset:%" PRId64
-// " retry failed, ignore this commit. code:%s ordinal:%d/%d",
-// pParam->pTmq->consumerId, pParam->topicName, pVg->vgId, pVg->committedOffset.version,
-// tstrerror(terrno), index + 1, numOfVgroups);
-// }
-// }
-//
-// taosThreadMutexUnlock(&pParam->pTmq->lock);
-//
-// taosMemoryFree(pParam->pOffset);
-// taosMemoryFree(pBuf->pData);
-// taosMemoryFree(pBuf->pEpSet);
-//
-// commitRspCountDown(pParamSet, pParam->pTmq->consumerId, pParam->topicName, pParam->vgId);
-// return 0;
-// }
-//
-// // todo replace the pTmq with refId
+ // if (code != TSDB_CODE_SUCCESS) { // if commit offset failed, let's try again
+ // taosThreadMutexLock(&pParam->pTmq->lock);
+ // int32_t numOfVgroups, index;
+ // SMqClientVg* pVg = foundClientVg(pParam->pTmq->clientTopics, pParam->topicName, pParam->vgId, &index,
+ // &numOfVgroups); if (pVg == NULL) {
+ // tscDebug("consumer:0x%" PRIx64
+ // " subKey:%s vgId:%d commit failed, code:%s has been transferred to other consumer, no need retry
+ // ordinal:%d/%d", pParam->pTmq->consumerId, pParam->pOffset->subKey, pParam->vgId, tstrerror(code),
+ // index + 1, numOfVgroups);
+ // } else { // let's retry the commit
+ // int32_t code1 = doSendCommitMsg(pParam->pTmq, pVg, pParam->topicName, pParamSet, index, numOfVgroups);
+ // if (code1 != TSDB_CODE_SUCCESS) { // retry failed.
+ // tscError("consumer:0x%" PRIx64 " topic:%s vgId:%d offset:%" PRId64
+ // " retry failed, ignore this commit. code:%s ordinal:%d/%d",
+ // pParam->pTmq->consumerId, pParam->topicName, pVg->vgId, pVg->committedOffset.version,
+ // tstrerror(terrno), index + 1, numOfVgroups);
+ // }
+ // }
+ //
+ // taosThreadMutexUnlock(&pParam->pTmq->lock);
+ //
+ // taosMemoryFree(pParam->pOffset);
+ // taosMemoryFree(pBuf->pData);
+ // taosMemoryFree(pBuf->pEpSet);
+ //
+ // commitRspCountDown(pParamSet, pParam->pTmq->consumerId, pParam->topicName, pParam->vgId);
+ // return 0;
+ // }
+ //
+ // // todo replace the pTmq with refId
taosMemoryFree(pParam->pOffset);
taosMemoryFree(pBuf->pData);
@@ -606,8 +606,8 @@ static void asyncCommitOffset(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* p
}
if (i == numOfTopics) {
- tscWarn("consumer:0x%" PRIx64 " failed to find the specified topic:%s, total topics:%d", tmq->consumerId, pTopicName,
- numOfTopics);
+ tscWarn("consumer:0x%" PRIx64 " failed to find the specified topic:%s, total topics:%d", tmq->consumerId,
+ pTopicName, numOfTopics);
taosMemoryFree(pParamSet);
pCommitFp(tmq, TSDB_CODE_SUCCESS, userParam);
return;
@@ -625,8 +625,8 @@ static void asyncCommitOffset(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* p
}
if (j == numOfVgroups) {
- tscWarn("consumer:0x%" PRIx64 " failed to find the specified vgId:%d, total Vgs:%d, topic:%s", tmq->consumerId, vgId,
- numOfVgroups, pTopicName);
+ tscWarn("consumer:0x%" PRIx64 " failed to find the specified vgId:%d, total Vgs:%d, topic:%s", tmq->consumerId,
+ vgId, numOfVgroups, pTopicName);
taosMemoryFree(pParamSet);
pCommitFp(tmq, TSDB_CODE_SUCCESS, userParam);
return;
@@ -641,7 +641,7 @@ static void asyncCommitOffset(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* p
taosMemoryFree(pParamSet);
pCommitFp(tmq, code, userParam);
}
- } else { // do not perform commit, callback user function directly.
+ } else { // do not perform commit, callback user function directly.
taosMemoryFree(pParamSet);
pCommitFp(tmq, code, userParam);
}
@@ -686,7 +686,7 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
// update the offset value.
pVg->committedOffset = pVg->currentOffset;
} else {
- tscDebug("consumer:0x%" PRIx64 " topic:%s vgId:%d, not commit, current:%" PRId64 ", ordinal:%d/%d",
+ tscDebug("consumer:0x%" PRIx64 " topic:%s vgId:%d, no commit, current:%" PRId64 ", ordinal:%d/%d",
tmq->consumerId, pTopic->topicName, pVg->vgId, pVg->currentOffset.version, j + 1, numOfVgroups);
}
}
@@ -754,7 +754,7 @@ int32_t tmqHbCb(void* param, SDataBuf* pMsg, int32_t code) {
void tmqSendHbReq(void* param, void* tmrId) {
int64_t refId = *(int64_t*)param;
- tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
+ tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
if (tmq == NULL) {
taosMemoryFree(param);
return;
@@ -812,7 +812,7 @@ OVER:
static void defaultCommitCbFn(tmq_t* pTmq, int32_t code, void* param) {
if (code != 0) {
- tscDebug("consumer:0x%"PRIx64", failed to commit offset, code:%s", pTmq->consumerId, tstrerror(code));
+ tscDebug("consumer:0x%" PRIx64 ", failed to commit offset, code:%s", pTmq->consumerId, tstrerror(code));
}
}
@@ -839,7 +839,7 @@ int32_t tmqHandleAllDelayedTask(tmq_t* pTmq) {
tscDebug("consumer:0x%" PRIx64 " retrieve ep from mnode in 1s", pTmq->consumerId);
taosTmrReset(tmqAssignAskEpTask, 1000, pRefId, tmqMgmt.timer, &pTmq->epTimer);
} else if (*pTaskType == TMQ_DELAYED_TASK__COMMIT) {
- tmq_commit_cb* pCallbackFn = pTmq->commitCb? pTmq->commitCb:defaultCommitCbFn;
+ tmq_commit_cb* pCallbackFn = pTmq->commitCb ? pTmq->commitCb : defaultCommitCbFn;
asyncCommitAllOffsets(pTmq, pCallbackFn, pTmq->commitCbUserParam);
int64_t* pRefId = taosMemoryMalloc(sizeof(int64_t));
@@ -1028,8 +1028,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
if (pTmq->clientTopics == NULL || pTmq->mqueue == NULL || pTmq->qall == NULL || pTmq->delayedTask == NULL ||
conf->groupId[0] == 0) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
- tscError("consumer:0x%" PRIx64 " setup failed since %s, groupId:%s", pTmq->consumerId, terrstr(),
- pTmq->groupId);
+ tscError("consumer:0x%" PRIx64 " setup failed since %s, groupId:%s", pTmq->consumerId, terrstr(), pTmq->groupId);
goto _failed;
}
@@ -1083,9 +1082,10 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
char buf[80] = {0};
STqOffsetVal offset = {.type = pTmq->resetOffsetCfg};
tFormatOffset(buf, tListLen(buf), &offset);
- tscInfo("consumer:0x%" PRIx64 " is setup, refId:%"PRId64", groupId:%s, snapshot:%d, autoCommit:%d, commitInterval:%dms, offset:%s, backgroudHB:%d",
- pTmq->consumerId, pTmq->refId, pTmq->groupId, pTmq->useSnapshot, pTmq->autoCommit, pTmq->autoCommitInterval, buf,
- pTmq->hbBgEnable);
+ tscInfo("consumer:0x%" PRIx64 " is setup, refId:%" PRId64
+ ", groupId:%s, snapshot:%d, autoCommit:%d, commitInterval:%dms, offset:%s, backgroudHB:%d",
+ pTmq->consumerId, pTmq->refId, pTmq->groupId, pTmq->useSnapshot, pTmq->autoCommit, pTmq->autoCommitInterval,
+ buf, pTmq->hbBgEnable);
return pTmq;
@@ -1258,7 +1258,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
if (code == TSDB_CODE_TMQ_CONSUMER_MISMATCH) {
taosMsleep(500);
atomic_store_8(&tmq->status, TMQ_CONSUMER_STATUS__RECOVER);
- tscDebug("consumer:0x%" PRIx64" wait for the re-balance, wait for 500ms and set status to be RECOVER", tmq->consumerId);
+ tscDebug("consumer:0x%" PRIx64 " wait for the re-balance, wait for 500ms and set status to be RECOVER",
+ tmq->consumerId);
} else if (code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) {
SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0);
if (pRspWrapper == NULL) {
@@ -1278,7 +1279,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
int32_t tmqEpoch = atomic_load_32(&tmq->epoch);
if (msgEpoch < tmqEpoch) {
// do not write into queue since updating epoch reset
- tscWarn("consumer:0x%" PRIx64 " msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d, reqId:0x%"PRIx64,
+ tscWarn("consumer:0x%" PRIx64
+ " msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d, reqId:0x%" PRIx64,
tmq->consumerId, vgId, msgEpoch, tmqEpoch, requestId);
tsem_post(&tmq->rspSem);
@@ -1301,7 +1303,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
if (pRspWrapper == NULL) {
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
- tscWarn("consumer:0x%"PRIx64" msg discard from vgId:%d, epoch %d since out of memory", tmq->consumerId, vgId, epoch);
+ tscWarn("consumer:0x%" PRIx64 " msg discard from vgId:%d, epoch %d since out of memory", tmq->consumerId, vgId,
+ epoch);
goto CREATE_MSG_FAIL;
}
@@ -1336,8 +1339,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
tDecodeSTaosxRsp(&decoder, &pRspWrapper->taosxRsp);
tDecoderClear(&decoder);
memcpy(&pRspWrapper->taosxRsp, pMsg->pData, sizeof(SMqRspHead));
- } else { // invalid rspType
- tscError("consumer:0x%"PRIx64" invalid rsp msg received, type:%d ignored", tmq->consumerId, rspType);
+ } else { // invalid rspType
+ tscError("consumer:0x%" PRIx64 " invalid rsp msg received, type:%d ignored", tmq->consumerId, rspType);
}
taosMemoryFree(pMsg->pData);
@@ -1373,7 +1376,7 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
pTopicEp->schema.nCols = 0;
pTopicEp->schema.pSchema = NULL;
- char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
+ char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
int32_t vgNumGet = taosArrayGetSize(pTopicEp->vgs);
tstrncpy(pTopic->topicName, pTopicEp->topic, TSDB_TOPIC_FNAME_LEN);
@@ -1388,8 +1391,8 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
makeTopicVgroupKey(vgKey, pTopic->topicName, pVgEp->vgId);
SVgroupSaveInfo* pInfo = taosHashGet(pVgOffsetHashMap, vgKey, strlen(vgKey));
- int64_t numOfRows = 0;
- STqOffsetVal offsetNew = {.type = tmq->resetOffsetCfg};
+ int64_t numOfRows = 0;
+ STqOffsetVal offsetNew = {.type = tmq->resetOffsetCfg};
if (pInfo != NULL) {
offsetNew = pInfo->offset;
numOfRows = pInfo->numOfRows;
@@ -1453,8 +1456,8 @@ static bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) {
char buf[80];
tFormatOffset(buf, 80, &pVgCur->currentOffset);
- tscDebug("consumer:0x%" PRIx64 ", epoch:%d vgId:%d vgKey:%s, offset:%s", tmq->consumerId, epoch,
- pVgCur->vgId, vgKey, buf);
+ tscDebug("consumer:0x%" PRIx64 ", epoch:%d vgId:%d vgKey:%s, offset:%s", tmq->consumerId, epoch, pVgCur->vgId,
+ vgKey, buf);
SVgroupSaveInfo info = {.offset = pVgCur->currentOffset, .numOfRows = pVgCur->numOfRows};
taosHashPut(pVgOffsetHashMap, vgKey, strlen(vgKey), &info, sizeof(SVgroupSaveInfo));
@@ -1480,7 +1483,7 @@ static bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) {
tmq->clientTopics = newTopics;
taosThreadMutexUnlock(&tmq->lock);
- int8_t flag = (topicNumGet == 0)? TMQ_CONSUMER_STATUS__NO_TOPIC:TMQ_CONSUMER_STATUS__READY;
+ int8_t flag = (topicNumGet == 0) ? TMQ_CONSUMER_STATUS__NO_TOPIC : TMQ_CONSUMER_STATUS__READY;
atomic_store_8(&tmq->status, flag);
atomic_store_32(&tmq->epoch, epoch);
@@ -1490,7 +1493,7 @@ static bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) {
int32_t askEpCallbackFn(void* param, SDataBuf* pMsg, int32_t code) {
SMqAskEpCbParam* pParam = (SMqAskEpCbParam*)param;
- tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, pParam->refId);
+ tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, pParam->refId);
if (tmq == NULL) {
terrno = TSDB_CODE_TMQ_CONSUMER_CLOSED;
@@ -1593,9 +1596,9 @@ SMqRspObj* tmqBuildRspFromWrapper(SMqPollRspWrapper* pWrapper, SMqClientVg* pVg,
}
// extract the rows in this data packet
- for(int32_t i = 0; i < pRspObj->rsp.blockNum; ++i) {
+ for (int32_t i = 0; i < pRspObj->rsp.blockNum; ++i) {
SRetrieveTableRsp* pRetrieve = (SRetrieveTableRsp*)taosArrayGetP(pRspObj->rsp.blockData, i);
- int64_t rows = htobe64(pRetrieve->numOfRows);
+ int64_t rows = htobe64(pRetrieve->numOfRows);
pVg->numOfRows += rows;
(*numOfRows) += rows;
}
@@ -1682,8 +1685,8 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
char offsetFormatBuf[80];
tFormatOffset(offsetFormatBuf, tListLen(offsetFormatBuf), &pVg->currentOffset);
- tscDebug("consumer:0x%" PRIx64 " send poll to %s vgId:%d, epoch %d, req:%s, reqId:0x%" PRIx64,
- pTmq->consumerId, pTopic->topicName, pVg->vgId, pTmq->epoch, offsetFormatBuf, req.reqId);
+ tscDebug("consumer:0x%" PRIx64 " send poll to %s vgId:%d, epoch %d, req:%s, reqId:0x%" PRIx64, pTmq->consumerId,
+ pTopic->topicName, pVg->vgId, pTmq->epoch, offsetFormatBuf, req.reqId);
asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
pVg->pollCnt++;
@@ -1703,9 +1706,9 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
for (int j = 0; j < numOfVg; j++) {
SMqClientVg* pVg = taosArrayGet(pTopic->vgs, j);
- if (taosGetTimestampMs() - pVg->emptyBlockReceiveTs < EMPTY_BLOCK_POLL_IDLE_DURATION) { // less than 100ms
- tscTrace("consumer:0x%" PRIx64 " epoch %d, vgId:%d idle for 10ms before start next poll", tmq->consumerId, tmq->epoch,
- pVg->vgId);
+ if (taosGetTimestampMs() - pVg->emptyBlockReceiveTs < EMPTY_BLOCK_POLL_IDLE_DURATION) { // less than 100ms
+ tscTrace("consumer:0x%" PRIx64 " epoch %d, vgId:%d idle for 10ms before start next poll", tmq->consumerId,
+ tmq->epoch, pVg->vgId);
continue;
}
@@ -1771,7 +1774,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
}
}
- tscDebug("consumer:0x%"PRIx64" handle rsp, type:%d", tmq->consumerId, pRspWrapper->tmqRspType);
+ tscDebug("consumer:0x%" PRIx64 " handle rsp, type:%d", tmq->consumerId, pRspWrapper->tmqRspType);
if (pRspWrapper->tmqRspType == TMQ_MSG_TYPE__END_RSP) {
taosFreeQitem(pRspWrapper);
@@ -1781,7 +1784,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
} else if (pRspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) {
SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)pRspWrapper;
- int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
+ int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
SMqDataRsp* pDataRsp = &pollRspWrapper->dataRsp;
if (pDataRsp->head.epoch == consumerEpoch) {
@@ -1791,8 +1794,8 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
if (pollRspWrapper->pEpset != NULL) {
SEp* pEp = GET_ACTIVE_EP(pollRspWrapper->pEpset);
SEp* pOld = GET_ACTIVE_EP(&(pVg->epSet));
- tscDebug("consumer:0x%" PRIx64 " update epset vgId:%d, ep:%s:%d, old ep:%s:%d", tmq->consumerId,
- pVg->vgId, pEp->fqdn, pEp->port, pOld->fqdn, pOld->port);
+ tscDebug("consumer:0x%" PRIx64 " update epset vgId:%d, ep:%s:%d, old ep:%s:%d", tmq->consumerId, pVg->vgId,
+ pEp->fqdn, pEp->port, pOld->fqdn, pOld->port);
pVg->epSet = *pollRspWrapper->pEpset;
}
@@ -1803,12 +1806,13 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
char buf[80];
tFormatOffset(buf, 80, &pDataRsp->rspOffset);
if (pDataRsp->blockNum == 0) {
- tscDebug("consumer:0x%" PRIx64 " empty block received, vgId:%d, offset:%s, vg total:%"PRId64" total:%"PRId64" reqId:0x%" PRIx64, tmq->consumerId,
- pVg->vgId, buf, pVg->numOfRows, tmq->totalRows, pollRspWrapper->reqId);
+ tscDebug("consumer:0x%" PRIx64 " empty block received, vgId:%d, offset:%s, vg total:%" PRId64
+ " total:%" PRId64 " reqId:0x%" PRIx64,
+ tmq->consumerId, pVg->vgId, buf, pVg->numOfRows, tmq->totalRows, pollRspWrapper->reqId);
pRspWrapper = tmqFreeRspWrapper(pRspWrapper);
taosFreeQitem(pollRspWrapper);
} else { // build rsp
- int64_t numOfRows = 0;
+ int64_t numOfRows = 0;
SMqRspObj* pRsp = tmqBuildRspFromWrapper(pollRspWrapper, pVg, &numOfRows);
tmq->totalRows += numOfRows;
@@ -1847,7 +1851,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
}
} else if (pRspWrapper->tmqRspType == TMQ_MSG_TYPE__TAOSX_RSP) {
SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)pRspWrapper;
- int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
+ int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
if (pollRspWrapper->taosxRsp.head.epoch == consumerEpoch) {
SMqClientVg* pVg = pollRspWrapper->vgHandle;
@@ -1862,11 +1866,11 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
taosFreeQitem(pollRspWrapper);
continue;
} else {
- pVg->emptyBlockReceiveTs = 0; // reset the ts
+ pVg->emptyBlockReceiveTs = 0; // reset the ts
}
// build rsp
- void* pRsp = NULL;
+ void* pRsp = NULL;
int64_t numOfRows = 0;
if (pollRspWrapper->taosxRsp.createTableNum == 0) {
pRsp = tmqBuildRspFromWrapper(pollRspWrapper, pVg, &numOfRows);
@@ -1879,7 +1883,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
char buf[80];
tFormatOffset(buf, 80, &pVg->currentOffset);
tscDebug("consumer:0x%" PRIx64 " process taosx poll rsp, vgId:%d, offset:%s, blocks:%d, rows:%" PRId64
- ", vg total:%" PRId64 " total:%"PRId64" reqId:0x%" PRIx64,
+ ", vg total:%" PRId64 " total:%" PRId64 " reqId:0x%" PRIx64,
tmq->consumerId, pVg->vgId, buf, pollRspWrapper->dataRsp.blockNum, numOfRows, pVg->numOfRows,
tmq->totalRows, pollRspWrapper->reqId);
@@ -1910,7 +1914,8 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
void* rspObj;
int64_t startTime = taosGetTimestampMs();
- tscDebug("consumer:0x%" PRIx64 " start to poll at %"PRId64", timeout:%" PRId64, tmq->consumerId, startTime, timeout);
+ tscDebug("consumer:0x%" PRIx64 " start to poll at %" PRId64 ", timeout:%" PRId64, tmq->consumerId, startTime,
+ timeout);
#if 0
tmqHandleAllDelayedTask(tmq);
@@ -1993,7 +1998,7 @@ static void displayConsumeStatistics(const tmq_t* pTmq) {
}
int32_t tmq_consumer_close(tmq_t* tmq) {
- tscDebug("consumer:0x%" PRIx64" start to close consumer, status:%d", tmq->consumerId, tmq->status);
+ tscDebug("consumer:0x%" PRIx64 " start to close consumer, status:%d", tmq->consumerId, tmq->status);
displayConsumeStatistics(tmq);
if (tmq->status == TMQ_CONSUMER_STATUS__READY) {
@@ -2019,7 +2024,7 @@ int32_t tmq_consumer_close(tmq_t* tmq) {
tmq_list_destroy(lst);
} else {
- tscWarn("consumer:0x%" PRIx64" not in ready state, close it directly", tmq->consumerId);
+ tscWarn("consumer:0x%" PRIx64 " not in ready state, close it directly", tmq->consumerId);
}
taosRemoveRef(tmqMgmt.rsetId, tmq->refId);
@@ -2125,8 +2130,8 @@ typedef struct SSyncCommitInfo {
int32_t code;
} SSyncCommitInfo;
-static void commitCallBackFn(tmq_t *pTmq, int32_t code, void* param) {
- SSyncCommitInfo* pInfo = (SSyncCommitInfo*) param;
+static void commitCallBackFn(tmq_t* pTmq, int32_t code, void* param) {
+ SSyncCommitInfo* pInfo = (SSyncCommitInfo*)param;
pInfo->code = code;
tsem_post(&pInfo->sem);
}
@@ -2150,7 +2155,7 @@ int32_t tmq_commit_sync(tmq_t* tmq, const TAOS_RES* pRes) {
tsem_destroy(&pInfo->sem);
taosMemoryFree(pInfo);
- tscDebug("consumer:0x%"PRIx64" sync commit done, code:%s", tmq->consumerId, tstrerror(code));
+ tscDebug("consumer:0x%" PRIx64 " sync commit done, code:%s", tmq->consumerId, tstrerror(code));
return code;
}
@@ -2255,7 +2260,7 @@ void asyncAskEp(tmq_t* pTmq, __tmq_askep_fn_t askEpFn, void* param) {
return;
}
- sendInfo->msgInfo = (SDataBuf){ .pData = pReq, .len = tlen, .handle = NULL };
+ sendInfo->msgInfo = (SDataBuf){.pData = pReq, .len = tlen, .handle = NULL};
sendInfo->requestId = generateRequestId();
sendInfo->requestObjRefId = 0;
diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp
index 6cb89c13ecce538c0b6cf0c342bb0b5866ad9c37..517d8e0221136cab9c1075ee06d6e98106b4f7ca 100644
--- a/source/client/test/clientTests.cpp
+++ b/source/client/test/clientTests.cpp
@@ -52,15 +52,15 @@ void printResult(TAOS_RES* pRes) {
int32_t n = 0;
char str[512] = {0};
while ((pRow = taos_fetch_row(pRes)) != NULL) {
-// int32_t* length = taos_fetch_lengths(pRes);
-// for(int32_t i = 0; i < numOfFields; ++i) {
-// printf("(%d):%d " , i, length[i]);
-// }
-// printf("\n");
-//
-// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
-// printf("%s\n", str);
-// memset(str, 0, sizeof(str));
+ // int32_t* length = taos_fetch_lengths(pRes);
+ // for(int32_t i = 0; i < numOfFields; ++i) {
+ // printf("(%d):%d " , i, length[i]);
+ // }
+ // printf("\n");
+ //
+ // int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
+ // printf("%s\n", str);
+ // memset(str, 0, sizeof(str));
}
}
@@ -112,7 +112,7 @@ void createNewTable(TAOS* pConn, int32_t index) {
}
taos_free_result(pRes);
- for(int32_t i = 0; i < 100; i += 20) {
+ for (int32_t i = 0; i < 100; i += 20) {
char sql[1024] = {0};
sprintf(sql,
"insert into tu%d values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
@@ -131,7 +131,7 @@ void createNewTable(TAOS* pConn, int32_t index) {
}
}
-void *queryThread(void *arg) {
+void* queryThread(void* arg) {
TAOS* pConn = taos_connect("192.168.0.209", "root", "taosdata", NULL, 0);
if (pConn == NULL) {
printf("failed to connect to db, reason:%s", taos_errstr(pConn));
@@ -141,9 +141,10 @@ void *queryThread(void *arg) {
int64_t el = 0;
for (int32_t i = 0; i < 5000000; ++i) {
- int64_t st = taosGetTimestampUs();
+ int64_t st = taosGetTimestampUs();
TAOS_RES* pRes = taos_query(pConn,
- "SELECT _wstart as ts,max(usage_user) FROM benchmarkcpu.host_49 WHERE ts >= 1451618560000 AND ts < 1451622160000 INTERVAL(1m) ;");
+ "SELECT _wstart as ts,max(usage_user) FROM benchmarkcpu.host_49 WHERE ts >= "
+ "1451618560000 AND ts < 1451622160000 INTERVAL(1m) ;");
if (taos_errno(pRes) != 0) {
printf("failed, reason:%s\n", taos_errstr(pRes));
} else {
@@ -153,7 +154,7 @@ void *queryThread(void *arg) {
taos_free_result(pRes);
el += (taosGetTimestampUs() - st);
if (i % 1000 == 0 && i != 0) {
- printf("total:%d, avg time:%.2fms\n", i, el/(double)(i*1000));
+ printf("total:%d, avg time:%.2fms\n", i, el / (double)(i * 1000));
}
}
@@ -163,9 +164,7 @@ void *queryThread(void *arg) {
static int32_t numOfThreads = 1;
-void tmq_commit_cb_print(tmq_t *pTmq, int32_t code, void *param) {
- printf("success, code:%d\n", code);
-}
+void tmq_commit_cb_print(tmq_t* pTmq, int32_t code, void* param) { printf("success, code:%d\n", code); }
void* doConsumeData(void* param) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
@@ -205,7 +204,7 @@ void* doConsumeData(void* param) {
while (1) {
TAOS_RES* pRes = tmq_consumer_poll(tmq, timeout);
if (pRes) {
- char buf[1024];
+ char buf[1024];
const char* topicName = tmq_get_topic_name(pRes);
const char* dbName = tmq_get_db_name(pRes);
@@ -226,7 +225,7 @@ void* doConsumeData(void* param) {
precision = taos_result_precision(pRes);
taos_print_row(buf, row, fields, numOfFields);
totalRows += 1;
-// printf("precision: %d, row content: %s\n", precision, buf);
+ // printf("precision: %d, row content: %s\n", precision, buf);
}
taos_free_result(pRes);
@@ -491,17 +490,17 @@ TEST(clientCase, create_stable_Test) {
ASSERT_EQ(numOfFields, 0);
taos_free_result(pRes);
-// pRes = taos_query(pConn, "create stable if not exists abc1.`123_$^)` (ts timestamp, `abc` int) tags(a int)");
-// if (taos_errno(pRes) != 0) {
-// printf("failed to create super table 123_$^), reason:%s\n", taos_errstr(pRes));
-// }
-//
-// pRes = taos_query(pConn, "use abc1");
-// taos_free_result(pRes);
-// pRes = taos_query(pConn, "drop stable `123_$^)`");
-// if (taos_errno(pRes) != 0) {
-// printf("failed to drop super table 123_$^), reason:%s\n", taos_errstr(pRes));
-// }
+ // pRes = taos_query(pConn, "create stable if not exists abc1.`123_$^)` (ts timestamp, `abc` int) tags(a int)");
+ // if (taos_errno(pRes) != 0) {
+ // printf("failed to create super table 123_$^), reason:%s\n", taos_errstr(pRes));
+ // }
+ //
+ // pRes = taos_query(pConn, "use abc1");
+ // taos_free_result(pRes);
+ // pRes = taos_query(pConn, "drop stable `123_$^)`");
+ // if (taos_errno(pRes) != 0) {
+ // printf("failed to drop super table 123_$^), reason:%s\n", taos_errstr(pRes));
+ // }
taos_close(pConn);
}
@@ -666,8 +665,7 @@ TEST(clientCase, create_multiple_tables) {
for (int32_t i = 0; i < 500; i += 2) {
char sql[512] = {0};
- snprintf(sql, tListLen(sql),
- "create table t_x_%d using st1 tags(2) t_x_%d using st1 tags(5)", i, i + 1);
+ snprintf(sql, tListLen(sql), "create table t_x_%d using st1 tags(2) t_x_%d using st1 tags(5)", i, i + 1);
TAOS_RES* pres = taos_query(pConn, sql);
if (taos_errno(pres) != 0) {
printf("failed to create table %d\n, reason:%s", i, taos_errstr(pres));
@@ -701,7 +699,7 @@ TEST(clientCase, show_table_Test) {
int32_t numOfFields = taos_num_fields(pRes);
int32_t count = 0;
- char str[512] = {0};
+ char str[512] = {0};
while ((pRow = taos_fetch_row(pRes)) != NULL) {
int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
@@ -712,30 +710,30 @@ TEST(clientCase, show_table_Test) {
taos_close(pConn);
}
-//TEST(clientCase, drop_stable_Test) {
-// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
-// assert(pConn != nullptr);
+// TEST(clientCase, drop_stable_Test) {
+// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
+// assert(pConn != nullptr);
//
-// TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1");
-// if (taos_errno(pRes) != 0) {
-// printf("error in creating db, reason:%s\n", taos_errstr(pRes));
-// }
-// taos_free_result(pRes);
+// TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1");
+// if (taos_errno(pRes) != 0) {
+// printf("error in creating db, reason:%s\n", taos_errstr(pRes));
+// }
+// taos_free_result(pRes);
//
-// pRes = taos_query(pConn, "use abc1");
-// if (taos_errno(pRes) != 0) {
-// printf("error in using db, reason:%s\n", taos_errstr(pRes));
-// }
-// taos_free_result(pRes);
+// pRes = taos_query(pConn, "use abc1");
+// if (taos_errno(pRes) != 0) {
+// printf("error in using db, reason:%s\n", taos_errstr(pRes));
+// }
+// taos_free_result(pRes);
//
-// pRes = taos_query(pConn, "drop stable st1");
-// if (taos_errno(pRes) != 0) {
-// printf("failed to drop stable, reason:%s\n", taos_errstr(pRes));
-// }
+// pRes = taos_query(pConn, "drop stable st1");
+// if (taos_errno(pRes) != 0) {
+// printf("failed to drop stable, reason:%s\n", taos_errstr(pRes));
+// }
//
-// taos_free_result(pRes);
-// taos_close(pConn);
-//}
+// taos_free_result(pRes);
+// taos_close(pConn);
+// }
TEST(clientCase, generated_request_id_test) {
SHashObj* phash = taosHashInit(10000, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_ENTRY_LOCK);
@@ -744,7 +742,7 @@ TEST(clientCase, generated_request_id_test) {
uint64_t v = generateRequestId();
void* result = taosHashGet(phash, &v, sizeof(v));
if (result != nullptr) {
-// printf("0x%llx, index:%d\n", v, i);
+ // printf("0x%llx, index:%d\n", v, i);
}
assert(result == nullptr);
taosHashPut(phash, &v, sizeof(v), NULL, 0);
@@ -832,7 +830,7 @@ TEST(clientCase, projection_query_tables) {
TEST(clientCase, tsbs_perf_test) {
TdThread qid[20] = {0};
- for(int32_t i = 0; i < numOfThreads; ++i) {
+ for (int32_t i = 0; i < numOfThreads; ++i) {
taosThreadCreate(&qid[i], NULL, queryThread, NULL);
}
getchar();
@@ -858,8 +856,8 @@ TEST(clientCase, projection_query_stables) {
char str[512] = {0};
while ((pRow = taos_fetch_row(pRes)) != NULL) {
-// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
-// printf("%s\n", str);
+ // int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
+ // printf("%s\n", str);
}
taos_free_result(pRes);
@@ -898,7 +896,8 @@ use test;
create table m1(ts timestamp, k int) tags(a int);
create table tm0 using m1 tags(1);
create table tm1 using m1 tags(2);
-insert into tm0 values('2021-1-1 1:1:1.120', 1) ('2021-1-1 1:1:2.9', 2) tm1 values('2021-1-1 1:1:1.120', 11) ('2021-1-1 1:1:2.99', 22);
+insert into tm0 values('2021-1-1 1:1:1.120', 1) ('2021-1-1 1:1:2.9', 2) tm1 values('2021-1-1 1:1:1.120', 11) ('2021-1-1
+1:1:2.99', 22);
*/
TEST(clientCase, async_api_test) {
@@ -912,7 +911,7 @@ TEST(clientCase, async_api_test) {
printf("failed, reason:%s\n", taos_errstr(pRes));
}
- int32_t n = 0;
+ int32_t n = 0;
TAOS_ROW pRow = NULL;
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
int32_t numOfFields = taos_num_fields(pRes);
@@ -920,8 +919,8 @@ TEST(clientCase, async_api_test) {
char str[512] = {0};
while ((pRow = taos_fetch_row(pRes)) != NULL) {
int32_t* length = taos_fetch_lengths(pRes);
- for(int32_t i = 0; i < numOfFields; ++i) {
- printf("(%d):%d " , i, length[i]);
+ for (int32_t i = 0; i < numOfFields; ++i) {
+ printf("(%d):%d ", i, length[i]);
}
printf("\n");
@@ -963,8 +962,8 @@ TEST(clientCase, update_test) {
taos_free_result(pRes);
- char s[256] = {0};
- for(int32_t i = 0; i < 17000; ++i) {
+ char s[256] = {0};
+ for (int32_t i = 0; i < 17000; ++i) {
sprintf(s, "insert into tup values(now+%da, %d)", i, i);
pRes = taos_query(pConn, s);
taos_free_result(pRes);
@@ -1028,7 +1027,7 @@ TEST(clientCase, sub_db_test) {
printf("db: %s\n", dbName);
printf("vgroup id: %d\n", vgroupId);
- if (count ++ > 200) {
+ if (count++ > 200) {
tmq_unsubscribe(tmq);
break;
}
@@ -1092,7 +1091,7 @@ TEST(clientCase, sub_tb_test) {
while (1) {
TAOS_RES* pRes = tmq_consumer_poll(tmq, timeout);
if (pRes) {
- char buf[1024];
+ char buf[1024];
const char* topicName = tmq_get_topic_name(pRes);
const char* dbName = tmq_get_db_name(pRes);
@@ -1117,9 +1116,9 @@ TEST(clientCase, sub_tb_test) {
}
taos_free_result(pRes);
-// if ((++count) > 1) {
-// break;
-// }
+ // if ((++count) > 1) {
+ // break;
+ // }
} else {
break;
}
@@ -1134,11 +1133,11 @@ TEST(clientCase, sub_tb_mt_test) {
taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg");
TdThread qid[20] = {0};
- for(int32_t i = 0; i < 1; ++i) {
+ for (int32_t i = 0; i < 1; ++i) {
taosThreadCreate(&qid[i], NULL, doConsumeData, NULL);
}
- for(int32_t i = 0; i < 4; ++i) {
+ for (int32_t i = 0; i < 4; ++i) {
taosThreadJoin(qid[i], NULL);
}
}
diff --git a/source/common/src/systable.c b/source/common/src/systable.c
index 919a09962bba4960fb44727c066a9ba0c8d53b9b..2c1598016719169dfddb4423f9b59c9469d37b3f 100644
--- a/source/common/src/systable.c
+++ b/source/common/src/systable.c
@@ -114,6 +114,8 @@ static const SSysDbTableSchema userFuncSchema[] = {
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false},
{.name = "code_len", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
{.name = "bufsize", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
+ {.name = "func_language", .bytes = TSDB_TYPE_STR_MAX_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},
+ {.name = "func_body", .bytes = TSDB_MAX_BINARY_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},
};
static const SSysDbTableSchema userIdxSchema[] = {
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index a65f30f0235e60c4aaf4a2535efe4993afe07c69..e021e655496cd9f94e787ebfcb00a958519fb50c 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -1836,7 +1836,9 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) {
}
}
struct tm ptm = {0};
- taosLocalTime(&tt, &ptm);
+ if (taosLocalTime(&tt, &ptm, buf) == NULL) {
+ return buf;
+ }
size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm);
if (precision == TSDB_TIME_PRECISION_NANO) {
diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c
index aeeec1d61ce8b9fb307ba870d2a3872e7b5641e2..1c2d53397740f6cffc711467c7bf9ca491ae8ed6 100644
--- a/source/common/src/tglobal.c
+++ b/source/common/src/tglobal.c
@@ -228,7 +228,11 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *input
taosExpandDir(inputCfgDir, cfgDir, PATH_MAX);
if (taosIsDir(cfgDir)) {
+#ifdef CUS_PROMPT
+ snprintf(cfgFile, sizeof(cfgFile), "%s" TD_DIRSEP "%s.cfg", CUS_PROMPT, cfgDir);
+#else
snprintf(cfgFile, sizeof(cfgFile), "%s" TD_DIRSEP "taos.cfg", cfgDir);
+#endif
} else {
tstrncpy(cfgFile, cfgDir, sizeof(cfgDir));
}
diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c
index 7a238440a70e32fbc0084b2bf4f9fbb2c2396a26..c37c0e830ace93b78d95650e38f915fe96f48c34 100644
--- a/source/common/src/tmsg.c
+++ b/source/common/src/tmsg.c
@@ -1150,7 +1150,7 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
if (tDecodeI64(&decoder, &vload.compStorage) < 0) return -1;
if (tDecodeI64(&decoder, &vload.pointsWritten) < 0) return -1;
if (tDecodeI32(&decoder, &vload.numOfCachedTables) < 0) return -1;
- if (tDecodeI32(&decoder, (int32_t*)&reserved) < 0) return -1;
+ if (tDecodeI32(&decoder, (int32_t *)&reserved) < 0) return -1;
if (tDecodeI64(&decoder, &reserved) < 0) return -1;
if (tDecodeI64(&decoder, &reserved) < 0) return -1;
if (taosArrayPush(pReq->pVloads, &vload) == NULL) {
@@ -1702,6 +1702,8 @@ int32_t tSerializeSCreateFuncReq(void *buf, int32_t bufLen, SCreateFuncReq *pReq
if (tEncodeCStr(&encoder, pReq->pComment) < 0) return -1;
}
+ if (tEncodeI8(&encoder, pReq->orReplace) < 0) return -1;
+
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -1744,6 +1746,12 @@ int32_t tDeserializeSCreateFuncReq(void *buf, int32_t bufLen, SCreateFuncReq *pR
if (tDecodeCStrTo(&decoder, pReq->pComment) < 0) return -1;
}
+ if (!tDecodeIsEnd(&decoder)) {
+ if (tDecodeI8(&decoder, &pReq->orReplace) < 0) return -1;
+ } else {
+ pReq->orReplace = false;
+ }
+
tEndDecode(&decoder);
tDecoderClear(&decoder);
@@ -2224,7 +2232,9 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
// 1st modification
if (tEncodeI32(&encoder, pReq->minRows) < 0) return -1;
-
+ // 2nd modification
+ if (tEncodeI32(&encoder, pReq->walRetentionPeriod) < 0) return -1;
+ if (tEncodeI32(&encoder, pReq->walRetentionSize) < 0) return -1;
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -2259,6 +2269,15 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
} else {
pReq->minRows = -1;
}
+
+ // 2nd modification
+ if (!tDecodeIsEnd(&decoder)) {
+ if (tDecodeI32(&decoder, &pReq->walRetentionPeriod) < 0) return -1;
+ if (tDecodeI32(&decoder, &pReq->walRetentionSize) < 0) return -1;
+ } else {
+ pReq->walRetentionPeriod = -1;
+ pReq->walRetentionSize = -1;
+ }
tEndDecode(&decoder);
tDecoderClear(&decoder);
@@ -4189,7 +4208,9 @@ int32_t tSerializeSAlterVnodeConfigReq(void *buf, int32_t bufLen, SAlterVnodeCon
// 1st modification
if (tEncodeI16(&encoder, pReq->sttTrigger) < 0) return -1;
if (tEncodeI32(&encoder, pReq->minRows) < 0) return -1;
-
+ // 2nd modification
+ if (tEncodeI32(&encoder, pReq->walRetentionPeriod) < 0) return -1;
+ if (tEncodeI32(&encoder, pReq->walRetentionSize) < 0) return -1;
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -4228,6 +4249,14 @@ int32_t tDeserializeSAlterVnodeConfigReq(void *buf, int32_t bufLen, SAlterVnodeC
if (tDecodeI32(&decoder, &pReq->minRows) < 0) return -1;
}
+ // 2n modification
+ if (tDecodeIsEnd(&decoder)) {
+ pReq->walRetentionPeriod = -1;
+ pReq->walRetentionSize = -1;
+ } else {
+ if (tDecodeI32(&decoder, &pReq->walRetentionPeriod) < 0) return -1;
+ if (tDecodeI32(&decoder, &pReq->walRetentionSize) < 0) return -1;
+ }
tEndDecode(&decoder);
tDecoderClear(&decoder);
return 0;
@@ -4440,6 +4469,31 @@ int32_t tDeserializeSBalanceVgroupReq(void *buf, int32_t bufLen, SBalanceVgroupR
return 0;
}
+int32_t tSerializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceVgroupLeaderReq *pReq) {
+ SEncoder encoder = {0};
+ tEncoderInit(&encoder, buf, bufLen);
+
+ if (tStartEncode(&encoder) < 0) return -1;
+ if (tEncodeI32(&encoder, pReq->useless) < 0) return -1;
+ tEndEncode(&encoder);
+
+ int32_t tlen = encoder.pos;
+ tEncoderClear(&encoder);
+ return tlen;
+}
+
+int32_t tDeserializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceVgroupLeaderReq *pReq) {
+ SDecoder decoder = {0};
+ tDecoderInit(&decoder, buf, bufLen);
+
+ if (tStartDecode(&decoder) < 0) return -1;
+ if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1;
+ tEndDecode(&decoder);
+
+ tDecoderClear(&decoder);
+ return 0;
+}
+
int32_t tSerializeSMergeVgroupReq(void *buf, int32_t bufLen, SMergeVgroupReq *pReq) {
SEncoder encoder = {0};
tEncoderInit(&encoder, buf, bufLen);
@@ -4523,6 +4577,31 @@ int32_t tDeserializeSSplitVgroupReq(void *buf, int32_t bufLen, SSplitVgroupReq *
return 0;
}
+int32_t tSerializeSForceBecomeFollowerReq(void *buf, int32_t bufLen, SForceBecomeFollowerReq *pReq) {
+ SEncoder encoder = {0};
+ tEncoderInit(&encoder, buf, bufLen);
+
+ if (tStartEncode(&encoder) < 0) return -1;
+ if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1;
+ tEndEncode(&encoder);
+
+ int32_t tlen = encoder.pos;
+ tEncoderClear(&encoder);
+ return tlen;
+}
+
+int32_t tDeserializeSForceBecomeFollowerReq(void *buf, int32_t bufLen, SForceBecomeFollowerReq *pReq) {
+ SDecoder decoder = {0};
+ tDecoderInit(&decoder, buf, bufLen);
+
+ if (tStartDecode(&decoder) < 0) return -1;
+ if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1;
+ tEndDecode(&decoder);
+
+ tDecoderClear(&decoder);
+ return 0;
+}
+
int32_t tSerializeSDCreateMnodeReq(void *buf, int32_t bufLen, SDCreateMnodeReq *pReq) {
SEncoder encoder = {0};
tEncoderInit(&encoder, buf, bufLen);
@@ -6824,7 +6903,7 @@ int32_t tDecodeSMqDataRsp(SDecoder *pDecoder, SMqDataRsp *pRsp) {
}
void tDeleteSMqDataRsp(SMqDataRsp *pRsp) {
- pRsp->blockDataLen = taosArrayDestroy(pRsp->blockDataLen);;
+ pRsp->blockDataLen = taosArrayDestroy(pRsp->blockDataLen);
taosArrayDestroyP(pRsp->blockData, (FDelete)taosMemoryFree);
pRsp->blockData = NULL;
taosArrayDestroyP(pRsp->blockSchema, (FDelete)tDeleteSSchemaWrapper);
diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c
index 7996498d451f95df794fab75c644eed044d37c4b..dcd539bd91e11c570a9f779f9c1c9a3811765c41 100644
--- a/source/common/src/ttime.c
+++ b/source/common/src/ttime.c
@@ -727,7 +727,7 @@ int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision) {
struct tm tm;
time_t tt = (time_t)(t / TSDB_TICK_PER_SECOND(precision));
- taosLocalTime(&tt, &tm);
+ taosLocalTime(&tt, &tm, NULL);
int32_t mon = tm.tm_year * 12 + tm.tm_mon + (int32_t)numOfMonth;
tm.tm_year = mon / 12;
tm.tm_mon = mon % 12;
@@ -750,11 +750,11 @@ int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char
struct tm tm;
time_t t = (time_t)skey;
- taosLocalTime(&t, &tm);
+ taosLocalTime(&t, &tm, NULL);
int32_t smon = tm.tm_year * 12 + tm.tm_mon;
t = (time_t)ekey;
- taosLocalTime(&t, &tm);
+ taosLocalTime(&t, &tm, NULL);
int32_t emon = tm.tm_year * 12 + tm.tm_mon;
if (unit == 'y') {
@@ -774,7 +774,7 @@ int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precisio
start /= (int64_t)(TSDB_TICK_PER_SECOND(precision));
struct tm tm;
time_t tt = (time_t)start;
- taosLocalTime(&tt, &tm);
+ taosLocalTime(&tt, &tm, NULL);
tm.tm_sec = 0;
tm.tm_min = 0;
tm.tm_hour = 0;
@@ -867,13 +867,17 @@ const char* fmtts(int64_t ts) {
if (ts > -62135625943 && ts < 32503651200) {
time_t t = (time_t)ts;
- taosLocalTime(&t, &tm);
+ if (taosLocalTime(&t, &tm, buf) == NULL) {
+ return buf;
+ }
pos += strftime(buf + pos, sizeof(buf), "s=%Y-%m-%d %H:%M:%S", &tm);
}
if (ts > -62135625943000 && ts < 32503651200000) {
time_t t = (time_t)(ts / 1000);
- taosLocalTime(&t, &tm);
+ if (taosLocalTime(&t, &tm, buf) == NULL) {
+ return buf;
+ }
if (pos > 0) {
buf[pos++] = ' ';
buf[pos++] = '|';
@@ -885,7 +889,9 @@ const char* fmtts(int64_t ts) {
{
time_t t = (time_t)(ts / 1000000);
- taosLocalTime(&t, &tm);
+ if (taosLocalTime(&t, &tm, buf) == NULL) {
+ return buf;
+ }
if (pos > 0) {
buf[pos++] = ' ';
buf[pos++] = '|';
@@ -937,7 +943,9 @@ void taosFormatUtcTime(char* buf, int32_t bufLen, int64_t t, int32_t precision)
ASSERT(false);
}
- taosLocalTime(", &ptm);
+ if (taosLocalTime(", &ptm, buf) == NULL) {
+ return;
+ }
int32_t length = (int32_t)strftime(ts, 40, "%Y-%m-%dT%H:%M:%S", &ptm);
length += snprintf(ts + length, fractionLen, format, mod);
length += (int32_t)strftime(ts + length, 40 - length, "%z", &ptm);
diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c
index 9a092e2df50133ba68f6fc399a81d9df54a77356..f0e020edfed8136e6b7fbfc3a023c1ef2822fd01 100644
--- a/source/dnode/mgmt/exe/dmMain.c
+++ b/source/dnode/mgmt/exe/dmMain.c
@@ -20,6 +20,21 @@
#include "tglobal.h"
#include "version.h"
+#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
+#include "cus_name.h"
+#else
+#ifndef CUS_NAME
+ #define CUS_NAME "TDengine"
+#endif
+
+#ifndef CUS_PROMPT
+ #define CUS_PROMPT "taos"
+#endif
+
+#ifndef CUS_EMAIL
+ #define CUS_EMAIL ""
+#endif
+#endif
// 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\"}'."
#define DM_CFG_DIR "Configuration directory."
@@ -232,7 +247,7 @@ static void dmDumpCfg() {
}
static int32_t dmInitLog() {
- return taosCreateLog("taosdlog", 1, configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0);
+ return taosCreateLog(CUS_PROMPT"dlog", 1, configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0);
}
static void taosCleanupArgs() {
diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
index c2c9e37c8cf823ddee0f4b8b3d682f0c47e7505a..76977dd4a8178792f3867b3a615ef552c5449c1d 100644
--- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
@@ -126,6 +126,7 @@ SArray *mmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_MND_MERGE_VGROUP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_SPLIT_VGROUP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_BALANCE_VGROUP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_MND_BALANCE_VGROUP_LEADER, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_FUNC, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_RETRIEVE_FUNC, mmPutMsgToReadQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_FUNC, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
@@ -189,7 +190,6 @@ SArray *mmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_VND_DISABLE_WRITE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT_ELECTION, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST_BATCH, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST_REPLY, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
@@ -201,7 +201,10 @@ SArray *mmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_SYNC_FORCE_FOLLOWER_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
+
if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, mmPutMsgToSyncRdQueue, 1) == NULL) goto _OVER;
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
index 28cb5d2058d6d82ffe53005263c0515384fb7f29..d61eb3ec0390af04e97c2977131d8381c26b351a 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
@@ -21,7 +21,7 @@ void vmGetVnodeLoads(SVnodeMgmt *pMgmt, SMonVloadInfo *pInfo, bool isReset) {
if (pInfo->pVloads == NULL) return;
tfsUpdateSize(pMgmt->pTfs);
-
+
taosThreadRwlockRdlock(&pMgmt->lock);
void *pIter = taosHashIterate(pMgmt->hash, NULL);
@@ -550,7 +550,6 @@ SArray *vmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_DND_DROP_VNODE, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT_ELECTION, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST_BATCH, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
@@ -561,8 +560,10 @@ SArray *vmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_SYNC_FORCE_FOLLOWER, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_SYNC_PRE_SNAPSHOT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER;
diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h
index 935db099c4590c41fa759502c7a420d97492251a..876f2651bc652a128ac3bbf99a97e9cf895658f9 100644
--- a/source/dnode/mnode/impl/inc/mndDef.h
+++ b/source/dnode/mnode/impl/inc/mndDef.h
@@ -176,6 +176,7 @@ typedef struct {
char opername[TSDB_TRANS_OPER_LEN];
SArray* pRpcArray;
SRWLatch lockRpcArray;
+ int64_t mTraceId;
} STrans;
typedef struct {
diff --git a/source/dnode/mnode/impl/inc/mndTopic.h b/source/dnode/mnode/impl/inc/mndTopic.h
index 8ed7fc6a11043bddda295759d8ba59e9d26be1f8..b2b86775aba1e59ca7caecc935669eb9c53c4380 100644
--- a/source/dnode/mnode/impl/inc/mndTopic.h
+++ b/source/dnode/mnode/impl/inc/mndTopic.h
@@ -32,6 +32,7 @@ bool mndTopicExistsForDb(SMnode *pMnode, SDbObj *pDb);
const char *mndTopicGetShowName(const char topic[TSDB_TOPIC_FNAME_LEN]);
int32_t mndSetTopicCommitLogs(SMnode *pMnode, STrans *pTrans, SMqTopicObj *pTopic);
+int32_t mndGetNumOfTopics(SMnode *pMnode, char *dbName, int32_t *pNumOfTopics);
#ifdef __cplusplus
}
diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h
index d6e5d322baf28dbad41d0ea13124e1ec21588f0b..057e3efbbcabe42d43c6030973707e371ccf4fd1 100644
--- a/source/dnode/mnode/impl/inc/mndTrans.h
+++ b/source/dnode/mnode/impl/inc/mndTrans.h
@@ -52,6 +52,8 @@ typedef struct {
int32_t contLen;
void *pCont;
SSdbRaw *pRaw;
+
+ int64_t mTraceId;
} STransAction;
typedef void (*TransCbFp)(SMnode *pMnode, void *param, int32_t paramLen);
diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c
index 68670eedfbd6ed9e1672af0dcdb999f51d13703e..8f1cfbff931d74df3dab3f6f3fb9669894811876 100644
--- a/source/dnode/mnode/impl/src/mndConsumer.c
+++ b/source/dnode/mnode/impl/src/mndConsumer.c
@@ -81,9 +81,7 @@ bool mndRebTryStart() {
return old == 0;
}
-void mndRebEnd() {
- mndRebCntDec();
-}
+void mndRebEnd() { mndRebCntDec(); }
void mndRebCntInc() {
int32_t val = atomic_add_fetch_32(&mqRebInExecCnt, 1);
@@ -247,8 +245,8 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
return pRebInfo;
}
-static void freeRebalanceItem(void* param) {
- SMqRebInfo* pInfo = param;
+static void freeRebalanceItem(void *param) {
+ SMqRebInfo *pInfo = param;
taosArrayDestroy(pInfo->lostConsumers);
taosArrayDestroy(pInfo->newConsumers);
taosArrayDestroy(pInfo->removedConsumers);
@@ -270,7 +268,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
SMqDoRebalanceMsg *pRebMsg = rpcMallocCont(sizeof(SMqDoRebalanceMsg));
if (pRebMsg == NULL) {
- mError("failed to create the rebalance msg, size:%d, quit mq timer", (int32_t) sizeof(SMqDoRebalanceMsg));
+ mError("failed to create the rebalance msg, size:%d, quit mq timer", (int32_t)sizeof(SMqDoRebalanceMsg));
mndRebEnd();
return TSDB_CODE_OUT_OF_MEMORY;
}
@@ -596,7 +594,7 @@ int32_t mndSetConsumerCommitLogs(SMnode *pMnode, STrans *pTrans, SMqConsumerObj
return 0;
}
-static int32_t validateTopics(const SArray* pTopicList, SMnode* pMnode, const char* pUser) {
+static int32_t validateTopics(const SArray *pTopicList, SMnode *pMnode, const char *pUser) {
int32_t numOfTopics = taosArrayGetSize(pTopicList);
for (int32_t i = 0; i < numOfTopics; i++) {
@@ -617,12 +615,10 @@ static int32_t validateTopics(const SArray* pTopicList, SMnode* pMnode, const ch
return 0;
}
-static void* topicNameDup(void* p){
- return taosStrdup((char*) p);
-}
+static void *topicNameDup(void *p) { return taosStrdup((char *)p); }
-static void freeItem(void* param) {
- void* pItem = *(void**)param;
+static void freeItem(void *param) {
+ void *pItem = *(void **)param;
if (pItem != NULL) {
taosMemoryFree(pItem);
}
@@ -660,8 +656,8 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
pExistedConsumer = mndAcquireConsumer(pMnode, consumerId);
if (pExistedConsumer == NULL) {
- mInfo("receive subscribe request from new consumer:0x%" PRIx64" cgroup:%s, numOfTopics:%d", consumerId,
- subscribe.cgroup, (int32_t) taosArrayGetSize(pTopicList));
+ mInfo("receive subscribe request from new consumer:0x%" PRIx64 " cgroup:%s, numOfTopics:%d", consumerId,
+ subscribe.cgroup, (int32_t)taosArrayGetSize(pTopicList));
pConsumerNew = tNewSMqConsumerObj(consumerId, cgroup);
tstrncpy(pConsumerNew->clientId, subscribe.clientId, tListLen(pConsumerNew->clientId));
@@ -683,8 +679,9 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
/*taosRLockLatch(&pExistedConsumer->lock);*/
int32_t status = atomic_load_32(&pExistedConsumer->status);
- mInfo("receive subscribe request from existed consumer:0x%" PRIx64 " cgroup:%s, current status:%d(%s), subscribe topic num: %d",
- consumerId, subscribe.cgroup, status,mndConsumerStatusName(status), newTopicNum);
+ mInfo("receive subscribe request from existed consumer:0x%" PRIx64
+ " cgroup:%s, current status:%d(%s), subscribe topic num: %d",
+ consumerId, subscribe.cgroup, status, mndConsumerStatusName(status), newTopicNum);
if (status != MQ_CONSUMER_STATUS__READY) {
terrno = TSDB_CODE_MND_CONSUMER_NOT_READY;
@@ -701,7 +698,7 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
taosArrayDestroy(pConsumerNew->assignedTopics);
pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup);
- int32_t oldTopicNum = (pExistedConsumer->currentTopics)? taosArrayGetSize(pExistedConsumer->currentTopics):0;
+ int32_t oldTopicNum = (pExistedConsumer->currentTopics) ? taosArrayGetSize(pExistedConsumer->currentTopics) : 0;
int32_t i = 0, j = 0;
while (i < oldTopicNum || j < newTopicNum) {
@@ -866,13 +863,13 @@ static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer) {
}
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer) {
- mDebug("consumer:0x%" PRIx64 " perform delete action, status:(%d)%s", pConsumer->consumerId,
- pConsumer->status, mndConsumerStatusName(pConsumer->status));
+ mDebug("consumer:0x%" PRIx64 " perform delete action, status:(%d)%s", pConsumer->consumerId, pConsumer->status,
+ mndConsumerStatusName(pConsumer->status));
tDeleteSMqConsumerObj(pConsumer);
return 0;
}
-static void updateConsumerStatus(SMqConsumerObj* pConsumer) {
+static void updateConsumerStatus(SMqConsumerObj *pConsumer) {
int32_t status = pConsumer->status;
if (taosArrayGetSize(pConsumer->rebNewTopics) == 0 && taosArrayGetSize(pConsumer->rebRemovedTopics) == 0) {
@@ -891,7 +888,7 @@ static void updateConsumerStatus(SMqConsumerObj* pConsumer) {
}
// remove from new topic
-static void removeFromNewTopicList(SMqConsumerObj* pConsumer, const char* pTopic) {
+static void removeFromNewTopicList(SMqConsumerObj *pConsumer, const char *pTopic) {
int32_t size = taosArrayGetSize(pConsumer->rebNewTopics);
for (int32_t i = 0; i < taosArrayGetSize(pConsumer->rebNewTopics); i++) {
char *p = taosArrayGetP(pConsumer->rebNewTopics, i);
@@ -900,14 +897,14 @@ static void removeFromNewTopicList(SMqConsumerObj* pConsumer, const char* pTopic
taosMemoryFree(p);
mDebug("consumer:0x%" PRIx64 " remove new topic:%s in the topic list, remain newTopics:%d", pConsumer->consumerId,
- pTopic, (int) taosArrayGetSize(pConsumer->rebNewTopics));
+ pTopic, (int)taosArrayGetSize(pConsumer->rebNewTopics));
break;
}
}
}
// remove from removed topic
-static void removeFromRemoveTopicList(SMqConsumerObj* pConsumer, const char* pTopic) {
+static void removeFromRemoveTopicList(SMqConsumerObj *pConsumer, const char *pTopic) {
int32_t size = taosArrayGetSize(pConsumer->rebRemovedTopics);
for (int32_t i = 0; i < size; i++) {
char *p = taosArrayGetP(pConsumer->rebRemovedTopics, i);
@@ -1057,7 +1054,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
mDebug("consumer:0x%" PRIx64 " state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64
- ", current topics:%d, newTopics:%d, removeTopics:%d",
+ ", current topics:%d, newTopics:%d, removeTopics:%d",
pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime,
(int)taosArrayGetSize(pOldConsumer->currentTopics), (int)taosArrayGetSize(pOldConsumer->rebNewTopics),
@@ -1137,8 +1134,8 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
colDataSetVal(pColInfo, numOfRows, (const char *)clientId, false);
// status
- char status[20 + VARSTR_HEADER_SIZE] = {0};
- const char* pStatusName = mndConsumerStatusName(pConsumer->status);
+ char status[20 + VARSTR_HEADER_SIZE] = {0};
+ const char *pStatusName = mndConsumerStatusName(pConsumer->status);
STR_TO_VARSTR(status, pStatusName);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c
index 126a653a69c447808cd1b74ca72c0cb8f51e5590..df220340688ae7b0230dae3a3242e0fc9ff6d2b9 100644
--- a/source/dnode/mnode/impl/src/mndDb.c
+++ b/source/dnode/mnode/impl/src/mndDb.c
@@ -275,6 +275,8 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
pOld->cfg.daysToKeep2 = pNew->cfg.daysToKeep2;
pOld->cfg.walFsyncPeriod = pNew->cfg.walFsyncPeriod;
pOld->cfg.walLevel = pNew->cfg.walLevel;
+ pOld->cfg.walRetentionPeriod = pNew->cfg.walRetentionPeriod;
+ pOld->cfg.walRetentionSize = pNew->cfg.walRetentionSize;
pOld->cfg.strict = pNew->cfg.strict;
pOld->cfg.cacheLast = pNew->cfg.cacheLast;
pOld->cfg.replications = pNew->cfg.replications;
@@ -734,6 +736,20 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
terrno = 0;
}
+ if (pAlter->walRetentionPeriod > TSDB_DB_MIN_WAL_RETENTION_PERIOD &&
+ pAlter->walRetentionPeriod != pDb->cfg.walRetentionPeriod) {
+ pDb->cfg.walRetentionPeriod = pAlter->walRetentionPeriod;
+ pDb->vgVersion++;
+ terrno = 0;
+ }
+
+ if (pAlter->walRetentionSize > TSDB_DB_MIN_WAL_RETENTION_SIZE &&
+ pAlter->walRetentionSize != pDb->cfg.walRetentionSize) {
+ pDb->cfg.walRetentionSize = pAlter->walRetentionSize;
+ pDb->vgVersion++;
+ terrno = 0;
+ }
+
return terrno;
}
@@ -830,6 +846,18 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
goto _OVER;
}
+ int32_t numOfTopics = 0;
+ if (mndGetNumOfTopics(pMnode, pDb->name, &numOfTopics) != 0) {
+ goto _OVER;
+ }
+
+ if (numOfTopics != 0 && alterReq.walRetentionPeriod == 0) {
+ terrno = TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO;
+ mError("db:%s, not allowed to set WAL_RETENTION_PERIOD 0 when there are topics defined. numOfTopics:%d", pDb->name,
+ numOfTopics);
+ goto _OVER;
+ }
+
memcpy(&dbObj, pDb, sizeof(SDbObj));
if (dbObj.cfg.pRetensions != NULL) {
dbObj.cfg.pRetensions = taosArrayDup(pDb->cfg.pRetensions, NULL);
@@ -1409,7 +1437,7 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs,
return 0;
}
-static int32_t mndTrimDb(SMnode *pMnode, SDbObj *pDb) {
+static int32_t mndTrimDb(SMnode *pMnode, SDbObj *pDb, SRpcMsg *pReq) {
SSdb *pSdb = pMnode->pSdb;
SVgObj *pVgroup = NULL;
void *pIter = NULL;
@@ -1431,7 +1459,7 @@ static int32_t mndTrimDb(SMnode *pMnode, SDbObj *pDb) {
pHead->vgId = htonl(pVgroup->vgId);
tSerializeSVTrimDbReq((char *)pHead + sizeof(SMsgHead), contLen, &trimReq);
- SRpcMsg rpcMsg = {.msgType = TDMT_VND_TRIM, .pCont = pHead, .contLen = contLen};
+ SRpcMsg rpcMsg = {.msgType = TDMT_VND_TRIM, .pCont = pHead, .contLen = contLen, .info = pReq->info};
SEpSet epSet = mndGetVgroupEpset(pMnode, pVgroup);
int32_t code = tmsgSendReq(&epSet, &rpcMsg);
if (code != 0) {
@@ -1467,7 +1495,7 @@ static int32_t mndProcessTrimDbReq(SRpcMsg *pReq) {
goto _OVER;
}
- code = mndTrimDb(pMnode, pDb);
+ code = mndTrimDb(pMnode, pDb, pReq);
_OVER:
if (code != 0) {
diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c
index adeae45314e0fa5c773818e57b90929f2b213e18..1f58ae97a3c7034eda9ef8385e1e057cf0c510d2 100644
--- a/source/dnode/mnode/impl/src/mndDnode.c
+++ b/source/dnode/mnode/impl/src/mndDnode.c
@@ -25,6 +25,7 @@
#include "mndUser.h"
#include "mndVgroup.h"
#include "tmisce.h"
+#include "mndCluster.h"
#define TSDB_DNODE_VER_NUMBER 1
#define TSDB_DNODE_RESERVE_SIZE 64
@@ -366,6 +367,14 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
goto _OVER;
}
+ int64_t clusterid = mndGetClusterId(pMnode);
+ if (statusReq.clusterId != 0 && statusReq.clusterId != clusterid) {
+ code = TSDB_CODE_MND_DNODE_DIFF_CLUSTER;
+ mWarn("dnode:%d, %s, its clusterid:%" PRId64 " differ from current cluster:%" PRId64 ", code:0x%x",
+ statusReq.dnodeId, statusReq.dnodeEp, statusReq.clusterId, clusterid, code);
+ goto _OVER;
+ }
+
if (statusReq.dnodeId == 0) {
pDnode = mndAcquireDnodeByEp(pMnode, statusReq.dnodeEp);
if (pDnode == NULL) {
@@ -956,7 +965,7 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
tSerializeSDCfgDnodeReq(pBuf, bufLen, &dcfgReq);
mInfo("dnode:%d, send config req to dnode, app:%p config:%s value:%s", cfgReq.dnodeId, pReq->info.ahandle,
dcfgReq.config, dcfgReq.value);
- SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen};
+ SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen, .info = pReq->info};
tmsgSendReq(&epSet, &rpcMsg);
code = 0;
}
diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c
index 8d006f10296eaf1fc1e90613eebc54cfd7e983c7..7a475c61b6c0c95469d94a690fd80c96ac11b5c4 100644
--- a/source/dnode/mnode/impl/src/mndFunc.c
+++ b/source/dnode/mnode/impl/src/mndFunc.c
@@ -519,6 +519,7 @@ static int32_t mndRetrieveFuncs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)b2, false);
+ taosMemoryFree(b2);
} else {
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, NULL, true);
@@ -545,6 +546,26 @@ static int32_t mndRetrieveFuncs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pFunc->bufSize, false);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ char* language = "";
+ if (pFunc->scriptType == TSDB_FUNC_SCRIPT_BIN_LIB) {
+ language = "C";
+ } else if (pFunc->scriptType == TSDB_FUNC_SCRIPT_PYTHON) {
+ language = "Python";
+ }
+ char varLang[TSDB_TYPE_STR_MAX_LEN + 1] = {0};
+ varDataSetLen(varLang, strlen(language));
+ strcpy(varDataVal(varLang), language);
+ colDataSetVal(pColInfo, numOfRows, (const char *)varLang, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ int32_t varCodeLen = (pFunc->codeSize + VARSTR_HEADER_SIZE) > TSDB_MAX_BINARY_LEN ? TSDB_MAX_BINARY_LEN : pFunc->codeSize + VARSTR_HEADER_SIZE;
+ char *b4 = taosMemoryMalloc(varCodeLen);
+ memcpy(varDataVal(b4), pFunc->pCode, varCodeLen - VARSTR_HEADER_SIZE);
+ varDataSetLen(b4, varCodeLen - VARSTR_HEADER_SIZE);
+ colDataSetVal(pColInfo, numOfRows, (const char*)b4, false);
+ taosMemoryFree(b4);
+
numOfRows++;
sdbRelease(pSdb, pFunc);
}
diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c
index a096e0341e6ad65aa1a374a7f4b80072eca5550d..5c20887cf5b548fc291d5ae37aac10e9a1f506b1 100644
--- a/source/dnode/mnode/impl/src/mndMain.c
+++ b/source/dnode/mnode/impl/src/mndMain.c
@@ -653,7 +653,7 @@ _OVER:
pMsg->msgType == TDMT_MND_TRANS_TIMER || pMsg->msgType == TDMT_MND_TTL_TIMER ||
pMsg->msgType == TDMT_MND_UPTIME_TIMER) {
mTrace("timer not process since mnode restored:%d stopped:%d, sync restored:%d role:%s ", pMnode->restored,
- pMnode->stopped, state.restored, syncStr(state.restored));
+ pMnode->stopped, state.restored, syncStr(state.state));
return -1;
}
@@ -761,6 +761,8 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
pClusterInfo->dbs_total = sdbGetSize(pSdb, SDB_DB);
pClusterInfo->stbs_total = sdbGetSize(pSdb, SDB_STB);
+ pClusterInfo->topics_toal = sdbGetSize(pSdb, SDB_TOPIC);
+ pClusterInfo->streams_total = sdbGetSize(pSdb, SDB_STREAM);
void *pIter = NULL;
while (1) {
diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c
index 09aef2cd967fb094b553dec38a837e59050c5e44..3d654a23d87b082aa441012375d0691089e391d8 100644
--- a/source/dnode/mnode/impl/src/mndSma.c
+++ b/source/dnode/mnode/impl/src/mndSma.c
@@ -470,6 +470,7 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans,
return -1;
}
+ action.mTraceId = pTrans->mTraceId;
action.pCont = pReq;
action.contLen = contLen;
action.msgType = TDMT_DND_CREATE_VNODE;
@@ -693,6 +694,8 @@ static int32_t mndProcessCreateSmaReq(SRpcMsg *pReq) {
SDbObj *pDb = NULL;
SMCreateSmaReq createReq = {0};
+ int64_t mTraceId = TRACE_GET_ROOTID(&pReq->info.traceId);
+
if (tDeserializeSMCreateSmaReq(pReq->pCont, pReq->contLen, &createReq) != 0) {
terrno = TSDB_CODE_INVALID_MSG;
goto _OVER;
diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c
index c577097644d8b296db434a1b71e5e9d11a98b774..b3da66a035e7f071b5245dad4ac8edda9abc1151 100644
--- a/source/dnode/mnode/impl/src/mndStb.c
+++ b/source/dnode/mnode/impl/src/mndStb.c
@@ -668,6 +668,7 @@ static int32_t mndSetCreateStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
}
STransAction action = {0};
+ action.mTraceId = pTrans->mTraceId;
action.epSet = mndGetVgroupEpset(pMnode, pVgroup);
action.pCont = pReq;
action.contLen = contLen;
@@ -877,7 +878,7 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) {
pHead->vgId = htonl(pVgroup->vgId);
tSerializeSVDropTtlTableReq((char *)pHead + sizeof(SMsgHead), contLen, &ttlReq);
- SRpcMsg rpcMsg = {.msgType = TDMT_VND_DROP_TTL_TABLE, .pCont = pHead, .contLen = contLen};
+ SRpcMsg rpcMsg = {.msgType = TDMT_VND_DROP_TTL_TABLE, .pCont = pHead, .contLen = contLen, .info = pReq->info};
SEpSet epSet = mndGetVgroupEpset(pMnode, pVgroup);
int32_t code = tmsgSendReq(&epSet, &rpcMsg);
if (code != 0) {
diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c
index b7f80f6b0e5e84be4806268c9b6c301488a02860..ff759f5e785728998d6b8c90824a244cd80ff3f6 100644
--- a/source/dnode/mnode/impl/src/mndStream.c
+++ b/source/dnode/mnode/impl/src/mndStream.c
@@ -434,6 +434,7 @@ int32_t mndPersistTaskDeployReq(STrans *pTrans, const SStreamTask *pTask) {
tEncoderClear(&encoder);
STransAction action = {0};
+ action.mTraceId = pTrans->mTraceId;
memcpy(&action.epSet, &pTask->epSet, sizeof(SEpSet));
action.pCont = buf;
action.contLen = tlen;
diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c
index 64a3170d471f293ad703ef27f30cd00a59258ba0..6a745a0a4f94ff4668e55927b99596bfd705d5ca 100644
--- a/source/dnode/mnode/impl/src/mndSubscribe.c
+++ b/source/dnode/mnode/impl/src/mndSubscribe.c
@@ -240,7 +240,7 @@ static void doRemoveExistedConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash,
}
static void doAddNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pInput) {
- int32_t numOfNewConsumers = taosArrayGetSize(pInput->pRebInfo->newConsumers);
+ int32_t numOfNewConsumers = taosArrayGetSize(pInput->pRebInfo->newConsumers);
const char *pSubKey = pOutput->pSub->key;
for (int32_t i = 0; i < numOfNewConsumers; i++) {
@@ -256,9 +256,9 @@ static void doAddNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pI
}
}
-static void addUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj* pHash) {
+static void addUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj *pHash) {
const char *pSubKey = pOutput->pSub->key;
- int32_t numOfVgroups = taosArrayGetSize(pOutput->pSub->unassignedVgs);
+ int32_t numOfVgroups = taosArrayGetSize(pOutput->pSub->unassignedVgs);
for (int32_t i = 0; i < numOfVgroups; i++) {
SMqVgEp *pVgEp = *(SMqVgEp **)taosArrayPop(pOutput->pSub->unassignedVgs);
@@ -273,7 +273,8 @@ static void addUnassignedVgroups(SMqRebOutputObj *pOutput, SHashObj* pHash) {
}
}
-static void transferVgroupsForConsumers(SMqRebOutputObj *pOutput, SHashObj* pHash, int32_t minVgCnt, int32_t imbConsumerNum) {
+static void transferVgroupsForConsumers(SMqRebOutputObj *pOutput, SHashObj *pHash, int32_t minVgCnt,
+ int32_t imbConsumerNum) {
const char *pSubKey = pOutput->pSub->key;
int32_t imbCnt = 0;
@@ -612,7 +613,7 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
}
// todo handle the malloc failure
- SMqRebInputObj rebInput = {0};
+ SMqRebInputObj rebInput = {0};
SMqRebOutputObj rebOutput = {0};
rebOutput.newConsumers = taosArrayInit(0, sizeof(int64_t));
rebOutput.removedConsumers = taosArrayInit(0, sizeof(int64_t));
diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c
index 991f1099a63aee39526b27371d72cd9699ea83fb..f6da3709164158acc008708121873da5bb2b78d1 100644
--- a/source/dnode/mnode/impl/src/mndTopic.c
+++ b/source/dnode/mnode/impl/src/mndTopic.c
@@ -605,6 +605,12 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) {
goto _OVER;
}
+ if (pDb->cfg.walRetentionPeriod == 0) {
+ terrno = TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO;
+ mError("db:%s, not allowed to create topic when WAL_RETENTION_PERIOD is zero", pDb->name);
+ goto _OVER;
+ }
+
code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb, pReq->info.conn.user);
if (code == 0) {
code = TSDB_CODE_ACTION_IN_PROGRESS;
@@ -793,7 +799,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
return TSDB_CODE_ACTION_IN_PROGRESS;
}
-static int32_t mndGetNumOfTopics(SMnode *pMnode, char *dbName, int32_t *pNumOfTopics) {
+int32_t mndGetNumOfTopics(SMnode *pMnode, char *dbName, int32_t *pNumOfTopics) {
*pNumOfTopics = 0;
SSdb *pSdb = pMnode->pSdb;
@@ -943,4 +949,4 @@ int32_t mndDropTopicByDB(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) {
return code;
}
-#endif
\ No newline at end of file
+#endif
diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c
index 9d8a662b6b05f96a4fe687a1146a60d44368f69c..106eea031384a93641c002200ab0c084f53fc76a 100644
--- a/source/dnode/mnode/impl/src/mndTrans.c
+++ b/source/dnode/mnode/impl/src/mndTrans.c
@@ -505,8 +505,8 @@ static TransCbFp mndTransGetCbFp(ETrnFunc ftype) {
}
static int32_t mndTransActionInsert(SSdb *pSdb, STrans *pTrans) {
- mInfo("trans:%d, perform insert action, row:%p stage:%s, callfunc:1, startFunc:%d", pTrans->id, pTrans, mndTransStr(pTrans->stage),
- pTrans->startFunc);
+ mInfo("trans:%d, perform insert action, row:%p stage:%s, callfunc:1, startFunc:%d", pTrans->id, pTrans,
+ mndTransStr(pTrans->stage), pTrans->startFunc);
if (pTrans->startFunc > 0) {
TransCbFp fp = mndTransGetCbFp(pTrans->startFunc);
@@ -577,8 +577,7 @@ static void mndTransUpdateActions(SArray *pOldArray, SArray *pNewArray) {
static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
mInfo("trans:%d, perform update action, old row:%p stage:%s create:%" PRId64 ", new row:%p stage:%s create:%" PRId64,
- pOld->id, pOld, mndTransStr(pOld->stage), pOld->createdTime, pNew, mndTransStr(pNew->stage),
- pNew->createdTime);
+ pOld->id, pOld, mndTransStr(pOld->stage), pOld->createdTime, pNew, mndTransStr(pNew->stage), pNew->createdTime);
if (pOld->createdTime != pNew->createdTime) {
mError("trans:%d, failed to perform update action since createTime not match, old row:%p stage:%s create:%" PRId64
@@ -650,6 +649,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict,
pTrans->undoActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction));
pTrans->commitActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction));
pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo));
+ pTrans->mTraceId = pReq ? TRACE_GET_ROOTID(&pReq->info.traceId) : 0;
taosInitRWLatch(&pTrans->lockRpcArray);
if (pTrans->redoActions == NULL || pTrans->undoActions == NULL || pTrans->commitActions == NULL ||
@@ -706,7 +706,8 @@ static int32_t mndTransAppendAction(SArray *pArray, STransAction *pAction) {
}
int32_t mndTransAppendRedolog(STrans *pTrans, SSdbRaw *pRaw) {
- STransAction action = {.stage = TRN_STAGE_REDO_ACTION, .actionType = TRANS_ACTION_RAW, .pRaw = pRaw};
+ STransAction action = {
+ .stage = TRN_STAGE_REDO_ACTION, .actionType = TRANS_ACTION_RAW, .pRaw = pRaw, .mTraceId = pTrans->mTraceId};
return mndTransAppendAction(pTrans->redoActions, &action);
}
@@ -728,6 +729,7 @@ int32_t mndTransAppendCommitlog(STrans *pTrans, SSdbRaw *pRaw) {
int32_t mndTransAppendRedoAction(STrans *pTrans, STransAction *pAction) {
pAction->stage = TRN_STAGE_REDO_ACTION;
pAction->actionType = TRANS_ACTION_MSG;
+ pAction->mTraceId = pTrans->mTraceId;
return mndTransAppendAction(pTrans->redoActions, pAction);
}
@@ -875,7 +877,6 @@ int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans) {
}
}
-
if (mndCheckTransConflict(pMnode, pTrans)) {
terrno = TSDB_CODE_MND_TRANS_CONFLICT;
mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr());
@@ -912,6 +913,7 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) {
pNew->pRpcArray = pTrans->pRpcArray;
pNew->rpcRsp = pTrans->rpcRsp;
pNew->rpcRspLen = pTrans->rpcRspLen;
+ pNew->mTraceId = pTrans->mTraceId;
pTrans->pRpcArray = NULL;
pTrans->rpcRsp = NULL;
pTrans->rpcRspLen = 0;
@@ -1170,6 +1172,8 @@ static int32_t mndTransSendSingleMsg(SMnode *pMnode, STrans *pTrans, STransActio
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
}
+ rpcMsg.info.traceId.rootId = pTrans->mTraceId;
+
memcpy(rpcMsg.pCont, pAction->pCont, pAction->contLen);
char detail[1024] = {0};
@@ -1460,7 +1464,7 @@ static bool mndTransPerformCommitActionStage(SMnode *pMnode, STrans *pTrans) {
if (code == 0) {
pTrans->code = 0;
- pTrans->stage = TRN_STAGE_FINISHED; // TRN_STAGE_PRE_FINISH is not necessary
+ pTrans->stage = TRN_STAGE_FINISHED; // TRN_STAGE_PRE_FINISH is not necessary
mInfo("trans:%d, stage from commitAction to finished", pTrans->id);
continueExec = true;
} else {
diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c
index b747755acca339a1f4b088bd513a84f9bee07fcd..31924e04717e0bfffb485b7726a533454d718194 100644
--- a/source/dnode/mnode/impl/src/mndVgroup.c
+++ b/source/dnode/mnode/impl/src/mndVgroup.c
@@ -40,6 +40,7 @@ static void mndCancelGetNextVnode(SMnode *pMnode, void *pIter);
static int32_t mndProcessRedistributeVgroupMsg(SRpcMsg *pReq);
static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq);
static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq);
+static int32_t mndProcessVgroupBalanceLeaderMsg(SRpcMsg *pReq);
int32_t mndInitVgroup(SMnode *pMnode) {
SSdbTable table = {
@@ -60,10 +61,13 @@ int32_t mndInitVgroup(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_DND_DROP_VNODE_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_VND_COMPACT_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_VND_DISABLE_WRITE_RSP, mndTransProcessRsp);
+ mndSetMsgHandle(pMnode, TDMT_SYNC_FORCE_FOLLOWER_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_MND_REDISTRIBUTE_VGROUP, mndProcessRedistributeVgroupMsg);
mndSetMsgHandle(pMnode, TDMT_MND_SPLIT_VGROUP, mndProcessSplitVgroupMsg);
+ //mndSetMsgHandle(pMnode, TDMT_MND_BALANCE_VGROUP, mndProcessVgroupBalanceLeaderMsg);
mndSetMsgHandle(pMnode, TDMT_MND_BALANCE_VGROUP, mndProcessBalanceVgroupMsg);
+ mndSetMsgHandle(pMnode, TDMT_MND_BALANCE_VGROUP_LEADER, mndProcessVgroupBalanceLeaderMsg);
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_VGROUP, mndRetrieveVgroups);
mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_VGROUP, mndCancelGetNextVgroup);
@@ -321,6 +325,8 @@ static void *mndBuildAlterVnodeConfigReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pV
alterReq.cacheLast = pDb->cfg.cacheLast;
alterReq.sttTrigger = pDb->cfg.sstTrigger;
alterReq.minRows = pDb->cfg.minRows;
+ alterReq.walRetentionPeriod = pDb->cfg.walRetentionPeriod;
+ alterReq.walRetentionSize = pDb->cfg.walRetentionSize;
mInfo("vgId:%d, build alter vnode config req", pVgroup->vgId);
int32_t contLen = tSerializeSAlterVnodeConfigReq(NULL, 0, &alterReq);
@@ -1773,6 +1779,169 @@ _OVER:
return code;
}
+static void *mndBuildSForceBecomeFollowerReq(SMnode *pMnode, SVgObj *pVgroup, int32_t dnodeId,
+ int32_t *pContLen) {
+ SForceBecomeFollowerReq balanceReq = {
+ .vgId = pVgroup->vgId,
+ };
+
+ int32_t contLen = tSerializeSForceBecomeFollowerReq(NULL, 0, &balanceReq);
+ if (contLen < 0) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return NULL;
+ }
+ contLen += sizeof(SMsgHead);
+
+ void *pReq = taosMemoryMalloc(contLen);
+ if (pReq == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return NULL;
+ }
+
+ SMsgHead *pHead = pReq;
+ pHead->contLen = htonl(contLen);
+ pHead->vgId = htonl(pVgroup->vgId);
+
+ tSerializeSForceBecomeFollowerReq((char *)pReq + sizeof(SMsgHead), contLen, &balanceReq);
+ *pContLen = contLen;
+ return pReq;
+}
+
+int32_t mndAddBalanceVgroupLeaderAction(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, int32_t dnodeId) {
+ SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId);
+ if (pDnode == NULL) return -1;
+
+ STransAction action = {0};
+ action.epSet = mndGetDnodeEpset(pDnode);
+ mndReleaseDnode(pMnode, pDnode);
+
+ int32_t contLen = 0;
+ void *pReq = mndBuildSForceBecomeFollowerReq(pMnode, pVgroup, dnodeId, &contLen);
+ if (pReq == NULL) return -1;
+
+ action.pCont = pReq;
+ action.contLen = contLen;
+ action.msgType = TDMT_SYNC_FORCE_FOLLOWER;
+
+ if (mndTransAppendRedoAction(pTrans, &action) != 0) {
+ taosMemoryFree(pReq);
+ return -1;
+ }
+
+ return 0;
+}
+
+int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTrans){
+ SSdb *pSdb = pMnode->pSdb;
+
+ int32_t vgid = pVgroup->vgId;
+ int8_t replica = pVgroup->replica;
+
+ if(pVgroup->replica <= 1) {
+ mInfo("trans:%d, vgid:%d no need to balance, replica:%d", pTrans->id, vgid, replica);
+ return -1;
+ }
+
+ int32_t dnodeId = pVgroup->vnodeGid[0].dnodeId;
+
+ for(int i = 0; i < replica; i++)
+ {
+ if(pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER){
+ dnodeId = pVgroup->vnodeGid[i].dnodeId;
+ break;
+ }
+ }
+
+ bool exist = false;
+ bool online = false;
+ int64_t curMs = taosGetTimestampMs();
+ SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId);
+ if (pDnode != NULL) {
+ exist = true;
+ online = mndIsDnodeOnline(pDnode, curMs);
+ mndReleaseDnode(pMnode, pDnode);
+ }
+
+ if(exist && online)
+ {
+ mInfo("trans:%d, vgid:%d leader to dnode:%d", pTrans->id, vgid, dnodeId);
+
+ if (mndAddBalanceVgroupLeaderAction(pMnode, pTrans, pVgroup, dnodeId) != 0) {
+ mError("trans:%d, vgid:%d failed to be balanced to dnode:%d", pTrans->id, vgid, dnodeId);
+ return -1;
+ }
+
+ SSdbRaw *pRaw = mndVgroupActionEncode(pVgroup);
+ if (pRaw == NULL) {
+ mError("trans:%d, vgid:%d failed to encode action to dnode:%d", pTrans->id, vgid, dnodeId);
+ return -1;
+ }
+ if (mndTransAppendCommitlog(pTrans, pRaw) != 0) {
+ sdbFreeRaw(pRaw);
+ mError("trans:%d, vgid:%d failed to append commit log dnode:%d", pTrans->id, vgid, dnodeId);
+ return -1;
+ }
+ (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY);
+ }
+ else
+ {
+ mInfo("trans:%d, vgid:%d cant be balanced to dnode:%d, exist:%d, online:%d", pTrans->id, vgid, dnodeId, exist, online);
+ }
+
+ return 0;
+}
+
+int32_t mndProcessVgroupBalanceLeaderMsg(SRpcMsg *pReq) {
+ int32_t code = -1;
+
+ SBalanceVgroupLeaderReq req = {0};
+ if (tDeserializeSBalanceVgroupLeaderReq(pReq->pCont, pReq->contLen, &req) != 0) {
+ terrno = TSDB_CODE_INVALID_MSG;
+ return code;
+ }
+
+ SMnode *pMnode = pReq->info.node;
+ SSdb *pSdb = pMnode->pSdb;
+
+ int32_t total = sdbGetSize(pSdb, SDB_VGROUP);
+ if(total <= 0) {
+ terrno = TSDB_CODE_TSC_INVALID_OPERATION;
+ return code;
+ }
+
+ STrans *pTrans = NULL;
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pReq, "bal-vg-leader");
+ if (pTrans == NULL) goto _OVER;
+ mndTransSetSerial(pTrans);
+ mInfo("trans:%d, used to balance vgroup leader", pTrans->id);
+
+ void *pIter = NULL;
+ int32_t count = 0;
+ while (1) {
+ SVgObj *pVgroup = NULL;
+ pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup);
+ if (pIter == NULL) break;
+
+ if(mndAddVgroupBalanceToTrans(pMnode, pVgroup, pTrans) == 0){
+ count++;
+ }
+
+ sdbRelease(pSdb, pVgroup);
+ }
+
+ if(count == 0) {
+ terrno = TSDB_CODE_TSC_INVALID_OPERATION;
+ goto _OVER;
+ }
+
+ if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
+ code = 0;
+
+_OVER:
+ mndTransDrop(pTrans);
+ return code;
+}
+
static int32_t mndCheckDnodeMemory(SMnode *pMnode, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pOldVgroup,
SVgObj *pNewVgroup, SArray *pArray) {
for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pArray); ++i) {
@@ -2270,4 +2439,4 @@ int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
STimeWindow tw) {
if (mndAddCompactVnodeAction(pMnode, pTrans, pDb, pVgroup, compactTs, tw) != 0) return -1;
return 0;
-}
\ No newline at end of file
+}
diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h
index 8b01ba237f26b4f03bfd8bad978be665a05b3570..253d5aebcec2353c1e951c5399256a23681f6850 100644
--- a/source/dnode/vnode/src/inc/vnodeInt.h
+++ b/source/dnode/vnode/src/inc/vnodeInt.h
@@ -187,13 +187,14 @@ int32_t tsdbDeleteTableData(STsdb* pTsdb, int64_t version, tb_uid_t suid, tb_uid
int32_t tsdbSetKeepCfg(STsdb* pTsdb, STsdbCfg* pCfg);
// tq
-int tqInit();
-void tqCleanUp();
-STQ* tqOpen(const char* path, SVnode* pVnode);
-void tqClose(STQ*);
-int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver);
-int tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest, SRpcMsg* pRpcMsg, SMqDataRsp* pDataRsp, int32_t type);
-int tqUnregisterPushEntry(STQ* pTq, const char* pKey, int32_t keyLen, uint64_t consumerId, bool rspConsumer);
+int tqInit();
+void tqCleanUp();
+STQ* tqOpen(const char* path, SVnode* pVnode);
+void tqClose(STQ*);
+int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver);
+int tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest, SRpcMsg* pRpcMsg, SMqDataRsp* pDataRsp,
+ int32_t type);
+int tqUnregisterPushEntry(STQ* pTq, const char* pKey, int32_t keyLen, uint64_t consumerId, bool rspConsumer);
int tqCommit(STQ*);
int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd);
diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c
index 3376150d264675b98e8f7455ea941d956dfc7f58..2359a165b7e131bde308fa1d68c7ba8d1f0c4a87 100644
--- a/source/dnode/vnode/src/meta/metaQuery.c
+++ b/source/dnode/vnode/src/meta/metaQuery.c
@@ -1337,6 +1337,7 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
/// src: [[suid, cid1, type1]....[suid, cid2, type2]....[suid, cid3, type3]...]
/// target: [suid, cid2, type2]
+ int diffCidCount = 0;
do {
void *entryKey = NULL, *entryVal = NULL;
int32_t nEntryKey, nEntryVal;
@@ -1353,7 +1354,9 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
if (p == NULL) break;
if (p->type != pCursor->type || p->suid != pCursor->suid || p->cid != pCursor->cid) {
- if (found == true) break;
+ if (found == true) break; //
+ if (diffCidCount > TRY_ERROR_LIMIT) break;
+ diffCidCount++;
count++;
valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur);
if (valid < 0) {
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index d4bdd633e91b30d72e9c48422f3dc3fa92481fb3..75c2bfcce842366543ec3558516e0533bd93414f 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -15,6 +15,10 @@
#include "tq.h"
+// 0: not init
+// 1: already inited
+// 2: wait to be inited or cleaup
+
int32_t tqInit() {
int8_t old;
while (1) {
@@ -205,7 +209,7 @@ static int32_t doSendDataRsp(const SRpcHandleInfo* pRpcHandleInfo, const SMqData
if (type == TMQ_MSG_TYPE__POLL_RSP) {
tEncodeSMqDataRsp(&encoder, pRsp);
} else if (type == TMQ_MSG_TYPE__TAOSX_RSP) {
- tEncodeSTaosxRsp(&encoder, (STaosxRsp*) pRsp);
+ tEncodeSTaosxRsp(&encoder, (STaosxRsp*)pRsp);
}
tEncoderClear(&encoder);
@@ -244,11 +248,7 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
A(taosArrayGetSize(pRsp->blockSchema) == 0);
if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) {
- if (pRsp->blockNum > 0) {
- A(pRsp->rspOffset.version > pRsp->reqOffset.version);
- } else {
- A(pRsp->rspOffset.version >= pRsp->reqOffset.version);
- }
+ A(pRsp->rspOffset.version > pRsp->reqOffset.version);
}
#endif
doSendDataRsp(&pMsg->info, pRsp, pReq->epoch, pReq->consumerId, type);
@@ -258,7 +258,7 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
tFormatOffset(buf1, 80, &pRsp->reqOffset);
tFormatOffset(buf2, 80, &pRsp->rspOffset);
- tqDebug("vgId:%d consumer:0x%" PRIx64 " (epoch %d) send rsp, block num:%d, req:%s, rsp:%s, reqId:0x%"PRIx64,
+ tqDebug("vgId:%d consumer:0x%" PRIx64 " (epoch %d) send rsp, block num:%d, req:%s, rsp:%s, reqId:0x%" PRIx64,
TD_VID(pTq->pVnode), pReq->consumerId, pReq->epoch, pRsp->blockNum, buf1, buf2, pReq->reqId);
return 0;
@@ -271,7 +271,7 @@ static FORCE_INLINE bool tqOffsetLessOrEqual(const STqOffset* pLeft, const STqOf
int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t sversion, char* msg, int32_t msgLen) {
STqOffset offset = {0};
- int32_t vgId = TD_VID(pTq->pVnode);
+ int32_t vgId = TD_VID(pTq->pVnode);
SDecoder decoder;
tDecoderInit(&decoder, (uint8_t*)msg, msgLen);
@@ -285,8 +285,8 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t sversion, char* msg, int32_t
tqDebug("receive offset commit msg to %s on vgId:%d, offset(type:snapshot) uid:%" PRId64 ", ts:%" PRId64,
offset.subKey, vgId, offset.val.uid, offset.val.ts);
} else if (offset.val.type == TMQ_OFFSET__LOG) {
- tqDebug("receive offset commit msg to %s on vgId:%d, offset(type:log) version:%" PRId64, offset.subKey,
- vgId, offset.val.version);
+ tqDebug("receive offset commit msg to %s on vgId:%d, offset(type:log) version:%" PRId64, offset.subKey, vgId,
+ offset.val.version);
if (offset.val.version + 1 == sversion) {
offset.val.version += 1;
}
@@ -399,7 +399,8 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
char formatBuf[80];
tFormatOffset(formatBuf, 80, pOffsetVal);
- tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, existed offset found, offset reset to %s and continue. reqId:0x%"PRIx64,
+ tqDebug("tmq poll: consumer:0x%" PRIx64
+ ", subkey %s, vgId:%d, existed offset found, offset reset to %s and continue. reqId:0x%" PRIx64,
consumerId, pHandle->subKey, vgId, formatBuf, pRequest->reqId);
return 0;
} else {
@@ -447,7 +448,8 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
return code;
}
} else if (reqOffset.type == TMQ_OFFSET__RESET_NONE) {
- tqError("tmq poll: subkey:%s, no offset committed for consumer:0x%" PRIx64 " in vg %d, subkey %s, reset none failed",
+ tqError("tmq poll: subkey:%s, no offset committed for consumer:0x%" PRIx64
+ " in vg %d, subkey %s, reset none failed",
pHandle->subKey, consumerId, vgId, pRequest->subKey);
terrno = TSDB_CODE_TQ_NO_COMMITTED_OFFSET;
return -1;
@@ -457,7 +459,7 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
return 0;
}
-#define IS_OFFSET_RESET_TYPE(_t) ((_t) < 0)
+#define IS_OFFSET_RESET_TYPE(_t) ((_t) < 0)
static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequest,
SRpcMsg* pMsg, STqOffsetVal* pOffset) {
@@ -521,7 +523,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
if (blockReturned) {
return 0;
}
- } else { // use the consumer specified offset
+ } else { // use the consumer specified offset
// the offset value can not be monotonious increase??
offset = reqOffset;
}
@@ -534,7 +536,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
// todo handle the case where re-balance occurs.
// for taosx
SMqMetaRsp metaRsp = {0};
- STaosxRsp taosxRsp = {0};
+ STaosxRsp taosxRsp = {0};
tqInitTaosxRsp(&taosxRsp, pRequest);
if (offset.type != TMQ_OFFSET__LOG) {
@@ -545,9 +547,8 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
if (metaRsp.metaRspLen > 0) {
code = tqSendMetaPollRsp(pTq, pMsg, pRequest, &metaRsp);
tqDebug("tmq poll: consumer:0x%" PRIx64 " subkey:%s vgId:%d, send meta offset type:%d,uid:%" PRId64
- ",ts:%" PRId64,
- consumerId, pHandle->subKey, vgId, metaRsp.rspOffset.type, metaRsp.rspOffset.uid,
- metaRsp.rspOffset.ts);
+ ",ts:%" PRId64,
+ consumerId, pHandle->subKey, vgId, metaRsp.rspOffset.type, metaRsp.rspOffset.uid, metaRsp.rspOffset.ts);
taosMemoryFree(metaRsp.metaRsp);
tDeleteSTaosxRsp(&taosxRsp);
return code;
@@ -562,7 +563,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
}
tqDebug("taosx poll: consumer:0x%" PRIx64 " subkey:%s vgId:%d, send data blockNum:%d, offset type:%d,uid:%" PRId64
- ",version:%" PRId64,
+ ",version:%" PRId64,
consumerId, pHandle->subKey, vgId, taosxRsp.blockNum, taosxRsp.rspOffset.type, taosxRsp.rspOffset.uid,
taosxRsp.rspOffset.version);
}
@@ -582,7 +583,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
int32_t savedEpoch = atomic_load_32(&pHandle->epoch);
if (savedEpoch > pRequest->epoch) {
tqWarn("tmq poll: consumer:0x%" PRIx64 " (epoch %d), subkey:%s vgId:%d offset %" PRId64
- ", found new consumer epoch %d, discard req epoch %d",
+ ", found new consumer epoch %d, discard req epoch %d",
consumerId, pRequest->epoch, pHandle->subKey, vgId, fetchVer, savedEpoch, pRequest->epoch);
break;
}
@@ -601,7 +602,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
// process meta
if (pHead->msgType != TDMT_VND_SUBMIT) {
- if(totalRows > 0) {
+ if (totalRows > 0) {
tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer - 1);
code = tqSendDataRsp(pTq, pMsg, pRequest, (SMqDataRsp*)&taosxRsp, TMQ_MSG_TYPE__TAOSX_RSP);
tDeleteSTaosxRsp(&taosxRsp);
@@ -659,7 +660,7 @@ static int32_t doPollDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* p
}
int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
- SMqPollReq req = {0};
+ SMqPollReq req = {0};
if (tDeserializeSMqPollReq(pMsg->pCont, pMsg->contLen, &req) < 0) {
tqError("tDeserializeSMqPollReq %d failed", pMsg->contLen);
terrno = TSDB_CODE_INVALID_MSG;
@@ -694,7 +695,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
taosWLockLatch(&pTq->lock);
int32_t savedEpoch = pHandle->epoch;
if (savedEpoch < reqEpoch) {
- tqDebug("tmq poll: consumer:0x%" PRIx64 " epoch update from %d to %d by poll req", consumerId, savedEpoch, reqEpoch);
+ tqDebug("tmq poll: consumer:0x%" PRIx64 " epoch update from %d to %d by poll req", consumerId, savedEpoch,
+ reqEpoch);
pHandle->epoch = reqEpoch;
}
taosWUnLockLatch(&pTq->lock);
@@ -832,8 +834,8 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
pHandle->execHandle.execCol.qmsg = req.qmsg;
req.qmsg = NULL;
- pHandle->execHandle.task =
- qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, vgId, &pHandle->execHandle.numOfCols, req.newConsumerId);
+ pHandle->execHandle.task = qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, vgId,
+ &pHandle->execHandle.numOfCols, req.newConsumerId);
void* scanner = NULL;
qExtractStreamScanner(pHandle->execHandle.task, &scanner);
pHandle->execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner);
@@ -988,22 +990,23 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
pTask->tbSink.vnode = pTq->pVnode;
pTask->tbSink.tbSinkFunc = tqSinkToTablePipeline2;
- int32_t ver1 = 1;
+ int32_t ver1 = 1;
SMetaInfo info = {0};
- int32_t code = metaGetInfo(pTq->pVnode->pMeta, pTask->tbSink.stbUid, &info, NULL);
+ int32_t code = metaGetInfo(pTq->pVnode->pMeta, pTask->tbSink.stbUid, &info, NULL);
if (code == TSDB_CODE_SUCCESS) {
ver1 = info.skmVer;
}
pTask->tbSink.pTSchema =
tBuildTSchema(pTask->tbSink.pSchemaWrapper->pSchema, pTask->tbSink.pSchemaWrapper->nCols, ver1);
- if(pTask->tbSink.pTSchema == NULL) {
+ if (pTask->tbSink.pTSchema == NULL) {
return -1;
}
}
streamSetupTrigger(pTask);
- tqInfo("expand stream task on vg %d, task id %d, child id %d, level %d", vgId, pTask->taskId, pTask->selfChildId, pTask->taskLevel);
+ tqInfo("expand stream task on vg %d, task id %d, child id %d, level %d", vgId, pTask->taskId, pTask->selfChildId,
+ pTask->taskLevel);
return 0;
}
diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c
index a273f2edec45d58161a6a3f312932a5ff0e50708..7b0cdab2f8ac7e49ef7f18fc5e971a0399969d65 100644
--- a/source/dnode/vnode/src/tq/tqMeta.c
+++ b/source/dnode/vnode/src/tq/tqMeta.c
@@ -269,7 +269,7 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) {
}
int32_t tqMetaRestoreHandle(STQ* pTq) {
- int code = 0;
+ int code = 0;
TBC* pCur = NULL;
if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) {
return -1;
diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c
index 1619829115960d7c1e35ba6663e5a834dfa62c37..d55b533f8a95319e964a2519dacff60a1e5fab42 100644
--- a/source/dnode/vnode/src/tq/tqPush.c
+++ b/source/dnode/vnode/src/tq/tqPush.c
@@ -207,25 +207,25 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
#endif
typedef struct {
- void* pKey;
+ void* pKey;
int64_t keyLen;
} SItem;
static void recordPushedEntry(SArray* cachedKey, void* pIter);
static void freeItem(void* param) {
- SItem* p = (SItem*) param;
+ SItem* p = (SItem*)param;
taosMemoryFree(p->pKey);
}
static void doRemovePushedEntry(SArray* pCachedKeys, STQ* pTq) {
int32_t vgId = TD_VID(pTq->pVnode);
- int32_t numOfKeys = (int32_t) taosArrayGetSize(pCachedKeys);
+ int32_t numOfKeys = (int32_t)taosArrayGetSize(pCachedKeys);
for (int32_t i = 0; i < numOfKeys; i++) {
SItem* pItem = taosArrayGet(pCachedKeys, i);
if (taosHashRemove(pTq->pPushMgr, pItem->pKey, pItem->keyLen) != 0) {
- tqError("vgId:%d, tq push hash remove key error, key: %s", vgId, (char*) pItem->pKey);
+ tqError("vgId:%d, tq push hash remove key error, key: %s", vgId, (char*)pItem->pKey);
}
}
@@ -274,7 +274,7 @@ static void doPushDataForEntry(void* pIter, STqExecHandle* pExec, STQ* pTq, int6
}
tqDebug("vgId:%d, tq handle push, subkey:%s, block num:%d, rows:%d", vgId, pPushEntry->subKey, pRsp->blockNum,
- totalRows);
+ totalRows);
if (pRsp->blockNum > 0) {
tqOffsetResetToLog(&pRsp->rspOffset, ver);
@@ -295,7 +295,7 @@ int32_t tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t v
int32_t numOfRegisteredPush = taosHashGetSize(pTq->pPushMgr);
if (numOfRegisteredPush > 0) {
tqDebug("vgId:%d tq push msg version:%" PRId64 " type:%s, head:%p, body:%p len:%d, numOfPushed consumers:%d",
- vgId, ver, TMSG_INFO(msgType), msg, pReq, len, numOfRegisteredPush);
+ vgId, ver, TMSG_INFO(msgType), msg, pReq, len, numOfRegisteredPush);
void* data = taosMemoryMalloc(len);
if (data == NULL) {
@@ -320,7 +320,8 @@ int32_t tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t v
STqHandle* pHandle = taosHashGet(pTq->pHandle, pPushEntry->subKey, strlen(pPushEntry->subKey));
if (pHandle == NULL) {
- tqDebug("vgId:%d, failed to find handle %s in pushing data to consumer, ignore", pTq->pVnode->config.vgId, pPushEntry->subKey);
+ tqDebug("vgId:%d, failed to find handle %s in pushing data to consumer, ignore", pTq->pVnode->config.vgId,
+ pPushEntry->subKey);
continue;
}
@@ -369,12 +370,12 @@ int32_t tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t v
void recordPushedEntry(SArray* cachedKey, void* pIter) {
size_t kLen = 0;
void* key = taosHashGetKey(pIter, &kLen);
- SItem item = {.pKey = strndup(key, kLen), .keyLen = kLen};
+ SItem item = {.pKey = strndup(key, kLen), .keyLen = kLen};
taosArrayPush(cachedKey, &item);
}
-int32_t tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest, SRpcMsg* pRpcMsg,
- SMqDataRsp* pDataRsp, int32_t type) {
+int32_t tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest, SRpcMsg* pRpcMsg, SMqDataRsp* pDataRsp,
+ int32_t type) {
uint64_t consumerId = pRequest->consumerId;
int32_t vgId = TD_VID(pTq->pVnode);
STqHandle* pTqHandle = pHandle;
@@ -391,7 +392,7 @@ int32_t tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest,
memcpy(pPushEntry->subKey, pTqHandle->subKey, TSDB_SUBSCRIBE_KEY_LEN);
if (type == TMQ_MSG_TYPE__TAOSX_RSP) {
- pPushEntry->pDataRsp = taosMemoryCalloc(1, sizeof(STaosxRsp));
+ pPushEntry->pDataRsp = taosMemoryCalloc(1, sizeof(STaosxRsp));
memcpy(pPushEntry->pDataRsp, pDataRsp, sizeof(STaosxRsp));
} else if (type == TMQ_MSG_TYPE__POLL_RSP) {
pPushEntry->pDataRsp = taosMemoryCalloc(1, sizeof(SMqDataRsp));
@@ -405,8 +406,8 @@ int32_t tqRegisterPushEntry(STQ* pTq, void* pHandle, const SMqPollReq* pRequest,
taosHashPut(pTq->pPushMgr, pTqHandle->subKey, strlen(pTqHandle->subKey), &pPushEntry, sizeof(void*));
- tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s offset:%" PRId64 ", vgId:%d save handle to push mgr, total:%d", consumerId,
- pTqHandle->subKey, pDataRsp->reqOffset.version, vgId, taosHashGetSize(pTq->pPushMgr));
+ tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s offset:%" PRId64 ", vgId:%d save handle to push mgr, total:%d",
+ consumerId, pTqHandle->subKey, pDataRsp->reqOffset.version, vgId, taosHashGetSize(pTq->pPushMgr));
return 0;
}
@@ -421,7 +422,7 @@ int32_t tqUnregisterPushEntry(STQ* pTq, const char* pKey, int32_t keyLen, uint64
tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s vgId:%d remove from push mgr, remains:%d", consumerId,
(*pEntry)->subKey, vgId, taosHashGetSize(pTq->pPushMgr) - 1);
- if (rspConsumer) { // rsp the old consumer with empty block.
+ if (rspConsumer) { // rsp the old consumer with empty block.
tqPushDataRsp(pTq, *pEntry);
}
diff --git a/source/dnode/vnode/src/tq/tqScan.c b/source/dnode/vnode/src/tq/tqScan.c
index c097cac015d4293cc9aa6aeeaeca80ced84cec84..6528b7c8d2a82f79f97cd984cb9d918f26dbacc6 100644
--- a/source/dnode/vnode/src/tq/tqScan.c
+++ b/source/dnode/vnode/src/tq/tqScan.c
@@ -74,14 +74,14 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
qTaskInfo_t task = pExec->task;
if (qStreamPrepareScan(task, pOffset, pHandle->execHandle.subType) < 0) {
- tqDebug("prepare scan failed, vgId:%d, consumer:0x%"PRIx64, vgId, pHandle->consumerId);
+ tqDebug("prepare scan failed, vgId:%d, consumer:0x%" PRIx64, vgId, pHandle->consumerId);
if (pOffset->type == TMQ_OFFSET__LOG) {
pRsp->rspOffset = *pOffset;
return code;
} else {
tqOffsetResetToLog(pOffset, pHandle->snapshotVer);
if (qStreamPrepareScan(task, pOffset, pHandle->execHandle.subType) < 0) {
- tqDebug("prepare scan failed, vgId:%d, consumer:0x%"PRIx64, vgId, pHandle->consumerId);
+ tqDebug("prepare scan failed, vgId:%d, consumer:0x%" PRIx64, vgId, pHandle->consumerId);
pRsp->rspOffset = *pOffset;
return code;
}
@@ -92,12 +92,11 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
SSDataBlock* pDataBlock = NULL;
uint64_t ts = 0;
- tqDebug("vgId:%d, tmq task start to execute, consumer:0x%"PRIx64, vgId, pHandle->consumerId);
+ tqDebug("vgId:%d, tmq task start to execute, consumer:0x%" PRIx64, vgId, pHandle->consumerId);
code = qExecTask(task, &pDataBlock, &ts);
if (code != TSDB_CODE_SUCCESS) {
- tqError("vgId:%d, task exec error since %s, consumer:0x%" PRIx64, vgId, terrstr(),
- pHandle->consumerId);
+ tqError("vgId:%d, task exec error since %s, consumer:0x%" PRIx64, vgId, terrstr(), pHandle->consumerId);
return code;
}
@@ -114,8 +113,8 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
pRsp->blockNum++;
- tqDebug("vgId:%d, consumer:0x%" PRIx64 " tmq task executed, rows:%" PRId64 ", total blocks:%d", vgId, pHandle->consumerId,
- pDataBlock->info.rows, pRsp->blockNum);
+ tqDebug("vgId:%d, consumer:0x%" PRIx64 " tmq task executed, rows:%" PRId64 ", total blocks:%d", vgId,
+ pHandle->consumerId, pDataBlock->info.rows, pRsp->blockNum);
if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
totalRows += pDataBlock->info.rows;
@@ -251,8 +250,8 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp, int32_t* totalRows) {
STqExecHandle* pExec = &pHandle->execHandle;
- SArray* pBlocks = taosArrayInit(0, sizeof(SSDataBlock));
- SArray* pSchemas = taosArrayInit(0, sizeof(void*));
+ SArray* pBlocks = taosArrayInit(0, sizeof(SSDataBlock));
+ SArray* pSchemas = taosArrayInit(0, sizeof(void*));
if (pExec->subType == TOPIC_SUB_TYPE__TABLE) {
STqReader* pReader = pExec->pExecReader;
@@ -286,7 +285,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
if (TSDB_CODE_SUCCESS != code) {
continue;
}
- void* createReq = taosMemoryCalloc(1, len);
+ void* createReq = taosMemoryCalloc(1, len);
SEncoder encoder = {0};
tEncoderInit(&encoder, createReq, len);
code = tEncodeSVCreateTbReq(&encoder, pSubmitTbDataRet->pCreateTbReq);
@@ -345,7 +344,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
if (TSDB_CODE_SUCCESS != code) {
continue;
}
- void* createReq = taosMemoryCalloc(1, len);
+ void* createReq = taosMemoryCalloc(1, len);
SEncoder encoder = {0};
tEncoderInit(&encoder, createReq, len);
code = tEncodeSVCreateTbReq(&encoder, pSubmitTbDataRet->pCreateTbReq);
diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c
index 8a89cb6bd7899bc8f2399f4255fb759907658a35..4645df5b67c121065b0844a7bca345205479e1b2 100644
--- a/source/dnode/vnode/src/tq/tqSink.c
+++ b/source/dnode/vnode/src/tq/tqSink.c
@@ -587,6 +587,8 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
taosMemoryFree(ctbName);
tdDestroySVCreateTbReq(pCreateTbReq);
terrno = TSDB_CODE_OUT_OF_MEMORY;
+ taosMemoryFree(ctbName);
+ tdDestroySVCreateTbReq(pCreateTbReq);
goto _end;
}
pCreateTbReq->ctb.pTag = (uint8_t*)pTag;
diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c
index 6fc8ad8be647c5331f7c31f1e373d891997ece6a..48d33712845503aa8b69911dff837a81968ea319 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCache.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCache.c
@@ -601,6 +601,7 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow, bool *pIgnoreEa
int nCols) {
SFSLastNextRowIter *state = (SFSLastNextRowIter *)iter;
int32_t code = 0;
+ bool checkRemainingRow = true;
switch (state->state) {
case SFSLASTNEXTROW_FS:
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c
index 1ac327de7fe49cea60bad511b1232162df756a34..480ae7ea64153df2a47313fd7bb9b6d208b40dc2 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead.c
@@ -959,14 +959,15 @@ static void setBlockAllDumped(SFileBlockDumpInfo* pDumpInfo, int64_t maxKey, int
}
static int32_t doCopyColVal(SColumnInfoData* pColInfoData, int32_t rowIndex, int32_t colIndex, SColVal* pColVal,
- SBlockLoadSuppInfo* pSup) {
+ SBlockLoadSuppInfo* pSup) {
if (IS_VAR_DATA_TYPE(pColVal->type)) {
if (!COL_VAL_IS_VALUE(pColVal)) {
colDataSetNULL(pColInfoData, rowIndex);
} else {
varDataSetLen(pSup->buildBuf[colIndex], pColVal->value.nData);
if (pColVal->value.nData > pColInfoData->info.bytes) {
- tsdbWarn("column cid:%d actual data len %d is bigger than schema len %d", pColVal->cid, pColVal->value.nData, pColInfoData->info.bytes);
+ tsdbWarn("column cid:%d actual data len %d is bigger than schema len %d", pColVal->cid, pColVal->value.nData,
+ pColInfoData->info.bytes);
return TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER;
}
if (pColVal->value.nData > 0) { // pData may be null, if nData is 0
@@ -1794,7 +1795,7 @@ static int32_t buildDataBlockFromBuf(STsdbReader* pReader, STableBlockScanInfo*
}
static bool tryCopyDistinctRowFromFileBlock(STsdbReader* pReader, SBlockData* pBlockData, int64_t key,
- SFileBlockDumpInfo* pDumpInfo, bool *copied) {
+ SFileBlockDumpInfo* pDumpInfo, bool* copied) {
// opt version
// 1. it is not a border point
// 2. the direct next point is not an duplicated timestamp
@@ -1843,7 +1844,8 @@ static bool nextRowFromLastBlocks(SLastBlockReader* pLastBlockReader, STableBloc
}
static bool tryCopyDistinctRowFromSttBlock(TSDBROW* fRow, SLastBlockReader* pLastBlockReader,
- STableBlockScanInfo* pScanInfo, int64_t ts, STsdbReader* pReader, bool *copied) {
+ STableBlockScanInfo* pScanInfo, int64_t ts, STsdbReader* pReader,
+ bool* copied) {
int32_t code = TSDB_CODE_SUCCESS;
*copied = false;
@@ -1856,7 +1858,7 @@ static bool tryCopyDistinctRowFromSttBlock(TSDBROW* fRow, SLastBlockReader* pLas
if (code) {
return code;
}
-
+
*copied = true;
return code;
}
@@ -1865,7 +1867,7 @@ static bool tryCopyDistinctRowFromSttBlock(TSDBROW* fRow, SLastBlockReader* pLas
if (code) {
return code;
}
-
+
*copied = true;
return code;
}
@@ -2068,11 +2070,11 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
bool mergeBlockData) {
SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo;
int64_t tsLastBlock = getCurrentKeyInLastBlock(pLastBlockReader);
- bool copied = false;
- int32_t code = TSDB_CODE_SUCCESS;
- SRow* pTSRow = NULL;
- SRowMerger merge = {0};
- TSDBROW fRow = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
+ bool copied = false;
+ int32_t code = TSDB_CODE_SUCCESS;
+ SRow* pTSRow = NULL;
+ SRowMerger merge = {0};
+ TSDBROW fRow = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
tsdbTrace("fRow ptr:%p, %d, uid:%" PRIu64 ", %s", fRow.pBlockData, fRow.iRow, pLastBlockReader->uid, pReader->idStr);
// only last block exists
@@ -2081,7 +2083,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
if (code) {
return code;
}
-
+
if (copied) {
pBlockScanInfo->lastKey = tsLastBlock;
return TSDB_CODE_SUCCESS;
@@ -2108,7 +2110,6 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
if (code != TSDB_CODE_SUCCESS) {
return code;
}
-
}
} else { // not merge block data
int32_t code = tsdbRowMergerInit(&merge, &fRow, pReader->pSchema);
@@ -2557,12 +2558,12 @@ bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo*
int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBlockScanInfo, int64_t key,
STsdbReader* pReader) {
SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo;
- bool copied = false;
- int32_t code = tryCopyDistinctRowFromFileBlock(pReader, pBlockData, key, pDumpInfo, &copied);
+ bool copied = false;
+ int32_t code = tryCopyDistinctRowFromFileBlock(pReader, pBlockData, key, pDumpInfo, &copied);
if (code) {
return code;
}
-
+
if (copied) {
pBlockScanInfo->lastKey = key;
return TSDB_CODE_SUCCESS;
@@ -2758,7 +2759,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
if (code) {
goto _end;
}
-
+
// currently loaded file data block is consumed
if ((pBlockData->nRow > 0) && (pDumpInfo->rowIndex >= pBlockData->nRow || pDumpInfo->rowIndex < 0)) {
SDataBlk* pBlock = getCurrentBlock(&pReader->status.blockIter);
@@ -2776,8 +2777,8 @@ _end:
updateComposedBlockInfo(pReader, el, pBlockScanInfo);
if (pResBlock->info.rows > 0) {
- tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64
- " rows:%" PRId64 ", elapsed time:%.2f ms %s",
+ tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 " rows:%" PRId64
+ ", elapsed time:%.2f ms %s",
pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey,
pResBlock->info.rows, el, pReader->idStr);
}
@@ -3018,7 +3019,7 @@ static int32_t doLoadLastBlockSequentially(STsdbReader* pReader) {
if (code) {
return code;
}
-
+
if (pResBlock->info.rows >= pReader->capacity) {
break;
}
@@ -3028,8 +3029,8 @@ static int32_t doLoadLastBlockSequentially(STsdbReader* pReader) {
updateComposedBlockInfo(pReader, el, pScanInfo);
if (pResBlock->info.rows > 0) {
- tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64
- " rows:%" PRId64 ", elapsed time:%.2f ms %s",
+ tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 " rows:%" PRId64
+ ", elapsed time:%.2f ms %s",
pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey,
pResBlock->info.rows, el, pReader->idStr);
return TSDB_CODE_SUCCESS;
@@ -3102,7 +3103,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
if (code) {
return code;
}
-
+
if (pResBlock->info.rows >= pReader->capacity) {
break;
}
@@ -3112,8 +3113,8 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
updateComposedBlockInfo(pReader, el, pScanInfo);
if (pResBlock->info.rows > 0) {
- tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64
- " rows:%" PRId64 ", elapsed time:%.2f ms %s",
+ tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 " rows:%" PRId64
+ ", elapsed time:%.2f ms %s",
pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey,
pResBlock->info.rows, el, pReader->idStr);
}
@@ -3139,7 +3140,6 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
return code;
}
-
static int32_t doSumFileBlockRows(STsdbReader* pReader, SDataFReader* pFileReader) {
int64_t st = taosGetTimestampUs();
LRUHandle* handle = NULL;
@@ -3157,8 +3157,8 @@ static int32_t doSumFileBlockRows(STsdbReader* pReader, SDataFReader* pFileReade
return TSDB_CODE_SUCCESS;
}
- SBlockIdx* pBlockIdx = NULL;
- int32_t i = 0;
+ SBlockIdx* pBlockIdx = NULL;
+ int32_t i = 0;
for (int32_t i = 0; i < num; ++i) {
pBlockIdx = (SBlockIdx*)taosArrayGet(aBlockIdx, i);
if (pBlockIdx->suid != pReader->suid) {
@@ -3170,7 +3170,7 @@ static int32_t doSumFileBlockRows(STsdbReader* pReader, SDataFReader* pFileReade
continue;
}
- STableBlockScanInfo *pScanInfo = *p;
+ STableBlockScanInfo* pScanInfo = *p;
tMapDataReset(&pScanInfo->mapData);
tsdbReadDataBlk(pReader->pFileReader, pBlockIdx, &pScanInfo->mapData);
@@ -3186,15 +3186,14 @@ _end:
return code;
}
-
static int32_t doSumSttBlockRows(STsdbReader* pReader) {
- int32_t code = TSDB_CODE_SUCCESS;
- SLastBlockReader* pLastBlockReader = pReader->status.fileIter.pLastBlockReader;
- SSttBlockLoadInfo* pBlockLoadInfo = NULL;
+ int32_t code = TSDB_CODE_SUCCESS;
+ SLastBlockReader* pLastBlockReader = pReader->status.fileIter.pLastBlockReader;
+ SSttBlockLoadInfo* pBlockLoadInfo = NULL;
for (int32_t i = 0; i < pReader->pFileReader->pSet->nSttF; ++i) { // open all last file
pBlockLoadInfo = &pLastBlockReader->pInfo[i];
-
+
code = tsdbReadSttBlk(pReader->pFileReader, i, pBlockLoadInfo->aSttBlk);
if (code) {
return code;
@@ -3202,9 +3201,9 @@ static int32_t doSumSttBlockRows(STsdbReader* pReader) {
size_t size = taosArrayGetSize(pBlockLoadInfo->aSttBlk);
if (size >= 1) {
- SSttBlk *pStart = taosArrayGet(pBlockLoadInfo->aSttBlk, 0);
- SSttBlk *pEnd = taosArrayGet(pBlockLoadInfo->aSttBlk, size - 1);
-
+ SSttBlk* pStart = taosArrayGet(pBlockLoadInfo->aSttBlk, 0);
+ SSttBlk* pEnd = taosArrayGet(pBlockLoadInfo->aSttBlk, size - 1);
+
// all identical
if (pStart->suid == pEnd->suid) {
if (pStart->suid != pReader->suid) {
@@ -3213,17 +3212,17 @@ static int32_t doSumSttBlockRows(STsdbReader* pReader) {
continue;
}
for (int32_t i = 0; i < size; ++i) {
- SSttBlk *p = taosArrayGet(pBlockLoadInfo->aSttBlk, i);
+ SSttBlk* p = taosArrayGet(pBlockLoadInfo->aSttBlk, i);
pReader->rowsNum += p->nRow;
}
} else {
for (int32_t i = 0; i < size; ++i) {
- SSttBlk *p = taosArrayGet(pBlockLoadInfo->aSttBlk, i);
+ SSttBlk* p = taosArrayGet(pBlockLoadInfo->aSttBlk, i);
uint64_t s = p->suid;
if (s < pReader->suid) {
continue;
}
-
+
if (s == pReader->suid) {
pReader->rowsNum += p->nRow;
} else if (s > pReader->suid) {
@@ -3238,7 +3237,7 @@ static int32_t doSumSttBlockRows(STsdbReader* pReader) {
}
static int32_t readRowsCountFromFiles(STsdbReader* pReader) {
- int32_t code = TSDB_CODE_SUCCESS;
+ int32_t code = TSDB_CODE_SUCCESS;
while (1) {
bool hasNext = false;
@@ -3259,7 +3258,7 @@ static int32_t readRowsCountFromFiles(STsdbReader* pReader) {
code = doSumSttBlockRows(pReader);
if (code != TSDB_CODE_SUCCESS) {
return code;
- }
+ }
}
pReader->status.loadFromFile = false;
@@ -3268,8 +3267,8 @@ static int32_t readRowsCountFromFiles(STsdbReader* pReader) {
}
static int32_t readRowsCountFromMem(STsdbReader* pReader) {
- int32_t code = TSDB_CODE_SUCCESS;
- int64_t memNum = 0, imemNum = 0;
+ int32_t code = TSDB_CODE_SUCCESS;
+ int64_t memNum = 0, imemNum = 0;
if (pReader->pReadSnap->pMem != NULL) {
tsdbMemTableCountRows(pReader->pReadSnap->pMem, pReader->status.pTableMap, &memNum);
}
@@ -3283,7 +3282,6 @@ static int32_t readRowsCountFromMem(STsdbReader* pReader) {
return code;
}
-
static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) {
SReaderStatus* pStatus = &pReader->status;
STableUidList* pUidList = &pStatus->uidList;
@@ -4000,7 +3998,7 @@ int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pR
int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pTSRow, STableBlockScanInfo* pScanInfo) {
int32_t outputRowIndex = pBlock->info.rows;
int64_t uid = pScanInfo->uid;
- int32_t code = TSDB_CODE_SUCCESS;
+ int32_t code = TSDB_CODE_SUCCESS;
int32_t numOfCols = (int32_t)taosArrayGetSize(pBlock->pDataBlock);
@@ -4106,7 +4104,7 @@ int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pReader, S
int32_t buildDataBlockFromBufImpl(STableBlockScanInfo* pBlockScanInfo, int64_t endKey, int32_t capacity,
STsdbReader* pReader) {
SSDataBlock* pBlock = pReader->pResBlock;
- int32_t code = TSDB_CODE_SUCCESS;
+ int32_t code = TSDB_CODE_SUCCESS;
do {
// SRow* pTSRow = NULL;
@@ -4342,7 +4340,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
if (countOnly) {
pReader->readMode = READ_MODE_COUNT_ONLY;
}
-
+
tsdbDebug("%p total numOfTable:%d in this query %s", pReader, numOfTables, pReader->idStr);
return code;
@@ -4644,7 +4642,7 @@ _err:
}
static bool tsdbReadRowsCountOnly(STsdbReader* pReader) {
- int32_t code = TSDB_CODE_SUCCESS;
+ int32_t code = TSDB_CODE_SUCCESS;
SSDataBlock* pBlock = pReader->pResBlock;
if (pReader->status.loadFromFile == false) {
@@ -4664,15 +4662,15 @@ static bool tsdbReadRowsCountOnly(STsdbReader* pReader) {
pBlock->info.rows = pReader->rowsNum;
pBlock->info.id.uid = 0;
pBlock->info.dataLoad = 0;
-
+
pReader->rowsNum = 0;
-
+
return pBlock->info.rows > 0;
}
-static int32_t doTsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
+static int32_t doTsdbNextDataBlock(STsdbReader* pReader, bool* hasNext) {
int32_t code = TSDB_CODE_SUCCESS;
-
+
// cleanup the data that belongs to the previous data block
SSDataBlock* pBlock = pReader->pResBlock;
blockDataCleanup(pBlock);
@@ -4707,11 +4705,11 @@ static int32_t doTsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
return code;
}
-int32_t tsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
+int32_t tsdbNextDataBlock(STsdbReader* pReader, bool* hasNext) {
int32_t code = TSDB_CODE_SUCCESS;
*hasNext = false;
-
+
if (isEmptyQueryTimeWindow(&pReader->window) || pReader->step == EXTERNAL_ROWS_NEXT) {
return code;
}
@@ -4731,7 +4729,7 @@ int32_t tsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
tsdbReleaseReader(pReader);
return code;
}
-
+
pReader->step = EXTERNAL_ROWS_PREV;
if (*hasNext) {
pStatus = &pReader->innerReader[0]->status;
@@ -4762,7 +4760,7 @@ int32_t tsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
tsdbReleaseReader(pReader);
return code;
}
-
+
if (*hasNext) {
if (pStatus->composedDataBlock) {
qTrace("tsdb/read: %p, unlock read mutex", pReader);
@@ -4786,7 +4784,7 @@ int32_t tsdbNextDataBlock(STsdbReader* pReader, bool *hasNext) {
tsdbReleaseReader(pReader);
return code;
}
-
+
pReader->step = EXTERNAL_ROWS_NEXT;
if (*hasNext) {
pStatus = &pReader->innerReader[1]->status;
@@ -5062,7 +5060,7 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
}
static int32_t getBucketIndex(int32_t startRow, int32_t bucketRange, int32_t numOfRows, int32_t numOfBucket) {
- int32_t bucketIndex = (numOfRows - startRow) / bucketRange;
+ int32_t bucketIndex = ((numOfRows - startRow) / bucketRange);
if (bucketIndex == numOfBucket) {
bucketIndex -= 1;
}
@@ -5075,7 +5073,9 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->totalRows = 0;
pTableBlockInfo->numOfVgroups = 1;
- const int32_t numOfBucket = 20.0;
+ const int32_t numOfBuckets = 20.0;
+
+ // find the start data block in file
// find the start data block in file
tsdbAcquireReader(pReader);
@@ -5088,7 +5088,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->defMinRows = pc->minRows;
pTableBlockInfo->defMaxRows = pc->maxRows;
- int32_t bucketRange = ceil(((double)(pc->maxRows - pc->minRows)) / numOfBucket);
+ int32_t bucketRange = ceil(((double)(pc->maxRows - pc->minRows)) / numOfBuckets);
pTableBlockInfo->numOfFiles += 1;
@@ -5126,7 +5126,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->totalSize += pBlock->aSubBlock[0].szBlock;
- int32_t bucketIndex = getBucketIndex(pTableBlockInfo->defMinRows, bucketRange, numOfRows, numOfBucket);
+ int32_t bucketIndex = getBucketIndex(pTableBlockInfo->defMinRows, bucketRange, numOfRows, numOfBuckets);
pTableBlockInfo->blockRowsHisto[bucketIndex]++;
hasNext = blockIteratorNext(&pStatus->blockIter, pReader->idStr);
diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c
index 718b5979a156dae1cb043d2dc1a27fca2801fbb3..02d361ccdb0715f539dd2572e730cd1fd89bff81 100644
--- a/source/dnode/vnode/src/vnd/vnodeSvr.c
+++ b/source/dnode/vnode/src/vnd/vnodeSvr.c
@@ -1471,10 +1471,11 @@ static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t version, void
}
vInfo("vgId:%d, start to alter vnode config, page:%d pageSize:%d buffer:%d szPage:%d szBuf:%" PRIu64
- " cacheLast:%d cacheLastSize:%d days:%d keep0:%d keep1:%d keep2:%d fsync:%d level:%d",
+ " cacheLast:%d cacheLastSize:%d days:%d keep0:%d keep1:%d keep2:%d fsync:%d level:%d walRetentionPeriod:%d "
+ "walRetentionSize:%d",
TD_VID(pVnode), req.pages, req.pageSize, req.buffer, req.pageSize * 1024, (uint64_t)req.buffer * 1024 * 1024,
req.cacheLast, req.cacheLastSize, req.daysPerFile, req.daysToKeep0, req.daysToKeep1, req.daysToKeep2,
- req.walFsyncPeriod, req.walLevel);
+ req.walFsyncPeriod, req.walLevel, req.walRetentionPeriod, req.walRetentionSize);
if (pVnode->config.cacheLastSize != req.cacheLastSize) {
pVnode->config.cacheLastSize = req.cacheLastSize;
@@ -1504,13 +1505,21 @@ static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t version, void
if (pVnode->config.walCfg.fsyncPeriod != req.walFsyncPeriod) {
pVnode->config.walCfg.fsyncPeriod = req.walFsyncPeriod;
-
walChanged = true;
}
if (pVnode->config.walCfg.level != req.walLevel) {
pVnode->config.walCfg.level = req.walLevel;
+ walChanged = true;
+ }
+
+ if (pVnode->config.walCfg.retentionPeriod != req.walRetentionPeriod) {
+ pVnode->config.walCfg.retentionPeriod = req.walRetentionPeriod;
+ walChanged = true;
+ }
+ if (pVnode->config.walCfg.retentionSize != req.walRetentionSize) {
+ pVnode->config.walCfg.retentionSize = req.walRetentionSize;
walChanged = true;
}
diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h
index 8fc7df63be2204f872bcf0eca8def42deb819d9e..c4e1fd3078b18d74df3e89a4a9ea2d82f26cef0e 100644
--- a/source/libs/catalog/inc/catalogInt.h
+++ b/source/libs/catalog/inc/catalogInt.h
@@ -43,6 +43,32 @@ extern "C" {
#define CTG_BATCH_FETCH 1
+typedef enum {
+ CTG_CI_CLUSTER = 0,
+ CTG_CI_DNODE,
+ CTG_CI_QNODE,
+ CTG_CI_DB,
+ CTG_CI_DB_VGROUP,
+ CTG_CI_DB_CFG,
+ CTG_CI_DB_INFO,
+ CTG_CI_STABLE_META,
+ CTG_CI_NTABLE_META,
+ CTG_CI_CTABLE_META,
+ CTG_CI_SYSTABLE_META,
+ CTG_CI_OTHERTABLE_META,
+ CTG_CI_TBL_SMA,
+ CTG_CI_TBL_CFG,
+ CTG_CI_INDEX_INFO,
+ CTG_CI_USER,
+ CTG_CI_UDF,
+ CTG_CI_SVR_VER,
+ CTG_CI_MAX_VALUE,
+} CTG_CACHE_ITEM;
+
+#define CTG_CI_FLAG_LEVEL_GLOBAL (1)
+#define CTG_CI_FLAG_LEVEL_CLUSTER (1<<1)
+#define CTG_CI_FLAG_LEVEL_DB (1<<2)
+
enum {
CTG_READ = 1,
CTG_WRITE,
@@ -76,9 +102,9 @@ typedef enum {
CTG_TASK_GET_DB_INFO,
CTG_TASK_GET_TB_META,
CTG_TASK_GET_TB_HASH,
- CTG_TASK_GET_TB_INDEX,
+ CTG_TASK_GET_TB_SMA_INDEX,
CTG_TASK_GET_TB_CFG,
- CTG_TASK_GET_INDEX,
+ CTG_TASK_GET_INDEX_INFO,
CTG_TASK_GET_UDF,
CTG_TASK_GET_USER,
CTG_TASK_GET_SVR_VER,
@@ -96,9 +122,16 @@ typedef struct SCtgDebug {
bool cacheEnable;
bool apiEnable;
bool metaEnable;
+ bool statEnable;
uint32_t showCachePeriodSec;
} SCtgDebug;
+typedef struct SCtgCacheStat {
+ uint64_t cacheNum[CTG_CI_MAX_VALUE];
+ uint64_t cacheHit[CTG_CI_MAX_VALUE];
+ uint64_t cacheNHit[CTG_CI_MAX_VALUE];
+} SCtgCacheStat;
+
typedef struct SCtgTbCacheInfo {
bool inCache;
uint64_t dbId;
@@ -191,12 +224,13 @@ typedef struct SCtgVgCache {
} SCtgVgCache;
typedef struct SCtgDBCache {
- SRWLatch dbLock; // RC between destroy tbCache/stbCache and all reads
- uint64_t dbId;
- int8_t deleted;
- SCtgVgCache vgCache;
- SHashObj* tbCache; // key:tbname, value:SCtgTbCache
- SHashObj* stbCache; // key:suid, value:char*
+ SRWLatch dbLock; // RC between destroy tbCache/stbCache and all reads
+ uint64_t dbId;
+ int8_t deleted;
+ SCtgVgCache vgCache;
+ SHashObj* tbCache; // key:tbname, value:SCtgTbCache
+ SHashObj* stbCache; // key:suid, value:char*
+ uint64_t dbCacheNum[CTG_CI_MAX_VALUE];
} SCtgDBCache;
typedef struct SCtgRentSlot {
@@ -223,12 +257,13 @@ typedef struct SCtgUserAuth {
} SCtgUserAuth;
typedef struct SCatalog {
- uint64_t clusterId;
- bool stopUpdate;
- SHashObj* userCache; // key:user, value:SCtgUserAuth
- SHashObj* dbCache; // key:dbname, value:SCtgDBCache
- SCtgRentMgmt dbRent;
- SCtgRentMgmt stbRent;
+ uint64_t clusterId;
+ bool stopUpdate;
+ SHashObj* userCache; // key:user, value:SCtgUserAuth
+ SHashObj* dbCache; // key:dbname, value:SCtgDBCache
+ SCtgRentMgmt dbRent;
+ SCtgRentMgmt stbRent;
+ SCtgCacheStat cacheStat;
} SCatalog;
typedef struct SCtgBatch {
@@ -347,25 +382,9 @@ typedef struct SCtgRuntimeStat {
uint64_t numOfOpAbort;
uint64_t numOfOpEnqueue;
uint64_t numOfOpDequeue;
+ uint64_t numOfOpClearCache;
} SCtgRuntimeStat;
-typedef struct SCtgCacheStat {
- uint64_t numOfCluster;
- uint64_t numOfDb;
- uint64_t numOfTbl;
- uint64_t numOfStb;
- uint64_t numOfUser;
- uint64_t numOfVgHit;
- uint64_t numOfVgMiss;
- uint64_t numOfMetaHit;
- uint64_t numOfMetaMiss;
- uint64_t numOfIndexHit;
- uint64_t numOfIndexMiss;
- uint64_t numOfUserHit;
- uint64_t numOfUserMiss;
- uint64_t numOfClear;
-} SCtgCacheStat;
-
typedef struct SCatalogStat {
SCtgApiStat api;
SCtgRuntimeStat runtime;
@@ -472,7 +491,7 @@ typedef struct SCatalogMgmt {
SCtgQueue queue;
TdThread updateThread;
SHashObj* pCluster; // key: clusterId, value: SCatalog*
- SCatalogStat stat;
+ SCatalogStat statInfo;
SCatalogCfg cfg;
} SCatalogMgmt;
@@ -485,6 +504,11 @@ typedef struct SCtgOperation {
ctgOpFunc func;
} SCtgOperation;
+typedef struct SCtgCacheItemInfo {
+ char *name;
+ int32_t flag;
+} SCtgCacheItemInfo;
+
#define CTG_AUTH_READ(_t) ((_t) == AUTH_TYPE_READ || (_t) == AUTH_TYPE_READ_OR_WRITE)
#define CTG_AUTH_WRITE(_t) ((_t) == AUTH_TYPE_WRITE || (_t) == AUTH_TYPE_READ_OR_WRITE)
@@ -495,9 +519,87 @@ typedef struct SCtgOperation {
#define CTG_STAT_DEC(_item, _n) atomic_sub_fetch_64(&(_item), _n)
#define CTG_STAT_GET(_item) atomic_load_64(&(_item))
-#define CTG_RT_STAT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.stat.runtime.item, n))
-#define CTG_CACHE_STAT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.stat.cache.item, n))
-#define CTG_CACHE_STAT_DEC(item, n) (CTG_STAT_DEC(gCtgMgmt.stat.cache.item, n))
+#define CTG_DB_NUM_INC(_item) dbCache->dbCacheNum[_item] += 1
+#define CTG_DB_NUM_DEC(_item) dbCache->dbCacheNum[_item] -= 1
+#define CTG_DB_NUM_SET(_item) dbCache->dbCacheNum[_item] = 1
+#define CTG_DB_NUM_RESET(_item) dbCache->dbCacheNum[_item] = 0
+
+#define CTG_STAT_API_INC(item, n) (CTG_STAT_INC(gCtgMgmt.statInfo.api.item, n))
+#define CTG_STAT_RT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.statInfo.runtime.item, n))
+#define CTG_STAT_NUM_INC(item, n) (CTG_STAT_INC(gCtgMgmt.statInfo.cache.cacheNum[item], n))
+#define CTG_STAT_NUM_DEC(item, n) (CTG_STAT_DEC(gCtgMgmt.statInfo.cache.cacheNum[item], n))
+#define CTG_STAT_HIT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.statInfo.cache.cacheHit[item], n))
+#define CTG_STAT_HIT_DEC(item, n) (CTG_STAT_DEC(gCtgMgmt.statInfo.cache.cacheHit[item], n))
+#define CTG_STAT_NHIT_INC(item, n) (CTG_STAT_INC(gCtgMgmt.statInfo.cache.cacheNHit[item], n))
+#define CTG_STAT_NHIT_DEC(item, n) (CTG_STAT_DEC(gCtgMgmt.statInfo.cache.cacheNHit[item], n))
+
+#define CTG_CACHE_NUM_INC(item, n) (CTG_STAT_INC(pCtg->cacheStat.cacheNum[item], n))
+#define CTG_CACHE_NUM_DEC(item, n) (CTG_STAT_DEC(pCtg->cacheStat.cacheNum[item], n))
+#define CTG_CACHE_HIT_INC(item, n) (CTG_STAT_INC(pCtg->cacheStat.cacheHit[item], n))
+#define CTG_CACHE_NHIT_INC(item, n) (CTG_STAT_INC(pCtg->cacheStat.cacheNHit[item], n))
+
+#define CTG_META_NUM_INC(type) do { \
+ switch (type) { \
+ case TSDB_SUPER_TABLE: \
+ CTG_DB_NUM_INC(CTG_CI_STABLE_META); \
+ break; \
+ case TSDB_CHILD_TABLE: \
+ CTG_DB_NUM_INC(CTG_CI_CTABLE_META); \
+ break; \
+ case TSDB_NORMAL_TABLE: \
+ CTG_DB_NUM_INC(CTG_CI_NTABLE_META); \
+ break; \
+ case TSDB_SYSTEM_TABLE: \
+ CTG_DB_NUM_INC(CTG_CI_SYSTABLE_META); \
+ break; \
+ default: \
+ CTG_DB_NUM_INC(CTG_CI_OTHERTABLE_META); \
+ break; \
+ } \
+} while (0)
+
+#define CTG_META_NUM_DEC(type) do { \
+ switch (type) { \
+ case TSDB_SUPER_TABLE: \
+ CTG_DB_NUM_DEC(CTG_CI_STABLE_META); \
+ break; \
+ case TSDB_CHILD_TABLE: \
+ CTG_DB_NUM_DEC(CTG_CI_CTABLE_META); \
+ break; \
+ case TSDB_NORMAL_TABLE: \
+ CTG_DB_NUM_DEC(CTG_CI_NTABLE_META); \
+ break; \
+ case TSDB_SYSTEM_TABLE: \
+ CTG_DB_NUM_DEC(CTG_CI_SYSTABLE_META); \
+ break; \
+ default: \
+ CTG_DB_NUM_DEC(CTG_CI_OTHERTABLE_META); \
+ break; \
+ } \
+} while (0)
+
+#define CTG_META_HIT_INC(type) do { \
+ switch (type) { \
+ case TSDB_SUPER_TABLE: \
+ CTG_CACHE_HIT_INC(CTG_CI_STABLE_META, 1); \
+ break; \
+ case TSDB_CHILD_TABLE: \
+ CTG_CACHE_HIT_INC(CTG_CI_CTABLE_META, 1); \
+ break; \
+ case TSDB_NORMAL_TABLE: \
+ CTG_CACHE_HIT_INC(CTG_CI_NTABLE_META, 1); \
+ break; \
+ case TSDB_SYSTEM_TABLE: \
+ CTG_CACHE_HIT_INC(CTG_CI_SYSTABLE_META, 1); \
+ break; \
+ default: \
+ CTG_CACHE_HIT_INC(CTG_CI_OTHERTABLE_META, 1); \
+ break; \
+ } \
+} while (0)
+
+#define CTG_META_NHIT_INC() CTG_CACHE_NHIT_INC(CTG_CI_OTHERTABLE_META, 1)
+
#define CTG_IS_META_NULL(type) ((type) == META_TYPE_NULL_TABLE)
#define CTG_IS_META_CTABLE(type) ((type) == META_TYPE_CTABLE)
@@ -682,6 +784,7 @@ typedef struct SCtgOperation {
void ctgdShowTableMeta(SCatalog* pCtg, const char* tbName, STableMeta* p);
void ctgdShowClusterCache(SCatalog* pCtg);
int32_t ctgdShowCacheInfo(void);
+int32_t ctgdShowStatInfo(void);
int32_t ctgRemoveTbMetaFromCache(SCatalog* pCtg, SName* pTableName, bool syncReq);
int32_t ctgGetTbMetaFromCache(SCatalog* pCtg, SCtgTbMetaCtx* ctx, STableMeta** pTableMeta);
@@ -806,10 +909,12 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
int32_t ctgCopyTbMeta(SCatalog *pCtg, SCtgTbMetaCtx *ctx, SCtgDBCache **pDb, SCtgTbCache **pTb, STableMeta **pTableMeta, char* dbFName);
void ctgReleaseVgMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache *pCache);
void ctgReleaseTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, SCtgTbCache *pCache);
+void ctgGetGlobalCacheStat(SCtgCacheStat *pStat);
extern SCatalogMgmt gCtgMgmt;
extern SCtgDebug gCTGDebug;
extern SCtgAsyncFps gCtgAsyncFps[];
+extern SCtgCacheItemInfo gCtgStatItem[CTG_CI_MAX_VALUE];
#ifdef __cplusplus
}
diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c
index f9a218835ea77d4a20aa1b7ac8086187c995c561..8a56b0889b679b750e7077662dbbc4361e478310 100644
--- a/source/libs/catalog/src/catalog.c
+++ b/source/libs/catalog/src/catalog.c
@@ -721,10 +721,13 @@ int32_t catalogGetHandle(uint64_t clusterId, SCatalog** catalogHandle) {
if (ctg && (*ctg)) {
*catalogHandle = *ctg;
+ CTG_STAT_HIT_INC(CTG_CI_CLUSTER, 1);
qDebug("got catalog handle from cache, clusterId:0x%" PRIx64 ", CTG:%p", clusterId, *ctg);
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
}
+ CTG_STAT_NHIT_INC(CTG_CI_CLUSTER, 1);
+
clusterCtg = taosMemoryCalloc(1, sizeof(SCatalog));
if (NULL == clusterCtg) {
qError("calloc %d failed", (int32_t)sizeof(SCatalog));
@@ -768,7 +771,7 @@ int32_t catalogGetHandle(uint64_t clusterId, SCatalog** catalogHandle) {
*catalogHandle = clusterCtg;
- CTG_CACHE_STAT_INC(numOfCluster, 1);
+ CTG_STAT_NUM_INC(CTG_CI_CLUSTER, 1);
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
@@ -1301,6 +1304,7 @@ int32_t catalogGetQnodeList(SCatalog* pCtg, SRequestConnInfo* pConn, SArray* pQn
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
+ CTG_CACHE_NHIT_INC(CTG_CI_QNODE, 1);
CTG_ERR_JRET(ctgGetQnodeListFromMnode(pCtg, pConn, pQnodeList, NULL));
_return:
@@ -1316,6 +1320,7 @@ int32_t catalogGetDnodeList(SCatalog* pCtg, SRequestConnInfo* pConn, SArray** pD
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
+ CTG_CACHE_NHIT_INC(CTG_CI_DNODE, 1);
CTG_ERR_JRET(ctgGetDnodeListFromMnode(pCtg, pConn, pDnodeList, NULL));
_return:
@@ -1388,6 +1393,8 @@ int32_t catalogGetDBCfg(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbF
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_CFG, 1);
+
CTG_API_LEAVE(ctgGetDBCfgFromMnode(pCtg, pConn, dbFName, pDbCfg, NULL));
}
@@ -1440,6 +1447,8 @@ int32_t catalogGetUdfInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* f
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
+ CTG_CACHE_NHIT_INC(CTG_CI_UDF, 1);
+
int32_t code = 0;
CTG_ERR_JRET(ctgGetUdfInfoFromMnode(pCtg, pConn, funcName, pInfo, NULL));
@@ -1488,6 +1497,8 @@ int32_t catalogGetServerVersion(SCatalog* pCtg, SRequestConnInfo* pConn, char**
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
+ CTG_CACHE_NHIT_INC(CTG_CI_SVR_VER, 1);
+
int32_t code = 0;
CTG_ERR_JRET(ctgGetSvrVerFromMnode(pCtg, pConn, pVersion, NULL));
diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c
index f62e93b82a9374ae751cb9e4b5bbde797d62e200..6c5666193753aea698559937c660022a5650bbbb 100644
--- a/source/libs/catalog/src/ctgAsync.c
+++ b/source/libs/catalog/src/ctgAsync.c
@@ -241,7 +241,7 @@ int32_t ctgInitGetIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
char* name = (char*)param;
SCtgTask task = {0};
- task.type = CTG_TASK_GET_INDEX;
+ task.type = CTG_TASK_GET_INDEX_INFO;
task.taskId = taskIdx;
task.pJob = pJob;
@@ -330,7 +330,7 @@ int32_t ctgInitGetTbIndexTask(SCtgJob* pJob, int32_t taskIdx, void* param) {
SName* name = (SName*)param;
SCtgTask task = {0};
- task.type = CTG_TASK_GET_TB_INDEX;
+ task.type = CTG_TASK_GET_TB_SMA_INDEX;
task.taskId = taskIdx;
task.pJob = pJob;
@@ -596,7 +596,7 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
for (int32_t i = 0; i < tbIndexNum; ++i) {
SName* name = taosArrayGet(pReq->pTableIndex, i);
- CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_TB_INDEX, name, NULL));
+ CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_TB_SMA_INDEX, name, NULL));
}
for (int32_t i = 0; i < tbCfgNum; ++i) {
@@ -606,7 +606,7 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob** job, const
for (int32_t i = 0; i < indexNum; ++i) {
char* indexName = taosArrayGet(pReq->pIndex, i);
- CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_INDEX, indexName, NULL));
+ CTG_ERR_JRET(ctgInitTask(pJob, CTG_TASK_GET_INDEX_INFO, indexName, NULL));
}
for (int32_t i = 0; i < udfNum; ++i) {
@@ -1925,6 +1925,8 @@ int32_t ctgLaunchGetTbCfgTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_TBL_CFG, 1);
+
if (pCtx->tbType <= 0) {
CTG_ERR_JRET(ctgReadTbTypeFromCache(pCtg, dbFName, pCtx->pName->tname, &pCtx->tbType));
if (pCtx->tbType <= 0) {
@@ -1967,6 +1969,7 @@ int32_t ctgLaunchGetQnodeTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_QNODE, 1);
CTG_ERR_RET(ctgGetQnodeListFromMnode(pCtg, pConn, NULL, pTask));
return TSDB_CODE_SUCCESS;
}
@@ -1980,6 +1983,7 @@ int32_t ctgLaunchGetDnodeTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_DNODE, 1);
CTG_ERR_RET(ctgGetDnodeListFromMnode(pCtg, pConn, NULL, pTask));
return TSDB_CODE_SUCCESS;
}
@@ -1994,6 +1998,8 @@ int32_t ctgLaunchGetDbCfgTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_CFG, 1);
+
CTG_ERR_RET(ctgGetDBCfgFromMnode(pCtg, pConn, pCtx->dbFName, NULL, pTask));
return TSDB_CODE_SUCCESS;
@@ -2023,10 +2029,14 @@ int32_t ctgLaunchGetDbInfoTask(SCtgTask* pTask) {
pInfo->tbNum = dbCache->vgCache.vgInfo->numOfTable;
pInfo->stateTs = dbCache->vgCache.vgInfo->stateTs;
+ CTG_CACHE_HIT_INC(CTG_CI_DB_INFO, 1);
+
ctgReleaseVgInfoToCache(pCtg, dbCache);
dbCache = NULL;
} else {
pInfo->vgVer = CTG_DEFAULT_INVALID_VERSION;
+
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_INFO, 1);
}
CTG_ERR_JRET(ctgHandleTaskEnd(pTask, 0));
@@ -2046,6 +2056,8 @@ int32_t ctgLaunchGetIndexTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_INDEX_INFO, 1);
+
CTG_ERR_RET(ctgGetIndexInfoFromMnode(pCtg, pConn, pCtx->indexFName, NULL, pTask));
return TSDB_CODE_SUCCESS;
@@ -2061,6 +2073,8 @@ int32_t ctgLaunchGetUdfTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_UDF, 1);
+
CTG_ERR_RET(ctgGetUdfInfoFromMnode(pCtg, pConn, pCtx->udfName, NULL, pTask));
return TSDB_CODE_SUCCESS;
@@ -2104,6 +2118,8 @@ int32_t ctgLaunchGetSvrVerTask(SCtgTask* pTask) {
pMsgCtx->pBatchs = pJob->pBatchs;
}
+ CTG_CACHE_NHIT_INC(CTG_CI_SVR_VER, 1);
+
CTG_ERR_RET(ctgGetSvrVerFromMnode(pCtg, pConn, NULL, pTask));
return TSDB_CODE_SUCCESS;
diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c
index 7ff8afd6a510f16c6a47df25550c9d2dbd0e3543..b0321588651a73da880fa062c9b4e87baa478955 100644
--- a/source/libs/catalog/src/ctgCache.c
+++ b/source/libs/catalog/src/ctgCache.c
@@ -31,6 +31,28 @@ SCtgOperation gCtgCacheOperation[CTG_OP_MAX] = {{CTG_OP_UPDATE_VGROUP, "update v
{CTG_OP_DROP_TB_INDEX, "drop tbIndex", ctgOpDropTbIndex},
{CTG_OP_CLEAR_CACHE, "clear cache", ctgOpClearCache}};
+SCtgCacheItemInfo gCtgStatItem[CTG_CI_MAX_VALUE] = {
+ {"Cluster ", CTG_CI_FLAG_LEVEL_GLOBAL}, //CTG_CI_CLUSTER
+ {"Dnode ", CTG_CI_FLAG_LEVEL_CLUSTER}, //CTG_CI_DNODE,
+ {"Qnode ", CTG_CI_FLAG_LEVEL_CLUSTER}, //CTG_CI_QNODE,
+ {"DB ", CTG_CI_FLAG_LEVEL_CLUSTER}, //CTG_CI_DB,
+ {"DbVgroup ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_DB_VGROUP,
+ {"DbCfg ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_DB_CFG,
+ {"DbInfo ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_DB_INFO,
+ {"StbMeta ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_STABLE_META,
+ {"NtbMeta ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_NTABLE_META,
+ {"CtbMeta ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_CTABLE_META,
+ {"SysTblMeta", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_SYSTABLE_META,
+ {"OthTblMeta", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_OTHERTABLE_META,
+ {"TblSMA ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_TBL_SMA,
+ {"TblCfg ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_TBL_CFG,
+ {"IndexInfo ", CTG_CI_FLAG_LEVEL_DB}, //CTG_CI_INDEX_INFO,
+ {"User ", CTG_CI_FLAG_LEVEL_CLUSTER}, //CTG_CI_USER,
+ {"UDF ", CTG_CI_FLAG_LEVEL_CLUSTER}, //CTG_CI_UDF,
+ {"SvrVer ", CTG_CI_FLAG_LEVEL_CLUSTER} //CTG_CI_SVR_VER,
+};
+
+
int32_t ctgRLockVgInfo(SCatalog *pCtg, SCtgDBCache *dbCache, bool *inCache) {
CTG_LOCK(CTG_READ, &dbCache->vgCache.vgLock);
@@ -93,6 +115,7 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
if (NULL == dbCache) {
*pCache = NULL;
+ CTG_CACHE_NHIT_INC(CTG_CI_DB, 1);
ctgDebug("db not in cache, dbFName:%s", dbFName);
return TSDB_CODE_SUCCESS;
}
@@ -107,11 +130,13 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
}
*pCache = NULL;
+ CTG_CACHE_NHIT_INC(CTG_CI_DB, 1);
ctgDebug("db is removing from cache, dbFName:%s", dbFName);
return TSDB_CODE_SUCCESS;
}
*pCache = dbCache;
+ CTG_CACHE_HIT_INC(CTG_CI_DB, 1);
return TSDB_CODE_SUCCESS;
}
@@ -180,7 +205,7 @@ int32_t ctgAcquireVgInfoFromCache(SCatalog *pCtg, const char *dbFName, SCtgDBCac
*pCache = dbCache;
- CTG_CACHE_STAT_INC(numOfVgHit, 1);
+ CTG_CACHE_HIT_INC(CTG_CI_DB_VGROUP, 1);
ctgDebug("Got db vgInfo from cache, dbFName:%s", dbFName);
@@ -194,7 +219,7 @@ _return:
*pCache = NULL;
- CTG_CACHE_STAT_INC(numOfVgMiss, 1);
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_VGROUP, 1);
return TSDB_CODE_SUCCESS;
}
@@ -225,7 +250,7 @@ int32_t ctgAcquireTbMetaFromCache(SCatalog *pCtg, char *dbFName, char *tbName, S
ctgDebug("tb %s meta got in cache, dbFName:%s", tbName, dbFName);
- CTG_CACHE_STAT_INC(numOfMetaHit, 1);
+ CTG_META_HIT_INC(pCache->pMeta->tableType);
return TSDB_CODE_SUCCESS;
@@ -233,7 +258,7 @@ _return:
ctgReleaseTbMetaToCache(pCtg, dbCache, pCache);
- CTG_CACHE_STAT_INC(numOfMetaMiss, 1);
+ CTG_META_NHIT_INC();
return TSDB_CODE_SUCCESS;
}
@@ -246,34 +271,34 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
ctgAcquireDBCache(pCtg, dbFName, &dbCache);
if (NULL == dbCache) {
ctgDebug("db %s not in cache", dbFName);
- CTG_CACHE_STAT_INC(numOfVgMiss, 1);
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_VGROUP, 1);
goto _return;
}
ctgRLockVgInfo(pCtg, dbCache, &vgInCache);
if (!vgInCache) {
ctgDebug("vgInfo of db %s not in cache", dbFName);
- CTG_CACHE_STAT_INC(numOfVgMiss, 1);
+ CTG_CACHE_NHIT_INC(CTG_CI_DB_VGROUP, 1);
goto _return;
}
*pDb = dbCache;
- CTG_CACHE_STAT_INC(numOfVgHit, 1);
+ CTG_CACHE_HIT_INC(CTG_CI_DB_VGROUP, 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);
+ CTG_META_NHIT_INC();
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);
+ CTG_META_NHIT_INC();
goto _return;
}
@@ -281,7 +306,7 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
ctgDebug("tb %s meta got in cache, dbFName:%s", tbName, dbFName);
- CTG_CACHE_STAT_INC(numOfMetaHit, 1);
+ CTG_META_HIT_INC(tbCache->pMeta->tableType);
return TSDB_CODE_SUCCESS;
@@ -343,7 +368,7 @@ int32_t ctgAcquireStbMetaFromCache(SCatalog *pCtg, char *dbFName, uint64_t suid,
ctgDebug("stb 0x%" PRIx64 " meta got in cache, dbFName:%s", suid, dbFName);
- CTG_CACHE_STAT_INC(numOfMetaHit, 1);
+ CTG_META_HIT_INC(pCache->pMeta->tableType, 1);
return TSDB_CODE_SUCCESS;
@@ -351,7 +376,7 @@ _return:
ctgReleaseTbMetaToCache(pCtg, dbCache, pCache);
- CTG_CACHE_STAT_INC(numOfMetaMiss, 1);
+ CTG_META_NHIT_INC(1);
*pDb = NULL;
*pTb = NULL;
@@ -387,7 +412,7 @@ int32_t ctgAcquireStbMetaFromCache(SCtgDBCache *dbCache, SCatalog *pCtg, char *d
ctgDebug("stb 0x%" PRIx64 " meta got in cache, dbFName:%s", suid, dbFName);
- CTG_CACHE_STAT_INC(numOfMetaHit, 1);
+ CTG_META_HIT_INC(pCache->pMeta->tableType);
return TSDB_CODE_SUCCESS;
@@ -395,7 +420,7 @@ _return:
ctgReleaseTbMetaToCache(pCtg, dbCache, pCache);
- CTG_CACHE_STAT_INC(numOfMetaMiss, 1);
+ CTG_META_NHIT_INC();
*pTb = NULL;
@@ -429,7 +454,7 @@ int32_t ctgAcquireTbIndexFromCache(SCatalog *pCtg, char *dbFName, char *tbName,
ctgDebug("tb %s index got in cache, dbFName:%s", tbName, dbFName);
- CTG_CACHE_STAT_INC(numOfIndexHit, 1);
+ CTG_CACHE_HIT_INC(CTG_CI_TBL_SMA, 1);
return TSDB_CODE_SUCCESS;
@@ -437,7 +462,7 @@ _return:
ctgReleaseTbIndexToCache(pCtg, dbCache, pCache);
- CTG_CACHE_STAT_INC(numOfIndexMiss, 1);
+ CTG_CACHE_NHIT_INC(CTG_CI_TBL_SMA, 1);
return TSDB_CODE_SUCCESS;
}
@@ -702,7 +727,7 @@ int32_t ctgChkAuthFromCache(SCatalog *pCtg, char *user, char *dbFName, AUTH_TYPE
*inCache = true;
ctgDebug("Got user from cache, user:%s", user);
- CTG_CACHE_STAT_INC(numOfUserHit, 1);
+ CTG_CACHE_HIT_INC(CTG_CI_USER, 1);
if (pUser->superUser) {
*pass = true;
@@ -731,7 +756,7 @@ int32_t ctgChkAuthFromCache(SCatalog *pCtg, char *user, char *dbFName, AUTH_TYPE
_return:
*inCache = false;
- CTG_CACHE_STAT_INC(numOfUserMiss, 1);
+ CTG_CACHE_NHIT_INC(CTG_CI_USER, 1);
return TSDB_CODE_SUCCESS;
}
@@ -784,7 +809,7 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
ctgDebug("action [%s] added into queue", opName);
CTG_QUEUE_INC();
- CTG_RT_STAT_INC(numOfOpEnqueue, 1);
+ CTG_STAT_RT_INC(numOfOpEnqueue, 1);
tsem_post(&gCtgMgmt.queue.reqSem);
@@ -1382,7 +1407,7 @@ int32_t ctgAddNewDBCache(SCatalog *pCtg, const char *dbFName, uint64_t dbId) {
CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
}
- CTG_CACHE_STAT_INC(numOfDb, 1);
+ CTG_CACHE_NUM_INC(CTG_CI_DB, 1);
SDbVgVersion vgVersion = {.dbId = newDBCache.dbId, .vgVersion = -1, .stateTs = 0};
tstrncpy(vgVersion.dbFName, dbFName, sizeof(vgVersion.dbFName));
@@ -1444,7 +1469,7 @@ int32_t ctgRemoveDBFromCache(SCatalog *pCtg, SCtgDBCache *dbCache, const char *d
CTG_ERR_RET(TSDB_CODE_CTG_DB_DROPPED);
}
- CTG_CACHE_STAT_DEC(numOfDb, 1);
+ CTG_CACHE_NUM_DEC(CTG_CI_DB, 1);
ctgInfo("db removed from cache, dbFName:%s, dbId:0x%" PRIx64, dbFName, dbId);
return TSDB_CODE_SUCCESS;
@@ -1542,7 +1567,6 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
if (taosHashRemove(dbCache->stbCache, &orig->suid, sizeof(orig->suid))) {
ctgError("stb not exist in stbCache, dbFName:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
} else {
- CTG_CACHE_STAT_DEC(numOfStb, 1);
ctgDebug("stb removed from stbCache, dbFName:%s, stb:%s, suid:0x%" PRIx64, dbFName, tbName, orig->suid);
}
}
@@ -1560,14 +1584,15 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
pCache = taosHashGet(dbCache->tbCache, tbName, strlen(tbName));
} else {
CTG_LOCK(CTG_WRITE, &pCache->metaLock);
+ if (orig) {
+ CTG_META_NUM_DEC(origType);
+ }
taosMemoryFree(pCache->pMeta);
pCache->pMeta = meta;
CTG_UNLOCK(CTG_WRITE, &pCache->metaLock);
}
- if (NULL == orig) {
- CTG_CACHE_STAT_INC(numOfTbl, 1);
- }
+ CTG_META_NUM_INC(pCache->pMeta->tableType);
ctgDebug("tbmeta updated to cache, dbFName:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
ctgdShowTableMeta(pCtg, tbName, meta);
@@ -1581,8 +1606,6 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
}
- CTG_CACHE_STAT_INC(numOfStb, 1);
-
ctgDebug("stb 0x%" PRIx64 " updated to cache, dbFName:%s, tbName:%s, tbType:%d", meta->suid, dbFName, tbName,
meta->tableType);
@@ -1615,6 +1638,8 @@ int32_t ctgWriteTbIndexToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNa
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
}
+ CTG_DB_NUM_INC(CTG_CI_TBL_SMA);
+
*index = NULL;
ctgDebug("table %s index updated to cache, ver:%d, num:%d", tbName, pIndex->version,
(int32_t)taosArrayGetSize(pIndex->pIndex));
@@ -1766,10 +1791,12 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
}
freeVgInfo(vgInfo);
+ CTG_DB_NUM_RESET(CTG_CI_DB_VGROUP);
}
vgCache->vgInfo = dbInfo;
msg->dbInfo = NULL;
+ CTG_DB_NUM_SET(CTG_CI_DB_VGROUP);
ctgDebug("db vgInfo updated, dbFName:%s, vgVer:%d, stateTs:%" PRId64 ", dbId:0x%" PRIx64, dbFName,
vgVersion.vgVersion, vgVersion.stateTs, vgVersion.dbId);
@@ -1842,6 +1869,7 @@ int32_t ctgOpDropDbVgroup(SCtgCacheOperation *operation) {
freeVgInfo(dbCache->vgCache.vgInfo);
dbCache->vgCache.vgInfo = NULL;
+ CTG_DB_NUM_RESET(CTG_CI_DB_VGROUP);
ctgDebug("db vgInfo removed, dbFName:%s", msg->dbFName);
ctgWUnlockVgInfo(dbCache);
@@ -1911,6 +1939,7 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
int32_t code = 0;
SCtgDropStbMetaMsg *msg = operation->data;
SCatalog *pCtg = msg->pCtg;
+ int32_t tblType = 0;
if (pCtg->stopUpdate) {
goto _return;
@@ -1931,8 +1960,6 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
if (taosHashRemove(dbCache->stbCache, &msg->suid, sizeof(msg->suid))) {
ctgDebug("stb not exist in stbCache, may be removed, dbFName:%s, stb:%s, suid:0x%" PRIx64, msg->dbFName,
msg->stbName, msg->suid);
- } else {
- CTG_CACHE_STAT_DEC(numOfStb, 1);
}
SCtgTbCache *pTbCache = taosHashGet(dbCache->tbCache, msg->stbName, strlen(msg->stbName));
@@ -1942,13 +1969,14 @@ int32_t ctgOpDropStbMeta(SCtgCacheOperation *operation) {
}
CTG_LOCK(CTG_WRITE, &pTbCache->metaLock);
+ tblType = pTbCache->pMeta->tableType;
ctgFreeTbCacheImpl(pTbCache);
CTG_UNLOCK(CTG_WRITE, &pTbCache->metaLock);
if (taosHashRemove(dbCache->tbCache, msg->stbName, strlen(msg->stbName))) {
ctgError("stb not exist in cache, dbFName:%s, stb:%s, suid:0x%" PRIx64, msg->dbFName, msg->stbName, msg->suid);
} else {
- CTG_CACHE_STAT_DEC(numOfTbl, 1);
+ CTG_META_NUM_DEC(tblType);
}
ctgInfo("stb removed from cache, dbFName:%s, stbName:%s, suid:0x%" PRIx64, msg->dbFName, msg->stbName, msg->suid);
@@ -1968,6 +1996,7 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
int32_t code = 0;
SCtgDropTblMetaMsg *msg = operation->data;
SCatalog *pCtg = msg->pCtg;
+ int32_t tblType = 0;
if (pCtg->stopUpdate) {
goto _return;
@@ -1992,6 +2021,7 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
}
CTG_LOCK(CTG_WRITE, &pTbCache->metaLock);
+ tblType = pTbCache->pMeta->tableType;
ctgFreeTbCacheImpl(pTbCache);
CTG_UNLOCK(CTG_WRITE, &pTbCache->metaLock);
@@ -1999,7 +2029,7 @@ int32_t ctgOpDropTbMeta(SCtgCacheOperation *operation) {
ctgError("tb %s not exist in cache, dbFName:%s", msg->tbName, msg->dbFName);
CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR);
} else {
- CTG_CACHE_STAT_DEC(numOfTbl, 1);
+ CTG_META_NUM_DEC(tblType);
}
ctgDebug("table %s removed from cache, dbFName:%s", msg->tbName, msg->dbFName);
@@ -2037,6 +2067,8 @@ int32_t ctgOpUpdateUser(SCtgCacheOperation *operation) {
taosMemoryFreeClear(msg);
+ CTG_CACHE_NUM_INC(CTG_CI_USER, 1);
+
return TSDB_CODE_SUCCESS;
}
@@ -2290,10 +2322,10 @@ void ctgCleanupCacheQueue(void) {
ctgDebug("process [%s] operation", gCtgCacheOperation[op->opId].name);
(*gCtgCacheOperation[op->opId].func)(op);
stopQueue = true;
- CTG_RT_STAT_INC(numOfOpDequeue, 1);
+ CTG_STAT_RT_INC(numOfOpDequeue, 1);
} else {
ctgFreeCacheOperationData(op);
- CTG_RT_STAT_INC(numOfOpAbort, 1);
+ CTG_STAT_RT_INC(numOfOpAbort, 1);
}
if (op->syncOp) {
@@ -2349,9 +2381,10 @@ void *ctgUpdateThreadFunc(void *param) {
taosMemoryFreeClear(operation);
}
- CTG_RT_STAT_INC(numOfOpDequeue, 1);
+ CTG_STAT_RT_INC(numOfOpDequeue, 1);
ctgdShowCacheInfo();
+ ctgdShowStatInfo();
}
qInfo("catalog update thread stopped");
@@ -2492,7 +2525,8 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgDebug("tb %s not in cache, dbFName:%s", pName->tname, dbFName);
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
-
+ CTG_META_NHIT_INC();
+
continue;
}
@@ -2502,12 +2536,15 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgDebug("tb %s meta not in cache, dbFName:%s", pName->tname, dbFName);
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
+ CTG_META_NHIT_INC();
continue;
}
STableMeta *tbMeta = pCache->pMeta;
+ CTG_META_HIT_INC(tbMeta->tableType);
+
SCtgTbMetaCtx nctx = {0};
nctx.flag = flag;
nctx.tbInfo.inCache = true;
@@ -2575,8 +2612,9 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgDebug("stb 0x%" PRIx64 " not in cache, dbFName:%s", pTableMeta->suid, dbFName);
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
-
taosMemoryFreeClear(pTableMeta);
+
+ CTG_META_NHIT_INC();
continue;
}
@@ -2587,8 +2625,9 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
-
taosMemoryFreeClear(pTableMeta);
+
+ CTG_META_NHIT_INC();
continue;
}
@@ -2602,9 +2641,9 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
-
taosMemoryFreeClear(pTableMeta);
+ CTG_META_NHIT_INC();
continue;
}
@@ -2618,9 +2657,9 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
ctgAddFetch(&ctx->pFetchs, dbIdx, i, fetchIdx, baseResIdx + i, flag);
taosArrayPush(ctx->pResList, &(SMetaRes){0});
-
taosMemoryFreeClear(pTableMeta);
+ CTG_META_NHIT_INC();
continue;
}
@@ -2636,6 +2675,8 @@ int32_t ctgGetTbMetasFromCache(SCatalog *pCtg, SRequestConnInfo *pConn, SCtgTbMe
CTG_UNLOCK(CTG_READ, &pCache->metaLock);
taosHashRelease(dbCache->tbCache, pCache);
+ CTG_META_HIT_INC(pTableMeta->tableType);
+
res.pRes = pTableMeta;
taosArrayPush(ctx->pResList, &res);
diff --git a/source/libs/catalog/src/ctgDbg.c b/source/libs/catalog/src/ctgDbg.c
index 5b17b548ccd58c03e2c3922b555a14340d5880fa..12ff8a7b388a994e8fd0249a557e993768934342 100644
--- a/source/libs/catalog/src/ctgDbg.c
+++ b/source/libs/catalog/src/ctgDbg.c
@@ -348,7 +348,7 @@ int32_t ctgdGetOneHandle(SCatalog **pHandle) {
int32_t ctgdGetStatNum(char *option, void *res) {
if (0 == strcasecmp(option, "runtime.numOfOpDequeue")) {
- *(uint64_t *)res = atomic_load_64(&gCtgMgmt.stat.runtime.numOfOpDequeue);
+ *(uint64_t *)res = atomic_load_64(&gCtgMgmt.statInfo.runtime.numOfOpDequeue);
return TSDB_CODE_SUCCESS;
}
@@ -520,6 +520,27 @@ void ctgdShowClusterCache(SCatalog *pCtg) {
ctgDebug("## cluster 0x%" PRIx64 " %p cache Info END ##", pCtg->clusterId, pCtg);
}
+int32_t ctgdShowStatInfo(void) {
+ if (!gCTGDebug.statEnable) {
+ return TSDB_CODE_CTG_OUT_OF_SERVICE;
+ }
+
+ CTG_API_ENTER();
+
+ SCtgCacheStat cache;
+ ctgGetGlobalCacheStat(&cache);
+
+ qDebug("## Global Stat Info %s ##", "begin");
+ qDebug("## \t%s \t%s \t%s ##", "Num", "Hit", "Nhit");
+ for (int32_t i = 0; i < CTG_CI_MAX_VALUE; ++i) {
+ qDebug("# %s \t%" PRIu64 " \t%" PRIu64 " \t%" PRIu64 " #", gCtgStatItem[i].name, cache.cacheNum[i], cache.cacheHit[i], cache.cacheNHit[i]);
+ }
+ qDebug("## Global Stat Info %s ##", "end");
+
+ CTG_API_LEAVE(TSDB_CODE_SUCCESS);
+}
+
+
int32_t ctgdShowCacheInfo(void) {
if (!gCTGDebug.cacheEnable) {
return TSDB_CODE_CTG_OUT_OF_SERVICE;
diff --git a/source/libs/catalog/src/ctgUtil.c b/source/libs/catalog/src/ctgUtil.c
index 9b013c2892d20a39d2be80dedb5c12d221c20425..fd6ee6c1b9f36f7fbe8d8e9a6b754957334028e6 100644
--- a/source/libs/catalog/src/ctgUtil.c
+++ b/source/libs/catalog/src/ctgUtil.c
@@ -77,12 +77,12 @@ char* ctgTaskTypeStr(CTG_TASK_TYPE type) {
return "[get table meta]";
case CTG_TASK_GET_TB_HASH:
return "[get table hash]";
- case CTG_TASK_GET_TB_INDEX:
- return "[get table index]";
+ case CTG_TASK_GET_TB_SMA_INDEX:
+ return "[get table sma]";
case CTG_TASK_GET_TB_CFG:
return "[get table cfg]";
- case CTG_TASK_GET_INDEX:
- return "[get index]";
+ case CTG_TASK_GET_INDEX_INFO:
+ return "[get index info]";
case CTG_TASK_GET_UDF:
return "[get udf]";
case CTG_TASK_GET_USER:
@@ -203,7 +203,6 @@ void ctgFreeStbMetaCache(SCtgDBCache* dbCache) {
int32_t stbNum = taosHashGetSize(dbCache->stbCache);
taosHashCleanup(dbCache->stbCache);
dbCache->stbCache = NULL;
- CTG_CACHE_STAT_DEC(numOfStb, stbNum);
}
void ctgFreeTbCacheImpl(SCtgTbCache* pCache) {
@@ -228,7 +227,6 @@ void ctgFreeTbCache(SCtgDBCache* dbCache) {
}
taosHashCleanup(dbCache->tbCache);
dbCache->tbCache = NULL;
- CTG_CACHE_STAT_DEC(numOfTbl, tblNum);
}
void ctgFreeVgInfoCache(SCtgDBCache* dbCache) { freeVgInfo(dbCache->vgCache.vgInfo); }
@@ -260,8 +258,6 @@ void ctgFreeInstDbCache(SHashObj* pDbCache) {
}
taosHashCleanup(pDbCache);
-
- CTG_CACHE_STAT_DEC(numOfDb, dbNum);
}
void ctgFreeInstUserCache(SHashObj* pUserCache) {
@@ -280,8 +276,6 @@ void ctgFreeInstUserCache(SHashObj* pUserCache) {
}
taosHashCleanup(pUserCache);
-
- CTG_CACHE_STAT_DEC(numOfUser, userNum);
}
void ctgFreeHandleImpl(SCatalog* pCtg) {
@@ -307,7 +301,7 @@ void ctgFreeHandle(SCatalog* pCtg) {
ctgFreeInstDbCache(pCtg->dbCache);
ctgFreeInstUserCache(pCtg->userCache);
- CTG_CACHE_STAT_DEC(numOfCluster, 1);
+ CTG_STAT_NUM_DEC(CTG_CI_CLUSTER, 1);
taosMemoryFree(pCtg);
@@ -342,7 +336,9 @@ void ctgClearHandle(SCatalog* pCtg) {
ctgError("taosHashInit %d user cache failed", gCtgMgmt.cfg.maxUserCacheNum);
}
- CTG_CACHE_STAT_INC(numOfClear, 1);
+ memset(pCtg->cacheStat.cacheNum, 0, sizeof(pCtg->cacheStat.cacheNum));
+
+ CTG_STAT_RT_INC(numOfOpClearCache, 1);
ctgInfo("handle cleared, clusterId:0x%" PRIx64, clusterId);
}
@@ -501,7 +497,7 @@ void ctgFreeTaskRes(CTG_TASK_TYPE type, void** pRes) {
}
break;
}
- case CTG_TASK_GET_TB_INDEX: {
+ case CTG_TASK_GET_TB_SMA_INDEX: {
taosArrayDestroyEx(*pRes, tFreeSTableIndexInfo);
*pRes = NULL;
break;
@@ -516,7 +512,7 @@ void ctgFreeTaskRes(CTG_TASK_TYPE type, void** pRes) {
}
case CTG_TASK_GET_TB_HASH:
case CTG_TASK_GET_DB_INFO:
- case CTG_TASK_GET_INDEX:
+ case CTG_TASK_GET_INDEX_INFO:
case CTG_TASK_GET_UDF:
case CTG_TASK_GET_USER:
case CTG_TASK_GET_SVR_VER:
@@ -571,7 +567,7 @@ void ctgFreeSubTaskRes(CTG_TASK_TYPE type, void** pRes) {
}
break;
}
- case CTG_TASK_GET_TB_INDEX: {
+ case CTG_TASK_GET_TB_SMA_INDEX: {
taosArrayDestroyEx(*pRes, tFreeSTableIndexInfo);
*pRes = NULL;
break;
@@ -587,7 +583,7 @@ void ctgFreeSubTaskRes(CTG_TASK_TYPE type, void** pRes) {
case CTG_TASK_GET_TB_META:
case CTG_TASK_GET_DB_INFO:
case CTG_TASK_GET_TB_HASH:
- case CTG_TASK_GET_INDEX:
+ case CTG_TASK_GET_INDEX_INFO:
case CTG_TASK_GET_UDF:
case CTG_TASK_GET_SVR_VER:
case CTG_TASK_GET_USER: {
@@ -664,7 +660,7 @@ void ctgFreeTaskCtx(SCtgTask* pTask) {
taosMemoryFreeClear(pTask->taskCtx);
break;
}
- case CTG_TASK_GET_TB_INDEX: {
+ case CTG_TASK_GET_TB_SMA_INDEX: {
SCtgTbIndexCtx* taskCtx = (SCtgTbIndexCtx*)pTask->taskCtx;
taosMemoryFreeClear(taskCtx->pName);
taosMemoryFreeClear(pTask->taskCtx);
@@ -680,7 +676,7 @@ void ctgFreeTaskCtx(SCtgTask* pTask) {
case CTG_TASK_GET_DB_VGROUP:
case CTG_TASK_GET_DB_CFG:
case CTG_TASK_GET_DB_INFO:
- case CTG_TASK_GET_INDEX:
+ case CTG_TASK_GET_INDEX_INFO:
case CTG_TASK_GET_UDF:
case CTG_TASK_GET_QNODE:
case CTG_TASK_GET_USER: {
@@ -869,19 +865,19 @@ int32_t ctgGetVgInfoFromHashValue(SCatalog* pCtg, SDBVgInfo* dbInfo, const SName
vgInfo = taosArraySearch(dbInfo->vgArray, &hashValue, ctgHashValueComp, TD_EQ);
-/*
- void* pIter = taosHashIterate(dbInfo->vgHash, NULL);
- while (pIter) {
- vgInfo = pIter;
- if (hashValue >= vgInfo->hashBegin && hashValue <= vgInfo->hashEnd) {
- taosHashCancelIterate(dbInfo->vgHash, pIter);
- break;
- }
+ /*
+ void* pIter = taosHashIterate(dbInfo->vgHash, NULL);
+ while (pIter) {
+ vgInfo = pIter;
+ if (hashValue >= vgInfo->hashBegin && hashValue <= vgInfo->hashEnd) {
+ taosHashCancelIterate(dbInfo->vgHash, pIter);
+ break;
+ }
- pIter = taosHashIterate(dbInfo->vgHash, pIter);
- vgInfo = NULL;
- }
-*/
+ pIter = taosHashIterate(dbInfo->vgHash, pIter);
+ vgInfo = NULL;
+ }
+ */
if (NULL == vgInfo) {
ctgError("no hash range found for hash value [%u], db:%s, numOfVgId:%d", hashValue, db,
@@ -906,7 +902,7 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SCtgTaskReq* tReq, SDBVgInfo*
CTG_ERR_RET(ctgMakeVgArray(dbInfo));
- int32_t vgNum = taosArrayGetSize(dbInfo->vgArray);
+ int32_t vgNum = taosArrayGetSize(dbInfo->vgArray);
if (vgNum <= 0) {
ctgError("db vgroup cache invalid, db:%s, vgroup number:%d", dbFName, vgNum);
CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
@@ -986,42 +982,42 @@ int32_t ctgGetVgInfosFromHashValue(SCatalog* pCtg, SCtgTaskReq* tReq, SDBVgInfo*
CTG_RET(code);
}
-int32_t ctgGetVgIdsFromHashValue(SCatalog* pCtg, SDBVgInfo* dbInfo, char* dbFName, const char* pTbs[], int32_t tbNum, int32_t* vgId) {
- int32_t code = 0;
- CTG_ERR_RET(ctgMakeVgArray(dbInfo));
+int32_t ctgGetVgIdsFromHashValue(SCatalog* pCtg, SDBVgInfo* dbInfo, char* dbFName, const char* pTbs[], int32_t tbNum,
+ int32_t* vgId) {
+ int32_t code = 0;
+ CTG_ERR_RET(ctgMakeVgArray(dbInfo));
- int32_t vgNum = taosArrayGetSize(dbInfo->vgArray);
+ int32_t vgNum = taosArrayGetSize(dbInfo->vgArray);
- if (vgNum <= 0) {
- ctgError("db vgroup cache invalid, db:%s, vgroup number:%d", dbFName, vgNum);
- CTG_ERR_RET(TSDB_CODE_TSC_DB_NOT_SELECTED);
- }
+ if (vgNum <= 0) {
+ ctgError("db vgroup cache invalid, db:%s, vgroup number:%d", dbFName, vgNum);
+ CTG_ERR_RET(TSDB_CODE_TSC_DB_NOT_SELECTED);
+ }
- SVgroupInfo* vgInfo = NULL;
- char tbFullName[TSDB_TABLE_FNAME_LEN];
- snprintf(tbFullName, sizeof(tbFullName), "%s.", dbFName);
- int32_t offset = strlen(tbFullName);
-
- for (int32_t i = 0; i < tbNum; ++i) {
- snprintf(tbFullName + offset, sizeof(tbFullName) - offset, "%s", pTbs[i]);
- uint32_t hashValue = taosGetTbHashVal(tbFullName, (uint32_t)strlen(tbFullName), dbInfo->hashMethod,
- dbInfo->hashPrefix, dbInfo->hashSuffix);
+ SVgroupInfo* vgInfo = NULL;
+ char tbFullName[TSDB_TABLE_FNAME_LEN];
+ snprintf(tbFullName, sizeof(tbFullName), "%s.", dbFName);
+ int32_t offset = strlen(tbFullName);
- vgInfo = taosArraySearch(dbInfo->vgArray, &hashValue, ctgHashValueComp, TD_EQ);
- if (NULL == vgInfo) {
- ctgError("no hash range found for hash value [%u], db:%s, numOfVgId:%d", hashValue, dbFName,
- (int32_t)taosArrayGetSize(dbInfo->vgArray));
- CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
- }
+ for (int32_t i = 0; i < tbNum; ++i) {
+ snprintf(tbFullName + offset, sizeof(tbFullName) - offset, "%s", pTbs[i]);
+ uint32_t hashValue = taosGetTbHashVal(tbFullName, (uint32_t)strlen(tbFullName), dbInfo->hashMethod,
+ dbInfo->hashPrefix, dbInfo->hashSuffix);
- vgId[i] = vgInfo->vgId;
+ vgInfo = taosArraySearch(dbInfo->vgArray, &hashValue, ctgHashValueComp, TD_EQ);
+ if (NULL == vgInfo) {
+ ctgError("no hash range found for hash value [%u], db:%s, numOfVgId:%d", hashValue, dbFName,
+ (int32_t)taosArrayGetSize(dbInfo->vgArray));
+ CTG_ERR_RET(TSDB_CODE_CTG_INTERNAL_ERROR);
+ }
- ctgDebug("Got tb %s vgId:%d", tbFullName, vgInfo->vgId);
- }
+ vgId[i] = vgInfo->vgId;
- CTG_RET(code);
-}
+ ctgDebug("Got tb %s vgId:%d", tbFullName, vgInfo->vgId);
+ }
+ CTG_RET(code);
+}
int32_t ctgStbVersionSearchCompare(const void* key1, const void* key2) {
if (*(uint64_t*)key1 < ((SSTableVersion*)key2)->suid) {
@@ -1067,26 +1063,25 @@ int32_t ctgMakeVgArray(SDBVgInfo* dbInfo) {
if (NULL == dbInfo) {
return TSDB_CODE_SUCCESS;
}
-
+
if (dbInfo->vgHash && NULL == dbInfo->vgArray) {
dbInfo->vgArray = taosArrayInit(100, sizeof(SVgroupInfo));
if (NULL == dbInfo->vgArray) {
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
}
-
- void* pIter = taosHashIterate(dbInfo->vgHash, NULL);
+
+ void* pIter = taosHashIterate(dbInfo->vgHash, NULL);
while (pIter) {
taosArrayPush(dbInfo->vgArray, pIter);
pIter = taosHashIterate(dbInfo->vgHash, pIter);
}
-
+
taosArraySort(dbInfo->vgArray, ctgVgInfoComp);
}
return TSDB_CODE_SUCCESS;
}
-
int32_t ctgCloneVgInfo(SDBVgInfo* src, SDBVgInfo** dst) {
CTG_ERR_RET(ctgMakeVgArray(src));
@@ -1424,3 +1419,67 @@ void catalogFreeMetaData(SMetaData* pData) {
}
#endif
+void ctgGetClusterCacheStat(SCatalog* pCtg) {
+ for (int32_t i = 0; i < CTG_CI_MAX_VALUE; ++i) {
+ if (0 == (gCtgStatItem[i].flag & CTG_CI_FLAG_LEVEL_DB)) {
+ continue;
+ }
+
+ pCtg->cacheStat.cacheNum[i] = 0;
+ }
+
+ SCtgDBCache* dbCache = NULL;
+ void* pIter = taosHashIterate(pCtg->dbCache, NULL);
+ while (pIter) {
+ dbCache = (SCtgDBCache*)pIter;
+
+ for (int32_t i = 0; i < CTG_CI_MAX_VALUE; ++i) {
+ if (0 == (gCtgStatItem[i].flag & CTG_CI_FLAG_LEVEL_DB)) {
+ continue;
+ }
+
+ pCtg->cacheStat.cacheNum[i] += dbCache->dbCacheNum[i];
+ }
+
+ pIter = taosHashIterate(pCtg->dbCache, pIter);
+ }
+}
+
+void ctgSummaryClusterCacheStat(SCatalog* pCtg) {
+ for (int32_t i = 0; i < CTG_CI_MAX_VALUE; ++i) {
+ if (gCtgStatItem[i].flag & CTG_CI_FLAG_LEVEL_GLOBAL) {
+ continue;
+ }
+
+ gCtgMgmt.statInfo.cache.cacheNum[i] += pCtg->cacheStat.cacheNum[i];
+ gCtgMgmt.statInfo.cache.cacheHit[i] += pCtg->cacheStat.cacheHit[i];
+ gCtgMgmt.statInfo.cache.cacheNHit[i] += pCtg->cacheStat.cacheNHit[i];
+ }
+}
+
+void ctgGetGlobalCacheStat(SCtgCacheStat* pStat) {
+ for (int32_t i = 0; i < CTG_CI_MAX_VALUE; ++i) {
+ if (gCtgStatItem[i].flag & CTG_CI_FLAG_LEVEL_GLOBAL) {
+ continue;
+ }
+
+ gCtgMgmt.statInfo.cache.cacheNum[i] = 0;
+ gCtgMgmt.statInfo.cache.cacheHit[i] = 0;
+ gCtgMgmt.statInfo.cache.cacheNHit[i] = 0;
+ }
+
+ SCatalog* pCtg = NULL;
+ void* pIter = taosHashIterate(gCtgMgmt.pCluster, NULL);
+ while (pIter) {
+ pCtg = *(SCatalog**)pIter;
+
+ if (pCtg) {
+ ctgGetClusterCacheStat(pCtg);
+ ctgSummaryClusterCacheStat(pCtg);
+ }
+
+ pIter = taosHashIterate(gCtgMgmt.pCluster, pIter);
+ }
+
+ memcpy(pStat, &gCtgMgmt.statInfo.cache, sizeof(gCtgMgmt.statInfo.cache));
+}
diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h
index a6353f722a7cabd3e4e97f962af0f05533d9b8e2..54a9ff0942ee1b5865b42b15ff4228709719fe5b 100644
--- a/source/libs/executor/inc/executorimpl.h
+++ b/source/libs/executor/inc/executorimpl.h
@@ -169,21 +169,21 @@ struct SExecTaskInfo {
uint32_t status;
STimeWindow window;
STaskCostInfo cost;
- int64_t owner; // if it is in execution
+ int64_t owner; // if it is in execution
int32_t code;
int32_t qbufQuota; // total available buffer (in KB) during execution query
int64_t version; // used for stream to record wal version, why not move to sschemainfo
SStreamTaskInfo streamInfo;
SSchemaInfo schemaInfo;
- const char* sql; // query sql string
- jmp_buf env; // jump to this position when error happens.
- EOPTR_EXEC_MODEL execModel; // operator execution model [batch model|stream model]
+ const char* sql; // query sql string
+ jmp_buf env; // jump to this position when error happens.
+ EOPTR_EXEC_MODEL execModel; // operator execution model [batch model|stream model]
SSubplan* pSubplan;
struct SOperatorInfo* pRoot;
SLocalFetch localFetch;
SArray* pResultBlockList; // result block list
STaskStopInfo stopInfo;
- SRWLatch lock; // secure the access of STableListInfo
+ SRWLatch lock; // secure the access of STableListInfo
};
enum {
@@ -323,7 +323,7 @@ typedef struct STableScanBase {
int32_t dataBlockLoadFlag;
SLimitInfo limitInfo;
// there are more than one table list exists in one task, if only one vnode exists.
- STableListInfo* pTableListInfo;
+ STableListInfo* pTableListInfo;
} STableScanBase;
typedef struct STableScanInfo {
@@ -698,7 +698,8 @@ typedef struct SStreamFillOperatorInfo {
#define OPTR_IS_OPENED(_optr) (((_optr)->status & OP_OPENED) == OP_OPENED)
#define OPTR_SET_OPENED(_optr) ((_optr)->status |= OP_OPENED)
-SExecTaskInfo* doCreateExecTaskInfo(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model, char* dbFName);
+SExecTaskInfo* doCreateExecTaskInfo(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model,
+ char* dbFName);
SOperatorFpSet createOperatorFpSet(__optr_open_fn_t openFn, __optr_fn_t nextFn, __optr_fn_t cleanup,
__optr_close_fn_t closeFn, __optr_reqBuf_fn_t reqBufFn, __optr_explain_fn_t explain);
@@ -745,8 +746,8 @@ void updateLoadRemoteInfo(SLoadRemoteDataInfo* pInfo, int64_t numOfRows, int3
STimeWindow getFirstQualifiedTimeWindow(int64_t ts, STimeWindow* pWindow, SInterval* pInterval, int32_t order);
SOperatorInfo* extractOperatorInTree(SOperatorInfo* pOperator, int32_t type, const char* id);
-int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag, bool inheritUsOrder);
-int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaultBufsz);
+int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag, bool inheritUsOrder);
+int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaultBufsz);
extern void doDestroyExchangeOperatorInfo(void* param);
@@ -851,8 +852,9 @@ char* buildTaskId(uint64_t taskId, uint64_t queryId);
SArray* getTableListInfo(const SExecTaskInfo* pTaskInfo);
int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
- int32_t vgId, char* sql, EOPTR_EXEC_MODEL model);
-int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, STableListInfo* pTableListInfo, SReadHandle* readHandle);
+ int32_t vgId, char* sql, EOPTR_EXEC_MODEL model);
+int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, STableListInfo* pTableListInfo,
+ SReadHandle* readHandle);
int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SArray* pExecInfoList);
STimeWindow getActiveTimeWindow(SDiskbasedBuf* pBuf, SResultRowInfo* pResultRowInfo, int64_t ts, SInterval* pInterval,
diff --git a/source/libs/executor/src/dataSinkMgt.c b/source/libs/executor/src/dataSinkMgt.c
index 2b50be33ad29d4cb11d764dd090d2126c1fb13a0..7fbde07f596989c3a27ab5551c2b0215c13d4a59 100644
--- a/source/libs/executor/src/dataSinkMgt.c
+++ b/source/libs/executor/src/dataSinkMgt.c
@@ -37,10 +37,12 @@ int32_t dsCreateDataSinker(const SDataSinkNode* pDataSink, DataSinkHandle* pHand
switch ((int)nodeType(pDataSink)) {
case QUERY_NODE_PHYSICAL_PLAN_DISPATCH:
return createDataDispatcher(&gDataSinkManager, pDataSink, pHandle);
- case QUERY_NODE_PHYSICAL_PLAN_DELETE:
+ case QUERY_NODE_PHYSICAL_PLAN_DELETE: {
return createDataDeleter(&gDataSinkManager, pDataSink, pHandle, pParam);
- case QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT:
+ }
+ case QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT: {
return createDataInserter(&gDataSinkManager, pDataSink, pHandle, pParam);
+ }
}
qError("invalid input node type:%d, %s", nodeType(pDataSink), id);
diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c
index e1cd509cbae8cac31dabb0319e1a926737710101..6e05ea0d4f4bea99eb7bc17e93f70877e83c4dbb 100644
--- a/source/libs/executor/src/executor.c
+++ b/source/libs/executor/src/executor.c
@@ -29,8 +29,8 @@ static void cleanupRefPool() {
taosCloseRef(ref);
}
-static void initRefPool() {
- exchangeObjRefPool = taosOpenRef(1024, doDestroyExchangeOperatorInfo);
+static void initRefPool() {
+ exchangeObjRefPool = taosOpenRef(1024, doDestroyExchangeOperatorInfo);
atexit(cleanupRefPool);
}
@@ -242,14 +242,14 @@ int32_t qSetSMAInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numOfBlocks,
return code;
}
-qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int32_t vgId, int32_t* numOfCols, uint64_t id) {
- if (msg == NULL) { // create raw scan
+qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int32_t vgId, int32_t* numOfCols,
+ uint64_t id) {
+ if (msg == NULL) { // create raw scan
SExecTaskInfo* pTaskInfo = doCreateExecTaskInfo(0, id, vgId, OPTR_EXEC_MODEL_QUEUE, "");
if (NULL == pTaskInfo) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL;
}
-
pTaskInfo->pRoot = createRawScanOperatorInfo(pReaderHandle, pTaskInfo);
if (NULL == pTaskInfo->pRoot) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -506,7 +506,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
if (handle) {
void* pSinkParam = NULL;
- SArray* pInfoList = getTableListInfo(*pTask);
+ SArray* pInfoList = getTableListInfo(*pTask);
STableListInfo* pTableListInfo = taosArrayGetP(pInfoList, 0);
taosArrayDestroy(pInfoList);
@@ -761,7 +761,7 @@ int32_t qKillTask(qTaskInfo_t tinfo, int32_t rspCode) {
qDebug("%s sync killed execTask", GET_TASKID(pTaskInfo));
setTaskKilled(pTaskInfo, TSDB_CODE_TSC_QUERY_KILLED);
- while(qTaskIsExecuting(pTaskInfo)) {
+ while (qTaskIsExecuting(pTaskInfo)) {
taosMsleep(10);
}
@@ -1073,7 +1073,7 @@ int32_t initQueryTableDataCondForTmq(SQueryTableDataCond* pCond, SSnapContext* s
int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedData submit) {
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
- if((pTaskInfo->execModel != OPTR_EXEC_MODEL_QUEUE) || (pTaskInfo->streamInfo.submit.msgStr != NULL)){
+ if ((pTaskInfo->execModel != OPTR_EXEC_MODEL_QUEUE) || (pTaskInfo->streamInfo.submit.msgStr != NULL)) {
qError("qStreamSetScanMemData err:%d,%p", pTaskInfo->execModel, pTaskInfo->streamInfo.submit.msgStr);
return -1;
}
@@ -1084,9 +1084,9 @@ int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedData submit) {
}
int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType) {
- SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
- SOperatorInfo* pOperator = pTaskInfo->pRoot;
- const char* id = GET_TASKID(pTaskInfo);
+ SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
+ SOperatorInfo* pOperator = pTaskInfo->pRoot;
+ const char* id = GET_TASKID(pTaskInfo);
pTaskInfo->streamInfo.prepareStatus = *pOffset;
pTaskInfo->streamInfo.returned = 0;
@@ -1102,7 +1102,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
SStreamScanInfo* pInfo = pOperator->info;
STableScanInfo* pScanInfo = pInfo->pTableScanOp->info;
STableScanBase* pScanBaseInfo = &pScanInfo->base;
- STableListInfo* pTableListInfo = pScanBaseInfo->pTableListInfo;
+ STableListInfo* pTableListInfo = pScanBaseInfo->pTableListInfo;
if (pOffset->type == TMQ_OFFSET__LOG) {
tsdbReaderClose(pScanBaseInfo->dataReader);
@@ -1110,7 +1110,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
// let's seek to the next version in wal file
if (tqSeekVer(pInfo->tqReader, pOffset->version + 1, pTaskInfo->id.str) < 0) {
- qError("tqSeekVer failed ver:%"PRId64", %s", pOffset->version + 1, id);
+ qError("tqSeekVer failed ver:%" PRId64 ", %s", pOffset->version + 1, id);
return -1;
}
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
@@ -1154,7 +1154,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
}
STableKeyInfo keyInfo = {.uid = uid};
- int64_t oldSkey = pScanBaseInfo->cond.twindows.skey;
+ int64_t oldSkey = pScanBaseInfo->cond.twindows.skey;
// let's start from the next ts that returned to consumer.
pScanBaseInfo->cond.twindows.skey = ts + 1;
@@ -1191,11 +1191,11 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
SStreamRawScanInfo* pInfo = pOperator->info;
SSnapContext* sContext = pInfo->sContext;
- SOperatorInfo* p = extractOperatorInTree(pOperator, QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN, id);
+ SOperatorInfo* p = extractOperatorInTree(pOperator, QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN, id);
STableListInfo* pTableListInfo = ((SStreamRawScanInfo*)(p->info))->pTableListInfo;
if (setForSnapShot(sContext, pOffset->uid) != 0) {
- qError("setDataForSnapShot error. uid:%" PRId64" , %s", pOffset->uid, id);
+ qError("setDataForSnapShot error. uid:%" PRId64 " , %s", pOffset->uid, id);
return -1;
}
@@ -1218,14 +1218,15 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
STableKeyInfo* pList = tableListGetInfo(pTableListInfo, 0);
int32_t size = tableListGetSize(pTableListInfo);
- tsdbReaderOpen(pInfo->vnode, &pTaskInfo->streamInfo.tableCond, pList, size, NULL, &pInfo->dataReader, NULL, false);
+ tsdbReaderOpen(pInfo->vnode, &pTaskInfo->streamInfo.tableCond, pList, size, NULL, &pInfo->dataReader, NULL,
+ false);
cleanupQueryTableDataCond(&pTaskInfo->streamInfo.tableCond);
strcpy(pTaskInfo->streamInfo.tbName, mtInfo.tbName);
tDeleteSSchemaWrapper(pTaskInfo->streamInfo.schema);
pTaskInfo->streamInfo.schema = mtInfo.schema;
- qDebug("tmqsnap qStreamPrepareScan snapshot data uid:%" PRId64 " ts %" PRId64" %s", mtInfo.uid, pOffset->ts, id);
+ qDebug("tmqsnap qStreamPrepareScan snapshot data uid:%" PRId64 " ts %" PRId64 " %s", mtInfo.uid, pOffset->ts, id);
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_META) {
SStreamRawScanInfo* pInfo = pOperator->info;
SSnapContext* sContext = pInfo->sContext;
@@ -1233,7 +1234,8 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
qError("setForSnapShot error. uid:%" PRIu64 " ,version:%" PRId64, pOffset->uid, pOffset->version);
return -1;
}
- qDebug("tmqsnap qStreamPrepareScan snapshot meta uid:%" PRId64 " ts %" PRId64 " %s", pOffset->uid, pOffset->ts, id);
+ qDebug("tmqsnap qStreamPrepareScan snapshot meta uid:%" PRId64 " ts %" PRId64 " %s", pOffset->uid, pOffset->ts,
+ id);
} else if (pOffset->type == TMQ_OFFSET__LOG) {
SStreamRawScanInfo* pInfo = pOperator->info;
tsdbReaderClose(pInfo->dataReader);
@@ -1247,7 +1249,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
void qProcessRspMsg(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
SMsgSendInfo* pSendInfo = (SMsgSendInfo*)pMsg->info.ahandle;
- if(pMsg->info.ahandle == NULL){
+ if (pMsg->info.ahandle == NULL) {
qError("pMsg->info.ahandle is NULL");
return;
}
@@ -1268,4 +1270,3 @@ void qProcessRspMsg(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
rpcFreeCont(pMsg->pCont);
destroySendMsgInfo(pSendInfo);
}
-
diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c
index c120c6055d171ae83023e3554dee95be259aafb7..5105fbc181d7a4351492a9433bfd8fe2e4669708 100644
--- a/source/libs/executor/src/executorimpl.c
+++ b/source/libs/executor/src/executorimpl.c
@@ -34,7 +34,7 @@
#include "ttypes.h"
#include "vnode.h"
-#define SET_REVERSE_SCAN_FLAG(runtime) ((runtime)->scanFlag = REVERSE_SCAN)
+#define SET_REVERSE_SCAN_FLAG(runtime) ((runtime)->scanFlag = REVERSE_SCAN)
#define GET_FORWARD_DIRECTION_FACTOR(ord) (((ord) == TSDB_ORDER_ASC) ? QUERY_ASC_FORWARD_STEP : QUERY_DESC_FORWARD_STEP)
#if 0
@@ -71,14 +71,14 @@ static UNUSED_FUNC void* u_realloc(void* p, size_t __size) {
#define realloc u_realloc
#endif
-#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
+#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
static void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExpr, SSDataBlock* pBlock);
static void releaseQueryBuf(size_t numOfTables);
-static void initCtxOutputBuffer(SqlFunctionCtx* pCtx, int32_t size);
-static void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlock, int32_t order, int32_t scanFlag);
+static void initCtxOutputBuffer(SqlFunctionCtx* pCtx, int32_t size);
+static void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlock, int32_t order, int32_t scanFlag);
static void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoData* p, bool keep,
int32_t status);
@@ -185,7 +185,7 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR
if (!keepGroup) {
*(uint64_t*)pSup->keyBuf = calcGroupId(pSup->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes));
}
-
+
SResultRowPosition* p1 =
(SResultRowPosition*)tSimpleHashGet(pSup->pResultRowHashTable, pSup->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes));
@@ -482,7 +482,7 @@ void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, SSDataBlock* pB
}
}
-bool isTaskKilled(SExecTaskInfo* pTaskInfo) { return (0 != pTaskInfo->code);}
+bool isTaskKilled(SExecTaskInfo* pTaskInfo) { return (0 != pTaskInfo->code); }
void setTaskKilled(SExecTaskInfo* pTaskInfo, int32_t rspCode) { pTaskInfo->code = rspCode; }
@@ -871,9 +871,8 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS
if (pBlock->info.rows + pRow->numOfRows > pBlock->info.capacity) {
blockDataEnsureCapacity(pBlock, pBlock->info.rows + pRow->numOfRows);
qDebug("datablock capacity not sufficient, expand to required:%" PRId64 ", current capacity:%d, %s",
- (pRow->numOfRows+pBlock->info.rows),
- pBlock->info.capacity, GET_TASKID(pTaskInfo));
- // todo set the pOperator->resultInfo size
+ (pRow->numOfRows + pBlock->info.rows), pBlock->info.capacity, GET_TASKID(pTaskInfo));
+ // todo set the pOperator->resultInfo size
}
pGroupResInfo->index += 1;
@@ -995,7 +994,7 @@ int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scan
}
}
-//QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
+// QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
SOperatorInfo* extractOperatorInTree(SOperatorInfo* pOperator, int32_t type, const char* id) {
if (pOperator == NULL) {
qError("invalid operator, failed to find tableScanOperator %s", id);
@@ -1165,7 +1164,8 @@ char* buildTaskId(uint64_t taskId, uint64_t queryId) {
return p;
}
-SExecTaskInfo* doCreateExecTaskInfo(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model, char* dbFName) {
+SExecTaskInfo* doCreateExecTaskInfo(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model,
+ char* dbFName) {
SExecTaskInfo* pTaskInfo = taosMemoryCalloc(1, sizeof(SExecTaskInfo));
if (pTaskInfo == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -1189,6 +1189,11 @@ SExecTaskInfo* doCreateExecTaskInfo(uint64_t queryId, uint64_t taskId, int32_t v
int32_t extractTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode, SExecTaskInfo* pTaskInfo) {
SMetaReader mr = {0};
+ if (pHandle == NULL) {
+ terrno = TSDB_CODE_INVALID_PARA;
+ return terrno;
+ }
+
metaReaderInit(&mr, pHandle->meta, 0);
int32_t code = metaGetTableEntryByUidCache(&mr, pScanNode->uid);
if (code != TSDB_CODE_SUCCESS) {
@@ -1288,8 +1293,8 @@ bool groupbyTbname(SNodeList* pGroupList) {
SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHandle* pHandle, SNode* pTagCond,
SNode* pTagIndexCond, const char* pUser) {
- int32_t type = nodeType(pPhyNode);
- const char* idstr = GET_TASKID(pTaskInfo);
+ int32_t type = nodeType(pPhyNode);
+ const char* idstr = GET_TASKID(pTaskInfo);
if (pPhyNode->pChildren == NULL || LIST_LENGTH(pPhyNode->pChildren) == 0) {
SOperatorInfo* pOperator = NULL;
@@ -1303,7 +1308,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
STableListInfo* pTableListInfo = tableListCreate();
- int32_t code =
+ int32_t code =
createScanTableListInfo(&pTableScanNode->scan, pTableScanNode->pGroupTags, pTableScanNode->groupSort, pHandle,
pTableListInfo, pTagCond, pTagIndexCond, pTaskInfo);
if (code) {
@@ -1330,7 +1335,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pTaskInfo->cost.pRecoder = &pScanInfo->base.readRecorder;
} else if (QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN == type) {
STableMergeScanPhysiNode* pTableScanNode = (STableMergeScanPhysiNode*)pPhyNode;
- STableListInfo* pTableListInfo = tableListCreate();
+ STableListInfo* pTableListInfo = tableListCreate();
int32_t code = createScanTableListInfo(&pTableScanNode->scan, pTableScanNode->pGroupTags, true, pHandle,
pTableListInfo, pTagCond, pTagIndexCond, pTaskInfo);
@@ -1362,7 +1367,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pTaskInfo);
} else if (QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN == type) {
STableScanPhysiNode* pTableScanNode = (STableScanPhysiNode*)pPhyNode;
- STableListInfo* pTableListInfo = tableListCreate();
+ STableListInfo* pTableListInfo = tableListCreate();
if (pHandle->vnode) {
int32_t code =
@@ -1386,9 +1391,9 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pOperator = createTableCountScanOperatorInfo(pHandle, pTblCountScanNode, pTaskInfo);
} else if (QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN == type) {
STagScanPhysiNode* pScanPhyNode = (STagScanPhysiNode*)pPhyNode;
- STableListInfo* pTableListInfo = tableListCreate();
- int32_t code = createScanTableListInfo(pScanPhyNode, NULL, false, pHandle, pTableListInfo, pTagCond,
- pTagIndexCond, pTaskInfo);
+ STableListInfo* pTableListInfo = tableListCreate();
+ int32_t code = createScanTableListInfo(pScanPhyNode, NULL, false, pHandle, pTableListInfo, pTagCond,
+ pTagIndexCond, pTaskInfo);
if (code != TSDB_CODE_SUCCESS) {
pTaskInfo->code = code;
qError("failed to getTableList, code: %s", tstrerror(code));
@@ -1398,7 +1403,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pOperator = createTagScanOperatorInfo(pHandle, pScanPhyNode, pTableListInfo, pTaskInfo);
} else if (QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN == type) {
SBlockDistScanPhysiNode* pBlockNode = (SBlockDistScanPhysiNode*)pPhyNode;
- STableListInfo* pTableListInfo = tableListCreate();
+ STableListInfo* pTableListInfo = tableListCreate();
if (pBlockNode->tableType == TSDB_SUPER_TABLE) {
SArray* pList = taosArrayInit(4, sizeof(STableKeyInfo));
@@ -1422,7 +1427,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pOperator = createDataBlockInfoScanOperator(pHandle, pBlockNode, pTableListInfo, pTaskInfo);
} else if (QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN == type) {
SLastRowScanPhysiNode* pScanNode = (SLastRowScanPhysiNode*)pPhyNode;
- STableListInfo* pTableListInfo = tableListCreate();
+ STableListInfo* pTableListInfo = tableListCreate();
int32_t code = createScanTableListInfo(&pScanNode->scan, pScanNode->pGroupTags, true, pHandle, pTableListInfo,
pTagCond, pTagIndexCond, pTaskInfo);
@@ -1586,7 +1591,8 @@ int32_t extractTableScanNode(SPhysiNode* pNode, STableScanPhysiNode** ppNode) {
return -1;
}
-int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, STableListInfo* pTableListInfo, SReadHandle* readHandle) {
+int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, STableListInfo* pTableListInfo,
+ SReadHandle* readHandle) {
switch (pNode->type) {
case QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT: {
SInserterParam* pInserterParam = taosMemoryCalloc(1, sizeof(SInserterParam));
@@ -1631,7 +1637,7 @@ int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, STableListInfo*
}
int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
- int32_t vgId, char* sql, EOPTR_EXEC_MODEL model) {
+ int32_t vgId, char* sql, EOPTR_EXEC_MODEL model) {
*pTaskInfo = doCreateExecTaskInfo(pPlan->id.queryId, taskId, vgId, model, pPlan->dbFName);
if (*pTaskInfo == NULL) {
goto _complete;
@@ -1980,7 +1986,7 @@ void qStreamCloseTsdbReader(void* task) {
STableScanInfo* pTSInfo = pInfo->pTableScanOp->info;
setOperatorCompleted(pInfo->pTableScanOp);
- while(pTaskInfo->owner != 0) {
+ while (pTaskInfo->owner != 0) {
taosMsleep(100);
qDebug("wait for the reader stopping");
}
@@ -2009,7 +2015,7 @@ static void extractTableList(SArray* pList, const SOperatorInfo* pOperator) {
}
SArray* getTableListInfo(const SExecTaskInfo* pTaskInfo) {
- SArray* pArray = taosArrayInit(0, POINTER_BYTES);
+ SArray* pArray = taosArrayInit(0, POINTER_BYTES);
SOperatorInfo* pOperator = pTaskInfo->pRoot;
extractTableList(pArray, pOperator);
return pArray;
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index 1bfa8ccfc4b6f54797b11953879cbf057181c36a..b9fd8512d0b0e854f4b264c79cebe4ebec261a5e 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -33,8 +33,7 @@
int32_t scanDebug = 0;
-
-#define MULTI_READER_MAX_TABLE_NUM 5000
+#define MULTI_READER_MAX_TABLE_NUM 5000
#define SET_REVERSE_SCAN_FLAG(_info) ((_info)->scanFlag = REVERSE_SCAN)
#define SWITCH_ORDER(n) (((n) = ((n) == TSDB_ORDER_ASC) ? TSDB_ORDER_DESC : TSDB_ORDER_ASC))
@@ -47,7 +46,7 @@ typedef struct STableMergeScanSortSourceParam {
SOperatorInfo* pOperator;
int32_t readerIdx;
uint64_t uid;
- SSDataBlock* inputBlock;
+ SSDataBlock* inputBlock;
bool multiReader;
STsdbReader* dataReader;
} STableMergeScanSortSourceParam;
@@ -91,7 +90,7 @@ static void getNextTimeWindow(SInterval* pInterval, STimeWindow* tw, int32_t ord
struct tm tm;
time_t t = (time_t)key;
- taosLocalTime(&t, &tm);
+ taosLocalTime(&t, &tm, NULL);
int mon = (int)(tm.tm_year * 12 + tm.tm_mon + interval * factor);
tm.tm_year = mon / 12;
@@ -311,15 +310,16 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
taosMemoryFreeClear(pBlock->pBlockAgg);
if (*status == FUNC_DATA_REQUIRED_FILTEROUT) {
- qDebug("%s data block filter out, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 , GET_TASKID(pTaskInfo),
+ qDebug("%s data block filter out, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64, GET_TASKID(pTaskInfo),
pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
pCost->filterOutBlocks += 1;
pCost->totalRows += pBlock->info.rows;
tsdbReleaseDataBlock(pTableScanInfo->dataReader);
return TSDB_CODE_SUCCESS;
} else if (*status == FUNC_DATA_REQUIRED_NOT_LOAD) {
- qDebug("%s data block skipped, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 ", uid:%" PRIu64, GET_TASKID(pTaskInfo),
- pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows, pBlockInfo->id.uid);
+ qDebug("%s data block skipped, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 ", uid:%" PRIu64,
+ GET_TASKID(pTaskInfo), pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows,
+ pBlockInfo->id.uid);
doSetTagColumnData(pTableScanInfo, pBlock, pTaskInfo, 1);
pCost->skipBlocks += 1;
tsdbReleaseDataBlock(pTableScanInfo->dataReader);
@@ -329,7 +329,7 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
loadSMA = true; // mark the operation of load sma;
bool success = doLoadBlockSMA(pTableScanInfo, pBlock, pTaskInfo);
if (success) { // failed to load the block sma data, data block statistics does not exist, load data block instead
- qDebug("%s data block SMA loaded, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 , GET_TASKID(pTaskInfo),
+ qDebug("%s data block SMA loaded, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64, GET_TASKID(pTaskInfo),
pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
doSetTagColumnData(pTableScanInfo, pBlock, pTaskInfo, 1);
tsdbReleaseDataBlock(pTableScanInfo->dataReader);
@@ -349,8 +349,8 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
size_t size = taosArrayGetSize(pBlock->pDataBlock);
bool keep = doFilterByBlockSMA(pOperator->exprSupp.pFilterInfo, pBlock->pBlockAgg, size, pBlockInfo->rows);
if (!keep) {
- qDebug("%s data block filter out by block SMA, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 , GET_TASKID(pTaskInfo),
- pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
+ qDebug("%s data block filter out by block SMA, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64,
+ GET_TASKID(pTaskInfo), pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
pCost->filterOutBlocks += 1;
(*status) = FUNC_DATA_REQUIRED_FILTEROUT;
@@ -366,8 +366,8 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca
// try to filter data block according to current results
doDynamicPruneDataBlock(pOperator, pBlockInfo, status);
if (*status == FUNC_DATA_REQUIRED_NOT_LOAD) {
- qDebug("%s data block skipped due to dynamic prune, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64 , GET_TASKID(pTaskInfo),
- pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
+ qDebug("%s data block skipped due to dynamic prune, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64,
+ GET_TASKID(pTaskInfo), pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows);
pCost->skipBlocks += 1;
tsdbReleaseDataBlock(pTableScanInfo->dataReader);
*status = FUNC_DATA_REQUIRED_FILTEROUT;
@@ -658,7 +658,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) {
if (!hasNext) {
break;
}
-
+
if (isTaskKilled(pTaskInfo)) {
tsdbReleaseDataBlock(pTableScanInfo->base.dataReader);
T_LONG_JMP(pTaskInfo->env, pTaskInfo->code);
@@ -678,7 +678,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) {
if (pBlock->info.id.uid) {
pBlock->info.id.groupId = getTableGroupId(pTableScanInfo->base.pTableListInfo, pBlock->info.id.uid);
}
-
+
uint32_t status = 0;
int32_t code = loadDataBlock(pOperator, &pTableScanInfo->base, pBlock, &status);
if (code != TSDB_CODE_SUCCESS) {
@@ -771,7 +771,7 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
// scan table one by one sequentially
if (pInfo->scanMode == TABLE_SCAN__TABLE_ORDER) {
- int32_t numOfTables = 0;//tableListGetSize(pTaskInfo->pTableListInfo);
+ int32_t numOfTables = 0; // tableListGetSize(pTaskInfo->pTableListInfo);
STableKeyInfo tInfo = {0};
while (1) {
@@ -792,7 +792,7 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
return NULL;
}
- tInfo = *(STableKeyInfo*) tableListGetInfo(pInfo->base.pTableListInfo, pInfo->currentTable);
+ tInfo = *(STableKeyInfo*)tableListGetInfo(pInfo->base.pTableListInfo, pInfo->currentTable);
taosRUnLockLatch(&pTaskInfo->lock);
tsdbSetTableList(pInfo->base.dataReader, &tInfo, 1);
@@ -1618,12 +1618,11 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
SStreamScanInfo* pInfo = pOperator->info;
- const char* id = GET_TASKID(pTaskInfo);
+ const char* id = GET_TASKID(pTaskInfo);
qDebug("start to exec queue scan, %s", id);
if (pTaskInfo->streamInfo.submit.msgStr != NULL) {
-
if (pInfo->tqReader->msg2.msgStr == NULL) {
SPackedData submit = pTaskInfo->streamInfo.submit;
if (tqReaderSetSubmitReq2(pInfo->tqReader, submit.msgStr, submit.msgLen, submit.ver) < 0) {
@@ -1661,8 +1660,9 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_DATA) {
SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp);
if (pResult && pResult->info.rows > 0) {
- qDebug("queue scan tsdb return %" PRId64 " rows min:%" PRId64 " max:%" PRId64 " wal curVersion:%" PRId64" %s", pResult->info.rows,
- pResult->info.window.skey, pResult->info.window.ekey, pInfo->tqReader->pWalReader->curVersion, id);
+ qDebug("queue scan tsdb return %" PRId64 " rows min:%" PRId64 " max:%" PRId64 " wal curVersion:%" PRId64 " %s",
+ pResult->info.rows, pResult->info.window.skey, pResult->info.window.ekey,
+ pInfo->tqReader->pWalReader->curVersion, id);
pTaskInfo->streamInfo.returned = 1;
return pResult;
} else {
@@ -1670,7 +1670,6 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
if (!pTaskInfo->streamInfo.returned) {
STableScanInfo* pTSInfo = pInfo->pTableScanOp->info;
tsdbReaderClose(pTSInfo->base.dataReader);
-
pTSInfo->base.dataReader = NULL;
tqOffsetResetToLog(&pTaskInfo->streamInfo.prepareStatus, pTaskInfo->streamInfo.snapshotVer);
@@ -1898,7 +1897,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
printDataBlock(pInfo->pCreateTbRes, "recover createTbl");
return pInfo->pCreateTbRes;
}
- qDebug("stream recover scan get block, rows %" PRId64 , pInfo->pRecoverRes->info.rows);
+ qDebug("stream recover scan get block, rows %" PRId64, pInfo->pRecoverRes->info.rows);
printDataBlock(pInfo->pRecoverRes, "scan recover");
return pInfo->pRecoverRes;
}
@@ -2128,7 +2127,7 @@ FETCH_NEXT_BLOCK:
pOperator->resultInfo.totalRows += pBlockInfo->rows;
// printDataBlock(pInfo->pRes, "stream scan");
- qDebug("scan rows: %" PRId64 , pBlockInfo->rows);
+ qDebug("scan rows: %" PRId64, pBlockInfo->rows);
if (pBlockInfo->rows > 0) {
return pInfo->pRes;
}
@@ -2175,7 +2174,7 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) {
T_LONG_JMP(pTaskInfo->env, code);
}
}
-
+
if (pInfo->dataReader && hasNext) {
if (isTaskKilled(pTaskInfo)) {
tsdbReleaseDataBlock(pInfo->dataReader);
@@ -2624,8 +2623,8 @@ static void destroyTagScanOperatorInfo(void* param) {
taosMemoryFreeClear(param);
}
-SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode, STableListInfo* pTableListInfo,
- SExecTaskInfo* pTaskInfo) {
+SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysiNode* pPhyNode,
+ STableListInfo* pTableListInfo, SExecTaskInfo* pTaskInfo) {
STagScanInfo* pInfo = taosMemoryCalloc(1, sizeof(STagScanInfo));
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
if (pInfo == NULL || pOperator == NULL) {
@@ -2690,10 +2689,10 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
T_LONG_JMP(pTaskInfo->env, code);
}
}
-
+
pInfo->base.dataReader = source->dataReader;
STsdbReader* reader = pInfo->base.dataReader;
- bool hasNext = false;
+ bool hasNext = false;
qTrace("tsdb/read-table-data: %p, enter next reader", reader);
while (true) {
@@ -2707,7 +2706,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) {
if (!hasNext) {
break;
}
-
+
if (isTaskKilled(pTaskInfo)) {
tsdbReleaseDataBlock(reader);
pInfo->base.dataReader = NULL;
@@ -2967,7 +2966,7 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) {
pInfo->tableStartIndex = pInfo->tableEndIndex + 1;
pInfo->groupId = tableListGetInfo(pInfo->base.pTableListInfo, pInfo->tableStartIndex)->groupId;
startGroupTableMergeScan(pOperator);
- resetLimitInfoForNextGroup(&pInfo->limitInfo);
+ resetLimitInfoForNextGroup(&pInfo->limitInfo);
}
}
@@ -2987,6 +2986,9 @@ void destroyTableMergeScanOperatorInfo(void* param) {
p->dataReader = NULL;
}
+ tsdbReaderClose(pTableScanInfo->base.dataReader);
+ pTableScanInfo->base.dataReader = NULL;
+
taosArrayDestroy(pTableScanInfo->sortSourceParams);
tsortDestroySortHandle(pTableScanInfo->pSortHandle);
pTableScanInfo->pSortHandle = NULL;
@@ -3324,7 +3326,7 @@ static void buildSysDbGroupedTableCount(SOperatorInfo* pOperator, STableCountSca
} else {
groupId = calcGroupId("", 0);
}
-
+
pRes->info.id.groupId = groupId;
fillTableCountScanDataBlock(pSupp, TSDB_INFORMATION_SCHEMA_DB, "", infodbTableNum, pRes);
} else if (pInfo->currGrpIdx == 1) {
@@ -3436,7 +3438,7 @@ static void buildVnodeGroupedNtbTableCount(STableCountScanOperatorInfo* pInfo, S
if (pSupp->groupByDbName) {
snprintf(fullStbName, TSDB_TABLE_FNAME_LEN, "%s.%s", dbName, "");
}
-
+
uint64_t groupId = calcGroupId(fullStbName, strlen(fullStbName));
pRes->info.id.groupId = groupId;
int64_t ntbNum = metaGetNtbNum(pInfo->readHandle.meta);
@@ -3456,7 +3458,7 @@ static void buildVnodeGroupedStbTableCount(STableCountScanOperatorInfo* pInfo, S
} else {
snprintf(fullStbName, TSDB_TABLE_FNAME_LEN, "%s", stbName);
}
-
+
uint64_t groupId = calcGroupId(fullStbName, strlen(fullStbName));
pRes->info.id.groupId = groupId;
diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c
index 29acc1fea203d44b86ebd1a0867d4d041c09a2de..987a82436f92f942cc9b65001834112bea342270 100644
--- a/source/libs/executor/src/timewindowoperator.c
+++ b/source/libs/executor/src/timewindowoperator.c
@@ -283,7 +283,7 @@ static void getNextTimeWindow(SInterval* pInterval, int32_t precision, int32_t o
struct tm tm;
time_t t = (time_t)key;
- taosLocalTime(&t, &tm);
+ taosLocalTime(&t, &tm, NULL);
int mon = (int)(tm.tm_year * 12 + tm.tm_mon + interval * factor);
tm.tm_year = mon / 12;
diff --git a/source/libs/function/inc/tudfInt.h b/source/libs/function/inc/tudfInt.h
index c69d19b8a6187ad1d6817a6b5f8793b0905817e4..27d3b7930f80905f76704250765dc63040d33353 100644
--- a/source/libs/function/inc/tudfInt.h
+++ b/source/libs/function/inc/tudfInt.h
@@ -41,7 +41,7 @@ typedef struct SUdfSetupRequest {
typedef struct SUdfSetupResponse {
int64_t udfHandle;
int8_t outputType;
- int32_t outputLen;
+ int32_t bytes;
int32_t bufSize;
} SUdfSetupResponse;
diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c
index a88b1388bab39c0db6443884c7974b0c340e849b..a36204bab7c10a67af4ddec40f61b21cde2d2842 100644
--- a/source/libs/function/src/builtins.c
+++ b/source/libs/function/src/builtins.c
@@ -213,8 +213,9 @@ static int32_t addTimezoneParam(SNodeList* pList) {
char buf[6] = {0};
time_t t = taosTime(NULL);
struct tm tmInfo;
- taosLocalTime(&t, &tmInfo);
- strftime(buf, sizeof(buf), "%z", &tmInfo);
+ if (taosLocalTime(&t, &tmInfo, buf) != NULL) {
+ strftime(buf, sizeof(buf), "%z", &tmInfo);
+ }
int32_t len = (int32_t)strlen(buf);
SValueNode* pVal = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE);
diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c
index 6d093c130f35656ebad34c18d8cd20ec20ceb909..01f81c9a99e9d00528691abec5a345881d9a1991 100644
--- a/source/libs/function/src/builtinsimpl.c
+++ b/source/libs/function/src/builtinsimpl.c
@@ -32,9 +32,6 @@
#define TAIL_MAX_POINTS_NUM 100
#define TAIL_MAX_OFFSET 100
-#define UNIQUE_MAX_RESULT_SIZE (1024 * 1024 * 10)
-#define MODE_MAX_RESULT_SIZE UNIQUE_MAX_RESULT_SIZE
-
#define HLL_BUCKET_BITS 14 // The bits of the bucket
#define HLL_DATA_BITS (64 - HLL_BUCKET_BITS)
#define HLL_BUCKETS (1 << HLL_BUCKET_BITS)
@@ -244,12 +241,11 @@ typedef struct SUniqueInfo {
typedef struct SModeItem {
int64_t count;
+ STuplePos dataPos;
STuplePos tuplePos;
- char data[];
} SModeItem;
typedef struct SModeInfo {
- int32_t numOfPoints;
uint8_t colType;
int16_t colBytes;
SHashObj* pHash;
@@ -257,7 +253,7 @@ typedef struct SModeInfo {
STuplePos nullTuplePos;
bool nullTupleSaved;
- char pItems[];
+ char* buf; // serialize data buffer
} SModeInfo;
typedef struct SDerivInfo {
@@ -3125,7 +3121,7 @@ void* serializeTupleData(const SSDataBlock* pSrcBlock, int32_t rowIndex, SSubsid
return buf;
}
-static int32_t doSaveTupleData(SSerializeDataHandle* pHandle, const void* pBuf, size_t length, STupleKey key,
+static int32_t doSaveTupleData(SSerializeDataHandle* pHandle, const void* pBuf, size_t length, STupleKey* key,
STuplePos* pPos) {
STuplePos p = {0};
if (pHandle->pBuf != NULL) {
@@ -3161,8 +3157,8 @@ static int32_t doSaveTupleData(SSerializeDataHandle* pHandle, const void* pBuf,
releaseBufPage(pHandle->pBuf, pPage);
} else {
// other tuple save policy
- if (streamStateFuncPut(pHandle->pState, &key, pBuf, length) >= 0) {
- p.streamTupleKey = key;
+ if (streamStateFuncPut(pHandle->pState, key, pBuf, length) >= 0) {
+ p.streamTupleKey = *key;
}
}
@@ -3186,7 +3182,7 @@ int32_t saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock*
}
char* buf = serializeTupleData(pSrcBlock, rowIndex, &pCtx->subsidiaries, pCtx->subsidiaries.buf);
- return doSaveTupleData(&pCtx->saveHandle, buf, pCtx->subsidiaries.rowLen, key, pPos);
+ return doSaveTupleData(&pCtx->saveHandle, buf, pCtx->subsidiaries.rowLen, &key, pPos);
}
static int32_t doUpdateTupleData(SSerializeDataHandle* pHandle, const void* pBuf, size_t length, STuplePos* pPos) {
@@ -4961,7 +4957,7 @@ int32_t uniqueFunction(SqlFunctionCtx* pCtx) {
}
bool getModeFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
- pEnv->calcMemSize = sizeof(SModeInfo) + MODE_MAX_RESULT_SIZE;
+ pEnv->calcMemSize = sizeof(SModeInfo);
return true;
}
@@ -4971,7 +4967,6 @@ bool modeFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
}
SModeInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo);
- pInfo->numOfPoints = 0;
pInfo->colType = pCtx->resDataInfo.type;
pInfo->colBytes = pCtx->resDataInfo.bytes;
if (pInfo->pHash != NULL) {
@@ -4982,38 +4977,60 @@ bool modeFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
pInfo->nullTupleSaved = false;
pInfo->nullTuplePos.pageId = -1;
+ pInfo->buf = taosMemoryMalloc(pInfo->colBytes);
+
return true;
}
+static void modeFunctionCleanup(SModeInfo * pInfo) {
+ taosHashCleanup(pInfo->pHash);
+ taosMemoryFreeClear(pInfo->buf);
+}
+
+static int32_t saveModeTupleData(SqlFunctionCtx* pCtx, char* data, SModeInfo *pInfo, STuplePos* pPos) {
+ if (IS_VAR_DATA_TYPE(pInfo->colType)) {
+ memcpy(pInfo->buf, data, varDataTLen(data));
+ } else {
+ memcpy(pInfo->buf, data, pInfo->colBytes);
+ }
+
+ return doSaveTupleData(&pCtx->saveHandle, pInfo->buf, pInfo->colBytes, NULL, pPos);
+}
+
static int32_t doModeAdd(SModeInfo* pInfo, int32_t rowIndex, SqlFunctionCtx* pCtx, char* data) {
- int32_t hashKeyBytes = IS_STR_DATA_TYPE(pInfo->colType) ? varDataTLen(data) : pInfo->colBytes;
- SModeItem** pHashItem = taosHashGet(pInfo->pHash, data, hashKeyBytes);
+ int32_t code = TSDB_CODE_SUCCESS;
+ int32_t hashKeyBytes = IS_STR_DATA_TYPE(pInfo->colType) ? varDataTLen(data) : pInfo->colBytes;
+
+ SModeItem* pHashItem = (SModeItem *)taosHashGet(pInfo->pHash, data, hashKeyBytes);
if (pHashItem == NULL) {
- int32_t size = sizeof(SModeItem) + pInfo->colBytes;
- SModeItem* pItem = (SModeItem*)(pInfo->pItems + pInfo->numOfPoints * size);
- memcpy(pItem->data, data, hashKeyBytes);
- pItem->count += 1;
+ int32_t size = sizeof(SModeItem);
+ SModeItem item = {0};
+
+ item.count += 1;
+ code = saveModeTupleData(pCtx, data, pInfo, &item.dataPos);
+ if (code != TSDB_CODE_SUCCESS) {
+ return code;
+ }
if (pCtx->subsidiaries.num > 0) {
- int32_t code = saveTupleData(pCtx, rowIndex, pCtx->pSrcBlock, &pItem->tuplePos);
+ code = saveTupleData(pCtx, rowIndex, pCtx->pSrcBlock, &item.tuplePos);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
}
- taosHashPut(pInfo->pHash, data, hashKeyBytes, &pItem, sizeof(SModeItem*));
- pInfo->numOfPoints++;
+ taosHashPut(pInfo->pHash, data, hashKeyBytes, &item, sizeof(SModeItem));
} else {
- (*pHashItem)->count += 1;
+ pHashItem->count += 1;
if (pCtx->subsidiaries.num > 0) {
- int32_t code = updateTupleData(pCtx, rowIndex, pCtx->pSrcBlock, &((*pHashItem)->tuplePos));
+ int32_t code = updateTupleData(pCtx, rowIndex, pCtx->pSrcBlock, &pHashItem->tuplePos);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
}
}
- return TSDB_CODE_SUCCESS;
+ return code;
}
int32_t modeFunction(SqlFunctionCtx* pCtx) {
@@ -5036,18 +5053,15 @@ int32_t modeFunction(SqlFunctionCtx* pCtx) {
char* data = colDataGetData(pInputCol, i);
int32_t code = doModeAdd(pInfo, i, pCtx, data);
if (code != TSDB_CODE_SUCCESS) {
+ modeFunctionCleanup(pInfo);
return code;
}
-
- if (sizeof(SModeInfo) + pInfo->numOfPoints * (sizeof(SModeItem) + pInfo->colBytes) >= MODE_MAX_RESULT_SIZE) {
- taosHashCleanup(pInfo->pHash);
- return TSDB_CODE_OUT_OF_MEMORY;
- }
}
if (numOfElems == 0 && pCtx->subsidiaries.num > 0 && !pInfo->nullTupleSaved) {
int32_t code = saveTupleData(pCtx, pInput->startRowIndex, pCtx->pSrcBlock, &pInfo->nullTuplePos);
if (code != TSDB_CODE_SUCCESS) {
+ modeFunctionCleanup(pInfo);
return code;
}
pInfo->nullTupleSaved = true;
@@ -5066,26 +5080,37 @@ int32_t modeFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId);
int32_t currentRow = pBlock->info.rows;
- int32_t resIndex = -1;
+ STuplePos resDataPos, resTuplePos;
int32_t maxCount = 0;
- for (int32_t i = 0; i < pInfo->numOfPoints; ++i) {
- SModeItem* pItem = (SModeItem*)(pInfo->pItems + i * (sizeof(SModeItem) + pInfo->colBytes));
+
+ void *pIter = taosHashIterate(pInfo->pHash, NULL);
+ while (pIter != NULL) {
+ SModeItem *pItem = (SModeItem *)pIter;
if (pItem->count >= maxCount) {
maxCount = pItem->count;
- resIndex = i;
+ resDataPos = pItem->dataPos;
+ resTuplePos = pItem->tuplePos;
}
+
+ pIter = taosHashIterate(pInfo->pHash, pIter);
}
if (maxCount != 0) {
- SModeItem* pResItem = (SModeItem*)(pInfo->pItems + resIndex * (sizeof(SModeItem) + pInfo->colBytes));
- colDataSetVal(pCol, currentRow, pResItem->data, false);
- code = setSelectivityValue(pCtx, pBlock, &pResItem->tuplePos, currentRow);
+ const char* pData = loadTupleData(pCtx, &resDataPos);
+ if (pData == NULL) {
+ code = TSDB_CODE_NO_AVAIL_DISK;
+ modeFunctionCleanup(pInfo);
+ return code;
+ }
+
+ colDataSetVal(pCol, currentRow, pData, false);
+ code = setSelectivityValue(pCtx, pBlock, &resTuplePos, currentRow);
} else {
colDataSetNULL(pCol, currentRow);
code = setSelectivityValue(pCtx, pBlock, &pInfo->nullTuplePos, currentRow);
}
- taosHashCleanup(pInfo->pHash);
+ modeFunctionCleanup(pInfo);
return code;
}
@@ -5595,7 +5620,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
int32_t bucketRange = (pData->defMaxRows - pData->defMinRows) / numOfBuckets;
for (int32_t i = 0; i < tListLen(pData->blockRowsHisto); ++i) {
- len = sprintf(st + VARSTR_HEADER_SIZE, "%04d |", pData->defMinRows + bucketRange * i);
+ len = sprintf(st + VARSTR_HEADER_SIZE, "%04d |", pData->defMinRows + bucketRange * (i + 1));
int32_t num = 0;
if (pData->blockRowsHisto[i] > 0) {
diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c
index 8f5cd070dca186651d552ce2cd274856a703e119..fad118297e6412c054f5c22ecc82b8cb291aa1f5 100644
--- a/source/libs/function/src/tudf.c
+++ b/source/libs/function/src/tudf.c
@@ -376,7 +376,7 @@ typedef struct SUdfcUvSession {
uv_pipe_t *udfUvPipe;
int8_t outputType;
- int32_t outputLen;
+ int32_t bytes;
int32_t bufSize;
char udfName[TSDB_FUNC_NAME_LEN + 1];
@@ -614,7 +614,7 @@ int32_t encodeUdfSetupResponse(void **buf, const SUdfSetupResponse *setupRsp) {
int32_t len = 0;
len += taosEncodeFixedI64(buf, setupRsp->udfHandle);
len += taosEncodeFixedI8(buf, setupRsp->outputType);
- len += taosEncodeFixedI32(buf, setupRsp->outputLen);
+ len += taosEncodeFixedI32(buf, setupRsp->bytes);
len += taosEncodeFixedI32(buf, setupRsp->bufSize);
return len;
}
@@ -622,7 +622,7 @@ int32_t encodeUdfSetupResponse(void **buf, const SUdfSetupResponse *setupRsp) {
void *decodeUdfSetupResponse(const void *buf, SUdfSetupResponse *setupRsp) {
buf = taosDecodeFixedI64(buf, &setupRsp->udfHandle);
buf = taosDecodeFixedI8(buf, &setupRsp->outputType);
- buf = taosDecodeFixedI32(buf, &setupRsp->outputLen);
+ buf = taosDecodeFixedI32(buf, &setupRsp->bytes);
buf = taosDecodeFixedI32(buf, &setupRsp->bufSize);
return (void *)buf;
}
@@ -808,6 +808,26 @@ int32_t convertDataBlockToUdfDataBlock(SSDataBlock *block, SUdfDataBlock *udfBlo
}
int32_t convertUdfColumnToDataBlock(SUdfColumn *udfCol, SSDataBlock *block) {
+ SUdfColumnMeta* meta = &udfCol->colMeta;
+
+ SColumnInfoData colInfoData = createColumnInfoData(meta->type, meta->bytes, 1);
+ blockDataAppendColInfo(block, &colInfoData);
+ blockDataEnsureCapacity(block, udfCol->colData.numOfRows);
+
+ SColumnInfoData *col = bdGetColumnInfoData(block, 0);
+ for (int i = 0; i < udfCol->colData.numOfRows; ++i) {
+ if (udfColDataIsNull(udfCol, i)) {
+ colDataSetNULL(col, i);
+ } else {
+ char* data = udfColDataGetData(udfCol, i);
+ colDataSetVal(col, i, data, false);
+ }
+ }
+ block->info.rows = udfCol->colData.numOfRows;
+ return 0;
+}
+
+int32_t convertUdfColumnToDataBlock2(SUdfColumn *udfCol, SSDataBlock *block) {
block->info.rows = udfCol->colData.numOfRows;
block->info.hasVarCol = IS_VAR_DATA_TYPE(udfCol->colMeta.type);
@@ -899,9 +919,11 @@ int32_t convertDataBlockToScalarParm(SSDataBlock *input, SScalarParam *output) {
typedef struct SUdfAggRes {
int8_t finalResNum;
int8_t interResNum;
+ int32_t interResBufLen;
char *finalResBuf;
char *interResBuf;
} SUdfAggRes;
+
void onUdfcPipeClose(uv_handle_t *handle);
int32_t udfcGetUdfTaskResultFromUvTask(SClientUdfTask *task, SClientUvTaskNode *uvTask);
void udfcAllocateBuffer(uv_handle_t *handle, size_t suggestedSize, uv_buf_t *buf);
@@ -1048,15 +1070,22 @@ int32_t callUdfScalarFunc(char *udfName, SScalarParam *input, int32_t numOfCols,
if (code != 0) {
return code;
}
+
SUdfcUvSession *session = handle;
code = doCallUdfScalarFunc(handle, input, numOfCols, output);
+ if (code != TSDB_CODE_SUCCESS) {
+ fnError("udfc scalar function execution failure");
+ releaseUdfFuncHandle(udfName);
+ return code;
+ }
+
if (output->columnData == NULL) {
fnError("udfc scalar function calculate error. no column data");
code = TSDB_CODE_UDF_INVALID_OUTPUT_TYPE;
} else {
- if (session->outputType != output->columnData->info.type || session->outputLen != output->columnData->info.bytes) {
+ if (session->outputType != output->columnData->info.type || session->bytes != output->columnData->info.bytes) {
fnError("udfc scalar function calculate error. type mismatch. session type: %d(%d), output type: %d(%d)",
- session->outputType, session->outputLen, output->columnData->info.type, output->columnData->info.bytes);
+ session->outputType, session->bytes, output->columnData->info.type, output->columnData->info.bytes);
code = TSDB_CODE_UDF_INVALID_OUTPUT_TYPE;
}
}
@@ -1084,11 +1113,11 @@ bool udfAggInit(struct SqlFunctionCtx *pCtx, struct SResultRowEntryInfo *pResult
}
SUdfcUvSession *session = (SUdfcUvSession *)handle;
SUdfAggRes *udfRes = (SUdfAggRes *)GET_ROWCELL_INTERBUF(pResultCellInfo);
- int32_t envSize = sizeof(SUdfAggRes) + session->outputLen + session->bufSize;
+ int32_t envSize = sizeof(SUdfAggRes) + session->bytes + session->bufSize;
memset(udfRes, 0, envSize);
udfRes->finalResBuf = (char *)udfRes + sizeof(SUdfAggRes);
- udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->outputLen;
+ udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->bytes;
SUdfInterBuf buf = {0};
if ((udfCode = doCallUdfAggInit(handle, &buf)) != 0) {
@@ -1096,9 +1125,10 @@ bool udfAggInit(struct SqlFunctionCtx *pCtx, struct SResultRowEntryInfo *pResult
releaseUdfFuncHandle(pCtx->udfName);
return false;
}
- udfRes->interResNum = buf.numOfResult;
if (buf.bufLen <= session->bufSize) {
memcpy(udfRes->interResBuf, buf.buf, buf.bufLen);
+ udfRes->interResBufLen = buf.bufLen;
+ udfRes->interResNum = buf.numOfResult;
} else {
fnError("udfc inter buf size %d is greater than function bufSize %d", buf.bufLen, session->bufSize);
releaseUdfFuncHandle(pCtx->udfName);
@@ -1120,7 +1150,7 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) {
SUdfcUvSession *session = handle;
SUdfAggRes *udfRes = (SUdfAggRes *)GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
udfRes->finalResBuf = (char *)udfRes + sizeof(SUdfAggRes);
- udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->outputLen;
+ udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->bytes;
SInputColumnInfoData *pInput = &pCtx->input;
int32_t numOfCols = pInput->numOfInputCols;
@@ -1136,7 +1166,7 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) {
SSDataBlock *inputBlock = blockDataExtractBlock(pTempBlock, start, numOfRows);
- SUdfInterBuf state = {.buf = udfRes->interResBuf, .bufLen = session->bufSize, .numOfResult = udfRes->interResNum};
+ SUdfInterBuf state = {.buf = udfRes->interResBuf, .bufLen = udfRes->interResBufLen, .numOfResult = udfRes->interResNum};
SUdfInterBuf newState = {0};
udfCode = doCallUdfAggProcess(session, inputBlock, &state, &newState);
@@ -1144,17 +1174,17 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) {
fnError("udfAggProcess error. code: %d", udfCode);
newState.numOfResult = 0;
} else {
- udfRes->interResNum = newState.numOfResult;
if (newState.bufLen <= session->bufSize) {
memcpy(udfRes->interResBuf, newState.buf, newState.bufLen);
+ udfRes->interResBufLen = newState.bufLen;
+ udfRes->interResNum = newState.numOfResult;
} else {
fnError("udfc inter buf size %d is greater than function bufSize %d", newState.bufLen, session->bufSize);
udfCode = TSDB_CODE_UDF_INVALID_BUFSIZE;
}
}
- if (newState.numOfResult == 1 || state.numOfResult == 1) {
- GET_RES_INFO(pCtx)->numOfRes = 1;
- }
+
+ GET_RES_INFO(pCtx)->numOfRes = udfRes->interResNum;
blockDataDestroy(inputBlock);
@@ -1177,24 +1207,29 @@ int32_t udfAggFinalize(struct SqlFunctionCtx *pCtx, SSDataBlock *pBlock) {
SUdfcUvSession *session = handle;
SUdfAggRes *udfRes = (SUdfAggRes *)GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
udfRes->finalResBuf = (char *)udfRes + sizeof(SUdfAggRes);
- udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->outputLen;
+ udfRes->interResBuf = (char *)udfRes + sizeof(SUdfAggRes) + session->bytes;
SUdfInterBuf resultBuf = {0};
- SUdfInterBuf state = {.buf = udfRes->interResBuf, .bufLen = session->bufSize, .numOfResult = udfRes->interResNum};
+ SUdfInterBuf state = {.buf = udfRes->interResBuf, .bufLen = udfRes->interResBufLen, .numOfResult = udfRes->interResNum};
int32_t udfCallCode = 0;
udfCallCode = doCallUdfAggFinalize(session, &state, &resultBuf);
if (udfCallCode != 0) {
fnError("udfAggFinalize error. doCallUdfAggFinalize step. udf code:%d", udfCallCode);
GET_RES_INFO(pCtx)->numOfRes = 0;
} else {
- if (resultBuf.bufLen <= session->outputLen) {
- memcpy(udfRes->finalResBuf, resultBuf.buf, session->outputLen);
- udfRes->finalResNum = resultBuf.numOfResult;
- GET_RES_INFO(pCtx)->numOfRes = udfRes->finalResNum;
- } else {
- fnError("udfc inter buf size %d is greater than function output size %d", resultBuf.bufLen, session->outputLen);
+ if (resultBuf.numOfResult == 0) {
+ udfRes->finalResNum = 0;
GET_RES_INFO(pCtx)->numOfRes = 0;
- udfCallCode = TSDB_CODE_UDF_INVALID_OUTPUT_TYPE;
+ } else {
+ if (resultBuf.bufLen <= session->bytes) {
+ memcpy(udfRes->finalResBuf, resultBuf.buf, resultBuf.bufLen);
+ udfRes->finalResNum = resultBuf.numOfResult;
+ GET_RES_INFO(pCtx)->numOfRes = udfRes->finalResNum;
+ } else {
+ fnError("udfc inter buf size %d is greater than function output size %d", resultBuf.bufLen, session->bytes);
+ GET_RES_INFO(pCtx)->numOfRes = 0;
+ udfCallCode = TSDB_CODE_UDF_INVALID_OUTPUT_TYPE;
+ }
}
}
@@ -1696,13 +1731,13 @@ int32_t doSetupUdf(char udfName[], UdfcFuncHandle *funcHandle) {
SUdfSetupResponse *rsp = &task->_setup.rsp;
task->session->severHandle = rsp->udfHandle;
task->session->outputType = rsp->outputType;
- task->session->outputLen = rsp->outputLen;
+ task->session->bytes = rsp->bytes;
task->session->bufSize = rsp->bufSize;
strncpy(task->session->udfName, udfName, TSDB_FUNC_NAME_LEN);
if (task->errCode != 0) {
fnError("failed to setup udf. udfname: %s, err: %d", udfName, task->errCode)
} else {
- fnInfo("sucessfully setup udf func handle. udfName: %s, handle: %p", udfName, task->session);
+ fnInfo("successfully setup udf func handle. udfName: %s, handle: %p", udfName, task->session);
*funcHandle = task->session;
}
int32_t err = task->errCode;
diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c
index c368788243c264600fc7a055037354b0ee82ea6a..a8b993290e6367bf49a833f36a6455f3bae67abe 100644
--- a/source/libs/function/src/udfd.c
+++ b/source/libs/function/src/udfd.c
@@ -31,6 +31,173 @@
#include "tmisce.h"
// clang-format on
+#define UDFD_MAX_SCRIPT_PLUGINS 64
+#define UDFD_MAX_SCRIPT_TYPE 1
+#define UDFD_MAX_PLUGIN_FUNCS 9
+
+typedef struct SUdfCPluginCtx {
+ uv_lib_t lib;
+
+ TUdfScalarProcFunc scalarProcFunc;
+
+ TUdfAggStartFunc aggStartFunc;
+ TUdfAggProcessFunc aggProcFunc;
+ TUdfAggFinishFunc aggFinishFunc;
+ TUdfAggMergeFunc aggMergeFunc;
+
+ TUdfInitFunc initFunc;
+ TUdfDestroyFunc destroyFunc;
+} SUdfCPluginCtx;
+
+int32_t udfdCPluginOpen(SScriptUdfEnvItem *items, int numItems) { return 0; }
+
+int32_t udfdCPluginClose() { return 0; }
+
+int32_t udfdCPluginUdfInit(SScriptUdfInfo *udf, void **pUdfCtx) {
+ int32_t err = 0;
+ SUdfCPluginCtx *udfCtx = taosMemoryCalloc(1, sizeof(SUdfCPluginCtx));
+ err = uv_dlopen(udf->path, &udfCtx->lib);
+ if (err != 0) {
+ fnError("can not load library %s. error: %s", udf->path, uv_strerror(err));
+ return TSDB_CODE_UDF_LOAD_UDF_FAILURE;
+ }
+ const char *udfName = udf->name;
+ char initFuncName[TSDB_FUNC_NAME_LEN + 5] = {0};
+ char *initSuffix = "_init";
+ strcpy(initFuncName, udfName);
+ strncat(initFuncName, initSuffix, strlen(initSuffix));
+ uv_dlsym(&udfCtx->lib, initFuncName, (void **)(&udfCtx->initFunc));
+
+ char destroyFuncName[TSDB_FUNC_NAME_LEN + 5] = {0};
+ char *destroySuffix = "_destroy";
+ strcpy(destroyFuncName, udfName);
+ strncat(destroyFuncName, destroySuffix, strlen(destroySuffix));
+ uv_dlsym(&udfCtx->lib, destroyFuncName, (void **)(&udfCtx->destroyFunc));
+
+ if (udf->funcType == UDF_FUNC_TYPE_SCALAR) {
+ char processFuncName[TSDB_FUNC_NAME_LEN] = {0};
+ strcpy(processFuncName, udfName);
+ uv_dlsym(&udfCtx->lib, processFuncName, (void **)(&udfCtx->scalarProcFunc));
+ } else if (udf->funcType == UDF_FUNC_TYPE_AGG) {
+ char processFuncName[TSDB_FUNC_NAME_LEN] = {0};
+ strcpy(processFuncName, udfName);
+ uv_dlsym(&udfCtx->lib, processFuncName, (void **)(&udfCtx->aggProcFunc));
+ char startFuncName[TSDB_FUNC_NAME_LEN + 6] = {0};
+ char *startSuffix = "_start";
+ strncpy(startFuncName, processFuncName, sizeof(startFuncName));
+ strncat(startFuncName, startSuffix, strlen(startSuffix));
+ uv_dlsym(&udfCtx->lib, startFuncName, (void **)(&udfCtx->aggStartFunc));
+ char finishFuncName[TSDB_FUNC_NAME_LEN + 7] = {0};
+ char *finishSuffix = "_finish";
+ strncpy(finishFuncName, processFuncName, sizeof(finishFuncName));
+ strncat(finishFuncName, finishSuffix, strlen(finishSuffix));
+ uv_dlsym(&udfCtx->lib, finishFuncName, (void **)(&udfCtx->aggFinishFunc));
+ char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0};
+ char *mergeSuffix = "_merge";
+ strncpy(mergeFuncName, processFuncName, sizeof(mergeFuncName));
+ strncat(mergeFuncName, mergeSuffix, strlen(mergeSuffix));
+ uv_dlsym(&udfCtx->lib, mergeFuncName, (void **)(&udfCtx->aggMergeFunc));
+ }
+ int32_t code = 0;
+ if (udfCtx->initFunc) {
+ // TODO: handle init call return error
+ code = (udfCtx->initFunc)();
+ if (code != 0) {
+ uv_dlclose(&udfCtx->lib);
+ taosMemoryFree(udfCtx);
+ return code;
+ }
+ }
+ *pUdfCtx = udfCtx;
+ return 0;
+}
+
+int32_t udfdCPluginUdfDestroy(void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ int32_t code = 0;
+ if (ctx->destroyFunc) {
+ code = (ctx->destroyFunc)();
+ }
+ uv_dlclose(&ctx->lib);
+ taosMemoryFree(ctx);
+ return code;
+}
+
+int32_t udfdCPluginUdfScalarProc(SUdfDataBlock *block, SUdfColumn *resultCol, void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ if (ctx->scalarProcFunc) {
+ return ctx->scalarProcFunc(block, resultCol);
+ } else {
+ fnError("udfd c plugin scalar proc not implemented");
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
+}
+
+int32_t udfdCPluginUdfAggStart(SUdfInterBuf *buf, void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ if (ctx->aggStartFunc) {
+ return ctx->aggStartFunc(buf);
+ } else {
+ fnError("udfd c plugin aggregation start not implemented");
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
+ return 0;
+}
+
+int32_t udfdCPluginUdfAggProc(SUdfDataBlock *block, SUdfInterBuf *interBuf, SUdfInterBuf *newInterBuf, void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ if (ctx->aggProcFunc) {
+ return ctx->aggProcFunc(block, interBuf, newInterBuf);
+ } else {
+ fnError("udfd c plugin aggregation process not implemented");
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
+}
+
+int32_t udfdCPluginUdfAggMerge(SUdfInterBuf *inputBuf1, SUdfInterBuf *inputBuf2, SUdfInterBuf *outputBuf,
+ void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ if (ctx->aggMergeFunc) {
+ return ctx->aggMergeFunc(inputBuf1, inputBuf2, outputBuf);
+ } else {
+ fnError("udfd c plugin aggregation merge not implemented");
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
+}
+
+int32_t udfdCPluginUdfAggFinish(SUdfInterBuf *buf, SUdfInterBuf *resultData, void *udfCtx) {
+ SUdfCPluginCtx *ctx = udfCtx;
+ if (ctx->aggFinishFunc) {
+ return ctx->aggFinishFunc(buf, resultData);
+ } else {
+ fnError("udfd c plugin aggregation finish not implemented");
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
+ return 0;
+}
+
+// for c, the function pointer are filled directly and libloaded = true;
+// for others, dlopen/dlsym to find function pointers
+typedef struct SUdfScriptPlugin {
+ int8_t scriptType;
+
+ char libPath[PATH_MAX];
+ bool libLoaded;
+ uv_lib_t lib;
+
+ TScriptUdfScalarProcFunc udfScalarProcFunc;
+ TScriptUdfAggStartFunc udfAggStartFunc;
+ TScriptUdfAggProcessFunc udfAggProcFunc;
+ TScriptUdfAggMergeFunc udfAggMergeFunc;
+ TScriptUdfAggFinishFunc udfAggFinishFunc;
+
+ TScriptUdfInitFunc udfInitFunc;
+ TScriptUdfDestoryFunc udfDestroyFunc;
+
+ TScriptOpenFunc openFunc;
+ TScriptCloseFunc closeFunc;
+} SUdfScriptPlugin;
+
typedef struct SUdfdContext {
uv_loop_t *loop;
uv_pipe_t ctrlPipe;
@@ -38,11 +205,15 @@ typedef struct SUdfdContext {
char listenPipeName[PATH_MAX + UDF_LISTEN_PIPE_NAME_LEN + 2];
uv_pipe_t listeningPipe;
- void *clientRpc;
- SCorEpSet mgmtEp;
+ void *clientRpc;
+ SCorEpSet mgmtEp;
+
uv_mutex_t udfsMutex;
SHashObj *udfsHash;
+ uv_mutex_t scriptPluginsMutex;
+ SUdfScriptPlugin *scriptPlugins[UDFD_MAX_SCRIPT_PLUGINS];
+
SArray *residentFuncs;
bool printVersion;
@@ -71,16 +242,11 @@ typedef struct SUvUdfWork {
struct SUvUdfWork *pWorkNext;
} SUvUdfWork;
-typedef enum { UDF_STATE_INIT = 0, UDF_STATE_LOADING, UDF_STATE_READY, UDF_STATE_UNLOADING } EUdfState;
+typedef enum { UDF_STATE_INIT = 0, UDF_STATE_LOADING, UDF_STATE_READY } EUdfState;
typedef struct SUdf {
- int32_t refCount;
- EUdfState state;
- uv_mutex_t lock;
- uv_cond_t condReady;
- bool resident;
+ char name[TSDB_FUNC_NAME_LEN + 1];
- char name[TSDB_FUNC_NAME_LEN + 1];
int8_t funcType;
int8_t scriptType;
int8_t outputType;
@@ -89,17 +255,14 @@ typedef struct SUdf {
char path[PATH_MAX];
- uv_lib_t lib;
-
- TUdfScalarProcFunc scalarProcFunc;
-
- TUdfAggStartFunc aggStartFunc;
- TUdfAggProcessFunc aggProcFunc;
- TUdfAggFinishFunc aggFinishFunc;
- TUdfAggMergeFunc aggMergeFunc;
+ int32_t refCount;
+ EUdfState state;
+ uv_mutex_t lock;
+ uv_cond_t condReady;
+ bool resident;
- TUdfInitFunc initFunc;
- TUdfDestroyFunc destroyFunc;
+ SUdfScriptPlugin *scriptPlugin;
+ void *scriptUdfCtx;
} SUdf;
// TODO: add private udf structure.
@@ -122,7 +285,6 @@ typedef struct SUdfdRpcSendRecvInfo {
static void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet);
static int32_t udfdFillUdfInfoFromMNode(void *clientRpc, char *udfName, SUdf *udf);
static int32_t udfdConnectToMnode();
-static int32_t udfdLoadUdf(char *udfName, SUdf *udf);
static bool udfdRpcRfp(int32_t code, tmsg_t msgType);
static int initEpSetFromCfg(const char *firstEp, const char *secondEp, SCorEpSet *pEpSet);
static int32_t udfdOpenClientRpc();
@@ -156,6 +318,155 @@ static void udfdCloseWalkCb(uv_handle_t *handle, void *arg);
static int32_t udfdRun();
static void udfdConnectMnodeThreadFunc(void *args);
+void udfdInitializeCPlugin(SUdfScriptPlugin *plugin) {
+ plugin->scriptType = TSDB_FUNC_SCRIPT_BIN_LIB;
+ plugin->openFunc = udfdCPluginOpen;
+ plugin->closeFunc = udfdCPluginClose;
+ plugin->udfInitFunc = udfdCPluginUdfInit;
+ plugin->udfDestroyFunc = udfdCPluginUdfDestroy;
+ plugin->udfScalarProcFunc = udfdCPluginUdfScalarProc;
+ plugin->udfAggStartFunc = udfdCPluginUdfAggStart;
+ plugin->udfAggProcFunc = udfdCPluginUdfAggProc;
+ plugin->udfAggMergeFunc = udfdCPluginUdfAggMerge;
+ plugin->udfAggFinishFunc = udfdCPluginUdfAggFinish;
+
+ SScriptUdfEnvItem items[1] = {{"LD_LIBRARY_PATH", tsUdfdLdLibPath}};
+ plugin->openFunc(items, 1);
+ return;
+}
+
+int32_t udfdLoadSharedLib(char *libPath, uv_lib_t *pLib, const char *funcName[], void **func[], int numOfFuncs) {
+ int err = uv_dlopen(libPath, pLib);
+ if (err != 0) {
+ fnError("can not load library %s. error: %s", libPath, uv_strerror(err));
+ return TSDB_CODE_UDF_LOAD_UDF_FAILURE;
+ }
+
+ for (int i = 0; i < numOfFuncs; ++i) {
+ err = uv_dlsym(pLib, funcName[i], func[i]);
+ if (err != 0) {
+ fnError("load library function failed. lib %s function %s", libPath, funcName[i]);
+ }
+ }
+ return 0;
+}
+
+int32_t udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) {
+ plugin->scriptType = TSDB_FUNC_SCRIPT_PYTHON;
+ // todo: windows support
+ sprintf(plugin->libPath, "%s", "libtaospyudf.so");
+ plugin->libLoaded = false;
+ const char *funcName[UDFD_MAX_PLUGIN_FUNCS] = {"pyOpen", "pyClose", "pyUdfInit",
+ "pyUdfDestroy", "pyUdfScalarProc", "pyUdfAggStart",
+ "pyUdfAggFinish", "pyUdfAggProc", "pyUdfAggMerge"};
+ void **funcs[UDFD_MAX_PLUGIN_FUNCS] = {
+ (void **)&plugin->openFunc, (void **)&plugin->closeFunc, (void **)&plugin->udfInitFunc,
+ (void **)&plugin->udfDestroyFunc, (void **)&plugin->udfScalarProcFunc, (void **)&plugin->udfAggStartFunc,
+ (void **)&plugin->udfAggFinishFunc, (void **)&plugin->udfAggProcFunc, (void **)&plugin->udfAggMergeFunc};
+ int32_t err = udfdLoadSharedLib(plugin->libPath, &plugin->lib, funcName, funcs, UDFD_MAX_PLUGIN_FUNCS);
+ if (err != 0) {
+ fnError("can not load python plugin. lib path %s", plugin->libPath);
+ return err;
+ }
+
+ if (plugin->openFunc) {
+ int16_t lenPythonPath = strlen(tsUdfdLdLibPath) + strlen(tsTempDir) + 1 + 1; // tsTempDir:tsUdfdLdLibPath
+ char *pythonPath = taosMemoryMalloc(lenPythonPath);
+#ifdef WINDOWS
+ snprintf(pythonPath, lenPythonPath, "%s;%s", tsTempDir, tsUdfdLdLibPath);
+#else
+ snprintf(pythonPath, lenPythonPath, "%s:%s", tsTempDir, tsUdfdLdLibPath);
+#endif
+ SScriptUdfEnvItem items[] = {{"PYTHONPATH", pythonPath}, {"LOGDIR", tsLogDir}};
+ err = plugin->openFunc(items, 2);
+ taosMemoryFree(pythonPath);
+ }
+ if (err != 0) {
+ fnError("udf script python plugin open func failed. error: %d", err);
+ uv_dlclose(&plugin->lib);
+ return err;
+ }
+ plugin->libLoaded = true;
+
+ return 0;
+}
+
+void udfdDeinitCPlugin(SUdfScriptPlugin *plugin) {
+ if (plugin->closeFunc) {
+ plugin->closeFunc();
+ }
+ plugin->openFunc = NULL;
+ plugin->closeFunc = NULL;
+ plugin->udfInitFunc = NULL;
+ plugin->udfDestroyFunc = NULL;
+ plugin->udfScalarProcFunc = NULL;
+ plugin->udfAggStartFunc = NULL;
+ plugin->udfAggProcFunc = NULL;
+ plugin->udfAggMergeFunc = NULL;
+ plugin->udfAggFinishFunc = NULL;
+ return;
+}
+
+void udfdDeinitPythonPlugin(SUdfScriptPlugin *plugin) {
+ if (plugin->closeFunc) {
+ plugin->closeFunc();
+ }
+ uv_dlclose(&plugin->lib);
+ if (plugin->libLoaded) {
+ plugin->libLoaded = false;
+ }
+ plugin->openFunc = NULL;
+ plugin->closeFunc = NULL;
+ plugin->udfInitFunc = NULL;
+ plugin->udfDestroyFunc = NULL;
+ plugin->udfScalarProcFunc = NULL;
+ plugin->udfAggStartFunc = NULL;
+ plugin->udfAggProcFunc = NULL;
+ plugin->udfAggMergeFunc = NULL;
+ plugin->udfAggFinishFunc = NULL;
+}
+
+int32_t udfdInitScriptPlugin(int8_t scriptType) {
+ SUdfScriptPlugin *plugin = taosMemoryCalloc(1, sizeof(SUdfScriptPlugin));
+
+ switch (scriptType) {
+ case TSDB_FUNC_SCRIPT_BIN_LIB:
+ udfdInitializeCPlugin(plugin);
+ break;
+ case TSDB_FUNC_SCRIPT_PYTHON: {
+ int32_t err = udfdInitializePythonPlugin(plugin);
+ if (err != 0) {
+ taosMemoryFree(plugin);
+ return err;
+ }
+ break;
+ }
+ default:
+ fnError("udf script type %d not supported", scriptType);
+ taosMemoryFree(plugin);
+ return TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED;
+ }
+
+ global.scriptPlugins[scriptType] = plugin;
+ return TSDB_CODE_SUCCESS;
+}
+
+void udfdDeinitScriptPlugins() {
+ SUdfScriptPlugin *plugin = NULL;
+ plugin = global.scriptPlugins[TSDB_FUNC_SCRIPT_PYTHON];
+ if (plugin != NULL) {
+ udfdDeinitPythonPlugin(plugin);
+ taosMemoryFree(plugin);
+ }
+
+ plugin = global.scriptPlugins[TSDB_FUNC_SCRIPT_BIN_LIB];
+ if (plugin != NULL) {
+ udfdDeinitCPlugin(plugin);
+ taosMemoryFree(plugin);
+ }
+ return;
+}
+
void udfdProcessRequest(uv_work_t *req) {
SUvUdfWork *uvUdf = (SUvUdfWork *)(req->data);
SUdfRequest request = {0};
@@ -181,14 +492,78 @@ void udfdProcessRequest(uv_work_t *req) {
}
}
-void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
- // TODO: tracable id from client. connect, setup, call, teardown
- fnInfo("setup request. seq num: %" PRId64 ", udf name: %s", request->seqNum, request->setup.udfName);
- SUdfSetupRequest *setup = &request->setup;
- int32_t code = TSDB_CODE_SUCCESS;
- SUdf *udf = NULL;
+void convertUdf2UdfInfo(SUdf *udf, SScriptUdfInfo *udfInfo) {
+ udfInfo->bufSize = udf->bufSize;
+ if (udf->funcType == TSDB_FUNC_TYPE_AGGREGATE) {
+ udfInfo->funcType = UDF_FUNC_TYPE_AGG;
+ } else if (udf->funcType == TSDB_FUNC_TYPE_SCALAR) {
+ udfInfo->funcType = UDF_FUNC_TYPE_SCALAR;
+ }
+ udfInfo->name = udf->name;
+ udfInfo->outputLen = udf->outputLen;
+ udfInfo->outputType = udf->outputType;
+ udfInfo->path = udf->path;
+ udfInfo->scriptType = udf->scriptType;
+}
+
+int32_t udfdRenameUdfFile(SUdf *udf) {
+ char newPath[PATH_MAX];
+ if (udf->scriptType == TSDB_FUNC_SCRIPT_BIN_LIB) {
+ snprintf(newPath, PATH_MAX, "%s/lib%s.so", tsTempDir, udf->name);
+ } else if (udf->scriptType == TSDB_FUNC_SCRIPT_PYTHON) {
+ snprintf(newPath, PATH_MAX, "%s/%s.py", tsTempDir, udf->name);
+ } else {
+ return TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED;
+ }
+ int32_t code = taosRenameFile(udf->path, newPath);
+ if (code == 0) {
+ sprintf(udf->path, "%s", newPath);
+ }
+ return 0;
+}
+
+int32_t udfdInitUdf(char *udfName, SUdf *udf) {
+ int32_t err = 0;
+ err = udfdFillUdfInfoFromMNode(global.clientRpc, udfName, udf);
+ if (err != 0) {
+ fnError("can not retrieve udf from mnode. udf name %s", udfName);
+ return TSDB_CODE_UDF_LOAD_UDF_FAILURE;
+ }
+ if (udf->scriptType > UDFD_MAX_SCRIPT_TYPE) {
+ fnError("udf name %s script type %d not supported", udfName, udf->scriptType);
+ return TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED;
+ }
+
+ uv_mutex_lock(&global.scriptPluginsMutex);
+ SUdfScriptPlugin *scriptPlugin = global.scriptPlugins[udf->scriptType];
+ if (scriptPlugin == NULL) {
+ err = udfdInitScriptPlugin(udf->scriptType);
+ if (err != 0) {
+ uv_mutex_unlock(&global.scriptPluginsMutex);
+ return err;
+ }
+ }
+ uv_mutex_unlock(&global.scriptPluginsMutex);
+ udf->scriptPlugin = global.scriptPlugins[udf->scriptType];
+
+ udfdRenameUdfFile(udf);
+
+ SScriptUdfInfo info = {0};
+ convertUdf2UdfInfo(udf, &info);
+ err = udf->scriptPlugin->udfInitFunc(&info, &udf->scriptUdfCtx);
+ if (err != 0) {
+ fnError("udf name %s init failed. error %d", udfName, err);
+ return err;
+ }
+
+ fnInfo("udf init succeeded. name %s type %d context %p", udf->name, udf->scriptType, (void*)udf->scriptUdfCtx);
+ return 0;
+}
+
+SUdf *udfdGetOrCreateUdf(const char *udfName) {
+ SUdf *udf = NULL;
uv_mutex_lock(&global.udfsMutex);
- SUdf **udfInHash = taosHashGet(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName));
+ SUdf **udfInHash = taosHashGet(global.udfsHash, udfName, strlen(udfName));
if (udfInHash) {
++(*udfInHash)->refCount;
udf = *udfInHash;
@@ -196,36 +571,51 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
} else {
SUdf *udfNew = taosMemoryCalloc(1, sizeof(SUdf));
udfNew->refCount = 1;
+ strncpy(udfNew->name, udfName, TSDB_FUNC_NAME_LEN);
+
udfNew->state = UDF_STATE_INIT;
uv_mutex_init(&udfNew->lock);
uv_cond_init(&udfNew->condReady);
udf = udfNew;
+ udf->resident = false;
+ for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) {
+ char *funcName = taosArrayGet(global.residentFuncs, i);
+ if (strcmp(udfName, funcName) == 0) {
+ udf->resident = true;
+ break;
+ }
+ }
SUdf **pUdf = &udf;
- taosHashPut(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName), pUdf, POINTER_BYTES);
+ taosHashPut(global.udfsHash, udfName, strlen(udfName), pUdf, POINTER_BYTES);
uv_mutex_unlock(&global.udfsMutex);
}
+ return udf;
+}
+
+void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
+ // TODO: tracable id from client. connect, setup, call, teardown
+ fnInfo("setup request. seq num: %" PRId64 ", udf name: %s", request->seqNum, request->setup.udfName);
+
+ SUdfSetupRequest *setup = &request->setup;
+ int32_t code = TSDB_CODE_SUCCESS;
+ SUdf *udf = NULL;
+
+ udf = udfdGetOrCreateUdf(setup->udfName);
uv_mutex_lock(&udf->lock);
if (udf->state == UDF_STATE_INIT) {
udf->state = UDF_STATE_LOADING;
- code = udfdLoadUdf(setup->udfName, udf);
- if (udf->initFunc) {
- udf->initFunc();
- }
- udf->resident = false;
- for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) {
- char *funcName = taosArrayGet(global.residentFuncs, i);
- if (strcmp(setup->udfName, funcName) == 0) {
- udf->resident = true;
- break;
- }
+ code = udfdInitUdf(setup->udfName, udf);
+ if (code == 0) {
+ udf->state = UDF_STATE_READY;
+ } else {
+ udf->state = UDF_STATE_INIT;
}
- udf->state = UDF_STATE_READY;
uv_cond_broadcast(&udf->condReady);
uv_mutex_unlock(&udf->lock);
} else {
- while (udf->state != UDF_STATE_READY) {
+ while (udf->state == UDF_STATE_LOADING) {
uv_cond_wait(&udf->condReady, &udf->lock);
}
uv_mutex_unlock(&udf->lock);
@@ -236,10 +626,10 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
SUdfResponse rsp;
rsp.seqNum = request->seqNum;
rsp.type = request->type;
- rsp.code = code;
+ rsp.code = (code != 0) ? TSDB_CODE_UDF_FUNC_EXEC_FAILURE : 0;
rsp.setupRsp.udfHandle = (int64_t)(handle);
rsp.setupRsp.outputType = udf->outputType;
- rsp.setupRsp.outputLen = udf->outputLen;
+ rsp.setupRsp.bytes = udf->outputLen;
rsp.setupRsp.bufSize = udf->bufSize;
int32_t len = encodeUdfResponse(NULL, &rsp);
@@ -268,10 +658,13 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
switch (call->callType) {
case TSDB_UDF_CALL_SCALA_PROC: {
SUdfColumn output = {0};
-
+ output.colMeta.bytes = udf->outputLen;
+ output.colMeta.type = udf->outputType;
+ output.colMeta.precision = 0;
+ output.colMeta.scale = 0;
SUdfDataBlock input = {0};
convertDataBlockToUdfDataBlock(&call->block, &input);
- code = udf->scalarProcFunc(&input, &output);
+ code = udf->scriptPlugin->udfScalarProcFunc(&input, &output, udf->scriptUdfCtx);
freeUdfDataDataBlock(&input);
convertUdfColumnToDataBlock(&output, &response.callRsp.resultData);
freeUdfColumn(&output);
@@ -279,7 +672,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
}
case TSDB_UDF_CALL_AGG_INIT: {
SUdfInterBuf outBuf = {.buf = taosMemoryMalloc(udf->bufSize), .bufLen = udf->bufSize, .numOfResult = 0};
- udf->aggStartFunc(&outBuf);
+ code = udf->scriptPlugin->udfAggStartFunc(&outBuf, udf->scriptUdfCtx);
subRsp->resultBuf = outBuf;
break;
}
@@ -287,7 +680,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
SUdfDataBlock input = {0};
convertDataBlockToUdfDataBlock(&call->block, &input);
SUdfInterBuf outBuf = {.buf = taosMemoryMalloc(udf->bufSize), .bufLen = udf->bufSize, .numOfResult = 0};
- code = udf->aggProcFunc(&input, &call->interBuf, &outBuf);
+ code = udf->scriptPlugin->udfAggProcFunc(&input, &call->interBuf, &outBuf, udf->scriptUdfCtx);
freeUdfInterBuf(&call->interBuf);
freeUdfDataDataBlock(&input);
subRsp->resultBuf = outBuf;
@@ -296,7 +689,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
}
case TSDB_UDF_CALL_AGG_MERGE: {
SUdfInterBuf outBuf = {.buf = taosMemoryMalloc(udf->bufSize), .bufLen = udf->bufSize, .numOfResult = 0};
- code = udf->aggMergeFunc(&call->interBuf, &call->interBuf2, &outBuf);
+ code = udf->scriptPlugin->udfAggMergeFunc(&call->interBuf, &call->interBuf2, &outBuf, udf->scriptUdfCtx);
freeUdfInterBuf(&call->interBuf);
freeUdfInterBuf(&call->interBuf2);
subRsp->resultBuf = outBuf;
@@ -305,7 +698,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
}
case TSDB_UDF_CALL_AGG_FIN: {
SUdfInterBuf outBuf = {.buf = taosMemoryMalloc(udf->bufSize), .bufLen = udf->bufSize, .numOfResult = 0};
- code = udf->aggFinishFunc(&call->interBuf, &outBuf);
+ code = udf->scriptPlugin->udfAggFinishFunc(&call->interBuf, &outBuf, udf->scriptUdfCtx);
freeUdfInterBuf(&call->interBuf);
subRsp->resultBuf = outBuf;
break;
@@ -316,7 +709,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
rsp->seqNum = request->seqNum;
rsp->type = request->type;
- rsp->code = code;
+ rsp->code = (code != 0) ? TSDB_CODE_UDF_FUNC_EXEC_FAILURE : 0;
subRsp->callType = call->callType;
int32_t len = encodeUdfResponse(NULL, rsp);
@@ -373,12 +766,11 @@ void udfdProcessTeardownRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
}
uv_mutex_unlock(&global.udfsMutex);
if (unloadUdf) {
+ fnInfo("udf teardown. udf name: %s type %d: context %p", udf->name, udf->scriptType, (void*)(udf->scriptUdfCtx));
uv_cond_destroy(&udf->condReady);
uv_mutex_destroy(&udf->lock);
- if (udf->destroyFunc) {
- (udf->destroyFunc)();
- }
- uv_dlclose(&udf->lib);
+ code = udf->scriptPlugin->udfDestroyFunc(udf->scriptUdfCtx);
+ fnDebug("udfd destroy function returns %d", code);
taosMemoryFree(udf);
}
taosMemoryFree(handle);
@@ -441,7 +833,8 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
goto _return;
}
SFuncInfo *pFuncInfo = (SFuncInfo *)taosArrayGet(retrieveRsp.pFuncInfos, 0);
- SUdf *udf = msgInfo->param;
+ // SUdf *udf = msgInfo->param;
+ SUdf *udf = msgInfo->param;
udf->funcType = pFuncInfo->funcType;
udf->scriptType = pFuncInfo->scriptType;
udf->outputType = pFuncInfo->outputType;
@@ -457,11 +850,10 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
char path[PATH_MAX] = {0};
#ifdef WINDOWS
- snprintf(path, sizeof(path), "%s%s.dll", tsTempDir, pFuncInfo->name);
+ snprintf(path, sizeof(path), "%s%s", tsTempDir, pFuncInfo->name);
#else
- snprintf(path, sizeof(path), "%s/lib%s.so", tsTempDir, pFuncInfo->name);
+ snprintf(path, sizeof(path), "%s/%s", tsTempDir, pFuncInfo->name);
#endif
-
TdFilePtr file = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_READ | TD_FILE_TRUNC);
if (file == NULL) {
fnError("udfd write udf shared library: %s failed, error: %d %s", path, errno, strerror(errno));
@@ -552,60 +944,6 @@ int32_t udfdConnectToMnode() {
return code;
}
-int32_t udfdLoadUdf(char *udfName, SUdf *udf) {
- strncpy(udf->name, udfName, TSDB_FUNC_NAME_LEN);
- int32_t err = 0;
-
- err = udfdFillUdfInfoFromMNode(global.clientRpc, udf->name, udf);
- if (err != 0) {
- fnError("can not retrieve udf from mnode. udf name %s", udfName);
- return TSDB_CODE_UDF_LOAD_UDF_FAILURE;
- }
-
- err = uv_dlopen(udf->path, &udf->lib);
- if (err != 0) {
- fnError("can not load library %s. error: %s", udf->path, uv_strerror(err));
- return TSDB_CODE_UDF_LOAD_UDF_FAILURE;
- }
-
- char initFuncName[TSDB_FUNC_NAME_LEN + 5] = {0};
- char *initSuffix = "_init";
- strcpy(initFuncName, udfName);
- strncat(initFuncName, initSuffix, strlen(initSuffix));
- uv_dlsym(&udf->lib, initFuncName, (void **)(&udf->initFunc));
-
- char destroyFuncName[TSDB_FUNC_NAME_LEN + 5] = {0};
- char *destroySuffix = "_destroy";
- strcpy(destroyFuncName, udfName);
- strncat(destroyFuncName, destroySuffix, strlen(destroySuffix));
- uv_dlsym(&udf->lib, destroyFuncName, (void **)(&udf->destroyFunc));
-
- if (udf->funcType == TSDB_FUNC_TYPE_SCALAR) {
- char processFuncName[TSDB_FUNC_NAME_LEN] = {0};
- strcpy(processFuncName, udfName);
- uv_dlsym(&udf->lib, processFuncName, (void **)(&udf->scalarProcFunc));
- } else if (udf->funcType == TSDB_FUNC_TYPE_AGGREGATE) {
- char processFuncName[TSDB_FUNC_NAME_LEN] = {0};
- strcpy(processFuncName, udfName);
- uv_dlsym(&udf->lib, processFuncName, (void **)(&udf->aggProcFunc));
- char startFuncName[TSDB_FUNC_NAME_LEN + 6] = {0};
- char *startSuffix = "_start";
- strncpy(startFuncName, processFuncName, sizeof(startFuncName));
- strncat(startFuncName, startSuffix, strlen(startSuffix));
- uv_dlsym(&udf->lib, startFuncName, (void **)(&udf->aggStartFunc));
- char finishFuncName[TSDB_FUNC_NAME_LEN + 7] = {0};
- char *finishSuffix = "_finish";
- strncpy(finishFuncName, processFuncName, sizeof(finishFuncName));
- strncat(finishFuncName, finishSuffix, strlen(finishSuffix));
- uv_dlsym(&udf->lib, finishFuncName, (void **)(&udf->aggFinishFunc));
- char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0};
- char *mergeSuffix = "_merge";
- strncpy(mergeFuncName, processFuncName, sizeof(mergeFuncName));
- strncat(mergeFuncName, mergeSuffix, strlen(mergeSuffix));
- uv_dlsym(&udf->lib, mergeFuncName, (void **)(&udf->aggMergeFunc));
- }
- return 0;
-}
static bool udfdRpcRfp(int32_t code, tmsg_t msgType) {
if (code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_SYN_NOT_LEADER ||
code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED || code == TSDB_CODE_SYN_RESTORING ||
@@ -967,6 +1305,8 @@ static void udfdCloseWalkCb(uv_handle_t *handle, void *arg) {
}
static int32_t udfdRun() {
+ uv_mutex_init(&global.scriptPluginsMutex);
+
global.udfsHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
uv_mutex_init(&global.udfsMutex);
@@ -1023,13 +1363,11 @@ int32_t udfdDeinitResidentFuncs() {
char *funcName = taosArrayGet(global.residentFuncs, i);
SUdf **udfInHash = taosHashGet(global.udfsHash, funcName, strlen(funcName));
if (udfInHash) {
- SUdf *udf = *udfInHash;
- if (udf->destroyFunc) {
- (udf->destroyFunc)();
- }
- uv_dlclose(&udf->lib);
- taosMemoryFree(udf);
+ SUdf *udf = *udfInHash;
+ int32_t code = udf->scriptPlugin->udfDestroyFunc(udf->scriptUdfCtx);
+ fnDebug("udfd destroy function returns %d", code);
taosHashRemove(global.udfsHash, funcName, strlen(funcName));
+ taosMemoryFree(udf);
}
}
taosArrayDestroy(global.residentFuncs);
@@ -1090,6 +1428,9 @@ int main(int argc, char *argv[]) {
udfdCloseClientRpc();
udfdDeinitResidentFuncs();
+
+ udfdDeinitScriptPlugins();
+
udfdCleanup();
return 0;
}
diff --git a/source/libs/function/test/udf1.c b/source/libs/function/test/udf1.c
index 71d30b67557847dcdf451cefb20c7b144d214cf8..7798a0bf3d957c03240a1f22914a54d0fdcf5b30 100644
--- a/source/libs/function/test/udf1.c
+++ b/source/libs/function/test/udf1.c
@@ -14,15 +14,8 @@ DLL_EXPORT int32_t udf1_init() { return 0; }
DLL_EXPORT int32_t udf1_destroy() { return 0; }
DLL_EXPORT int32_t udf1(SUdfDataBlock *block, SUdfColumn *resultCol) {
- SUdfColumnMeta *meta = &resultCol->colMeta;
- meta->bytes = 4;
- meta->type = TSDB_DATA_TYPE_INT;
- meta->scale = 0;
- meta->precision = 0;
-
SUdfColumnData *resultData = &resultCol->colData;
- resultData->numOfRows = block->numOfRows;
- for (int32_t i = 0; i < resultData->numOfRows; ++i) {
+ for (int32_t i = 0; i < block->numOfRows; ++i) {
int j = 0;
for (; j < block->numOfCols; ++j) {
if (udfColDataIsNull(block->udfCols[j], i)) {
@@ -42,5 +35,6 @@ DLL_EXPORT int32_t udf1(SUdfDataBlock *block, SUdfColumn *resultCol) {
#ifdef WINDOWS
Sleep(1);
#endif
+ resultData->numOfRows = block->numOfRows;
return 0;
-}
\ No newline at end of file
+}
diff --git a/source/libs/function/test/udf2.c b/source/libs/function/test/udf2.c
index e24789d0fb4095f2fdc75d8d1ce3e8dc1355e4c6..faf4daa4e53cacd70cbfd4ff319178c2cdbb8a56 100644
--- a/source/libs/function/test/udf2.c
+++ b/source/libs/function/test/udf2.c
@@ -12,12 +12,15 @@ DLL_EXPORT int32_t udf2_destroy() { return 0; }
DLL_EXPORT int32_t udf2_start(SUdfInterBuf* buf) {
*(int64_t*)(buf->buf) = 0;
buf->bufLen = sizeof(double);
- buf->numOfResult = 0;
+ buf->numOfResult = 1;
return 0;
}
DLL_EXPORT int32_t udf2(SUdfDataBlock* block, SUdfInterBuf* interBuf, SUdfInterBuf* newInterBuf) {
- double sumSquares = *(double*)interBuf->buf;
+ double sumSquares = 0;
+ if (interBuf->numOfResult == 1) {
+ sumSquares = *(double*)interBuf->buf;
+ }
int8_t numNotNull = 0;
for (int32_t i = 0; i < block->numOfCols; ++i) {
SUdfColumn* col = block->udfCols[i];
diff --git a/source/libs/monitor/src/monMain.c b/source/libs/monitor/src/monMain.c
index b23a36d4df3acaef40116b2fd66559a661e3f8c1..949e91198adcb69301fbc177b721289d6d736651 100644
--- a/source/libs/monitor/src/monMain.c
+++ b/source/libs/monitor/src/monMain.c
@@ -210,6 +210,8 @@ static void monGenClusterJson(SMonInfo *pMonitor) {
tjsonAddDoubleToObject(pJson, "vnodes_total", pInfo->vnodes_total);
tjsonAddDoubleToObject(pJson, "vnodes_alive", pInfo->vnodes_alive);
tjsonAddDoubleToObject(pJson, "connections_total", pInfo->connections_total);
+ tjsonAddDoubleToObject(pJson, "topics_total", pInfo->topics_toal);
+ tjsonAddDoubleToObject(pJson, "streams_total", pInfo->streams_total);
SJson *pDnodesJson = tjsonAddArrayToObject(pJson, "dnodes");
if (pDnodesJson == NULL) return;
diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c
index e18de1c1d2fd6215f81bd08178a81400dadb4932..0aeb83ce0812cf52bd3add4b2b0276fe051d00f3 100644
--- a/source/libs/nodes/src/nodesCodeFuncs.c
+++ b/source/libs/nodes/src/nodesCodeFuncs.c
@@ -173,6 +173,8 @@ const char* nodesNodeName(ENodeType type) {
return "DropStreamStmt";
case QUERY_NODE_BALANCE_VGROUP_STMT:
return "BalanceVgroupStmt";
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT:
+ return "BalanceVgroupLeaderStmt";
case QUERY_NODE_MERGE_VGROUP_STMT:
return "MergeVgroupStmt";
case QUERY_NODE_SHOW_DB_ALIVE_STMT:
@@ -6433,6 +6435,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
return dropStreamStmtToJson(pObj, pJson);
case QUERY_NODE_BALANCE_VGROUP_STMT:
return TSDB_CODE_SUCCESS; // SBalanceVgroupStmt has no fields to serialize.
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT:
+ return TSDB_CODE_SUCCESS; // SBalanceVgroupLeaderStmt has no fields to serialize.
case QUERY_NODE_MERGE_VGROUP_STMT:
return mergeVgroupStmtToJson(pObj, pJson);
case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT:
@@ -6741,6 +6745,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
return jsonToDropStreamStmt(pJson, pObj);
case QUERY_NODE_BALANCE_VGROUP_STMT:
return TSDB_CODE_SUCCESS; // SBalanceVgroupStmt has no fields to deserialize.
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT:
+ return TSDB_CODE_SUCCESS; // SBalanceVgroupLeaderStmt has no fields to deserialize.
case QUERY_NODE_MERGE_VGROUP_STMT:
return jsonToMergeVgroupStmt(pJson, pObj);
case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT:
diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c
index 8d6c3288b907e0ee8678f1d6970410bec351b758..4180ba1d6c6879a5589f532784f711a28e740d3d 100644
--- a/source/libs/nodes/src/nodesUtilFuncs.c
+++ b/source/libs/nodes/src/nodesUtilFuncs.c
@@ -386,6 +386,8 @@ SNode* nodesMakeNode(ENodeType type) {
return makeNode(type, sizeof(SDropStreamStmt));
case QUERY_NODE_BALANCE_VGROUP_STMT:
return makeNode(type, sizeof(SBalanceVgroupStmt));
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT:
+ return makeNode(type, sizeof(SBalanceVgroupLeaderStmt));
case QUERY_NODE_MERGE_VGROUP_STMT:
return makeNode(type, sizeof(SMergeVgroupStmt));
case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT:
@@ -923,9 +925,14 @@ void nodesDestroyNode(SNode* pNode) {
taosMemoryFree(((SDescribeStmt*)pNode)->pMeta);
break;
case QUERY_NODE_RESET_QUERY_CACHE_STMT: // no pointer field
- case QUERY_NODE_COMPACT_DATABASE_STMT: // no pointer field
- case QUERY_NODE_CREATE_FUNCTION_STMT: // no pointer field
- case QUERY_NODE_DROP_FUNCTION_STMT: // no pointer field
+ case QUERY_NODE_COMPACT_DATABASE_STMT: {
+ SCompactDatabaseStmt* pStmt = (SCompactDatabaseStmt*)pNode;
+ nodesDestroyNode(pStmt->pStart);
+ nodesDestroyNode(pStmt->pEnd);
+ break;
+ }
+ case QUERY_NODE_CREATE_FUNCTION_STMT: // no pointer field
+ case QUERY_NODE_DROP_FUNCTION_STMT: // no pointer field
break;
case QUERY_NODE_CREATE_STREAM_STMT: {
SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pNode;
@@ -937,6 +944,7 @@ void nodesDestroyNode(SNode* pNode) {
}
case QUERY_NODE_DROP_STREAM_STMT: // no pointer field
case QUERY_NODE_BALANCE_VGROUP_STMT: // no pointer field
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT: // no pointer field
case QUERY_NODE_MERGE_VGROUP_STMT: // no pointer field
break;
case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT:
diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h
index 695d9f3006d72eb4354d793afbe0ab14b07f70cd..69043e8915b3526548cf7976b4faea0ee3e8b986 100644
--- a/source/libs/parser/inc/parAst.h
+++ b/source/libs/parser/inc/parAst.h
@@ -212,7 +212,8 @@ SNode* createExplainStmt(SAstCreateContext* pCxt, bool analyze, SNode* pOptions,
SNode* createDescribeStmt(SAstCreateContext* pCxt, SNode* pRealTable);
SNode* createResetQueryCacheStmt(SAstCreateContext* pCxt);
SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool aggFunc, const SToken* pFuncName,
- const SToken* pLibPath, SDataType dataType, int32_t bufSize);
+ const SToken* pLibPath, SDataType dataType, int32_t bufSize, const SToken* pLanguage,
+ bool orReplace);
SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName);
SNode* createStreamOptions(SAstCreateContext* pCxt);
SNode* setStreamOptions(SAstCreateContext* pCxt, SNode* pOptions, EStreamOptionsSetFlag setflag, SToken* pToken,
@@ -223,6 +224,7 @@ SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToke
SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId);
SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId);
SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt);
+SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt);
SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2);
SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId, SNodeList* pDnodes);
SNode* createSplitVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId);
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index 9fd8d5415ad5fdea65a50155f79352374a2d6045..ebd8f51f900ad6b244cd9c66894f91ff20c7d266 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -237,6 +237,18 @@ alter_db_option(A) ::= REPLICA NK_INTEGER(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; }
alter_db_option(A) ::= MINROWS NK_INTEGER(B). { A.type = DB_OPTION_MINROWS; A.val = B; }
+alter_db_option(A) ::= WAL_RETENTION_PERIOD NK_INTEGER(B). { A.type = DB_OPTION_WAL_RETENTION_PERIOD; A.val = B; }
+alter_db_option(A) ::= WAL_RETENTION_PERIOD NK_MINUS(B) NK_INTEGER(C). {
+ SToken t = B;
+ t.n = (C.z + C.n) - B.z;
+ A.type = DB_OPTION_WAL_RETENTION_PERIOD; A.val = t;
+ }
+alter_db_option(A) ::= WAL_RETENTION_SIZE NK_INTEGER(B). { A.type = DB_OPTION_WAL_RETENTION_SIZE; A.val = B; }
+alter_db_option(A) ::= WAL_RETENTION_SIZE NK_MINUS(B) NK_INTEGER(C). {
+ SToken t = B;
+ t.n = (C.z + C.n) - B.z;
+ A.type = DB_OPTION_WAL_RETENTION_SIZE; A.val = t;
+ }
%type integer_list { SNodeList* }
%destructor integer_list { nodesDestroyList($$); }
@@ -541,8 +553,9 @@ explain_options(A) ::= explain_options(B) VERBOSE NK_BOOL(C).
explain_options(A) ::= explain_options(B) RATIO NK_FLOAT(C). { A = setExplainRatio(pCxt, B, &C); }
/************************************************ create/drop function ************************************************/
-cmd ::= CREATE agg_func_opt(A) FUNCTION not_exists_opt(F) function_name(B)
- AS NK_STRING(C) OUTPUTTYPE type_name(D) bufsize_opt(E). { pCxt->pRootNode = createCreateFunctionStmt(pCxt, F, A, &B, &C, D, E); }
+cmd ::= CREATE or_replace_opt(H) agg_func_opt(A) FUNCTION not_exists_opt(F)
+ function_name(B) AS NK_STRING(C) OUTPUTTYPE type_name(D) bufsize_opt(E)
+ language_opt(G). { pCxt->pRootNode = createCreateFunctionStmt(pCxt, F, A, &B, &C, D, E, &G, H); }
cmd ::= DROP FUNCTION exists_opt(B) function_name(A). { pCxt->pRootNode = createDropFunctionStmt(pCxt, B, &A); }
%type agg_func_opt { bool }
@@ -555,6 +568,16 @@ agg_func_opt(A) ::= AGGREGATE.
bufsize_opt(A) ::= . { A = 0; }
bufsize_opt(A) ::= BUFSIZE NK_INTEGER(B). { A = taosStr2Int32(B.z, NULL, 10); }
+%type language_opt { SToken }
+%destructor language_opt { }
+language_opt(A) ::= . { A = nil_token; }
+language_opt(A) ::= LANGUAGE NK_STRING(B). { A = B; }
+
+%type or_replace_opt { bool }
+%destructor or_replace_opt { }
+or_replace_opt(A) ::= . { A = false; }
+or_replace_opt(A) ::= OR REPLACE. { A = true; }
+
/************************************************ create/drop stream **************************************************/
cmd ::= CREATE STREAM not_exists_opt(E) stream_name(A) stream_options(B) INTO
full_table_name(C) col_list_opt(H) tag_def_or_ref_opt(F) subtable_opt(G)
@@ -592,6 +615,7 @@ cmd ::= KILL TRANSACTION NK_INTEGER(A).
/************************************************ merge/redistribute/ vgroup ******************************************/
cmd ::= BALANCE VGROUP. { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
+cmd ::= BALANCE VGROUP LEADER. { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); }
cmd ::= MERGE VGROUP NK_INTEGER(A) NK_INTEGER(B). { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &A, &B); }
cmd ::= REDISTRIBUTE VGROUP NK_INTEGER(A) dnode_list(B). { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &A, B); }
cmd ::= SPLIT VGROUP NK_INTEGER(A). { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &A); }
@@ -1118,5 +1142,5 @@ null_ordering_opt(A) ::= NULLS FIRST.
null_ordering_opt(A) ::= NULLS LAST. { A = NULL_ORDER_LAST; }
%fallback ABORT AFTER ATTACH BEFORE BEGIN BITAND BITNOT BITOR BLOCKS CHANGE COMMA CONCAT CONFLICT COPY DEFERRED DELIMITERS DETACH DIVIDE DOT EACH END FAIL
- FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT
+ FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE RESTRICT ROW SEMI STAR STATEMENT
STRICT STRING TIMES VALUES VARIABLE VIEW WAL.
diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c
index e1855256b2f6d723b830677d97ccd6dbe9822895..2ec942d890f5c865f8a0cda0f8077fdb954c78f8 100644
--- a/source/libs/parser/src/parAstCreater.c
+++ b/source/libs/parser/src/parAstCreater.c
@@ -925,8 +925,8 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) {
pOptions->numOfVgroups = -1;
pOptions->singleStable = -1;
pOptions->schemaless = -1;
- pOptions->walRetentionPeriod = -1;
- pOptions->walRetentionSize = -1;
+ pOptions->walRetentionPeriod = -2; // -1 is a valid value
+ pOptions->walRetentionSize = -2; // -1 is a valid value
pOptions->walRollPeriod = -1;
pOptions->walSegmentSize = -1;
pOptions->sstTrigger = -1;
@@ -935,7 +935,8 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) {
return (SNode*)pOptions;
}
-SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, void* pVal) {
+static SNode* setDatabaseOptionImpl(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, void* pVal,
+ bool alter) {
CHECK_PARSER_STATUS(pCxt);
SDatabaseOptions* pDbOptions = (SDatabaseOptions*)pOptions;
switch (type) {
@@ -986,7 +987,9 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
break;
case DB_OPTION_REPLICA:
pDbOptions->replica = taosStr2Int8(((SToken*)pVal)->z, NULL, 10);
- updateWalOptionsDefault(pDbOptions);
+ if (!alter) {
+ updateWalOptionsDefault(pDbOptions);
+ }
break;
case DB_OPTION_STRICT:
COPY_STRING_FORM_STR_TOKEN(pDbOptions->strictStr, (SToken*)pVal);
@@ -1033,16 +1036,20 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti
return pOptions;
}
+SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, void* pVal) {
+ return setDatabaseOptionImpl(pCxt, pOptions, type, pVal, false);
+}
+
SNode* setAlterDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, SAlterOption* pAlterOption) {
CHECK_PARSER_STATUS(pCxt);
switch (pAlterOption->type) {
case DB_OPTION_KEEP:
case DB_OPTION_RETENTIONS:
- return setDatabaseOption(pCxt, pOptions, pAlterOption->type, pAlterOption->pList);
+ return setDatabaseOptionImpl(pCxt, pOptions, pAlterOption->type, pAlterOption->pList, true);
default:
break;
}
- return setDatabaseOption(pCxt, pOptions, pAlterOption->type, &pAlterOption->val);
+ return setDatabaseOptionImpl(pCxt, pOptions, pAlterOption->type, &pAlterOption->val, true);
}
SNode* createCreateDatabaseStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pDbName, SNode* pOptions) {
@@ -1781,21 +1788,40 @@ SNode* createResetQueryCacheStmt(SAstCreateContext* pCxt) {
return pStmt;
}
+static int32_t convertUdfLanguageType(SAstCreateContext* pCxt, const SToken* pLanguageToken, int8_t* pLanguage) {
+ if (TK_NK_NIL == pLanguageToken->type || 0 == strncasecmp(pLanguageToken->z + 1, "c", pLanguageToken->n - 2)) {
+ *pLanguage = TSDB_FUNC_SCRIPT_BIN_LIB;
+ } else if (0 == strncasecmp(pLanguageToken->z + 1, "python", pLanguageToken->n - 2)) {
+ *pLanguage = TSDB_FUNC_SCRIPT_PYTHON;
+ } else {
+ pCxt->errCode = generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR,
+ "udf programming language supports c and python");
+ }
+ return pCxt->errCode;
+}
+
SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool aggFunc, const SToken* pFuncName,
- const SToken* pLibPath, SDataType dataType, int32_t bufSize) {
+ const SToken* pLibPath, SDataType dataType, int32_t bufSize, const SToken* pLanguage,
+ bool orReplace) {
CHECK_PARSER_STATUS(pCxt);
if (pLibPath->n <= 2) {
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
return NULL;
}
+ int8_t language = 0;
+ if (TSDB_CODE_SUCCESS != convertUdfLanguageType(pCxt, pLanguage, &language)) {
+ return NULL;
+ }
SCreateFunctionStmt* pStmt = (SCreateFunctionStmt*)nodesMakeNode(QUERY_NODE_CREATE_FUNCTION_STMT);
CHECK_OUT_OF_MEM(pStmt);
+ pStmt->orReplace = orReplace;
pStmt->ignoreExists = ignoreExists;
COPY_STRING_FORM_ID_TOKEN(pStmt->funcName, pFuncName);
pStmt->isAgg = aggFunc;
COPY_STRING_FORM_STR_TOKEN(pStmt->libraryPath, pLibPath);
pStmt->outputDt = dataType;
pStmt->bufSize = bufSize;
+ pStmt->language = language;
return (SNode*)pStmt;
}
@@ -1928,6 +1954,13 @@ SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt) {
return (SNode*)pStmt;
}
+SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt) {
+ CHECK_PARSER_STATUS(pCxt);
+ SBalanceVgroupLeaderStmt* pStmt = (SBalanceVgroupLeaderStmt*)nodesMakeNode(QUERY_NODE_BALANCE_VGROUP_LEADER_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ return (SNode*)pStmt;
+}
+
SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2) {
CHECK_PARSER_STATUS(pCxt);
SMergeVgroupStmt* pStmt = (SMergeVgroupStmt*)nodesMakeNode(QUERY_NODE_MERGE_VGROUP_STMT);
diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c
index 3fbe23592a8ed2344b4df8898cec9f80c5dc906d..18d65dd47711e445633a4b2969decfab5f5dd07e 100644
--- a/source/libs/parser/src/parInsertSql.c
+++ b/source/libs/parser/src/parInsertSql.c
@@ -1492,6 +1492,7 @@ static void resetEnvPreTable(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStm
pStmt->pBoundCols = NULL;
pStmt->usingTableProcessing = false;
pStmt->fileProcessing = false;
+ pStmt->usingTableName.type = 0;
}
// input pStmt->pSql: [(field1_name, ...)] [ USING ... ] VALUES ... | FILE ...
@@ -1539,6 +1540,10 @@ static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModif
}
}
+ if (TK_NK_ID != pTbName->type && TK_NK_STRING != pTbName->type && TK_NK_QUESTION != pTbName->type) {
+ return buildSyntaxErrMsg(&pCxt->msg, "table_name is expected", pTbName->z);
+ }
+
*pHasData = true;
return TSDB_CODE_SUCCESS;
}
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 678dcf34d3a9a1d08bfa8c51e25abe3cd2161daf..312584994fe593085a83dca11e763b9ef4d4410b 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -124,8 +124,10 @@ static SKeyword keywordTable[] = {
{"JSON", TK_JSON},
{"KEEP", TK_KEEP},
{"KILL", TK_KILL},
+ {"LANGUAGE", TK_LANGUAGE},
{"LAST", TK_LAST},
{"LAST_ROW", TK_LAST_ROW},
+ {"LEADER", TK_LEADER},
{"LICENCES", TK_LICENCES},
{"LIKE", TK_LIKE},
{"LIMIT", TK_LIMIT},
@@ -176,6 +178,7 @@ static SKeyword keywordTable[] = {
{"READ", TK_READ},
{"REDISTRIBUTE", TK_REDISTRIBUTE},
{"RENAME", TK_RENAME},
+ {"REPLACE", TK_REPLACE},
{"REPLICA", TK_REPLICA},
{"RESET", TK_RESET},
{"RETENTIONS", TK_RETENTIONS},
@@ -236,7 +239,7 @@ static SKeyword keywordTable[] = {
{"TTL", TK_TTL},
{"UNION", TK_UNION},
{"UNSIGNED", TK_UNSIGNED},
- {"UPDATE", TK_UPDATE},
+ {"UPDATE", TK_UPDATE},
{"USE", TK_USE},
{"USER", TK_USER},
{"USERS", TK_USERS},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index 4541002960fcecdea49f33ebf7558aa16e3c9381..78fc097f6f5024e8a1932217ba2440cb342ec3e7 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -4304,6 +4304,8 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
pReq->replications = pStmt->pOptions->replica;
pReq->sstTrigger = pStmt->pOptions->sstTrigger;
pReq->minRows = pStmt->pOptions->minRowsPerBlock;
+ pReq->walRetentionPeriod = pStmt->pOptions->walRetentionPeriod;
+ pReq->walRetentionSize = pStmt->pOptions->walRetentionSize;
return;
}
@@ -6447,12 +6449,25 @@ static int32_t translateCreateFunction(STranslateContext* pCxt, SCreateFunctionS
if (fmIsBuiltinFunc(pStmt->funcName)) {
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_FUNCTION_NAME);
}
+
+ if (TSDB_DATA_TYPE_JSON == pStmt->outputDt.type || TSDB_DATA_TYPE_VARBINARY == pStmt->outputDt.type ||
+ TSDB_DATA_TYPE_DECIMAL == pStmt->outputDt.type || TSDB_DATA_TYPE_BLOB == pStmt->outputDt.type ||
+ TSDB_DATA_TYPE_MEDIUMBLOB == pStmt->outputDt.type) {
+ return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "Unsupported output type for UDF");
+ }
+
+ if (!pStmt->isAgg && pStmt->bufSize > 0) {
+ return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "BUFSIZE can only be used with UDAF");
+ }
+
SCreateFuncReq req = {0};
strcpy(req.name, pStmt->funcName);
+ req.orReplace = pStmt->orReplace;
req.igExists = pStmt->ignoreExists;
req.funcType = pStmt->isAgg ? TSDB_FUNC_TYPE_AGGREGATE : TSDB_FUNC_TYPE_SCALAR;
- req.scriptType = TSDB_FUNC_SCRIPT_BIN_LIB;
+ req.scriptType = pStmt->language;
req.outputType = pStmt->outputDt.type;
+ pStmt->outputDt.bytes = calcTypeBytes(pStmt->outputDt);
req.outputLen = pStmt->outputDt.bytes;
req.bufSize = pStmt->bufSize;
int32_t code = readFromFile(pStmt->libraryPath, &req.codeLen, &req.pCode);
@@ -6511,6 +6526,11 @@ static int32_t translateBalanceVgroup(STranslateContext* pCxt, SBalanceVgroupStm
return buildCmdMsg(pCxt, TDMT_MND_BALANCE_VGROUP, (FSerializeFunc)tSerializeSBalanceVgroupReq, &req);
}
+static int32_t translateBalanceVgroupLeader(STranslateContext* pCxt, SBalanceVgroupLeaderStmt* pStmt) {
+ SBalanceVgroupLeaderReq req = {0};
+ return buildCmdMsg(pCxt, TDMT_MND_BALANCE_VGROUP_LEADER, (FSerializeFunc)tSerializeSBalanceVgroupLeaderReq, &req);
+}
+
static int32_t translateMergeVgroup(STranslateContext* pCxt, SMergeVgroupStmt* pStmt) {
SMergeVgroupReq req = {.vgId1 = pStmt->vgId1, .vgId2 = pStmt->vgId2};
return buildCmdMsg(pCxt, TDMT_MND_MERGE_VGROUP, (FSerializeFunc)tSerializeSMergeVgroupReq, &req);
@@ -6722,6 +6742,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_BALANCE_VGROUP_STMT:
code = translateBalanceVgroup(pCxt, (SBalanceVgroupStmt*)pNode);
break;
+ case QUERY_NODE_BALANCE_VGROUP_LEADER_STMT:
+ code = translateBalanceVgroupLeader(pCxt, (SBalanceVgroupLeaderStmt*)pNode);
+ break;
case QUERY_NODE_MERGE_VGROUP_STMT:
code = translateMergeVgroup(pCxt, (SMergeVgroupStmt*)pNode);
break;
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index 291d35ebe3abadfdcbee46cbcdaf1bc04f33fcbb..b1437bbb6bba7de0aadaa3b0a4c8950865fa731d 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 471
+#define YYNOCODE 475
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- SNode* yy140;
- EFillMode yy174;
- int32_t yy214;
- SNodeList* yy220;
- int64_t yy303;
- bool yy587;
- SDataType yy682;
- ENullOrder yy697;
- EOperatorType yy794;
- SAlterOption yy809;
- EJoinType yy852;
- int8_t yy857;
- EOrder yy866;
- SToken yy881;
+ EOrder yy88;
+ EFillMode yy94;
+ SToken yy129;
+ SDataType yy184;
+ SNodeList* yy274;
+ int32_t yy310;
+ bool yy337;
+ int8_t yy353;
+ int64_t yy359;
+ EOperatorType yy440;
+ SAlterOption yy595;
+ SNode* yy712;
+ ENullOrder yy907;
+ EJoinType yy912;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -139,17 +139,17 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
-#define YYNSTATE 752
-#define YYNRULE 572
-#define YYNTOKEN 328
-#define YY_MAX_SHIFT 751
-#define YY_MIN_SHIFTREDUCE 1118
-#define YY_MAX_SHIFTREDUCE 1689
-#define YY_ERROR_ACTION 1690
-#define YY_ACCEPT_ACTION 1691
-#define YY_NO_ACTION 1692
-#define YY_MIN_REDUCE 1693
-#define YY_MAX_REDUCE 2264
+#define YYNSTATE 761
+#define YYNRULE 581
+#define YYNTOKEN 330
+#define YY_MAX_SHIFT 760
+#define YY_MIN_SHIFTREDUCE 1133
+#define YY_MAX_SHIFTREDUCE 1713
+#define YY_ERROR_ACTION 1714
+#define YY_ACCEPT_ACTION 1715
+#define YY_NO_ACTION 1716
+#define YY_MIN_REDUCE 1717
+#define YY_MAX_REDUCE 2297
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -216,739 +216,827 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (2669)
+#define YY_ACTTAB_COUNT (3096)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 1975, 1845, 387, 2076, 429, 604, 627, 2062, 141, 2235,
- /* 10 */ 161, 2135, 45, 43, 1617, 1973, 628, 363, 2058, 1858,
- /* 20 */ 384, 2062, 1466, 616, 603, 182, 1907, 2062, 496, 2236,
- /* 30 */ 605, 2030, 2058, 1547, 492, 1464, 2094, 640, 2058, 44,
- /* 40 */ 42, 41, 40, 39, 619, 1170, 332, 1169, 640, 2044,
- /* 50 */ 1491, 657, 2054, 2060, 365, 506, 139, 1968, 1542, 1909,
- /* 60 */ 222, 2240, 1909, 651, 18, 2235, 2054, 2060, 366, 349,
- /* 70 */ 1691, 1472, 2054, 2060, 379, 1908, 1171, 651, 1907, 404,
- /* 80 */ 2075, 2239, 176, 651, 2111, 2236, 2238, 109, 2077, 661,
- /* 90 */ 2079, 2080, 656, 1151, 651, 166, 167, 748, 1705, 179,
- /* 100 */ 14, 2164, 1801, 351, 1958, 378, 2160, 1491, 38, 37,
- /* 110 */ 45, 43, 44, 42, 41, 40, 39, 48, 384, 184,
- /* 120 */ 1466, 269, 2172, 615, 176, 133, 614, 2190, 48, 2235,
- /* 130 */ 61, 1547, 1153, 1464, 1156, 1157, 1549, 1550, 397, 604,
- /* 140 */ 622, 31, 396, 2235, 603, 182, 1959, 38, 37, 2236,
- /* 150 */ 605, 44, 42, 41, 40, 39, 1542, 389, 603, 182,
- /* 160 */ 1902, 1904, 18, 2236, 605, 1492, 1522, 1532, 1716, 1472,
- /* 170 */ 1759, 122, 1548, 1551, 121, 120, 119, 118, 117, 116,
- /* 180 */ 115, 114, 113, 579, 1975, 579, 1467, 2235, 1465, 2235,
- /* 190 */ 490, 1493, 491, 1729, 65, 748, 375, 1239, 14, 1972,
- /* 200 */ 628, 105, 2241, 182, 2241, 182, 640, 2236, 605, 2236,
- /* 210 */ 605, 102, 1470, 1471, 2044, 1521, 1524, 1525, 1526, 1527,
- /* 220 */ 1528, 1529, 1530, 1531, 653, 649, 1540, 1541, 1543, 1544,
- /* 230 */ 1545, 1546, 2, 1241, 1549, 1550, 725, 724, 723, 722,
- /* 240 */ 394, 626, 721, 720, 143, 715, 714, 713, 712, 711,
- /* 250 */ 710, 709, 156, 705, 704, 703, 393, 392, 700, 699,
- /* 260 */ 698, 697, 696, 2240, 1522, 1532, 1715, 2235, 38, 37,
- /* 270 */ 1548, 1551, 44, 42, 41, 40, 39, 185, 1686, 185,
- /* 280 */ 1494, 1330, 1331, 2239, 1467, 693, 1465, 2236, 2237, 508,
- /* 290 */ 61, 1847, 489, 38, 37, 494, 1735, 44, 42, 41,
- /* 300 */ 40, 39, 2058, 154, 153, 690, 689, 688, 151, 599,
- /* 310 */ 1470, 1471, 2044, 1521, 1524, 1525, 1526, 1527, 1528, 1529,
- /* 320 */ 1530, 1531, 653, 649, 1540, 1541, 1543, 1544, 1545, 1546,
- /* 330 */ 2, 11, 45, 43, 1762, 1491, 2054, 2060, 1909, 271,
- /* 340 */ 384, 1296, 1466, 1492, 695, 362, 1170, 651, 1169, 344,
- /* 350 */ 594, 106, 194, 1547, 1907, 1464, 100, 1287, 683, 682,
- /* 360 */ 681, 1291, 680, 1293, 1294, 679, 676, 140, 1302, 673,
- /* 370 */ 1304, 1305, 670, 667, 1685, 1848, 33, 1171, 1542, 1833,
- /* 380 */ 1849, 2076, 38, 37, 18, 568, 44, 42, 41, 40,
- /* 390 */ 39, 1472, 1490, 83, 1576, 1645, 82, 545, 544, 543,
- /* 400 */ 545, 544, 543, 1714, 535, 136, 539, 535, 136, 539,
- /* 410 */ 538, 35, 290, 538, 2094, 537, 542, 748, 537, 542,
- /* 420 */ 14, 536, 658, 499, 536, 491, 1729, 2044, 249, 657,
- /* 430 */ 45, 43, 1552, 600, 595, 588, 86, 2179, 384, 185,
- /* 440 */ 1466, 1250, 591, 590, 1643, 1644, 1646, 1647, 1648, 2044,
- /* 450 */ 1577, 1547, 353, 1464, 1249, 641, 1549, 1550, 2075, 1402,
- /* 460 */ 1403, 1851, 2111, 2176, 533, 109, 2077, 661, 2079, 2080,
- /* 470 */ 656, 187, 651, 1694, 641, 142, 1542, 149, 2135, 2164,
- /* 480 */ 61, 1385, 1386, 378, 2160, 532, 1522, 1532, 1856, 1472,
- /* 490 */ 54, 693, 1548, 1551, 122, 1401, 1404, 121, 120, 119,
- /* 500 */ 118, 117, 116, 115, 114, 113, 1467, 1856, 1465, 154,
- /* 510 */ 153, 690, 689, 688, 151, 748, 476, 239, 46, 467,
- /* 520 */ 49, 34, 382, 1571, 1572, 1573, 1574, 1575, 1579, 1580,
- /* 530 */ 1581, 1582, 1470, 1471, 1693, 1521, 1524, 1525, 1526, 1527,
- /* 540 */ 1528, 1529, 1530, 1531, 653, 649, 1540, 1541, 1543, 1544,
- /* 550 */ 1545, 1546, 2, 423, 1549, 1550, 1472, 422, 131, 130,
- /* 560 */ 129, 128, 127, 126, 125, 124, 123, 272, 498, 38,
- /* 570 */ 37, 494, 1735, 44, 42, 41, 40, 39, 164, 2076,
- /* 580 */ 198, 197, 1440, 1441, 1522, 1532, 616, 1859, 38, 37,
- /* 590 */ 1548, 1551, 44, 42, 41, 40, 39, 2240, 579, 686,
- /* 600 */ 1909, 86, 2235, 466, 1467, 2094, 1465, 372, 643, 61,
- /* 610 */ 2136, 92, 2094, 598, 1493, 178, 1907, 2241, 182, 139,
- /* 620 */ 619, 1831, 2236, 605, 27, 2044, 1852, 657, 1896, 185,
- /* 630 */ 1470, 1471, 416, 1521, 1524, 1525, 1526, 1527, 1528, 1529,
- /* 640 */ 1530, 1531, 653, 649, 1540, 1541, 1543, 1544, 1545, 1546,
- /* 650 */ 2, 45, 43, 2037, 418, 414, 2075, 641, 597, 384,
- /* 660 */ 2111, 1466, 1656, 109, 2077, 661, 2079, 2080, 656, 185,
- /* 670 */ 651, 641, 1547, 132, 1464, 179, 641, 2164, 1903, 1904,
- /* 680 */ 529, 378, 2160, 618, 180, 2172, 2173, 132, 137, 2177,
- /* 690 */ 1856, 550, 427, 2179, 534, 1679, 2076, 1542, 579, 73,
- /* 700 */ 1713, 616, 2235, 2191, 1856, 641, 560, 38, 37, 1856,
- /* 710 */ 1472, 44, 42, 41, 40, 39, 627, 2241, 182, 2175,
- /* 720 */ 236, 428, 2236, 605, 41, 40, 39, 641, 238, 2094,
- /* 730 */ 616, 641, 237, 693, 139, 553, 748, 658, 1856, 46,
- /* 740 */ 547, 11, 2044, 437, 657, 235, 2044, 452, 81, 45,
- /* 750 */ 43, 154, 153, 690, 689, 688, 151, 384, 185, 1466,
- /* 760 */ 1856, 376, 271, 139, 1856, 625, 627, 1968, 2063, 164,
- /* 770 */ 1547, 2038, 1464, 2075, 707, 1549, 1550, 2111, 1858, 2058,
- /* 780 */ 168, 2077, 661, 2079, 2080, 656, 69, 651, 1841, 68,
- /* 790 */ 89, 339, 1712, 641, 361, 1542, 561, 1711, 2076, 181,
- /* 800 */ 2172, 2173, 387, 137, 2177, 1522, 1532, 1954, 1472, 453,
- /* 810 */ 164, 1548, 1551, 2054, 2060, 636, 579, 1968, 190, 1858,
- /* 820 */ 2235, 580, 2201, 1939, 651, 1467, 1856, 1465, 183, 2172,
- /* 830 */ 2173, 2094, 137, 2177, 748, 2241, 182, 14, 2044, 658,
- /* 840 */ 2236, 605, 1621, 2044, 2044, 1710, 657, 1557, 1491, 1709,
- /* 850 */ 2179, 1470, 1471, 1491, 1521, 1524, 1525, 1526, 1527, 1528,
- /* 860 */ 1529, 1530, 1531, 653, 649, 1540, 1541, 1543, 1544, 1545,
- /* 870 */ 1546, 2, 1843, 1549, 1550, 2075, 2174, 559, 1708, 2111,
- /* 880 */ 1839, 641, 109, 2077, 661, 2079, 2080, 656, 165, 651,
- /* 890 */ 557, 2044, 555, 310, 2139, 2044, 2164, 507, 685, 1909,
- /* 900 */ 378, 2160, 1707, 1522, 1532, 1704, 377, 308, 72, 1548,
- /* 910 */ 1551, 71, 38, 37, 1856, 1907, 44, 42, 41, 40,
- /* 920 */ 39, 281, 282, 1467, 2044, 1465, 280, 356, 390, 205,
- /* 930 */ 486, 484, 481, 8, 38, 37, 164, 2239, 44, 42,
- /* 940 */ 41, 40, 39, 1703, 2076, 1858, 541, 540, 2044, 1470,
- /* 950 */ 1471, 2044, 1521, 1524, 1525, 1526, 1527, 1528, 1529, 1530,
- /* 960 */ 1531, 653, 649, 1540, 1541, 1543, 1544, 1545, 1546, 2,
- /* 970 */ 61, 335, 1909, 1489, 2076, 719, 717, 2094, 447, 388,
- /* 980 */ 460, 641, 1614, 474, 641, 658, 473, 446, 1907, 2044,
- /* 990 */ 2044, 1254, 657, 357, 1523, 355, 354, 1853, 531, 1523,
- /* 1000 */ 241, 443, 533, 475, 1253, 1633, 445, 2094, 108, 244,
- /* 1010 */ 641, 641, 373, 1832, 1856, 658, 11, 1856, 9, 1491,
- /* 1020 */ 2044, 2075, 657, 532, 652, 2111, 575, 620, 109, 2077,
- /* 1030 */ 661, 2079, 2080, 656, 708, 651, 1818, 1702, 1701, 61,
- /* 1040 */ 2255, 1494, 2164, 1856, 1856, 1700, 378, 2160, 80, 79,
- /* 1050 */ 426, 2075, 352, 189, 641, 2111, 1494, 2198, 327, 2077,
- /* 1060 */ 661, 2079, 2080, 656, 433, 651, 478, 13, 12, 1466,
- /* 1070 */ 624, 1699, 333, 1749, 1578, 412, 695, 410, 406, 402,
- /* 1080 */ 399, 419, 1464, 2044, 2044, 1698, 1697, 1856, 1696, 2076,
- /* 1090 */ 645, 2044, 2136, 471, 163, 546, 465, 464, 463, 462,
- /* 1100 */ 459, 458, 457, 456, 455, 451, 450, 449, 448, 334,
- /* 1110 */ 440, 439, 438, 641, 435, 434, 350, 2044, 1472, 185,
- /* 1120 */ 641, 608, 2094, 641, 421, 641, 420, 641, 574, 285,
- /* 1130 */ 658, 2044, 2044, 152, 2044, 2044, 638, 657, 2076, 639,
- /* 1140 */ 1954, 291, 1610, 391, 748, 32, 1856, 2012, 1954, 304,
- /* 1150 */ 419, 192, 1886, 1856, 687, 1583, 1856, 1900, 1856, 196,
- /* 1160 */ 1856, 1156, 1157, 2184, 1610, 1523, 2075, 1590, 1834, 691,
- /* 1170 */ 2111, 2094, 1900, 109, 2077, 661, 2079, 2080, 656, 658,
- /* 1180 */ 651, 51, 611, 3, 2044, 2255, 657, 2164, 185, 191,
- /* 1190 */ 53, 378, 2160, 240, 430, 692, 1742, 2076, 1900, 145,
- /* 1200 */ 152, 134, 2211, 607, 248, 228, 230, 431, 226, 229,
- /* 1210 */ 232, 234, 147, 231, 233, 2075, 1688, 1689, 548, 2111,
- /* 1220 */ 2076, 247, 109, 2077, 661, 2079, 2080, 656, 1613, 651,
- /* 1230 */ 2094, 1802, 152, 1467, 2255, 1465, 2164, 563, 658, 562,
- /* 1240 */ 378, 2160, 1740, 2044, 1475, 657, 63, 578, 13, 12,
- /* 1250 */ 1706, 586, 2204, 2094, 648, 63, 253, 1435, 701, 1470,
- /* 1260 */ 1471, 658, 266, 152, 551, 90, 2044, 592, 657, 47,
- /* 1270 */ 278, 70, 150, 152, 2075, 63, 1474, 47, 2111, 47,
- /* 1280 */ 1219, 109, 2077, 661, 2079, 2080, 656, 2065, 651, 1438,
- /* 1290 */ 665, 221, 150, 2255, 152, 2164, 135, 2075, 2076, 378,
- /* 1300 */ 2160, 2111, 150, 1642, 109, 2077, 661, 2079, 2080, 656,
- /* 1310 */ 2229, 651, 1641, 255, 381, 380, 2255, 395, 2164, 52,
- /* 1320 */ 623, 1736, 378, 2160, 1480, 1200, 1399, 283, 633, 287,
- /* 1330 */ 1280, 2094, 1584, 2183, 1533, 1547, 303, 1473, 260, 658,
- /* 1340 */ 2067, 702, 1963, 223, 2044, 2095, 657, 1308, 609, 1312,
- /* 1350 */ 1730, 1319, 2194, 1317, 617, 1897, 265, 2076, 171, 155,
- /* 1360 */ 1542, 1201, 268, 1217, 525, 521, 517, 513, 220, 1,
- /* 1370 */ 743, 4, 398, 1472, 403, 2075, 1422, 348, 298, 2111,
- /* 1380 */ 2076, 195, 109, 2077, 661, 2079, 2080, 656, 432, 651,
- /* 1390 */ 2094, 1494, 1964, 436, 2137, 469, 2164, 1478, 658, 647,
- /* 1400 */ 378, 2160, 1568, 2044, 441, 657, 1489, 454, 1956, 87,
- /* 1410 */ 468, 612, 218, 2094, 461, 470, 479, 477, 200, 480,
- /* 1420 */ 199, 658, 483, 482, 202, 485, 2044, 566, 657, 1477,
- /* 1430 */ 487, 1495, 488, 497, 2075, 1497, 1492, 500, 2111, 208,
- /* 1440 */ 501, 109, 2077, 661, 2079, 2080, 656, 1496, 651, 210,
- /* 1450 */ 502, 1498, 503, 644, 213, 2164, 215, 2075, 505, 378,
- /* 1460 */ 2160, 2111, 2076, 509, 110, 2077, 661, 2079, 2080, 656,
- /* 1470 */ 84, 651, 579, 85, 219, 1173, 2235, 526, 2164, 217,
- /* 1480 */ 211, 528, 2163, 2160, 216, 527, 504, 530, 1481, 111,
- /* 1490 */ 1476, 2241, 182, 338, 1846, 2094, 2236, 605, 225, 2021,
- /* 1500 */ 1842, 227, 209, 658, 157, 158, 1844, 565, 2044, 1840,
- /* 1510 */ 657, 2076, 567, 159, 1484, 1486, 160, 88, 148, 242,
- /* 1520 */ 299, 2018, 569, 2017, 245, 576, 573, 649, 1540, 1541,
- /* 1530 */ 1543, 1544, 1545, 1546, 2076, 570, 583, 593, 2210, 2075,
- /* 1540 */ 2195, 2205, 631, 2111, 2094, 602, 110, 2077, 661, 2079,
- /* 1550 */ 2080, 656, 658, 651, 251, 589, 254, 2044, 7, 657,
- /* 1560 */ 2164, 367, 596, 2209, 646, 2160, 172, 2094, 2186, 584,
- /* 1570 */ 582, 261, 259, 2258, 263, 655, 262, 581, 1610, 264,
- /* 1580 */ 2044, 613, 657, 368, 610, 138, 1493, 2180, 659, 371,
- /* 1590 */ 621, 1499, 2111, 300, 1969, 110, 2077, 661, 2079, 2080,
- /* 1600 */ 656, 629, 651, 273, 95, 634, 2076, 301, 97, 2164,
- /* 1610 */ 635, 2075, 99, 343, 2160, 2111, 630, 60, 326, 2077,
- /* 1620 */ 661, 2079, 2080, 656, 654, 651, 642, 2129, 267, 2076,
- /* 1630 */ 2234, 1983, 1982, 1981, 374, 1857, 302, 2145, 101, 2094,
- /* 1640 */ 663, 1901, 1819, 751, 305, 744, 745, 658, 747, 314,
- /* 1650 */ 294, 328, 2044, 318, 657, 307, 309, 297, 50, 340,
- /* 1660 */ 341, 2036, 2094, 2076, 2035, 2034, 329, 77, 2031, 400,
- /* 1670 */ 658, 401, 175, 1457, 1458, 2044, 188, 657, 741, 737,
- /* 1680 */ 733, 729, 295, 2075, 405, 2029, 407, 2111, 408, 2076,
- /* 1690 */ 169, 2077, 661, 2079, 2080, 656, 2094, 651, 409, 2028,
- /* 1700 */ 411, 2027, 413, 2026, 658, 415, 2075, 2025, 417, 2044,
- /* 1710 */ 2111, 657, 78, 110, 2077, 661, 2079, 2080, 656, 1425,
- /* 1720 */ 651, 1424, 2094, 107, 1995, 1994, 288, 2164, 1993, 424,
- /* 1730 */ 658, 425, 2161, 1992, 1991, 2044, 1376, 657, 1947, 1946,
- /* 1740 */ 2075, 1944, 606, 2256, 2111, 1943, 144, 168, 2077, 661,
- /* 1750 */ 2079, 2080, 656, 2076, 651, 1942, 1945, 1941, 637, 193,
- /* 1760 */ 1935, 442, 444, 1949, 1934, 1933, 2075, 1940, 1938, 1937,
- /* 1770 */ 2111, 1936, 1932, 320, 2077, 661, 2079, 2080, 656, 1931,
- /* 1780 */ 651, 1930, 1929, 1928, 1927, 2076, 2094, 1926, 1925, 2202,
- /* 1790 */ 1924, 1923, 1922, 275, 658, 1921, 1920, 1919, 274, 2044,
- /* 1800 */ 146, 657, 1918, 1917, 1948, 1916, 1915, 1378, 1914, 1913,
- /* 1810 */ 2076, 1912, 1911, 472, 1429, 1910, 243, 601, 2094, 336,
- /* 1820 */ 1251, 1255, 1765, 337, 201, 1764, 655, 1763, 1247, 1761,
- /* 1830 */ 2075, 2044, 203, 657, 2111, 204, 1725, 169, 2077, 661,
- /* 1840 */ 2079, 2080, 656, 2094, 651, 177, 1724, 2064, 383, 206,
- /* 1850 */ 2008, 658, 75, 1159, 1158, 76, 2044, 493, 657, 2076,
- /* 1860 */ 207, 495, 2075, 2002, 1990, 212, 2111, 214, 1989, 326,
- /* 1870 */ 2077, 661, 2079, 2080, 656, 2076, 651, 1967, 2130, 1835,
- /* 1880 */ 1760, 1758, 1193, 510, 512, 511, 1756, 2075, 514, 515,
- /* 1890 */ 2257, 2111, 2094, 516, 327, 2077, 661, 2079, 2080, 656,
- /* 1900 */ 658, 651, 1754, 519, 518, 2044, 520, 657, 2094, 1752,
- /* 1910 */ 522, 524, 1739, 385, 523, 1738, 658, 1721, 1837, 1324,
- /* 1920 */ 1836, 2044, 1323, 657, 2076, 1238, 224, 62, 1237, 1236,
- /* 1930 */ 1235, 1234, 716, 718, 1231, 1229, 564, 1750, 1230, 1228,
- /* 1940 */ 2111, 2076, 1743, 322, 2077, 661, 2079, 2080, 656, 358,
- /* 1950 */ 651, 359, 2075, 1741, 360, 549, 2111, 2094, 2076, 327,
- /* 1960 */ 2077, 661, 2079, 2080, 656, 658, 651, 1720, 552, 554,
- /* 1970 */ 2044, 1719, 657, 556, 2094, 1718, 558, 112, 1445, 1447,
- /* 1980 */ 1444, 2007, 658, 1449, 1431, 26, 2001, 2044, 571, 657,
- /* 1990 */ 1988, 2094, 55, 246, 1986, 2240, 577, 66, 572, 658,
- /* 2000 */ 19, 2075, 364, 16, 2044, 2111, 657, 2076, 311, 2077,
- /* 2010 */ 661, 2079, 2080, 656, 58, 651, 28, 162, 2075, 5,
- /* 2020 */ 1658, 250, 2111, 2076, 585, 312, 2077, 661, 2079, 2080,
- /* 2030 */ 656, 6, 651, 59, 587, 2075, 64, 252, 258, 2111,
- /* 2040 */ 2094, 2076, 313, 2077, 661, 2079, 2080, 656, 658, 651,
- /* 2050 */ 257, 1640, 170, 2044, 2065, 657, 2094, 30, 256, 29,
- /* 2060 */ 21, 1632, 91, 1673, 658, 1678, 1679, 1672, 270, 2044,
- /* 2070 */ 369, 657, 1677, 1676, 2094, 370, 173, 1607, 1606, 1987,
- /* 2080 */ 57, 1985, 658, 93, 2075, 56, 20, 2044, 2111, 657,
- /* 2090 */ 2076, 319, 2077, 661, 2079, 2080, 656, 17, 651, 1984,
- /* 2100 */ 2075, 1966, 94, 276, 2111, 22, 2076, 323, 2077, 661,
- /* 2110 */ 2079, 2080, 656, 1965, 651, 277, 1638, 279, 2075, 284,
- /* 2120 */ 67, 96, 2111, 2094, 286, 315, 2077, 661, 2079, 2080,
- /* 2130 */ 656, 658, 651, 102, 98, 289, 2044, 23, 657, 2094,
- /* 2140 */ 632, 1559, 10, 1558, 12, 1482, 2114, 658, 1537, 650,
- /* 2150 */ 174, 1535, 2044, 1569, 657, 36, 186, 1514, 1534, 15,
- /* 2160 */ 24, 660, 1506, 2076, 25, 662, 1309, 2075, 664, 386,
- /* 2170 */ 666, 2111, 1306, 668, 324, 2077, 661, 2079, 2080, 656,
- /* 2180 */ 2076, 651, 671, 2075, 669, 674, 1303, 2111, 1297, 672,
- /* 2190 */ 316, 2077, 661, 2079, 2080, 656, 2094, 651, 675, 677,
- /* 2200 */ 1301, 1295, 678, 1300, 658, 1286, 684, 103, 104, 2044,
- /* 2210 */ 292, 657, 1318, 2094, 1299, 1298, 74, 1314, 1191, 694,
- /* 2220 */ 1225, 658, 1224, 1223, 1222, 1221, 2044, 1220, 657, 2076,
- /* 2230 */ 1245, 1218, 706, 1216, 1215, 1214, 1212, 293, 1211, 1210,
- /* 2240 */ 2075, 1209, 1208, 1207, 2111, 2076, 1206, 325, 2077, 661,
- /* 2250 */ 2079, 2080, 656, 1242, 651, 1240, 1203, 2075, 1202, 1199,
- /* 2260 */ 1198, 2111, 2094, 1197, 317, 2077, 661, 2079, 2080, 656,
- /* 2270 */ 658, 651, 1196, 1757, 726, 2044, 727, 657, 2094, 728,
- /* 2280 */ 1755, 731, 730, 732, 1753, 734, 658, 736, 1751, 738,
- /* 2290 */ 735, 2044, 740, 657, 2076, 1737, 742, 739, 1148, 1717,
- /* 2300 */ 296, 1468, 746, 750, 306, 1692, 2075, 749, 1692, 1692,
- /* 2310 */ 2111, 1692, 1692, 330, 2077, 661, 2079, 2080, 656, 2076,
- /* 2320 */ 651, 1692, 2075, 1692, 1692, 1692, 2111, 2094, 1692, 331,
- /* 2330 */ 2077, 661, 2079, 2080, 656, 658, 651, 1692, 1692, 1692,
- /* 2340 */ 2044, 1692, 657, 2076, 1692, 1692, 1692, 1692, 1692, 1692,
- /* 2350 */ 1692, 1692, 2094, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
- /* 2360 */ 658, 1692, 1692, 1692, 1692, 2044, 1692, 657, 1692, 1692,
- /* 2370 */ 1692, 2075, 1692, 1692, 1692, 2111, 2094, 1692, 2088, 2077,
- /* 2380 */ 661, 2079, 2080, 656, 658, 651, 1692, 1692, 1692, 2044,
- /* 2390 */ 1692, 657, 1692, 1692, 1692, 1692, 2075, 1692, 1692, 1692,
- /* 2400 */ 2111, 1692, 1692, 2087, 2077, 661, 2079, 2080, 656, 1692,
- /* 2410 */ 651, 1692, 1692, 1692, 2076, 1692, 1692, 1692, 1692, 1692,
- /* 2420 */ 2075, 1692, 1692, 1692, 2111, 1692, 1692, 2086, 2077, 661,
- /* 2430 */ 2079, 2080, 656, 1692, 651, 1692, 2076, 1692, 1692, 1692,
- /* 2440 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 2094, 1692, 1692,
- /* 2450 */ 1692, 1692, 1692, 1692, 1692, 658, 1692, 1692, 1692, 1692,
- /* 2460 */ 2044, 1692, 657, 2076, 1692, 1692, 1692, 1692, 1692, 2094,
- /* 2470 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 658, 1692, 1692,
- /* 2480 */ 1692, 1692, 2044, 1692, 657, 1692, 1692, 1692, 1692, 1692,
- /* 2490 */ 1692, 2075, 1692, 1692, 1692, 2111, 2094, 1692, 345, 2077,
- /* 2500 */ 661, 2079, 2080, 656, 658, 651, 1692, 1692, 1692, 2044,
- /* 2510 */ 1692, 657, 2076, 2075, 1692, 1692, 1692, 2111, 1692, 1692,
- /* 2520 */ 346, 2077, 661, 2079, 2080, 656, 1692, 651, 2076, 1692,
- /* 2530 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
- /* 2540 */ 2075, 1692, 1692, 1692, 2111, 2094, 1692, 342, 2077, 661,
- /* 2550 */ 2079, 2080, 656, 658, 651, 1692, 1692, 1692, 2044, 1692,
- /* 2560 */ 657, 2094, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 658,
- /* 2570 */ 1692, 1692, 1692, 1692, 2044, 1692, 657, 2076, 1692, 1692,
- /* 2580 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 2075,
- /* 2590 */ 1692, 1692, 1692, 2111, 1692, 1692, 347, 2077, 661, 2079,
- /* 2600 */ 2080, 656, 1692, 651, 1692, 659, 1692, 1692, 1692, 2111,
- /* 2610 */ 2094, 1692, 322, 2077, 661, 2079, 2080, 656, 658, 651,
- /* 2620 */ 1692, 1692, 1692, 2044, 1692, 657, 1692, 1692, 1692, 1692,
- /* 2630 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
- /* 2640 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
- /* 2650 */ 1692, 1692, 1692, 1692, 2075, 1692, 1692, 1692, 2111, 1692,
- /* 2660 */ 1692, 321, 2077, 661, 2079, 2080, 656, 1692, 651,
+ /* 0 */ 1873, 2109, 2003, 428, 1875, 1869, 631, 427, 2096, 167,
+ /* 10 */ 650, 1729, 45, 43, 1641, 2091, 176, 2001, 637, 2091,
+ /* 20 */ 389, 613, 1490, 38, 37, 2268, 187, 44, 42, 41,
+ /* 30 */ 40, 39, 1937, 1571, 2127, 1488, 1783, 354, 1986, 367,
+ /* 40 */ 612, 182, 664, 1884, 106, 2269, 614, 2077, 1935, 666,
+ /* 50 */ 588, 2087, 2093, 588, 2268, 2087, 2093, 2268, 1566, 1517,
+ /* 60 */ 140, 2273, 660, 178, 18, 2268, 660, 2003, 1876, 2274,
+ /* 70 */ 182, 1496, 2274, 182, 2269, 614, 1924, 2269, 614, 380,
+ /* 80 */ 2108, 2272, 2000, 637, 2144, 2269, 2271, 328, 2110, 670,
+ /* 90 */ 2112, 2113, 665, 663, 660, 651, 2162, 757, 1258, 649,
+ /* 100 */ 14, 501, 734, 733, 732, 731, 399, 497, 730, 729,
+ /* 110 */ 143, 724, 723, 722, 721, 720, 719, 718, 156, 714,
+ /* 120 */ 713, 712, 398, 397, 709, 708, 707, 706, 705, 1515,
+ /* 130 */ 495, 1315, 496, 1753, 1260, 122, 1573, 1574, 121, 120,
+ /* 140 */ 119, 118, 117, 116, 115, 114, 113, 1306, 692, 691,
+ /* 150 */ 690, 1310, 689, 1312, 1313, 688, 685, 649, 1321, 682,
+ /* 160 */ 1323, 1324, 679, 676, 650, 61, 1546, 1556, 2273, 649,
+ /* 170 */ 38, 37, 1572, 1575, 44, 42, 41, 40, 39, 48,
+ /* 180 */ 132, 504, 1937, 496, 1753, 1517, 1491, 534, 1489, 352,
+ /* 190 */ 1515, 35, 292, 1710, 635, 38, 37, 1884, 1935, 44,
+ /* 200 */ 42, 41, 40, 39, 238, 38, 37, 273, 237, 44,
+ /* 210 */ 42, 41, 40, 39, 2109, 1494, 1495, 1518, 1545, 1548,
+ /* 220 */ 1549, 1550, 1551, 1552, 1553, 1554, 1555, 662, 658, 1564,
+ /* 230 */ 1565, 1567, 1568, 1569, 1570, 2, 45, 43, 166, 513,
+ /* 240 */ 636, 337, 625, 1513, 389, 1825, 1490, 2127, 1740, 48,
+ /* 250 */ 465, 346, 1739, 479, 625, 628, 478, 1571, 2044, 1488,
+ /* 260 */ 2077, 613, 666, 1680, 2070, 2268, 1703, 49, 89, 341,
+ /* 270 */ 61, 448, 366, 480, 568, 139, 450, 1516, 434, 2095,
+ /* 280 */ 612, 182, 1566, 13, 12, 2269, 614, 139, 18, 511,
+ /* 290 */ 2091, 1996, 1709, 2108, 2077, 1496, 1600, 2144, 2077, 608,
+ /* 300 */ 109, 2110, 670, 2112, 2113, 665, 240, 660, 1185, 274,
+ /* 310 */ 1184, 588, 179, 86, 2197, 2268, 2109, 185, 383, 2193,
+ /* 320 */ 334, 757, 355, 222, 14, 86, 2087, 2093, 370, 356,
+ /* 330 */ 2274, 182, 184, 273, 438, 2269, 614, 660, 1879, 1186,
+ /* 340 */ 2223, 627, 180, 2205, 2206, 1862, 137, 2210, 1516, 2127,
+ /* 350 */ 1880, 61, 1601, 92, 181, 2205, 2206, 667, 137, 2210,
+ /* 360 */ 1573, 1574, 2077, 476, 666, 251, 470, 469, 468, 467,
+ /* 370 */ 464, 463, 462, 461, 460, 456, 455, 454, 453, 336,
+ /* 380 */ 445, 444, 443, 1614, 440, 439, 353, 1931, 1932, 147,
+ /* 390 */ 1546, 1556, 1738, 1349, 1350, 2108, 1572, 1575, 566, 2144,
+ /* 400 */ 392, 185, 109, 2110, 670, 2112, 2113, 665, 161, 660,
+ /* 410 */ 1491, 564, 1489, 562, 2172, 368, 2197, 1886, 603, 185,
+ /* 420 */ 383, 2193, 185, 652, 1935, 2169, 34, 387, 1595, 1596,
+ /* 430 */ 1597, 1598, 1599, 1603, 1604, 1605, 1606, 625, 2077, 1494,
+ /* 440 */ 1495, 704, 1545, 1548, 1549, 1550, 1551, 1552, 1553, 1554,
+ /* 450 */ 1555, 662, 658, 1564, 1565, 1567, 1568, 1569, 1570, 2,
+ /* 460 */ 11, 45, 43, 394, 1421, 1422, 1930, 1932, 1514, 389,
+ /* 470 */ 139, 1490, 552, 551, 550, 1669, 548, 547, 1982, 542,
+ /* 480 */ 136, 546, 1571, 239, 1488, 545, 1737, 223, 2109, 190,
+ /* 490 */ 544, 549, 362, 361, 494, 1515, 543, 499, 1759, 1967,
+ /* 500 */ 1420, 1423, 171, 185, 609, 604, 597, 1566, 530, 526,
+ /* 510 */ 522, 518, 220, 18, 44, 42, 41, 40, 39, 650,
+ /* 520 */ 1496, 2127, 600, 599, 1667, 1668, 1670, 1671, 1672, 667,
+ /* 530 */ 100, 636, 2077, 65, 2077, 54, 666, 271, 2205, 624,
+ /* 540 */ 503, 133, 623, 499, 1759, 2268, 757, 61, 1937, 14,
+ /* 550 */ 1463, 1464, 1884, 87, 1877, 377, 218, 1645, 728, 726,
+ /* 560 */ 612, 182, 2127, 1515, 1935, 2269, 614, 2108, 165, 1718,
+ /* 570 */ 607, 2144, 1786, 312, 169, 2110, 670, 2112, 2113, 665,
+ /* 580 */ 634, 660, 1996, 2272, 702, 1573, 1574, 310, 72, 421,
+ /* 590 */ 122, 71, 1861, 121, 120, 119, 118, 117, 116, 115,
+ /* 600 */ 114, 113, 154, 153, 699, 698, 697, 151, 575, 205,
+ /* 610 */ 491, 489, 486, 423, 419, 1546, 1556, 606, 41, 40,
+ /* 620 */ 39, 1572, 1575, 217, 211, 11, 615, 2289, 216, 61,
+ /* 630 */ 509, 538, 426, 176, 425, 1491, 381, 1489, 552, 551,
+ /* 640 */ 550, 1404, 1405, 636, 164, 542, 136, 546, 209, 2095,
+ /* 650 */ 61, 545, 537, 1886, 452, 1987, 544, 549, 362, 361,
+ /* 660 */ 2091, 424, 543, 451, 1494, 1495, 1496, 1545, 1548, 1549,
+ /* 670 */ 1550, 1551, 1552, 1553, 1554, 1555, 662, 658, 1564, 1565,
+ /* 680 */ 1567, 1568, 1569, 1570, 2, 45, 43, 1576, 108, 1717,
+ /* 690 */ 1736, 1735, 645, 389, 1996, 1490, 2087, 2093, 371, 185,
+ /* 700 */ 11, 2109, 9, 1715, 702, 1871, 1571, 660, 1488, 1547,
+ /* 710 */ 1185, 1166, 1184, 131, 130, 129, 128, 127, 126, 125,
+ /* 720 */ 124, 123, 154, 153, 699, 698, 697, 151, 80, 79,
+ /* 730 */ 431, 1566, 650, 189, 2127, 650, 2077, 2077, 1171, 1172,
+ /* 740 */ 1734, 1186, 667, 650, 1496, 695, 472, 2077, 132, 666,
+ /* 750 */ 1168, 432, 1171, 1172, 335, 539, 1269, 417, 716, 433,
+ /* 760 */ 415, 411, 407, 404, 424, 1884, 2095, 1937, 1884, 1268,
+ /* 770 */ 757, 402, 1490, 46, 382, 401, 1884, 2091, 1860, 2109,
+ /* 780 */ 2108, 185, 2098, 1935, 2144, 1488, 2077, 109, 2110, 670,
+ /* 790 */ 2112, 2113, 665, 654, 660, 2169, 1867, 142, 1581, 149,
+ /* 800 */ 2168, 2197, 185, 650, 1515, 383, 2193, 198, 197, 1573,
+ /* 810 */ 1574, 625, 2127, 2087, 2093, 384, 1937, 164, 588, 442,
+ /* 820 */ 667, 1496, 2268, 393, 660, 2077, 1887, 666, 283, 284,
+ /* 830 */ 471, 481, 1935, 282, 194, 2100, 1884, 2274, 182, 1546,
+ /* 840 */ 1556, 704, 2269, 614, 139, 1572, 1575, 757, 650, 38,
+ /* 850 */ 37, 1518, 616, 44, 42, 41, 40, 39, 2108, 1491,
+ /* 860 */ 1273, 1489, 2144, 392, 457, 109, 2110, 670, 2112, 2113,
+ /* 870 */ 665, 164, 660, 1272, 1733, 83, 1515, 2170, 82, 2197,
+ /* 880 */ 1886, 1884, 1732, 383, 2193, 27, 2071, 1602, 1494, 1495,
+ /* 890 */ 1638, 1545, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555,
+ /* 900 */ 662, 658, 1564, 1565, 1567, 1568, 1569, 1570, 2, 45,
+ /* 910 */ 43, 183, 2205, 2206, 395, 137, 2210, 389, 650, 1490,
+ /* 920 */ 2077, 2109, 164, 248, 2217, 1634, 650, 1731, 2077, 73,
+ /* 930 */ 1571, 1886, 1488, 588, 458, 483, 1491, 2268, 1489, 38,
+ /* 940 */ 37, 557, 512, 44, 42, 41, 40, 39, 2212, 694,
+ /* 950 */ 1547, 1884, 2274, 182, 2127, 1566, 567, 2269, 614, 1884,
+ /* 960 */ 1728, 32, 628, 2212, 2060, 1494, 1495, 2077, 1496, 666,
+ /* 970 */ 236, 1607, 1727, 2077, 2209, 38, 37, 1982, 81, 44,
+ /* 980 */ 42, 41, 40, 39, 717, 560, 1846, 650, 192, 2208,
+ /* 990 */ 554, 1726, 8, 152, 757, 235, 1725, 46, 1724, 191,
+ /* 1000 */ 2108, 1518, 1723, 1881, 2144, 2109, 2077, 109, 2110, 670,
+ /* 1010 */ 2112, 2113, 665, 1722, 660, 1721, 1720, 31, 2077, 179,
+ /* 1020 */ 1884, 2197, 1547, 38, 37, 383, 2193, 44, 42, 41,
+ /* 1030 */ 40, 39, 1657, 1573, 1574, 1859, 69, 2077, 2127, 68,
+ /* 1040 */ 141, 650, 2077, 2168, 2077, 1982, 667, 2224, 2077, 650,
+ /* 1050 */ 53, 2077, 1937, 666, 435, 2212, 196, 241, 51, 2077,
+ /* 1060 */ 3, 2077, 2077, 1546, 1556, 584, 33, 436, 1936, 1572,
+ /* 1070 */ 1575, 650, 38, 37, 1884, 617, 44, 42, 41, 40,
+ /* 1080 */ 39, 2207, 1884, 1491, 2108, 1489, 696, 629, 2144, 1928,
+ /* 1090 */ 2063, 109, 2110, 670, 2112, 2113, 665, 700, 660, 701,
+ /* 1100 */ 1928, 620, 1928, 653, 1884, 2197, 152, 2109, 306, 383,
+ /* 1110 */ 2193, 1914, 1494, 1495, 540, 1545, 1548, 1549, 1550, 1551,
+ /* 1120 */ 1552, 1553, 1554, 1555, 662, 658, 1564, 1565, 1567, 1568,
+ /* 1130 */ 1569, 1570, 2, 45, 43, 163, 1256, 587, 409, 1637,
+ /* 1140 */ 2127, 389, 650, 1490, 570, 650, 569, 702, 667, 250,
+ /* 1150 */ 145, 152, 134, 2077, 1571, 666, 1488, 228, 633, 573,
+ /* 1160 */ 226, 287, 245, 1458, 661, 154, 153, 699, 698, 697,
+ /* 1170 */ 151, 230, 359, 416, 229, 1884, 38, 37, 1884, 1566,
+ /* 1180 */ 44, 42, 41, 40, 39, 232, 2108, 650, 231, 249,
+ /* 1190 */ 2144, 63, 1496, 109, 2110, 670, 2112, 2113, 665, 650,
+ /* 1200 */ 660, 650, 1826, 647, 1634, 2288, 588, 2197, 1461, 52,
+ /* 1210 */ 2268, 383, 2193, 2109, 1499, 648, 63, 293, 757, 650,
+ /* 1220 */ 1884, 14, 2231, 1773, 234, 2274, 182, 233, 1766, 255,
+ /* 1230 */ 2269, 614, 1884, 90, 1884, 396, 2109, 1498, 360, 105,
+ /* 1240 */ 358, 357, 1764, 536, 541, 553, 2127, 538, 1666, 102,
+ /* 1250 */ 555, 2273, 1884, 152, 667, 2268, 1730, 1573, 1574, 2077,
+ /* 1260 */ 2237, 666, 1712, 1713, 558, 268, 1254, 710, 537, 2127,
+ /* 1270 */ 601, 2272, 657, 1665, 47, 2269, 2270, 667, 280, 13,
+ /* 1280 */ 12, 70, 2077, 221, 666, 262, 257, 1546, 1556, 1234,
+ /* 1290 */ 2128, 400, 2108, 1572, 1575, 1991, 2144, 1754, 1215, 110,
+ /* 1300 */ 2110, 670, 2112, 2113, 665, 618, 660, 1491, 150, 1489,
+ /* 1310 */ 632, 152, 1925, 2197, 63, 2108, 47, 2196, 2193, 2144,
+ /* 1320 */ 47, 674, 168, 2110, 670, 2112, 2113, 665, 2109, 660,
+ /* 1330 */ 2227, 1418, 150, 621, 1216, 285, 1494, 1495, 642, 1545,
+ /* 1340 */ 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 662, 658,
+ /* 1350 */ 1564, 1565, 1567, 1568, 1569, 1570, 2, 711, 626, 270,
+ /* 1360 */ 267, 2127, 1, 589, 2234, 289, 4, 1502, 1299, 667,
+ /* 1370 */ 152, 1608, 135, 1557, 2077, 403, 666, 305, 1327, 1232,
+ /* 1380 */ 150, 1760, 408, 350, 1441, 300, 437, 195, 1518, 1331,
+ /* 1390 */ 1501, 1992, 441, 446, 474, 459, 1513, 1984, 2109, 466,
+ /* 1400 */ 484, 473, 475, 485, 482, 199, 487, 2108, 488, 200,
+ /* 1410 */ 202, 2144, 490, 492, 109, 2110, 670, 2112, 2113, 665,
+ /* 1420 */ 1519, 660, 493, 1592, 502, 1521, 2288, 1338, 2197, 1336,
+ /* 1430 */ 752, 2127, 383, 2193, 505, 208, 1516, 155, 210, 667,
+ /* 1440 */ 1520, 506, 507, 2244, 2077, 1522, 666, 508, 510, 2109,
+ /* 1450 */ 213, 215, 84, 1188, 514, 531, 85, 219, 532, 533,
+ /* 1460 */ 535, 1874, 225, 1870, 227, 157, 111, 340, 158, 572,
+ /* 1470 */ 88, 2053, 2050, 578, 574, 148, 579, 2108, 242, 244,
+ /* 1480 */ 301, 2144, 2127, 1872, 109, 2110, 670, 2112, 2113, 665,
+ /* 1490 */ 667, 660, 577, 1868, 159, 2077, 2288, 666, 2197, 386,
+ /* 1500 */ 385, 2049, 383, 2193, 160, 246, 1448, 585, 2228, 1504,
+ /* 1510 */ 582, 602, 2238, 595, 7, 592, 2243, 640, 611, 583,
+ /* 1520 */ 1571, 598, 1497, 372, 2109, 605, 593, 373, 2108, 591,
+ /* 1530 */ 2242, 253, 2144, 261, 256, 109, 2110, 670, 2112, 2113,
+ /* 1540 */ 665, 2219, 660, 622, 590, 1566, 2267, 2288, 619, 2197,
+ /* 1550 */ 1634, 2291, 269, 383, 2193, 138, 1517, 2127, 1496, 266,
+ /* 1560 */ 630, 2213, 376, 275, 2262, 667, 95, 1523, 1997, 302,
+ /* 1570 */ 2077, 638, 666, 172, 639, 2011, 2010, 2009, 303, 643,
+ /* 1580 */ 379, 644, 60, 264, 656, 97, 304, 1885, 263, 99,
+ /* 1590 */ 2178, 1929, 101, 265, 1847, 672, 296, 307, 753, 342,
+ /* 1600 */ 50, 754, 331, 2108, 756, 343, 316, 2144, 330, 576,
+ /* 1610 */ 109, 2110, 670, 2112, 2113, 665, 311, 660, 320, 309,
+ /* 1620 */ 2069, 2068, 2288, 2067, 2197, 77, 2064, 760, 383, 2193,
+ /* 1630 */ 405, 406, 1481, 1482, 188, 410, 2062, 412, 413, 2216,
+ /* 1640 */ 414, 299, 2061, 2109, 351, 2059, 418, 2058, 2057, 420,
+ /* 1650 */ 422, 78, 1444, 1443, 2023, 2022, 175, 2021, 429, 430,
+ /* 1660 */ 2020, 2019, 750, 746, 742, 738, 297, 1975, 1974, 1395,
+ /* 1670 */ 1972, 144, 1971, 1505, 1970, 1500, 2127, 193, 447, 1963,
+ /* 1680 */ 449, 1977, 1962, 1961, 667, 1973, 1969, 1968, 1966, 2077,
+ /* 1690 */ 1965, 666, 1964, 1960, 1959, 1958, 1957, 1956, 1955, 1954,
+ /* 1700 */ 1953, 1952, 1508, 1510, 1951, 1950, 1949, 107, 2109, 1948,
+ /* 1710 */ 290, 146, 1947, 1946, 1945, 658, 1564, 1565, 1567, 1568,
+ /* 1720 */ 1569, 1570, 2108, 1976, 1944, 1943, 2144, 1942, 1941, 110,
+ /* 1730 */ 2110, 670, 2112, 2113, 665, 1940, 660, 1397, 1939, 477,
+ /* 1740 */ 1938, 2127, 646, 2197, 1270, 338, 339, 655, 2193, 667,
+ /* 1750 */ 1789, 1274, 1266, 1788, 2077, 1787, 666, 1785, 1749, 75,
+ /* 1760 */ 201, 206, 177, 2097, 1748, 203, 204, 2040, 1174, 76,
+ /* 1770 */ 1173, 2030, 2018, 2109, 207, 212, 2017, 277, 498, 500,
+ /* 1780 */ 1995, 1863, 276, 214, 1784, 1782, 1208, 668, 517, 516,
+ /* 1790 */ 1780, 2144, 520, 1778, 110, 2110, 670, 2112, 2113, 665,
+ /* 1800 */ 515, 660, 243, 519, 523, 521, 2127, 524, 2197, 525,
+ /* 1810 */ 1776, 528, 345, 2193, 667, 1763, 529, 527, 1762, 2077,
+ /* 1820 */ 1745, 666, 1865, 1343, 2109, 1342, 1864, 1257, 1244, 1255,
+ /* 1830 */ 725, 1253, 1252, 1251, 1250, 62, 1249, 1246, 1774, 1245,
+ /* 1840 */ 224, 363, 1243, 2109, 727, 1767, 364, 1765, 559, 365,
+ /* 1850 */ 1744, 561, 2108, 1743, 1742, 556, 2144, 2127, 563, 110,
+ /* 1860 */ 2110, 670, 2112, 2113, 665, 667, 660, 1468, 565, 112,
+ /* 1870 */ 2077, 1470, 666, 2197, 1467, 26, 2127, 2039, 2194, 1472,
+ /* 1880 */ 1452, 2029, 1454, 66, 667, 580, 1450, 2016, 2014, 2077,
+ /* 1890 */ 16, 666, 2273, 20, 64, 17, 19, 2015, 2013, 162,
+ /* 1900 */ 58, 59, 1697, 2108, 596, 55, 259, 2144, 28, 247,
+ /* 1910 */ 168, 2110, 670, 2112, 2113, 665, 581, 660, 2109, 369,
+ /* 1920 */ 586, 252, 2108, 260, 5, 2098, 2144, 594, 30, 322,
+ /* 1930 */ 2110, 670, 2112, 2113, 665, 1682, 660, 2109, 6, 21,
+ /* 1940 */ 1696, 254, 1664, 170, 258, 374, 1701, 1700, 29, 375,
+ /* 1950 */ 272, 2127, 2235, 57, 173, 2012, 1656, 1994, 641, 667,
+ /* 1960 */ 91, 56, 1702, 94, 2077, 1703, 666, 1631, 278, 1630,
+ /* 1970 */ 2127, 93, 22, 610, 279, 378, 1662, 1993, 667, 281,
+ /* 1980 */ 286, 96, 67, 2077, 102, 666, 288, 291, 23, 10,
+ /* 1990 */ 12, 1583, 98, 1506, 1582, 1561, 174, 2108, 186, 2147,
+ /* 2000 */ 659, 2144, 1559, 1558, 169, 2110, 670, 2112, 2113, 665,
+ /* 2010 */ 2109, 660, 1538, 36, 673, 15, 2108, 24, 391, 1530,
+ /* 2020 */ 2144, 677, 25, 329, 2110, 670, 2112, 2113, 665, 1593,
+ /* 2030 */ 660, 671, 1328, 675, 680, 1325, 2109, 678, 683, 1322,
+ /* 2040 */ 1316, 681, 686, 2127, 1314, 684, 687, 669, 1320, 1319,
+ /* 2050 */ 1318, 664, 1317, 1305, 103, 294, 2077, 2290, 666, 693,
+ /* 2060 */ 104, 1337, 74, 1333, 1240, 1206, 703, 1239, 1238, 2127,
+ /* 2070 */ 1237, 1236, 1264, 1235, 388, 1233, 1224, 667, 1231, 1230,
+ /* 2080 */ 1229, 1227, 2077, 295, 666, 715, 1226, 1225, 1223, 2108,
+ /* 2090 */ 1222, 1221, 1261, 2144, 1259, 1218, 328, 2110, 670, 2112,
+ /* 2100 */ 2113, 665, 1217, 660, 1214, 2163, 1213, 2109, 1212, 1211,
+ /* 2110 */ 1781, 735, 736, 1779, 737, 2108, 739, 741, 740, 2144,
+ /* 2120 */ 1777, 744, 329, 2110, 670, 2112, 2113, 665, 2109, 660,
+ /* 2130 */ 743, 745, 1775, 748, 747, 749, 1761, 751, 1163, 1741,
+ /* 2140 */ 2127, 298, 755, 759, 1492, 390, 308, 758, 667, 1716,
+ /* 2150 */ 1716, 1716, 1716, 2077, 1716, 666, 1716, 1716, 2109, 1716,
+ /* 2160 */ 1716, 2127, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 667,
+ /* 2170 */ 1716, 1716, 1716, 1716, 2077, 1716, 666, 1716, 1716, 1716,
+ /* 2180 */ 1716, 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716, 1716,
+ /* 2190 */ 2144, 2127, 1716, 329, 2110, 670, 2112, 2113, 665, 667,
+ /* 2200 */ 660, 1716, 1716, 1716, 2077, 1716, 666, 571, 1716, 1716,
+ /* 2210 */ 1716, 2144, 1716, 1716, 324, 2110, 670, 2112, 2113, 665,
+ /* 2220 */ 1716, 660, 1716, 2109, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2230 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716,
+ /* 2240 */ 1716, 2144, 1716, 1716, 313, 2110, 670, 2112, 2113, 665,
+ /* 2250 */ 1716, 660, 2109, 1716, 1716, 1716, 2127, 1716, 1716, 1716,
+ /* 2260 */ 1716, 1716, 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077,
+ /* 2270 */ 1716, 666, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2280 */ 1716, 1716, 1716, 1716, 1716, 2127, 2109, 1716, 1716, 1716,
+ /* 2290 */ 1716, 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077, 1716,
+ /* 2300 */ 666, 1716, 2108, 1716, 1716, 1716, 2144, 1716, 1716, 314,
+ /* 2310 */ 2110, 670, 2112, 2113, 665, 1716, 660, 1716, 1716, 2127,
+ /* 2320 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 667, 1716, 1716,
+ /* 2330 */ 1716, 2108, 2077, 1716, 666, 2144, 1716, 1716, 315, 2110,
+ /* 2340 */ 670, 2112, 2113, 665, 1716, 660, 1716, 1716, 1716, 1716,
+ /* 2350 */ 2109, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2360 */ 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716, 1716, 2144,
+ /* 2370 */ 2109, 1716, 321, 2110, 670, 2112, 2113, 665, 1716, 660,
+ /* 2380 */ 1716, 1716, 1716, 2127, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2390 */ 1716, 667, 1716, 1716, 1716, 1716, 2077, 1716, 666, 1716,
+ /* 2400 */ 1716, 1716, 1716, 2127, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2410 */ 1716, 667, 1716, 1716, 1716, 1716, 2077, 1716, 666, 1716,
+ /* 2420 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 2108,
+ /* 2430 */ 1716, 2109, 1716, 2144, 1716, 1716, 325, 2110, 670, 2112,
+ /* 2440 */ 2113, 665, 1716, 660, 1716, 1716, 1716, 1716, 1716, 2108,
+ /* 2450 */ 1716, 1716, 1716, 2144, 1716, 1716, 317, 2110, 670, 2112,
+ /* 2460 */ 2113, 665, 1716, 660, 2127, 1716, 1716, 1716, 1716, 1716,
+ /* 2470 */ 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077, 1716, 666,
+ /* 2480 */ 1716, 1716, 2109, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2490 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2500 */ 1716, 1716, 1716, 2109, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2510 */ 2108, 1716, 1716, 1716, 2144, 2127, 1716, 326, 2110, 670,
+ /* 2520 */ 2112, 2113, 665, 667, 660, 1716, 1716, 1716, 2077, 1716,
+ /* 2530 */ 666, 1716, 1716, 2109, 1716, 1716, 2127, 1716, 1716, 1716,
+ /* 2540 */ 1716, 1716, 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077,
+ /* 2550 */ 1716, 666, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2560 */ 1716, 2108, 1716, 1716, 1716, 2144, 2127, 1716, 318, 2110,
+ /* 2570 */ 670, 2112, 2113, 665, 667, 660, 1716, 1716, 1716, 2077,
+ /* 2580 */ 1716, 666, 2108, 1716, 1716, 1716, 2144, 1716, 1716, 327,
+ /* 2590 */ 2110, 670, 2112, 2113, 665, 1716, 660, 1716, 2109, 1716,
+ /* 2600 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2610 */ 1716, 1716, 2108, 1716, 1716, 1716, 2144, 1716, 1716, 319,
+ /* 2620 */ 2110, 670, 2112, 2113, 665, 1716, 660, 2109, 1716, 1716,
+ /* 2630 */ 1716, 2127, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 667,
+ /* 2640 */ 1716, 1716, 1716, 1716, 2077, 1716, 666, 1716, 1716, 1716,
+ /* 2650 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2660 */ 2127, 2109, 1716, 1716, 1716, 1716, 1716, 1716, 667, 1716,
+ /* 2670 */ 1716, 1716, 1716, 2077, 1716, 666, 1716, 2108, 1716, 1716,
+ /* 2680 */ 1716, 2144, 1716, 1716, 332, 2110, 670, 2112, 2113, 665,
+ /* 2690 */ 1716, 660, 1716, 1716, 2127, 1716, 1716, 1716, 1716, 1716,
+ /* 2700 */ 1716, 1716, 667, 1716, 1716, 1716, 2108, 2077, 1716, 666,
+ /* 2710 */ 2144, 1716, 1716, 333, 2110, 670, 2112, 2113, 665, 1716,
+ /* 2720 */ 660, 1716, 1716, 1716, 1716, 2109, 1716, 1716, 1716, 1716,
+ /* 2730 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2740 */ 2108, 1716, 1716, 1716, 2144, 2109, 1716, 2121, 2110, 670,
+ /* 2750 */ 2112, 2113, 665, 1716, 660, 1716, 1716, 1716, 2127, 1716,
+ /* 2760 */ 1716, 1716, 1716, 1716, 1716, 1716, 667, 1716, 1716, 1716,
+ /* 2770 */ 1716, 2077, 1716, 666, 1716, 1716, 1716, 1716, 2127, 1716,
+ /* 2780 */ 1716, 1716, 1716, 1716, 1716, 1716, 667, 1716, 1716, 1716,
+ /* 2790 */ 1716, 2077, 1716, 666, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2800 */ 1716, 1716, 1716, 1716, 2108, 1716, 2109, 1716, 2144, 1716,
+ /* 2810 */ 1716, 2120, 2110, 670, 2112, 2113, 665, 1716, 660, 1716,
+ /* 2820 */ 1716, 1716, 1716, 1716, 2108, 1716, 1716, 1716, 2144, 1716,
+ /* 2830 */ 1716, 2119, 2110, 670, 2112, 2113, 665, 1716, 660, 2127,
+ /* 2840 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 667, 1716, 1716,
+ /* 2850 */ 1716, 1716, 2077, 1716, 666, 1716, 1716, 2109, 1716, 1716,
+ /* 2860 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2870 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 2109, 1716,
+ /* 2880 */ 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716, 1716, 2144,
+ /* 2890 */ 2127, 1716, 347, 2110, 670, 2112, 2113, 665, 667, 660,
+ /* 2900 */ 1716, 1716, 1716, 2077, 1716, 666, 1716, 1716, 2109, 1716,
+ /* 2910 */ 1716, 2127, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 667,
+ /* 2920 */ 1716, 1716, 1716, 1716, 2077, 1716, 666, 1716, 1716, 1716,
+ /* 2930 */ 1716, 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716, 1716,
+ /* 2940 */ 2144, 2127, 1716, 348, 2110, 670, 2112, 2113, 665, 667,
+ /* 2950 */ 660, 1716, 1716, 1716, 2077, 1716, 666, 2108, 1716, 1716,
+ /* 2960 */ 1716, 2144, 1716, 1716, 344, 2110, 670, 2112, 2113, 665,
+ /* 2970 */ 1716, 660, 1716, 2109, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 2980 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 2108, 1716, 1716,
+ /* 2990 */ 1716, 2144, 1716, 1716, 349, 2110, 670, 2112, 2113, 665,
+ /* 3000 */ 1716, 660, 2109, 1716, 1716, 1716, 2127, 1716, 1716, 1716,
+ /* 3010 */ 1716, 1716, 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077,
+ /* 3020 */ 1716, 666, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 3030 */ 1716, 1716, 1716, 1716, 1716, 2127, 1716, 1716, 1716, 1716,
+ /* 3040 */ 1716, 1716, 1716, 667, 1716, 1716, 1716, 1716, 2077, 1716,
+ /* 3050 */ 666, 1716, 668, 1716, 1716, 1716, 2144, 1716, 1716, 324,
+ /* 3060 */ 2110, 670, 2112, 2113, 665, 1716, 660, 1716, 1716, 1716,
+ /* 3070 */ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ /* 3080 */ 1716, 2108, 1716, 1716, 1716, 2144, 1716, 1716, 323, 2110,
+ /* 3090 */ 670, 2112, 2113, 665, 1716, 660,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 379, 365, 356, 331, 339, 441, 339, 366, 425, 445,
- /* 10 */ 364, 428, 12, 13, 14, 394, 395, 371, 377, 373,
- /* 20 */ 20, 366, 22, 339, 460, 461, 380, 366, 14, 465,
- /* 30 */ 466, 0, 377, 33, 20, 35, 364, 20, 377, 12,
- /* 40 */ 13, 14, 15, 16, 372, 20, 381, 22, 20, 377,
- /* 50 */ 20, 379, 411, 412, 413, 388, 372, 390, 58, 364,
- /* 60 */ 35, 441, 364, 422, 64, 445, 411, 412, 413, 371,
- /* 70 */ 328, 71, 411, 412, 413, 380, 51, 422, 380, 48,
- /* 80 */ 408, 461, 364, 422, 412, 465, 466, 415, 416, 417,
- /* 90 */ 418, 419, 420, 4, 422, 346, 330, 97, 332, 427,
- /* 100 */ 100, 429, 353, 385, 386, 433, 434, 20, 8, 9,
- /* 110 */ 12, 13, 12, 13, 14, 15, 16, 100, 20, 447,
- /* 120 */ 22, 437, 438, 439, 364, 441, 442, 455, 100, 445,
- /* 130 */ 100, 33, 43, 35, 45, 46, 136, 137, 396, 441,
- /* 140 */ 396, 2, 400, 445, 460, 461, 386, 8, 9, 465,
- /* 150 */ 466, 12, 13, 14, 15, 16, 58, 375, 460, 461,
- /* 160 */ 378, 379, 64, 465, 466, 20, 166, 167, 331, 71,
- /* 170 */ 0, 21, 172, 173, 24, 25, 26, 27, 28, 29,
- /* 180 */ 30, 31, 32, 441, 379, 441, 186, 445, 188, 445,
- /* 190 */ 335, 20, 337, 338, 4, 97, 391, 35, 100, 394,
- /* 200 */ 395, 100, 460, 461, 460, 461, 20, 465, 466, 465,
- /* 210 */ 466, 110, 212, 213, 377, 215, 216, 217, 218, 219,
+ /* 0 */ 367, 333, 381, 398, 368, 367, 398, 402, 368, 332,
+ /* 10 */ 341, 334, 12, 13, 14, 379, 366, 396, 397, 379,
+ /* 20 */ 20, 445, 22, 8, 9, 449, 357, 12, 13, 14,
+ /* 30 */ 15, 16, 366, 33, 366, 35, 0, 387, 388, 373,
+ /* 40 */ 464, 465, 374, 374, 345, 469, 470, 379, 382, 381,
+ /* 50 */ 445, 415, 416, 445, 449, 415, 416, 449, 58, 20,
+ /* 60 */ 361, 445, 426, 365, 64, 449, 426, 381, 369, 464,
+ /* 70 */ 465, 71, 464, 465, 469, 470, 378, 469, 470, 393,
+ /* 80 */ 412, 465, 396, 397, 416, 469, 470, 419, 420, 421,
+ /* 90 */ 422, 423, 424, 425, 426, 427, 428, 97, 35, 20,
+ /* 100 */ 100, 14, 66, 67, 68, 69, 70, 20, 72, 73,
+ /* 110 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 20,
+ /* 130 */ 337, 97, 339, 340, 71, 21, 136, 137, 24, 25,
+ /* 140 */ 26, 27, 28, 29, 30, 31, 32, 113, 114, 115,
+ /* 150 */ 116, 117, 118, 119, 120, 121, 122, 20, 124, 125,
+ /* 160 */ 126, 127, 128, 129, 341, 100, 166, 167, 3, 20,
+ /* 170 */ 8, 9, 172, 173, 12, 13, 14, 15, 16, 100,
+ /* 180 */ 357, 337, 366, 339, 340, 20, 186, 364, 188, 373,
+ /* 190 */ 20, 434, 435, 178, 20, 8, 9, 374, 382, 12,
+ /* 200 */ 13, 14, 15, 16, 131, 8, 9, 168, 135, 12,
+ /* 210 */ 13, 14, 15, 16, 333, 215, 216, 20, 218, 219,
/* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
- /* 230 */ 230, 231, 232, 71, 136, 137, 66, 67, 68, 69,
- /* 240 */ 70, 20, 72, 73, 74, 75, 76, 77, 78, 79,
- /* 250 */ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- /* 260 */ 90, 91, 92, 441, 166, 167, 331, 445, 8, 9,
- /* 270 */ 172, 173, 12, 13, 14, 15, 16, 249, 178, 249,
- /* 280 */ 20, 136, 137, 461, 186, 112, 188, 465, 466, 63,
- /* 290 */ 100, 366, 336, 8, 9, 339, 340, 12, 13, 14,
- /* 300 */ 15, 16, 377, 130, 131, 132, 133, 134, 135, 20,
- /* 310 */ 212, 213, 377, 215, 216, 217, 218, 219, 220, 221,
- /* 320 */ 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
- /* 330 */ 232, 233, 12, 13, 0, 20, 411, 412, 364, 168,
- /* 340 */ 20, 97, 22, 20, 63, 371, 20, 422, 22, 64,
- /* 350 */ 171, 343, 58, 33, 380, 35, 343, 113, 114, 115,
- /* 360 */ 116, 117, 118, 119, 120, 121, 122, 359, 124, 125,
- /* 370 */ 126, 127, 128, 129, 274, 367, 2, 51, 58, 0,
- /* 380 */ 367, 331, 8, 9, 64, 111, 12, 13, 14, 15,
- /* 390 */ 16, 71, 20, 99, 109, 212, 102, 66, 67, 68,
- /* 400 */ 66, 67, 68, 331, 73, 74, 75, 73, 74, 75,
- /* 410 */ 79, 430, 431, 79, 364, 84, 85, 97, 84, 85,
- /* 420 */ 100, 90, 372, 335, 90, 337, 338, 377, 168, 379,
- /* 430 */ 12, 13, 14, 254, 255, 256, 345, 414, 20, 249,
- /* 440 */ 22, 22, 259, 260, 261, 262, 263, 264, 265, 377,
- /* 450 */ 165, 33, 361, 35, 35, 339, 136, 137, 408, 136,
- /* 460 */ 137, 370, 412, 440, 112, 415, 416, 417, 418, 419,
- /* 470 */ 420, 355, 422, 0, 339, 425, 58, 427, 428, 429,
- /* 480 */ 100, 166, 167, 433, 434, 133, 166, 167, 372, 71,
- /* 490 */ 355, 112, 172, 173, 21, 172, 173, 24, 25, 26,
- /* 500 */ 27, 28, 29, 30, 31, 32, 186, 372, 188, 130,
- /* 510 */ 131, 132, 133, 134, 135, 97, 97, 130, 100, 80,
- /* 520 */ 100, 236, 237, 238, 239, 240, 241, 242, 243, 244,
- /* 530 */ 245, 246, 212, 213, 0, 215, 216, 217, 218, 219,
- /* 540 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
- /* 550 */ 230, 231, 232, 396, 136, 137, 71, 400, 24, 25,
- /* 560 */ 26, 27, 28, 29, 30, 31, 32, 58, 336, 8,
- /* 570 */ 9, 339, 340, 12, 13, 14, 15, 16, 364, 331,
- /* 580 */ 141, 142, 195, 196, 166, 167, 339, 373, 8, 9,
- /* 590 */ 172, 173, 12, 13, 14, 15, 16, 3, 441, 111,
- /* 600 */ 364, 345, 445, 164, 186, 364, 188, 371, 426, 100,
- /* 610 */ 428, 102, 364, 372, 20, 363, 380, 460, 461, 372,
- /* 620 */ 372, 0, 465, 466, 44, 377, 370, 379, 376, 249,
- /* 630 */ 212, 213, 181, 215, 216, 217, 218, 219, 220, 221,
- /* 640 */ 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
- /* 650 */ 232, 12, 13, 396, 203, 204, 408, 339, 417, 20,
- /* 660 */ 412, 22, 101, 415, 416, 417, 418, 419, 420, 249,
- /* 670 */ 422, 339, 33, 355, 35, 427, 339, 429, 378, 379,
- /* 680 */ 362, 433, 434, 436, 437, 438, 439, 355, 441, 442,
- /* 690 */ 372, 4, 355, 414, 362, 101, 331, 58, 441, 111,
- /* 700 */ 331, 339, 445, 455, 372, 339, 19, 8, 9, 372,
- /* 710 */ 71, 12, 13, 14, 15, 16, 339, 460, 461, 440,
- /* 720 */ 33, 355, 465, 466, 14, 15, 16, 339, 131, 364,
- /* 730 */ 339, 339, 135, 112, 372, 48, 97, 372, 372, 100,
- /* 740 */ 53, 233, 377, 355, 379, 58, 377, 355, 160, 12,
- /* 750 */ 13, 130, 131, 132, 133, 134, 135, 20, 249, 22,
- /* 760 */ 372, 356, 168, 372, 372, 388, 339, 390, 366, 364,
- /* 770 */ 33, 396, 35, 408, 71, 136, 137, 412, 373, 377,
- /* 780 */ 415, 416, 417, 418, 419, 420, 99, 422, 365, 102,
- /* 790 */ 193, 194, 331, 339, 197, 58, 199, 331, 331, 437,
- /* 800 */ 438, 439, 356, 441, 442, 166, 167, 372, 71, 355,
- /* 810 */ 364, 172, 173, 411, 412, 388, 441, 390, 383, 373,
- /* 820 */ 445, 456, 457, 0, 422, 186, 372, 188, 437, 438,
- /* 830 */ 439, 364, 441, 442, 97, 460, 461, 100, 377, 372,
- /* 840 */ 465, 466, 14, 377, 377, 331, 379, 14, 20, 331,
- /* 850 */ 414, 212, 213, 20, 215, 216, 217, 218, 219, 220,
- /* 860 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
- /* 870 */ 231, 232, 365, 136, 137, 408, 440, 21, 331, 412,
- /* 880 */ 365, 339, 415, 416, 417, 418, 419, 420, 18, 422,
- /* 890 */ 34, 377, 36, 23, 427, 377, 429, 355, 365, 364,
- /* 900 */ 433, 434, 331, 166, 167, 331, 371, 37, 38, 172,
- /* 910 */ 173, 41, 8, 9, 372, 380, 12, 13, 14, 15,
- /* 920 */ 16, 130, 131, 186, 377, 188, 135, 37, 356, 59,
- /* 930 */ 60, 61, 62, 39, 8, 9, 364, 3, 12, 13,
- /* 940 */ 14, 15, 16, 331, 331, 373, 350, 351, 377, 212,
- /* 950 */ 213, 377, 215, 216, 217, 218, 219, 220, 221, 222,
- /* 960 */ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
- /* 970 */ 100, 18, 364, 20, 331, 350, 351, 364, 155, 371,
- /* 980 */ 27, 339, 4, 30, 339, 372, 33, 164, 380, 377,
- /* 990 */ 377, 22, 379, 103, 166, 105, 106, 355, 108, 166,
- /* 1000 */ 355, 48, 112, 50, 35, 101, 53, 364, 138, 365,
- /* 1010 */ 339, 339, 369, 0, 372, 372, 233, 372, 235, 20,
- /* 1020 */ 377, 408, 379, 133, 365, 412, 355, 355, 415, 416,
- /* 1030 */ 417, 418, 419, 420, 352, 422, 354, 331, 331, 100,
- /* 1040 */ 427, 20, 429, 372, 372, 331, 433, 434, 178, 179,
- /* 1050 */ 180, 408, 99, 183, 339, 412, 20, 444, 415, 416,
- /* 1060 */ 417, 418, 419, 420, 111, 422, 97, 1, 2, 22,
- /* 1070 */ 355, 331, 202, 0, 165, 205, 63, 207, 208, 209,
- /* 1080 */ 210, 211, 35, 377, 377, 331, 331, 372, 331, 331,
- /* 1090 */ 426, 377, 428, 140, 168, 22, 143, 144, 145, 146,
- /* 1100 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
- /* 1110 */ 157, 158, 159, 339, 161, 162, 163, 377, 71, 249,
- /* 1120 */ 339, 44, 364, 339, 185, 339, 187, 339, 401, 355,
- /* 1130 */ 372, 377, 377, 44, 377, 377, 355, 379, 331, 355,
- /* 1140 */ 372, 355, 248, 355, 97, 236, 372, 360, 372, 357,
- /* 1150 */ 211, 383, 360, 372, 374, 246, 372, 377, 372, 383,
- /* 1160 */ 372, 45, 46, 247, 248, 166, 408, 101, 0, 374,
- /* 1170 */ 412, 364, 377, 415, 416, 417, 418, 419, 420, 372,
- /* 1180 */ 422, 42, 44, 44, 377, 427, 379, 429, 249, 168,
- /* 1190 */ 101, 433, 434, 406, 22, 374, 0, 331, 377, 42,
- /* 1200 */ 44, 44, 444, 269, 168, 104, 104, 35, 107, 107,
- /* 1210 */ 104, 104, 44, 107, 107, 408, 136, 137, 22, 412,
- /* 1220 */ 331, 58, 415, 416, 417, 418, 419, 420, 250, 422,
- /* 1230 */ 364, 353, 44, 186, 427, 188, 429, 198, 372, 200,
- /* 1240 */ 433, 434, 0, 377, 35, 379, 44, 96, 1, 2,
- /* 1250 */ 332, 444, 387, 364, 64, 44, 44, 101, 13, 212,
- /* 1260 */ 213, 372, 469, 44, 22, 102, 377, 458, 379, 44,
- /* 1270 */ 44, 44, 44, 44, 408, 44, 35, 44, 412, 44,
- /* 1280 */ 35, 415, 416, 417, 418, 419, 420, 47, 422, 101,
- /* 1290 */ 44, 341, 44, 427, 44, 429, 44, 408, 331, 433,
- /* 1300 */ 434, 412, 44, 101, 415, 416, 417, 418, 419, 420,
- /* 1310 */ 444, 422, 101, 101, 12, 13, 427, 341, 429, 168,
- /* 1320 */ 101, 0, 433, 434, 22, 35, 101, 101, 101, 101,
- /* 1330 */ 101, 364, 101, 444, 101, 33, 101, 35, 452, 372,
- /* 1340 */ 100, 13, 387, 33, 377, 364, 379, 101, 271, 101,
- /* 1350 */ 338, 101, 387, 101, 443, 376, 435, 331, 48, 101,
- /* 1360 */ 58, 71, 462, 35, 54, 55, 56, 57, 58, 446,
- /* 1370 */ 49, 251, 410, 71, 48, 408, 184, 409, 398, 412,
- /* 1380 */ 331, 42, 415, 416, 417, 418, 419, 420, 384, 422,
- /* 1390 */ 364, 20, 387, 384, 427, 165, 429, 188, 372, 97,
- /* 1400 */ 433, 434, 212, 377, 382, 379, 20, 339, 339, 99,
- /* 1410 */ 382, 273, 102, 364, 384, 382, 98, 95, 339, 349,
- /* 1420 */ 348, 372, 347, 94, 339, 339, 377, 396, 379, 188,
- /* 1430 */ 339, 20, 333, 333, 408, 20, 20, 403, 412, 345,
- /* 1440 */ 379, 415, 416, 417, 418, 419, 420, 20, 422, 345,
- /* 1450 */ 340, 20, 397, 427, 345, 429, 345, 408, 340, 433,
- /* 1460 */ 434, 412, 331, 339, 415, 416, 417, 418, 419, 420,
- /* 1470 */ 345, 422, 441, 345, 345, 52, 445, 342, 429, 169,
- /* 1480 */ 170, 333, 433, 434, 174, 342, 176, 364, 186, 339,
- /* 1490 */ 188, 460, 461, 333, 364, 364, 465, 466, 364, 377,
- /* 1500 */ 364, 364, 192, 372, 364, 364, 364, 201, 377, 364,
- /* 1510 */ 379, 331, 407, 364, 212, 213, 364, 100, 405, 343,
- /* 1520 */ 403, 377, 191, 377, 343, 339, 379, 225, 226, 227,
- /* 1530 */ 228, 229, 230, 231, 331, 402, 377, 258, 451, 408,
- /* 1540 */ 387, 387, 257, 412, 364, 177, 415, 416, 417, 418,
- /* 1550 */ 419, 420, 372, 422, 392, 377, 392, 377, 266, 379,
- /* 1560 */ 429, 377, 377, 451, 433, 434, 451, 364, 454, 268,
- /* 1570 */ 267, 450, 453, 470, 448, 372, 449, 252, 248, 410,
- /* 1580 */ 377, 272, 379, 275, 270, 372, 20, 414, 408, 340,
- /* 1590 */ 339, 20, 412, 392, 390, 415, 416, 417, 418, 419,
- /* 1600 */ 420, 377, 422, 343, 343, 170, 331, 392, 343, 429,
- /* 1610 */ 389, 408, 343, 433, 434, 412, 377, 100, 415, 416,
- /* 1620 */ 417, 418, 419, 420, 421, 422, 423, 424, 463, 331,
- /* 1630 */ 464, 377, 377, 377, 377, 372, 360, 432, 100, 364,
- /* 1640 */ 368, 377, 354, 19, 339, 36, 334, 372, 333, 358,
- /* 1650 */ 343, 358, 377, 358, 379, 344, 329, 33, 399, 393,
- /* 1660 */ 393, 0, 364, 331, 0, 0, 404, 42, 0, 35,
- /* 1670 */ 372, 206, 48, 35, 35, 377, 35, 379, 54, 55,
- /* 1680 */ 56, 57, 58, 408, 206, 0, 35, 412, 35, 331,
- /* 1690 */ 415, 416, 417, 418, 419, 420, 364, 422, 206, 0,
- /* 1700 */ 206, 0, 35, 0, 372, 22, 408, 0, 35, 377,
- /* 1710 */ 412, 379, 193, 415, 416, 417, 418, 419, 420, 188,
- /* 1720 */ 422, 186, 364, 99, 0, 0, 102, 429, 0, 182,
- /* 1730 */ 372, 181, 434, 0, 0, 377, 47, 379, 0, 0,
- /* 1740 */ 408, 0, 467, 468, 412, 0, 42, 415, 416, 417,
- /* 1750 */ 418, 419, 420, 331, 422, 0, 0, 0, 134, 155,
- /* 1760 */ 0, 35, 155, 0, 0, 0, 408, 0, 0, 0,
- /* 1770 */ 412, 0, 0, 415, 416, 417, 418, 419, 420, 0,
- /* 1780 */ 422, 0, 0, 0, 0, 331, 364, 0, 0, 457,
- /* 1790 */ 0, 0, 0, 169, 372, 0, 0, 0, 174, 377,
- /* 1800 */ 42, 379, 0, 0, 0, 0, 0, 22, 0, 0,
- /* 1810 */ 331, 0, 0, 139, 190, 0, 192, 459, 364, 96,
- /* 1820 */ 22, 22, 0, 96, 58, 0, 372, 0, 35, 0,
- /* 1830 */ 408, 377, 58, 379, 412, 58, 0, 415, 416, 417,
- /* 1840 */ 418, 419, 420, 364, 422, 44, 0, 47, 369, 42,
- /* 1850 */ 0, 372, 39, 14, 14, 39, 377, 47, 379, 331,
- /* 1860 */ 40, 47, 408, 0, 0, 39, 412, 177, 0, 415,
- /* 1870 */ 416, 417, 418, 419, 420, 331, 422, 0, 424, 0,
- /* 1880 */ 0, 0, 65, 35, 39, 48, 0, 408, 35, 48,
- /* 1890 */ 468, 412, 364, 39, 415, 416, 417, 418, 419, 420,
- /* 1900 */ 372, 422, 0, 48, 35, 377, 39, 379, 364, 0,
- /* 1910 */ 35, 39, 0, 369, 48, 0, 372, 0, 0, 35,
- /* 1920 */ 0, 377, 22, 379, 331, 35, 107, 109, 35, 35,
- /* 1930 */ 35, 35, 44, 44, 35, 22, 408, 0, 35, 35,
- /* 1940 */ 412, 331, 0, 415, 416, 417, 418, 419, 420, 22,
- /* 1950 */ 422, 22, 408, 0, 22, 50, 412, 364, 331, 415,
- /* 1960 */ 416, 417, 418, 419, 420, 372, 422, 0, 35, 35,
- /* 1970 */ 377, 0, 379, 35, 364, 0, 22, 20, 35, 35,
- /* 1980 */ 35, 0, 372, 101, 35, 100, 0, 377, 22, 379,
- /* 1990 */ 0, 364, 168, 170, 0, 3, 175, 100, 168, 372,
- /* 2000 */ 44, 408, 168, 253, 377, 412, 379, 331, 415, 416,
- /* 2010 */ 417, 418, 419, 420, 44, 422, 100, 189, 408, 96,
- /* 2020 */ 101, 100, 412, 331, 98, 415, 416, 417, 418, 419,
- /* 2030 */ 420, 96, 422, 44, 95, 408, 3, 101, 47, 412,
- /* 2040 */ 364, 331, 415, 416, 417, 418, 419, 420, 372, 422,
- /* 2050 */ 44, 101, 100, 377, 47, 379, 364, 44, 100, 100,
- /* 2060 */ 44, 101, 100, 35, 372, 101, 101, 35, 47, 377,
- /* 2070 */ 35, 379, 35, 35, 364, 35, 47, 101, 101, 0,
- /* 2080 */ 44, 0, 372, 100, 408, 247, 253, 377, 412, 379,
- /* 2090 */ 331, 415, 416, 417, 418, 419, 420, 253, 422, 0,
- /* 2100 */ 408, 0, 39, 47, 412, 100, 331, 415, 416, 417,
- /* 2110 */ 418, 419, 420, 0, 422, 101, 101, 100, 408, 100,
- /* 2120 */ 100, 39, 412, 364, 169, 415, 416, 417, 418, 419,
- /* 2130 */ 420, 372, 422, 110, 100, 47, 377, 44, 379, 364,
- /* 2140 */ 171, 98, 234, 98, 2, 22, 100, 372, 101, 100,
- /* 2150 */ 47, 101, 377, 212, 379, 100, 47, 22, 101, 100,
- /* 2160 */ 100, 214, 101, 331, 100, 111, 101, 408, 35, 35,
- /* 2170 */ 100, 412, 101, 35, 415, 416, 417, 418, 419, 420,
- /* 2180 */ 331, 422, 35, 408, 100, 35, 101, 412, 101, 100,
- /* 2190 */ 415, 416, 417, 418, 419, 420, 364, 422, 100, 35,
- /* 2200 */ 123, 101, 100, 123, 372, 22, 112, 100, 100, 377,
- /* 2210 */ 44, 379, 35, 364, 123, 123, 100, 22, 65, 64,
- /* 2220 */ 35, 372, 35, 35, 35, 35, 377, 35, 379, 331,
- /* 2230 */ 71, 35, 93, 35, 35, 35, 35, 44, 35, 35,
- /* 2240 */ 408, 22, 35, 35, 412, 331, 35, 415, 416, 417,
- /* 2250 */ 418, 419, 420, 71, 422, 35, 35, 408, 35, 35,
- /* 2260 */ 35, 412, 364, 22, 415, 416, 417, 418, 419, 420,
- /* 2270 */ 372, 422, 35, 0, 35, 377, 48, 379, 364, 39,
- /* 2280 */ 0, 48, 35, 39, 0, 35, 372, 39, 0, 35,
- /* 2290 */ 48, 377, 39, 379, 331, 0, 35, 48, 35, 0,
- /* 2300 */ 22, 22, 21, 20, 22, 471, 408, 21, 471, 471,
- /* 2310 */ 412, 471, 471, 415, 416, 417, 418, 419, 420, 331,
- /* 2320 */ 422, 471, 408, 471, 471, 471, 412, 364, 471, 415,
- /* 2330 */ 416, 417, 418, 419, 420, 372, 422, 471, 471, 471,
- /* 2340 */ 377, 471, 379, 331, 471, 471, 471, 471, 471, 471,
- /* 2350 */ 471, 471, 364, 471, 471, 471, 471, 471, 471, 471,
- /* 2360 */ 372, 471, 471, 471, 471, 377, 471, 379, 471, 471,
- /* 2370 */ 471, 408, 471, 471, 471, 412, 364, 471, 415, 416,
- /* 2380 */ 417, 418, 419, 420, 372, 422, 471, 471, 471, 377,
- /* 2390 */ 471, 379, 471, 471, 471, 471, 408, 471, 471, 471,
- /* 2400 */ 412, 471, 471, 415, 416, 417, 418, 419, 420, 471,
- /* 2410 */ 422, 471, 471, 471, 331, 471, 471, 471, 471, 471,
- /* 2420 */ 408, 471, 471, 471, 412, 471, 471, 415, 416, 417,
- /* 2430 */ 418, 419, 420, 471, 422, 471, 331, 471, 471, 471,
- /* 2440 */ 471, 471, 471, 471, 471, 471, 471, 364, 471, 471,
- /* 2450 */ 471, 471, 471, 471, 471, 372, 471, 471, 471, 471,
- /* 2460 */ 377, 471, 379, 331, 471, 471, 471, 471, 471, 364,
- /* 2470 */ 471, 471, 471, 471, 471, 471, 471, 372, 471, 471,
- /* 2480 */ 471, 471, 377, 471, 379, 471, 471, 471, 471, 471,
- /* 2490 */ 471, 408, 471, 471, 471, 412, 364, 471, 415, 416,
- /* 2500 */ 417, 418, 419, 420, 372, 422, 471, 471, 471, 377,
- /* 2510 */ 471, 379, 331, 408, 471, 471, 471, 412, 471, 471,
- /* 2520 */ 415, 416, 417, 418, 419, 420, 471, 422, 331, 471,
- /* 2530 */ 471, 471, 471, 471, 471, 471, 471, 471, 471, 471,
- /* 2540 */ 408, 471, 471, 471, 412, 364, 471, 415, 416, 417,
- /* 2550 */ 418, 419, 420, 372, 422, 471, 471, 471, 377, 471,
- /* 2560 */ 379, 364, 471, 471, 471, 471, 471, 471, 471, 372,
- /* 2570 */ 471, 471, 471, 471, 377, 471, 379, 331, 471, 471,
- /* 2580 */ 471, 471, 471, 471, 471, 471, 471, 471, 471, 408,
- /* 2590 */ 471, 471, 471, 412, 471, 471, 415, 416, 417, 418,
- /* 2600 */ 419, 420, 471, 422, 471, 408, 471, 471, 471, 412,
- /* 2610 */ 364, 471, 415, 416, 417, 418, 419, 420, 372, 422,
- /* 2620 */ 471, 471, 471, 377, 471, 379, 471, 471, 471, 471,
- /* 2630 */ 471, 471, 471, 471, 471, 471, 471, 471, 471, 471,
- /* 2640 */ 471, 471, 471, 471, 471, 471, 471, 471, 471, 471,
- /* 2650 */ 471, 471, 471, 471, 408, 471, 471, 471, 412, 471,
- /* 2660 */ 471, 415, 416, 417, 418, 419, 420, 471, 422,
+ /* 230 */ 230, 231, 232, 233, 234, 235, 12, 13, 348, 63,
+ /* 240 */ 341, 18, 341, 20, 20, 355, 22, 366, 333, 100,
+ /* 250 */ 27, 64, 333, 30, 341, 374, 33, 33, 362, 35,
+ /* 260 */ 379, 445, 381, 101, 398, 449, 101, 100, 195, 196,
+ /* 270 */ 100, 48, 199, 50, 201, 374, 53, 20, 341, 368,
+ /* 280 */ 464, 465, 58, 1, 2, 469, 470, 374, 64, 390,
+ /* 290 */ 379, 392, 277, 412, 379, 71, 109, 416, 379, 20,
+ /* 300 */ 419, 420, 421, 422, 423, 424, 410, 426, 20, 58,
+ /* 310 */ 22, 445, 431, 347, 433, 449, 333, 252, 437, 438,
+ /* 320 */ 383, 97, 99, 35, 100, 347, 415, 416, 417, 363,
+ /* 330 */ 464, 465, 451, 168, 111, 469, 470, 426, 372, 51,
+ /* 340 */ 459, 440, 441, 442, 443, 0, 445, 446, 20, 366,
+ /* 350 */ 372, 100, 165, 102, 441, 442, 443, 374, 445, 446,
+ /* 360 */ 136, 137, 379, 140, 381, 168, 143, 144, 145, 146,
+ /* 370 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
+ /* 380 */ 157, 158, 159, 101, 161, 162, 163, 380, 381, 44,
+ /* 390 */ 166, 167, 333, 136, 137, 412, 172, 173, 21, 416,
+ /* 400 */ 358, 252, 419, 420, 421, 422, 423, 424, 366, 426,
+ /* 410 */ 186, 34, 188, 36, 431, 373, 433, 375, 171, 252,
+ /* 420 */ 437, 438, 252, 430, 382, 432, 239, 240, 241, 242,
+ /* 430 */ 243, 244, 245, 246, 247, 248, 249, 341, 379, 215,
+ /* 440 */ 216, 63, 218, 219, 220, 221, 222, 223, 224, 225,
+ /* 450 */ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235,
+ /* 460 */ 236, 12, 13, 377, 136, 137, 380, 381, 20, 20,
+ /* 470 */ 374, 22, 66, 67, 68, 215, 352, 353, 374, 73,
+ /* 480 */ 74, 75, 33, 130, 35, 79, 333, 33, 333, 385,
+ /* 490 */ 84, 85, 86, 87, 338, 20, 90, 341, 342, 0,
+ /* 500 */ 172, 173, 48, 252, 257, 258, 259, 58, 54, 55,
+ /* 510 */ 56, 57, 58, 64, 12, 13, 14, 15, 16, 341,
+ /* 520 */ 71, 366, 262, 263, 264, 265, 266, 267, 268, 374,
+ /* 530 */ 345, 341, 379, 4, 379, 357, 381, 441, 442, 443,
+ /* 540 */ 338, 445, 446, 341, 342, 449, 97, 100, 366, 100,
+ /* 550 */ 197, 198, 374, 99, 369, 373, 102, 14, 352, 353,
+ /* 560 */ 464, 465, 366, 20, 382, 469, 470, 412, 18, 0,
+ /* 570 */ 374, 416, 0, 23, 419, 420, 421, 422, 423, 424,
+ /* 580 */ 390, 426, 392, 3, 112, 136, 137, 37, 38, 181,
+ /* 590 */ 21, 41, 0, 24, 25, 26, 27, 28, 29, 30,
+ /* 600 */ 31, 32, 130, 131, 132, 133, 134, 135, 111, 59,
+ /* 610 */ 60, 61, 62, 205, 206, 166, 167, 421, 14, 15,
+ /* 620 */ 16, 172, 173, 169, 170, 236, 471, 472, 174, 100,
+ /* 630 */ 176, 112, 185, 366, 187, 186, 358, 188, 66, 67,
+ /* 640 */ 68, 166, 167, 341, 366, 73, 74, 75, 194, 368,
+ /* 650 */ 100, 79, 133, 375, 155, 388, 84, 85, 86, 87,
+ /* 660 */ 379, 214, 90, 164, 215, 216, 71, 218, 219, 220,
+ /* 670 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
+ /* 680 */ 231, 232, 233, 234, 235, 12, 13, 14, 138, 0,
+ /* 690 */ 333, 333, 390, 20, 392, 22, 415, 416, 417, 252,
+ /* 700 */ 236, 333, 238, 330, 112, 367, 33, 426, 35, 166,
+ /* 710 */ 20, 4, 22, 24, 25, 26, 27, 28, 29, 30,
+ /* 720 */ 31, 32, 130, 131, 132, 133, 134, 135, 178, 179,
+ /* 730 */ 180, 58, 341, 183, 366, 341, 379, 379, 45, 46,
+ /* 740 */ 333, 51, 374, 341, 71, 111, 80, 379, 357, 381,
+ /* 750 */ 43, 357, 45, 46, 204, 364, 22, 207, 71, 357,
+ /* 760 */ 210, 211, 212, 213, 214, 374, 368, 366, 374, 35,
+ /* 770 */ 97, 398, 22, 100, 373, 402, 374, 379, 0, 333,
+ /* 780 */ 412, 252, 47, 382, 416, 35, 379, 419, 420, 421,
+ /* 790 */ 422, 423, 424, 430, 426, 432, 367, 429, 14, 431,
+ /* 800 */ 432, 433, 252, 341, 20, 437, 438, 141, 142, 136,
+ /* 810 */ 137, 341, 366, 415, 416, 417, 366, 366, 445, 357,
+ /* 820 */ 374, 71, 449, 373, 426, 379, 375, 381, 130, 131,
+ /* 830 */ 164, 97, 382, 135, 58, 100, 374, 464, 465, 166,
+ /* 840 */ 167, 63, 469, 470, 374, 172, 173, 97, 341, 8,
+ /* 850 */ 9, 20, 272, 12, 13, 14, 15, 16, 412, 186,
+ /* 860 */ 22, 188, 416, 358, 357, 419, 420, 421, 422, 423,
+ /* 870 */ 424, 366, 426, 35, 333, 99, 20, 431, 102, 433,
+ /* 880 */ 375, 374, 333, 437, 438, 44, 398, 165, 215, 216,
+ /* 890 */ 4, 218, 219, 220, 221, 222, 223, 224, 225, 226,
+ /* 900 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 12,
+ /* 910 */ 13, 441, 442, 443, 358, 445, 446, 20, 341, 22,
+ /* 920 */ 379, 333, 366, 403, 250, 251, 341, 333, 379, 111,
+ /* 930 */ 33, 375, 35, 445, 357, 97, 186, 449, 188, 8,
+ /* 940 */ 9, 4, 357, 12, 13, 14, 15, 16, 418, 367,
+ /* 950 */ 166, 374, 464, 465, 366, 58, 19, 469, 470, 374,
+ /* 960 */ 333, 239, 374, 418, 0, 215, 216, 379, 71, 381,
+ /* 970 */ 33, 249, 333, 379, 444, 8, 9, 374, 160, 12,
+ /* 980 */ 13, 14, 15, 16, 354, 48, 356, 341, 385, 444,
+ /* 990 */ 53, 333, 39, 44, 97, 58, 333, 100, 333, 168,
+ /* 1000 */ 412, 20, 333, 357, 416, 333, 379, 419, 420, 421,
+ /* 1010 */ 422, 423, 424, 333, 426, 333, 333, 2, 379, 431,
+ /* 1020 */ 374, 433, 166, 8, 9, 437, 438, 12, 13, 14,
+ /* 1030 */ 15, 16, 101, 136, 137, 0, 99, 379, 366, 102,
+ /* 1040 */ 429, 341, 379, 432, 379, 374, 374, 459, 379, 341,
+ /* 1050 */ 101, 379, 366, 381, 22, 418, 385, 357, 42, 379,
+ /* 1060 */ 44, 379, 379, 166, 167, 357, 2, 35, 382, 172,
+ /* 1070 */ 173, 341, 8, 9, 374, 44, 12, 13, 14, 15,
+ /* 1080 */ 16, 444, 374, 186, 412, 188, 376, 357, 416, 379,
+ /* 1090 */ 0, 419, 420, 421, 422, 423, 424, 376, 426, 376,
+ /* 1100 */ 379, 44, 379, 431, 374, 433, 44, 333, 359, 437,
+ /* 1110 */ 438, 362, 215, 216, 13, 218, 219, 220, 221, 222,
+ /* 1120 */ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
+ /* 1130 */ 233, 234, 235, 12, 13, 168, 35, 96, 48, 253,
+ /* 1140 */ 366, 20, 341, 22, 200, 341, 202, 112, 374, 168,
+ /* 1150 */ 42, 44, 44, 379, 33, 381, 35, 104, 357, 398,
+ /* 1160 */ 107, 357, 367, 101, 367, 130, 131, 132, 133, 134,
+ /* 1170 */ 135, 104, 37, 209, 107, 374, 8, 9, 374, 58,
+ /* 1180 */ 12, 13, 14, 15, 16, 104, 412, 341, 107, 58,
+ /* 1190 */ 416, 44, 71, 419, 420, 421, 422, 423, 424, 341,
+ /* 1200 */ 426, 341, 355, 357, 251, 431, 445, 433, 101, 168,
+ /* 1210 */ 449, 437, 438, 333, 35, 357, 44, 357, 97, 341,
+ /* 1220 */ 374, 100, 448, 0, 104, 464, 465, 107, 0, 44,
+ /* 1230 */ 469, 470, 374, 102, 374, 357, 333, 35, 103, 100,
+ /* 1240 */ 105, 106, 0, 108, 13, 22, 366, 112, 101, 110,
+ /* 1250 */ 22, 445, 374, 44, 374, 449, 334, 136, 137, 379,
+ /* 1260 */ 389, 381, 136, 137, 22, 473, 35, 13, 133, 366,
+ /* 1270 */ 462, 465, 64, 101, 44, 469, 470, 374, 44, 1,
+ /* 1280 */ 2, 44, 379, 343, 381, 456, 101, 166, 167, 35,
+ /* 1290 */ 366, 343, 412, 172, 173, 389, 416, 340, 35, 419,
+ /* 1300 */ 420, 421, 422, 423, 424, 274, 426, 186, 44, 188,
+ /* 1310 */ 101, 44, 378, 433, 44, 412, 44, 437, 438, 416,
+ /* 1320 */ 44, 44, 419, 420, 421, 422, 423, 424, 333, 426,
+ /* 1330 */ 389, 101, 44, 276, 71, 101, 215, 216, 101, 218,
+ /* 1340 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
+ /* 1350 */ 229, 230, 231, 232, 233, 234, 235, 13, 447, 466,
+ /* 1360 */ 439, 366, 450, 460, 461, 101, 254, 188, 101, 374,
+ /* 1370 */ 44, 101, 44, 101, 379, 414, 381, 101, 101, 35,
+ /* 1380 */ 44, 0, 48, 413, 184, 400, 386, 42, 20, 101,
+ /* 1390 */ 188, 389, 386, 384, 165, 341, 20, 341, 333, 386,
+ /* 1400 */ 98, 384, 384, 351, 95, 350, 94, 412, 349, 341,
+ /* 1410 */ 341, 416, 341, 341, 419, 420, 421, 422, 423, 424,
+ /* 1420 */ 20, 426, 335, 215, 335, 20, 431, 101, 433, 101,
+ /* 1430 */ 49, 366, 437, 438, 407, 347, 20, 101, 347, 374,
+ /* 1440 */ 20, 381, 342, 448, 379, 20, 381, 399, 342, 333,
+ /* 1450 */ 347, 347, 347, 52, 341, 344, 347, 347, 344, 335,
+ /* 1460 */ 366, 366, 366, 366, 366, 366, 341, 335, 366, 203,
+ /* 1470 */ 100, 379, 379, 192, 411, 409, 406, 412, 345, 405,
+ /* 1480 */ 407, 416, 366, 366, 419, 420, 421, 422, 423, 424,
+ /* 1490 */ 374, 426, 191, 366, 366, 379, 431, 381, 433, 12,
+ /* 1500 */ 13, 379, 437, 438, 366, 345, 190, 341, 389, 22,
+ /* 1510 */ 381, 261, 389, 448, 269, 379, 455, 260, 177, 404,
+ /* 1520 */ 33, 379, 35, 379, 333, 379, 271, 278, 412, 270,
+ /* 1530 */ 455, 394, 416, 457, 394, 419, 420, 421, 422, 423,
+ /* 1540 */ 424, 458, 426, 275, 255, 58, 468, 431, 273, 433,
+ /* 1550 */ 251, 474, 467, 437, 438, 374, 20, 366, 71, 414,
+ /* 1560 */ 341, 418, 342, 345, 448, 374, 345, 20, 392, 394,
+ /* 1570 */ 379, 379, 381, 455, 379, 379, 379, 379, 394, 170,
+ /* 1580 */ 379, 391, 100, 453, 97, 345, 362, 374, 454, 345,
+ /* 1590 */ 436, 379, 100, 452, 356, 370, 345, 341, 36, 395,
+ /* 1600 */ 401, 336, 408, 412, 335, 395, 360, 416, 360, 1,
+ /* 1610 */ 419, 420, 421, 422, 423, 424, 331, 426, 360, 346,
+ /* 1620 */ 0, 0, 431, 0, 433, 42, 0, 19, 437, 438,
+ /* 1630 */ 35, 208, 35, 35, 35, 208, 0, 35, 35, 448,
+ /* 1640 */ 208, 33, 0, 333, 208, 0, 35, 0, 0, 22,
+ /* 1650 */ 35, 195, 188, 186, 0, 0, 48, 0, 182, 181,
+ /* 1660 */ 0, 0, 54, 55, 56, 57, 58, 0, 0, 47,
+ /* 1670 */ 0, 42, 0, 186, 0, 188, 366, 155, 35, 0,
+ /* 1680 */ 155, 0, 0, 0, 374, 0, 0, 0, 0, 379,
+ /* 1690 */ 0, 381, 0, 0, 0, 0, 0, 0, 0, 0,
+ /* 1700 */ 0, 0, 215, 216, 0, 0, 0, 99, 333, 0,
+ /* 1710 */ 102, 42, 0, 0, 0, 228, 229, 230, 231, 232,
+ /* 1720 */ 233, 234, 412, 0, 0, 0, 416, 0, 0, 419,
+ /* 1730 */ 420, 421, 422, 423, 424, 0, 426, 22, 0, 139,
+ /* 1740 */ 0, 366, 134, 433, 22, 96, 96, 437, 438, 374,
+ /* 1750 */ 0, 22, 35, 0, 379, 0, 381, 0, 0, 39,
+ /* 1760 */ 58, 42, 44, 47, 0, 58, 58, 0, 14, 39,
+ /* 1770 */ 14, 0, 0, 333, 40, 39, 0, 169, 47, 47,
+ /* 1780 */ 0, 0, 174, 177, 0, 0, 65, 412, 39, 48,
+ /* 1790 */ 0, 416, 48, 0, 419, 420, 421, 422, 423, 424,
+ /* 1800 */ 35, 426, 194, 35, 35, 39, 366, 48, 433, 39,
+ /* 1810 */ 0, 48, 437, 438, 374, 0, 39, 35, 0, 379,
+ /* 1820 */ 0, 381, 0, 35, 333, 22, 0, 35, 22, 35,
+ /* 1830 */ 44, 35, 35, 35, 35, 109, 35, 35, 0, 35,
+ /* 1840 */ 107, 22, 35, 333, 44, 0, 22, 0, 35, 22,
+ /* 1850 */ 0, 35, 412, 0, 0, 50, 416, 366, 35, 419,
+ /* 1860 */ 420, 421, 422, 423, 424, 374, 426, 35, 22, 20,
+ /* 1870 */ 379, 35, 381, 433, 35, 100, 366, 0, 438, 101,
+ /* 1880 */ 22, 0, 193, 100, 374, 22, 35, 0, 0, 379,
+ /* 1890 */ 256, 381, 3, 256, 3, 256, 44, 0, 0, 189,
+ /* 1900 */ 44, 44, 35, 412, 95, 168, 44, 416, 100, 170,
+ /* 1910 */ 419, 420, 421, 422, 423, 424, 168, 426, 333, 168,
+ /* 1920 */ 175, 100, 412, 47, 96, 47, 416, 98, 44, 419,
+ /* 1930 */ 420, 421, 422, 423, 424, 101, 426, 333, 96, 44,
+ /* 1940 */ 35, 101, 101, 100, 100, 35, 35, 35, 100, 35,
+ /* 1950 */ 47, 366, 461, 44, 47, 0, 101, 0, 171, 374,
+ /* 1960 */ 100, 250, 101, 39, 379, 101, 381, 101, 47, 101,
+ /* 1970 */ 366, 100, 100, 463, 101, 371, 101, 0, 374, 100,
+ /* 1980 */ 100, 39, 100, 379, 110, 381, 169, 47, 44, 237,
+ /* 1990 */ 2, 98, 100, 22, 98, 101, 47, 412, 47, 100,
+ /* 2000 */ 100, 416, 101, 101, 419, 420, 421, 422, 423, 424,
+ /* 2010 */ 333, 426, 22, 100, 35, 100, 412, 100, 35, 101,
+ /* 2020 */ 416, 35, 100, 419, 420, 421, 422, 423, 424, 215,
+ /* 2030 */ 426, 111, 101, 100, 35, 101, 333, 100, 35, 101,
+ /* 2040 */ 101, 100, 35, 366, 101, 100, 100, 217, 123, 123,
+ /* 2050 */ 123, 374, 123, 22, 100, 44, 379, 472, 381, 112,
+ /* 2060 */ 100, 35, 100, 22, 35, 65, 64, 35, 35, 366,
+ /* 2070 */ 35, 35, 71, 35, 371, 35, 22, 374, 35, 35,
+ /* 2080 */ 35, 35, 379, 44, 381, 93, 35, 35, 35, 412,
+ /* 2090 */ 35, 35, 71, 416, 35, 35, 419, 420, 421, 422,
+ /* 2100 */ 423, 424, 35, 426, 35, 428, 35, 333, 22, 35,
+ /* 2110 */ 0, 35, 48, 0, 39, 412, 35, 39, 48, 416,
+ /* 2120 */ 0, 48, 419, 420, 421, 422, 423, 424, 333, 426,
+ /* 2130 */ 35, 39, 0, 48, 35, 39, 0, 35, 35, 0,
+ /* 2140 */ 366, 22, 21, 20, 22, 371, 22, 21, 374, 475,
+ /* 2150 */ 475, 475, 475, 379, 475, 381, 475, 475, 333, 475,
+ /* 2160 */ 475, 366, 475, 475, 475, 475, 475, 475, 475, 374,
+ /* 2170 */ 475, 475, 475, 475, 379, 475, 381, 475, 475, 475,
+ /* 2180 */ 475, 475, 475, 475, 475, 475, 412, 475, 475, 475,
+ /* 2190 */ 416, 366, 475, 419, 420, 421, 422, 423, 424, 374,
+ /* 2200 */ 426, 475, 475, 475, 379, 475, 381, 412, 475, 475,
+ /* 2210 */ 475, 416, 475, 475, 419, 420, 421, 422, 423, 424,
+ /* 2220 */ 475, 426, 475, 333, 475, 475, 475, 475, 475, 475,
+ /* 2230 */ 475, 475, 475, 475, 475, 475, 475, 412, 475, 475,
+ /* 2240 */ 475, 416, 475, 475, 419, 420, 421, 422, 423, 424,
+ /* 2250 */ 475, 426, 333, 475, 475, 475, 366, 475, 475, 475,
+ /* 2260 */ 475, 475, 475, 475, 374, 475, 475, 475, 475, 379,
+ /* 2270 */ 475, 381, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2280 */ 475, 475, 475, 475, 475, 366, 333, 475, 475, 475,
+ /* 2290 */ 475, 475, 475, 374, 475, 475, 475, 475, 379, 475,
+ /* 2300 */ 381, 475, 412, 475, 475, 475, 416, 475, 475, 419,
+ /* 2310 */ 420, 421, 422, 423, 424, 475, 426, 475, 475, 366,
+ /* 2320 */ 475, 475, 475, 475, 475, 475, 475, 374, 475, 475,
+ /* 2330 */ 475, 412, 379, 475, 381, 416, 475, 475, 419, 420,
+ /* 2340 */ 421, 422, 423, 424, 475, 426, 475, 475, 475, 475,
+ /* 2350 */ 333, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2360 */ 475, 475, 475, 475, 475, 412, 475, 475, 475, 416,
+ /* 2370 */ 333, 475, 419, 420, 421, 422, 423, 424, 475, 426,
+ /* 2380 */ 475, 475, 475, 366, 475, 475, 475, 475, 475, 475,
+ /* 2390 */ 475, 374, 475, 475, 475, 475, 379, 475, 381, 475,
+ /* 2400 */ 475, 475, 475, 366, 475, 475, 475, 475, 475, 475,
+ /* 2410 */ 475, 374, 475, 475, 475, 475, 379, 475, 381, 475,
+ /* 2420 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 412,
+ /* 2430 */ 475, 333, 475, 416, 475, 475, 419, 420, 421, 422,
+ /* 2440 */ 423, 424, 475, 426, 475, 475, 475, 475, 475, 412,
+ /* 2450 */ 475, 475, 475, 416, 475, 475, 419, 420, 421, 422,
+ /* 2460 */ 423, 424, 475, 426, 366, 475, 475, 475, 475, 475,
+ /* 2470 */ 475, 475, 374, 475, 475, 475, 475, 379, 475, 381,
+ /* 2480 */ 475, 475, 333, 475, 475, 475, 475, 475, 475, 475,
+ /* 2490 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2500 */ 475, 475, 475, 333, 475, 475, 475, 475, 475, 475,
+ /* 2510 */ 412, 475, 475, 475, 416, 366, 475, 419, 420, 421,
+ /* 2520 */ 422, 423, 424, 374, 426, 475, 475, 475, 379, 475,
+ /* 2530 */ 381, 475, 475, 333, 475, 475, 366, 475, 475, 475,
+ /* 2540 */ 475, 475, 475, 475, 374, 475, 475, 475, 475, 379,
+ /* 2550 */ 475, 381, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2560 */ 475, 412, 475, 475, 475, 416, 366, 475, 419, 420,
+ /* 2570 */ 421, 422, 423, 424, 374, 426, 475, 475, 475, 379,
+ /* 2580 */ 475, 381, 412, 475, 475, 475, 416, 475, 475, 419,
+ /* 2590 */ 420, 421, 422, 423, 424, 475, 426, 475, 333, 475,
+ /* 2600 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2610 */ 475, 475, 412, 475, 475, 475, 416, 475, 475, 419,
+ /* 2620 */ 420, 421, 422, 423, 424, 475, 426, 333, 475, 475,
+ /* 2630 */ 475, 366, 475, 475, 475, 475, 475, 475, 475, 374,
+ /* 2640 */ 475, 475, 475, 475, 379, 475, 381, 475, 475, 475,
+ /* 2650 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2660 */ 366, 333, 475, 475, 475, 475, 475, 475, 374, 475,
+ /* 2670 */ 475, 475, 475, 379, 475, 381, 475, 412, 475, 475,
+ /* 2680 */ 475, 416, 475, 475, 419, 420, 421, 422, 423, 424,
+ /* 2690 */ 475, 426, 475, 475, 366, 475, 475, 475, 475, 475,
+ /* 2700 */ 475, 475, 374, 475, 475, 475, 412, 379, 475, 381,
+ /* 2710 */ 416, 475, 475, 419, 420, 421, 422, 423, 424, 475,
+ /* 2720 */ 426, 475, 475, 475, 475, 333, 475, 475, 475, 475,
+ /* 2730 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2740 */ 412, 475, 475, 475, 416, 333, 475, 419, 420, 421,
+ /* 2750 */ 422, 423, 424, 475, 426, 475, 475, 475, 366, 475,
+ /* 2760 */ 475, 475, 475, 475, 475, 475, 374, 475, 475, 475,
+ /* 2770 */ 475, 379, 475, 381, 475, 475, 475, 475, 366, 475,
+ /* 2780 */ 475, 475, 475, 475, 475, 475, 374, 475, 475, 475,
+ /* 2790 */ 475, 379, 475, 381, 475, 475, 475, 475, 475, 475,
+ /* 2800 */ 475, 475, 475, 475, 412, 475, 333, 475, 416, 475,
+ /* 2810 */ 475, 419, 420, 421, 422, 423, 424, 475, 426, 475,
+ /* 2820 */ 475, 475, 475, 475, 412, 475, 475, 475, 416, 475,
+ /* 2830 */ 475, 419, 420, 421, 422, 423, 424, 475, 426, 366,
+ /* 2840 */ 475, 475, 475, 475, 475, 475, 475, 374, 475, 475,
+ /* 2850 */ 475, 475, 379, 475, 381, 475, 475, 333, 475, 475,
+ /* 2860 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 2870 */ 475, 475, 475, 475, 475, 475, 475, 475, 333, 475,
+ /* 2880 */ 475, 475, 475, 475, 475, 412, 475, 475, 475, 416,
+ /* 2890 */ 366, 475, 419, 420, 421, 422, 423, 424, 374, 426,
+ /* 2900 */ 475, 475, 475, 379, 475, 381, 475, 475, 333, 475,
+ /* 2910 */ 475, 366, 475, 475, 475, 475, 475, 475, 475, 374,
+ /* 2920 */ 475, 475, 475, 475, 379, 475, 381, 475, 475, 475,
+ /* 2930 */ 475, 475, 475, 475, 475, 475, 412, 475, 475, 475,
+ /* 2940 */ 416, 366, 475, 419, 420, 421, 422, 423, 424, 374,
+ /* 2950 */ 426, 475, 475, 475, 379, 475, 381, 412, 475, 475,
+ /* 2960 */ 475, 416, 475, 475, 419, 420, 421, 422, 423, 424,
+ /* 2970 */ 475, 426, 475, 333, 475, 475, 475, 475, 475, 475,
+ /* 2980 */ 475, 475, 475, 475, 475, 475, 475, 412, 475, 475,
+ /* 2990 */ 475, 416, 475, 475, 419, 420, 421, 422, 423, 424,
+ /* 3000 */ 475, 426, 333, 475, 475, 475, 366, 475, 475, 475,
+ /* 3010 */ 475, 475, 475, 475, 374, 475, 475, 475, 475, 379,
+ /* 3020 */ 475, 381, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 3030 */ 475, 475, 475, 475, 475, 366, 475, 475, 475, 475,
+ /* 3040 */ 475, 475, 475, 374, 475, 475, 475, 475, 379, 475,
+ /* 3050 */ 381, 475, 412, 475, 475, 475, 416, 475, 475, 419,
+ /* 3060 */ 420, 421, 422, 423, 424, 475, 426, 475, 475, 475,
+ /* 3070 */ 475, 475, 475, 475, 475, 475, 475, 475, 475, 475,
+ /* 3080 */ 475, 412, 475, 475, 475, 416, 475, 475, 419, 420,
+ /* 3090 */ 421, 422, 423, 424, 475, 426,
};
-#define YY_SHIFT_COUNT (751)
+#define YY_SHIFT_COUNT (760)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (2299)
+#define YY_SHIFT_MAX (2139)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 870, 0, 98, 0, 320, 320, 320, 320, 320, 320,
- /* 10 */ 320, 320, 320, 320, 320, 418, 639, 639, 737, 639,
- /* 20 */ 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
- /* 30 */ 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
- /* 40 */ 639, 639, 639, 639, 639, 639, 639, 639, 28, 30,
- /* 50 */ 939, 17, 509, 380, 420, 380, 17, 17, 1302, 1302,
- /* 60 */ 1302, 380, 1302, 1302, 190, 380, 87, 323, 186, 186,
- /* 70 */ 323, 89, 89, 315, 145, 14, 14, 186, 186, 186,
- /* 80 */ 186, 186, 186, 186, 221, 186, 186, 226, 87, 186,
- /* 90 */ 186, 289, 186, 87, 186, 221, 186, 221, 87, 186,
- /* 100 */ 186, 87, 186, 87, 87, 87, 186, 281, 953, 285,
- /* 110 */ 285, 331, 150, 1047, 1047, 1047, 1047, 1047, 1047, 1047,
- /* 120 */ 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047,
- /* 130 */ 1047, 1047, 890, 594, 315, 145, 162, 171, 171, 171,
- /* 140 */ 1013, 783, 783, 162, 372, 372, 372, 226, 274, 508,
- /* 150 */ 87, 485, 87, 485, 485, 488, 703, 244, 244, 244,
- /* 160 */ 244, 244, 244, 244, 244, 1624, 334, 473, 260, 100,
- /* 170 */ 183, 25, 179, 828, 833, 326, 1021, 1116, 352, 1036,
- /* 180 */ 916, 894, 934, 916, 1139, 978, 999, 1120, 1326, 1192,
- /* 190 */ 1339, 1371, 1339, 1230, 1386, 1386, 1339, 1230, 1230, 1318,
- /* 200 */ 1322, 1386, 1329, 1386, 1386, 1386, 1411, 1411, 1415, 226,
- /* 210 */ 1416, 226, 1427, 1431, 226, 1427, 226, 226, 226, 1386,
- /* 220 */ 226, 1423, 1423, 1411, 87, 87, 87, 87, 87, 87,
- /* 230 */ 87, 87, 87, 87, 87, 1386, 1411, 485, 485, 485,
- /* 240 */ 1306, 1417, 1415, 281, 1331, 1416, 281, 1386, 1371, 1371,
- /* 250 */ 485, 1279, 1285, 485, 1279, 1285, 485, 485, 87, 1292,
- /* 260 */ 1368, 1279, 1301, 1303, 1325, 1120, 1308, 1309, 1314, 1330,
- /* 270 */ 372, 1566, 1386, 1427, 281, 281, 1571, 1285, 485, 485,
- /* 280 */ 485, 485, 485, 1285, 485, 1435, 281, 488, 281, 372,
- /* 290 */ 1517, 1538, 485, 703, 1386, 281, 1609, 1411, 2669, 2669,
- /* 300 */ 2669, 2669, 2669, 2669, 2669, 2669, 2669, 170, 1310, 534,
- /* 310 */ 687, 561, 580, 904, 379, 139, 374, 926, 621, 699,
- /* 320 */ 699, 699, 699, 699, 699, 699, 699, 699, 173, 597,
- /* 330 */ 27, 27, 439, 451, 823, 294, 419, 969, 856, 387,
- /* 340 */ 791, 791, 710, 1066, 909, 710, 710, 710, 31, 1089,
- /* 350 */ 1172, 1157, 588, 1168, 1101, 1102, 1106, 1107, 1073, 1196,
- /* 360 */ 1242, 1039, 1156, 1188, 1163, 1202, 1211, 1212, 1080, 1077,
- /* 370 */ 1138, 1151, 1219, 1225, 1226, 1227, 1228, 1229, 1247, 1231,
- /* 380 */ 1209, 1241, 1190, 1233, 1240, 1235, 1246, 1248, 1250, 1252,
- /* 390 */ 1258, 101, 1245, 1328, 1290, 1321, 1661, 1664, 1665, 1625,
- /* 400 */ 1668, 1634, 1465, 1638, 1639, 1641, 1478, 1685, 1651, 1653,
- /* 410 */ 1492, 1699, 1494, 1701, 1667, 1703, 1683, 1707, 1673, 1519,
- /* 420 */ 1531, 1535, 1724, 1725, 1728, 1547, 1550, 1733, 1734, 1689,
- /* 430 */ 1738, 1739, 1741, 1704, 1745, 1755, 1756, 1757, 1767, 1768,
- /* 440 */ 1769, 1771, 1604, 1726, 1760, 1607, 1763, 1764, 1765, 1772,
- /* 450 */ 1779, 1781, 1782, 1783, 1784, 1787, 1788, 1790, 1791, 1792,
- /* 460 */ 1795, 1796, 1758, 1797, 1802, 1803, 1804, 1805, 1806, 1785,
- /* 470 */ 1808, 1809, 1811, 1674, 1812, 1815, 1798, 1723, 1799, 1727,
- /* 480 */ 1822, 1766, 1793, 1825, 1774, 1827, 1777, 1829, 1836, 1807,
- /* 490 */ 1813, 1801, 1800, 1839, 1810, 1840, 1814, 1846, 1820, 1816,
- /* 500 */ 1850, 1863, 1864, 1826, 1690, 1868, 1877, 1879, 1817, 1880,
- /* 510 */ 1881, 1848, 1837, 1845, 1886, 1853, 1841, 1854, 1902, 1869,
- /* 520 */ 1855, 1867, 1909, 1875, 1866, 1872, 1912, 1915, 1917, 1918,
- /* 530 */ 1818, 1819, 1884, 1900, 1920, 1890, 1893, 1894, 1895, 1896,
- /* 540 */ 1888, 1889, 1899, 1903, 1913, 1904, 1937, 1927, 1942, 1929,
- /* 550 */ 1905, 1953, 1932, 1933, 1967, 1934, 1971, 1938, 1975, 1954,
- /* 560 */ 1957, 1943, 1944, 1945, 1882, 1885, 1981, 1824, 1897, 1949,
- /* 570 */ 1986, 1828, 1966, 1830, 1823, 1990, 1994, 1834, 1821, 1992,
- /* 580 */ 1956, 1750, 1916, 1919, 1921, 1923, 1926, 1935, 1939, 1936,
- /* 590 */ 1970, 1989, 1950, 1952, 1958, 1959, 1960, 2006, 1991, 2007,
- /* 600 */ 1962, 2013, 1833, 1964, 1965, 2033, 2016, 1844, 2028, 2032,
- /* 610 */ 2035, 2037, 2038, 2040, 1976, 1977, 2021, 1838, 2036, 2029,
- /* 620 */ 2079, 2081, 2099, 2101, 1983, 2063, 1800, 2056, 2005, 2014,
- /* 630 */ 2015, 2017, 2019, 1969, 2020, 2113, 2082, 1955, 2034, 2023,
- /* 640 */ 1800, 2088, 2093, 2043, 1908, 2045, 2142, 2123, 1941, 2046,
- /* 650 */ 2047, 2049, 2050, 2055, 2057, 2103, 2059, 2060, 2109, 2061,
- /* 660 */ 2135, 1947, 2064, 2054, 2065, 2133, 2134, 2070, 2071, 2138,
- /* 670 */ 2084, 2085, 2147, 2089, 2087, 2150, 2098, 2100, 2164, 2102,
- /* 680 */ 2077, 2080, 2091, 2092, 2183, 2094, 2107, 2166, 2108, 2177,
- /* 690 */ 2116, 2166, 2166, 2195, 2153, 2155, 2185, 2187, 2188, 2189,
- /* 700 */ 2190, 2192, 2196, 2198, 2199, 2200, 2159, 2139, 2193, 2201,
- /* 710 */ 2203, 2204, 2219, 2207, 2208, 2211, 2182, 1888, 2220, 1889,
- /* 720 */ 2221, 2223, 2224, 2225, 2241, 2237, 2273, 2239, 2228, 2240,
- /* 730 */ 2280, 2247, 2233, 2244, 2284, 2250, 2242, 2248, 2288, 2254,
- /* 740 */ 2249, 2253, 2295, 2261, 2263, 2299, 2278, 2281, 2279, 2282,
- /* 750 */ 2286, 2283,
+ /* 0 */ 550, 0, 224, 0, 449, 449, 449, 449, 449, 449,
+ /* 10 */ 449, 449, 449, 449, 449, 673, 897, 897, 1121, 897,
+ /* 20 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+ /* 30 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+ /* 40 */ 897, 897, 897, 897, 897, 897, 897, 897, 149, 170,
+ /* 50 */ 447, 79, 251, 65, 167, 65, 79, 79, 1487, 1487,
+ /* 60 */ 1487, 65, 1487, 1487, 529, 65, 109, 328, 137, 137,
+ /* 70 */ 328, 707, 707, 475, 257, 87, 87, 137, 137, 137,
+ /* 80 */ 137, 137, 137, 137, 174, 137, 137, 176, 109, 137,
+ /* 90 */ 137, 279, 137, 109, 137, 174, 137, 174, 109, 137,
+ /* 100 */ 137, 109, 137, 109, 109, 109, 137, 378, 223, 187,
+ /* 110 */ 187, 406, 114, 750, 750, 750, 750, 750, 750, 750,
+ /* 120 */ 750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
+ /* 130 */ 750, 750, 1135, 165, 475, 257, 63, 39, 39, 39,
+ /* 140 */ 778, 464, 464, 63, 448, 448, 448, 176, 497, 389,
+ /* 150 */ 109, 595, 109, 595, 595, 634, 687, 34, 34, 34,
+ /* 160 */ 34, 34, 34, 34, 34, 1608, 572, 569, 197, 15,
+ /* 170 */ 260, 288, 247, 543, 784, 690, 831, 693, 519, 981,
+ /* 180 */ 674, 953, 580, 674, 1016, 886, 856, 1112, 1334, 1200,
+ /* 190 */ 1345, 1368, 1345, 1229, 1376, 1376, 1345, 1229, 1229, 1302,
+ /* 200 */ 1309, 1376, 1312, 1376, 1376, 1376, 1400, 1400, 1405, 176,
+ /* 210 */ 1416, 176, 1420, 1425, 176, 1420, 176, 176, 176, 1376,
+ /* 220 */ 176, 1401, 1401, 1400, 109, 109, 109, 109, 109, 109,
+ /* 230 */ 109, 109, 109, 109, 109, 1376, 1400, 595, 595, 595,
+ /* 240 */ 1266, 1370, 1405, 378, 1281, 1301, 1416, 378, 1316, 1376,
+ /* 250 */ 1368, 1368, 595, 1250, 1257, 595, 1250, 1257, 595, 595,
+ /* 260 */ 109, 1245, 1341, 1250, 1255, 1259, 1289, 1112, 1249, 1268,
+ /* 270 */ 1275, 1299, 448, 1536, 1376, 1420, 378, 378, 1547, 1257,
+ /* 280 */ 595, 595, 595, 595, 595, 1257, 595, 1409, 378, 634,
+ /* 290 */ 378, 448, 1482, 1492, 595, 687, 1376, 378, 1562, 1400,
+ /* 300 */ 3096, 3096, 3096, 3096, 3096, 3096, 3096, 3096, 3096, 36,
+ /* 310 */ 454, 689, 937, 162, 841, 931, 592, 1015, 1064, 967,
+ /* 320 */ 1035, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
+ /* 330 */ 472, 73, 502, 502, 666, 408, 499, 776, 734, 838,
+ /* 340 */ 377, 353, 698, 698, 604, 282, 722, 604, 604, 604,
+ /* 350 */ 1090, 964, 949, 1032, 1108, 818, 345, 1053, 1067, 1081,
+ /* 360 */ 1120, 1101, 1231, 1223, 1228, 1242, 944, 1062, 1107, 1131,
+ /* 370 */ 1147, 1172, 1185, 1126, 1031, 1057, 1041, 1209, 1230, 1234,
+ /* 380 */ 1237, 1264, 1267, 1278, 1270, 1179, 1202, 1208, 1272, 735,
+ /* 390 */ 1276, 1277, 1288, 1326, 1328, 1336, 1139, 1254, 1344, 1263,
+ /* 400 */ 1381, 1620, 1621, 1623, 1583, 1626, 1595, 1423, 1597, 1598,
+ /* 410 */ 1599, 1427, 1636, 1602, 1603, 1432, 1642, 1436, 1645, 1611,
+ /* 420 */ 1647, 1627, 1648, 1615, 1456, 1464, 1467, 1654, 1655, 1657,
+ /* 430 */ 1476, 1478, 1660, 1661, 1622, 1667, 1668, 1670, 1629, 1672,
+ /* 440 */ 1674, 1685, 1686, 1687, 1688, 1690, 1692, 1522, 1643, 1679,
+ /* 450 */ 1525, 1681, 1682, 1683, 1693, 1694, 1695, 1696, 1697, 1698,
+ /* 460 */ 1699, 1700, 1701, 1704, 1705, 1706, 1709, 1669, 1712, 1713,
+ /* 470 */ 1714, 1723, 1724, 1725, 1715, 1727, 1728, 1735, 1600, 1738,
+ /* 480 */ 1740, 1722, 1649, 1729, 1650, 1750, 1702, 1717, 1753, 1707,
+ /* 490 */ 1755, 1708, 1757, 1758, 1719, 1720, 1718, 1716, 1754, 1731,
+ /* 500 */ 1756, 1732, 1764, 1734, 1730, 1767, 1771, 1772, 1736, 1606,
+ /* 510 */ 1776, 1780, 1781, 1721, 1784, 1785, 1765, 1741, 1749, 1790,
+ /* 520 */ 1768, 1744, 1766, 1793, 1769, 1759, 1770, 1810, 1782, 1763,
+ /* 530 */ 1777, 1815, 1818, 1820, 1822, 1726, 1733, 1788, 1803, 1826,
+ /* 540 */ 1792, 1794, 1796, 1797, 1798, 1799, 1801, 1786, 1800, 1802,
+ /* 550 */ 1804, 1806, 1807, 1838, 1819, 1845, 1824, 1805, 1847, 1827,
+ /* 560 */ 1813, 1850, 1816, 1853, 1823, 1854, 1846, 1849, 1832, 1836,
+ /* 570 */ 1839, 1778, 1775, 1877, 1737, 1783, 1689, 1851, 1858, 1881,
+ /* 580 */ 1710, 1863, 1748, 1739, 1887, 1888, 1751, 1745, 1889, 1852,
+ /* 590 */ 1634, 1808, 1834, 1821, 1828, 1829, 1842, 1809, 1840, 1856,
+ /* 600 */ 1857, 1841, 1843, 1844, 1848, 1855, 1862, 1876, 1878, 1860,
+ /* 610 */ 1884, 1637, 1861, 1864, 1891, 1895, 1639, 1867, 1905, 1910,
+ /* 620 */ 1911, 1912, 1914, 1866, 1868, 1903, 1711, 1909, 1907, 1897,
+ /* 630 */ 1898, 1955, 1957, 1871, 1924, 1716, 1921, 1872, 1873, 1875,
+ /* 640 */ 1879, 1880, 1787, 1882, 1977, 1942, 1817, 1892, 1874, 1716,
+ /* 650 */ 1940, 1944, 1893, 1752, 1896, 1988, 1971, 1814, 1899, 1894,
+ /* 660 */ 1900, 1901, 1913, 1902, 1949, 1915, 1917, 1951, 1918, 1990,
+ /* 670 */ 1830, 1922, 1920, 1931, 1979, 1983, 1933, 1934, 1986, 1937,
+ /* 680 */ 1938, 1999, 1941, 1939, 2003, 1945, 1943, 2007, 1946, 1925,
+ /* 690 */ 1926, 1927, 1929, 2031, 1947, 1954, 2011, 1960, 2026, 1962,
+ /* 700 */ 2011, 2011, 2041, 2000, 2002, 2029, 2032, 2033, 2035, 2036,
+ /* 710 */ 2038, 2040, 2043, 2044, 2045, 2001, 1992, 2039, 2046, 2051,
+ /* 720 */ 2052, 2054, 2053, 2055, 2056, 2021, 1786, 2059, 1800, 2060,
+ /* 730 */ 2067, 2069, 2071, 2086, 2074, 2110, 2076, 2064, 2075, 2113,
+ /* 740 */ 2081, 2070, 2078, 2120, 2095, 2073, 2092, 2132, 2099, 2085,
+ /* 750 */ 2096, 2136, 2102, 2103, 2139, 2119, 2121, 2122, 2124, 2126,
+ /* 760 */ 2123,
};
-#define YY_REDUCE_COUNT (306)
-#define YY_REDUCE_MIN (-436)
-#define YY_REDUCE_MAX (2246)
+#define YY_REDUCE_COUNT (308)
+#define YY_REDUCE_MIN (-424)
+#define YY_REDUCE_MAX (2669)
static const short yy_reduce_ofst[] = {
- /* 0 */ -258, -328, 50, 248, 613, 758, 807, 866, 889, 467,
- /* 10 */ 967, 1026, 1049, 1131, 1180, 1203, 365, 1275, 1298, 1332,
- /* 20 */ 1358, 1422, 643, 1454, 1479, 1544, 1528, 1593, 1610, 1627,
- /* 30 */ 1676, 1692, 1710, 1759, 1775, 1832, 1849, 1898, 1914, 1963,
- /* 40 */ 1988, 2012, 2083, 2105, 2132, 2181, 2197, 2246, -316, -302,
- /* 50 */ 157, 247, -256, 257, 375, 1031, 362, 391, -359, -345,
- /* 60 */ -339, -436, -75, 402, -380, -178, -354, -195, 318, 332,
- /* 70 */ -379, -145, 88, -282, -218, -44, 232, 116, 135, 337,
- /* 80 */ 366, 388, 392, 454, -333, 542, 642, 91, -26, 645,
- /* 90 */ 671, 241, 672, 236, 715, 377, 774, 427, 405, 781,
- /* 100 */ 784, 535, 786, 446, 608, 572, 788, 8, -335, -19,
- /* 110 */ -19, -251, -234, -163, -65, 72, 369, 461, 466, 514,
- /* 120 */ 518, 547, 571, 574, 612, 706, 707, 714, 740, 754,
- /* 130 */ 755, 757, 252, 23, -240, 300, 596, 23, 279, 436,
- /* 140 */ 13, 182, 664, 625, 435, 768, 776, 256, 787, -417,
- /* 150 */ 214, 780, -305, 795, 821, 792, 682, -364, 423, 507,
- /* 160 */ 515, 533, 644, 659, 533, 727, 878, 918, 865, 793,
- /* 170 */ 809, 950, 886, 981, 981, 976, 955, 1012, 979, 965,
- /* 180 */ 911, 911, 900, 911, 921, 923, 981, 962, 968, 980,
- /* 190 */ 1004, 1005, 1009, 1022, 1068, 1069, 1030, 1028, 1033, 1070,
- /* 200 */ 1072, 1079, 1075, 1085, 1086, 1091, 1099, 1100, 1034, 1094,
- /* 210 */ 1061, 1104, 1110, 1055, 1109, 1118, 1111, 1125, 1128, 1124,
- /* 220 */ 1129, 1135, 1143, 1148, 1123, 1130, 1134, 1136, 1137, 1140,
- /* 230 */ 1141, 1142, 1145, 1149, 1152, 1150, 1160, 1122, 1144, 1146,
- /* 240 */ 1105, 1113, 1117, 1176, 1133, 1147, 1181, 1186, 1153, 1154,
- /* 250 */ 1159, 1087, 1162, 1178, 1112, 1164, 1184, 1185, 981, 1114,
- /* 260 */ 1119, 1115, 1121, 1127, 1126, 1169, 1103, 1166, 1165, 911,
- /* 270 */ 1213, 1173, 1251, 1249, 1260, 1261, 1204, 1201, 1224, 1239,
- /* 280 */ 1254, 1255, 1256, 1215, 1257, 1221, 1265, 1276, 1269, 1263,
- /* 290 */ 1205, 1272, 1264, 1288, 1305, 1307, 1312, 1315, 1259, 1262,
- /* 300 */ 1266, 1267, 1291, 1293, 1295, 1311, 1327,
+ /* 0 */ 373, -119, 368, 588, 774, 995, 1065, 1116, 1191, -17,
+ /* 10 */ 446, 672, 880, 1310, 1375, -332, 903, 155, 1440, 1491,
+ /* 20 */ 1510, 1585, 1604, 1677, 1703, 1774, 1795, 1825, 1890, 1919,
+ /* 30 */ 1953, 2017, 2037, 2098, 2149, 2170, 2200, 2265, 2294, 2328,
+ /* 40 */ 2392, 2412, 2473, 2524, 2545, 2575, 2640, 2669, 96, -184,
+ /* 50 */ -395, -99, -392, -134, 488, 761, -87, 470, -89, 281,
+ /* 60 */ 398, -424, -364, -360, -384, 806, 42, -314, -177, 391,
+ /* 70 */ -379, -207, -156, -350, 86, 156, 202, -331, 178, 394,
+ /* 80 */ 402, 462, 507, 577, -101, 585, 646, -34, -334, 700,
+ /* 90 */ 708, 196, 730, 182, 801, 190, 804, 302, 278, 846,
+ /* 100 */ 858, 401, 860, 505, 450, 556, 878, -301, -63, -243,
+ /* 110 */ -243, -110, -323, -85, -81, 59, 153, 357, 358, 407,
+ /* 120 */ 541, 549, 594, 627, 639, 658, 663, 665, 669, 680,
+ /* 130 */ 682, 683, -302, 530, 267, 7, 124, 530, 545, 637,
+ /* 140 */ 185, -7, 363, 206, 104, 603, 671, -22, -104, 611,
+ /* 150 */ 451, 710, 686, 721, 723, 749, 630, -367, -362, 338,
+ /* 160 */ 429, 582, 795, 797, 582, 520, 847, 922, 871, 792,
+ /* 170 */ 808, 940, 829, 924, 924, 948, 906, 957, 934, 941,
+ /* 180 */ 911, 911, 893, 911, 921, 912, 924, 961, 970, 985,
+ /* 190 */ 1000, 1002, 1006, 1009, 1054, 1056, 1013, 1017, 1018, 1052,
+ /* 200 */ 1055, 1068, 1059, 1069, 1071, 1072, 1087, 1089, 1027, 1088,
+ /* 210 */ 1060, 1091, 1100, 1048, 1103, 1106, 1104, 1105, 1109, 1113,
+ /* 220 */ 1110, 1111, 1114, 1124, 1094, 1095, 1096, 1097, 1098, 1099,
+ /* 230 */ 1102, 1117, 1127, 1128, 1138, 1125, 1132, 1092, 1093, 1122,
+ /* 240 */ 1063, 1066, 1073, 1133, 1070, 1074, 1129, 1160, 1115, 1166,
+ /* 250 */ 1119, 1123, 1136, 1061, 1137, 1142, 1075, 1140, 1144, 1146,
+ /* 260 */ 924, 1083, 1076, 1118, 1134, 1130, 1141, 1145, 1077, 1078,
+ /* 270 */ 1085, 911, 1181, 1143, 1219, 1220, 1218, 1221, 1176, 1175,
+ /* 280 */ 1192, 1195, 1196, 1197, 1198, 1184, 1201, 1190, 1240, 1224,
+ /* 290 */ 1244, 1213, 1154, 1225, 1212, 1238, 1256, 1251, 1265, 1269,
+ /* 300 */ 1199, 1194, 1204, 1210, 1246, 1248, 1258, 1273, 1285,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 10 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 20 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 30 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 40 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 50 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 60 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 70 */ 1690, 1690, 1690, 1957, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 80 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1769, 1690, 1690,
- /* 90 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 100 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1767, 1950, 2166,
- /* 110 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 120 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 130 */ 1690, 1690, 1690, 2178, 1690, 1690, 1690, 2178, 2178, 2178,
- /* 140 */ 1767, 2138, 2138, 1690, 1690, 1690, 1690, 1769, 2011, 1690,
- /* 150 */ 1690, 1690, 1690, 1690, 1690, 1885, 1690, 1690, 1690, 1690,
- /* 160 */ 1690, 1909, 1690, 1690, 1690, 2003, 1690, 1690, 2203, 2259,
- /* 170 */ 1690, 1690, 2206, 1690, 1690, 1690, 1962, 1690, 1838, 2193,
- /* 180 */ 2170, 2184, 2243, 2171, 2168, 2187, 1690, 2197, 1690, 1996,
- /* 190 */ 1955, 1690, 1955, 1952, 1690, 1690, 1955, 1952, 1952, 1827,
- /* 200 */ 1823, 1690, 1821, 1690, 1690, 1690, 1690, 1690, 1690, 1769,
- /* 210 */ 1690, 1769, 1690, 1690, 1769, 1690, 1769, 1769, 1769, 1690,
- /* 220 */ 1769, 1747, 1747, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 230 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 240 */ 2023, 2009, 1690, 1767, 2005, 1690, 1767, 1690, 1690, 1690,
- /* 250 */ 1690, 2214, 2212, 1690, 2214, 2212, 1690, 1690, 1690, 2228,
- /* 260 */ 2224, 2214, 2232, 2230, 2199, 2197, 2262, 2249, 2245, 2184,
- /* 270 */ 1690, 1690, 1690, 1690, 1767, 1767, 1690, 2212, 1690, 1690,
- /* 280 */ 1690, 1690, 1690, 2212, 1690, 1690, 1767, 1690, 1767, 1690,
- /* 290 */ 1690, 1854, 1690, 1690, 1690, 1767, 1722, 1690, 1998, 2014,
- /* 300 */ 1980, 1980, 1888, 1888, 1888, 1770, 1695, 1690, 1690, 1690,
- /* 310 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2227,
- /* 320 */ 2226, 2093, 1690, 2142, 2141, 2140, 2131, 2092, 1850, 1690,
- /* 330 */ 2091, 2090, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 340 */ 1971, 1970, 2084, 1690, 1690, 2085, 2083, 2082, 1690, 1690,
- /* 350 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 360 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2246,
- /* 370 */ 2250, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2167, 1690,
- /* 380 */ 1690, 1690, 1690, 1690, 2066, 1690, 1690, 1690, 1690, 1690,
- /* 390 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 400 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 410 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 420 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 430 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 440 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 450 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 460 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 470 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 480 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 490 */ 1690, 1727, 2071, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 500 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 510 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 520 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 530 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 540 */ 1808, 1807, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 550 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 560 */ 1690, 1690, 1690, 1690, 2075, 1690, 1690, 1690, 1690, 1690,
- /* 570 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2242,
- /* 580 */ 2200, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 590 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2066,
- /* 600 */ 1690, 2225, 1690, 1690, 2240, 1690, 2244, 1690, 1690, 1690,
- /* 610 */ 1690, 1690, 1690, 1690, 2177, 2173, 1690, 1690, 2169, 1690,
- /* 620 */ 1690, 1690, 1690, 1690, 1690, 1690, 2074, 1690, 1690, 1690,
- /* 630 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 640 */ 2065, 1690, 2128, 1690, 1690, 1690, 2162, 1690, 1690, 2113,
- /* 650 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 2075,
- /* 660 */ 1690, 2078, 1690, 1690, 1690, 1690, 1690, 1882, 1690, 1690,
- /* 670 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 680 */ 1867, 1865, 1864, 1863, 1690, 1860, 1690, 1895, 1690, 1690,
- /* 690 */ 1690, 1891, 1890, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 700 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1788, 1690,
- /* 710 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1780, 1690, 1779,
- /* 720 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 730 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 740 */ 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- /* 750 */ 1690, 1690,
+ /* 0 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 10 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 20 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 30 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 40 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 50 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 60 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 70 */ 1714, 1714, 1714, 1985, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 80 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1793, 1714, 1714,
+ /* 90 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 100 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1791, 1978, 2199,
+ /* 110 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 120 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 130 */ 1714, 1714, 1714, 2211, 1714, 1714, 1714, 2211, 2211, 2211,
+ /* 140 */ 1791, 2171, 2171, 1714, 1714, 1714, 1714, 1793, 2043, 1714,
+ /* 150 */ 1714, 1714, 1714, 1714, 1714, 1913, 1714, 1714, 1714, 1714,
+ /* 160 */ 1714, 1937, 1714, 1714, 1714, 2037, 1714, 1714, 2236, 2292,
+ /* 170 */ 1714, 1714, 2239, 1714, 1714, 1714, 1990, 1714, 1866, 2226,
+ /* 180 */ 2203, 2217, 2276, 2204, 2201, 2220, 1714, 2230, 1714, 2024,
+ /* 190 */ 1983, 1714, 1983, 1980, 1714, 1714, 1983, 1980, 1980, 1855,
+ /* 200 */ 1851, 1714, 1849, 1714, 1714, 1714, 1714, 1714, 1714, 1793,
+ /* 210 */ 1714, 1793, 1714, 1714, 1793, 1714, 1793, 1793, 1793, 1714,
+ /* 220 */ 1793, 1771, 1771, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 230 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 240 */ 2055, 2041, 1714, 1791, 2035, 2033, 1714, 1791, 2031, 1714,
+ /* 250 */ 1714, 1714, 1714, 2247, 2245, 1714, 2247, 2245, 1714, 1714,
+ /* 260 */ 1714, 2261, 2257, 2247, 2265, 2263, 2232, 2230, 2295, 2282,
+ /* 270 */ 2278, 2217, 1714, 1714, 1714, 1714, 1791, 1791, 1714, 2245,
+ /* 280 */ 1714, 1714, 1714, 1714, 1714, 2245, 1714, 1714, 1791, 1714,
+ /* 290 */ 1791, 1714, 1714, 1882, 1714, 1714, 1714, 1791, 1746, 1714,
+ /* 300 */ 2026, 2046, 2008, 2008, 1916, 1916, 1916, 1794, 1719, 1714,
+ /* 310 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 320 */ 1714, 2260, 2259, 2126, 1714, 2175, 2174, 2173, 2164, 2125,
+ /* 330 */ 1878, 1714, 2124, 2123, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 340 */ 1714, 1714, 1999, 1998, 2117, 1714, 1714, 2118, 2116, 2115,
+ /* 350 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 360 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 370 */ 1714, 1714, 1714, 1714, 2279, 2283, 1714, 1714, 1714, 1714,
+ /* 380 */ 1714, 1714, 1714, 2200, 1714, 1714, 1714, 1714, 1714, 2099,
+ /* 390 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 400 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 410 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 420 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 430 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 440 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 450 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 460 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 470 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 480 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 490 */ 1714, 1714, 1714, 1714, 1714, 1714, 1751, 2104, 1714, 1714,
+ /* 500 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 510 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 520 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 530 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 540 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1832, 1831, 1714,
+ /* 550 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 560 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 570 */ 1714, 2108, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 580 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 2275, 2233,
+ /* 590 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 600 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 2099, 1714,
+ /* 610 */ 2258, 1714, 1714, 2273, 1714, 2277, 1714, 1714, 1714, 1714,
+ /* 620 */ 1714, 1714, 1714, 2210, 2206, 1714, 1714, 2202, 1714, 1714,
+ /* 630 */ 1714, 1714, 1714, 1714, 1714, 2107, 1714, 1714, 1714, 1714,
+ /* 640 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 2098,
+ /* 650 */ 1714, 2161, 1714, 1714, 1714, 2195, 1714, 1714, 2146, 1714,
+ /* 660 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 2108, 1714,
+ /* 670 */ 2111, 1714, 1714, 1714, 1714, 1714, 1910, 1714, 1714, 1714,
+ /* 680 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1895,
+ /* 690 */ 1893, 1892, 1891, 1714, 1888, 1714, 1923, 1714, 1714, 1714,
+ /* 700 */ 1919, 1918, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 710 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1812, 1714, 1714,
+ /* 720 */ 1714, 1714, 1714, 1714, 1714, 1714, 1804, 1714, 1803, 1714,
+ /* 730 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 740 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 750 */ 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714, 1714,
+ /* 760 */ 1714,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1066,7 +1154,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* START => nothing */
0, /* WITH => nothing */
0, /* TIMESTAMP => nothing */
- 276, /* END => ABORT */
+ 279, /* END => ABORT */
0, /* TABLE => nothing */
0, /* NK_LP => nothing */
0, /* NK_RP => nothing */
@@ -1160,6 +1248,8 @@ static const YYCODETYPE yyFallback[] = {
0, /* OUTPUTTYPE => nothing */
0, /* AGGREGATE => nothing */
0, /* BUFSIZE => nothing */
+ 0, /* LANGUAGE => nothing */
+ 0, /* REPLACE => nothing */
0, /* STREAM => nothing */
0, /* INTO => nothing */
0, /* TRIGGER => nothing */
@@ -1175,6 +1265,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* TRANSACTION => nothing */
0, /* BALANCE => nothing */
0, /* VGROUP => nothing */
+ 0, /* LEADER => nothing */
0, /* MERGE => nothing */
0, /* REDISTRIBUTE => nothing */
0, /* SPLIT => nothing */
@@ -1245,57 +1336,56 @@ static const YYCODETYPE yyFallback[] = {
0, /* ASC => nothing */
0, /* NULLS => nothing */
0, /* ABORT => nothing */
- 276, /* AFTER => ABORT */
- 276, /* ATTACH => ABORT */
- 276, /* BEFORE => ABORT */
- 276, /* BEGIN => ABORT */
- 276, /* BITAND => ABORT */
- 276, /* BITNOT => ABORT */
- 276, /* BITOR => ABORT */
- 276, /* BLOCKS => ABORT */
- 276, /* CHANGE => ABORT */
- 276, /* COMMA => ABORT */
- 276, /* CONCAT => ABORT */
- 276, /* CONFLICT => ABORT */
- 276, /* COPY => ABORT */
- 276, /* DEFERRED => ABORT */
- 276, /* DELIMITERS => ABORT */
- 276, /* DETACH => ABORT */
- 276, /* DIVIDE => ABORT */
- 276, /* DOT => ABORT */
- 276, /* EACH => ABORT */
- 276, /* FAIL => ABORT */
- 276, /* FILE => ABORT */
- 276, /* FOR => ABORT */
- 276, /* GLOB => ABORT */
- 276, /* ID => ABORT */
- 276, /* IMMEDIATE => ABORT */
- 276, /* IMPORT => ABORT */
- 276, /* INITIALLY => ABORT */
- 276, /* INSTEAD => ABORT */
- 276, /* ISNULL => ABORT */
- 276, /* KEY => ABORT */
- 276, /* MODULES => ABORT */
- 276, /* NK_BITNOT => ABORT */
- 276, /* NK_SEMI => ABORT */
- 276, /* NOTNULL => ABORT */
- 276, /* OF => ABORT */
- 276, /* PLUS => ABORT */
- 276, /* PRIVILEGE => ABORT */
- 276, /* RAISE => ABORT */
- 276, /* REPLACE => ABORT */
- 276, /* RESTRICT => ABORT */
- 276, /* ROW => ABORT */
- 276, /* SEMI => ABORT */
- 276, /* STAR => ABORT */
- 276, /* STATEMENT => ABORT */
- 276, /* STRICT => ABORT */
- 276, /* STRING => ABORT */
- 276, /* TIMES => ABORT */
- 276, /* VALUES => ABORT */
- 276, /* VARIABLE => ABORT */
- 276, /* VIEW => ABORT */
- 276, /* WAL => ABORT */
+ 279, /* AFTER => ABORT */
+ 279, /* ATTACH => ABORT */
+ 279, /* BEFORE => ABORT */
+ 279, /* BEGIN => ABORT */
+ 279, /* BITAND => ABORT */
+ 279, /* BITNOT => ABORT */
+ 279, /* BITOR => ABORT */
+ 279, /* BLOCKS => ABORT */
+ 279, /* CHANGE => ABORT */
+ 279, /* COMMA => ABORT */
+ 279, /* CONCAT => ABORT */
+ 279, /* CONFLICT => ABORT */
+ 279, /* COPY => ABORT */
+ 279, /* DEFERRED => ABORT */
+ 279, /* DELIMITERS => ABORT */
+ 279, /* DETACH => ABORT */
+ 279, /* DIVIDE => ABORT */
+ 279, /* DOT => ABORT */
+ 279, /* EACH => ABORT */
+ 279, /* FAIL => ABORT */
+ 279, /* FILE => ABORT */
+ 279, /* FOR => ABORT */
+ 279, /* GLOB => ABORT */
+ 279, /* ID => ABORT */
+ 279, /* IMMEDIATE => ABORT */
+ 279, /* IMPORT => ABORT */
+ 279, /* INITIALLY => ABORT */
+ 279, /* INSTEAD => ABORT */
+ 279, /* ISNULL => ABORT */
+ 279, /* KEY => ABORT */
+ 279, /* MODULES => ABORT */
+ 279, /* NK_BITNOT => ABORT */
+ 279, /* NK_SEMI => ABORT */
+ 279, /* NOTNULL => ABORT */
+ 279, /* OF => ABORT */
+ 279, /* PLUS => ABORT */
+ 279, /* PRIVILEGE => ABORT */
+ 279, /* RAISE => ABORT */
+ 279, /* RESTRICT => ABORT */
+ 279, /* ROW => ABORT */
+ 279, /* SEMI => ABORT */
+ 279, /* STAR => ABORT */
+ 279, /* STATEMENT => ABORT */
+ 279, /* STRICT => ABORT */
+ 279, /* STRING => ABORT */
+ 279, /* TIMES => ABORT */
+ 279, /* VALUES => ABORT */
+ 279, /* VARIABLE => ABORT */
+ 279, /* VIEW => ABORT */
+ 279, /* WAL => ABORT */
};
#endif /* YYFALLBACK */
@@ -1575,285 +1665,289 @@ static const char *const yyTokenName[] = {
/* 189 */ "OUTPUTTYPE",
/* 190 */ "AGGREGATE",
/* 191 */ "BUFSIZE",
- /* 192 */ "STREAM",
- /* 193 */ "INTO",
- /* 194 */ "TRIGGER",
- /* 195 */ "AT_ONCE",
- /* 196 */ "WINDOW_CLOSE",
- /* 197 */ "IGNORE",
- /* 198 */ "EXPIRED",
- /* 199 */ "FILL_HISTORY",
- /* 200 */ "UPDATE",
- /* 201 */ "SUBTABLE",
- /* 202 */ "KILL",
- /* 203 */ "CONNECTION",
- /* 204 */ "TRANSACTION",
- /* 205 */ "BALANCE",
- /* 206 */ "VGROUP",
- /* 207 */ "MERGE",
- /* 208 */ "REDISTRIBUTE",
- /* 209 */ "SPLIT",
- /* 210 */ "DELETE",
- /* 211 */ "INSERT",
- /* 212 */ "NULL",
- /* 213 */ "NK_QUESTION",
- /* 214 */ "NK_ARROW",
- /* 215 */ "ROWTS",
- /* 216 */ "QSTART",
- /* 217 */ "QEND",
- /* 218 */ "QDURATION",
- /* 219 */ "WSTART",
- /* 220 */ "WEND",
- /* 221 */ "WDURATION",
- /* 222 */ "IROWTS",
- /* 223 */ "ISFILLED",
- /* 224 */ "CAST",
- /* 225 */ "NOW",
- /* 226 */ "TODAY",
- /* 227 */ "TIMEZONE",
- /* 228 */ "CLIENT_VERSION",
- /* 229 */ "SERVER_VERSION",
- /* 230 */ "SERVER_STATUS",
- /* 231 */ "CURRENT_USER",
- /* 232 */ "CASE",
- /* 233 */ "WHEN",
- /* 234 */ "THEN",
- /* 235 */ "ELSE",
- /* 236 */ "BETWEEN",
- /* 237 */ "IS",
- /* 238 */ "NK_LT",
- /* 239 */ "NK_GT",
- /* 240 */ "NK_LE",
- /* 241 */ "NK_GE",
- /* 242 */ "NK_NE",
- /* 243 */ "MATCH",
- /* 244 */ "NMATCH",
- /* 245 */ "CONTAINS",
- /* 246 */ "IN",
- /* 247 */ "JOIN",
- /* 248 */ "INNER",
- /* 249 */ "SELECT",
- /* 250 */ "DISTINCT",
- /* 251 */ "WHERE",
- /* 252 */ "PARTITION",
- /* 253 */ "BY",
- /* 254 */ "SESSION",
- /* 255 */ "STATE_WINDOW",
- /* 256 */ "EVENT_WINDOW",
- /* 257 */ "SLIDING",
- /* 258 */ "FILL",
- /* 259 */ "VALUE",
- /* 260 */ "VALUE_F",
- /* 261 */ "NONE",
- /* 262 */ "PREV",
- /* 263 */ "NULL_F",
- /* 264 */ "LINEAR",
- /* 265 */ "NEXT",
- /* 266 */ "HAVING",
- /* 267 */ "RANGE",
- /* 268 */ "EVERY",
- /* 269 */ "ORDER",
- /* 270 */ "SLIMIT",
- /* 271 */ "SOFFSET",
- /* 272 */ "LIMIT",
- /* 273 */ "OFFSET",
- /* 274 */ "ASC",
- /* 275 */ "NULLS",
- /* 276 */ "ABORT",
- /* 277 */ "AFTER",
- /* 278 */ "ATTACH",
- /* 279 */ "BEFORE",
- /* 280 */ "BEGIN",
- /* 281 */ "BITAND",
- /* 282 */ "BITNOT",
- /* 283 */ "BITOR",
- /* 284 */ "BLOCKS",
- /* 285 */ "CHANGE",
- /* 286 */ "COMMA",
- /* 287 */ "CONCAT",
- /* 288 */ "CONFLICT",
- /* 289 */ "COPY",
- /* 290 */ "DEFERRED",
- /* 291 */ "DELIMITERS",
- /* 292 */ "DETACH",
- /* 293 */ "DIVIDE",
- /* 294 */ "DOT",
- /* 295 */ "EACH",
- /* 296 */ "FAIL",
- /* 297 */ "FILE",
- /* 298 */ "FOR",
- /* 299 */ "GLOB",
- /* 300 */ "ID",
- /* 301 */ "IMMEDIATE",
- /* 302 */ "IMPORT",
- /* 303 */ "INITIALLY",
- /* 304 */ "INSTEAD",
- /* 305 */ "ISNULL",
- /* 306 */ "KEY",
- /* 307 */ "MODULES",
- /* 308 */ "NK_BITNOT",
- /* 309 */ "NK_SEMI",
- /* 310 */ "NOTNULL",
- /* 311 */ "OF",
- /* 312 */ "PLUS",
- /* 313 */ "PRIVILEGE",
- /* 314 */ "RAISE",
- /* 315 */ "REPLACE",
- /* 316 */ "RESTRICT",
- /* 317 */ "ROW",
- /* 318 */ "SEMI",
- /* 319 */ "STAR",
- /* 320 */ "STATEMENT",
- /* 321 */ "STRICT",
- /* 322 */ "STRING",
- /* 323 */ "TIMES",
- /* 324 */ "VALUES",
- /* 325 */ "VARIABLE",
- /* 326 */ "VIEW",
- /* 327 */ "WAL",
- /* 328 */ "cmd",
- /* 329 */ "account_options",
- /* 330 */ "alter_account_options",
- /* 331 */ "literal",
- /* 332 */ "alter_account_option",
- /* 333 */ "user_name",
- /* 334 */ "sysinfo_opt",
- /* 335 */ "privileges",
- /* 336 */ "priv_level",
- /* 337 */ "priv_type_list",
- /* 338 */ "priv_type",
- /* 339 */ "db_name",
- /* 340 */ "topic_name",
- /* 341 */ "dnode_endpoint",
- /* 342 */ "force_opt",
- /* 343 */ "not_exists_opt",
- /* 344 */ "db_options",
- /* 345 */ "exists_opt",
- /* 346 */ "alter_db_options",
- /* 347 */ "speed_opt",
- /* 348 */ "start_opt",
- /* 349 */ "end_opt",
- /* 350 */ "integer_list",
- /* 351 */ "variable_list",
- /* 352 */ "retention_list",
- /* 353 */ "alter_db_option",
- /* 354 */ "retention",
- /* 355 */ "full_table_name",
- /* 356 */ "column_def_list",
- /* 357 */ "tags_def_opt",
- /* 358 */ "table_options",
- /* 359 */ "multi_create_clause",
- /* 360 */ "tags_def",
- /* 361 */ "multi_drop_clause",
- /* 362 */ "alter_table_clause",
- /* 363 */ "alter_table_options",
- /* 364 */ "column_name",
- /* 365 */ "type_name",
- /* 366 */ "signed_literal",
- /* 367 */ "create_subtable_clause",
- /* 368 */ "specific_cols_opt",
- /* 369 */ "expression_list",
- /* 370 */ "drop_table_clause",
- /* 371 */ "col_name_list",
- /* 372 */ "table_name",
- /* 373 */ "column_def",
- /* 374 */ "duration_list",
- /* 375 */ "rollup_func_list",
- /* 376 */ "alter_table_option",
- /* 377 */ "duration_literal",
- /* 378 */ "rollup_func_name",
- /* 379 */ "function_name",
- /* 380 */ "col_name",
- /* 381 */ "db_name_cond_opt",
- /* 382 */ "like_pattern_opt",
- /* 383 */ "table_name_cond",
- /* 384 */ "from_db_opt",
- /* 385 */ "tag_list_opt",
- /* 386 */ "tag_item",
- /* 387 */ "column_alias",
- /* 388 */ "full_index_name",
- /* 389 */ "index_options",
- /* 390 */ "index_name",
- /* 391 */ "func_list",
- /* 392 */ "sliding_opt",
- /* 393 */ "sma_stream_opt",
- /* 394 */ "func",
- /* 395 */ "sma_func_name",
- /* 396 */ "query_or_subquery",
- /* 397 */ "cgroup_name",
- /* 398 */ "analyze_opt",
- /* 399 */ "explain_options",
- /* 400 */ "insert_query",
- /* 401 */ "agg_func_opt",
- /* 402 */ "bufsize_opt",
- /* 403 */ "stream_name",
- /* 404 */ "stream_options",
- /* 405 */ "col_list_opt",
- /* 406 */ "tag_def_or_ref_opt",
- /* 407 */ "subtable_opt",
- /* 408 */ "expression",
- /* 409 */ "dnode_list",
- /* 410 */ "where_clause_opt",
- /* 411 */ "signed",
- /* 412 */ "literal_func",
- /* 413 */ "literal_list",
- /* 414 */ "table_alias",
- /* 415 */ "expr_or_subquery",
- /* 416 */ "pseudo_column",
- /* 417 */ "column_reference",
- /* 418 */ "function_expression",
- /* 419 */ "case_when_expression",
- /* 420 */ "star_func",
- /* 421 */ "star_func_para_list",
- /* 422 */ "noarg_func",
- /* 423 */ "other_para_list",
- /* 424 */ "star_func_para",
- /* 425 */ "when_then_list",
- /* 426 */ "case_when_else_opt",
- /* 427 */ "common_expression",
- /* 428 */ "when_then_expr",
- /* 429 */ "predicate",
- /* 430 */ "compare_op",
- /* 431 */ "in_op",
- /* 432 */ "in_predicate_value",
- /* 433 */ "boolean_value_expression",
- /* 434 */ "boolean_primary",
- /* 435 */ "from_clause_opt",
- /* 436 */ "table_reference_list",
- /* 437 */ "table_reference",
- /* 438 */ "table_primary",
- /* 439 */ "joined_table",
- /* 440 */ "alias_opt",
- /* 441 */ "subquery",
- /* 442 */ "parenthesized_joined_table",
- /* 443 */ "join_type",
- /* 444 */ "search_condition",
- /* 445 */ "query_specification",
- /* 446 */ "set_quantifier_opt",
- /* 447 */ "select_list",
- /* 448 */ "partition_by_clause_opt",
- /* 449 */ "range_opt",
- /* 450 */ "every_opt",
- /* 451 */ "fill_opt",
- /* 452 */ "twindow_clause_opt",
- /* 453 */ "group_by_clause_opt",
- /* 454 */ "having_clause_opt",
- /* 455 */ "select_item",
- /* 456 */ "partition_list",
- /* 457 */ "partition_item",
- /* 458 */ "fill_mode",
- /* 459 */ "group_by_list",
- /* 460 */ "query_expression",
- /* 461 */ "query_simple",
- /* 462 */ "order_by_clause_opt",
- /* 463 */ "slimit_clause_opt",
- /* 464 */ "limit_clause_opt",
- /* 465 */ "union_query_expression",
- /* 466 */ "query_simple_or_subquery",
- /* 467 */ "sort_specification_list",
- /* 468 */ "sort_specification",
- /* 469 */ "ordering_specification_opt",
- /* 470 */ "null_ordering_opt",
+ /* 192 */ "LANGUAGE",
+ /* 193 */ "REPLACE",
+ /* 194 */ "STREAM",
+ /* 195 */ "INTO",
+ /* 196 */ "TRIGGER",
+ /* 197 */ "AT_ONCE",
+ /* 198 */ "WINDOW_CLOSE",
+ /* 199 */ "IGNORE",
+ /* 200 */ "EXPIRED",
+ /* 201 */ "FILL_HISTORY",
+ /* 202 */ "UPDATE",
+ /* 203 */ "SUBTABLE",
+ /* 204 */ "KILL",
+ /* 205 */ "CONNECTION",
+ /* 206 */ "TRANSACTION",
+ /* 207 */ "BALANCE",
+ /* 208 */ "VGROUP",
+ /* 209 */ "LEADER",
+ /* 210 */ "MERGE",
+ /* 211 */ "REDISTRIBUTE",
+ /* 212 */ "SPLIT",
+ /* 213 */ "DELETE",
+ /* 214 */ "INSERT",
+ /* 215 */ "NULL",
+ /* 216 */ "NK_QUESTION",
+ /* 217 */ "NK_ARROW",
+ /* 218 */ "ROWTS",
+ /* 219 */ "QSTART",
+ /* 220 */ "QEND",
+ /* 221 */ "QDURATION",
+ /* 222 */ "WSTART",
+ /* 223 */ "WEND",
+ /* 224 */ "WDURATION",
+ /* 225 */ "IROWTS",
+ /* 226 */ "ISFILLED",
+ /* 227 */ "CAST",
+ /* 228 */ "NOW",
+ /* 229 */ "TODAY",
+ /* 230 */ "TIMEZONE",
+ /* 231 */ "CLIENT_VERSION",
+ /* 232 */ "SERVER_VERSION",
+ /* 233 */ "SERVER_STATUS",
+ /* 234 */ "CURRENT_USER",
+ /* 235 */ "CASE",
+ /* 236 */ "WHEN",
+ /* 237 */ "THEN",
+ /* 238 */ "ELSE",
+ /* 239 */ "BETWEEN",
+ /* 240 */ "IS",
+ /* 241 */ "NK_LT",
+ /* 242 */ "NK_GT",
+ /* 243 */ "NK_LE",
+ /* 244 */ "NK_GE",
+ /* 245 */ "NK_NE",
+ /* 246 */ "MATCH",
+ /* 247 */ "NMATCH",
+ /* 248 */ "CONTAINS",
+ /* 249 */ "IN",
+ /* 250 */ "JOIN",
+ /* 251 */ "INNER",
+ /* 252 */ "SELECT",
+ /* 253 */ "DISTINCT",
+ /* 254 */ "WHERE",
+ /* 255 */ "PARTITION",
+ /* 256 */ "BY",
+ /* 257 */ "SESSION",
+ /* 258 */ "STATE_WINDOW",
+ /* 259 */ "EVENT_WINDOW",
+ /* 260 */ "SLIDING",
+ /* 261 */ "FILL",
+ /* 262 */ "VALUE",
+ /* 263 */ "VALUE_F",
+ /* 264 */ "NONE",
+ /* 265 */ "PREV",
+ /* 266 */ "NULL_F",
+ /* 267 */ "LINEAR",
+ /* 268 */ "NEXT",
+ /* 269 */ "HAVING",
+ /* 270 */ "RANGE",
+ /* 271 */ "EVERY",
+ /* 272 */ "ORDER",
+ /* 273 */ "SLIMIT",
+ /* 274 */ "SOFFSET",
+ /* 275 */ "LIMIT",
+ /* 276 */ "OFFSET",
+ /* 277 */ "ASC",
+ /* 278 */ "NULLS",
+ /* 279 */ "ABORT",
+ /* 280 */ "AFTER",
+ /* 281 */ "ATTACH",
+ /* 282 */ "BEFORE",
+ /* 283 */ "BEGIN",
+ /* 284 */ "BITAND",
+ /* 285 */ "BITNOT",
+ /* 286 */ "BITOR",
+ /* 287 */ "BLOCKS",
+ /* 288 */ "CHANGE",
+ /* 289 */ "COMMA",
+ /* 290 */ "CONCAT",
+ /* 291 */ "CONFLICT",
+ /* 292 */ "COPY",
+ /* 293 */ "DEFERRED",
+ /* 294 */ "DELIMITERS",
+ /* 295 */ "DETACH",
+ /* 296 */ "DIVIDE",
+ /* 297 */ "DOT",
+ /* 298 */ "EACH",
+ /* 299 */ "FAIL",
+ /* 300 */ "FILE",
+ /* 301 */ "FOR",
+ /* 302 */ "GLOB",
+ /* 303 */ "ID",
+ /* 304 */ "IMMEDIATE",
+ /* 305 */ "IMPORT",
+ /* 306 */ "INITIALLY",
+ /* 307 */ "INSTEAD",
+ /* 308 */ "ISNULL",
+ /* 309 */ "KEY",
+ /* 310 */ "MODULES",
+ /* 311 */ "NK_BITNOT",
+ /* 312 */ "NK_SEMI",
+ /* 313 */ "NOTNULL",
+ /* 314 */ "OF",
+ /* 315 */ "PLUS",
+ /* 316 */ "PRIVILEGE",
+ /* 317 */ "RAISE",
+ /* 318 */ "RESTRICT",
+ /* 319 */ "ROW",
+ /* 320 */ "SEMI",
+ /* 321 */ "STAR",
+ /* 322 */ "STATEMENT",
+ /* 323 */ "STRICT",
+ /* 324 */ "STRING",
+ /* 325 */ "TIMES",
+ /* 326 */ "VALUES",
+ /* 327 */ "VARIABLE",
+ /* 328 */ "VIEW",
+ /* 329 */ "WAL",
+ /* 330 */ "cmd",
+ /* 331 */ "account_options",
+ /* 332 */ "alter_account_options",
+ /* 333 */ "literal",
+ /* 334 */ "alter_account_option",
+ /* 335 */ "user_name",
+ /* 336 */ "sysinfo_opt",
+ /* 337 */ "privileges",
+ /* 338 */ "priv_level",
+ /* 339 */ "priv_type_list",
+ /* 340 */ "priv_type",
+ /* 341 */ "db_name",
+ /* 342 */ "topic_name",
+ /* 343 */ "dnode_endpoint",
+ /* 344 */ "force_opt",
+ /* 345 */ "not_exists_opt",
+ /* 346 */ "db_options",
+ /* 347 */ "exists_opt",
+ /* 348 */ "alter_db_options",
+ /* 349 */ "speed_opt",
+ /* 350 */ "start_opt",
+ /* 351 */ "end_opt",
+ /* 352 */ "integer_list",
+ /* 353 */ "variable_list",
+ /* 354 */ "retention_list",
+ /* 355 */ "alter_db_option",
+ /* 356 */ "retention",
+ /* 357 */ "full_table_name",
+ /* 358 */ "column_def_list",
+ /* 359 */ "tags_def_opt",
+ /* 360 */ "table_options",
+ /* 361 */ "multi_create_clause",
+ /* 362 */ "tags_def",
+ /* 363 */ "multi_drop_clause",
+ /* 364 */ "alter_table_clause",
+ /* 365 */ "alter_table_options",
+ /* 366 */ "column_name",
+ /* 367 */ "type_name",
+ /* 368 */ "signed_literal",
+ /* 369 */ "create_subtable_clause",
+ /* 370 */ "specific_cols_opt",
+ /* 371 */ "expression_list",
+ /* 372 */ "drop_table_clause",
+ /* 373 */ "col_name_list",
+ /* 374 */ "table_name",
+ /* 375 */ "column_def",
+ /* 376 */ "duration_list",
+ /* 377 */ "rollup_func_list",
+ /* 378 */ "alter_table_option",
+ /* 379 */ "duration_literal",
+ /* 380 */ "rollup_func_name",
+ /* 381 */ "function_name",
+ /* 382 */ "col_name",
+ /* 383 */ "db_name_cond_opt",
+ /* 384 */ "like_pattern_opt",
+ /* 385 */ "table_name_cond",
+ /* 386 */ "from_db_opt",
+ /* 387 */ "tag_list_opt",
+ /* 388 */ "tag_item",
+ /* 389 */ "column_alias",
+ /* 390 */ "full_index_name",
+ /* 391 */ "index_options",
+ /* 392 */ "index_name",
+ /* 393 */ "func_list",
+ /* 394 */ "sliding_opt",
+ /* 395 */ "sma_stream_opt",
+ /* 396 */ "func",
+ /* 397 */ "sma_func_name",
+ /* 398 */ "query_or_subquery",
+ /* 399 */ "cgroup_name",
+ /* 400 */ "analyze_opt",
+ /* 401 */ "explain_options",
+ /* 402 */ "insert_query",
+ /* 403 */ "or_replace_opt",
+ /* 404 */ "agg_func_opt",
+ /* 405 */ "bufsize_opt",
+ /* 406 */ "language_opt",
+ /* 407 */ "stream_name",
+ /* 408 */ "stream_options",
+ /* 409 */ "col_list_opt",
+ /* 410 */ "tag_def_or_ref_opt",
+ /* 411 */ "subtable_opt",
+ /* 412 */ "expression",
+ /* 413 */ "dnode_list",
+ /* 414 */ "where_clause_opt",
+ /* 415 */ "signed",
+ /* 416 */ "literal_func",
+ /* 417 */ "literal_list",
+ /* 418 */ "table_alias",
+ /* 419 */ "expr_or_subquery",
+ /* 420 */ "pseudo_column",
+ /* 421 */ "column_reference",
+ /* 422 */ "function_expression",
+ /* 423 */ "case_when_expression",
+ /* 424 */ "star_func",
+ /* 425 */ "star_func_para_list",
+ /* 426 */ "noarg_func",
+ /* 427 */ "other_para_list",
+ /* 428 */ "star_func_para",
+ /* 429 */ "when_then_list",
+ /* 430 */ "case_when_else_opt",
+ /* 431 */ "common_expression",
+ /* 432 */ "when_then_expr",
+ /* 433 */ "predicate",
+ /* 434 */ "compare_op",
+ /* 435 */ "in_op",
+ /* 436 */ "in_predicate_value",
+ /* 437 */ "boolean_value_expression",
+ /* 438 */ "boolean_primary",
+ /* 439 */ "from_clause_opt",
+ /* 440 */ "table_reference_list",
+ /* 441 */ "table_reference",
+ /* 442 */ "table_primary",
+ /* 443 */ "joined_table",
+ /* 444 */ "alias_opt",
+ /* 445 */ "subquery",
+ /* 446 */ "parenthesized_joined_table",
+ /* 447 */ "join_type",
+ /* 448 */ "search_condition",
+ /* 449 */ "query_specification",
+ /* 450 */ "set_quantifier_opt",
+ /* 451 */ "select_list",
+ /* 452 */ "partition_by_clause_opt",
+ /* 453 */ "range_opt",
+ /* 454 */ "every_opt",
+ /* 455 */ "fill_opt",
+ /* 456 */ "twindow_clause_opt",
+ /* 457 */ "group_by_clause_opt",
+ /* 458 */ "having_clause_opt",
+ /* 459 */ "select_item",
+ /* 460 */ "partition_list",
+ /* 461 */ "partition_item",
+ /* 462 */ "fill_mode",
+ /* 463 */ "group_by_list",
+ /* 464 */ "query_expression",
+ /* 465 */ "query_simple",
+ /* 466 */ "order_by_clause_opt",
+ /* 467 */ "slimit_clause_opt",
+ /* 468 */ "limit_clause_opt",
+ /* 469 */ "union_query_expression",
+ /* 470 */ "query_simple_or_subquery",
+ /* 471 */ "sort_specification_list",
+ /* 472 */ "sort_specification",
+ /* 473 */ "ordering_specification_opt",
+ /* 474 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -1982,457 +2076,466 @@ static const char *const yyRuleName[] = {
/* 118 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER",
/* 119 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER",
/* 120 */ "alter_db_option ::= MINROWS 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 */ "start_opt ::=",
- /* 131 */ "start_opt ::= START WITH NK_INTEGER",
- /* 132 */ "start_opt ::= START WITH NK_STRING",
- /* 133 */ "start_opt ::= START WITH TIMESTAMP NK_STRING",
- /* 134 */ "end_opt ::=",
- /* 135 */ "end_opt ::= END WITH NK_INTEGER",
- /* 136 */ "end_opt ::= END WITH NK_STRING",
- /* 137 */ "end_opt ::= END WITH TIMESTAMP NK_STRING",
- /* 138 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
- /* 139 */ "cmd ::= CREATE TABLE multi_create_clause",
- /* 140 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
- /* 141 */ "cmd ::= DROP TABLE multi_drop_clause",
- /* 142 */ "cmd ::= DROP STABLE exists_opt full_table_name",
- /* 143 */ "cmd ::= ALTER TABLE alter_table_clause",
- /* 144 */ "cmd ::= ALTER STABLE alter_table_clause",
- /* 145 */ "alter_table_clause ::= full_table_name alter_table_options",
- /* 146 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
- /* 147 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
- /* 148 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
- /* 149 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
- /* 150 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
- /* 151 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
- /* 152 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
- /* 153 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
- /* 154 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal",
- /* 155 */ "multi_create_clause ::= create_subtable_clause",
- /* 156 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
- /* 157 */ "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",
- /* 158 */ "multi_drop_clause ::= drop_table_clause",
- /* 159 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
- /* 160 */ "drop_table_clause ::= exists_opt full_table_name",
- /* 161 */ "specific_cols_opt ::=",
- /* 162 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
- /* 163 */ "full_table_name ::= table_name",
- /* 164 */ "full_table_name ::= db_name NK_DOT table_name",
- /* 165 */ "column_def_list ::= column_def",
- /* 166 */ "column_def_list ::= column_def_list NK_COMMA column_def",
- /* 167 */ "column_def ::= column_name type_name",
- /* 168 */ "column_def ::= column_name type_name COMMENT NK_STRING",
- /* 169 */ "type_name ::= BOOL",
- /* 170 */ "type_name ::= TINYINT",
- /* 171 */ "type_name ::= SMALLINT",
- /* 172 */ "type_name ::= INT",
- /* 173 */ "type_name ::= INTEGER",
- /* 174 */ "type_name ::= BIGINT",
- /* 175 */ "type_name ::= FLOAT",
- /* 176 */ "type_name ::= DOUBLE",
- /* 177 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
- /* 178 */ "type_name ::= TIMESTAMP",
- /* 179 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
- /* 180 */ "type_name ::= TINYINT UNSIGNED",
- /* 181 */ "type_name ::= SMALLINT UNSIGNED",
- /* 182 */ "type_name ::= INT UNSIGNED",
- /* 183 */ "type_name ::= BIGINT UNSIGNED",
- /* 184 */ "type_name ::= JSON",
- /* 185 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
- /* 186 */ "type_name ::= MEDIUMBLOB",
- /* 187 */ "type_name ::= BLOB",
- /* 188 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
- /* 189 */ "type_name ::= DECIMAL",
- /* 190 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
- /* 191 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
- /* 192 */ "tags_def_opt ::=",
- /* 193 */ "tags_def_opt ::= tags_def",
- /* 194 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
- /* 195 */ "table_options ::=",
- /* 196 */ "table_options ::= table_options COMMENT NK_STRING",
- /* 197 */ "table_options ::= table_options MAX_DELAY duration_list",
- /* 198 */ "table_options ::= table_options WATERMARK duration_list",
- /* 199 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
- /* 200 */ "table_options ::= table_options TTL NK_INTEGER",
- /* 201 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
- /* 202 */ "table_options ::= table_options DELETE_MARK duration_list",
- /* 203 */ "alter_table_options ::= alter_table_option",
- /* 204 */ "alter_table_options ::= alter_table_options alter_table_option",
- /* 205 */ "alter_table_option ::= COMMENT NK_STRING",
- /* 206 */ "alter_table_option ::= TTL NK_INTEGER",
- /* 207 */ "duration_list ::= duration_literal",
- /* 208 */ "duration_list ::= duration_list NK_COMMA duration_literal",
- /* 209 */ "rollup_func_list ::= rollup_func_name",
- /* 210 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
- /* 211 */ "rollup_func_name ::= function_name",
- /* 212 */ "rollup_func_name ::= FIRST",
- /* 213 */ "rollup_func_name ::= LAST",
- /* 214 */ "col_name_list ::= col_name",
- /* 215 */ "col_name_list ::= col_name_list NK_COMMA col_name",
- /* 216 */ "col_name ::= column_name",
- /* 217 */ "cmd ::= SHOW DNODES",
- /* 218 */ "cmd ::= SHOW USERS",
- /* 219 */ "cmd ::= SHOW USER PRIVILEGES",
- /* 220 */ "cmd ::= SHOW DATABASES",
- /* 221 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
- /* 222 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
- /* 223 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
- /* 224 */ "cmd ::= SHOW MNODES",
- /* 225 */ "cmd ::= SHOW QNODES",
- /* 226 */ "cmd ::= SHOW FUNCTIONS",
- /* 227 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
- /* 228 */ "cmd ::= SHOW STREAMS",
- /* 229 */ "cmd ::= SHOW ACCOUNTS",
- /* 230 */ "cmd ::= SHOW APPS",
- /* 231 */ "cmd ::= SHOW CONNECTIONS",
- /* 232 */ "cmd ::= SHOW LICENCES",
- /* 233 */ "cmd ::= SHOW GRANTS",
- /* 234 */ "cmd ::= SHOW CREATE DATABASE db_name",
- /* 235 */ "cmd ::= SHOW CREATE TABLE full_table_name",
- /* 236 */ "cmd ::= SHOW CREATE STABLE full_table_name",
- /* 237 */ "cmd ::= SHOW QUERIES",
- /* 238 */ "cmd ::= SHOW SCORES",
- /* 239 */ "cmd ::= SHOW TOPICS",
- /* 240 */ "cmd ::= SHOW VARIABLES",
- /* 241 */ "cmd ::= SHOW CLUSTER VARIABLES",
- /* 242 */ "cmd ::= SHOW LOCAL VARIABLES",
- /* 243 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
- /* 244 */ "cmd ::= SHOW BNODES",
- /* 245 */ "cmd ::= SHOW SNODES",
- /* 246 */ "cmd ::= SHOW CLUSTER",
- /* 247 */ "cmd ::= SHOW TRANSACTIONS",
- /* 248 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
- /* 249 */ "cmd ::= SHOW CONSUMERS",
- /* 250 */ "cmd ::= SHOW SUBSCRIPTIONS",
- /* 251 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
- /* 252 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
- /* 253 */ "cmd ::= SHOW VNODES NK_INTEGER",
- /* 254 */ "cmd ::= SHOW VNODES NK_STRING",
- /* 255 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
- /* 256 */ "cmd ::= SHOW CLUSTER ALIVE",
- /* 257 */ "db_name_cond_opt ::=",
- /* 258 */ "db_name_cond_opt ::= db_name NK_DOT",
- /* 259 */ "like_pattern_opt ::=",
- /* 260 */ "like_pattern_opt ::= LIKE NK_STRING",
- /* 261 */ "table_name_cond ::= table_name",
- /* 262 */ "from_db_opt ::=",
- /* 263 */ "from_db_opt ::= FROM db_name",
- /* 264 */ "tag_list_opt ::=",
- /* 265 */ "tag_list_opt ::= tag_item",
- /* 266 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
- /* 267 */ "tag_item ::= TBNAME",
- /* 268 */ "tag_item ::= QTAGS",
- /* 269 */ "tag_item ::= column_name",
- /* 270 */ "tag_item ::= column_name column_alias",
- /* 271 */ "tag_item ::= column_name AS column_alias",
- /* 272 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options",
- /* 273 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP",
- /* 274 */ "cmd ::= DROP INDEX exists_opt full_index_name",
- /* 275 */ "full_index_name ::= index_name",
- /* 276 */ "full_index_name ::= db_name NK_DOT index_name",
- /* 277 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
- /* 278 */ "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",
- /* 279 */ "func_list ::= func",
- /* 280 */ "func_list ::= func_list NK_COMMA func",
- /* 281 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
- /* 282 */ "sma_func_name ::= function_name",
- /* 283 */ "sma_func_name ::= COUNT",
- /* 284 */ "sma_func_name ::= FIRST",
- /* 285 */ "sma_func_name ::= LAST",
- /* 286 */ "sma_func_name ::= LAST_ROW",
- /* 287 */ "sma_stream_opt ::=",
- /* 288 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
- /* 289 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
- /* 290 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
- /* 291 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
- /* 292 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name",
- /* 293 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name",
- /* 294 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name",
- /* 295 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name",
- /* 296 */ "cmd ::= DROP TOPIC exists_opt topic_name",
- /* 297 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
- /* 298 */ "cmd ::= DESC full_table_name",
- /* 299 */ "cmd ::= DESCRIBE full_table_name",
- /* 300 */ "cmd ::= RESET QUERY CACHE",
- /* 301 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
- /* 302 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
- /* 303 */ "analyze_opt ::=",
- /* 304 */ "analyze_opt ::= ANALYZE",
- /* 305 */ "explain_options ::=",
- /* 306 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
- /* 307 */ "explain_options ::= explain_options RATIO NK_FLOAT",
- /* 308 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
- /* 309 */ "cmd ::= DROP FUNCTION exists_opt function_name",
- /* 310 */ "agg_func_opt ::=",
- /* 311 */ "agg_func_opt ::= AGGREGATE",
- /* 312 */ "bufsize_opt ::=",
- /* 313 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
- /* 314 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery",
- /* 315 */ "cmd ::= DROP STREAM exists_opt stream_name",
- /* 316 */ "col_list_opt ::=",
- /* 317 */ "col_list_opt ::= NK_LP col_name_list NK_RP",
- /* 318 */ "tag_def_or_ref_opt ::=",
- /* 319 */ "tag_def_or_ref_opt ::= tags_def",
- /* 320 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP",
- /* 321 */ "stream_options ::=",
- /* 322 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
- /* 323 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
- /* 324 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
- /* 325 */ "stream_options ::= stream_options WATERMARK duration_literal",
- /* 326 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
- /* 327 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
- /* 328 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
- /* 329 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
- /* 330 */ "subtable_opt ::=",
- /* 331 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
- /* 332 */ "cmd ::= KILL CONNECTION NK_INTEGER",
- /* 333 */ "cmd ::= KILL QUERY NK_STRING",
- /* 334 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
- /* 335 */ "cmd ::= BALANCE VGROUP",
- /* 336 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
- /* 337 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
- /* 338 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
- /* 339 */ "dnode_list ::= DNODE NK_INTEGER",
- /* 340 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
- /* 341 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
- /* 342 */ "cmd ::= query_or_subquery",
- /* 343 */ "cmd ::= insert_query",
- /* 344 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
- /* 345 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
- /* 346 */ "literal ::= NK_INTEGER",
- /* 347 */ "literal ::= NK_FLOAT",
- /* 348 */ "literal ::= NK_STRING",
- /* 349 */ "literal ::= NK_BOOL",
- /* 350 */ "literal ::= TIMESTAMP NK_STRING",
- /* 351 */ "literal ::= duration_literal",
- /* 352 */ "literal ::= NULL",
- /* 353 */ "literal ::= NK_QUESTION",
- /* 354 */ "duration_literal ::= NK_VARIABLE",
- /* 355 */ "signed ::= NK_INTEGER",
- /* 356 */ "signed ::= NK_PLUS NK_INTEGER",
- /* 357 */ "signed ::= NK_MINUS NK_INTEGER",
- /* 358 */ "signed ::= NK_FLOAT",
- /* 359 */ "signed ::= NK_PLUS NK_FLOAT",
- /* 360 */ "signed ::= NK_MINUS NK_FLOAT",
- /* 361 */ "signed_literal ::= signed",
- /* 362 */ "signed_literal ::= NK_STRING",
- /* 363 */ "signed_literal ::= NK_BOOL",
- /* 364 */ "signed_literal ::= TIMESTAMP NK_STRING",
- /* 365 */ "signed_literal ::= duration_literal",
- /* 366 */ "signed_literal ::= NULL",
- /* 367 */ "signed_literal ::= literal_func",
- /* 368 */ "signed_literal ::= NK_QUESTION",
- /* 369 */ "literal_list ::= signed_literal",
- /* 370 */ "literal_list ::= literal_list NK_COMMA signed_literal",
- /* 371 */ "db_name ::= NK_ID",
- /* 372 */ "table_name ::= NK_ID",
- /* 373 */ "column_name ::= NK_ID",
- /* 374 */ "function_name ::= NK_ID",
- /* 375 */ "table_alias ::= NK_ID",
- /* 376 */ "column_alias ::= NK_ID",
- /* 377 */ "user_name ::= NK_ID",
- /* 378 */ "topic_name ::= NK_ID",
- /* 379 */ "stream_name ::= NK_ID",
- /* 380 */ "cgroup_name ::= NK_ID",
- /* 381 */ "index_name ::= NK_ID",
- /* 382 */ "expr_or_subquery ::= expression",
- /* 383 */ "expression ::= literal",
- /* 384 */ "expression ::= pseudo_column",
- /* 385 */ "expression ::= column_reference",
- /* 386 */ "expression ::= function_expression",
- /* 387 */ "expression ::= case_when_expression",
- /* 388 */ "expression ::= NK_LP expression NK_RP",
- /* 389 */ "expression ::= NK_PLUS expr_or_subquery",
- /* 390 */ "expression ::= NK_MINUS expr_or_subquery",
- /* 391 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
- /* 392 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
- /* 393 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
- /* 394 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
- /* 395 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
- /* 396 */ "expression ::= column_reference NK_ARROW NK_STRING",
- /* 397 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
- /* 398 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
- /* 399 */ "expression_list ::= expr_or_subquery",
- /* 400 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
- /* 401 */ "column_reference ::= column_name",
- /* 402 */ "column_reference ::= table_name NK_DOT column_name",
- /* 403 */ "pseudo_column ::= ROWTS",
- /* 404 */ "pseudo_column ::= TBNAME",
- /* 405 */ "pseudo_column ::= table_name NK_DOT TBNAME",
- /* 406 */ "pseudo_column ::= QSTART",
- /* 407 */ "pseudo_column ::= QEND",
- /* 408 */ "pseudo_column ::= QDURATION",
- /* 409 */ "pseudo_column ::= WSTART",
- /* 410 */ "pseudo_column ::= WEND",
- /* 411 */ "pseudo_column ::= WDURATION",
- /* 412 */ "pseudo_column ::= IROWTS",
- /* 413 */ "pseudo_column ::= ISFILLED",
- /* 414 */ "pseudo_column ::= QTAGS",
- /* 415 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
- /* 416 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
- /* 417 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
- /* 418 */ "function_expression ::= literal_func",
- /* 419 */ "literal_func ::= noarg_func NK_LP NK_RP",
- /* 420 */ "literal_func ::= NOW",
- /* 421 */ "noarg_func ::= NOW",
- /* 422 */ "noarg_func ::= TODAY",
- /* 423 */ "noarg_func ::= TIMEZONE",
- /* 424 */ "noarg_func ::= DATABASE",
- /* 425 */ "noarg_func ::= CLIENT_VERSION",
- /* 426 */ "noarg_func ::= SERVER_VERSION",
- /* 427 */ "noarg_func ::= SERVER_STATUS",
- /* 428 */ "noarg_func ::= CURRENT_USER",
- /* 429 */ "noarg_func ::= USER",
- /* 430 */ "star_func ::= COUNT",
- /* 431 */ "star_func ::= FIRST",
- /* 432 */ "star_func ::= LAST",
- /* 433 */ "star_func ::= LAST_ROW",
- /* 434 */ "star_func_para_list ::= NK_STAR",
- /* 435 */ "star_func_para_list ::= other_para_list",
- /* 436 */ "other_para_list ::= star_func_para",
- /* 437 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
- /* 438 */ "star_func_para ::= expr_or_subquery",
- /* 439 */ "star_func_para ::= table_name NK_DOT NK_STAR",
- /* 440 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
- /* 441 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
- /* 442 */ "when_then_list ::= when_then_expr",
- /* 443 */ "when_then_list ::= when_then_list when_then_expr",
- /* 444 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
- /* 445 */ "case_when_else_opt ::=",
- /* 446 */ "case_when_else_opt ::= ELSE common_expression",
- /* 447 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
- /* 448 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 449 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 450 */ "predicate ::= expr_or_subquery IS NULL",
- /* 451 */ "predicate ::= expr_or_subquery IS NOT NULL",
- /* 452 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
- /* 453 */ "compare_op ::= NK_LT",
- /* 454 */ "compare_op ::= NK_GT",
- /* 455 */ "compare_op ::= NK_LE",
- /* 456 */ "compare_op ::= NK_GE",
- /* 457 */ "compare_op ::= NK_NE",
- /* 458 */ "compare_op ::= NK_EQ",
- /* 459 */ "compare_op ::= LIKE",
- /* 460 */ "compare_op ::= NOT LIKE",
- /* 461 */ "compare_op ::= MATCH",
- /* 462 */ "compare_op ::= NMATCH",
- /* 463 */ "compare_op ::= CONTAINS",
- /* 464 */ "in_op ::= IN",
- /* 465 */ "in_op ::= NOT IN",
- /* 466 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
- /* 467 */ "boolean_value_expression ::= boolean_primary",
- /* 468 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 469 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 470 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 471 */ "boolean_primary ::= predicate",
- /* 472 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 473 */ "common_expression ::= expr_or_subquery",
- /* 474 */ "common_expression ::= boolean_value_expression",
- /* 475 */ "from_clause_opt ::=",
- /* 476 */ "from_clause_opt ::= FROM table_reference_list",
- /* 477 */ "table_reference_list ::= table_reference",
- /* 478 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 479 */ "table_reference ::= table_primary",
- /* 480 */ "table_reference ::= joined_table",
- /* 481 */ "table_primary ::= table_name alias_opt",
- /* 482 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 483 */ "table_primary ::= subquery alias_opt",
- /* 484 */ "table_primary ::= parenthesized_joined_table",
- /* 485 */ "alias_opt ::=",
- /* 486 */ "alias_opt ::= table_alias",
- /* 487 */ "alias_opt ::= AS table_alias",
- /* 488 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 489 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 490 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
- /* 491 */ "join_type ::=",
- /* 492 */ "join_type ::= INNER",
- /* 493 */ "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",
- /* 494 */ "set_quantifier_opt ::=",
- /* 495 */ "set_quantifier_opt ::= DISTINCT",
- /* 496 */ "set_quantifier_opt ::= ALL",
- /* 497 */ "select_list ::= select_item",
- /* 498 */ "select_list ::= select_list NK_COMMA select_item",
- /* 499 */ "select_item ::= NK_STAR",
- /* 500 */ "select_item ::= common_expression",
- /* 501 */ "select_item ::= common_expression column_alias",
- /* 502 */ "select_item ::= common_expression AS column_alias",
- /* 503 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 504 */ "where_clause_opt ::=",
- /* 505 */ "where_clause_opt ::= WHERE search_condition",
- /* 506 */ "partition_by_clause_opt ::=",
- /* 507 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
- /* 508 */ "partition_list ::= partition_item",
- /* 509 */ "partition_list ::= partition_list NK_COMMA partition_item",
- /* 510 */ "partition_item ::= expr_or_subquery",
- /* 511 */ "partition_item ::= expr_or_subquery column_alias",
- /* 512 */ "partition_item ::= expr_or_subquery AS column_alias",
- /* 513 */ "twindow_clause_opt ::=",
- /* 514 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
- /* 515 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
- /* 516 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
- /* 517 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
- /* 518 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
- /* 519 */ "sliding_opt ::=",
- /* 520 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
- /* 521 */ "fill_opt ::=",
- /* 522 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 523 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
- /* 524 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP",
- /* 525 */ "fill_mode ::= NONE",
- /* 526 */ "fill_mode ::= PREV",
- /* 527 */ "fill_mode ::= NULL",
- /* 528 */ "fill_mode ::= NULL_F",
- /* 529 */ "fill_mode ::= LINEAR",
- /* 530 */ "fill_mode ::= NEXT",
- /* 531 */ "group_by_clause_opt ::=",
- /* 532 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 533 */ "group_by_list ::= expr_or_subquery",
- /* 534 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
- /* 535 */ "having_clause_opt ::=",
- /* 536 */ "having_clause_opt ::= HAVING search_condition",
- /* 537 */ "range_opt ::=",
- /* 538 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
- /* 539 */ "every_opt ::=",
- /* 540 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
- /* 541 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 542 */ "query_simple ::= query_specification",
- /* 543 */ "query_simple ::= union_query_expression",
- /* 544 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
- /* 545 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
- /* 546 */ "query_simple_or_subquery ::= query_simple",
- /* 547 */ "query_simple_or_subquery ::= subquery",
- /* 548 */ "query_or_subquery ::= query_expression",
- /* 549 */ "query_or_subquery ::= subquery",
- /* 550 */ "order_by_clause_opt ::=",
- /* 551 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 552 */ "slimit_clause_opt ::=",
- /* 553 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 554 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 555 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 556 */ "limit_clause_opt ::=",
- /* 557 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 558 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 559 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 560 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 561 */ "subquery ::= NK_LP subquery NK_RP",
- /* 562 */ "search_condition ::= common_expression",
- /* 563 */ "sort_specification_list ::= sort_specification",
- /* 564 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 565 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
- /* 566 */ "ordering_specification_opt ::=",
- /* 567 */ "ordering_specification_opt ::= ASC",
- /* 568 */ "ordering_specification_opt ::= DESC",
- /* 569 */ "null_ordering_opt ::=",
- /* 570 */ "null_ordering_opt ::= NULLS FIRST",
- /* 571 */ "null_ordering_opt ::= NULLS LAST",
+ /* 121 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER",
+ /* 122 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
+ /* 123 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER",
+ /* 124 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
+ /* 125 */ "integer_list ::= NK_INTEGER",
+ /* 126 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
+ /* 127 */ "variable_list ::= NK_VARIABLE",
+ /* 128 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
+ /* 129 */ "retention_list ::= retention",
+ /* 130 */ "retention_list ::= retention_list NK_COMMA retention",
+ /* 131 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
+ /* 132 */ "speed_opt ::=",
+ /* 133 */ "speed_opt ::= MAX_SPEED NK_INTEGER",
+ /* 134 */ "start_opt ::=",
+ /* 135 */ "start_opt ::= START WITH NK_INTEGER",
+ /* 136 */ "start_opt ::= START WITH NK_STRING",
+ /* 137 */ "start_opt ::= START WITH TIMESTAMP NK_STRING",
+ /* 138 */ "end_opt ::=",
+ /* 139 */ "end_opt ::= END WITH NK_INTEGER",
+ /* 140 */ "end_opt ::= END WITH NK_STRING",
+ /* 141 */ "end_opt ::= END WITH TIMESTAMP NK_STRING",
+ /* 142 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
+ /* 143 */ "cmd ::= CREATE TABLE multi_create_clause",
+ /* 144 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
+ /* 145 */ "cmd ::= DROP TABLE multi_drop_clause",
+ /* 146 */ "cmd ::= DROP STABLE exists_opt full_table_name",
+ /* 147 */ "cmd ::= ALTER TABLE alter_table_clause",
+ /* 148 */ "cmd ::= ALTER STABLE alter_table_clause",
+ /* 149 */ "alter_table_clause ::= full_table_name alter_table_options",
+ /* 150 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
+ /* 151 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
+ /* 152 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
+ /* 153 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
+ /* 154 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
+ /* 155 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
+ /* 156 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
+ /* 157 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
+ /* 158 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal",
+ /* 159 */ "multi_create_clause ::= create_subtable_clause",
+ /* 160 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
+ /* 161 */ "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",
+ /* 162 */ "multi_drop_clause ::= drop_table_clause",
+ /* 163 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
+ /* 164 */ "drop_table_clause ::= exists_opt full_table_name",
+ /* 165 */ "specific_cols_opt ::=",
+ /* 166 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
+ /* 167 */ "full_table_name ::= table_name",
+ /* 168 */ "full_table_name ::= db_name NK_DOT table_name",
+ /* 169 */ "column_def_list ::= column_def",
+ /* 170 */ "column_def_list ::= column_def_list NK_COMMA column_def",
+ /* 171 */ "column_def ::= column_name type_name",
+ /* 172 */ "column_def ::= column_name type_name COMMENT NK_STRING",
+ /* 173 */ "type_name ::= BOOL",
+ /* 174 */ "type_name ::= TINYINT",
+ /* 175 */ "type_name ::= SMALLINT",
+ /* 176 */ "type_name ::= INT",
+ /* 177 */ "type_name ::= INTEGER",
+ /* 178 */ "type_name ::= BIGINT",
+ /* 179 */ "type_name ::= FLOAT",
+ /* 180 */ "type_name ::= DOUBLE",
+ /* 181 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
+ /* 182 */ "type_name ::= TIMESTAMP",
+ /* 183 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
+ /* 184 */ "type_name ::= TINYINT UNSIGNED",
+ /* 185 */ "type_name ::= SMALLINT UNSIGNED",
+ /* 186 */ "type_name ::= INT UNSIGNED",
+ /* 187 */ "type_name ::= BIGINT UNSIGNED",
+ /* 188 */ "type_name ::= JSON",
+ /* 189 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
+ /* 190 */ "type_name ::= MEDIUMBLOB",
+ /* 191 */ "type_name ::= BLOB",
+ /* 192 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
+ /* 193 */ "type_name ::= DECIMAL",
+ /* 194 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
+ /* 195 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
+ /* 196 */ "tags_def_opt ::=",
+ /* 197 */ "tags_def_opt ::= tags_def",
+ /* 198 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
+ /* 199 */ "table_options ::=",
+ /* 200 */ "table_options ::= table_options COMMENT NK_STRING",
+ /* 201 */ "table_options ::= table_options MAX_DELAY duration_list",
+ /* 202 */ "table_options ::= table_options WATERMARK duration_list",
+ /* 203 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
+ /* 204 */ "table_options ::= table_options TTL NK_INTEGER",
+ /* 205 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
+ /* 206 */ "table_options ::= table_options DELETE_MARK duration_list",
+ /* 207 */ "alter_table_options ::= alter_table_option",
+ /* 208 */ "alter_table_options ::= alter_table_options alter_table_option",
+ /* 209 */ "alter_table_option ::= COMMENT NK_STRING",
+ /* 210 */ "alter_table_option ::= TTL NK_INTEGER",
+ /* 211 */ "duration_list ::= duration_literal",
+ /* 212 */ "duration_list ::= duration_list NK_COMMA duration_literal",
+ /* 213 */ "rollup_func_list ::= rollup_func_name",
+ /* 214 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
+ /* 215 */ "rollup_func_name ::= function_name",
+ /* 216 */ "rollup_func_name ::= FIRST",
+ /* 217 */ "rollup_func_name ::= LAST",
+ /* 218 */ "col_name_list ::= col_name",
+ /* 219 */ "col_name_list ::= col_name_list NK_COMMA col_name",
+ /* 220 */ "col_name ::= column_name",
+ /* 221 */ "cmd ::= SHOW DNODES",
+ /* 222 */ "cmd ::= SHOW USERS",
+ /* 223 */ "cmd ::= SHOW USER PRIVILEGES",
+ /* 224 */ "cmd ::= SHOW DATABASES",
+ /* 225 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
+ /* 226 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
+ /* 227 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
+ /* 228 */ "cmd ::= SHOW MNODES",
+ /* 229 */ "cmd ::= SHOW QNODES",
+ /* 230 */ "cmd ::= SHOW FUNCTIONS",
+ /* 231 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
+ /* 232 */ "cmd ::= SHOW STREAMS",
+ /* 233 */ "cmd ::= SHOW ACCOUNTS",
+ /* 234 */ "cmd ::= SHOW APPS",
+ /* 235 */ "cmd ::= SHOW CONNECTIONS",
+ /* 236 */ "cmd ::= SHOW LICENCES",
+ /* 237 */ "cmd ::= SHOW GRANTS",
+ /* 238 */ "cmd ::= SHOW CREATE DATABASE db_name",
+ /* 239 */ "cmd ::= SHOW CREATE TABLE full_table_name",
+ /* 240 */ "cmd ::= SHOW CREATE STABLE full_table_name",
+ /* 241 */ "cmd ::= SHOW QUERIES",
+ /* 242 */ "cmd ::= SHOW SCORES",
+ /* 243 */ "cmd ::= SHOW TOPICS",
+ /* 244 */ "cmd ::= SHOW VARIABLES",
+ /* 245 */ "cmd ::= SHOW CLUSTER VARIABLES",
+ /* 246 */ "cmd ::= SHOW LOCAL VARIABLES",
+ /* 247 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
+ /* 248 */ "cmd ::= SHOW BNODES",
+ /* 249 */ "cmd ::= SHOW SNODES",
+ /* 250 */ "cmd ::= SHOW CLUSTER",
+ /* 251 */ "cmd ::= SHOW TRANSACTIONS",
+ /* 252 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
+ /* 253 */ "cmd ::= SHOW CONSUMERS",
+ /* 254 */ "cmd ::= SHOW SUBSCRIPTIONS",
+ /* 255 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
+ /* 256 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
+ /* 257 */ "cmd ::= SHOW VNODES NK_INTEGER",
+ /* 258 */ "cmd ::= SHOW VNODES NK_STRING",
+ /* 259 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
+ /* 260 */ "cmd ::= SHOW CLUSTER ALIVE",
+ /* 261 */ "db_name_cond_opt ::=",
+ /* 262 */ "db_name_cond_opt ::= db_name NK_DOT",
+ /* 263 */ "like_pattern_opt ::=",
+ /* 264 */ "like_pattern_opt ::= LIKE NK_STRING",
+ /* 265 */ "table_name_cond ::= table_name",
+ /* 266 */ "from_db_opt ::=",
+ /* 267 */ "from_db_opt ::= FROM db_name",
+ /* 268 */ "tag_list_opt ::=",
+ /* 269 */ "tag_list_opt ::= tag_item",
+ /* 270 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
+ /* 271 */ "tag_item ::= TBNAME",
+ /* 272 */ "tag_item ::= QTAGS",
+ /* 273 */ "tag_item ::= column_name",
+ /* 274 */ "tag_item ::= column_name column_alias",
+ /* 275 */ "tag_item ::= column_name AS column_alias",
+ /* 276 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options",
+ /* 277 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP",
+ /* 278 */ "cmd ::= DROP INDEX exists_opt full_index_name",
+ /* 279 */ "full_index_name ::= index_name",
+ /* 280 */ "full_index_name ::= db_name NK_DOT index_name",
+ /* 281 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
+ /* 282 */ "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",
+ /* 283 */ "func_list ::= func",
+ /* 284 */ "func_list ::= func_list NK_COMMA func",
+ /* 285 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
+ /* 286 */ "sma_func_name ::= function_name",
+ /* 287 */ "sma_func_name ::= COUNT",
+ /* 288 */ "sma_func_name ::= FIRST",
+ /* 289 */ "sma_func_name ::= LAST",
+ /* 290 */ "sma_func_name ::= LAST_ROW",
+ /* 291 */ "sma_stream_opt ::=",
+ /* 292 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
+ /* 293 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
+ /* 294 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
+ /* 295 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
+ /* 296 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name",
+ /* 297 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name",
+ /* 298 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name",
+ /* 299 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name",
+ /* 300 */ "cmd ::= DROP TOPIC exists_opt topic_name",
+ /* 301 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
+ /* 302 */ "cmd ::= DESC full_table_name",
+ /* 303 */ "cmd ::= DESCRIBE full_table_name",
+ /* 304 */ "cmd ::= RESET QUERY CACHE",
+ /* 305 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
+ /* 306 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
+ /* 307 */ "analyze_opt ::=",
+ /* 308 */ "analyze_opt ::= ANALYZE",
+ /* 309 */ "explain_options ::=",
+ /* 310 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
+ /* 311 */ "explain_options ::= explain_options RATIO NK_FLOAT",
+ /* 312 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt",
+ /* 313 */ "cmd ::= DROP FUNCTION exists_opt function_name",
+ /* 314 */ "agg_func_opt ::=",
+ /* 315 */ "agg_func_opt ::= AGGREGATE",
+ /* 316 */ "bufsize_opt ::=",
+ /* 317 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
+ /* 318 */ "language_opt ::=",
+ /* 319 */ "language_opt ::= LANGUAGE NK_STRING",
+ /* 320 */ "or_replace_opt ::=",
+ /* 321 */ "or_replace_opt ::= OR REPLACE",
+ /* 322 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery",
+ /* 323 */ "cmd ::= DROP STREAM exists_opt stream_name",
+ /* 324 */ "col_list_opt ::=",
+ /* 325 */ "col_list_opt ::= NK_LP col_name_list NK_RP",
+ /* 326 */ "tag_def_or_ref_opt ::=",
+ /* 327 */ "tag_def_or_ref_opt ::= tags_def",
+ /* 328 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP",
+ /* 329 */ "stream_options ::=",
+ /* 330 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
+ /* 331 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
+ /* 332 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
+ /* 333 */ "stream_options ::= stream_options WATERMARK duration_literal",
+ /* 334 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
+ /* 335 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
+ /* 336 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
+ /* 337 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
+ /* 338 */ "subtable_opt ::=",
+ /* 339 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
+ /* 340 */ "cmd ::= KILL CONNECTION NK_INTEGER",
+ /* 341 */ "cmd ::= KILL QUERY NK_STRING",
+ /* 342 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
+ /* 343 */ "cmd ::= BALANCE VGROUP",
+ /* 344 */ "cmd ::= BALANCE VGROUP LEADER",
+ /* 345 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
+ /* 346 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
+ /* 347 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
+ /* 348 */ "dnode_list ::= DNODE NK_INTEGER",
+ /* 349 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
+ /* 350 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
+ /* 351 */ "cmd ::= query_or_subquery",
+ /* 352 */ "cmd ::= insert_query",
+ /* 353 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
+ /* 354 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
+ /* 355 */ "literal ::= NK_INTEGER",
+ /* 356 */ "literal ::= NK_FLOAT",
+ /* 357 */ "literal ::= NK_STRING",
+ /* 358 */ "literal ::= NK_BOOL",
+ /* 359 */ "literal ::= TIMESTAMP NK_STRING",
+ /* 360 */ "literal ::= duration_literal",
+ /* 361 */ "literal ::= NULL",
+ /* 362 */ "literal ::= NK_QUESTION",
+ /* 363 */ "duration_literal ::= NK_VARIABLE",
+ /* 364 */ "signed ::= NK_INTEGER",
+ /* 365 */ "signed ::= NK_PLUS NK_INTEGER",
+ /* 366 */ "signed ::= NK_MINUS NK_INTEGER",
+ /* 367 */ "signed ::= NK_FLOAT",
+ /* 368 */ "signed ::= NK_PLUS NK_FLOAT",
+ /* 369 */ "signed ::= NK_MINUS NK_FLOAT",
+ /* 370 */ "signed_literal ::= signed",
+ /* 371 */ "signed_literal ::= NK_STRING",
+ /* 372 */ "signed_literal ::= NK_BOOL",
+ /* 373 */ "signed_literal ::= TIMESTAMP NK_STRING",
+ /* 374 */ "signed_literal ::= duration_literal",
+ /* 375 */ "signed_literal ::= NULL",
+ /* 376 */ "signed_literal ::= literal_func",
+ /* 377 */ "signed_literal ::= NK_QUESTION",
+ /* 378 */ "literal_list ::= signed_literal",
+ /* 379 */ "literal_list ::= literal_list NK_COMMA signed_literal",
+ /* 380 */ "db_name ::= NK_ID",
+ /* 381 */ "table_name ::= NK_ID",
+ /* 382 */ "column_name ::= NK_ID",
+ /* 383 */ "function_name ::= NK_ID",
+ /* 384 */ "table_alias ::= NK_ID",
+ /* 385 */ "column_alias ::= NK_ID",
+ /* 386 */ "user_name ::= NK_ID",
+ /* 387 */ "topic_name ::= NK_ID",
+ /* 388 */ "stream_name ::= NK_ID",
+ /* 389 */ "cgroup_name ::= NK_ID",
+ /* 390 */ "index_name ::= NK_ID",
+ /* 391 */ "expr_or_subquery ::= expression",
+ /* 392 */ "expression ::= literal",
+ /* 393 */ "expression ::= pseudo_column",
+ /* 394 */ "expression ::= column_reference",
+ /* 395 */ "expression ::= function_expression",
+ /* 396 */ "expression ::= case_when_expression",
+ /* 397 */ "expression ::= NK_LP expression NK_RP",
+ /* 398 */ "expression ::= NK_PLUS expr_or_subquery",
+ /* 399 */ "expression ::= NK_MINUS expr_or_subquery",
+ /* 400 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
+ /* 401 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
+ /* 402 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
+ /* 403 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
+ /* 404 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
+ /* 405 */ "expression ::= column_reference NK_ARROW NK_STRING",
+ /* 406 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
+ /* 407 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
+ /* 408 */ "expression_list ::= expr_or_subquery",
+ /* 409 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
+ /* 410 */ "column_reference ::= column_name",
+ /* 411 */ "column_reference ::= table_name NK_DOT column_name",
+ /* 412 */ "pseudo_column ::= ROWTS",
+ /* 413 */ "pseudo_column ::= TBNAME",
+ /* 414 */ "pseudo_column ::= table_name NK_DOT TBNAME",
+ /* 415 */ "pseudo_column ::= QSTART",
+ /* 416 */ "pseudo_column ::= QEND",
+ /* 417 */ "pseudo_column ::= QDURATION",
+ /* 418 */ "pseudo_column ::= WSTART",
+ /* 419 */ "pseudo_column ::= WEND",
+ /* 420 */ "pseudo_column ::= WDURATION",
+ /* 421 */ "pseudo_column ::= IROWTS",
+ /* 422 */ "pseudo_column ::= ISFILLED",
+ /* 423 */ "pseudo_column ::= QTAGS",
+ /* 424 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
+ /* 425 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
+ /* 426 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
+ /* 427 */ "function_expression ::= literal_func",
+ /* 428 */ "literal_func ::= noarg_func NK_LP NK_RP",
+ /* 429 */ "literal_func ::= NOW",
+ /* 430 */ "noarg_func ::= NOW",
+ /* 431 */ "noarg_func ::= TODAY",
+ /* 432 */ "noarg_func ::= TIMEZONE",
+ /* 433 */ "noarg_func ::= DATABASE",
+ /* 434 */ "noarg_func ::= CLIENT_VERSION",
+ /* 435 */ "noarg_func ::= SERVER_VERSION",
+ /* 436 */ "noarg_func ::= SERVER_STATUS",
+ /* 437 */ "noarg_func ::= CURRENT_USER",
+ /* 438 */ "noarg_func ::= USER",
+ /* 439 */ "star_func ::= COUNT",
+ /* 440 */ "star_func ::= FIRST",
+ /* 441 */ "star_func ::= LAST",
+ /* 442 */ "star_func ::= LAST_ROW",
+ /* 443 */ "star_func_para_list ::= NK_STAR",
+ /* 444 */ "star_func_para_list ::= other_para_list",
+ /* 445 */ "other_para_list ::= star_func_para",
+ /* 446 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
+ /* 447 */ "star_func_para ::= expr_or_subquery",
+ /* 448 */ "star_func_para ::= table_name NK_DOT NK_STAR",
+ /* 449 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
+ /* 450 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
+ /* 451 */ "when_then_list ::= when_then_expr",
+ /* 452 */ "when_then_list ::= when_then_list when_then_expr",
+ /* 453 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
+ /* 454 */ "case_when_else_opt ::=",
+ /* 455 */ "case_when_else_opt ::= ELSE common_expression",
+ /* 456 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
+ /* 457 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 458 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 459 */ "predicate ::= expr_or_subquery IS NULL",
+ /* 460 */ "predicate ::= expr_or_subquery IS NOT NULL",
+ /* 461 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
+ /* 462 */ "compare_op ::= NK_LT",
+ /* 463 */ "compare_op ::= NK_GT",
+ /* 464 */ "compare_op ::= NK_LE",
+ /* 465 */ "compare_op ::= NK_GE",
+ /* 466 */ "compare_op ::= NK_NE",
+ /* 467 */ "compare_op ::= NK_EQ",
+ /* 468 */ "compare_op ::= LIKE",
+ /* 469 */ "compare_op ::= NOT LIKE",
+ /* 470 */ "compare_op ::= MATCH",
+ /* 471 */ "compare_op ::= NMATCH",
+ /* 472 */ "compare_op ::= CONTAINS",
+ /* 473 */ "in_op ::= IN",
+ /* 474 */ "in_op ::= NOT IN",
+ /* 475 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
+ /* 476 */ "boolean_value_expression ::= boolean_primary",
+ /* 477 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 478 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 479 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 480 */ "boolean_primary ::= predicate",
+ /* 481 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 482 */ "common_expression ::= expr_or_subquery",
+ /* 483 */ "common_expression ::= boolean_value_expression",
+ /* 484 */ "from_clause_opt ::=",
+ /* 485 */ "from_clause_opt ::= FROM table_reference_list",
+ /* 486 */ "table_reference_list ::= table_reference",
+ /* 487 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 488 */ "table_reference ::= table_primary",
+ /* 489 */ "table_reference ::= joined_table",
+ /* 490 */ "table_primary ::= table_name alias_opt",
+ /* 491 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 492 */ "table_primary ::= subquery alias_opt",
+ /* 493 */ "table_primary ::= parenthesized_joined_table",
+ /* 494 */ "alias_opt ::=",
+ /* 495 */ "alias_opt ::= table_alias",
+ /* 496 */ "alias_opt ::= AS table_alias",
+ /* 497 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 498 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 499 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
+ /* 500 */ "join_type ::=",
+ /* 501 */ "join_type ::= INNER",
+ /* 502 */ "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",
+ /* 503 */ "set_quantifier_opt ::=",
+ /* 504 */ "set_quantifier_opt ::= DISTINCT",
+ /* 505 */ "set_quantifier_opt ::= ALL",
+ /* 506 */ "select_list ::= select_item",
+ /* 507 */ "select_list ::= select_list NK_COMMA select_item",
+ /* 508 */ "select_item ::= NK_STAR",
+ /* 509 */ "select_item ::= common_expression",
+ /* 510 */ "select_item ::= common_expression column_alias",
+ /* 511 */ "select_item ::= common_expression AS column_alias",
+ /* 512 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 513 */ "where_clause_opt ::=",
+ /* 514 */ "where_clause_opt ::= WHERE search_condition",
+ /* 515 */ "partition_by_clause_opt ::=",
+ /* 516 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
+ /* 517 */ "partition_list ::= partition_item",
+ /* 518 */ "partition_list ::= partition_list NK_COMMA partition_item",
+ /* 519 */ "partition_item ::= expr_or_subquery",
+ /* 520 */ "partition_item ::= expr_or_subquery column_alias",
+ /* 521 */ "partition_item ::= expr_or_subquery AS column_alias",
+ /* 522 */ "twindow_clause_opt ::=",
+ /* 523 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
+ /* 524 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
+ /* 525 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
+ /* 526 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
+ /* 527 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
+ /* 528 */ "sliding_opt ::=",
+ /* 529 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
+ /* 530 */ "fill_opt ::=",
+ /* 531 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 532 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
+ /* 533 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP",
+ /* 534 */ "fill_mode ::= NONE",
+ /* 535 */ "fill_mode ::= PREV",
+ /* 536 */ "fill_mode ::= NULL",
+ /* 537 */ "fill_mode ::= NULL_F",
+ /* 538 */ "fill_mode ::= LINEAR",
+ /* 539 */ "fill_mode ::= NEXT",
+ /* 540 */ "group_by_clause_opt ::=",
+ /* 541 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 542 */ "group_by_list ::= expr_or_subquery",
+ /* 543 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
+ /* 544 */ "having_clause_opt ::=",
+ /* 545 */ "having_clause_opt ::= HAVING search_condition",
+ /* 546 */ "range_opt ::=",
+ /* 547 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
+ /* 548 */ "every_opt ::=",
+ /* 549 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
+ /* 550 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 551 */ "query_simple ::= query_specification",
+ /* 552 */ "query_simple ::= union_query_expression",
+ /* 553 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
+ /* 554 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
+ /* 555 */ "query_simple_or_subquery ::= query_simple",
+ /* 556 */ "query_simple_or_subquery ::= subquery",
+ /* 557 */ "query_or_subquery ::= query_expression",
+ /* 558 */ "query_or_subquery ::= subquery",
+ /* 559 */ "order_by_clause_opt ::=",
+ /* 560 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 561 */ "slimit_clause_opt ::=",
+ /* 562 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 563 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 564 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 565 */ "limit_clause_opt ::=",
+ /* 566 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 567 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 568 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 569 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 570 */ "subquery ::= NK_LP subquery NK_RP",
+ /* 571 */ "search_condition ::= common_expression",
+ /* 572 */ "sort_specification_list ::= sort_specification",
+ /* 573 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 574 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
+ /* 575 */ "ordering_specification_opt ::=",
+ /* 576 */ "ordering_specification_opt ::= ASC",
+ /* 577 */ "ordering_specification_opt ::= DESC",
+ /* 578 */ "null_ordering_opt ::=",
+ /* 579 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 580 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
@@ -2559,201 +2662,203 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
- case 328: /* cmd */
- case 331: /* literal */
- case 344: /* db_options */
- case 346: /* alter_db_options */
- case 348: /* start_opt */
- case 349: /* end_opt */
- case 354: /* retention */
- case 355: /* full_table_name */
- case 358: /* table_options */
- case 362: /* alter_table_clause */
- case 363: /* alter_table_options */
- case 366: /* signed_literal */
- case 367: /* create_subtable_clause */
- case 370: /* drop_table_clause */
- case 373: /* column_def */
- case 377: /* duration_literal */
- case 378: /* rollup_func_name */
- case 380: /* col_name */
- case 381: /* db_name_cond_opt */
- case 382: /* like_pattern_opt */
- case 383: /* table_name_cond */
- case 384: /* from_db_opt */
- case 386: /* tag_item */
- case 388: /* full_index_name */
- case 389: /* index_options */
- case 392: /* sliding_opt */
- case 393: /* sma_stream_opt */
- case 394: /* func */
- case 396: /* query_or_subquery */
- case 399: /* explain_options */
- case 400: /* insert_query */
- case 404: /* stream_options */
- case 407: /* subtable_opt */
- case 408: /* expression */
- case 410: /* where_clause_opt */
- case 411: /* signed */
- case 412: /* literal_func */
- case 415: /* expr_or_subquery */
- case 416: /* pseudo_column */
- case 417: /* column_reference */
- case 418: /* function_expression */
- case 419: /* case_when_expression */
- case 424: /* star_func_para */
- case 426: /* case_when_else_opt */
- case 427: /* common_expression */
- case 428: /* when_then_expr */
- case 429: /* predicate */
- case 432: /* in_predicate_value */
- case 433: /* boolean_value_expression */
- case 434: /* boolean_primary */
- case 435: /* from_clause_opt */
- case 436: /* table_reference_list */
- case 437: /* table_reference */
- case 438: /* table_primary */
- case 439: /* joined_table */
- case 441: /* subquery */
- case 442: /* parenthesized_joined_table */
- case 444: /* search_condition */
- case 445: /* query_specification */
- case 449: /* range_opt */
- case 450: /* every_opt */
- case 451: /* fill_opt */
- case 452: /* twindow_clause_opt */
- case 454: /* having_clause_opt */
- case 455: /* select_item */
- case 457: /* partition_item */
- case 460: /* query_expression */
- case 461: /* query_simple */
- case 463: /* slimit_clause_opt */
- case 464: /* limit_clause_opt */
- case 465: /* union_query_expression */
- case 466: /* query_simple_or_subquery */
- case 468: /* sort_specification */
+ case 330: /* cmd */
+ case 333: /* literal */
+ case 346: /* db_options */
+ case 348: /* alter_db_options */
+ case 350: /* start_opt */
+ case 351: /* end_opt */
+ case 356: /* retention */
+ case 357: /* full_table_name */
+ case 360: /* table_options */
+ case 364: /* alter_table_clause */
+ case 365: /* alter_table_options */
+ case 368: /* signed_literal */
+ case 369: /* create_subtable_clause */
+ case 372: /* drop_table_clause */
+ case 375: /* column_def */
+ case 379: /* duration_literal */
+ case 380: /* rollup_func_name */
+ case 382: /* col_name */
+ case 383: /* db_name_cond_opt */
+ case 384: /* like_pattern_opt */
+ case 385: /* table_name_cond */
+ case 386: /* from_db_opt */
+ case 388: /* tag_item */
+ case 390: /* full_index_name */
+ case 391: /* index_options */
+ case 394: /* sliding_opt */
+ case 395: /* sma_stream_opt */
+ case 396: /* func */
+ case 398: /* query_or_subquery */
+ case 401: /* explain_options */
+ case 402: /* insert_query */
+ case 408: /* stream_options */
+ case 411: /* subtable_opt */
+ case 412: /* expression */
+ case 414: /* where_clause_opt */
+ case 415: /* signed */
+ case 416: /* literal_func */
+ case 419: /* expr_or_subquery */
+ case 420: /* pseudo_column */
+ case 421: /* column_reference */
+ case 422: /* function_expression */
+ case 423: /* case_when_expression */
+ case 428: /* star_func_para */
+ case 430: /* case_when_else_opt */
+ case 431: /* common_expression */
+ case 432: /* when_then_expr */
+ case 433: /* predicate */
+ case 436: /* in_predicate_value */
+ case 437: /* boolean_value_expression */
+ case 438: /* boolean_primary */
+ case 439: /* from_clause_opt */
+ case 440: /* table_reference_list */
+ case 441: /* table_reference */
+ case 442: /* table_primary */
+ case 443: /* joined_table */
+ case 445: /* subquery */
+ case 446: /* parenthesized_joined_table */
+ case 448: /* search_condition */
+ case 449: /* query_specification */
+ case 453: /* range_opt */
+ case 454: /* every_opt */
+ case 455: /* fill_opt */
+ case 456: /* twindow_clause_opt */
+ case 458: /* having_clause_opt */
+ case 459: /* select_item */
+ case 461: /* partition_item */
+ case 464: /* query_expression */
+ case 465: /* query_simple */
+ case 467: /* slimit_clause_opt */
+ case 468: /* limit_clause_opt */
+ case 469: /* union_query_expression */
+ case 470: /* query_simple_or_subquery */
+ case 472: /* sort_specification */
{
- nodesDestroyNode((yypminor->yy140));
+ nodesDestroyNode((yypminor->yy712));
}
break;
- case 329: /* account_options */
- case 330: /* alter_account_options */
- case 332: /* alter_account_option */
- case 347: /* speed_opt */
- case 402: /* bufsize_opt */
+ case 331: /* account_options */
+ case 332: /* alter_account_options */
+ case 334: /* alter_account_option */
+ case 349: /* speed_opt */
+ case 405: /* bufsize_opt */
{
}
break;
- case 333: /* user_name */
- case 336: /* priv_level */
- case 339: /* db_name */
- case 340: /* topic_name */
- case 341: /* dnode_endpoint */
- case 364: /* column_name */
- case 372: /* table_name */
- case 379: /* function_name */
- case 387: /* column_alias */
- case 390: /* index_name */
- case 395: /* sma_func_name */
- case 397: /* cgroup_name */
- case 403: /* stream_name */
- case 414: /* table_alias */
- case 420: /* star_func */
- case 422: /* noarg_func */
- case 440: /* alias_opt */
+ case 335: /* user_name */
+ case 338: /* priv_level */
+ case 341: /* db_name */
+ case 342: /* topic_name */
+ case 343: /* dnode_endpoint */
+ case 366: /* column_name */
+ case 374: /* table_name */
+ case 381: /* function_name */
+ case 389: /* column_alias */
+ case 392: /* index_name */
+ case 397: /* sma_func_name */
+ case 399: /* cgroup_name */
+ case 406: /* language_opt */
+ case 407: /* stream_name */
+ case 418: /* table_alias */
+ case 424: /* star_func */
+ case 426: /* noarg_func */
+ case 444: /* alias_opt */
{
}
break;
- case 334: /* sysinfo_opt */
+ case 336: /* sysinfo_opt */
{
}
break;
- case 335: /* privileges */
- case 337: /* priv_type_list */
- case 338: /* priv_type */
+ case 337: /* privileges */
+ case 339: /* priv_type_list */
+ case 340: /* priv_type */
{
}
break;
- case 342: /* force_opt */
- case 343: /* not_exists_opt */
- case 345: /* exists_opt */
- case 398: /* analyze_opt */
- case 401: /* agg_func_opt */
- case 446: /* set_quantifier_opt */
+ case 344: /* force_opt */
+ case 345: /* not_exists_opt */
+ case 347: /* exists_opt */
+ case 400: /* analyze_opt */
+ case 403: /* or_replace_opt */
+ case 404: /* agg_func_opt */
+ case 450: /* set_quantifier_opt */
{
}
break;
- case 350: /* integer_list */
- case 351: /* variable_list */
- case 352: /* retention_list */
- case 356: /* column_def_list */
- case 357: /* tags_def_opt */
- case 359: /* multi_create_clause */
- case 360: /* tags_def */
- case 361: /* multi_drop_clause */
- case 368: /* specific_cols_opt */
- case 369: /* expression_list */
- case 371: /* col_name_list */
- case 374: /* duration_list */
- case 375: /* rollup_func_list */
- case 385: /* tag_list_opt */
- case 391: /* func_list */
- case 405: /* col_list_opt */
- case 406: /* tag_def_or_ref_opt */
- case 409: /* dnode_list */
- case 413: /* literal_list */
- case 421: /* star_func_para_list */
- case 423: /* other_para_list */
- case 425: /* when_then_list */
- case 447: /* select_list */
- case 448: /* partition_by_clause_opt */
- case 453: /* group_by_clause_opt */
- case 456: /* partition_list */
- case 459: /* group_by_list */
- case 462: /* order_by_clause_opt */
- case 467: /* sort_specification_list */
+ case 352: /* integer_list */
+ case 353: /* variable_list */
+ case 354: /* retention_list */
+ case 358: /* column_def_list */
+ case 359: /* tags_def_opt */
+ case 361: /* multi_create_clause */
+ case 362: /* tags_def */
+ case 363: /* multi_drop_clause */
+ case 370: /* specific_cols_opt */
+ case 371: /* expression_list */
+ case 373: /* col_name_list */
+ case 376: /* duration_list */
+ case 377: /* rollup_func_list */
+ case 387: /* tag_list_opt */
+ case 393: /* func_list */
+ case 409: /* col_list_opt */
+ case 410: /* tag_def_or_ref_opt */
+ case 413: /* dnode_list */
+ case 417: /* literal_list */
+ case 425: /* star_func_para_list */
+ case 427: /* other_para_list */
+ case 429: /* when_then_list */
+ case 451: /* select_list */
+ case 452: /* partition_by_clause_opt */
+ case 457: /* group_by_clause_opt */
+ case 460: /* partition_list */
+ case 463: /* group_by_list */
+ case 466: /* order_by_clause_opt */
+ case 471: /* sort_specification_list */
{
- nodesDestroyList((yypminor->yy220));
+ nodesDestroyList((yypminor->yy274));
}
break;
- case 353: /* alter_db_option */
- case 376: /* alter_table_option */
+ case 355: /* alter_db_option */
+ case 378: /* alter_table_option */
{
}
break;
- case 365: /* type_name */
+ case 367: /* type_name */
{
}
break;
- case 430: /* compare_op */
- case 431: /* in_op */
+ case 434: /* compare_op */
+ case 435: /* in_op */
{
}
break;
- case 443: /* join_type */
+ case 447: /* join_type */
{
}
break;
- case 458: /* fill_mode */
+ case 462: /* fill_mode */
{
}
break;
- case 469: /* ordering_specification_opt */
+ case 473: /* ordering_specification_opt */
{
}
break;
- case 470: /* null_ordering_opt */
+ case 474: /* null_ordering_opt */
{
}
@@ -3052,578 +3157,587 @@ 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[] = {
- { 328, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
- { 328, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
- { 329, 0 }, /* (2) account_options ::= */
- { 329, -3 }, /* (3) account_options ::= account_options PPS literal */
- { 329, -3 }, /* (4) account_options ::= account_options TSERIES literal */
- { 329, -3 }, /* (5) account_options ::= account_options STORAGE literal */
- { 329, -3 }, /* (6) account_options ::= account_options STREAMS literal */
- { 329, -3 }, /* (7) account_options ::= account_options QTIME literal */
- { 329, -3 }, /* (8) account_options ::= account_options DBS literal */
- { 329, -3 }, /* (9) account_options ::= account_options USERS literal */
- { 329, -3 }, /* (10) account_options ::= account_options CONNS literal */
- { 329, -3 }, /* (11) account_options ::= account_options STATE literal */
- { 330, -1 }, /* (12) alter_account_options ::= alter_account_option */
- { 330, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
- { 332, -2 }, /* (14) alter_account_option ::= PASS literal */
- { 332, -2 }, /* (15) alter_account_option ::= PPS literal */
- { 332, -2 }, /* (16) alter_account_option ::= TSERIES literal */
- { 332, -2 }, /* (17) alter_account_option ::= STORAGE literal */
- { 332, -2 }, /* (18) alter_account_option ::= STREAMS literal */
- { 332, -2 }, /* (19) alter_account_option ::= QTIME literal */
- { 332, -2 }, /* (20) alter_account_option ::= DBS literal */
- { 332, -2 }, /* (21) alter_account_option ::= USERS literal */
- { 332, -2 }, /* (22) alter_account_option ::= CONNS literal */
- { 332, -2 }, /* (23) alter_account_option ::= STATE literal */
- { 328, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
- { 328, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
- { 328, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
- { 328, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
- { 328, -3 }, /* (28) cmd ::= DROP USER user_name */
- { 334, 0 }, /* (29) sysinfo_opt ::= */
- { 334, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
- { 328, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
- { 328, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
- { 335, -1 }, /* (33) privileges ::= ALL */
- { 335, -1 }, /* (34) privileges ::= priv_type_list */
- { 335, -1 }, /* (35) privileges ::= SUBSCRIBE */
- { 337, -1 }, /* (36) priv_type_list ::= priv_type */
- { 337, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */
- { 338, -1 }, /* (38) priv_type ::= READ */
- { 338, -1 }, /* (39) priv_type ::= WRITE */
- { 336, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */
- { 336, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */
- { 336, -1 }, /* (42) priv_level ::= topic_name */
- { 328, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */
- { 328, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
- { 328, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */
- { 328, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */
- { 328, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
- { 328, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
- { 328, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */
- { 328, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
- { 341, -1 }, /* (51) dnode_endpoint ::= NK_STRING */
- { 341, -1 }, /* (52) dnode_endpoint ::= NK_ID */
- { 341, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */
- { 342, 0 }, /* (54) force_opt ::= */
- { 342, -1 }, /* (55) force_opt ::= FORCE */
- { 328, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */
- { 328, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
- { 328, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
- { 328, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
- { 328, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */
- { 328, -2 }, /* (68) cmd ::= USE db_name */
- { 328, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */
- { 328, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */
- { 328, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */
- { 328, -5 }, /* (72) cmd ::= COMPACT DATABASE db_name start_opt end_opt */
- { 343, -3 }, /* (73) not_exists_opt ::= IF NOT EXISTS */
- { 343, 0 }, /* (74) not_exists_opt ::= */
- { 345, -2 }, /* (75) exists_opt ::= IF EXISTS */
- { 345, 0 }, /* (76) exists_opt ::= */
- { 344, 0 }, /* (77) db_options ::= */
- { 344, -3 }, /* (78) db_options ::= db_options BUFFER NK_INTEGER */
- { 344, -3 }, /* (79) db_options ::= db_options CACHEMODEL NK_STRING */
- { 344, -3 }, /* (80) db_options ::= db_options CACHESIZE NK_INTEGER */
- { 344, -3 }, /* (81) db_options ::= db_options COMP NK_INTEGER */
- { 344, -3 }, /* (82) db_options ::= db_options DURATION NK_INTEGER */
- { 344, -3 }, /* (83) db_options ::= db_options DURATION NK_VARIABLE */
- { 344, -3 }, /* (84) db_options ::= db_options MAXROWS NK_INTEGER */
- { 344, -3 }, /* (85) db_options ::= db_options MINROWS NK_INTEGER */
- { 344, -3 }, /* (86) db_options ::= db_options KEEP integer_list */
- { 344, -3 }, /* (87) db_options ::= db_options KEEP variable_list */
- { 344, -3 }, /* (88) db_options ::= db_options PAGES NK_INTEGER */
- { 344, -3 }, /* (89) db_options ::= db_options PAGESIZE NK_INTEGER */
- { 344, -3 }, /* (90) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
- { 344, -3 }, /* (91) db_options ::= db_options PRECISION NK_STRING */
- { 344, -3 }, /* (92) db_options ::= db_options REPLICA NK_INTEGER */
- { 344, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */
- { 344, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
- { 344, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */
- { 344, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */
- { 344, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */
- { 344, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
- { 344, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
- { 344, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
- { 344, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
- { 344, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
- { 344, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
- { 344, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
- { 344, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */
- { 344, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */
- { 344, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
- { 346, -1 }, /* (108) alter_db_options ::= alter_db_option */
- { 346, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */
- { 353, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */
- { 353, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */
- { 353, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */
- { 353, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
- { 353, -2 }, /* (114) alter_db_option ::= KEEP integer_list */
- { 353, -2 }, /* (115) alter_db_option ::= KEEP variable_list */
- { 353, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */
- { 353, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */
- { 353, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */
- { 353, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */
- { 353, -2 }, /* (120) alter_db_option ::= MINROWS NK_INTEGER */
- { 350, -1 }, /* (121) integer_list ::= NK_INTEGER */
- { 350, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */
- { 351, -1 }, /* (123) variable_list ::= NK_VARIABLE */
- { 351, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
- { 352, -1 }, /* (125) retention_list ::= retention */
- { 352, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */
- { 354, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
- { 347, 0 }, /* (128) speed_opt ::= */
- { 347, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */
- { 348, 0 }, /* (130) start_opt ::= */
- { 348, -3 }, /* (131) start_opt ::= START WITH NK_INTEGER */
- { 348, -3 }, /* (132) start_opt ::= START WITH NK_STRING */
- { 348, -4 }, /* (133) start_opt ::= START WITH TIMESTAMP NK_STRING */
- { 349, 0 }, /* (134) end_opt ::= */
- { 349, -3 }, /* (135) end_opt ::= END WITH NK_INTEGER */
- { 349, -3 }, /* (136) end_opt ::= END WITH NK_STRING */
- { 349, -4 }, /* (137) end_opt ::= END WITH TIMESTAMP NK_STRING */
- { 328, -9 }, /* (138) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- { 328, -3 }, /* (139) cmd ::= CREATE TABLE multi_create_clause */
- { 328, -9 }, /* (140) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
- { 328, -3 }, /* (141) cmd ::= DROP TABLE multi_drop_clause */
- { 328, -4 }, /* (142) cmd ::= DROP STABLE exists_opt full_table_name */
- { 328, -3 }, /* (143) cmd ::= ALTER TABLE alter_table_clause */
- { 328, -3 }, /* (144) cmd ::= ALTER STABLE alter_table_clause */
- { 362, -2 }, /* (145) alter_table_clause ::= full_table_name alter_table_options */
- { 362, -5 }, /* (146) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
- { 362, -4 }, /* (147) alter_table_clause ::= full_table_name DROP COLUMN column_name */
- { 362, -5 }, /* (148) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
- { 362, -5 }, /* (149) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
- { 362, -5 }, /* (150) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
- { 362, -4 }, /* (151) alter_table_clause ::= full_table_name DROP TAG column_name */
- { 362, -5 }, /* (152) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
- { 362, -5 }, /* (153) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
- { 362, -6 }, /* (154) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
- { 359, -1 }, /* (155) multi_create_clause ::= create_subtable_clause */
- { 359, -2 }, /* (156) multi_create_clause ::= multi_create_clause create_subtable_clause */
- { 367, -10 }, /* (157) 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 */
- { 361, -1 }, /* (158) multi_drop_clause ::= drop_table_clause */
- { 361, -3 }, /* (159) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */
- { 370, -2 }, /* (160) drop_table_clause ::= exists_opt full_table_name */
- { 368, 0 }, /* (161) specific_cols_opt ::= */
- { 368, -3 }, /* (162) specific_cols_opt ::= NK_LP col_name_list NK_RP */
- { 355, -1 }, /* (163) full_table_name ::= table_name */
- { 355, -3 }, /* (164) full_table_name ::= db_name NK_DOT table_name */
- { 356, -1 }, /* (165) column_def_list ::= column_def */
- { 356, -3 }, /* (166) column_def_list ::= column_def_list NK_COMMA column_def */
- { 373, -2 }, /* (167) column_def ::= column_name type_name */
- { 373, -4 }, /* (168) column_def ::= column_name type_name COMMENT NK_STRING */
- { 365, -1 }, /* (169) type_name ::= BOOL */
- { 365, -1 }, /* (170) type_name ::= TINYINT */
- { 365, -1 }, /* (171) type_name ::= SMALLINT */
- { 365, -1 }, /* (172) type_name ::= INT */
- { 365, -1 }, /* (173) type_name ::= INTEGER */
- { 365, -1 }, /* (174) type_name ::= BIGINT */
- { 365, -1 }, /* (175) type_name ::= FLOAT */
- { 365, -1 }, /* (176) type_name ::= DOUBLE */
- { 365, -4 }, /* (177) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
- { 365, -1 }, /* (178) type_name ::= TIMESTAMP */
- { 365, -4 }, /* (179) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
- { 365, -2 }, /* (180) type_name ::= TINYINT UNSIGNED */
- { 365, -2 }, /* (181) type_name ::= SMALLINT UNSIGNED */
- { 365, -2 }, /* (182) type_name ::= INT UNSIGNED */
- { 365, -2 }, /* (183) type_name ::= BIGINT UNSIGNED */
- { 365, -1 }, /* (184) type_name ::= JSON */
- { 365, -4 }, /* (185) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
- { 365, -1 }, /* (186) type_name ::= MEDIUMBLOB */
- { 365, -1 }, /* (187) type_name ::= BLOB */
- { 365, -4 }, /* (188) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
- { 365, -1 }, /* (189) type_name ::= DECIMAL */
- { 365, -4 }, /* (190) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
- { 365, -6 }, /* (191) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
- { 357, 0 }, /* (192) tags_def_opt ::= */
- { 357, -1 }, /* (193) tags_def_opt ::= tags_def */
- { 360, -4 }, /* (194) tags_def ::= TAGS NK_LP column_def_list NK_RP */
- { 358, 0 }, /* (195) table_options ::= */
- { 358, -3 }, /* (196) table_options ::= table_options COMMENT NK_STRING */
- { 358, -3 }, /* (197) table_options ::= table_options MAX_DELAY duration_list */
- { 358, -3 }, /* (198) table_options ::= table_options WATERMARK duration_list */
- { 358, -5 }, /* (199) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
- { 358, -3 }, /* (200) table_options ::= table_options TTL NK_INTEGER */
- { 358, -5 }, /* (201) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
- { 358, -3 }, /* (202) table_options ::= table_options DELETE_MARK duration_list */
- { 363, -1 }, /* (203) alter_table_options ::= alter_table_option */
- { 363, -2 }, /* (204) alter_table_options ::= alter_table_options alter_table_option */
- { 376, -2 }, /* (205) alter_table_option ::= COMMENT NK_STRING */
- { 376, -2 }, /* (206) alter_table_option ::= TTL NK_INTEGER */
- { 374, -1 }, /* (207) duration_list ::= duration_literal */
- { 374, -3 }, /* (208) duration_list ::= duration_list NK_COMMA duration_literal */
- { 375, -1 }, /* (209) rollup_func_list ::= rollup_func_name */
- { 375, -3 }, /* (210) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
- { 378, -1 }, /* (211) rollup_func_name ::= function_name */
- { 378, -1 }, /* (212) rollup_func_name ::= FIRST */
- { 378, -1 }, /* (213) rollup_func_name ::= LAST */
- { 371, -1 }, /* (214) col_name_list ::= col_name */
- { 371, -3 }, /* (215) col_name_list ::= col_name_list NK_COMMA col_name */
- { 380, -1 }, /* (216) col_name ::= column_name */
- { 328, -2 }, /* (217) cmd ::= SHOW DNODES */
- { 328, -2 }, /* (218) cmd ::= SHOW USERS */
- { 328, -3 }, /* (219) cmd ::= SHOW USER PRIVILEGES */
- { 328, -2 }, /* (220) cmd ::= SHOW DATABASES */
- { 328, -4 }, /* (221) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
- { 328, -4 }, /* (222) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
- { 328, -3 }, /* (223) cmd ::= SHOW db_name_cond_opt VGROUPS */
- { 328, -2 }, /* (224) cmd ::= SHOW MNODES */
- { 328, -2 }, /* (225) cmd ::= SHOW QNODES */
- { 328, -2 }, /* (226) cmd ::= SHOW FUNCTIONS */
- { 328, -5 }, /* (227) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
- { 328, -2 }, /* (228) cmd ::= SHOW STREAMS */
- { 328, -2 }, /* (229) cmd ::= SHOW ACCOUNTS */
- { 328, -2 }, /* (230) cmd ::= SHOW APPS */
- { 328, -2 }, /* (231) cmd ::= SHOW CONNECTIONS */
- { 328, -2 }, /* (232) cmd ::= SHOW LICENCES */
- { 328, -2 }, /* (233) cmd ::= SHOW GRANTS */
- { 328, -4 }, /* (234) cmd ::= SHOW CREATE DATABASE db_name */
- { 328, -4 }, /* (235) cmd ::= SHOW CREATE TABLE full_table_name */
- { 328, -4 }, /* (236) cmd ::= SHOW CREATE STABLE full_table_name */
- { 328, -2 }, /* (237) cmd ::= SHOW QUERIES */
- { 328, -2 }, /* (238) cmd ::= SHOW SCORES */
- { 328, -2 }, /* (239) cmd ::= SHOW TOPICS */
- { 328, -2 }, /* (240) cmd ::= SHOW VARIABLES */
- { 328, -3 }, /* (241) cmd ::= SHOW CLUSTER VARIABLES */
- { 328, -3 }, /* (242) cmd ::= SHOW LOCAL VARIABLES */
- { 328, -5 }, /* (243) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
- { 328, -2 }, /* (244) cmd ::= SHOW BNODES */
- { 328, -2 }, /* (245) cmd ::= SHOW SNODES */
- { 328, -2 }, /* (246) cmd ::= SHOW CLUSTER */
- { 328, -2 }, /* (247) cmd ::= SHOW TRANSACTIONS */
- { 328, -4 }, /* (248) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
- { 328, -2 }, /* (249) cmd ::= SHOW CONSUMERS */
- { 328, -2 }, /* (250) cmd ::= SHOW SUBSCRIPTIONS */
- { 328, -5 }, /* (251) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
- { 328, -7 }, /* (252) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
- { 328, -3 }, /* (253) cmd ::= SHOW VNODES NK_INTEGER */
- { 328, -3 }, /* (254) cmd ::= SHOW VNODES NK_STRING */
- { 328, -3 }, /* (255) cmd ::= SHOW db_name_cond_opt ALIVE */
- { 328, -3 }, /* (256) cmd ::= SHOW CLUSTER ALIVE */
- { 381, 0 }, /* (257) db_name_cond_opt ::= */
- { 381, -2 }, /* (258) db_name_cond_opt ::= db_name NK_DOT */
- { 382, 0 }, /* (259) like_pattern_opt ::= */
- { 382, -2 }, /* (260) like_pattern_opt ::= LIKE NK_STRING */
- { 383, -1 }, /* (261) table_name_cond ::= table_name */
- { 384, 0 }, /* (262) from_db_opt ::= */
- { 384, -2 }, /* (263) from_db_opt ::= FROM db_name */
- { 385, 0 }, /* (264) tag_list_opt ::= */
- { 385, -1 }, /* (265) tag_list_opt ::= tag_item */
- { 385, -3 }, /* (266) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */
- { 386, -1 }, /* (267) tag_item ::= TBNAME */
- { 386, -1 }, /* (268) tag_item ::= QTAGS */
- { 386, -1 }, /* (269) tag_item ::= column_name */
- { 386, -2 }, /* (270) tag_item ::= column_name column_alias */
- { 386, -3 }, /* (271) tag_item ::= column_name AS column_alias */
- { 328, -8 }, /* (272) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
- { 328, -9 }, /* (273) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
- { 328, -4 }, /* (274) cmd ::= DROP INDEX exists_opt full_index_name */
- { 388, -1 }, /* (275) full_index_name ::= index_name */
- { 388, -3 }, /* (276) full_index_name ::= db_name NK_DOT index_name */
- { 389, -10 }, /* (277) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
- { 389, -12 }, /* (278) 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 */
- { 391, -1 }, /* (279) func_list ::= func */
- { 391, -3 }, /* (280) func_list ::= func_list NK_COMMA func */
- { 394, -4 }, /* (281) func ::= sma_func_name NK_LP expression_list NK_RP */
- { 395, -1 }, /* (282) sma_func_name ::= function_name */
- { 395, -1 }, /* (283) sma_func_name ::= COUNT */
- { 395, -1 }, /* (284) sma_func_name ::= FIRST */
- { 395, -1 }, /* (285) sma_func_name ::= LAST */
- { 395, -1 }, /* (286) sma_func_name ::= LAST_ROW */
- { 393, 0 }, /* (287) sma_stream_opt ::= */
- { 393, -3 }, /* (288) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
- { 393, -3 }, /* (289) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
- { 393, -3 }, /* (290) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
- { 328, -6 }, /* (291) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
- { 328, -7 }, /* (292) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
- { 328, -9 }, /* (293) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
- { 328, -7 }, /* (294) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
- { 328, -9 }, /* (295) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
- { 328, -4 }, /* (296) cmd ::= DROP TOPIC exists_opt topic_name */
- { 328, -7 }, /* (297) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
- { 328, -2 }, /* (298) cmd ::= DESC full_table_name */
- { 328, -2 }, /* (299) cmd ::= DESCRIBE full_table_name */
- { 328, -3 }, /* (300) cmd ::= RESET QUERY CACHE */
- { 328, -4 }, /* (301) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
- { 328, -4 }, /* (302) cmd ::= EXPLAIN analyze_opt explain_options insert_query */
- { 398, 0 }, /* (303) analyze_opt ::= */
- { 398, -1 }, /* (304) analyze_opt ::= ANALYZE */
- { 399, 0 }, /* (305) explain_options ::= */
- { 399, -3 }, /* (306) explain_options ::= explain_options VERBOSE NK_BOOL */
- { 399, -3 }, /* (307) explain_options ::= explain_options RATIO NK_FLOAT */
- { 328, -10 }, /* (308) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
- { 328, -4 }, /* (309) cmd ::= DROP FUNCTION exists_opt function_name */
- { 401, 0 }, /* (310) agg_func_opt ::= */
- { 401, -1 }, /* (311) agg_func_opt ::= AGGREGATE */
- { 402, 0 }, /* (312) bufsize_opt ::= */
- { 402, -2 }, /* (313) bufsize_opt ::= BUFSIZE NK_INTEGER */
- { 328, -12 }, /* (314) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
- { 328, -4 }, /* (315) cmd ::= DROP STREAM exists_opt stream_name */
- { 405, 0 }, /* (316) col_list_opt ::= */
- { 405, -3 }, /* (317) col_list_opt ::= NK_LP col_name_list NK_RP */
- { 406, 0 }, /* (318) tag_def_or_ref_opt ::= */
- { 406, -1 }, /* (319) tag_def_or_ref_opt ::= tags_def */
- { 406, -4 }, /* (320) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */
- { 404, 0 }, /* (321) stream_options ::= */
- { 404, -3 }, /* (322) stream_options ::= stream_options TRIGGER AT_ONCE */
- { 404, -3 }, /* (323) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
- { 404, -4 }, /* (324) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
- { 404, -3 }, /* (325) stream_options ::= stream_options WATERMARK duration_literal */
- { 404, -4 }, /* (326) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
- { 404, -3 }, /* (327) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
- { 404, -3 }, /* (328) stream_options ::= stream_options DELETE_MARK duration_literal */
- { 404, -4 }, /* (329) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
- { 407, 0 }, /* (330) subtable_opt ::= */
- { 407, -4 }, /* (331) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
- { 328, -3 }, /* (332) cmd ::= KILL CONNECTION NK_INTEGER */
- { 328, -3 }, /* (333) cmd ::= KILL QUERY NK_STRING */
- { 328, -3 }, /* (334) cmd ::= KILL TRANSACTION NK_INTEGER */
- { 328, -2 }, /* (335) cmd ::= BALANCE VGROUP */
- { 328, -4 }, /* (336) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
- { 328, -4 }, /* (337) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
- { 328, -3 }, /* (338) cmd ::= SPLIT VGROUP NK_INTEGER */
- { 409, -2 }, /* (339) dnode_list ::= DNODE NK_INTEGER */
- { 409, -3 }, /* (340) dnode_list ::= dnode_list DNODE NK_INTEGER */
- { 328, -4 }, /* (341) cmd ::= DELETE FROM full_table_name where_clause_opt */
- { 328, -1 }, /* (342) cmd ::= query_or_subquery */
- { 328, -1 }, /* (343) cmd ::= insert_query */
- { 400, -7 }, /* (344) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
- { 400, -4 }, /* (345) insert_query ::= INSERT INTO full_table_name query_or_subquery */
- { 331, -1 }, /* (346) literal ::= NK_INTEGER */
- { 331, -1 }, /* (347) literal ::= NK_FLOAT */
- { 331, -1 }, /* (348) literal ::= NK_STRING */
- { 331, -1 }, /* (349) literal ::= NK_BOOL */
- { 331, -2 }, /* (350) literal ::= TIMESTAMP NK_STRING */
- { 331, -1 }, /* (351) literal ::= duration_literal */
- { 331, -1 }, /* (352) literal ::= NULL */
- { 331, -1 }, /* (353) literal ::= NK_QUESTION */
- { 377, -1 }, /* (354) duration_literal ::= NK_VARIABLE */
- { 411, -1 }, /* (355) signed ::= NK_INTEGER */
- { 411, -2 }, /* (356) signed ::= NK_PLUS NK_INTEGER */
- { 411, -2 }, /* (357) signed ::= NK_MINUS NK_INTEGER */
- { 411, -1 }, /* (358) signed ::= NK_FLOAT */
- { 411, -2 }, /* (359) signed ::= NK_PLUS NK_FLOAT */
- { 411, -2 }, /* (360) signed ::= NK_MINUS NK_FLOAT */
- { 366, -1 }, /* (361) signed_literal ::= signed */
- { 366, -1 }, /* (362) signed_literal ::= NK_STRING */
- { 366, -1 }, /* (363) signed_literal ::= NK_BOOL */
- { 366, -2 }, /* (364) signed_literal ::= TIMESTAMP NK_STRING */
- { 366, -1 }, /* (365) signed_literal ::= duration_literal */
- { 366, -1 }, /* (366) signed_literal ::= NULL */
- { 366, -1 }, /* (367) signed_literal ::= literal_func */
- { 366, -1 }, /* (368) signed_literal ::= NK_QUESTION */
- { 413, -1 }, /* (369) literal_list ::= signed_literal */
- { 413, -3 }, /* (370) literal_list ::= literal_list NK_COMMA signed_literal */
- { 339, -1 }, /* (371) db_name ::= NK_ID */
- { 372, -1 }, /* (372) table_name ::= NK_ID */
- { 364, -1 }, /* (373) column_name ::= NK_ID */
- { 379, -1 }, /* (374) function_name ::= NK_ID */
- { 414, -1 }, /* (375) table_alias ::= NK_ID */
- { 387, -1 }, /* (376) column_alias ::= NK_ID */
- { 333, -1 }, /* (377) user_name ::= NK_ID */
- { 340, -1 }, /* (378) topic_name ::= NK_ID */
- { 403, -1 }, /* (379) stream_name ::= NK_ID */
- { 397, -1 }, /* (380) cgroup_name ::= NK_ID */
- { 390, -1 }, /* (381) index_name ::= NK_ID */
- { 415, -1 }, /* (382) expr_or_subquery ::= expression */
- { 408, -1 }, /* (383) expression ::= literal */
- { 408, -1 }, /* (384) expression ::= pseudo_column */
- { 408, -1 }, /* (385) expression ::= column_reference */
- { 408, -1 }, /* (386) expression ::= function_expression */
- { 408, -1 }, /* (387) expression ::= case_when_expression */
- { 408, -3 }, /* (388) expression ::= NK_LP expression NK_RP */
- { 408, -2 }, /* (389) expression ::= NK_PLUS expr_or_subquery */
- { 408, -2 }, /* (390) expression ::= NK_MINUS expr_or_subquery */
- { 408, -3 }, /* (391) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
- { 408, -3 }, /* (392) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
- { 408, -3 }, /* (393) expression ::= expr_or_subquery NK_STAR expr_or_subquery */
- { 408, -3 }, /* (394) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
- { 408, -3 }, /* (395) expression ::= expr_or_subquery NK_REM expr_or_subquery */
- { 408, -3 }, /* (396) expression ::= column_reference NK_ARROW NK_STRING */
- { 408, -3 }, /* (397) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
- { 408, -3 }, /* (398) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
- { 369, -1 }, /* (399) expression_list ::= expr_or_subquery */
- { 369, -3 }, /* (400) expression_list ::= expression_list NK_COMMA expr_or_subquery */
- { 417, -1 }, /* (401) column_reference ::= column_name */
- { 417, -3 }, /* (402) column_reference ::= table_name NK_DOT column_name */
- { 416, -1 }, /* (403) pseudo_column ::= ROWTS */
- { 416, -1 }, /* (404) pseudo_column ::= TBNAME */
- { 416, -3 }, /* (405) pseudo_column ::= table_name NK_DOT TBNAME */
- { 416, -1 }, /* (406) pseudo_column ::= QSTART */
- { 416, -1 }, /* (407) pseudo_column ::= QEND */
- { 416, -1 }, /* (408) pseudo_column ::= QDURATION */
- { 416, -1 }, /* (409) pseudo_column ::= WSTART */
- { 416, -1 }, /* (410) pseudo_column ::= WEND */
- { 416, -1 }, /* (411) pseudo_column ::= WDURATION */
- { 416, -1 }, /* (412) pseudo_column ::= IROWTS */
- { 416, -1 }, /* (413) pseudo_column ::= ISFILLED */
- { 416, -1 }, /* (414) pseudo_column ::= QTAGS */
- { 418, -4 }, /* (415) function_expression ::= function_name NK_LP expression_list NK_RP */
- { 418, -4 }, /* (416) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
- { 418, -6 }, /* (417) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
- { 418, -1 }, /* (418) function_expression ::= literal_func */
- { 412, -3 }, /* (419) literal_func ::= noarg_func NK_LP NK_RP */
- { 412, -1 }, /* (420) literal_func ::= NOW */
- { 422, -1 }, /* (421) noarg_func ::= NOW */
- { 422, -1 }, /* (422) noarg_func ::= TODAY */
- { 422, -1 }, /* (423) noarg_func ::= TIMEZONE */
- { 422, -1 }, /* (424) noarg_func ::= DATABASE */
- { 422, -1 }, /* (425) noarg_func ::= CLIENT_VERSION */
- { 422, -1 }, /* (426) noarg_func ::= SERVER_VERSION */
- { 422, -1 }, /* (427) noarg_func ::= SERVER_STATUS */
- { 422, -1 }, /* (428) noarg_func ::= CURRENT_USER */
- { 422, -1 }, /* (429) noarg_func ::= USER */
- { 420, -1 }, /* (430) star_func ::= COUNT */
- { 420, -1 }, /* (431) star_func ::= FIRST */
- { 420, -1 }, /* (432) star_func ::= LAST */
- { 420, -1 }, /* (433) star_func ::= LAST_ROW */
- { 421, -1 }, /* (434) star_func_para_list ::= NK_STAR */
- { 421, -1 }, /* (435) star_func_para_list ::= other_para_list */
- { 423, -1 }, /* (436) other_para_list ::= star_func_para */
- { 423, -3 }, /* (437) other_para_list ::= other_para_list NK_COMMA star_func_para */
- { 424, -1 }, /* (438) star_func_para ::= expr_or_subquery */
- { 424, -3 }, /* (439) star_func_para ::= table_name NK_DOT NK_STAR */
- { 419, -4 }, /* (440) case_when_expression ::= CASE when_then_list case_when_else_opt END */
- { 419, -5 }, /* (441) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
- { 425, -1 }, /* (442) when_then_list ::= when_then_expr */
- { 425, -2 }, /* (443) when_then_list ::= when_then_list when_then_expr */
- { 428, -4 }, /* (444) when_then_expr ::= WHEN common_expression THEN common_expression */
- { 426, 0 }, /* (445) case_when_else_opt ::= */
- { 426, -2 }, /* (446) case_when_else_opt ::= ELSE common_expression */
- { 429, -3 }, /* (447) predicate ::= expr_or_subquery compare_op expr_or_subquery */
- { 429, -5 }, /* (448) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
- { 429, -6 }, /* (449) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
- { 429, -3 }, /* (450) predicate ::= expr_or_subquery IS NULL */
- { 429, -4 }, /* (451) predicate ::= expr_or_subquery IS NOT NULL */
- { 429, -3 }, /* (452) predicate ::= expr_or_subquery in_op in_predicate_value */
- { 430, -1 }, /* (453) compare_op ::= NK_LT */
- { 430, -1 }, /* (454) compare_op ::= NK_GT */
- { 430, -1 }, /* (455) compare_op ::= NK_LE */
- { 430, -1 }, /* (456) compare_op ::= NK_GE */
- { 430, -1 }, /* (457) compare_op ::= NK_NE */
- { 430, -1 }, /* (458) compare_op ::= NK_EQ */
- { 430, -1 }, /* (459) compare_op ::= LIKE */
- { 430, -2 }, /* (460) compare_op ::= NOT LIKE */
- { 430, -1 }, /* (461) compare_op ::= MATCH */
- { 430, -1 }, /* (462) compare_op ::= NMATCH */
- { 430, -1 }, /* (463) compare_op ::= CONTAINS */
- { 431, -1 }, /* (464) in_op ::= IN */
- { 431, -2 }, /* (465) in_op ::= NOT IN */
- { 432, -3 }, /* (466) in_predicate_value ::= NK_LP literal_list NK_RP */
- { 433, -1 }, /* (467) boolean_value_expression ::= boolean_primary */
- { 433, -2 }, /* (468) boolean_value_expression ::= NOT boolean_primary */
- { 433, -3 }, /* (469) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
- { 433, -3 }, /* (470) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
- { 434, -1 }, /* (471) boolean_primary ::= predicate */
- { 434, -3 }, /* (472) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
- { 427, -1 }, /* (473) common_expression ::= expr_or_subquery */
- { 427, -1 }, /* (474) common_expression ::= boolean_value_expression */
- { 435, 0 }, /* (475) from_clause_opt ::= */
- { 435, -2 }, /* (476) from_clause_opt ::= FROM table_reference_list */
- { 436, -1 }, /* (477) table_reference_list ::= table_reference */
- { 436, -3 }, /* (478) table_reference_list ::= table_reference_list NK_COMMA table_reference */
- { 437, -1 }, /* (479) table_reference ::= table_primary */
- { 437, -1 }, /* (480) table_reference ::= joined_table */
- { 438, -2 }, /* (481) table_primary ::= table_name alias_opt */
- { 438, -4 }, /* (482) table_primary ::= db_name NK_DOT table_name alias_opt */
- { 438, -2 }, /* (483) table_primary ::= subquery alias_opt */
- { 438, -1 }, /* (484) table_primary ::= parenthesized_joined_table */
- { 440, 0 }, /* (485) alias_opt ::= */
- { 440, -1 }, /* (486) alias_opt ::= table_alias */
- { 440, -2 }, /* (487) alias_opt ::= AS table_alias */
- { 442, -3 }, /* (488) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- { 442, -3 }, /* (489) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
- { 439, -6 }, /* (490) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
- { 443, 0 }, /* (491) join_type ::= */
- { 443, -1 }, /* (492) join_type ::= INNER */
- { 445, -12 }, /* (493) 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 */
- { 446, 0 }, /* (494) set_quantifier_opt ::= */
- { 446, -1 }, /* (495) set_quantifier_opt ::= DISTINCT */
- { 446, -1 }, /* (496) set_quantifier_opt ::= ALL */
- { 447, -1 }, /* (497) select_list ::= select_item */
- { 447, -3 }, /* (498) select_list ::= select_list NK_COMMA select_item */
- { 455, -1 }, /* (499) select_item ::= NK_STAR */
- { 455, -1 }, /* (500) select_item ::= common_expression */
- { 455, -2 }, /* (501) select_item ::= common_expression column_alias */
- { 455, -3 }, /* (502) select_item ::= common_expression AS column_alias */
- { 455, -3 }, /* (503) select_item ::= table_name NK_DOT NK_STAR */
- { 410, 0 }, /* (504) where_clause_opt ::= */
- { 410, -2 }, /* (505) where_clause_opt ::= WHERE search_condition */
- { 448, 0 }, /* (506) partition_by_clause_opt ::= */
- { 448, -3 }, /* (507) partition_by_clause_opt ::= PARTITION BY partition_list */
- { 456, -1 }, /* (508) partition_list ::= partition_item */
- { 456, -3 }, /* (509) partition_list ::= partition_list NK_COMMA partition_item */
- { 457, -1 }, /* (510) partition_item ::= expr_or_subquery */
- { 457, -2 }, /* (511) partition_item ::= expr_or_subquery column_alias */
- { 457, -3 }, /* (512) partition_item ::= expr_or_subquery AS column_alias */
- { 452, 0 }, /* (513) twindow_clause_opt ::= */
- { 452, -6 }, /* (514) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
- { 452, -4 }, /* (515) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
- { 452, -6 }, /* (516) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
- { 452, -8 }, /* (517) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
- { 452, -7 }, /* (518) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
- { 392, 0 }, /* (519) sliding_opt ::= */
- { 392, -4 }, /* (520) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
- { 451, 0 }, /* (521) fill_opt ::= */
- { 451, -4 }, /* (522) fill_opt ::= FILL NK_LP fill_mode NK_RP */
- { 451, -6 }, /* (523) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
- { 451, -6 }, /* (524) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
- { 458, -1 }, /* (525) fill_mode ::= NONE */
- { 458, -1 }, /* (526) fill_mode ::= PREV */
- { 458, -1 }, /* (527) fill_mode ::= NULL */
- { 458, -1 }, /* (528) fill_mode ::= NULL_F */
- { 458, -1 }, /* (529) fill_mode ::= LINEAR */
- { 458, -1 }, /* (530) fill_mode ::= NEXT */
- { 453, 0 }, /* (531) group_by_clause_opt ::= */
- { 453, -3 }, /* (532) group_by_clause_opt ::= GROUP BY group_by_list */
- { 459, -1 }, /* (533) group_by_list ::= expr_or_subquery */
- { 459, -3 }, /* (534) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
- { 454, 0 }, /* (535) having_clause_opt ::= */
- { 454, -2 }, /* (536) having_clause_opt ::= HAVING search_condition */
- { 449, 0 }, /* (537) range_opt ::= */
- { 449, -6 }, /* (538) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
- { 450, 0 }, /* (539) every_opt ::= */
- { 450, -4 }, /* (540) every_opt ::= EVERY NK_LP duration_literal NK_RP */
- { 460, -4 }, /* (541) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
- { 461, -1 }, /* (542) query_simple ::= query_specification */
- { 461, -1 }, /* (543) query_simple ::= union_query_expression */
- { 465, -4 }, /* (544) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
- { 465, -3 }, /* (545) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
- { 466, -1 }, /* (546) query_simple_or_subquery ::= query_simple */
- { 466, -1 }, /* (547) query_simple_or_subquery ::= subquery */
- { 396, -1 }, /* (548) query_or_subquery ::= query_expression */
- { 396, -1 }, /* (549) query_or_subquery ::= subquery */
- { 462, 0 }, /* (550) order_by_clause_opt ::= */
- { 462, -3 }, /* (551) order_by_clause_opt ::= ORDER BY sort_specification_list */
- { 463, 0 }, /* (552) slimit_clause_opt ::= */
- { 463, -2 }, /* (553) slimit_clause_opt ::= SLIMIT NK_INTEGER */
- { 463, -4 }, /* (554) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- { 463, -4 }, /* (555) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 464, 0 }, /* (556) limit_clause_opt ::= */
- { 464, -2 }, /* (557) limit_clause_opt ::= LIMIT NK_INTEGER */
- { 464, -4 }, /* (558) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
- { 464, -4 }, /* (559) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 441, -3 }, /* (560) subquery ::= NK_LP query_expression NK_RP */
- { 441, -3 }, /* (561) subquery ::= NK_LP subquery NK_RP */
- { 444, -1 }, /* (562) search_condition ::= common_expression */
- { 467, -1 }, /* (563) sort_specification_list ::= sort_specification */
- { 467, -3 }, /* (564) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
- { 468, -3 }, /* (565) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
- { 469, 0 }, /* (566) ordering_specification_opt ::= */
- { 469, -1 }, /* (567) ordering_specification_opt ::= ASC */
- { 469, -1 }, /* (568) ordering_specification_opt ::= DESC */
- { 470, 0 }, /* (569) null_ordering_opt ::= */
- { 470, -2 }, /* (570) null_ordering_opt ::= NULLS FIRST */
- { 470, -2 }, /* (571) null_ordering_opt ::= NULLS LAST */
+ { 330, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
+ { 330, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+ { 331, 0 }, /* (2) account_options ::= */
+ { 331, -3 }, /* (3) account_options ::= account_options PPS literal */
+ { 331, -3 }, /* (4) account_options ::= account_options TSERIES literal */
+ { 331, -3 }, /* (5) account_options ::= account_options STORAGE literal */
+ { 331, -3 }, /* (6) account_options ::= account_options STREAMS literal */
+ { 331, -3 }, /* (7) account_options ::= account_options QTIME literal */
+ { 331, -3 }, /* (8) account_options ::= account_options DBS literal */
+ { 331, -3 }, /* (9) account_options ::= account_options USERS literal */
+ { 331, -3 }, /* (10) account_options ::= account_options CONNS literal */
+ { 331, -3 }, /* (11) account_options ::= account_options STATE literal */
+ { 332, -1 }, /* (12) alter_account_options ::= alter_account_option */
+ { 332, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
+ { 334, -2 }, /* (14) alter_account_option ::= PASS literal */
+ { 334, -2 }, /* (15) alter_account_option ::= PPS literal */
+ { 334, -2 }, /* (16) alter_account_option ::= TSERIES literal */
+ { 334, -2 }, /* (17) alter_account_option ::= STORAGE literal */
+ { 334, -2 }, /* (18) alter_account_option ::= STREAMS literal */
+ { 334, -2 }, /* (19) alter_account_option ::= QTIME literal */
+ { 334, -2 }, /* (20) alter_account_option ::= DBS literal */
+ { 334, -2 }, /* (21) alter_account_option ::= USERS literal */
+ { 334, -2 }, /* (22) alter_account_option ::= CONNS literal */
+ { 334, -2 }, /* (23) alter_account_option ::= STATE literal */
+ { 330, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
+ { 330, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
+ { 330, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
+ { 330, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
+ { 330, -3 }, /* (28) cmd ::= DROP USER user_name */
+ { 336, 0 }, /* (29) sysinfo_opt ::= */
+ { 336, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
+ { 330, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
+ { 330, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
+ { 337, -1 }, /* (33) privileges ::= ALL */
+ { 337, -1 }, /* (34) privileges ::= priv_type_list */
+ { 337, -1 }, /* (35) privileges ::= SUBSCRIBE */
+ { 339, -1 }, /* (36) priv_type_list ::= priv_type */
+ { 339, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */
+ { 340, -1 }, /* (38) priv_type ::= READ */
+ { 340, -1 }, /* (39) priv_type ::= WRITE */
+ { 338, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */
+ { 338, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */
+ { 338, -1 }, /* (42) priv_level ::= topic_name */
+ { 330, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */
+ { 330, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
+ { 330, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */
+ { 330, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */
+ { 330, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
+ { 330, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
+ { 330, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */
+ { 330, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
+ { 343, -1 }, /* (51) dnode_endpoint ::= NK_STRING */
+ { 343, -1 }, /* (52) dnode_endpoint ::= NK_ID */
+ { 343, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */
+ { 344, 0 }, /* (54) force_opt ::= */
+ { 344, -1 }, /* (55) force_opt ::= FORCE */
+ { 330, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */
+ { 330, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+ { 330, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
+ { 330, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+ { 330, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */
+ { 330, -2 }, /* (68) cmd ::= USE db_name */
+ { 330, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */
+ { 330, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */
+ { 330, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */
+ { 330, -5 }, /* (72) cmd ::= COMPACT DATABASE db_name start_opt end_opt */
+ { 345, -3 }, /* (73) not_exists_opt ::= IF NOT EXISTS */
+ { 345, 0 }, /* (74) not_exists_opt ::= */
+ { 347, -2 }, /* (75) exists_opt ::= IF EXISTS */
+ { 347, 0 }, /* (76) exists_opt ::= */
+ { 346, 0 }, /* (77) db_options ::= */
+ { 346, -3 }, /* (78) db_options ::= db_options BUFFER NK_INTEGER */
+ { 346, -3 }, /* (79) db_options ::= db_options CACHEMODEL NK_STRING */
+ { 346, -3 }, /* (80) db_options ::= db_options CACHESIZE NK_INTEGER */
+ { 346, -3 }, /* (81) db_options ::= db_options COMP NK_INTEGER */
+ { 346, -3 }, /* (82) db_options ::= db_options DURATION NK_INTEGER */
+ { 346, -3 }, /* (83) db_options ::= db_options DURATION NK_VARIABLE */
+ { 346, -3 }, /* (84) db_options ::= db_options MAXROWS NK_INTEGER */
+ { 346, -3 }, /* (85) db_options ::= db_options MINROWS NK_INTEGER */
+ { 346, -3 }, /* (86) db_options ::= db_options KEEP integer_list */
+ { 346, -3 }, /* (87) db_options ::= db_options KEEP variable_list */
+ { 346, -3 }, /* (88) db_options ::= db_options PAGES NK_INTEGER */
+ { 346, -3 }, /* (89) db_options ::= db_options PAGESIZE NK_INTEGER */
+ { 346, -3 }, /* (90) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
+ { 346, -3 }, /* (91) db_options ::= db_options PRECISION NK_STRING */
+ { 346, -3 }, /* (92) db_options ::= db_options REPLICA NK_INTEGER */
+ { 346, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */
+ { 346, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+ { 346, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */
+ { 346, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */
+ { 346, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */
+ { 346, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
+ { 346, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
+ { 346, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+ { 346, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
+ { 346, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+ { 346, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
+ { 346, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
+ { 346, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */
+ { 346, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */
+ { 346, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
+ { 348, -1 }, /* (108) alter_db_options ::= alter_db_option */
+ { 348, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */
+ { 355, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */
+ { 355, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */
+ { 355, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */
+ { 355, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
+ { 355, -2 }, /* (114) alter_db_option ::= KEEP integer_list */
+ { 355, -2 }, /* (115) alter_db_option ::= KEEP variable_list */
+ { 355, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */
+ { 355, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */
+ { 355, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */
+ { 355, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */
+ { 355, -2 }, /* (120) alter_db_option ::= MINROWS NK_INTEGER */
+ { 355, -2 }, /* (121) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
+ { 355, -3 }, /* (122) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+ { 355, -2 }, /* (123) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
+ { 355, -3 }, /* (124) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+ { 352, -1 }, /* (125) integer_list ::= NK_INTEGER */
+ { 352, -3 }, /* (126) integer_list ::= integer_list NK_COMMA NK_INTEGER */
+ { 353, -1 }, /* (127) variable_list ::= NK_VARIABLE */
+ { 353, -3 }, /* (128) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+ { 354, -1 }, /* (129) retention_list ::= retention */
+ { 354, -3 }, /* (130) retention_list ::= retention_list NK_COMMA retention */
+ { 356, -3 }, /* (131) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
+ { 349, 0 }, /* (132) speed_opt ::= */
+ { 349, -2 }, /* (133) speed_opt ::= MAX_SPEED NK_INTEGER */
+ { 350, 0 }, /* (134) start_opt ::= */
+ { 350, -3 }, /* (135) start_opt ::= START WITH NK_INTEGER */
+ { 350, -3 }, /* (136) start_opt ::= START WITH NK_STRING */
+ { 350, -4 }, /* (137) start_opt ::= START WITH TIMESTAMP NK_STRING */
+ { 351, 0 }, /* (138) end_opt ::= */
+ { 351, -3 }, /* (139) end_opt ::= END WITH NK_INTEGER */
+ { 351, -3 }, /* (140) end_opt ::= END WITH NK_STRING */
+ { 351, -4 }, /* (141) end_opt ::= END WITH TIMESTAMP NK_STRING */
+ { 330, -9 }, /* (142) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ { 330, -3 }, /* (143) cmd ::= CREATE TABLE multi_create_clause */
+ { 330, -9 }, /* (144) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
+ { 330, -3 }, /* (145) cmd ::= DROP TABLE multi_drop_clause */
+ { 330, -4 }, /* (146) cmd ::= DROP STABLE exists_opt full_table_name */
+ { 330, -3 }, /* (147) cmd ::= ALTER TABLE alter_table_clause */
+ { 330, -3 }, /* (148) cmd ::= ALTER STABLE alter_table_clause */
+ { 364, -2 }, /* (149) alter_table_clause ::= full_table_name alter_table_options */
+ { 364, -5 }, /* (150) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+ { 364, -4 }, /* (151) alter_table_clause ::= full_table_name DROP COLUMN column_name */
+ { 364, -5 }, /* (152) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+ { 364, -5 }, /* (153) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+ { 364, -5 }, /* (154) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+ { 364, -4 }, /* (155) alter_table_clause ::= full_table_name DROP TAG column_name */
+ { 364, -5 }, /* (156) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+ { 364, -5 }, /* (157) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+ { 364, -6 }, /* (158) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+ { 361, -1 }, /* (159) multi_create_clause ::= create_subtable_clause */
+ { 361, -2 }, /* (160) multi_create_clause ::= multi_create_clause create_subtable_clause */
+ { 369, -10 }, /* (161) 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 */
+ { 363, -1 }, /* (162) multi_drop_clause ::= drop_table_clause */
+ { 363, -3 }, /* (163) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */
+ { 372, -2 }, /* (164) drop_table_clause ::= exists_opt full_table_name */
+ { 370, 0 }, /* (165) specific_cols_opt ::= */
+ { 370, -3 }, /* (166) specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ { 357, -1 }, /* (167) full_table_name ::= table_name */
+ { 357, -3 }, /* (168) full_table_name ::= db_name NK_DOT table_name */
+ { 358, -1 }, /* (169) column_def_list ::= column_def */
+ { 358, -3 }, /* (170) column_def_list ::= column_def_list NK_COMMA column_def */
+ { 375, -2 }, /* (171) column_def ::= column_name type_name */
+ { 375, -4 }, /* (172) column_def ::= column_name type_name COMMENT NK_STRING */
+ { 367, -1 }, /* (173) type_name ::= BOOL */
+ { 367, -1 }, /* (174) type_name ::= TINYINT */
+ { 367, -1 }, /* (175) type_name ::= SMALLINT */
+ { 367, -1 }, /* (176) type_name ::= INT */
+ { 367, -1 }, /* (177) type_name ::= INTEGER */
+ { 367, -1 }, /* (178) type_name ::= BIGINT */
+ { 367, -1 }, /* (179) type_name ::= FLOAT */
+ { 367, -1 }, /* (180) type_name ::= DOUBLE */
+ { 367, -4 }, /* (181) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+ { 367, -1 }, /* (182) type_name ::= TIMESTAMP */
+ { 367, -4 }, /* (183) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+ { 367, -2 }, /* (184) type_name ::= TINYINT UNSIGNED */
+ { 367, -2 }, /* (185) type_name ::= SMALLINT UNSIGNED */
+ { 367, -2 }, /* (186) type_name ::= INT UNSIGNED */
+ { 367, -2 }, /* (187) type_name ::= BIGINT UNSIGNED */
+ { 367, -1 }, /* (188) type_name ::= JSON */
+ { 367, -4 }, /* (189) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+ { 367, -1 }, /* (190) type_name ::= MEDIUMBLOB */
+ { 367, -1 }, /* (191) type_name ::= BLOB */
+ { 367, -4 }, /* (192) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+ { 367, -1 }, /* (193) type_name ::= DECIMAL */
+ { 367, -4 }, /* (194) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+ { 367, -6 }, /* (195) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+ { 359, 0 }, /* (196) tags_def_opt ::= */
+ { 359, -1 }, /* (197) tags_def_opt ::= tags_def */
+ { 362, -4 }, /* (198) tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ { 360, 0 }, /* (199) table_options ::= */
+ { 360, -3 }, /* (200) table_options ::= table_options COMMENT NK_STRING */
+ { 360, -3 }, /* (201) table_options ::= table_options MAX_DELAY duration_list */
+ { 360, -3 }, /* (202) table_options ::= table_options WATERMARK duration_list */
+ { 360, -5 }, /* (203) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+ { 360, -3 }, /* (204) table_options ::= table_options TTL NK_INTEGER */
+ { 360, -5 }, /* (205) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+ { 360, -3 }, /* (206) table_options ::= table_options DELETE_MARK duration_list */
+ { 365, -1 }, /* (207) alter_table_options ::= alter_table_option */
+ { 365, -2 }, /* (208) alter_table_options ::= alter_table_options alter_table_option */
+ { 378, -2 }, /* (209) alter_table_option ::= COMMENT NK_STRING */
+ { 378, -2 }, /* (210) alter_table_option ::= TTL NK_INTEGER */
+ { 376, -1 }, /* (211) duration_list ::= duration_literal */
+ { 376, -3 }, /* (212) duration_list ::= duration_list NK_COMMA duration_literal */
+ { 377, -1 }, /* (213) rollup_func_list ::= rollup_func_name */
+ { 377, -3 }, /* (214) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
+ { 380, -1 }, /* (215) rollup_func_name ::= function_name */
+ { 380, -1 }, /* (216) rollup_func_name ::= FIRST */
+ { 380, -1 }, /* (217) rollup_func_name ::= LAST */
+ { 373, -1 }, /* (218) col_name_list ::= col_name */
+ { 373, -3 }, /* (219) col_name_list ::= col_name_list NK_COMMA col_name */
+ { 382, -1 }, /* (220) col_name ::= column_name */
+ { 330, -2 }, /* (221) cmd ::= SHOW DNODES */
+ { 330, -2 }, /* (222) cmd ::= SHOW USERS */
+ { 330, -3 }, /* (223) cmd ::= SHOW USER PRIVILEGES */
+ { 330, -2 }, /* (224) cmd ::= SHOW DATABASES */
+ { 330, -4 }, /* (225) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
+ { 330, -4 }, /* (226) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+ { 330, -3 }, /* (227) cmd ::= SHOW db_name_cond_opt VGROUPS */
+ { 330, -2 }, /* (228) cmd ::= SHOW MNODES */
+ { 330, -2 }, /* (229) cmd ::= SHOW QNODES */
+ { 330, -2 }, /* (230) cmd ::= SHOW FUNCTIONS */
+ { 330, -5 }, /* (231) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+ { 330, -2 }, /* (232) cmd ::= SHOW STREAMS */
+ { 330, -2 }, /* (233) cmd ::= SHOW ACCOUNTS */
+ { 330, -2 }, /* (234) cmd ::= SHOW APPS */
+ { 330, -2 }, /* (235) cmd ::= SHOW CONNECTIONS */
+ { 330, -2 }, /* (236) cmd ::= SHOW LICENCES */
+ { 330, -2 }, /* (237) cmd ::= SHOW GRANTS */
+ { 330, -4 }, /* (238) cmd ::= SHOW CREATE DATABASE db_name */
+ { 330, -4 }, /* (239) cmd ::= SHOW CREATE TABLE full_table_name */
+ { 330, -4 }, /* (240) cmd ::= SHOW CREATE STABLE full_table_name */
+ { 330, -2 }, /* (241) cmd ::= SHOW QUERIES */
+ { 330, -2 }, /* (242) cmd ::= SHOW SCORES */
+ { 330, -2 }, /* (243) cmd ::= SHOW TOPICS */
+ { 330, -2 }, /* (244) cmd ::= SHOW VARIABLES */
+ { 330, -3 }, /* (245) cmd ::= SHOW CLUSTER VARIABLES */
+ { 330, -3 }, /* (246) cmd ::= SHOW LOCAL VARIABLES */
+ { 330, -5 }, /* (247) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
+ { 330, -2 }, /* (248) cmd ::= SHOW BNODES */
+ { 330, -2 }, /* (249) cmd ::= SHOW SNODES */
+ { 330, -2 }, /* (250) cmd ::= SHOW CLUSTER */
+ { 330, -2 }, /* (251) cmd ::= SHOW TRANSACTIONS */
+ { 330, -4 }, /* (252) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+ { 330, -2 }, /* (253) cmd ::= SHOW CONSUMERS */
+ { 330, -2 }, /* (254) cmd ::= SHOW SUBSCRIPTIONS */
+ { 330, -5 }, /* (255) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+ { 330, -7 }, /* (256) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+ { 330, -3 }, /* (257) cmd ::= SHOW VNODES NK_INTEGER */
+ { 330, -3 }, /* (258) cmd ::= SHOW VNODES NK_STRING */
+ { 330, -3 }, /* (259) cmd ::= SHOW db_name_cond_opt ALIVE */
+ { 330, -3 }, /* (260) cmd ::= SHOW CLUSTER ALIVE */
+ { 383, 0 }, /* (261) db_name_cond_opt ::= */
+ { 383, -2 }, /* (262) db_name_cond_opt ::= db_name NK_DOT */
+ { 384, 0 }, /* (263) like_pattern_opt ::= */
+ { 384, -2 }, /* (264) like_pattern_opt ::= LIKE NK_STRING */
+ { 385, -1 }, /* (265) table_name_cond ::= table_name */
+ { 386, 0 }, /* (266) from_db_opt ::= */
+ { 386, -2 }, /* (267) from_db_opt ::= FROM db_name */
+ { 387, 0 }, /* (268) tag_list_opt ::= */
+ { 387, -1 }, /* (269) tag_list_opt ::= tag_item */
+ { 387, -3 }, /* (270) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */
+ { 388, -1 }, /* (271) tag_item ::= TBNAME */
+ { 388, -1 }, /* (272) tag_item ::= QTAGS */
+ { 388, -1 }, /* (273) tag_item ::= column_name */
+ { 388, -2 }, /* (274) tag_item ::= column_name column_alias */
+ { 388, -3 }, /* (275) tag_item ::= column_name AS column_alias */
+ { 330, -8 }, /* (276) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
+ { 330, -9 }, /* (277) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
+ { 330, -4 }, /* (278) cmd ::= DROP INDEX exists_opt full_index_name */
+ { 390, -1 }, /* (279) full_index_name ::= index_name */
+ { 390, -3 }, /* (280) full_index_name ::= db_name NK_DOT index_name */
+ { 391, -10 }, /* (281) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+ { 391, -12 }, /* (282) 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 */
+ { 393, -1 }, /* (283) func_list ::= func */
+ { 393, -3 }, /* (284) func_list ::= func_list NK_COMMA func */
+ { 396, -4 }, /* (285) func ::= sma_func_name NK_LP expression_list NK_RP */
+ { 397, -1 }, /* (286) sma_func_name ::= function_name */
+ { 397, -1 }, /* (287) sma_func_name ::= COUNT */
+ { 397, -1 }, /* (288) sma_func_name ::= FIRST */
+ { 397, -1 }, /* (289) sma_func_name ::= LAST */
+ { 397, -1 }, /* (290) sma_func_name ::= LAST_ROW */
+ { 395, 0 }, /* (291) sma_stream_opt ::= */
+ { 395, -3 }, /* (292) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+ { 395, -3 }, /* (293) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+ { 395, -3 }, /* (294) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+ { 330, -6 }, /* (295) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+ { 330, -7 }, /* (296) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
+ { 330, -9 }, /* (297) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
+ { 330, -7 }, /* (298) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
+ { 330, -9 }, /* (299) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
+ { 330, -4 }, /* (300) cmd ::= DROP TOPIC exists_opt topic_name */
+ { 330, -7 }, /* (301) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+ { 330, -2 }, /* (302) cmd ::= DESC full_table_name */
+ { 330, -2 }, /* (303) cmd ::= DESCRIBE full_table_name */
+ { 330, -3 }, /* (304) cmd ::= RESET QUERY CACHE */
+ { 330, -4 }, /* (305) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
+ { 330, -4 }, /* (306) cmd ::= EXPLAIN analyze_opt explain_options insert_query */
+ { 400, 0 }, /* (307) analyze_opt ::= */
+ { 400, -1 }, /* (308) analyze_opt ::= ANALYZE */
+ { 401, 0 }, /* (309) explain_options ::= */
+ { 401, -3 }, /* (310) explain_options ::= explain_options VERBOSE NK_BOOL */
+ { 401, -3 }, /* (311) explain_options ::= explain_options RATIO NK_FLOAT */
+ { 330, -12 }, /* (312) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */
+ { 330, -4 }, /* (313) cmd ::= DROP FUNCTION exists_opt function_name */
+ { 404, 0 }, /* (314) agg_func_opt ::= */
+ { 404, -1 }, /* (315) agg_func_opt ::= AGGREGATE */
+ { 405, 0 }, /* (316) bufsize_opt ::= */
+ { 405, -2 }, /* (317) bufsize_opt ::= BUFSIZE NK_INTEGER */
+ { 406, 0 }, /* (318) language_opt ::= */
+ { 406, -2 }, /* (319) language_opt ::= LANGUAGE NK_STRING */
+ { 403, 0 }, /* (320) or_replace_opt ::= */
+ { 403, -2 }, /* (321) or_replace_opt ::= OR REPLACE */
+ { 330, -12 }, /* (322) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
+ { 330, -4 }, /* (323) cmd ::= DROP STREAM exists_opt stream_name */
+ { 409, 0 }, /* (324) col_list_opt ::= */
+ { 409, -3 }, /* (325) col_list_opt ::= NK_LP col_name_list NK_RP */
+ { 410, 0 }, /* (326) tag_def_or_ref_opt ::= */
+ { 410, -1 }, /* (327) tag_def_or_ref_opt ::= tags_def */
+ { 410, -4 }, /* (328) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */
+ { 408, 0 }, /* (329) stream_options ::= */
+ { 408, -3 }, /* (330) stream_options ::= stream_options TRIGGER AT_ONCE */
+ { 408, -3 }, /* (331) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
+ { 408, -4 }, /* (332) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+ { 408, -3 }, /* (333) stream_options ::= stream_options WATERMARK duration_literal */
+ { 408, -4 }, /* (334) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+ { 408, -3 }, /* (335) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+ { 408, -3 }, /* (336) stream_options ::= stream_options DELETE_MARK duration_literal */
+ { 408, -4 }, /* (337) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+ { 411, 0 }, /* (338) subtable_opt ::= */
+ { 411, -4 }, /* (339) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
+ { 330, -3 }, /* (340) cmd ::= KILL CONNECTION NK_INTEGER */
+ { 330, -3 }, /* (341) cmd ::= KILL QUERY NK_STRING */
+ { 330, -3 }, /* (342) cmd ::= KILL TRANSACTION NK_INTEGER */
+ { 330, -2 }, /* (343) cmd ::= BALANCE VGROUP */
+ { 330, -3 }, /* (344) cmd ::= BALANCE VGROUP LEADER */
+ { 330, -4 }, /* (345) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+ { 330, -4 }, /* (346) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+ { 330, -3 }, /* (347) cmd ::= SPLIT VGROUP NK_INTEGER */
+ { 413, -2 }, /* (348) dnode_list ::= DNODE NK_INTEGER */
+ { 413, -3 }, /* (349) dnode_list ::= dnode_list DNODE NK_INTEGER */
+ { 330, -4 }, /* (350) cmd ::= DELETE FROM full_table_name where_clause_opt */
+ { 330, -1 }, /* (351) cmd ::= query_or_subquery */
+ { 330, -1 }, /* (352) cmd ::= insert_query */
+ { 402, -7 }, /* (353) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+ { 402, -4 }, /* (354) insert_query ::= INSERT INTO full_table_name query_or_subquery */
+ { 333, -1 }, /* (355) literal ::= NK_INTEGER */
+ { 333, -1 }, /* (356) literal ::= NK_FLOAT */
+ { 333, -1 }, /* (357) literal ::= NK_STRING */
+ { 333, -1 }, /* (358) literal ::= NK_BOOL */
+ { 333, -2 }, /* (359) literal ::= TIMESTAMP NK_STRING */
+ { 333, -1 }, /* (360) literal ::= duration_literal */
+ { 333, -1 }, /* (361) literal ::= NULL */
+ { 333, -1 }, /* (362) literal ::= NK_QUESTION */
+ { 379, -1 }, /* (363) duration_literal ::= NK_VARIABLE */
+ { 415, -1 }, /* (364) signed ::= NK_INTEGER */
+ { 415, -2 }, /* (365) signed ::= NK_PLUS NK_INTEGER */
+ { 415, -2 }, /* (366) signed ::= NK_MINUS NK_INTEGER */
+ { 415, -1 }, /* (367) signed ::= NK_FLOAT */
+ { 415, -2 }, /* (368) signed ::= NK_PLUS NK_FLOAT */
+ { 415, -2 }, /* (369) signed ::= NK_MINUS NK_FLOAT */
+ { 368, -1 }, /* (370) signed_literal ::= signed */
+ { 368, -1 }, /* (371) signed_literal ::= NK_STRING */
+ { 368, -1 }, /* (372) signed_literal ::= NK_BOOL */
+ { 368, -2 }, /* (373) signed_literal ::= TIMESTAMP NK_STRING */
+ { 368, -1 }, /* (374) signed_literal ::= duration_literal */
+ { 368, -1 }, /* (375) signed_literal ::= NULL */
+ { 368, -1 }, /* (376) signed_literal ::= literal_func */
+ { 368, -1 }, /* (377) signed_literal ::= NK_QUESTION */
+ { 417, -1 }, /* (378) literal_list ::= signed_literal */
+ { 417, -3 }, /* (379) literal_list ::= literal_list NK_COMMA signed_literal */
+ { 341, -1 }, /* (380) db_name ::= NK_ID */
+ { 374, -1 }, /* (381) table_name ::= NK_ID */
+ { 366, -1 }, /* (382) column_name ::= NK_ID */
+ { 381, -1 }, /* (383) function_name ::= NK_ID */
+ { 418, -1 }, /* (384) table_alias ::= NK_ID */
+ { 389, -1 }, /* (385) column_alias ::= NK_ID */
+ { 335, -1 }, /* (386) user_name ::= NK_ID */
+ { 342, -1 }, /* (387) topic_name ::= NK_ID */
+ { 407, -1 }, /* (388) stream_name ::= NK_ID */
+ { 399, -1 }, /* (389) cgroup_name ::= NK_ID */
+ { 392, -1 }, /* (390) index_name ::= NK_ID */
+ { 419, -1 }, /* (391) expr_or_subquery ::= expression */
+ { 412, -1 }, /* (392) expression ::= literal */
+ { 412, -1 }, /* (393) expression ::= pseudo_column */
+ { 412, -1 }, /* (394) expression ::= column_reference */
+ { 412, -1 }, /* (395) expression ::= function_expression */
+ { 412, -1 }, /* (396) expression ::= case_when_expression */
+ { 412, -3 }, /* (397) expression ::= NK_LP expression NK_RP */
+ { 412, -2 }, /* (398) expression ::= NK_PLUS expr_or_subquery */
+ { 412, -2 }, /* (399) expression ::= NK_MINUS expr_or_subquery */
+ { 412, -3 }, /* (400) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
+ { 412, -3 }, /* (401) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
+ { 412, -3 }, /* (402) expression ::= expr_or_subquery NK_STAR expr_or_subquery */
+ { 412, -3 }, /* (403) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
+ { 412, -3 }, /* (404) expression ::= expr_or_subquery NK_REM expr_or_subquery */
+ { 412, -3 }, /* (405) expression ::= column_reference NK_ARROW NK_STRING */
+ { 412, -3 }, /* (406) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
+ { 412, -3 }, /* (407) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
+ { 371, -1 }, /* (408) expression_list ::= expr_or_subquery */
+ { 371, -3 }, /* (409) expression_list ::= expression_list NK_COMMA expr_or_subquery */
+ { 421, -1 }, /* (410) column_reference ::= column_name */
+ { 421, -3 }, /* (411) column_reference ::= table_name NK_DOT column_name */
+ { 420, -1 }, /* (412) pseudo_column ::= ROWTS */
+ { 420, -1 }, /* (413) pseudo_column ::= TBNAME */
+ { 420, -3 }, /* (414) pseudo_column ::= table_name NK_DOT TBNAME */
+ { 420, -1 }, /* (415) pseudo_column ::= QSTART */
+ { 420, -1 }, /* (416) pseudo_column ::= QEND */
+ { 420, -1 }, /* (417) pseudo_column ::= QDURATION */
+ { 420, -1 }, /* (418) pseudo_column ::= WSTART */
+ { 420, -1 }, /* (419) pseudo_column ::= WEND */
+ { 420, -1 }, /* (420) pseudo_column ::= WDURATION */
+ { 420, -1 }, /* (421) pseudo_column ::= IROWTS */
+ { 420, -1 }, /* (422) pseudo_column ::= ISFILLED */
+ { 420, -1 }, /* (423) pseudo_column ::= QTAGS */
+ { 422, -4 }, /* (424) function_expression ::= function_name NK_LP expression_list NK_RP */
+ { 422, -4 }, /* (425) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
+ { 422, -6 }, /* (426) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+ { 422, -1 }, /* (427) function_expression ::= literal_func */
+ { 416, -3 }, /* (428) literal_func ::= noarg_func NK_LP NK_RP */
+ { 416, -1 }, /* (429) literal_func ::= NOW */
+ { 426, -1 }, /* (430) noarg_func ::= NOW */
+ { 426, -1 }, /* (431) noarg_func ::= TODAY */
+ { 426, -1 }, /* (432) noarg_func ::= TIMEZONE */
+ { 426, -1 }, /* (433) noarg_func ::= DATABASE */
+ { 426, -1 }, /* (434) noarg_func ::= CLIENT_VERSION */
+ { 426, -1 }, /* (435) noarg_func ::= SERVER_VERSION */
+ { 426, -1 }, /* (436) noarg_func ::= SERVER_STATUS */
+ { 426, -1 }, /* (437) noarg_func ::= CURRENT_USER */
+ { 426, -1 }, /* (438) noarg_func ::= USER */
+ { 424, -1 }, /* (439) star_func ::= COUNT */
+ { 424, -1 }, /* (440) star_func ::= FIRST */
+ { 424, -1 }, /* (441) star_func ::= LAST */
+ { 424, -1 }, /* (442) star_func ::= LAST_ROW */
+ { 425, -1 }, /* (443) star_func_para_list ::= NK_STAR */
+ { 425, -1 }, /* (444) star_func_para_list ::= other_para_list */
+ { 427, -1 }, /* (445) other_para_list ::= star_func_para */
+ { 427, -3 }, /* (446) other_para_list ::= other_para_list NK_COMMA star_func_para */
+ { 428, -1 }, /* (447) star_func_para ::= expr_or_subquery */
+ { 428, -3 }, /* (448) star_func_para ::= table_name NK_DOT NK_STAR */
+ { 423, -4 }, /* (449) case_when_expression ::= CASE when_then_list case_when_else_opt END */
+ { 423, -5 }, /* (450) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+ { 429, -1 }, /* (451) when_then_list ::= when_then_expr */
+ { 429, -2 }, /* (452) when_then_list ::= when_then_list when_then_expr */
+ { 432, -4 }, /* (453) when_then_expr ::= WHEN common_expression THEN common_expression */
+ { 430, 0 }, /* (454) case_when_else_opt ::= */
+ { 430, -2 }, /* (455) case_when_else_opt ::= ELSE common_expression */
+ { 433, -3 }, /* (456) predicate ::= expr_or_subquery compare_op expr_or_subquery */
+ { 433, -5 }, /* (457) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
+ { 433, -6 }, /* (458) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
+ { 433, -3 }, /* (459) predicate ::= expr_or_subquery IS NULL */
+ { 433, -4 }, /* (460) predicate ::= expr_or_subquery IS NOT NULL */
+ { 433, -3 }, /* (461) predicate ::= expr_or_subquery in_op in_predicate_value */
+ { 434, -1 }, /* (462) compare_op ::= NK_LT */
+ { 434, -1 }, /* (463) compare_op ::= NK_GT */
+ { 434, -1 }, /* (464) compare_op ::= NK_LE */
+ { 434, -1 }, /* (465) compare_op ::= NK_GE */
+ { 434, -1 }, /* (466) compare_op ::= NK_NE */
+ { 434, -1 }, /* (467) compare_op ::= NK_EQ */
+ { 434, -1 }, /* (468) compare_op ::= LIKE */
+ { 434, -2 }, /* (469) compare_op ::= NOT LIKE */
+ { 434, -1 }, /* (470) compare_op ::= MATCH */
+ { 434, -1 }, /* (471) compare_op ::= NMATCH */
+ { 434, -1 }, /* (472) compare_op ::= CONTAINS */
+ { 435, -1 }, /* (473) in_op ::= IN */
+ { 435, -2 }, /* (474) in_op ::= NOT IN */
+ { 436, -3 }, /* (475) in_predicate_value ::= NK_LP literal_list NK_RP */
+ { 437, -1 }, /* (476) boolean_value_expression ::= boolean_primary */
+ { 437, -2 }, /* (477) boolean_value_expression ::= NOT boolean_primary */
+ { 437, -3 }, /* (478) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ { 437, -3 }, /* (479) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ { 438, -1 }, /* (480) boolean_primary ::= predicate */
+ { 438, -3 }, /* (481) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
+ { 431, -1 }, /* (482) common_expression ::= expr_or_subquery */
+ { 431, -1 }, /* (483) common_expression ::= boolean_value_expression */
+ { 439, 0 }, /* (484) from_clause_opt ::= */
+ { 439, -2 }, /* (485) from_clause_opt ::= FROM table_reference_list */
+ { 440, -1 }, /* (486) table_reference_list ::= table_reference */
+ { 440, -3 }, /* (487) table_reference_list ::= table_reference_list NK_COMMA table_reference */
+ { 441, -1 }, /* (488) table_reference ::= table_primary */
+ { 441, -1 }, /* (489) table_reference ::= joined_table */
+ { 442, -2 }, /* (490) table_primary ::= table_name alias_opt */
+ { 442, -4 }, /* (491) table_primary ::= db_name NK_DOT table_name alias_opt */
+ { 442, -2 }, /* (492) table_primary ::= subquery alias_opt */
+ { 442, -1 }, /* (493) table_primary ::= parenthesized_joined_table */
+ { 444, 0 }, /* (494) alias_opt ::= */
+ { 444, -1 }, /* (495) alias_opt ::= table_alias */
+ { 444, -2 }, /* (496) alias_opt ::= AS table_alias */
+ { 446, -3 }, /* (497) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ { 446, -3 }, /* (498) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
+ { 443, -6 }, /* (499) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+ { 447, 0 }, /* (500) join_type ::= */
+ { 447, -1 }, /* (501) join_type ::= INNER */
+ { 449, -12 }, /* (502) 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 */
+ { 450, 0 }, /* (503) set_quantifier_opt ::= */
+ { 450, -1 }, /* (504) set_quantifier_opt ::= DISTINCT */
+ { 450, -1 }, /* (505) set_quantifier_opt ::= ALL */
+ { 451, -1 }, /* (506) select_list ::= select_item */
+ { 451, -3 }, /* (507) select_list ::= select_list NK_COMMA select_item */
+ { 459, -1 }, /* (508) select_item ::= NK_STAR */
+ { 459, -1 }, /* (509) select_item ::= common_expression */
+ { 459, -2 }, /* (510) select_item ::= common_expression column_alias */
+ { 459, -3 }, /* (511) select_item ::= common_expression AS column_alias */
+ { 459, -3 }, /* (512) select_item ::= table_name NK_DOT NK_STAR */
+ { 414, 0 }, /* (513) where_clause_opt ::= */
+ { 414, -2 }, /* (514) where_clause_opt ::= WHERE search_condition */
+ { 452, 0 }, /* (515) partition_by_clause_opt ::= */
+ { 452, -3 }, /* (516) partition_by_clause_opt ::= PARTITION BY partition_list */
+ { 460, -1 }, /* (517) partition_list ::= partition_item */
+ { 460, -3 }, /* (518) partition_list ::= partition_list NK_COMMA partition_item */
+ { 461, -1 }, /* (519) partition_item ::= expr_or_subquery */
+ { 461, -2 }, /* (520) partition_item ::= expr_or_subquery column_alias */
+ { 461, -3 }, /* (521) partition_item ::= expr_or_subquery AS column_alias */
+ { 456, 0 }, /* (522) twindow_clause_opt ::= */
+ { 456, -6 }, /* (523) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+ { 456, -4 }, /* (524) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+ { 456, -6 }, /* (525) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+ { 456, -8 }, /* (526) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+ { 456, -7 }, /* (527) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+ { 394, 0 }, /* (528) sliding_opt ::= */
+ { 394, -4 }, /* (529) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+ { 455, 0 }, /* (530) fill_opt ::= */
+ { 455, -4 }, /* (531) fill_opt ::= FILL NK_LP fill_mode NK_RP */
+ { 455, -6 }, /* (532) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+ { 455, -6 }, /* (533) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
+ { 462, -1 }, /* (534) fill_mode ::= NONE */
+ { 462, -1 }, /* (535) fill_mode ::= PREV */
+ { 462, -1 }, /* (536) fill_mode ::= NULL */
+ { 462, -1 }, /* (537) fill_mode ::= NULL_F */
+ { 462, -1 }, /* (538) fill_mode ::= LINEAR */
+ { 462, -1 }, /* (539) fill_mode ::= NEXT */
+ { 457, 0 }, /* (540) group_by_clause_opt ::= */
+ { 457, -3 }, /* (541) group_by_clause_opt ::= GROUP BY group_by_list */
+ { 463, -1 }, /* (542) group_by_list ::= expr_or_subquery */
+ { 463, -3 }, /* (543) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+ { 458, 0 }, /* (544) having_clause_opt ::= */
+ { 458, -2 }, /* (545) having_clause_opt ::= HAVING search_condition */
+ { 453, 0 }, /* (546) range_opt ::= */
+ { 453, -6 }, /* (547) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+ { 454, 0 }, /* (548) every_opt ::= */
+ { 454, -4 }, /* (549) every_opt ::= EVERY NK_LP duration_literal NK_RP */
+ { 464, -4 }, /* (550) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ { 465, -1 }, /* (551) query_simple ::= query_specification */
+ { 465, -1 }, /* (552) query_simple ::= union_query_expression */
+ { 469, -4 }, /* (553) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+ { 469, -3 }, /* (554) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+ { 470, -1 }, /* (555) query_simple_or_subquery ::= query_simple */
+ { 470, -1 }, /* (556) query_simple_or_subquery ::= subquery */
+ { 398, -1 }, /* (557) query_or_subquery ::= query_expression */
+ { 398, -1 }, /* (558) query_or_subquery ::= subquery */
+ { 466, 0 }, /* (559) order_by_clause_opt ::= */
+ { 466, -3 }, /* (560) order_by_clause_opt ::= ORDER BY sort_specification_list */
+ { 467, 0 }, /* (561) slimit_clause_opt ::= */
+ { 467, -2 }, /* (562) slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ { 467, -4 }, /* (563) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ { 467, -4 }, /* (564) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 468, 0 }, /* (565) limit_clause_opt ::= */
+ { 468, -2 }, /* (566) limit_clause_opt ::= LIMIT NK_INTEGER */
+ { 468, -4 }, /* (567) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
+ { 468, -4 }, /* (568) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 445, -3 }, /* (569) subquery ::= NK_LP query_expression NK_RP */
+ { 445, -3 }, /* (570) subquery ::= NK_LP subquery NK_RP */
+ { 448, -1 }, /* (571) search_condition ::= common_expression */
+ { 471, -1 }, /* (572) sort_specification_list ::= sort_specification */
+ { 471, -3 }, /* (573) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
+ { 472, -3 }, /* (574) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+ { 473, 0 }, /* (575) ordering_specification_opt ::= */
+ { 473, -1 }, /* (576) ordering_specification_opt ::= ASC */
+ { 473, -1 }, /* (577) ordering_specification_opt ::= DESC */
+ { 474, 0 }, /* (578) null_ordering_opt ::= */
+ { 474, -2 }, /* (579) null_ordering_opt ::= NULLS FIRST */
+ { 474, -2 }, /* (580) null_ordering_opt ::= NULLS LAST */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -3712,11 +3826,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,329,&yymsp[0].minor);
+ yy_destructor(yypParser,331,&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,330,&yymsp[0].minor);
+ yy_destructor(yypParser,332,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
{ }
@@ -3730,20 +3844,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,329,&yymsp[-2].minor);
+{ yy_destructor(yypParser,331,&yymsp[-2].minor);
{ }
- yy_destructor(yypParser,331,&yymsp[0].minor);
+ yy_destructor(yypParser,333,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
-{ yy_destructor(yypParser,332,&yymsp[0].minor);
+{ yy_destructor(yypParser,334,&yymsp[0].minor);
{ }
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
-{ yy_destructor(yypParser,330,&yymsp[-1].minor);
+{ yy_destructor(yypParser,332,&yymsp[-1].minor);
{ }
- yy_destructor(yypParser,332,&yymsp[0].minor);
+ yy_destructor(yypParser,334,&yymsp[0].minor);
}
break;
case 14: /* alter_account_option ::= PASS literal */
@@ -3757,81 +3871,81 @@ 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,331,&yymsp[0].minor);
+ yy_destructor(yypParser,333,&yymsp[0].minor);
break;
case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
-{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy881, &yymsp[-1].minor.yy0, yymsp[0].minor.yy857); }
+{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy0, yymsp[0].minor.yy353); }
break;
case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy881, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, 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.yy881, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, 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.yy881, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
break;
case 28: /* cmd ::= DROP USER user_name */
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); }
break;
case 29: /* sysinfo_opt ::= */
-{ yymsp[1].minor.yy857 = 1; }
+{ yymsp[1].minor.yy353 = 1; }
break;
case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
-{ yymsp[-1].minor.yy857 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
+{ yymsp[-1].minor.yy353 = 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.yy303, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy359, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); }
break;
case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */
-{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy303, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy359, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); }
break;
case 33: /* privileges ::= ALL */
-{ yymsp[0].minor.yy303 = PRIVILEGE_TYPE_ALL; }
+{ yymsp[0].minor.yy359 = PRIVILEGE_TYPE_ALL; }
break;
case 34: /* privileges ::= priv_type_list */
case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36);
-{ yylhsminor.yy303 = yymsp[0].minor.yy303; }
- yymsp[0].minor.yy303 = yylhsminor.yy303;
+{ yylhsminor.yy359 = yymsp[0].minor.yy359; }
+ yymsp[0].minor.yy359 = yylhsminor.yy359;
break;
case 35: /* privileges ::= SUBSCRIBE */
-{ yymsp[0].minor.yy303 = PRIVILEGE_TYPE_SUBSCRIBE; }
+{ yymsp[0].minor.yy359 = PRIVILEGE_TYPE_SUBSCRIBE; }
break;
case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
-{ yylhsminor.yy303 = yymsp[-2].minor.yy303 | yymsp[0].minor.yy303; }
- yymsp[-2].minor.yy303 = yylhsminor.yy303;
+{ yylhsminor.yy359 = yymsp[-2].minor.yy359 | yymsp[0].minor.yy359; }
+ yymsp[-2].minor.yy359 = yylhsminor.yy359;
break;
case 38: /* priv_type ::= READ */
-{ yymsp[0].minor.yy303 = PRIVILEGE_TYPE_READ; }
+{ yymsp[0].minor.yy359 = PRIVILEGE_TYPE_READ; }
break;
case 39: /* priv_type ::= WRITE */
-{ yymsp[0].minor.yy303 = PRIVILEGE_TYPE_WRITE; }
+{ yymsp[0].minor.yy359 = PRIVILEGE_TYPE_WRITE; }
break;
case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
-{ yylhsminor.yy881 = yymsp[-2].minor.yy0; }
- yymsp[-2].minor.yy881 = yylhsminor.yy881;
+{ yylhsminor.yy129 = yymsp[-2].minor.yy0; }
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
break;
case 41: /* priv_level ::= db_name NK_DOT NK_STAR */
-{ yylhsminor.yy881 = yymsp[-2].minor.yy881; }
- yymsp[-2].minor.yy881 = yylhsminor.yy881;
+{ yylhsminor.yy129 = yymsp[-2].minor.yy129; }
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
break;
case 42: /* priv_level ::= topic_name */
- case 282: /* sma_func_name ::= function_name */ yytestcase(yyruleno==282);
- case 486: /* alias_opt ::= table_alias */ yytestcase(yyruleno==486);
-{ yylhsminor.yy881 = yymsp[0].minor.yy881; }
- yymsp[0].minor.yy881 = yylhsminor.yy881;
+ case 286: /* sma_func_name ::= function_name */ yytestcase(yyruleno==286);
+ case 495: /* alias_opt ::= table_alias */ yytestcase(yyruleno==495);
+{ yylhsminor.yy129 = yymsp[0].minor.yy129; }
+ yymsp[0].minor.yy129 = yylhsminor.yy129;
break;
case 43: /* cmd ::= CREATE DNODE dnode_endpoint */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy881, NULL); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL); }
break;
case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &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.yy587); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy337); }
break;
case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy881, yymsp[0].minor.yy587); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy337); }
break;
case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
@@ -3848,50 +3962,51 @@ 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 283: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==283);
- case 284: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==284);
- case 285: /* sma_func_name ::= LAST */ yytestcase(yyruleno==285);
- case 286: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==286);
- case 371: /* db_name ::= NK_ID */ yytestcase(yyruleno==371);
- case 372: /* table_name ::= NK_ID */ yytestcase(yyruleno==372);
- case 373: /* column_name ::= NK_ID */ yytestcase(yyruleno==373);
- case 374: /* function_name ::= NK_ID */ yytestcase(yyruleno==374);
- case 375: /* table_alias ::= NK_ID */ yytestcase(yyruleno==375);
- case 376: /* column_alias ::= NK_ID */ yytestcase(yyruleno==376);
- case 377: /* user_name ::= NK_ID */ yytestcase(yyruleno==377);
- case 378: /* topic_name ::= NK_ID */ yytestcase(yyruleno==378);
- case 379: /* stream_name ::= NK_ID */ yytestcase(yyruleno==379);
- case 380: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==380);
- case 381: /* index_name ::= NK_ID */ yytestcase(yyruleno==381);
- case 421: /* noarg_func ::= NOW */ yytestcase(yyruleno==421);
- case 422: /* noarg_func ::= TODAY */ yytestcase(yyruleno==422);
- case 423: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==423);
- case 424: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==424);
- case 425: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==425);
- case 426: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==426);
- case 427: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==427);
- case 428: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==428);
- case 429: /* noarg_func ::= USER */ yytestcase(yyruleno==429);
- case 430: /* star_func ::= COUNT */ yytestcase(yyruleno==430);
- case 431: /* star_func ::= FIRST */ yytestcase(yyruleno==431);
- case 432: /* star_func ::= LAST */ yytestcase(yyruleno==432);
- case 433: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==433);
-{ yylhsminor.yy881 = yymsp[0].minor.yy0; }
- yymsp[0].minor.yy881 = yylhsminor.yy881;
+ case 287: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==287);
+ case 288: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==288);
+ case 289: /* sma_func_name ::= LAST */ yytestcase(yyruleno==289);
+ case 290: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==290);
+ case 380: /* db_name ::= NK_ID */ yytestcase(yyruleno==380);
+ case 381: /* table_name ::= NK_ID */ yytestcase(yyruleno==381);
+ case 382: /* column_name ::= NK_ID */ yytestcase(yyruleno==382);
+ case 383: /* function_name ::= NK_ID */ yytestcase(yyruleno==383);
+ case 384: /* table_alias ::= NK_ID */ yytestcase(yyruleno==384);
+ case 385: /* column_alias ::= NK_ID */ yytestcase(yyruleno==385);
+ case 386: /* user_name ::= NK_ID */ yytestcase(yyruleno==386);
+ case 387: /* topic_name ::= NK_ID */ yytestcase(yyruleno==387);
+ case 388: /* stream_name ::= NK_ID */ yytestcase(yyruleno==388);
+ case 389: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==389);
+ case 390: /* index_name ::= NK_ID */ yytestcase(yyruleno==390);
+ case 430: /* noarg_func ::= NOW */ yytestcase(yyruleno==430);
+ case 431: /* noarg_func ::= TODAY */ yytestcase(yyruleno==431);
+ case 432: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==432);
+ case 433: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==433);
+ case 434: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==434);
+ case 435: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==435);
+ case 436: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==436);
+ case 437: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==437);
+ case 438: /* noarg_func ::= USER */ yytestcase(yyruleno==438);
+ case 439: /* star_func ::= COUNT */ yytestcase(yyruleno==439);
+ case 440: /* star_func ::= FIRST */ yytestcase(yyruleno==440);
+ case 441: /* star_func ::= LAST */ yytestcase(yyruleno==441);
+ case 442: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==442);
+{ yylhsminor.yy129 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy129 = yylhsminor.yy129;
break;
case 54: /* force_opt ::= */
case 74: /* not_exists_opt ::= */ yytestcase(yyruleno==74);
case 76: /* exists_opt ::= */ yytestcase(yyruleno==76);
- case 303: /* analyze_opt ::= */ yytestcase(yyruleno==303);
- case 310: /* agg_func_opt ::= */ yytestcase(yyruleno==310);
- case 494: /* set_quantifier_opt ::= */ yytestcase(yyruleno==494);
-{ yymsp[1].minor.yy587 = false; }
+ case 307: /* analyze_opt ::= */ yytestcase(yyruleno==307);
+ case 314: /* agg_func_opt ::= */ yytestcase(yyruleno==314);
+ case 320: /* or_replace_opt ::= */ yytestcase(yyruleno==320);
+ case 503: /* set_quantifier_opt ::= */ yytestcase(yyruleno==503);
+{ yymsp[1].minor.yy337 = false; }
break;
case 55: /* force_opt ::= FORCE */
- case 304: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==304);
- case 311: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==311);
- case 495: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==495);
-{ yymsp[0].minor.yy587 = true; }
+ case 308: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==308);
+ case 315: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==315);
+ case 504: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==504);
+{ yymsp[0].minor.yy337 = true; }
break;
case 56: /* cmd ::= ALTER LOCAL NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
@@ -3924,1397 +4039,1427 @@ 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.yy587, &yymsp[-1].minor.yy881, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy337, &yymsp[-1].minor.yy129, yymsp[0].minor.yy712); }
break;
case 67: /* cmd ::= DROP DATABASE exists_opt db_name */
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy587, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); }
break;
case 68: /* cmd ::= USE db_name */
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); }
break;
case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy881, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy712); }
break;
case 70: /* cmd ::= FLUSH DATABASE db_name */
-{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy881); }
+{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy129); }
break;
case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */
-{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy881, yymsp[0].minor.yy214); }
+{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy310); }
break;
case 72: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
-{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy881, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy129, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
break;
case 73: /* not_exists_opt ::= IF NOT EXISTS */
-{ yymsp[-2].minor.yy587 = true; }
+{ yymsp[-2].minor.yy337 = true; }
break;
case 75: /* exists_opt ::= IF EXISTS */
-{ yymsp[-1].minor.yy587 = true; }
+ case 321: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==321);
+{ yymsp[-1].minor.yy337 = true; }
break;
case 77: /* db_options ::= */
-{ yymsp[1].minor.yy140 = createDefaultDatabaseOptions(pCxt); }
+{ yymsp[1].minor.yy712 = createDefaultDatabaseOptions(pCxt); }
break;
case 78: /* db_options ::= db_options BUFFER NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 79: /* db_options ::= db_options CACHEMODEL NK_STRING */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 80: /* db_options ::= db_options CACHESIZE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 81: /* db_options ::= db_options COMP NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 82: /* db_options ::= db_options DURATION NK_INTEGER */
case 83: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==83);
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 84: /* db_options ::= db_options MAXROWS NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 85: /* db_options ::= db_options MINROWS NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 86: /* db_options ::= db_options KEEP integer_list */
case 87: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==87);
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_KEEP, yymsp[0].minor.yy220); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_KEEP, yymsp[0].minor.yy274); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 88: /* db_options ::= db_options PAGES NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 89: /* db_options ::= db_options PAGESIZE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 90: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 91: /* db_options ::= db_options PRECISION NK_STRING */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 92: /* db_options ::= db_options REPLICA NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 95: /* db_options ::= db_options RETENTIONS retention_list */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_RETENTIONS, yymsp[0].minor.yy220); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_RETENTIONS, yymsp[0].minor.yy274); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
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.yy140 = setDatabaseOption(pCxt, yymsp[-3].minor.yy140, DB_OPTION_WAL_RETENTION_PERIOD, &t);
+ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-3].minor.yy712, DB_OPTION_WAL_RETENTION_PERIOD, &t);
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
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.yy140 = setDatabaseOption(pCxt, yymsp[-3].minor.yy140, DB_OPTION_WAL_RETENTION_SIZE, &t);
+ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-3].minor.yy712, DB_OPTION_WAL_RETENTION_SIZE, &t);
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
-{ yylhsminor.yy140 = setDatabaseOption(pCxt, yymsp[-2].minor.yy140, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
case 108: /* alter_db_options ::= alter_db_option */
-{ yylhsminor.yy140 = createAlterDatabaseOptions(pCxt); yylhsminor.yy140 = setAlterDatabaseOption(pCxt, yylhsminor.yy140, &yymsp[0].minor.yy809); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = createAlterDatabaseOptions(pCxt); yylhsminor.yy712 = setAlterDatabaseOption(pCxt, yylhsminor.yy712, &yymsp[0].minor.yy595); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
case 109: /* alter_db_options ::= alter_db_options alter_db_option */
-{ yylhsminor.yy140 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy140, &yymsp[0].minor.yy809); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+{ yylhsminor.yy712 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy712, &yymsp[0].minor.yy595); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
case 110: /* alter_db_option ::= BUFFER NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy595.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.yy809.type = DB_OPTION_KEEP; yymsp[-1].minor.yy809.pList = yymsp[0].minor.yy220; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_KEEP; yymsp[-1].minor.yy595.pList = yymsp[0].minor.yy274; }
break;
case 116: /* alter_db_option ::= PAGES NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_PAGES; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_PAGES; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 117: /* alter_db_option ::= REPLICA NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_WAL; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_WAL; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy595.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
case 120: /* alter_db_option ::= MINROWS NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
- break;
- case 121: /* integer_list ::= NK_INTEGER */
-{ yylhsminor.yy220 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
- break;
- case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
- case 340: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==340);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
- break;
- case 123: /* variable_list ::= NK_VARIABLE */
-{ yylhsminor.yy220 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
- break;
- case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
- break;
- case 125: /* retention_list ::= retention */
- case 155: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==155);
- case 158: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==158);
- case 165: /* column_def_list ::= column_def */ yytestcase(yyruleno==165);
- case 209: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==209);
- case 214: /* col_name_list ::= col_name */ yytestcase(yyruleno==214);
- case 265: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==265);
- case 279: /* func_list ::= func */ yytestcase(yyruleno==279);
- case 369: /* literal_list ::= signed_literal */ yytestcase(yyruleno==369);
- case 436: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==436);
- case 442: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==442);
- case 497: /* select_list ::= select_item */ yytestcase(yyruleno==497);
- case 508: /* partition_list ::= partition_item */ yytestcase(yyruleno==508);
- case 563: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==563);
-{ yylhsminor.yy220 = createNodeList(pCxt, yymsp[0].minor.yy140); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
- break;
- case 126: /* retention_list ::= retention_list NK_COMMA retention */
- case 159: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==159);
- case 166: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==166);
- case 210: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==210);
- case 215: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==215);
- case 266: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==266);
- case 280: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==280);
- case 370: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==370);
- case 437: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==437);
- case 498: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==498);
- case 509: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==509);
- case 564: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==564);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, yymsp[0].minor.yy140); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
- break;
- case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
-{ yylhsminor.yy140 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 128: /* speed_opt ::= */
- case 312: /* bufsize_opt ::= */ yytestcase(yyruleno==312);
-{ yymsp[1].minor.yy214 = 0; }
- break;
- case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */
- case 313: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==313);
-{ yymsp[-1].minor.yy214 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
- break;
- case 130: /* start_opt ::= */
- case 134: /* end_opt ::= */ yytestcase(yyruleno==134);
- case 259: /* like_pattern_opt ::= */ yytestcase(yyruleno==259);
- case 330: /* subtable_opt ::= */ yytestcase(yyruleno==330);
- case 445: /* case_when_else_opt ::= */ yytestcase(yyruleno==445);
- case 475: /* from_clause_opt ::= */ yytestcase(yyruleno==475);
- case 504: /* where_clause_opt ::= */ yytestcase(yyruleno==504);
- case 513: /* twindow_clause_opt ::= */ yytestcase(yyruleno==513);
- case 519: /* sliding_opt ::= */ yytestcase(yyruleno==519);
- case 521: /* fill_opt ::= */ yytestcase(yyruleno==521);
- case 535: /* having_clause_opt ::= */ yytestcase(yyruleno==535);
- case 537: /* range_opt ::= */ yytestcase(yyruleno==537);
- case 539: /* every_opt ::= */ yytestcase(yyruleno==539);
- case 552: /* slimit_clause_opt ::= */ yytestcase(yyruleno==552);
- case 556: /* limit_clause_opt ::= */ yytestcase(yyruleno==556);
-{ yymsp[1].minor.yy140 = NULL; }
- break;
- case 131: /* start_opt ::= START WITH NK_INTEGER */
- case 135: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==135);
-{ yymsp[-2].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
- break;
- case 132: /* start_opt ::= START WITH NK_STRING */
- case 136: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==136);
-{ yymsp[-2].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
- break;
- case 133: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
- case 137: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==137);
-{ yymsp[-3].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
- break;
- case 138: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- case 140: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==140);
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy587, yymsp[-5].minor.yy140, yymsp[-3].minor.yy220, yymsp[-1].minor.yy220, yymsp[0].minor.yy140); }
- break;
- case 139: /* cmd ::= CREATE TABLE multi_create_clause */
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy220); }
- break;
- case 141: /* cmd ::= DROP TABLE multi_drop_clause */
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy220); }
- break;
- case 142: /* cmd ::= DROP STABLE exists_opt full_table_name */
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy587, yymsp[0].minor.yy140); }
- break;
- case 143: /* cmd ::= ALTER TABLE alter_table_clause */
- case 342: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==342);
- case 343: /* cmd ::= insert_query */ yytestcase(yyruleno==343);
-{ pCxt->pRootNode = yymsp[0].minor.yy140; }
- break;
- case 144: /* cmd ::= ALTER STABLE alter_table_clause */
-{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy140); }
- break;
- case 145: /* alter_table_clause ::= full_table_name alter_table_options */
-{ yylhsminor.yy140 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
- break;
- case 146: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy881, yymsp[0].minor.yy682); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 147: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-{ yylhsminor.yy140 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy140, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy881); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
- break;
- case 148: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy881, yymsp[0].minor.yy682); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 149: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-{ yylhsminor.yy140 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy881, &yymsp[0].minor.yy881); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 150: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy881, yymsp[0].minor.yy682); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 151: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-{ yylhsminor.yy140 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy140, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy881); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
- break;
- case 152: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-{ yylhsminor.yy140 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy881, yymsp[0].minor.yy682); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 153: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-{ yylhsminor.yy140 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy140, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy881, &yymsp[0].minor.yy881); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+{ yymsp[-1].minor.yy595.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
- case 154: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
-{ yylhsminor.yy140 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy140, &yymsp[-2].minor.yy881, yymsp[0].minor.yy140); }
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ case 121: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
+{ yymsp[-1].minor.yy595.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
- case 156: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
- case 443: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==443);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-1].minor.yy220, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy220 = yylhsminor.yy220;
+ case 122: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+{
+ SToken t = yymsp[-1].minor.yy0;
+ t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
+ yymsp[-2].minor.yy595.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy595.val = t;
+ }
break;
- case 157: /* 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.yy140 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy587, yymsp[-8].minor.yy140, yymsp[-6].minor.yy140, yymsp[-5].minor.yy220, yymsp[-2].minor.yy220, yymsp[0].minor.yy140); }
- yymsp[-9].minor.yy140 = yylhsminor.yy140;
+ case 123: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
+{ yymsp[-1].minor.yy595.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
- case 160: /* drop_table_clause ::= exists_opt full_table_name */
-{ yylhsminor.yy140 = createDropTableClause(pCxt, yymsp[-1].minor.yy587, yymsp[0].minor.yy140); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 124: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+{
+ SToken t = yymsp[-1].minor.yy0;
+ t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
+ yymsp[-2].minor.yy595.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy595.val = t;
+ }
+ break;
+ case 125: /* integer_list ::= NK_INTEGER */
+{ yylhsminor.yy274 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 126: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
+ case 349: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==349);
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-2].minor.yy274, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 127: /* variable_list ::= NK_VARIABLE */
+{ yylhsminor.yy274 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 128: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-2].minor.yy274, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 129: /* retention_list ::= retention */
+ case 159: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==159);
+ case 162: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==162);
+ case 169: /* column_def_list ::= column_def */ yytestcase(yyruleno==169);
+ case 213: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==213);
+ case 218: /* col_name_list ::= col_name */ yytestcase(yyruleno==218);
+ case 269: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==269);
+ case 283: /* func_list ::= func */ yytestcase(yyruleno==283);
+ case 378: /* literal_list ::= signed_literal */ yytestcase(yyruleno==378);
+ case 445: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==445);
+ case 451: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==451);
+ case 506: /* select_list ::= select_item */ yytestcase(yyruleno==506);
+ case 517: /* partition_list ::= partition_item */ yytestcase(yyruleno==517);
+ case 572: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==572);
+{ yylhsminor.yy274 = createNodeList(pCxt, yymsp[0].minor.yy712); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 130: /* retention_list ::= retention_list NK_COMMA retention */
+ case 163: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==163);
+ case 170: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==170);
+ case 214: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==214);
+ case 219: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==219);
+ case 270: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==270);
+ case 284: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==284);
+ case 379: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==379);
+ case 446: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==446);
+ case 507: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==507);
+ case 518: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==518);
+ case 573: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==573);
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-2].minor.yy274, yymsp[0].minor.yy712); }
+ yymsp[-2].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 131: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
+{ yylhsminor.yy712 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 132: /* speed_opt ::= */
+ case 316: /* bufsize_opt ::= */ yytestcase(yyruleno==316);
+{ yymsp[1].minor.yy310 = 0; }
+ break;
+ case 133: /* speed_opt ::= MAX_SPEED NK_INTEGER */
+ case 317: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==317);
+{ yymsp[-1].minor.yy310 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+ break;
+ case 134: /* start_opt ::= */
+ case 138: /* end_opt ::= */ yytestcase(yyruleno==138);
+ case 263: /* like_pattern_opt ::= */ yytestcase(yyruleno==263);
+ case 338: /* subtable_opt ::= */ yytestcase(yyruleno==338);
+ case 454: /* case_when_else_opt ::= */ yytestcase(yyruleno==454);
+ case 484: /* from_clause_opt ::= */ yytestcase(yyruleno==484);
+ case 513: /* where_clause_opt ::= */ yytestcase(yyruleno==513);
+ case 522: /* twindow_clause_opt ::= */ yytestcase(yyruleno==522);
+ case 528: /* sliding_opt ::= */ yytestcase(yyruleno==528);
+ case 530: /* fill_opt ::= */ yytestcase(yyruleno==530);
+ case 544: /* having_clause_opt ::= */ yytestcase(yyruleno==544);
+ case 546: /* range_opt ::= */ yytestcase(yyruleno==546);
+ case 548: /* every_opt ::= */ yytestcase(yyruleno==548);
+ case 561: /* slimit_clause_opt ::= */ yytestcase(yyruleno==561);
+ case 565: /* limit_clause_opt ::= */ yytestcase(yyruleno==565);
+{ yymsp[1].minor.yy712 = NULL; }
+ break;
+ case 135: /* start_opt ::= START WITH NK_INTEGER */
+ case 139: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==139);
+{ yymsp[-2].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ break;
+ case 136: /* start_opt ::= START WITH NK_STRING */
+ case 140: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==140);
+{ yymsp[-2].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 137: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
+ case 141: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==141);
+{ yymsp[-3].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 142: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ case 144: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==144);
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy337, yymsp[-5].minor.yy712, yymsp[-3].minor.yy274, yymsp[-1].minor.yy274, yymsp[0].minor.yy712); }
+ break;
+ case 143: /* cmd ::= CREATE TABLE multi_create_clause */
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy274); }
+ break;
+ case 145: /* cmd ::= DROP TABLE multi_drop_clause */
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy274); }
+ break;
+ case 146: /* cmd ::= DROP STABLE exists_opt full_table_name */
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy337, yymsp[0].minor.yy712); }
+ break;
+ case 147: /* cmd ::= ALTER TABLE alter_table_clause */
+ case 351: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==351);
+ case 352: /* cmd ::= insert_query */ yytestcase(yyruleno==352);
+{ pCxt->pRootNode = yymsp[0].minor.yy712; }
+ break;
+ case 148: /* cmd ::= ALTER STABLE alter_table_clause */
+{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy712); }
+ break;
+ case 149: /* alter_table_clause ::= full_table_name alter_table_options */
+{ yylhsminor.yy712 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 150: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 151: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
+{ yylhsminor.yy712 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy712, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy129); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 152: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 153: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+{ yylhsminor.yy712 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 154: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 155: /* alter_table_clause ::= full_table_name DROP TAG column_name */
+{ yylhsminor.yy712 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy712, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy129); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 156: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 157: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+{ yylhsminor.yy712 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 158: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+{ yylhsminor.yy712 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy712, &yymsp[-2].minor.yy129, yymsp[0].minor.yy712); }
+ yymsp[-5].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 160: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
+ case 452: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==452);
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-1].minor.yy274, yymsp[0].minor.yy712); }
+ yymsp[-1].minor.yy274 = yylhsminor.yy274;
break;
- case 161: /* specific_cols_opt ::= */
- case 192: /* tags_def_opt ::= */ yytestcase(yyruleno==192);
- case 264: /* tag_list_opt ::= */ yytestcase(yyruleno==264);
- case 316: /* col_list_opt ::= */ yytestcase(yyruleno==316);
- case 318: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==318);
- case 506: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==506);
- case 531: /* group_by_clause_opt ::= */ yytestcase(yyruleno==531);
- case 550: /* order_by_clause_opt ::= */ yytestcase(yyruleno==550);
-{ yymsp[1].minor.yy220 = NULL; }
+ case 161: /* 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.yy712 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy337, yymsp[-8].minor.yy712, yymsp[-6].minor.yy712, yymsp[-5].minor.yy274, yymsp[-2].minor.yy274, yymsp[0].minor.yy712); }
+ yymsp[-9].minor.yy712 = yylhsminor.yy712;
break;
- case 162: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
- case 317: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==317);
-{ yymsp[-2].minor.yy220 = yymsp[-1].minor.yy220; }
+ case 164: /* drop_table_clause ::= exists_opt full_table_name */
+{ yylhsminor.yy712 = createDropTableClause(pCxt, yymsp[-1].minor.yy337, yymsp[0].minor.yy712); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 163: /* full_table_name ::= table_name */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy881, NULL); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 165: /* specific_cols_opt ::= */
+ case 196: /* tags_def_opt ::= */ yytestcase(yyruleno==196);
+ case 268: /* tag_list_opt ::= */ yytestcase(yyruleno==268);
+ case 324: /* col_list_opt ::= */ yytestcase(yyruleno==324);
+ case 326: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==326);
+ case 515: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==515);
+ case 540: /* group_by_clause_opt ::= */ yytestcase(yyruleno==540);
+ case 559: /* order_by_clause_opt ::= */ yytestcase(yyruleno==559);
+{ yymsp[1].minor.yy274 = NULL; }
break;
- case 164: /* full_table_name ::= db_name NK_DOT table_name */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 166: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ case 325: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==325);
+{ yymsp[-2].minor.yy274 = yymsp[-1].minor.yy274; }
break;
- case 167: /* column_def ::= column_name type_name */
-{ yylhsminor.yy140 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy881, yymsp[0].minor.yy682, NULL); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 167: /* full_table_name ::= table_name */
+{ yylhsminor.yy712 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 168: /* column_def ::= column_name type_name COMMENT NK_STRING */
-{ yylhsminor.yy140 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy881, yymsp[-2].minor.yy682, &yymsp[0].minor.yy0); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 168: /* full_table_name ::= db_name NK_DOT table_name */
+{ yylhsminor.yy712 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 169: /* type_name ::= BOOL */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_BOOL); }
+ case 171: /* column_def ::= column_name type_name */
+{ yylhsminor.yy712 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184, NULL); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 170: /* type_name ::= TINYINT */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+ case 172: /* column_def ::= column_name type_name COMMENT NK_STRING */
+{ yylhsminor.yy712 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 171: /* type_name ::= SMALLINT */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+ case 173: /* type_name ::= BOOL */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
- case 172: /* type_name ::= INT */
- case 173: /* type_name ::= INTEGER */ yytestcase(yyruleno==173);
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_INT); }
+ case 174: /* type_name ::= TINYINT */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
- case 174: /* type_name ::= BIGINT */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+ case 175: /* type_name ::= SMALLINT */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
- case 175: /* type_name ::= FLOAT */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+ case 176: /* type_name ::= INT */
+ case 177: /* type_name ::= INTEGER */ yytestcase(yyruleno==177);
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_INT); }
break;
- case 176: /* type_name ::= DOUBLE */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+ case 178: /* type_name ::= BIGINT */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
- case 177: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy682 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+ case 179: /* type_name ::= FLOAT */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
- case 178: /* type_name ::= TIMESTAMP */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+ case 180: /* type_name ::= DOUBLE */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
- case 179: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy682 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+ case 181: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
- case 180: /* type_name ::= TINYINT UNSIGNED */
-{ yymsp[-1].minor.yy682 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+ case 182: /* type_name ::= TIMESTAMP */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
- case 181: /* type_name ::= SMALLINT UNSIGNED */
-{ yymsp[-1].minor.yy682 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+ case 183: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
- case 182: /* type_name ::= INT UNSIGNED */
-{ yymsp[-1].minor.yy682 = createDataType(TSDB_DATA_TYPE_UINT); }
+ case 184: /* type_name ::= TINYINT UNSIGNED */
+{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
- case 183: /* type_name ::= BIGINT UNSIGNED */
-{ yymsp[-1].minor.yy682 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+ case 185: /* type_name ::= SMALLINT UNSIGNED */
+{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
- case 184: /* type_name ::= JSON */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_JSON); }
+ case 186: /* type_name ::= INT UNSIGNED */
+{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
- case 185: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy682 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+ case 187: /* type_name ::= BIGINT UNSIGNED */
+{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
- case 186: /* type_name ::= MEDIUMBLOB */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+ case 188: /* type_name ::= JSON */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
- case 187: /* type_name ::= BLOB */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_BLOB); }
+ case 189: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
- case 188: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy682 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+ case 190: /* type_name ::= MEDIUMBLOB */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
- case 189: /* type_name ::= DECIMAL */
-{ yymsp[0].minor.yy682 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 191: /* type_name ::= BLOB */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
- case 190: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy682 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 192: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
- case 191: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy682 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 193: /* type_name ::= DECIMAL */
+{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 193: /* tags_def_opt ::= tags_def */
- case 319: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==319);
- case 435: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==435);
-{ yylhsminor.yy220 = yymsp[0].minor.yy220; }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 194: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 194: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
- case 320: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==320);
-{ yymsp[-3].minor.yy220 = yymsp[-1].minor.yy220; }
+ case 195: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 195: /* table_options ::= */
-{ yymsp[1].minor.yy140 = createDefaultTableOptions(pCxt); }
+ case 197: /* tags_def_opt ::= tags_def */
+ case 327: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==327);
+ case 444: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==444);
+{ yylhsminor.yy274 = yymsp[0].minor.yy274; }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
break;
- case 196: /* table_options ::= table_options COMMENT NK_STRING */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-2].minor.yy140, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 198: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ case 328: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==328);
+{ yymsp[-3].minor.yy274 = yymsp[-1].minor.yy274; }
break;
- case 197: /* table_options ::= table_options MAX_DELAY duration_list */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-2].minor.yy140, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy220); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 199: /* table_options ::= */
+{ yymsp[1].minor.yy712 = createDefaultTableOptions(pCxt); }
break;
- case 198: /* table_options ::= table_options WATERMARK duration_list */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-2].minor.yy140, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy220); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 200: /* table_options ::= table_options COMMENT NK_STRING */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 199: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-4].minor.yy140, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy220); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+ case 201: /* table_options ::= table_options MAX_DELAY duration_list */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy274); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 200: /* table_options ::= table_options TTL NK_INTEGER */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-2].minor.yy140, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 202: /* table_options ::= table_options WATERMARK duration_list */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy274); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 201: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-4].minor.yy140, TABLE_OPTION_SMA, yymsp[-1].minor.yy220); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+ case 203: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-4].minor.yy712, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy274); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
break;
- case 202: /* table_options ::= table_options DELETE_MARK duration_list */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-2].minor.yy140, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy220); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 204: /* table_options ::= table_options TTL NK_INTEGER */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 203: /* alter_table_options ::= alter_table_option */
-{ yylhsminor.yy140 = createAlterTableOptions(pCxt); yylhsminor.yy140 = setTableOption(pCxt, yylhsminor.yy140, yymsp[0].minor.yy809.type, &yymsp[0].minor.yy809.val); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 205: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-4].minor.yy712, TABLE_OPTION_SMA, yymsp[-1].minor.yy274); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
break;
- case 204: /* alter_table_options ::= alter_table_options alter_table_option */
-{ yylhsminor.yy140 = setTableOption(pCxt, yymsp[-1].minor.yy140, yymsp[0].minor.yy809.type, &yymsp[0].minor.yy809.val); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 206: /* table_options ::= table_options DELETE_MARK duration_list */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy274); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 205: /* alter_table_option ::= COMMENT NK_STRING */
-{ yymsp[-1].minor.yy809.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+ case 207: /* alter_table_options ::= alter_table_option */
+{ yylhsminor.yy712 = createAlterTableOptions(pCxt); yylhsminor.yy712 = setTableOption(pCxt, yylhsminor.yy712, yymsp[0].minor.yy595.type, &yymsp[0].minor.yy595.val); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 206: /* alter_table_option ::= TTL NK_INTEGER */
-{ yymsp[-1].minor.yy809.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy809.val = yymsp[0].minor.yy0; }
+ case 208: /* alter_table_options ::= alter_table_options alter_table_option */
+{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy595.type, &yymsp[0].minor.yy595.val); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 207: /* duration_list ::= duration_literal */
- case 399: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==399);
-{ yylhsminor.yy220 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 209: /* alter_table_option ::= COMMENT NK_STRING */
+{ yymsp[-1].minor.yy595.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
- case 208: /* duration_list ::= duration_list NK_COMMA duration_literal */
- case 400: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==400);
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+ case 210: /* alter_table_option ::= TTL NK_INTEGER */
+{ yymsp[-1].minor.yy595.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy595.val = yymsp[0].minor.yy0; }
break;
- case 211: /* rollup_func_name ::= function_name */
-{ yylhsminor.yy140 = createFunctionNode(pCxt, &yymsp[0].minor.yy881, NULL); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 211: /* duration_list ::= duration_literal */
+ case 408: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==408);
+{ yylhsminor.yy274 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
break;
- case 212: /* rollup_func_name ::= FIRST */
- case 213: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==213);
- case 268: /* tag_item ::= QTAGS */ yytestcase(yyruleno==268);
-{ yylhsminor.yy140 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 212: /* duration_list ::= duration_list NK_COMMA duration_literal */
+ case 409: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==409);
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-2].minor.yy274, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ yymsp[-2].minor.yy274 = yylhsminor.yy274;
break;
- case 216: /* col_name ::= column_name */
- case 269: /* tag_item ::= column_name */ yytestcase(yyruleno==269);
-{ yylhsminor.yy140 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy881); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 215: /* rollup_func_name ::= function_name */
+{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[0].minor.yy129, NULL); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 217: /* cmd ::= SHOW DNODES */
+ case 216: /* rollup_func_name ::= FIRST */
+ case 217: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==217);
+ case 272: /* tag_item ::= QTAGS */ yytestcase(yyruleno==272);
+{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 220: /* col_name ::= column_name */
+ case 273: /* tag_item ::= column_name */ yytestcase(yyruleno==273);
+{ yylhsminor.yy712 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 221: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
break;
- case 218: /* cmd ::= SHOW USERS */
+ case 222: /* cmd ::= SHOW USERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
break;
- case 219: /* cmd ::= SHOW USER PRIVILEGES */
+ case 223: /* cmd ::= SHOW USER PRIVILEGES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
break;
- case 220: /* cmd ::= SHOW DATABASES */
+ case 224: /* cmd ::= SHOW DATABASES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
break;
- case 221: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy140, yymsp[0].minor.yy140, OP_TYPE_LIKE); }
+ case 225: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, OP_TYPE_LIKE); }
break;
- case 222: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy140, yymsp[0].minor.yy140, OP_TYPE_LIKE); }
+ case 226: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, OP_TYPE_LIKE); }
break;
- case 223: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy140, NULL, OP_TYPE_LIKE); }
+ case 227: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy712, NULL, OP_TYPE_LIKE); }
break;
- case 224: /* cmd ::= SHOW MNODES */
+ case 228: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
break;
- case 225: /* cmd ::= SHOW QNODES */
+ case 229: /* cmd ::= SHOW QNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
break;
- case 226: /* cmd ::= SHOW FUNCTIONS */
+ case 230: /* cmd ::= SHOW FUNCTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
break;
- case 227: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy140, yymsp[-1].minor.yy140, OP_TYPE_EQUAL); }
+ case 231: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy712, yymsp[-1].minor.yy712, OP_TYPE_EQUAL); }
break;
- case 228: /* cmd ::= SHOW STREAMS */
+ case 232: /* cmd ::= SHOW STREAMS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
break;
- case 229: /* cmd ::= SHOW ACCOUNTS */
+ case 233: /* cmd ::= SHOW ACCOUNTS */
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
break;
- case 230: /* cmd ::= SHOW APPS */
+ case 234: /* cmd ::= SHOW APPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
break;
- case 231: /* cmd ::= SHOW CONNECTIONS */
+ case 235: /* cmd ::= SHOW CONNECTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
break;
- case 232: /* cmd ::= SHOW LICENCES */
- case 233: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==233);
+ case 236: /* cmd ::= SHOW LICENCES */
+ case 237: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==237);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
break;
- case 234: /* cmd ::= SHOW CREATE DATABASE db_name */
-{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy881); }
+ case 238: /* cmd ::= SHOW CREATE DATABASE db_name */
+{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy129); }
break;
- case 235: /* cmd ::= SHOW CREATE TABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy140); }
+ case 239: /* cmd ::= SHOW CREATE TABLE full_table_name */
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy712); }
break;
- case 236: /* cmd ::= SHOW CREATE STABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy140); }
+ case 240: /* cmd ::= SHOW CREATE STABLE full_table_name */
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy712); }
break;
- case 237: /* cmd ::= SHOW QUERIES */
+ case 241: /* cmd ::= SHOW QUERIES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
break;
- case 238: /* cmd ::= SHOW SCORES */
+ case 242: /* cmd ::= SHOW SCORES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
break;
- case 239: /* cmd ::= SHOW TOPICS */
+ case 243: /* cmd ::= SHOW TOPICS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
break;
- case 240: /* cmd ::= SHOW VARIABLES */
- case 241: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==241);
+ case 244: /* cmd ::= SHOW VARIABLES */
+ case 245: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==245);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
break;
- case 242: /* cmd ::= SHOW LOCAL VARIABLES */
+ case 246: /* cmd ::= SHOW LOCAL VARIABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
break;
- case 243: /* 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.yy140); }
+ case 247: /* 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.yy712); }
break;
- case 244: /* cmd ::= SHOW BNODES */
+ case 248: /* cmd ::= SHOW BNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
break;
- case 245: /* cmd ::= SHOW SNODES */
+ case 249: /* cmd ::= SHOW SNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
break;
- case 246: /* cmd ::= SHOW CLUSTER */
+ case 250: /* cmd ::= SHOW CLUSTER */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
break;
- case 247: /* cmd ::= SHOW TRANSACTIONS */
+ case 251: /* cmd ::= SHOW TRANSACTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
break;
- case 248: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
-{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy140); }
+ case 252: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy712); }
break;
- case 249: /* cmd ::= SHOW CONSUMERS */
+ case 253: /* cmd ::= SHOW CONSUMERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
break;
- case 250: /* cmd ::= SHOW SUBSCRIPTIONS */
+ case 254: /* cmd ::= SHOW SUBSCRIPTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
break;
- case 251: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy140, yymsp[-1].minor.yy140, OP_TYPE_EQUAL); }
+ case 255: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy712, yymsp[-1].minor.yy712, OP_TYPE_EQUAL); }
break;
- case 252: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy140, yymsp[0].minor.yy140, yymsp[-3].minor.yy220); }
+ case 256: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy712, yymsp[-3].minor.yy274); }
break;
- case 253: /* cmd ::= SHOW VNODES NK_INTEGER */
+ case 257: /* cmd ::= SHOW VNODES NK_INTEGER */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
break;
- case 254: /* cmd ::= SHOW VNODES NK_STRING */
+ case 258: /* cmd ::= SHOW VNODES NK_STRING */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); }
break;
- case 255: /* cmd ::= SHOW db_name_cond_opt ALIVE */
-{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy140, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
+ case 259: /* cmd ::= SHOW db_name_cond_opt ALIVE */
+{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy712, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
break;
- case 256: /* cmd ::= SHOW CLUSTER ALIVE */
+ case 260: /* cmd ::= SHOW CLUSTER ALIVE */
{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); }
break;
- case 257: /* db_name_cond_opt ::= */
- case 262: /* from_db_opt ::= */ yytestcase(yyruleno==262);
-{ yymsp[1].minor.yy140 = createDefaultDatabaseCondValue(pCxt); }
+ case 261: /* db_name_cond_opt ::= */
+ case 266: /* from_db_opt ::= */ yytestcase(yyruleno==266);
+{ yymsp[1].minor.yy712 = createDefaultDatabaseCondValue(pCxt); }
break;
- case 258: /* db_name_cond_opt ::= db_name NK_DOT */
-{ yylhsminor.yy140 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy881); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 262: /* db_name_cond_opt ::= db_name NK_DOT */
+{ yylhsminor.yy712 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy129); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 260: /* like_pattern_opt ::= LIKE NK_STRING */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ case 264: /* like_pattern_opt ::= LIKE NK_STRING */
+{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
- case 261: /* table_name_cond ::= table_name */
-{ yylhsminor.yy140 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy881); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 265: /* table_name_cond ::= table_name */
+{ yylhsminor.yy712 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 263: /* from_db_opt ::= FROM db_name */
-{ yymsp[-1].minor.yy140 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy881); }
+ case 267: /* from_db_opt ::= FROM db_name */
+{ yymsp[-1].minor.yy712 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy129); }
break;
- case 267: /* tag_item ::= TBNAME */
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 271: /* tag_item ::= TBNAME */
+{ yylhsminor.yy712 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 270: /* tag_item ::= column_name column_alias */
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy881), &yymsp[0].minor.yy881); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 274: /* tag_item ::= column_name column_alias */
+{ yylhsminor.yy712 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy129), &yymsp[0].minor.yy129); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 271: /* tag_item ::= column_name AS column_alias */
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy881), &yymsp[0].minor.yy881); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 275: /* tag_item ::= column_name AS column_alias */
+{ yylhsminor.yy712 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy129), &yymsp[0].minor.yy129); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 272: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy587, yymsp[-3].minor.yy140, yymsp[-1].minor.yy140, NULL, yymsp[0].minor.yy140); }
+ case 276: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy337, yymsp[-3].minor.yy712, yymsp[-1].minor.yy712, NULL, yymsp[0].minor.yy712); }
break;
- case 273: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy587, yymsp[-5].minor.yy140, yymsp[-3].minor.yy140, yymsp[-1].minor.yy220, NULL); }
+ case 277: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy337, yymsp[-5].minor.yy712, yymsp[-3].minor.yy712, yymsp[-1].minor.yy274, NULL); }
break;
- case 274: /* cmd ::= DROP INDEX exists_opt full_index_name */
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy587, yymsp[0].minor.yy140); }
+ case 278: /* cmd ::= DROP INDEX exists_opt full_index_name */
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy337, yymsp[0].minor.yy712); }
break;
- case 275: /* full_index_name ::= index_name */
-{ yylhsminor.yy140 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy881); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 279: /* full_index_name ::= index_name */
+{ yylhsminor.yy712 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy129); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 276: /* full_index_name ::= db_name NK_DOT index_name */
-{ yylhsminor.yy140 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 280: /* full_index_name ::= db_name NK_DOT index_name */
+{ yylhsminor.yy712 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 277: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
-{ yymsp[-9].minor.yy140 = createIndexOption(pCxt, yymsp[-7].minor.yy220, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), NULL, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 281: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+{ yymsp[-9].minor.yy712 = createIndexOption(pCxt, yymsp[-7].minor.yy274, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
break;
- case 278: /* 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.yy140 = createIndexOption(pCxt, yymsp[-9].minor.yy220, releaseRawExprNode(pCxt, yymsp[-5].minor.yy140), releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 282: /* 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.yy712 = createIndexOption(pCxt, yymsp[-9].minor.yy274, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
break;
- case 281: /* func ::= sma_func_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy140 = createFunctionNode(pCxt, &yymsp[-3].minor.yy881, yymsp[-1].minor.yy220); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 285: /* func ::= sma_func_name NK_LP expression_list NK_RP */
+{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy274); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 287: /* sma_stream_opt ::= */
- case 321: /* stream_options ::= */ yytestcase(yyruleno==321);
-{ yymsp[1].minor.yy140 = createStreamOptions(pCxt); }
+ case 291: /* sma_stream_opt ::= */
+ case 329: /* stream_options ::= */ yytestcase(yyruleno==329);
+{ yymsp[1].minor.yy712 = createStreamOptions(pCxt); }
break;
- case 288: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
-{ ((SStreamOptions*)yymsp[-2].minor.yy140)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 292: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy712)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-2].minor.yy712; }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 289: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
-{ ((SStreamOptions*)yymsp[-2].minor.yy140)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 293: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy712)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-2].minor.yy712; }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 290: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
-{ ((SStreamOptions*)yymsp[-2].minor.yy140)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); yylhsminor.yy140 = yymsp[-2].minor.yy140; }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 294: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy712)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-2].minor.yy712; }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 291: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
-{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy587, &yymsp[-2].minor.yy881, yymsp[0].minor.yy140); }
+ case 295: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy337, &yymsp[-2].minor.yy129, yymsp[0].minor.yy712); }
break;
- case 292: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy587, &yymsp[-3].minor.yy881, &yymsp[0].minor.yy881, false); }
+ case 296: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy337, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy129, false); }
break;
- case 293: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy587, &yymsp[-5].minor.yy881, &yymsp[0].minor.yy881, true); }
+ case 297: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy337, &yymsp[-5].minor.yy129, &yymsp[0].minor.yy129, true); }
break;
- case 294: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy587, &yymsp[-3].minor.yy881, yymsp[0].minor.yy140, false); }
+ case 298: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy337, &yymsp[-3].minor.yy129, yymsp[0].minor.yy712, false); }
break;
- case 295: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy587, &yymsp[-5].minor.yy881, yymsp[0].minor.yy140, true); }
+ case 299: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy337, &yymsp[-5].minor.yy129, yymsp[0].minor.yy712, true); }
break;
- case 296: /* cmd ::= DROP TOPIC exists_opt topic_name */
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy587, &yymsp[0].minor.yy881); }
+ case 300: /* cmd ::= DROP TOPIC exists_opt topic_name */
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); }
break;
- case 297: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
-{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy587, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881); }
+ case 301: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy337, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); }
break;
- case 298: /* cmd ::= DESC full_table_name */
- case 299: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==299);
-{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy140); }
+ case 302: /* cmd ::= DESC full_table_name */
+ case 303: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==303);
+{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy712); }
break;
- case 300: /* cmd ::= RESET QUERY CACHE */
+ case 304: /* cmd ::= RESET QUERY CACHE */
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
break;
- case 301: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
- case 302: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==302);
-{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy587, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 305: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
+ case 306: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==306);
+{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy337, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
+ break;
+ case 309: /* explain_options ::= */
+{ yymsp[1].minor.yy712 = createDefaultExplainOptions(pCxt); }
break;
- case 305: /* explain_options ::= */
-{ yymsp[1].minor.yy140 = createDefaultExplainOptions(pCxt); }
+ case 310: /* explain_options ::= explain_options VERBOSE NK_BOOL */
+{ yylhsminor.yy712 = setExplainVerbose(pCxt, yymsp[-2].minor.yy712, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 306: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-{ yylhsminor.yy140 = setExplainVerbose(pCxt, yymsp[-2].minor.yy140, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 311: /* explain_options ::= explain_options RATIO NK_FLOAT */
+{ yylhsminor.yy712 = setExplainRatio(pCxt, yymsp[-2].minor.yy712, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 307: /* explain_options ::= explain_options RATIO NK_FLOAT */
-{ yylhsminor.yy140 = setExplainRatio(pCxt, yymsp[-2].minor.yy140, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 312: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */
+{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy337, yymsp[-9].minor.yy337, &yymsp[-6].minor.yy129, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy184, yymsp[-1].minor.yy310, &yymsp[0].minor.yy129, yymsp[-10].minor.yy337); }
break;
- case 308: /* 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.yy587, yymsp[-8].minor.yy587, &yymsp[-5].minor.yy881, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy682, yymsp[0].minor.yy214); }
+ case 313: /* cmd ::= DROP FUNCTION exists_opt function_name */
+{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); }
break;
- case 309: /* cmd ::= DROP FUNCTION exists_opt function_name */
-{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy587, &yymsp[0].minor.yy881); }
+ case 318: /* language_opt ::= */
+{ yymsp[1].minor.yy129 = nil_token; }
break;
- case 314: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
-{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy587, &yymsp[-8].minor.yy881, yymsp[-5].minor.yy140, yymsp[-7].minor.yy140, yymsp[-3].minor.yy220, yymsp[-2].minor.yy140, yymsp[0].minor.yy140, yymsp[-4].minor.yy220); }
+ case 319: /* language_opt ::= LANGUAGE NK_STRING */
+{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy0; }
break;
- case 315: /* cmd ::= DROP STREAM exists_opt stream_name */
-{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy587, &yymsp[0].minor.yy881); }
+ case 322: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
+{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy337, &yymsp[-8].minor.yy129, yymsp[-5].minor.yy712, yymsp[-7].minor.yy712, yymsp[-3].minor.yy274, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, yymsp[-4].minor.yy274); }
break;
- case 322: /* stream_options ::= stream_options TRIGGER AT_ONCE */
- case 323: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==323);
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-2].minor.yy140, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 323: /* cmd ::= DROP STREAM exists_opt stream_name */
+{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); }
break;
- case 324: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-3].minor.yy140, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 330: /* stream_options ::= stream_options TRIGGER AT_ONCE */
+ case 331: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==331);
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-2].minor.yy712, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 325: /* stream_options ::= stream_options WATERMARK duration_literal */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-2].minor.yy140, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 332: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-3].minor.yy712, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 326: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-3].minor.yy140, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 333: /* stream_options ::= stream_options WATERMARK duration_literal */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-2].minor.yy712, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 327: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-2].minor.yy140, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 334: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-3].minor.yy712, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 328: /* stream_options ::= stream_options DELETE_MARK duration_literal */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-2].minor.yy140, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 335: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-2].minor.yy712, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 329: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
-{ yylhsminor.yy140 = setStreamOptions(pCxt, yymsp[-3].minor.yy140, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 336: /* stream_options ::= stream_options DELETE_MARK duration_literal */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-2].minor.yy712, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 331: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
- case 520: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==520);
- case 540: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==540);
-{ yymsp[-3].minor.yy140 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy140); }
+ case 337: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+{ yylhsminor.yy712 = setStreamOptions(pCxt, yymsp[-3].minor.yy712, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 332: /* cmd ::= KILL CONNECTION NK_INTEGER */
+ case 339: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
+ case 529: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==529);
+ case 549: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==549);
+{ yymsp[-3].minor.yy712 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy712); }
+ break;
+ case 340: /* cmd ::= KILL CONNECTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
break;
- case 333: /* cmd ::= KILL QUERY NK_STRING */
+ case 341: /* cmd ::= KILL QUERY NK_STRING */
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 334: /* cmd ::= KILL TRANSACTION NK_INTEGER */
+ case 342: /* cmd ::= KILL TRANSACTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
break;
- case 335: /* cmd ::= BALANCE VGROUP */
+ case 343: /* cmd ::= BALANCE VGROUP */
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
break;
- case 336: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+ case 344: /* cmd ::= BALANCE VGROUP LEADER */
+{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); }
+ break;
+ case 345: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 337: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy220); }
+ case 346: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy274); }
break;
- case 338: /* cmd ::= SPLIT VGROUP NK_INTEGER */
+ case 347: /* cmd ::= SPLIT VGROUP NK_INTEGER */
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 339: /* dnode_list ::= DNODE NK_INTEGER */
-{ yymsp[-1].minor.yy220 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- break;
- case 341: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
-{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
- break;
- case 344: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
-{ yymsp[-6].minor.yy140 = createInsertStmt(pCxt, yymsp[-4].minor.yy140, yymsp[-2].minor.yy220, yymsp[0].minor.yy140); }
- break;
- case 345: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
-{ yymsp[-3].minor.yy140 = createInsertStmt(pCxt, yymsp[-1].minor.yy140, NULL, yymsp[0].minor.yy140); }
- break;
- case 346: /* literal ::= NK_INTEGER */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 347: /* literal ::= NK_FLOAT */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 348: /* literal ::= NK_STRING */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 349: /* literal ::= NK_BOOL */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 350: /* literal ::= TIMESTAMP NK_STRING */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
- break;
- case 351: /* literal ::= duration_literal */
- case 361: /* signed_literal ::= signed */ yytestcase(yyruleno==361);
- case 382: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==382);
- case 383: /* expression ::= literal */ yytestcase(yyruleno==383);
- case 384: /* expression ::= pseudo_column */ yytestcase(yyruleno==384);
- case 385: /* expression ::= column_reference */ yytestcase(yyruleno==385);
- case 386: /* expression ::= function_expression */ yytestcase(yyruleno==386);
- case 387: /* expression ::= case_when_expression */ yytestcase(yyruleno==387);
- case 418: /* function_expression ::= literal_func */ yytestcase(yyruleno==418);
- case 467: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==467);
- case 471: /* boolean_primary ::= predicate */ yytestcase(yyruleno==471);
- case 473: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==473);
- case 474: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==474);
- case 477: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==477);
- case 479: /* table_reference ::= table_primary */ yytestcase(yyruleno==479);
- case 480: /* table_reference ::= joined_table */ yytestcase(yyruleno==480);
- case 484: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==484);
- case 542: /* query_simple ::= query_specification */ yytestcase(yyruleno==542);
- case 543: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==543);
- case 546: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==546);
- case 548: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==548);
-{ yylhsminor.yy140 = yymsp[0].minor.yy140; }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 352: /* literal ::= NULL */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 353: /* literal ::= NK_QUESTION */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 354: /* duration_literal ::= NK_VARIABLE */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 355: /* signed ::= NK_INTEGER */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 356: /* signed ::= NK_PLUS NK_INTEGER */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
- break;
- case 357: /* signed ::= NK_MINUS NK_INTEGER */
+ case 348: /* dnode_list ::= DNODE NK_INTEGER */
+{ yymsp[-1].minor.yy274 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ break;
+ case 350: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
+{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
+ break;
+ case 353: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+{ yymsp[-6].minor.yy712 = createInsertStmt(pCxt, yymsp[-4].minor.yy712, yymsp[-2].minor.yy274, yymsp[0].minor.yy712); }
+ break;
+ case 354: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
+{ yymsp[-3].minor.yy712 = createInsertStmt(pCxt, yymsp[-1].minor.yy712, NULL, yymsp[0].minor.yy712); }
+ break;
+ case 355: /* literal ::= NK_INTEGER */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 356: /* literal ::= NK_FLOAT */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 357: /* literal ::= NK_STRING */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 358: /* literal ::= NK_BOOL */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 359: /* literal ::= TIMESTAMP NK_STRING */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 360: /* literal ::= duration_literal */
+ case 370: /* signed_literal ::= signed */ yytestcase(yyruleno==370);
+ case 391: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==391);
+ case 392: /* expression ::= literal */ yytestcase(yyruleno==392);
+ case 393: /* expression ::= pseudo_column */ yytestcase(yyruleno==393);
+ case 394: /* expression ::= column_reference */ yytestcase(yyruleno==394);
+ case 395: /* expression ::= function_expression */ yytestcase(yyruleno==395);
+ case 396: /* expression ::= case_when_expression */ yytestcase(yyruleno==396);
+ case 427: /* function_expression ::= literal_func */ yytestcase(yyruleno==427);
+ case 476: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==476);
+ case 480: /* boolean_primary ::= predicate */ yytestcase(yyruleno==480);
+ case 482: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==482);
+ case 483: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==483);
+ case 486: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==486);
+ case 488: /* table_reference ::= table_primary */ yytestcase(yyruleno==488);
+ case 489: /* table_reference ::= joined_table */ yytestcase(yyruleno==489);
+ case 493: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==493);
+ case 551: /* query_simple ::= query_specification */ yytestcase(yyruleno==551);
+ case 552: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==552);
+ case 555: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==555);
+ case 557: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==557);
+{ yylhsminor.yy712 = yymsp[0].minor.yy712; }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 361: /* literal ::= NULL */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 362: /* literal ::= NK_QUESTION */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 363: /* duration_literal ::= NK_VARIABLE */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 364: /* signed ::= NK_INTEGER */
+{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 365: /* signed ::= NK_PLUS NK_INTEGER */
+{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+ break;
+ case 366: /* 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.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
+ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 358: /* signed ::= NK_FLOAT */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 367: /* signed ::= NK_FLOAT */
+{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 359: /* signed ::= NK_PLUS NK_FLOAT */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ case 368: /* signed ::= NK_PLUS NK_FLOAT */
+{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
break;
- case 360: /* signed ::= NK_MINUS NK_FLOAT */
+ case 369: /* 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.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
+ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
- break;
- case 362: /* signed_literal ::= NK_STRING */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 363: /* signed_literal ::= NK_BOOL */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 364: /* signed_literal ::= TIMESTAMP NK_STRING */
-{ yymsp[-1].minor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
- break;
- case 365: /* signed_literal ::= duration_literal */
- case 367: /* signed_literal ::= literal_func */ yytestcase(yyruleno==367);
- case 438: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==438);
- case 500: /* select_item ::= common_expression */ yytestcase(yyruleno==500);
- case 510: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==510);
- case 547: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==547);
- case 549: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==549);
- case 562: /* search_condition ::= common_expression */ yytestcase(yyruleno==562);
-{ yylhsminor.yy140 = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 366: /* signed_literal ::= NULL */
-{ yylhsminor.yy140 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 368: /* signed_literal ::= NK_QUESTION */
-{ yylhsminor.yy140 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 388: /* expression ::= NK_LP expression NK_RP */
- case 472: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==472);
- case 561: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==561);
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 389: /* expression ::= NK_PLUS expr_or_subquery */
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 371: /* signed_literal ::= NK_STRING */
+{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 372: /* signed_literal ::= NK_BOOL */
+{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 373: /* signed_literal ::= TIMESTAMP NK_STRING */
+{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 374: /* signed_literal ::= duration_literal */
+ case 376: /* signed_literal ::= literal_func */ yytestcase(yyruleno==376);
+ case 447: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==447);
+ case 509: /* select_item ::= common_expression */ yytestcase(yyruleno==509);
+ case 519: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==519);
+ case 556: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==556);
+ case 558: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==558);
+ case 571: /* search_condition ::= common_expression */ yytestcase(yyruleno==571);
+{ yylhsminor.yy712 = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 375: /* signed_literal ::= NULL */
+{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 377: /* signed_literal ::= NK_QUESTION */
+{ yylhsminor.yy712 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 397: /* expression ::= NK_LP expression NK_RP */
+ case 481: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==481);
+ case 570: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==570);
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 398: /* expression ::= NK_PLUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy140));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy712));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 390: /* expression ::= NK_MINUS expr_or_subquery */
+ case 399: /* expression ::= NK_MINUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy140), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy712), NULL));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 391: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
+ case 400: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 392: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
+ case 401: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 393: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
+ case 402: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 394: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
+ case 403: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 395: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
+ case 404: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 396: /* expression ::= column_reference NK_ARROW NK_STRING */
+ case 405: /* expression ::= column_reference NK_ARROW NK_STRING */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 397: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
+ case 406: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 398: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
+ case 407: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 401: /* column_reference ::= column_name */
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy881, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy881)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 402: /* column_reference ::= table_name NK_DOT column_name */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881, createColumnNode(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy881)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 403: /* pseudo_column ::= ROWTS */
- case 404: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==404);
- case 406: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==406);
- case 407: /* pseudo_column ::= QEND */ yytestcase(yyruleno==407);
- case 408: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==408);
- case 409: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==409);
- case 410: /* pseudo_column ::= WEND */ yytestcase(yyruleno==410);
- case 411: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==411);
- case 412: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==412);
- case 413: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==413);
- case 414: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==414);
- case 420: /* literal_func ::= NOW */ yytestcase(yyruleno==420);
-{ yylhsminor.yy140 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
- break;
- case 405: /* pseudo_column ::= table_name NK_DOT TBNAME */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy881)))); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 415: /* function_expression ::= function_name NK_LP expression_list NK_RP */
- case 416: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==416);
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy881, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy881, yymsp[-1].minor.yy220)); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
- break;
- case 417: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), yymsp[-1].minor.yy682)); }
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
- break;
- case 419: /* literal_func ::= noarg_func NK_LP NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy881, NULL)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 434: /* star_func_para_list ::= NK_STAR */
-{ yylhsminor.yy220 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
- break;
- case 439: /* star_func_para ::= table_name NK_DOT NK_STAR */
- case 503: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==503);
-{ yylhsminor.yy140 = createColumnNode(pCxt, &yymsp[-2].minor.yy881, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
- break;
- case 440: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy220, yymsp[-1].minor.yy140)); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
- break;
- case 441: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), yymsp[-2].minor.yy220, yymsp[-1].minor.yy140)); }
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
- break;
- case 444: /* when_then_expr ::= WHEN common_expression THEN common_expression */
-{ yymsp[-3].minor.yy140 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)); }
- break;
- case 446: /* case_when_else_opt ::= ELSE common_expression */
-{ yymsp[-1].minor.yy140 = releaseRawExprNode(pCxt, yymsp[0].minor.yy140); }
- break;
- case 447: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
- case 452: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==452);
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 410: /* column_reference ::= column_name */
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 411: /* column_reference ::= table_name NK_DOT column_name */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 412: /* pseudo_column ::= ROWTS */
+ case 413: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==413);
+ case 415: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==415);
+ case 416: /* pseudo_column ::= QEND */ yytestcase(yyruleno==416);
+ case 417: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==417);
+ case 418: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==418);
+ case 419: /* pseudo_column ::= WEND */ yytestcase(yyruleno==419);
+ case 420: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==420);
+ case 421: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==421);
+ case 422: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==422);
+ case 423: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==423);
+ case 429: /* literal_func ::= NOW */ yytestcase(yyruleno==429);
+{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 414: /* pseudo_column ::= table_name NK_DOT TBNAME */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy129)))); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 424: /* function_expression ::= function_name NK_LP expression_list NK_RP */
+ case 425: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==425);
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy274)); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 426: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy184)); }
+ yymsp[-5].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 428: /* literal_func ::= noarg_func NK_LP NK_RP */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy129, NULL)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 443: /* star_func_para_list ::= NK_STAR */
+{ yylhsminor.yy274 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
+ break;
+ case 448: /* star_func_para ::= table_name NK_DOT NK_STAR */
+ case 512: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==512);
+{ yylhsminor.yy712 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 449: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy274, yymsp[-1].minor.yy712)); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 450: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-2].minor.yy274, yymsp[-1].minor.yy712)); }
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
+ break;
+ case 453: /* when_then_expr ::= WHEN common_expression THEN common_expression */
+{ yymsp[-3].minor.yy712 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); }
+ break;
+ case 455: /* case_when_else_opt ::= ELSE common_expression */
+{ yymsp[-1].minor.yy712 = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); }
+ break;
+ case 456: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
+ case 461: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==461);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy794, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy440, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 448: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
+ case 457: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy140), releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy712), releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-4].minor.yy140 = yylhsminor.yy140;
+ yymsp[-4].minor.yy712 = yylhsminor.yy712;
break;
- case 449: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
+ case 458: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy140), releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ yymsp[-5].minor.yy712 = yylhsminor.yy712;
break;
- case 450: /* predicate ::= expr_or_subquery IS NULL */
+ case 459: /* predicate ::= expr_or_subquery IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), NULL));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 451: /* predicate ::= expr_or_subquery IS NOT NULL */
+ case 460: /* predicate ::= expr_or_subquery IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL));
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 453: /* compare_op ::= NK_LT */
-{ yymsp[0].minor.yy794 = OP_TYPE_LOWER_THAN; }
+ case 462: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_THAN; }
break;
- case 454: /* compare_op ::= NK_GT */
-{ yymsp[0].minor.yy794 = OP_TYPE_GREATER_THAN; }
+ case 463: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_THAN; }
break;
- case 455: /* compare_op ::= NK_LE */
-{ yymsp[0].minor.yy794 = OP_TYPE_LOWER_EQUAL; }
+ case 464: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_EQUAL; }
break;
- case 456: /* compare_op ::= NK_GE */
-{ yymsp[0].minor.yy794 = OP_TYPE_GREATER_EQUAL; }
+ case 465: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_EQUAL; }
break;
- case 457: /* compare_op ::= NK_NE */
-{ yymsp[0].minor.yy794 = OP_TYPE_NOT_EQUAL; }
+ case 466: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy440 = OP_TYPE_NOT_EQUAL; }
break;
- case 458: /* compare_op ::= NK_EQ */
-{ yymsp[0].minor.yy794 = OP_TYPE_EQUAL; }
+ case 467: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy440 = OP_TYPE_EQUAL; }
break;
- case 459: /* compare_op ::= LIKE */
-{ yymsp[0].minor.yy794 = OP_TYPE_LIKE; }
+ case 468: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy440 = OP_TYPE_LIKE; }
break;
- case 460: /* compare_op ::= NOT LIKE */
-{ yymsp[-1].minor.yy794 = OP_TYPE_NOT_LIKE; }
+ case 469: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_LIKE; }
break;
- case 461: /* compare_op ::= MATCH */
-{ yymsp[0].minor.yy794 = OP_TYPE_MATCH; }
+ case 470: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy440 = OP_TYPE_MATCH; }
break;
- case 462: /* compare_op ::= NMATCH */
-{ yymsp[0].minor.yy794 = OP_TYPE_NMATCH; }
+ case 471: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy440 = OP_TYPE_NMATCH; }
break;
- case 463: /* compare_op ::= CONTAINS */
-{ yymsp[0].minor.yy794 = OP_TYPE_JSON_CONTAINS; }
+ case 472: /* compare_op ::= CONTAINS */
+{ yymsp[0].minor.yy440 = OP_TYPE_JSON_CONTAINS; }
break;
- case 464: /* in_op ::= IN */
-{ yymsp[0].minor.yy794 = OP_TYPE_IN; }
+ case 473: /* in_op ::= IN */
+{ yymsp[0].minor.yy440 = OP_TYPE_IN; }
break;
- case 465: /* in_op ::= NOT IN */
-{ yymsp[-1].minor.yy794 = OP_TYPE_NOT_IN; }
+ case 474: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_IN; }
break;
- case 466: /* in_predicate_value ::= NK_LP literal_list NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy220)); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 475: /* in_predicate_value ::= NK_LP literal_list NK_RP */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy274)); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 468: /* boolean_value_expression ::= NOT boolean_primary */
+ case 477: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy140), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy712), NULL));
}
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 469: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ case 478: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 470: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ case 479: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy140);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy140);
- yylhsminor.yy140 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), releaseRawExprNode(pCxt, yymsp[0].minor.yy140)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712);
+ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712)));
}
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 476: /* from_clause_opt ::= FROM table_reference_list */
- case 505: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==505);
- case 536: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==536);
-{ yymsp[-1].minor.yy140 = yymsp[0].minor.yy140; }
+ case 485: /* from_clause_opt ::= FROM table_reference_list */
+ case 514: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==514);
+ case 545: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==545);
+{ yymsp[-1].minor.yy712 = yymsp[0].minor.yy712; }
break;
- case 478: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-{ yylhsminor.yy140 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy140, yymsp[0].minor.yy140, NULL); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 487: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy712 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, NULL); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 481: /* table_primary ::= table_name alias_opt */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy881, &yymsp[0].minor.yy881); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 490: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy712 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 482: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-{ yylhsminor.yy140 = createRealTableNode(pCxt, &yymsp[-3].minor.yy881, &yymsp[-1].minor.yy881, &yymsp[0].minor.yy881); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 491: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy712 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 483: /* table_primary ::= subquery alias_opt */
-{ yylhsminor.yy140 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140), &yymsp[0].minor.yy881); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 492: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy712 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712), &yymsp[0].minor.yy129); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 485: /* alias_opt ::= */
-{ yymsp[1].minor.yy881 = nil_token; }
+ case 494: /* alias_opt ::= */
+{ yymsp[1].minor.yy129 = nil_token; }
break;
- case 487: /* alias_opt ::= AS table_alias */
-{ yymsp[-1].minor.yy881 = yymsp[0].minor.yy881; }
+ case 496: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; }
break;
- case 488: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 489: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==489);
-{ yymsp[-2].minor.yy140 = yymsp[-1].minor.yy140; }
+ case 497: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 498: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==498);
+{ yymsp[-2].minor.yy712 = yymsp[-1].minor.yy712; }
break;
- case 490: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-{ yylhsminor.yy140 = createJoinTableNode(pCxt, yymsp[-4].minor.yy852, yymsp[-5].minor.yy140, yymsp[-2].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-5].minor.yy140 = yylhsminor.yy140;
+ case 499: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+{ yylhsminor.yy712 = createJoinTableNode(pCxt, yymsp[-4].minor.yy912, yymsp[-5].minor.yy712, yymsp[-2].minor.yy712, yymsp[0].minor.yy712); }
+ yymsp[-5].minor.yy712 = yylhsminor.yy712;
break;
- case 491: /* join_type ::= */
-{ yymsp[1].minor.yy852 = JOIN_TYPE_INNER; }
+ case 500: /* join_type ::= */
+{ yymsp[1].minor.yy912 = JOIN_TYPE_INNER; }
break;
- case 492: /* join_type ::= INNER */
-{ yymsp[0].minor.yy852 = JOIN_TYPE_INNER; }
+ case 501: /* join_type ::= INNER */
+{ yymsp[0].minor.yy912 = JOIN_TYPE_INNER; }
break;
- case 493: /* 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 502: /* 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.yy140 = createSelectStmt(pCxt, yymsp[-10].minor.yy587, yymsp[-9].minor.yy220, yymsp[-8].minor.yy140);
- yymsp[-11].minor.yy140 = addWhereClause(pCxt, yymsp[-11].minor.yy140, yymsp[-7].minor.yy140);
- yymsp[-11].minor.yy140 = addPartitionByClause(pCxt, yymsp[-11].minor.yy140, yymsp[-6].minor.yy220);
- yymsp[-11].minor.yy140 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy140, yymsp[-2].minor.yy140);
- yymsp[-11].minor.yy140 = addGroupByClause(pCxt, yymsp[-11].minor.yy140, yymsp[-1].minor.yy220);
- yymsp[-11].minor.yy140 = addHavingClause(pCxt, yymsp[-11].minor.yy140, yymsp[0].minor.yy140);
- yymsp[-11].minor.yy140 = addRangeClause(pCxt, yymsp[-11].minor.yy140, yymsp[-5].minor.yy140);
- yymsp[-11].minor.yy140 = addEveryClause(pCxt, yymsp[-11].minor.yy140, yymsp[-4].minor.yy140);
- yymsp[-11].minor.yy140 = addFillClause(pCxt, yymsp[-11].minor.yy140, yymsp[-3].minor.yy140);
+ yymsp[-11].minor.yy712 = createSelectStmt(pCxt, yymsp[-10].minor.yy337, yymsp[-9].minor.yy274, yymsp[-8].minor.yy712);
+ yymsp[-11].minor.yy712 = addWhereClause(pCxt, yymsp[-11].minor.yy712, yymsp[-7].minor.yy712);
+ yymsp[-11].minor.yy712 = addPartitionByClause(pCxt, yymsp[-11].minor.yy712, yymsp[-6].minor.yy274);
+ yymsp[-11].minor.yy712 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy712, yymsp[-2].minor.yy712);
+ yymsp[-11].minor.yy712 = addGroupByClause(pCxt, yymsp[-11].minor.yy712, yymsp[-1].minor.yy274);
+ yymsp[-11].minor.yy712 = addHavingClause(pCxt, yymsp[-11].minor.yy712, yymsp[0].minor.yy712);
+ yymsp[-11].minor.yy712 = addRangeClause(pCxt, yymsp[-11].minor.yy712, yymsp[-5].minor.yy712);
+ yymsp[-11].minor.yy712 = addEveryClause(pCxt, yymsp[-11].minor.yy712, yymsp[-4].minor.yy712);
+ yymsp[-11].minor.yy712 = addFillClause(pCxt, yymsp[-11].minor.yy712, yymsp[-3].minor.yy712);
}
break;
- case 496: /* set_quantifier_opt ::= ALL */
-{ yymsp[0].minor.yy587 = false; }
+ case 505: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy337 = false; }
break;
- case 499: /* select_item ::= NK_STAR */
-{ yylhsminor.yy140 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy140 = yylhsminor.yy140;
+ case 508: /* select_item ::= NK_STAR */
+{ yylhsminor.yy712 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy712 = yylhsminor.yy712;
break;
- case 501: /* select_item ::= common_expression column_alias */
- case 511: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==511);
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140), &yymsp[0].minor.yy881); }
- yymsp[-1].minor.yy140 = yylhsminor.yy140;
+ case 510: /* select_item ::= common_expression column_alias */
+ case 520: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==520);
+{ yylhsminor.yy712 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712), &yymsp[0].minor.yy129); }
+ yymsp[-1].minor.yy712 = yylhsminor.yy712;
break;
- case 502: /* select_item ::= common_expression AS column_alias */
- case 512: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==512);
-{ yylhsminor.yy140 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), &yymsp[0].minor.yy881); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 511: /* select_item ::= common_expression AS column_alias */
+ case 521: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==521);
+{ yylhsminor.yy712 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), &yymsp[0].minor.yy129); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 507: /* partition_by_clause_opt ::= PARTITION BY partition_list */
- case 532: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==532);
- case 551: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==551);
-{ yymsp[-2].minor.yy220 = yymsp[0].minor.yy220; }
+ case 516: /* partition_by_clause_opt ::= PARTITION BY partition_list */
+ case 541: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==541);
+ case 560: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==560);
+{ yymsp[-2].minor.yy274 = yymsp[0].minor.yy274; }
break;
- case 514: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
-{ yymsp[-5].minor.yy140 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
+ case 523: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+{ yymsp[-5].minor.yy712 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); }
break;
- case 515: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
-{ yymsp[-3].minor.yy140 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
+ case 524: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+{ yymsp[-3].minor.yy712 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); }
break;
- case 516: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-5].minor.yy140 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), NULL, yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 525: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy712 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
break;
- case 517: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-7].minor.yy140 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy140), releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), yymsp[-1].minor.yy140, yymsp[0].minor.yy140); }
+ case 526: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy712 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy712, yymsp[0].minor.yy712); }
break;
- case 518: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
-{ yymsp[-6].minor.yy140 = createEventWindowNode(pCxt, yymsp[-3].minor.yy140, yymsp[0].minor.yy140); }
+ case 527: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+{ yymsp[-6].minor.yy712 = createEventWindowNode(pCxt, yymsp[-3].minor.yy712, yymsp[0].minor.yy712); }
break;
- case 522: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-{ yymsp[-3].minor.yy140 = createFillNode(pCxt, yymsp[-1].minor.yy174, NULL); }
+ case 531: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy712 = createFillNode(pCxt, yymsp[-1].minor.yy94, NULL); }
break;
- case 523: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy140 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy220)); }
+ case 532: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy712 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy274)); }
break;
- case 524: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy140 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy220)); }
+ case 533: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy712 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy274)); }
break;
- case 525: /* fill_mode ::= NONE */
-{ yymsp[0].minor.yy174 = FILL_MODE_NONE; }
+ case 534: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy94 = FILL_MODE_NONE; }
break;
- case 526: /* fill_mode ::= PREV */
-{ yymsp[0].minor.yy174 = FILL_MODE_PREV; }
+ case 535: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy94 = FILL_MODE_PREV; }
break;
- case 527: /* fill_mode ::= NULL */
-{ yymsp[0].minor.yy174 = FILL_MODE_NULL; }
+ case 536: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy94 = FILL_MODE_NULL; }
break;
- case 528: /* fill_mode ::= NULL_F */
-{ yymsp[0].minor.yy174 = FILL_MODE_NULL_F; }
+ case 537: /* fill_mode ::= NULL_F */
+{ yymsp[0].minor.yy94 = FILL_MODE_NULL_F; }
break;
- case 529: /* fill_mode ::= LINEAR */
-{ yymsp[0].minor.yy174 = FILL_MODE_LINEAR; }
+ case 538: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy94 = FILL_MODE_LINEAR; }
break;
- case 530: /* fill_mode ::= NEXT */
-{ yymsp[0].minor.yy174 = FILL_MODE_NEXT; }
+ case 539: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy94 = FILL_MODE_NEXT; }
break;
- case 533: /* group_by_list ::= expr_or_subquery */
-{ yylhsminor.yy220 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140))); }
- yymsp[0].minor.yy220 = yylhsminor.yy220;
+ case 542: /* group_by_list ::= expr_or_subquery */
+{ yylhsminor.yy274 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); }
+ yymsp[0].minor.yy274 = yylhsminor.yy274;
break;
- case 534: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
-{ yylhsminor.yy220 = addNodeToList(pCxt, yymsp[-2].minor.yy220, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy140))); }
- yymsp[-2].minor.yy220 = yylhsminor.yy220;
+ case 543: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+{ yylhsminor.yy274 = addNodeToList(pCxt, yymsp[-2].minor.yy274, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); }
+ yymsp[-2].minor.yy274 = yylhsminor.yy274;
break;
- case 538: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
-{ yymsp[-5].minor.yy140 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy140), releaseRawExprNode(pCxt, yymsp[-1].minor.yy140)); }
+ case 547: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+{ yymsp[-5].minor.yy712 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); }
break;
- case 541: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ case 550: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy140 = addOrderByClause(pCxt, yymsp[-3].minor.yy140, yymsp[-2].minor.yy220);
- yylhsminor.yy140 = addSlimitClause(pCxt, yylhsminor.yy140, yymsp[-1].minor.yy140);
- yylhsminor.yy140 = addLimitClause(pCxt, yylhsminor.yy140, yymsp[0].minor.yy140);
+ yylhsminor.yy712 = addOrderByClause(pCxt, yymsp[-3].minor.yy712, yymsp[-2].minor.yy274);
+ yylhsminor.yy712 = addSlimitClause(pCxt, yylhsminor.yy712, yymsp[-1].minor.yy712);
+ yylhsminor.yy712 = addLimitClause(pCxt, yylhsminor.yy712, yymsp[0].minor.yy712);
}
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 544: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
-{ yylhsminor.yy140 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-3].minor.yy140 = yylhsminor.yy140;
+ case 553: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+{ yylhsminor.yy712 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy712, yymsp[0].minor.yy712); }
+ yymsp[-3].minor.yy712 = yylhsminor.yy712;
break;
- case 545: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
-{ yylhsminor.yy140 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy140, yymsp[0].minor.yy140); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 554: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+{ yylhsminor.yy712 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy712, yymsp[0].minor.yy712); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 553: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
- case 557: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==557);
-{ yymsp[-1].minor.yy140 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ case 562: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ case 566: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==566);
+{ yymsp[-1].minor.yy712 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 554: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 558: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==558);
-{ yymsp[-3].minor.yy140 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+ case 563: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 567: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==567);
+{ yymsp[-3].minor.yy712 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 555: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 559: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==559);
-{ yymsp[-3].minor.yy140 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+ case 564: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 568: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==568);
+{ yymsp[-3].minor.yy712 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 560: /* subquery ::= NK_LP query_expression NK_RP */
-{ yylhsminor.yy140 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy140); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 569: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy712); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 565: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
-{ yylhsminor.yy140 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy140), yymsp[-1].minor.yy866, yymsp[0].minor.yy697); }
- yymsp[-2].minor.yy140 = yylhsminor.yy140;
+ case 574: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy712 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), yymsp[-1].minor.yy88, yymsp[0].minor.yy907); }
+ yymsp[-2].minor.yy712 = yylhsminor.yy712;
break;
- case 566: /* ordering_specification_opt ::= */
-{ yymsp[1].minor.yy866 = ORDER_ASC; }
+ case 575: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy88 = ORDER_ASC; }
break;
- case 567: /* ordering_specification_opt ::= ASC */
-{ yymsp[0].minor.yy866 = ORDER_ASC; }
+ case 576: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy88 = ORDER_ASC; }
break;
- case 568: /* ordering_specification_opt ::= DESC */
-{ yymsp[0].minor.yy866 = ORDER_DESC; }
+ case 577: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy88 = ORDER_DESC; }
break;
- case 569: /* null_ordering_opt ::= */
-{ yymsp[1].minor.yy697 = NULL_ORDER_DEFAULT; }
+ case 578: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy907 = NULL_ORDER_DEFAULT; }
break;
- case 570: /* null_ordering_opt ::= NULLS FIRST */
-{ yymsp[-1].minor.yy697 = NULL_ORDER_FIRST; }
+ case 579: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy907 = NULL_ORDER_FIRST; }
break;
- case 571: /* null_ordering_opt ::= NULLS LAST */
-{ yymsp[-1].minor.yy697 = NULL_ORDER_LAST; }
+ case 580: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy907 = NULL_ORDER_LAST; }
break;
default:
break;
diff --git a/source/libs/parser/test/parAlterToBalanceTest.cpp b/source/libs/parser/test/parAlterToBalanceTest.cpp
index 4cccfd449c1b33410be910a44ab7f3071839f26f..db74e66d2bb06b1de08a187583ee9fadfe72e8b4 100644
--- a/source/libs/parser/test/parAlterToBalanceTest.cpp
+++ b/source/libs/parser/test/parAlterToBalanceTest.cpp
@@ -109,7 +109,8 @@ TEST_F(ParserInitialATest, alterDnode) {
* | WAL_LEVEL int_value -- enum 1, 2, default 1
* | STT_TRIGGER int_value -- rang [1, 16], default 8
* | MINROWS int_value -- rang [10, 1000], default 100
- * }
+ * | WAL_RETENTION_PERIOD int_value -- rang [-1, INT32_MAX], default 0
+ * | WAL_RETENTION_SIZE int_value -- rang [-1, INT32_MAX], default 0
*/
TEST_F(ParserInitialATest, alterDatabase) {
useDb("root", "test");
@@ -135,6 +136,8 @@ TEST_F(ParserInitialATest, alterDatabase) {
expect.replications = -1;
expect.sstTrigger = -1;
expect.minRows = -1;
+ expect.walRetentionPeriod = -2;
+ expect.walRetentionSize = -2;
};
auto setAlterDbBuffer = [&](int32_t buffer) { expect.buffer = buffer; };
auto setAlterDbPageSize = [&](int32_t pageSize) { expect.pageSize = pageSize; };
@@ -153,6 +156,10 @@ TEST_F(ParserInitialATest, alterDatabase) {
auto setAlterDbReplica = [&](int8_t replications) { expect.replications = replications; };
auto setAlterDbSttTrigger = [&](int8_t sstTrigger) { expect.sstTrigger = sstTrigger; };
auto setAlterDbMinRows = [&](int32_t minRows) { expect.minRows = minRows; };
+ auto setAlterDbWalRetentionPeriod = [&](int32_t walRetentionPeriod) {
+ expect.walRetentionPeriod = walRetentionPeriod;
+ };
+ auto setAlterDbWalRetentionSize = [&](int32_t walRetentionSize) { expect.walRetentionSize = walRetentionSize; };
setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) {
ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_ALTER_DATABASE_STMT);
@@ -174,6 +181,8 @@ TEST_F(ParserInitialATest, alterDatabase) {
ASSERT_EQ(req.replications, expect.replications);
ASSERT_EQ(req.sstTrigger, expect.sstTrigger);
ASSERT_EQ(req.minRows, expect.minRows);
+ ASSERT_EQ(req.walRetentionPeriod, expect.walRetentionPeriod);
+ ASSERT_EQ(req.walRetentionSize, expect.walRetentionSize);
});
const int32_t MINUTE_PER_DAY = MILLISECOND_PER_DAY / MILLISECOND_PER_MINUTE;
@@ -189,8 +198,10 @@ TEST_F(ParserInitialATest, alterDatabase) {
setAlterDbBuffer(16);
setAlterDbPages(128);
setAlterDbReplica(3);
+ setAlterDbWalRetentionPeriod(10);
+ setAlterDbWalRetentionSize(20);
run("ALTER DATABASE test BUFFER 16 CACHEMODEL 'last_row' CACHESIZE 32 WAL_FSYNC_PERIOD 200 KEEP 10 PAGES 128 "
- "REPLICA 3 WAL_LEVEL 1 STT_TRIGGER 16");
+ "REPLICA 3 WAL_LEVEL 1 STT_TRIGGER 16 WAL_RETENTION_PERIOD 10 WAL_RETENTION_SIZE 20");
clearAlterDbReq();
initAlterDb("test");
@@ -290,6 +301,20 @@ TEST_F(ParserInitialATest, alterDatabase) {
setAlterDbMinRows(1000);
run("ALTER DATABASE test MINROWS 1000");
clearAlterDbReq();
+
+ initAlterDb("test");
+ setAlterDbWalRetentionPeriod(-1);
+ run("ALTER DATABASE test WAL_RETENTION_PERIOD -1");
+ setAlterDbWalRetentionPeriod(50);
+ run("ALTER DATABASE test WAL_RETENTION_PERIOD 50");
+ clearAlterDbReq();
+
+ initAlterDb("test");
+ setAlterDbWalRetentionSize(-1);
+ run("ALTER DATABASE test WAL_RETENTION_SIZE -1");
+ setAlterDbWalRetentionSize(50);
+ run("ALTER DATABASE test WAL_RETENTION_SIZE 50");
+ clearAlterDbReq();
}
TEST_F(ParserInitialATest, alterDatabaseSemanticCheck) {
@@ -612,7 +637,9 @@ TEST_F(ParserInitialATest, alterTable) {
}
ASSERT_EQ(req.isNull, expect.isNull);
ASSERT_EQ(req.nTagVal, expect.nTagVal);
- ASSERT_EQ(memcmp(req.pTagVal, expect.pTagVal, expect.nTagVal), 0);
+ if (nullptr != req.pTagVal) {
+ ASSERT_EQ(memcmp(req.pTagVal, expect.pTagVal, expect.nTagVal), 0);
+ }
ASSERT_EQ(req.updateTTL, expect.updateTTL);
ASSERT_EQ(req.newTTL, expect.newTTL);
if (nullptr != expect.newComment) {
@@ -831,4 +858,21 @@ TEST_F(ParserInitialATest, balanceVgroup) {
run("BALANCE VGROUP");
}
+/*
+ * BALANCE VGROUP LEADER
+ */
+TEST_F(ParserInitialATest, balanceVgroupLeader) {
+ useDb("root", "test");
+
+ setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) {
+ ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_BALANCE_VGROUP_LEADER_STMT);
+ ASSERT_EQ(pQuery->pCmdMsg->msgType, TDMT_MND_BALANCE_VGROUP_LEADER);
+ SBalanceVgroupLeaderReq req = {0};
+ ASSERT_EQ(tDeserializeSBalanceVgroupLeaderReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req),
+ TSDB_CODE_SUCCESS);
+ });
+
+ run("BALANCE VGROUP LEADER");
+}
+
} // namespace ParserTest
\ No newline at end of file
diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp
index c36402e8e00f54df91747097bd23c8cc98d1f6fb..88e66997eb85ff6a65595b7749a38a69762e5239 100644
--- a/source/libs/parser/test/parInitialCTest.cpp
+++ b/source/libs/parser/test/parInitialCTest.cpp
@@ -13,6 +13,8 @@
* along with this program. If not, see .
*/
+#include
+
#include "parTestUtil.h"
using namespace std;
@@ -396,7 +398,8 @@ TEST_F(ParserInitialCTest, createDnode) {
}
/*
- * CREATE [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name AS library_path OUTPUTTYPE type_name [BUFSIZE value]
+ * CREATE [OR REPLACE] [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name
+ * AS library_path OUTPUTTYPE type_name [BUFSIZE value] [LANGUAGE value]
*/
TEST_F(ParserInitialCTest, createFunction) {
useDb("root", "test");
@@ -404,12 +407,14 @@ TEST_F(ParserInitialCTest, createFunction) {
SCreateFuncReq expect = {0};
auto setCreateFuncReq = [&](const char* pUdfName, int8_t outputType, int32_t outputBytes = 0,
- int8_t funcType = TSDB_FUNC_TYPE_SCALAR, int8_t igExists = 0, int32_t bufSize = 0) {
+ int8_t funcType = TSDB_FUNC_TYPE_SCALAR, int8_t igExists = 0, int32_t bufSize = 0,
+ int8_t language = TSDB_FUNC_SCRIPT_BIN_LIB, int8_t orReplace = 0) {
memset(&expect, 0, sizeof(SCreateFuncReq));
strcpy(expect.name, pUdfName);
+ expect.orReplace = orReplace;
expect.igExists = igExists;
expect.funcType = funcType;
- expect.scriptType = TSDB_FUNC_SCRIPT_BIN_LIB;
+ expect.scriptType = language;
expect.outputType = outputType;
expect.outputLen = outputBytes > 0 ? outputBytes : tDataTypes[outputType].bytes;
expect.bufSize = bufSize;
@@ -421,19 +426,32 @@ TEST_F(ParserInitialCTest, createFunction) {
ASSERT_TRUE(TSDB_CODE_SUCCESS == tDeserializeSCreateFuncReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req));
ASSERT_EQ(std::string(req.name), std::string(expect.name));
+ ASSERT_EQ(req.orReplace, expect.orReplace);
ASSERT_EQ(req.igExists, expect.igExists);
ASSERT_EQ(req.funcType, expect.funcType);
ASSERT_EQ(req.scriptType, expect.scriptType);
ASSERT_EQ(req.outputType, expect.outputType);
ASSERT_EQ(req.outputLen, expect.outputLen);
ASSERT_EQ(req.bufSize, expect.bufSize);
+
+ tFreeSCreateFuncReq(&req);
});
+ struct udfFile {
+ udfFile(const std::string& filename) : path_(filename) {
+ std::ofstream file(filename, std::ios::binary);
+ file << 123 << "abc" << '\n';
+ file.close();
+ }
+ ~udfFile() { remove(path_.c_str()); }
+ std::string path_;
+ } udffile("udf");
+
setCreateFuncReq("udf1", TSDB_DATA_TYPE_INT);
- // run("CREATE FUNCTION udf1 AS './build/lib/libudf1.so' OUTPUTTYPE INT");
+ run("CREATE FUNCTION udf1 AS 'udf' OUTPUTTYPE INT");
- setCreateFuncReq("udf2", TSDB_DATA_TYPE_DOUBLE, 0, TSDB_FUNC_TYPE_AGGREGATE, 1, 8);
- // run("CREATE AGGREGATE FUNCTION IF NOT EXISTS udf2 AS './build/lib/libudf2.so' OUTPUTTYPE DOUBLE BUFSIZE 8");
+ setCreateFuncReq("udf2", TSDB_DATA_TYPE_DOUBLE, 0, TSDB_FUNC_TYPE_AGGREGATE, 1, 8, TSDB_FUNC_SCRIPT_PYTHON, 1);
+ run("CREATE OR REPLACE AGGREGATE FUNCTION IF NOT EXISTS udf2 AS 'udf' OUTPUTTYPE DOUBLE BUFSIZE 8 LANGUAGE 'python'");
}
/*
diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c
index 1affbac613cdb2caeb0d8862506caee85f7697b6..24b25cec80ce58390b7a83d71a607bbaba18fe50 100644
--- a/source/libs/scalar/src/sclfunc.c
+++ b/source/libs/scalar/src/sclfunc.c
@@ -1067,9 +1067,15 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam *
}
struct tm tmInfo;
- taosLocalTime((const time_t *)&timeVal, &tmInfo);
+ int32_t len = 0;
+
+ if (taosLocalTime((const time_t *)&timeVal, &tmInfo, buf) == NULL) {
+ len = (int32_t)strlen(buf);
+ goto _end;
+ }
+
strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", &tmInfo);
- int32_t len = (int32_t)strlen(buf);
+ len = (int32_t)strlen(buf);
// add timezone string
if (tzLen > 0) {
@@ -1103,6 +1109,7 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam *
len += fracLen;
}
+_end:
memmove(buf + VARSTR_HEADER_SIZE, buf, len);
varDataSetLen(buf, len);
diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c
index 66d98e90bfaa7f81e5c985de205d245c9a3b0120..03391c0ba2b5dd52e4442c4f172c27e7c474c37a 100644
--- a/source/libs/stream/src/streamMeta.c
+++ b/source/libs/stream/src/streamMeta.c
@@ -18,6 +18,7 @@
#include "ttimer.h"
SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc, int32_t vgId) {
+ int32_t code = -1;
SStreamMeta* pMeta = taosMemoryCalloc(1, sizeof(SStreamMeta));
if (pMeta == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -33,7 +34,12 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
}
sprintf(streamPath, "%s/%s", pMeta->path, "checkpoints");
- taosMulModeMkDir(streamPath, 0755);
+ code = taosMulModeMkDir(streamPath, 0755);
+ if (code != 0) {
+ terrno = TAOS_SYSTEM_ERROR(code);
+ taosMemoryFree(streamPath);
+ goto _err;
+ }
taosMemoryFree(streamPath);
if (tdbTbOpen("task.db", sizeof(int32_t), -1, NULL, pMeta->db, &pMeta->pTaskDb, 0) < 0) {
diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c
index a617a5d293fce6ac377a613e47fe0f0e58d08b23..524daee7cf2e0ece65ba6ffac02ecaf9c9d2117f 100644
--- a/source/libs/sync/src/syncMain.c
+++ b/source/libs/sync/src/syncMain.c
@@ -37,6 +37,7 @@
#include "syncVoteMgr.h"
#include "tglobal.h"
#include "tref.h"
+#include "syncUtil.h"
static void syncNodeEqPingTimer(void* param, void* tmrId);
static void syncNodeEqElectTimer(void* param, void* tmrId);
@@ -209,6 +210,9 @@ int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg) {
case TDMT_SYNC_LOCAL_CMD:
code = syncNodeOnLocalCmd(pSyncNode, pMsg);
break;
+ case TDMT_SYNC_FORCE_FOLLOWER:
+ code = syncForceBecomeFollower(pSyncNode, pMsg);
+ break;
default:
terrno = TSDB_CODE_MSG_NOT_PROCESSED;
code = -1;
@@ -231,6 +235,20 @@ int32_t syncLeaderTransfer(int64_t rid) {
return ret;
}
+int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
+ syncNodeBecomeFollower(ths, "force election");
+
+ SRpcMsg rsp = {
+ .code = 0,
+ .pCont = pRpcMsg->info.rsp,
+ .contLen = pRpcMsg->info.rspLen,
+ .info = pRpcMsg->info,
+ };
+ tmsgSendRsp(&rsp);
+
+ return 0;
+}
+
int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) {
SSyncNode* pNode = syncNodeAcquire(rid);
if (pNode == NULL) return -1;
@@ -2290,6 +2308,14 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
int64_t timeDiff = tsMs - pMsg->timeStamp;
syncLogRecvHeartbeat(ths, pMsg, timeDiff, tbuf);
+ if (!syncNodeInRaftGroup(ths, &pMsg->srcId)) {
+ sWarn(
+ "vgId:%d, drop heartbeat msg from dnode:%d, because it come from another cluster:%d, differ from current "
+ "cluster:%d",
+ ths->vgId, DID(&(pMsg->srcId)), CID(&(pMsg->srcId)), CID(&(ths->myRaftId)));
+ return 0;
+ }
+
SRpcMsg rpcMsg = {0};
(void)syncBuildHeartbeatReply(&rpcMsg, ths->vgId);
SyncTerm currentTerm = raftStoreGetTerm(ths);
diff --git a/source/libs/sync/src/syncRequestVote.c b/source/libs/sync/src/syncRequestVote.c
index 40b747b7117398325c450a74f2a7156cc9e231ba..77e5498127ecea7bcead68d83876b5334f551567 100644
--- a/source/libs/sync/src/syncRequestVote.c
+++ b/source/libs/sync/src/syncRequestVote.c
@@ -20,6 +20,7 @@
#include "syncRaftStore.h"
#include "syncUtil.h"
#include "syncVoteMgr.h"
+#include "syncUtil.h"
// TLA+ Spec
// HandleRequestVoteRequest(i, j, m) ==
diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c
index 702d05f57696c55e88b94d2d335674bd8f262c49..54e6abd85a50a5367bcac9c1c42d910df15d6b06 100644
--- a/source/libs/wal/src/walMgmt.c
+++ b/source/libs/wal/src/walMgmt.c
@@ -179,17 +179,23 @@ _err:
int32_t walAlter(SWal *pWal, SWalCfg *pCfg) {
if (pWal == NULL) return TSDB_CODE_APP_ERROR;
- if (pWal->cfg.level == pCfg->level && pWal->cfg.fsyncPeriod == pCfg->fsyncPeriod) {
- wDebug("vgId:%d, old walLevel:%d fsync:%d, new walLevel:%d fsync:%d not change", pWal->cfg.vgId, pWal->cfg.level,
- pWal->cfg.fsyncPeriod, pCfg->level, pCfg->fsyncPeriod);
+ if (pWal->cfg.level == pCfg->level && pWal->cfg.fsyncPeriod == pCfg->fsyncPeriod &&
+ pWal->cfg.retentionPeriod == pCfg->retentionPeriod && pWal->cfg.retentionSize == pCfg->retentionSize) {
+ wDebug("vgId:%d, walLevel:%d fsync:%d walRetentionPeriod:%d walRetentionSize:%" PRId64 " not change",
+ pWal->cfg.vgId, pWal->cfg.level, pWal->cfg.fsyncPeriod, pWal->cfg.retentionPeriod, pWal->cfg.retentionSize);
return 0;
}
- wInfo("vgId:%d, change old walLevel:%d fsync:%d, new walLevel:%d fsync:%d", pWal->cfg.vgId, pWal->cfg.level,
- pWal->cfg.fsyncPeriod, pCfg->level, pCfg->fsyncPeriod);
+ wInfo("vgId:%d, change old walLevel:%d fsync:%d walRetentionPeriod:%d walRetentionSize:%" PRId64
+ ", new walLevel:%d fsync:%d walRetentionPeriod:%d walRetentionSize:%" PRId64,
+ pWal->cfg.vgId, pWal->cfg.level, pWal->cfg.fsyncPeriod, pWal->cfg.retentionPeriod, pWal->cfg.retentionSize,
+ pCfg->level, pCfg->fsyncPeriod, pCfg->retentionPeriod, pCfg->retentionSize);
pWal->cfg.level = pCfg->level;
pWal->cfg.fsyncPeriod = pCfg->fsyncPeriod;
+ pWal->cfg.retentionPeriod = pCfg->retentionPeriod;
+ pWal->cfg.retentionSize = pCfg->retentionSize;
+
pWal->fsyncSeq = pCfg->fsyncPeriod / 1000;
if (pWal->fsyncSeq <= 0) pWal->fsyncSeq = 1;
diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c
index 00ad7a3d67ea6118a0ed9d2fe8bd10b988bdd350..848de4f36da4db57e881df4977b4f2399314a68f 100644
--- a/source/libs/wal/src/walWrite.c
+++ b/source/libs/wal/src/walWrite.c
@@ -290,14 +290,22 @@ int32_t walEndSnapshot(SWal *pWal) {
int ts = taosGetTimestampSec();
ver = TMAX(ver - pWal->vers.logRetention, pWal->vers.firstVer - 1);
+
+ bool hasTopic = false;
+ int64_t refVer = ver;
void *pIter = NULL;
while (1) {
pIter = taosHashIterate(pWal->pRefHash, pIter);
if (pIter == NULL) break;
SWalRef *pRef = *(SWalRef **)pIter;
if (pRef->refVer == -1) continue;
- ver = TMIN(ver, pRef->refVer - 1);
+ refVer = TMIN(refVer, pRef->refVer - 1);
wDebug("vgId:%d, wal found ref %" PRId64 ", refId %" PRId64, pWal->cfg.vgId, pRef->refVer, pRef->refId);
+ hasTopic = true;
+ }
+ // compatible mode
+ if (pWal->cfg.retentionPeriod == 0 && hasTopic) {
+ ver = TMIN(ver, refVer);
}
int deleteCnt = 0;
@@ -327,7 +335,7 @@ int32_t walEndSnapshot(SWal *pWal) {
wDebug("vgId:%d, wal check remove file %" PRId64 "(file size %" PRId64 " close ts %" PRId64
"), new tot size %" PRId64,
pWal->cfg.vgId, iter->firstVer, iter->fileSize, iter->closeTs, newTotSize);
- if (((pWal->cfg.retentionSize == 0) || (pWal->cfg.retentionSize != -1 && newTotSize > pWal->cfg.retentionSize)) ||
+ if ((pWal->cfg.retentionSize != -1 && pWal->cfg.retentionSize != 0 && newTotSize > pWal->cfg.retentionSize) ||
((pWal->cfg.retentionPeriod == 0) || (pWal->cfg.retentionPeriod != -1 && iter->closeTs != -1 &&
iter->closeTs + pWal->cfg.retentionPeriod < ts))) {
// delete according to file size or close time
diff --git a/source/os/src/osMath.c b/source/os/src/osMath.c
index b466f89a1d127db23a1618f3455d876f25643f97..0cff0f78a618b5d82f05b55d45e2cc6303a186fd 100644
--- a/source/os/src/osMath.c
+++ b/source/os/src/osMath.c
@@ -18,20 +18,6 @@
#include
#include "talgo.h"
-#ifdef WINDOWS
-void swapStr(char* j, char* J, int width) {
- int i;
- char tmp;
- for (i = 0; i < width; i++) {
- tmp = *j;
- *j = *J;
- *J = tmp;
- j++;
- J++;
- }
-}
-#endif
-
int32_t qsortHelper(const void* p1, const void* p2, const void* param) {
__compar_fn_t comparFn = param;
return comparFn(p1, p2);
@@ -39,7 +25,7 @@ int32_t qsortHelper(const void* p1, const void* p2, const void* param) {
// todo refactor: 1) move away; 2) use merge sort instead; 3) qsort is not a stable sort actually.
void taosSort(void* base, int64_t sz, int64_t width, __compar_fn_t compar) {
-#ifdef _ALPINE
+#if defined(WINDOWS) || defined(_ALPINE)
void* param = compar;
taosqsort(base, sz, width, param, qsortHelper);
#else
diff --git a/source/os/src/osSleep.c b/source/os/src/osSleep.c
index a2373f952f6a22a7fd34a12b052502c04206598f..f6cc7d608d57b1343a95a5e68bd077b06d6fbfaa 100644
--- a/source/os/src/osSleep.c
+++ b/source/os/src/osSleep.c
@@ -22,6 +22,7 @@
#endif
void taosSsleep(int32_t s) {
+ if (s < 0) return;
#ifdef WINDOWS
Sleep(1000 * s);
#else
@@ -30,6 +31,7 @@ void taosSsleep(int32_t s) {
}
void taosMsleep(int32_t ms) {
+ if (ms < 0) return;
#ifdef WINDOWS
Sleep(ms);
#else
@@ -38,6 +40,7 @@ void taosMsleep(int32_t ms) {
}
void taosUsleep(int32_t us) {
+ if (us < 0) return;
#ifdef WINDOWS
HANDLE timer;
LARGE_INTEGER interval;
diff --git a/source/os/src/osString.c b/source/os/src/osString.c
index ae4a8a5cada3789c05e09a7b59455b9a38f54df7..0f459b58cd3a31118ac3c37a304449aad3834792 100644
--- a/source/os/src/osString.c
+++ b/source/os/src/osString.c
@@ -94,21 +94,21 @@ int32_t tasoUcs4Compare(TdUcs4 *f1_ucs4, TdUcs4 *f2_ucs4, int32_t bytes) {
return 0;
-#if 0
- int32_t ucs4_max_len = bytes + 4;
- char *f1_mbs = taosMemoryCalloc(bytes, 1);
- char *f2_mbs = taosMemoryCalloc(bytes, 1);
- if (taosUcs4ToMbs(f1_ucs4, ucs4_max_len, f1_mbs) < 0) {
- return -1;
- }
- if (taosUcs4ToMbs(f2_ucs4, ucs4_max_len, f2_mbs) < 0) {
- return -1;
- }
- int32_t ret = strcmp(f1_mbs, f2_mbs);
- taosMemoryFree(f1_mbs);
- taosMemoryFree(f2_mbs);
- return ret;
-#endif
+//#if 0
+// int32_t ucs4_max_len = bytes + 4;
+// char *f1_mbs = taosMemoryCalloc(bytes, 1);
+// char *f2_mbs = taosMemoryCalloc(bytes, 1);
+// if (taosUcs4ToMbs(f1_ucs4, ucs4_max_len, f1_mbs) < 0) {
+// return -1;
+// }
+// if (taosUcs4ToMbs(f2_ucs4, ucs4_max_len, f2_mbs) < 0) {
+// return -1;
+// }
+// int32_t ret = strcmp(f1_mbs, f2_mbs);
+// taosMemoryFree(f1_mbs);
+// taosMemoryFree(f2_mbs);
+// return ret;
+//#endif
}
TdUcs4 *tasoUcs4Copy(TdUcs4 *target_ucs4, TdUcs4 *source_ucs4, int32_t len_ucs4) {
diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c
index 52309a7b35cbdad87baf87ab10fae2bf42c1e335..84004ed3c18d1bb4baa218d450e7c825d25cd385 100644
--- a/source/os/src/osSysinfo.c
+++ b/source/os/src/osSysinfo.c
@@ -17,6 +17,10 @@
#include "os.h"
#include "taoserror.h"
+#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
+#include "cus_name.h"
+#endif
+
#define PROCESS_ITEM 12
#define UUIDLEN37 37
@@ -252,7 +256,11 @@ int32_t taosGetEmail(char *email, int32_t maxLen) {
#ifdef WINDOWS
// ASSERT(0);
#elif defined(_TD_DARWIN_64)
+#ifdef CUS_PROMPT
+ const char *filepath = "/usr/local/"CUS_PROMPT"/email";
+#else
const char *filepath = "/usr/local/taos/email";
+#endif // CUS_PROMPT
TdFilePtr pFile = taosOpenFile(filepath, TD_FILE_READ);
if (pFile == NULL) return false;
@@ -264,8 +272,12 @@ int32_t taosGetEmail(char *email, int32_t maxLen) {
taosCloseFile(&pFile);
return 0;
+#else
+#ifdef CUS_PROMPT
+ const char *filepath = "/usr/local/"CUS_PROMPT"/email";
#else
const char *filepath = "/usr/local/taos/email";
+#endif // CUS_PROMPT
TdFilePtr pFile = taosOpenFile(filepath, TD_FILE_READ);
if (pFile == NULL) return false;
diff --git a/source/os/src/osTime.c b/source/os/src/osTime.c
index 685693a709f4dd14efc3ffd5f277946a3293b38a..f120b6650a613dfb46003c85819c0551a3008de2 100644
--- a/source/os/src/osTime.c
+++ b/source/os/src/osTime.c
@@ -407,18 +407,34 @@ time_t taosMktime(struct tm *timep) {
#endif
}
-struct tm *taosLocalTime(const time_t *timep, struct tm *result) {
+struct tm *taosLocalTime(const time_t *timep, struct tm *result, char *buf) {
+ struct tm *res = NULL;
+
if (result == NULL) {
- return localtime(timep);
+ res = localtime(timep);
+ if (res == NULL && buf != NULL) {
+ sprintf(buf, "NaN");
+ }
+ return res;
}
#ifdef WINDOWS
if (*timep < 0) {
+ if (buf != NULL) {
+ sprintf(buf, "NaN");
+ }
+ return NULL;
+ // TODO: bugs in following code
SYSTEMTIME ss, s;
FILETIME ff, f;
LARGE_INTEGER offset;
struct tm tm1;
time_t tt = 0;
- localtime_s(&tm1, &tt);
+ if (localtime_s(&tm1, &tt) != 0 ) {
+ if (buf != NULL) {
+ sprintf(buf, "NaN");
+ }
+ return NULL;
+ }
ss.wYear = tm1.tm_year + 1900;
ss.wMonth = tm1.tm_mon + 1;
ss.wDay = tm1.tm_mday;
@@ -444,10 +460,18 @@ struct tm *taosLocalTime(const time_t *timep, struct tm *result) {
result->tm_yday = 0;
result->tm_isdst = 0;
} else {
- localtime_s(result, timep);
+ if (localtime_s(result, timep) != 0) {
+ if (buf != NULL) {
+ sprintf(buf, "NaN");
+ }
+ return NULL;
+ }
}
#else
- localtime_r(timep, result);
+ res = localtime_r(timep, result);
+ if (res == NULL && buf != NULL) {
+ sprintf(buf, "NaN");
+ }
#endif
return result;
}
@@ -469,12 +493,16 @@ struct tm *taosLocalTimeNolock(struct tm *result, const time_t *timep, int dst)
}
#ifdef WINDOWS
if (*timep < 0) {
+ return NULL;
+ // TODO: bugs in following code
SYSTEMTIME ss, s;
FILETIME ff, f;
LARGE_INTEGER offset;
struct tm tm1;
time_t tt = 0;
- localtime_s(&tm1, &tt);
+ if (localtime_s(&tm1, &tt) != 0) {
+ return NULL;
+ }
ss.wYear = tm1.tm_year + 1900;
ss.wMonth = tm1.tm_mon + 1;
ss.wDay = tm1.tm_mday;
@@ -500,7 +528,9 @@ struct tm *taosLocalTimeNolock(struct tm *result, const time_t *timep, int dst)
result->tm_yday = 0;
result->tm_isdst = 0;
} else {
- localtime_s(result, timep);
+ if (localtime_s(result, timep) != 0) {
+ return NULL;
+ }
}
#elif defined(LINUX)
time_t secsMin = 60, secsHour = 3600, secsDay = 3600 * 24;
diff --git a/source/os/src/osTimezone.c b/source/os/src/osTimezone.c
index ad223bff27de80a454d09215926dcdf44e95c23c..cd6ad7cdb5b45c35bae19093a2a97b0c0d8e9bdf 100644
--- a/source/os/src/osTimezone.c
+++ b/source/os/src/osTimezone.c
@@ -893,7 +893,7 @@ void taosGetSystemTimezone(char *outTimezoneStr, enum TdTimezone *tsTimezone) {
*/
time_t tx1 = taosGetTimestampSec();
struct tm tm1;
- taosLocalTime(&tx1, &tm1);
+ taosLocalTime(&tx1, &tm1, NULL);
daylight = tm1.tm_isdst;
/*
@@ -921,7 +921,7 @@ void taosGetSystemTimezone(char *outTimezoneStr, enum TdTimezone *tsTimezone) {
*/
time_t tx1 = taosGetTimestampSec();
struct tm tm1;
- taosLocalTime(&tx1, &tm1);
+ taosLocalTime(&tx1, &tm1, NULL);
/* load time zone string from /etc/timezone */
// FILE *f = fopen("/etc/timezone", "r");
errno = 0;
@@ -1008,7 +1008,7 @@ void taosGetSystemTimezone(char *outTimezoneStr, enum TdTimezone *tsTimezone) {
*/
time_t tx1 = taosGetTimestampSec();
struct tm tm1;
- taosLocalTime(&tx1, &tm1);
+ taosLocalTime(&tx1, &tm1, NULL);
/*
* format example:
diff --git a/source/os/test/CMakeLists.txt b/source/os/test/CMakeLists.txt
index 21fb2ee630d2d0058ca48f94a1f39c10ce7abe40..fba4d23e3fa5114fa0c4420761dbc0279f9934c4 100644
--- a/source/os/test/CMakeLists.txt
+++ b/source/os/test/CMakeLists.txt
@@ -17,8 +17,64 @@ INCLUDE_DIRECTORIES(${TD_SOURCE_DIR}/src/util/inc)
# osTests
add_executable(osTests "osTests.cpp")
-target_link_libraries(osTests os util gtest_main)
+target_link_libraries(osTests os util gtest_main)
add_test(
NAME osTests
COMMAND osTests
+)
+
+add_executable(osSystemTests "osSystemTests.cpp")
+target_link_libraries(osSystemTests os util gtest_main)
+add_test(
+ NAME osSystemTests
+ COMMAND osSystemTests
+)
+
+add_executable(osMathTests "osMathTests.cpp")
+target_link_libraries(osMathTests os util gtest_main)
+add_test(
+ NAME osMathTests
+ COMMAND osMathTests
+)
+
+add_executable(osSignalTests "osSignalTests.cpp")
+target_link_libraries(osSignalTests os util gtest_main)
+add_test(
+ NAME osSignalTests
+ COMMAND osSignalTests
+)
+
+add_executable(osSleepTests "osSleepTests.cpp")
+target_link_libraries(osSleepTests os util gtest_main)
+add_test(
+ NAME osSleepTests
+ COMMAND osSleepTests
+)
+
+add_executable(osStringTests "osStringTests.cpp")
+target_link_libraries(osStringTests os util gtest_main)
+add_test(
+ NAME osStringTests
+ COMMAND osStringTests
+)
+
+add_executable(osThreadTests "osThreadTests.cpp")
+target_link_libraries(osThreadTests os util gtest_main)
+add_test(
+ NAME osThreadTests
+ COMMAND osThreadTests
+)
+
+add_executable(osTimeTests "osTimeTests.cpp")
+target_link_libraries(osTimeTests os util gtest_main)
+add_test(
+ NAME osTimeTests
+ COMMAND osTimeTests
+)
+
+add_executable(osAtomicTests "osAtomicTests.cpp")
+target_link_libraries(osAtomicTests os util gtest_main)
+add_test(
+ NAME osAtomicTests
+ COMMAND osAtomicTests
)
\ No newline at end of file
diff --git a/source/os/test/osAtomicTests.cpp b/source/os/test/osAtomicTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..eebc1574c3b286a249cf051f8c0ad41acb32b39a
--- /dev/null
+++ b/source/os/test/osAtomicTests.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osAtomicTests, Exchange16) {
+ int16_t value = 123;
+ int16_t new_value = 456;
+ int16_t result = atomic_exchange_16(&value, new_value);
+ EXPECT_EQ(result, 123);
+ EXPECT_EQ(value, 456);
+}
+
+TEST(osAtomicTests, Exchange32) {
+ int32_t value = 123;
+ int32_t new_value = 456;
+ int32_t result = atomic_exchange_32(&value, new_value);
+ EXPECT_EQ(result, 123);
+ EXPECT_EQ(value, 456);
+}
+
+TEST(osAtomicTests, Exchange64) {
+ int64_t value = 123;
+ int64_t new_value = 456;
+ int64_t result = atomic_exchange_64(&value, new_value);
+ EXPECT_EQ(result, 123);
+ EXPECT_EQ(value, 456);
+}
+
+TEST(osAtomicTests, ExchangePtr) {
+ int value1 = 123;
+ int value2 = 456;
+ int* ptr = &value1;
+ int* result = (int*)atomic_exchange_ptr(&ptr, &value2);
+ EXPECT_EQ(result, &value1);
+ EXPECT_EQ(*ptr, 456);
+}
+
+TEST(osAtomicTests, ValCompareExchange8) {
+ int8_t value = 12;
+ int8_t oldval = 12;
+ int8_t newval = 45;
+ int8_t result = atomic_val_compare_exchange_8(&value, oldval, newval);
+ EXPECT_EQ(result, 12);
+ EXPECT_EQ(value, 45);
+
+ oldval = 78;
+ result = atomic_val_compare_exchange_8(&value, oldval, newval);
+ EXPECT_EQ(result, 45);
+ EXPECT_EQ(value, 45);
+}
+
+TEST(osAtomicTests, ValCompareExchange16) {
+ int16_t value = 123;
+ int16_t oldval = 123;
+ int16_t newval = 456;
+ int16_t result = atomic_val_compare_exchange_16(&value, oldval, newval);
+ EXPECT_EQ(result, 123);
+ EXPECT_EQ(value, 456);
+
+ oldval = 789;
+ result = atomic_val_compare_exchange_16(&value, oldval, newval);
+ EXPECT_EQ(result, 456);
+ EXPECT_EQ(value, 456);
+}
+
+TEST(osAtomicTests, TestAtomicExchange8) {
+ volatile int8_t value = 42;
+ int8_t new_value = 100;
+ int8_t old_value = atomic_exchange_8(&value, new_value);
+ EXPECT_EQ(old_value, 42);
+ EXPECT_EQ(value, new_value);
+}
+
+TEST(osAtomicTests, TestAtomicAddFetch16) {
+ volatile int16_t value = 42;
+ int16_t increment = 10;
+ int16_t new_value = atomic_add_fetch_16(&value, increment);
+ EXPECT_EQ(new_value, 52);
+ EXPECT_EQ(value, 52);
+}
+
+//TEST(osAtomicTests, AddFetchPtr) {
+// uintptr_t val = 0;
+// uintptr_t* ptr = &val;
+// uintptr_t ret = atomic_add_fetch_ptr(ptr, 10);
+// EXPECT_EQ(ret, 10);
+// EXPECT_EQ(val, 10);
+//}
diff --git a/source/os/test/osMathTests.cpp b/source/os/test/osMathTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..93c8d1f8da03cc359cd23d5feca712e8b5e6c1f3
--- /dev/null
+++ b/source/os/test/osMathTests.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+struct TestStruct {
+ int a;
+ float b;
+};
+
+// Define a custom comparison function for testing
+int cmpFunc(const void* a, const void* b) {
+ const TestStruct* pa = reinterpret_cast(a);
+ const TestStruct* pb = reinterpret_cast(b);
+ if (pa->a < pb->a) {
+ return -1;
+ } else if (pa->a > pb->a) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+TEST(osMathTests, taosSort) {
+ // Create an array of test data
+ TestStruct arr[] = {{4, 2.5}, {2, 1.5}, {1, 3.5}, {3, 4.5}};
+
+ // Sort the array using taosSort
+ taosSort(arr, 4, sizeof(TestStruct), cmpFunc);
+
+ // Check that the array is sorted correctly
+ EXPECT_EQ(arr[0].a, 1);
+ EXPECT_EQ(arr[1].a, 2);
+ EXPECT_EQ(arr[2].a, 3);
+ EXPECT_EQ(arr[3].a, 4);
+}
\ No newline at end of file
diff --git a/source/os/test/osSignalTests.cpp b/source/os/test/osSignalTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4cc6e9e588fe02aeeaae3f128635e341d024d2d
--- /dev/null
+++ b/source/os/test/osSignalTests.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osSignalTests, taosSetSignal) {
+ // Set up SIGINT handler using taosSetSignal
+ //taosSetSignal(SIGINT, sigint_handler);
+
+ // Print PID for testing purposes
+ // printf("PID: %d\n", getpid());
+
+ // Wait for signal to be received
+}
diff --git a/source/os/test/osSleepTests.cpp b/source/os/test/osSleepTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5faa837a0ada8d5e0b8485d642c34a08dc1bcec2
--- /dev/null
+++ b/source/os/test/osSleepTests.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osSleepTests, taosUsleep) {
+ const int sleep_time1 = 1000; // sleep for 1000 microseconds
+ taosUsleep(sleep_time1);
+
+ const int sleep_time2 = 0; // sleep for 0 microseconds
+ taosUsleep(sleep_time2);
+
+ const int sleep_time3 = -1; // sleep for negative time
+ taosUsleep(sleep_time3);
+}
+
+TEST(osSleepTests, taosSsleep) {
+ const int sleep_time1 = 1;
+ taosSsleep(sleep_time1);
+
+ const int sleep_time2 = 0;
+ taosSsleep(sleep_time2);
+
+ const int sleep_time3 = -1;
+ taosSsleep(sleep_time3);
+}
+
+TEST(osSleepTests, taosMsleep) {
+ const int sleep_time1 = 1000;
+ taosMsleep(sleep_time1);
+
+ const int sleep_time2 = 0;
+ taosMsleep(sleep_time2);
+
+ const int sleep_time3 = -1; // sleep for negative time
+ taosMsleep(sleep_time3);
+}
diff --git a/source/os/test/osStringTests.cpp b/source/os/test/osStringTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5e07636b1f81b9db0fb454e501441ae4e5959714
--- /dev/null
+++ b/source/os/test/osStringTests.cpp
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+#ifdef WINDOWS
+TEST(osStringTests, strsepNormalInput) {
+ char str[] = "This is a test string.";
+ char * ptr = str;
+ char * tok = NULL;
+ const char delim[] = " ";
+
+ while ((tok = strsep(&ptr, delim)) != NULL) {
+ printf("%s\n", tok);
+ }
+ EXPECT_STREQ(tok, nullptr);
+ EXPECT_EQ(ptr, nullptr);
+}
+
+TEST(osStringTests, strsepEmptyInput) {
+ char* str = "";
+ char* ptr = str;
+ char* tok = NULL;
+ const char delim[] = " ";
+
+ while ((tok = strsep(&ptr, delim)) != NULL) {
+ printf("%s\n", tok);
+ }
+
+ EXPECT_STREQ(tok, nullptr);
+ EXPECT_EQ(ptr, nullptr);
+}
+
+TEST(osStringTests, strsepNullInput) {
+ char * str = NULL;
+ char * ptr = str;
+ char * tok = NULL;
+ const char delim[] = " ";
+
+ while ((tok = strsep(&ptr, delim)) != NULL) {
+ printf("%s\n", tok);
+ }
+
+ EXPECT_STREQ(tok, nullptr);
+ EXPECT_EQ(ptr, nullptr);
+}
+
+TEST(osStringTests, strndupNormalInput) {
+ const char s[] = "This is a test string.";
+ int size = strlen(s) + 1;
+ char * s2 = strndup(s, size);
+
+ EXPECT_STREQ(s, s2);
+
+ free(s2);
+}
+#endif
+
+TEST(osStringTests, osUcs4Tests1) {
+ TdUcs4 f1_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0000};
+ TdUcs4 f2_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0000};
+
+ EXPECT_EQ(tasoUcs4Compare(f1_ucs4, f2_ucs4, sizeof(f1_ucs4)), 0);
+
+ TdUcs4 f3_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0020, 0x0077,
+ 0x006F, 0x0072, 0x006C, 0x0064, 0x0021, 0x0000};
+ TdUcs4 f4_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0000};
+
+ EXPECT_GT(tasoUcs4Compare(f3_ucs4, f4_ucs4, sizeof(f3_ucs4)), 0);
+
+ TdUcs4 f5_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0000};
+ TdUcs4 f6_ucs4[] = {0x0048, 0x0065, 0x006C, 0x006C, 0x006F, 0x0020, 0x0077,
+ 0x006F, 0x0072, 0x006C, 0x0064, 0x0021, 0x0000};
+
+ EXPECT_LT(tasoUcs4Compare(f5_ucs4, f6_ucs4, sizeof(f5_ucs4)), 0);
+}
+
+TEST(osStringTests, osUcs4lenTests2) {
+ TdUcs4 ucs4_1[] = {'H', 'e', 'l', 'l', 'o', '\0'};
+ EXPECT_EQ(taosUcs4len(ucs4_1), 5);
+
+ TdUcs4 ucs4_2[] = {'\0'};
+ EXPECT_EQ(taosUcs4len(ucs4_2), 0);
+
+ TdUcs4 ucs4_3[] = {'C', 'h', 'i', 'n', 'a', 0x4E2D, 0x6587, '\0'};
+ EXPECT_EQ(taosUcs4len(ucs4_3), 7);
+}
diff --git a/source/os/test/osSystemTests.cpp b/source/os/test/osSystemTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dfc92a1b72b8b743a23a3cba1b6e18c66b5b982f
--- /dev/null
+++ b/source/os/test/osSystemTests.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osSystemTest, osSystem1) {
+ char tmp[4096] = "test";
+#ifdef _TD_DARWIN_64
+ taosLogTraceToBuf(tmp, sizeof(tmp), 4);
+#elif !defined(WINDOWS)
+ taosLogTraceToBuf(tmp, sizeof(tmp), 3);
+#else
+ taosLogTraceToBuf(tmp, sizeof(tmp), 8);
+#endif
+}
diff --git a/source/os/test/osThreadTests.cpp b/source/os/test/osThreadTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e7fc4f135609b95cb5e13d49f1c5d4a50b8fec6c
--- /dev/null
+++ b/source/os/test/osThreadTests.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osThreadTests, osThreadTests1) {
+
+}
diff --git a/source/os/test/osTimeTests.cpp b/source/os/test/osTimeTests.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..366c3fc720f7c1543d1d11bdd69f1d2ae085eb38
--- /dev/null
+++ b/source/os/test/osTimeTests.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+
+#include "os.h"
+#include "tlog.h"
+
+TEST(osTimeTests, taosLocalTimeNolock) {
+ time_t currentTime;
+ // Test when result is NULL
+ struct tm* result = taosLocalTimeNolock(NULL, ¤tTime, 0);
+ // Test when result is not NULL
+ struct tm expectedTime;
+ result = taosLocalTimeNolock(&expectedTime, ¤tTime, 1);
+ EXPECT_EQ(expectedTime.tm_year, result->tm_year);
+ EXPECT_EQ(expectedTime.tm_mon, result->tm_mon);
+ EXPECT_EQ(expectedTime.tm_mday, result->tm_mday);
+ EXPECT_EQ(expectedTime.tm_hour, result->tm_hour);
+ EXPECT_EQ(expectedTime.tm_min, result->tm_min);
+ EXPECT_EQ(expectedTime.tm_sec, result->tm_sec);
+ EXPECT_EQ(expectedTime.tm_wday, result->tm_wday);
+ EXPECT_EQ(expectedTime.tm_yday, result->tm_yday);
+ EXPECT_EQ(expectedTime.tm_isdst, result->tm_isdst);
+}
diff --git a/source/util/src/terror.c b/source/util/src/terror.c
index b84d58bfe8b7a625fc566ef536d03862f03c0566..2ea43e2cdea0c3f38659082b73d171c924112f0b 100644
--- a/source/util/src/terror.c
+++ b/source/util/src/terror.c
@@ -224,6 +224,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB, "Invalid database name
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_DATABASES, "Too many databases for account")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_DROPPING, "Database in dropping status")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_NOT_EXIST, "Database not exist")
+TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO, "WAL retention period is zero")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_ACCT, "Invalid database account")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_OPTION_UNCHANGED, "Database options not changed")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_INDEX_NOT_EXIST, "Index not exist")
@@ -585,6 +586,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_UDF_INVALID_INPUT, "udf invalid functio
TAOS_DEFINE_ERROR(TSDB_CODE_UDF_NO_FUNC_HANDLE, "udf no function handle")
TAOS_DEFINE_ERROR(TSDB_CODE_UDF_INVALID_BUFSIZE, "udf invalid bufsize")
TAOS_DEFINE_ERROR(TSDB_CODE_UDF_INVALID_OUTPUT_TYPE, "udf invalid output type")
+TAOS_DEFINE_ERROR(TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED, "udf program language not supported")
+TAOS_DEFINE_ERROR(TSDB_CODE_UDF_FUNC_EXEC_FAILURE, "udf function execution failure")
//schemaless
TAOS_DEFINE_ERROR(TSDB_CODE_SML_INVALID_PROTOCOL_TYPE, "Invalid line protocol type")
diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c
index bd9ea058b4f911d5060c85b9303afb3d2cc5dbdb..a3d3c399abcd6040cf042dec045024549e2d3179 100644
--- a/source/util/src/tlog.c
+++ b/source/util/src/tlog.c
@@ -121,7 +121,7 @@ static FORCE_INLINE void taosUpdateDaylight() {
struct timeval timeSecs;
taosGetTimeOfDay(&timeSecs);
time_t curTime = timeSecs.tv_sec;
- ptm = taosLocalTime(&curTime, &Tm);
+ ptm = taosLocalTime(&curTime, &Tm, NULL);
tsDaylightActive = ptm->tm_isdst;
}
static FORCE_INLINE int32_t taosGetDaylight() { return tsDaylightActive; }
@@ -437,7 +437,7 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) {
taosGetTimeOfDay(&timeSecs);
time_t curTime = timeSecs.tv_sec;
- ptm = taosLocalTime(&curTime, &Tm);
+ ptm = taosLocalTime(&curTime, &Tm, NULL);
return sprintf(buffer, "%02d/%02d %02d:%02d:%02d.%06d %08" PRId64 " %s", ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour,
ptm->tm_min, ptm->tm_sec, (int32_t)timeSecs.tv_usec, taosGetSelfPthreadId(), flags);
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py
index 9da678bf818d6e6140e1e821e1a49410ae563eb7..c4426010e439fcb24774c0322e0e928f0c83a572 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py
@@ -31,6 +31,8 @@ class TDTestCase:
tdSql.init(conn.cursor())
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
index ba296584ba6e81e2f8db6860240c6535cfc62cbf..b353566b256c796f7c60af8a161fc767099391a4 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
@@ -33,6 +33,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py b/tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
index 0fb39c210c96d9a5db7b2f4216fe023499002f01..d1a807c201217cd04a9ec348411daa2fab7266f6 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py
index 7599c82483509807d222d73557d3164c35159403..b06b0890ff2b5f671f4d347d1f5f77d305e2f367 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py
@@ -29,25 +29,23 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
- if "community" in selfPath:
- projPath = selfPath[: selfPath.find("community")]
- elif "src" in selfPath:
- projPath = selfPath[: selfPath.find("src")]
- elif "/tools/" in selfPath:
- projPath = selfPath[: selfPath.find("/tools/")]
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
else:
- projPath = selfPath[: selfPath.find("tests")]
+ projPath = selfPath[:selfPath.find("tests")]
paths = []
for root, dirs, files in os.walk(projPath):
- if (tool) in files:
+ if ((tool) in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
- if "packaging" not in rootRealPath:
+ if ("packaging" not in rootRealPath):
paths.append(os.path.join(root, tool))
break
- if len(paths) == 0:
+ if (len(paths) == 0):
tdLog.exit("taosBenchmark not found!")
return
else:
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/demo.py b/tests/develop-test/5-taos-tools/taosbenchmark/demo.py
index 25a8d92f7e9b45e55011d5fe0bb241bb68962340..3f9c2160de24bfc7dde983178bbcef31c1e0c45f 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/demo.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/demo.py
@@ -33,6 +33,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if "community" in selfPath:
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
index 54657995e2b0abcfa80b1b08be0b40b9bf415126..cf76e362e5b8174fccff02615efc8778496e70df 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py
index d706eea068221602e057baa236b1dd671ddd1674..1a7f422123f826bbc4f22426de8c89732215a69e 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py b/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
index afefabef66ef8b242a98874d5c15442e173f2df9..ea1bc165202c53fa7a714a1b249dfd15a786310f 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
index d95e6741f8af4ee837fe903dbc60fee894bebd7f..a1a77ba0bbf0e2fccfca222b20b30a619627e1bc 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
index c906f6167526c707f1a065b32dfd65fe5bdc7eac..f300e6520341e5c36ff216f1378f106a9699fce1 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
@@ -35,6 +35,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
index fd79f1e01b4ad28f8dfb75a13d114113ab1604ea..5d4dd794887efd55b5c81b2f6f89a7403c3390ea 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
index 200a3c0e69bc5b2e6c3b3dd6926885c5ca8d6f8f..3e40dd6a5e69548d20178d12aa7bd0a73ef6f1c2 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
index 0d10741331578f678198ad8dac597fe56a6c0709..ff82713ca3d4edf417c45d99f96393fe2cf64de5 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
@@ -29,28 +29,23 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
- if "community" in selfPath:
- projPath = selfPath[: selfPath.find("community")]
- elif "src" in selfPath:
- projPath = selfPath[: selfPath.find("src")]
- elif "/tools/" in selfPath:
- projPath = selfPath[: selfPath.find("/tools/")]
- elif "/tests/" in selfPath:
- projPath = selfPath[: selfPath.find("/tests/")]
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
else:
- tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
- projPath = "/usr/local/taos/bin/"
+ projPath = selfPath[:selfPath.find("tests")]
paths = []
- for root, dummy, files in os.walk(projPath):
- if (tool) in files:
+ for root, dirs, files in os.walk(projPath):
+ if ((tool) in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
- if "packaging" not in rootRealPath:
+ if ("packaging" not in rootRealPath):
paths.append(os.path.join(root, tool))
break
- if len(paths) == 0:
+ if (len(paths) == 0):
tdLog.exit("taosBenchmark not found!")
return
else:
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py b/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
index 241c6d63593d9cc5f203e88d7515d1085e446122..e8fa4f81fe234c6415eed425d4a91d90614cb635 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
@@ -30,6 +30,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
index 4d0adde1922bb62c8987133f14d0b7647c12b504..488bb6f81e7f48a7ce5924be1b0d948eddfd7da8 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
@@ -31,6 +31,8 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py b/tests/develop-test/5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py
index 19500c7dca946f3c0a1887eaa3d4bdcfa35390ef..91ebf1b1df1f5d60068a354f5c4fc10deff70b99 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py
@@ -32,30 +32,28 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
- if "community" in selfPath:
- projPath = selfPath[: selfPath.find("community")]
- elif "src" in selfPath:
- projPath = selfPath[: selfPath.find("src")]
- elif "/tools/" in selfPath:
- projPath = selfPath[: selfPath.find("/tools/")]
- elif "/tests/" in selfPath:
- projPath = selfPath[: selfPath.find("/tests/")]
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
else:
- tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
- projPath = "/usr/local/taos/bin/"
+ projPath = selfPath[:selfPath.find("tests")]
paths = []
for root, dirs, files in os.walk(projPath):
- if (tool) in files:
+ if ((tool) in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
- if "packaging" not in rootRealPath:
+ if ("packaging" not in rootRealPath):
paths.append(os.path.join(root, tool))
break
- if len(paths) == 0:
- return ""
- return paths[0]
+ if (len(paths) == 0):
+ tdLog.exit("taosBenchmark not found!")
+ return
+ else:
+ tdLog.info("taosBenchmark found in %s" % paths[0])
+ return paths[0]
# 获取taosc接口查询的结果文件中的内容,返回每行数据,并断言数据的第一列内容。
def assertfileDataTaosc(self, filename, expectResult):
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py b/tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
index 23e788916f63d899d3ae3059a8062d54dcf329c6..0392b58aa2df54ebc75dc8647fed7e9bc51dd3f2 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
@@ -29,27 +29,23 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql)
def getPath(self, tool="taosBenchmark"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
- if "community" in selfPath:
- projPath = selfPath[: selfPath.find("community")]
- elif "src" in selfPath:
- projPath = selfPath[: selfPath.find("src")]
- elif "/tools/" in selfPath:
- projPath = selfPath[: selfPath.find("/tools/")]
- elif "/tests/" in selfPath:
- projPath = selfPath[: selfPath.find("/tests/")]
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
else:
- tdLog.exit("cannot found %s in path: %s, use system's" % (tool, selfPath))
+ projPath = selfPath[:selfPath.find("tests")]
paths = []
for root, dirs, files in os.walk(projPath):
- if (tool) in files:
+ if ((tool) in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
- if "packaging" not in rootRealPath:
+ if ("packaging" not in rootRealPath):
paths.append(os.path.join(root, tool))
break
- if len(paths) == 0:
+ if (len(paths) == 0):
tdLog.exit("taosBenchmark not found!")
return
else:
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestInspect.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestInspect.py
index 1ccbb1f7d659d4ce64ba83475997539d3f9d5845..197f05aac9889181dc5d988bfb27137fed53ea0d 100644
--- a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestInspect.py
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestInspect.py
@@ -30,30 +30,28 @@ class TDTestCase:
self.tmpdir = "tmp"
def getPath(self, tool="taosdump"):
+ if (platform.system().lower() == 'windows'):
+ tool = tool + ".exe"
selfPath = os.path.dirname(os.path.realpath(__file__))
- if "community" in selfPath:
- projPath = selfPath[: selfPath.find("community")]
- elif "src" in selfPath:
- projPath = selfPath[: selfPath.find("src")]
- elif "/tools/" in selfPath:
- projPath = selfPath[: selfPath.find("/tools/")]
- elif "/tests/" in selfPath:
- projPath = selfPath[: selfPath.find("/tests/")]
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
else:
- tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
- projPath = "/usr/local/taos/bin"
+ projPath = selfPath[:selfPath.find("tests")]
paths = []
- for root, dummy, files in os.walk(projPath):
- if (tool) in files:
+ for root, dirs, files in os.walk(projPath):
+ if ((tool) in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
- if "packaging" not in rootRealPath:
+ if ("packaging" not in rootRealPath):
paths.append(os.path.join(root, tool))
break
- if len(paths) == 0:
- return ""
- return paths[0]
+ if (len(paths) == 0):
+ tdLog.exit("taosBenchmark not found!")
+ return
+ else:
+ tdLog.info("taosBenchmark found in %s" % paths[0])
+ return paths[0]
def run(self):
tdSql.prepare()
diff --git a/tests/develop-test/test.py b/tests/develop-test/test.py
index 600925174f358b6a4659b10b66a825cc7e12641d..6b1c63a1c0c4fe9415c921b97beb3dbe336235ce 100644
--- a/tests/develop-test/test.py
+++ b/tests/develop-test/test.py
@@ -316,9 +316,9 @@ if __name__ == "__main__":
print(r)
else:
pass
- if restful:
- tAdapter.init(deployPath, masterIp)
- tAdapter.stop(force_kill=True)
+
+ tAdapter.init(deployPath, masterIp)
+ tAdapter.stop(force_kill=True)
if dnodeNums == 1:
tdDnodes.deploy(1, updateCfgDict)
diff --git a/tests/develop-test/win-test-file b/tests/develop-test/win-test-file
new file mode 100644
index 0000000000000000000000000000000000000000..e4f3bcf56ee0ea3154232d384e005855b60e3c82
--- /dev/null
+++ b/tests/develop-test/win-test-file
@@ -0,0 +1,13 @@
+python3 ./test.py -f 2-query/table_count_scan.py
+python3 ./test.py -f 2-query/show_create_db.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py
+python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R
+python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R
diff --git a/tests/docs-examples-test/jdbc.sh b/tests/docs-examples-test/jdbc.sh
index d71085a40306956ea8d25e9b575c97ae9945df76..4fcc5404b6585ec64383cb8cd341687119698dd6 100644
--- a/tests/docs-examples-test/jdbc.sh
+++ b/tests/docs-examples-test/jdbc.sh
@@ -6,15 +6,10 @@ cd ../../docs/examples/java
mvn clean test > jdbc-out.log 2>&1
tail -n 20 jdbc-out.log
-
-cases=`grep 'Tests run' jdbc-out.log | awk 'END{print $3}'`
-totalJDBCCases=`echo ${cases/%,}`
-failed=`grep 'Tests run' jdbc-out.log | awk 'END{print $5}'`
-JDBCFailed=`echo ${failed/%,}`
-error=`grep 'Tests run' jdbc-out.log | awk 'END{print $7}'`
-JDBCError=`echo ${error/%,}`
-
-totalJDBCFailed=`expr $JDBCFailed + $JDBCError`
+totalJDBCCases=`grep 'Tests run' jdbc-out.log | awk -F"[:,]" 'END{ print $2 }'`
+failed=`grep 'Tests run' jdbc-out.log | awk -F"[:,]" 'END{ print $4 }'`
+error=`grep 'Tests run' jdbc-out.log | awk -F"[:,]" 'END{ print $6 }'`
+totalJDBCFailed=`expr $failed + $error`
totalJDBCSuccess=`expr $totalJDBCCases - $totalJDBCFailed`
if [ "$totalJDBCSuccess" -gt "0" ]; then
diff --git a/tests/docs-examples-test/python.sh b/tests/docs-examples-test/python.sh
index 31342b33d7a6a0038bb02c32e2ce99c788957792..2a44ee75528ed462460cc6783a2cca62f3a022ef 100644
--- a/tests/docs-examples-test/python.sh
+++ b/tests/docs-examples-test/python.sh
@@ -52,7 +52,7 @@ python3 conn_rest_pandas.py
taos -s "drop database if exists power"
# 11
-taos -s "create database if not exists test"
+taos -s "create database if not exists test wal_retention_period 3600"
python3 connect_native_reference.py
# 12
@@ -85,3 +85,9 @@ python3 fast_write_example.py
pip3 install kafka-python
python3 kafka_example_consumer.py
+# 21
+pip3 install taos-ws-py
+python3 conn_websocket_pandas.py
+
+# 22
+python3 connect_websocket_examples.py
diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task
index 49f14191b13023ab63b161c02387559050e24cf8..39415ed0bd666a5add74789f1f165782bb430742 100644
--- a/tests/parallel_test/cases.task
+++ b/tests/parallel_test/cases.task
@@ -129,6 +129,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py
+,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py
+,,n,system-test,python3 ./test.py -N 3 -f 0-others/walRetention.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py
@@ -621,7 +623,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/json_tag.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/json_tag.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -Q 4
@@ -651,9 +653,9 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/cast.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/unique.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stateduration.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_stateduration.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/statecount.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tail.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ttl_comment.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4
@@ -872,6 +874,7 @@
,,y,script,./test.sh -f tsim/query/scalarNull.sim
,,y,script,./test.sh -f tsim/query/session.sim
,,y,script,./test.sh -f tsim/query/udf.sim
+,,n,script,./test.sh -f tsim/query/udfpy.sim
,,y,script,./test.sh -f tsim/query/udf_with_const.sim
,,y,script,./test.sh -f tsim/query/join_interval.sim
,,y,script,./test.sh -f tsim/query/unionall_as_table.sim
diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh
index e00e59f46b00dd9425fa393fb6a1b9918079d1ba..ffc23ba6d2baa83b534532d1eac9cb154d007ecb 100755
--- a/tests/parallel_test/run_case.sh
+++ b/tests/parallel_test/run_case.sh
@@ -51,6 +51,9 @@ if [ $ent -eq 0 ]; then
ln -s /home/TDengine/debug/build/lib/libtaos.so /usr/lib/libtaos.so 2>/dev/null
ln -s /home/TDengine/debug/build/lib/libtaos.so /usr/lib/libtaos.so.1 2>/dev/null
ln -s /home/TDengine/include/client/taos.h /usr/include/taos.h 2>/dev/null
+ ln -s /home/TDengine/include/common/taosdef.h /usr/include/taosdef.h 2>/dev/null
+ ln -s /home/TDengine/include/util/taoserror.h /usr/include/taoserror.h 2>/dev/null
+ ln -s /home/TDengine/include/libs/function/taosudf.h /usr/include/taosudf.h 2>/dev/null
CONTAINER_TESTDIR=/home/TDengine
else
export PATH=$PATH:/home/TDinternal/debug/build/bin
@@ -58,6 +61,9 @@ else
ln -s /home/TDinternal/debug/build/lib/libtaos.so /usr/lib/libtaos.so 2>/dev/null
ln -s /home/TDinternal/debug/build/lib/libtaos.so /usr/lib/libtaos.so.1 2>/dev/null
ln -s /home/TDinternal/community/include/client/taos.h /usr/include/taos.h 2>/dev/null
+ ln -s /home/TDinternal/community/include/common/taosdef.h /usr/include/taosdef.h 2>/dev/null
+ ln -s /home/TDinternal/community/include/util/taoserror.h /usr/include/taoserror.h 2>/dev/null
+ ln -s /home/TDinternal/community/include/libs/function/taosudf.h /usr/include/taosudf.h 2>/dev/null
CONTAINER_TESTDIR=/home/TDinternal/community
fi
mkdir -p /var/lib/taos/subscribe
diff --git a/tests/parallel_test/split_case.sh b/tests/parallel_test/split_case.sh
new file mode 100755
index 0000000000000000000000000000000000000000..af601ed9a6a1c4d371e56d94aa45bc56b8715793
--- /dev/null
+++ b/tests/parallel_test/split_case.sh
@@ -0,0 +1,58 @@
+case_file="cases_temp_file"
+
+parm_path=$(dirname $0)
+parm_path=$(pwd ${parm_path})
+echo "execute path:${parm_path}"
+cd ${parm_path}
+cp cases.task ${case_file}
+sed -i '/^$/d' ${case_file}
+sed -i '$a\%%FINISHED%%' ${case_file}
+
+utest="unit-test"
+tsimtest="script"
+systest="system-test"
+devtest="develop-test"
+doctest="docs-examples-test"
+rm -rf win-${utest}.log win-${tsimtest}.log win-${systest}.log win-${devtest}.log win-${doctest}.log
+rm -rf ${parm_path}/../${utest}/win-test-file ${parm_path}/../${tsimtest}/win-test-file ${parm_path}/../${systest}/win-test-file ${parm_path}/../${devtest}/win-test-file
+while read -r line
+do
+ echo "$line"|grep -q "^#"
+ if [ $? -eq 0 ]; then
+ continue
+ fi
+ exec_dir=$(echo "$line"|cut -d ',' -f4)
+ case_cmd=$(echo "$line"|cut -d ',' -f5)
+ if [[ "${exec_dir}" == "${utest}" ]]; then
+ echo ${case_cmd} >> win-${utest}.log
+ continue
+ fi
+ if [[ "${exec_dir}" == "${tsimtest}" ]]; then
+ echo ${case_cmd} >> win-${tsimtest}.log
+ continue
+ fi
+ if [[ "${exec_dir}" == "${systest}" ]]; then
+ if [[ "${case_cmd}" =~ "pytest.sh" ]]; then
+ case_cmd=$(echo "$case_cmd"|cut -d ' ' -f 2-)
+ echo ${case_cmd} >> win-${systest}.log
+ else
+ echo ${case_cmd} >> win-${systest}.log
+ fi
+ continue
+ fi
+ if [[ "${exec_dir}" == "${devtest}" ]]; then
+ echo ${case_cmd} >> win-${devtest}.log
+ continue
+ fi
+ if [[ "${exec_dir}" == "${doctest}" ]]; then
+ echo ${case_cmd} >> win-${doctest}.log
+ continue
+ fi
+done < ${case_file}
+mv win-${utest}.log ${parm_path}/../${utest}/win-test-file
+mv win-${tsimtest}.log ${parm_path}/../${tsimtest}/win-test-file
+mv win-${systest}.log ${parm_path}/../${systest}/win-test-file
+mv win-${devtest}.log ${parm_path}/../${devtest}/win-test-file
+
+
+rm -rf ${case_file}
diff --git a/tests/pytest/util/autogen.py b/tests/pytest/util/autogen.py
index 5c6445da7d3b05e8190480304cebe447c79776e6..b85348d0ba36a026e9400ece76e18de54185aeee 100644
--- a/tests/pytest/util/autogen.py
+++ b/tests/pytest/util/autogen.py
@@ -51,10 +51,7 @@ class AutoGen:
metas = []
for i in range(cnt):
colname = f"{pre}{i}"
- if i < len(types):
- sel = i
- else:
- sel = random.randint(0, len(types)-1)
+ sel = len(types) % len(types)
coltype = types[sel]
sql = f"{colname} {coltype}"
if sqls != "":
diff --git a/tests/pytest/util/cases.py b/tests/pytest/util/cases.py
index 82aa5523596c8d62557bad7d41d02e1ca897c9a9..536b8f30d3582875e85d1260861d6839f8503f6f 100644
--- a/tests/pytest/util/cases.py
+++ b/tests/pytest/util/cases.py
@@ -17,6 +17,7 @@ import time
import datetime
import inspect
import importlib
+import traceback
from util.log import *
@@ -75,6 +76,7 @@ class TDCases:
case.run()
except Exception as e:
tdLog.notice(repr(e))
+ traceback.print_exc()
tdLog.exit("%s failed" % (fileName))
case.stop()
runNum += 1
@@ -94,14 +96,14 @@ class TDCases:
tdLog.notice("total %d Windows test case(s) executed" % (runNum))
- def runOneWindows(self, conn, fileName):
+ def runOneWindows(self, conn, fileName, replicaVar=1):
testModule = self.__dynamicLoadModule(fileName)
runNum = 0
for tmp in self.windowsCases:
if tmp.name.find(fileName) != -1:
case = testModule.TDTestCase()
- case.init(conn, self._logSql)
+ case.init(conn, self._logSql,replicaVar)
try:
case.run()
except Exception as e:
diff --git a/tests/pytest/util/dnodes-default.py b/tests/pytest/util/dnodes-default.py
index 8da36f30748251f307a9152fd8907bdebc9e1405..6809c1082ca8db3c099f4d047be46104c0dccf5b 100644
--- a/tests/pytest/util/dnodes-default.py
+++ b/tests/pytest/util/dnodes-default.py
@@ -46,11 +46,11 @@ class TDSimClient:
self.path = path
def getLogDir(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
return self.logDir
def getCfgDir(self):
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
return self.cfgDir
def setTestCluster(self, value):
@@ -65,9 +65,9 @@ class TDSimClient:
tdLog.exit(cmd)
def deploy(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
- self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
+ self.cfgPath = os.path.join(self.path,"sim","psim","cfg","taos.cfg")
cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0:
@@ -131,11 +131,10 @@ class TDDnode:
return totalSize
def deploy(self):
- self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
- self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
- self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
- self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
- self.path, self.index)
+ self.logDir = os.path.join(self.path,"sim","dnode%d" % self.index, "log")
+ self.dataDir = os.path.join(self.path,"sim","dnode%d" % self.index, "data")
+ self.cfgDir = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg")
+ self.cfgPath = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg","taos.cfg")
cmd = "rm -rf " + self.dataDir
if os.system(cmd) != 0:
@@ -325,11 +324,11 @@ class TDDnode:
tdLog.exit(cmd)
def getDnodeRootDir(self, index):
- dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
+ dnodeRootDir = os.path.join(self.path,"sim","psim","dnode%d" % index)
return dnodeRootDir
def getDnodesRootDir(self):
- dnodesRootDir = "%s/sim/psim" % (self.path)
+ dnodesRootDir = os.path.join(self.path,"sim","psim")
return dnodesRootDir
diff --git a/tests/pytest/util/dnodes-no-random-fail.py b/tests/pytest/util/dnodes-no-random-fail.py
index a973f8da52d63aa04ecc3eb4afea47c93419e0c5..0e433e9664ef7ca05652e6fbb03949a9311c0bdf 100644
--- a/tests/pytest/util/dnodes-no-random-fail.py
+++ b/tests/pytest/util/dnodes-no-random-fail.py
@@ -44,11 +44,11 @@ class TDSimClient:
self.path = path
def getLogDir(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
return self.logDir
def getCfgDir(self):
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
return self.cfgDir
def setTestCluster(self, value):
@@ -63,9 +63,9 @@ class TDSimClient:
tdLog.exit(cmd)
def deploy(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
- self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
+ self.cfgPath = os.path.join(self.path,"sim","psim","cfg","taos.cfg")
cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0:
@@ -129,11 +129,10 @@ class TDDnode:
return totalSize
def deploy(self):
- self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
- self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
- self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
- self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
- self.path, self.index)
+ self.logDir = os.path.join(self.path,"sim","dnode%d" % self.index, "log")
+ self.dataDir = os.path.join(self.path,"sim","dnode%d" % self.index, "data")
+ self.cfgDir = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg")
+ self.cfgPath = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg","taos.cfg")
cmd = "rm -rf " + self.dataDir
if os.system(cmd) != 0:
@@ -323,11 +322,11 @@ class TDDnode:
tdLog.exit(cmd)
def getDnodeRootDir(self, index):
- dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
+ dnodeRootDir = os.path.join(self.path,"sim","psim","dnode%d" % index)
return dnodeRootDir
def getDnodesRootDir(self):
- dnodesRootDir = "%s/sim/psim" % (self.path)
+ dnodesRootDir = os.path.join(self.path,"sim","psim")
return dnodesRootDir
diff --git a/tests/pytest/util/dnodes-random-fail.py b/tests/pytest/util/dnodes-random-fail.py
index 9b653844f880f6f0667c2b96bf9a264c04d5c613..1c527290ec3c0a24b0a0175da104eeca2ffcfdfb 100644
--- a/tests/pytest/util/dnodes-random-fail.py
+++ b/tests/pytest/util/dnodes-random-fail.py
@@ -41,11 +41,11 @@ class TDSimClient:
self.path = path
def getLogDir(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
return self.logDir
def getCfgDir(self):
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
return self.cfgDir
def setTestCluster(self, value):
@@ -60,9 +60,9 @@ class TDSimClient:
tdLog.exit(cmd)
def deploy(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
- self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
+ self.cfgPath = os.path.join(self.path,"sim","psim","cfg","taos.cfg")
cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0:
@@ -126,11 +126,10 @@ class TDDnode:
return totalSize
def deploy(self):
- self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
- self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
- self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
- self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
- self.path, self.index)
+ self.logDir = os.path.join(self.path,"sim","dnode%d" % self.index, "log")
+ self.dataDir = os.path.join(self.path,"sim","dnode%d" % self.index, "data")
+ self.cfgDir = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg")
+ self.cfgPath = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg","taos.cfg")
cmd = "rm -rf " + self.dataDir
if os.system(cmd) != 0:
@@ -320,11 +319,11 @@ class TDDnode:
tdLog.exit(cmd)
def getDnodeRootDir(self, index):
- dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
+ dnodeRootDir = os.path.join(self.path,"sim","psim","dnode%d" % index)
return dnodeRootDir
def getDnodesRootDir(self):
- dnodesRootDir = "%s/sim/psim" % (self.path)
+ dnodesRootDir = os.path.join(self.path,"sim","psim")
return dnodesRootDir
diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py
index 360843c46c3568836d8e7cd5c8b33a49b3a0e99f..80ab5baa9a8a23132abf75686ccdc6bebb6d8238 100644
--- a/tests/pytest/util/dnodes.py
+++ b/tests/pytest/util/dnodes.py
@@ -50,11 +50,11 @@ class TDSimClient:
}
def getLogDir(self):
- self.logDir = "%s/sim/psim/log" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
return self.logDir
def getCfgDir(self):
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
return self.cfgDir
def setTestCluster(self, value):
@@ -69,9 +69,9 @@ class TDSimClient:
tdLog.exit(cmd)
def deploy(self, *updatecfgDict):
- self.logDir = "%s/sim/psim/log" % (self.path)
- self.cfgDir = "%s/sim/psim/cfg" % (self.path)
- self.cfgPath = "%s/sim/psim/cfg/taos.cfg" % (self.path)
+ self.logDir = os.path.join(self.path,"sim","psim","log")
+ self.cfgDir = os.path.join(self.path,"sim","psim","cfg")
+ self.cfgPath = os.path.join(self.path,"sim","psim","cfg","taos.cfg")
cmd = "rm -rf " + self.logDir
if os.system(cmd) != 0:
@@ -207,11 +207,10 @@ class TDDnode:
self.remote_conn.run("python3 ./test.py %s -d %s -e %s"%(valgrindStr,remoteCfgDictStr,execCmdStr))
def deploy(self, *updatecfgDict):
- self.logDir = "%s/sim/dnode%d/log" % (self.path, self.index)
- self.dataDir = "%s/sim/dnode%d/data" % (self.path, self.index)
- self.cfgDir = "%s/sim/dnode%d/cfg" % (self.path, self.index)
- self.cfgPath = "%s/sim/dnode%d/cfg/taos.cfg" % (
- self.path, self.index)
+ self.logDir = os.path.join(self.path,"sim","dnode%d" % self.index, "log")
+ self.dataDir = os.path.join(self.path,"sim","dnode%d" % self.index, "data")
+ self.cfgDir = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg")
+ self.cfgPath = os.path.join(self.path,"sim","dnode%d" % self.index, "cfg","taos.cfg")
cmd = "rm -rf " + self.dataDir
if os.system(cmd) != 0:
@@ -472,20 +471,25 @@ class TDDnode:
tdLog.exit("dnode:%d is not deployed" % (self.index))
if self.valgrind == 0:
- if self.asan:
- asanDir = "%s/sim/asan/dnode%d.asan" % (
- self.path, self.index)
- cmd = "nohup %s -c %s > /dev/null 2> %s & " % (
- binPath, self.cfgDir, asanDir)
+ if platform.system().lower() == 'windows':
+ cmd = "mintty -h never %s -c %s" % (binPath, self.cfgDir)
else:
- cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
- binPath, self.cfgDir)
+ if self.asan:
+ asanDir = "%s/sim/asan/dnode%d.asan" % (
+ self.path, self.index)
+ cmd = "nohup %s -c %s > /dev/null 2> %s & " % (
+ binPath, self.cfgDir, asanDir)
+ else:
+ cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
+ binPath, self.cfgDir)
else:
valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir
-
- cmd = "nohup %s %s -c %s 2>&1 & " % (
- valgrindCmdline, binPath, self.cfgDir)
-
+ if platform.system().lower() == 'windows':
+ cmd = "mintty -h never %s %s -c %s" % (
+ valgrindCmdline, binPath, self.cfgDir)
+ else:
+ cmd = "nohup %s %s -c %s 2>&1 & " % (
+ valgrindCmdline, binPath, self.cfgDir)
print(cmd)
if (self.remoteIP == ""):
@@ -568,6 +572,8 @@ class TDDnode:
while(processID):
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
+ if platform.system().lower() == 'windows':
+ killCmd = "kill -INT %s > nul 2>&1" % processID
os.system(killCmd)
onlyKillOnceWindows = 1
time.sleep(1)
@@ -635,11 +641,11 @@ class TDDnode:
tdLog.exit(cmd)
def getDnodeRootDir(self, index):
- dnodeRootDir = "%s/sim/psim/dnode%d" % (self.path, index)
+ dnodeRootDir = os.path.join(self.path,"sim","psim","dnode%d" % index)
return dnodeRootDir
def getDnodesRootDir(self):
- dnodesRootDir = "%s/sim/psim" % (self.path)
+ dnodesRootDir = os.path.join(self.path,"sim","psim")
return dnodesRootDir
@@ -789,15 +795,21 @@ class TDDnodes:
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
while(processID):
print(processID)
- if platform.system().lower() == 'windows':
- killCmd = "kill -9 %s > nul 2>&1" % processID
- else:
- killCmd = "kill -9 %s > /dev/null 2>&1" % processID
+ killCmd = "kill -9 %s > /dev/null 2>&1" % processID
+ os.system(killCmd)
+ time.sleep(1)
+ processID = subprocess.check_output(
+ psCmd, shell=True).decode("utf-8").strip()
+ elif platform.system().lower() == 'windows':
+ psCmd = "for /f %a in ('wmic process where \"name='taosd.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)"
+ processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
+ while(processID):
+ print(processID)
+ killCmd = "kill -9 %s > nul 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8").strip()
-
else:
psCmd = "ps -ef | grep -w taosd | grep 'root' | grep -v grep| grep -v defunct | awk '{print $2}' | xargs"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
@@ -809,10 +821,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w taosd| grep -v grep| grep -v defunct | awk '{print $2}' | xargs"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
while(processID):
- if platform.system().lower() == 'windows':
- killCmd = "kill -9 %s > nul 2>&1" % processID
- else:
- killCmd = "kill -9 %s > /dev/null 2>&1" % processID
+ killCmd = "kill -9 %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
diff --git a/tests/pytest/util/gettime.py b/tests/pytest/util/gettime.py
index 94eed384789b85b746a523c3a0875bf1f5b711ea..d4a5e18dc9e9fb8f3ee032219d05c8a6d53becfb 100644
--- a/tests/pytest/util/gettime.py
+++ b/tests/pytest/util/gettime.py
@@ -18,6 +18,9 @@ class GetTime:
def get_ms_timestamp(self,ts_str):
_ts_str = ts_str
+ if "+" in _ts_str:
+ timestamp = datetime.fromisoformat(_ts_str)
+ return int((timestamp-datetime.fromtimestamp(0,timestamp.tzinfo)).total_seconds())*1000+int(timestamp.microsecond / 1000)
if " " in ts_str:
p = ts_str.split(" ")[1]
if len(p) > 15 :
diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py
index aa6fb2bbc135aa256fa1bd3b0f2cd2ec73b29d79..783ee476cb5d3b34ffc4461e336412b0259dc975 100644
--- a/tests/pytest/util/sql.py
+++ b/tests/pytest/util/sql.py
@@ -24,26 +24,12 @@ from util.log import *
from util.constant import *
# from datetime import timezone
-from tzlocal import get_localzone
-import pytz
import time
-def _locaTzTimeStamp(utctimestamp):
- tz = get_localzone()
- temptz = str(tz)
- localtz = pytz.timezone(temptz)
- defUtctimestamp=1035640800
- local_dt = datetime.datetime(2002, 10, 27, 6, 0, 0, tzinfo=localtz)
- defLocaltimestamp = time.mktime(local_dt.timetuple())
- deltaTzTime = int(defLocaltimestamp)-int(defUtctimestamp)
- temp = int(str(utctimestamp)[0:10])
- tempOther = str(utctimestamp)[10-len(str(utctimestamp)):]
- localtemp = deltaTzTime + temp
- localAll = str(localtemp) + str(tempOther)
- localtimestamp = int(localAll)
-
- print(f"local timezone is {localtimestamp}, Deltel time is {deltaTzTime}s")
- return localtimestamp
+def _parse_ns_timestamp(timestr):
+ dt_obj = datetime.datetime.strptime(timestr[:len(timestr)-3], "%Y-%m-%d %H:%M:%S.%f")
+ tz = int(int((dt_obj-datetime.datetime.fromtimestamp(0,dt_obj.tzinfo)).total_seconds())*1e9) + int(dt_obj.microsecond * 1000) + int(timestr[-3:])
+ return tz
def _parse_datetime(timestr):
@@ -265,19 +251,18 @@ class TDSql:
if self.queryResult[row][col] != data:
if self.cursor.istype(col, "TIMESTAMP"):
- # suppose user want to check nanosecond timestamp if a longer data passed``
+ # suppose user want to check nanosecond timestamp if a longer data passed``
if isinstance(data,str) :
if (len(data) >= 28):
- resultData = _locaTzTimeStamp(self.queryResult[row][col])
- if pd.to_datetime(resultData) == pd.to_datetime(data):
+ if self.queryResult[row][col] == _parse_ns_timestamp(data):
# tdLog.info(f"sql:{self.sql}, row:{row} col:{col} data:{pd.to_datetime(resultData)} == expect:{data}")
tdLog.info("check successfully")
else:
caller = inspect.getframeinfo(inspect.stack()[1][0])
args = (caller.filename, caller.lineno, self.sql, row, col, self.queryResult[row][col], data)
- tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
+ tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
else:
- if self.queryResult[row][col] == _parse_datetime(data):
+ if self.queryResult[row][col].astimezone(datetime.timezone.utc) == _parse_datetime(data).astimezone(datetime.timezone.utc):
# tdLog.info(f"sql:{self.sql}, row:{row} col:{col} data:{self.queryResult[row][col]} == expect:{data}")
tdLog.info("check successfully")
else:
@@ -285,20 +270,44 @@ class TDSql:
args = (caller.filename, caller.lineno, self.sql, row, col, self.queryResult[row][col], data)
tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
return
- elif isinstance(data,int) :
- if len(str(data)) == 16 :
- unitTime = 'us'
- elif len(str(data)) == 13 :
- unitTime = 'ms'
- elif len(str(data)) == 19 :
- unitTime = 'ns'
+ elif isinstance(data,int):
+ if len(str(data)) == 16:
+ precision = 'us'
+ elif len(str(data)) == 13:
+ precision = 'ms'
+ elif len(str(data)) == 19:
+ precision = 'ns'
else:
caller = inspect.getframeinfo(inspect.stack()[1][0])
args = (caller.filename, caller.lineno, self.sql, row, col, self.queryResult[row][col], data)
tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
- resultData = pd.to_datetime(_locaTzTimeStamp(data),unit=unitTime)
- if resultData == self.queryResult[row][col] :
- # tdLog.info(f"sql:{self.sql}, row:{row} col:{col} data:{self.queryResult[row][col]} == expect:{resultData}")
+ return
+ success = False
+ if precision == 'ms':
+ dt_obj = self.queryResult[row][col]
+ ts = int(int((dt_obj-datetime.datetime.fromtimestamp(0,dt_obj.tzinfo)).total_seconds())*1000) + int(dt_obj.microsecond/1000)
+ if ts == data:
+ success = True
+ elif precision == 'us':
+ dt_obj = self.queryResult[row][col]
+ ts = int(int((dt_obj-datetime.datetime.fromtimestamp(0,dt_obj.tzinfo)).total_seconds())*1e6) + int(dt_obj.microsecond)
+ if ts == data:
+ success = True
+ elif precision == 'ns':
+ if data == self.queryResult[row][col]:
+ success = True
+ if success:
+ tdLog.info("check successfully")
+ else:
+ caller = inspect.getframeinfo(inspect.stack()[1][0])
+ args = (caller.filename, caller.lineno, self.sql, row, col, self.queryResult[row][col], data)
+ tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
+ return
+ elif isinstance(data,datetime.datetime):
+ dt_obj = self.queryResult[row][col]
+ delt_data = data-datetime.datetime.fromtimestamp(0,data.tzinfo)
+ delt_result = self.queryResult[row][col] - datetime.datetime.fromtimestamp(0,self.queryResult[row][col].tzinfo)
+ if delt_data == delt_result:
tdLog.info("check successfully")
else:
caller = inspect.getframeinfo(inspect.stack()[1][0])
@@ -309,7 +318,6 @@ class TDSql:
caller = inspect.getframeinfo(inspect.stack()[1][0])
args = (caller.filename, caller.lineno, self.sql, row, col, self.queryResult[row][col], data)
tdLog.exit("%s(%d) failed: sql:%s row:%d col:%d data:%s != expect:%s" % args)
-
if str(self.queryResult[row][col]) == str(data):
# tdLog.info(f"sql:{self.sql}, row:{row} col:{col} data:{self.queryResult[row][col]} == expect:{data}")
diff --git a/tests/pytest/util/taosadapter.py b/tests/pytest/util/taosadapter.py
index 79ea86c5bd820c1327cf844b35eb8800fefdfe60..1f1c38672e130f54478d1fed408f2948d2ec892a 100644
--- a/tests/pytest/util/taosadapter.py
+++ b/tests/pytest/util/taosadapter.py
@@ -1,4 +1,4 @@
-import socket
+import requests
from fabric2 import Connection
from util.log import *
from util.common import *
@@ -132,9 +132,9 @@ class TAdapter:
tdLog.exit(cmd)
def deploy(self, *update_cfg_dict):
- self.log_dir = f"{self.path}/sim/dnode1/log"
- self.cfg_dir = f"{self.path}/sim/dnode1/cfg"
- self.cfg_path = f"{self.cfg_dir}/taosadapter.toml"
+ self.log_dir = os.path.join(self.path,"sim","dnode1","log")
+ self.cfg_dir = os.path.join(self.path,"sim","dnode1","cfg")
+ self.cfg_path = os.path.join(self.cfg_dir,"taosadapter.toml")
cmd = f"touch {self.cfg_path}"
if os.system(cmd) != 0:
@@ -162,7 +162,7 @@ class TAdapter:
tdLog.info(f"taosadapter found: {bin_path}")
if platform.system().lower() == 'windows':
- cmd = f"mintty -h never {bin_path} -c {self.cfg_dir}"
+ cmd = f"mintty -h never {bin_path} -c {self.cfg_path}"
else:
cmd = f"nohup {bin_path} -c {self.cfg_path} > /dev/null & "
@@ -170,7 +170,7 @@ class TAdapter:
self.remote_exec(self.taosadapter_cfg_dict, f"tAdapter.deployed=1\ntAdapter.log_dir={self.log_dir}\ntAdapter.cfg_dir={self.cfg_dir}\ntAdapter.start()")
self.running = 1
else:
- os.system(f"rm -rf {self.log_dir}/taosadapter*")
+ os.system(f"rm -rf {self.log_dir}{os.sep}taosadapter*")
if os.system(cmd) != 0:
tdLog.exit(cmd)
self.running = 1
@@ -179,22 +179,19 @@ class TAdapter:
time.sleep(0.1)
taosadapter_port = self.taosadapter_cfg_dict["port"]
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.settimeout(3)
- try:
- res = s.connect_ex((self.remoteIP, taosadapter_port))
- s.shutdown(2)
- if res == 0:
- tdLog.info(f"the taosadapter has been started, using port:{taosadapter_port}")
- else:
- tdLog.info(f"the taosadapter do not started!!!")
- except socket.error as e:
- tdLog.notice("socket connect error!")
- finally:
- if s:
- s.close()
- # tdLog.debug("the taosadapter has been started.")
- time.sleep(1)
+ for i in range(5):
+ ip = 'localhost'
+ if self.remoteIP != "":
+ ip = self.remoteIP
+ url = f'http://{ip}:{taosadapter_port}/-/ping'
+ try:
+ r = requests.get(url)
+ if r.status_code == 200:
+ tdLog.info(f"the taosadapter has been started, using port:{taosadapter_port}")
+ break
+ except Exception:
+ tdLog.info(f"the taosadapter do not started!!!")
+ time.sleep(1)
def start_taosadapter(self):
"""
@@ -228,33 +225,36 @@ class TAdapter:
def stop(self, force_kill=False):
signal = "-9" if force_kill else "-15"
-
if self.remoteIP:
self.remote_exec(self.taosadapter_cfg_dict, "tAdapter.running=1\ntAdapter.stop()")
tdLog.info("stop taosadapter")
return
-
toBeKilled = "taosadapter"
-
- if self.running != 0:
+ if platform.system().lower() == 'windows':
psCmd = f"ps -ef|grep -w {toBeKilled}| grep -v grep | awk '{{print $2}}'"
- # psCmd = f"pgrep {toBeKilled}"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
- while(processID):
- killCmd = "kill %s %s > /dev/null 2>&1" % (signal, processID)
+ while(processID):
+ killCmd = "kill %s %s > nul 2>&1" % (signal, processID)
os.system(killCmd)
time.sleep(1)
- processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
- if not platform.system().lower() == 'windows':
+ processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
+ self.running = 0
+ tdLog.debug(f"taosadapter is stopped by kill {signal}")
+
+ else:
+ if self.running != 0:
+ psCmd = f"ps -ef|grep -w {toBeKilled}| grep -v grep | awk '{{print $2}}'"
+ processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
+ while(processID):
+ killCmd = "kill %s %s > /dev/null 2>&1" % (signal, processID)
+ os.system(killCmd)
+ time.sleep(1)
+ processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip()
port = 6041
fuserCmd = f"fuser -k -n tcp {port} > /dev/null"
os.system(fuserCmd)
- # for port in range(6030, 6041):
- # fuserCmd = f"fuser -k -n tcp {port} > /dev/null"
- # os.system(fuserCmd)
-
- self.running = 0
- tdLog.debug(f"taosadapter is stopped by kill {signal}")
+ self.running = 0
+ tdLog.debug(f"taosadapter is stopped by kill {signal}")
diff --git a/tests/script/coverage_test.sh b/tests/script/coverage_test.sh
index ad87528f9c414907581f7d052d14779fb73799ff..535b6802f25c1a94549ae9ea5fbb67f08601f258 100755
--- a/tests/script/coverage_test.sh
+++ b/tests/script/coverage_test.sh
@@ -57,9 +57,9 @@ function buildTDengine() {
rm -rf *
if [ "$branch" == "3.0" ]; then
echo "3.0 ============="
- cmake -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true ..
+ cmake -DCOVER=true -DBUILD_TEST=true -DBUILD_HTTP=false -DBUILD_TOOLS=true .. > /dev/null
else
- cmake -DCOVER=true -DBUILD_TOOLS=true -DBUILD_HTTP=false .. > /dev/null
+ cmake -DCOVER=true -DBUILD_TEST=true -DBUILD_TOOLS=true -DBUILD_HTTP=false .. > /dev/null
fi
make -j
make install
@@ -109,6 +109,19 @@ function runUnitTest() {
echo " $TDENGINE_DIR/debug"
cd $TDENGINE_DIR/debug
ctest -j12
+
+ echo " $TDENGINE_DIR/tests/script/api"
+ cd $TDENGINE_DIR/tests/script/api
+ make clean && make
+
+ stopTaosd
+ stopTaosadapter
+
+ nohup taosd -c /etc/taos >> /dev/null 2>&1 &
+ ./batchprepare 127.0.0.1
+ ./dbTableRoute 127.0.0.1
+ ./stopquery 127.0.0.1 demo t1
+
echo "3.0 unit test done"
}
@@ -116,7 +129,7 @@ function runSimCases() {
echo "=== Run sim cases ==="
cd $TDENGINE_DIR/tests/script
- runCasesOneByOne ../parallel_test/cases.task sim
+ runCasesOneByOne ../parallel_test/cases.task sim
totalSuccess=`grep 'sim success' $TDENGINE_COVERAGE_REPORT | wc -l`
if [ "$totalSuccess" -gt "0" ]; then
@@ -164,8 +177,8 @@ function runJDBCCases() {
stopTaosd
stopTaosadapter
- taosd -c /etc/taos >> /dev/null 2>&1 &
- taosadapter >> /dev/null 2>&1 &
+ nohup taosd -c /etc/taos >> /dev/null 2>&1 &
+ nohup taosadapter >> /dev/null 2>&1 &
mvn clean test > result.txt 2>&1
summary=`grep "Tests run:" result.txt | tail -n 1`
diff --git a/tests/script/sh/bit_and.c b/tests/script/sh/bit_and.c
index 2f2e48fdb0882db2a40c9aae019402e031343d13..f3bf71ce946b5b5d62ac6d63de4c2532a799721e 100644
--- a/tests/script/sh/bit_and.c
+++ b/tests/script/sh/bit_and.c
@@ -1,61 +1,47 @@
-#include
-#include
#include
+#include
+#include
#include "taosudf.h"
+DLL_EXPORT int32_t bit_and_init() { return 0; }
-DLL_EXPORT int32_t bit_and_init() {
- return 0;
-}
-
-DLL_EXPORT int32_t bit_and_destroy() {
- return 0;
-}
-
-DLL_EXPORT int32_t bit_and(SUdfDataBlock* block, SUdfColumn *resultCol) {
+DLL_EXPORT int32_t bit_and_destroy() { return 0; }
- if (block->numOfCols < 2) {
- return TSDB_CODE_UDF_INVALID_INPUT;
- }
+DLL_EXPORT int32_t bit_and(SUdfDataBlock* block, SUdfColumn* resultCol) {
+ if (block->numOfCols < 2) {
+ return TSDB_CODE_UDF_INVALID_INPUT;
+ }
- for (int32_t i = 0; i < block->numOfCols; ++i) {
- SUdfColumn* col = block->udfCols[i];
- if (!(col->colMeta.type == TSDB_DATA_TYPE_INT)) {
- return TSDB_CODE_UDF_INVALID_INPUT;
- }
+ for (int32_t i = 0; i < block->numOfCols; ++i) {
+ SUdfColumn* col = block->udfCols[i];
+ if (!(col->colMeta.type == TSDB_DATA_TYPE_INT)) {
+ return TSDB_CODE_UDF_INVALID_INPUT;
}
+ }
- SUdfColumnMeta *meta = &resultCol->colMeta;
- meta->bytes = 4;
- meta->type = TSDB_DATA_TYPE_INT;
- meta->scale = 0;
- meta->precision = 0;
-
-
- SUdfColumnData *resultData = &resultCol->colData;
-
- resultData->numOfRows = block->numOfRows;
-
- for (int32_t i = 0; i < resultData->numOfRows; ++i) {
- if (udfColDataIsNull(block->udfCols[0], i)) {
- udfColDataSetNull(resultCol, i);
- continue;
- }
- int32_t result = *(int32_t*)udfColDataGetData(block->udfCols[0], i);
- int j = 1;
- for (; j < block->numOfCols; ++j) {
- if (udfColDataIsNull(block->udfCols[j], i)) {
- udfColDataSetNull(resultCol, i);
- break;
- }
-
- char* colData = udfColDataGetData(block->udfCols[j], i);
- result &= *(int32_t*)colData;
- }
- if (j == block->numOfCols) {
- udfColDataSet(resultCol, i, (char*)&result, false);
- }
+ SUdfColumnData* resultData = &resultCol->colData;
+ for (int32_t i = 0; i < block->numOfRows; ++i) {
+ if (udfColDataIsNull(block->udfCols[0], i)) {
+ udfColDataSetNull(resultCol, i);
+ continue;
}
- return TSDB_CODE_SUCCESS;
+ int32_t result = *(int32_t*)udfColDataGetData(block->udfCols[0], i);
+ int j = 1;
+ for (; j < block->numOfCols; ++j) {
+ if (udfColDataIsNull(block->udfCols[j], i)) {
+ udfColDataSetNull(resultCol, i);
+ break;
+ }
+
+ char* colData = udfColDataGetData(block->udfCols[j], i);
+ result &= *(int32_t*)colData;
+ }
+ if (j == block->numOfCols) {
+ udfColDataSet(resultCol, i, (char*)&result, false);
+ }
+ }
+ resultData->numOfRows = block->numOfRows;
+
+ return TSDB_CODE_SUCCESS;
}
diff --git a/tests/script/sh/checkValgrind.bat b/tests/script/sh/checkValgrind.bat
new file mode 100644
index 0000000000000000000000000000000000000000..cd80750fde70b434e97113be34785c675f4b1211
--- /dev/null
+++ b/tests/script/sh/checkValgrind.bat
@@ -0,0 +1,2 @@
+@echo off
+echo 0
\ No newline at end of file
diff --git a/tests/script/sh/deploy.bat b/tests/script/sh/deploy.bat
index 38e7022edec2c5dae9053e11934a65e108a75b93..fd76b3007874ef5ccdcbd6cacb5681587cec9a9d 100644
--- a/tests/script/sh/deploy.bat
+++ b/tests/script/sh/deploy.bat
@@ -54,7 +54,7 @@ if %NODE% == 6 set NODE=7600
if %NODE% == 7 set NODE=7700
if %NODE% == 8 set NODE=7800
-rem set "fqdn="
+set "fqdn=localhost"
for /f "skip=1" %%A in (
'wmic computersystem get caption'
) do if not defined fqdn set "fqdn=%%A"
diff --git a/tests/script/sh/exec.bat b/tests/script/sh/exec.bat
index 88dd43349ed9d49774faafe827b77126286c741d..75957882922a0bcf20dee10d5824f3c488b0697f 100644
--- a/tests/script/sh/exec.bat
+++ b/tests/script/sh/exec.bat
@@ -50,7 +50,7 @@ if %EXEC_OPTON% == start (
goto :finish
)
echo check taosd online
- tail -n +0 %TAOS_LOG% | grep -q "TDengine initialized successfully" || goto :check_online
+ tail -n +0 %TAOS_LOG% | grep -E "TDengine initialized successfully|from offline to online" || goto :check_online
echo finish
goto :finish
)
diff --git a/tests/script/sh/l2norm.c b/tests/script/sh/l2norm.c
index 8ccdffb8d69d1ba27410ad61a74ee3d7ca156be2..0b7f5bf7f6756c11331cae3140a9bf6b5cba024b 100644
--- a/tests/script/sh/l2norm.c
+++ b/tests/script/sh/l2norm.c
@@ -16,7 +16,7 @@ DLL_EXPORT int32_t l2norm_destroy() {
DLL_EXPORT int32_t l2norm_start(SUdfInterBuf *buf) {
*(int64_t*)(buf->buf) = 0;
buf->bufLen = sizeof(double);
- buf->numOfResult = 0;
+ buf->numOfResult = 1;
return 0;
}
@@ -58,20 +58,11 @@ DLL_EXPORT int32_t l2norm(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInte
*(double*)(newInterBuf->buf) = sumSquares;
newInterBuf->bufLen = sizeof(double);
-
- if (interBuf->numOfResult == 0 && numNotNull == 0) {
- newInterBuf->numOfResult = 0;
- } else {
- newInterBuf->numOfResult = 1;
- }
+ newInterBuf->numOfResult = 1;
return 0;
}
DLL_EXPORT int32_t l2norm_finish(SUdfInterBuf* buf, SUdfInterBuf *resultData) {
- if (buf->numOfResult == 0) {
- resultData->numOfResult = 0;
- return 0;
- }
double sumSquares = *(double*)(buf->buf);
*(double*)(resultData->buf) = sqrt(sumSquares);
resultData->bufLen = sizeof(double);
diff --git a/tests/script/sh/prepare_pyudf.sh b/tests/script/sh/prepare_pyudf.sh
new file mode 100755
index 0000000000000000000000000000000000000000..b72f8c9f77f94cf35a6bf1daef93ee773e53acfe
--- /dev/null
+++ b/tests/script/sh/prepare_pyudf.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set +e
+
+FILE=/usr/local/lib/libtaospyudf.so
+if [ ! -f "$FILE" ]; then
+ echo "$FILE does not exist."
+ apt install -y python3 python3-dev python3-venv
+ /usr/bin/python3 -m venv /udfenv
+ source /udfenv/bin/activate
+ pip3 install taospyudf
+ ldconfig
+ deactivate
+else
+ echo "show dependencies of $FILE"
+ ldd $FILE
+fi
diff --git a/tests/script/sh/pybitand.py b/tests/script/sh/pybitand.py
new file mode 100644
index 0000000000000000000000000000000000000000..1df724794ec20c6a133f3800046c897c722a173e
--- /dev/null
+++ b/tests/script/sh/pybitand.py
@@ -0,0 +1,21 @@
+def init():
+ pass
+
+def process(block):
+ (rows, cols) = block.shape()
+ result = []
+ for i in range(rows):
+ r = 2 ** 32 - 1
+ for j in range(cols):
+ cell = block.data(i,j)
+ if cell is None:
+ result.append(None)
+ break
+ else:
+ r = r & cell
+ else:
+ result.append(r)
+ return result
+
+def destroy():
+ pass
diff --git a/tests/script/sh/pyl2norm.py b/tests/script/sh/pyl2norm.py
new file mode 100644
index 0000000000000000000000000000000000000000..105f546b7d186f466f4fcad5eca38ecf5ff7b5e1
--- /dev/null
+++ b/tests/script/sh/pyl2norm.py
@@ -0,0 +1,27 @@
+import json
+import math
+
+def init():
+ pass
+
+def destroy():
+ pass
+
+def start():
+ return json.dumps(0.0).encode('utf-8')
+
+def finish(buf):
+ sum_squares = json.loads(buf)
+ result = math.sqrt(sum_squares)
+ return result
+
+def reduce(datablock, buf):
+ (rows, cols) = datablock.shape()
+ sum_squares = json.loads(buf)
+
+ for i in range(rows):
+ for j in range(cols):
+ cell = datablock.data(i,j)
+ if cell is not None:
+ sum_squares += cell * cell
+ return json.dumps(sum_squares).encode('utf-8')
diff --git a/tests/script/test-win.bat b/tests/script/test-win.bat
new file mode 100644
index 0000000000000000000000000000000000000000..66bef2008d168c4a2286a8068d4d196230164fc9
--- /dev/null
+++ b/tests/script/test-win.bat
@@ -0,0 +1,67 @@
+@echo off
+SETLOCAL EnableDelayedExpansion
+for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( set "DEL=%%a")
+set /a a=0
+echo Windows Taosd Full Test
+set /a exitNum=0
+rm -rf failed.txt
+set caseFile="win-test-file"
+if not "%2" == "" (
+ set caseFile="%2"
+)
+for /F "usebackq tokens=*" %%i in (!caseFile!) do (
+ set line=%%i
+ call :CheckSkipCase %%i
+ if !skipCase! == false (
+ if "!line:~,9!" == "./test.sh" (
+ set /a a+=1
+ echo !a! Processing %%i
+ call :GetTimeSeconds !time!
+ set time1=!_timeTemp!
+ echo Start at !time!
+ call !line:./test.sh=wtest.bat! > result_!a!.txt 2>error_!a!.txt || set /a errorlevel=8
+ if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && set /a exitNum=8 && echo %%i >>failed.txt ) else ( call :colorEcho 0a "Success" &echo. )
+ )
+ )
+)
+exit /b !exitNum!
+
+:colorEcho
+set timeNow=%time%
+call :GetTimeSeconds %timeNow%
+set time2=%_timeTemp%
+set /a interTime=%time2% - %time1%
+echo End at %timeNow% , cast %interTime%s
+echo off
+ "%~2"
+findstr /v /a:%1 /R "^$" "%~2" nul
+del "%~2" > nul 2>&1i
+goto :eof
+
+:GetTimeSeconds
+set tt=%1
+set tt=%tt:.= %
+set tt=%tt::= %
+set tt=%tt: 0= %
+set /a index=1
+for %%a in (%tt%) do (
+ if !index! EQU 1 (
+ set /a hh=%%a
+ )^
+ else if !index! EQU 2 (
+ set /a mm=%%a
+
+ )^
+ else if !index! EQU 3 (
+ set /a ss=%%a
+ )
+ set /a index=index+1
+)
+set /a _timeTemp=(%hh%*60+%mm%)*60+%ss%
+goto :eof
+
+:CheckSkipCase
+set skipCase=false
+@REM if "%*" == "./test.sh -f tsim/query/scalarFunction.sim" ( set skipCase=true )
+echo %* | grep valgrind && set skipCase=true
+:goto eof
\ No newline at end of file
diff --git a/tests/script/tsim/dnode/drop_dnode_force.sim b/tests/script/tsim/dnode/drop_dnode_force.sim
index 425e5f48b2f278f3ef2f2bad51b25f81b8133fc2..bce51a98887dd4aa9bfe6a4bb444424fdf8b006d 100644
--- a/tests/script/tsim/dnode/drop_dnode_force.sim
+++ b/tests/script/tsim/dnode/drop_dnode_force.sim
@@ -50,6 +50,21 @@ endi
print =============== step2 create database
sql create database d1 vgroups 1 replica 3
sql use d1
+
+$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 create table d1.st0 (ts timestamp, i int) tags (j int)
sql create table d1.c0 using st0 tags(0)
sql create table d1.c1 using st0 tags(1)
diff --git a/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim b/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
index 0fa7320ff6cd515452748c6c81e82011eb4f8dcb..ef5001dcee28012ca40d2d09cd933b1e5ee1ec34 100644
--- a/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
+++ b/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
@@ -170,6 +170,20 @@ if $leaderExist != 1 then
goto step35
endi
+$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
+
print =============== step36: create table
sql use d1
sql create table d1.st (ts timestamp, i int) tags (j int)
diff --git a/tests/script/tsim/query/udf.sim b/tests/script/tsim/query/udf.sim
index 0b48a815e21900c4a80e3ea883e6b95f26bcf695..e539f115317abcd2b64279ec476f8f3464a559d5 100644
--- a/tests/script/tsim/query/udf.sim
+++ b/tests/script/tsim/query/udf.sim
@@ -23,12 +23,15 @@ if $system_content == Windows_NT then
return 0;
endi
if $system_content == Windows_NT then
- sql create function bit_and as 'C:\\Windows\\Temp\\bitand.dll' outputtype int bufSize 8;
+ sql create function bit_and as 'C:\\Windows\\Temp\\bitand.dll' outputtype int;
sql create aggregate function l2norm as 'C:\\Windows\\Temp\\l2norm.dll' outputtype double bufSize 8;
else
- sql create function bit_and as '/tmp/udf/libbitand.so' outputtype int bufSize 8;
+ sql create function bit_and as '/tmp/udf/libbitand.so' outputtype int;
sql create aggregate function l2norm as '/tmp/udf/libl2norm.so' outputtype double bufSize 8;
endi
+
+sql_error create function bit_and as '/tmp/udf/libbitand.so' oputtype json;
+
sql show functions;
if $rows != 2 then
return -1
diff --git a/tests/script/tsim/query/udf_with_const.sim b/tests/script/tsim/query/udf_with_const.sim
index 7a2a3389bd155e1c384823ce94c3fdd96b14139e..4a12dd68682a1afe39bf31be1b5b249d2433ee72 100644
--- a/tests/script/tsim/query/udf_with_const.sim
+++ b/tests/script/tsim/query/udf_with_const.sim
@@ -23,9 +23,9 @@ if $system_content == Windows_NT then
endi
if $system_content == Windows_NT then
- sql create function gpd as 'C:\\Windows\\Temp\\gpd.dll' outputtype int bufSize 8;
+ sql create function gpd as 'C:\\Windows\\Temp\\gpd.dll' outputtype int;
else
- sql create function gpd as '/tmp/udf/libgpd.so' outputtype int bufSize 8;
+ sql create function gpd as '/tmp/udf/libgpd.so' outputtype int;
endi
sql show functions;
if $rows != 1 then
diff --git a/tests/script/tsim/query/udfpy.sim b/tests/script/tsim/query/udfpy.sim
new file mode 100644
index 0000000000000000000000000000000000000000..025df7984be1f199d336e3041421f5960d3a3097
--- /dev/null
+++ b/tests/script/tsim/query/udfpy.sim
@@ -0,0 +1,298 @@
+system_content printf %OS%
+if $system_content == Windows_NT then
+ return 0;
+endi
+
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/cfg.sh -n dnode1 -c udf -v 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+print ======== step1 udf
+system sh/compile_udf.sh
+system sh/prepare_pyudf.sh
+system mkdir -p /tmp/pyudf
+system cp sh/pybitand.py /tmp/pyudf/
+system cp sh/pyl2norm.py /tmp/pyudf/
+system ls /tmp/pyudf
+
+sql create database udf vgroups 3;
+sql use udf;
+sql select * from information_schema.ins_databases;
+
+sql create table t (ts timestamp, f int);
+sql insert into t values(now, 1)(now+1s, 2);
+
+system_content printf %OS%
+if $system_content == Windows_NT then
+ return 0;
+endi
+if $system_content == Windows_NT then
+ sql create function bit_and as 'C:\\Windows\\Temp\\bitand.dll' outputtype int;
+ sql create aggregate function l2norm as 'C:\\Windows\\Temp\\l2norm.dll' outputtype double bufSize 8;
+else
+ sql create function bit_and as '/tmp/udf/libbitand.so' outputtype int;
+ sql create aggregate function l2norm as '/tmp/udf/libl2norm.so' outputtype double bufSize 8;
+endi
+sql create function pybitand as '/tmp/pyudf/pybitand.py' outputtype int language 'python';
+sql create aggregate function pyl2norm as '/tmp/pyudf/pyl2norm.py' outputtype double bufSize 128 language 'python';
+
+sql show functions;
+if $rows != 4 then
+ return -1
+endi
+
+sql select func_language, func_body,name from information_schema.ins_functions order by name
+if $rows != 4 then
+ return -1
+endi
+
+if $data00 != @C@ then
+ return -1
+endi
+if $data10 != @C@ then
+ return -1
+endi
+if $data20 != @Python@ then
+ return -1
+endi
+if $data30 != @Python@ then
+ return -1
+endi
+
+sql select bit_and(f, f) from t;
+if $rows != 2 then
+ return -1
+endi
+if $data00 != 1 then
+ return -1
+endi
+if $data10 != 2 then
+ return -1
+endi
+
+sql select pybitand(f, f) from t;
+if $rows != 2 then
+ return -1
+endi
+if $data00 != 1 then
+ return -1
+endi
+if $data10 != 2 then
+ return -1
+endi
+
+sql select l2norm(f) from t;
+if $rows != 1 then
+ print expect 1, actual $rows
+ return -1
+endi
+if $data00 != 2.236067977 then
+ return -1
+endi
+
+sql select pyl2norm(f) from t;
+if $rows != 1 then
+ print expect 1, actual $rows
+ return -1
+endi
+if $data00 != 2.236067977 then
+ return -1
+endi
+
+sql create table t2 (ts timestamp, f1 int, f2 int);
+sql insert into t2 values(now, 0, 0)(now+1s, 1, 1);
+sql select bit_and(f1, f2) from t2;
+if $rows != 2 then
+ return -1
+endi
+if $data00 != 0 then
+ return -1
+endi
+if $data10 != 1 then
+ return -1
+endi
+
+sql select l2norm(f1, f2) from t2;
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 1.414213562 then
+ return -1
+endi
+
+sql select pybitand(f1, f2) from t2;
+if $rows != 2 then
+ return -1
+endi
+if $data00 != 0 then
+ return -1
+endi
+if $data10 != 1 then
+ return -1
+endi
+
+sql select pyl2norm(f1, f2) from t2;
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 1.414213562 then
+ return -1
+endi
+
+sql insert into t2 values(now+2s, 1, null)(now+3s, null, 2);
+sql select bit_and(f1, f2) from t2;
+print $rows , $data00 , $data10 , $data20 , $data30
+if $rows != 4 then
+ return -1
+endi
+if $data00 != 0 then
+ return -1
+endi
+if $data10 != 1 then
+ return -1
+endi
+
+if $data20 != NULL then
+ return -1
+endi
+
+if $data30 != NULL then
+ return -1
+endi
+
+sql select l2norm(f1, f2) from t2;
+print $rows, $data00
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 2.645751311 then
+ return -1
+endi
+
+sql select pybitand(f1, f2) from t2;
+print $rows , $data00 , $data10 , $data20 , $data30
+if $rows != 4 then
+ return -1
+endi
+if $data00 != 0 then
+ return -1
+endi
+if $data10 != 1 then
+ return -1
+endi
+
+if $data20 != NULL then
+ return -1
+endi
+
+if $data30 != NULL then
+ return -1
+endi
+
+sql select pyl2norm(f1, f2) from t2;
+print $rows, $data00
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 2.645751311 then
+ return -1
+endi
+
+
+sql insert into t2 values(now+4s, 4, 8)(now+5s, 5, 9);
+sql select l2norm(f1-f2), l2norm(f1+f2) from t2;
+print $rows , $data00 , $data01
+if $rows != 1 then
+ return -1;
+endi
+if $data00 != 5.656854249 then
+ return -1
+endi
+if $data01 != 18.547236991 then
+ return -1
+endi
+
+sql select l2norm(bit_and(f2, f1)), l2norm(bit_and(f1, f2)) from t2;
+print $rows , $data00 , $data01
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 1.414213562 then
+ return -1
+endi
+if $data01 != 1.414213562 then
+ return -1
+endi
+
+sql select l2norm(f2) from udf.t2 group by 1-bit_and(f1, f2) order by 1-bit_and(f1,f2);
+print $rows , $data00 , $data10 , $data20
+if $rows != 3 then
+ return -1
+endi
+if $data00 != 2.000000000 then
+ return -1
+endi
+if $data10 != 9.055385138 then
+ return -1
+endi
+if $data20 != 8.000000000 then
+ return -1
+endi
+
+sql select pyl2norm(f1-f2), pyl2norm(f1+f2) from t2;
+print $rows , $data00 , $data01
+if $rows != 1 then
+ return -1;
+endi
+if $data00 != 5.656854249 then
+ return -1
+endi
+if $data01 != 18.547236991 then
+ return -1
+endi
+
+sql select pyl2norm(pybitand(f2, f1)), pyl2norm(pybitand(f1, f2)) from t2;
+print $rows , $data00 , $data01
+if $rows != 1 then
+ return -1
+endi
+if $data00 != 1.414213562 then
+ return -1
+endi
+if $data01 != 1.414213562 then
+ return -1
+endi
+
+sql select pyl2norm(f2) from udf.t2 group by 1-pybitand(f1, f2) order by 1-pybitand(f1,f2);
+print $rows , $data00 , $data10 , $data20
+if $rows != 3 then
+ return -1
+endi
+if $data00 != 2.000000000 then
+ return -1
+endi
+if $data10 != 9.055385138 then
+ return -1
+endi
+if $data20 != 8.000000000 then
+ return -1
+endi
+
+
+#sql drop function bit_and;
+#sql show functions;
+#if $rows != 1 then
+# return -1
+#endi
+#if $data00 != @l2norm@ then
+# return -1
+# endi
+#sql drop function l2norm;
+#sql show functions;
+#if $rows != 0 then
+# return -1
+#endi
+
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/sync/3Replica1VgElect.sim b/tests/script/tsim/sync/3Replica1VgElect.sim
index f069ff40e597df927d7162d5d628a7d8a50a23ca..aae1b25636b46a738096b93f8325e2d6f8a1306c 100644
--- a/tests/script/tsim/sync/3Replica1VgElect.sim
+++ b/tests/script/tsim/sync/3Replica1VgElect.sim
@@ -55,7 +55,7 @@ $loop_cnt = 0
check_db_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
-if $loop_cnt == 100 then
+if $loop_cnt == 500 then
print ====> db not ready!
return -1
endi
diff --git a/tests/script/tsim/tagindex/add_index.sim b/tests/script/tsim/tagindex/add_index.sim
index 4e883ef150772ec4de1a2651261caedb334db484..cfbec905426a64547c8695905af0986be668d586 100644
--- a/tests/script/tsim/tagindex/add_index.sim
+++ b/tests/script/tsim/tagindex/add_index.sim
@@ -7,7 +7,7 @@ print ======== step0
$dbPrefix = ta_3_db
$tbPrefix = ta_3_tb
$mtPrefix = ta_3_mt
-$tbNum = 100
+$tbNum = 500
$rowNum = 20
$totalNum = 200
@@ -26,9 +26,10 @@ endi
print =============== create child table
$i = 0
+$val = 1
while $i < $tbNum
$tb = $tbPrefix . $i
- sql create table $tb using $mtPrefix tags( $i , $i , $i , $i , $i );
+ sql create table $tb using $mtPrefix tags( $i , $i , $i , $i , $val );
$i = $i + 1
endw
@@ -49,6 +50,7 @@ endw
sql create index ti2 on $mtPrefix (t2)
+sql create index ti5 on $mtPrefix (t5)
print ==== test name conflict
#
@@ -120,6 +122,53 @@ while $i < $tbNum
$i = $i + 1
endw
+
+
+# test special boundary condtion
+print ===== test operator low on ti5
+# great equal than
+sql select * from $mtPrefix where t5 < 0 ;
+if $rows != 0 then
+ return -1
+endi
+
+print ===== test operator lower equal on ti5
+# great equal than
+sql select * from $mtPrefix where t5 <= $val ;
+if $rows != $tbNum then
+ return -1
+endi
+
+print ===== test operator equal on ti5
+# great equal than
+sql select * from $mtPrefix where t5 = $val ;
+if $rows != $tbNum then
+ return -1
+endi
+
+print ===== test operator great equal on ti5
+# great equal than
+sql select * from $mtPrefix where t5 >= $val ;
+if $rows != $tbNum then
+ return -1
+endi
+
+print ===== test operator great than on ti5
+# great equal than
+sql select * from $mtPrefix where t5 > $val ;
+if $rows != 0 then
+ return -1
+endi
+
+print ===== test operator great on ti5
+# great equal than
+sql select * from $mtPrefix where t5 > $val + 1 ;
+if $rows != 0 then
+ return -1
+endi
+
+sql drop index ti5
+
print ===== add table after index created
$interval = $tbNum + $tbNum
$i = $interval
@@ -130,8 +179,6 @@ while $i < $limit
$i = $i + 1
endw
-
-
print ===== add table after index created (opeator great equal than)
# great equal than
$i = $interval
diff --git a/tests/script/tsim/tmq/basic1.sim b/tests/script/tsim/tmq/basic1.sim
index 6880f290f5fda796cbf5b90f98cf5d40c1976eff..b296290214d223a54153e27ee6e1386fc7722541 100644
--- a/tests/script/tsim/tmq/basic1.sim
+++ b/tests/script/tsim/tmq/basic1.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -155,6 +161,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -226,6 +235,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic1Of2Cons.sim b/tests/script/tsim/tmq/basic1Of2Cons.sim
index 11b645c4d1a008dc82af07999b86ce32c5484947..4c966c370e9bc57c4eb453f72234d027de972576 100644
--- a/tests/script/tsim/tmq/basic1Of2Cons.sim
+++ b/tests/script/tsim/tmq/basic1Of2Cons.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for stb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -186,6 +192,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -288,6 +297,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic2.sim b/tests/script/tsim/tmq/basic2.sim
index dce73be592e459264916f67b4390141115c05bc8..6d49b46c854678930a30e88a23720faa2e6c1844 100644
--- a/tests/script/tsim/tmq/basic2.sim
+++ b/tests/script/tsim/tmq/basic2.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -118,6 +121,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -175,6 +181,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic2Of2Cons.sim b/tests/script/tsim/tmq/basic2Of2Cons.sim
index 87559305ba19cb30b7c8f7928a1437f3246cc139..db660a0c93be23b2b42fc118f522b7944b5f4649 100644
--- a/tests/script/tsim/tmq/basic2Of2Cons.sim
+++ b/tests/script/tsim/tmq/basic2Of2Cons.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -147,6 +150,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -234,6 +240,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim b/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
index dda5e0059e5c760925e7944b13089b1d3897c0f8..54e10126f1bd2827ce219a7f8d5cfc1511b6ed88 100644
--- a/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
+++ b/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -168,6 +171,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -259,6 +265,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic3.sim b/tests/script/tsim/tmq/basic3.sim
index 8d677766d74371209e53bab94b62a524318146ee..1e95fa90a5bf603a2afc1f2fd90ee9e3f6dacdfd 100644
--- a/tests/script/tsim/tmq/basic3.sim
+++ b/tests/script/tsim/tmq/basic3.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -154,6 +160,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -225,6 +234,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic3Of2Cons.sim b/tests/script/tsim/tmq/basic3Of2Cons.sim
index 4921c86c4574174b06af4d906b9a3e74e8ee9c3c..be0292c57b23be1bf2342f50229076c90ebc4ead 100644
--- a/tests/script/tsim/tmq/basic3Of2Cons.sim
+++ b/tests/script/tsim/tmq/basic3Of2Cons.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -82,6 +85,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -197,6 +203,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -299,6 +308,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic4.sim b/tests/script/tsim/tmq/basic4.sim
index 9b418f12f2b95410994cf52fd4e140a8dcc73889..33a66628d0b3871740754d15225477015eb8e055 100644
--- a/tests/script/tsim/tmq/basic4.sim
+++ b/tests/script/tsim/tmq/basic4.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -115,6 +118,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -172,6 +178,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/basic4Of2Cons.sim b/tests/script/tsim/tmq/basic4Of2Cons.sim
index f1755f732baa365689653d83e117d2780c40f621..fdee3f633e0a887c650f5ee67ae699c8642b537d 100644
--- a/tests/script/tsim/tmq/basic4Of2Cons.sim
+++ b/tests/script/tsim/tmq/basic4Of2Cons.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -156,6 +159,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -244,6 +250,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/snapshot.sim b/tests/script/tsim/tmq/snapshot.sim
index de0468e6f26871cc4b5118889a0fcd1262c291e4..81fff3522499ff99ccfa9a92be5483ea42d775ba 100644
--- a/tests/script/tsim/tmq/snapshot.sim
+++ b/tests/script/tsim/tmq/snapshot.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -83,6 +86,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -152,6 +158,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -223,6 +232,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/snapshot1.sim b/tests/script/tsim/tmq/snapshot1.sim
index e586719db2fa7646d487658d09e71693ff557c7a..c79892ae1d943a071c58fe2236eb90ef9a5e10d4 100644
--- a/tests/script/tsim/tmq/snapshot1.sim
+++ b/tests/script/tsim/tmq/snapshot1.sim
@@ -34,6 +34,9 @@ $showRow = 0
sql connect
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
+
print == create topics from super table
sql create topic topic_stb_column as select ts, c3 from stb
sql create topic topic_stb_all as select ts, c1, c2, c3 from stb
@@ -147,6 +150,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ctb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
@@ -224,6 +230,9 @@ sql create database $cdbName vgroups 1
sleep 500
sql use $cdbName
+print == alter database
+sql alter database $cdbName wal_retention_period 3600
+
print == create consume info table and consume result table for ntb
sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int)
sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int)
diff --git a/tests/script/tsim/tmq/topic.sim b/tests/script/tsim/tmq/topic.sim
index cb1e74798ea072a03d2ea2570a5a245222b5c8c5..0bf0873e9f0513b08b6868bed220c5e3d74072f9 100644
--- a/tests/script/tsim/tmq/topic.sim
+++ b/tests/script/tsim/tmq/topic.sim
@@ -39,6 +39,8 @@ endi
sql use $dbName
+print == alter database
+sql alter database $dbName wal_retention_period 3600
print == create super table
sql create table $stbPrefix (ts timestamp, c1 int, c2 float, c3 binary(16)) tags (t1 int)
diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim
index b708fdab64c1931d6a86c67a8f3ec86cb880677a..50eaa1210866dcfb98f0c889a5eef9960d2faf81 100644
--- a/tests/script/tsim/user/privilege_db.sim
+++ b/tests/script/tsim/user/privilege_db.sim
@@ -4,13 +4,13 @@ system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create db
-sql create database d1 vgroups 1;
+sql create database d1 vgroups 1 wal_retention_period 3600;
sql use d1
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;
+sql create database d2 vgroups 1 wal_retention_period 3600;
+sql create database d3 vgroups 1 wal_retention_period 3600;
sql select * from information_schema.ins_databases
if $rows != 5 then
return -1
diff --git a/tests/script/tsim/user/privilege_topic.sim b/tests/script/tsim/user/privilege_topic.sim
index 9ce5bebec3d68761fb5364896f81e4a5e1428878..9d096a97807a70dfe34297c7fac688502b236a5a 100644
--- a/tests/script/tsim/user/privilege_topic.sim
+++ b/tests/script/tsim/user/privilege_topic.sim
@@ -4,9 +4,9 @@ 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 create database root_d1 vgroups 1 wal_retention_period 3600;
+sql create database root_d2 vgroups 1 wal_retention_period 3600;
+sql create database root_d3 vgroups 1 wal_retention_period 3600;
sql show user privileges
if $rows != 1 then
diff --git a/tests/script/tsim/valgrind/checkUdf.sim b/tests/script/tsim/valgrind/checkUdf.sim
index caf316bd868a057cd8a161817c85d8664a9db82e..dc703e155d3bacf2ed17648c0020192f5bf77eab 100644
--- a/tests/script/tsim/valgrind/checkUdf.sim
+++ b/tests/script/tsim/valgrind/checkUdf.sim
@@ -15,10 +15,10 @@ sql insert into t values(now, 1)(now+1s, 2);
system_content printf %OS%
if $system_content == Windows_NT then
- sql create function udf1 as 'C:\\Windows\\Temp\\udf1.dll' outputtype int bufSize 8;
+ sql create function udf1 as 'C:\\Windows\\Temp\\udf1.dll' outputtype int;
sql create aggregate function udf2 as 'C:\\Windows\\Temp\\udf2.dll' outputtype double bufSize 8;
else
- sql create function udf1 as '/tmp/udf/libudf1.so' outputtype int bufSize 8;
+ sql create function udf1 as '/tmp/udf/libudf1.so' outputtype int;
sql create aggregate function udf2 as '/tmp/udf/libudf2.so' outputtype double bufSize 8;
endi
sql show functions;
diff --git a/tests/script/win-test-file b/tests/script/win-test-file
new file mode 100644
index 0000000000000000000000000000000000000000..2d5a1b3108efb2b884bf7664ff61557f09d2bca5
--- /dev/null
+++ b/tests/script/win-test-file
@@ -0,0 +1,402 @@
+./test.sh -f tsim/user/basic.sim
+./test.sh -f tsim/user/password.sim
+./test.sh -f tsim/user/privilege_db.sim
+./test.sh -f tsim/user/privilege_sysinfo.sim
+./test.sh -f tsim/user/privilege_topic.sim
+./test.sh -f tsim/db/alter_option.sim
+rem ./test.sh -f tsim/db/alter_replica_13.sim
+./test.sh -f tsim/db/alter_replica_31.sim
+./test.sh -f tsim/db/basic1.sim
+./test.sh -f tsim/db/basic2.sim
+./test.sh -f tsim/db/basic3.sim
+./test.sh -f tsim/db/basic4.sim
+./test.sh -f tsim/db/basic5.sim
+./test.sh -f tsim/db/basic6.sim
+./test.sh -f tsim/db/commit.sim
+./test.sh -f tsim/db/create_all_options.sim
+./test.sh -f tsim/db/delete_reuse1.sim
+./test.sh -f tsim/db/delete_reuse2.sim
+./test.sh -f tsim/db/delete_reusevnode.sim
+./test.sh -f tsim/db/delete_reusevnode2.sim
+./test.sh -f tsim/db/delete_writing1.sim
+./test.sh -f tsim/db/delete_writing2.sim
+./test.sh -f tsim/db/error1.sim
+./test.sh -f tsim/db/keep.sim
+./test.sh -f tsim/db/len.sim
+./test.sh -f tsim/db/repeat.sim
+./test.sh -f tsim/db/show_create_db.sim
+./test.sh -f tsim/db/show_create_table.sim
+./test.sh -f tsim/db/tables.sim
+./test.sh -f tsim/db/taosdlog.sim
+./test.sh -f tsim/dnode/balance_replica1.sim
+./test.sh -f tsim/dnode/balance_replica3.sim
+./test.sh -f tsim/dnode/balance1.sim
+./test.sh -f tsim/dnode/balance2.sim
+./test.sh -f tsim/dnode/balance3.sim
+./test.sh -f tsim/dnode/balancex.sim
+./test.sh -f tsim/dnode/create_dnode.sim
+./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim
+./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim
+./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim
+./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim
+./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim
+./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
+./test.sh -f tsim/dnode/drop_dnode_force.sim
+./test.sh -f tsim/dnode/offline_reason.sim
+./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim
+./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
+./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
+./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim
+./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim
+./test.sh -f tsim/dnode/vnode_clean.sim
+./test.sh -f tsim/dnode/use_dropped_dnode.sim
+./test.sh -f tsim/dnode/split_vgroup_replica1.sim
+./test.sh -f tsim/dnode/split_vgroup_replica3.sim
+./test.sh -f tsim/import/basic.sim
+./test.sh -f tsim/import/commit.sim
+./test.sh -f tsim/import/large.sim
+./test.sh -f tsim/import/replica1.sim
+./test.sh -f tsim/insert/backquote.sim
+./test.sh -f tsim/insert/basic.sim
+./test.sh -f tsim/insert/basic0.sim
+./test.sh -f tsim/insert/basic1.sim
+./test.sh -f tsim/insert/basic2.sim
+./test.sh -f tsim/insert/commit-merge0.sim
+./test.sh -f tsim/insert/insert_drop.sim
+./test.sh -f tsim/insert/insert_select.sim
+./test.sh -f tsim/insert/null.sim
+./test.sh -f tsim/insert/query_block1_file.sim
+./test.sh -f tsim/insert/query_block1_memory.sim
+./test.sh -f tsim/insert/query_block2_file.sim
+./test.sh -f tsim/insert/query_block2_memory.sim
+./test.sh -f tsim/insert/query_file_memory.sim
+./test.sh -f tsim/insert/query_multi_file.sim
+./test.sh -f tsim/insert/tcp.sim
+./test.sh -f tsim/insert/update0.sim
+./test.sh -f tsim/insert/update1_sort_merge.sim
+./test.sh -f tsim/insert/update2.sim
+./test.sh -f tsim/parser/alter__for_community_version.sim
+./test.sh -f tsim/parser/alter_column.sim
+./test.sh -f tsim/parser/alter_stable.sim
+./test.sh -f tsim/parser/alter.sim
+./test.sh -f tsim/parser/alter1.sim
+./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim
+./test.sh -f tsim/parser/auto_create_tb.sim
+./test.sh -f tsim/parser/between_and.sim
+./test.sh -f tsim/parser/binary_escapeCharacter.sim
+./test.sh -f tsim/parser/col_arithmetic_operation.sim
+./test.sh -f tsim/parser/columnValue_bigint.sim
+./test.sh -f tsim/parser/columnValue_bool.sim
+./test.sh -f tsim/parser/columnValue_double.sim
+./test.sh -f tsim/parser/columnValue_float.sim
+./test.sh -f tsim/parser/columnValue_int.sim
+./test.sh -f tsim/parser/columnValue_smallint.sim
+./test.sh -f tsim/parser/columnValue_tinyint.sim
+./test.sh -f tsim/parser/columnValue_unsign.sim
+./test.sh -f tsim/parser/commit.sim
+./test.sh -f tsim/parser/condition.sim
+./test.sh -f tsim/parser/constCol.sim
+./test.sh -f tsim/parser/create_db.sim
+./test.sh -f tsim/parser/create_mt.sim
+./test.sh -f tsim/parser/create_tb_with_tag_name.sim
+./test.sh -f tsim/parser/create_tb.sim
+./test.sh -f tsim/parser/dbtbnameValidate.sim
+./test.sh -f tsim/parser/distinct.sim
+./test.sh -f tsim/parser/fill_us.sim
+./test.sh -f tsim/parser/fill.sim
+./test.sh -f tsim/parser/first_last.sim
+./test.sh -f tsim/parser/fill_stb.sim
+./test.sh -f tsim/parser/interp.sim
+./test.sh -f tsim/parser/fourArithmetic-basic.sim
+./test.sh -f tsim/parser/function.sim
+./test.sh -f tsim/parser/groupby-basic.sim
+./test.sh -f tsim/parser/groupby.sim
+./test.sh -f tsim/parser/having_child.sim
+./test.sh -f tsim/parser/having.sim
+./test.sh -f tsim/parser/import_commit1.sim
+./test.sh -f tsim/parser/import_commit2.sim
+./test.sh -f tsim/parser/import_commit3.sim
+./test.sh -f tsim/parser/import_file.sim
+./test.sh -f tsim/parser/import.sim
+./test.sh -f tsim/parser/insert_multiTbl.sim
+./test.sh -f tsim/parser/insert_tb.sim
+./test.sh -f tsim/parser/join_manyblocks.sim
+./test.sh -f tsim/parser/join_multitables.sim
+./test.sh -f tsim/parser/join_multivnode.sim
+./test.sh -f tsim/parser/join.sim
+./test.sh -f tsim/parser/last_cache.sim
+./test.sh -f tsim/parser/last_groupby.sim
+./test.sh -f tsim/parser/lastrow.sim
+./test.sh -f tsim/parser/lastrow2.sim
+./test.sh -f tsim/parser/like.sim
+./test.sh -f tsim/parser/limit.sim
+./test.sh -f tsim/parser/limit1.sim
+./test.sh -f tsim/parser/mixed_blocks.sim
+./test.sh -f tsim/parser/nchar.sim
+./test.sh -f tsim/parser/nestquery.sim
+./test.sh -f tsim/parser/null_char.sim
+./test.sh -f tsim/parser/precision_ns.sim
+./test.sh -f tsim/parser/projection_limit_offset.sim
+./test.sh -f tsim/parser/regex.sim
+./test.sh -f tsim/parser/regressiontest.sim
+./test.sh -f tsim/parser/select_across_vnodes.sim
+./test.sh -f tsim/parser/select_distinct_tag.sim
+./test.sh -f tsim/parser/select_from_cache_disk.sim
+./test.sh -f tsim/parser/select_with_tags.sim
+./test.sh -f tsim/parser/selectResNum.sim
+./test.sh -f tsim/parser/set_tag_vals.sim
+./test.sh -f tsim/parser/single_row_in_tb.sim
+./test.sh -f tsim/parser/sliding.sim
+./test.sh -f tsim/parser/slimit_alter_tags.sim
+./test.sh -f tsim/parser/slimit.sim
+./test.sh -f tsim/parser/slimit1.sim
+./test.sh -f tsim/parser/stableOp.sim
+./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
+./test.sh -f tsim/parser/tags_filter.sim
+./test.sh -f tsim/parser/tbnameIn.sim
+./test.sh -f tsim/parser/timestamp.sim
+./test.sh -f tsim/parser/top_groupby.sim
+./test.sh -f tsim/parser/topbot.sim
+./test.sh -f tsim/parser/union.sim
+./test.sh -f tsim/parser/union_sysinfo.sim
+./test.sh -f tsim/parser/where.sim
+./test.sh -f tsim/query/tagLikeFilter.sim
+./test.sh -f tsim/query/charScalarFunction.sim
+./test.sh -f tsim/query/explain.sim
+./test.sh -f tsim/query/interval-offset.sim
+./test.sh -f tsim/query/interval.sim
+./test.sh -f tsim/query/scalarFunction.sim
+./test.sh -f tsim/query/scalarNull.sim
+./test.sh -f tsim/query/session.sim
+./test.sh -f tsim/query/sys_tbname.sim
+./test.sh -f tsim/query/groupby.sim
+./test.sh -f tsim/query/event.sim
+./test.sh -f tsim/query/forceFill.sim
+./test.sh -f tsim/query/emptyTsRange.sim
+./test.sh -f tsim/query/partitionby.sim
+./test.sh -f tsim/qnode/basic1.sim
+./test.sh -f tsim/snode/basic1.sim
+./test.sh -f tsim/mnode/basic1.sim
+./test.sh -f tsim/mnode/basic2.sim
+./test.sh -f tsim/mnode/basic3.sim
+./test.sh -f tsim/mnode/basic4.sim
+./test.sh -f tsim/mnode/basic5.sim
+./test.sh -f tsim/show/basic.sim
+./test.sh -f tsim/table/autocreate.sim
+./test.sh -f tsim/table/basic1.sim
+./test.sh -f tsim/table/basic2.sim
+./test.sh -f tsim/table/basic3.sim
+./test.sh -f tsim/table/bigint.sim
+./test.sh -f tsim/table/binary.sim
+./test.sh -f tsim/table/bool.sim
+./test.sh -f tsim/table/column_name.sim
+./test.sh -f tsim/table/column_num.sim
+./test.sh -f tsim/table/column_value.sim
+./test.sh -f tsim/table/column2.sim
+./test.sh -f tsim/table/createmulti.sim
+./test.sh -f tsim/table/date.sim
+./test.sh -f tsim/table/db.table.sim
+./test.sh -f tsim/table/delete_reuse1.sim
+./test.sh -f tsim/table/delete_reuse2.sim
+./test.sh -f tsim/table/delete_writing.sim
+./test.sh -f tsim/table/describe.sim
+./test.sh -f tsim/table/double.sim
+./test.sh -f tsim/table/float.sim
+./test.sh -f tsim/table/hash.sim
+./test.sh -f tsim/table/int.sim
+./test.sh -f tsim/table/limit.sim
+./test.sh -f tsim/table/smallint.sim
+./test.sh -f tsim/table/table_len.sim
+./test.sh -f tsim/table/table.sim
+./test.sh -f tsim/table/tinyint.sim
+./test.sh -f tsim/table/vgroup.sim
+./test.sh -f tsim/stream/basic0.sim -g
+./test.sh -f tsim/stream/basic1.sim
+./test.sh -f tsim/stream/basic2.sim
+./test.sh -f tsim/stream/drop_stream.sim
+./test.sh -f tsim/stream/fillHistoryBasic1.sim
+./test.sh -f tsim/stream/fillHistoryBasic2.sim
+./test.sh -f tsim/stream/fillHistoryBasic3.sim
+./test.sh -f tsim/stream/distributeInterval0.sim
+./test.sh -f tsim/stream/distributeIntervalRetrive0.sim
+./test.sh -f tsim/stream/distributeSession0.sim
+./test.sh -f tsim/stream/session0.sim
+./test.sh -f tsim/stream/session1.sim
+./test.sh -f tsim/stream/state0.sim
+./test.sh -f tsim/stream/triggerInterval0.sim
+./test.sh -f tsim/stream/triggerSession0.sim
+./test.sh -f tsim/stream/partitionby.sim
+./test.sh -f tsim/stream/partitionby1.sim
+./test.sh -f tsim/stream/schedSnode.sim
+./test.sh -f tsim/stream/windowClose.sim
+./test.sh -f tsim/stream/ignoreExpiredData.sim
+./test.sh -f tsim/stream/sliding.sim
+./test.sh -f tsim/stream/partitionbyColumnInterval.sim
+./test.sh -f tsim/stream/partitionbyColumnSession.sim
+./test.sh -f tsim/stream/partitionbyColumnState.sim
+./test.sh -f tsim/stream/deleteInterval.sim
+./test.sh -f tsim/stream/deleteSession.sim
+./test.sh -f tsim/stream/deleteState.sim
+./test.sh -f tsim/stream/fillIntervalDelete0.sim
+./test.sh -f tsim/stream/fillIntervalDelete1.sim
+./test.sh -f tsim/stream/fillIntervalLinear.sim
+./test.sh -f tsim/stream/fillIntervalPartitionBy.sim
+./test.sh -f tsim/stream/fillIntervalPrevNext.sim
+./test.sh -f tsim/stream/fillIntervalValue.sim
+./test.sh -f tsim/stream/udTableAndTag0.sim
+./test.sh -f tsim/stream/udTableAndTag1.sim
+./test.sh -f tsim/trans/lossdata1.sim
+./test.sh -f tsim/trans/create_db.sim
+./test.sh -f tsim/tmq/basic1.sim
+./test.sh -f tsim/tmq/basic2.sim
+./test.sh -f tsim/tmq/basic3.sim
+./test.sh -f tsim/tmq/basic4.sim
+./test.sh -f tsim/tmq/basic1Of2Cons.sim
+./test.sh -f tsim/tmq/basic2Of2Cons.sim
+./test.sh -f tsim/tmq/basic3Of2Cons.sim
+./test.sh -f tsim/tmq/basic4Of2Cons.sim
+./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim
+./test.sh -f tsim/tmq/topic.sim
+./test.sh -f tsim/tmq/snapshot.sim
+./test.sh -f tsim/tmq/snapshot1.sim
+./test.sh -f tsim/stable/alter_comment.sim
+./test.sh -f tsim/stable/alter_count.sim
+./test.sh -f tsim/stable/alter_import.sim
+./test.sh -f tsim/stable/alter_insert1.sim
+./test.sh -f tsim/stable/alter_insert2.sim
+./test.sh -f tsim/stable/alter_metrics.sim
+./test.sh -f tsim/stable/column_add.sim
+./test.sh -f tsim/stable/column_drop.sim
+./test.sh -f tsim/stable/column_modify.sim
+./test.sh -f tsim/stable/disk.sim
+./test.sh -f tsim/stable/dnode3.sim
+./test.sh -f tsim/stable/metrics.sim
+./test.sh -f tsim/stable/refcount.sim
+./test.sh -f tsim/stable/tag_add.sim
+./test.sh -f tsim/stable/tag_drop.sim
+./test.sh -f tsim/stable/tag_filter.sim
+./test.sh -f tsim/stable/tag_modify.sim
+./test.sh -f tsim/stable/tag_rename.sim
+./test.sh -f tsim/stable/values.sim
+./test.sh -f tsim/stable/vnode3.sim
+./test.sh -f tsim/stable/metrics_idx.sim
+./test.sh -f tsim/sma/drop_sma.sim
+./test.sh -f tsim/sma/sma_leak.sim
+./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim
+./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim
+./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim
+./test.sh -f tsim/valgrind/checkError1.sim
+./test.sh -f tsim/valgrind/checkError2.sim
+./test.sh -f tsim/valgrind/checkError3.sim
+./test.sh -f tsim/valgrind/checkError4.sim
+./test.sh -f tsim/valgrind/checkError5.sim
+./test.sh -f tsim/valgrind/checkError6.sim
+./test.sh -f tsim/valgrind/checkError7.sim
+./test.sh -f tsim/valgrind/checkError8.sim
+./test.sh -f tsim/vnode/replica3_basic.sim
+./test.sh -f tsim/vnode/replica3_repeat.sim
+./test.sh -f tsim/vnode/replica3_vgroup.sim
+./test.sh -f tsim/vnode/replica3_many.sim
+./test.sh -f tsim/vnode/replica3_import.sim
+./test.sh -f tsim/vnode/stable_balance_replica1.sim
+./test.sh -f tsim/vnode/stable_dnode2_stop.sim
+./test.sh -f tsim/vnode/stable_dnode2.sim
+./test.sh -f tsim/vnode/stable_dnode3.sim
+./test.sh -f tsim/vnode/stable_replica3_dnode6.sim
+./test.sh -f tsim/vnode/stable_replica3_vnode3.sim
+./test.sh -f tsim/sync/3Replica1VgElect.sim
+./test.sh -f tsim/sync/3Replica5VgElect.sim
+./test.sh -f tsim/sync/oneReplica1VgElect.sim
+./test.sh -f tsim/sync/oneReplica5VgElect.sim
+./test.sh -f tsim/catalog/alterInCurrent.sim
+./test.sh -f tsim/scalar/in.sim
+./test.sh -f tsim/scalar/scalar.sim
+./test.sh -f tsim/scalar/filter.sim
+./test.sh -f tsim/scalar/caseWhen.sim
+./test.sh -f tsim/scalar/tsConvert.sim
+./test.sh -f tsim/alter/cached_schema_after_alter.sim
+./test.sh -f tsim/alter/dnode.sim
+./test.sh -f tsim/alter/table.sim
+./test.sh -f tsim/cache/new_metrics.sim
+./test.sh -f tsim/cache/restart_table.sim
+./test.sh -f tsim/cache/restart_metrics.sim
+./test.sh -f tsim/column/commit.sim
+./test.sh -f tsim/column/metrics.sim
+./test.sh -f tsim/column/table.sim
+./test.sh -f tsim/compress/commitlog.sim
+./test.sh -f tsim/compress/compress2.sim
+./test.sh -f tsim/compress/compress.sim
+./test.sh -f tsim/compress/uncompress.sim
+./test.sh -f tsim/compute/avg.sim
+./test.sh -f tsim/compute/block_dist.sim
+./test.sh -f tsim/compute/bottom.sim
+./test.sh -f tsim/compute/count.sim
+./test.sh -f tsim/compute/diff.sim
+./test.sh -f tsim/compute/diff2.sim
+./test.sh -f tsim/compute/first.sim
+./test.sh -f tsim/compute/interval.sim
+./test.sh -f tsim/compute/last_row.sim
+./test.sh -f tsim/compute/last.sim
+./test.sh -f tsim/compute/leastsquare.sim
+./test.sh -f tsim/compute/max.sim
+./test.sh -f tsim/compute/min.sim
+./test.sh -f tsim/compute/null.sim
+./test.sh -f tsim/compute/percentile.sim
+./test.sh -f tsim/compute/stddev.sim
+./test.sh -f tsim/compute/sum.sim
+./test.sh -f tsim/compute/top.sim
+./test.sh -f tsim/field/2.sim
+./test.sh -f tsim/field/3.sim
+./test.sh -f tsim/field/4.sim
+./test.sh -f tsim/field/5.sim
+./test.sh -f tsim/field/6.sim
+./test.sh -f tsim/field/binary.sim
+./test.sh -f tsim/field/bigint.sim
+./test.sh -f tsim/field/bool.sim
+./test.sh -f tsim/field/double.sim
+./test.sh -f tsim/field/float.sim
+./test.sh -f tsim/field/int.sim
+./test.sh -f tsim/field/single.sim
+./test.sh -f tsim/field/smallint.sim
+./test.sh -f tsim/field/tinyint.sim
+./test.sh -f tsim/field/unsigined_bigint.sim
+./test.sh -f tsim/vector/metrics_field.sim
+./test.sh -f tsim/vector/metrics_mix.sim
+./test.sh -f tsim/vector/metrics_query.sim
+./test.sh -f tsim/vector/metrics_tag.sim
+./test.sh -f tsim/vector/metrics_time.sim
+./test.sh -f tsim/vector/multi.sim
+./test.sh -f tsim/vector/single.sim
+./test.sh -f tsim/vector/table_field.sim
+./test.sh -f tsim/vector/table_mix.sim
+./test.sh -f tsim/vector/table_query.sim
+./test.sh -f tsim/vector/table_time.sim
+./test.sh -f tsim/wal/kill.sim
+./test.sh -f tsim/tag/3.sim
+./test.sh -f tsim/tag/4.sim
+./test.sh -f tsim/tag/5.sim
+./test.sh -f tsim/tag/6.sim
+./test.sh -f tsim/tag/add.sim
+./test.sh -f tsim/tag/bigint.sim
+./test.sh -f tsim/tag/binary_binary.sim
+./test.sh -f tsim/tag/binary.sim
+./test.sh -f tsim/tag/bool_binary.sim
+./test.sh -f tsim/tag/bool_int.sim
+./test.sh -f tsim/tag/bool.sim
+./test.sh -f tsim/tag/change.sim
+./test.sh -f tsim/tag/column.sim
+./test.sh -f tsim/tag/commit.sim
+./test.sh -f tsim/tag/create.sim
+./test.sh -f tsim/tag/delete.sim
+./test.sh -f tsim/tag/double.sim
+./test.sh -f tsim/tag/filter.sim
+./test.sh -f tsim/tag/float.sim
+./test.sh -f tsim/tag/int_binary.sim
+./test.sh -f tsim/tag/int_float.sim
+./test.sh -f tsim/tag/int.sim
+./test.sh -f tsim/tag/set.sim
+./test.sh -f tsim/tag/smallint.sim
+./test.sh -f tsim/tag/tinyint.sim
+./test.sh -f tsim/tag/drop_tag.sim
+./test.sh -f tsim/tag/tbNameIn.sim
+./test.sh -f tmp/monitor.sim
diff --git a/tests/script/wtest.bat b/tests/script/wtest.bat
index f674277df9455d0abac76bc4f214b9c53a62ce91..b642bad285864fd2fd423d0e28c739bc4680bcd0 100644
--- a/tests/script/wtest.bat
+++ b/tests/script/wtest.bat
@@ -33,7 +33,7 @@ if exist %LOG_DIR% rmdir /s/q %LOG_DIR%
if not exist %CFG_DIR% mkdir %CFG_DIR%
if not exist %LOG_DIR% mkdir %LOG_DIR%
-rem set "fqdn="
+set "fqdn=localhost"
for /f "skip=1" %%A in (
'wmic computersystem get caption'
) do if not defined fqdn set "fqdn=%%A"
diff --git a/tests/system-test/0-others/backquote_check.py b/tests/system-test/0-others/backquote_check.py
index 33577232538074953457830934fa853ba81aec6a..be8590f913f110e0156d71fa81560fc99fa39132 100644
--- a/tests/system-test/0-others/backquote_check.py
+++ b/tests/system-test/0-others/backquote_check.py
@@ -29,7 +29,7 @@ class TDTestCase:
self.streamname = 'stm'
self.streamtb = 'stm_stb'
def topic_name_check(self):
- tdSql.execute(f'create database if not exists {self.dbname}')
+ tdSql.execute(f'create database if not exists {self.dbname} wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}')
tdSql.execute(f'create stable {self.stbname} (ts timestamp,c0 int) tags(t0 int)')
for name in [self.dbname,self.stbname]:
@@ -56,12 +56,12 @@ class TDTestCase:
tdSql.execute(f'drop topic `{name}`')
def db_name_check(self):
- tdSql.execute(f'create database if not exists `{self.dbname}`')
+ tdSql.execute(f'create database if not exists `{self.dbname}` wal_retention_period 3600')
tdSql.execute(f'use `{self.dbname}`')
tdSql.execute(f'drop database {self.dbname}')
def stream_name_check(self):
- tdSql.execute(f'create database if not exists {self.dbname}')
+ tdSql.execute(f'create database if not exists {self.dbname} wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}')
tdSql.execute(f'create stable {self.stbname} (ts timestamp,c0 int) tags(t0 int)')
tdSql.execute(f'create stream `{self.streamname}` into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);')
@@ -84,4 +84,4 @@ class TDTestCase:
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py
index 03aadf8746b3673b57b4c86675682302d71f075b..1922ebfb2f9d6c48c911214b3fe13d68a77e5d26 100644
--- a/tests/system-test/0-others/compatibility.py
+++ b/tests/system-test/0-others/compatibility.py
@@ -3,6 +3,7 @@ import taos
import sys
import os
import time
+import platform
import inspect
from taos.tmq import Consumer
@@ -106,6 +107,9 @@ class TDTestCase:
if distro_id == "alpine":
tdLog.info(f"alpine skip compatibility test")
return True
+ if platform.system().lower() == 'windows':
+ tdLog.info(f"Windows skip compatibility test")
+ return True
bPath = self.getBuildPath()
cPath = self.getCfgPath()
dbname = "test"
@@ -169,7 +173,7 @@ class TDTestCase:
tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}")
tdsql.query(f"select count(*) from {stb}")
- tdsql.checkData(0,0,tableNumbers*recordNumbers1)
+ tdsql.checkData(0,0,tableNumbers*recordNumbers1)
# tdsql.query("show streams;")
# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
# tdsql.query("show streams;")
@@ -183,6 +187,7 @@ class TDTestCase:
tdsql.execute("drop database if exists db")
tdsql.execute("create database db")
tdsql.execute("use db")
+ tdsql.execute("alter database db wal_retention_period 3600")
tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);")
tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);")
tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);")
@@ -198,15 +203,15 @@ class TDTestCase:
tdsql.query("describe information_schema.ins_databases;")
qRows=tdsql.queryRows
comFlag=True
- j=0
- while comFlag:
+ j=0
+ while comFlag:
for i in range(qRows) :
if tdsql.queryResult[i][0] == "retentions" :
print("parameters include retentions")
comFlag=False
break
else :
- comFlag=True
+ comFlag=True
j=j+1
if j == qRows:
print("parameters don't include retentions")
diff --git a/tests/system-test/0-others/performance_schema.py b/tests/system-test/0-others/performance_schema.py
index 70e86009a67fb0fdd3c04e0e98b89539c4ed8ad0..9d2a362254714a2daefc98787a3c1ec236c3e80c 100755
--- a/tests/system-test/0-others/performance_schema.py
+++ b/tests/system-test/0-others/performance_schema.py
@@ -75,7 +75,7 @@ class TDTestCase:
def prepare_data(self):
tdSql.execute(f"create database if not exists {self.dbname} vgroups 2") #1 query
tdSql.execute(f'use {self.dbname}') #1 query
-
+ tdsql.execute(f"alter database {self.dbname} wal_retention_period 3600")
tdSql.execute(self.setsql.set_create_stable_sql(self.stbname,self.column_dict,self.tag_dict)) #1 query
for i in range(self.tbnum): #self.tbnum query
@@ -92,12 +92,12 @@ class TDTestCase:
def run(self):
tdSqlTran = TDSql()
tdSqlTran.init(self.obj.conn.cursor())
- tdSqlTran.execute(f"create database if not exists %s vgroups 20"%(self.obj.transTestDBName))
+ tdSqlTran.execute(f"create database if not exists %s vgroups 20 wal_retention_period 3600"%(self.obj.transTestDBName))
tdSqlTran.execute(f"DROP DATABASE %s"%(self.obj.transTestDBName))
def init_tmq_env(self, db, topic):
self.conn.execute("drop topic if exists {}".format(topic))
- self.conn.execute("create database if not exists {}".format(db))
+ self.conn.execute("create database if not exists {} wal_retention_period 3600".format(db))
self.conn.select_db(db)
self.conn.execute(
"create stable if not exists stb_sub (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))")
@@ -211,4 +211,4 @@ class TDTestCase:
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py
index 3e176fe25162b2053f5d86d83b97bc61e6a354d8..b284605a0e8dc619c5ab004d4a65d022b0eb8946 100644
--- a/tests/system-test/0-others/show.py
+++ b/tests/system-test/0-others/show.py
@@ -28,7 +28,7 @@ class TDTestCase:
self.perf_param = ['apps','connections','consumers','queries','transactions']
self.perf_param_list = ['apps','connections','consumers','queries','trans']
self.dbname = "db"
- self.vgroups = 10
+ self.vgroups = 4
self.stbname = f'`{tdCom.getLongName(5)}`'
self.tbname = f'`{tdCom.getLongName(3)}`'
self.db_param = {
diff --git a/tests/system-test/0-others/sysinfo.py b/tests/system-test/0-others/sysinfo.py
index 9ffa6ca9e60e104cebb51fc1a94eacd7aa494773..43a0400f1880ded44bbbaadfa1a3467a8c3d9775 100644
--- a/tests/system-test/0-others/sysinfo.py
+++ b/tests/system-test/0-others/sysinfo.py
@@ -49,8 +49,6 @@ class TDTestCase:
#!for bug
tdDnodes.stoptaosd(1)
sleep(self.delaytime * 5)
- if platform.system().lower() == 'windows':
- sleep(10)
tdSql.error('select server_status()')
def run(self):
diff --git a/tests/system-test/0-others/taosdMonitor.py b/tests/system-test/0-others/taosdMonitor.py
index 195f1ba5bcc3a916c0693b86a382cae895863e44..8094c4e0f555dcd7a5a7340c439a0a34948b212d 100644
--- a/tests/system-test/0-others/taosdMonitor.py
+++ b/tests/system-test/0-others/taosdMonitor.py
@@ -292,7 +292,7 @@ class TDTestCase:
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
# time.sleep(2)
- vgroups = "8"
+ vgroups = "4"
sql = "create database db3 vgroups " + vgroups
tdSql.query(sql)
sql = "create table db3.stb (ts timestamp, f int) tags (t int)"
diff --git a/tests/system-test/0-others/taosdShell.py b/tests/system-test/0-others/taosdShell.py
index 2125b5eebe448b4ac044158f7157cd689eaec29e..3b9eb66705407e80a9e130680675a618283679e0 100644
--- a/tests/system-test/0-others/taosdShell.py
+++ b/tests/system-test/0-others/taosdShell.py
@@ -4,6 +4,7 @@ import sys
import time
from datetime import datetime
import socket
+import psutil
import os
import platform
if platform.system().lower() == 'windows':
@@ -67,19 +68,25 @@ class TDTestCase:
return buildPath
def get_process_pid(self,processname):
- #origin artical link:https://blog.csdn.net/weixin_45623536/article/details/122099062
- process_info_list = []
- process = os.popen('ps -A | grep %s'% processname)
- process_info = process.read()
- for i in process_info.split(' '):
- if i != "":
- process_info_list.append(i)
- print(process_info_list)
- if len(process_info_list) != 0 :
- pid = int(process_info_list[0])
- else :
- pid = 0
- return pid
+ if platform.system().lower() == 'windows':
+ pids = psutil.process_iter()
+ for pid in pids:
+ if(pid.name() == processname):
+ return pid.pid
+ return 0
+ else:
+ process_info_list = []
+ process = os.popen('ps -A | grep %s'% processname)
+ process_info = process.read()
+ for i in process_info.split(' '):
+ if i != "":
+ process_info_list.append(i)
+ print(process_info_list)
+ if len(process_info_list) != 0 :
+ pid = int(process_info_list[0])
+ else :
+ pid = 0
+ return pid
def checkAndstopPro(self,processName,startAction):
i = 1
@@ -88,23 +95,29 @@ class TDTestCase:
taosdPid=self.get_process_pid(processName)
if taosdPid != 0 and taosdPid != "" :
tdLog.info("stop taosd %s ,kill pid :%s "%(startAction,taosdPid))
- os.system("kill -9 %d"%taosdPid)
+ os.system("kill -9 %d"%taosdPid)
break
else:
tdLog.info( "wait start taosd ,times: %d "%i)
time.sleep(1)
i+= 1
else :
- tdLog.exit("taosd %s is not running "%startAction)
+ tdLog.exit("taosd %s is not running "%startAction)
def taosdCommandStop(self,startAction,taosdCmdRun):
processName="taosd"
+ if platform.system().lower() == 'windows':
+ processName="taosd.exe"
taosdCmd = taosdCmdRun + startAction
tdLog.printNoPrefix("%s"%taosdCmd)
- logTime=datetime.now().strftime('%Y%m%d_%H%M%S_%f')
- os.system(f"nohup {taosdCmd} > {logTime}.log 2>&1 & ")
- self.checkAndstopPro(processName,startAction)
- os.system(f"rm -rf {logTime}.log")
+ if platform.system().lower() == 'windows':
+ cmd = f"mintty -h never {taosdCmd}"
+ os.system(cmd)
+ else:
+ logTime=datetime.now().strftime('%Y%m%d_%H%M%S_%f')
+ os.system(f"nohup {taosdCmd} > {logTime}.log 2>&1 & ")
+ self.checkAndstopPro(processName,startAction)
+ os.system(f"rm -rf {logTime}.log")
def taosdCommandExe(self,startAction,taosdCmdRun):
@@ -116,7 +129,7 @@ class TDTestCase:
# database\stb\tb\chiild-tb\rows\topics
tdSql.execute("create user testpy pass 'testpy'")
tdSql.execute("drop database if exists db0;")
- tdSql.execute("create database db0;")
+ tdSql.execute("create database db0 wal_retention_period 3600;")
tdSql.execute("use db0;")
tdSql.execute("create table if not exists db0.stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned);")
tdSql.execute("create table db0.ct1 using db0.stb tags(1000);")
@@ -132,14 +145,14 @@ class TDTestCase:
#stream
tdSql.execute("drop database if exists source_db;")
- tdSql.query("create database source_db vgroups 3;")
+ tdSql.query("create database source_db vgroups 3 wal_retention_period 3600;")
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 startts, min(k), max(k), sum(k) from source_db.stb interval(10m);")
- #TD-19944 -Q=3
+ #TD-19944 -Q=3
tdsqlN=tdCom.newTdSql()
tdsqlN.query("select * from source_db.stb")
@@ -186,7 +199,11 @@ class TDTestCase:
startAction=" -a jsonFile:./taosdCaseTmp.json"
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
- os.system("echo \'{\"queryPolicy\":\"3\"}\' > taosdCaseTmp.json")
+
+ if platform.system().lower() == 'windows':
+ os.system("echo {\"queryPolicy\":\"3\"} > taosdCaseTmp.json")
+ else:
+ os.system("echo \'{\"queryPolicy\":\"3\"}\' > taosdCaseTmp.json")
self.taosdCommandStop(startAction,taosdCmdRun)
startAction = " -a jsonFile:./taosdCaseTmp.json -C "
@@ -206,12 +223,12 @@ class TDTestCase:
self.taosdCommandStop(startAction,taosdCmdRun)
- startAction=" -E taosdCaseTmp/.env"
+ startAction=f" -E taosdCaseTmp{os.sep}.env"
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
- os.system(" mkdir -p taosdCaseTmp ")
- os.system("echo \'TAOS_QUERY_POLICY=3\' > taosdCaseTmp/.env ")
+ os.system(" mkdir -p taosdCaseTmp ")
+ os.system("echo TAOS_QUERY_POLICY=3 > taosdCaseTmp/.env ")
self.taosdCommandStop(startAction,taosdCmdRun)
- os.system(" rm -rf taosdCaseTmp ")
+ os.system(" rm -rf taosdCaseTmp ")
startAction = " -V"
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
diff --git a/tests/system-test/0-others/telemetry.py b/tests/system-test/0-others/telemetry.py
index c62e3c2487e6e95eca7c42e1e30f4debbabba5be..3b6cb105099dfacebc705d347b320005e4b3d109 100644
--- a/tests/system-test/0-others/telemetry.py
+++ b/tests/system-test/0-others/telemetry.py
@@ -181,7 +181,7 @@ class TDTestCase:
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
# time.sleep(2)
- vgroups = "8"
+ vgroups = "4"
sql = "create database db3 vgroups " + vgroups
tdSql.query(sql)
diff --git a/tests/system-test/0-others/testRoll.py b/tests/system-test/0-others/testRoll.py
index 56e5b3630afe9c875be74dcbbdce52d024c9a22e..c5489146dc4edff7c77a6e2888925bb284dd3fc3 100644
--- a/tests/system-test/0-others/testRoll.py
+++ b/tests/system-test/0-others/testRoll.py
@@ -13,7 +13,7 @@ def init_tmq_env(db, topic):
conn.execute("drop topic if exists {}".format(topic))
conn.execute("drop database if exists {}".format(db))
- conn.execute("create database if not exists {} replica 1 ".format(db))
+ conn.execute("create database if not exists {} replica 1 wal_retention_period 3600".format(db))
conn.select_db(db)
conn.execute(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))")
@@ -37,7 +37,7 @@ def init_tmq_rest_env(db, topic):
conn.execute("drop topic if exists {}".format(topic))
conn.execute("drop database if exists {}".format(db))
- conn.execute("create database if not exists {} replica 3 ".format(db))
+ conn.execute("create database if not exists {} replica 3 wal_retention_period 3600".format(db))
conn.select_db(db)
conn.execute(
"create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))")
@@ -80,4 +80,4 @@ if __name__ == '__main__':
val = res.value()
for block in val:
- print(block.fetchall())
\ No newline at end of file
+ print(block.fetchall())
diff --git a/tests/system-test/0-others/udfTest.py b/tests/system-test/0-others/udfTest.py
index 15253df0c4eda40378ed2c875f01a8448f73003d..da77078208d5f54eb8b4d09ab5e489bb9eb2f1ff 100644
--- a/tests/system-test/0-others/udfTest.py
+++ b/tests/system-test/0-others/udfTest.py
@@ -146,7 +146,7 @@ class TDTestCase:
for i in range(5):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -171,7 +171,7 @@ class TDTestCase:
tdLog.info("drop two udf functions success ")
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -562,7 +562,7 @@ class TDTestCase:
# create function without buffer
tdSql.execute("create aggregate function udf1 as '%s' outputtype int bufSize 8 "%self.libudf1)
- tdSql.execute("create function udf2 as '%s' outputtype double bufSize 8"%self.libudf2)
+ tdSql.execute("create function udf2 as '%s' outputtype double"%self.libudf2)
udf1_sqls ,udf2_sqls = self.try_query_sql()
for scalar_sql in udf1_sqls:
@@ -570,7 +570,7 @@ class TDTestCase:
for aggregate_sql in udf2_sqls:
tdSql.error(aggregate_sql)
- tdSql.execute(" create function db as '%s' outputtype int bufSize 8 "%self.libudf1)
+ tdSql.execute(" create function db as '%s' outputtype int "%self.libudf1)
tdSql.execute(" create aggregate function test as '%s' outputtype int bufSize 8 "%self.libudf1)
tdSql.error(" select db(c1) from stb1 ")
tdSql.error(" select db(c1,c6), db(c6) from stb1 ")
@@ -619,9 +619,9 @@ class TDTestCase:
tdLog.info(" create function name is not build_in functions ")
tdSql.execute(" drop function udf1 ")
tdSql.execute(" drop function udf2 ")
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int "%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int "%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function tbname as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function function as '%s' outputtype double bufSize 8"%self.libudf2)
diff --git a/tests/system-test/0-others/udf_cfg1.py b/tests/system-test/0-others/udf_cfg1.py
index 35d43ea9b73eedc7b9432cf0590d90927ad2932c..913e5fcca14283579f6d2cc72d9674b448fc0c2b 100644
--- a/tests/system-test/0-others/udf_cfg1.py
+++ b/tests/system-test/0-others/udf_cfg1.py
@@ -148,7 +148,7 @@ class TDTestCase:
for i in range(5):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -173,7 +173,7 @@ class TDTestCase:
tdLog.info("drop two udf functions success ")
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
diff --git a/tests/system-test/0-others/udf_cfg2.py b/tests/system-test/0-others/udf_cfg2.py
index 869cb098e2e0415acf931179dc4e6887aa781f4a..cc6da81847126d91e2aed8c14f11ebfbc0729b01 100644
--- a/tests/system-test/0-others/udf_cfg2.py
+++ b/tests/system-test/0-others/udf_cfg2.py
@@ -148,7 +148,7 @@ class TDTestCase:
for i in range(5):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -173,7 +173,7 @@ class TDTestCase:
tdLog.info("drop two udf functions success ")
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -564,7 +564,7 @@ class TDTestCase:
# create function without buffer
tdSql.execute("create aggregate function udf1 as '%s' outputtype int bufSize 8 "%self.libudf1)
- tdSql.execute("create function udf2 as '%s' outputtype double bufSize 8"%self.libudf2)
+ tdSql.execute("create function udf2 as '%s' outputtype double"%self.libudf2)
udf1_sqls ,udf2_sqls = self.try_query_sql()
for scalar_sql in udf1_sqls:
@@ -572,7 +572,7 @@ class TDTestCase:
for aggregate_sql in udf2_sqls:
tdSql.error(aggregate_sql)
- tdSql.execute(" create function db as '%s' outputtype int bufSize 8 "%self.libudf1)
+ tdSql.execute(" create function db as '%s' outputtype int "%self.libudf1)
tdSql.execute(" create aggregate function test as '%s' outputtype int bufSize 8 "%self.libudf1)
tdSql.error(" select db(c1) from stb1 ")
tdSql.error(" select db(c1,c6), db(c6) from stb1 ")
@@ -621,9 +621,9 @@ class TDTestCase:
tdLog.info(" create function name is not build_in functions ")
tdSql.execute(" drop function udf1 ")
tdSql.execute(" drop function udf2 ")
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function tbname as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function function as '%s' outputtype double bufSize 8"%self.libudf2)
diff --git a/tests/system-test/0-others/udf_create.py b/tests/system-test/0-others/udf_create.py
index 65dad6400041e8c52d39d0ff4e484bdc29099894..d35688c8dae3c419084e2f0414c5fb9031a4bea3 100644
--- a/tests/system-test/0-others/udf_create.py
+++ b/tests/system-test/0-others/udf_create.py
@@ -148,7 +148,7 @@ class TDTestCase:
for i in range(5):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -173,7 +173,7 @@ class TDTestCase:
tdLog.info("drop two udf functions success ")
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -574,7 +574,7 @@ class TDTestCase:
# create function without buffer
tdSql.execute("create aggregate function udf1 as '%s' outputtype int bufSize 8 "%self.libudf1)
- tdSql.execute("create function udf2 as '%s' outputtype double bufSize 8"%self.libudf2)
+ tdSql.execute("create function udf2 as '%s' outputtype double "%self.libudf2)
udf1_sqls ,udf2_sqls = self.try_query_sql()
for scalar_sql in udf1_sqls:
@@ -582,7 +582,7 @@ class TDTestCase:
for aggregate_sql in udf2_sqls:
tdSql.error(aggregate_sql)
- tdSql.execute(" create function db as '%s' outputtype int bufSize 8 "%self.libudf1)
+ tdSql.execute(" create function db as '%s' outputtype int "%self.libudf1)
tdSql.execute(" create aggregate function test as '%s' outputtype int bufSize 8 "%self.libudf1)
tdSql.error(" select db(c1) from stb1 ")
tdSql.error(" select db(c1,c6), db(c6) from stb1 ")
@@ -631,9 +631,9 @@ class TDTestCase:
tdLog.info(" create function name is not build_in functions ")
tdSql.execute(" drop function udf1 ")
tdSql.execute(" drop function udf2 ")
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function tbname as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function function as '%s' outputtype double bufSize 8"%self.libudf2)
diff --git a/tests/system-test/0-others/udf_restart_taosd.py b/tests/system-test/0-others/udf_restart_taosd.py
index dae707520f55e2e2c6b02c60e5d9015f8c613d3d..a0f70ccd49be9884ad1c0eeb5b7ee91c67ea4bee 100644
--- a/tests/system-test/0-others/udf_restart_taosd.py
+++ b/tests/system-test/0-others/udf_restart_taosd.py
@@ -145,7 +145,7 @@ class TDTestCase:
for i in range(5):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -170,7 +170,7 @@ class TDTestCase:
tdLog.info("drop two udf functions success ")
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
# create aggregate functions
@@ -561,7 +561,7 @@ class TDTestCase:
# create function without buffer
tdSql.execute("create aggregate function udf1 as '%s' outputtype int bufSize 8 "%self.libudf1)
- tdSql.execute("create function udf2 as '%s' outputtype double bufSize 8"%self.libudf2)
+ tdSql.execute("create function udf2 as '%s' outputtype double"%self.libudf2)
udf1_sqls ,udf2_sqls = self.try_query_sql()
for scalar_sql in udf1_sqls:
@@ -569,7 +569,7 @@ class TDTestCase:
for aggregate_sql in udf2_sqls:
tdSql.error(aggregate_sql)
- tdSql.execute(" create function db as '%s' outputtype int bufSize 8 "%self.libudf1)
+ tdSql.execute(" create function db as '%s' outputtype int "%self.libudf1)
tdSql.execute(" create aggregate function test as '%s' outputtype int bufSize 8 "%self.libudf1)
tdSql.error(" select db(c1) from stb1 ")
tdSql.error(" select db(c1,c6), db(c6) from stb1 ")
@@ -618,9 +618,9 @@ class TDTestCase:
tdLog.info(" create function name is not build_in functions ")
tdSql.execute(" drop function udf1 ")
tdSql.execute(" drop function udf2 ")
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
- tdSql.error("create function max as '%s' outputtype int bufSize 8"%self.libudf1)
+ tdSql.error("create function max as '%s' outputtype int"%self.libudf1)
tdSql.error("create aggregate function sum as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function tbname as '%s' outputtype double bufSize 8"%self.libudf2)
tdSql.error("create aggregate function function as '%s' outputtype double bufSize 8"%self.libudf2)
diff --git a/tests/system-test/0-others/udfpy/af_count.py b/tests/system-test/0-others/udfpy/af_count.py
new file mode 100644
index 0000000000000000000000000000000000000000..ce29abca13866f9f311d1e868a5df68c71c5f735
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/af_count.py
@@ -0,0 +1,23 @@
+import pickle
+
+def init():
+ pass
+
+def destroy():
+ pass
+
+def start():
+ return pickle.dumps(0)
+
+def finish(buf):
+ count = pickle.loads(buf)
+ return count
+
+def reduce(datablock, buf):
+ (rows, cols) = datablock.shape()
+ count = pickle.loads(buf)
+ for i in range(rows):
+ val = datablock.data(i, 0)
+ if val is not None:
+ count += 1
+ return pickle.dumps(count)
\ No newline at end of file
diff --git a/tests/system-test/0-others/udfpy/af_min.py b/tests/system-test/0-others/udfpy/af_min.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f1aadf4145c7bb585040d1f05640c913aab2aee
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/af_min.py
@@ -0,0 +1,30 @@
+import pickle
+
+def init():
+ pass
+
+def destroy():
+ pass
+
+def start():
+ return pickle.dumps([])
+
+def finish(buf):
+ mins = pickle.loads(buf)
+ min_val = None
+ for min in mins:
+ if min_val is None or (min is not None and min < min_val):
+ min_val = min
+ return min_val
+
+def reduce(datablock, buf):
+ (rows, cols) = datablock.shape()
+ mins = pickle.loads(buf)
+ min = None
+ for i in range(rows):
+ val = datablock.data(i, 0)
+ if min is None or (val is not None and val < min) :
+ min = val
+ if min is not None:
+ mins.append(min)
+ return pickle.dumps(mins)
diff --git a/tests/system-test/0-others/udfpy/af_null.py b/tests/system-test/0-others/udfpy/af_null.py
new file mode 100644
index 0000000000000000000000000000000000000000..230eac6888245444a4f902274a83bb5671626515
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/af_null.py
@@ -0,0 +1,19 @@
+import pickle
+
+def init():
+ pass
+
+def destroy():
+ pass
+
+def start():
+ return pickle.dumps([])
+
+def finish(buf):
+ return None
+
+def reduce(datablock, buf):
+ (rows, cols) = datablock.shape()
+ mins = pickle.loads(buf)
+ mins.append(None)
+ return pickle.dumps(mins)
diff --git a/tests/system-test/0-others/udfpy/af_sum.py b/tests/system-test/0-others/udfpy/af_sum.py
new file mode 100644
index 0000000000000000000000000000000000000000..8b88aba56ca08f64249f85a4df596d9fd204b05a
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/af_sum.py
@@ -0,0 +1,26 @@
+import pickle
+
+def init():
+ pass
+
+def destroy():
+ pass
+
+def start():
+ return pickle.dumps(None)
+
+def finish(buf):
+ sum = pickle.loads(buf)
+ return sum
+
+def reduce(datablock, buf):
+ (rows, cols) = datablock.shape()
+ sum = pickle.loads(buf)
+ for i in range(rows):
+ val = datablock.data(i, 0)
+ if val is not None:
+ if sum is None:
+ sum = val
+ else:
+ sum += val
+ return pickle.dumps(sum)
diff --git a/tests/system-test/0-others/udfpy/sf_concat_nch.py b/tests/system-test/0-others/udfpy/sf_concat_nch.py
new file mode 100644
index 0000000000000000000000000000000000000000..84d8eb2c961c11282784f81b6206a36fba0f2edc
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/sf_concat_nch.py
@@ -0,0 +1,27 @@
+# init
+def init():
+ pass
+
+# destroy
+def destroy():
+ pass
+
+def process(block):
+ (nrows, ncols) = block.shape()
+ results = []
+ for i in range(nrows):
+ row = []
+ for j in range(ncols):
+ val = block.data(i, j)
+ if val is None:
+ row = None
+ break
+ row.append(val.decode('utf_32_le'))
+ if row is None:
+ results.append(None)
+ else:
+ row_str = ''.join(row)
+ results.append(row_str.encode('utf_32_le'))
+ return results
+
+
diff --git a/tests/system-test/0-others/udfpy/sf_concat_var.py b/tests/system-test/0-others/udfpy/sf_concat_var.py
new file mode 100644
index 0000000000000000000000000000000000000000..fc8292c718d5c8def7cebc87ee7938b2c7bd3849
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/sf_concat_var.py
@@ -0,0 +1,26 @@
+# init
+def init():
+ pass
+
+# destroy
+def destroy():
+ pass
+
+def process(block):
+ (nrows, ncols) = block.shape()
+ results = []
+ for i in range(nrows):
+ row = []
+ for j in range(ncols):
+ val = block.data(i, j)
+ if val is None:
+ row = None
+ break
+ row.append(val.decode('utf-8'))
+ if row is None:
+ results.append(None)
+ else:
+ results.append(''.join(row))
+ return results
+
+
diff --git a/tests/system-test/0-others/udfpy/sf_multi_args.py b/tests/system-test/0-others/udfpy/sf_multi_args.py
new file mode 100644
index 0000000000000000000000000000000000000000..1026661d8d127eeb52b6b79f9b81dd29ccc24ba5
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/sf_multi_args.py
@@ -0,0 +1,23 @@
+# init
+def init():
+ pass
+
+# destroy
+def destroy():
+ pass
+
+# return origin column one value
+def process(block):
+ (nrows, ncols) = block.shape()
+ results = []
+ for i in range(nrows):
+ rows = []
+ for j in range(ncols):
+ val = block.data(i, j)
+ if type(val) is bytes:
+ rows.append(val.decode('utf-8'))
+ else:
+ rows.append(repr(val))
+ results.append(','.join(rows))
+ return results
+
diff --git a/tests/system-test/0-others/udfpy/sf_null.py b/tests/system-test/0-others/udfpy/sf_null.py
new file mode 100644
index 0000000000000000000000000000000000000000..c22ca95b19f93d2d494a4890154923626a6a445a
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/sf_null.py
@@ -0,0 +1,16 @@
+
+# init
+def init():
+ pass
+
+# destroy
+def destroy():
+ pass
+
+# return origin column one value
+def process(block):
+ (rows, cols) = block.shape()
+ results = []
+ for i in range(rows):
+ results.append(None)
+ return results
\ No newline at end of file
diff --git a/tests/system-test/0-others/udfpy/sf_origin.py b/tests/system-test/0-others/udfpy/sf_origin.py
new file mode 100644
index 0000000000000000000000000000000000000000..9158e044d2defb118683f56b889bf95bb7d04ee6
--- /dev/null
+++ b/tests/system-test/0-others/udfpy/sf_origin.py
@@ -0,0 +1,15 @@
+# init
+def init():
+ pass
+
+# destroy
+def destroy():
+ pass
+
+# return origin column one value
+def process(block):
+ (rows, cols) = block.shape()
+ results = []
+ for i in range(rows):
+ results.append(block.data(i,0))
+ return results
diff --git a/tests/system-test/0-others/udfpy_main.py b/tests/system-test/0-others/udfpy_main.py
new file mode 100644
index 0000000000000000000000000000000000000000..916b032edbde72a4ddc011608b924f95bb035c58
--- /dev/null
+++ b/tests/system-test/0-others/udfpy_main.py
@@ -0,0 +1,464 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.common import *
+from util.sqlset import *
+
+import random
+import os
+import subprocess
+
+
+class PerfDB:
+ def __init__(self):
+ self.sqls = []
+ self.spends = []
+
+ # execute
+ def execute(self, sql):
+ print(f" perfdb execute {sql}")
+ stime = time.time()
+ ret = tdSql.execute(sql, 1)
+ spend = time.time() - stime
+
+ self.sqls.append(sql)
+ self.spends.append(spend)
+ return ret
+
+ # query
+ def query(self, sql):
+ print(f" perfdb query {sql}")
+ start = time.time()
+ ret = tdSql.query(sql, None, 1)
+ spend = time.time() - start
+ self.sqls.append(sql)
+ self.spends.append(spend)
+ return ret
+
+
+class TDTestCase:
+ def init(self, conn, logSql, replicaVar=1):
+ self.replicaVar = int(replicaVar)
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor())
+ self.setsql = TDSetSql()
+
+ # udf path
+ self.udf_path = os.path.dirname(os.path.realpath(__file__)) + "/udfpy"
+
+
+ self.column_dict = {
+ 'ts': 'timestamp',
+ 'col1': 'tinyint',
+ 'col2': 'smallint',
+ 'col3': 'int',
+ 'col4': 'bigint',
+ 'col5': 'tinyint unsigned',
+ 'col6': 'smallint unsigned',
+ 'col7': 'int unsigned',
+ 'col8': 'bigint unsigned',
+ 'col9': 'float',
+ 'col10': 'double',
+ 'col11': 'bool',
+ 'col12': 'varchar(120)',
+ 'col13': 'nchar(100)',
+ }
+ self.tag_dict = {
+ 't1': 'tinyint',
+ 't2': 'smallint',
+ 't3': 'int',
+ 't4': 'bigint',
+ 't5': 'tinyint unsigned',
+ 't6': 'smallint unsigned',
+ 't7': 'int unsigned',
+ 't8': 'bigint unsigned',
+ 't9': 'float',
+ 't10': 'double',
+ 't11': 'bool',
+ 't12': 'varchar(120)',
+ 't13': 'nchar(100)',
+ }
+
+ def set_stb_sql(self,stbname,column_dict,tag_dict):
+ column_sql = ''
+ tag_sql = ''
+ for k,v in column_dict.items():
+ column_sql += f"{k} {v}, "
+ for k,v in tag_dict.items():
+ tag_sql += f"{k} {v}, "
+ create_stb_sql = f'create stable {stbname} ({column_sql[:-2]}) tags ({tag_sql[:-2]})'
+ return create_stb_sql
+
+ # create stable and child tables
+ def create_table(self, stbname, tbname, count):
+ tdSql.execute("create database db wal_retention_period 4")
+ tdSql.execute('use db')
+ self.child_count = count
+ self.stbname = stbname
+ self.tbname = tbname
+
+ # create stable
+ create_table_sql = self.set_stb_sql(stbname, self.column_dict, self.tag_dict)
+ tdSql.execute(create_table_sql)
+
+ batch_size = 1000
+ # create child table
+ for i in range(count):
+ ti = i % 128
+ tags = f'{ti},{ti},{i},{i},{ti},{ti},{i},{i},{i}.000{i},{i}.000{i},true,"var{i}","nch{i}"'
+ sql = f'create table {tbname}{i} using {stbname} tags({tags});'
+ tdSql.execute(sql)
+ if i % batch_size == 0:
+ tdLog.info(f" create child table {i} ...")
+
+ tdLog.info(f" create {count} child tables ok.")
+
+ # create with dicts
+ def create_sf_dicts(self, dicts, filename):
+ for fun_name, out_type in dicts.items():
+ sql = f' create function {fun_name} as "{self.udf_path}/{filename}" outputtype {out_type} language "Python" '
+ tdSql.execute(sql)
+ tdLog.info(sql)
+
+ # create_udfpy_function
+ def create_scalar_udfpy(self):
+ # scalar funciton
+ self.scalar_funs = {
+ 'sf0': 'timestamp',
+ 'sf1': 'tinyint',
+ 'sf2': 'smallint',
+ 'sf3': 'int',
+ 'sf4': 'bigint',
+ 'sf5': 'tinyint unsigned',
+ 'sf6': 'smallint unsigned',
+ 'sf7': 'int unsigned',
+ 'sf8': 'bigint unsigned',
+ 'sf9': 'float',
+ 'sf10': 'double',
+ 'sf11': 'bool',
+ 'sf12': 'varchar(120)',
+ 'sf13': 'nchar(100)'
+ }
+ # agg function
+ self.agg_funs = {
+ 'af1': 'tinyint',
+ 'af2': 'smallint',
+ 'af3': 'int',
+ 'af4': 'bigint',
+ 'af5': 'tinyint unsigned',
+ 'af6': 'smallint unsigned',
+ 'af7': 'int unsigned',
+ 'af8': 'bigint unsigned',
+ 'af9': 'float',
+ 'af10': 'double',
+ 'af11': 'bool',
+ 'af12': 'varchar(120)',
+ 'af13': 'nchar(100)',
+ 'af14': 'timestamp'
+ }
+
+ # multi_args
+ self.create_sf_dicts(self.scalar_funs, "sf_origin.py")
+ fun_name = "sf_multi_args"
+ self.create_udf_sf(fun_name, f'{fun_name}.py', "binary(1024)")
+
+ # all type check null
+ for col_name, col_type in self.column_dict.items():
+ self.create_udf_sf(f"sf_null_{col_name}", "sf_null.py", col_type)
+
+ # concat
+ fun_name = "sf_concat_var"
+ self.create_udf_sf(fun_name, f'{fun_name}.py', "varchar(1024)")
+ fun_name = "sf_concat_nch"
+ self.create_udf_sf(fun_name, f'{fun_name}.py', "nchar(1024)")
+
+
+ # fun_name == fun_name.py
+ def create_udf_sf(self, fun_name, file_name, out_type):
+ sql = f'create function {fun_name} as "{self.udf_path}/{file_name}" outputtype {out_type} language "Python" '
+ tdSql.execute(sql)
+ tdLog.info(sql)
+
+ def create_udf_af(self, fun_name, file_name, out_type, bufsize):
+ sql = f'create aggregate function {fun_name} as "{self.udf_path}/{file_name}" outputtype {out_type} bufsize {bufsize} language "Python" '
+ tdSql.execute(sql)
+ tdLog.info(sql)
+
+
+ # sql1 query result eual with sql2
+ def verify_same_result(self, sql1, sql2):
+ # query
+ result1 = tdSql.getResult(sql1)
+ tdSql.query(sql2)
+
+ for i, row in enumerate(result1):
+ for j , val in enumerate(row):
+ tdSql.checkData(i, j, result1[i][j])
+
+ # same value like select col1, udf_fun1(col1) from st
+ def verify_same_value(self, sql, col=0):
+ tdSql.query(sql)
+ nrows = tdSql.getRows()
+ for i in range(nrows):
+ val = tdSql.getData(i, col)
+ tdSql.checkData(i, col + 1, val)
+
+ # verify multi values
+ def verify_same_multi_values(self, sql):
+ tdSql.query(sql)
+ nrows = tdSql.getRows()
+ for i in range(nrows):
+ udf_val = tdSql.getData(i, 0)
+ vals = udf_val.split(',')
+ for j,val in enumerate(vals, 1):
+ tdSql.checkData(i, j, val)
+
+ # query multi-args
+ def query_multi_args(self):
+ cols = list(self.column_dict.keys()) + list(self.tag_dict.keys())
+ cols.remove("col13")
+ cols.remove("t13")
+ cols.remove("ts")
+ ncols = len(cols)
+ print(cols)
+ for i in range(2, ncols):
+ sample = random.sample(cols, i)
+ print(sample)
+ cols_name = ','.join(sample)
+ sql = f'select sf_multi_args({cols_name}),{cols_name} from {self.stbname} limit 10'
+ self.verify_same_multi_values(sql)
+ tdLog.info(sql)
+
+
+ # query_udfpy
+ def query_scalar_udfpy(self):
+ # col
+ for col_name, col_type in self.column_dict.items():
+ for fun_name, out_type in self.scalar_funs.items():
+ if col_type == out_type :
+ sql = f'select {col_name}, {fun_name}({col_name}) from {self.stbname} limit 10'
+ tdLog.info(sql)
+ self.verify_same_value(sql)
+ sql = f'select * from (select {col_name} as a, {fun_name}({col_name}) as b from {self.stbname} limit 100) order by b,a desc'
+ tdLog.info(sql)
+ self.verify_same_value(sql)
+
+ # multi-args
+ self.query_multi_args()
+
+ # all type check null
+ for col_name, col_type in self.column_dict.items():
+ fun_name = f"sf_null_{col_name}"
+ sql = f'select {fun_name}({col_name}) from {self.stbname}'
+ tdSql.query(sql)
+ if col_type != "timestamp":
+ tdSql.checkData(0, 0, "None")
+ else:
+ val = tdSql.getData(0, 0)
+ if val is not None:
+ tdLog.exit(f" check {sql} not expect None.")
+
+ # concat
+ sql = f'select sf_concat_var(col12, t12), concat(col12, t12) from {self.stbname} limit 1000'
+ self.verify_same_value(sql)
+ sql = f'select sf_concat_nch(col13, t13), concat(col13, t13) from {self.stbname} limit 1000'
+ self.verify_same_value(sql)
+
+ # create aggregate
+ def create_aggr_udfpy(self):
+
+ bufsize = 200 * 1024
+ # all type check null
+ for col_name, col_type in self.column_dict.items():
+ self.create_udf_af(f"af_null_{col_name}", "af_null.py", col_type, bufsize)
+
+ # min
+ file_name = "af_min.py"
+ fun_name = "af_min_float"
+ self.create_udf_af(fun_name, file_name, f"float", bufsize)
+ fun_name = "af_min_int"
+ self.create_udf_af(fun_name, file_name, f"int", bufsize)
+
+ # sum
+ file_name = "af_sum.py"
+ fun_name = "af_sum_float"
+ self.create_udf_af(fun_name, file_name, f"float", bufsize)
+ fun_name = "af_sum_int"
+ self.create_udf_af(fun_name, file_name, f"int", bufsize)
+ fun_name = "af_sum_bigint"
+ self.create_udf_af(fun_name, file_name, f"bigint", bufsize)
+
+ # count
+ file_name = "af_count.py"
+ fun_name = "af_count_float"
+ self.create_udf_af(fun_name, file_name, f"float", bufsize)
+ fun_name = "af_count_int"
+ self.create_udf_af(fun_name, file_name, f"int", bufsize)
+ fun_name = "af_count_bigint"
+ self.create_udf_af(fun_name, file_name, f"bigint", bufsize)
+
+
+ # query aggregate
+ def query_aggr_udfpy(self) :
+ # all type check null
+ for col_name, col_type in self.column_dict.items():
+ fun_name = f"af_null_{col_name}"
+ sql = f'select {fun_name}({col_name}) from {self.stbname}'
+ tdSql.query(sql)
+ if col_type != "timestamp":
+ tdSql.checkData(0, 0, "None")
+ else:
+ val = tdSql.getData(0, 0)
+ if val is not None:
+ tdLog.exit(f" check {sql} not expect None.")
+
+ # min
+ sql = f'select min(col3), af_min_int(col3) from {self.stbname}'
+ self.verify_same_value(sql)
+ sql = f'select min(col7), af_min_int(col7) from {self.stbname}'
+ self.verify_same_value(sql)
+ sql = f'select min(col9), af_min_float(col9) from {self.stbname}'
+ self.verify_same_value(sql)
+
+ # sum
+ sql = f'select sum(col1), af_sum_int(col1) from d0'
+ self.verify_same_value(sql)
+ sql = f'select sum(col3), af_sum_bigint(col3) from {self.stbname}'
+ self.verify_same_value(sql)
+ sql = f'select sum(col9), af_sum_float(col9) from {self.stbname}'
+ self.verify_same_value(sql)
+
+ # count
+ sql = f'select count(col1), af_count_int(col1) from {self.stbname}'
+ self.verify_same_value(sql)
+ sql = f'select count(col7), af_count_bigint(col7) from {self.stbname}'
+ self.verify_same_value(sql)
+ sql = f'select count(col8), af_count_float(col8) from {self.stbname}'
+ self.verify_same_value(sql)
+
+ # nest
+ sql = f'select a+1000,b+1000 from (select count(col8) as a, af_count_float(col8) as b from {self.stbname})'
+ self.verify_same_value(sql)
+ # group by
+ sql = f'select a+1000,b+1000 from (select count(col8) as a, af_count_float(col8) as b from {self.stbname} group by tbname)'
+ self.verify_same_value(sql)
+ # two filed expr
+ sql = f'select sum(col1+col2),af_sum_float(col1+col2) from {self.stbname};'
+ self.verify_same_value(sql)
+ # interval
+ sql = f'select af_sum_float(col2+col3),sum(col3+col2) from {self.stbname} interval(1s)'
+ self.verify_same_value(sql)
+
+
+ # insert to child table d1 data
+ def insert_data(self, tbname, rows):
+ ts = 1670000000000
+ values = ""
+ batch_size = 500
+ child_name = ""
+ for i in range(self.child_count):
+ for j in range(rows):
+ tj = j % 128
+ cols = f'{tj},{tj},{j},{j},{tj},{tj},{j},{j},{j}.000{j},{j}.000{j},true,"var{j}","nch{j}涛思数据codepage is utf_32_le"'
+ value = f'({ts+j},{cols})'
+ if values == "":
+ values = value
+ else:
+ values += f",{value}"
+ if j % batch_size == 0 or j + 1 == rows:
+ sql = f'insert into {tbname}{i} values {values};'
+ tdSql.execute(sql)
+ tdLog.info(f" child table={i} rows={j} insert data.")
+ values = ""
+
+ # partial columns upate
+ sql = f'insert into {tbname}0(ts, col1, col9, col11) values(now, 100, 200, 0)'
+ tdSql.execute(sql)
+ sql = f'insert into {tbname}0(ts, col2, col5, col8) values(now, 100, 200, 300)'
+ tdSql.execute(sql)
+ sql = f'insert into {tbname}0(ts, col3, col7, col13) values(now, null, null, null)'
+ tdSql.execute(sql)
+ sql = f'insert into {tbname}0(ts) values(now)'
+ tdSql.execute(sql)
+ tdLog.info(f" insert {rows} to child table {self.child_count} .")
+
+
+ # create stream
+ def create_stream(self):
+ sql = f"create stream ma into sta subtable(concat('sta_',tbname)) \
+ as select _wstart,count(col1),af_count_bigint(col1) from {self.stbname} partition by tbname interval(1s);"
+ tdSql.execute(sql)
+ tdLog.info(sql)
+
+ # query stream
+ def verify_stream(self):
+ sql = f"select * from sta limit 10"
+ self.verify_same_value(sql, 1)
+
+ # create tmq
+ def create_tmq(self):
+ sql = f"create topic topa as select concat(col12,t12),sf_concat_var(col12,t12) from {self.stbname};"
+ tdSql.execute(sql)
+ tdLog.info(sql)
+
+ def install_taospy(self):
+ tdLog.info("install taospyudf...")
+ packs = ["taospyudf"]
+ for pack in packs:
+ subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-i', 'https://pypi.org/simple', '-U', pack])
+ tdLog.info("call ldconfig...")
+ os.system("ldconfig")
+ tdLog.info("install taospyudf successfully.")
+
+ # run
+ def run(self):
+ self.install_taospy()
+
+ # var
+ stable = "meters"
+ tbname = "d"
+ count = 10
+ rows = 5000
+ # do
+ self.create_table(stable, tbname, count)
+
+ # create
+ self.create_scalar_udfpy()
+ self.create_aggr_udfpy()
+
+ # create stream
+ self.create_stream()
+
+ # create tmq
+ self.create_tmq()
+
+ # insert data
+ self.insert_data(tbname, rows)
+
+ # query
+ self.query_scalar_udfpy()
+ self.query_aggr_udfpy()
+
+ # show performance
+
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/0-others/user_manage.py b/tests/system-test/0-others/user_manage.py
index 6f90a2873afa4e08c1ec4b72457b6cba9f232d48..1e33d4bb1c628bd43569b68d8f7fc07e68f2bec8 100644
--- a/tests/system-test/0-others/user_manage.py
+++ b/tests/system-test/0-others/user_manage.py
@@ -115,6 +115,7 @@ class TDTestCase:
jiacy0_read_conn = taos.connect(user='jiacy0_read', password='123')
jiacy0_write_conn = taos.connect(user='jiacy0_write', password='123')
jiacy0_none_conn = taos.connect(user='jiacy0_none', password='123')
+ tdSql.execute('alter database db wal_retention_period 3600')
tdSql.execute('create topic root_db as select * from db.stb')
for user in [jiacy1_all_conn, jiacy1_read_conn, jiacy0_all_conn, jiacy0_read_conn]:
user.execute(f'create topic db_jiacy as select * from db.stb')
diff --git a/tests/system-test/0-others/walFileIdex.py b/tests/system-test/0-others/walFileIdex.py
index cd34c7e5e30315df92b0f0aa4c0dda7c460b450a..f8309519cd77a63d863105a8a1cd2227021a4ff4 100644
--- a/tests/system-test/0-others/walFileIdex.py
+++ b/tests/system-test/0-others/walFileIdex.py
@@ -58,7 +58,7 @@ class TDTestCase:
#stream
tdSql.execute("drop database if exists source_db;")
- tdSql.query("create database source_db vgroups 3;")
+ tdSql.query("create database source_db vgroups 3 wal_retention_period 3600;")
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);")
diff --git a/tests/system-test/0-others/walRetention.py b/tests/system-test/0-others/walRetention.py
new file mode 100644
index 0000000000000000000000000000000000000000..2b340b79697f874a1e300970fac74f90529f0cc9
--- /dev/null
+++ b/tests/system-test/0-others/walRetention.py
@@ -0,0 +1,472 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+#
+# The option for wal_retetion_period and wal_retention_size is work well
+#
+
+import taos
+from taos.tmq import Consumer
+
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.common import *
+from util.sqlset import *
+
+
+import os
+import threading
+import json
+import time
+from datetime import date
+from datetime import datetime
+from datetime import timedelta
+from os import path
+
+
+#
+# -------------- util --------------------------
+#
+def pathSize(path):
+
+ total_size = 0
+ for dirpath, dirnames, filenames in os.walk(path):
+ for i in filenames:
+ # use join to concatenate all the components of path
+ f = os.path.join(dirpath, i)
+ # use getsize to generate size in bytes and add it to the total size
+ total_size += os.path.getsize(f)
+ # print(dirpath)
+
+ print(" %s %.02f MB" % (path, total_size/1024/1024))
+ return total_size
+
+
+# load json from file
+def jsonFromFile(jsonFile):
+ fp = open(jsonFile)
+ return json.load(fp)
+
+
+#
+# ----------------- class ------------------
+#
+
+# wal file object
+class WalFile:
+ def __init__(self, pathFile, fileName):
+ self.mtime = os.path.getmtime(pathFile)
+ self.startVer = int(fileName)
+ self.fsize = os.path.getsize(pathFile)
+ self.endVer = -1
+ self.pathFile = pathFile
+
+ def needDelete(self, delTsLine):
+ return True
+
+# VNode object
+class VNode :
+ # init
+ def __init__(self, dnodeId, path, walPeriod, walSize, walStayRange):
+ self.path = path
+ self.dnodeId = dnodeId
+ self.vgId = 0
+ self.snapVer = 0
+ self.firstVer = 0
+ self.lastVer = -1
+ self.walPeriod = walPeriod
+ self.walSize = walSize
+ self.walStayRange = walStayRange
+ self.walFiles = []
+ self.load(path)
+
+ # load
+ def load(self, path):
+ # load wal
+ walPath = os.path.join(path, "wal")
+ metaFile = ""
+ with os.scandir(walPath) as items:
+ for item in items:
+ if item.is_file():
+ fileName, fileExt = os.path.splitext(item.name)
+ pathFile = os.path.join(walPath, item)
+ if fileExt == ".log":
+ self.walFiles.append(WalFile(pathFile, fileName))
+ elif fileExt == "":
+ if fileName[:8] == "meta-ver":
+ metaFile = pathFile
+ # load config
+ tdLog.info(f' meta-ver file={metaFile}')
+ if metaFile != "":
+ jsonVer = jsonFromFile(metaFile)
+ metaNode = jsonVer["meta"]
+ self.snapVer = int(metaNode["snapshotVer"])
+ self.firstVer = int(metaNode["firstVer"])
+ self.lastVer = int(metaNode["lastVer"])
+
+ # sort with startVer
+ self.walFiles = sorted(self.walFiles, key=lambda x : x.startVer, reverse=True)
+ # set endVer
+ startVer = -1
+ for walFile in self.walFiles:
+ if startVer == -1:
+ startVer = walFile.startVer
+ continue
+ walFile.endVer = startVer - 1
+ startVer = walFile.startVer
+
+ # print total
+ tdLog.info(f" ---- dnode{self.dnodeId} snapVer={self.snapVer} firstVer={self.firstVer} lastVer={self.lastVer} {self.path} --------")
+ for walFile in self.walFiles:
+ mt = datetime.fromtimestamp(walFile.mtime)
+ tdLog.info(f" {walFile.pathFile} {mt} startVer={walFile.startVer} endVer={walFile.endVer}")
+
+ # snapVer compare
+ def canDelete(self, walFile):
+ if walFile.endVer == -1:
+ # end file
+ return False
+
+ # check snapVer
+ ret = False
+ if self.snapVer > walFile.endVer:
+ ret = True
+
+ # check stayRange
+ if self.lastVer != -1 and ret:
+ # first wal file ignore
+ if walFile.startVer == self.firstVer:
+ tdLog.info(f" {walFile.pathFile} can del, but is first. snapVer={self.snapVer} firstVer={self.firstVer}")
+ return False
+
+ # ver in stay range
+ smallVer = self.snapVer - self.walStayRange -1
+ if walFile.startVer >= smallVer:
+ tdLog.info(f" {walFile.pathFile} can del, but range not arrived. snapVer={self.snapVer} smallVer={smallVer}")
+ return False
+
+ return ret
+
+ # get log size
+ def getWalsSize(self):
+ size = 0
+ for walFile in self.walFiles:
+ size += walFile.fsize
+
+ return size
+
+ # vnode
+ def check_retention(self):
+ #
+ # check period
+ #
+ delta = self.walPeriod
+ if self.walPeriod == 0:
+ delta += 1 * 60 # delete after 1 minutes
+ elif self.walPeriod < 3600:
+ delta += 3 * 60 # 5 minutes
+ else:
+ delta += 5 * 60 # 10 minutes
+
+ delTsLine = datetime.now() - timedelta(seconds = delta)
+ delTs = delTsLine.timestamp()
+ for walFile in self.walFiles:
+ mt = datetime.fromtimestamp(walFile.mtime)
+ info = f" {walFile.pathFile} mt={mt} line={delTsLine} start={walFile.startVer} snap={self.snapVer} end= {walFile.endVer}"
+ tdLog.info(info)
+ if walFile.mtime < delTs and self.canDelete(walFile):
+ # wait a moment then check file exist
+ time.sleep(1)
+ if os.path.exists(walFile.pathFile):
+ #report error
+ tdLog.exit(f" wal file expired need delete. \n {walFile.pathFile} \n modify time={mt} \n delTsLine={delTsLine}\n start={walFile.startVer} snap={self.snapVer} end= {walFile.endVer}")
+ return False
+
+ #
+ # check size
+ #
+ if self.walSize == 0:
+ return True
+
+ vnodeSize = self.getWalsSize()
+ if vnodeSize < self.walSize:
+ tdLog.info(f" wal size valid. {self.path} real = {vnodeSize} set = {self.walSize} ")
+ return True
+
+ # check valid
+ tdLog.info(f" wal size over set. {self.path} real = {vnodeSize} set = {self.walSize} ")
+ for walFile in self.walFiles:
+ if self.canDelete(walFile):
+ # wait a moment then check file exist
+ time.sleep(1)
+ if os.path.exists(walFile.pathFile):
+ tdLog.exit(f" wal file size over .\
+ \n wal file = {walFile.pathFile}\
+ \n snapVer = {self.snapVer}\
+ \n real = {vnodeSize} bytes\
+ \n set = {self.walSize} bytes")
+ return False
+ return True
+
+
+# insert by async
+def thread_insert(testCase, tbname, rows):
+ print(f"start thread... {tbname} - {rows} \n")
+ new_conn = testCase.new_connect()
+ testCase.insert_data(tbname, rows, new_conn)
+ new_conn.close()
+ print("end thread\n")
+
+# case
+class TDTestCase:
+ def init(self, conn, logSql, replicaVar=1):
+ self.ts = 1670000000000
+ self.replicaVar = int(replicaVar)
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor())
+ self.setsql = TDSetSql()
+ self.conn = conn
+
+ # init cluster path
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+ self.projDir = f"{projPath}sim/"
+ tdLog.info(f" init projPath={self.projDir}")
+
+ self.column_dict = {
+ 'ts': 'timestamp',
+ 'col1': 'tinyint',
+ 'col2': 'smallint',
+ 'col3': 'int',
+ 'col4': 'bigint',
+ 'col5': 'tinyint unsigned',
+ 'col6': 'smallint unsigned',
+ 'col7': 'int unsigned',
+ 'col8': 'bigint unsigned',
+ 'col9': 'float',
+ 'col10': 'double',
+ 'col11': 'bool',
+ 'col12': 'varchar(120)',
+ 'col13': 'nchar(100)',
+ }
+ self.tag_dict = {
+ 't1': 'tinyint',
+ 't2': 'smallint',
+ 't3': 'int',
+ 't4': 'bigint',
+ 't5': 'tinyint unsigned',
+ 't6': 'smallint unsigned',
+ 't7': 'int unsigned',
+ 't8': 'bigint unsigned',
+ 't9': 'float',
+ 't10': 'double',
+ 't11': 'bool',
+ 't12': 'varchar(120)',
+ 't13': 'nchar(100)',
+ }
+
+ # malloc new connect
+ def new_connect(self):
+ return taos.connect(host = self.conn._host,
+ user = self.conn._user,
+ password = self.conn._password,
+ database = self.dbname,
+ port = self.conn._port,
+ config = self.conn._config)
+
+ def set_stb_sql(self,stbname,column_dict,tag_dict):
+ column_sql = ''
+ tag_sql = ''
+ for k,v in column_dict.items():
+ column_sql += f"{k} {v}, "
+ for k,v in tag_dict.items():
+ tag_sql += f"{k} {v}, "
+ create_stb_sql = f'create stable {stbname} ({column_sql[:-2]}) tags ({tag_sql[:-2]})'
+ return create_stb_sql
+
+ def create_database(self, dbname, wal_period, wal_size_kb, vgroups):
+ self.wal_period = wal_period
+ self.wal_size = wal_size_kb * 1024
+ self.vgroups = vgroups
+ self.dbname = dbname
+ tdSql.execute(f"create database {dbname} wal_retention_period {wal_period} wal_retention_size {wal_size_kb} vgroups {vgroups} replica 3")
+ tdSql.execute(f'use {dbname}')
+
+ # create stable and child tables
+ def create_table(self, stbname, tbname, count):
+ self.child_count = count
+ self.stbname = stbname
+ self.tbname = tbname
+
+ # create stable
+ create_table_sql = self.set_stb_sql(stbname, self.column_dict, self.tag_dict)
+ tdSql.execute(create_table_sql)
+
+ batch_size = 1000
+ # create child table
+ for i in range(count):
+ ti = i % 128
+ tags = f'{ti},{ti},{i},{i},{ti},{ti},{i},{i},{i}.000{i},{i}.000{i},true,"var{i}","nch{i}"'
+ sql = f'create table {tbname}{i} using {stbname} tags({tags});'
+ tdSql.execute(sql)
+ if i % batch_size == 0:
+ tdLog.info(f" create child table {i} ...")
+
+ tdLog.info(f" create {count} child tables ok.")
+
+
+ # insert to child table d1 data
+ def insert_data(self, tbname, insertTime):
+ start = time.time()
+ values = ""
+ child_name = ""
+ cnt = 0
+ rows = 10000000000
+ for j in range(rows):
+ for i in range(self.child_count):
+ tj = j % 128
+ cols = f'{tj},{tj},{j},{j},{tj},{tj},{j},{j},{j}.000{j},{j}.000{j},true,"var{j}","nch{j}涛思数据codepage is utf_32_le"'
+ sql = f'insert into {tbname}{i} values ({self.ts},{cols});'
+ tdSql.execute(sql)
+ self.ts += 1
+ #tdLog.info(f" child table={i} rows={j} insert data.")
+ cost = time.time() - start
+ if j % 100 == 0:
+ tdSql.execute(f"flush database {self.dbname}")
+ tdLog.info(" insert row cost time = %ds rows = %d"%(cost, j))
+ self.consume_topic("topic1", 5)
+
+ if cost > insertTime and j > 100:
+ tdLog.info(" insert finished. cost time = %ds rows = %d"%(cost, j))
+ return
+
+ # create tmq
+ def create_tmq(self):
+ sql = f"create topic topic1 as select ts, col1, concat(col12,t12) from {self.stbname};"
+ tdSql.execute(sql)
+ sql = f"create topic topic2 as select * from {self.stbname};"
+ tdSql.execute(sql)
+ #tdLog.info(sql)
+
+ def check_retention(self, walStayRange):
+ # flash database
+ tdSql.execute(f"flush database {self.dbname}")
+ time.sleep(0.5)
+
+ vnodes = []
+ # put all vnode to list
+ for dnode in os.listdir(self.projDir):
+ vnodeDir = self.projDir + f"{dnode}/data/vnode/"
+ print(f"vnodeDir={vnodeDir}")
+ if os.path.isdir(vnodeDir) == False or dnode[:5] != "dnode":
+ continue
+ # enum all vnode
+ for entry in os.listdir(vnodeDir):
+ entryPath = path.join(vnodeDir, entry)
+
+ if os.path.isdir(entryPath):
+ if path.exists(path.join(entryPath, "vnode.json")):
+ vnode = VNode(int(dnode[5:]), entryPath, self.wal_period, self.wal_size, walStayRange)
+ vnodes.append(vnode)
+
+ # do check
+ for vnode in vnodes:
+ vnode.check_retention()
+
+ # consume topic
+ def consume_topic(self, topic_name, consume_cnt):
+ print("start consume...")
+ consumer = Consumer(
+ {
+ "group.id": "tg2",
+ "td.connect.user": "root",
+ "td.connect.pass": "taosdata",
+ "enable.auto.commit": "true",
+ }
+ )
+ print("start subscrite...")
+ consumer.subscribe([topic_name])
+
+ cnt = 0
+ try:
+ while True and cnt < consume_cnt:
+ res = consumer.poll(1)
+ if not res:
+ break
+ err = res.error()
+ if err is not None:
+ raise err
+ val = res.value()
+ cnt += 1
+ print(f" consume {cnt} ")
+ for block in val:
+ print(block.fetchall())
+ finally:
+ consumer.unsubscribe()
+ consumer.close()
+
+
+ # test db1
+ def test_db(self, dbname, checkTime ,wal_period, wal_size_kb):
+ # var
+ stable = "meters"
+ tbname = "d"
+ vgroups = 6
+ count = 10
+
+ # do
+ self.create_database(dbname, wal_period, wal_size_kb, vgroups)
+ self.create_table(stable, tbname, count)
+
+ # create tmq
+ self.create_tmq()
+
+ # insert data
+ self.insert_data(tbname, checkTime)
+
+ #stopInsert = False
+ #tobj = threading.Thread(target = thread_insert, args=(self, tbname, rows))
+ #tobj.start()
+
+ # check retention
+ tdLog.info(f" -------------- do check retention ---------------")
+ self.check_retention(walStayRange = 256)
+
+
+ # stop insert and wait exit
+ tdLog.info(f" {dbname} stop insert ...")
+ tdLog.info(f" {dbname} test_db end.")
+
+
+ # run
+ def run(self):
+ # period
+ #self.test_db("db1", 10, 60, 0)
+ # size
+ #self.test_db("db2", 5, 10*24*3600, 2*1024) # 2M size
+
+ # period + size
+ self.test_db("db", checkTime = 5*60, wal_period = 60, wal_size_kb=10)
+ #self.test_db("db", checkTime = 3*60, wal_period = 0, wal_size_kb=0)
+
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/1-insert/drop.py b/tests/system-test/1-insert/drop.py
index a8bfea27415a2b89d230e14d95d2c8a2871ade29..9954b3557e23df193a4c4f84c819fc508c39f5bb 100644
--- a/tests/system-test/1-insert/drop.py
+++ b/tests/system-test/1-insert/drop.py
@@ -54,7 +54,7 @@ class TDTestCase:
insert_list = []
self.setsql.insert_values(column_dict,i,insert_sql,insert_list,self.ts)
def drop_ntb_check(self):
- tdSql.execute(f'create database if not exists {self.dbname} replica {self.replicaVar}')
+ tdSql.execute(f'create database if not exists {self.dbname} replica {self.replicaVar} wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}')
tdSql.execute(self.setsql.set_create_normaltable_sql(self.ntbname,self.column_dict))
self.insert_data(self.column_dict,self.ntbname,self.rowNum)
@@ -80,7 +80,7 @@ class TDTestCase:
tag_values = [
f'1'
]
- tdSql.execute(f"create database if not exists {self.dbname} replica {self.replicaVar}")
+ tdSql.execute(f"create database if not exists {self.dbname} replica {self.replicaVar} wal_retention_period 3600")
tdSql.execute(f'use {self.dbname}')
tdSql.execute(self.setsql.set_create_stable_sql(stbname,self.column_dict,tag_dict))
for i in range(self.tbnum):
@@ -116,7 +116,7 @@ class TDTestCase:
tdSql.checkRows(self.tbnum)
tdSql.execute(f'drop database {self.dbname}')
def drop_topic_check(self):
- tdSql.execute(f'create database {self.dbname} replica {self.replicaVar}')
+ tdSql.execute(f'create database {self.dbname} replica {self.replicaVar} wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}')
stbname = tdCom.getLongName(5,"letters")
topic_name = tdCom.getLongName(5,"letters")
@@ -132,7 +132,7 @@ class TDTestCase:
tdSql.execute(f'drop database {self.dbname}')
def drop_stream_check(self):
- tdSql.execute(f'create database {self.dbname} replica 1')
+ tdSql.execute(f'create database {self.dbname} replica 1 wal_retention_period 3600')
tdSql.execute(f'use {self.dbname}')
stbname = tdCom.getLongName(5,"letters")
stream_name = tdCom.getLongName(5,"letters")
diff --git a/tests/system-test/1-insert/mutil_stage.py b/tests/system-test/1-insert/mutil_stage.py
index 8780ecc477f6c6a9ec1076967aa27da63eb09f97..970554c6c17f8b50eb9261dfe1da2f307740cbd0 100644
--- a/tests/system-test/1-insert/mutil_stage.py
+++ b/tests/system-test/1-insert/mutil_stage.py
@@ -75,7 +75,7 @@ class TDTestCase:
tdLog.exit(cmd)
def cfg_str(self, filename, update_str):
- cmd = f'echo "{update_str}" >> {filename}'
+ cmd = f'echo {update_str} >> {filename}'
if os.system(cmd) != 0:
tdLog.exit(cmd)
@@ -94,41 +94,41 @@ class TDTestCase:
def __err_cfg(self):
cfg_list = []
err_case1 = [
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE1}1 {L1} {PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE1}1 {L1} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}"
]
err_case2 = [
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L2} {PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L2} {PRIMARY_DIR}"
]
err_case3 = [
- f"dataDir {self.taos_data_dir}/data33 3 {NON_PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}data33 3 {NON_PRIMARY_DIR}"
]
err_case4 = [
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L1} {NON_PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L1} {NON_PRIMARY_DIR}"
]
- err_case5 = [f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {PRIMARY_DIR}"]
+ err_case5 = [f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {PRIMARY_DIR}"]
for i in range(16):
- err_case5.append(f"dataDir {self.taos_data_dir}/{DATA_PRE0}{i+1} {L0} {NON_PRIMARY_DIR}")
+ err_case5.append(f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}{i+1} {L0} {NON_PRIMARY_DIR}")
err_case6 = [
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}1 {L0} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}1 {L0} {PRIMARY_DIR}",
]
err_case7 = [
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L2} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L2} {PRIMARY_DIR}",
]
err_case8 = [
- f"dataDir {self.taos_data_dir}/data33 3 {PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}data33 3 {PRIMARY_DIR}"
]
err_case9 = [
- f"dataDir {self.taos_data_dir}/data33 -1 {NON_PRIMARY_DIR}"
+ f"dataDir {self.taos_data_dir}{os.sep}data33 -1 {NON_PRIMARY_DIR}"
]
cfg_list.append(err_case1)
@@ -147,23 +147,23 @@ class TDTestCase:
def __current_cfg(self):
cfg_list = []
current_case1 = [
- #f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}1 {L0} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}"
+ #f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}1 {L0} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE1}1 {L1} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}2 {L2} {NON_PRIMARY_DIR}"
]
- #current_case2 = [f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 {L0} {PRIMARY_DIR}"]
+ #current_case2 = [f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 {L0} {PRIMARY_DIR}"]
current_case2 = []
for i in range(9):
- current_case2.append(f"dataDir {self.taos_data_dir}/{DATA_PRE0}{i+1} {L0} {NON_PRIMARY_DIR}")
+ current_case2.append(f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}{i+1} {L0} {NON_PRIMARY_DIR}")
# TD-17773bug
current_case3 = [
- #f"dataDir {self.taos_data_dir}/{DATA_PRE0}0 ",
- f"dataDir {self.taos_data_dir}/{DATA_PRE0}1 {L0} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE1}0 {L1} {NON_PRIMARY_DIR}",
- f"dataDir {self.taos_data_dir}/{DATA_PRE2}0 {L2} {NON_PRIMARY_DIR}",
+ #f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}0 ",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE0}1 {L0} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE1}0 {L1} {NON_PRIMARY_DIR}",
+ f"dataDir {self.taos_data_dir}{os.sep}{DATA_PRE2}0 {L2} {NON_PRIMARY_DIR}",
]
cfg_list.append(current_case1)
cfg_list.append(current_case3)
diff --git a/tests/system-test/2-query/cast.py b/tests/system-test/2-query/cast.py
index eb765fcc5096d0e92cfc5a142dd8c489dd023909..ede1f28324dd768a40d7ae98d140c40570e7bb88 100644
--- a/tests/system-test/2-query/cast.py
+++ b/tests/system-test/2-query/cast.py
@@ -38,11 +38,8 @@ class TDTestCase:
if data_tb_col[i] is None:
tdSql.checkData( i, 0 , None )
if col_name not in ["c2", "double"] or tbname != f"{self.dbname}.t1" or i != 10:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_tb_col[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = datetime.datetime.fromtimestamp(data_tb_col[i]/1000)
+ tdSql.checkData( i, 0, date_init_stamp)
def __range_to_timestamp(self, cols, tables):
for col in cols:
@@ -60,7 +57,7 @@ class TDTestCase:
self.__range_to_timestamp(cols=__col_list, tables=__table_list)
def all_test(self):
-
+ _datetime_epoch = datetime.datetime.fromtimestamp(0)
tdSql.query(f"select c1 from {self.dbname}.ct4")
data_ct4_c1 = [tdSql.getData(i,0) for i in range(tdSql.queryRows)]
tdSql.query(f"select c1 from {self.dbname}.t1")
@@ -99,22 +96,16 @@ class TDTestCase:
if data_ct4_c1[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_ct4_c1[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c1[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c1 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c1)):
if data_t1_c1[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_t1_c1[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c1[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step8: cast bigint to bigint, expect no changes")
@@ -156,11 +147,8 @@ class TDTestCase:
if data_ct4_c2[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_ct4_c2[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c2[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c2 as timestamp) as b from {self.dbname}.t1")
@@ -170,11 +158,8 @@ class TDTestCase:
elif i == 10:
continue
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_t1_c2[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c2[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step12: cast smallint to bigint, expect no changes")
@@ -216,22 +201,16 @@ class TDTestCase:
if data_ct4_c3[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_ct4_c3[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c3[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c3 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c3)):
if data_t1_c3[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_t1_c3[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c3[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step16: cast tinyint to bigint, expect no changes")
@@ -273,22 +252,16 @@ class TDTestCase:
if data_ct4_c4[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_ct4_c4[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c4[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c4 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c4)):
if data_t1_c4[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(data_t1_c4[i]/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c4[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step20: cast float to bigint, expect no changes")
@@ -326,21 +299,15 @@ class TDTestCase:
if data_ct4_c5[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_ct4_c5[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c5[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c5 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c5)):
if data_t1_c5[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_t1_c5[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c5[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step24: cast double to bigint, expect no changes")
tdSql.query(f"select c6 from {self.dbname}.ct4")
@@ -382,11 +349,8 @@ class TDTestCase:
if data_ct4_c6[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_ct4_c6[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c6[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c6 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c6)):
@@ -395,11 +359,8 @@ class TDTestCase:
elif i == 10:
continue
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_t1_c6[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c6[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdLog.printNoPrefix("==========step28: cast bool to bigint, expect no changes")
tdSql.query(f"select c7 from {self.dbname}.ct4")
@@ -436,21 +397,15 @@ class TDTestCase:
if data_ct4_c7[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_ct4_c7[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_ct4_c7[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select cast(c7 as timestamp) as b from {self.dbname}.t1")
for i in range(len(data_t1_c7)):
if data_t1_c7[i] is None:
tdSql.checkData( i, 0 , None )
else:
- utc_zone = datetime.timezone.utc
- utc_8 = datetime.timezone(datetime.timedelta(hours=8))
- date_init_stamp = datetime.datetime.utcfromtimestamp(int(data_t1_c7[i])/1000)
- date_data = date_init_stamp.replace(tzinfo=utc_zone).astimezone(utc_8).strftime("%Y-%m-%d %H:%M:%S.%f")
- tdSql.checkData( i, 0, date_data)
+ date_init_stamp = _datetime_epoch+datetime.timedelta(seconds=int(data_t1_c7[i]) / 1000.0)
+ tdSql.checkData( i, 0, date_init_stamp)
tdSql.query(f"select c8 from {self.dbname}.ct4")
@@ -566,7 +521,7 @@ class TDTestCase:
if data_ct4_c10[i] is None:
tdSql.checkData( i, 0, None )
else:
- time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000))
+ time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0,data_ct4_c10[i].tzinfo)).total_seconds())*1000+int(data_ct4_c10[i].microsecond / 1000))
tdSql.checkData( i, 0, time2str )
tdSql.query(f"select cast(c10 as nchar(32)) as b from {self.dbname}.t1")
for i in range(len(data_t1_c10)):
@@ -575,7 +530,7 @@ class TDTestCase:
elif i == 10:
continue
else:
- time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000))
+ time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0,data_t1_c10[i].tzinfo)).total_seconds())*1000+int(data_t1_c10[i].microsecond / 1000))
tdSql.checkData( i, 0, time2str )
tdLog.printNoPrefix("==========step38: cast timestamp to binary, expect no changes ")
@@ -584,7 +539,7 @@ class TDTestCase:
if data_ct4_c10[i] is None:
tdSql.checkData( i, 0, None )
else:
- time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000))
+ time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0,data_ct4_c10[i].tzinfo)).total_seconds())*1000+int(data_ct4_c10[i].microsecond / 1000))
tdSql.checkData( i, 0, time2str )
tdSql.query(f"select cast(c10 as binary(32)) as b from {self.dbname}.t1")
for i in range(len(data_t1_c10)):
@@ -593,7 +548,7 @@ class TDTestCase:
elif i == 10:
continue
else:
- time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000))
+ time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0,data_t1_c10[i].tzinfo)).total_seconds())*1000+int(data_t1_c10[i].microsecond / 1000))
tdSql.checkData( i, 0, time2str )
tdLog.printNoPrefix("==========step39: cast constant operation to bigint, expect change to int ")
@@ -694,7 +649,7 @@ class TDTestCase:
tdSql.query(f"select cast('123' as tinyint unsigned) as b from {self.dbname}.stb1 partition by tbname")
# uion with cast and common cols
-
+
tdSql.query(f"select cast(c2 as int) as b from {self.dbname}.stb1 union all select c1 from {self.dbname}.stb1 ")
tdSql.query(f"select cast(c3 as bool) as b from {self.dbname}.stb1 union all select c7 from {self.dbname}.ct1 ")
tdSql.query(f"select cast(c4 as tinyint) as b from {self.dbname}.stb1 union all select c4 from {self.dbname}.stb1")
diff --git a/tests/system-test/2-query/mode.py b/tests/system-test/2-query/mode.py
index 72bae552618f7e772481035c079a2d9507045d79..8321ef167585ac31d7d8086bfa24ccb34926ecb8 100644
--- a/tests/system-test/2-query/mode.py
+++ b/tests/system-test/2-query/mode.py
@@ -53,6 +53,7 @@ class TDTestCase:
( '2022-02-01 01:01:20.000', 6, 66666, 666, 66, 6.66, 66.66, 1, "binary6", "nchar6", now()+6a )
( '2022-10-28 01:01:26.000', 7, 00000, 000, 00, 0.00, 00.00, 1, "binary7", "nchar7", "1970-01-01 08:00:00.000" )
( '2022-12-01 01:01:30.000', 8, -88888, -888, -88, -8.88, -88.88, 0, "binary8", "nchar8", "1969-01-01 01:00:00.000" )
+ ( '2022-12-31 01:01:32.000', 9, -99999999999999999, -999, -99, -9.99, -999999999999999999999.99, 1, "binary9", "nchar9", "1900-01-01 00:00:00.000" )
( '2022-12-31 01:01:36.000', 9, -99999999999999999, -999, -99, -9.99, -999999999999999999999.99, 1, "binary9", "nchar9", "1900-01-01 00:00:00.000" )
( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
'''
@@ -64,61 +65,61 @@ class TDTestCase:
tdSql.query(f"select ts,mode(c1) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 9)
tdSql.query(f"select ts,mode(c2) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -99999999999999999)
tdSql.query(f"select ts,mode(c3) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -999)
tdSql.query(f"select ts,mode(c4) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -99)
tdSql.query(f"select ts,mode(c5) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -9.99)
tdSql.query(f"select ts,mode(c6) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -1e+21)
tdSql.query(f"select ts,mode(c7) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, True)
tdSql.query(f"select ts,mode(c8) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 'binary9')
tdSql.query(f"select ts,mode(c9) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 'nchar9')
tdSql.query(f"select ts,c3,c5,c8,mode(c1) from {dbname}.tb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2022, 12, 31, 1, 1, 36))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2022, 12, 31, 1, 1, 36).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -999)
tdSql.checkData(0, 2, -9.99)
tdSql.checkData(0, 3, 'binary9')
@@ -128,61 +129,61 @@ class TDTestCase:
tdSql.query(f"select ts,mode(c1) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 9)
tdSql.query(f"select ts,mode(c2) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -99999)
tdSql.query(f"select ts,mode(c3) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -999)
tdSql.query(f"select ts,mode(c4) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 2))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 2).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -99)
tdSql.query(f"select ts,mode(c5) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -9.99)
tdSql.query(f"select ts,mode(c6) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, -99.99)
tdSql.query(f"select ts,mode(c7) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, True)
tdSql.query(f"select ts,mode(c8) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 'binary9')
tdSql.query(f"select ts,mode(c9) from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 'nchar9')
tdSql.query(f"select ts,mode(c1),c3,c5,c8 from {dbname}.stb")
tdSql.checkRows(1)
ts = tdSql.getData(0, 0)
- tdSql.checkEqual(ts, datetime.datetime(2020, 12, 11, 0, 0, 3))
+ tdSql.checkEqual(ts.astimezone(datetime.timezone.utc), datetime.datetime(2020, 12, 11, 0, 0, 3).astimezone(datetime.timezone.utc))
tdSql.checkData(0, 1, 9)
tdSql.checkData(0, 2, -999)
tdSql.checkData(0, 3, -9.99)
diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py
index 9bbff4af21c078f006be27710c58ae645261d719..f9232dddf8e68ce3122df84a414240bcbbd405e7 100644
--- a/tests/system-test/2-query/odbc.py
+++ b/tests/system-test/2-query/odbc.py
@@ -22,7 +22,7 @@ class TDTestCase:
tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)")
tdSql.query("select count(*) from information_schema.ins_columns")
- tdSql.checkData(0, 0, 272)
+ tdSql.checkData(0, 0, 274)
tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'")
tdSql.checkRows(14)
diff --git a/tests/system-test/2-query/out_of_order.py b/tests/system-test/2-query/out_of_order.py
index ff2b71193b6705c7f5a0dcb54345f27a74196d18..8685b112068b5fbba72db009f6bd707a74dd6dbc 100644
--- a/tests/system-test/2-query/out_of_order.py
+++ b/tests/system-test/2-query/out_of_order.py
@@ -35,7 +35,10 @@ class TDTestCase:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
- if ("taosd" in files):
+ taosdFileName = "taosd"
+ if platform.system().lower() == 'windows':
+ taosdFileName = "taosd.exe"
+ if (taosdFileName in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
@@ -52,7 +55,10 @@ class TDTestCase:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
- os.system("%staosBenchmark -d %s -t %d -n %d -O %d -a %d -b float,double,nchar\(200\),binary\(50\) -T 50 -y " % (binPath,dbname,tables,per_table_num,order,replica))
+ cmd = "%staosBenchmark -d %s -t %d -n %d -O %d -a %d -b float,double,nchar\(200\),binary\(50\) -T 50 -y " % (binPath,dbname,tables,per_table_num,order,replica)
+ if platform.system().lower() == 'windows':
+ cmd = "%staosBenchmark -d %s -t %d -n %d -O %d -a %d -b float,double,nchar(200),binary(50) -T 50 -y " % (binPath,dbname,tables,per_table_num,order,replica)
+ os.system(cmd)
def sql_base(self,dbname):
self.check_sub(dbname)
diff --git a/tests/system-test/2-query/queryQnode.py b/tests/system-test/2-query/queryQnode.py
index fec553436c04f6b1cca231dc917874de4a883f5f..9c4091d0dfb58c05484f32cfbdd27a55c4b20dbd 100644
--- a/tests/system-test/2-query/queryQnode.py
+++ b/tests/system-test/2-query/queryQnode.py
@@ -292,9 +292,9 @@ class TDTestCase:
maxQnode=tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
minQnode=tdSql.getData(0,0)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionQnode=tdSql.queryResult
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionallQnode=tdSql.queryResult
# tdSql.query("select * from information_schema.ins_qnodes;")
@@ -306,10 +306,10 @@ class TDTestCase:
tdSql.checkData(0, 0, "%s"%maxQnode)
tdSql.query("select min(c1) from stb11;")
tdSql.checkData(0, 0, "%s"%minQnode)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionVnode=tdSql.queryResult
assert unionQnode == unionVnode
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionallVnode=tdSql.queryResult
assert unionallQnode == unionallVnode
@@ -340,9 +340,9 @@ class TDTestCase:
assert maxQnode==tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
assert minQnode==tdSql.getData(0,0)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionQnode==tdSql.queryResult
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionallQnode==tdSql.queryResult
# tdSql.query("select * from information_schema.ins_qnodes;")
@@ -354,8 +354,8 @@ class TDTestCase:
assert maxQnode==tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
assert minQnode==tdSql.getData(0,0)
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
# tdSql.execute("create qnode on dnode %s"%dnodeId)
@@ -387,9 +387,9 @@ class TDTestCase:
assert maxQnode==tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
assert minQnode==tdSql.getData(0,0)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionQnode==tdSql.queryResult
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionallQnode==tdSql.queryResult
queryPolicy=1
@@ -412,9 +412,9 @@ class TDTestCase:
assert maxQnode==tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
assert minQnode==tdSql.getData(0,0)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionQnode==tdSql.queryResult
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
assert unionallQnode==tdSql.queryResult
# test case : queryPolicy = 2
@@ -443,8 +443,8 @@ class TDTestCase:
tdSql.execute("use db1;")
tdSql.error("select max(c1) from stb10;")
tdSql.error("select min(c1) from stb11;")
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
tdSql.query("select max(c1) from stb10_0;")
tdSql.query("select min(c1) from stb11_0;")
@@ -464,9 +464,9 @@ class TDTestCase:
maxQnode=tdSql.getData(0,0)
tdSql.query("select min(c1) from stb11;")
minQnode=tdSql.getData(0,0)
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionQnode=tdSql.queryResult
- tdSql.query("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.query("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
unionallQnode=tdSql.queryResult
# tdSql.query("select * from information_schema.ins_qnodes;")
@@ -478,8 +478,8 @@ class TDTestCase:
tdSql.error("select max(c1) from stb10;")
tdSql.error("select min(c1) from stb11;")
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000;")
- tdSql.error("select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
+ tdSql.error("select c0,c1 from(select c0,c1 from stb11_1 where (c0>1000) union all select c0,c1 from stb11_1 where c0>2000) order by c0,c1;")
# run case
def run(self):
diff --git a/tests/system-test/6-cluster/5dnode1mnode.py b/tests/system-test/6-cluster/5dnode1mnode.py
index d0d9372298682f6a9ef038b82c899c99c165e73c..61451f03b1927352f9d0a227925f33227458c12f 100644
--- a/tests/system-test/6-cluster/5dnode1mnode.py
+++ b/tests/system-test/6-cluster/5dnode1mnode.py
@@ -18,7 +18,10 @@ class MyDnodes(TDDnodes):
def __init__(self ,dnodes_lists):
super(MyDnodes,self).__init__()
self.dnodes = dnodes_lists # dnode must be TDDnode instance
- self.simDeployed = False
+ if platform.system().lower() == 'windows':
+ self.simDeployed = True
+ else:
+ self.simDeployed = False
class TDTestCase:
noConn = True
diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py
index 9dd3c568054948d7062c2f87f145149509b1b575..c4b30a16f71ba1331fd3f146aa3245375326588e 100644
--- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py
+++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py
@@ -19,7 +19,10 @@ class MyDnodes(TDDnodes):
def __init__(self ,dnodes_lists):
super(MyDnodes,self).__init__()
self.dnodes = dnodes_lists # dnode must be TDDnode instance
- self.simDeployed = False
+ if platform.system().lower() == 'windows':
+ self.simDeployed = True
+ else:
+ self.simDeployed = False
class TDTestCase:
@@ -111,6 +114,8 @@ class TDTestCase:
dnode_first_host = dnode.cfgDict["firstEp"].split(":")[0]
dnode_first_port = dnode.cfgDict["firstEp"].split(":")[-1]
cmd = f" taos -h {dnode_first_host} -P {dnode_first_port} -s ' create dnode \"{dnode_id} \" ' ;"
+ if platform.system().lower() == 'windows':
+ cmd = f" taos -h {dnode_first_host} -P {dnode_first_port} -s \"create dnode \\\"{dnode_id}\\\""
tdLog.debug(cmd)
if os.system(cmd) != 0:
raise Exception("failed to execute system command. cmd: %s" % cmd)
diff --git a/tests/system-test/7-tmq/basic5.py b/tests/system-test/7-tmq/basic5.py
index 69cf378da3da0b12e56242125c49bfe33afcb3a6..080b431ffe54f43e725e22d84a3f365f8bfc4cea 100644
--- a/tests/system-test/7-tmq/basic5.py
+++ b/tests/system-test/7-tmq/basic5.py
@@ -57,7 +57,7 @@ class TDTestCase:
return cur
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -149,6 +149,7 @@ class TDTestCase:
topicFromStb = 'topic_stb_column'
topicFromCtb = 'topic_ctb_column'
+ tdSql.execute("alter database %s wal_retention_period 3600" % (parameterDict['dbName']))
tdSql.execute("create topic %s as select ts, c1, c2 from %s.%s" %(topicFromStb, parameterDict['dbName'], parameterDict['stbName']))
tdSql.execute("create topic %s as select ts, c1, c2 from %s.%s_0" %(topicFromCtb, parameterDict['dbName'], parameterDict['stbName']))
diff --git a/tests/system-test/7-tmq/create_wrong_topic.py b/tests/system-test/7-tmq/create_wrong_topic.py
index 39d519fec1be19009860408dd02d26630070af44..77d43149cd611225d2ee8f7b017013b0fc784bfb 100644
--- a/tests/system-test/7-tmq/create_wrong_topic.py
+++ b/tests/system-test/7-tmq/create_wrong_topic.py
@@ -44,6 +44,7 @@ class TDTestCase:
def wrong_topic(self):
tdSql.prepare()
tdSql.execute('use db')
+ tdSql.execute('alter database db wal_retention_period 3600')
stbname = f'db.{tdCom.getLongName(5, "letters")}'
tag_dict = {
't0':'int'
@@ -75,4 +76,4 @@ class TDTestCase:
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
-tdCases.addWindows(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py b/tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
index 808a4935e30ccec4d06863e54e5e2ff3e1ba635d..44f58279be2df9cc97ee504babebbbfda1793f44 100644
--- a/tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
+++ b/tests/system-test/7-tmq/dataFromTsdbNWal-multiCtb.py
@@ -67,6 +67,7 @@ class TDTestCase:
tdLog.info("flush db to let data falls into the disk")
tdSql.query("flush database %s"%(paraDict['dbName']))
+ tdSql.execute("alter database %s wal_retention_period 3600"%(paraDict['dbName']))
return
def tmqCase1(self):
diff --git a/tests/system-test/7-tmq/dataFromTsdbNWal.py b/tests/system-test/7-tmq/dataFromTsdbNWal.py
index 8386c22cd0430128a1b873f3f5150ef51704b245..0f4f1694c17701d9d4361c788980215ae418db5e 100644
--- a/tests/system-test/7-tmq/dataFromTsdbNWal.py
+++ b/tests/system-test/7-tmq/dataFromTsdbNWal.py
@@ -67,6 +67,7 @@ class TDTestCase:
tdLog.info("flush db to let data falls into the disk")
tdSql.query("flush database %s"%(paraDict['dbName']))
+ tdSql.execute("alter database %s wal_retention_period 3600"%(paraDict['dbName']))
return
def tmqCase1(self):
diff --git a/tests/system-test/7-tmq/db.py b/tests/system-test/7-tmq/db.py
index 04f5aac559b060e17b23618cea1007e41ffb858d..e0d1e2c5b6190ed28f9e8ad9f3e4c8b15d57bb51 100644
--- a/tests/system-test/7-tmq/db.py
+++ b/tests/system-test/7-tmq/db.py
@@ -60,7 +60,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
tdSql.query("drop database if exists %s "%(cdbName))
- tdSql.query("create database %s vgroups 1"%(cdbName))
+ tdSql.query("create database %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
diff --git a/tests/system-test/7-tmq/dropDbR3ConflictTransaction.py b/tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
index 4371a909c253b3aaf1f7f4d5fad931ee35665519..fa22cad726ee700dd05350d0d03d5463bfbbcdec 100644
--- a/tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
+++ b/tests/system-test/7-tmq/dropDbR3ConflictTransaction.py
@@ -134,6 +134,7 @@ class TDTestCase:
paraDict['ctbNum'] = self.ctbNum
paraDict['rowsPerTbl'] = self.rowsPerTbl
+ tdSql.execute("alter database dbt wal_retention_period 3600")
tdLog.info("create topics from stb1")
topicFromStb1 = 'topic_stb1'
queryString = "select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha' "%(paraDict['dbName'], paraDict['stbName'])
diff --git a/tests/system-test/7-tmq/schema.py b/tests/system-test/7-tmq/schema.py
index 04224fbc7e86d177829f898855067986aae81746..95c1839964eeb20ac9aa1672713527d197c179b1 100644
--- a/tests/system-test/7-tmq/schema.py
+++ b/tests/system-test/7-tmq/schema.py
@@ -60,7 +60,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
tdSql.query("drop database if exists %s "%(cdbName))
- tdSql.query("create database %s vgroups 1"%(cdbName))
+ tdSql.query("create database %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -115,7 +115,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/stbFilter.py b/tests/system-test/7-tmq/stbFilter.py
index 6b48a6d57076b4baf54d7c08db7cd8a625fab29c..3f862ae0472f6a1312ac5f2ea680adbd4b95f172 100644
--- a/tests/system-test/7-tmq/stbFilter.py
+++ b/tests/system-test/7-tmq/stbFilter.py
@@ -45,6 +45,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tmqCom.create_database(tsql=tdSql, dbName=paraDict["dbName"],dropFlag=paraDict["dropFlag"], vgroups=paraDict['vgroups'],replica=paraDict['replica'])
+ tdSql.execute("alter database %s wal_retention_period 3600"%(paraDict["dbName"]))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/stbTagFilter-1ctb.py b/tests/system-test/7-tmq/stbTagFilter-1ctb.py
index c4a7c8cae5551c6374d683f941148f8f054dd53c..7ee5fce5a81ffb50341a61497f5616b03040d998 100644
--- a/tests/system-test/7-tmq/stbTagFilter-1ctb.py
+++ b/tests/system-test/7-tmq/stbTagFilter-1ctb.py
@@ -106,6 +106,7 @@ class TDTestCase:
# ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],
# startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx'])
+ tdSql.execute("alter database dbt wal_retention_period 3600")
tdLog.info("create topics from stb1")
topicFromStb1 = 'topic_UpperCase_stb1'
# queryString = "select ts, c1, c2 from %s.%s where t4 == 'shanghai' or t4 == 'changsha'"%(paraDict['dbName'], paraDict['stbName'])
diff --git a/tests/system-test/7-tmq/stbTagFilter-multiCtb.py b/tests/system-test/7-tmq/stbTagFilter-multiCtb.py
index c380d201b2d8827c6e3d12f03a0168ed47af0362..71b7fdef5d6a2fc072b7a21ef4205ea7a651bce2 100644
--- a/tests/system-test/7-tmq/stbTagFilter-multiCtb.py
+++ b/tests/system-test/7-tmq/stbTagFilter-multiCtb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" %(paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/subscribeDb.py b/tests/system-test/7-tmq/subscribeDb.py
index 41db943f835d4b7d6ed11a83aa14a7ad53ad47df..631813e7ab864d486411bbd437079181ba9711bb 100644
--- a/tests/system-test/7-tmq/subscribeDb.py
+++ b/tests/system-test/7-tmq/subscribeDb.py
@@ -52,7 +52,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -99,7 +99,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -180,7 +180,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -278,7 +278,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -345,7 +345,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
tdSql.execute("create table if not exists %s.%s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%(parameterDict['dbName'], parameterDict['stbName']))
tdLog.info("create topics from db")
@@ -415,7 +415,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/7-tmq/subscribeDb0.py b/tests/system-test/7-tmq/subscribeDb0.py
index 50ef52cb15a5336395154813619976c7933f2dc7..ed13fcbe06be1c82590752b7257528190b972192 100644
--- a/tests/system-test/7-tmq/subscribeDb0.py
+++ b/tests/system-test/7-tmq/subscribeDb0.py
@@ -52,7 +52,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -99,7 +99,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -180,7 +180,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -262,7 +262,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/7-tmq/subscribeDb1.py b/tests/system-test/7-tmq/subscribeDb1.py
index 89bf337a20a8c41b27ac453cd6c96946ea3c5ebd..605e862950799b81fe57451a94e62ba086fa0a47 100644
--- a/tests/system-test/7-tmq/subscribeDb1.py
+++ b/tests/system-test/7-tmq/subscribeDb1.py
@@ -52,7 +52,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -99,7 +99,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -180,8 +180,8 @@ class TDTestCase:
parameterDict['cfg'] = cfgPath
self.initConsumerTable()
- tdLog.info("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdLog.info("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -197,7 +197,7 @@ class TDTestCase:
'startTs': 1640966400000} # 2022-01-01 00:00:00.000
parameterDict['cfg'] = cfgPath
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict2['dbName'], parameterDict2['vgroups'], parameterDict2['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict2['dbName'], parameterDict2['vgroups'], parameterDict2['replica']))
prepareEnvThread2 = threading.Thread(target=self.prepareEnv, kwargs=parameterDict2)
prepareEnvThread2.start()
@@ -268,7 +268,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups'], parameterDict['replica']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -284,7 +284,7 @@ class TDTestCase:
'startTs': 1640966400000} # 2022-01-01 00:00:00.000
parameterDict['cfg'] = cfgPath
- tdSql.execute("create database if not exists %s vgroups %d replica %d" %(parameterDict2['dbName'], parameterDict2['vgroups'], parameterDict2['replica']))
+ tdSql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600" %(parameterDict2['dbName'], parameterDict2['vgroups'], parameterDict2['replica']))
prepareEnvThread2 = threading.Thread(target=self.prepareEnv, kwargs=parameterDict2)
prepareEnvThread2.start()
diff --git a/tests/system-test/7-tmq/subscribeDb2.py b/tests/system-test/7-tmq/subscribeDb2.py
index d045842e45f4f526e5916081774177b22847ef11..60cde8d7f0940a8427e7f76ae31f5c682e36ca57 100644
--- a/tests/system-test/7-tmq/subscribeDb2.py
+++ b/tests/system-test/7-tmq/subscribeDb2.py
@@ -53,7 +53,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -100,7 +100,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -185,7 +185,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -263,7 +263,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/7-tmq/subscribeDb3.py b/tests/system-test/7-tmq/subscribeDb3.py
index 747ea3ba86c56a4008014e044fad5de6f8536f32..f82f89f1b9f37ab77ccea3368ccd1d5c51d861e7 100644
--- a/tests/system-test/7-tmq/subscribeDb3.py
+++ b/tests/system-test/7-tmq/subscribeDb3.py
@@ -52,7 +52,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
tdSql.query("drop table if exists %s.notifyinfo "%(cdbName))
@@ -122,7 +122,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -203,7 +203,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -280,7 +280,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/7-tmq/subscribeDb4.py b/tests/system-test/7-tmq/subscribeDb4.py
index c14d3b27b11fa8e36bd216f23a2371018358aaf0..764362c70882e0851d3cd5eb80ac4f0096a71113 100644
--- a/tests/system-test/7-tmq/subscribeDb4.py
+++ b/tests/system-test/7-tmq/subscribeDb4.py
@@ -65,6 +65,7 @@ class TDTestCase:
tmqCom.initConsumerTable(self.cdbName)
tdCom.create_database(tdSql,self.paraDict["dbName"],self.paraDict["dropFlag"])
+ tdSql.execute("alter database %s wal_retention_period 3600" % (self.paraDict['dbName']))
self.paraDict["stbName"] = 'stb1'
tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"])
diff --git a/tests/system-test/7-tmq/subscribeStb.py b/tests/system-test/7-tmq/subscribeStb.py
index 3ff0b25ff6b4585a8abc4061e7e46abced77d15e..c8b66adfa2db404941838e64170be41f27ad24b5 100644
--- a/tests/system-test/7-tmq/subscribeStb.py
+++ b/tests/system-test/7-tmq/subscribeStb.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/subscribeStb0.py b/tests/system-test/7-tmq/subscribeStb0.py
index 1463cad627a23dd106d6afb78a4ee274345a840f..717cf05bdc6d3dfa4d27c915d57fbe3bf61b8e60 100644
--- a/tests/system-test/7-tmq/subscribeStb0.py
+++ b/tests/system-test/7-tmq/subscribeStb0.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/subscribeStb1.py b/tests/system-test/7-tmq/subscribeStb1.py
index 3dc3528d047cd5f8685193374d214418c1b6b929..6d4b7d2380161be0b4baaded864a782f8dbd86f5 100644
--- a/tests/system-test/7-tmq/subscribeStb1.py
+++ b/tests/system-test/7-tmq/subscribeStb1.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/subscribeStb2.py b/tests/system-test/7-tmq/subscribeStb2.py
index 6c3e122902cc907dacd8297d95f27c6289cad176..422cb23ffd1c503873cde2ca6b26ae6763a899c8 100644
--- a/tests/system-test/7-tmq/subscribeStb2.py
+++ b/tests/system-test/7-tmq/subscribeStb2.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/subscribeStb3.py b/tests/system-test/7-tmq/subscribeStb3.py
index 025f403282e46eab4893062069bcea820124203b..7205e846205e87cfa4589f01bc6a76c29fda4986 100644
--- a/tests/system-test/7-tmq/subscribeStb3.py
+++ b/tests/system-test/7-tmq/subscribeStb3.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/subscribeStb4.py b/tests/system-test/7-tmq/subscribeStb4.py
index 6aa3da66a46b316c55b2586bfc4c82f96fc33a8c..bb8afcf14ee300231e44c2766ac61d3420f237f1 100644
--- a/tests/system-test/7-tmq/subscribeStb4.py
+++ b/tests/system-test/7-tmq/subscribeStb4.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -114,7 +114,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/tmq3mnodeSwitch.py b/tests/system-test/7-tmq/tmq3mnodeSwitch.py
index 7c95f7a3dbd1983c1c1ecd7e910c152eac6ca477..22ef8cebdc1f367d8d95010087e15b2eaf2f72e8 100644
--- a/tests/system-test/7-tmq/tmq3mnodeSwitch.py
+++ b/tests/system-test/7-tmq/tmq3mnodeSwitch.py
@@ -200,6 +200,7 @@ class TDTestCase:
tdLog.info("async insert data")
pThread = tmqCom.asyncInsertData(paraDict)
+ tdSql.execute("alter database %s wal_retention_period 3600" %(paraDict['dbName']))
tdLog.info("create topics from stb with filter")
# queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName'])
diff --git a/tests/system-test/7-tmq/tmqAlterSchema.py b/tests/system-test/7-tmq/tmqAlterSchema.py
index a70678219f15ba94b7f9ceb1f81b9aa3881660d4..1a8b0693b86cae8d12eaeb11f3af91f587a23a6f 100644
--- a/tests/system-test/7-tmq/tmqAlterSchema.py
+++ b/tests/system-test/7-tmq/tmqAlterSchema.py
@@ -65,6 +65,7 @@ class TDTestCase:
queryStringList = []
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" %(paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ctb")
@@ -175,6 +176,7 @@ class TDTestCase:
queryStringList = []
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" %(paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ntb")
diff --git a/tests/system-test/7-tmq/tmqAutoCreateTbl.py b/tests/system-test/7-tmq/tmqAutoCreateTbl.py
index 41073d83ae13b5a3828bbc758d8d1d2c600f8ca6..5d0af636b206e5c13ca403dd35c70fabeb2601cd 100644
--- a/tests/system-test/7-tmq/tmqAutoCreateTbl.py
+++ b/tests/system-test/7-tmq/tmqAutoCreateTbl.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1, wal_retention_size=-1,wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
# tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqCheckData.py b/tests/system-test/7-tmq/tmqCheckData.py
index 04d0744ab595279ac834e62669cb100df113d253..a9671241a966ea632f31726349580a8e7152f440 100644
--- a/tests/system-test/7-tmq/tmqCheckData.py
+++ b/tests/system-test/7-tmq/tmqCheckData.py
@@ -80,6 +80,7 @@ class TDTestCase:
tdLog.info("insert data")
tmqCom.insert_data(tdSql,paraDict["dbName"],paraDict["ctbPrefix"],paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"])
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create topics from stb with filter")
queryString = "select ts, log(c1), ceil(pow(c1,3)) from %s.%s where c1 %% 7 == 0" %(paraDict['dbName'], paraDict['stbName'])
sqlString = "create topic %s as %s" %(topicNameList[0], queryString)
diff --git a/tests/system-test/7-tmq/tmqCheckData1.py b/tests/system-test/7-tmq/tmqCheckData1.py
index b9dac62833ba45dc63fca65e1b6f642265b655dd..e06c29c5a2770ec7f2e2a34d391495ee24399f0c 100644
--- a/tests/system-test/7-tmq/tmqCheckData1.py
+++ b/tests/system-test/7-tmq/tmqCheckData1.py
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqCommon.py b/tests/system-test/7-tmq/tmqCommon.py
index 895da95e5d5d8280b9e420b2803681674dab5bc2..1e636e207441e7794f312ffa00e27accde0eccbe 100644
--- a/tests/system-test/7-tmq/tmqCommon.py
+++ b/tests/system-test/7-tmq/tmqCommon.py
@@ -129,11 +129,16 @@ class TMQCom:
def stopTmqSimProcess(self, processorName):
psCmd = "unset LD_PRELOAD; ps -ef|grep -w %s|grep -v grep | awk '{print $2}'"%(processorName)
+ if platform.system().lower() == 'windows':
+ psCmd = "ps -ef|grep -w %s|grep -v grep | awk '{print $2}'"%(processorName)
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
onlyKillOnceWindows = 0
while(processID):
if not platform.system().lower() == 'windows' or (onlyKillOnceWindows == 0 and platform.system().lower() == 'windows'):
- killCmd = "unset LD_PRELOAD; kill -INT %s > /dev/null 2>&1" % processID
+ if platform.system().lower() == 'windows':
+ killCmd = "kill -INT %s > /dev/nul 2>&1" % processID
+ else:
+ killCmd = "unset LD_PRELOAD; kill -INT %s > /dev/null 2>&1" % processID
os.system(killCmd)
onlyKillOnceWindows = 1
time.sleep(0.2)
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py b/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
index f372a2b7428a77b02b8dcdb5c4c546756ef7e1f7..3ad1d097e11b85f04f1d0cc9b2cd75a9ea1bdb0a 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py b/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
index c7f95f6f41cbf72e8d64c3a9bd8218dfd7a1c6d5..fdd683d08daba5625017029a3363b379d2a206b1 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb-1ctb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
index 26dacf514d4f66273d36f6ac3fe49ee17602747a..f05f0abeff3f3f6dabde18ac3d3543d9df032f4e 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
index d6f100041b15c205e8294cca964353d880b9ecc4..75b49a34fc583217e5ee0bb81324abc8421ed31a 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
index 11fc7dbcc0587b20fd65bc71047ba04c1adb3f91..26f7a9fb4d1300907807651a5e2fd9dd80579725 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb-mutilVg.py
@@ -56,6 +56,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb.py b/tests/system-test/7-tmq/tmqConsFromTsdb.py
index 8ed4a6df973b57f7302d5a2c193debffbf7286a1..cca29c178db281b86d145b8623f72a2dd8df1366 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=self.replicaVar)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
index 6a03f0f75192dda0b8b8394b1733bdec02222bda..00d2491c97b0a178fbfd289cf44e2617107fdfe9 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
index c11159c6e551d60b90aab16bb7c90e4b26021ac2..3b1dbae443f0e8d6f71dc3c8127975790c23401a 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
index 37946d0c22dae353ac62cb8e564c1361115bf8f9..a799fa57195fe84065c7bb0b295dc7c0f14cdd09 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
index 439845aa54a6d29c1cd7633e9949da3eaa40cfee..f0bedbb187b9987e8f367f1afed7b69fb4c41001 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
index 53ff020b08abf2b758a6de00984b0cb799528d45..a63927dd8bdee0483cc943ececaac1855248ef57 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1.py b/tests/system-test/7-tmq/tmqConsFromTsdb1.py
index 4bb6cf463f59519565f43e04e18d7d7902b73108..8fcc991d4e3904da04480c7bbc28cac49cf5c068 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=self.replicaVar)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqConsumerGroup.py b/tests/system-test/7-tmq/tmqConsumerGroup.py
index 02093a2d889f1f7138e29055145bc63318dd2873..b1aef9d762f7d994c0bfa02ab04b0c64b76edffa 100644
--- a/tests/system-test/7-tmq/tmqConsumerGroup.py
+++ b/tests/system-test/7-tmq/tmqConsumerGroup.py
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqDelete-1ctb.py b/tests/system-test/7-tmq/tmqDelete-1ctb.py
index 69d2f5e3472da93d3bdce64c3387a7383af85143..6dc8de7efce5659b46e386eabcd69130a1c08524 100644
--- a/tests/system-test/7-tmq/tmqDelete-1ctb.py
+++ b/tests/system-test/7-tmq/tmqDelete-1ctb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1,wal_retention_size=-1, wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqDelete-multiCtb.py b/tests/system-test/7-tmq/tmqDelete-multiCtb.py
index e59e3d6ecda6e13127eba3f087029ad281cc55b3..7a47cd6025ccffab89656caf017f21aa2005c1c6 100644
--- a/tests/system-test/7-tmq/tmqDelete-multiCtb.py
+++ b/tests/system-test/7-tmq/tmqDelete-multiCtb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=self.replicaVar,wal_retention_size=-1, wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqDnode.py b/tests/system-test/7-tmq/tmqDnode.py
index e1d6d91e2d620fe6a1ca7b28a5762047eaaa9bed..b96ca24ac5ad372eb5e3b15fbbebc63adeb9f63e 100644
--- a/tests/system-test/7-tmq/tmqDnode.py
+++ b/tests/system-test/7-tmq/tmqDnode.py
@@ -110,7 +110,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/tmqDnodeRestart.py b/tests/system-test/7-tmq/tmqDnodeRestart.py
index 8c19377c0bedd8abab6677c82d35020e5f9d5c32..648d629e5cc2e5cbcc8d60cf1599ba93c37d080a 100644
--- a/tests/system-test/7-tmq/tmqDnodeRestart.py
+++ b/tests/system-test/7-tmq/tmqDnodeRestart.py
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1,wal_retention_size=-1, wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -145,7 +146,7 @@ class TDTestCase:
for i in range(expectRows):
totalConsumeRows += resultList[i]
- tdSql.query(queryString)
+ tdSql.query(queryString, None, 50)
totalRowsFromQury = tdSql.getRows()
tdLog.info("act consume rows: %d, act query rows: %d"%(totalConsumeRows, totalRowsFromQury))
@@ -186,6 +187,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
# tdLog.info("create ctb")
@@ -234,7 +236,7 @@ class TDTestCase:
for i in range(expectRows):
totalConsumeRows += resultList[i]
- tdSql.query(queryString)
+ tdSql.query(queryString, None, 50)
totalRowsFromQuery = tdSql.getRows()
tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, totalRowsFromQuery))
diff --git a/tests/system-test/7-tmq/tmqDnodeRestart1.py b/tests/system-test/7-tmq/tmqDnodeRestart1.py
index 982cc0a6313f8482031290acd89ea9f556dd5be3..cff55a1239b37414d234185d2326f089c1bb8f41 100644
--- a/tests/system-test/7-tmq/tmqDnodeRestart1.py
+++ b/tests/system-test/7-tmq/tmqDnodeRestart1.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1,wal_retention_size=-1, wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqDropNtb-snapshot0.py b/tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
index c8bcdd6235782f4a29cc18a4f243e8e53ed5ffe5..7a9c1bbb8c808fe62e8fede76640ac78e19f2f30 100644
--- a/tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
+++ b/tests/system-test/7-tmq/tmqDropNtb-snapshot0.py
@@ -57,6 +57,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdLog.info("start create database....")
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("start create normal tables....")
tmqCom.create_ntable(tsql=tdSql, dbname=paraDict["dbName"], tbname_prefix=paraDict["ctbPrefix"], tbname_index_start_num = 1, column_elm_list=paraDict["colSchema"], colPrefix='c', tblNum=paraDict["ctbNum"])
tdLog.info("start insert data into normal tables....")
@@ -143,6 +144,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdLog.info("start create database....")
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("start create normal tables....")
tmqCom.create_ntable(tsql=tdSql, dbname=paraDict["dbName"], tbname_prefix=paraDict["ctbPrefix"], tbname_index_start_num = 1, column_elm_list=paraDict["colSchema"], colPrefix='c', tblNum=paraDict["ctbNum"])
tdLog.info("start insert data into normal tables....")
diff --git a/tests/system-test/7-tmq/tmqDropNtb-snapshot1.py b/tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
index 3fc5a2fdc70b64ec95324c370625f5397287ae7d..0b9cb7e66a2d481f6162f1e5e92d8c1f68dcb300 100644
--- a/tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
+++ b/tests/system-test/7-tmq/tmqDropNtb-snapshot1.py
@@ -57,6 +57,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdLog.info("start create database....")
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("start create normal tables....")
tmqCom.create_ntable(tsql=tdSql, dbname=paraDict["dbName"], tbname_prefix=paraDict["ctbPrefix"], tbname_index_start_num = 1, column_elm_list=paraDict["colSchema"], colPrefix='c', tblNum=paraDict["ctbNum"])
tdLog.info("start insert data into normal tables....")
@@ -143,6 +144,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdLog.info("start create database....")
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("start create normal tables....")
tmqCom.create_ntable(tsql=tdSql, dbname=paraDict["dbName"], tbname_prefix=paraDict["ctbPrefix"], tbname_index_start_num = 1, column_elm_list=paraDict["colSchema"], colPrefix='c', tblNum=paraDict["ctbNum"])
tdLog.info("start insert data into normal tables....")
diff --git a/tests/system-test/7-tmq/tmqDropStb.py b/tests/system-test/7-tmq/tmqDropStb.py
index 3789632984c91e49358ea21124824138642162ea..a94747e574cf1dd5b10f875dcf6c6590a3532aca 100644
--- a/tests/system-test/7-tmq/tmqDropStb.py
+++ b/tests/system-test/7-tmq/tmqDropStb.py
@@ -64,6 +64,7 @@ class TDTestCase:
tmqCom.initConsumerTable(self.cdbName)
tdCom.create_database(tdSql,self.paraDict["dbName"],self.paraDict["dropFlag"])
+ tdSql.execute("alter database %s wal_retention_period 3600" % (self.paraDict['dbName']))
self.paraDict["stbName"] = 'stb1'
tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"])
diff --git a/tests/system-test/7-tmq/tmqDropStbCtb.py b/tests/system-test/7-tmq/tmqDropStbCtb.py
index c9e34136cc1e59af173205a8e0cb2796acb1a14a..587baf12aab02a3ae3e7d4d9783cafab6ac0ceca 100644
--- a/tests/system-test/7-tmq/tmqDropStbCtb.py
+++ b/tests/system-test/7-tmq/tmqDropStbCtb.py
@@ -54,6 +54,7 @@ class TDTestCase:
# tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqError.py b/tests/system-test/7-tmq/tmqError.py
index a39bac8dd194360196ccad80c1352b6028474a0b..b2038f1644e70cd2a6f4f7c2eb979ac58ff9a27e 100644
--- a/tests/system-test/7-tmq/tmqError.py
+++ b/tests/system-test/7-tmq/tmqError.py
@@ -116,7 +116,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/tmqModule.py b/tests/system-test/7-tmq/tmqModule.py
index d6b4aff9380bb8f5337ce4b52088e105449a1d07..187152c9ce9a1fd6afba1a718cd82e7e81ae0e4f 100644
--- a/tests/system-test/7-tmq/tmqModule.py
+++ b/tests/system-test/7-tmq/tmqModule.py
@@ -110,7 +110,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/7-tmq/tmqShow.py b/tests/system-test/7-tmq/tmqShow.py
index 31ddc1b0f831df5d6e10f4337536488ddeaa892e..e9234f6c7aea99cf339be76ed799b34d3ec44721 100644
--- a/tests/system-test/7-tmq/tmqShow.py
+++ b/tests/system-test/7-tmq/tmqShow.py
@@ -51,6 +51,7 @@ class TDTestCase:
consumerIdList = [0, 1, 2, 3]
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict['vgroups'],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqSubscribeStb-r3.py b/tests/system-test/7-tmq/tmqSubscribeStb-r3.py
index 85222a941bf466631feedd1ead0387ef5f984096..7f322dc2583201bce47f40a9c1883daabadf8e42 100644
--- a/tests/system-test/7-tmq/tmqSubscribeStb-r3.py
+++ b/tests/system-test/7-tmq/tmqSubscribeStb-r3.py
@@ -94,6 +94,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=self.replica)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py b/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
index 297429b495b4bbc42e6d53a58295ef306b5d6903..a923232706c62fa1343b65e936cbc7aac1b6df5f 100644
--- a/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
+++ b/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot0.py
@@ -50,7 +50,7 @@ class TDTestCase:
def create_udf_function(self):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
functions = tdSql.getResult("show functions")
function_nums = len(functions)
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
@@ -265,6 +267,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py b/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
index 9c139b50de71902d743236c503d6cca12cb8296a..bee174376daca3c0244464c85f80124929e00ce8 100644
--- a/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
+++ b/tests/system-test/7-tmq/tmqUdf-multCtb-snapshot1.py
@@ -50,7 +50,7 @@ class TDTestCase:
def create_udf_function(self):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
functions = tdSql.getResult("show functions")
function_nums = len(functions)
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
@@ -265,6 +267,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUdf.py b/tests/system-test/7-tmq/tmqUdf.py
index 8593fd4f1e5969d9eb8083a66200301a6524d8c1..5bb8e3034ceec89c1161b6a5c9bfd9eb5cfddc82 100644
--- a/tests/system-test/7-tmq/tmqUdf.py
+++ b/tests/system-test/7-tmq/tmqUdf.py
@@ -50,7 +50,7 @@ class TDTestCase:
def create_udf_function(self):
# create scalar functions
- tdSql.execute("create function udf1 as '%s' outputtype int bufSize 8;"%self.libudf1)
+ tdSql.execute("create function udf1 as '%s' outputtype int;"%self.libudf1)
functions = tdSql.getResult("show functions")
function_nums = len(functions)
@@ -116,6 +116,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -163,6 +164,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
@@ -266,6 +268,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
# tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ # tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
# tdLog.info("create stb")
# tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
# tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUpdate-1ctb.py b/tests/system-test/7-tmq/tmqUpdate-1ctb.py
index 2fa6600fb99efa22035091da6d75ac00d6b55afa..8fdf7748a3425b1efe7966949a1098e5867b6ee2 100644
--- a/tests/system-test/7-tmq/tmqUpdate-1ctb.py
+++ b/tests/system-test/7-tmq/tmqUpdate-1ctb.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -207,7 +208,7 @@ class TDTestCase:
paraDict['rowsPerTbl'] = self.rowsPerTbl
consumerId = 1
if self.snapshot == 0:
- expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (1/2))
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (1+ 1/2 + 1/2))
elif self.snapshot == 1:
expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (1))
diff --git a/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py b/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
index daffff44c1cf0dda7c4ecf5ac2dfd3dadfdf5504..8b67f6f8252e5e3682284c5c2d5b4295308db26c 100644
--- a/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
+++ b/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot0.py
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -128,7 +129,7 @@ class TDTestCase:
ifManualCommit = 1
keyList = 'group.id:cgrp1,\
enable.auto.commit:true,\
- auto.commit.interval.ms:1000,\
+ auto.commit.interval.ms:200,\
auto.offset.reset:earliest'
tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit)
@@ -213,7 +214,7 @@ class TDTestCase:
paraDict['rowsPerTbl'] = self.rowsPerTbl
consumerId = 1
if self.snapshot == 0:
- expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (1/2) * (1/2*3))
+ expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] *(2 + 1/2*1/2*2 + 1/2 + 1/4))
elif self.snapshot == 1:
expectrowcnt = int(paraDict["rowsPerTbl"] * paraDict["ctbNum"] * (1 + 1/2))
diff --git a/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py b/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
index 6b8c10de271b28726639baad8648e2586c02f9a1..5a35c4f5ee84c950ee7a611e5be93fe13371b031 100644
--- a/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
+++ b/tests/system-test/7-tmq/tmqUpdate-multiCtb-snapshot1.py
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUpdate-multiCtb.py b/tests/system-test/7-tmq/tmqUpdate-multiCtb.py
index 3975013e747f09d8cc0548b5e32f9f01c63fb9a4..84617efae4d78cf57cf6d522a7b3fbf50321e5f2 100644
--- a/tests/system-test/7-tmq/tmqUpdate-multiCtb.py
+++ b/tests/system-test/7-tmq/tmqUpdate-multiCtb.py
@@ -55,6 +55,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/7-tmq/tmqUpdateWithConsume.py b/tests/system-test/7-tmq/tmqUpdateWithConsume.py
index 4f595788daee975f26cd2e30c1a0fe973e35aa68..6a9bb0ae924d0c0a6366ae6ccb0a6f8a1cec6e0d 100644
--- a/tests/system-test/7-tmq/tmqUpdateWithConsume.py
+++ b/tests/system-test/7-tmq/tmqUpdateWithConsume.py
@@ -54,6 +54,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=self.replicaVar, wal_retention_size=-1, wal_retention_period=-1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
diff --git a/tests/system-test/99-TDcase/TD-15517.py b/tests/system-test/99-TDcase/TD-15517.py
index db06700284d6de78139aef2f2678e2eb75d379fd..aeb28063e47253b085fe664e3109dcb4855539c9 100644
--- a/tests/system-test/99-TDcase/TD-15517.py
+++ b/tests/system-test/99-TDcase/TD-15517.py
@@ -51,7 +51,7 @@ class TDTestCase:
return cur
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
diff --git a/tests/system-test/99-TDcase/TD-15554.py b/tests/system-test/99-TDcase/TD-15554.py
index 51934ccd4408cc002060049f8c32fb6706a41fd3..c8ddeca3c3426c22efe3c4ddbbc6ad5b5992a108 100644
--- a/tests/system-test/99-TDcase/TD-15554.py
+++ b/tests/system-test/99-TDcase/TD-15554.py
@@ -50,7 +50,7 @@ class TDTestCase:
return cur
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
diff --git a/tests/system-test/99-TDcase/TD-15557.py b/tests/system-test/99-TDcase/TD-15557.py
index 884c028a6567d62ce5141eb5ad16240830168f51..f9e676f4f89d9e356d9ede59793f2b8cc431039b 100644
--- a/tests/system-test/99-TDcase/TD-15557.py
+++ b/tests/system-test/99-TDcase/TD-15557.py
@@ -64,7 +64,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -141,7 +141,7 @@ class TDTestCase:
'startTs': 1640966400000} # 2022-01-01 00:00:00.000
parameterDict['cfg'] = cfgPath
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -214,7 +214,7 @@ class TDTestCase:
'startTs': 1640966400000} # 2022-01-01 00:00:00.000
parameterDict['cfg'] = cfgPath
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -298,7 +298,7 @@ class TDTestCase:
'startTs': 1640966400000} # 2022-01-01 00:00:00.000
parameterDict['cfg'] = cfgPath
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/99-TDcase/TD-15563.py b/tests/system-test/99-TDcase/TD-15563.py
index 5ea652b4fb6fe5b441ea4a946026115431ec24b2..cc4c3f3b39a6ff6259b62a18d39d91265d87ba13 100644
--- a/tests/system-test/99-TDcase/TD-15563.py
+++ b/tests/system-test/99-TDcase/TD-15563.py
@@ -52,7 +52,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -95,7 +95,7 @@ class TDTestCase:
os.system(shellCmd)
def create_tables(self,tsql, dbName,vgroups,stbName,ctbNum,rowsPerTbl):
- tsql.execute("create database if not exists %s vgroups %d"%(dbName, vgroups))
+ tsql.execute("create database if not exists %s vgroups %d wal_retention_period 3600"%(dbName, vgroups))
tsql.execute("use %s" %dbName)
tsql.execute("create table if not exists %s (ts timestamp, c1 bigint, c2 binary(16)) tags(t1 int)"%stbName)
pre_create = "create table"
@@ -176,7 +176,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -238,7 +238,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
@@ -304,7 +304,7 @@ class TDTestCase:
self.initConsumerTable()
- tdSql.execute("create database if not exists %s vgroups %d" %(parameterDict['dbName'], parameterDict['vgroups']))
+ tdSql.execute("create database if not exists %s vgroups %d wal_retention_period 3600" %(parameterDict['dbName'], parameterDict['vgroups']))
prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict)
prepareEnvThread.start()
diff --git a/tests/system-test/99-TDcase/TD-16025.py b/tests/system-test/99-TDcase/TD-16025.py
index 8c9fa9319f8071db436e4f71a597dc7d5de8758e..3e25b8c8334013b5dbb56b77ead3473994cd8e9e 100644
--- a/tests/system-test/99-TDcase/TD-16025.py
+++ b/tests/system-test/99-TDcase/TD-16025.py
@@ -59,7 +59,7 @@ class TDTestCase:
def initConsumerTable(self,cdbName='cdb'):
tdLog.info("create consume database, and consume info table, and consume result table")
- tdSql.query("create database if not exists %s vgroups 1"%(cdbName))
+ tdSql.query("create database if not exists %s vgroups 1 wal_retention_period 3600"%(cdbName))
tdSql.query("drop table if exists %s.consumeinfo "%(cdbName))
tdSql.query("drop table if exists %s.consumeresult "%(cdbName))
@@ -110,7 +110,7 @@ class TDTestCase:
if dropFlag == 1:
tsql.execute("drop database if exists %s"%(dbName))
- tsql.execute("create database if not exists %s vgroups %d replica %d"%(dbName, vgroups, replica))
+ tsql.execute("create database if not exists %s vgroups %d replica %d wal_retention_period 3600"%(dbName, vgroups, replica))
tdLog.debug("complete to create database %s"%(dbName))
return
diff --git a/tests/system-test/99-TDcase/TD-16821.py b/tests/system-test/99-TDcase/TD-16821.py
index f57fae752f8d2d07f730f791ce0b5a63eb7dc832..78ac172f3075733aff7b3608fb29400b32adc01d 100644
--- a/tests/system-test/99-TDcase/TD-16821.py
+++ b/tests/system-test/99-TDcase/TD-16821.py
@@ -73,6 +73,7 @@ class TDTestCase:
expectRowsList = []
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=4,replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tdCom.create_stable(tdSql, dbname=paraDict["dbName"],stbname=paraDict["stbName"], column_elm_list=paraDict['colSchema'], tag_elm_list=paraDict['tagSchema'])
tdLog.info("create ctb")
diff --git a/tests/system-test/99-TDcase/TD-17255.py b/tests/system-test/99-TDcase/TD-17255.py
index 0f83468754783ee5adca78113c7a8df5c78bbe99..5f68a5b7389d3ea095a8886e2801dd82fb6af8d9 100644
--- a/tests/system-test/99-TDcase/TD-17255.py
+++ b/tests/system-test/99-TDcase/TD-17255.py
@@ -53,6 +53,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -97,6 +98,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -181,6 +183,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("create ctb")
@@ -267,6 +270,7 @@ class TDTestCase:
tmqCom.initConsumerTable()
tdCom.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], vgroups=paraDict["vgroups"],replica=1)
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
tdLog.info("create stb")
tmqCom.create_stable(tdSql, dbName=paraDict["dbName"],stbName=paraDict["stbName"])
tdLog.info("insert data by auto create ctb")
diff --git a/tests/system-test/99-TDcase/TD-17699.py b/tests/system-test/99-TDcase/TD-17699.py
index 2862f4a78d5391098f0493afa35e482c5a032817..6956e88aec7d0c8adb84c8af9aff31cb6d80fa1f 100644
--- a/tests/system-test/99-TDcase/TD-17699.py
+++ b/tests/system-test/99-TDcase/TD-17699.py
@@ -65,6 +65,7 @@ class TDTestCase:
tmqCom.initConsumerTable(self.cdbName)
tdCom.create_database(tdSql,self.paraDict["dbName"],self.paraDict["dropFlag"])
+ tdSql.execute("alter database %s wal_retention_period 3600" % (paraDict['dbName']))
self.paraDict["stbName"] = 'stb1'
tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"])
diff --git a/tests/system-test/pytest.sh b/tests/system-test/pytest.sh
index a76efb62f3f9bb58082e9473c5b6ea8381d485c8..dfdfc32ed0c60122926f4472ae80923d98778541 100755
--- a/tests/system-test/pytest.sh
+++ b/tests/system-test/pytest.sh
@@ -93,7 +93,7 @@ else
fi
sleep 1
done
-
+ # check case successful
AsanFileSuccessLen=$(grep -w "successfully executed" $AsanFile | wc -l)
echo "AsanFileSuccessLen:" $AsanFileSuccessLen
diff --git a/tests/system-test/test-win.bat b/tests/system-test/test-win.bat
new file mode 100644
index 0000000000000000000000000000000000000000..662adf3987a254c62da0fb68708e7b0d48cdfb21
--- /dev/null
+++ b/tests/system-test/test-win.bat
@@ -0,0 +1,96 @@
+@echo off
+SETLOCAL EnableDelayedExpansion
+for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( set "DEL=%%a")
+set /a a=0
+if "%1" == "full" (
+ echo Windows Taosd Full Test
+ set /a exitNum=0
+ del /Q /F failed.txt
+ set caseFile="win-test-file"
+ if not "%2" == "" (
+ set caseFile="%2"
+ )
+ for /F "usebackq tokens=*" %%i in (!caseFile!) do (
+ call :CheckSkipCase %%i
+ if !skipCase! == false (
+ set line=%%i
+ if "!line:~,7!" == "python3" (
+ set /a a+=1
+ echo !a! Processing %%i
+ call :GetTimeSeconds !time!
+ set time1=!_timeTemp!
+ echo Start at !time!
+ call %%i ARG1 > result_!a!.txt 2>error_!a!.txt || set errorlevel=8
+ if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && set /a exitNum=8 && echo %%i >>failed.txt ) else ( call :colorEcho 0a "Success" &echo. )
+ )
+ )
+ )
+ exit /b !exitNum!
+)
+echo Windows Taosd Test
+for /F "usebackq tokens=*" %%i in (win-test-file) do (
+ for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" (
+ set /a a+=1
+ set timeNow=!time!
+ echo !a! Processing %%i
+ call :GetTimeSeconds !timeNow!
+ set time1=!_timeTemp!
+ echo Start at !timeNow!
+ call %%i ARG1 > result_!a!.txt 2>error_!a!.txt || set errorlevel=8
+ if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit /b 8 ) else ( call :colorEcho 0a "Success" &echo. )
+ )
+)
+@REM echo Linux Taosd Test
+@REM for /F "usebackq tokens=*" %%i in (simpletest.bat) do (
+@REM for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" (
+@REM set /a a+=1
+@REM echo !a! Processing %%i
+@REM call :GetTimeSeconds !time!
+@REM set time1=!_timeTemp!
+@REM echo Start at !time!
+@REM call %%i ARG1 -m %1 > result_!a!.txt 2>error_!a!.txt
+@REM if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. )
+@REM )
+@REM )
+exit /b
+
+:colorEcho
+set timeNow=%time%
+call :GetTimeSeconds %timeNow%
+set time2=%_timeTemp%
+set /a interTime=%time2% - %time1%
+echo End at %timeNow% , cast %interTime%s
+echo off
+ "%~2"
+findstr /v /a:%1 /R "^$" "%~2" nul
+del "%~2" > nul 2>&1i
+goto :eof
+
+:GetTimeSeconds
+set tt=%1
+set tt=%tt:.= %
+set tt=%tt::= %
+set tt=%tt: 0= %
+set /a index=1
+for %%a in (%tt%) do (
+ if !index! EQU 1 (
+ set /a hh=%%a
+ )^
+ else if !index! EQU 2 (
+ set /a mm=%%a
+
+ )^
+ else if !index! EQU 3 (
+ set /a ss=%%a
+ )
+ set /a index=index+1
+)
+set /a _timeTemp=(%hh%*60+%mm%)*60+%ss%
+goto :eof
+
+:CheckSkipCase
+set skipCase=false
+if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=false )
+if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=false )
+echo %* | grep "\-R" && set skipCase=true
+:goto eof
\ No newline at end of file
diff --git a/tests/system-test/test.py b/tests/system-test/test.py
index 0c62c182f70eda8e20a7c5d91ebe360bfa2475ad..bc7f1d9861c6128de2bcbef00ddd2c77c0df5a33 100644
--- a/tests/system-test/test.py
+++ b/tests/system-test/test.py
@@ -291,9 +291,9 @@ if __name__ == "__main__":
print(r)
else:
pass
- if restful:
- tAdapter.init(deployPath, masterIp)
- tAdapter.stop(force_kill=True)
+ # if restful:
+ tAdapter.init(deployPath, masterIp)
+ tAdapter.stop(force_kill=True)
if dnodeNums == 1 :
tdDnodes.deploy(1,updateCfgDict)
@@ -306,7 +306,7 @@ if __name__ == "__main__":
if queryPolicy != 1:
queryPolicy=int(queryPolicy)
if restful:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
else:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
@@ -343,7 +343,7 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
# tdLog.info(tdDnodes.getSimCfgPath(),host)
if createDnodeNums == 1:
createDnodeNums=dnodeNums
@@ -359,7 +359,7 @@ if __name__ == "__main__":
if queryPolicy != 1:
queryPolicy=int(queryPolicy)
if restful:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
else:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
@@ -382,11 +382,44 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect(host="%s"%(host), config=tdDnodes.sim.getCfgDir())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
- if is_test_framework:
- tdCases.runOneWindows(conn, fileName)
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
+
+ if testCluster:
+ tdLog.info("Procedures for testing cluster")
+ if fileName == "all":
+ tdCases.runAllCluster()
+ else:
+ tdCases.runOneCluster(fileName)
else:
- tdCases.runAllWindows(conn)
+ tdLog.info("Procedures for testing self-deployment")
+ if not restful:
+ conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
+ else:
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
+
+ if fileName == "all":
+ tdCases.runAllWindows(conn)
+ else:
+ tdCases.runOneWindows(conn, fileName, replicaVar)
+
+ if restart:
+ if fileName == "all":
+ tdLog.info("not need to query ")
+ else:
+ sp = fileName.rsplit(".", 1)
+ if len(sp) == 2 and sp[1] == "py":
+ tdDnodes.stopAll()
+ tdDnodes.start(1)
+ time.sleep(1)
+ if not restful:
+ conn = taos.connect( host, config=tdDnodes.getSimCfgPath())
+ else:
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
+ tdLog.info("Procedures for tdengine deployed in %s" % (host))
+ tdLog.info("query test after taosd restart")
+ tdCases.runOneWindows(conn, sp[0] + "_" + "restart.py", replicaVar)
+ else:
+ tdLog.info("not need to query")
else:
tdDnodes.setKillValgrind(killValgrind)
tdDnodes.init(deployPath, masterIp)
@@ -431,7 +464,7 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
# tdSql.init(conn.cursor())
# tdSql.execute("create qnode on dnode 1")
# tdSql.execute('alter local "queryPolicy" "%d"'%queryPolicy)
@@ -479,7 +512,7 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
print(tdDnodes.getSimCfgPath(),host)
if createDnodeNums == 1:
createDnodeNums=dnodeNums
@@ -497,7 +530,7 @@ if __name__ == "__main__":
if queryPolicy != 1:
queryPolicy=int(queryPolicy)
if restful:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
else:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
@@ -526,7 +559,7 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
if fileName == "all":
tdCases.runAllLinux(conn)
@@ -545,7 +578,7 @@ if __name__ == "__main__":
if not restful:
conn = taos.connect( host, config=tdDnodes.getSimCfgPath())
else:
- conn = taosrest.connect(url=f"http://{host}:6041")
+ conn = taosrest.connect(url=f"http://{host}:6041",timezone="utc")
tdLog.info("Procedures for tdengine deployed in %s" % (host))
tdLog.info("query test after taosd restart")
tdCases.runOneLinux(conn, sp[0] + "_" + "restart.py", replicaVar)
diff --git a/tests/system-test/win-test-file b/tests/system-test/win-test-file
new file mode 100644
index 0000000000000000000000000000000000000000..7e68c40fd8b355d3d3cd40161bb2df09886e8570
--- /dev/null
+++ b/tests/system-test/win-test-file
@@ -0,0 +1,637 @@
+python3 ./test.py -f 1-insert/database_pre_suf.py
+python3 ./test.py -f 0-others/balance_vgroups_r1.py -N 6
+python3 ./test.py -f 0-others/taosShell.py
+python3 ./test.py -f 0-others/taosShellError.py
+python3 ./test.py -f 0-others/taosShellNetChk.py
+python3 ./test.py -f 0-others/telemetry.py
+python3 ./test.py -f 0-others/backquote_check.py
+python3 ./test.py -f 0-others/taosdMonitor.py
+python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
+python3 ./test.py -f 0-others/cachemodel.py
+python3 ./test.py -f 0-others/sysinfo.py
+python3 ./test.py -f 0-others/user_control.py
+python3 ./test.py -f 0-others/user_manage.py
+python3 ./test.py -f 0-others/fsync.py
+python3 ./test.py -f 0-others/compatibility.py
+python3 ./test.py -f 0-others/tag_index_basic.py
+# python3 ./test.py -f 1-insert/alter_database.py
+python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
+python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py
+python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py
+python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py
+python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py
+python3 ./test.py -f 1-insert/alter_stable.py
+python3 ./test.py -f 1-insert/alter_table.py
+python3 ./test.py -f 1-insert/boundary.py
+python3 ./test.py -f 1-insert/insertWithMoreVgroup.py
+python3 ./test.py -f 1-insert/table_comment.py
+python3 ./test.py -f 1-insert/time_range_wise.py
+python3 ./test.py -f 1-insert/block_wise.py
+python3 ./test.py -f 1-insert/create_retentions.py
+python3 ./test.py -f 1-insert/mutil_stage.py
+python3 ./test.py -f 1-insert/table_param_ttl.py
+python3 ./test.py -f 1-insert/table_param_ttl.py -R
+python3 ./test.py -f 1-insert/update_data_muti_rows.py
+python3 ./test.py -f 1-insert/db_tb_name_check.py
+python3 ./test.py -f 1-insert/InsertFuturets.py
+python3 ./test.py -f 0-others/show.py
+python3 ./test.py -f 0-others/information_schema.py
+python3 ./test.py -f 2-query/abs.py
+python3 ./test.py -f 2-query/abs.py -R
+python3 ./test.py -f 2-query/and_or_for_byte.py
+python3 ./test.py -f 2-query/and_or_for_byte.py -R
+python3 ./test.py -f 2-query/apercentile.py
+python3 ./test.py -f 2-query/apercentile.py -R
+python3 ./test.py -f 2-query/arccos.py
+python3 ./test.py -f 2-query/arccos.py -R
+python3 ./test.py -f 2-query/arcsin.py
+python3 ./test.py -f 2-query/arcsin.py -R
+python3 ./test.py -f 2-query/arctan.py
+python3 ./test.py -f 2-query/arctan.py -R
+python3 ./test.py -f 2-query/avg.py
+python3 ./test.py -f 2-query/avg.py -R
+python3 ./test.py -f 2-query/between.py
+python3 ./test.py -f 2-query/between.py -R
+python3 ./test.py -f 2-query/bottom.py
+python3 ./test.py -f 2-query/bottom.py -R
+python3 ./test.py -f 2-query/cast.py
+python3 ./test.py -f 2-query/cast.py -R
+python3 ./test.py -f 2-query/ceil.py
+python3 ./test.py -f 2-query/ceil.py -R
+python3 ./test.py -f 2-query/char_length.py
+python3 ./test.py -f 2-query/char_length.py -R
+python3 ./test.py -f 2-query/check_tsdb.py
+python3 ./test.py -f 2-query/check_tsdb.py -R
+python3 ./test.py -f 2-query/concat.py
+python3 ./test.py -f 2-query/concat.py -R
+python3 ./test.py -f 2-query/concat_ws.py
+python3 ./test.py -f 2-query/concat_ws.py -R
+python3 ./test.py -f 2-query/concat_ws2.py
+python3 ./test.py -f 2-query/concat_ws2.py -R
+python3 ./test.py -f 2-query/cos.py
+python3 ./test.py -f 2-query/cos.py -R
+python3 ./test.py -f 2-query/count_partition.py
+python3 ./test.py -f 2-query/count_partition.py -R
+python3 ./test.py -f 2-query/count.py
+python3 ./test.py -f 2-query/count.py -R
+python3 ./test.py -f 2-query/countAlwaysReturnValue.py
+python3 ./test.py -f 2-query/countAlwaysReturnValue.py -R
+python3 ./test.py -f 2-query/db.py
+python3 ./test.py -f 2-query/db.py -N 3 -n 3 -R
+python3 ./test.py -f 2-query/diff.py
+python3 ./test.py -f 2-query/diff.py -R
+python3 ./test.py -f 2-query/distinct.py
+python3 ./test.py -f 2-query/distinct.py -R
+python3 ./test.py -f 2-query/distribute_agg_apercentile.py
+python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R
+python3 ./test.py -f 2-query/distribute_agg_avg.py
+python3 ./test.py -f 2-query/distribute_agg_avg.py -R
+python3 ./test.py -f 2-query/distribute_agg_count.py
+python3 ./test.py -f 2-query/distribute_agg_count.py -R
+python3 ./test.py -f 2-query/distribute_agg_max.py
+python3 ./test.py -f 2-query/distribute_agg_max.py -R
+python3 ./test.py -f 2-query/distribute_agg_min.py
+python3 ./test.py -f 2-query/distribute_agg_min.py -R
+python3 ./test.py -f 2-query/distribute_agg_spread.py
+python3 ./test.py -f 2-query/distribute_agg_spread.py -R
+python3 ./test.py -f 2-query/distribute_agg_stddev.py
+python3 ./test.py -f 2-query/distribute_agg_stddev.py -R
+python3 ./test.py -f 2-query/distribute_agg_sum.py
+python3 ./test.py -f 2-query/distribute_agg_sum.py -R
+python3 ./test.py -f 2-query/explain.py
+python3 ./test.py -f 2-query/explain.py -R
+python3 ./test.py -f 2-query/first.py
+python3 ./test.py -f 2-query/first.py -R
+python3 ./test.py -f 2-query/floor.py
+python3 ./test.py -f 2-query/floor.py -R
+python3 ./test.py -f 2-query/function_null.py
+python3 ./test.py -f 2-query/function_null.py -R
+python3 ./test.py -f 2-query/function_stateduration.py
+python3 ./test.py -f 2-query/function_stateduration.py -R
+python3 ./test.py -f 2-query/histogram.py
+python3 ./test.py -f 2-query/histogram.py -R
+python3 ./test.py -f 2-query/hyperloglog.py
+python3 ./test.py -f 2-query/hyperloglog.py -R
+python3 ./test.py -f 2-query/interp.py
+python3 ./test.py -f 2-query/interp.py -R
+python3 ./test.py -f 2-query/irate.py
+python3 ./test.py -f 2-query/irate.py -R
+python3 ./test.py -f 2-query/join.py
+python3 ./test.py -f 2-query/join.py -R
+python3 ./test.py -f 2-query/last_row.py
+python3 ./test.py -f 2-query/last_row.py -R
+python3 ./test.py -f 2-query/last.py
+python3 ./test.py -f 2-query/last.py -R
+python3 ./test.py -f 2-query/leastsquares.py
+python3 ./test.py -f 2-query/leastsquares.py -R
+python3 ./test.py -f 2-query/length.py
+python3 ./test.py -f 2-query/length.py -R
+python3 ./test.py -f 2-query/limit.py
+python3 ./test.py -f 2-query/log.py
+python3 ./test.py -f 2-query/log.py -R
+python3 ./test.py -f 2-query/lower.py
+python3 ./test.py -f 2-query/lower.py -R
+python3 ./test.py -f 2-query/ltrim.py
+python3 ./test.py -f 2-query/ltrim.py -R
+python3 ./test.py -f 2-query/mavg.py
+python3 ./test.py -f 2-query/mavg.py -R
+python3 ./test.py -f 2-query/max_partition.py
+python3 ./test.py -f 2-query/max_partition.py -R
+python3 ./test.py -f 2-query/max_min_last_interval.py
+python3 ./test.py -f 2-query/max.py
+python3 ./test.py -f 2-query/max.py -R
+python3 ./test.py -f 2-query/min.py
+python3 ./test.py -f 2-query/min.py -R
+python3 ./test.py -f 2-query/mode.py
+python3 ./test.py -f 2-query/mode.py -R
+python3 ./test.py -f 2-query/Now.py
+python3 ./test.py -f 2-query/Now.py -R
+python3 ./test.py -f 2-query/percentile.py
+python3 ./test.py -f 2-query/percentile.py -R
+python3 ./test.py -f 2-query/pow.py
+python3 ./test.py -f 2-query/pow.py -R
+python3 ./test.py -f 2-query/query_cols_tags_and_or.py
+python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R
+python3 ./test.py -f 2-query/round.py
+python3 ./test.py -f 2-query/round.py -R
+python3 ./test.py -f 2-query/rtrim.py
+python3 ./test.py -f 2-query/rtrim.py -R
+python3 ./test.py -f 2-query/sample.py
+python3 ./test.py -f 2-query/sample.py -R
+python3 ./test.py -f 2-query/sin.py
+python3 ./test.py -f 2-query/sin.py -R
+python3 ./test.py -f 2-query/smaTest.py
+python3 ./test.py -f 2-query/smaTest.py -R
+python3 ./test.py -f 2-query/sml.py
+python3 ./test.py -f 2-query/sml.py -R
+python3 ./test.py -f 2-query/spread.py
+python3 ./test.py -f 2-query/spread.py -R
+python3 ./test.py -f 2-query/sqrt.py
+python3 ./test.py -f 2-query/sqrt.py -R
+python3 ./test.py -f 2-query/statecount.py
+python3 ./test.py -f 2-query/statecount.py -R
+python3 ./test.py -f 2-query/stateduration.py
+python3 ./test.py -f 2-query/stateduration.py -R
+python3 ./test.py -f 2-query/substr.py
+python3 ./test.py -f 2-query/substr.py -R
+python3 ./test.py -f 2-query/sum.py
+python3 ./test.py -f 2-query/sum.py -R
+python3 ./test.py -f 2-query/tail.py
+python3 ./test.py -f 2-query/tail.py -R
+python3 ./test.py -f 2-query/tan.py
+python3 ./test.py -f 2-query/tan.py -R
+python3 ./test.py -f 2-query/Timediff.py
+python3 ./test.py -f 2-query/Timediff.py -R
+python3 ./test.py -f 2-query/timetruncate.py
+python3 ./test.py -f 2-query/timetruncate.py -R
+python3 ./test.py -f 2-query/timezone.py
+python3 ./test.py -f 2-query/timezone.py -R
+python3 ./test.py -f 2-query/To_iso8601.py
+python3 ./test.py -f 2-query/To_iso8601.py -R
+python3 ./test.py -f 2-query/To_unixtimestamp.py
+python3 ./test.py -f 2-query/To_unixtimestamp.py -R
+python3 ./test.py -f 2-query/Today.py
+python3 ./test.py -f 2-query/Today.py -R
+python3 ./test.py -f 2-query/top.py
+python3 ./test.py -f 2-query/top.py -R
+python3 ./test.py -f 2-query/tsbsQuery.py
+python3 ./test.py -f 2-query/tsbsQuery.py -R
+python3 ./test.py -f 2-query/ttl_comment.py
+python3 ./test.py -f 2-query/ttl_comment.py -R
+python3 ./test.py -f 2-query/twa.py
+python3 ./test.py -f 2-query/twa.py -R
+python3 ./test.py -f 2-query/union.py
+python3 ./test.py -f 2-query/union.py -R
+python3 ./test.py -f 2-query/unique.py
+python3 ./test.py -f 2-query/unique.py -R
+python3 ./test.py -f 2-query/upper.py
+python3 ./test.py -f 2-query/upper.py -R
+python3 ./test.py -f 2-query/varchar.py
+python3 ./test.py -f 2-query/varchar.py -R
+python3 ./test.py -f 2-query/case_when.py
+python3 ./test.py -f 2-query/case_when.py -R
+python3 ./test.py -f 2-query/blockSMA.py
+python3 ./test.py -f 2-query/blockSMA.py -R
+python3 ./test.py -f 1-insert/update_data.py
+python3 ./test.py -f 1-insert/tb_100w_data_order.py
+python3 ./test.py -f 1-insert/delete_stable.py
+python3 ./test.py -f 1-insert/delete_childtable.py
+python3 ./test.py -f 1-insert/delete_normaltable.py
+python3 ./test.py -f 1-insert/keep_expired.py
+python3 ./test.py -f 1-insert/drop.py
+python3 ./test.py -f 1-insert/drop.py -N 3 -M 3 -i False -n 3
+python3 ./test.py -f 2-query/join2.py
+python3 ./test.py -f 2-query/union1.py
+python3 ./test.py -f 2-query/concat2.py
+python3 ./test.py -f 2-query/json_tag.py
+python3 ./test.py -f 2-query/nestedQuery.py
+python3 ./test.py -f 2-query/nestedQueryInterval.py
+python3 ./test.py -f 2-query/nestedQuery_str.py
+python3 ./test.py -f 2-query/nestedQuery_math.py
+python3 ./test.py -f 2-query/nestedQuery_time.py
+python3 ./test.py -f 2-query/stablity.py
+python3 ./test.py -f 2-query/stablity_1.py
+python3 ./test.py -f 2-query/elapsed.py
+python3 ./test.py -f 2-query/csum.py
+python3 ./test.py -f 2-query/function_diff.py
+python3 ./test.py -f 2-query/tagFilter.py
+python3 ./test.py -f 2-query/queryQnode.py
+python3 ./test.py -f 6-cluster/5dnode1mnode.py
+python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5
+python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -i False
+python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -i False
+python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeModifyMeta.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeModifyMeta.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6
+python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1
+python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1
+python3 ./test.py -f 7-tmq/create_wrong_topic.py
+python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3
+python3 ./test.py -f 7-tmq/basic5.py
+python3 ./test.py -f 7-tmq/subscribeDb.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/subscribeDb0.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/subscribeDb1.py
+python3 ./test.py -f 7-tmq/subscribeDb2.py
+python3 ./test.py -f 7-tmq/subscribeDb3.py
+python3 ./test.py -f 7-tmq/subscribeDb4.py
+python3 ./test.py -f 7-tmq/subscribeStb.py
+python3 ./test.py -f 7-tmq/subscribeStb0.py
+python3 ./test.py -f 7-tmq/subscribeStb1.py
+python3 ./test.py -f 7-tmq/subscribeStb2.py
+python3 ./test.py -f 7-tmq/subscribeStb3.py
+python3 ./test.py -f 7-tmq/subscribeStb4.py
+python3 ./test.py -f 7-tmq/db.py
+python3 ./test.py -f 7-tmq/tmqError.py
+python3 ./test.py -f 7-tmq/schema.py
+python3 ./test.py -f 7-tmq/stbFilter.py
+python3 ./test.py -f 7-tmq/tmqCheckData.py
+python3 ./test.py -f 7-tmq/tmqCheckData1.py
+python3 ./test.py -f 7-tmq/tmqConsumerGroup.py
+python3 ./test.py -f 7-tmq/tmqShow.py
+python3 ./test.py -f 7-tmq/tmqAlterSchema.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
+python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
+python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
+python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
+python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py
+python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py
+python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py
+python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py
+python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
+python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py -N 3 -n 3
+python3 ./test.py -f 7-tmq/tmqDropStb.py
+python3 ./test.py -f 7-tmq/tmqDropStbCtb.py
+python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py
+python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py
+python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py
+python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py
+python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py
+python3 ./test.py -f 7-tmq/tmq_taosx.py
+python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py
+python3 ./test.py -f 99-TDcase/TD-19201.py
+python3 ./test.py -f 99-TDcase/TD-21561.py
+python3 ./test.py -f 7-tmq/tmqSubscribeStb-r3.py -N 5
+python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3
+python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 6 -M 3 -n 3
+python3 ./test.py -f 2-query/between.py -Q 2
+python3 ./test.py -f 2-query/distinct.py -Q 2
+python3 ./test.py -f 2-query/varchar.py -Q 2
+python3 ./test.py -f 2-query/ltrim.py -Q 2
+python3 ./test.py -f 2-query/rtrim.py -Q 2
+python3 ./test.py -f 2-query/length.py -Q 2
+python3 ./test.py -f 2-query/char_length.py -Q 2
+python3 ./test.py -f 2-query/upper.py -Q 2
+python3 ./test.py -f 2-query/lower.py -Q 2
+python3 ./test.py -f 2-query/join.py -Q 2
+python3 ./test.py -f 2-query/join2.py -Q 2
+python3 ./test.py -f 2-query/cast.py -Q 2
+python3 ./test.py -f 2-query/substr.py -Q 2
+python3 ./test.py -f 2-query/union.py -Q 2
+python3 ./test.py -f 2-query/union1.py -Q 2
+python3 ./test.py -f 2-query/concat.py -Q 2
+python3 ./test.py -f 2-query/concat2.py -Q 2
+python3 ./test.py -f 2-query/concat_ws.py -Q 2
+python3 ./test.py -f 2-query/concat_ws2.py -Q 2
+python3 ./test.py -f 2-query/check_tsdb.py -Q 2
+python3 ./test.py -f 2-query/spread.py -Q 2
+python3 ./test.py -f 2-query/hyperloglog.py -Q 2
+python3 ./test.py -f 2-query/explain.py -Q 2
+python3 ./test.py -f 2-query/leastsquares.py -Q 2
+python3 ./test.py -f 2-query/timezone.py -Q 2
+python3 ./test.py -f 2-query/Now.py -Q 2
+python3 ./test.py -f 2-query/Today.py -Q 2
+python3 ./test.py -f 2-query/max.py -Q 2
+python3 ./test.py -f 2-query/min.py -Q 2
+python3 ./test.py -f 2-query/mode.py -Q 2
+python3 ./test.py -f 2-query/count.py -Q 2
+python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 2
+python3 ./test.py -f 2-query/last.py -Q 2
+python3 ./test.py -f 2-query/first.py -Q 2
+python3 ./test.py -f 2-query/To_iso8601.py -Q 2
+python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 2
+python3 ./test.py -f 2-query/timetruncate.py -Q 2
+python3 ./test.py -f 2-query/diff.py -Q 2
+python3 ./test.py -f 2-query/Timediff.py -Q 2
+python3 ./test.py -f 2-query/json_tag.py -Q 2
+python3 ./test.py -f 2-query/top.py -Q 2
+python3 ./test.py -f 2-query/bottom.py -Q 2
+python3 ./test.py -f 2-query/percentile.py -Q 2
+python3 ./test.py -f 2-query/apercentile.py -Q 2
+python3 ./test.py -f 2-query/abs.py -Q 2
+python3 ./test.py -f 2-query/ceil.py -Q 2
+python3 ./test.py -f 2-query/floor.py -Q 2
+python3 ./test.py -f 2-query/round.py -Q 2
+python3 ./test.py -f 2-query/log.py -Q 2
+python3 ./test.py -f 2-query/pow.py -Q 2
+python3 ./test.py -f 2-query/sqrt.py -Q 2
+python3 ./test.py -f 2-query/sin.py -Q 2
+python3 ./test.py -f 2-query/cos.py -Q 2
+python3 ./test.py -f 2-query/tan.py -Q 2
+python3 ./test.py -f 2-query/arcsin.py -Q 2
+python3 ./test.py -f 2-query/arccos.py -Q 2
+python3 ./test.py -f 2-query/arctan.py -Q 2
+python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2
+python3 ./test.py -f 2-query/interp.py -Q 2
+python3 ./test.py -f 2-query/nestedQuery.py -Q 2
+python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 2
+python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2
+python3 ./test.py -f 2-query/nestedQuery_math.py -Q 2
+python3 ./test.py -f 2-query/nestedQuery_time.py -Q 2
+python3 ./test.py -f 2-query/stablity.py -Q 2
+python3 ./test.py -f 2-query/stablity_1.py -Q 2
+python3 ./test.py -f 2-query/avg.py -Q 2
+python3 ./test.py -f 2-query/elapsed.py -Q 2
+python3 ./test.py -f 2-query/csum.py -Q 2
+python3 ./test.py -f 2-query/mavg.py -Q 2
+python3 ./test.py -f 2-query/sample.py -Q 2
+python3 ./test.py -f 2-query/function_diff.py -Q 2
+python3 ./test.py -f 2-query/unique.py -Q 2
+python3 ./test.py -f 2-query/stateduration.py -Q 2
+python3 ./test.py -f 2-query/function_stateduration.py -Q 2
+python3 ./test.py -f 2-query/statecount.py -Q 2
+python3 ./test.py -f 2-query/tail.py -Q 2
+python3 ./test.py -f 2-query/ttl_comment.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_max.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_min.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 2
+python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 2
+python3 ./test.py -f 2-query/twa.py -Q 2
+python3 ./test.py -f 2-query/irate.py -Q 2
+python3 ./test.py -f 2-query/function_null.py -Q 2
+python3 ./test.py -f 2-query/count_partition.py -Q 2
+python3 ./test.py -f 2-query/max_partition.py -Q 2
+python3 ./test.py -f 2-query/max_min_last_interval.py -Q 2
+python3 ./test.py -f 2-query/last_row.py -Q 2
+python3 ./test.py -f 2-query/tsbsQuery.py -Q 2
+python3 ./test.py -f 2-query/sml.py -Q 2
+python3 ./test.py -f 2-query/case_when.py -Q 2
+python3 ./test.py -f 2-query/blockSMA.py -Q 2
+python3 ./test.py -f 99-TDcase/TD-21561.py -Q 2
+python3 ./test.py -f 2-query/between.py -Q 3
+python3 ./test.py -f 2-query/distinct.py -Q 3
+python3 ./test.py -f 2-query/varchar.py -Q 3
+python3 ./test.py -f 2-query/ltrim.py -Q 3
+python3 ./test.py -f 2-query/rtrim.py -Q 3
+python3 ./test.py -f 2-query/length.py -Q 3
+python3 ./test.py -f 2-query/char_length.py -Q 3
+python3 ./test.py -f 2-query/upper.py -Q 3
+python3 ./test.py -f 2-query/lower.py -Q 3
+python3 ./test.py -f 2-query/join.py -Q 3
+python3 ./test.py -f 2-query/join2.py -Q 3
+python3 ./test.py -f 2-query/cast.py -Q 3
+python3 ./test.py -f 2-query/substr.py -Q 3
+python3 ./test.py -f 2-query/union.py -Q 3
+python3 ./test.py -f 2-query/union1.py -Q 3
+python3 ./test.py -f 2-query/concat.py -Q 3
+python3 ./test.py -f 2-query/concat2.py -Q 3
+python3 ./test.py -f 2-query/concat_ws.py -Q 3
+python3 ./test.py -f 2-query/concat_ws2.py -Q 3
+python3 ./test.py -f 2-query/check_tsdb.py -Q 3
+python3 ./test.py -f 2-query/spread.py -Q 3
+python3 ./test.py -f 2-query/hyperloglog.py -Q 3
+python3 ./test.py -f 2-query/explain.py -Q 3
+python3 ./test.py -f 2-query/leastsquares.py -Q 3
+python3 ./test.py -f 2-query/timezone.py -Q 3
+python3 ./test.py -f 2-query/Now.py -Q 3
+python3 ./test.py -f 2-query/Today.py -Q 3
+python3 ./test.py -f 2-query/max.py -Q 3
+python3 ./test.py -f 2-query/min.py -Q 3
+python3 ./test.py -f 2-query/mode.py -Q 3
+python3 ./test.py -f 2-query/count.py -Q 3
+python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 3
+python3 ./test.py -f 2-query/last.py -Q 3
+python3 ./test.py -f 2-query/first.py -Q 3
+python3 ./test.py -f 2-query/To_iso8601.py -Q 3
+python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 3
+python3 ./test.py -f 2-query/timetruncate.py -Q 3
+python3 ./test.py -f 2-query/diff.py -Q 3
+python3 ./test.py -f 2-query/Timediff.py -Q 3
+python3 ./test.py -f 2-query/json_tag.py -Q 3
+python3 ./test.py -f 2-query/top.py -Q 3
+python3 ./test.py -f 2-query/bottom.py -Q 3
+python3 ./test.py -f 2-query/percentile.py -Q 3
+python3 ./test.py -f 2-query/apercentile.py -Q 3
+python3 ./test.py -f 2-query/abs.py -Q 3
+python3 ./test.py -f 2-query/ceil.py -Q 3
+python3 ./test.py -f 2-query/floor.py -Q 3
+python3 ./test.py -f 2-query/round.py -Q 3
+python3 ./test.py -f 2-query/log.py -Q 3
+python3 ./test.py -f 2-query/pow.py -Q 3
+python3 ./test.py -f 2-query/sqrt.py -Q 3
+python3 ./test.py -f 2-query/sin.py -Q 3
+python3 ./test.py -f 2-query/cos.py -Q 3
+python3 ./test.py -f 2-query/tan.py -Q 3
+python3 ./test.py -f 2-query/arcsin.py -Q 3
+python3 ./test.py -f 2-query/arccos.py -Q 3
+python3 ./test.py -f 2-query/arctan.py -Q 3
+python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3
+python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 3
+python3 ./test.py -f 2-query/stablity.py -Q 3
+python3 ./test.py -f 2-query/stablity_1.py -Q 3
+python3 ./test.py -f 2-query/avg.py -Q 3
+python3 ./test.py -f 2-query/elapsed.py -Q 3
+python3 ./test.py -f 2-query/csum.py -Q 3
+python3 ./test.py -f 2-query/mavg.py -Q 3
+python3 ./test.py -f 2-query/sample.py -Q 3
+python3 ./test.py -f 2-query/function_diff.py -Q 3
+python3 ./test.py -f 2-query/unique.py -Q 3
+python3 ./test.py -f 2-query/stateduration.py -Q 3
+python3 ./test.py -f 2-query/function_stateduration.py -Q 3
+python3 ./test.py -f 2-query/statecount.py -Q 3
+python3 ./test.py -f 2-query/tail.py -Q 3
+python3 ./test.py -f 2-query/ttl_comment.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_max.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_min.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 3
+python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 3
+python3 ./test.py -f 2-query/twa.py -Q 3
+python3 ./test.py -f 2-query/irate.py -Q 3
+python3 ./test.py -f 2-query/function_null.py -Q 3
+python3 ./test.py -f 2-query/count_partition.py -Q 3
+python3 ./test.py -f 2-query/max_partition.py -Q 3
+python3 ./test.py -f 2-query/max_min_last_interval.py -Q 3
+python3 ./test.py -f 2-query/last_row.py -Q 3
+python3 ./test.py -f 2-query/tsbsQuery.py -Q 3
+python3 ./test.py -f 2-query/sml.py -Q 3
+python3 ./test.py -f 2-query/interp.py -Q 3
+python3 ./test.py -f 2-query/case_when.py -Q 3
+python3 ./test.py -f 2-query/blockSMA.py -Q 3
+python3 ./test.py -f 99-TDcase/TD-21561.py -Q 3
+python3 ./test.py -f 2-query/between.py -Q 4
+python3 ./test.py -f 2-query/distinct.py -Q 4
+python3 ./test.py -f 2-query/varchar.py -Q 4
+python3 ./test.py -f 2-query/ltrim.py -Q 4
+python3 ./test.py -f 2-query/rtrim.py -Q 4
+python3 ./test.py -f 2-query/length.py -Q 4
+python3 ./test.py -f 2-query/char_length.py -Q 4
+python3 ./test.py -f 2-query/upper.py -Q 4
+python3 ./test.py -f 2-query/lower.py -Q 4
+python3 ./test.py -f 2-query/join.py -Q 4
+python3 ./test.py -f 2-query/join2.py -Q 4
+python3 ./test.py -f 2-query/substr.py -Q 4
+python3 ./test.py -f 2-query/union.py -Q 4
+python3 ./test.py -f 2-query/union1.py -Q 4
+python3 ./test.py -f 2-query/concat.py -Q 4
+python3 ./test.py -f 2-query/concat2.py -Q 4
+python3 ./test.py -f 2-query/concat_ws.py -Q 4
+python3 ./test.py -f 2-query/concat_ws2.py -Q 4
+python3 ./test.py -f 2-query/check_tsdb.py -Q 4
+python3 ./test.py -f 2-query/spread.py -Q 4
+python3 ./test.py -f 2-query/hyperloglog.py -Q 4
+python3 ./test.py -f 2-query/explain.py -Q 4
+python3 ./test.py -f 2-query/leastsquares.py -Q 4
+python3 ./test.py -f 2-query/timezone.py -Q 4
+python3 ./test.py -f 2-query/Now.py -Q 4
+python3 ./test.py -f 2-query/Today.py -Q 4
+python3 ./test.py -f 2-query/max.py -Q 4
+python3 ./test.py -f 2-query/min.py -Q 4
+python3 ./test.py -f 2-query/mode.py -Q 4
+python3 ./test.py -f 2-query/count.py -Q 4
+python3 ./test.py -f 2-query/countAlwaysReturnValue.py -Q 4
+python3 ./test.py -f 2-query/last.py -Q 4
+python3 ./test.py -f 2-query/first.py -Q 4
+python3 ./test.py -f 2-query/To_iso8601.py -Q 4
+python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 4
+python3 ./test.py -f 2-query/timetruncate.py -Q 4
+python3 ./test.py -f 2-query/diff.py -Q 4
+python3 ./test.py -f 2-query/Timediff.py -Q 4
+python3 ./test.py -f 2-query/top.py -Q 4
+python3 ./test.py -f 2-query/bottom.py -Q 4
+python3 ./test.py -f 2-query/percentile.py -Q 4
+python3 ./test.py -f 2-query/apercentile.py -Q 4
+python3 ./test.py -f 2-query/abs.py -Q 4
+python3 ./test.py -f 2-query/ceil.py -Q 4
+python3 ./test.py -f 2-query/floor.py -Q 4
+python3 ./test.py -f 2-query/round.py -Q 4
+python3 ./test.py -f 2-query/log.py -Q 4
+python3 ./test.py -f 2-query/pow.py -Q 4
+python3 ./test.py -f 2-query/sqrt.py -Q 4
+python3 ./test.py -f 2-query/sin.py -Q 4
+python3 ./test.py -f 2-query/cos.py -Q 4
+python3 ./test.py -f 2-query/tan.py -Q 4
+python3 ./test.py -f 2-query/arcsin.py -Q 4
+python3 ./test.py -f 2-query/arccos.py -Q 4
+python3 ./test.py -f 2-query/arctan.py -Q 4
+python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4
+python3 ./test.py -f 2-query/nestedQuery.py -Q 4
+python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 4
+python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4
+python3 ./test.py -f 2-query/nestedQuery_math.py -Q 4
+python3 ./test.py -f 2-query/nestedQuery_time.py -Q 4
+python3 ./test.py -f 2-query/avg.py -Q 4
+python3 ./test.py -f 2-query/elapsed.py -Q 4
+python3 ./test.py -f 2-query/csum.py -Q 4
+python3 ./test.py -f 2-query/mavg.py -Q 4
+python3 ./test.py -f 2-query/sample.py -Q 4
+python3 ./test.py -f 2-query/cast.py -Q 4
+python3 ./test.py -f 2-query/function_diff.py -Q 4
+python3 ./test.py -f 2-query/unique.py -Q 4
+python3 ./test.py -f 2-query/tail.py -Q 4
+python3 ./test.py -f 2-query/ttl_comment.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_max.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_min.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 4
+python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 4
+python3 ./test.py -f 2-query/twa.py -Q 4
+python3 ./test.py -f 2-query/irate.py -Q 4
+python3 ./test.py -f 2-query/function_null.py -Q 4
+python3 ./test.py -f 2-query/count_partition.py -Q 4
+python3 ./test.py -f 2-query/max_partition.py -Q 4
+python3 ./test.py -f 2-query/max_min_last_interval.py -Q 4
+python3 ./test.py -f 2-query/last_row.py -Q 4
+python3 ./test.py -f 2-query/tsbsQuery.py -Q 4
+python3 ./test.py -f 2-query/sml.py -Q 4
+python3 ./test.py -f 2-query/interp.py -Q 4
+python3 ./test.py -f 2-query/case_when.py -Q 4
+python3 ./test.py -f 2-query/insert_select.py
+python3 ./test.py -f 2-query/insert_select.py -R
+python3 ./test.py -f 2-query/insert_select.py -Q 2
+python3 ./test.py -f 2-query/insert_select.py -Q 3
+python3 ./test.py -f 2-query/insert_select.py -Q 4
+python3 ./test.py -f 2-query/insert_null_none.py
+python3 ./test.py -f 2-query/insert_null_none.py -R
+python3 ./test.py -f 2-query/insert_null_none.py -Q 2
+python3 ./test.py -f 2-query/insert_null_none.py -Q 3
+python3 ./test.py -f 2-query/insert_null_none.py -Q 4
+python3 ./test.py -f 2-query/out_of_order.py
+python3 ./test.py -f 2-query/out_of_order.py -R
+python3 ./test.py -f 2-query/out_of_order.py -Q 2
+python3 ./test.py -f 2-query/out_of_order.py -Q 3
+python3 ./test.py -f 2-query/out_of_order.py -Q 4
+python3 ./test.py -f 2-query/max_min_data.py
+python3 ./test.py -f 2-query/max_min_data.py -R
+python3 ./test.py -f 2-query/max_min_data.py -Q 2
+python3 ./test.py -f 2-query/max_min_data.py -Q 3
+python3 ./test.py -f 2-query/max_min_data.py -Q 4
+python3 ./test.py -f 2-query/blockSMA.py -Q 4
+python3 ./test.py -f 2-query/odbc.py
+python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4
+python3 ./test.py -f 99-TDcase/TD-20582.py
diff --git a/tests/unit-test/win-test-file b/tests/unit-test/win-test-file
new file mode 100644
index 0000000000000000000000000000000000000000..7ddca165e55c15048841effe860d255befc3955f
--- /dev/null
+++ b/tests/unit-test/win-test-file
@@ -0,0 +1 @@
+bash test.sh
diff --git a/tools/shell/CMakeLists.txt b/tools/shell/CMakeLists.txt
index 600e33feab10fcd0b3c0ccee2de3cd61544e16d8..7b1dc3a541416335dca761aba8634679473ecdd2 100644
--- a/tools/shell/CMakeLists.txt
+++ b/tools/shell/CMakeLists.txt
@@ -26,10 +26,6 @@ ELSE ()
SET(LINK_WEBSOCKET "")
ENDIF ()
-IF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)
- ADD_DEFINITIONS(-I${CMAKE_CURRENT_SOURCE_DIR}/../../../enterprise/packaging)
-ENDIF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)
-
IF (TD_LINUX AND TD_ALPINE)
SET(LINK_ARGP "/usr/lib/libargp.a")
ELSE ()
diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c
index 8111ccc0b11e085da5cf47ef95690a02c4ddd131..0f5585991e5efcf4d3c69b74a5b0b3e254a99e60 100644
--- a/tools/shell/src/shellArguments.c
+++ b/tools/shell/src/shellArguments.c
@@ -59,8 +59,8 @@ char cusEmail[] = "";
#define SHELL_VERSION "Print program version."
#ifdef WEBSOCKET
-#define SHELL_DSN "The dsn to use when connecting to cloud server."
-#define SHELL_REST "Use restful mode when connecting."
+#define SHELL_DSN "Use dsn to connect to the cloud server or to a remote server which provides WebSocket connection."
+#define SHELL_REST "Use RESTful mode when connecting."
#define SHELL_TIMEOUT "Set the timeout for websocket query in seconds, default is 30."
#endif
@@ -93,7 +93,11 @@ void shellPrintHelp() {
#endif
printf("%s%s%s%s\r\n", indent, "-w,", indent, SHELL_WIDTH);
printf("%s%s%s%s\r\n", indent, "-V,", indent, SHELL_VERSION);
- printf("\r\n\r\nReport bugs to %s.\r\n", cusEmail);
+#ifdef CUS_EMAIL
+ printf("\r\n\r\nReport bugs to %s.\r\n", CUS_EMAIL);
+#else
+ printf("\r\n\r\nReport bugs to %s.\r\n", "support@taosdata.com");
+#endif
}
#ifdef LINUX
@@ -105,7 +109,11 @@ void shellPrintHelp() {
#endif
const char *argp_program_version = version;
-const char *argp_program_bug_address = cusEmail;
+#ifdef CUS_EMAIL
+const char *argp_program_bug_address = CUS_EMAIL;
+#else
+const char *argp_program_bug_address = "support@taosdata.com";
+#endif
static struct argp_option shellOptions[] = {
{"host", 'h', "HOST", 0, SHELL_HOST},
@@ -411,10 +419,19 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
shell.info.clientVersion =
"Welcome to the %s Command Line Interface, Client Version:%s\r\n"
"Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n";
- strcpy(shell.info.cusName, cusName);
- sprintf(shell.info.promptHeader, "%s> ", cusPrompt);
+#ifdef CUS_NAME
+ strcpy(shell.info.cusName, CUS_NAME);
+#else
+ strcpy(shell.info.cusName, "TDengine");
+#endif
char promptContinueFormat[32] = {0};
- sprintf(promptContinueFormat, "%%%zus> ", strlen(cusPrompt));
+#ifdef CUS_PROMPT
+ sprintf(shell.info.promptHeader, "%s> ", CUS_PROMPT);
+ sprintf(promptContinueFormat, "%%%zus> ", strlen(CUS_PROMPT));
+#else
+ sprintf(shell.info.promptHeader, "taos> ");
+ sprintf(promptContinueFormat, "%%%zus> ", strlen("taos"));
+#endif
sprintf(shell.info.promptContinue, promptContinueFormat, " ");
shell.info.promptSize = strlen(shell.info.promptHeader);
#ifdef TD_ENTERPRISE
diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c
index a8986351b7325802ba6a121db56a1cbc5dfe1295..140720af815cf317bf7665c40750b2d0fb2ebd37 100644
--- a/tools/shell/src/shellAuto.c
+++ b/tools/shell/src/shellAuto.c
@@ -84,15 +84,15 @@ SWords shellCommands[] = {
{"create table using tags(", 0, 0, NULL},
{"create database "
" "
- " ;",
- 0, 0, NULL},
+ " ;", 0, 0, NULL},
{"create dnode ", 0, 0, NULL},
{"create index on ()", 0, 0, NULL},
{"create mnode on dnode ;", 0, 0, NULL},
{"create qnode on dnode ;", 0, 0, NULL},
{"create stream into as select", 0, 0, NULL}, // 26 append sub sql
{"create topic as select", 0, 0, NULL}, // 27 append sub sql
- {"create function ", 0, 0, NULL},
+ {"create function as outputtype language ", 0, 0, NULL},
+ {"create aggregate function as outputtype bufsize language ", 0, 0, NULL},
{"create user pass sysinfo 0;", 0, 0, NULL},
{"create user pass sysinfo 1;", 0, 0, NULL},
{"describe ", 0, 0, NULL},
@@ -105,7 +105,7 @@ SWords shellCommands[] = {
{"drop qnode on dnode ;", 0, 0, NULL},
{"drop user ;", 0, 0, NULL},
// 40
- {"drop function", 0, 0, NULL},
+ {"drop function ;", 0, 0, NULL},
{"drop consumer group on ", 0, 0, NULL},
{"drop topic ;", 0, 0, NULL},
{"drop stream ;", 0, 0, NULL},
@@ -272,6 +272,8 @@ char* key_systable[] = {
"ins_subscriptions", "ins_streams", "ins_stream_tasks", "ins_vnodes", "ins_user_privileges", "perf_connections",
"perf_queries", "perf_consumers", "perf_trans", "perf_apps"};
+char* udf_language[] = {"\'Python\'", "\'C\'"};
+
//
// ------- global variant define ---------
//
@@ -291,25 +293,29 @@ bool waitAutoFill = false;
#define WT_VAR_USERNAME 4
#define WT_VAR_TOPIC 5
#define WT_VAR_STREAM 6
-#define WT_VAR_ALLTABLE 7
-#define WT_VAR_FUNC 8
-#define WT_VAR_KEYWORD 9
-#define WT_VAR_TBACTION 10
-#define WT_VAR_DBOPTION 11
-#define WT_VAR_ALTER_DBOPTION 12
-#define WT_VAR_DATATYPE 13
-#define WT_VAR_KEYTAGS 14
-#define WT_VAR_ANYWORD 15
-#define WT_VAR_TBOPTION 16
-#define WT_VAR_USERACTION 17
-#define WT_VAR_KEYSELECT 18
-#define WT_VAR_SYSTABLE 19
-
-#define WT_VAR_CNT 20
-
-#define WT_FROM_DB_MAX 6 // max get content from db
+#define WT_VAR_UDFNAME 7
+
+#define WT_FROM_DB_MAX 7 // max get content from db
#define WT_FROM_DB_CNT (WT_FROM_DB_MAX + 1)
+#define WT_VAR_ALLTABLE 8
+#define WT_VAR_FUNC 9
+#define WT_VAR_KEYWORD 10
+#define WT_VAR_TBACTION 11
+#define WT_VAR_DBOPTION 12
+#define WT_VAR_ALTER_DBOPTION 13
+#define WT_VAR_DATATYPE 14
+#define WT_VAR_KEYTAGS 15
+#define WT_VAR_ANYWORD 16
+#define WT_VAR_TBOPTION 17
+#define WT_VAR_USERACTION 18
+#define WT_VAR_KEYSELECT 19
+#define WT_VAR_SYSTABLE 20
+#define WT_VAR_LANGUAGE 21
+
+#define WT_VAR_CNT 22
+
+
#define WT_TEXT 0xFF
char dbName[256] = ""; // save use database name;
@@ -319,13 +325,13 @@ TdThreadMutex tiresMutex;
// save thread handle obtain var name from db server
TdThread* threads[WT_FROM_DB_CNT];
// obtain var name with sql from server
-char varTypes[WT_VAR_CNT][64] = {"", "", "", "", "",
- "", "", "", "", "",
- "", "", "", "", "",
- "", "", "", ""};
+char varTypes[WT_VAR_CNT][64] = {
+ "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", ""};
char varSqls[WT_FROM_DB_CNT][64] = {"show databases;", "show stables;", "show tables;", "show dnodes;",
- "show users;", "show topics;", "show streams;"};
+ "show users;", "show topics;", "show streams;", "show functions;"};
// var words current cursor, if user press any one key except tab, cursorVar can be reset to -1
int cursorVar = -1;
@@ -390,7 +396,8 @@ void showHelp() {
create qnode on dnode ;\n\
create stream into as select ...\n\
create topic as select ...\n\
- create function ...\n\
+ create function as outputtype language \'C\' | \'Python\' ;\n\
+ create aggregate function as outputtype bufsize language \'C\' | \'Python\';\n\
create user pass ...\n\
----- D ----- \n\
describe \n\
@@ -401,7 +408,7 @@ void showHelp() {
drop mnode on dnode ;\n\
drop qnode on dnode ;\n\
drop user ;\n\
- drop function ;\n\
+ drop function ;\n\
drop consumer group ... \n\
drop topic ;\n\
drop stream ;\n\
@@ -643,6 +650,7 @@ bool shellAutoInit() {
GenerateVarType(WT_VAR_USERACTION, user_actions, sizeof(user_actions) / sizeof(char*));
GenerateVarType(WT_VAR_KEYSELECT, key_select, sizeof(key_select) / sizeof(char*));
GenerateVarType(WT_VAR_SYSTABLE, key_systable, sizeof(key_systable) / sizeof(char*));
+ GenerateVarType(WT_VAR_LANGUAGE, udf_language, sizeof(udf_language) / sizeof(char*));
return true;
}
diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c
index f9602aaa4dfb0f2ea7b68216c239df66ceae62e1..70130397ba7d4b9539080bff1ad81c193e751a54 100644
--- a/tools/shell/src/shellEngine.c
+++ b/tools/shell/src/shellEngine.c
@@ -291,7 +291,9 @@ char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision) {
}
struct tm ptm = {0};
- taosLocalTime(&tt, &ptm);
+ if (taosLocalTime(&tt, &ptm, buf) == NULL) {
+ return buf;
+ }
size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm);
if (precision == TSDB_TIME_PRECISION_NANO) {
diff --git a/utils/test/c/tmqDemo.c b/utils/test/c/tmqDemo.c
index d105b505793eae17068af9e9db02eff5071f5bd4..ce069c2b05878cb6806f2784be896942cb701ae4 100644
--- a/utils/test/c/tmqDemo.c
+++ b/utils/test/c/tmqDemo.c
@@ -597,7 +597,7 @@ void printParaIntoFile() {
time_t tTime = taosGetTimestampSec();
struct tm tm;
- taosLocalTime(&tTime, &tm);
+ taosLocalTime(&tTime, &tm, NULL);
taosFprintfFile(pFile, "###################################################################\n");
taosFprintfFile(pFile, "# configDir: %s\n", configDir);
diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c
index 69debe7ab50c0dff57cbc570cbb7643f3249521b..f2de219f4e740b090a87ebbb7e9ceb9cb1c6dcc2 100644
--- a/utils/test/c/tmqSim.c
+++ b/utils/test/c/tmqSim.c
@@ -166,7 +166,7 @@ static void printHelp() {
char* getCurrentTimeString(char* timeString) {
time_t tTime = taosGetTimestampSec();
struct tm tm;
- taosLocalTime(&tTime, &tm);
+ taosLocalTime(&tTime, &tm, NULL);
sprintf(timeString, "%d-%02d-%02d %02d:%02d:%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
tm.tm_min, tm.tm_sec);
@@ -472,7 +472,9 @@ static char* shellFormatTimestamp(char* buf, int64_t val, int32_t precision) {
}
struct tm ptm;
- taosLocalTime(&tt, &ptm);
+ if (taosLocalTime(&tt, &ptm, buf) == NULL) {
+ return buf;
+ }
size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm);
if (precision == TSDB_TIME_PRECISION_NANO) {
diff --git a/utils/test/c/tmq_taosx_ci.c b/utils/test/c/tmq_taosx_ci.c
index 6661d6d14a9f339b58d4ef22e3aa6e69d7663229..c4becdd38196727b0ac3417c028fb4f9d698ae80 100644
--- a/utils/test/c/tmq_taosx_ci.c
+++ b/utils/test/c/tmq_taosx_ci.c
@@ -441,7 +441,7 @@ int32_t init_env() {
taos_free_result(pRes);
char sql[128] = {0};
- snprintf(sql, 128, "create database if not exists db_taosx vgroups %d", g_conf.dstVgroups);
+ snprintf(sql, 128, "create database if not exists db_taosx vgroups %d wal_retention_period 3600", g_conf.dstVgroups);
pRes = taos_query(pConn, sql);
if (taos_errno(pRes) != 0) {
printf("error in create db_taosx, reason:%s\n", taos_errstr(pRes));
@@ -470,7 +470,7 @@ int32_t init_env() {
}
taos_free_result(pRes);
- snprintf(sql, 128, "create database if not exists abc1 vgroups %d", g_conf.srcVgroups);
+ snprintf(sql, 128, "create database if not exists abc1 vgroups %d wal_retention_period 3600", g_conf.srcVgroups);
pRes = taos_query(pConn, sql);
if (taos_errno(pRes) != 0) {
printf("error in create db, reason:%s\n", taos_errstr(pRes));
diff --git a/utils/tsim/src/simExe.c b/utils/tsim/src/simExe.c
index d82c948cf7b774703faaa8e70ee7b49bde9f8d12..1be28635ef721167d67a33e7837f782c70e17d49 100644
--- a/utils/tsim/src/simExe.c
+++ b/utils/tsim/src/simExe.c
@@ -37,15 +37,15 @@ void simLogSql(char *sql, bool useSharp) {
char *simParseHostName(char *varName) {
static char hostName[140];
-#ifdef WINDOWS
- hostName[0] = '\"';
- taosGetFqdn(&hostName[1]);
- int strEndIndex = strlen(hostName);
- hostName[strEndIndex] = '\"';
- hostName[strEndIndex + 1] = '\0';
-#else
+//#ifdef WINDOWS
+// hostName[0] = '\"';
+// taosGetFqdn(&hostName[1]);
+// int strEndIndex = strlen(hostName);
+// hostName[strEndIndex] = '\"';
+// hostName[strEndIndex + 1] = '\0';
+//#else
sprintf(hostName, "%s", "localhost");
-#endif
+//#endif
return hostName;
}
@@ -376,6 +376,20 @@ bool simExecuteRunBackCmd(SScript *script, char *option) {
return true;
}
+void simReplaceDirSep (char *buf){
+#ifdef WINDOWS
+ int i=0;
+ while(buf[i] != '\0')
+ {
+ if(buf[i] == '/')
+ {
+ buf[i] = '\\';
+ }
+ i++;
+ }
+#endif
+}
+
bool simReplaceStr(char *buf, char *src, char *dst) {
bool replaced = false;
char *begin = strstr(buf, src);
@@ -407,9 +421,10 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
sprintf(buf, "cd %s; ", simScriptDir);
simVisuallizeOption(script, option, buf + strlen(buf));
#else
- sprintf(buf, "%s", simScriptDir);
+ sprintf(buf, "cd %s && ", simScriptDir);
simVisuallizeOption(script, option, buf + strlen(buf));
simReplaceStr(buf, ".sh", ".bat");
+ simReplaceDirSep(buf);
#endif
if (useValgrind) {
@@ -471,6 +486,8 @@ bool simExecuteSystemContentCmd(SScript *script, char *option) {
#ifdef WINDOWS
sprintf(buf, "cd %s && ", simScriptDir);
simVisuallizeOption(script, option, buf + strlen(buf));
+ simReplaceStr(buf, ".sh", ".bat");
+ simReplaceDirSep(buf);
sprintf(buf1, "%s > %s 2>nul", buf, filename);
#else
sprintf(buf, "cd %s; ", simScriptDir);
@@ -755,7 +772,9 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
tt = (*(int64_t *)row[i]) / 1000000000;
}
- taosLocalTime(&tt, &tp);
+ if (taosLocalTime(&tt, &tp, timeStr) == NULL) {
+ break;
+ }
strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", &tp);
if (precision == TSDB_TIME_PRECISION_MILLI) {
sprintf(value, "%s.%03d", timeStr, (int32_t)(*((int64_t *)row[i]) % 1000));