diff --git a/Jenkinsfile2 b/Jenkinsfile2
index 6c72f8216e..bb7fa70c57 100644
--- a/Jenkinsfile2
+++ b/Jenkinsfile2
@@ -40,7 +40,7 @@ def check_docs() {
sh '''
cd ${WKC}
git reset --hard
- git clean -fxd
+ git clean -f
rm -rf examples/rust/
git remote prune origin
git fetch
@@ -86,7 +86,7 @@ def pre_test(){
git fetch
cd ${WKC}
git reset --hard
- git clean -fxd
+ git clean -f
rm -rf examples/rust/
git remote prune origin
git fetch
@@ -201,7 +201,7 @@ def pre_test_win(){
'''
bat '''
cd %WIN_COMMUNITY_ROOT%
- git clean -fxd
+ git clean -f
git reset --hard
git remote prune origin
git fetch
@@ -313,7 +313,8 @@ def pre_test_build_win() {
bat '''
cd %WIN_CONNECTOR_ROOT%
python.exe -m pip install --upgrade pip
- python -m pip install .
+ python -m pip uninstall taospy -y
+ python -m pip install taospy==2.7.6
xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
'''
return 1
@@ -331,8 +332,6 @@ def run_win_test() {
bat '''
echo "windows test ..."
cd %WIN_CONNECTOR_ROOT%
- python.exe -m pip install --upgrade pip
- python -m pip install .
xcopy /e/y/i/f %WIN_INTERNAL_ROOT%\\debug\\build\\lib\\taos.dll C:\\Windows\\System32
ls -l C:\\Windows\\System32\\taos.dll
time /t
@@ -387,7 +386,7 @@ pipeline {
}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
- timeout(time: 75, unit: 'MINUTES'){
+ timeout(time: 126, unit: 'MINUTES'){
pre_test_win()
pre_test_build_win()
run_win_ctest()
diff --git a/README.md b/README.md
index 3b7e978a17..5d4bb309a4 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.version b/cmake/cmake.version
index d0d455c73d..d38ac40b90 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.2.6")
+ SET(TD_VER_NUMBER "3.0.3.0")
ENDIF ()
IF (DEFINED VERCOMPATIBLE)
diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in
index 8df50af03c..1c401ae80e 100644
--- a/cmake/taosadapter_CMakeLists.txt.in
+++ b/cmake/taosadapter_CMakeLists.txt.in
@@ -2,7 +2,7 @@
# taosadapter
ExternalProject_Add(taosadapter
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
- GIT_TAG db6c843
+ GIT_TAG d8059ff
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in
index db2ae92f6e..736ab0b095 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 1e15545
+ GIT_TAG d9ec91d
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 7b8dbd6535..0f1150a331 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 95dd4324f1..79d170eeb9 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 a0c1d93983..c70c2589c2 100644
--- a/docs/en/05-get-started/03-package.md
+++ b/docs/en/05-get-started/03-package.md
@@ -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 d5afa8ef6e..d6a0048138 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 c85109d3c5..71abe59055 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";
@@ -294,7 +295,7 @@ You configure the following parameters when creating a consumer:
| `enable.auto.commit` | boolean | Commit automatically | Specify `true` or `false`. |
| `auto.commit.interval.ms` | integer | Interval for automatic commits, in milliseconds |
| `enable.heartbeat.background` | boolean | Backend heartbeat; if enabled, the consumer does not go offline even if it has not polled for a long time | |
-| `experimental.snapshot.enable` | boolean | Specify whether to consume messages from the WAL or from TSBS | |
+| `experimental.snapshot.enable` | boolean | Specify whether to consume messages from TSDB | |
| `msg.with.table.name` | boolean | Specify whether to deserialize table names from messages |
The method of specifying these parameters depends on the language used:
@@ -417,7 +418,7 @@ 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` |
@@ -807,7 +808,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 553a7b932b..dc42743b51 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 965161651c..c0e9e6c937 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 0000000000..2a48713358
--- /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 5e8c9aaa92..a1c46875aa 100644
--- a/docs/en/12-taos-sql/02-database.md
+++ b/docs/en/12-taos-sql/02-database.md
@@ -75,10 +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 time after which WAL files are deleted. This parameter is used for data subscription. Enter a time in seconds. The default value of single copy is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. The default value of multiple copy is 4 days.
-- WAL_RETENTION_SIZE: specifies the size at which WAL files are deleted. This parameter is used for data subscription. Enter a size in KB. The default value of single copy is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. The default value of multiple copy is -1.
-- 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 of single copy is 0. A value of 0 indicates that a new WAL file is created only after the previous WAL file was written to disk. The default values of multiple copy is 1 day.
-- 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 the previous WAL file was written to disk.
+- 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_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
diff --git a/docs/en/12-taos-sql/04-stable.md b/docs/en/12-taos-sql/04-stable.md
index 5b316d0d24..3725728637 100644
--- a/docs/en/12-taos-sql/04-stable.md
+++ b/docs/en/12-taos-sql/04-stable.md
@@ -34,7 +34,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 3099e3a541..75462c3d96 100644
--- a/docs/en/12-taos-sql/06-select.md
+++ b/docs/en/12-taos-sql/06-select.md
@@ -248,7 +248,7 @@ 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 clause, the LIMIT keyword is performed on each partition, not on the entire set of results.
## SLIMIT
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 0000000000..cb2a61d3e8
--- /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 b32d2af5bb..8dfa9c2851 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 536fd8ffc3..1edae16026 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:
@@ -105,7 +105,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 +146,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 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 b2494e0cc1..843858c0c7 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 d2bc72f047..81284aeaed 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 dc1db956a0..65aab4c47b 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;
```
@@ -359,7 +359,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/event_window.webp b/docs/en/12-taos-sql/event_window.webp
new file mode 100644
index 0000000000..0a3a344b03
Binary files /dev/null and b/docs/en/12-taos-sql/event_window.webp differ
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 b138d69bfc..1691b8be8b 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 3bd7b7f4c6..b543879b3c 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 36992da636..e7a1303aaf 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
diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx
index 6e84859610..ad522e9d2b 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 146da268a8..c885d416c8 100644
--- a/docs/en/14-reference/03-connector/07-python.mdx
+++ b/docs/en/14-reference/03-connector/07-python.mdx
@@ -32,7 +32,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.
@@ -228,6 +228,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 +308,15 @@ 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.
@@ -319,6 +337,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 e984967fb7..fdc0824973 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 fd00d11239..6cc45ded49 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/_windows_install.mdx b/docs/en/14-reference/03-connector/_windows_install.mdx
index a96e02feea..723f685b5d 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 2df73b8592..a35d5bc2d1 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 c1ec97b647..7ab894a1c7 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 9828d71ece..bfb311d72e 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.
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 f651983528..43f29bda44 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 b4254c428b..660875262e 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 7696cfce3f..e3bad31fab 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/12-config/index.md b/docs/en/14-reference/12-config/index.md
index 7075dc771e..a76074f507 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 | |
@@ -599,7 +599,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 651892c8b2..439fcf37f6 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 caedd76df8..3f75364081 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/_statsd.mdx b/docs/en/14-reference/_statsd.mdx
index d068304a1d..b15c9640db 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/11-kafka.md b/docs/en/20-third-party/11-kafka.md
index 0998862b2d..9e322d2a5b 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 a0f6ca4ffe..e2a1e358b0 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 73da1c1dd6..474272c46d 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 e043aebcb6..b84b30bb71 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 6a62108062..088c4ba2dc 100644
--- a/docs/en/28-releases/01-tdengine.md
+++ b/docs/en/28-releases/01-tdengine.md
@@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://w
import Release from "/components/ReleaseV3";
+## 3.0.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 91eb0c9b8d..7d45110bb0 100644
--- a/docs/en/28-releases/02-tools.md
+++ b/docs/en/28-releases/02-tools.md
@@ -10,6 +10,14 @@ For other historical version installers, please visit [here](https://www.taosdat
import Release from "/components/ReleaseV3";
+## 2.4.9
+
+
+
+## 2.4.8
+
+
+
## 2.4.6
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 04b149a4b9..8678f65231 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 c2989acdbe..dc820f161c 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 0000000000..eac386732c
--- /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')
+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_websocket_examples.py b/docs/examples/python/connect_websocket_examples.py
new file mode 100644
index 0000000000..c50976efbf
--- /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")
+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/zh/04-concept/index.md b/docs/zh/04-concept/index.md
index 2cba68edcd..b389b8d1ce 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 7edb9b62f4..1fab518529 100644
--- a/docs/zh/05-get-started/03-package.md
+++ b/docs/zh/05-get-started/03-package.md
@@ -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/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx
index fb171042d9..1d834cfff0 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";
@@ -288,9 +289,9 @@ CREATE TOPIC topic_name AS DATABASE db_name;
| `td.connect.port` | integer | 用于创建连接,同 `taos_connect` | |
| `group.id` | string | 消费组 ID,同一消费组共享消费进度 | **必填项**。最大长度:192。 |
| `client.id` | string | 客户端 ID | 最大长度:192。 |
-| `auto.offset.reset` | enum | 消费组订阅的初始位置 | 可选:`earliest`(default), `latest`, `none` |
+| `auto.offset.reset` | enum | 消费组订阅的初始位置 | `earliest`: default;从头开始订阅; `latest`: 仅从最新数据开始订阅; `none`: 没有提交的 offset 无法订阅 |
| `enable.auto.commit` | boolean | 是否启用消费位点自动提交 | 合法值:`true`, `false`。 |
-| `auto.commit.interval.ms` | integer | 以毫秒为单位的消费记录自动提交消费位点时间间 | 默认 5000 m |
+| `auto.commit.interval.ms` | integer | 以毫秒为单位的消费记录自动提交消费位点时间间隔 | 默认 5000 m |
| `enable.heartbeat.background` | boolean | 启用后台心跳,启用后即使长时间不 poll 消息也不会造成离线 | 默认开启 |
| `experimental.snapshot.enable` | boolean | 是否允许从 TSDB 消费数据 | 实验功能,默认关闭 |
| `msg.with.table.name` | boolean | 是否允许从消息中解析表名, 不适用于列订阅(列订阅时可将 tbname 作为列写入 subquery 语句) | |
@@ -807,7 +808,14 @@ SHOW SUBSCRIPTIONS;
-
+
+
+
+
+
+
+
+
diff --git a/docs/zh/07-develop/09-udf.md b/docs/zh/07-develop/09-udf.md
index 7a3a3822d5..2eb4b3dee3 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 a0505dabad..60810ec275 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 0000000000..5a4211d059
--- /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 af2ec1b1c2..a081595bca 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 35d30303c2..9c5095f09c 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/30-python.mdx b/docs/zh/08-connector/30-python.mdx
index 1962df9607..b57f02ac80 100644
--- a/docs/zh/08-connector/30-python.mdx
+++ b/docs/zh/08-connector/30-python.mdx
@@ -32,7 +32,7 @@ Python 连接器的源码托管在 [GitHub](https://github.com/taosdata/taos-con
### 准备
-1. 安装 Python。新近版本 taospy 包要求 Python 3.6+。早期版本 taospy 包要求 Python 3.7+。taos-ws-py 包要求 Python 3.7+。如果系统上还没有 Python 可参考 [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) 安装。
+1. 安装 Python。新近版本 taospy 包要求 Python 3.6.2+。早期版本 taospy 包要求 Python 3.7+。taos-ws-py 包要求 Python 3.7+。如果系统上还没有 Python 可参考 [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) 安装。
2. 安装 [pip](https://pypi.org/project/pip/)。大部分情况下 Python 的安装包都自带了 pip 工具, 如果没有请参考 [pip documentation](https://pip.pypa.io/en/stable/installation/) 安装。
3. 如果使用原生连接,还需[安装客户端驱动](../#安装客户端驱动)。客户端软件包含了 TDengine 客户端动态链接库(libtaos.so 或 taos.dll) 和 TDengine CLI。
@@ -229,6 +229,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 +308,15 @@ 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 语句,返回查询结果
@@ -320,6 +337,13 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
{{#include docs/examples/python/conn_rest_pandas.py}}
```
+
+
+
+```python
+{{#include docs/examples/python/conn_websocket_pandas.py}}
+```
+
@@ -335,15 +359,17 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
```python
{{#include docs/examples/python/tmq_example.py}}
```
+
-
+
除了原生的连接方式,Python 连接器还支持通过 websocket 订阅 TMQ 数据。
```python
{{#include docs/examples/python/tmq_websocket_example.py}}
```
+
@@ -366,7 +392,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 80a831bab9..3a945e77fd 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/index.md b/docs/zh/08-connector/index.md
index f3f0f23b34..eb1f3a9a9a 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 0cae59657c..39ca56f3d9 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 d9ef3b51aa..9e346fdca8 100644
--- a/docs/zh/12-taos-sql/02-database.md
+++ b/docs/zh/12-taos-sql/02-database.md
@@ -75,10 +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 表示不删除。多副本默认为 4 天。
-- WAL_RETENTION_SIZE:wal 文件的额外保留策略,用于数据订阅。wal 的保存的最大上限,单位为 KB。单副本默认为 0,即落盘后立即删除。多副本默认为-1,表示不删除。
-- WAL_ROLL_PERIOD:wal 文件切换时长,单位为 s。当 wal 文件创建并写入后,经过该时间,会自动创建一个新的 wal 文件。单副本默认为 0,即仅在落盘时创建新文件。多副本默认为 1 天。
-- WAL_SEGMENT_SIZE:wal 单个文件大小,单位为 KB。当前写入文件大小超过上限后会自动创建一个新的 wal 文件。默认为 0,即仅在落盘时创建新文件。
+- WAL_RETENTION_PERIOD:数据订阅已消费WAL日志,WAL文件的最大额外保留的时长策略。单位为 s。默认为 0,表示无需额外保留。-1, 表示额外保留,时间无上限。
+- WAL_RETENTION_SIZE:数据订阅已消费WAL日志,WAL文件的最大额外保留的累计大小策略。单位为 KB。默认为 0,表示无需额外保留。-1, 表示额外保留,累计大小无上限。
+- WAL_ROLL_PERIOD:wal 文件切换时长,单位为 s。当WAL文件创建并写入后,经过该时间,会自动创建一个新的WAL文件。默认为 0,即仅在TSDB落盘时创建新文件。
+- WAL_SEGMENT_SIZE:wal 单个文件大小,单位为 KB。当前写入文件大小超过上限后会自动创建一个新的WAL文件。默认为 0,即仅在TSDB落盘时创建新文件。
### 创建数据库示例
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 0000000000..ae16b0b2ec
--- /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 d36c852e79..53689197ef 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
+}
```
在上述语法中的具体限制如下
@@ -138,6 +140,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 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/22-meta.md b/docs/zh/12-taos-sql/22-meta.md
index c05dbf9c2a..1f2e3fb7d5 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 901548e132..5348233d5a 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 行表示内存缓存中没有数据
@@ -303,7 +303,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 cb349109a7..7697944f9a 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/event_window.webp b/docs/zh/12-taos-sql/event_window.webp
new file mode 100644
index 0000000000..6d2ac08204
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 5c155bdd6e..b8c5f9d647 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 9091e71d1f..e2e51efec5 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 会建立子表并继续写入
#### 数据库相关配置参数
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 f651983528..43f29bda44 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 b4254c428b..660875262e 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 7696cfce3f..e3bad31fab 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 8ec11378ee..8783d47f00 100644
--- a/docs/zh/14-reference/07-tdinsight/index.mdx
+++ b/docs/zh/14-reference/07-tdinsight/index.mdx
@@ -46,7 +46,7 @@ sudo apt-get install grafana
### 在 CentOS / RHEL 上安装 Grafana
-
+
您可以从官方 YUM 镜像仓库安装。
@@ -140,10 +140,10 @@ Install and configure TDinsight dashboard in Grafana on Ubuntu 18.04/20.04 syste
| -n | --tdengine-ds-name | TDENGINE_DS_NAME | TDengine 数据源名称,默认为 TDengine。 |
| -a | --tdengine-api | TDENGINE_API | TDengine REST API 端点。默认为`http://127.0.0.1:6041`。 |
| -u | --tdengine-user | TDENGINE_USER | TDengine 用户名。 [默认值:root] |
-| -p | --tdengine-密码 | TDENGINE_PASSWORD | TDengine 密码。 [默认:taosdata] |
+| -p | --tdengine-password | TDENGINE_PASSWORD | TDengine 密码。 [默认:taosdata] |
| -i | --tdinsight-uid | TDINSIGHT_DASHBOARD_UID | TDinsight 仪表盘`uid`。 [默认值:tdinsight] |
| -t | --tdinsight-title | TDINSIGHT_DASHBOARD_TITLE | TDinsight 仪表盘标题。 [默认:TDinsight] |
-| -e | --tdinsight-可编辑 | TDINSIGHT_DASHBOARD_EDITABLE | 如果配置仪表盘可以编辑。 [默认值:false] |
+| -e | --tdinsight-editable | TDINSIGHT_DASHBOARD_EDITABLE | 如果配置仪表盘可以编辑。 [默认值:false] |
| -E | --external-notifier | EXTERNAL_NOTIFIER | 将外部通知程序 uid 应用于 TDinsight 仪表盘。 |
假设您在主机 `tdengine` 上启动 TDengine 数据库,HTTP API 端口为 `6041`,用户为 `root1`,密码为 `pass5ord`。执行脚本:
@@ -175,7 +175,7 @@ sudo ./TDengine.sh -n TDengine-Env1 -a http://another:6041 -u root -p taosdata -
特别地,当您使用 Grafana Cloud 或其他组织时,`-O` 可用于设置组织 ID。 `-G` 可指定 Grafana 插件安装目录。 `-e` 参数将仪表盘设置为可编辑。
-
+
### 安装 TDengine 数据源插件
diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md
index eed8b9ca7d..6eeb577ab5 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 服务的网络端口。 | |
@@ -104,7 +104,7 @@ taos --dump-config
| 属性 | 说明 |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | 服务器内部的系统监控开关。监控主要负责收集物理节点的负载状况,包括 CPU、内存、硬盘、网络带宽的监控记录,监控信息将通过 HTTP 协议发送给由 `monitorFqdn` 和 `monitorProt` 指定的 TaosKeeper 监控服务 |
+| 含义 | 服务器内部的系统监控开关。监控主要负责收集物理节点的负载状况,包括 CPU、内存、硬盘、网络带宽的监控记录,监控信息将通过 HTTP 协议发送给由 `monitorFqdn` 和 `monitorProt` 指定的 taosKeeper 监控服务 |
| 取值范围 | 0:关闭监控服务, 1:激活监控服务。 |
| 缺省值 | 0 |
@@ -113,7 +113,7 @@ taos --dump-config
| 属性 | 说明 |
| -------- | -------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | TaosKeeper 监控服务的 FQDN |
+| 含义 | taosKeeper 监控服务的 FQDN |
| 缺省值 | 无 |
### monitorPort
@@ -121,7 +121,7 @@ taos --dump-config
| 属性 | 说明 |
| -------- | --------------------------- |
| 适用范围 | 仅服务端适用 |
-| 含义 | TaosKeeper 监控服务的端口号 |
+| 含义 | taosKeeper 监控服务的端口号 |
| 缺省值 | 6043 |
### monitorInterval
@@ -355,8 +355,6 @@ charset 的有效值是 UTF-8。
| 取值范围 | 0-4096 |
| 缺省值 | CPU 核数的 2 倍 |
-## 时间相关 |
-
## 性能调优
### numOfCommitThreads
@@ -611,7 +609,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 3d0bac25d2..e5f232c1fc 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 bbd5b1b911..ac0c8754b5 100644
--- a/docs/zh/14-reference/14-taosKeeper.md
+++ b/docs/zh/14-reference/14-taosKeeper.md
@@ -6,7 +6,7 @@ description: TDengine 3.0 版本监控指标的导出工具
## 简介
-TaosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。
+taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。
## 安装
diff --git a/docs/zh/14-reference/_statsd.mdx b/docs/zh/14-reference/_statsd.mdx
index dc4f19b37c..21c2e29f64 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/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md
index cc2247f25e..7fb7738a4f 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 ec263d7792..07a3067a4f 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 c9505d95a5..5c8c5edd05 100644
--- a/docs/zh/28-releases/01-tdengine.md
+++ b/docs/zh/28-releases/01-tdengine.md
@@ -10,6 +10,11 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do
import Release from "/components/ReleaseV3";
+## 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 69d35f95c8..a9c9ea5ac7 100644
--- a/docs/zh/28-releases/02-tools.md
+++ b/docs/zh/28-releases/02-tools.md
@@ -10,6 +10,14 @@ taosTools 各版本安装包下载链接如下:
import Release from "/components/ReleaseV3";
+## 2.4.9
+
+
+
+## 2.4.8
+
+
+
## 2.4.6
diff --git a/examples/JDBC/springbootdemo/readme.md b/examples/JDBC/springbootdemo/readme.md
index a3942a6a51..a89e21c009 100644
--- a/examples/JDBC/springbootdemo/readme.md
+++ b/examples/JDBC/springbootdemo/readme.md
@@ -1,6 +1,13 @@
## TDengine SpringBoot + Mybatis Demo
## 需要提前创建 test 数据库
+
+```
+$ taos -s 'create database if not exists test'
+
+$ curl http://localhost:8080/weather/init
+```
+
### 配置 application.properties
```properties
# datasource config
diff --git a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.xml b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.xml
index 99d5893ec1..4899ec4654 100644
--- a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.xml
+++ b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/dao/WeatherMapper.xml
@@ -7,6 +7,7 @@
+
@@ -36,6 +37,11 @@
binary
(
64
+ ),
+ bytes
+ binary
+ (
+ 64
)) tags
(
location nchar
@@ -63,8 +69,8 @@
- insert into test.t#{groupId} (ts, temperature, humidity, note)
- values (#{ts}, ${temperature}, ${humidity}, #{note})
+ insert into test.t#{groupId} (ts, temperature, humidity, note, bytes)
+ values (#{ts}, ${temperature}, ${humidity}, #{note}, #{bytes})
diff --git a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/Weather.java b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/Weather.java
index e4238127bd..de3a27e72a 100644
--- a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/Weather.java
+++ b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/domain/Weather.java
@@ -2,6 +2,7 @@ package com.taosdata.example.springbootdemo.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
+import java.nio.charset.StandardCharsets;
import java.sql.Timestamp;
public class Weather {
@@ -12,6 +13,9 @@ public class Weather {
private Float humidity;
private String location;
private String note;
+ // In rest mode, the byte[] type is not recommended.
+ // UTF-8 is used to encode the byte arrays, that result may affect the SQL correctness
+ private byte[] bytes;
private int groupId;
public Weather() {
@@ -70,4 +74,30 @@ public class Weather {
public void setNote(String note) {
this.note = note;
}
+
+ public byte[] getBytes() {
+ return bytes;
+ }
+
+ public void setBytes(byte[] bytes) {
+ this.bytes = bytes;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("Weather{");
+ sb.append("ts=").append(ts);
+ sb.append(", temperature=").append(temperature);
+ sb.append(", humidity=").append(humidity);
+ sb.append(", location='").append(location).append('\'');
+ sb.append(", note='").append(note).append('\'');
+ sb.append(", bytes -> string=");
+ if (bytes == null) sb.append("null");
+ else {
+ sb.append(new String(bytes, StandardCharsets.UTF_8));
+ }
+ sb.append(", groupId=").append(groupId);
+ sb.append('}');
+ return sb.toString();
+ }
}
diff --git a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/WeatherService.java b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/WeatherService.java
index 2264b200af..cf72aac551 100644
--- a/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/WeatherService.java
+++ b/examples/JDBC/springbootdemo/src/main/java/com/taosdata/example/springbootdemo/service/WeatherService.java
@@ -5,6 +5,7 @@ import com.taosdata.example.springbootdemo.domain.Weather;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.nio.charset.StandardCharsets;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
@@ -30,6 +31,7 @@ public class WeatherService {
weather.setLocation(locations[random.nextInt(locations.length)]);
weather.setGroupId(i % locations.length);
weather.setNote("note-" + i);
+ weather.setBytes(locations[random.nextInt(locations.length)].getBytes(StandardCharsets.UTF_8));
weatherMapper.createTable(weather);
count += weatherMapper.insert(weather);
}
diff --git a/include/common/tglobal.h b/include/common/tglobal.h
index b5fd6c0270..ac75b84762 100644
--- a/include/common/tglobal.h
+++ b/include/common/tglobal.h
@@ -50,6 +50,7 @@ extern int32_t tsTagFilterResCacheSize;
// queue & threads
extern int32_t tsNumOfRpcThreads;
extern int32_t tsNumOfRpcSessions;
+extern int32_t tsTimeToGetAvailableConn;
extern int32_t tsNumOfCommitThreads;
extern int32_t tsNumOfTaskQueueThreads;
extern int32_t tsNumOfMnodeQueryThreads;
@@ -73,6 +74,10 @@ extern int32_t tsHeartbeatTimeout;
// vnode
extern int64_t tsVndCommitMaxIntervalMs;
+// mnode
+extern int64_t tsMndSdbWriteDelta;
+extern int64_t tsMndLogRetention;
+
// monitor
extern bool tsEnableMonitor;
extern int32_t tsMonitorInterval;
diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index cd63f7d278..17fde6a536 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -66,6 +66,15 @@ extern int32_t tMsgDict[];
typedef uint16_t tmsg_t;
+static inline bool tmsgIsValid(tmsg_t type) {
+ if (type < TDMT_DND_MAX_MSG || type < TDMT_MND_MAX_MSG || type < TDMT_VND_MAX_MSG || type < TDMT_SCH_MAX_MSG ||
+ type < TDMT_STREAM_MAX_MSG || type < TDMT_MON_MAX_MSG || type < TDMT_SYNC_MAX_MSG || type < TDMT_VND_STREAM_MSG ||
+ type < TDMT_VND_TMQ_MSG || type < TDMT_VND_TMQ_MAX_MSG) {
+ return true;
+ } else {
+ return false;
+ }
+}
static inline bool vnodeIsMsgBlock(tmsg_t type) {
return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) ||
(type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM);
@@ -603,6 +612,7 @@ typedef struct {
char user[TSDB_USER_LEN];
char passwd[TSDB_PASSWORD_LEN];
int64_t startTime;
+ char sVer[TSDB_VERSION_LEN];
} SConnectReq;
int32_t tSerializeSConnectReq(void* buf, int32_t bufLen, SConnectReq* pReq);
@@ -929,12 +939,19 @@ typedef struct {
int32_t minRows;
int32_t maxRows;
int32_t walFsyncPeriod;
+ int16_t hashPrefix;
+ int16_t hashSuffix;
int8_t walLevel;
int8_t precision;
int8_t compression;
int8_t replications;
int8_t strict;
int8_t cacheLast;
+ int32_t tsdbPageSize;
+ int32_t walRetentionPeriod;
+ int32_t walRollPeriod;
+ int64_t walRetentionSize;
+ int64_t walSegmentSize;
int32_t numOfRetensions;
SArray* pRetensions;
int8_t schemaless;
@@ -1015,7 +1032,8 @@ int32_t tDeserializeSUserAuthBatchRsp(void* buf, int32_t bufLen, SUserAuthBatchR
void tFreeSUserAuthBatchRsp(SUserAuthBatchRsp* pRsp);
typedef struct {
- char db[TSDB_DB_FNAME_LEN];
+ char db[TSDB_DB_FNAME_LEN];
+ STimeWindow timeRange;
} SCompactDbReq;
int32_t tSerializeSCompactDbReq(void* buf, int32_t bufLen, SCompactDbReq* pReq);
@@ -1274,9 +1292,10 @@ int32_t tSerializeSDropIdxReq(void* buf, int32_t bufLen, SDropIndexReq* pReq);
int32_t tDeserializeSDropIdxReq(void* buf, int32_t bufLen, SDropIndexReq* pReq);
typedef struct {
- int64_t dbUid;
- char db[TSDB_DB_FNAME_LEN];
- int64_t compactStartTime;
+ int64_t dbUid;
+ char db[TSDB_DB_FNAME_LEN];
+ int64_t compactStartTime;
+ STimeWindow tw;
} SCompactVnodeReq;
int32_t tSerializeSCompactVnodeReq(void* buf, int32_t bufLen, SCompactVnodeReq* pReq);
@@ -1812,7 +1831,7 @@ typedef struct {
#define STREAM_TRIGGER_AT_ONCE 1
#define STREAM_TRIGGER_WINDOW_CLOSE 2
#define STREAM_TRIGGER_MAX_DELAY 3
-#define STREAM_DEFAULT_IGNORE_EXPIRED 0
+#define STREAM_DEFAULT_IGNORE_EXPIRED 1
#define STREAM_FILL_HISTORY_ON 1
#define STREAM_FILL_HISTORY_OFF 0
#define STREAM_DEFAULT_FILL_HISTORY STREAM_FILL_HISTORY_OFF
@@ -1904,10 +1923,10 @@ typedef struct {
} SMqConsumerLostMsg, SMqConsumerRecoverMsg, SMqConsumerClearMsg;
typedef struct {
- int64_t consumerId;
- char cgroup[TSDB_CGROUP_LEN];
- char clientId[256];
- SArray* topicNames; // SArray
+ int64_t consumerId;
+ char cgroup[TSDB_CGROUP_LEN];
+ char clientId[256];
+ SArray* topicNames; // SArray
} SCMSubscribeReq;
static FORCE_INLINE int32_t tSerializeSCMSubscribeReq(void** buf, const SCMSubscribeReq* pReq) {
@@ -2684,7 +2703,7 @@ typedef struct {
char subKey[TSDB_SUBSCRIBE_KEY_LEN];
int8_t subType;
int8_t withMeta;
- char* qmsg;
+ char* qmsg; // SubPlanToString
int64_t suid;
} SMqRebVgReq;
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index ada3fd20e8..1235dd3447 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -110,239 +110,240 @@
#define TK_TABLE_SUFFIX 92
#define TK_NK_COLON 93
#define TK_MAX_SPEED 94
-#define TK_TABLE 95
-#define TK_NK_LP 96
-#define TK_NK_RP 97
-#define TK_STABLE 98
-#define TK_ADD 99
-#define TK_COLUMN 100
-#define TK_MODIFY 101
-#define TK_RENAME 102
-#define TK_TAG 103
-#define TK_SET 104
-#define TK_NK_EQ 105
-#define TK_USING 106
-#define TK_TAGS 107
-#define TK_COMMENT 108
-#define TK_BOOL 109
-#define TK_TINYINT 110
-#define TK_SMALLINT 111
-#define TK_INT 112
-#define TK_INTEGER 113
-#define TK_BIGINT 114
-#define TK_FLOAT 115
-#define TK_DOUBLE 116
-#define TK_BINARY 117
-#define TK_TIMESTAMP 118
-#define TK_NCHAR 119
-#define TK_UNSIGNED 120
-#define TK_JSON 121
-#define TK_VARCHAR 122
-#define TK_MEDIUMBLOB 123
-#define TK_BLOB 124
-#define TK_VARBINARY 125
-#define TK_DECIMAL 126
-#define TK_MAX_DELAY 127
-#define TK_WATERMARK 128
-#define TK_ROLLUP 129
-#define TK_TTL 130
-#define TK_SMA 131
-#define TK_DELETE_MARK 132
-#define TK_FIRST 133
-#define TK_LAST 134
-#define TK_SHOW 135
-#define TK_PRIVILEGES 136
-#define TK_DATABASES 137
-#define TK_TABLES 138
-#define TK_STABLES 139
-#define TK_MNODES 140
-#define TK_QNODES 141
-#define TK_FUNCTIONS 142
-#define TK_INDEXES 143
-#define TK_ACCOUNTS 144
-#define TK_APPS 145
-#define TK_CONNECTIONS 146
-#define TK_LICENCES 147
-#define TK_GRANTS 148
-#define TK_QUERIES 149
-#define TK_SCORES 150
-#define TK_TOPICS 151
-#define TK_VARIABLES 152
-#define TK_CLUSTER 153
-#define TK_BNODES 154
-#define TK_SNODES 155
-#define TK_TRANSACTIONS 156
-#define TK_DISTRIBUTED 157
-#define TK_CONSUMERS 158
-#define TK_SUBSCRIPTIONS 159
-#define TK_VNODES 160
-#define TK_ALIVE 161
-#define TK_LIKE 162
-#define TK_TBNAME 163
-#define TK_QTAGS 164
-#define TK_AS 165
-#define TK_INDEX 166
-#define TK_FUNCTION 167
-#define TK_INTERVAL 168
-#define TK_COUNT 169
-#define TK_LAST_ROW 170
-#define TK_TOPIC 171
-#define TK_WITH 172
-#define TK_META 173
-#define TK_CONSUMER 174
-#define TK_GROUP 175
-#define TK_DESC 176
-#define TK_DESCRIBE 177
-#define TK_RESET 178
-#define TK_QUERY 179
-#define TK_CACHE 180
-#define TK_EXPLAIN 181
-#define TK_ANALYZE 182
-#define TK_VERBOSE 183
-#define TK_NK_BOOL 184
-#define TK_RATIO 185
-#define TK_NK_FLOAT 186
-#define TK_OUTPUTTYPE 187
-#define TK_AGGREGATE 188
-#define TK_BUFSIZE 189
-#define TK_STREAM 190
-#define TK_INTO 191
-#define TK_TRIGGER 192
-#define TK_AT_ONCE 193
-#define TK_WINDOW_CLOSE 194
-#define TK_IGNORE 195
-#define TK_EXPIRED 196
-#define TK_FILL_HISTORY 197
-#define TK_UPDATE 198
-#define TK_SUBTABLE 199
-#define TK_KILL 200
-#define TK_CONNECTION 201
-#define TK_TRANSACTION 202
-#define TK_BALANCE 203
-#define TK_VGROUP 204
-#define TK_MERGE 205
-#define TK_REDISTRIBUTE 206
-#define TK_SPLIT 207
-#define TK_DELETE 208
-#define TK_INSERT 209
-#define TK_NULL 210
-#define TK_NK_QUESTION 211
-#define TK_NK_ARROW 212
-#define TK_ROWTS 213
-#define TK_QSTART 214
-#define TK_QEND 215
-#define TK_QDURATION 216
-#define TK_WSTART 217
-#define TK_WEND 218
-#define TK_WDURATION 219
-#define TK_IROWTS 220
-#define TK_ISFILLED 221
-#define TK_CAST 222
-#define TK_NOW 223
-#define TK_TODAY 224
-#define TK_TIMEZONE 225
-#define TK_CLIENT_VERSION 226
-#define TK_SERVER_VERSION 227
-#define TK_SERVER_STATUS 228
-#define TK_CURRENT_USER 229
-#define TK_CASE 230
-#define TK_END 231
-#define TK_WHEN 232
-#define TK_THEN 233
-#define TK_ELSE 234
-#define TK_BETWEEN 235
-#define TK_IS 236
-#define TK_NK_LT 237
-#define TK_NK_GT 238
-#define TK_NK_LE 239
-#define TK_NK_GE 240
-#define TK_NK_NE 241
-#define TK_MATCH 242
-#define TK_NMATCH 243
-#define TK_CONTAINS 244
-#define TK_IN 245
-#define TK_JOIN 246
-#define TK_INNER 247
-#define TK_SELECT 248
-#define TK_DISTINCT 249
-#define TK_WHERE 250
-#define TK_PARTITION 251
-#define TK_BY 252
-#define TK_SESSION 253
-#define TK_STATE_WINDOW 254
-#define TK_EVENT_WINDOW 255
-#define TK_START 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_START 95
+#define TK_WITH 96
+#define TK_TIMESTAMP 97
+#define TK_END 98
+#define TK_TABLE 99
+#define TK_NK_LP 100
+#define TK_NK_RP 101
+#define TK_STABLE 102
+#define TK_ADD 103
+#define TK_COLUMN 104
+#define TK_MODIFY 105
+#define TK_RENAME 106
+#define TK_TAG 107
+#define TK_SET 108
+#define TK_NK_EQ 109
+#define TK_USING 110
+#define TK_TAGS 111
+#define TK_COMMENT 112
+#define TK_BOOL 113
+#define TK_TINYINT 114
+#define TK_SMALLINT 115
+#define TK_INT 116
+#define TK_INTEGER 117
+#define TK_BIGINT 118
+#define TK_FLOAT 119
+#define TK_DOUBLE 120
+#define TK_BINARY 121
+#define TK_NCHAR 122
+#define TK_UNSIGNED 123
+#define TK_JSON 124
+#define TK_VARCHAR 125
+#define TK_MEDIUMBLOB 126
+#define TK_BLOB 127
+#define TK_VARBINARY 128
+#define TK_DECIMAL 129
+#define TK_MAX_DELAY 130
+#define TK_WATERMARK 131
+#define TK_ROLLUP 132
+#define TK_TTL 133
+#define TK_SMA 134
+#define TK_DELETE_MARK 135
+#define TK_FIRST 136
+#define TK_LAST 137
+#define TK_SHOW 138
+#define TK_PRIVILEGES 139
+#define TK_DATABASES 140
+#define TK_TABLES 141
+#define TK_STABLES 142
+#define TK_MNODES 143
+#define TK_QNODES 144
+#define TK_FUNCTIONS 145
+#define TK_INDEXES 146
+#define TK_ACCOUNTS 147
+#define TK_APPS 148
+#define TK_CONNECTIONS 149
+#define TK_LICENCES 150
+#define TK_GRANTS 151
+#define TK_QUERIES 152
+#define TK_SCORES 153
+#define TK_TOPICS 154
+#define TK_VARIABLES 155
+#define TK_CLUSTER 156
+#define TK_BNODES 157
+#define TK_SNODES 158
+#define TK_TRANSACTIONS 159
+#define TK_DISTRIBUTED 160
+#define TK_CONSUMERS 161
+#define TK_SUBSCRIPTIONS 162
+#define TK_VNODES 163
+#define TK_ALIVE 164
+#define TK_LIKE 165
+#define TK_TBNAME 166
+#define TK_QTAGS 167
+#define TK_AS 168
+#define TK_INDEX 169
+#define TK_FUNCTION 170
+#define TK_INTERVAL 171
+#define TK_COUNT 172
+#define TK_LAST_ROW 173
+#define TK_TOPIC 174
+#define TK_META 175
+#define TK_CONSUMER 176
+#define TK_GROUP 177
+#define TK_DESC 178
+#define TK_DESCRIBE 179
+#define TK_RESET 180
+#define TK_QUERY 181
+#define TK_CACHE 182
+#define TK_EXPLAIN 183
+#define TK_ANALYZE 184
+#define TK_VERBOSE 185
+#define TK_NK_BOOL 186
+#define TK_RATIO 187
+#define TK_NK_FLOAT 188
+#define TK_OUTPUTTYPE 189
+#define TK_AGGREGATE 190
+#define TK_BUFSIZE 191
+#define TK_LANGUAGE 192
+#define TK_STREAM 193
+#define TK_INTO 194
+#define TK_TRIGGER 195
+#define TK_AT_ONCE 196
+#define TK_WINDOW_CLOSE 197
+#define TK_IGNORE 198
+#define TK_EXPIRED 199
+#define TK_FILL_HISTORY 200
+#define TK_UPDATE 201
+#define TK_SUBTABLE 202
+#define TK_KILL 203
+#define TK_CONNECTION 204
+#define TK_TRANSACTION 205
+#define TK_BALANCE 206
+#define TK_VGROUP 207
+#define TK_MERGE 208
+#define TK_REDISTRIBUTE 209
+#define TK_SPLIT 210
+#define TK_DELETE 211
+#define TK_INSERT 212
+#define TK_NULL 213
+#define TK_NK_QUESTION 214
+#define TK_NK_ARROW 215
+#define TK_ROWTS 216
+#define TK_QSTART 217
+#define TK_QEND 218
+#define TK_QDURATION 219
+#define TK_WSTART 220
+#define TK_WEND 221
+#define TK_WDURATION 222
+#define TK_IROWTS 223
+#define TK_ISFILLED 224
+#define TK_CAST 225
+#define TK_NOW 226
+#define TK_TODAY 227
+#define TK_TIMEZONE 228
+#define TK_CLIENT_VERSION 229
+#define TK_SERVER_VERSION 230
+#define TK_SERVER_STATUS 231
+#define TK_CURRENT_USER 232
+#define TK_CASE 233
+#define TK_WHEN 234
+#define TK_THEN 235
+#define TK_ELSE 236
+#define TK_BETWEEN 237
+#define TK_IS 238
+#define TK_NK_LT 239
+#define TK_NK_GT 240
+#define TK_NK_LE 241
+#define TK_NK_GE 242
+#define TK_NK_NE 243
+#define TK_MATCH 244
+#define TK_NMATCH 245
+#define TK_CONTAINS 246
+#define TK_IN 247
+#define TK_JOIN 248
+#define TK_INNER 249
+#define TK_SELECT 250
+#define TK_DISTINCT 251
+#define TK_WHERE 252
+#define TK_PARTITION 253
+#define TK_BY 254
+#define TK_SESSION 255
+#define TK_STATE_WINDOW 256
+#define TK_EVENT_WINDOW 257
+#define TK_SLIDING 258
+#define TK_FILL 259
+#define TK_VALUE 260
+#define TK_VALUE_F 261
+#define TK_NONE 262
+#define TK_PREV 263
+#define TK_NULL_F 264
+#define TK_LINEAR 265
+#define TK_NEXT 266
+#define TK_HAVING 267
+#define TK_RANGE 268
+#define TK_EVERY 269
+#define TK_ORDER 270
+#define TK_SLIMIT 271
+#define TK_SOFFSET 272
+#define TK_LIMIT 273
+#define TK_OFFSET 274
+#define TK_ASC 275
+#define TK_NULLS 276
+#define TK_ABORT 277
+#define TK_AFTER 278
+#define TK_ATTACH 279
+#define TK_BEFORE 280
+#define TK_BEGIN 281
+#define TK_BITAND 282
+#define TK_BITNOT 283
+#define TK_BITOR 284
+#define TK_BLOCKS 285
+#define TK_CHANGE 286
+#define TK_COMMA 287
+#define TK_CONCAT 288
+#define TK_CONFLICT 289
+#define TK_COPY 290
+#define TK_DEFERRED 291
+#define TK_DELIMITERS 292
+#define TK_DETACH 293
+#define TK_DIVIDE 294
+#define TK_DOT 295
+#define TK_EACH 296
+#define TK_FAIL 297
+#define TK_FILE 298
+#define TK_FOR 299
+#define TK_GLOB 300
+#define TK_ID 301
+#define TK_IMMEDIATE 302
+#define TK_IMPORT 303
+#define TK_INITIALLY 304
+#define TK_INSTEAD 305
+#define TK_ISNULL 306
+#define TK_KEY 307
+#define TK_MODULES 308
+#define TK_NK_BITNOT 309
+#define TK_NK_SEMI 310
+#define TK_NOTNULL 311
+#define TK_OF 312
+#define TK_PLUS 313
+#define TK_PRIVILEGE 314
+#define TK_RAISE 315
+#define TK_REPLACE 316
+#define TK_RESTRICT 317
+#define TK_ROW 318
+#define TK_SEMI 319
+#define TK_STAR 320
+#define TK_STATEMENT 321
+#define TK_STRICT 322
+#define TK_STRING 323
+#define TK_TIMES 324
+#define TK_VALUES 325
+#define TK_VARIABLE 326
+#define TK_VIEW 327
+#define TK_WAL 328
#define TK_NK_SPACE 600
#define TK_NK_COMMENT 601
diff --git a/include/common/ttypes.h b/include/common/ttypes.h
index 97ae151b7a..f8a85ee1b0 100644
--- a/include/common/ttypes.h
+++ b/include/common/ttypes.h
@@ -53,10 +53,6 @@ typedef struct {
#define varDataNetLen(v) (htons(((VarDataLenT *)(v))[0]))
#define varDataNetTLen(v) (sizeof(VarDataLenT) + varDataNetLen(v))
-// this data type is internally used only in 'in' query to hold the values
-#define TSDB_DATA_TYPE_POINTER_ARRAY (1000)
-#define TSDB_DATA_TYPE_VALUE_ARRAY (1001)
-
#define GET_TYPED_DATA(_v, _finalType, _type, _data) \
do { \
switch (_type) { \
diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h
index 095d2f6d10..c3d2010351 100644
--- a/include/libs/executor/executor.h
+++ b/include/libs/executor/executor.h
@@ -219,6 +219,7 @@ int32_t qStreamRecoverFinish(qTaskInfo_t tinfo);
int32_t qStreamRestoreParam(qTaskInfo_t tinfo);
bool qStreamRecoverScanFinished(qTaskInfo_t tinfo);
void qStreamCloseTsdbReader(void* task);
+void resetTaskInfo(qTaskInfo_t tinfo);
#ifdef __cplusplus
}
diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h
index 164fbf018c..fefcc28bc2 100644
--- a/include/libs/nodes/cmdnodes.h
+++ b/include/libs/nodes/cmdnodes.h
@@ -41,14 +41,15 @@ extern "C" {
#define SHOW_LOCAL_VARIABLES_RESULT_FIELD2_LEN (TSDB_CONFIG_VALUE_LEN + VARSTR_HEADER_SIZE)
#define SHOW_ALIVE_RESULT_COLS 1
-#define PRIVILEGE_TYPE_MASK(n) (1 << n)
-#define PRIVILEGE_TYPE_ALL PRIVILEGE_TYPE_MASK(0)
-#define PRIVILEGE_TYPE_READ PRIVILEGE_TYPE_MASK(1)
-#define PRIVILEGE_TYPE_WRITE PRIVILEGE_TYPE_MASK(2)
-#define PRIVILEGE_TYPE_SUBSCRIBE PRIVILEGE_TYPE_MASK(3)
+#define BIT_FLAG_MASK(n) (1 << n)
+#define BIT_FLAG_SET_MASK(val, mask) ((val) |= (mask))
+#define BIT_FLAG_TEST_MASK(val, mask) (((val) & (mask)) != 0)
-#define PRIVILEGE_TYPE_TEST_MASK(val, mask) (((val) & (mask)) != 0)
+#define PRIVILEGE_TYPE_ALL BIT_FLAG_MASK(0)
+#define PRIVILEGE_TYPE_READ BIT_FLAG_MASK(1)
+#define PRIVILEGE_TYPE_WRITE BIT_FLAG_MASK(2)
+#define PRIVILEGE_TYPE_SUBSCRIBE BIT_FLAG_MASK(3)
typedef struct SDatabaseOptions {
ENodeType type;
@@ -127,6 +128,8 @@ typedef struct STrimDatabaseStmt {
typedef struct SCompactDatabaseStmt {
ENodeType type;
char dbName[TSDB_DB_NAME_LEN];
+ SNode* pStart;
+ SNode* pEnd;
} SCompactDatabaseStmt;
typedef struct STableOptions {
@@ -265,6 +268,7 @@ typedef struct SShowStmt {
typedef struct SShowCreateDatabaseStmt {
ENodeType type;
char dbName[TSDB_DB_NAME_LEN];
+ char dbFName[TSDB_DB_FNAME_LEN];
void* pCfg; // SDbCfgInfo
} SShowCreateDatabaseStmt;
@@ -392,6 +396,15 @@ typedef struct SKillQueryStmt {
char queryId[TSDB_QUERY_ID_LEN];
} SKillQueryStmt;
+typedef enum EStreamOptionsSetFlag {
+ SOPT_TRIGGER_TYPE_SET = BIT_FLAG_MASK(0),
+ SOPT_WATERMARK_SET = BIT_FLAG_MASK(1),
+ SOPT_DELETE_MARK_SET = BIT_FLAG_MASK(2),
+ SOPT_FILL_HISTORY_SET = BIT_FLAG_MASK(3),
+ SOPT_IGNORE_EXPIRED_SET = BIT_FLAG_MASK(4),
+ SOPT_IGNORE_UPDATE_SET = BIT_FLAG_MASK(5),
+} EStreamOptionsSetFlag;
+
typedef struct SStreamOptions {
ENodeType type;
int8_t triggerType;
@@ -401,6 +414,7 @@ typedef struct SStreamOptions {
int8_t fillHistory;
int8_t ignoreExpired;
int8_t ignoreUpdate;
+ int64_t setFlag;
} SStreamOptions;
typedef struct SCreateStreamStmt {
@@ -430,6 +444,7 @@ typedef struct SCreateFunctionStmt {
char libraryPath[PATH_MAX];
SDataType outputDt;
int32_t bufSize;
+ int8_t language;
} SCreateFunctionStmt;
typedef struct SDropFunctionStmt {
diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h
index 5e37da4f3f..189484d1a6 100644
--- a/include/libs/sync/sync.h
+++ b/include/libs/sync/sync.h
@@ -35,7 +35,6 @@ extern "C" {
#define SYNC_MAX_RECV_TIME_RANGE_MS 1200
#define SYNC_DEL_WAL_MS (1000 * 60)
#define SYNC_ADD_QUORUM_COUNT 3
-#define SYNC_MNODE_LOG_RETENTION 10000
#define SYNC_VNODE_LOG_RETENTION (TSDB_SYNC_LOG_BUFFER_RETENTION + 1)
#define SNAPSHOT_MAX_CLOCK_SKEW_MS 1000 * 10
#define SNAPSHOT_WAIT_MS 1000 * 30
diff --git a/include/libs/transport/thttp.h b/include/libs/transport/thttp.h
index 9a6aee4187..f6f1f7f027 100644
--- a/include/libs/transport/thttp.h
+++ b/include/libs/transport/thttp.h
@@ -17,6 +17,7 @@
#define _TD_UTIL_HTTP_H_
#include "os.h"
+#include "tref.h"
#ifdef __cplusplus
extern "C" {
@@ -24,7 +25,8 @@ extern "C" {
typedef enum { HTTP_GZIP, HTTP_FLAT } EHttpCompFlag;
-int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag);
+int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen,
+ EHttpCompFlag flag);
#ifdef __cplusplus
}
diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h
index 0cc0ab64ef..c73e5c127a 100644
--- a/include/libs/transport/trpc.h
+++ b/include/libs/transport/trpc.h
@@ -114,7 +114,7 @@ typedef struct SRpcInit {
int32_t connLimitNum;
int32_t connLimitLock;
-
+ int32_t timeToGetConn;
int8_t supportBatch; // 0: no batch, 1. batch
int32_t batchSize;
void *parent;
diff --git a/include/os/osMemory.h b/include/os/osMemory.h
index 3f57c72933..44a97bf055 100644
--- a/include/os/osMemory.h
+++ b/include/os/osMemory.h
@@ -29,9 +29,11 @@ extern "C" {
#define calloc CALLOC_FUNC_TAOS_FORBID
#define realloc REALLOC_FUNC_TAOS_FORBID
#define free FREE_FUNC_TAOS_FORBID
+#ifdef strdup
+#undef strdup
#define strdup STRDUP_FUNC_TAOS_FORBID
+#endif
#endif // ifndef ALLOW_FORBID_FUNC
-
#endif // if !defined(WINDOWS)
int32_t taosMemoryDbgInit();
diff --git a/include/util/taoserror.h b/include/util/taoserror.h
index 75860a4b1e..5106196ccd 100644
--- a/include/util/taoserror.h
+++ b/include/util/taoserror.h
@@ -116,6 +116,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_NO_DISKSPACE TAOS_DEF_ERROR_CODE(0, 0x012B)
#define TSDB_CODE_TIMEOUT_ERROR TAOS_DEF_ERROR_CODE(0, 0x012C)
#define TSDB_CODE_MSG_ENCODE_ERROR TAOS_DEF_ERROR_CODE(0, 0x012D)
+#define TSDB_CODE_NO_ENOUGH_DISKSPACE TAOS_DEF_ERROR_CODE(0, 0x012E)
#define TSDB_CODE_APP_IS_STARTING TAOS_DEF_ERROR_CODE(0, 0x0130) //
#define TSDB_CODE_APP_IS_STOPPING TAOS_DEF_ERROR_CODE(0, 0x0131) //
diff --git a/include/util/tdef.h b/include/util/tdef.h
index 85c89744ed..f2da4096d3 100644
--- a/include/util/tdef.h
+++ b/include/util/tdef.h
@@ -206,7 +206,7 @@ typedef enum ELogicConditionType {
#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/include/util/ttrace.h b/include/util/ttrace.h
index 5cdb1eecaa..e672882f57 100644
--- a/include/util/ttrace.h
+++ b/include/util/ttrace.h
@@ -59,11 +59,13 @@ typedef struct STraceId {
char* _t = _buf; \
_t[0] = '0'; \
_t[1] = 'x'; \
- _t += titoa(rootId, 16, &_t[2]); \
+ _t += 2; \
+ _t += titoa(rootId, 16, &_t[0]); \
_t[0] = ':'; \
_t[1] = '0'; \
_t[2] = 'x'; \
- _t += titoa(msgId, 16, &_t[3]); \
+ _t += 3; \
+ _t += titoa(msgId, 16, &_t[0]); \
} while (0)
#ifdef __cplusplus
diff --git a/include/util/tversion.h b/include/util/tversion.h
index c924752a01..f5c42b2a22 100644
--- a/include/util/tversion.h
+++ b/include/util/tversion.h
@@ -13,8 +13,8 @@
* along with this program. If not, see .
*/
-#ifndef _TD_UTIL_VERSION_H_
-#define _TD_UTIL_VERSION_H_
+#ifndef _TD_UTIL_TVERSION_H_
+#define _TD_UTIL_TVERSION_H_
#include "os.h"
@@ -25,9 +25,11 @@ extern "C" {
int32_t taosVersionStrToInt(const char *vstr, int32_t *vint);
int32_t taosVersionIntToStr(int32_t vint, char *vstr, int32_t len);
int32_t taosCheckVersionCompatible(int32_t clientVer, int32_t serverVer, int32_t comparedSegments);
+int32_t taosCheckVersionCompatibleFromStr(const char *pClientVersion, const char *pServerVersion,
+ int32_t comparedSegments);
#ifdef __cplusplus
}
#endif
-#endif /*_TD_UTIL_VERSION_H_*/
+#endif /*_TD_UTIL_TVERSION_H_*/
diff --git a/packaging/release.bat b/packaging/release.bat
index 4c82c5ead5..4b49f364d0 100644
--- a/packaging/release.bat
+++ b/packaging/release.bat
@@ -46,9 +46,9 @@ rd /s /Q C:\TDengine
cmake --install .
if not %errorlevel% == 0 ( call :RUNFAILED build x64 failed & exit /b 1)
cd %package_dir%
-iscc /DMyAppInstallName="%packagServerName_x64%" /DMyAppVersion="%2" /DMyAppExcludeSource="" tools\tdengine.iss /O..\release
+iscc /DMyAppInstallName="%packagServerName_x64%" /DMyAppVersion="%2" /DCusName="TDengine" /DCusPrompt="taos" /DMyAppExcludeSource="" tools\tdengine.iss /O..\release
if not %errorlevel% == 0 ( call :RUNFAILED package %packagServerName_x64% failed & exit /b 1)
-iscc /DMyAppInstallName="%packagClientName_x64%" /DMyAppVersion="%2" /DMyAppExcludeSource="taosd.exe" tools\tdengine.iss /O..\release
+iscc /DMyAppInstallName="%packagClientName_x64%" /DMyAppVersion="%2" /DCusName="TDengine" /DCusPrompt="taos" /DMyAppExcludeSource="taosd.exe" tools\tdengine.iss /O..\release
if not %errorlevel% == 0 ( call :RUNFAILED package %packagClientName_x64% failed & exit /b 1)
goto EXIT0
diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh
index 5aeff0e2fa..2495e177e1 100755
--- a/packaging/tools/install.sh
+++ b/packaging/tools/install.sh
@@ -34,6 +34,7 @@ benchmarkName="taosBenchmark"
dumpName="taosdump"
demoName="taosdemo"
xname="taosx"
+explorerName="${clientName}-explorer"
clientName2="taos"
serverName2="taosd"
@@ -214,6 +215,7 @@ function install_bin() {
${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}/${explorerName} || :
${csudo}rm -f ${bin_link_dir}/set_core || :
${csudo}rm -f ${bin_link_dir}/TDinsight.sh || :
@@ -228,6 +230,7 @@ function install_bin() {
[ -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 -s ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${dumpName} || :
[ -x ${install_main_dir}/bin/${xname} ] && ${csudo}ln -s ${install_main_dir}/bin/${xname} ${bin_link_dir}/${xname} || :
+ [ -x ${install_main_dir}/bin/${explorerName} ] && ${csudo}ln -s ${install_main_dir}/bin/${explorerName} ${bin_link_dir}/${explorerName} || :
[ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.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 || :
diff --git a/packaging/tools/make_install.bat b/packaging/tools/make_install.bat
index f5ed1cdf66..3996495aca 100644
--- a/packaging/tools/make_install.bat
+++ b/packaging/tools/make_install.bat
@@ -70,6 +70,9 @@ if %Enterprise% == TRUE (
if exist %binary_dir%\\build\\bin\\taosx.exe (
copy %binary_dir%\\build\\bin\\taosx.exe %target_dir% > nul
)
+ if exist %binary_dir%\\build\\bin\\taos-explorer.exe (
+ copy %binary_dir%\\build\\bin\\taos-explorer.exe %target_dir% > nul
+ )
if exist %binary_dir%\\build\\bin\\tmq_sim.exe (
copy %binary_dir%\\build\\bin\\tmq_sim.exe %target_dir% > nul
)
@@ -91,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
diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh
index 5725560bd6..87c72c6a7c 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/makepkg.sh b/packaging/tools/makepkg.sh
index 0a34d81b7f..7ad3cf7b0a 100755
--- a/packaging/tools/makepkg.sh
+++ b/packaging/tools/makepkg.sh
@@ -89,11 +89,13 @@ else
${build_dir}/bin/tdengine-datasource.zip \
${build_dir}/bin/tdengine-datasource.zip.md5sum"
[ -f ${build_dir}/bin/taosx ] && taosx_bin="${build_dir}/bin/taosx"
+ explorer_bin_files=$(find ${build_dir}/bin/ -name '*-explorer')
bin_files="${build_dir}/bin/${serverName} \
${build_dir}/bin/${clientName} \
${taostools_bin_files} \
${taosx_bin} \
+ ${explorer_bin_files} \
${build_dir}/bin/taosadapter \
${build_dir}/bin/udfd \
${script_dir}/remove.sh \
diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh
index 78eb7f7587..b2fc488a19 100755
--- a/packaging/tools/post.sh
+++ b/packaging/tools/post.sh
@@ -185,6 +185,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}/*
@@ -220,6 +221,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 9c50c4582d..2479e48670 100755
--- a/packaging/tools/remove.sh
+++ b/packaging/tools/remove.sh
@@ -119,6 +119,7 @@ function clean_bin() {
${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 || :
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
${csudo}rm -f ${bin_link_dir}/${clientName2} || :
diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h
index 7cc7a1717a..b10daa9c21 100644
--- a/source/client/inc/clientInt.h
+++ b/source/client/inc/clientInt.h
@@ -66,7 +66,8 @@ enum {
typedef struct SAppInstInfo SAppInstInfo;
typedef struct {
- char* key;
+ char* key;
+ int32_t idx;
// statistics
int32_t reportCnt;
int32_t connKeyCnt;
diff --git a/source/client/inc/clientSml.h b/source/client/inc/clientSml.h
index 3dcba673bf..d8d41d8be6 100644
--- a/source/client/inc/clientSml.h
+++ b/source/client/inc/clientSml.h
@@ -190,7 +190,7 @@ typedef struct {
//
SArray *preLineTagKV;
SArray *maxTagKVs;
- SArray *preLineColKV;
+ SArray *masColKVs;
SSmlLineInfo preLine;
STableMeta *currSTableMeta;
diff --git a/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h b/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h
index 197cd78006..c035b6598c 100644
--- a/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h
+++ b/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h
@@ -99,6 +99,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitSync(JNI
*/
JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAsync(JNIEnv *, jobject, jlong, jlong, jobject);
+JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAsync(JNIEnv *, jobject, jlong, jlong,
+ jobject);
+
/*
* Class: com_taosdata_jdbc_tmq_TMQConnector
* Method: tmqUnsubscribeImp
diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c
index 2348648041..e3e20ee85d 100644
--- a/source/client/src/clientEnv.c
+++ b/source/client/src/clientEnv.c
@@ -144,7 +144,7 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) {
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = 0;
rpcInit.label = "TSC";
- rpcInit.numOfThreads = numOfThread;
+ rpcInit.numOfThreads = tsNumOfRpcThreads;
rpcInit.cfp = processMsgFromServer;
rpcInit.rfp = clientRpcRfp;
rpcInit.sessions = 1024;
@@ -159,6 +159,12 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) {
rpcInit.retryMaxInterval = tsRedirectMaxPeriod;
rpcInit.retryMaxTimouet = tsMaxRetryWaitTime;
+ int32_t connLimitNum = tsNumOfRpcSessions / (tsNumOfRpcThreads * 3);
+ connLimitNum = TMAX(connLimitNum, 10);
+ connLimitNum = TMIN(connLimitNum, 1000);
+ rpcInit.connLimitNum = connLimitNum;
+ rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
+
void *pDnodeConn = rpcOpen(&rpcInit);
if (pDnodeConn == NULL) {
tscError("failed to init connection to server");
@@ -517,7 +523,7 @@ void taos_init_imp(void) {
if (code) {
printf("failed to init memory dbg, error:%s\n", tstrerror(code));
} else {
- tsAsyncLog = false;
+ tsAsyncLog = false;
printf("memory dbg enabled\n");
}
}
diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c
index b5838386db..c9c2e7a5f8 100644
--- a/source/client/src/clientHb.c
+++ b/source/client/src/clientHb.c
@@ -303,8 +303,12 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
}
static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
+ if (0 == atomic_load_8(&clientHbMgr.inited)) {
+ goto _return;
+ }
+
static int32_t emptyRspNum = 0;
- char *key = (char *)param;
+ int32_t idx = *(int32_t *)param;
SClientHbBatchRsp pRsp = {0};
if (TSDB_CODE_SUCCESS == code) {
tDeserializeSClientHbBatchRsp(pMsg->pData, pMsg->len, &pRsp);
@@ -319,22 +323,24 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
int32_t rspNum = taosArrayGetSize(pRsp.rsps);
- taosThreadMutexLock(&appInfo.mutex);
+ taosThreadMutexLock(&clientHbMgr.lock);
- SAppInstInfo **pInst = taosHashGet(appInfo.pInstMap, key, strlen(key));
- if (pInst == NULL || NULL == *pInst) {
- taosThreadMutexUnlock(&appInfo.mutex);
- tscError("cluster not exist, key:%s", key);
+ SAppHbMgr *pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, idx);
+ if (pAppHbMgr == NULL) {
+ taosThreadMutexUnlock(&clientHbMgr.lock);
+ tscError("appHbMgr not exist, idx:%d", idx);
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
tFreeClientHbBatchRsp(&pRsp);
return -1;
}
+ SAppInstInfo *pInst = pAppHbMgr->pAppInstInfo;
+
if (code != 0) {
- (*pInst)->onlineDnodes = ((*pInst)->totalDnodes ? 0 : -1);
- tscDebug("hb rsp error %s, update server status %d/%d", tstrerror(code), (*pInst)->onlineDnodes,
- (*pInst)->totalDnodes);
+ pInst->onlineDnodes = pInst->totalDnodes ? 0 : -1;
+ tscDebug("hb rsp error %s, update server status %d/%d", tstrerror(code), pInst->onlineDnodes,
+ pInst->totalDnodes);
}
if (rspNum) {
@@ -346,15 +352,17 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
for (int32_t i = 0; i < rspNum; ++i) {
SClientHbRsp *rsp = taosArrayGet(pRsp.rsps, i);
- code = (*clientHbMgr.rspHandle[rsp->connKey.connType])((*pInst)->pAppHbMgr, rsp);
+ code = (*clientHbMgr.rspHandle[rsp->connKey.connType])(pAppHbMgr, rsp);
if (code) {
break;
}
}
- taosThreadMutexUnlock(&appInfo.mutex);
+ taosThreadMutexUnlock(&clientHbMgr.lock);
tFreeClientHbBatchRsp(&pRsp);
+
+_return:
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
return code;
@@ -788,7 +796,8 @@ static void *hbThreadFunc(void *param) {
pInfo->msgInfo.pData = buf;
pInfo->msgInfo.len = tlen;
pInfo->msgType = TDMT_MND_HEARTBEAT;
- pInfo->param = taosStrdup(pAppHbMgr->key);
+ pInfo->param = taosMemoryMalloc(sizeof(int32_t));
+ *(int32_t *)pInfo->param = i;
pInfo->paramFreeFp = taosMemoryFree;
pInfo->requestId = generateRequestId();
pInfo->requestObjRefId = 0;
@@ -874,6 +883,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) {
taosThreadMutexLock(&clientHbMgr.lock);
taosArrayPush(clientHbMgr.appHbMgrs, &pAppHbMgr);
+ pAppHbMgr->idx = taosArrayGetSize(clientHbMgr.appHbMgrs) - 1;
taosThreadMutexUnlock(&clientHbMgr.lock);
return pAppHbMgr;
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index a6d2fad816..d5247d4b8a 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -192,7 +192,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
(*pRequest)->sqlLen = sqlLen;
(*pRequest)->validateOnly = validateSql;
- SSyncQueryParam* newpParam;
+ SSyncQueryParam* newpParam = NULL;
if (param == NULL) {
newpParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
if (newpParam == NULL) {
@@ -1307,6 +1307,7 @@ static SMsgSendInfo* buildConnectMsg(SRequestObj* pRequest) {
tstrncpy(connectReq.app, appInfo.appName, sizeof(connectReq.app));
tstrncpy(connectReq.user, pObj->user, sizeof(connectReq.user));
tstrncpy(connectReq.passwd, pObj->pass, sizeof(connectReq.passwd));
+ tstrncpy(connectReq.sVer, version, sizeof(connectReq.sVer));
int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq);
void* pReq = taosMemoryMalloc(contLen);
@@ -1545,7 +1546,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;
@@ -2034,6 +2035,12 @@ TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* de
rpcInit.compressSize = tsCompressMsgSize;
rpcInit.user = "_dnd";
+ int32_t connLimitNum = tsNumOfRpcSessions / (tsNumOfRpcThreads * 3);
+ connLimitNum = TMAX(connLimitNum, 10);
+ connLimitNum = TMIN(connLimitNum, 500);
+ rpcInit.connLimitNum = connLimitNum;
+ rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
+
clientRpc = rpcOpen(&rpcInit);
if (clientRpc == NULL) {
tscError("failed to init server status client");
diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c
index 750ba684f4..cfa6f84bd2 100644
--- a/source/client/src/clientJniConnector.c
+++ b/source/client/src/clientJniConnector.c
@@ -56,6 +56,7 @@ jmethodID g_createConsumerErrorCallback;
jmethodID g_topicListCallback;
jclass g_consumerClass;
+// deprecated
jmethodID g_commitCallback;
void jniGetGlobalMethod(JNIEnv *env) {
diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c
index 4ba51ce50d..63db9a679c 100644
--- a/source/client/src/clientMain.c
+++ b/source/client/src/clientMain.c
@@ -271,6 +271,8 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
SReqResultInfo *pResultInfo;
if (msg->resIter == -1) {
pResultInfo = tmqGetNextResInfo(res, true);
+ tscDebug("consumer:0x%" PRIx64 ", vgId:%d, numOfRows:%" PRId64 ", total rows:%" PRId64, msg->rsp.head.consumerId,
+ msg->vgId, pResultInfo->numOfRows, pResultInfo->totalRows);
} else {
pResultInfo = tmqGetCurResInfo(res);
}
@@ -281,7 +283,13 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) {
return pResultInfo->row;
} else {
pResultInfo = tmqGetNextResInfo(res, true);
- if (pResultInfo == NULL) return NULL;
+ if (pResultInfo == NULL) {
+ return NULL;
+ }
+
+ tscDebug("consumer:0x%" PRIx64 " vgId:%d, numOfRows:%" PRId64 ", total rows:%" PRId64, msg->rsp.head.consumerId,
+ msg->vgId, pResultInfo->numOfRows, pResultInfo->totalRows);
+
doSetOneRowPtr(pResultInfo);
pResultInfo->current += 1;
return pResultInfo->row;
@@ -1016,7 +1024,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/clientMsgHandler.c b/source/client/src/clientMsgHandler.c
index a5f963a956..21590022b1 100644
--- a/source/client/src/clientMsgHandler.c
+++ b/source/client/src/clientMsgHandler.c
@@ -18,10 +18,12 @@
#include "clientLog.h"
#include "os.h"
#include "query.h"
-#include "tdef.h"
-#include "tname.h"
-#include "tdatablock.h"
#include "systable.h"
+#include "tdatablock.h"
+#include "tdef.h"
+#include "tglobal.h"
+#include "tname.h"
+#include "tversion.h"
static void setErrno(SRequestObj* pRequest, int32_t code) {
pRequest->code = code;
@@ -47,11 +49,11 @@ int32_t genericRspCallback(void* param, SDataBuf* pMsg, int32_t code) {
}
int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
- SRequestObj *pRequest = acquireRequest(*(int64_t*)param);
+ SRequestObj* pRequest = acquireRequest(*(int64_t*)param);
if (NULL == pRequest) {
goto End;
}
-
+
if (code != TSDB_CODE_SUCCESS) {
setErrno(pRequest, code);
tsem_post(&pRequest->body.rspSem);
@@ -65,7 +67,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
tsem_post(&pRequest->body.rspSem);
goto End;
}
-
+
SConnectRsp connectRsp = {0};
if (tDeserializeSConnectRsp(pMsg->pData, pMsg->len, &connectRsp) != 0) {
code = TSDB_CODE_TSC_INVALID_VERSION;
@@ -74,6 +76,12 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
goto End;
}
+ if ((code = taosCheckVersionCompatibleFromStr(version, connectRsp.sVer, 2)) != 0) {
+ setErrno(pRequest, code);
+ tsem_post(&pRequest->body.rspSem);
+ goto End;
+ }
+
int32_t now = taosGetTimestampSec();
int32_t delta = abs(now - connectRsp.svrTimestamp);
if (delta > timestampDeltaLimit) {
@@ -127,14 +135,14 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
tscDebug("0x%" PRIx64 " clusterId:%" PRId64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId,
pTscObj->pAppInfo->numOfConns);
-
+
tsem_post(&pRequest->body.rspSem);
End:
if (pRequest) {
releaseRequest(pRequest->self);
}
-
+
taosMemoryFree(param);
taosMemoryFree(pMsg->pEpSet);
taosMemoryFree(pMsg->pData);
@@ -166,18 +174,18 @@ int32_t processCreateDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
struct SCatalog* pCatalog = NULL;
int32_t code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
if (TSDB_CODE_SUCCESS == code) {
- STscObj* pTscObj = pRequest->pTscObj;
+ STscObj* pTscObj = pRequest->pTscObj;
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
.requestId = pRequest->requestId,
.requestObjRefId = pRequest->self,
.mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
- char dbFName[TSDB_DB_FNAME_LEN];
+ char dbFName[TSDB_DB_FNAME_LEN];
snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
catalogRefreshDBVgInfo(pCatalog, &conn, dbFName);
snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
catalogRefreshDBVgInfo(pCatalog, &conn, dbFName);
- }
+ }
}
if (pRequest->body.queryFp) {
@@ -197,7 +205,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp);
struct SCatalog* pCatalog = NULL;
- if (usedbRsp.vgVersion >= 0) { // cached in local
+ if (usedbRsp.vgVersion >= 0) { // cached in local
uint64_t clusterId = pRequest->pTscObj->pAppInfo->clusterId;
int32_t code1 = catalogGetHandle(clusterId, &pCatalog);
if (code1 != TSDB_CODE_SUCCESS) {
@@ -289,7 +297,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
}
int32_t processCreateSTableRsp(void* param, SDataBuf* pMsg, int32_t code) {
- if(pMsg == NULL || param == NULL){
+ if (pMsg == NULL || param == NULL) {
return TSDB_CODE_TSC_INVALID_INPUT;
}
SRequestObj* pRequest = param;
@@ -344,13 +352,13 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
int32_t code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
if (TSDB_CODE_SUCCESS == code) {
catalogRemoveDB(pCatalog, dropdbRsp.db, dropdbRsp.uid);
- STscObj* pTscObj = pRequest->pTscObj;
+ STscObj* pTscObj = pRequest->pTscObj;
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
.requestId = pRequest->requestId,
.requestObjRefId = pRequest->self,
.mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
- char dbFName[TSDB_DB_FNAME_LEN];
+ char dbFName[TSDB_DB_FNAME_LEN];
snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
catalogRefreshDBVgInfo(pCatalog, &conn, dbFName);
snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
@@ -474,8 +482,9 @@ static int32_t buildShowVariablesRsp(SArray* pVars, SRetrieveTableRsp** pRsp) {
int32_t len = blockEncode(pBlock, (*pRsp)->data, SHOW_VARIABLES_RESULT_COLS);
blockDataDestroy(pBlock);
- if(len != rspSize - sizeof(SRetrieveTableRsp)){
- uError("buildShowVariablesRsp error, len:%d != rspSize - sizeof(SRetrieveTableRsp):%" PRIu64, len, (uint64_t) (rspSize - sizeof(SRetrieveTableRsp)));
+ if (len != rspSize - sizeof(SRetrieveTableRsp)) {
+ uError("buildShowVariablesRsp error, len:%d != rspSize - sizeof(SRetrieveTableRsp):%" PRIu64, len,
+ (uint64_t)(rspSize - sizeof(SRetrieveTableRsp)));
return TSDB_CODE_TSC_INVALID_INPUT;
}
@@ -497,6 +506,9 @@ int32_t processShowVariablesRsp(void* param, SDataBuf* pMsg, int32_t code) {
code = setQueryResultFromRsp(&pRequest->body.resInfo, pRes, false, true);
}
+ if(code != 0){
+ taosMemoryFree(pRes);
+ }
tFreeSShowVariablesRsp(&rsp);
}
diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c
index b83e7ee976..32f748d4a9 100644
--- a/source/client/src/clientSml.c
+++ b/source/client/src/clientSml.c
@@ -1073,8 +1073,6 @@ void smlDestroyInfo(SSmlHandle *info) {
taosArrayDestroy(info->valueJsonArray);
taosArrayDestroy(info->preLineTagKV);
- taosArrayDestroy(info->maxTagKVs);
- taosArrayDestroy(info->preLineColKV);
if (!info->dataFormat) {
for (int i = 0; i < info->lineNum; i++) {
@@ -1117,8 +1115,6 @@ SSmlHandle *smlBuildSmlInfo(TAOS *taos) {
info->tagJsonArray = taosArrayInit(8, POINTER_BYTES);
info->valueJsonArray = taosArrayInit(8, POINTER_BYTES);
info->preLineTagKV = taosArrayInit(8, sizeof(SSmlKv));
- info->maxTagKVs = taosArrayInit(8, sizeof(SSmlKv));
- info->preLineColKV = taosArrayInit(8, sizeof(SSmlKv));
if (NULL == info->pVgHash || NULL == info->childTables || NULL == info->superTables) {
uError("create SSmlHandle failed");
@@ -1141,6 +1137,7 @@ 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;}
}
taosArrayPush(colsArray, &kvHash);
@@ -1154,13 +1151,16 @@ static int32_t smlParseLineBottom(SSmlHandle *info) {
SSmlLineInfo *elements = info->lines + i;
SSmlTableInfo *tinfo = NULL;
if (info->protocol == TSDB_SML_LINE_PROTOCOL) {
- tinfo = *(SSmlTableInfo **)taosHashGet(info->childTables, elements->measure, elements->measureTagsLen);
+ SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measure, elements->measureTagsLen);
+ if(tmp) tinfo = *tmp;
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
- tinfo = *(SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
+ SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
elements->measureLen + elements->tagsLen);
+ if(tmp) tinfo = *tmp;
} else {
- tinfo = *(SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
+ SSmlTableInfo** tmp = (SSmlTableInfo **)taosHashGet(info->childTables, elements->measureTag,
elements->measureLen + elements->tagsLen);
+ if(tmp) tinfo = *tmp;
}
if (tinfo == NULL) {
@@ -1204,6 +1204,7 @@ static int32_t smlParseLineBottom(SSmlHandle *info) {
SSmlSTableMeta *meta = smlBuildSTableMeta(info->dataFormat);
smlInsertMeta(meta->tagHash, meta->tags, tinfo->tags);
+ 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);
}
diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c
index e89227d412..4609dd68b0 100644
--- a/source/client/src/clientSmlJson.c
+++ b/source/client/src/clientSmlJson.c
@@ -683,13 +683,10 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *tags, SSmlLineInfo
int cnt = 0;
SArray *preLineKV = info->preLineTagKV;
- SArray *maxKVs = info->maxTagKVs;
- bool isSuperKVInit = true;
- SArray *superKV = NULL;
if (info->dataFormat) {
if (unlikely(!isSameMeasure)) {
SSmlSTableMeta **tmp = (SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
- SSmlSTableMeta *sMeta = NULL;
+ SSmlSTableMeta *sMeta = NULL;
if (unlikely(tmp == NULL)) {
STableMeta *pTableMeta = smlGetMeta(info, elements->measure, elements->measureLen);
if (pTableMeta == NULL) {
@@ -700,18 +697,16 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *tags, SSmlLineInfo
sMeta = smlBuildSTableMeta(info->dataFormat);
sMeta->tableMeta = pTableMeta;
taosHashPut(info->superTables, elements->measure, elements->measureLen, &sMeta, POINTER_BYTES);
+ for(int i = pTableMeta->tableInfo.numOfColumns; i < pTableMeta->tableInfo.numOfTags + pTableMeta->tableInfo.numOfColumns; i++){
+ SSchema *tag = pTableMeta->schema + i;
+ SSmlKv kv = {.key = tag->name, .keyLen = strlen(tag->name), .type = tag->type, .length = (tag->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE };
+ taosArrayPush(sMeta->tags, &kv);
+ }
tmp = &sMeta;
}
info->currSTableMeta = (*tmp)->tableMeta;
- superKV = (*tmp)->tags;
-
- if (unlikely(taosArrayGetSize(superKV) == 0)) {
- isSuperKVInit = false;
- }
- taosArrayClear(maxKVs);
+ info->maxTagKVs = (*tmp)->tags;
}
- } else {
- taosArrayClear(maxKVs);
}
taosArrayClear(preLineKV);
@@ -747,58 +742,21 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *tags, SSmlLineInfo
return TSDB_CODE_SUCCESS;
}
- if (isSameMeasure) {
- if (unlikely(cnt >= taosArrayGetSize(maxKVs))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(maxKVs, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- SSmlSTableMeta **tableMeta =
- (SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
- if (unlikely(NULL == tableMeta)) {
- uError("SML:0x%" PRIx64 " NULL == tableMeta", info->id);
- return TSDB_CODE_SML_INTERNAL_ERROR;
- }
-
- SSmlKv *oldKV = (SSmlKv *)taosArrayGet((*tableMeta)->tags, cnt);
- oldKV->length = kv.length;
- info->needModifySchema = true;
- }
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- if (isSuperKVInit) {
- if (unlikely(cnt >= taosArrayGetSize(superKV))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(superKV, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- } else {
- kv.length = maxKV->length;
- }
- info->needModifySchema = true;
-
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- taosArrayPush(superKV, &kv);
- }
- taosArrayPush(maxKVs, &kv);
+ if (unlikely(cnt >= taosArrayGetSize(info->maxTagKVs))) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ SSmlKv *maxKV = (SSmlKv *)taosArrayGet(info->maxTagKVs, cnt);
+ if (unlikely(!IS_SAME_KEY)) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ if (unlikely(kv.length > maxKV->length)) {
+ maxKV->length = kv.length;
+ info->needModifySchema = true;
}
- } else {
- taosArrayPush(maxKVs, &kv);
}
taosArrayPush(preLineKV, &kv);
cnt++;
@@ -1214,7 +1172,7 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo *
return TSDB_CODE_INVALID_TIMESTAMP;
} else if (elements->timestamp[0] == '{') {
char tmp = elements->timestamp[elements->timestampLen];
- elements->cols[elements->timestampLen] = '\0';
+ elements->timestamp[elements->timestampLen] = '\0';
cJSON *tsJson = cJSON_Parse(elements->timestamp);
ts = smlParseTSFromJSON(info, tsJson);
if (unlikely(ts < 0)) {
@@ -1279,10 +1237,11 @@ int32_t smlParseJSON(SSmlHandle *info, char *payload) {
if (cnt >= payloadNum) {
payloadNum = payloadNum << 1;
void *tmp = taosMemoryRealloc(info->lines, payloadNum * sizeof(SSmlLineInfo));
- if (tmp != NULL) {
- info->lines = (SSmlLineInfo *)tmp;
- memset(info->lines + cnt, 0, (payloadNum - cnt) * sizeof(SSmlLineInfo));
+ if (tmp == NULL) {
+ return TSDB_CODE_OUT_OF_MEMORY;
}
+ info->lines = (SSmlLineInfo *)tmp;
+ memset(info->lines + cnt, 0, (payloadNum - cnt) * sizeof(SSmlLineInfo));
}
ret = smlParseJSONString(info, &dataPointStart, info->lines + cnt);
if ((info->lines + cnt)->measure == NULL) break;
diff --git a/source/client/src/clientSmlLine.c b/source/client/src/clientSmlLine.c
index a2f752edb9..66f1316cd5 100644
--- a/source/client/src/clientSmlLine.c
+++ b/source/client/src/clientSmlLine.c
@@ -144,13 +144,11 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
int cnt = 0;
SArray *preLineKV = info->preLineTagKV;
- SArray *maxKVs = info->maxTagKVs;
- bool isSuperKVInit = true;
- SArray *superKV = NULL;
if (info->dataFormat) {
if (unlikely(!isSameMeasure)) {
SSmlSTableMeta **tmp =
(SSmlSTableMeta **)taosHashGet(info->superTables, currElement->measure, currElement->measureLen);
+
SSmlSTableMeta *sMeta = NULL;
if (unlikely(tmp == NULL)) {
STableMeta *pTableMeta = smlGetMeta(info, currElement->measure, currElement->measureLen);
@@ -162,18 +160,16 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
sMeta = smlBuildSTableMeta(info->dataFormat);
sMeta->tableMeta = pTableMeta;
taosHashPut(info->superTables, currElement->measure, currElement->measureLen, &sMeta, POINTER_BYTES);
+ for(int i = pTableMeta->tableInfo.numOfColumns; i < pTableMeta->tableInfo.numOfTags + pTableMeta->tableInfo.numOfColumns; i++){
+ SSchema *tag = pTableMeta->schema + i;
+ SSmlKv kv = {.key = tag->name, .keyLen = strlen(tag->name), .type = tag->type, .length = (tag->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE };
+ taosArrayPush(sMeta->tags, &kv);
+ }
tmp = &sMeta;
}
info->currSTableMeta = (*tmp)->tableMeta;
- superKV = (*tmp)->tags;
-
- if (unlikely(taosArrayGetSize(superKV) == 0)) {
- isSuperKVInit = false;
- }
- taosArrayClear(maxKVs);
+ info->maxTagKVs = (*tmp)->tags;
}
- } else {
- taosArrayClear(maxKVs);
}
taosArrayClear(preLineKV);
@@ -252,58 +248,23 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
return TSDB_CODE_SUCCESS;
}
- if (isSameMeasure) {
- if (unlikely(cnt >= taosArrayGetSize(maxKVs))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(maxKVs, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- SSmlSTableMeta **tableMeta =
- (SSmlSTableMeta **)taosHashGet(info->superTables, currElement->measure, currElement->measureLen);
- if (unlikely(NULL == tableMeta)) {
- uError("SML:0x%" PRIx64 " NULL == tableMeta", info->id);
- return TSDB_CODE_SML_INTERNAL_ERROR;
- }
-
- SSmlKv *oldKV = (SSmlKv *)taosArrayGet((*tableMeta)->tags, cnt);
- oldKV->length = kv.length;
- info->needModifySchema = true;
- }
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- if (isSuperKVInit) {
- if (unlikely(cnt >= taosArrayGetSize(superKV))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(superKV, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- } else {
- kv.length = maxKV->length;
- }
- info->needModifySchema = true;
-
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- taosArrayPush(superKV, &kv);
- }
- taosArrayPush(maxKVs, &kv);
+ if (unlikely(cnt >= taosArrayGetSize(info->maxTagKVs))) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ SSmlKv *maxKV = (SSmlKv *)taosArrayGet(info->maxTagKVs, cnt);
+
+ if (unlikely(!IS_SAME_KEY)) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+
+ if (unlikely(kv.length > maxKV->length)) {
+ maxKV->length = kv.length;
+ info->needModifySchema = true;
}
- } else {
- taosArrayPush(maxKVs, &kv);
}
taosArrayPush(preLineKV, &kv);
@@ -344,9 +305,6 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLineInfo *currElement, bool isSameMeasure,
bool isSameCTable) {
int cnt = 0;
- SArray *preLineKV = info->preLineColKV;
- bool isSuperKVInit = true;
- SArray *superKV = NULL;
if (info->dataFormat) {
if (unlikely(!isSameCTable)) {
SSmlTableInfo **oneTable =
@@ -361,7 +319,6 @@ static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
if (unlikely(!isSameMeasure)) {
SSmlSTableMeta **tmp =
(SSmlSTableMeta **)taosHashGet(info->superTables, currElement->measure, currElement->measureLen);
- SSmlSTableMeta *sMeta = NULL;
if (unlikely(tmp == NULL)) {
STableMeta *pTableMeta = smlGetMeta(info, currElement->measure, currElement->measureLen);
if (pTableMeta == NULL) {
@@ -369,17 +326,23 @@ static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
info->reRun = true;
return TSDB_CODE_SUCCESS;
}
- sMeta = smlBuildSTableMeta(info->dataFormat);
- sMeta->tableMeta = pTableMeta;
- taosHashPut(info->superTables, currElement->measure, currElement->measureLen, &sMeta, POINTER_BYTES);
- tmp = &sMeta;
+ *tmp = smlBuildSTableMeta(info->dataFormat);
+ (*tmp)->tableMeta = pTableMeta;
+ taosHashPut(info->superTables, currElement->measure, currElement->measureLen, tmp, POINTER_BYTES);
+
+ for(int i = 0; i < pTableMeta->tableInfo.numOfColumns; i++){
+ SSchema *tag = pTableMeta->schema + i;
+ SSmlKv kv = {.key = tag->name, .keyLen = strlen(tag->name), .type = tag->type };
+ if(tag->type == TSDB_DATA_TYPE_NCHAR){
+ kv.length = (tag->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
+ }else if(tag->type == TSDB_DATA_TYPE_BINARY){
+ kv.length = tag->bytes - VARSTR_HEADER_SIZE;
+ }
+ taosArrayPush((*tmp)->cols, &kv);
+ }
}
info->currSTableMeta = (*tmp)->tableMeta;
- superKV = (*tmp)->cols;
- if (unlikely(taosArrayGetSize(superKV) == 0)) {
- isSuperKVInit = false;
- }
- taosArrayClear(preLineKV);
+ info->masColKVs = (*tmp)->cols;
}
}
@@ -478,69 +441,26 @@ static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin
info->reRun = true;
return TSDB_CODE_SUCCESS;
}
+ if (cnt >= taosArrayGetSize(info->masColKVs)) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ SSmlKv *maxKV = (SSmlKv *)taosArrayGet(info->masColKVs, cnt);
+ if (kv.type != maxKV->type) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ if (unlikely(!IS_SAME_KEY)) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
- if (isSameMeasure) {
- if (cnt >= taosArrayGetSize(preLineKV)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(preLineKV, cnt);
- if (kv.type != maxKV->type) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
-
- if (unlikely(IS_VAR_DATA_TYPE(kv.type) && kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- SSmlSTableMeta **tableMeta =
- (SSmlSTableMeta **)taosHashGet(info->superTables, currElement->measure, currElement->measureLen);
- if (unlikely(NULL == tableMeta)) {
- uError("SML:0x%" PRIx64 " NULL == tableMeta", info->id);
- return TSDB_CODE_SML_INTERNAL_ERROR;
- }
-
- SSmlKv *oldKV = (SSmlKv *)taosArrayGet((*tableMeta)->cols, cnt);
- oldKV->length = kv.length;
- info->needModifySchema = true;
- }
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- if (isSuperKVInit) {
- if (unlikely(cnt >= taosArrayGetSize(superKV))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(superKV, cnt);
- if (unlikely(kv.type != maxKV->type)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
-
- if (IS_VAR_DATA_TYPE(kv.type)) {
- if (kv.length > maxKV->length) {
- maxKV->length = kv.length;
- } else {
- kv.length = maxKV->length;
- }
- info->needModifySchema = true;
- }
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- taosArrayPush(superKV, &kv);
- }
- taosArrayPush(preLineKV, &kv);
+ if (unlikely(IS_VAR_DATA_TYPE(kv.type) && kv.length > maxKV->length)) {
+ maxKV->length = kv.length;
+ info->needModifySchema = true;
}
} else {
if (currElement->colArray == NULL) {
diff --git a/source/client/src/clientSmlTelnet.c b/source/client/src/clientSmlTelnet.c
index ab071305fa..ccf79cfc64 100644
--- a/source/client/src/clientSmlTelnet.c
+++ b/source/client/src/clientSmlTelnet.c
@@ -79,13 +79,10 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS
int cnt = 0;
SArray *preLineKV = info->preLineTagKV;
- SArray *maxKVs = info->maxTagKVs;
- bool isSuperKVInit = true;
- SArray *superKV = NULL;
if (info->dataFormat) {
if (!isSameMeasure) {
SSmlSTableMeta **tmp = (SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
- SSmlSTableMeta *sMeta = NULL;
+ SSmlSTableMeta *sMeta = NULL;
if (unlikely(tmp == NULL)) {
STableMeta *pTableMeta = smlGetMeta(info, elements->measure, elements->measureLen);
if (pTableMeta == NULL) {
@@ -96,18 +93,16 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS
sMeta = smlBuildSTableMeta(info->dataFormat);
sMeta->tableMeta = pTableMeta;
taosHashPut(info->superTables, elements->measure, elements->measureLen, &sMeta, POINTER_BYTES);
+ for(int i = pTableMeta->tableInfo.numOfColumns; i < pTableMeta->tableInfo.numOfTags + pTableMeta->tableInfo.numOfColumns; i++){
+ SSchema *tag = pTableMeta->schema + i;
+ SSmlKv kv = {.key = tag->name, .keyLen = strlen(tag->name), .type = tag->type, .length = (tag->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE };
+ taosArrayPush(sMeta->tags, &kv);
+ }
tmp = &sMeta;
}
info->currSTableMeta = (*tmp)->tableMeta;
- superKV = (*tmp)->tags;
-
- if (unlikely(taosArrayGetSize(superKV) == 0)) {
- isSuperKVInit = false;
- }
- taosArrayClear(maxKVs);
+ info->maxTagKVs = (*tmp)->tags;
}
- } else {
- taosArrayClear(maxKVs);
}
taosArrayClear(preLineKV);
@@ -175,59 +170,21 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS
info->reRun = true;
return TSDB_CODE_SUCCESS;
}
-
- if (isSameMeasure) {
- if (unlikely(cnt >= taosArrayGetSize(maxKVs))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(maxKVs, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- SSmlSTableMeta **tableMeta =
- (SSmlSTableMeta **)taosHashGet(info->superTables, elements->measure, elements->measureLen);
- if (unlikely(NULL == tableMeta)) {
- uError("SML:0x%" PRIx64 " NULL == tableMeta", info->id);
- return TSDB_CODE_SML_INTERNAL_ERROR;
- }
-
- SSmlKv *oldKV = (SSmlKv *)taosArrayGet((*tableMeta)->tags, cnt);
- oldKV->length = kv.length;
- info->needModifySchema = true;
- }
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- if (isSuperKVInit) {
- if (unlikely(cnt >= taosArrayGetSize(superKV))) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- SSmlKv *maxKV = (SSmlKv *)taosArrayGet(superKV, cnt);
- if (unlikely(kv.length > maxKV->length)) {
- maxKV->length = kv.length;
- } else {
- kv.length = maxKV->length;
- }
- info->needModifySchema = true;
-
- if (unlikely(!IS_SAME_KEY)) {
- info->dataFormat = false;
- info->reRun = true;
- return TSDB_CODE_SUCCESS;
- }
- } else {
- taosArrayPush(superKV, &kv);
- }
- taosArrayPush(maxKVs, &kv);
+ if (unlikely(cnt >= taosArrayGetSize(info->maxTagKVs))) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ SSmlKv *maxKV = (SSmlKv *)taosArrayGet(info->maxTagKVs, cnt);
+ if (unlikely(!IS_SAME_KEY)) {
+ info->dataFormat = false;
+ info->reRun = true;
+ return TSDB_CODE_SUCCESS;
+ }
+ if (unlikely(kv.length > maxKV->length)) {
+ maxKV->length = kv.length;
+ info->needModifySchema = true;
}
- } else {
- taosArrayPush(maxKVs, &kv);
}
taosArrayPush(preLineKV, &kv);
cnt++;
diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c
index d913b32642..9f24deff94 100644
--- a/source/client/src/clientTmq.c
+++ b/source/client/src/clientTmq.c
@@ -192,6 +192,7 @@ typedef struct {
SMqClientTopic* pTopic;
int32_t vgId;
tsem_t rspSem;
+ uint64_t requestId; // request id for debug purpose
} SMqPollCbParam;
typedef struct {
@@ -1054,7 +1055,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
pTmq->hbLiveTimer = taosTmrStart(tmqSendHbReq, 1000, pRefId, tmqMgmt.timer);
}
- tscInfo("consumer:0x%" PRIx64 " is setup, consumer groupId %s", pTmq->consumerId, pTmq->groupId);
+ tscInfo("consumer:0x%" PRIx64 " is setup, groupId:%s", pTmq->consumerId, pTmq->groupId);
return pTmq;
FAIL:
@@ -1075,7 +1076,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
SCMSubscribeReq req = {0};
int32_t code = 0;
- tscDebug("consumer:0x%" PRIx64 " subscribe %d topics", tmq->consumerId, sz);
+ tscDebug("consumer:0x%" PRIx64 " cgroup:%s, subscribe %d topics", tmq->consumerId, tmq->groupId, sz);
req.consumerId = tmq->consumerId;
tstrncpy(req.clientId, tmq->clientId, 256);
@@ -1161,7 +1162,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
int32_t retryCnt = 0;
while (TSDB_CODE_MND_CONSUMER_NOT_READY == tmqAskEp(tmq, false)) {
- if (retryCnt++ > 10) {
+ if (retryCnt++ > 40) {
goto FAIL;
}
@@ -1212,30 +1213,39 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
return -1;
}
- int32_t epoch = pParam->epoch;
- int32_t vgId = pParam->vgId;
+ int32_t epoch = pParam->epoch;
+ int32_t vgId = pParam->vgId;
+ uint64_t requestId = pParam->requestId;
+
taosMemoryFree(pParam);
+
if (code != 0) {
- tscWarn("msg discard from vgId:%d, epoch %d, since %s", vgId, epoch, terrstr());
+ tscWarn("consumer:0x%"PRIx64" msg from vgId:%d discarded, epoch %d, since %s, reqId:0x%"PRIx64, tmq->consumerId, vgId,
+ epoch, tstrerror(code), requestId);
+
if (pMsg->pData) taosMemoryFree(pMsg->pData);
if (pMsg->pEpSet) taosMemoryFree(pMsg->pEpSet);
+ // in case of consumer mismatch, wait for 500ms and retry
if (code == TSDB_CODE_TMQ_CONSUMER_MISMATCH) {
+ taosMsleep(500);
atomic_store_8(&tmq->status, TMQ_CONSUMER_STATUS__RECOVER);
- goto CREATE_MSG_FAIL;
- }
- if (code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) {
+ 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) {
- tscWarn("msg discard from vgId:%d, epoch %d since out of memory", vgId, epoch);
+ tscWarn("consumer:0x%" PRIx64 " msg from vgId:%d discarded, epoch %d since out of memory, reqId:0x%" PRIx64,
+ tmq->consumerId, vgId, epoch, requestId);
goto CREATE_MSG_FAIL;
}
+
pRspWrapper->tmqRspType = TMQ_MSG_TYPE__END_RSP;
/*pRspWrapper->vgHandle = pVg;*/
/*pRspWrapper->topicHandle = pTopic;*/
taosWriteQitem(tmq->mqueue, pRspWrapper);
tsem_post(&tmq->rspSem);
}
+
goto CREATE_MSG_FAIL;
}
@@ -1243,8 +1253,9 @@ 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("msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d", vgId, msgEpoch,
- tmqEpoch);
+ 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);
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
@@ -1252,7 +1263,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
}
if (msgEpoch != tmqEpoch) {
- tscWarn("mismatch rsp from vgId:%d, epoch %d, current epoch %d", vgId, msgEpoch, tmqEpoch);
+ tscWarn("consumer:0x%"PRIx64" mismatch rsp from vgId:%d, epoch %d, current epoch %d, reqId:0x%"PRIx64, tmq->consumerId, vgId,
+ msgEpoch, tmqEpoch, requestId);
}
// handle meta rsp
@@ -1262,7 +1274,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
if (pRspWrapper == NULL) {
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
- tscWarn("msg discard from vgId:%d, epoch %d since out of memory", 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;
}
@@ -1277,10 +1289,9 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
tDecoderClear(&decoder);
memcpy(&pRspWrapper->dataRsp, pMsg->pData, sizeof(SMqRspHead));
- tscDebug("consumer:0x%" PRIx64 ", recv poll: vgId:%d, req offset %" PRId64 ", rsp offset %" PRId64 " type %d",
+ tscDebug("consumer:0x%" PRIx64 " recv poll rsp, vgId:%d, req offset:%" PRId64 ", rsp offset:%" PRId64 " type %d, reqId:0x%"PRIx64,
tmq->consumerId, pVg->vgId, pRspWrapper->dataRsp.reqOffset.version, pRspWrapper->dataRsp.rspOffset.version,
- rspType);
-
+ rspType, requestId);
} else if (rspType == TMQ_MSG_TYPE__POLL_META_RSP) {
SDecoder decoder;
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead));
@@ -1298,16 +1309,19 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
- tscDebug("consumer:0x%" PRIx64 ", put poll res into mqueue %p", tmq->consumerId, pRspWrapper);
+ tscDebug("consumer:0x%" PRIx64 ", put poll res into mqueue, total in queue:%d, reqId:0x%" PRIx64, tmq->consumerId,
+ tmq->mqueue->numOfItems, requestId);
taosWriteQitem(tmq->mqueue, pRspWrapper);
tsem_post(&tmq->rspSem);
return 0;
+
CREATE_MSG_FAIL:
if (epoch == tmq->epoch) {
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
}
+
tsem_post(&tmq->rspSem);
return -1;
}
@@ -1344,7 +1358,7 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) {
sprintf(vgKey, "%s:%d", pTopicCur->topicName, pVgCur->vgId);
char buf[80];
tFormatOffset(buf, 80, &pVgCur->currentOffset);
- tscDebug("consumer:0x%" PRIx64 ", epoch %d vgId:%d vgKey is %s, offset is %s", tmq->consumerId, epoch,
+ tscDebug("consumer:0x%" PRIx64 ", epoch:%d vgId:%d vgKey:%s, offset:%s", tmq->consumerId, epoch,
pVgCur->vgId, vgKey, buf);
taosHashPut(pHash, vgKey, strlen(vgKey), &pVgCur->currentOffset, sizeof(STqOffsetVal));
}
@@ -1552,7 +1566,7 @@ int32_t tmqAskEp(tmq_t* tmq, bool async) {
.handle = NULL,
};
- sendInfo->requestId = tmq->consumerId;
+ sendInfo->requestId = generateRequestId();
sendInfo->requestObjRefId = 0;
sendInfo->param = pParam;
sendInfo->fp = tmqAskEpCb;
@@ -1560,7 +1574,7 @@ int32_t tmqAskEp(tmq_t* tmq, bool async) {
SEpSet epSet = getEpSet_s(&tmq->pTscObj->pAppInfo->mgmtEp);
tscDebug("consumer:0x%" PRIx64 " ask ep from mnode, async:%d, reqId:0x%" PRIx64, tmq->consumerId, async,
- tmq->consumerId);
+ sendInfo->requestId);
int64_t transporterId = 0;
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
@@ -1674,6 +1688,7 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
pParam->pVg = pVg; // pVg may be released,fix it
pParam->pTopic = pTopic;
pParam->vgId = pVg->vgId;
+ pParam->requestId = req.reqId;
SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
if (sendInfo == NULL) {
@@ -1698,7 +1713,7 @@ 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 offset:%s, reqId:0x%" PRIx64,
+ 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);
@@ -1722,10 +1737,9 @@ int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
int32_t vgStatus = atomic_val_compare_exchange_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE, TMQ_VG_STATUS__WAIT);
if (vgStatus == TMQ_VG_STATUS__WAIT) {
int32_t vgSkipCnt = atomic_add_fetch_32(&pVg->vgSkipCnt, 1);
- tscDebug("consumer:0x%" PRIx64 " epoch %d wait poll-rsp, skip vgId:%d skip cnt %d", tmq->consumerId, tmq->epoch,
+ tscTrace("consumer:0x%" PRIx64 " epoch %d wait poll-rsp, skip vgId:%d skip cnt %d", tmq->consumerId, tmq->epoch,
pVg->vgId, vgSkipCnt);
continue;
- /*if (vgSkipCnt < 10000) continue;*/
#if 0
if (skipCnt < 30000) {
continue;
@@ -1767,7 +1781,7 @@ int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper, bool* pReset)
}
void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
- tscDebug("consumer:0x%" PRIx64 " start to handle the rsp", tmq->consumerId);
+ tscDebug("consumer:0x%" PRIx64 " start to handle the rsp, total:%d", tmq->consumerId, tmq->qall->numOfItems);
while (1) {
SMqRspWrapper* rspWrapper = NULL;
@@ -1785,25 +1799,32 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__END_RSP) {
taosFreeQitem(rspWrapper);
terrno = TSDB_CODE_TQ_NO_COMMITTED_OFFSET;
+ tscError("consumer:0x%" PRIx64 " unexpected rsp from poll, code:%s", tmq->consumerId, tstrerror(terrno));
return NULL;
} else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) {
SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)rspWrapper;
- tscDebug("consumer:0x%" PRIx64 " process poll rsp", tmq->consumerId);
+
/*atomic_sub_fetch_32(&tmq->readyRequest, 1);*/
int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
if (pollRspWrapper->dataRsp.head.epoch == consumerEpoch) {
SMqClientVg* pVg = pollRspWrapper->vgHandle;
- /*printf("vgId:%d, offset %" PRId64 " up to %" PRId64 "\n", pVg->vgId, pVg->currentOffset,
- * rspMsg->msg.rspOffset);*/
pVg->currentOffset = pollRspWrapper->dataRsp.rspOffset;
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
+
if (pollRspWrapper->dataRsp.blockNum == 0) {
+ tscDebug("consumer:0x%" PRIx64 " empty block received, vgId:%d", tmq->consumerId, pVg->vgId);
taosFreeQitem(pollRspWrapper);
rspWrapper = NULL;
continue;
}
+
// build rsp
+ char buf[80];
+ tFormatOffset(buf, 80, &pVg->currentOffset);
SMqRspObj* pRsp = tmqBuildRspFromWrapper(pollRspWrapper);
+ tscDebug("consumer:0x%" PRIx64 " process poll rsp, vgId:%d, offset:%s, blocks:%d", tmq->consumerId,
+ pVg->vgId, buf, pollRspWrapper->dataRsp.blockNum);
+
taosFreeQitem(pollRspWrapper);
return pRsp;
} else {
@@ -1876,6 +1897,8 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
}
}
}
+
+ tscDebug("consumer:0x%" PRIx64 " handle the rsp completed", tmq->consumerId);
}
TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
@@ -1896,17 +1919,18 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
// in no topic status, delayed task also need to be processed
if (atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__INIT) {
tscDebug("consumer:0x%" PRIx64 " poll return since consumer is init", tmq->consumerId);
+ taosMsleep(500); // sleep for a while
return NULL;
}
if (atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__RECOVER) {
int32_t retryCnt = 0;
while (TSDB_CODE_MND_CONSUMER_NOT_READY == tmqAskEp(tmq, false)) {
- if (retryCnt++ > 10) {
+ if (retryCnt++ > 40) {
return NULL;
}
- tscDebug("consumer:0x%" PRIx64 " not ready, retry:%d/10 in 500ms", tmq->consumerId, retryCnt);
+ tscDebug("consumer:0x%" PRIx64 " not ready, retry:%d/40 in 500ms", tmq->consumerId, retryCnt);
taosMsleep(500);
}
}
diff --git a/source/client/src/clientTmqConnector.c b/source/client/src/clientTmqConnector.c
index ccfc4980bc..a8c9f2279d 100644
--- a/source/client/src/clientTmqConnector.c
+++ b/source/client/src/clientTmqConnector.c
@@ -17,6 +17,36 @@
#include "jniCommon.h"
#include "taos.h"
+int __init_tmq = 0;
+jmethodID g_offsetCallback;
+
+void tmqGlobalMethod(JNIEnv *env) {
+ // make sure init function executed once
+ switch (atomic_val_compare_exchange_32(&__init_tmq, 0, 1)) {
+ case 0:
+ break;
+ case 1:
+ do {
+ taosMsleep(0);
+ } while (atomic_load_32(&__init_tmq) == 1);
+ case 2:
+ return;
+ }
+
+ if (g_vm == NULL) {
+ (*env)->GetJavaVM(env, &g_vm);
+ }
+
+ jclass offset = (*env)->FindClass(env, "com/taosdata/jdbc/tmq/OffsetWaitCallback");
+ jclass g_offsetCallbackClass = (*env)->NewGlobalRef(env, offset);
+ g_offsetCallback = (*env)->GetMethodID(env, g_offsetCallbackClass, "commitCallbackHandler", "(I)V");
+ (*env)->DeleteLocalRef(env, offset);
+
+ atomic_store_32(&__init_tmq, 2);
+ jniDebug("tmq method register finished");
+}
+
+// deprecated
void commit_cb(tmq_t *tmq, int32_t code, void *param) {
JNIEnv *env = NULL;
int status = (*g_vm)->GetEnv(g_vm, (void **)&env, JNI_VERSION_1_6);
@@ -40,6 +70,28 @@ void commit_cb(tmq_t *tmq, int32_t code, void *param) {
env = NULL;
}
+void consumer_callback(tmq_t *tmq, int32_t code, void *param) {
+ JNIEnv *env = NULL;
+ int status = (*g_vm)->GetEnv(g_vm, (void **)&env, JNI_VERSION_1_6);
+ bool needDetach = false;
+ if (status < 0) {
+ if ((*g_vm)->AttachCurrentThread(g_vm, (void **)&env, NULL) != 0) {
+ return;
+ }
+ needDetach = true;
+ }
+
+ jobject obj = (jobject)param;
+ (*env)->CallVoidMethod(env, obj, g_offsetCallback, code);
+ (*env)->DeleteGlobalRef(env, obj);
+ param = NULL;
+
+ if (needDetach) {
+ (*g_vm)->DetachCurrentThread(g_vm);
+ }
+ env = NULL;
+}
+
JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqConfNewImp(JNIEnv *env, jobject jobj) {
tmq_conf_t *conf = tmq_conf_new();
jniGetGlobalMethod(env);
@@ -201,6 +253,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitSync(JNI
return tmq_commit_sync(tmq, res);
}
+// deprecated
JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAsync(JNIEnv *env, jobject jobj, jlong jtmq,
jlong jres, jobject consumer) {
tmq_t *tmq = (tmq_t *)jtmq;
@@ -213,6 +266,19 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAsync(JN
tmq_commit_async(tmq, res, commit_cb, consumer);
}
+JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAsync(JNIEnv *env, jobject jobj, jlong jtmq,
+ jlong jres, jobject offset) {
+ tmqGlobalMethod(env);
+ tmq_t *tmq = (tmq_t *)jtmq;
+ if (tmq == NULL) {
+ jniError("jobj:%p, tmq is closed", jobj);
+ return;
+ }
+ TAOS_RES *res = (TAOS_RES *)jres;
+ offset = (*env)->NewGlobalRef(env, offset);
+ tmq_commit_async(tmq, res, consumer_callback, offset);
+}
+
JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqUnsubscribeImp(JNIEnv *env, jobject jobj,
jlong jtmq) {
tmq_t *tmq = (tmq_t *)jtmq;
diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp
index 59c931d9aa..2f3d600019 100644
--- a/source/client/test/clientTests.cpp
+++ b/source/client/test/clientTests.cpp
@@ -925,7 +925,7 @@ TEST(clientCase, subscription_test) {
// 创建订阅 topics 列表
tmq_list_t* topicList = tmq_list_new();
- tmq_list_append(topicList, "topic_t1");
+// tmq_list_append(topicList, "topic_t1");
// 启动订阅
tmq_subscribe(tmq, topicList);
@@ -938,6 +938,8 @@ TEST(clientCase, subscription_test) {
int32_t msgCnt = 0;
int32_t timeout = 5000;
+ int32_t count = 0;
+
while (1) {
TAOS_RES* pRes = tmq_consumer_poll(tmq, timeout);
if (pRes) {
@@ -952,6 +954,11 @@ TEST(clientCase, subscription_test) {
printf("db: %s\n", dbName);
printf("vgroup id: %d\n", vgroupId);
+ if (count ++ > 20) {
+ tmq_unsubscribe(tmq);
+ break;
+ }
+
while (1) {
TAOS_ROW row = taos_fetch_row(pRes);
if (row == NULL) break;
diff --git a/source/common/src/systable.c b/source/common/src/systable.c
index 6198f923f4..4aa47a3819 100644
--- a/source/common/src/systable.c
+++ b/source/common/src/systable.c
@@ -33,6 +33,7 @@ static const SSysDbTableSchema dnodesSchema[] = {
{.name = "support_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
+ {.name = "reboot_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
};
@@ -42,6 +43,7 @@ static const SSysDbTableSchema mnodesSchema[] = {
{.name = "role", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
+ {.name = "reboot_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
};
static const SSysDbTableSchema modulesSchema[] = {
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index 88eb3bdb97..453e4a8d8e 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -2003,7 +2003,7 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
switch (pColInfoData->info.type) {
case TSDB_DATA_TYPE_TIMESTAMP:
memset(pBuf, 0, sizeof(pBuf));
- formatTimestamp(pBuf, *(uint64_t*)var, TSDB_TIME_PRECISION_MILLI);
+ formatTimestamp(pBuf, *(uint64_t*)var, pColInfoData->info.precision);
len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf);
if (len >= size - 1) return dumpBuf;
break;
diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c
index 02d83af3a7..8058f9fddd 100644
--- a/source/common/src/tglobal.c
+++ b/source/common/src/tglobal.c
@@ -41,7 +41,8 @@ bool tsPrintAuth = false;
// queue & threads
int32_t tsNumOfRpcThreads = 1;
-int32_t tsNumOfRpcSessions = 2000;
+int32_t tsNumOfRpcSessions = 10000;
+int32_t tsTimeToGetAvailableConn = 500000;
int32_t tsNumOfCommitThreads = 2;
int32_t tsNumOfTaskQueueThreads = 4;
int32_t tsNumOfMnodeQueryThreads = 4;
@@ -55,6 +56,7 @@ int32_t tsNumOfQnodeQueryThreads = 4;
int32_t tsNumOfQnodeFetchThreads = 1;
int32_t tsNumOfSnodeStreamThreads = 4;
int32_t tsNumOfSnodeWriteThreads = 1;
+
// sync raft
int32_t tsElectInterval = 25 * 1000;
int32_t tsHeartbeatInterval = 1000;
@@ -63,6 +65,10 @@ int32_t tsHeartbeatTimeout = 20 * 1000;
// vnode
int64_t tsVndCommitMaxIntervalMs = 600 * 1000;
+// mnode
+int64_t tsMndSdbWriteDelta = 200;
+int64_t tsMndLogRetention = 2000;
+
// monitor
bool tsEnableMonitor = true;
int32_t tsMonitorInterval = 30;
@@ -326,6 +332,16 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if (cfgAddBool(pCfg, "useAdapter", tsUseAdapter, true) != 0) return -1;
if (cfgAddBool(pCfg, "crashReporting", tsEnableCrashReport, true) != 0) return -1;
+ tsNumOfRpcThreads = tsNumOfCores / 2;
+ tsNumOfRpcThreads = TRANGE(tsNumOfRpcThreads, 2, TSDB_MAX_RPC_THREADS);
+ if (cfgAddInt32(pCfg, "numOfRpcThreads", tsNumOfRpcThreads, 1, 1024, 0) != 0) return -1;
+
+ tsNumOfRpcSessions = TRANGE(tsNumOfRpcSessions, 100, 100000);
+ if (cfgAddInt32(pCfg, "numOfRpcSessions", tsNumOfRpcSessions, 1, 100000, 0) != 0) return -1;
+
+ tsTimeToGetAvailableConn = TRANGE(tsTimeToGetAvailableConn, 20, 10000000);
+ if (cfgAddInt32(pCfg, "timeToGetAvailableConn", tsTimeToGetAvailableConn, 20, 1000000, 0) != 0) return -1;
+
tsNumOfTaskQueueThreads = tsNumOfCores / 2;
tsNumOfTaskQueueThreads = TMAX(tsNumOfTaskQueueThreads, 4);
if (tsNumOfTaskQueueThreads >= 10) {
@@ -397,6 +413,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
tsNumOfRpcSessions = TRANGE(tsNumOfRpcSessions, 100, 10000);
if (cfgAddInt32(pCfg, "numOfRpcSessions", tsNumOfRpcSessions, 1, 100000, 0) != 0) return -1;
+ tsTimeToGetAvailableConn = TRANGE(tsTimeToGetAvailableConn, 20, 1000000);
+ if (cfgAddInt32(pCfg, "timeToGetAvailableConn", tsNumOfRpcSessions, 20, 1000000, 0) != 0) return -1;
+
tsNumOfCommitThreads = tsNumOfCores / 2;
tsNumOfCommitThreads = TRANGE(tsNumOfCommitThreads, 2, 4);
if (cfgAddInt32(pCfg, "numOfCommitThreads", tsNumOfCommitThreads, 1, 1024, 0) != 0) return -1;
@@ -446,6 +465,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if (cfgAddInt64(pCfg, "vndCommitMaxInterval", tsVndCommitMaxIntervalMs, 1000, 1000 * 60 * 60, 0) != 0) return -1;
+ if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, 0) != 0) return -1;
+ if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, 0) != 0) return -1;
+
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, 0) != 0) return -1;
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, 0) != 0) return -1;
if (cfgAddString(pCfg, "monitorFqdn", tsMonitorFqdn, 0) != 0) return -1;
@@ -511,12 +533,18 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) {
pItem = cfgGetItem(tsCfg, "numOfRpcSessions");
if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) {
- tsNumOfRpcSessions = 2000;
tsNumOfRpcSessions = TRANGE(tsNumOfRpcSessions, 100, 10000);
pItem->i32 = tsNumOfRpcSessions;
pItem->stype = stype;
}
+ pItem = cfgGetItem(tsCfg, "timeToGetAvailableConn");
+ if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) {
+ tsTimeToGetAvailableConn = TRANGE(tsTimeToGetAvailableConn, 20, 1000000);
+ pItem->i32 = tsTimeToGetAvailableConn;
+ pItem->stype = stype;
+ }
+
pItem = cfgGetItem(tsCfg, "numOfCommitThreads");
if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) {
tsNumOfCommitThreads = numOfCores / 2;
@@ -698,6 +726,11 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsEnableCrashReport = cfgGetItem(pCfg, "crashReporting")->bval;
tsMaxRetryWaitTime = cfgGetItem(pCfg, "maxRetryWaitTime")->i32;
+
+ tsNumOfRpcThreads = cfgGetItem(pCfg, "numOfRpcThreads")->i32;
+ tsNumOfRpcSessions = cfgGetItem(pCfg, "numOfRpcSessions")->i32;
+
+ tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32;
return 0;
}
@@ -735,6 +768,8 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsNumOfRpcThreads = cfgGetItem(pCfg, "numOfRpcThreads")->i32;
tsNumOfRpcSessions = cfgGetItem(pCfg, "numOfRpcSessions")->i32;
+ tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32;
+
tsNumOfCommitThreads = cfgGetItem(pCfg, "numOfCommitThreads")->i32;
tsNumOfMnodeReadThreads = cfgGetItem(pCfg, "numOfMnodeReadThreads")->i32;
tsNumOfVnodeQueryThreads = cfgGetItem(pCfg, "numOfVnodeQueryThreads")->i32;
@@ -742,7 +777,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsNumOfVnodeFetchThreads = cfgGetItem(pCfg, "numOfVnodeFetchThreads")->i32;
tsNumOfVnodeRsmaThreads = cfgGetItem(pCfg, "numOfVnodeRsmaThreads")->i32;
tsNumOfQnodeQueryThreads = cfgGetItem(pCfg, "numOfQnodeQueryThreads")->i32;
- // tsNumOfQnodeFetchThreads = cfgGetItem(pCfg, "numOfQnodeFetchThreads")->i32;
+ // tsNumOfQnodeFetchThreads = cfgGetItem(pCfg, "numOfQnodeFetchTereads")->i32;
tsNumOfSnodeStreamThreads = cfgGetItem(pCfg, "numOfSnodeSharedThreads")->i32;
tsNumOfSnodeWriteThreads = cfgGetItem(pCfg, "numOfSnodeUniqueThreads")->i32;
tsRpcQueueMemoryAllowed = cfgGetItem(pCfg, "rpcQueueMemoryAllowed")->i64;
@@ -779,6 +814,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsVndCommitMaxIntervalMs = cfgGetItem(pCfg, "vndCommitMaxInterval")->i64;
+ tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64;
+ tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64;
+
tsStartUdfd = cfgGetItem(pCfg, "udf")->bval;
tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs));
tstrncpy(tsUdfdLdLibPath, cfgGetItem(pCfg, "udfdLdLibPath")->str, sizeof(tsUdfdLdLibPath));
@@ -1216,6 +1254,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32, false);
if (taosMulModeMkDir(tsLogDir, 0777) != 0) {
+ terrno = TAOS_SYSTEM_ERROR(errno);
uError("failed to create dir:%s since %s", tsLogDir, terrstr());
cfgCleanup(pCfg);
return -1;
diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c
index e180959d1e..6dd28094cb 100644
--- a/source/common/src/tmsg.c
+++ b/source/common/src/tmsg.c
@@ -2531,6 +2531,8 @@ int32_t tSerializeSCompactDbReq(void *buf, int32_t bufLen, SCompactDbReq *pReq)
if (tStartEncode(&encoder) < 0) return -1;
if (tEncodeCStr(&encoder, pReq->db) < 0) return -1;
+ if (tEncodeI64(&encoder, pReq->timeRange.skey) < 0) return -1;
+ if (tEncodeI64(&encoder, pReq->timeRange.ekey) < 0) return -1;
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -2544,6 +2546,8 @@ int32_t tDeserializeSCompactDbReq(void *buf, int32_t bufLen, SCompactDbReq *pReq
if (tStartDecode(&decoder) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1;
+ if (tDecodeI64(&decoder, &pReq->timeRange.skey) < 0) return -1;
+ if (tDecodeI64(&decoder, &pReq->timeRange.ekey) < 0) return -1;
tEndDecode(&decoder);
tDecoderClear(&decoder);
@@ -2865,12 +2869,19 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
if (tEncodeI32(&encoder, pRsp->minRows) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->maxRows) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->walFsyncPeriod) < 0) return -1;
+ if (tEncodeI16(&encoder, pRsp->hashPrefix) < 0) return -1;
+ if (tEncodeI16(&encoder, pRsp->hashSuffix) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->walLevel) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->precision) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->compression) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->replications) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->strict) < 0) return -1;
if (tEncodeI8(&encoder, pRsp->cacheLast) < 0) return -1;
+ if (tEncodeI32(&encoder, pRsp->tsdbPageSize) < 0) return -1;
+ if (tEncodeI32(&encoder, pRsp->walRetentionPeriod) < 0) return -1;
+ if (tEncodeI32(&encoder, pRsp->walRollPeriod) < 0) return -1;
+ if (tEncodeI64(&encoder, pRsp->walRetentionSize) < 0) return -1;
+ if (tEncodeI64(&encoder, pRsp->walSegmentSize) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->numOfRetensions) < 0) return -1;
for (int32_t i = 0; i < pRsp->numOfRetensions; ++i) {
SRetention *pRetension = taosArrayGet(pRsp->pRetensions, i);
@@ -2905,12 +2916,19 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
if (tDecodeI32(&decoder, &pRsp->minRows) < 0) return -1;
if (tDecodeI32(&decoder, &pRsp->maxRows) < 0) return -1;
if (tDecodeI32(&decoder, &pRsp->walFsyncPeriod) < 0) return -1;
+ if (tDecodeI16(&decoder, &pRsp->hashPrefix) < 0) return -1;
+ if (tDecodeI16(&decoder, &pRsp->hashSuffix) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->walLevel) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->precision) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->compression) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->replications) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->strict) < 0) return -1;
if (tDecodeI8(&decoder, &pRsp->cacheLast) < 0) return -1;
+ if (tDecodeI32(&decoder, &pRsp->tsdbPageSize) < 0) return -1;
+ if (tDecodeI32(&decoder, &pRsp->walRetentionPeriod) < 0) return -1;
+ if (tDecodeI32(&decoder, &pRsp->walRollPeriod) < 0) return -1;
+ if (tDecodeI64(&decoder, &pRsp->walRetentionSize) < 0) return -1;
+ if (tDecodeI64(&decoder, &pRsp->walSegmentSize) < 0) return -1;
if (tDecodeI32(&decoder, &pRsp->numOfRetensions) < 0) return -1;
if (pRsp->numOfRetensions > 0) {
pRsp->pRetensions = taosArrayInit(pRsp->numOfRetensions, sizeof(SRetention));
@@ -3723,6 +3741,7 @@ int32_t tSerializeSConnectReq(void *buf, int32_t bufLen, SConnectReq *pReq) {
if (tEncodeCStr(&encoder, pReq->user) < 0) return -1;
if (tEncodeCStrWithLen(&encoder, pReq->passwd, TSDB_PASSWORD_LEN) < 0) return -1;
if (tEncodeI64(&encoder, pReq->startTime) < 0) return -1;
+ if (tEncodeCStr(&encoder, pReq->sVer) < 0) return -1;
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -3742,6 +3761,12 @@ int32_t tDeserializeSConnectReq(void *buf, int32_t bufLen, SConnectReq *pReq) {
if (tDecodeCStrTo(&decoder, pReq->user) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->passwd) < 0) return -1;
if (tDecodeI64(&decoder, &pReq->startTime) < 0) return -1;
+ // Check the client version from version 3.0.3.0
+ if (tDecodeIsEnd(&decoder)) {
+ tDecoderClear(&decoder);
+ return TSDB_CODE_VERSION_NOT_COMPATIBLE;
+ }
+ if (tDecodeCStrTo(&decoder, pReq->sVer) < 0) return -1;
tEndDecode(&decoder);
tDecoderClear(&decoder);
@@ -4090,6 +4115,11 @@ int32_t tSerializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq *
if (tEncodeI64(&encoder, pReq->dbUid) < 0) return -1;
if (tEncodeCStr(&encoder, pReq->db) < 0) return -1;
if (tEncodeI64(&encoder, pReq->compactStartTime) < 0) return -1;
+
+ // 1.1 add tw.skey and tw.ekey
+ if (tEncodeI64(&encoder, pReq->tw.skey) < 0) return -1;
+ if (tEncodeI64(&encoder, pReq->tw.ekey) < 0) return -1;
+
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -4102,11 +4132,21 @@ int32_t tDeserializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq
tDecoderInit(&decoder, buf, bufLen);
if (tStartDecode(&decoder) < 0) return -1;
+
if (tDecodeI64(&decoder, &pReq->dbUid) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1;
if (tDecodeI64(&decoder, &pReq->compactStartTime) < 0) return -1;
- tEndDecode(&decoder);
+ // 1.1
+ if (tDecodeIsEnd(&decoder)) {
+ pReq->tw.skey = TSKEY_MIN;
+ pReq->tw.ekey = TSKEY_MAX;
+ } else {
+ if (tDecodeI64(&decoder, &pReq->tw.skey) < 0) return -1;
+ if (tDecodeI64(&decoder, &pReq->tw.ekey) < 0) return -1;
+ }
+
+ tEndDecode(&decoder);
tDecoderClear(&decoder);
return 0;
}
@@ -6570,7 +6610,7 @@ int32_t tFormatOffset(char *buf, int32_t maxLen, const STqOffsetVal *pVal) {
} else if (pVal->type == TMQ_OFFSET__LOG) {
snprintf(buf, maxLen, "offset(log) ver:%" PRId64, pVal->version);
} else if (pVal->type == TMQ_OFFSET__SNAPSHOT_DATA || pVal->type == TMQ_OFFSET__SNAPSHOT_META) {
- snprintf(buf, maxLen, "offset(ss data) uid:%" PRId64 ", ts:%" PRId64, pVal->uid, pVal->ts);
+ snprintf(buf, maxLen, "offset(snapshot) uid:%" PRId64 " ts:%" PRId64, pVal->uid, pVal->ts);
} else {
ASSERT(0);
}
diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c
index b42c88ac97..db69fe9d48 100644
--- a/source/common/src/tvariant.c
+++ b/source/common/src/tvariant.c
@@ -145,19 +145,6 @@ void taosVariantDestroy(SVariant *pVar) {
pVar->nLen = 0;
}
- // NOTE: this is only for string array
- if (pVar->nType == TSDB_DATA_TYPE_POINTER_ARRAY) {
- size_t num = taosArrayGetSize(pVar->arr);
- for (size_t i = 0; i < num; i++) {
- void *p = taosArrayGetP(pVar->arr, i);
- taosMemoryFree(p);
- }
- taosArrayDestroy(pVar->arr);
- pVar->arr = NULL;
- } else if (pVar->nType == TSDB_DATA_TYPE_VALUE_ARRAY) {
- taosArrayDestroy(pVar->arr);
- pVar->arr = NULL;
- }
}
void taosVariantAssign(SVariant *pDst, const SVariant *pSrc) {
@@ -180,28 +167,8 @@ void taosVariantAssign(SVariant *pDst, const SVariant *pSrc) {
if (IS_NUMERIC_TYPE(pSrc->nType) || (pSrc->nType == TSDB_DATA_TYPE_BOOL)) {
pDst->i = pSrc->i;
- } else if (pSrc->nType == TSDB_DATA_TYPE_POINTER_ARRAY) { // this is only for string array
- size_t num = taosArrayGetSize(pSrc->arr);
- pDst->arr = taosArrayInit(num, sizeof(char *));
- for (size_t i = 0; i < num; i++) {
- char *p = (char *)taosArrayGetP(pSrc->arr, i);
- char *n = taosStrdup(p);
- taosArrayPush(pDst->arr, &n);
- }
- } else if (pSrc->nType == TSDB_DATA_TYPE_VALUE_ARRAY) {
- size_t num = taosArrayGetSize(pSrc->arr);
- pDst->arr = taosArrayInit(num, sizeof(int64_t));
- pDst->nLen = pSrc->nLen;
- ASSERT(pSrc->nLen == num);
- for (size_t i = 0; i < num; i++) {
- int64_t *p = taosArrayGet(pSrc->arr, i);
- taosArrayPush(pDst->arr, p);
- }
}
- if (pDst->nType != TSDB_DATA_TYPE_POINTER_ARRAY && pDst->nType != TSDB_DATA_TYPE_VALUE_ARRAY) {
- pDst->nLen = tDataTypes[pDst->nType].bytes;
- }
}
int32_t taosVariantCompare(const SVariant *p1, const SVariant *p2) {
diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
index 0724fcc63a..228f301aec 100644
--- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
@@ -61,6 +61,16 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
rpcFreeCont(pRsp->pCont);
}
+void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) {
+ int32_t n = 0;
+ n += snprintf(buf + n, len - n, "%s", "{");
+ for (int i = 0; i < epSet->numOfEps; i++) {
+ n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port,
+ (i + 1 < epSet->numOfEps ? ", " : ""));
+ }
+ n += snprintf(buf + n, len - n, "%s", "}");
+}
+
void dmSendStatusReq(SDnodeMgmt *pMgmt) {
SStatusReq req = {0};
@@ -119,11 +129,10 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
dmGetMnodeEpSet(pMgmt->pData, &epSet);
rpcSendRecv(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, &rpcRsp);
if (rpcRsp.code != 0) {
- dError("failed to send status req since %s, numOfEps:%d inUse:%d", tstrerror(rpcRsp.code), epSet.numOfEps,
- epSet.inUse);
- for (int32_t i = 0; i < epSet.numOfEps; ++i) {
- dDebug("index:%d, mnode ep:%s:%u", i, epSet.eps[i].fqdn, epSet.eps[i].port);
- }
+ dmRotateMnodeEpSet(pMgmt->pData);
+ char tbuf[256];
+ dmEpSetToStr(tbuf, sizeof(tbuf), &epSet);
+ dError("failed to send status req since %s, epSet:%s, inUse:%d", tstrerror(rpcRsp.code), tbuf, epSet.inUse);
}
dmProcessStatusRsp(pMgmt, &rpcRsp);
}
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
index 5cf408a905..d7f91b74a8 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
@@ -20,6 +20,8 @@ void vmGetVnodeLoads(SVnodeMgmt *pMgmt, SMonVloadInfo *pInfo, bool isReset) {
pInfo->pVloads = taosArrayInit(pMgmt->state.totalVnodes, sizeof(SVnodeLoad));
if (pInfo->pVloads == NULL) return;
+ tfsUpdateSize(pMgmt->pTfs);
+
taosThreadRwlockRdlock(&pMgmt->lock);
void *pIter = taosHashIterate(pMgmt->hash, NULL);
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
index c1b3cde9ea..7aa1c9f56a 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
@@ -192,8 +192,8 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
taosWriteQitem(pVnode->pFetchQ, pMsg);
break;
case WRITE_QUEUE:
- if (!osDataSpaceAvailable()) {
- terrno = TSDB_CODE_NO_DISKSPACE;
+ if (!osDataSpaceSufficient()) {
+ terrno = TSDB_CODE_NO_ENOUGH_DISKSPACE;
code = terrno;
dError("vgId:%d, msg:%p put into vnode-write queue failed since %s", pVnode->vgId, pMsg, terrstr(code));
break;
diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c
index 23a047d49a..ea46b70693 100644
--- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c
+++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c
@@ -93,15 +93,15 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
break;
}
-/*
-pDnode is null, TD-22618
-at trans.c line 91
-before this line, dmProcessRpcMsg callback is set
-after this line, parent is set
-so when dmProcessRpcMsg is called, pDonde is still null.
-*/
- if (pDnode != NULL){
- if(pDnode->status != DND_STAT_RUNNING) {
+ /*
+ pDnode is null, TD-22618
+ at trans.c line 91
+ before this line, dmProcessRpcMsg callback is set
+ after this line, parent is set
+ so when dmProcessRpcMsg is called, pDonde is still null.
+ */
+ if (pDnode != NULL) {
+ if (pDnode->status != DND_STAT_RUNNING) {
if (pRpc->msgType == TDMT_DND_SERVER_STATUS) {
dmProcessServerStartupStatus(pDnode, pRpc);
return;
@@ -113,7 +113,7 @@ so when dmProcessRpcMsg is called, pDonde is still null.
}
goto _OVER;
}
- }
+ }
} else {
terrno = TSDB_CODE_APP_IS_STARTING;
goto _OVER;
@@ -304,6 +304,7 @@ int32_t dmInitClient(SDnode *pDnode) {
rpcInit.connLimitLock = 1;
rpcInit.supportBatch = 1;
rpcInit.batchSize = 8 * 1024;
+ rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
pTrans->clientRpc = rpcOpen(&rpcInit);
if (pTrans->clientRpc == NULL) {
diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h
index c2f403dfbb..cfdea40477 100644
--- a/source/dnode/mgmt/node_util/inc/dmUtil.h
+++ b/source/dnode/mgmt/node_util/inc/dmUtil.h
@@ -53,12 +53,12 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
-#define dGFatal(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);}
-#define dGError(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);}
-#define dGWarn(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn (param ", gtid:%s", __VA_ARGS__, buf);}
-#define dGInfo(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo (param ", gtid:%s", __VA_ARGS__, buf);}
-#define dGDebug(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);}
-#define dGTrace(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);}
+#define dGFatal(param, ...) {if (dDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define dGError(param, ...) {if (dDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define dGWarn(param, ...) {if (dDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define dGInfo(param, ...) {if (dDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define dGDebug(param, ...) {if (dDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define dGTrace(param, ...) {if (dDebugFlag & DEBUG_TRACE) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);}}
// clang-format on
@@ -166,6 +166,7 @@ int32_t dmReadEps(SDnodeData *pData);
int32_t dmWriteEps(SDnodeData *pData);
void dmUpdateEps(SDnodeData *pData, SArray *pDnodeEps);
void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet);
+void dmRotateMnodeEpSet(SDnodeData *pData);
void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet);
void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet);
bool dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port);
diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c
index e9ab8a0460..784d2b425b 100644
--- a/source/dnode/mgmt/node_util/src/dmEps.c
+++ b/source/dnode/mgmt/node_util/src/dmEps.c
@@ -325,6 +325,28 @@ void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) {
taosThreadRwlockUnlock(&pData->lock);
}
+static FORCE_INLINE void dmSwapEps(SEp *epLhs, SEp *epRhs) {
+ SEp epTmp;
+
+ epTmp.port = epLhs->port;
+ tstrncpy(epTmp.fqdn, epLhs->fqdn, tListLen(epTmp.fqdn));
+
+ epLhs->port = epRhs->port;
+ tstrncpy(epLhs->fqdn, epRhs->fqdn, tListLen(epLhs->fqdn));
+
+ epRhs->port = epTmp.port;
+ tstrncpy(epRhs->fqdn, epTmp.fqdn, tListLen(epRhs->fqdn));
+}
+
+void dmRotateMnodeEpSet(SDnodeData *pData) {
+ taosThreadRwlockRdlock(&pData->lock);
+ SEpSet *pEpSet = &pData->mnodeEps;
+ for (int i = 1; i < pEpSet->numOfEps; i++) {
+ dmSwapEps(&pEpSet->eps[i - 1], &pEpSet->eps[i]);
+ }
+ taosThreadRwlockUnlock(&pData->lock);
+}
+
void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet) {
dmGetMnodeEpSet(pData, pEpSet);
dTrace("msg is redirected, handle:%p num:%d use:%d", pMsg->info.handle, pEpSet->numOfEps, pEpSet->inUse);
diff --git a/source/dnode/mnode/impl/CMakeLists.txt b/source/dnode/mnode/impl/CMakeLists.txt
index 25a4397b7d..493ba48601 100644
--- a/source/dnode/mnode/impl/CMakeLists.txt
+++ b/source/dnode/mnode/impl/CMakeLists.txt
@@ -2,8 +2,9 @@ aux_source_directory(src MNODE_SRC)
IF (TD_PRIVILEGE)
ADD_DEFINITIONS(-D_PRIVILEGE)
ENDIF ()
-IF (TD_PRIVILEGE)
+IF (TD_ENTERPRISE)
LIST(APPEND MNODE_SRC ${TD_ENTERPRISE_DIR}/src/plugins/privilege/src/privilege.c)
+ LIST(APPEND MNODE_SRC ${TD_ENTERPRISE_DIR}/src/plugins/mnode/src/mndDb.c)
ENDIF ()
add_library(mnode STATIC ${MNODE_SRC})
diff --git a/source/dnode/mnode/impl/inc/mndDb.h b/source/dnode/mnode/impl/inc/mndDb.h
index 9edfd9bf3b..97d047d7a3 100644
--- a/source/dnode/mnode/impl/inc/mndDb.h
+++ b/source/dnode/mnode/impl/inc/mndDb.h
@@ -33,6 +33,8 @@ bool mndIsDbReady(SMnode *pMnode, SDbObj *pDb);
SSdbRaw *mndDbActionEncode(SDbObj *pDb);
const char *mndGetDbStr(const char *src);
+int32_t mndProcessCompactDbReq(SRpcMsg *pReq);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h
index ac0c68f652..fe2c58e29e 100644
--- a/source/dnode/mnode/impl/inc/mndDef.h
+++ b/source/dnode/mnode/impl/inc/mndDef.h
@@ -108,7 +108,8 @@ typedef enum {
TRN_STAGE_UNDO_ACTION = 3,
TRN_STAGE_COMMIT = 4,
TRN_STAGE_COMMIT_ACTION = 5,
- TRN_STAGE_FINISHED = 6
+ TRN_STAGE_FINISHED = 6,
+ TRN_STAGE_PRE_FINISH = 7
} ETrnStage;
typedef enum {
@@ -542,7 +543,7 @@ void* tDecodeSMqConsumerObj(const void* buf, SMqConsumerObj* pConsumer
typedef struct {
int32_t vgId;
- char* qmsg;
+ char* qmsg; //SubPlanToString
SEpSet epSet;
} SMqVgEp;
diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h
index d851578a74..006c74ef3d 100644
--- a/source/dnode/mnode/impl/inc/mndInt.h
+++ b/source/dnode/mnode/impl/inc/mndInt.h
@@ -41,12 +41,12 @@ extern "C" {
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
-#define mGFatal(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ", gtid:%s", __VA_ARGS__, buf);}
-#define mGError(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ", gtid:%s", __VA_ARGS__, buf);}
-#define mGWarn(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ", gtid:%s", __VA_ARGS__, buf);}
-#define mGInfo(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ", gtid:%s", __VA_ARGS__, buf);}
-#define mGDebug(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ", gtid:%s", __VA_ARGS__, buf);}
-#define mGTrace(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", gtid:%s", __VA_ARGS__, buf);}
+#define mGFatal(param, ...) { if (mDebugFlag & DEBUG_FATAL){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define mGError(param, ...) { if (mDebugFlag & DEBUG_ERROR){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define mGWarn(param, ...) { if (mDebugFlag & DEBUG_WARN){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ", gtid:%s", __VA_ARGS__, buf);}}
+#define mGInfo(param, ...) { if (mDebugFlag & DEBUG_INFO){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ", gtid:%s", __VA_ARGS__, buf);}}
+#define mGDebug(param, ...) { if (mDebugFlag & DEBUG_DEBUG){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ", gtid:%s", __VA_ARGS__, buf);}}
+#define mGTrace(param, ...) { if (mDebugFlag & DEBUG_TRACE){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", gtid:%s", __VA_ARGS__, buf);}}
// clang-format on
#define SYSTABLE_SCH_TABLE_NAME_LEN ((TSDB_TABLE_NAME_LEN - 1) + VARSTR_HEADER_SIZE)
@@ -80,7 +80,7 @@ typedef struct {
typedef struct {
TdThreadMutex lock;
- char email[TSDB_FQDN_LEN];
+ char email[TSDB_FQDN_LEN];
} STelemMgmt;
typedef struct {
diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h
index 51eb24f402..0229735952 100644
--- a/source/dnode/mnode/impl/inc/mndVgroup.h
+++ b/source/dnode/mnode/impl/inc/mndVgroup.h
@@ -43,7 +43,8 @@ int32_t mndAddDropVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVg
int32_t mndSetMoveVgroupsInfoToTrans(SMnode *, STrans *pTrans, int32_t dropDnodeId, bool force);
int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup,
SArray *pArray);
-int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs);
+int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs,
+ STimeWindow tw);
void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen);
void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen);
diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c
index 6621b6a3f9..f1ef83aca5 100644
--- a/source/dnode/mnode/impl/src/mndConsumer.c
+++ b/source/dnode/mnode/impl/src/mndConsumer.c
@@ -15,35 +15,29 @@
#define _DEFAULT_SOURCE
#include "mndConsumer.h"
-#include "mndDb.h"
-#include "mndDnode.h"
-#include "mndMnode.h"
#include "mndPrivilege.h"
#include "mndShow.h"
-#include "mndStb.h"
#include "mndSubscribe.h"
#include "mndTopic.h"
#include "mndTrans.h"
-#include "mndUser.h"
-#include "mndVgroup.h"
#include "tcompare.h"
#include "tname.h"
#define MND_CONSUMER_VER_NUMBER 1
#define MND_CONSUMER_RESERVE_SIZE 64
-#define MND_CONSUMER_LOST_HB_CNT 3
+#define MND_CONSUMER_LOST_HB_CNT 6
#define MND_CONSUMER_LOST_CLEAR_THRESHOLD 43200
-static int8_t mqRebInExecCnt = 0;
+static int32_t mqRebInExecCnt = 0;
static const char *mndConsumerStatusName(int status);
static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer);
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer);
-static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pConsumer, SMqConsumerObj *pNewConsumer);
+static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, SMqConsumerObj *pNewConsumer);
static int32_t mndProcessConsumerMetaMsg(SRpcMsg *pMsg);
-static int32_t mndRetrieveConsumer(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
+static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows);
static void mndCancelGetNextConsumer(SMnode *pMnode, void *pIter);
static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg);
@@ -82,15 +76,36 @@ int32_t mndInitConsumer(SMnode *pMnode) {
void mndCleanupConsumer(SMnode *pMnode) {}
bool mndRebTryStart() {
- int8_t old = atomic_val_compare_exchange_8(&mqRebInExecCnt, 0, 1);
+ int32_t old = atomic_val_compare_exchange_32(&mqRebInExecCnt, 0, 1);
+ mInfo("tq timer, rebalance counter old val:%d", old);
return old == 0;
}
-void mndRebEnd() { atomic_sub_fetch_8(&mqRebInExecCnt, 1); }
+void mndRebEnd() {
+ mndRebCntDec();
+}
-void mndRebCntInc() { atomic_add_fetch_8(&mqRebInExecCnt, 1); }
+void mndRebCntInc() {
+ int32_t val = atomic_add_fetch_32(&mqRebInExecCnt, 1);
+ mInfo("rebalance trans start, rebalance counter:%d", val);
+}
-void mndRebCntDec() { atomic_sub_fetch_8(&mqRebInExecCnt, 1); }
+void mndRebCntDec() {
+ while (1) {
+ int32_t val = atomic_load_32(&mqRebInExecCnt);
+ if (val <= 0) {
+ mError("rebalance trans end, rebalance counter:%d should not be less equalled than 0, ignore counter desc", val);
+ break;
+ }
+
+ int32_t newVal = val - 1;
+ int32_t oldVal = atomic_val_compare_exchange_32(&mqRebInExecCnt, val, newVal);
+ if (oldVal == val) {
+ mInfo("rebalance trans end, rebalance counter:%d", newVal);
+ break;
+ }
+ }
+}
static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg) {
SMnode *pMnode = pMsg->info.node;
@@ -209,6 +224,7 @@ static int32_t mndProcessConsumerClearMsg(SRpcMsg *pMsg) {
taosMemoryFree(pConsumerNew);
mndTransDrop(pTrans);
return 0;
+
FAIL:
tDeleteSMqConsumerObj(pConsumerNew);
taosMemoryFree(pConsumerNew);
@@ -303,6 +319,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
taosRUnLockLatch(&pConsumer->lock);
} else if (status == MQ_CONSUMER_STATUS__MODIFY) {
taosRLockLatch(&pConsumer->lock);
+
int32_t newTopicNum = taosArrayGetSize(pConsumer->rebNewTopics);
for (int32_t i = 0; i < newTopicNum; i++) {
char key[TSDB_SUBSCRIBE_KEY_LEN];
@@ -339,7 +356,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
} else {
taosHashCleanup(pRebMsg->rebSubHash);
rpcFreeCont(pRebMsg);
- mTrace("mq rebalance finished, no modification");
+ mInfo("mq rebalance finished, no modification");
mndRebEnd();
}
return 0;
@@ -580,6 +597,10 @@ static int32_t validateTopics(const SArray* pTopicList, SMnode* pMnode, const ch
return 0;
}
+static void* topicNameDup(void* p){
+ return taosStrdup((char*) p);
+}
+
int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
SMnode *pMnode = pMsg->info.node;
char *msgStr = pMsg->pCont;
@@ -612,19 +633,21 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
pExistedConsumer = mndAcquireConsumer(pMnode, consumerId);
if (pExistedConsumer == NULL) {
- mInfo("receive subscribe request from new consumer:0x%" PRIx64" cgroup:%s", consumerId, subscribe.cgroup);
+ 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, 256);
- pConsumerNew->updateType = CONSUMER_UPDATE__MODIFY;
- taosArrayDestroy(pConsumerNew->rebNewTopics);
- pConsumerNew->rebNewTopics = pTopicList; // all subscribe topics should re-balance.
- subscribe.topicNames = NULL;
+ tstrncpy(pConsumerNew->clientId, subscribe.clientId, tListLen(pConsumerNew->clientId));
- for (int32_t i = 0; i < newTopicNum; i++) {
- char *newTopicCopy = taosStrdup(taosArrayGetP(pTopicList, i));
- taosArrayPush(pConsumerNew->assignedTopics, &newTopicCopy);
- }
+ // set the update type
+ pConsumerNew->updateType = CONSUMER_UPDATE__MODIFY;
+ taosArrayDestroy(pConsumerNew->assignedTopics);
+ pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup);
+
+ // all subscribed topics should re-balance.
+ taosArrayDestroy(pConsumerNew->rebNewTopics);
+ pConsumerNew->rebNewTopics = pTopicList;
+ subscribe.topicNames = NULL;
if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) goto _over;
if (mndTransPrepare(pMnode, pTrans) != 0) goto _over;
@@ -646,17 +669,12 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
goto _over;
}
+ // set the update type
pConsumerNew->updateType = CONSUMER_UPDATE__MODIFY;
+ taosArrayDestroy(pConsumerNew->assignedTopics);
+ pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup);
- for (int32_t i = 0; i < newTopicNum; i++) {
- char *newTopicCopy = taosStrdup(taosArrayGetP(pTopicList, i));
- taosArrayPush(pConsumerNew->assignedTopics, &newTopicCopy);
- }
-
- int32_t oldTopicNum = 0;
- if (pExistedConsumer->currentTopics) {
- oldTopicNum = taosArrayGetSize(pExistedConsumer->currentTopics);
- }
+ int32_t oldTopicNum = (pExistedConsumer->currentTopics)? taosArrayGetSize(pExistedConsumer->currentTopics):0;
int32_t i = 0, j = 0;
while (i < oldTopicNum || j < newTopicNum) {
@@ -692,11 +710,8 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
}
}
- if (pExistedConsumer && taosArrayGetSize(pConsumerNew->rebNewTopics) == 0 &&
- taosArrayGetSize(pConsumerNew->rebRemovedTopics) == 0) {
- /*if (taosArrayGetSize(pConsumerNew->assignedTopics) == 0) {*/
- /*pConsumerNew->updateType = */
- /*}*/
+ // no topics need to be rebalanced
+ if (taosArrayGetSize(pConsumerNew->rebNewTopics) == 0 && taosArrayGetSize(pConsumerNew->rebRemovedTopics) == 0) {
goto _over;
}
@@ -718,8 +733,9 @@ _over:
tDeleteSMqConsumerObj(pConsumerNew);
taosMemoryFree(pConsumerNew);
}
+
// TODO: replace with destroy subscribe msg
- if (subscribe.topicNames) taosArrayDestroyP(subscribe.topicNames, (FDelete)taosMemoryFree);
+ taosArrayDestroyP(subscribe.topicNames, (FDelete)taosMemoryFree);
return code;
}
@@ -750,12 +766,12 @@ SSdbRaw *mndConsumerActionEncode(SMqConsumerObj *pConsumer) {
CM_ENCODE_OVER:
taosMemoryFreeClear(buf);
if (terrno != 0) {
- mError("consumer:%" PRId64 ", failed to encode to raw:%p since %s", pConsumer->consumerId, pRaw, terrstr());
+ mError("consumer:0x%" PRIx64 " failed to encode to raw:%p since %s", pConsumer->consumerId, pRaw, terrstr());
sdbFreeRaw(pRaw);
return NULL;
}
- mTrace("consumer:%" PRId64 ", encode to raw:%p, row:%p", pConsumer->consumerId, pRaw, pConsumer);
+ mTrace("consumer:0x%" PRIx64 ", encode to raw:%p, row:%p", pConsumer->consumerId, pRaw, pConsumer);
return pRaw;
}
@@ -823,8 +839,8 @@ static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer) {
}
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer) {
- mDebug("consumer:0x%" PRIx64 " perform delete action, status:%s", pConsumer->consumerId,
- mndConsumerStatusName(pConsumer->status));
+ mDebug("consumer:0x%" PRIx64 " perform delete action, status:(%d)%s", pConsumer->consumerId,
+ pConsumer->status, mndConsumerStatusName(pConsumer->status));
tDeleteSMqConsumerObj(pConsumer);
return 0;
}
@@ -950,8 +966,9 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
pOldConsumer->rebalanceTime = pNewConsumer->upTime;
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
- mDebug("consumer:0x%" PRIx64 " state %s -> %s, new epoch:%d, reb-time:%" PRId64 ", current topics:%d",
- pOldConsumer->consumerId, mndConsumerStatusName(status), mndConsumerStatusName(pOldConsumer->status),
+ mDebug("consumer:0x%" PRIx64 " state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64 ", current topics:%d",
+ pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
+ mndConsumerStatusName(pOldConsumer->status),
pOldConsumer->epoch, pOldConsumer->rebalanceTime, (int)taosArrayGetSize(pOldConsumer->currentTopics));
} else if (pNewConsumer->updateType == CONSUMER_UPDATE__REMOVE) {
/*A(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);*/
@@ -1009,8 +1026,9 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
pOldConsumer->rebalanceTime = pNewConsumer->upTime;
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
- mDebug("consumer:0x%" PRIx64 " state %s -> %s, new epoch:%d, reb-time:%" PRId64 ", current topics:%d",
- pOldConsumer->consumerId, mndConsumerStatusName(status), mndConsumerStatusName(pOldConsumer->status),
+ mDebug("consumer:0x%" PRIx64 " state %d(%s) -> %d(%s), new epoch:%d, reb-time:%" PRId64 ", current topics:%d",
+ pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
+ mndConsumerStatusName(pOldConsumer->status),
pOldConsumer->epoch, pOldConsumer->rebalanceTime, (int)taosArrayGetSize(pOldConsumer->currentTopics));
}
@@ -1051,7 +1069,6 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
}
taosRLockLatch(&pConsumer->lock);
-
mDebug("showing consumer:0x%" PRIx64, pConsumer->consumerId);
int32_t topicSz = taosArrayGetSize(pConsumer->assignedTopics);
@@ -1075,22 +1092,23 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
// consumer group
char cgroup[TSDB_CGROUP_LEN + VARSTR_HEADER_SIZE] = {0};
- tstrncpy(varDataVal(cgroup), pConsumer->cgroup, TSDB_CGROUP_LEN);
- varDataSetLen(cgroup, strlen(varDataVal(cgroup)));
+ STR_TO_VARSTR(cgroup, pConsumer->cgroup);
+
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)cgroup, false);
// client id
char clientId[256 + VARSTR_HEADER_SIZE] = {0};
- tstrncpy(varDataVal(clientId), pConsumer->clientId, 256);
- varDataSetLen(clientId, strlen(varDataVal(clientId)));
+ STR_TO_VARSTR(clientId, pConsumer->clientId);
+
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)clientId, false);
// status
char status[20 + VARSTR_HEADER_SIZE] = {0};
- tstrncpy(varDataVal(status), mndConsumerStatusName(pConsumer->status), 20);
- varDataSetLen(status, strlen(varDataVal(status)));
+ const char* pStatusName = mndConsumerStatusName(pConsumer->status);
+ STR_TO_VARSTR(status, pStatusName);
+
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)status, false);
@@ -1123,8 +1141,11 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
numOfRows++;
}
+
taosRUnLockLatch(&pConsumer->lock);
sdbRelease(pSdb, pConsumer);
+
+ pBlock->info.rows = numOfRows;
}
pShow->numOfRows += numOfRows;
diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c
index 3efd8fb249..af76971304 100644
--- a/source/dnode/mnode/impl/src/mndDb.c
+++ b/source/dnode/mnode/impl/src/mndDb.c
@@ -41,12 +41,15 @@ static int32_t mndProcessCreateDbReq(SRpcMsg *pReq);
static int32_t mndProcessAlterDbReq(SRpcMsg *pReq);
static int32_t mndProcessDropDbReq(SRpcMsg *pReq);
static int32_t mndProcessUseDbReq(SRpcMsg *pReq);
-static int32_t mndProcessCompactDbReq(SRpcMsg *pReq);
static int32_t mndProcessTrimDbReq(SRpcMsg *pReq);
static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity);
static void mndCancelGetNextDb(SMnode *pMnode, void *pIter);
static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq);
+#ifndef TD_ENTERPRISE
+int32_t mndProcessCompactDbReq(SRpcMsg *pReq) { return TSDB_CODE_OPS_NOT_SUPPORT; }
+#endif
+
int32_t mndInitDb(SMnode *pMnode) {
SSdbTable table = {
.sdbType = SDB_DB,
@@ -884,12 +887,19 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) {
cfgRsp.minRows = pDb->cfg.minRows;
cfgRsp.maxRows = pDb->cfg.maxRows;
cfgRsp.walFsyncPeriod = pDb->cfg.walFsyncPeriod;
+ cfgRsp.hashPrefix = pDb->cfg.hashPrefix;
+ cfgRsp.hashSuffix = pDb->cfg.hashSuffix;
cfgRsp.walLevel = pDb->cfg.walLevel;
cfgRsp.precision = pDb->cfg.precision;
cfgRsp.compression = pDb->cfg.compression;
cfgRsp.replications = pDb->cfg.replications;
cfgRsp.strict = pDb->cfg.strict;
cfgRsp.cacheLast = pDb->cfg.cacheLast;
+ cfgRsp.tsdbPageSize = pDb->cfg.tsdbPageSize;
+ cfgRsp.walRetentionPeriod = pDb->cfg.walRetentionPeriod;
+ cfgRsp.walRollPeriod = pDb->cfg.walRollPeriod;
+ cfgRsp.walRetentionSize = pDb->cfg.walRetentionSize;
+ cfgRsp.walSegmentSize = pDb->cfg.walSegmentSize;
cfgRsp.numOfRetensions = pDb->cfg.numOfRetensions;
cfgRsp.pRetensions = pDb->cfg.pRetensions;
cfgRsp.schemaless = pDb->cfg.schemaless;
@@ -1395,98 +1405,6 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs,
return 0;
}
-static int32_t mndSetCompactDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, int64_t compactTs) {
- SDbObj dbObj = {0};
- memcpy(&dbObj, pDb, sizeof(SDbObj));
- dbObj.compactStartTime = compactTs;
-
- SSdbRaw *pCommitRaw = mndDbActionEncode(&dbObj);
- if (pCommitRaw == NULL) return -1;
- if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) {
- sdbFreeRaw(pCommitRaw);
- return -1;
- }
-
- (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY);
- return 0;
-}
-
-static int32_t mndSetCompactDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, int64_t compactTs) {
- SSdb *pSdb = pMnode->pSdb;
- void *pIter = NULL;
-
- while (1) {
- SVgObj *pVgroup = NULL;
- pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup);
- if (pIter == NULL) break;
-
- if (mndVgroupInDb(pVgroup, pDb->uid)) {
- if (mndBuildCompactVgroupAction(pMnode, pTrans, pDb, pVgroup, compactTs) != 0) {
- sdbCancelFetch(pSdb, pIter);
- sdbRelease(pSdb, pVgroup);
- return -1;
- }
- }
-
- sdbRelease(pSdb, pVgroup);
- }
-
- return 0;
-}
-
-static int32_t mndCompactDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb) {
- int64_t compactTs = taosGetTimestampMs();
- int32_t code = -1;
- STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB, pReq, "compact-db");
- if (pTrans == NULL) goto _OVER;
-
- mInfo("trans:%d, used to compact db:%s", pTrans->id, pDb->name);
- mndTransSetDbName(pTrans, pDb->name, NULL);
- if (mndTrancCheckConflict(pMnode, pTrans) != 0) goto _OVER;
- if (mndSetCompactDbCommitLogs(pMnode, pTrans, pDb, compactTs) != 0) goto _OVER;
- if (mndSetCompactDbRedoActions(pMnode, pTrans, pDb, compactTs) != 0) goto _OVER;
- if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER;
- code = 0;
-
-_OVER:
- mndTransDrop(pTrans);
- return code;
-}
-
-static int32_t mndProcessCompactDbReq(SRpcMsg *pReq) {
- SMnode *pMnode = pReq->info.node;
- int32_t code = -1;
- SDbObj *pDb = NULL;
- SCompactDbReq compactReq = {0};
-
- if (tDeserializeSCompactDbReq(pReq->pCont, pReq->contLen, &compactReq) != 0) {
- terrno = TSDB_CODE_INVALID_MSG;
- goto _OVER;
- }
-
- mInfo("db:%s, start to compact", compactReq.db);
-
- pDb = mndAcquireDb(pMnode, compactReq.db);
- if (pDb == NULL) {
- goto _OVER;
- }
-
- if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_COMPACT_DB, pDb) != 0) {
- goto _OVER;
- }
-
- code = mndCompactDb(pMnode, pReq, pDb);
- if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS;
-
-_OVER:
- if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
- mError("db:%s, failed to process compact db req since %s", compactReq.db, terrstr());
- }
-
- mndReleaseDb(pMnode, pDb);
- return code;
-}
-
static int32_t mndTrimDb(SMnode *pMnode, SDbObj *pDb) {
SSdb *pSdb = pMnode->pSdb;
SVgObj *pVgroup = NULL;
diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c
index 5dd1742e5e..1d9db37a7d 100644
--- a/source/dnode/mnode/impl/src/mndDnode.c
+++ b/source/dnode/mnode/impl/src/mndDnode.c
@@ -1074,6 +1074,9 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->createdTime, false);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->rebootTime, false);
+
char *b = taosMemoryCalloc(VARSTR_HEADER_SIZE + strlen(offlineReason[pDnode->offlineReason]) + 1, 1);
STR_TO_VARSTR(b, online ? "" : offlineReason[pDnode->offlineReason]);
diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c
index 53a5548b2f..d83b969e2d 100644
--- a/source/dnode/mnode/impl/src/mndMain.c
+++ b/source/dnode/mnode/impl/src/mndMain.c
@@ -344,8 +344,8 @@ static int32_t mndInitWal(SMnode *pMnode) {
.fsyncPeriod = 0,
.rollPeriod = -1,
.segSize = -1,
- .retentionPeriod = -1,
- .retentionSize = -1,
+ .retentionPeriod = 0,
+ .retentionSize = 0,
.level = TAOS_WAL_FSYNC,
};
@@ -370,7 +370,6 @@ static int32_t mndInitSdb(SMnode *pMnode) {
opt.path = pMnode->path;
opt.pMnode = pMnode;
opt.pWal = pMnode->pWal;
- opt.sync = pMnode->syncMgmt.sync;
pMnode->pSdb = sdbInit(&opt);
if (pMnode->pSdb == NULL) {
@@ -552,16 +551,7 @@ void mndPreClose(SMnode *pMnode) {
if (pMnode != NULL) {
syncLeaderTransfer(pMnode->syncMgmt.sync);
syncPreStop(pMnode->syncMgmt.sync);
-#if 0
- while (syncSnapshotRecving(pMnode->syncMgmt.sync)) {
- mInfo("vgId:1, snapshot is recving");
- taosMsleep(300);
- }
- while (syncSnapshotSending(pMnode->syncMgmt.sync)) {
- mInfo("vgId:1, snapshot is sending");
- taosMsleep(300);
- }
-#endif
+ sdbWriteFile(pMnode->pSdb, 0);
}
}
@@ -716,6 +706,9 @@ int32_t mndProcessRpcMsg(SRpcMsg *pMsg) {
} else if (code == 0) {
mGTrace("msg:%p, successfully processed", pMsg);
} else {
+ if (code == -1) {
+ code = terrno;
+ }
mGError("msg:%p, failed to process since %s, app:%p type:%s", pMsg, tstrerror(code), pMsg->info.ahandle,
TMSG_INFO(pMsg->msgType));
}
diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c
index aada00296e..50fab447e3 100644
--- a/source/dnode/mnode/impl/src/mndMnode.c
+++ b/source/dnode/mnode/impl/src/mndMnode.c
@@ -644,6 +644,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->createdTime, false);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->stateStartTime, false);
+
numOfRows++;
sdbRelease(pSdb, pObj);
}
diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c
index 41dc57f32e..41dea50731 100644
--- a/source/dnode/mnode/impl/src/mndProfile.c
+++ b/source/dnode/mnode/impl/src/mndProfile.c
@@ -24,7 +24,7 @@
#include "mndStb.h"
#include "mndUser.h"
#include "tglobal.h"
-#include "version.h"
+#include "tversion.h"
typedef struct {
uint32_t id;
@@ -221,11 +221,18 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
char ip[24] = {0};
const STraceId *trace = &pReq->info.traceId;
- if (tDeserializeSConnectReq(pReq->pCont, pReq->contLen, &connReq) != 0) {
- terrno = TSDB_CODE_INVALID_MSG;
+ if ((code = tDeserializeSConnectReq(pReq->pCont, pReq->contLen, &connReq)) != 0) {
+ terrno = (-1 == code ? TSDB_CODE_INVALID_MSG : code);
goto _OVER;
}
+ if ((code = taosCheckVersionCompatibleFromStr(connReq.sVer, version, 2)) != 0) {
+ terrno = code;
+ goto _OVER;
+ }
+
+ code = -1;
+
taosIp2String(pReq->info.conn.clientIp, ip);
if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CONNECT) != 0) {
mGError("user:%s, failed to login from %s since %s", pReq->info.conn.user, ip, terrstr());
diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c
index 39ee443e51..d1671aa12a 100644
--- a/source/dnode/mnode/impl/src/mndScheduler.c
+++ b/source/dnode/mnode/impl/src/mndScheduler.c
@@ -115,7 +115,7 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream
if (pStream->fixedSinkVgId == 0) {
SDbObj* pDb = mndAcquireDb(pMnode, pStream->targetDb);
- if (pDb->cfg.numOfVgroups > 1) {
+ if (pDb != NULL && pDb->cfg.numOfVgroups > 1) {
isShuffle = true;
pTask->outputType = TASK_OUTPUT__SHUFFLE_DISPATCH;
pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH;
diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c
index 48d8e89bfe..7fe08514f6 100644
--- a/source/dnode/mnode/impl/src/mndShow.c
+++ b/source/dnode/mnode/impl/src/mndShow.c
@@ -134,7 +134,7 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SRetrieveTableReq *pReq) {
showObj.pMnode = pMnode;
showObj.type = convertToRetrieveType(pReq->tb, tListLen(pReq->tb));
memcpy(showObj.db, pReq->db, TSDB_DB_FNAME_LEN);
- strncpy(showObj.filterTb, pReq->filterTb, TSDB_TABLE_NAME_LEN);
+ tstrncpy(showObj.filterTb, pReq->filterTb, TSDB_TABLE_NAME_LEN);
int32_t keepTime = tsShellActivityTimer * 6 * 1000;
SShowObj *pShow = taosCachePut(pMgmt->cache, &showId, sizeof(int64_t), &showObj, size, keepTime);
diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c
index 2a05511134..b7f80f6b0e 100644
--- a/source/dnode/mnode/impl/src/mndStream.c
+++ b/source/dnode/mnode/impl/src/mndStream.c
@@ -1223,7 +1223,7 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
// node id
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- int32_t nodeId = TMAX(pTask->nodeId, 0);
+ int64_t nodeId = TMAX(pTask->nodeId, 0);
colDataSetVal(pColInfo, numOfRows, (const char *)&nodeId, false);
// level
diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c
index 8d8fd1b9b5..4d19110f31 100644
--- a/source/dnode/mnode/impl/src/mndSubscribe.c
+++ b/source/dnode/mnode/impl/src/mndSubscribe.c
@@ -16,15 +16,10 @@
#define _DEFAULT_SOURCE
#include "mndSubscribe.h"
#include "mndConsumer.h"
-#include "mndDb.h"
-#include "mndDnode.h"
-#include "mndMnode.h"
#include "mndScheduler.h"
#include "mndShow.h"
-#include "mndStb.h"
#include "mndTopic.h"
#include "mndTrans.h"
-#include "mndUser.h"
#include "mndVgroup.h"
#include "tcompare.h"
#include "tname.h"
@@ -229,7 +224,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.pVgEp = pVgEp,
};
taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg));
- mInfo("sub:%s mq re-balance remove vgId:%d from consumer:%" PRId64, sub, pVgEp->vgId, consumerId);
+ mInfo("sub:%s mq re-balance remove vgId:%d from consumer:%" PRIx64, sub, pVgEp->vgId, consumerId);
}
taosArrayDestroy(pConsumerEp->vgs);
taosHashRemove(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t));
@@ -268,7 +263,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
imbConsumerNum = totalVgNum % afterRebConsumerNum;
}
- mInfo("sub:%s mq re-balance %d consumers: at least %d vg each, %d consumer has more vg", sub,
+ mInfo("sub:%s mq re-balance %d consumers: at least %d vgs each, %d consumers has more vgs", sub,
afterRebConsumerNum, minVgCnt, imbConsumerNum);
// 4. first scan: remove consumer more than wanted, put to remove hash
@@ -301,7 +296,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.pVgEp = pVgEp,
};
taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg));
- mInfo("sub:%s mq rebalance remove vgId:%d from consumer:%" PRId64 ",(first scan)", sub, pVgEp->vgId,
+ mInfo("sub:%s mq rebalance remove vgId:%d from consumer:0x%" PRIx64 ",(first scan)", sub, pVgEp->vgId,
pConsumerEp->consumerId);
}
imbCnt++;
@@ -316,7 +311,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.pVgEp = pVgEp,
};
taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg));
- mInfo("sub:%s mq rebalance remove vgId:%d from consumer:%" PRId64 ",(first scan)", sub, pVgEp->vgId,
+ mInfo("sub:%s mq rebalance remove vgId:%d from consumer:0x%" PRIx64 ",(first scan)", sub, pVgEp->vgId,
pConsumerEp->consumerId);
}
}
@@ -334,7 +329,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
newConsumerEp.vgs = taosArrayInit(0, sizeof(void *));
taosHashPut(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t), &newConsumerEp, sizeof(SMqConsumerEp));
taosArrayPush(pOutput->newConsumers, &consumerId);
- mInfo("sub:%s mq rebalance add new consumer:%" PRId64, sub, consumerId);
+ mInfo("sub:%s mq rebalance add new consumer:%" PRIx64, sub, consumerId);
}
}
@@ -362,7 +357,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp);
pRebVg->newConsumerId = pConsumerEp->consumerId;
taosArrayPush(pOutput->rebVgs, pRebVg);
- mInfo("mq rebalance: add vgId:%d to consumer:%" PRId64 " (second scan) (not enough)", pRebVg->pVgEp->vgId,
+ mInfo("mq rebalance: add vgId:%d to consumer:%" PRIx64 " (second scan) (not enough)", pRebVg->pVgEp->vgId,
pConsumerEp->consumerId);
}
}
@@ -392,12 +387,12 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
taosArrayPush(pConsumerEp->vgs, &pRebVg->pVgEp);
pRebVg->newConsumerId = pConsumerEp->consumerId;
if (pRebVg->newConsumerId == pRebVg->oldConsumerId) {
- mInfo("mq rebalance: skip vg %d for same consumer:%" PRId64 " (second scan)", pRebVg->pVgEp->vgId,
+ mInfo("mq rebalance: skip vg %d for same consumer:%" PRIx64 " (second scan)", pRebVg->pVgEp->vgId,
pConsumerEp->consumerId);
continue;
}
taosArrayPush(pOutput->rebVgs, pRebVg);
- mInfo("mq rebalance: add vgId:%d to consumer:%" PRId64 " (second scan) (unassigned)", pRebVg->pVgEp->vgId,
+ mInfo("mq rebalance: add vgId:%d to consumer:%" PRIx64 " (second scan) (unassigned)", pRebVg->pVgEp->vgId,
pConsumerEp->consumerId);
}
} else {
@@ -432,10 +427,10 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
if (pIter == NULL) break;
SMqConsumerEp *pConsumerEp = (SMqConsumerEp *)pIter;
int32_t sz = taosArrayGetSize(pConsumerEp->vgs);
- mInfo("sub:%s mq re-balance final cfg: consumer:0x%" PRId64 " has %d vg", sub, pConsumerEp->consumerId, sz);
+ mInfo("sub:%s mq re-balance final cfg: consumer:0x%" PRIx64 " has %d vg", sub, pConsumerEp->consumerId, sz);
for (int32_t i = 0; i < sz; i++) {
SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, i);
- mInfo("sub:%s mq re-balance final cfg: vg %d to consumer:0x%" PRId64, sub, pVgEp->vgId,
+ mInfo("sub:%s mq re-balance final cfg: vg %d to consumer:0x%" PRIx64, sub, pVgEp->vgId,
pConsumerEp->consumerId);
}
}
@@ -449,7 +444,9 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOutputObj *pOutput) {
STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pMsg, "tmq-reb");
- if (pTrans == NULL) return -1;
+ if (pTrans == NULL) {
+ return -1;
+ }
mndTransSetDbName(pTrans, pOutput->pSub->dbName, NULL);
if (mndTrancCheckConflict(pMnode, pTrans) != 0) {
@@ -596,13 +593,13 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
rebOutput.pSub = mndCreateSubscription(pMnode, pTopic, pRebInfo->key);
if (rebOutput.pSub == NULL) {
- mError("mq rebalance %s failed create sub since %s, abort", pRebInfo->key, terrstr());
+ mError("mq rebalance %s failed create sub since %s, ignore", pRebInfo->key, terrstr());
taosRUnLockLatch(&pTopic->lock);
mndReleaseTopic(pMnode, pTopic);
continue;
}
- memcpy(rebOutput.pSub->dbName, pTopic->db, TSDB_DB_FNAME_LEN);
+ memcpy(rebOutput.pSub->dbName, pTopic->db, TSDB_DB_FNAME_LEN);
taosRUnLockLatch(&pTopic->lock);
mndReleaseTopic(pMnode, pTopic);
@@ -621,9 +618,9 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
// if add more consumer to balanced subscribe,
// possibly no vg is changed
-
+ // when each topic is re-balanced, issue an trans to save the results in sdb.
if (mndPersistRebResult(pMnode, pMsg, &rebOutput) < 0) {
- mError("mq re-balance persist re-balance output error, possibly vnode splitted or dropped");
+ mError("mq re-balance persist output error, possibly vnode splitted or dropped");
}
taosArrayDestroy(pRebInfo->lostConsumers);
@@ -775,7 +772,7 @@ static SSdbRow *mndSubActionDecode(SSdbRaw *pRaw) {
if (pSub->unassignedVgs != NULL) {
int32_t size = (int32_t)taosArrayGetSize(pSub->unassignedVgs);
for (int32_t i = 0; i < size; ++i) {
- SMqVgEp *pMqVgEp = taosArrayGet(pSub->unassignedVgs, i);
+ SMqVgEp *pMqVgEp = (SMqVgEp *)taosArrayGetP(pSub->unassignedVgs, i);
tmsgUpdateDnodeEpSet(&pMqVgEp->epSet);
}
}
@@ -785,7 +782,7 @@ static SSdbRow *mndSubActionDecode(SSdbRaw *pRaw) {
SMqConsumerEp *pConsumerEp = pIter;
int32_t size = (int32_t)taosArrayGetSize(pConsumerEp->vgs);
for (int32_t i = 0; i < size; ++i) {
- SMqVgEp *pMqVgEp = taosArrayGet(pConsumerEp->vgs, i);
+ SMqVgEp *pMqVgEp = (SMqVgEp *)taosArrayGetP(pConsumerEp->vgs, i);
tmsgUpdateDnodeEpSet(&pMqVgEp->epSet);
}
pIter = taosHashIterate(pSub->consumerHash, pIter);
@@ -1022,7 +1019,7 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pConsumerEp->consumerId, false);
- mDebug("mnd show subscriptions: topic %s, consumer %" PRId64 " cgroup %s vgid %d", varDataVal(topic),
+ mDebug("mnd show subscriptions: topic %s, consumer:%" PRIx64 " cgroup %s vgid %d", varDataVal(topic),
pConsumerEp->consumerId, varDataVal(cgroup), pVgEp->vgId);
// offset
@@ -1041,7 +1038,6 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
}
// do not show for cleared subscription
-#if 1
int32_t sz = taosArrayGetSize(pSub->unassignedVgs);
for (int32_t i = 0; i < sz; i++) {
SMqVgEp *pVgEp = taosArrayGetP(pSub->unassignedVgs, i);
@@ -1087,8 +1083,6 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
numOfRows++;
}
-#endif
-
pBlock->info.rows = numOfRows;
taosRUnLockLatch(&pSub->lock);
diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c
index f618b8afae..f702d8f148 100644
--- a/source/dnode/mnode/impl/src/mndSync.c
+++ b/source/dnode/mnode/impl/src/mndSync.c
@@ -118,12 +118,12 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta
transId, pTrans->createdTime, pMgmt->transId);
mndTransExecute(pMnode, pTrans, false);
mndReleaseTrans(pMnode, pTrans);
- // sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
} else {
mError("trans:%d, not found while execute in mnode since %s", transId, terrstr());
}
}
+ sdbWriteFile(pMnode->pSdb, tsMndSdbWriteDelta);
return 0;
}
@@ -319,6 +319,7 @@ int32_t mndInitSync(SMnode *pMnode) {
mError("failed to open sync since %s", terrstr());
return -1;
}
+ pMnode->pSdb->sync = pMgmt->sync;
mInfo("mnode-sync is opened, id:%" PRId64, pMgmt->sync);
return 0;
diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c
index a34dfff4d6..39b4252618 100644
--- a/source/dnode/mnode/impl/src/mndTrans.c
+++ b/source/dnode/mnode/impl/src/mndTrans.c
@@ -460,6 +460,8 @@ static const char *mndTransStr(ETrnStage stage) {
return "commitAction";
case TRN_STAGE_FINISHED:
return "finished";
+ case TRN_STAGE_PRE_FINISH:
+ return "pre-finish";
default:
return "invalid";
}
@@ -503,14 +505,15 @@ static TransCbFp mndTransGetCbFp(ETrnFunc ftype) {
}
static int32_t mndTransActionInsert(SSdb *pSdb, STrans *pTrans) {
- mTrace("trans:%d, perform insert action, row:%p stage:%s", pTrans->id, pTrans, mndTransStr(pTrans->stage));
+ 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);
if (fp) {
(*fp)(pSdb->pMnode, pTrans->param, pTrans->paramLen);
}
- pTrans->startFunc = 0;
+ // pTrans->startFunc = 0;
}
return 0;
@@ -546,14 +549,15 @@ static void mndTransDropData(STrans *pTrans) {
}
static int32_t mndTransActionDelete(SSdb *pSdb, STrans *pTrans, bool callFunc) {
- mTrace("trans:%d, perform delete action, row:%p stage:%s callfunc:%d", pTrans->id, pTrans, mndTransStr(pTrans->stage),
- callFunc);
+ mInfo("trans:%d, perform delete action, row:%p stage:%s callfunc:%d, stopFunc:%d", pTrans->id, pTrans,
+ mndTransStr(pTrans->stage), callFunc, pTrans->stopFunc);
+
if (pTrans->stopFunc > 0 && callFunc) {
TransCbFp fp = mndTransGetCbFp(pTrans->stopFunc);
if (fp) {
(*fp)(pSdb->pMnode, pTrans->param, pTrans->paramLen);
}
- pTrans->stopFunc = 0;
+ // pTrans->stopFunc = 0;
}
mndTransDropData(pTrans);
@@ -572,7 +576,7 @@ static void mndTransUpdateActions(SArray *pOldArray, SArray *pNewArray) {
}
static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
- mTrace("trans:%d, perform update action, old row:%p stage:%s create:%" PRId64 ", new row:%p stage:%s create:%" PRId64,
+ 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);
@@ -598,10 +602,15 @@ static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
}
if (pOld->stage == TRN_STAGE_ROLLBACK) {
- pOld->stage = TRN_STAGE_REDO_ACTION;
+ pOld->stage = TRN_STAGE_UNDO_ACTION;
mTrace("trans:%d, stage from rollback to undoAction since perform update action", pNew->id);
}
+ if (pOld->stage == TRN_STAGE_PRE_FINISH) {
+ pOld->stage = TRN_STAGE_FINISHED;
+ mTrace("trans:%d, stage from pre-finish to finished since perform update action", pNew->id);
+ }
+
return 0;
}
@@ -866,6 +875,7 @@ 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());
@@ -931,6 +941,16 @@ static int32_t mndTransRollback(SMnode *pMnode, STrans *pTrans) {
return 0;
}
+static int32_t mndTransPreFinish(SMnode *pMnode, STrans *pTrans) {
+ mInfo("trans:%d, pre-finish transaction", pTrans->id);
+ if (mndTransSync(pMnode, pTrans) != 0) {
+ mError("trans:%d, failed to pre-finish since %s", pTrans->id, terrstr());
+ return -1;
+ }
+ mInfo("trans:%d, pre-finish finished", pTrans->id);
+ return 0;
+}
+
static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
bool sendRsp = false;
int32_t code = pTrans->code;
@@ -1437,7 +1457,7 @@ static bool mndTransPerformCommitActionStage(SMnode *pMnode, STrans *pTrans) {
if (code == 0) {
pTrans->code = 0;
- pTrans->stage = TRN_STAGE_FINISHED;
+ 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 {
@@ -1455,8 +1475,8 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) {
int32_t code = mndTransExecuteUndoActions(pMnode, pTrans);
if (code == 0) {
- pTrans->stage = TRN_STAGE_FINISHED;
- mInfo("trans:%d, stage from undoAction to finished", pTrans->id);
+ pTrans->stage = TRN_STAGE_PRE_FINISH;
+ mInfo("trans:%d, stage from undoAction to pre-finish", pTrans->id);
continueExec = true;
} else if (code == TSDB_CODE_ACTION_IN_PROGRESS) {
mInfo("trans:%d, stage keep on undoAction since %s", pTrans->id, tstrerror(code));
@@ -1489,6 +1509,25 @@ static bool mndTransPerformRollbackStage(SMnode *pMnode, STrans *pTrans) {
return continueExec;
}
+static bool mndTransPerfromPreFinishedStage(SMnode *pMnode, STrans *pTrans) {
+ if (mndCannotExecuteTransAction(pMnode)) return false;
+
+ bool continueExec = true;
+ int32_t code = mndTransPreFinish(pMnode, pTrans);
+
+ if (code == 0) {
+ pTrans->stage = TRN_STAGE_FINISHED;
+ mInfo("trans:%d, stage from pre-finish to finish", pTrans->id);
+ continueExec = true;
+ } else {
+ pTrans->failedTimes++;
+ mError("trans:%d, stage keep on pre-finish since %s, failedTimes:%d", pTrans->id, terrstr(), pTrans->failedTimes);
+ continueExec = false;
+ }
+
+ return continueExec;
+}
+
static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
bool continueExec = false;
@@ -1545,6 +1584,14 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans, bool isLeader) {
case TRN_STAGE_UNDO_ACTION:
continueExec = mndTransPerformUndoActionStage(pMnode, pTrans);
break;
+ case TRN_STAGE_PRE_FINISH:
+ if (isLeader) {
+ continueExec = mndTransPerfromPreFinishedStage(pMnode, pTrans);
+ } else {
+ mInfo("trans:%d, can not pre-finish since not leader", pTrans->id);
+ continueExec = false;
+ }
+ break;
case TRN_STAGE_FINISHED:
continueExec = mndTransPerfromFinishedStage(pMnode, pTrans);
break;
@@ -1645,8 +1692,6 @@ void mndTransPullup(SMnode *pMnode) {
}
mndReleaseTrans(pMnode, pTrans);
}
-
- sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
taosArrayDestroy(pArray);
}
diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c
index b7bcaf41fd..b5d9353b68 100644
--- a/source/dnode/mnode/impl/src/mndVgroup.c
+++ b/source/dnode/mnode/impl/src/mndVgroup.c
@@ -2209,11 +2209,12 @@ _OVER:
bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid) { return !pVgroup->isTsma && pVgroup->dbUid == dbUid; }
-static void *mndBuildCompactVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen,
- int64_t compactTs) {
+static void *mndBuildCompactVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen, int64_t compactTs,
+ STimeWindow tw) {
SCompactVnodeReq compactReq = {0};
compactReq.dbUid = pDb->uid;
compactReq.compactStartTime = compactTs;
+ compactReq.tw = tw;
tstrncpy(compactReq.db, pDb->name, TSDB_DB_FNAME_LEN);
mInfo("vgId:%d, build compact vnode config req", pVgroup->vgId);
@@ -2239,13 +2240,13 @@ static void *mndBuildCompactVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgrou
return pReq;
}
-static int32_t mndAddCompactVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup,
- int64_t compactTs) {
+static int32_t mndAddCompactVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs,
+ STimeWindow tw) {
STransAction action = {0};
action.epSet = mndGetVgroupEpset(pMnode, pVgroup);
int32_t contLen = 0;
- void *pReq = mndBuildCompactVnodeReq(pMnode, pDb, pVgroup, &contLen, compactTs);
+ void *pReq = mndBuildCompactVnodeReq(pMnode, pDb, pVgroup, &contLen, compactTs, tw);
if (pReq == NULL) return -1;
action.pCont = pReq;
@@ -2260,7 +2261,8 @@ static int32_t mndAddCompactVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *
return 0;
}
-int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs) {
- if (mndAddCompactVnodeAction(pMnode, pTrans, pDb, pVgroup, compactTs) != 0) return -1;
+int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs,
+ 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/mnode/impl/test/profile/profile.cpp b/source/dnode/mnode/impl/test/profile/profile.cpp
index 2ae113e051..6ab6d364cb 100644
--- a/source/dnode/mnode/impl/test/profile/profile.cpp
+++ b/source/dnode/mnode/impl/test/profile/profile.cpp
@@ -32,13 +32,14 @@ TEST_F(MndTestProfile, 01_ConnectMsg) {
connectReq.pid = 1234;
char passwd[] = "taosdata";
- char secretEncrypt[TSDB_PASSWORD_LEN] = {0};
+ char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt);
strcpy(connectReq.app, "mnode_test_profile");
strcpy(connectReq.db, "");
strcpy(connectReq.user, "root");
strcpy(connectReq.passwd, secretEncrypt);
+ strcpy(connectReq.sVer, version);
int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq);
void* pReq = rpcMallocCont(contLen);
@@ -66,7 +67,7 @@ TEST_F(MndTestProfile, 01_ConnectMsg) {
TEST_F(MndTestProfile, 02_ConnectMsg_InvalidDB) {
char passwd[] = "taosdata";
- char secretEncrypt[TSDB_PASSWORD_LEN] = {0};
+ char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt);
SConnectReq connectReq = {0};
@@ -75,6 +76,7 @@ TEST_F(MndTestProfile, 02_ConnectMsg_InvalidDB) {
strcpy(connectReq.db, "invalid_db");
strcpy(connectReq.user, "root");
strcpy(connectReq.passwd, secretEncrypt);
+ strcpy(connectReq.sVer, version);
int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq);
void* pReq = rpcMallocCont(contLen);
diff --git a/source/dnode/mnode/impl/test/show/show.cpp b/source/dnode/mnode/impl/test/show/show.cpp
index 0ccefa7ca2..2e67ffa946 100644
--- a/source/dnode/mnode/impl/test/show/show.cpp
+++ b/source/dnode/mnode/impl/test/show/show.cpp
@@ -55,7 +55,7 @@ TEST_F(MndTestShow, 02_ShowMsg_InvalidMsgStart) {
TEST_F(MndTestShow, 03_ShowMsg_Conn) {
char passwd[] = "taosdata";
- char secretEncrypt[TSDB_PASSWORD_LEN] = {0};
+ char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t*)passwd, strlen(passwd), secretEncrypt);
SConnectReq connectReq = {0};
@@ -64,6 +64,7 @@ TEST_F(MndTestShow, 03_ShowMsg_Conn) {
strcpy(connectReq.db, "");
strcpy(connectReq.user, "root");
strcpy(connectReq.passwd, secretEncrypt);
+ strcpy(connectReq.sVer, version);
int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq);
void* pReq = rpcMallocCont(contLen);
diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h
index 8d2cec478c..e9a9e425e3 100644
--- a/source/dnode/mnode/sdb/inc/sdb.h
+++ b/source/dnode/mnode/sdb/inc/sdb.h
@@ -37,8 +37,6 @@ extern "C" {
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
// clang-format on
-#define SDB_WRITE_DELTA 20
-
#define SDB_GET_VAL(pData, dataPos, val, pos, func, type) \
{ \
if (func(pRaw, dataPos, val) != 0) { \
diff --git a/source/dnode/mnode/sdb/src/sdb.c b/source/dnode/mnode/sdb/src/sdb.c
index bb8040da07..9797dd8337 100644
--- a/source/dnode/mnode/sdb/src/sdb.c
+++ b/source/dnode/mnode/sdb/src/sdb.c
@@ -53,7 +53,6 @@ SSdb *sdbInit(SSdbOpt *pOption) {
}
pSdb->pWal = pOption->pWal;
- pSdb->sync = pOption->sync;
pSdb->applyIndex = -1;
pSdb->applyTerm = -1;
pSdb->applyConfig = -1;
diff --git a/source/dnode/mnode/sdb/src/sdbFile.c b/source/dnode/mnode/sdb/src/sdbFile.c
index c2d27ad713..2e182ec10b 100644
--- a/source/dnode/mnode/sdb/src/sdbFile.c
+++ b/source/dnode/mnode/sdb/src/sdbFile.c
@@ -472,10 +472,7 @@ int32_t sdbWriteFile(SSdb *pSdb, int32_t delta) {
taosThreadMutexLock(&pSdb->filelock);
if (pSdb->pWal != NULL) {
- // code = walBeginSnapshot(pSdb->pWal, pSdb->applyIndex, 0);
- if (pSdb->sync == 0) {
- code = 0;
- } else {
+ if (pSdb->sync > 0) {
code = syncBeginSnapshot(pSdb->sync, pSdb->applyIndex);
}
}
@@ -484,11 +481,7 @@ int32_t sdbWriteFile(SSdb *pSdb, int32_t delta) {
}
if (code == 0) {
if (pSdb->pWal != NULL) {
- // code = walEndSnapshot(pSdb->pWal);
-
- if (pSdb->sync == 0) {
- code = 0;
- } else {
+ if (pSdb->sync > 0) {
code = syncEndSnapshot(pSdb->sync);
}
}
diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c
index cc3dba2e07..569c78a68c 100644
--- a/source/dnode/mnode/sdb/src/sdbHash.c
+++ b/source/dnode/mnode/sdb/src/sdbHash.c
@@ -160,6 +160,7 @@ static int32_t sdbInsertRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
if (insertFp != NULL) {
code = (*insertFp)(pSdb, pRow->pObj);
if (code != 0) {
+ if (terrno == 0) terrno = TSDB_CODE_MND_TRANS_UNKNOW_ERROR;
code = terrno;
taosHashRemove(hash, pRow->pObj, keySize);
sdbFreeRow(pSdb, pRow, false);
diff --git a/source/dnode/vnode/CMakeLists.txt b/source/dnode/vnode/CMakeLists.txt
index ea7046886e..8dc3f46ae3 100644
--- a/source/dnode/vnode/CMakeLists.txt
+++ b/source/dnode/vnode/CMakeLists.txt
@@ -14,7 +14,7 @@ target_sources(
"src/vnd/vnodeSvr.c"
"src/vnd/vnodeSync.c"
"src/vnd/vnodeSnapshot.c"
- "src/vnd/vnodeCompact.c"
+ "src/vnd/vnodeRetention.c"
# meta
"src/meta/metaOpen.c"
@@ -52,7 +52,6 @@ target_sources(
"src/tsdb/tsdbCacheRead.c"
"src/tsdb/tsdbRetention.c"
"src/tsdb/tsdbDiskData.c"
- "src/tsdb/tsdbCompact.c"
"src/tsdb/tsdbMergeTree.c"
"src/tsdb/tsdbDataIter.c"
@@ -68,10 +67,20 @@ target_sources(
"src/tq/tqSnapshot.c"
"src/tq/tqOffsetSnapshot.c"
)
+
+IF (TD_VNODE_PLUGINS)
+ target_sources(
+ vnode
+ PRIVATE
+ ${TD_ENTERPRISE_DIR}/src/plugins/vnode/src/tsdbCompact.c
+ ${TD_ENTERPRISE_DIR}/src/plugins/vnode/src/vnodeCompact.c
+ )
+ENDIF ()
+
target_include_directories(
vnode
PUBLIC "inc"
- PRIVATE "src/inc"
+ PUBLIC "src/inc"
PUBLIC "${TD_SOURCE_DIR}/include/libs/scalar"
)
target_link_libraries(
diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h
index acfaccafe2..1d14829891 100644
--- a/source/dnode/vnode/inc/vnode.h
+++ b/source/dnode/vnode/inc/vnode.h
@@ -264,7 +264,7 @@ int32_t tqReaderSetTbUidList(STqReader *pReader, const SArray *tbUidList);
int32_t tqReaderAddTbUidList(STqReader *pReader, const SArray *tbUidList);
int32_t tqReaderRemoveTbUidList(STqReader *pReader, const SArray *tbUidList);
-int32_t tqSeekVer(STqReader *pReader, int64_t ver);
+int32_t tqSeekVer(STqReader *pReader, int64_t ver, const char* id);
int32_t tqNextBlock(STqReader *pReader, SFetchRet *ret);
int32_t tqReaderSetSubmitReq2(STqReader *pReader, void *msgStr, int32_t msgLen, int64_t ver);
diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h
index 104e0945ba..792fed2309 100644
--- a/source/dnode/vnode/src/inc/tq.h
+++ b/source/dnode/vnode/src/inc/tq.h
@@ -67,7 +67,7 @@ typedef struct {
// tqExec
typedef struct {
- char* qmsg;
+ char* qmsg; // SubPlanToString
} STqExecCol;
typedef struct {
diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h
index 44b7e95f9e..15087e90f0 100644
--- a/source/dnode/vnode/src/inc/tsdb.h
+++ b/source/dnode/vnode/src/inc/tsdb.h
@@ -766,6 +766,7 @@ typedef struct SCacheRowsReader {
TdThreadMutex readerMutex;
SVnode *pVnode;
STSchema *pSchema;
+ STSchema *pCurrSchema;
uint64_t uid;
uint64_t suid;
char **transferBuf; // todo remove it soon
diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h
index 88cd1d99e1..134909090f 100644
--- a/source/dnode/vnode/src/inc/vnd.h
+++ b/source/dnode/vnode/src/inc/vnd.h
@@ -106,10 +106,6 @@ int32_t vnodeSyncCommit(SVnode* pVnode);
int32_t vnodeAsyncCommit(SVnode* pVnode);
bool vnodeShouldRollback(SVnode* pVnode);
-// vnodeCompact.c
-int32_t vnodeAsyncCompact(SVnode* pVnode);
-int32_t vnodeSyncCompact(SVnode* pVnode);
-
// vnodeSync.c
int32_t vnodeSyncOpen(SVnode* pVnode, char* path);
int32_t vnodeSyncStart(SVnode* pVnode);
diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h
index 93e611e870..0dff2420ec 100644
--- a/source/dnode/vnode/src/inc/vnodeInt.h
+++ b/source/dnode/vnode/src/inc/vnodeInt.h
@@ -180,7 +180,6 @@ int32_t tsdbCommit(STsdb* pTsdb, SCommitInfo* pInfo);
int32_t tsdbCompact(STsdb* pTsdb, SCompactInfo* pInfo);
int32_t tsdbFinishCommit(STsdb* pTsdb);
int32_t tsdbRollbackCommit(STsdb* pTsdb);
-int32_t tsdbDoRetention(STsdb* pTsdb, int64_t now);
int tsdbScanAndConvertSubmitMsg(STsdb* pTsdb, SSubmitReq2* pMsg);
int tsdbInsertData(STsdb* pTsdb, int64_t version, SSubmitReq2* pMsg, SSubmitRsp2* pRsp);
int32_t tsdbInsertTableData(STsdb* pTsdb, int64_t version, SSubmitTbData* pSubmitTbData, int32_t* affectedRows);
@@ -458,9 +457,10 @@ struct SCommitInfo {
};
struct SCompactInfo {
- SVnode* pVnode;
- int32_t flag;
- int64_t commitID;
+ SVnode* pVnode;
+ int32_t flag;
+ int64_t commitID;
+ STimeWindow tw;
};
#ifdef __cplusplus
diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c
index 4b1163bb11..d338237314 100644
--- a/source/dnode/vnode/src/meta/metaQuery.c
+++ b/source/dnode/vnode/src/meta/metaQuery.c
@@ -1301,6 +1301,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;
@@ -1317,7 +1318,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/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c
index 94aa464354..3325f4055c 100644
--- a/source/dnode/vnode/src/meta/metaTable.c
+++ b/source/dnode/vnode/src/meta/metaTable.c
@@ -1921,10 +1921,10 @@ int metaCreateTagIdxKey(tb_uid_t suid, int32_t cid, const void *pTagData, int32_
// refactor
if (IS_VAR_DATA_TYPE(type)) {
memcpy((*ppTagIdxKey)->data, (uint16_t *)&nTagData, VARSTR_HEADER_SIZE);
- memcpy((*ppTagIdxKey)->data + VARSTR_HEADER_SIZE, pTagData, nTagData);
+ if (pTagData != NULL) memcpy((*ppTagIdxKey)->data + VARSTR_HEADER_SIZE, pTagData, nTagData);
*(tb_uid_t *)((*ppTagIdxKey)->data + VARSTR_HEADER_SIZE + nTagData) = uid;
} else {
- memcpy((*ppTagIdxKey)->data, pTagData, nTagData);
+ if (pTagData != NULL) memcpy((*ppTagIdxKey)->data, pTagData, nTagData);
*(tb_uid_t *)((*ppTagIdxKey)->data + nTagData) = uid;
}
diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c
index 37ae7d895e..99e171dde1 100644
--- a/source/dnode/vnode/src/sma/smaRollup.c
+++ b/source/dnode/vnode/src/sma/smaRollup.c
@@ -595,6 +595,7 @@ static int32_t tdFetchSubmitReqSuids(SSubmitReq2 *pMsg, STbUidStore *pStore) {
return 0;
}
+#if 0
/**
* @brief retention of rsma1/rsma2
*
@@ -618,6 +619,7 @@ int32_t smaDoRetention(SSma *pSma, int64_t now) {
_end:
return code;
}
+#endif
static void tdBlockDataDestroy(SArray *pBlockArr) {
for (int32_t i = 0; i < taosArrayGetSize(pBlockArr); ++i) {
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index c9bbb30380..4d21a2e7f3 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -217,7 +217,7 @@ int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) {
char buf2[80] = {0};
tFormatOffset(buf1, tListLen(buf1), &pRsp->reqOffset);
tFormatOffset(buf2, tListLen(buf2), &pRsp->rspOffset);
- tqDebug("vgId:%d, from consumer:0x%" PRIx64 " (epoch %d) push rsp, block num: %d, reqOffset:%s, rspOffset:%s",
+ tqDebug("vgId:%d, from consumer:0x%" PRIx64 " (epoch %d) push rsp, block num: %d, req:%s, rsp:%s",
TD_VID(pTq->pVnode), pRsp->head.consumerId, pRsp->head.epoch, pRsp->blockNum, buf1, buf2);
return 0;
@@ -275,7 +275,7 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
char buf2[80] = {0};
tFormatOffset(buf1, 80, &pRsp->reqOffset);
tFormatOffset(buf2, 80, &pRsp->rspOffset);
- tqDebug("vgId:%d consumer:0x%" PRIx64 " (epoch %d), block num:%d, reqOffset:%s, rspOffset:%s",
+ tqDebug("vgId:%d consumer:0x%" PRIx64 " (epoch %d), block num:%d, req:%s, rsp:%s",
TD_VID(pTq->pVnode), pReq->consumerId, pReq->epoch, pRsp->blockNum, buf1, buf2);
return 0;
@@ -488,7 +488,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
// 2. check rebalance
if (pHandle->consumerId != consumerId) {
- tqError("tmq poll: consumer:0x%" PRIx64 " vgId:%d, subkey %s, mismatch for saved handle consumer:0x%" PRIx64,
+ tqDebug("ERROR tmq poll: consumer:0x%" PRIx64 " vgId:%d, subkey %s, mismatch for saved handle consumer:0x%" PRIx64,
consumerId, TD_VID(pTq->pVnode), req.subKey, pHandle->consumerId);
terrno = TSDB_CODE_TMQ_CONSUMER_MISMATCH;
return -1;
@@ -575,7 +575,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
return -1;
}
-#if 1
// till now, all data has been rsp to consumer, new data needs to push client once arrived.
if (dataRsp.blockNum == 0 && dataRsp.reqOffset.type == TMQ_OFFSET__LOG &&
dataRsp.reqOffset.version == dataRsp.rspOffset.version) {
@@ -597,14 +596,13 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
return 0;
}
}
-#endif
taosWUnLockLatch(&pTq->pushLock);
if (tqSendDataRsp(pTq, pMsg, &req, &dataRsp) < 0) {
code = -1;
}
- tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp data block:%d, offset type:%d, uid/version:%" PRId64 ", ts:%" PRId64 "",
+ tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, offset type:%d, uid/version:%" PRId64 ", ts:%" PRId64 "",
consumerId, pHandle->subKey, TD_VID(pTq->pVnode), dataRsp.blockNum, dataRsp.rspOffset.type,
dataRsp.rspOffset.uid, dataRsp.rspOffset.ts);
@@ -613,10 +611,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
}
// for taosx
- /*A(pHandle->execHandle.subType != TOPIC_SUB_TYPE__COLUMN);*/
-
SMqMetaRsp metaRsp = {0};
-
STaosxRsp taosxRsp = {0};
tqInitTaosxRsp(&taosxRsp, &req);
@@ -827,6 +822,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
pHandle = &tqHandle;
/*taosInitRWLatch(&pExec->lock);*/
+ uint64_t oldConsumerId = pHandle->consumerId;
memcpy(pHandle->subKey, req.subKey, TSDB_SUBSCRIBE_KEY_LEN);
pHandle->consumerId = req.newConsumerId;
pHandle->epoch = -1;
@@ -889,13 +885,16 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
(SSnapContext**)(&handle.sContext));
pHandle->execHandle.task = qCreateQueueExecTaskInfo(NULL, &handle, NULL, NULL);
}
+
taosHashPut(pTq->pHandle, req.subKey, strlen(req.subKey), pHandle, sizeof(STqHandle));
- tqDebug("try to persist handle %s consumer:0x%" PRIx64, req.subKey, pHandle->consumerId);
+ tqDebug("try to persist handle %s consumer:0x%" PRIx64" , old consumer:0x%"PRIx64, req.subKey, pHandle->consumerId,
+ oldConsumerId);
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
return -1;
}
} else {
// TODO handle qmsg and exec modification
+ tqInfo("update the consumer info, old consumer id:0x%"PRIx64", new Id:0x%"PRIx64, pHandle->consumerId, req.newConsumerId);
atomic_store_32(&pHandle->epoch, -1);
atomic_store_64(&pHandle->consumerId, req.newConsumerId);
atomic_add_fetch_32(&pHandle->epoch, 1);
@@ -903,6 +902,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
qStreamCloseTsdbReader(pHandle->execHandle.task);
}
+
if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) {
return -1;
}
diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c
index e92da7668a..f97c5ce93c 100644
--- a/source/dnode/vnode/src/tq/tqExec.c
+++ b/source/dnode/vnode/src/tq/tqExec.c
@@ -113,9 +113,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
return -1;
}
- ASSERT(pRsp->withTbName == false);
- ASSERT(pRsp->withSchema == false);
-
+ ASSERT(!(pRsp->withTbName || pRsp->withSchema));
return 0;
}
@@ -149,7 +147,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
}
tqDebug("tmqsnap task execute end, get %p", pDataBlock);
- if (pDataBlock != NULL) {
+ if (pDataBlock != NULL && pDataBlock->info.rows > 0) {
if (pRsp->withTbName) {
if (pOffset->type == TMQ_OFFSET__LOG) {
int64_t uid = pExec->pExecReader->lastBlkUid;
diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c
index 12fd15c63a..25ee563796 100644
--- a/source/dnode/vnode/src/tq/tqMeta.c
+++ b/source/dnode/vnode/src/tq/tqMeta.c
@@ -197,7 +197,7 @@ int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) {
return -1;
}
- tqDebug("tq save %s(%d) handle consumer:0x%" PRIx64 "epoch:%d vgId:%d", pHandle->subKey,
+ tqDebug("tq save %s(%d) handle consumer:0x%" PRIx64 " epoch:%d vgId:%d", pHandle->subKey,
(int32_t)strlen(pHandle->subKey), pHandle->consumerId, pHandle->epoch, TD_VID(pTq->pVnode));
void* buf = taosMemoryCalloc(1, vlen);
@@ -269,6 +269,7 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) {
}
int32_t tqMetaRestoreHandle(STQ* pTq) {
+ int code = 0;
TBC* pCur = NULL;
if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) {
return -1;
@@ -290,7 +291,8 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
handle.pRef = walOpenRef(pTq->pVnode->pWal);
if (handle.pRef == NULL) {
- return -1;
+ code = -1;
+ goto end;
}
walRefVer(handle.pRef, handle.snapshotVer);
@@ -307,16 +309,21 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
qCreateQueueExecTaskInfo(handle.execHandle.execCol.qmsg, &reader, &handle.execHandle.numOfCols, NULL);
if (handle.execHandle.task == NULL) {
tqError("cannot create exec task for %s", handle.subKey);
- return -1;
+ code = -1;
+ goto end;
}
void* scanner = NULL;
qExtractStreamScanner(handle.execHandle.task, &scanner);
if (scanner == NULL) {
tqError("cannot extract stream scanner for %s", handle.subKey);
+ code = -1;
+ goto end;
}
handle.execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner);
if (handle.execHandle.pExecReader == NULL) {
tqError("cannot extract exec reader for %s", handle.subKey);
+ code = -1;
+ goto end;
}
} else if (handle.execHandle.subType == TOPIC_SUB_TYPE__DB) {
handle.pWalReader = walOpenReader(pTq->pVnode->pWal, NULL);
@@ -347,8 +354,9 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
taosHashPut(pTq->pHandle, pKey, kLen, &handle, sizeof(STqHandle));
}
+end:
tdbFree(pKey);
tdbFree(pVal);
tdbTbcClose(pCur);
- return 0;
+ return code;
}
diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c
index e747262277..5a25d7e894 100644
--- a/source/dnode/vnode/src/tq/tqPush.c
+++ b/source/dnode/vnode/src/tq/tqPush.c
@@ -193,7 +193,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
memset(&pHandle->pushHandle.rpcInfo, 0, sizeof(SRpcHandleInfo));
taosWUnLockLatch(&pHandle->pushHandle.lock);
- tqDebug("vgId:%d offset %" PRId64 " from consumer:%" PRId64 ", (epoch %d) send rsp, block num: %d, reqOffset:%" PRId64 ", rspOffset:%" PRId64,
+ tqDebug("vgId:%d offset %" PRId64 " from consumer:%" PRId64 ", (epoch %d) send rsp, block num: %d, req:%" PRId64 ", rsp:%" PRId64,
TD_VID(pTq->pVnode), fetchOffset, pHandle->pushHandle.consumerId, pHandle->pushHandle.epoch, rsp.blockNum,
rsp.reqOffset, rsp.rspOffset);
@@ -210,25 +210,30 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
void* pReq = POINTER_SHIFT(msg, sizeof(SSubmitReq2Msg));
int32_t len = msgLen - sizeof(SSubmitReq2Msg);
- tqDebug("vgId:%d tq push msg version:%" PRId64 " type: %s, p head %p, p body %p, len %d", pTq->pVnode->config.vgId, ver,
- TMSG_INFO(msgType), msg, pReq, len);
-
if (msgType == TDMT_VND_SUBMIT) {
// lock push mgr to avoid potential msg lost
taosWLockLatch(&pTq->pushLock);
- if (taosHashGetSize(pTq->pPushMgr) != 0) {
- tqDebug("vgId:%d, push handle num %d", pTq->pVnode->config.vgId, taosHashGetSize(pTq->pPushMgr));
+ 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",
+ pTq->pVnode->config.vgId, ver, TMSG_INFO(msgType), msg, pReq, len, numOfRegisteredPush);
+
SArray* cachedKeys = taosArrayInit(0, sizeof(void*));
SArray* cachedKeyLens = taosArrayInit(0, sizeof(size_t));
+
void* data = taosMemoryMalloc(len);
if (data == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
tqError("failed to copy data for stream since out of memory");
taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree);
taosArrayDestroy(cachedKeyLens);
+
+ // unlock
+ taosWUnLockLatch(&pTq->pushLock);
return -1;
}
+
memcpy(data, pReq, len);
void* pIter = NULL;
@@ -262,7 +267,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
};
qStreamSetScanMemData(task, submit);
- // exec
+ // here start to scan submit block to extract the subscribed data
while (1) {
SSDataBlock* pDataBlock = NULL;
uint64_t ts = 0;
@@ -278,7 +283,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
pRsp->blockNum++;
}
- tqDebug("vgId:%d, tq handle push, subkey: %s, block num: %d", pTq->pVnode->config.vgId, pPushEntry->subKey,
+ tqDebug("vgId:%d, tq handle push, subkey:%s, block num:%d", pTq->pVnode->config.vgId, pPushEntry->subKey,
pRsp->blockNum);
if (pRsp->blockNum > 0) {
// set offset
@@ -295,6 +300,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
tqPushDataRsp(pTq, pPushEntry);
}
}
+
// delete entry
for (int32_t i = 0; i < taosArrayGetSize(cachedKeys); i++) {
void* key = taosArrayGetP(cachedKeys, i);
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index 2c8f20d8cd..bf73cca925 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -290,11 +290,16 @@ void tqCloseReader(STqReader* pReader) {
taosMemoryFree(pReader);
}
-int32_t tqSeekVer(STqReader* pReader, int64_t ver) {
+int32_t tqSeekVer(STqReader* pReader, int64_t ver, const char* id) {
+ // todo set the correct vgId
+ tqDebug("tmq poll: wal seek to version:%"PRId64" %s", ver, id);
if (walReadSeekVer(pReader->pWalReader, ver) < 0) {
+ tqError("tmq poll: wal reader failed to seek to ver:%"PRId64" code:%s, %s", ver, tstrerror(terrno), id);
return -1;
+ } else {
+ tqDebug("tmq poll: wal reader seek to ver:%"PRId64" %s", ver, id);
+ return 0;
}
- return 0;
}
int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
@@ -303,30 +308,25 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) {
while (1) {
if (!fromProcessedMsg) {
if (walNextValidMsg(pReader->pWalReader) < 0) {
- pReader->ver =
- pReader->pWalReader->curVersion - (pReader->pWalReader->curInvalid | pReader->pWalReader->curStopped);
+// pReader->ver = pReader->pWalReader->curVersion - pReader->pWalReader->curStopped;
+ if(pReader->pWalReader->curInvalid == 0){
+ pReader->ver = pReader->pWalReader->curVersion - pReader->pWalReader->curStopped;
+ }else{
+ pReader->ver = walGetLastVer(pReader->pWalReader->pWal);
+ }
ret->offset.type = TMQ_OFFSET__LOG;
+
ret->offset.version = pReader->ver;
ret->fetchType = FETCH_TYPE__NONE;
- tqDebug("return offset %" PRId64 ", no more valid", ret->offset.version);
+ tqDebug("return offset %" PRId64 ", no more valid msg in wal", ret->offset.version);
return -1;
}
+
void* body = POINTER_SHIFT(pReader->pWalReader->pHead->head.body, sizeof(SSubmitReq2Msg));
int32_t bodyLen = pReader->pWalReader->pHead->head.bodyLen - sizeof(SSubmitReq2Msg);
int64_t ver = pReader->pWalReader->pHead->head.version;
-#if 0
- if (pReader->pWalReader->pHead->head.msgType != TDMT_VND_SUBMIT) {
- // TODO do filter
- ret->fetchType = FETCH_TYPE__META;
- ret->meta = pReader->pWalReader->pHead->head.body;
- return 0;
- } else {
-#endif
+
tqReaderSetSubmitReq2(pReader, body, bodyLen, ver);
- /*tqReaderSetDataMsg(pReader, body, pReader->pWalReader->pHead->head.version);*/
-#if 0
- }
-#endif
}
while (tqNextDataBlock2(pReader)) {
@@ -358,7 +358,7 @@ int32_t tqReaderSetDataMsg(STqReader* pReader, const SSubmitReq* pMsg, int64_t v
// if (tInitSubmitMsgIter(pMsg, &pReader->msgIter) < 0) return -1;
// while (true) {
// if (tGetSubmitMsgNext(&pReader->msgIter, &pReader->pBlock) < 0) return -1;
-// tqDebug("submitnext vgId:%d, block:%p, dataLen:%d, len:%d, uid:%"PRId64, pReader->pWalReader->pWal->cfg.vgId, pReader->pBlock, pReader->msgIter.dataLen,
+// tqDebug("submitnext vgId:%d, block:%p, dataLen:%d, len:%d, uid:%"PRId64, pWalReader->pWal->cfg.vgId, pReader->pBlock, pReader->msgIter.dataLen,
// pReader->msgIter.len, pReader->msgIter.uid);
// if (pReader->pBlock == NULL) break;
// }
@@ -371,10 +371,8 @@ int32_t tqReaderSetDataMsg(STqReader* pReader, const SSubmitReq* pMsg, int64_t v
#endif
int32_t tqReaderSetSubmitReq2(STqReader* pReader, void* msgStr, int32_t msgLen, int64_t ver) {
- ASSERT(pReader->msg2.msgStr == NULL);
- ASSERT(msgStr);
- ASSERT(msgLen);
- ASSERT(ver >= 0);
+ ASSERT(pReader->msg2.msgStr == NULL && msgStr && msgLen && (ver >= 0));
+
pReader->msg2.msgStr = msgStr;
pReader->msg2.msgLen = msgLen;
pReader->msg2.ver = ver;
@@ -421,7 +419,10 @@ bool tqNextDataBlock(STqReader* pReader) {
#endif
bool tqNextDataBlock2(STqReader* pReader) {
- if (pReader->msg2.msgStr == NULL) return false;
+ if (pReader->msg2.msgStr == NULL) {
+ return false;
+ }
+
ASSERT(pReader->setMsg == 1);
tqDebug("tq reader next data block %p, %d %" PRId64 " %d", pReader->msg2.msgStr, pReader->msg2.msgLen,
@@ -528,7 +529,7 @@ int32_t tqScanSubmitSplit(SArray* pBlocks, SArray* schemas, STqReader* pReader)
if (pReader->pSchema == NULL) {
tqWarn("vgId:%d, cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64
"), version %d, possibly dropped table",
- pReader->pWalReader->pWal->cfg.vgId, pReader->msgIter.uid, pReader->msgIter.suid, sversion);
+ pWalReader->pWal->cfg.vgId, pReader->msgIter.uid, pReader->msgIter.suid, sversion);
pReader->cachedSchemaSuid = 0;
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
return -1;
@@ -538,7 +539,7 @@ int32_t tqScanSubmitSplit(SArray* pBlocks, SArray* schemas, STqReader* pReader)
pReader->pSchemaWrapper = metaGetTableSchema(pReader->pVnodeMeta, pReader->msgIter.uid, sversion, 1);
if (pReader->pSchemaWrapper == NULL) {
tqWarn("vgId:%d, cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table",
- pReader->pWalReader->pWal->cfg.vgId, pReader->msgIter.uid, pReader->cachedSchemaVer);
+ pWalReader->pWal->cfg.vgId, pReader->msgIter.uid, pReader->cachedSchemaVer);
pReader->cachedSchemaSuid = 0;
terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND;
return -1;
diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c
index 56684b691b..93132293b1 100644
--- a/source/dnode/vnode/src/tq/tqSink.c
+++ b/source/dnode/vnode/src/tq/tqSink.c
@@ -370,11 +370,6 @@ int32_t tqPutReqToQueue(SVnode* pVnode, SVCreateTbBatchReq* pReqs) {
}
return TSDB_CODE_SUCCESS;
-
-_error:
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- tqError("failed to encode submit req since %s", terrstr());
- return TSDB_CODE_OUT_OF_MEMORY;
}
void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* data) {
@@ -441,9 +436,6 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
for (int32_t rowId = 0; rowId < rows; rowId++) {
SVCreateTbReq createTbReq = {0};
SVCreateTbReq* pCreateTbReq = &createTbReq;
- if (!pCreateTbReq) {
- goto _end;
- }
// set const
pCreateTbReq->flags = 0;
@@ -460,6 +452,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
if (size == 2) {
tagArray = taosArrayInit(1, sizeof(STagVal));
if (!tagArray) {
+ tdDestroySVCreateTbReq(pCreateTbReq);
goto _end;
}
STagVal tagVal = {
@@ -477,6 +470,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
} else {
tagArray = taosArrayInit(size - 1, sizeof(STagVal));
if (!tagArray) {
+ tdDestroySVCreateTbReq(pCreateTbReq);
goto _end;
}
for (int32_t tagId = UD_TAG_COLUMN_INDEX, step = 1; tagId < size; tagId++, step++) {
@@ -503,6 +497,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
tTagNew(tagArray, 1, false, &pTag);
tagArray = taosArrayDestroy(tagArray);
if (pTag == NULL) {
+ tdDestroySVCreateTbReq(pCreateTbReq);
terrno = TSDB_CODE_OUT_OF_MEMORY;
goto _end;
}
@@ -556,6 +551,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
SVCreateTbReq* pCreateTbReq = NULL;
if (!(pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateStbReq)))) {
+ taosMemoryFree(ctbName);
goto _end;
};
@@ -572,6 +568,8 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
// set tag content
tagArray = taosArrayInit(1, sizeof(STagVal));
if (!tagArray) {
+ taosMemoryFree(ctbName);
+ tdDestroySVCreateTbReq(pCreateTbReq);
goto _end;
}
STagVal tagVal = {
@@ -587,6 +585,8 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
tagArray = taosArrayDestroy(tagArray);
if (pTag == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
+ taosMemoryFree(ctbName);
+ tdDestroySVCreateTbReq(pCreateTbReq);
goto _end;
}
pCreateTbReq->ctb.pTag = (uint8_t*)pTag;
@@ -619,6 +619,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
TD_VID(pVnode), ctbName, suid, mr.me.ctbEntry.suid);
metaReaderClear(&mr);
taosMemoryFree(ctbName);
+ continue;
}
tbData.uid = mr.me.uid;
@@ -629,6 +630,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
// rows
if (!pVals && !(pVals = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal)))) {
taosArrayDestroy(tbData.aRowP);
+ tdDestroySVCreateTbReq(tbData.pCreateTbReq);
goto _end;
}
@@ -679,6 +681,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
SSubmitReq2 submitReq = {0};
if (!(submitReq.aSubmitTbData = taosArrayInit(1, sizeof(SSubmitTbData)))) {
+ tDestroySSubmitTbData(&tbData, TSDB_MSG_FLG_ENCODE);
goto _end;
}
@@ -692,6 +695,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
len += sizeof(SSubmitReq2Msg);
pBuf = rpcMallocCont(len);
if (NULL == pBuf) {
+ tDestroySSubmitReq2(&submitReq, TSDB_MSG_FLG_ENCODE);
goto _end;
}
((SSubmitReq2Msg*)pBuf)->header.vgId = TD_VID(pVnode);
@@ -703,6 +707,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void*
tqError("failed to encode submit req since %s", terrstr());
tEncoderClear(&encoder);
rpcFreeCont(pBuf);
+ tDestroySSubmitReq2(&submitReq, TSDB_MSG_FLG_ENCODE);
continue;
}
tEncoderClear(&encoder);
diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c
index 79e0ccc3e3..dcf7286c00 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCache.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCache.c
@@ -257,9 +257,6 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, TS
SLastCol lastCol = {.ts = keyTs, .colVal = colVal};
if (IS_VAR_DATA_TYPE(colVal.type) && colVal.value.nData > 0) {
- SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLast, iCol);
- taosMemoryFree(pLastCol->colVal.value.pData);
-
lastCol.colVal.value.pData = taosMemoryMalloc(colVal.value.nData);
if (lastCol.colVal.value.pData == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -378,9 +375,6 @@ int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, TSDBROW *row, STsdb
SLastCol lastCol = {.ts = keyTs, .colVal = colVal};
if (IS_VAR_DATA_TYPE(colVal.type) && colVal.value.nData > 0) {
- SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLast, iCol);
- taosMemoryFree(pLastCol->colVal.value.pData);
-
lastCol.colVal.value.pData = taosMemoryMalloc(colVal.value.nData);
if (lastCol.colVal.value.pData == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -1265,17 +1259,58 @@ _err:
return code;
}
-static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppColArray, SCacheRowsReader *pr) {
- int32_t code = 0;
+static int32_t initLastColArray(STSchema *pTSchema, SArray **ppColArray) {
+ SArray *pColArray = taosArrayInit(pTSchema->numOfCols, sizeof(SLastCol));
+ if (NULL == pColArray) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ for (int32_t i = 0; i < pTSchema->numOfCols; ++i) {
+ SLastCol col = {.ts = 0, .colVal = COL_VAL_NULL(pTSchema->columns[i].colId, pTSchema->columns[i].type)};
+ taosArrayPush(pColArray, &col);
+ }
+ *ppColArray = pColArray;
+ return TSDB_CODE_SUCCESS;
+}
+
+static int32_t cloneTSchema(STSchema *pSrc, STSchema **ppDst) {
+ int32_t len = sizeof(STSchema) + sizeof(STColumn) * pSrc->numOfCols;
+ *ppDst = taosMemoryMalloc(len);
+ if (NULL == *ppDst) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ memcpy(*ppDst, pSrc, len);
+ return TSDB_CODE_SUCCESS;
+}
+
+static int32_t updateTSchema(int32_t sversion, SCacheRowsReader *pReader, uint64_t uid) {
+ if (NULL == pReader->pCurrSchema && sversion == pReader->pSchema->version) {
+ return cloneTSchema(pReader->pSchema, &pReader->pCurrSchema);
+ }
+
+ if (NULL != pReader->pCurrSchema && sversion == pReader->pCurrSchema->version) {
+ return TSDB_CODE_SUCCESS;
+ }
+
+ taosMemoryFreeClear(pReader->pCurrSchema);
+ return metaGetTbTSchemaEx(pReader->pTsdb->pVnode->pMeta, pReader->suid, uid, sversion, &pReader->pCurrSchema);
+}
+
+static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppColArray, SCacheRowsReader *pr) {
STSchema *pTSchema = pr->pSchema; // metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1);
- int16_t nCol = pTSchema->numOfCols;
+ int16_t nLastCol = pTSchema->numOfCols;
int16_t iCol = 0;
int16_t noneCol = 0;
bool setNoneCol = false;
- SArray *pColArray = taosArrayInit(nCol, sizeof(SLastCol));
+ bool hasRow = false;
+ SArray *pColArray = NULL;
SColVal *pColVal = &(SColVal){0};
+ int32_t code = initLastColArray(pTSchema, &pColArray);
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
TSKEY lastRowTs = TSKEY_MAX;
CacheNextRowIter iter = {0};
@@ -1290,6 +1325,15 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
break;
}
+ hasRow = true;
+
+ code = updateTSchema(TSDBROW_SVERSION(pRow), pr, uid);
+ if (TSDB_CODE_SUCCESS != code) {
+ goto _err;
+ }
+ pTSchema = pr->pCurrSchema;
+ int16_t nCol = pTSchema->numOfCols;
+
TSKEY rowTs = TSDBROW_TS(pRow);
if (lastRowTs == TSKEY_MAX) {
@@ -1297,29 +1341,27 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
STColumn *pTColumn = &pTSchema->columns[0];
*pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = lastRowTs});
- if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) {
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- code = TSDB_CODE_OUT_OF_MEMORY;
- goto _err;
- }
+ taosArraySet(pColArray, 0, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal});
for (iCol = 1; iCol < nCol; ++iCol) {
+ if (iCol >= nLastCol) {
+ break;
+ }
+ SLastCol *pCol = taosArrayGet(pColArray, iCol);
+ if (pCol->colVal.cid != pTSchema->columns[iCol].colId) {
+ continue;
+ }
tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal);
- SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal};
+ *pCol = (SLastCol){.ts = lastRowTs, .colVal = *pColVal};
if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) {
- lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData);
- if (lastCol.colVal.value.pData == NULL) {
+ pCol->colVal.value.pData = taosMemoryMalloc(pCol->colVal.value.nData);
+ if (pCol->colVal.value.pData == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
code = TSDB_CODE_OUT_OF_MEMORY;
goto _err;
}
- memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData);
- }
-
- if (taosArrayPush(pColArray, &lastCol) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- goto _err;
+ memcpy(pCol->colVal.value.pData, pColVal->value.pData, pColVal->value.nData);
}
if (COL_VAL_IS_NONE(pColVal) && !setNoneCol) {
@@ -1376,6 +1418,9 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
//*ppColArray = NULL;
// taosArrayDestroy(pColArray);
//} else {
+ if (!hasRow) {
+ taosArrayClear(pColArray);
+ }
*ppColArray = pColArray;
//}
@@ -1391,16 +1436,19 @@ _err:
}
static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCacheRowsReader *pr) {
- int32_t code = 0;
-
STSchema *pTSchema = pr->pSchema; // metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1);
- int16_t nCol = pTSchema->numOfCols;
- int16_t iCol = 0;
+ int16_t nLastCol = pTSchema->numOfCols;
int16_t noneCol = 0;
bool setNoneCol = false;
- SArray *pColArray = taosArrayInit(nCol, sizeof(SLastCol));
+ bool hasRow = false;
+ SArray *pColArray = NULL;
SColVal *pColVal = &(SColVal){0};
+ int32_t code = initLastColArray(pTSchema, &pColArray);
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
TSKEY lastRowTs = TSKEY_MAX;
CacheNextRowIter iter = {0};
@@ -1415,6 +1463,15 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach
break;
}
+ hasRow = true;
+
+ code = updateTSchema(TSDBROW_SVERSION(pRow), pr, uid);
+ if (TSDB_CODE_SUCCESS != code) {
+ goto _err;
+ }
+ pTSchema = pr->pCurrSchema;
+ int16_t nCol = pTSchema->numOfCols;
+
TSKEY rowTs = TSDBROW_TS(pRow);
if (lastRowTs == TSKEY_MAX) {
@@ -1422,28 +1479,27 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach
STColumn *pTColumn = &pTSchema->columns[0];
*pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = lastRowTs});
- if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- goto _err;
- }
+ taosArraySet(pColArray, 0, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal});
- for (iCol = 1; iCol < nCol; ++iCol) {
+ for (int16_t iCol = 1; iCol < nCol; ++iCol) {
+ if (iCol >= nLastCol) {
+ break;
+ }
+ SLastCol *pCol = taosArrayGet(pColArray, iCol);
+ if (pCol->colVal.cid != pTSchema->columns[iCol].colId) {
+ continue;
+ }
tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal);
- SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal};
+ *pCol = (SLastCol){.ts = lastRowTs, .colVal = *pColVal};
if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) {
- lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData);
- if (lastCol.colVal.value.pData == NULL) {
+ pCol->colVal.value.pData = taosMemoryMalloc(pCol->colVal.value.nData);
+ if (pCol->colVal.value.pData == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
code = TSDB_CODE_OUT_OF_MEMORY;
goto _err;
}
- memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData);
- }
-
- if (taosArrayPush(pColArray, &lastCol) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- goto _err;
+ memcpy(pCol->colVal.value.pData, pColVal->value.pData, pColVal->value.nData);
}
if (!COL_VAL_IS_VALUE(pColVal) && !setNoneCol) {
@@ -1461,10 +1517,16 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach
// merge into pColArray
setNoneCol = false;
- for (iCol = noneCol; iCol < nCol; ++iCol) {
+ for (int16_t iCol = noneCol; iCol < nCol; ++iCol) {
+ if (iCol >= nLastCol) {
+ break;
+ }
// high version's column value
SLastCol *lastColVal = (SLastCol *)taosArrayGet(pColArray, iCol);
- SColVal *tColVal = &lastColVal->colVal;
+ if (lastColVal->colVal.cid != pTSchema->columns[iCol].colId) {
+ continue;
+ }
+ SColVal *tColVal = &lastColVal->colVal;
tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal);
if (!COL_VAL_IS_VALUE(tColVal) && COL_VAL_IS_VALUE(pColVal)) {
@@ -1494,6 +1556,9 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach
//*ppLastArray = NULL;
// taosArrayDestroy(pColArray);
//} else {
+ if (!hasRow) {
+ taosArrayClear(pColArray);
+ }
*ppLastArray = pColArray;
//}
diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
index 97b13a3c37..5528b6313c 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c
@@ -38,16 +38,17 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p
*(int64_t*)p->buf = pColVal->ts;
allNullRow = false;
} else {
- int32_t slotId = slotIds[i];
- SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId);
-
+ int32_t slotId = slotIds[i];
// add check for null value, caused by the modification of table schema (new column added).
- if (pColVal == NULL) {
+ if (slotId >= taosArrayGetSize(pRow)) {
p->ts = 0;
p->isNull = true;
+ colDataSetNULL(pColInfoData, numOfRows);
continue;
}
+ SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId);
+
p->ts = pColVal->ts;
p->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal);
allNullRow = p->isNull & allNullRow;
@@ -79,7 +80,12 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p
SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0);
colDataSetVal(pColInfoData, numOfRows, (const char*)&pColVal->ts, false);
} else {
- int32_t slotId = slotIds[i];
+ int32_t slotId = slotIds[i];
+ // add check for null value, caused by the modification of table schema (new column added).
+ if (slotId >= taosArrayGetSize(pRow)) {
+ colDataSetNULL(pColInfoData, numOfRows);
+ continue;
+ }
SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId);
SColVal* pVal = &pColVal->colVal;
@@ -209,6 +215,8 @@ void* tsdbCacherowsReaderClose(void* pReader) {
taosMemoryFree(p->pSchema);
}
+ taosMemoryFree(p->pCurrSchema);
+
destroyLastBlockLoadInfo(p->pLoadInfo);
taosMemoryFree((void*)p->idstr);
@@ -290,7 +298,8 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
}
for (int32_t j = 0; j < pr->numOfCols; ++j) {
- pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes + VARSTR_HEADER_SIZE);
+ pRes[j] = taosMemoryCalloc(
+ 1, sizeof(SFirstLastRes) + pr->pSchema->columns[-1 == slotIds[j] ? 0 : slotIds[j]].bytes + VARSTR_HEADER_SIZE);
SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[j]);
p->ts = INT64_MIN;
}
@@ -303,7 +312,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
for (int32_t i = 0; i < pr->pSchema->numOfCols; ++i) {
struct STColumn* pCol = &pr->pSchema->columns[i];
- SLastCol p = {.ts = INT64_MIN, .colVal.type = pCol->type};
+ SLastCol p = {.ts = INT64_MIN, .colVal.type = pCol->type, .colVal.flag = CV_FLAG_NULL};
if (IS_VAR_DATA_TYPE(pCol->type)) {
p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char));
diff --git a/source/dnode/vnode/src/tsdb/tsdbCompact.c b/source/dnode/vnode/src/tsdb/tsdbCompact.c
deleted file mode 100644
index fc7df98217..0000000000
--- a/source/dnode/vnode/src/tsdb/tsdbCompact.c
+++ /dev/null
@@ -1,667 +0,0 @@
-/*
- * Copyright (c) 2019 TAOS Data, Inc.
- *
- * This program is free software: you can use, redistribute, and/or modify
- * it under the terms of the GNU Affero General Public License, version 3
- * or later ("AGPL"), as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-#include "tsdb.h"
-
-extern int32_t tsdbUpdateTableSchema(SMeta *pMeta, int64_t suid, int64_t uid, SSkmInfo *pSkmInfo);
-extern int32_t tsdbWriteDataBlock(SDataFWriter *pWriter, SBlockData *pBlockData, SMapData *mDataBlk, int8_t cmprAlg);
-extern int32_t tsdbWriteSttBlock(SDataFWriter *pWriter, SBlockData *pBlockData, SArray *aSttBlk, int8_t cmprAlg);
-
-typedef struct {
- STsdb *pTsdb;
- int64_t commitID;
- int8_t cmprAlg;
- int32_t maxRows;
- int32_t minRows;
-
- STsdbFS fs;
-
- int32_t fid;
- TABLEID tbid;
- SSkmInfo tbSkm;
-
- // Tombstone
- SDelFReader *pDelFReader;
- SArray *aDelIdx; // SArray
- SArray *aDelData; // SArray
- SArray *aSkyLine; // SArray
- int32_t iDelIdx;
- int32_t iSkyLine;
- TSDBKEY *pDKey;
- TSDBKEY dKey;
-
- // Reader
- SDataFReader *pReader;
- STsdbDataIter2 *iterList; // list of iterators
- STsdbDataIter2 *pIter;
- SRBTree rbt;
-
- // Writer
- SDataFWriter *pWriter;
- SArray *aBlockIdx; // SArray
- SMapData mDataBlk; // SMapData
- SArray *aSttBlk; // SArray
- SBlockData bData;
- SBlockData sData;
-} STsdbCompactor;
-
-static int32_t tsdbCommitCompact(STsdbCompactor *pCompactor) {
- int32_t code = 0;
- int32_t lino = 0;
-
- STsdb *pTsdb = pCompactor->pTsdb;
-
- code = tsdbFSPrepareCommit(pTsdb, &pCompactor->fs);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- taosThreadRwlockWrlock(&pTsdb->rwLock);
-
- code = tsdbFSCommit(pTsdb);
- if (code) {
- taosThreadRwlockUnlock(&pTsdb->rwLock);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- taosThreadRwlockUnlock(&pTsdb->rwLock);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
- }
- return code;
-}
-
-static int32_t tsdbAbortCompact(STsdbCompactor *pCompactor) {
- int32_t code = 0;
- int32_t lino = 0;
-
- STsdb *pTsdb = pCompactor->pTsdb;
- code = tsdbFSRollback(pTsdb);
- TSDB_CHECK_CODE(code, lino, _exit);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
- } else {
- tsdbInfo("vgId:%d %s done", TD_VID(pTsdb->pVnode), __func__);
- }
- return code;
-}
-
-static int32_t tsdbCompactWriteTableDataStart(STsdbCompactor *pCompactor, TABLEID *pId) {
- int32_t code = 0;
- int32_t lino = 0;
-
- pCompactor->tbid = *pId;
-
- // tombstone
- for (;;) {
- if (pCompactor->iDelIdx >= taosArrayGetSize(pCompactor->aDelIdx)) {
- pCompactor->pDKey = NULL;
- break;
- }
-
- SDelIdx *pDelIdx = (SDelIdx *)taosArrayGet(pCompactor->aDelIdx, pCompactor->iDelIdx);
- int32_t c = tTABLEIDCmprFn(pDelIdx, &pCompactor->tbid);
- if (c < 0) {
- pCompactor->iDelIdx++;
- } else if (c == 0) {
- pCompactor->iDelIdx++;
-
- code = tsdbReadDelData(pCompactor->pDelFReader, pDelIdx, pCompactor->aDelData);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbBuildDeleteSkyline(pCompactor->aDelData, 0, taosArrayGetSize(pCompactor->aDelData) - 1,
- pCompactor->aSkyLine);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- pCompactor->iSkyLine = 0;
- if (pCompactor->iSkyLine < taosArrayGetSize(pCompactor->aSkyLine)) {
- TSDBKEY *pKey = (TSDBKEY *)taosArrayGet(pCompactor->aSkyLine, pCompactor->iSkyLine);
-
- pCompactor->dKey.version = 0;
- pCompactor->dKey.ts = pKey->ts;
- pCompactor->pDKey = &pCompactor->dKey;
- } else {
- pCompactor->pDKey = NULL;
- }
- break;
- } else {
- pCompactor->pDKey = NULL;
- break;
- }
- }
-
- // writer
- code = tsdbUpdateTableSchema(pCompactor->pTsdb->pVnode->pMeta, pId->suid, pId->uid, &pCompactor->tbSkm);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- tMapDataReset(&pCompactor->mDataBlk);
-
- code = tBlockDataInit(&pCompactor->bData, pId, pCompactor->tbSkm.pTSchema, NULL, 0);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (!TABLE_SAME_SCHEMA(pCompactor->sData.suid, pCompactor->sData.uid, pId->suid, pId->uid)) {
- if (pCompactor->sData.nRow > 0) {
- code = tsdbWriteSttBlock(pCompactor->pWriter, &pCompactor->sData, pCompactor->aSttBlk, pCompactor->cmprAlg);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- TABLEID tbid = {.suid = pId->suid, .uid = pId->suid ? 0 : pId->uid};
- code = tBlockDataInit(&pCompactor->sData, &tbid, pCompactor->tbSkm.pTSchema, NULL, 0);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code));
- } else {
- tsdbDebug("vgId:%d %s done, suid:%" PRId64 " uid:%" PRId64, TD_VID(pCompactor->pTsdb->pVnode), __func__, pId->suid,
- pId->uid);
- }
- return code;
-}
-
-static int32_t tsdbCompactWriteTableDataEnd(STsdbCompactor *pCompactor) {
- int32_t code = 0;
- int32_t lino = 0;
-
- if (pCompactor->bData.nRow > 0) {
- if (pCompactor->bData.nRow < pCompactor->minRows) {
- for (int32_t iRow = 0; iRow < pCompactor->bData.nRow; iRow++) {
- code = tBlockDataAppendRow(&pCompactor->sData, &tsdbRowFromBlockData(&pCompactor->bData, iRow), NULL,
- pCompactor->tbid.uid);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (pCompactor->sData.nRow >= pCompactor->maxRows) {
- code = tsdbWriteSttBlock(pCompactor->pWriter, &pCompactor->sData, pCompactor->aSttBlk, pCompactor->cmprAlg);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
- }
- tBlockDataClear(&pCompactor->bData);
- } else {
- code = tsdbWriteDataBlock(pCompactor->pWriter, &pCompactor->bData, &pCompactor->mDataBlk, pCompactor->cmprAlg);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
- }
-
- if (pCompactor->mDataBlk.nItem > 0) {
- SBlockIdx *pBlockIdx = (SBlockIdx *)taosArrayReserve(pCompactor->aBlockIdx, 1);
- if (pBlockIdx == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- pBlockIdx->suid = pCompactor->tbid.suid;
- pBlockIdx->uid = pCompactor->tbid.uid;
-
- code = tsdbWriteDataBlk(pCompactor->pWriter, &pCompactor->mDataBlk, pBlockIdx);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code));
- } else {
- tsdbDebug("vgId:%d %s done, suid:%" PRId64 " uid:%" PRId64, TD_VID(pCompactor->pTsdb->pVnode), __func__,
- pCompactor->tbid.suid, pCompactor->tbid.uid);
- }
- return code;
-}
-
-static bool tsdbCompactRowIsDeleted(STsdbCompactor *pCompactor, TSDBROW *pRow) {
- TSDBKEY tKey = TSDBROW_KEY(pRow);
- TSDBKEY *aKey = (TSDBKEY *)TARRAY_DATA(pCompactor->aSkyLine);
- int32_t nKey = TARRAY_SIZE(pCompactor->aSkyLine);
-
- if (tKey.ts > pCompactor->pDKey->ts) {
- do {
- pCompactor->pDKey->version = aKey[pCompactor->iSkyLine].version;
- pCompactor->iSkyLine++;
- if (pCompactor->iSkyLine < nKey) {
- pCompactor->dKey.ts = aKey[pCompactor->iSkyLine].ts;
- } else {
- if (pCompactor->pDKey->version == 0) {
- pCompactor->pDKey = NULL;
- return false;
- } else {
- pCompactor->pDKey->ts = INT64_MAX;
- }
- }
- } while (tKey.ts > pCompactor->pDKey->ts);
- }
-
- if (tKey.ts < pCompactor->pDKey->ts) {
- if (tKey.version > pCompactor->pDKey->version) {
- return false;
- } else {
- return true;
- }
- } else if (tKey.ts == pCompactor->pDKey->ts) {
- ASSERT(pCompactor->iSkyLine < nKey);
- if (tKey.version > TMAX(pCompactor->pDKey->version, aKey[pCompactor->iSkyLine].version)) {
- return false;
- } else {
- return true;
- }
- }
-
- return false;
-}
-
-static int32_t tsdbCompactWriteTableData(STsdbCompactor *pCompactor, SRowInfo *pRowInfo) {
- int32_t code = 0;
- int32_t lino = 0;
-
- // start a new table data write if need
- if (pRowInfo == NULL || pRowInfo->uid != pCompactor->tbid.uid) {
- if (pCompactor->tbid.uid) {
- code = tsdbCompactWriteTableDataEnd(pCompactor);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- if (pRowInfo == NULL) {
- if (pCompactor->sData.nRow > 0) {
- code = tsdbWriteSttBlock(pCompactor->pWriter, &pCompactor->sData, pCompactor->aSttBlk, pCompactor->cmprAlg);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
- return code;
- }
-
- code = tsdbCompactWriteTableDataStart(pCompactor, (TABLEID *)pRowInfo);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- // check if row is deleted
- if (pCompactor->pDKey && tsdbCompactRowIsDeleted(pCompactor, &pRowInfo->row)) goto _exit;
-
- if (tBlockDataTryUpsertRow(&pCompactor->bData, &pRowInfo->row, pRowInfo->uid) > pCompactor->maxRows) {
- code = tsdbWriteDataBlock(pCompactor->pWriter, &pCompactor->bData, &pCompactor->mDataBlk, pCompactor->cmprAlg);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- code = tBlockDataUpsertRow(&pCompactor->bData, &pRowInfo->row, NULL, pRowInfo->uid);
- TSDB_CHECK_CODE(code, lino, _exit);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code));
- } else if (pRowInfo) {
- tsdbTrace("vgId:%d %s done, suid:%" PRId64 " uid:%" PRId64 " ts:%" PRId64 " version:%" PRId64,
- TD_VID(pCompactor->pTsdb->pVnode), __func__, pRowInfo->suid, pRowInfo->uid, TSDBROW_TS(&pRowInfo->row),
- TSDBROW_VERSION(&pRowInfo->row));
- }
- return code;
-}
-
-static bool tsdbCompactTableIsDropped(STsdbCompactor *pCompactor) {
- SMetaInfo info;
-
- if (pCompactor->pIter->rowInfo.uid == pCompactor->tbid.uid) return false;
- if (metaGetInfo(pCompactor->pTsdb->pVnode->pMeta, pCompactor->pIter->rowInfo.uid, &info, NULL)) {
- return true;
- }
- return false;
-}
-static int32_t tsdbCompactNextRow(STsdbCompactor *pCompactor, SRowInfo **ppRowInfo) {
- int32_t code = 0;
- int32_t lino = 0;
-
- for (;;) {
- if (pCompactor->pIter) {
- code = tsdbDataIterNext2(pCompactor->pIter, NULL);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (pCompactor->pIter->rowInfo.suid == 0 && pCompactor->pIter->rowInfo.uid == 0) {
- pCompactor->pIter = NULL;
- } else {
- SRBTreeNode *pNode = tRBTreeMin(&pCompactor->rbt);
- if (pNode) {
- int32_t c = tsdbDataIterCmprFn(&pCompactor->pIter->rbtn, pNode);
- if (c > 0) {
- tRBTreePut(&pCompactor->rbt, &pCompactor->pIter->rbtn);
- pCompactor->pIter = NULL;
- } else if (c == 0) {
- ASSERT(0);
- }
- }
- }
- }
-
- if (pCompactor->pIter == NULL) {
- SRBTreeNode *pNode = tRBTreeDropMin(&pCompactor->rbt);
- if (pNode) {
- pCompactor->pIter = TSDB_RBTN_TO_DATA_ITER(pNode);
- }
- }
-
- if (pCompactor->pIter) {
- if (tsdbCompactTableIsDropped(pCompactor)) {
- TABLEID tbid = {.suid = pCompactor->pIter->rowInfo.suid, .uid = pCompactor->pIter->rowInfo.uid};
- tRBTreeClear(&pCompactor->rbt);
- for (pCompactor->pIter = pCompactor->iterList; pCompactor->pIter; pCompactor->pIter = pCompactor->pIter->next) {
- code = tsdbDataIterNext2(pCompactor->pIter,
- &(STsdbFilterInfo){.flag = TSDB_FILTER_FLAG_BY_TABLEID, .tbid = tbid});
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (pCompactor->pIter->rowInfo.suid || pCompactor->pIter->rowInfo.uid) {
- tRBTreePut(&pCompactor->rbt, &pCompactor->pIter->rbtn);
- }
- }
- } else {
- *ppRowInfo = &pCompactor->pIter->rowInfo;
- break;
- }
- } else {
- *ppRowInfo = NULL;
- break;
- }
- }
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code));
- }
- return code;
-}
-
-static int32_t tsdbCompactFileSetStart(STsdbCompactor *pCompactor, SDFileSet *pSet) {
- int32_t code = 0;
- int32_t lino = 0;
-
- pCompactor->fid = pSet->fid;
- pCompactor->tbid = (TABLEID){0};
-
- /* tombstone */
- pCompactor->iDelIdx = 0;
-
- /* reader */
- code = tsdbDataFReaderOpen(&pCompactor->pReader, pCompactor->pTsdb, pSet);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbOpenDataFileDataIter(pCompactor->pReader, &pCompactor->pIter);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- tRBTreeCreate(&pCompactor->rbt, tsdbDataIterCmprFn);
- if (pCompactor->pIter) {
- pCompactor->pIter->next = pCompactor->iterList;
- pCompactor->iterList = pCompactor->pIter;
-
- code = tsdbDataIterNext2(pCompactor->pIter, NULL);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- ASSERT(pCompactor->pIter->rowInfo.suid || pCompactor->pIter->rowInfo.uid);
- tRBTreePut(&pCompactor->rbt, &pCompactor->pIter->rbtn);
- }
-
- for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
- code = tsdbOpenSttFileDataIter(pCompactor->pReader, iStt, &pCompactor->pIter);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (pCompactor->pIter) {
- pCompactor->pIter->next = pCompactor->iterList;
- pCompactor->iterList = pCompactor->pIter;
-
- code = tsdbDataIterNext2(pCompactor->pIter, NULL);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- ASSERT(pCompactor->pIter->rowInfo.suid || pCompactor->pIter->rowInfo.uid);
- tRBTreePut(&pCompactor->rbt, &pCompactor->pIter->rbtn);
- }
- }
- pCompactor->pIter = NULL;
-
- /* writer */
- code = tsdbDataFWriterOpen(&pCompactor->pWriter, pCompactor->pTsdb,
- &(SDFileSet){.fid = pCompactor->fid,
- .diskId = pSet->diskId,
- .pHeadF = &(SHeadFile){.commitID = pCompactor->commitID},
- .pDataF = &(SDataFile){.commitID = pCompactor->commitID},
- .pSmaF = &(SSmaFile){.commitID = pCompactor->commitID},
- .nSttF = 1,
- .aSttF = {&(SSttFile){.commitID = pCompactor->commitID}}});
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if (pCompactor->aBlockIdx) {
- taosArrayClear(pCompactor->aBlockIdx);
- } else if ((pCompactor->aBlockIdx = taosArrayInit(0, sizeof(SBlockIdx))) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- tMapDataReset(&pCompactor->mDataBlk);
-
- if (pCompactor->aSttBlk) {
- taosArrayClear(pCompactor->aSttBlk);
- } else if ((pCompactor->aSttBlk = taosArrayInit(0, sizeof(SSttBlk))) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- tBlockDataReset(&pCompactor->bData);
- tBlockDataReset(&pCompactor->sData);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s, fid:%d", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code), pCompactor->fid);
- } else {
- tsdbInfo("vgId:%d %s done, fid:%d", TD_VID(pCompactor->pTsdb->pVnode), __func__, pCompactor->fid);
- }
- return code;
-}
-
-static int32_t tsdbCompactFileSetEnd(STsdbCompactor *pCompactor) {
- int32_t code = 0;
- int32_t lino = 0;
-
- ASSERT(pCompactor->bData.nRow == 0);
- ASSERT(pCompactor->sData.nRow == 0);
-
- /* update files */
- code = tsdbWriteSttBlk(pCompactor->pWriter, pCompactor->aSttBlk);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbWriteBlockIdx(pCompactor->pWriter, pCompactor->aBlockIdx);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbUpdateDFileSetHeader(pCompactor->pWriter);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbFSUpsertFSet(&pCompactor->fs, &pCompactor->pWriter->wSet);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbDataFWriterClose(&pCompactor->pWriter, 1);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbDataFReaderClose(&pCompactor->pReader);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- /* do clear */
- while ((pCompactor->pIter = pCompactor->iterList) != NULL) {
- pCompactor->iterList = pCompactor->pIter->next;
- tsdbCloseDataIter2(pCompactor->pIter);
- }
-
- tBlockDataReset(&pCompactor->bData);
- tBlockDataReset(&pCompactor->sData);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s, fid:%d", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code), pCompactor->fid);
- } else {
- tsdbInfo("vgId:%d %s done, fid:%d", TD_VID(pCompactor->pTsdb->pVnode), __func__, pCompactor->fid);
- }
- return code;
-}
-
-static int32_t tsdbCompactFileSet(STsdbCompactor *pCompactor, SDFileSet *pSet) {
- int32_t code = 0;
- int32_t lino = 0;
-
- // start compact
- code = tsdbCompactFileSetStart(pCompactor, pSet);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- // do compact, end with a NULL row
- SRowInfo *pRowInfo;
- do {
- code = tsdbCompactNextRow(pCompactor, &pRowInfo);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tsdbCompactWriteTableData(pCompactor, pRowInfo);
- TSDB_CHECK_CODE(code, lino, _exit);
- } while (pRowInfo);
-
- // end compact
- code = tsdbCompactFileSetEnd(pCompactor);
- TSDB_CHECK_CODE(code, lino, _exit);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s, fid:%d", TD_VID(pCompactor->pTsdb->pVnode), __func__, lino,
- tstrerror(code), pCompactor->fid);
- if (pCompactor->pWriter) tsdbDataFWriterClose(&pCompactor->pWriter, 0);
- while ((pCompactor->pIter = pCompactor->iterList)) {
- pCompactor->iterList = pCompactor->pIter->next;
- tsdbCloseDataIter2(pCompactor->pIter);
- }
- if (pCompactor->pReader) tsdbDataFReaderClose(&pCompactor->pReader);
- }
- return code;
-}
-
-static void tsdbEndCompact(STsdbCompactor *pCompactor) {
- // writer
- tBlockDataDestroy(&pCompactor->sData);
- tBlockDataDestroy(&pCompactor->bData);
- taosArrayDestroy(pCompactor->aSttBlk);
- tMapDataClear(&pCompactor->mDataBlk);
- taosArrayDestroy(pCompactor->aBlockIdx);
-
- // reader
-
- // tombstone
- taosArrayDestroy(pCompactor->aSkyLine);
- taosArrayDestroy(pCompactor->aDelData);
- taosArrayDestroy(pCompactor->aDelIdx);
-
- // others
- tDestroyTSchema(pCompactor->tbSkm.pTSchema);
- tsdbFSDestroy(&pCompactor->fs);
-
- tsdbInfo("vgId:%d %s done, commit ID:%" PRId64, TD_VID(pCompactor->pTsdb->pVnode), __func__, pCompactor->commitID);
-}
-
-static int32_t tsdbBeginCompact(STsdb *pTsdb, SCompactInfo *pInfo, STsdbCompactor *pCompactor) {
- int32_t code = 0;
- int32_t lino = 0;
-
- pCompactor->pTsdb = pTsdb;
- pCompactor->commitID = pInfo->commitID;
- pCompactor->cmprAlg = pTsdb->pVnode->config.tsdbCfg.compression;
- pCompactor->maxRows = pTsdb->pVnode->config.tsdbCfg.maxRows;
- pCompactor->minRows = pTsdb->pVnode->config.tsdbCfg.minRows;
- pCompactor->fid = INT32_MIN;
-
- code = tsdbFSCopy(pTsdb, &pCompactor->fs);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- /* tombstone */
- if (pCompactor->fs.pDelFile) {
- code = tsdbDelFReaderOpen(&pCompactor->pDelFReader, pCompactor->fs.pDelFile, pTsdb);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- if ((pCompactor->aDelIdx = taosArrayInit(0, sizeof(SDelIdx))) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- if ((pCompactor->aDelData = taosArrayInit(0, sizeof(SDelData))) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- if ((pCompactor->aSkyLine = taosArrayInit(0, sizeof(TSDBKEY))) == NULL) {
- code = TSDB_CODE_OUT_OF_MEMORY;
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- code = tsdbReadDelIdx(pCompactor->pDelFReader, pCompactor->aDelIdx);
- TSDB_CHECK_CODE(code, lino, _exit);
- }
-
- /* reader */
-
- /* writer */
- code = tBlockDataCreate(&pCompactor->bData);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = tBlockDataCreate(&pCompactor->sData);
- TSDB_CHECK_CODE(code, lino, _exit);
-
-_exit:
- if (code) {
- tsdbError("vgId:%d %s failed at line %d since %s, commit ID:%" PRId64, TD_VID(pTsdb->pVnode), __func__, lino,
- tstrerror(code), pCompactor->commitID);
- tBlockDataDestroy(&pCompactor->sData);
- tBlockDataDestroy(&pCompactor->bData);
- if (pCompactor->fs.pDelFile) {
- taosArrayDestroy(pCompactor->aSkyLine);
- taosArrayDestroy(pCompactor->aDelData);
- taosArrayDestroy(pCompactor->aDelIdx);
- if (pCompactor->pDelFReader) tsdbDelFReaderClose(&pCompactor->pDelFReader);
- }
- tsdbFSDestroy(&pCompactor->fs);
- } else {
- tsdbInfo("vgId:%d %s done, commit ID:%" PRId64, TD_VID(pTsdb->pVnode), __func__, pCompactor->commitID);
- }
- return code;
-}
-
-int32_t tsdbCompact(STsdb *pTsdb, SCompactInfo *pInfo) {
- int32_t code = 0;
-
- STsdbCompactor *pCompactor = &(STsdbCompactor){0};
-
- if ((code = tsdbBeginCompact(pTsdb, pInfo, pCompactor))) return code;
-
- for (;;) {
- SDFileSet *pSet = (SDFileSet *)taosArraySearch(pCompactor->fs.aDFileSet, &(SDFileSet){.fid = pCompactor->fid},
- tDFileSetCmprFn, TD_GT);
- if (pSet == NULL) {
- pCompactor->fid = INT32_MAX;
- break;
- }
-
- if ((code = tsdbCompactFileSet(pCompactor, pSet))) goto _exit;
- }
-
- if ((code = tsdbFSUpsertDelFile(&pCompactor->fs, NULL))) goto _exit;
-
-_exit:
- if (code) {
- tsdbAbortCompact(pCompactor);
- } else {
- tsdbCommitCompact(pCompactor);
- }
- tsdbEndCompact(pCompactor);
- return code;
-}
diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
index d4af0422d7..d9d60442ff 100644
--- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
@@ -404,7 +404,7 @@ void tLDataIterNextBlock(SLDataIter *pIter, const char *idStr) {
tsdbDebug("try next last file block:%d from %d, trigger by uid:%" PRIu64 ", file index:%d, %s", pIter->iSttBlk,
oldIndex, pIter->uid, pIter->iStt, idStr);
} else {
- tsdbDebug("no more last block qualified, uid:%" PRIu64 ", file index::%d, %s", pIter->uid, oldIndex, idStr);
+ tsdbDebug("no more last block qualified, uid:%" PRIu64 ", file index:%d, %s", pIter->uid, oldIndex, idStr);
}
}
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c
index a158bbfa8d..31153f0832 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead.c
@@ -44,6 +44,7 @@ typedef struct SBlockIndex {
typedef struct STableBlockScanInfo {
uint64_t uid;
TSKEY lastKey;
+ TSKEY lastKeyInStt; // last accessed key in stt
SMapData mapData; // block info (compressed)
SArray* pBlockList; // block data index list, SArray
SIterInfo iter; // mem buffer skip list iterator
@@ -192,7 +193,7 @@ static TSDBROW* getValidMemRow(SIterInfo* pIter, const SArray* pDelList, STsdbRe
static int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pScanInfo, STsdbReader* pReader,
SRowMerger* pMerger);
static int32_t doMergeRowsInLastBlock(SLastBlockReader* pLastBlockReader, STableBlockScanInfo* pScanInfo, int64_t ts,
- SRowMerger* pMerger, SVersionRange* pVerRange);
+ SRowMerger* pMerger, SVersionRange* pVerRange, const char* id);
static int32_t doMergeRowsInBuf(SIterInfo* pIter, uint64_t uid, int64_t ts, SArray* pDelList, SRowMerger* pMerger,
STsdbReader* pReader);
static int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pTSRow,
@@ -314,11 +315,11 @@ static int32_t ensureBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables)
}
if (pBuf->numOfTables > 0) {
- STableBlockScanInfo **p = (STableBlockScanInfo**)taosArrayPop(pBuf->pData);
+ STableBlockScanInfo** p = (STableBlockScanInfo**)taosArrayPop(pBuf->pData);
taosMemoryFree(*p);
pBuf->numOfTables /= pBuf->numPerBucket;
}
-
+
int32_t num = (numOfTables - pBuf->numOfTables) / pBuf->numPerBucket;
int32_t remainder = (numOfTables - pBuf->numOfTables) % pBuf->numPerBucket;
if (pBuf->pData == NULL) {
@@ -402,9 +403,11 @@ static SHashObj* createDataBlockScanInfo(STsdbReader* pTsdbReader, SBlockInfoBuf
if (ASCENDING_TRAVERSE(pTsdbReader->order)) {
int64_t skey = pTsdbReader->window.skey;
pScanInfo->lastKey = (skey > INT64_MIN) ? (skey - 1) : skey;
+ pScanInfo->lastKeyInStt = skey;
} else {
int64_t ekey = pTsdbReader->window.ekey;
pScanInfo->lastKey = (ekey < INT64_MAX) ? (ekey + 1) : ekey;
+ pScanInfo->lastKeyInStt = ekey;
}
taosHashPut(pTableMap, &pScanInfo->uid, sizeof(uint64_t), &pScanInfo, POINTER_BYTES);
@@ -916,8 +919,10 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SBlockN
pBlockNum->numOfBlocks += 1;
}
- if ((pScanInfo->pBlockList != NULL )&& (taosArrayGetSize(pScanInfo->pBlockList) > 0)) {
- numOfQTable += 1;
+ if (pScanInfo->pBlockList != NULL) {
+ if (taosArrayGetSize(pScanInfo->pBlockList) > 0) {
+ numOfQTable += 1;
+ }
}
}
@@ -1795,21 +1800,18 @@ static bool nextRowFromLastBlocks(SLastBlockReader* pLastBlockReader, STableBloc
while (1) {
bool hasVal = tMergeTreeNext(&pLastBlockReader->mergeTree);
- if (!hasVal) {
+ if (!hasVal) { // the next value will be the accessed key in stt
+ pScanInfo->lastKeyInStt += step;
return false;
}
TSDBROW row = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
TSDBKEY k = TSDBROW_KEY(&row);
- if (hasBeenDropped(pScanInfo->delSkyline, &pScanInfo->lastBlockDelIndex, &k, pLastBlockReader->order, pVerRange)) {
- pScanInfo->lastKey = k.ts;
- } else {
+ pScanInfo->lastKeyInStt = k.ts;
+
+ if (!hasBeenDropped(pScanInfo->delSkyline, &pScanInfo->lastBlockDelIndex, &k, pLastBlockReader->order, pVerRange)) {
// the qualifed ts may equal to k.ts, only a greater version one.
// here we need to fallback one step.
- if (pScanInfo->lastKey == k.ts) {
- pScanInfo->lastKey -= step;
- }
-
return true;
}
}
@@ -1949,7 +1951,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
return code;
}
}
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange, pReader->idStr);
}
if (minKey == k.ts) {
@@ -1997,7 +1999,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
return code;
}
}
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange, pReader->idStr);
}
if (minKey == key) {
@@ -2050,7 +2052,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
TSDBROW fRow1 = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
tsdbRowMerge(&merge, &fRow1);
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLastBlock, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLastBlock, &merge, &pReader->verRange, pReader->idStr);
code = tsdbRowMergerGetRow(&merge, &pTSRow);
if (code != TSDB_CODE_SUCCESS) {
@@ -2068,7 +2070,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
return code;
}
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLastBlock, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLastBlock, &merge, &pReader->verRange, pReader->idStr);
// merge with block data if ts == key
if (tsLastBlock == pBlockData->aTSKEY[pDumpInfo->rowIndex]) {
@@ -2121,7 +2123,7 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
TSDBROW fRow1 = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
tsdbRowMerge(&merge, &fRow1);
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, ts, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, ts, &merge, &pReader->verRange, pReader->idStr);
code = tsdbRowMergerGetRow(&merge, &pTSRow);
if (code != TSDB_CODE_SUCCESS) {
@@ -2230,7 +2232,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
}
}
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange, pReader->idStr);
}
if (minKey == ik.ts) {
@@ -2321,7 +2323,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
return code;
}
}
- doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange);
+ doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, tsLast, &merge, &pReader->verRange, pReader->idStr);
}
if (minKey == key) {
@@ -2472,9 +2474,9 @@ static bool initLastBlockReader(SLastBlockReader* pLBlockReader, STableBlockScan
int32_t step = ASCENDING_TRAVERSE(pLBlockReader->order) ? 1 : -1;
STimeWindow w = pLBlockReader->window;
if (ASCENDING_TRAVERSE(pLBlockReader->order)) {
- w.skey = pScanInfo->lastKey + step;
+ w.skey = pScanInfo->lastKeyInStt;
} else {
- w.ekey = pScanInfo->lastKey + step;
+ w.ekey = pScanInfo->lastKeyInStt;
}
tsdbDebug("init last block reader, window:%" PRId64 "-%" PRId64 ", uid:%" PRIu64 ", %s", w.skey, w.ekey,
@@ -3512,6 +3514,7 @@ static int32_t checkForNeighborFileBlock(STsdbReader* pReader, STableBlockScanIn
CHECK_FILEBLOCK_STATE* state) {
SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo;
SBlockData* pBlockData = &pReader->status.fileBlockData;
+ bool asc = ASCENDING_TRAVERSE(pReader->order);
*state = CHECK_FILEBLOCK_QUIT;
int32_t step = ASCENDING_TRAVERSE(pReader->order) ? 1 : -1;
@@ -3522,7 +3525,7 @@ static int32_t checkForNeighborFileBlock(STsdbReader* pReader, STableBlockScanIn
if (loadNeighbor && (code == TSDB_CODE_SUCCESS)) {
pDumpInfo->rowIndex =
doMergeRowsInFileBlockImpl(pBlockData, pDumpInfo->rowIndex, key, pMerger, &pReader->verRange, step);
- if (pDumpInfo->rowIndex >= pDumpInfo->totalRows) {
+ if ((pDumpInfo->rowIndex >= pDumpInfo->totalRows && asc) || (pDumpInfo->rowIndex < 0 && !asc)) {
*state = CHECK_FILEBLOCK_CONT;
}
}
@@ -3567,13 +3570,16 @@ int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pSc
}
int32_t doMergeRowsInLastBlock(SLastBlockReader* pLastBlockReader, STableBlockScanInfo* pScanInfo, int64_t ts,
- SRowMerger* pMerger, SVersionRange* pVerRange) {
+ SRowMerger* pMerger, SVersionRange* pVerRange, const char* idStr) {
while (nextRowFromLastBlocks(pLastBlockReader, pScanInfo, pVerRange)) {
int64_t next1 = getCurrentKeyInLastBlock(pLastBlockReader);
if (next1 == ts) {
TSDBROW fRow1 = tMergeTreeGetRow(&pLastBlockReader->mergeTree);
tsdbRowMerge(pMerger, &fRow1);
} else {
+ tsdbTrace("uid:%" PRIu64 " last del index:%d, del range:%d, lastKeyInStt:%" PRId64 ", %s", pScanInfo->uid,
+ pScanInfo->lastBlockDelIndex, (int32_t)taosArrayGetSize(pScanInfo->delSkyline), pScanInfo->lastKeyInStt,
+ idStr);
break;
}
}
@@ -3923,7 +3929,8 @@ int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t n
if (code) {
return code;
}
- pReader->status.uidList.tableUidList = (uint64_t*)taosMemoryRealloc(pReader->status.uidList.tableUidList, sizeof(uint64_t) * num);
+ pReader->status.uidList.tableUidList =
+ (uint64_t*)taosMemoryRealloc(pReader->status.uidList.tableUidList, sizeof(uint64_t) * num);
}
taosHashClear(pReader->status.pTableMap);
@@ -3936,6 +3943,17 @@ int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t n
pInfo->uid = pList[i].uid;
pUidList->tableUidList[i] = pList[i].uid;
+ // todo extract method
+ if (ASCENDING_TRAVERSE(pReader->order)) {
+ int64_t skey = pReader->window.skey;
+ pInfo->lastKey = (skey > INT64_MIN) ? (skey - 1) : skey;
+ pInfo->lastKeyInStt = skey;
+ } else {
+ int64_t ekey = pReader->window.ekey;
+ pInfo->lastKey = (ekey < INT64_MAX) ? (ekey + 1) : ekey;
+ pInfo->lastKeyInStt = ekey;
+ }
+
taosHashPut(pReader->status.pTableMap, &pInfo->uid, sizeof(uint64_t), &pInfo, POINTER_BYTES);
}
@@ -4720,8 +4738,12 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
return code;
}
-static int32_t getBucketIndex(int32_t startRow, int32_t bucketRange, int32_t numOfRows) {
- return (numOfRows - startRow) / bucketRange;
+static int32_t getBucketIndex(int32_t startRow, int32_t bucketRange, int32_t numOfRows, int32_t numOfBucket) {
+ int32_t bucketIndex = ((numOfRows - startRow) / bucketRange);
+ if (bucketIndex == numOfBucket) {
+ bucketIndex -= 1;
+ }
+ return bucketIndex;
}
int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTableBlockInfo) {
@@ -4730,8 +4752,11 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->totalRows = 0;
pTableBlockInfo->numOfVgroups = 1;
+ const int32_t numOfBuckets = 20.0;
+
// find the start data block in file
+ // find the start data block in file
tsdbAcquireReader(pReader);
if (pReader->suspended) {
tsdbReaderResume(pReader);
@@ -4742,7 +4767,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->defMinRows = pc->minRows;
pTableBlockInfo->defMaxRows = pc->maxRows;
- int32_t bucketRange = ceil((pc->maxRows - pc->minRows) / 20.0);
+ int32_t bucketRange = ceil((pc->maxRows - pc->minRows) / numOfBuckets);
pTableBlockInfo->numOfFiles += 1;
@@ -4780,7 +4805,7 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
pTableBlockInfo->totalSize += pBlock->aSubBlock[0].szBlock;
- int32_t bucketIndex = getBucketIndex(pTableBlockInfo->defMinRows, bucketRange, numOfRows);
+ 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/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c
index c6e1ed99f1..7c7e1bd0f7 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRetention.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c
@@ -15,7 +15,7 @@
#include "tsdb.h"
-static bool tsdbShouldDoRetention(STsdb *pTsdb, int64_t now) {
+static bool tsdbShouldDoRetentionImpl(STsdb *pTsdb, int64_t now) {
for (int32_t iSet = 0; iSet < taosArrayGetSize(pTsdb->fs.aDFileSet); iSet++) {
SDFileSet *pSet = (SDFileSet *)taosArrayGet(pTsdb->fs.aDFileSet, iSet);
int32_t expLevel = tsdbFidLevel(pSet->fid, &pTsdb->keepCfg, now);
@@ -38,19 +38,21 @@ static bool tsdbShouldDoRetention(STsdb *pTsdb, int64_t now) {
return false;
}
+bool tsdbShouldDoRetention(STsdb *pTsdb, int64_t now) {
+ bool should;
+ taosThreadRwlockRdlock(&pTsdb->rwLock);
+ should = tsdbShouldDoRetentionImpl(pTsdb, now);
+ taosThreadRwlockUnlock(&pTsdb->rwLock);
+ return should;
+}
int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now) {
int32_t code = 0;
-
- if (!tsdbShouldDoRetention(pTsdb, now)) {
- return code;
- }
-
- // do retention
+ int32_t lino = 0;
STsdbFS fs = {0};
code = tsdbFSCopy(pTsdb, &fs);
- if (code) goto _err;
+ TSDB_CHECK_CODE(code, lino, _exit);
for (int32_t iSet = 0; iSet < taosArrayGetSize(fs.aDFileSet); iSet++) {
SDFileSet *pSet = (SDFileSet *)taosArrayGet(fs.aDFileSet, iSet);
@@ -60,8 +62,10 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now) {
if (expLevel < 0) {
taosMemoryFree(pSet->pHeadF);
taosMemoryFree(pSet->pDataF);
- taosMemoryFree(pSet->aSttF[0]);
taosMemoryFree(pSet->pSmaF);
+ for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) {
+ taosMemoryFree(pSet->aSttF[iStt]);
+ }
taosArrayRemove(fs.aDFileSet, iSet);
iSet--;
} else {
@@ -78,35 +82,33 @@ int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now) {
fSet.diskId = did;
code = tsdbDFileSetCopy(pTsdb, pSet, &fSet);
- if (code) goto _err;
+ TSDB_CHECK_CODE(code, lino, _exit);
code = tsdbFSUpsertFSet(&fs, &fSet);
- if (code) goto _err;
+ TSDB_CHECK_CODE(code, lino, _exit);
}
}
// do change fs
code = tsdbFSPrepareCommit(pTsdb, &fs);
- if (code) goto _err;
-
- taosThreadRwlockWrlock(&pTsdb->rwLock);
-
- code = tsdbFSCommit(pTsdb);
- if (code) {
- taosThreadRwlockUnlock(&pTsdb->rwLock);
- goto _err;
- }
-
- taosThreadRwlockUnlock(&pTsdb->rwLock);
-
- tsdbFSDestroy(&fs);
+ TSDB_CHECK_CODE(code, lino, _exit);
_exit:
+ if (code) {
+ tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
+ } else {
+ tsdbInfo("vgId:%d %s done", TD_VID(pTsdb->pVnode), __func__);
+ }
+ tsdbFSDestroy(&fs);
return code;
+}
-_err:
- tsdbError("vgId:%d, tsdb do retention failed since %s", TD_VID(pTsdb->pVnode), tstrerror(code));
- ASSERT(0);
- // tsdbFSRollback(pTsdb->pFS);
- return code;
+static int32_t tsdbCommitRetentionImpl(STsdb *pTsdb) { return tsdbFSCommit(pTsdb); }
+
+int32_t tsdbCommitRetention(STsdb *pTsdb) {
+ taosThreadRwlockWrlock(&pTsdb->rwLock);
+ tsdbCommitRetentionImpl(pTsdb);
+ taosThreadRwlockUnlock(&pTsdb->rwLock);
+ tsdbInfo("vgId:%d %s done", TD_VID(pTsdb->pVnode), __func__);
+ return 0;
}
\ No newline at end of file
diff --git a/source/dnode/vnode/src/tsdb/tsdbWrite.c b/source/dnode/vnode/src/tsdb/tsdbWrite.c
index bd2d263804..2dbac956ed 100644
--- a/source/dnode/vnode/src/tsdb/tsdbWrite.c
+++ b/source/dnode/vnode/src/tsdb/tsdbWrite.c
@@ -35,9 +35,7 @@ int tsdbInsertData(STsdb *pTsdb, int64_t version, SSubmitReq2 *pMsg, SSubmitRsp2
return -1;
}
- if (pMsg) {
- arrSize = taosArrayGetSize(pMsg->aSubmitTbData);
- }
+ arrSize = taosArrayGetSize(pMsg->aSubmitTbData);
// scan and convert
if (tsdbScanAndConvertSubmitMsg(pTsdb, pMsg) < 0) {
diff --git a/source/dnode/vnode/src/vnd/vnodeCompact.c b/source/dnode/vnode/src/vnd/vnodeRetention.c
similarity index 54%
rename from source/dnode/vnode/src/vnd/vnodeCompact.c
rename to source/dnode/vnode/src/vnd/vnodeRetention.c
index 16e39d75dc..170deb4286 100644
--- a/source/dnode/vnode/src/vnd/vnodeCompact.c
+++ b/source/dnode/vnode/src/vnd/vnodeRetention.c
@@ -15,43 +15,54 @@
#include "vnd.h"
-static int32_t vnodeCompactTask(void *param) {
+typedef struct {
+ SVnode *pVnode;
+ int64_t now;
+ int64_t commitID;
+ SVnodeInfo info;
+} SRetentionInfo;
+
+extern bool tsdbShouldDoRetention(STsdb *pTsdb, int64_t now);
+extern int32_t tsdbDoRetention(STsdb *pTsdb, int64_t now);
+extern int32_t tsdbCommitRetention(STsdb *pTsdb);
+
+static int32_t vnodePrepareRentention(SVnode *pVnode, SRetentionInfo *pInfo) {
int32_t code = 0;
int32_t lino = 0;
- SCompactInfo *pInfo = (SCompactInfo *)param;
- SVnode *pVnode = pInfo->pVnode;
+ tsem_wait(&pVnode->canCommit);
- // do compact
- code = tsdbCompact(pInfo->pVnode->pTsdb, pInfo);
- TSDB_CHECK_CODE(code, lino, _exit);
+ pInfo->commitID = ++pVnode->state.commitID;
- // end compact
char dir[TSDB_FILENAME_LEN] = {0};
if (pVnode->pTfs) {
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path);
} else {
snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path);
}
- vnodeCommitInfo(dir);
+
+ if (vnodeLoadInfo(dir, &pInfo->info) < 0) {
+ code = terrno;
+ TSDB_CHECK_CODE(code, lino, _exit);
+ }
_exit:
- tsem_post(&pInfo->pVnode->canCommit);
- taosMemoryFree(pInfo);
+ if (code) {
+ vError("vgId:%d %s failed at line %d since %s", TD_VID(pVnode), __func__, lino, tstrerror(code));
+ tsem_post(&pVnode->canCommit);
+ } else {
+ vInfo("vgId:%d %s done", TD_VID(pVnode), __func__);
+ }
return code;
}
-static int32_t vnodePrepareCompact(SVnode *pVnode, SCompactInfo *pInfo) {
+
+static int32_t vnodeRetentionTask(void *param) {
int32_t code = 0;
int32_t lino = 0;
- tsem_wait(&pVnode->canCommit);
-
- pInfo->pVnode = pVnode;
- pInfo->flag = 0;
- pInfo->commitID = ++pVnode->state.commitID;
-
- char dir[TSDB_FILENAME_LEN] = {0};
- SVnodeInfo info = {0};
+ SRetentionInfo *pInfo = (SRetentionInfo *)param;
+ SVnode *pVnode = pInfo->pVnode;
+ char dir[TSDB_FILENAME_LEN] = {0};
if (pVnode->pTfs) {
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path);
@@ -59,57 +70,61 @@ static int32_t vnodePrepareCompact(SVnode *pVnode, SCompactInfo *pInfo) {
snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path);
}
- if (vnodeLoadInfo(dir, &info) < 0) {
+ // save info
+ pInfo->info.state.commitID = pInfo->commitID;
+
+ if (vnodeSaveInfo(dir, &pInfo->info) < 0) {
code = terrno;
- goto _exit;
+ TSDB_CHECK_CODE(code, lino, _exit);
}
- info.state.commitID = pInfo->commitID;
+ // do job
+ code = tsdbDoRetention(pInfo->pVnode->pTsdb, pInfo->now);
+ TSDB_CHECK_CODE(code, lino, _exit);
- if (vnodeSaveInfo(dir, &info) < 0) {
- code = terrno;
- goto _exit;
- }
+ // commit info
+ vnodeCommitInfo(dir);
+
+ // commit sub-job
+ tsdbCommitRetention(pVnode->pTsdb);
_exit:
if (code) {
- vError("vgId:%d %s failed at line %d since %s, commit ID:%" PRId64, TD_VID(pVnode), __func__, lino, tstrerror(code),
- pVnode->state.commitID);
+ vError("vgId:%d %s failed at line %d since %s", TD_VID(pInfo->pVnode), __func__, lino, tstrerror(code));
} else {
- vDebug("vgId:%d %s done, commit ID:%" PRId64, TD_VID(pVnode), __func__, pVnode->state.commitID);
+ vInfo("vgId:%d %s done", TD_VID(pInfo->pVnode), __func__);
}
+ tsem_post(&pInfo->pVnode->canCommit);
+ taosMemoryFree(pInfo);
return code;
}
-int32_t vnodeAsyncCompact(SVnode *pVnode) {
+
+int32_t vnodeAsyncRentention(SVnode *pVnode, int64_t now) {
int32_t code = 0;
int32_t lino = 0;
- SCompactInfo *pInfo = taosMemoryCalloc(1, sizeof(*pInfo));
+ if (!tsdbShouldDoRetention(pVnode->pTsdb, now)) return code;
+
+ SRetentionInfo *pInfo = (SRetentionInfo *)taosMemoryCalloc(1, sizeof(*pInfo));
if (pInfo == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
TSDB_CHECK_CODE(code, lino, _exit);
}
- vnodeAsyncCommit(pVnode);
+ pInfo->pVnode = pVnode;
+ pInfo->now = now;
- code = vnodePrepareCompact(pVnode, pInfo);
+ code = vnodePrepareRentention(pVnode, pInfo);
TSDB_CHECK_CODE(code, lino, _exit);
- vnodeScheduleTask(vnodeCompactTask, pInfo);
+ vnodeScheduleTask(vnodeRetentionTask, pInfo);
_exit:
if (code) {
- vError("vgId:%d %s failed at line %d since %s", TD_VID(pVnode), __func__, lino, tstrerror(code));
+ vError("vgId:%d %s failed at line %d since %s", TD_VID(pInfo->pVnode), __func__, lino, tstrerror(code));
if (pInfo) taosMemoryFree(pInfo);
} else {
- vInfo("vgId:%d %s done", TD_VID(pVnode), __func__);
+ vInfo("vgId:%d %s done", TD_VID(pInfo->pVnode), __func__);
}
- return code;
-}
-
-int32_t vnodeSyncCompact(SVnode *pVnode) {
- vnodeAsyncCompact(pVnode);
- tsem_wait(&pVnode->canCommit);
- tsem_post(&pVnode->canCommit);
return 0;
}
\ No newline at end of file
diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c
index 8651478afa..fb8d230eba 100644
--- a/source/dnode/vnode/src/vnd/vnodeSvr.c
+++ b/source/dnode/vnode/src/vnd/vnodeSvr.c
@@ -211,6 +211,11 @@ static int32_t vnodePreProcessSubmitMsg(SVnode *pVnode, SRpcMsg *pMsg) {
SDecoder *pCoder = &(SDecoder){0};
+ if (taosHton64(((SSubmitReq2Msg *)pMsg->pCont)->version) != 1) {
+ code = TSDB_CODE_INVALID_MSG;
+ TSDB_CHECK_CODE(code, lino, _exit);
+ }
+
tDecoderInit(pCoder, (uint8_t *)pMsg->pCont + sizeof(SSubmitReq2Msg), pMsg->contLen - sizeof(SSubmitReq2Msg));
if (tStartDecode(pCoder) < 0) {
@@ -586,6 +591,7 @@ void vnodeUpdateMetaRsp(SVnode *pVnode, STableMetaRsp *pMetaRsp) {
pMetaRsp->precision = pVnode->config.tsdbCfg.precision;
}
+extern int32_t vnodeAsyncRentention(SVnode *pVnode, int64_t now);
static int32_t vnodeProcessTrimReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) {
int32_t code = 0;
SVTrimDbReq trimReq = {0};
@@ -599,11 +605,9 @@ static int32_t vnodeProcessTrimReq(SVnode *pVnode, int64_t version, void *pReq,
vInfo("vgId:%d, trim vnode request will be processed, time:%d", pVnode->config.vgId, trimReq.timestamp);
// process
- code = tsdbDoRetention(pVnode->pTsdb, trimReq.timestamp);
- if (code) goto _exit;
-
- code = smaDoRetention(pVnode->pSma, trimReq.timestamp);
- if (code) goto _exit;
+ vnodeAsyncRentention(pVnode, trimReq.timestamp);
+ tsem_wait(&pVnode->canCommit);
+ tsem_post(&pVnode->canCommit);
_exit:
return code;
@@ -628,14 +632,7 @@ static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t version, void *p
tqUpdateTbUidList(pVnode->pTq, tbUids, false);
}
-#if 0
- // process
- ret = tsdbDoRetention(pVnode->pTsdb, ttlReq.timestamp);
- if (ret) goto end;
-
- ret = smaDoRetention(pVnode->pSma, ttlReq.timestamp);
- if (ret) goto end;
-#endif
+ vnodeAsyncRentention(pVnode, ttlReq.timestamp);
end:
taosArrayDestroy(tbUids);
@@ -1219,6 +1216,49 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
tDecoderClear(&dc);
}
+ // scan
+ TSKEY now = taosGetTimestamp(pVnode->config.tsdbCfg.precision);
+ TSKEY minKey = now - tsTickPerMin[pVnode->config.tsdbCfg.precision] * pVnode->config.tsdbCfg.keep2;
+ TSKEY maxKey = tsMaxKeyByPrecision[pVnode->config.tsdbCfg.precision];
+ for (int32_t i = 0; i < TARRAY_SIZE(pSubmitReq->aSubmitTbData); ++i) {
+ SSubmitTbData *pSubmitTbData = taosArrayGet(pSubmitReq->aSubmitTbData, i);
+
+ if (pSubmitTbData->pCreateTbReq && pSubmitTbData->pCreateTbReq->uid == 0) {
+ code = TSDB_CODE_INVALID_MSG;
+ goto _exit;
+ }
+
+ if (pSubmitTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) {
+ if (TARRAY_SIZE(pSubmitTbData->aCol) <= 0) {
+ code = TSDB_CODE_INVALID_MSG;
+ goto _exit;
+ }
+
+ SColData *pColData = (SColData *)taosArrayGet(pSubmitTbData->aCol, 0);
+ TSKEY *aKey = (TSKEY *)(pColData->pData);
+
+ for (int32_t iRow = 0; iRow < pColData->nVal; iRow++) {
+ if (aKey[iRow] < minKey || aKey[iRow] > maxKey || (iRow > 0 && aKey[iRow] <= aKey[iRow - 1])) {
+ code = TSDB_CODE_INVALID_MSG;
+ vError("vgId:%d %s failed since %s, version:%" PRId64, TD_VID(pVnode), __func__, tstrerror(terrno), version);
+ goto _exit;
+ }
+ }
+
+ } else {
+ int32_t nRow = TARRAY_SIZE(pSubmitTbData->aRowP);
+ SRow **aRow = (SRow **)TARRAY_DATA(pSubmitTbData->aRowP);
+
+ for (int32_t iRow = 0; iRow < nRow; ++iRow) {
+ if (aRow[iRow]->ts < minKey || aRow[iRow]->ts > maxKey || (iRow > 0 && aRow[iRow]->ts <= aRow[iRow - 1]->ts)) {
+ code = TSDB_CODE_INVALID_MSG;
+ vError("vgId:%d %s failed since %s, version:%" PRId64, TD_VID(pVnode), __func__, tstrerror(terrno), version);
+ goto _exit;
+ }
+ }
+ }
+ }
+
for (int32_t i = 0; i < TARRAY_SIZE(pSubmitReq->aSubmitTbData); ++i) {
SSubmitTbData *pSubmitTbData = taosArrayGet(pSubmitReq->aSubmitTbData, i);
@@ -1264,8 +1304,8 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
goto _exit;
}
- for (int32_t i = 1; i < nColData; i++) {
- if (aColData[i].nVal != aColData[0].nVal) {
+ for (int32_t j = 1; j < nColData; j++) {
+ if (aColData[j].nVal != aColData[0].nVal) {
code = TSDB_CODE_INVALID_MSG;
goto _exit;
}
@@ -1299,8 +1339,8 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
SVCreateTbRsp *pCreateTbRsp = taosArrayReserve(pSubmitRsp->aCreateTbRsp, 1);
// create table
- if (metaCreateTable(pVnode->pMeta, version, pSubmitTbData->pCreateTbReq, &pCreateTbRsp->pMeta) ==
- 0) { // create table success
+ if (metaCreateTable(pVnode->pMeta, version, pSubmitTbData->pCreateTbReq, &pCreateTbRsp->pMeta) == 0) {
+ // create table success
if (newTbUids == NULL &&
(newTbUids = taosArrayInit(TARRAY_SIZE(pSubmitReq->aSubmitTbData), sizeof(int64_t))) == NULL) {
@@ -1330,7 +1370,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
pSubmitRsp->affectedRows += affectedRows;
}
- // update table uid list
+ // update the affected table uid list
if (taosArrayGetSize(newTbUids) > 0) {
vDebug("vgId:%d, add %d table into query table list in handling submit", TD_VID(pVnode),
(int32_t)taosArrayGetSize(newTbUids));
@@ -1632,17 +1672,14 @@ static int32_t vnodeProcessDropIndexReq(SVnode *pVnode, int64_t version, void *p
return TSDB_CODE_SUCCESS;
}
+extern int32_t vnodeProcessCompactVnodeReqImpl(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp);
+
static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) {
- SCompactVnodeReq req = {0};
- if (tDeserializeSCompactVnodeReq(pReq, len, &req) != 0) {
- terrno = TSDB_CODE_INVALID_MSG;
- return TSDB_CODE_INVALID_MSG;
- }
- vInfo("vgId:%d, compact msg will be processed, db:%s dbUid:%" PRId64 " compactStartTime:%" PRId64, TD_VID(pVnode),
- req.db, req.dbUid, req.compactStartTime);
-
- vnodeAsyncCompact(pVnode);
- vnodeBegin(pVnode);
+ return vnodeProcessCompactVnodeReqImpl(pVnode, version, pReq, len, pRsp);
+}
+#ifndef TD_ENTERPRISE
+int32_t vnodeProcessCompactVnodeReqImpl(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) {
return 0;
}
+#endif
diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c
index 1e96a76170..e71b03d2af 100644
--- a/source/dnode/vnode/src/vnd/vnodeSync.c
+++ b/source/dnode/vnode/src/vnd/vnodeSync.c
@@ -292,7 +292,7 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs)
code = vnodePreProcessWriteMsg(pVnode, pMsg);
if (code != 0) {
- vGError("vgId:%d, msg:%p failed to pre-process since %s", vgId, pMsg, terrstr());
+ vGError("vgId:%d, msg:%p failed to pre-process since %s", vgId, pMsg, tstrerror(code));
if (terrno != 0) code = terrno;
vnodeHandleProposeError(pVnode, pMsg, code);
rpcFreeCont(pMsg->pCont);
diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c
index f88701afe2..c862a75ed3 100644
--- a/source/libs/command/src/command.c
+++ b/source/libs/command/src/command.c
@@ -248,13 +248,13 @@ static const char* cacheModelStr(int8_t cacheModel) {
return TSDB_CACHE_MODEL_NONE_STR;
}
-static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, SDbCfgInfo* pCfg) {
+static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbName, char* dbFName, SDbCfgInfo* pCfg) {
blockDataEnsureCapacity(pBlock, 1);
pBlock->info.rows = 1;
SColumnInfoData* pCol1 = taosArrayGet(pBlock->pDataBlock, 0);
char buf1[SHOW_CREATE_DB_RESULT_FIELD1_LEN] = {0};
- STR_TO_VARSTR(buf1, dbFName);
+ STR_TO_VARSTR(buf1, dbName);
colDataSetVal(pCol1, 0, buf1, false);
SColumnInfoData* pCol2 = taosArrayGet(pBlock->pDataBlock, 1);
@@ -277,16 +277,20 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
}
char* retentions = buildRetension(pCfg->pRetensions);
+ int32_t dbFNameLen = strlen(dbFName);
+ int32_t hashPrefix = (pCfg->hashPrefix > (dbFNameLen + 1)) ? (pCfg->hashPrefix - dbFNameLen - 1) : 0;
len += sprintf(
buf2 + VARSTR_HEADER_SIZE,
"CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm "
"WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d STT_TRIGGER %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
- "WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d",
- dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile,
+ "WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d TABLE_PREFIX %d TABLE_SUFFIX %d TSDB_PAGESIZE %d "
+ "WAL_RETENTION_PERIOD %d WAL_RETENTION_SIZE %" PRId64 " WAL_ROLL_PERIOD %d WAL_SEGMENT_SIZE %" PRId64,
+ dbName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile,
pCfg->walFsyncPeriod, pCfg->maxRows, pCfg->minRows, pCfg->sstTrigger, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2,
pCfg->pages, pCfg->pageSize, prec, pCfg->replications, pCfg->walLevel, pCfg->numOfVgroups,
- 1 == pCfg->numOfStables);
+ 1 == pCfg->numOfStables, hashPrefix, pCfg->hashSuffix, pCfg->tsdbPageSize, pCfg->walRetentionPeriod,
+ pCfg->walRetentionSize, pCfg->walRollPeriod, pCfg->walSegmentSize);
if (retentions) {
len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, " RETENTIONS %s", retentions);
@@ -404,7 +408,7 @@ static int32_t execShowCreateDatabase(SShowCreateDatabaseStmt* pStmt, SRetrieveT
SSDataBlock* pBlock = NULL;
int32_t code = buildCreateDBResultDataBlock(&pBlock);
if (TSDB_CODE_SUCCESS == code) {
- setCreateDBResultIntoDataBlock(pBlock, pStmt->dbName, pStmt->pCfg);
+ setCreateDBResultIntoDataBlock(pBlock, pStmt->dbName, pStmt->dbFName, pStmt->pCfg);
}
if (TSDB_CODE_SUCCESS == code) {
code = buildRetrieveTableRsp(pBlock, SHOW_CREATE_DB_RESULT_COLS, pRsp);
diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h
index 1712cba0f5..0b55eb4a45 100644
--- a/source/libs/executor/inc/executorimpl.h
+++ b/source/libs/executor/inc/executorimpl.h
@@ -133,8 +133,7 @@ typedef struct {
int64_t snapshotVer;
// const SSubmitReq* pReq;
- SPackedData submit;
-
+ SPackedData submit;
SSchemaWrapper* schema;
char tbName[TSDB_TABLE_NAME_LEN];
int8_t recoverStep;
@@ -733,7 +732,7 @@ void updateLoadRemoteInfo(SLoadRemoteDataInfo* pInfo, int64_t numOfRows, int3
STimeWindow getFirstQualifiedTimeWindow(int64_t ts, STimeWindow* pWindow, SInterval* pInterval, int32_t order);
-int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag);
+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);
@@ -882,6 +881,7 @@ SExprInfo* createExpr(SNodeList* pNodeList, int32_t* numOfExprs);
void copyResultrowToDataBlock(SExprInfo* pExprInfo, int32_t numOfExprs, SResultRow* pRow, SqlFunctionCtx* pCtx,
SSDataBlock* pBlock, const int32_t* rowEntryOffset, SExecTaskInfo* pTaskInfo);
void doUpdateNumOfRows(SqlFunctionCtx* pCtx, SResultRow* pRow, int32_t numOfExprs, const int32_t* rowEntryOffset);
+void doClearBufferedBlocks(SStreamScanInfo* pInfo);
#ifdef __cplusplus
}
diff --git a/source/libs/executor/src/dataSinkMgt.c b/source/libs/executor/src/dataSinkMgt.c
index 2b50be33ad..7fbde07f59 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/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c
index 49e2d5bc4a..559fce5224 100644
--- a/source/libs/executor/src/eventwindowoperator.c
+++ b/source/libs/executor/src/eventwindowoperator.c
@@ -29,7 +29,7 @@ typedef struct SEventWindowOperatorInfo {
SWindowRowsSup winSup;
int32_t tsSlotId; // primary timestamp column slot id
STimeWindowAggSupp twAggSup;
- uint64_t groupId; // current group id, used to identify the data block from different groups
+ uint64_t groupId; // current group id, used to identify the data block from different groups
SFilterInfo* pStartCondInfo;
SFilterInfo* pEndCondInfo;
bool inWindow;
@@ -310,6 +310,7 @@ int32_t eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* p
pSup->rowEntryInfoOffset, pTaskInfo);
pRes->info.rows += pInfo->pRow->numOfRows;
+ pInfo->pRow->numOfRows = 0;
pInfo->inWindow = false;
rowIndex += 1;
diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c
index 6b6f5cfe93..0ac458af49 100644
--- a/source/libs/executor/src/executil.c
+++ b/source/libs/executor/src/executil.c
@@ -850,32 +850,32 @@ static SSDataBlock* createTagValBlockForFilter(SArray* pColList, int32_t numOfTa
tagVal.cid = pColInfo->info.colId;
if (p1->pTagVal == NULL) {
colDataSetNULL(pColInfo, i);
- }
-
- const char* p = metaGetTableTagVal(p1->pTagVal, pColInfo->info.type, &tagVal);
-
- if (p == NULL || (pColInfo->info.type == TSDB_DATA_TYPE_JSON && ((STag*)p)->nTag == 0)) {
- colDataSetNULL(pColInfo, i);
- } else if (pColInfo->info.type == TSDB_DATA_TYPE_JSON) {
- colDataSetVal(pColInfo, i, p, false);
- } else if (IS_VAR_DATA_TYPE(pColInfo->info.type)) {
- char* tmp = taosMemoryMalloc(tagVal.nData + VARSTR_HEADER_SIZE + 1);
- varDataSetLen(tmp, tagVal.nData);
- memcpy(tmp + VARSTR_HEADER_SIZE, tagVal.pData, tagVal.nData);
- colDataSetVal(pColInfo, i, tmp, false);
-#if TAG_FILTER_DEBUG
- qDebug("tagfilter varch:%s", tmp + 2);
-#endif
- taosMemoryFree(tmp);
} else {
- colDataSetVal(pColInfo, i, (const char*)&tagVal.i64, false);
+ const char* p = metaGetTableTagVal(p1->pTagVal, pColInfo->info.type, &tagVal);
+
+ if (p == NULL || (pColInfo->info.type == TSDB_DATA_TYPE_JSON && ((STag*)p)->nTag == 0)) {
+ colDataSetNULL(pColInfo, i);
+ } else if (pColInfo->info.type == TSDB_DATA_TYPE_JSON) {
+ colDataSetVal(pColInfo, i, p, false);
+ } else if (IS_VAR_DATA_TYPE(pColInfo->info.type)) {
+ char* tmp = taosMemoryMalloc(tagVal.nData + VARSTR_HEADER_SIZE + 1);
+ varDataSetLen(tmp, tagVal.nData);
+ memcpy(tmp + VARSTR_HEADER_SIZE, tagVal.pData, tagVal.nData);
+ colDataSetVal(pColInfo, i, tmp, false);
#if TAG_FILTER_DEBUG
- if (pColInfo->info.type == TSDB_DATA_TYPE_INT) {
- qDebug("tagfilter int:%d", *(int*)(&tagVal.i64));
- } else if (pColInfo->info.type == TSDB_DATA_TYPE_DOUBLE) {
- qDebug("tagfilter double:%f", *(double*)(&tagVal.i64));
- }
+ qDebug("tagfilter varch:%s", tmp + 2);
#endif
+ taosMemoryFree(tmp);
+ } else {
+ colDataSetVal(pColInfo, i, (const char*)&tagVal.i64, false);
+#if TAG_FILTER_DEBUG
+ if (pColInfo->info.type == TSDB_DATA_TYPE_INT) {
+ qDebug("tagfilter int:%d", *(int*)(&tagVal.i64));
+ } else if (pColInfo->info.type == TSDB_DATA_TYPE_DOUBLE) {
+ qDebug("tagfilter double:%f", *(double*)(&tagVal.i64));
+ }
+#endif
+ }
}
}
}
@@ -957,9 +957,7 @@ static int32_t doFilterByTagCond(STableListInfo* pListInfo, SArray* pUidList, SN
STUidTagInfo* pInfo = taosArrayGet(pUidTagList, i);
taosArrayPush(pUidList, &pInfo->uid);
}
-
terrno = 0;
- goto end;
} else {
if ((condType == FILTER_NO_LOGIC || condType == FILTER_AND) && status != SFLT_NOT_INDEX) {
code = metaGetTableTagsByUids(metaHandle, pListInfo->suid, pUidTagList);
diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c
index 347ac369d8..04d54a95ae 100644
--- a/source/libs/executor/src/executor.c
+++ b/source/libs/executor/src/executor.c
@@ -93,6 +93,23 @@ static int32_t doSetStreamOpOpen(SOperatorInfo* pOperator, char* id) {
return 0;
}
+static void clearStreamBlock(SOperatorInfo* pOperator) {
+ if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
+ if (pOperator->numOfDownstream == 1) {
+ return clearStreamBlock(pOperator->pDownstream[0]);
+ }
+ } else {
+ SStreamScanInfo* pInfo = pOperator->info;
+ doClearBufferedBlocks(pInfo);
+ }
+}
+
+void resetTaskInfo(qTaskInfo_t tinfo) {
+ SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
+ pTaskInfo->code = 0;
+ clearStreamBlock(pTaskInfo->pRoot);
+}
+
static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t numOfBlocks, int32_t type, char* id) {
if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
if (pOperator->numOfDownstream == 0) {
@@ -608,6 +625,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) {
}
if (isTaskKilled(pTaskInfo)) {
+ clearStreamBlock(pTaskInfo->pRoot);
atomic_store_64(&pTaskInfo->owner, 0);
qDebug("%s already killed, abort", GET_TASKID(pTaskInfo));
return TSDB_CODE_SUCCESS;
@@ -1035,8 +1053,9 @@ int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq, int64_t sc
int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedData submit) {
SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo;
- ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
- ASSERT(pTaskInfo->streamInfo.submit.msgStr == NULL);
+ ASSERT((pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE )&& (pTaskInfo->streamInfo.submit.msgStr == NULL));
+ qDebug("set the submit block for future scan");
+
pTaskInfo->streamInfo.submit = submit;
return 0;
}
@@ -1047,14 +1066,16 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE);
pTaskInfo->streamInfo.prepareStatus = *pOffset;
pTaskInfo->streamInfo.returned = 0;
+
if (tOffsetEqual(pOffset, &pTaskInfo->streamInfo.lastStatus)) {
return 0;
}
+
if (subType == TOPIC_SUB_TYPE__COLUMN) {
- uint16_t type = pOperator->operatorType;
pOperator->status = OP_OPENED;
+
// TODO add more check
- if (type != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
+ if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) {
ASSERT(pOperator->numOfDownstream == 1);
pOperator = pOperator->pDownstream[0];
}
@@ -1064,11 +1085,13 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
STableScanInfo* pTSInfo = pInfo->pTableScanOp->info;
tsdbReaderClose(pTSInfo->base.dataReader);
pTSInfo->base.dataReader = NULL;
- if (tqSeekVer(pInfo->tqReader, pOffset->version + 1) < 0) {
+ // let's seek to the next version in wal file
+ if (tqSeekVer(pInfo->tqReader, pOffset->version + 1, pTaskInfo->id.str) < 0) {
return -1;
}
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_DATA) {
- /*pInfo->blockType = STREAM_INPUT__TABLE_SCAN;*/
+ // iterate all tables from tableInfoList, and retrieve rows from each table one-by-one
+ // those data are from the snapshot in tsdb, besides the data in the wal file.
int64_t uid = pOffset->uid;
int64_t ts = pOffset->ts;
@@ -1127,7 +1150,6 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
qDebug("tsdb reader offset seek to uid %" PRId64 " ts %" PRId64 ", table cur set to %d , all table num %d", uid,
ts, pTableScanInfo->currentTable, numOfTables);
- /*}*/
} else {
ASSERT(0);
}
@@ -1170,7 +1192,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
tDeleteSSchemaWrapper(pTaskInfo->streamInfo.schema);
pTaskInfo->streamInfo.schema = mtInfo.schema;
- qDebug("tmqsnap qStreamPrepareScan snapshot data uid %" PRId64 " ts %" PRId64, mtInfo.uid, pOffset->ts);
+ qDebug("tmqsnap qStreamPrepareScan snapshot data uid:%" PRId64 " ts %" PRId64, mtInfo.uid, pOffset->ts);
} else if (pOffset->type == TMQ_OFFSET__SNAPSHOT_META) {
SStreamRawScanInfo* pInfo = pOperator->info;
SSnapContext* sContext = pInfo->sContext;
@@ -1178,7 +1200,7 @@ 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, pOffset->uid, pOffset->ts);
+ qDebug("tmqsnap qStreamPrepareScan snapshot meta uid:%" PRId64 " ts %" PRId64, pOffset->uid, pOffset->ts);
} else if (pOffset->type == TMQ_OFFSET__LOG) {
SStreamRawScanInfo* pInfo = pOperator->info;
tsdbReaderClose(pInfo->dataReader);
diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c
index 89e0dd363c..5a2cdffa92 100644
--- a/source/libs/executor/src/executorimpl.c
+++ b/source/libs/executor/src/executorimpl.c
@@ -1197,16 +1197,11 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS
}
if (pBlock->info.rows + pRow->numOfRows > pBlock->info.capacity) {
- // expand the result datablock capacity
- if (pRow->numOfRows > pBlock->info.capacity) {
- blockDataEnsureCapacity(pBlock, pRow->numOfRows);
- qDebug("datablock capacity not sufficient, expand to requried:%d, current capacity:%d, %s", pRow->numOfRows,
- pBlock->info.capacity, GET_TASKID(pTaskInfo));
+ blockDataEnsureCapacity(pBlock, pBlock->info.rows + pRow->numOfRows);
+ qDebug("datablock capacity not sufficient, expand to required:%d, current capacity:%d, %s",
+ (pRow->numOfRows+pBlock->info.rows),
+ pBlock->info.capacity, GET_TASKID(pTaskInfo));
// todo set the pOperator->resultInfo size
- } else {
- releaseBufPage(pBuf, page);
- break;
- }
}
pGroupResInfo->index += 1;
@@ -1449,16 +1444,21 @@ int32_t appendDownstream(SOperatorInfo* p, SOperatorInfo** pDownstream, int32_t
return TSDB_CODE_SUCCESS;
}
-int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag) {
+int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scanFlag, bool inheritUsOrder) {
// todo add more information about exchange operation
int32_t type = pOperator->operatorType;
- if (type == QUERY_NODE_PHYSICAL_PLAN_EXCHANGE || type == QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN ||
- type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN ||
- type == QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN ||
- type == QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN) {
+ if (type == QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN ||
+ type == QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN ||
+ type == QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN) {
*order = TSDB_ORDER_ASC;
*scanFlag = MAIN_SCAN;
return TSDB_CODE_SUCCESS;
+ } else if (type == QUERY_NODE_PHYSICAL_PLAN_EXCHANGE) {
+ if (!inheritUsOrder) {
+ *order = TSDB_ORDER_ASC;
+ }
+ *scanFlag = MAIN_SCAN;
+ return TSDB_CODE_SUCCESS;
} else if (type == QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN) {
STableScanInfo* pTableScanInfo = pOperator->info;
*order = pTableScanInfo->base.cond.order;
@@ -1473,7 +1473,7 @@ int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scan
if (pOperator->pDownstream == NULL || pOperator->pDownstream[0] == NULL) {
return TSDB_CODE_INVALID_PARA;
} else {
- return getTableScanInfo(pOperator->pDownstream[0], order, scanFlag);
+ return getTableScanInfo(pOperator->pDownstream[0], order, scanFlag, inheritUsOrder);
}
}
}
@@ -1589,7 +1589,7 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) {
}
hasValidBlock = true;
- int32_t code = getTableScanInfo(pOperator, &order, &scanFlag);
+ int32_t code = getTableScanInfo(pOperator, &order, &scanFlag, false);
if (code != TSDB_CODE_SUCCESS) {
destroyDataBlockForEmptyInput(blockAllocated, &pBlock);
T_LONG_JMP(pTaskInfo->env, code);
@@ -1996,6 +1996,11 @@ SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode);
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) {
diff --git a/source/libs/executor/src/filloperator.c b/source/libs/executor/src/filloperator.c
index adb045a69f..2a33e3527a 100644
--- a/source/libs/executor/src/filloperator.c
+++ b/source/libs/executor/src/filloperator.c
@@ -69,7 +69,7 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOp
int32_t order = TSDB_ORDER_ASC;
int32_t scanFlag = MAIN_SCAN;
- getTableScanInfo(pOperator, &order, &scanFlag);
+ getTableScanInfo(pOperator, &order, &scanFlag, false);
int64_t ekey = pInfo->existNewGroupBlock->info.window.ekey;
taosResetFillInfo(pInfo->pFillInfo, getFillInfoStart(pInfo->pFillInfo));
@@ -128,7 +128,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
int32_t order = TSDB_ORDER_ASC;
int32_t scanFlag = MAIN_SCAN;
- getTableScanInfo(pOperator, &order, &scanFlag);
+ getTableScanInfo(pOperator, &order, &scanFlag, false);
doHandleRemainBlockFromNewGroup(pOperator, pInfo, pResultInfo, pTaskInfo);
if (pResBlock->info.rows > 0) {
diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c
index 8f5c3786e0..0fc2cdb46a 100644
--- a/source/libs/executor/src/groupoperator.c
+++ b/source/libs/executor/src/groupoperator.c
@@ -383,7 +383,7 @@ static SSDataBlock* hashGroupbyAggregate(SOperatorInfo* pOperator) {
break;
}
- int32_t code = getTableScanInfo(pOperator, &order, &scanFlag);
+ int32_t code = getTableScanInfo(pOperator, &order, &scanFlag, false);
if (code != TSDB_CODE_SUCCESS) {
T_LONG_JMP(pTaskInfo->env, code);
}
@@ -996,14 +996,14 @@ void appendCreateTableRow(SStreamState* pState, SExprSupp* pTableSup, SExprSupp*
memset(tbName, 0, TSDB_TABLE_NAME_LEN);
int32_t len = 0;
if (colDataIsNull_s(pTbCol, pDestBlock->info.rows - 1)) {
- len = TMIN(sizeof(TSDB_DATA_NULL_STR), TSDB_TABLE_NAME_LEN - 1);
- memcpy(tbName, TSDB_DATA_NULL_STR, len);
+ len = 1;
+ tbName[0] = 0;
} else {
void* pData = colDataGetData(pTbCol, pDestBlock->info.rows - 1);
len = TMIN(varDataLen(pData), TSDB_TABLE_NAME_LEN - 1);
memcpy(tbName, varDataVal(pData), len);
+ streamStatePutParName(pState, groupId, tbName);
}
- streamStatePutParName(pState, groupId, tbName);
memcpy(pTmpBlock->info.parTbName, tbName, len);
pDestBlock->info.rows--;
} else {
diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c
index 3ae114c656..49bc5af634 100644
--- a/source/libs/executor/src/projectoperator.c
+++ b/source/libs/executor/src/projectoperator.c
@@ -289,7 +289,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) {
}
// the pDataBlock are always the same one, no need to call this again
- int32_t code = getTableScanInfo(downstream, &order, &scanFlag);
+ int32_t code = getTableScanInfo(downstream, &order, &scanFlag, false);
if (code != TSDB_CODE_SUCCESS) {
T_LONG_JMP(pTaskInfo->env, code);
}
@@ -441,7 +441,7 @@ static void doHandleDataBlock(SOperatorInfo* pOperator, SSDataBlock* pBlock, SOp
SExprSupp* pSup = &pOperator->exprSupp;
// the pDataBlock are always the same one, no need to call this again
- int32_t code = getTableScanInfo(downstream, &order, &scanFlag);
+ int32_t code = getTableScanInfo(downstream, &order, &scanFlag, false);
if (code != TSDB_CODE_SUCCESS) {
T_LONG_JMP(pTaskInfo->env, code);
}
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index a238b84993..2f3b757241 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -945,7 +945,8 @@ SOperatorInfo* createTableSeqScanOperatorInfo(void* pReadHandle, SExecTaskInfo*
return pOperator;
}
-static FORCE_INLINE void doClearBufferedBlocks(SStreamScanInfo* pInfo) {
+FORCE_INLINE void doClearBufferedBlocks(SStreamScanInfo* pInfo) {
+ qDebug("clear buff blocks:%d", (int32_t)taosArrayGetSize(pInfo->pBlockLists));
taosArrayClear(pInfo->pBlockLists);
pInfo->validBlockIndex = 0;
}
@@ -1562,7 +1563,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
SStreamScanInfo* pInfo = pOperator->info;
- qDebug("queue scan called");
+ qDebug("start to exec queue scan");
if (pTaskInfo->streamInfo.submit.msgStr != NULL) {
if (pInfo->tqReader->msg2.msgStr == NULL) {
@@ -1587,7 +1588,6 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
SSDataBlock block = {0};
int32_t code = tqRetrieveDataBlock2(&block, pInfo->tqReader, NULL);
-
if (code != TSDB_CODE_SUCCESS || block.info.rows == 0) {
continue;
}
@@ -1610,6 +1610,8 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
if (pResult && pResult->info.rows > 0) {
qDebug("queue scan tsdb return %d rows min:%" PRId64 " max:%" PRId64, pResult->info.rows,
pResult->info.window.skey, pResult->info.window.ekey);
+ qDebug("queue scan tsdb return %d rows min:%" PRId64 " max:%" PRId64 " wal curVersion:%" PRId64, pResult->info.rows,
+ pResult->info.window.skey, pResult->info.window.ekey, pInfo->tqReader->pWalReader->curVersion);
pTaskInfo->streamInfo.returned = 1;
return pResult;
} else {
@@ -1619,7 +1621,7 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
pTSInfo->base.dataReader = NULL;
tqOffsetResetToLog(&pTaskInfo->streamInfo.prepareStatus, pTaskInfo->streamInfo.snapshotVer);
qDebug("queue scan tsdb over, switch to wal ver %" PRId64 "", pTaskInfo->streamInfo.snapshotVer + 1);
- if (tqSeekVer(pInfo->tqReader, pTaskInfo->streamInfo.snapshotVer + 1) < 0) {
+ if (tqSeekVer(pInfo->tqReader, pTaskInfo->streamInfo.snapshotVer + 1, pTaskInfo->id.str) < 0) {
tqOffsetResetToLog(&pTaskInfo->streamInfo.lastStatus, pTaskInfo->streamInfo.snapshotVer);
return NULL;
}
@@ -1633,8 +1635,12 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
while (1) {
SFetchRet ret = {0};
if (tqNextBlock(pInfo->tqReader, &ret) < 0) {
- qError("failed to get next log block since %s", terrstr());
+ // if the end is reached, terrno is 0
+ if (terrno != 0) {
+ qError("failed to get next log block since %s", terrstr());
+ }
}
+
if (ret.fetchType == FETCH_TYPE__DATA) {
blockDataCleanup(pInfo->pRes);
setBlockIntoRes(pInfo, &ret.data, true);
@@ -1652,8 +1658,6 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
} else if (ret.fetchType == FETCH_TYPE__NONE ||
(ret.fetchType == FETCH_TYPE__SEP && pOperator->status == OP_EXEC_RECV)) {
pTaskInfo->streamInfo.lastStatus = ret.offset;
- ASSERT(pTaskInfo->streamInfo.lastStatus.version >= pTaskInfo->streamInfo.prepareStatus.version);
- ASSERT(pTaskInfo->streamInfo.lastStatus.version + 1 == pInfo->tqReader->pWalReader->curVersion);
char formatBuf[80];
tFormatOffset(formatBuf, 80, &ret.offset);
qDebug("queue scan log return null, offset %s", formatBuf);
@@ -1661,16 +1665,6 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
return NULL;
}
}
-#if 0
- } else if (pTaskInfo->streamInfo.prepareStatus.type == TMQ_OFFSET__SNAPSHOT_DATA) {
- SSDataBlock* pResult = doTableScan(pInfo->pTableScanOp);
- if (pResult && pResult->info.rows > 0) {
- qDebug("stream scan tsdb return %d rows", pResult->info.rows);
- return pResult;
- }
- qDebug("stream scan tsdb return null");
- return NULL;
-#endif
} else {
qError("unexpected streamInfo prepare type: %d", pTaskInfo->streamInfo.prepareStatus.type);
return NULL;
@@ -1920,7 +1914,9 @@ FETCH_NEXT_BLOCK:
doFilter(pInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL);
pInfo->pRes->info.dataLoad = 1;
blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex);
- return pInfo->pRes;
+ if (pInfo->pRes->info.rows > 0) {
+ return pInfo->pRes;
+ }
} break;
case STREAM_SCAN_FROM_DELETE_DATA: {
generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes);
diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c
index 20d4f46eaf..6411d862ae 100644
--- a/source/libs/executor/src/timewindowoperator.c
+++ b/source/libs/executor/src/timewindowoperator.c
@@ -1072,7 +1072,7 @@ static int32_t doOpenIntervalAgg(SOperatorInfo* pOperator) {
break;
}
- getTableScanInfo(pOperator, &pInfo->inputOrder, &scanFlag);
+ getTableScanInfo(pOperator, &pInfo->inputOrder, &scanFlag, true);
if (pInfo->scalarSupp.pExprInfo != NULL) {
SExprSupp* pExprSup = &pInfo->scalarSupp;
@@ -4294,7 +4294,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) {
}
}
- getTableScanInfo(pOperator, &pIaInfo->inputOrder, &scanFlag);
+ getTableScanInfo(pOperator, &pIaInfo->inputOrder, &scanFlag, false);
setInputDataBlock(pSup, pBlock, pIaInfo->inputOrder, scanFlag, true);
doMergeAlignedIntervalAggImpl(pOperator, &pIaInfo->binfo.resultRowInfo, pBlock, pRes);
@@ -4621,7 +4621,7 @@ static SSDataBlock* doMergeIntervalAgg(SOperatorInfo* pOperator) {
break;
}
- getTableScanInfo(pOperator, &iaInfo->inputOrder, &scanFlag);
+ getTableScanInfo(pOperator, &iaInfo->inputOrder, &scanFlag, false);
setInputDataBlock(pExpSupp, pBlock, iaInfo->inputOrder, scanFlag, true);
doMergeIntervalAggImpl(pOperator, &iaInfo->binfo.resultRowInfo, pBlock, scanFlag, pRes);
diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c
index 9986af1691..fbc60041b2 100644
--- a/source/libs/function/src/builtinsimpl.c
+++ b/source/libs/function/src/builtinsimpl.c
@@ -1940,6 +1940,7 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) {
}
if (pInfo->algo != APERCT_ALGO_TDIGEST) {
+ buildHistogramInfo(pInfo);
qDebug("%s after merge, total:%" PRId64 ", numOfEntry:%d, %p", __FUNCTION__, pInfo->pHisto->numOfElems,
pInfo->pHisto->numOfEntries, pInfo->pHisto);
}
@@ -2461,6 +2462,9 @@ static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuer
int32_t numOfElems = 0;
for (int32_t i = start; i < start + pInput->numOfRows; ++i) {
+ if (colDataIsNull_s(pCol, i)) {
+ continue;
+ }
char* data = colDataGetData(pCol, i);
SFirstLastRes* pInputInfo = (SFirstLastRes*)varDataVal(data);
int32_t code = firstLastTransferInfo(pCtx, pInputInfo, pInfo, isFirstQuery, i);
@@ -5438,8 +5442,6 @@ int32_t blockDistFunction(SqlFunctionCtx* pCtx) {
if (pDistInfo->maxRows < p1.maxRows) {
pDistInfo->maxRows = p1.maxRows;
}
- pDistInfo->numOfVgroups += (p1.numOfTables != 0 ? 1 : 0);
-
pDistInfo->numOfVgroups += (p1.numOfTables != 0 ? 1 : 0);
for (int32_t i = 0; i < tListLen(pDistInfo->blockRowsHisto); ++i) {
pDistInfo->blockRowsHisto[i] += p1.blockRowsHisto[i];
@@ -5581,7 +5583,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/udfd.c b/source/libs/function/src/udfd.c
index fe6ed7d785..dc6fc3ad74 100644
--- a/source/libs/function/src/udfd.c
+++ b/source/libs/function/src/udfd.c
@@ -606,9 +606,8 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) {
}
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 || code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING ||
- code == TSDB_CODE_APP_IS_STOPPING) {
+ code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED || code == TSDB_CODE_SYN_RESTORING ||
+ code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING || code == TSDB_CODE_APP_IS_STOPPING) {
if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH ||
msgType == TDMT_SCH_MERGE_FETCH) {
return false;
@@ -673,6 +672,12 @@ int32_t udfdOpenClientRpc() {
rpcInit.rfp = udfdRpcRfp;
rpcInit.compressSize = tsCompressMsgSize;
+ int32_t connLimitNum = tsNumOfRpcSessions / (tsNumOfRpcThreads * 3);
+ connLimitNum = TMAX(connLimitNum, 10);
+ connLimitNum = TMIN(connLimitNum, 500);
+ rpcInit.connLimitNum = connLimitNum;
+ rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
+
global.clientRpc = rpcOpen(&rpcInit);
if (global.clientRpc == NULL) {
fnError("failed to init dnode rpc client");
@@ -765,7 +770,7 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) {
}
void udfdHandleRequest(SUdfdUvConn *conn) {
- char *inputBuf = conn->inputBuf;
+ char *inputBuf = conn->inputBuf;
int32_t inputLen = conn->inputLen;
uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t));
@@ -784,7 +789,7 @@ void udfdHandleRequest(SUdfdUvConn *conn) {
void udfdPipeCloseCb(uv_handle_t *pipe) {
SUdfdUvConn *conn = pipe->data;
- SUvUdfWork* pWork = conn->pWorkList;
+ SUvUdfWork *pWork = conn->pWorkList;
while (pWork != NULL) {
pWork->conn = NULL;
pWork = pWork->pWorkNext;
diff --git a/source/libs/index/src/indexFstFile.c b/source/libs/index/src/indexFstFile.c
index 5a9c8dfe3d..40c50ed9cb 100644
--- a/source/libs/index/src/indexFstFile.c
+++ b/source/libs/index/src/indexFstFile.c
@@ -18,6 +18,7 @@
#include "indexInt.h"
#include "indexUtil.h"
#include "os.h"
+#include "osDef.h"
#include "tutil.h"
static int32_t kBlockSize = 4096;
@@ -172,7 +173,8 @@ static FORCE_INLINE int idxFileCtxDoFlush(IFileCtx* ctx) {
int32_t nw = taosWriteFile(ctx->file.pFile, ctx->file.wBuf, ctx->file.wBufOffset);
ctx->file.wBufOffset = 0;
}
- taosFsyncFile(ctx->file.pFile);
+ int ret = taosFsyncFile(ctx->file.pFile);
+ UNUSED(ret);
} else {
// do nothing
}
@@ -180,11 +182,11 @@ static FORCE_INLINE int idxFileCtxDoFlush(IFileCtx* ctx) {
}
IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int32_t capacity) {
+ int code = 0;
IFileCtx* ctx = taosMemoryCalloc(1, sizeof(IFileCtx));
if (ctx == NULL) {
return NULL;
}
-
ctx->type = type;
if (ctx->type == TFILE) {
// ugly code, refactor later
@@ -192,15 +194,21 @@ IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int
memcpy(ctx->file.buf, path, strlen(path));
if (readOnly == false) {
ctx->file.pFile = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
- taosFtruncateFile(ctx->file.pFile, 0);
- taosStatFile(path, &ctx->file.size, NULL);
+
+ code = taosFtruncateFile(ctx->file.pFile, 0);
+ UNUSED(code);
+
+ code = taosStatFile(path, &ctx->file.size, NULL);
+ UNUSED(code);
ctx->file.wBufOffset = 0;
ctx->file.wBufCap = kBlockSize * 4;
ctx->file.wBuf = taosMemoryCalloc(1, ctx->file.wBufCap);
} else {
ctx->file.pFile = taosOpenFile(path, TD_FILE_READ);
- taosFStatFile(ctx->file.pFile, &ctx->file.size, NULL);
+ code = taosFStatFile(ctx->file.pFile, &ctx->file.size, NULL);
+ UNUSED(code);
+
ctx->file.wBufOffset = 0;
#ifdef USE_MMAP
diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c
index b4f7ea866a..d9a4c5178f 100644
--- a/source/libs/nodes/src/nodesCloneFuncs.c
+++ b/source/libs/nodes/src/nodesCloneFuncs.c
@@ -35,15 +35,15 @@
memcpy(&((pDst)->fldname), &((pSrc)->fldname), size); \
} while (0)
-#define COPY_CHAR_POINT_FIELD(fldname) \
- do { \
- if (NULL == (pSrc)->fldname) { \
- break; \
- } \
+#define COPY_CHAR_POINT_FIELD(fldname) \
+ do { \
+ if (NULL == (pSrc)->fldname) { \
+ break; \
+ } \
(pDst)->fldname = taosStrdup((pSrc)->fldname); \
- if (NULL == (pDst)->fldname) { \
- return TSDB_CODE_OUT_OF_MEMORY; \
- } \
+ if (NULL == (pDst)->fldname) { \
+ return TSDB_CODE_OUT_OF_MEMORY; \
+ } \
} while (0)
#define CLONE_NODE_FIELD(fldname) \
@@ -158,7 +158,7 @@ static int32_t valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) {
case TSDB_DATA_TYPE_NCHAR:
case TSDB_DATA_TYPE_VARCHAR:
case TSDB_DATA_TYPE_VARBINARY: {
- int32_t len = varDataTLen(pSrc->datum.p) + 1;
+ int32_t len = pSrc->node.resType.bytes + 1;
pDst->datum.p = taosMemoryCalloc(1, len);
if (NULL == pDst->datum.p) {
return TSDB_CODE_OUT_OF_MEMORY;
diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c
index 099cd0d3b3..e18de1c1d2 100644
--- a/source/libs/nodes/src/nodesCodeFuncs.c
+++ b/source/libs/nodes/src/nodesCodeFuncs.c
@@ -3269,7 +3269,7 @@ static int32_t jsonToDatum(const SJson* pJson, void* pObj) {
case TSDB_DATA_TYPE_NCHAR:
case TSDB_DATA_TYPE_VARCHAR:
case TSDB_DATA_TYPE_VARBINARY: {
- pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
+ pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + 1);
if (NULL == pNode->datum.p) {
code = TSDB_CODE_OUT_OF_MEMORY;
break;
diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c
index ad80508c64..6c6b6c0e81 100644
--- a/source/libs/nodes/src/nodesMsgFuncs.c
+++ b/source/libs/nodes/src/nodesMsgFuncs.c
@@ -928,7 +928,7 @@ static int32_t msgToDatum(STlv* pTlv, void* pObj) {
code = TSDB_CODE_FAILED;
break;
}
- pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
+ pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + 1);
if (NULL == pNode->datum.p) {
code = TSDB_CODE_OUT_OF_MEMORY;
break;
diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c
index 0419c883e6..22afc7ef55 100644
--- a/source/libs/nodes/src/nodesUtilFuncs.c
+++ b/source/libs/nodes/src/nodesUtilFuncs.c
@@ -963,8 +963,6 @@ void nodesDestroyNode(SNode* pNode) {
case QUERY_NODE_SHOW_USERS_STMT:
case QUERY_NODE_SHOW_LICENCES_STMT:
case QUERY_NODE_SHOW_VGROUPS_STMT:
- case QUERY_NODE_SHOW_DB_ALIVE_STMT:
- case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT:
case QUERY_NODE_SHOW_TOPICS_STMT:
case QUERY_NODE_SHOW_CONSUMERS_STMT:
case QUERY_NODE_SHOW_CONNECTIONS_STMT:
@@ -2101,9 +2099,9 @@ void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal) {
case TSDB_DATA_TYPE_NCHAR:
case TSDB_DATA_TYPE_VARCHAR:
case TSDB_DATA_TYPE_VARBINARY:
- pVal->pz = taosMemoryMalloc(pVal->nLen + VARSTR_HEADER_SIZE + 1);
- memcpy(pVal->pz, pNode->datum.p, pVal->nLen + VARSTR_HEADER_SIZE);
- pVal->pz[pVal->nLen + VARSTR_HEADER_SIZE] = 0;
+ pVal->pz = taosMemoryMalloc(pVal->nLen + 1);
+ memcpy(pVal->pz, pNode->datum.p, pVal->nLen);
+ pVal->pz[pVal->nLen] = 0;
break;
case TSDB_DATA_TYPE_JSON:
pVal->nLen = getJsonValueLen(pNode->datum.p);
diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h
index 3b309db1db..10d4adf17d 100644
--- a/source/libs/parser/inc/parAst.h
+++ b/source/libs/parser/inc/parAst.h
@@ -151,7 +151,7 @@ SNode* createDropDatabaseStmt(SAstCreateContext* pCxt, bool ignoreNotExists, STo
SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pOptions);
SNode* createFlushDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
SNode* createTrimDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, int32_t maxSpeed);
-SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName);
+SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pStart, SNode* pEnd);
SNode* createDefaultTableOptions(SAstCreateContext* pCxt);
SNode* createAlterTableOptions(SAstCreateContext* pCxt);
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, void* pVal);
@@ -212,9 +212,11 @@ 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);
SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName);
SNode* createStreamOptions(SAstCreateContext* pCxt);
+SNode* setStreamOptions(SAstCreateContext* pCxt, SNode* pOptions, EStreamOptionsSetFlag setflag, SToken* pToken,
+ SNode* pNode);
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pStreamName, SNode* pRealTable,
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery, SNodeList* pCols);
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pStreamName);
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index fb6d3bfdd9..994f99a797 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -167,7 +167,7 @@ cmd ::= USE db_name(A).
cmd ::= ALTER DATABASE db_name(A) alter_db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); }
cmd ::= FLUSH DATABASE db_name(A). { pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &A); }
cmd ::= TRIM DATABASE db_name(A) speed_opt(B). { pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &A, B); }
-cmd ::= COMPACT DATABASE db_name(A). { pCxt->pRootNode = createCompactStmt(pCxt, &A); }
+cmd ::= COMPACT DATABASE db_name(A) start_opt(B) end_opt(C). { pCxt->pRootNode = createCompactStmt(pCxt, &A, B, C); }
%type not_exists_opt { bool }
%destructor not_exists_opt { }
@@ -259,6 +259,16 @@ retention(A) ::= NK_VARIABLE(B) NK_COLON NK_VARIABLE(C).
speed_opt(A) ::= . { A = 0; }
speed_opt(A) ::= MAX_SPEED NK_INTEGER(B). { A = taosStr2Int32(B.z, NULL, 10); }
+start_opt(A) ::= . { A = NULL; }
+start_opt(A) ::= START WITH NK_INTEGER(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B); }
+start_opt(A) ::= START WITH NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &B); }
+start_opt(A) ::= START WITH TIMESTAMP NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &B); }
+
+end_opt(A) ::= . { A = NULL; }
+end_opt(A) ::= END WITH NK_INTEGER(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B); }
+end_opt(A) ::= END WITH NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &B); }
+end_opt(A) ::= END WITH TIMESTAMP NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &B); }
+
/************************************************ create/drop table/stable ********************************************/
cmd ::= CREATE TABLE not_exists_opt(A) full_table_name(B)
NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); }
@@ -531,7 +541,7 @@ explain_options(A) ::= explain_options(B) RATIO NK_FLOAT(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); }
+ 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); }
cmd ::= DROP FUNCTION exists_opt(B) function_name(A). { pCxt->pRootNode = createDropFunctionStmt(pCxt, B, &A); }
%type agg_func_opt { bool }
@@ -544,6 +554,11 @@ 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; }
+
/************************************************ 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)
@@ -562,14 +577,14 @@ tag_def_or_ref_opt(A) ::= tags_def(B).
tag_def_or_ref_opt(A) ::= TAGS NK_LP col_name_list(B) NK_RP. { A = B; }
stream_options(A) ::= . { A = createStreamOptions(pCxt); }
-stream_options(A) ::= stream_options(B) TRIGGER AT_ONCE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_AT_ONCE; A = B; }
-stream_options(A) ::= stream_options(B) TRIGGER WINDOW_CLOSE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; A = B; }
-stream_options(A) ::= stream_options(B) TRIGGER MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; }
-stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; }
-stream_options(A) ::= stream_options(B) IGNORE EXPIRED NK_INTEGER(C). { ((SStreamOptions*)B)->ignoreExpired = taosStr2Int8(C.z, NULL, 10); A = B; }
-stream_options(A) ::= stream_options(B) FILL_HISTORY NK_INTEGER(C). { ((SStreamOptions*)B)->fillHistory = taosStr2Int8(C.z, NULL, 10); A = B; }
-stream_options(A) ::= stream_options(B) DELETE_MARK duration_literal(C). { ((SStreamOptions*)B)->pDeleteMark = releaseRawExprNode(pCxt, C); A = B; }
-stream_options(A) ::= stream_options(B) IGNORE UPDATE NK_INTEGER(C). { ((SStreamOptions*)B)->ignoreUpdate = taosStr2Int8(C.z, NULL, 10); A = B; }
+stream_options(A) ::= stream_options(B) TRIGGER AT_ONCE(C). { A = setStreamOptions(pCxt, B, SOPT_TRIGGER_TYPE_SET, &C, NULL); }
+stream_options(A) ::= stream_options(B) TRIGGER WINDOW_CLOSE(C). { A = setStreamOptions(pCxt, B, SOPT_TRIGGER_TYPE_SET, &C, NULL); }
+stream_options(A) ::= stream_options(B) TRIGGER MAX_DELAY(C) duration_literal(D). { A = setStreamOptions(pCxt, B, SOPT_TRIGGER_TYPE_SET, &C, releaseRawExprNode(pCxt, D)); }
+stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C). { A = setStreamOptions(pCxt, B, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, C)); }
+stream_options(A) ::= stream_options(B) IGNORE EXPIRED NK_INTEGER(C). { A = setStreamOptions(pCxt, B, SOPT_IGNORE_EXPIRED_SET, &C, NULL); }
+stream_options(A) ::= stream_options(B) FILL_HISTORY NK_INTEGER(C). { A = setStreamOptions(pCxt, B, SOPT_FILL_HISTORY_SET, &C, NULL); }
+stream_options(A) ::= stream_options(B) DELETE_MARK duration_literal(C). { A = setStreamOptions(pCxt, B, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, C)); }
+stream_options(A) ::= stream_options(B) IGNORE UPDATE NK_INTEGER(C). { A = setStreamOptions(pCxt, B, SOPT_IGNORE_UPDATE_SET, &C, NULL); }
subtable_opt(A) ::= . { A = NULL; }
subtable_opt(A) ::= SUBTABLE NK_LP expression(B) NK_RP. { A = releaseRawExprNode(pCxt, B); }
diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c
index f613b1bd3d..a761b7a7b0 100644
--- a/source/libs/parser/src/parAstCreater.c
+++ b/source/libs/parser/src/parAstCreater.c
@@ -1105,7 +1105,7 @@ SNode* createTrimDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, int32_t
return (SNode*)pStmt;
}
-SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName) {
+SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pStart, SNode* pEnd) {
CHECK_PARSER_STATUS(pCxt);
if (!checkDbName(pCxt, pDbName, false)) {
return NULL;
@@ -1113,6 +1113,8 @@ SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName) {
SCompactDatabaseStmt* pStmt = (SCompactDatabaseStmt*)nodesMakeNode(QUERY_NODE_COMPACT_DATABASE_STMT);
CHECK_OUT_OF_MEM(pStmt);
COPY_STRING_FORM_ID_TOKEN(pStmt->dbName, pDbName);
+ pStmt->pStart = pStart;
+ pStmt->pEnd = pEnd;
return (SNode*)pStmt;
}
@@ -1779,13 +1781,29 @@ 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) {
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->ignoreExists = ignoreExists;
@@ -1794,6 +1812,7 @@ SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool
COPY_STRING_FORM_STR_TOKEN(pStmt->libraryPath, pLibPath);
pStmt->outputDt = dataType;
pStmt->bufSize = bufSize;
+ pStmt->language = language;
return (SNode*)pStmt;
}
@@ -1810,13 +1829,66 @@ SNode* createStreamOptions(SAstCreateContext* pCxt) {
CHECK_PARSER_STATUS(pCxt);
SStreamOptions* pOptions = (SStreamOptions*)nodesMakeNode(QUERY_NODE_STREAM_OPTIONS);
CHECK_OUT_OF_MEM(pOptions);
- pOptions->triggerType = STREAM_TRIGGER_AT_ONCE;
+ pOptions->triggerType = STREAM_TRIGGER_WINDOW_CLOSE;
pOptions->fillHistory = STREAM_DEFAULT_FILL_HISTORY;
pOptions->ignoreExpired = STREAM_DEFAULT_IGNORE_EXPIRED;
pOptions->ignoreUpdate = STREAM_DEFAULT_IGNORE_UPDATE;
return (SNode*)pOptions;
}
+static int8_t getTriggerType(uint32_t tokenType) {
+ switch (tokenType) {
+ case TK_AT_ONCE:
+ return STREAM_TRIGGER_AT_ONCE;
+ case TK_WINDOW_CLOSE:
+ return STREAM_TRIGGER_WINDOW_CLOSE;
+ case TK_MAX_DELAY:
+ return STREAM_TRIGGER_MAX_DELAY;
+ default:
+ break;
+ }
+ return STREAM_TRIGGER_WINDOW_CLOSE;
+}
+
+SNode* setStreamOptions(SAstCreateContext* pCxt, SNode* pOptions, EStreamOptionsSetFlag setflag, SToken* pToken,
+ SNode* pNode) {
+ SStreamOptions* pStreamOptions = (SStreamOptions*)pOptions;
+ if (BIT_FLAG_TEST_MASK(setflag, pStreamOptions->setFlag)) {
+ pCxt->errCode =
+ generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "stream options each item is only set once");
+ return pOptions;
+ }
+
+ switch (setflag) {
+ case SOPT_TRIGGER_TYPE_SET:
+ pStreamOptions->triggerType = getTriggerType(pToken->type);
+ if (STREAM_TRIGGER_MAX_DELAY == pStreamOptions->triggerType) {
+ pStreamOptions->pDelay = pNode;
+ }
+ break;
+ case SOPT_WATERMARK_SET:
+ pStreamOptions->pWatermark = pNode;
+ break;
+ case SOPT_DELETE_MARK_SET:
+ pStreamOptions->pDeleteMark = pNode;
+ break;
+ case SOPT_FILL_HISTORY_SET:
+ pStreamOptions->fillHistory = taosStr2Int8(pToken->z, NULL, 10);
+ break;
+ case SOPT_IGNORE_EXPIRED_SET:
+ pStreamOptions->ignoreExpired = taosStr2Int8(pToken->z, NULL, 10);
+ break;
+ case SOPT_IGNORE_UPDATE_SET:
+ pStreamOptions->ignoreUpdate = taosStr2Int8(pToken->z, NULL, 10);
+ break;
+ default:
+ break;
+ }
+ BIT_FLAG_SET_MASK(pStreamOptions->setFlag, setflag);
+
+ return pOptions;
+}
+
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pStreamName, SNode* pRealTable,
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery, SNodeList* pCols) {
CHECK_PARSER_STATUS(pCxt);
diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c
index 126027c78f..cd4b455e02 100644
--- a/source/libs/parser/src/parAstParser.c
+++ b/source/libs/parser/src/parAstParser.c
@@ -166,7 +166,8 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c
code = reserveDnodeRequiredInCache(pCxt->pMetaCache);
}
if (TSDB_CODE_SUCCESS == code &&
- (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS) || 0 == strcmp(pTable, TSDB_INS_TABLE_TABLES) || 0 == strcmp(pTable, TSDB_INS_TABLE_COLS)) &&
+ (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS) || 0 == strcmp(pTable, TSDB_INS_TABLE_TABLES) ||
+ 0 == strcmp(pTable, TSDB_INS_TABLE_COLS)) &&
QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) {
code = collectMetaKeyFromInsTags(pCxt);
}
@@ -605,6 +606,10 @@ static int32_t collectMetaKeyFromShowSubscriptions(SCollectMetaKeyCxt* pCxt, SSh
pCxt->pMetaCache);
}
+static int32_t collectMetaKeyFromCompactDatabase(SCollectMetaKeyCxt* pCxt, SCompactDatabaseStmt* pStmt) {
+ return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache);
+}
+
static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
pCxt->pStmt = pStmt;
switch (nodeType(pStmt)) {
@@ -636,6 +641,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
return collectMetaKeyFromExplain(pCxt, (SExplainStmt*)pStmt);
case QUERY_NODE_DESCRIBE_STMT:
return collectMetaKeyFromDescribe(pCxt, (SDescribeStmt*)pStmt);
+ case QUERY_NODE_COMPACT_DATABASE_STMT:
+ return collectMetaKeyFromCompactDatabase(pCxt, (SCompactDatabaseStmt*)pStmt);
case QUERY_NODE_CREATE_STREAM_STMT:
return collectMetaKeyFromCreateStream(pCxt, (SCreateStreamStmt*)pStmt);
case QUERY_NODE_SHOW_DNODES_STMT:
diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c
index d4f4949df0..b2fc88add1 100644
--- a/source/libs/parser/src/parCalcConst.c
+++ b/source/libs/parser/src/parCalcConst.c
@@ -320,6 +320,79 @@ static int32_t calcConstInsert(SCalcConstContext* pCxt, SInsertStmt* pInsert) {
return code;
}
+static SNodeList* getChildProjection(SNode* pStmt) {
+ switch (nodeType(pStmt)) {
+ case QUERY_NODE_SELECT_STMT:
+ return ((SSelectStmt*)pStmt)->pProjectionList;
+ case QUERY_NODE_SET_OPERATOR:
+ return ((SSetOperator*)pStmt)->pProjectionList;
+ default:
+ break;
+ }
+ return NULL;
+}
+
+static void eraseSetOpChildProjection(SSetOperator* pSetOp, int32_t index) {
+ SNodeList* pLeftProjs = getChildProjection(pSetOp->pLeft);
+ nodesListErase(pLeftProjs, nodesListGetCell(pLeftProjs, index));
+ SNodeList* pRightProjs = getChildProjection(pSetOp->pRight);
+ nodesListErase(pRightProjs, nodesListGetCell(pRightProjs, index));
+}
+
+typedef struct SNotRefByOrderByCxt {
+ SColumnNode* pCol;
+ bool hasThisCol;
+} SNotRefByOrderByCxt;
+
+static EDealRes notRefByOrderByImpl(SNode* pNode, void* pContext) {
+ if (QUERY_NODE_COLUMN == nodeType(pNode)) {
+ SNotRefByOrderByCxt* pCxt = (SNotRefByOrderByCxt*)pContext;
+ if (nodesEqualNode((SNode*)pCxt->pCol, pNode)) {
+ pCxt->hasThisCol = true;
+ return DEAL_RES_END;
+ }
+ }
+ return DEAL_RES_CONTINUE;
+}
+
+static bool notRefByOrderBy(SColumnNode* pCol, SNodeList* pOrderByList) {
+ SNotRefByOrderByCxt cxt = {.pCol = pCol, .hasThisCol = false};
+ nodesWalkExprs(pOrderByList, notRefByOrderByImpl, &cxt);
+ return !cxt.hasThisCol;
+}
+
+static int32_t calcConstSetOpProjections(SCalcConstContext* pCxt, SSetOperator* pSetOp, bool subquery) {
+ int32_t index = 0;
+ SNode* pProj = NULL;
+ WHERE_EACH(pProj, pSetOp->pProjectionList) {
+ if (subquery && notRefByOrderBy((SColumnNode*)pProj, pSetOp->pOrderByList) && isUselessCol((SExprNode*)pProj)) {
+ ERASE_NODE(pSetOp->pProjectionList);
+ eraseSetOpChildProjection(pSetOp, index);
+ continue;
+ }
+ ++index;
+ WHERE_NEXT;
+ }
+ if (0 == LIST_LENGTH(pSetOp->pProjectionList)) {
+ return nodesListStrictAppend(pSetOp->pProjectionList, createConstantValue());
+ }
+ return TSDB_CODE_SUCCESS;
+}
+
+static int32_t calcConstSetOperator(SCalcConstContext* pCxt, SSetOperator* pSetOp, bool subquery) {
+ int32_t code = calcConstSetOpProjections(pCxt, pSetOp, subquery);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = calcConstQuery(pCxt, pSetOp->pLeft, false);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = calcConstQuery(pCxt, pSetOp->pRight, false);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = calcConstList(pSetOp->pOrderByList);
+ }
+ return code;
+}
+
static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subquery) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pStmt)) {
@@ -330,11 +403,7 @@ static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subque
code = calcConstQuery(pCxt, ((SExplainStmt*)pStmt)->pQuery, subquery);
break;
case QUERY_NODE_SET_OPERATOR: {
- SSetOperator* pSetOp = (SSetOperator*)pStmt;
- code = calcConstQuery(pCxt, pSetOp->pLeft, false);
- if (TSDB_CODE_SUCCESS == code) {
- code = calcConstQuery(pCxt, pSetOp->pRight, false);
- }
+ code = calcConstSetOperator(pCxt, (SSetOperator*)pStmt, subquery);
break;
}
case QUERY_NODE_DELETE_STMT:
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 678dcf34d3..366831ee1a 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -124,6 +124,7 @@ static SKeyword keywordTable[] = {
{"JSON", TK_JSON},
{"KEEP", TK_KEEP},
{"KILL", TK_KILL},
+ {"LANGUAGE", TK_LANGUAGE},
{"LAST", TK_LAST},
{"LAST_ROW", TK_LAST_ROW},
{"LICENCES", TK_LICENCES},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index 8c5b41a7ee..fdc0a08371 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -1211,7 +1211,8 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD
} else {
res = translateNormalValue(pCxt, pVal, targetDt, strict);
}
- pVal->node.resType = targetDt;
+ pVal->node.resType.type = targetDt.type;
+ pVal->node.resType.bytes = targetDt.bytes;
pVal->node.resType.scale = pVal->unit;
pVal->translate = true;
if (!strict && TSDB_DATA_TYPE_UBIGINT == pVal->node.resType.type && pVal->datum.u <= INT64_MAX) {
@@ -2499,6 +2500,12 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) {
STempTableNode* pTempTable = (STempTableNode*)pTable;
code = translateSubquery(pCxt, pTempTable->pSubquery);
if (TSDB_CODE_SUCCESS == code) {
+ if (QUERY_NODE_SELECT_STMT == nodeType(pTempTable->pSubquery) &&
+ ((SSelectStmt*)pTempTable->pSubquery)->isEmptyResult &&
+ isSelectStmt(pCxt->pCurrStmt)) {
+ ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true;
+ }
+
pTempTable->table.precision = getStmtPrecision(pTempTable->pSubquery);
pTempTable->table.singleTable = stmtIsSingleTable(pTempTable->pSubquery);
code = addNamespace(pCxt, pTempTable);
@@ -2796,6 +2803,10 @@ static int32_t translateOrderBy(STranslateContext* pCxt, SSelectStmt* pSelect) {
bool other;
int32_t code = translateOrderByPosition(pCxt, pSelect->pProjectionList, pSelect->pOrderByList, &other);
if (TSDB_CODE_SUCCESS == code) {
+ if (0 == LIST_LENGTH(pSelect->pOrderByList)) {
+ NODES_DESTORY_LIST(pSelect->pOrderByList);
+ return TSDB_CODE_SUCCESS;
+ }
if (!other) {
return TSDB_CODE_SUCCESS;
}
@@ -3342,6 +3353,9 @@ static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) {
if (TSDB_CODE_SUCCESS == code) {
code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
}
+ if (TSDB_CODE_SUCCESS == code && pSelect->timeRange.skey > pSelect->timeRange.ekey) {
+ pSelect->isEmptyResult = true;
+ }
return code;
}
@@ -5618,12 +5632,36 @@ static int32_t translateDescribe(STranslateContext* pCxt, SDescribeStmt* pStmt)
return refreshGetTableMeta(pCxt, pStmt->dbName, pStmt->tableName, &pStmt->pMeta);
}
+static int32_t translateCompactRange(STranslateContext* pCxt, SCompactDatabaseStmt* pStmt, SCompactDbReq* pReq) {
+ SDbCfgInfo dbCfg = {0};
+ int32_t code = getDBCfg(pCxt, pStmt->dbName, &dbCfg);
+ if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pStart) {
+ ((SValueNode*)pStmt->pStart)->node.resType.precision = dbCfg.precision;
+ ((SValueNode*)pStmt->pStart)->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP;
+ code = doTranslateValue(pCxt, (SValueNode*)pStmt->pStart);
+ }
+ if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pEnd) {
+ ((SValueNode*)pStmt->pEnd)->node.resType.precision = dbCfg.precision;
+ ((SValueNode*)pStmt->pEnd)->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP;
+ code = doTranslateValue(pCxt, (SValueNode*)pStmt->pEnd);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ pReq->timeRange.skey = NULL != pStmt->pStart ? ((SValueNode*)pStmt->pStart)->datum.i : INT64_MIN;
+ pReq->timeRange.ekey = NULL != pStmt->pEnd ? ((SValueNode*)pStmt->pEnd)->datum.i : INT64_MAX;
+ }
+ return code;
+}
+
static int32_t translateCompact(STranslateContext* pCxt, SCompactDatabaseStmt* pStmt) {
SCompactDbReq compactReq = {0};
SName name;
tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName));
tNameGetFullDbName(&name, compactReq.db);
- return buildCmdMsg(pCxt, TDMT_MND_COMPACT_DB, (FSerializeFunc)tSerializeSCompactDbReq, &compactReq);
+ int32_t code = translateCompactRange(pCxt, pStmt, &compactReq);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = buildCmdMsg(pCxt, TDMT_MND_COMPACT_DB, (FSerializeFunc)tSerializeSCompactDbReq, &compactReq);
+ }
+ return code;
}
static int32_t translateKillConnection(STranslateContext* pCxt, SKillStmt* pStmt) {
@@ -6355,7 +6393,7 @@ static int32_t translateCreateFunction(STranslateContext* pCxt, SCreateFunctionS
strcpy(req.name, pStmt->funcName);
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;
req.outputLen = pStmt->outputDt.bytes;
req.bufSize = pStmt->bufSize;
@@ -6376,15 +6414,15 @@ static int32_t translateDropFunction(STranslateContext* pCxt, SDropFunctionStmt*
static int32_t translateGrant(STranslateContext* pCxt, SGrantStmt* pStmt) {
SAlterUserReq req = {0};
- if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_ALL) ||
- (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ) &&
- PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE))) {
+ if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_ALL) ||
+ (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ) &&
+ BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE))) {
req.alterType = TSDB_ALTER_USER_ADD_ALL_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ)) {
req.alterType = TSDB_ALTER_USER_ADD_READ_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE)) {
req.alterType = TSDB_ALTER_USER_ADD_WRITE_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_SUBSCRIBE)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_SUBSCRIBE)) {
req.alterType = TSDB_ALTER_USER_ADD_SUBSCRIBE_TOPIC;
}
strcpy(req.user, pStmt->userName);
@@ -6394,15 +6432,15 @@ static int32_t translateGrant(STranslateContext* pCxt, SGrantStmt* pStmt) {
static int32_t translateRevoke(STranslateContext* pCxt, SRevokeStmt* pStmt) {
SAlterUserReq req = {0};
- if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_ALL) ||
- (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ) &&
- PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE))) {
+ if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_ALL) ||
+ (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ) &&
+ BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE))) {
req.alterType = TSDB_ALTER_USER_REMOVE_ALL_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_READ)) {
req.alterType = TSDB_ALTER_USER_REMOVE_READ_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_WRITE)) {
req.alterType = TSDB_ALTER_USER_REMOVE_WRITE_DB;
- } else if (PRIVILEGE_TYPE_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_SUBSCRIBE)) {
+ } else if (BIT_FLAG_TEST_MASK(pStmt->privileges, PRIVILEGE_TYPE_SUBSCRIBE)) {
req.alterType = TSDB_ALTER_USER_REMOVE_SUBSCRIBE_TOPIC;
}
strcpy(req.user, pStmt->userName);
@@ -6474,6 +6512,11 @@ static int32_t translateShowCreateDatabase(STranslateContext* pCxt, SShowCreateD
if (NULL == pStmt->pCfg) {
return TSDB_CODE_OUT_OF_MEMORY;
}
+
+ SName name;
+ tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName));
+ tNameGetFullDbName(&name, pStmt->dbFName);
+
return getDBCfg(pCxt, pStmt->dbName, (SDbCfgInfo*)pStmt->pCfg);
}
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index b6940f8395..ab0571206b 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 469
+#define YYNOCODE 473
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- EOperatorType yy2;
- SNode* yy42;
- bool yy103;
- EOrder yy106;
- SNodeList* yy110;
- SToken yy225;
- EFillMode yy410;
- SDataType yy448;
- SAlterOption yy459;
- int32_t yy508;
- ENullOrder yy599;
- EJoinType yy638;
- int64_t yy641;
- int8_t yy705;
+ EOperatorType yy62;
+ SToken yy63;
+ EOrder yy158;
+ SNodeList* yy222;
+ SAlterOption yy233;
+ int32_t yy332;
+ int64_t yy393;
+ EJoinType yy574;
+ bool yy669;
+ ENullOrder yy675;
+ SDataType yy686;
+ int8_t yy707;
+ EFillMode yy822;
+ SNode* yy828;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -139,17 +139,17 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
-#define YYNSTATE 743
-#define YYNRULE 563
-#define YYNTOKEN 328
-#define YY_MAX_SHIFT 742
-#define YY_MIN_SHIFTREDUCE 1102
-#define YY_MAX_SHIFTREDUCE 1664
-#define YY_ERROR_ACTION 1665
-#define YY_ACCEPT_ACTION 1666
-#define YY_NO_ACTION 1667
-#define YY_MIN_REDUCE 1668
-#define YY_MAX_REDUCE 2230
+#define YYNSTATE 753
+#define YYNRULE 573
+#define YYNTOKEN 329
+#define YY_MAX_SHIFT 752
+#define YY_MIN_SHIFTREDUCE 1119
+#define YY_MAX_SHIFTREDUCE 1691
+#define YY_ERROR_ACTION 1692
+#define YY_ACCEPT_ACTION 1693
+#define YY_NO_ACTION 1694
+#define YY_MIN_REDUCE 1695
+#define YY_MAX_REDUCE 2267
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -216,753 +216,773 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (2749)
+#define YY_ACTTAB_COUNT (2833)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 1941, 2206, 1798, 607, 482, 2201, 483, 1704, 491, 1811,
- /* 10 */ 483, 1704, 45, 43, 1592, 1939, 619, 31, 176, 178,
- /* 20 */ 380, 2205, 1441, 38, 37, 2202, 2204, 44, 42, 41,
- /* 30 */ 40, 39, 1862, 1522, 139, 1439, 1466, 2042, 1875, 347,
- /* 40 */ 1924, 2028, 38, 37, 613, 358, 44, 42, 41, 40,
- /* 50 */ 39, 425, 2024, 2206, 1873, 38, 37, 2201, 1517, 44,
- /* 60 */ 42, 41, 40, 39, 18, 686, 385, 1469, 2060, 1868,
- /* 70 */ 1870, 1447, 1666, 2205, 167, 607, 646, 2202, 2203, 1776,
- /* 80 */ 1154, 2010, 1153, 648, 45, 43, 2020, 2026, 361, 570,
- /* 90 */ 1135, 330, 380, 2201, 1441, 220, 14, 642, 340, 181,
- /* 100 */ 2138, 2139, 550, 137, 2143, 1522, 139, 1439, 2207, 182,
- /* 110 */ 602, 1155, 2041, 2202, 596, 548, 2077, 546, 739, 324,
- /* 120 */ 2043, 652, 2045, 2046, 647, 645, 642, 633, 2095, 1137,
- /* 130 */ 1517, 1140, 1141, 1524, 1525, 631, 18, 481, 393, 1551,
- /* 140 */ 486, 1710, 392, 1447, 1691, 1262, 674, 673, 672, 1266,
- /* 150 */ 671, 1268, 1269, 670, 1271, 667, 176, 1277, 664, 1279,
- /* 160 */ 1280, 661, 658, 1497, 1507, 1941, 607, 617, 14, 1523,
- /* 170 */ 1526, 267, 2138, 606, 383, 133, 605, 371, 1925, 2201,
- /* 180 */ 1938, 619, 161, 570, 1442, 618, 1440, 2201, 2010, 359,
- /* 190 */ 739, 1824, 631, 270, 594, 182, 1552, 139, 1873, 2202,
- /* 200 */ 596, 500, 2207, 182, 631, 1524, 1525, 2202, 596, 590,
- /* 210 */ 1445, 1446, 247, 1496, 1499, 1500, 1501, 1502, 1503, 1504,
- /* 220 */ 1505, 1506, 644, 640, 1515, 1516, 1518, 1519, 1520, 1521,
- /* 230 */ 2, 61, 498, 92, 1934, 1497, 1507, 585, 106, 686,
- /* 240 */ 122, 1523, 1526, 121, 120, 119, 118, 117, 116, 115,
- /* 250 */ 114, 113, 140, 1596, 352, 166, 1442, 1680, 1440, 1466,
- /* 260 */ 1814, 609, 180, 2138, 2139, 1465, 137, 2143, 48, 34,
- /* 270 */ 378, 1546, 1547, 1548, 1549, 1550, 1554, 1555, 1556, 1557,
- /* 280 */ 48, 61, 1445, 1446, 1222, 1496, 1499, 1500, 1501, 1502,
- /* 290 */ 1503, 1504, 1505, 1506, 644, 640, 1515, 1516, 1518, 1519,
- /* 300 */ 1520, 1521, 2, 2028, 11, 45, 43, 44, 42, 41,
- /* 310 */ 40, 39, 1466, 380, 2024, 1441, 353, 742, 351, 350,
- /* 320 */ 1224, 523, 591, 586, 579, 525, 1522, 1466, 1439, 490,
- /* 330 */ 2042, 295, 486, 1710, 607, 35, 288, 38, 37, 603,
- /* 340 */ 412, 44, 42, 41, 40, 39, 175, 524, 2020, 2026,
- /* 350 */ 362, 1517, 732, 728, 724, 720, 293, 18, 86, 642,
- /* 360 */ 488, 2060, 414, 410, 1447, 139, 484, 559, 417, 649,
- /* 370 */ 416, 2145, 349, 1154, 2010, 1153, 648, 45, 43, 1527,
- /* 380 */ 1467, 1817, 2206, 185, 11, 380, 9, 1441, 61, 14,
- /* 390 */ 279, 280, 65, 107, 415, 278, 286, 2142, 1522, 1468,
- /* 400 */ 1439, 634, 1498, 2102, 1155, 2041, 1737, 632, 1690, 2077,
- /* 410 */ 632, 739, 168, 2043, 652, 2045, 2046, 647, 1669, 642,
- /* 420 */ 185, 132, 678, 1517, 187, 1866, 1524, 1525, 521, 628,
- /* 430 */ 183, 2138, 2139, 185, 137, 2143, 1447, 632, 1822, 122,
- /* 440 */ 11, 1822, 121, 120, 119, 118, 117, 116, 115, 114,
- /* 450 */ 113, 132, 2010, 571, 2167, 194, 1497, 1507, 526, 1875,
- /* 460 */ 100, 46, 1523, 1526, 273, 636, 368, 2102, 1822, 272,
- /* 470 */ 1360, 1361, 536, 535, 534, 1873, 1654, 1442, 2031, 1440,
- /* 480 */ 136, 530, 1815, 739, 61, 529, 1404, 463, 241, 1905,
- /* 490 */ 528, 533, 83, 1305, 1306, 82, 527, 237, 1524, 1525,
- /* 500 */ 1869, 1870, 1467, 1445, 1446, 1661, 1496, 1499, 1500, 1501,
- /* 510 */ 1502, 1503, 1504, 1505, 1506, 644, 640, 1515, 1516, 1518,
- /* 520 */ 1519, 1520, 1521, 2, 536, 535, 534, 2033, 1497, 1507,
- /* 530 */ 1668, 1875, 136, 530, 1523, 1526, 632, 529, 345, 632,
- /* 540 */ 185, 1447, 528, 533, 269, 198, 197, 1873, 527, 1442,
- /* 550 */ 54, 1440, 618, 423, 131, 130, 129, 128, 127, 126,
- /* 560 */ 125, 124, 123, 1415, 1416, 419, 677, 1822, 462, 418,
- /* 570 */ 1822, 41, 40, 39, 2042, 1445, 1446, 618, 1496, 1499,
- /* 580 */ 1500, 1501, 1502, 1503, 1504, 1505, 1506, 644, 640, 1515,
- /* 590 */ 1516, 1518, 1519, 1520, 1521, 2, 45, 43, 1468, 616,
- /* 600 */ 1920, 1934, 86, 1660, 380, 2060, 1441, 632, 595, 632,
- /* 610 */ 570, 190, 2201, 649, 2201, 1377, 1378, 1522, 2010, 1439,
- /* 620 */ 648, 424, 221, 433, 627, 1818, 1934, 594, 182, 2207,
- /* 630 */ 182, 61, 2202, 596, 2202, 596, 185, 171, 1822, 1689,
- /* 640 */ 1822, 443, 1517, 517, 513, 509, 505, 218, 632, 2041,
- /* 650 */ 442, 1376, 1379, 2077, 1620, 1447, 110, 2043, 652, 2045,
- /* 660 */ 2046, 647, 448, 642, 49, 372, 1532, 1688, 45, 43,
- /* 670 */ 2130, 2205, 1466, 164, 2129, 2126, 380, 698, 1441, 1822,
- /* 680 */ 46, 541, 1824, 2010, 87, 1687, 2145, 216, 1807, 1522,
- /* 690 */ 1686, 1439, 141, 38, 37, 2101, 551, 44, 42, 41,
- /* 700 */ 40, 39, 739, 582, 581, 1618, 1619, 1621, 1622, 1623,
- /* 710 */ 234, 2010, 2141, 1685, 1517, 38, 37, 1524, 1525, 44,
- /* 720 */ 42, 41, 40, 39, 236, 544, 33, 1447, 235, 2010,
- /* 730 */ 538, 1799, 38, 37, 2010, 233, 44, 42, 41, 40,
- /* 740 */ 39, 1684, 595, 269, 1553, 2145, 2201, 1497, 1507, 1875,
- /* 750 */ 632, 27, 14, 1523, 1526, 215, 209, 2010, 13, 12,
- /* 760 */ 214, 594, 182, 496, 449, 1874, 2202, 596, 1442, 383,
- /* 770 */ 1440, 2140, 69, 1589, 739, 68, 2060, 164, 1683, 207,
- /* 780 */ 1809, 1822, 1631, 185, 589, 2010, 1824, 89, 335, 1524,
- /* 790 */ 1525, 357, 1978, 552, 1445, 1446, 1469, 1496, 1499, 1500,
- /* 800 */ 1501, 1502, 1503, 1504, 1505, 1506, 644, 640, 1515, 1516,
- /* 810 */ 1518, 1519, 1520, 1521, 2, 1498, 185, 32, 1805, 1497,
- /* 820 */ 1507, 333, 2010, 1464, 684, 1523, 1526, 1558, 164, 588,
- /* 830 */ 456, 710, 708, 470, 1875, 152, 469, 1825, 238, 684,
- /* 840 */ 1442, 373, 1440, 154, 153, 681, 680, 679, 151, 1682,
- /* 850 */ 1873, 439, 1679, 471, 1565, 676, 441, 1920, 154, 153,
- /* 860 */ 681, 680, 679, 151, 532, 531, 1445, 1446, 192, 1496,
- /* 870 */ 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 644, 640,
- /* 880 */ 1515, 1516, 1518, 1519, 1520, 1521, 2, 699, 53, 1792,
- /* 890 */ 632, 682, 165, 2010, 1866, 1678, 2010, 308, 348, 1734,
- /* 900 */ 632, 38, 37, 1797, 499, 44, 42, 41, 40, 39,
- /* 910 */ 429, 306, 72, 242, 1819, 71, 1677, 1920, 643, 38,
- /* 920 */ 37, 1822, 1875, 44, 42, 41, 40, 39, 196, 384,
- /* 930 */ 51, 1822, 3, 203, 478, 476, 473, 598, 1873, 2010,
- /* 940 */ 467, 191, 525, 461, 460, 459, 458, 455, 454, 453,
- /* 950 */ 452, 451, 447, 446, 445, 444, 332, 436, 435, 434,
- /* 960 */ 2010, 431, 430, 346, 524, 716, 715, 714, 713, 390,
- /* 970 */ 61, 712, 711, 143, 706, 705, 704, 703, 702, 701,
- /* 980 */ 700, 156, 696, 695, 694, 389, 388, 691, 690, 689,
- /* 990 */ 688, 687, 632, 632, 1676, 38, 37, 565, 2003, 44,
- /* 1000 */ 42, 41, 40, 39, 1441, 632, 239, 566, 1608, 108,
- /* 1010 */ 2042, 684, 1996, 632, 632, 632, 1469, 1439, 1588, 629,
- /* 1020 */ 8, 1675, 1674, 1822, 1822, 1673, 1672, 630, 611, 615,
- /* 1030 */ 154, 153, 681, 680, 679, 151, 1822, 683, 2010, 1466,
- /* 1040 */ 1866, 2060, 1671, 570, 1822, 1822, 1822, 2201, 152, 610,
- /* 1050 */ 80, 79, 422, 1447, 2010, 189, 648, 632, 163, 2042,
- /* 1060 */ 400, 302, 2207, 182, 1852, 2010, 2010, 2202, 596, 2010,
- /* 1070 */ 2010, 283, 599, 2028, 331, 1140, 1141, 408, 1450, 406,
- /* 1080 */ 402, 398, 395, 415, 2024, 2041, 2010, 1681, 1822, 2077,
- /* 1090 */ 2060, 1813, 109, 2043, 652, 2045, 2046, 647, 649, 642,
- /* 1100 */ 739, 1410, 2024, 2010, 179, 648, 2130, 1777, 386, 632,
- /* 1110 */ 374, 2126, 2150, 1585, 426, 639, 164, 2029, 2020, 2026,
- /* 1120 */ 375, 632, 185, 387, 184, 1824, 2042, 427, 2024, 642,
- /* 1130 */ 2004, 145, 2156, 134, 2041, 289, 2020, 2026, 2077, 1800,
- /* 1140 */ 1822, 109, 2043, 652, 2045, 2046, 647, 642, 642, 52,
- /* 1150 */ 152, 142, 1822, 149, 2101, 2130, 569, 2060, 2042, 374,
- /* 1160 */ 2126, 246, 2020, 2026, 73, 610, 1442, 1711, 1440, 1724,
- /* 1170 */ 2010, 226, 648, 642, 224, 570, 1717, 228, 230, 2201,
- /* 1180 */ 227, 229, 1498, 147, 232, 245, 554, 231, 553, 2060,
- /* 1190 */ 2170, 537, 1445, 1446, 2207, 182, 1715, 649, 539, 2202,
- /* 1200 */ 596, 2041, 2010, 1413, 648, 2077, 1449, 2042, 109, 2043,
- /* 1210 */ 652, 2045, 2046, 647, 81, 642, 734, 63, 542, 63,
- /* 1220 */ 179, 251, 2130, 1663, 1664, 90, 374, 2126, 1585, 1453,
- /* 1230 */ 152, 47, 276, 2041, 70, 13, 12, 2077, 2060, 105,
- /* 1240 */ 109, 2043, 652, 2045, 2046, 647, 649, 642, 2157, 102,
- /* 1250 */ 264, 2010, 2221, 648, 2130, 583, 150, 557, 374, 2126,
- /* 1260 */ 152, 1543, 63, 47, 47, 219, 2042, 258, 2061, 2164,
- /* 1270 */ 1617, 656, 1616, 692, 253, 150, 152, 135, 1184, 150,
- /* 1280 */ 391, 1929, 2041, 614, 1374, 281, 2077, 624, 1705, 109,
- /* 1290 */ 2043, 652, 2045, 2046, 647, 1203, 642, 2060, 693, 600,
- /* 1300 */ 2042, 2221, 570, 2130, 1863, 649, 2201, 374, 2126, 285,
- /* 1310 */ 2010, 2160, 648, 1255, 1185, 1559, 1508, 301, 2177, 608,
- /* 1320 */ 1201, 2207, 182, 263, 1283, 266, 2202, 596, 1287, 1294,
- /* 1330 */ 1292, 2060, 155, 1, 399, 4, 394, 296, 344, 649,
- /* 1340 */ 1397, 2041, 195, 428, 2010, 2077, 648, 1469, 109, 2043,
- /* 1350 */ 652, 2045, 2046, 647, 432, 642, 1930, 1452, 437, 465,
- /* 1360 */ 2221, 1464, 2130, 450, 1922, 457, 374, 2126, 464, 466,
- /* 1370 */ 472, 474, 200, 2042, 475, 2041, 477, 577, 479, 2077,
- /* 1380 */ 1470, 480, 109, 2043, 652, 2045, 2046, 647, 489, 642,
- /* 1390 */ 1472, 206, 377, 376, 2221, 492, 2130, 1467, 493, 208,
- /* 1400 */ 374, 2126, 1455, 1471, 2060, 494, 1473, 211, 495, 497,
- /* 1410 */ 1157, 2195, 649, 1522, 518, 1448, 519, 2010, 213, 648,
- /* 1420 */ 84, 85, 2042, 522, 217, 501, 520, 1987, 1812, 223,
- /* 1430 */ 1808, 334, 225, 112, 1984, 1983, 556, 558, 1517, 88,
- /* 1440 */ 240, 148, 157, 158, 1810, 1806, 297, 560, 2041, 159,
- /* 1450 */ 160, 1447, 2077, 2060, 243, 109, 2043, 652, 2045, 2046,
- /* 1460 */ 647, 649, 642, 561, 567, 584, 2010, 2221, 648, 2130,
- /* 1470 */ 622, 2176, 564, 374, 2126, 2175, 574, 580, 593, 363,
- /* 1480 */ 587, 2161, 575, 7, 2149, 2171, 2042, 2152, 573, 249,
- /* 1490 */ 172, 257, 259, 252, 260, 572, 261, 2041, 638, 364,
- /* 1500 */ 604, 2077, 2224, 1585, 109, 2043, 652, 2045, 2046, 647,
- /* 1510 */ 601, 642, 138, 1468, 265, 262, 2105, 2060, 2130, 612,
- /* 1520 */ 2200, 2146, 374, 2126, 367, 649, 271, 1474, 95, 1935,
- /* 1530 */ 2010, 620, 648, 625, 298, 621, 1949, 1948, 1947, 299,
- /* 1540 */ 370, 626, 97, 99, 1823, 60, 2111, 300, 101, 303,
- /* 1550 */ 1793, 292, 735, 1867, 2042, 327, 736, 654, 738, 336,
- /* 1560 */ 312, 2041, 326, 50, 1456, 2077, 1451, 316, 109, 2043,
- /* 1570 */ 652, 2045, 2046, 647, 305, 642, 307, 2002, 2001, 2000,
- /* 1580 */ 2103, 77, 2130, 337, 2042, 2060, 374, 2126, 1997, 396,
- /* 1590 */ 1459, 1461, 397, 649, 1432, 1433, 188, 401, 2010, 1995,
- /* 1600 */ 648, 405, 403, 640, 1515, 1516, 1518, 1519, 1520, 1521,
- /* 1610 */ 404, 1994, 407, 1993, 2042, 2060, 409, 1992, 411, 1991,
- /* 1620 */ 413, 78, 1400, 649, 1399, 1961, 1960, 1959, 2010, 2041,
- /* 1630 */ 648, 420, 421, 2077, 1958, 1957, 109, 2043, 652, 2045,
- /* 1640 */ 2046, 647, 1351, 642, 2042, 2060, 1913, 1912, 635, 1910,
- /* 1650 */ 2130, 144, 1909, 649, 374, 2126, 1908, 1911, 2010, 2041,
- /* 1660 */ 648, 1907, 1906, 2077, 193, 438, 110, 2043, 652, 2045,
- /* 1670 */ 2046, 647, 1904, 642, 1903, 2060, 1902, 1901, 2042, 440,
- /* 1680 */ 2130, 1915, 1900, 649, 637, 2126, 1899, 1898, 2010, 650,
- /* 1690 */ 648, 1897, 1896, 2077, 1895, 1894, 110, 2043, 652, 2045,
- /* 1700 */ 2046, 647, 1893, 642, 1892, 2042, 1891, 1890, 1889, 2060,
- /* 1710 */ 2130, 1888, 1887, 1886, 339, 2126, 1885, 649, 1884, 2041,
- /* 1720 */ 146, 1883, 2010, 2077, 648, 1914, 169, 2043, 652, 2045,
- /* 1730 */ 2046, 647, 1882, 642, 1881, 1880, 2060, 1353, 1879, 1878,
- /* 1740 */ 468, 1877, 1876, 1740, 649, 1230, 199, 1739, 201, 2010,
- /* 1750 */ 1738, 648, 2030, 2041, 2042, 202, 1736, 2077, 1700, 204,
- /* 1760 */ 168, 2043, 652, 2045, 2046, 647, 75, 642, 177, 1143,
- /* 1770 */ 485, 1142, 1699, 487, 1974, 1968, 205, 1956, 597, 2222,
- /* 1780 */ 2041, 212, 1955, 76, 2077, 2060, 1933, 110, 2043, 652,
- /* 1790 */ 2045, 2046, 647, 649, 642, 1801, 1177, 1735, 2010, 210,
- /* 1800 */ 648, 2130, 2168, 1733, 502, 504, 2127, 503, 1731, 507,
- /* 1810 */ 508, 506, 1729, 510, 1727, 511, 2042, 1714, 514, 512,
- /* 1820 */ 516, 515, 1713, 1696, 1803, 62, 1299, 1298, 1802, 2041,
- /* 1830 */ 1725, 222, 707, 2077, 1221, 1220, 318, 2043, 652, 2045,
- /* 1840 */ 2046, 647, 1219, 642, 1218, 1215, 709, 2060, 2042, 1213,
- /* 1850 */ 1214, 1212, 1718, 354, 355, 649, 540, 1716, 356, 1695,
- /* 1860 */ 2010, 543, 648, 1694, 545, 1693, 549, 111, 547, 1420,
- /* 1870 */ 1422, 1973, 1419, 1406, 55, 1967, 562, 1954, 1952, 2060,
- /* 1880 */ 592, 1424, 2206, 26, 369, 66, 162, 649, 16, 244,
- /* 1890 */ 19, 2041, 2010, 1633, 648, 2077, 576, 2042, 169, 2043,
- /* 1900 */ 652, 2045, 2046, 647, 578, 642, 568, 28, 58, 248,
- /* 1910 */ 563, 360, 5, 59, 2042, 250, 1615, 170, 255, 256,
- /* 1920 */ 6, 254, 20, 2041, 30, 64, 1648, 2077, 2060, 2031,
- /* 1930 */ 325, 2043, 652, 2045, 2046, 647, 646, 642, 29, 21,
- /* 1940 */ 1607, 2010, 1653, 648, 91, 2060, 2042, 1654, 17, 1647,
- /* 1950 */ 379, 2223, 365, 649, 1652, 1651, 366, 1582, 2010, 1581,
- /* 1960 */ 648, 1953, 57, 268, 1951, 56, 1950, 1932, 94, 93,
- /* 1970 */ 173, 2042, 2041, 274, 1931, 96, 2077, 2060, 287, 324,
- /* 1980 */ 2043, 652, 2045, 2046, 647, 649, 642, 275, 2096, 2041,
- /* 1990 */ 2010, 1613, 648, 2077, 102, 2042, 325, 2043, 652, 2045,
- /* 2000 */ 2046, 647, 2060, 642, 22, 277, 282, 381, 623, 67,
- /* 2010 */ 649, 12, 23, 1457, 1544, 2010, 1534, 648, 174, 284,
- /* 2020 */ 2042, 555, 1512, 98, 1533, 2077, 2060, 10, 320, 2043,
- /* 2030 */ 652, 2045, 2046, 647, 649, 642, 2080, 641, 36, 2010,
- /* 2040 */ 1510, 648, 1509, 1481, 15, 24, 2041, 186, 1489, 25,
- /* 2050 */ 2077, 2060, 655, 325, 2043, 652, 2045, 2046, 647, 649,
- /* 2060 */ 642, 651, 653, 382, 2010, 657, 648, 1284, 659, 660,
- /* 2070 */ 2041, 662, 1281, 1278, 2077, 663, 665, 309, 2043, 652,
- /* 2080 */ 2045, 2046, 647, 2042, 642, 1272, 666, 668, 1261, 1270,
- /* 2090 */ 669, 675, 290, 103, 104, 2041, 1293, 1276, 1275, 2077,
- /* 2100 */ 1274, 1273, 310, 2043, 652, 2045, 2046, 647, 74, 642,
- /* 2110 */ 2042, 1289, 1175, 685, 2060, 1209, 1208, 1207, 1206, 291,
- /* 2120 */ 1205, 1204, 649, 1202, 1228, 1200, 1199, 2010, 1198, 648,
- /* 2130 */ 697, 1196, 2042, 1195, 1194, 1193, 1192, 1191, 1190, 1225,
- /* 2140 */ 1223, 2060, 1187, 1186, 1183, 1182, 1181, 1180, 1732, 649,
- /* 2150 */ 717, 1730, 718, 719, 2010, 721, 648, 723, 2041, 1728,
- /* 2160 */ 725, 727, 2077, 2060, 722, 311, 2043, 652, 2045, 2046,
- /* 2170 */ 647, 649, 642, 1726, 726, 729, 2010, 730, 648, 1712,
- /* 2180 */ 731, 733, 1132, 1692, 294, 2041, 737, 741, 1443, 2077,
- /* 2190 */ 304, 740, 317, 2043, 652, 2045, 2046, 647, 1667, 642,
- /* 2200 */ 1667, 1667, 1667, 1667, 1667, 1667, 1667, 2041, 1667, 1667,
- /* 2210 */ 1667, 2077, 2042, 1667, 321, 2043, 652, 2045, 2046, 647,
- /* 2220 */ 1667, 642, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 2042,
- /* 2230 */ 1667, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 1667,
- /* 2240 */ 1667, 1667, 1667, 2060, 1667, 1667, 2042, 1667, 1667, 1667,
- /* 2250 */ 1667, 649, 1667, 1667, 1667, 1667, 2010, 1667, 648, 1667,
- /* 2260 */ 2060, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 649, 1667,
- /* 2270 */ 1667, 1667, 1667, 2010, 1667, 648, 1667, 2060, 2042, 1667,
- /* 2280 */ 1667, 1667, 1667, 1667, 1667, 649, 1667, 2041, 1667, 1667,
- /* 2290 */ 2010, 2077, 648, 1667, 313, 2043, 652, 2045, 2046, 647,
- /* 2300 */ 1667, 642, 1667, 2042, 2041, 1667, 1667, 1667, 2077, 2060,
- /* 2310 */ 1667, 322, 2043, 652, 2045, 2046, 647, 649, 642, 1667,
- /* 2320 */ 1667, 2041, 2010, 1667, 648, 2077, 1667, 2042, 314, 2043,
- /* 2330 */ 652, 2045, 2046, 647, 2060, 642, 1667, 1667, 1667, 1667,
- /* 2340 */ 1667, 1667, 649, 1667, 1667, 1667, 1667, 2010, 1667, 648,
- /* 2350 */ 1667, 1667, 2042, 2041, 1667, 1667, 1667, 2077, 2060, 1667,
- /* 2360 */ 323, 2043, 652, 2045, 2046, 647, 649, 642, 1667, 1667,
- /* 2370 */ 1667, 2010, 1667, 648, 1667, 1667, 1667, 1667, 2041, 1667,
- /* 2380 */ 1667, 1667, 2077, 2060, 1667, 315, 2043, 652, 2045, 2046,
- /* 2390 */ 647, 649, 642, 1667, 1667, 1667, 2010, 1667, 648, 1667,
- /* 2400 */ 1667, 1667, 2041, 1667, 1667, 1667, 2077, 1667, 1667, 328,
- /* 2410 */ 2043, 652, 2045, 2046, 647, 2042, 642, 1667, 1667, 1667,
- /* 2420 */ 1667, 1667, 1667, 1667, 1667, 1667, 1667, 2041, 1667, 1667,
- /* 2430 */ 1667, 2077, 1667, 1667, 329, 2043, 652, 2045, 2046, 647,
- /* 2440 */ 1667, 642, 2042, 1667, 1667, 1667, 2060, 1667, 1667, 1667,
- /* 2450 */ 1667, 1667, 1667, 1667, 649, 1667, 1667, 1667, 1667, 2010,
- /* 2460 */ 1667, 648, 1667, 1667, 2042, 1667, 1667, 1667, 1667, 1667,
- /* 2470 */ 1667, 1667, 1667, 2060, 1667, 1667, 1667, 1667, 1667, 1667,
- /* 2480 */ 1667, 649, 1667, 1667, 1667, 1667, 2010, 1667, 648, 1667,
- /* 2490 */ 2041, 1667, 1667, 1667, 2077, 2060, 1667, 2054, 2043, 652,
- /* 2500 */ 2045, 2046, 647, 649, 642, 1667, 1667, 1667, 2010, 1667,
- /* 2510 */ 648, 1667, 1667, 1667, 1667, 1667, 1667, 2041, 1667, 1667,
- /* 2520 */ 1667, 2077, 1667, 1667, 2053, 2043, 652, 2045, 2046, 647,
- /* 2530 */ 1667, 642, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 2041,
- /* 2540 */ 1667, 1667, 1667, 2077, 2042, 1667, 2052, 2043, 652, 2045,
- /* 2550 */ 2046, 647, 1667, 642, 1667, 1667, 1667, 1667, 1667, 1667,
- /* 2560 */ 1667, 2042, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 1667,
- /* 2570 */ 1667, 1667, 1667, 1667, 1667, 2060, 1667, 1667, 2042, 1667,
- /* 2580 */ 1667, 1667, 1667, 649, 1667, 1667, 1667, 1667, 2010, 1667,
- /* 2590 */ 648, 1667, 2060, 1667, 1667, 1667, 1667, 1667, 1667, 1667,
- /* 2600 */ 649, 1667, 1667, 1667, 1667, 2010, 1667, 648, 1667, 2060,
- /* 2610 */ 2042, 1667, 1667, 1667, 1667, 1667, 1667, 649, 1667, 2041,
- /* 2620 */ 1667, 1667, 2010, 2077, 648, 1667, 341, 2043, 652, 2045,
- /* 2630 */ 2046, 647, 1667, 642, 1667, 2042, 2041, 1667, 1667, 1667,
- /* 2640 */ 2077, 2060, 1667, 342, 2043, 652, 2045, 2046, 647, 649,
- /* 2650 */ 642, 1667, 1667, 2041, 2010, 1667, 648, 2077, 1667, 2042,
- /* 2660 */ 338, 2043, 652, 2045, 2046, 647, 2060, 642, 1667, 1667,
- /* 2670 */ 1667, 1667, 1667, 1667, 649, 1667, 1667, 1667, 1667, 2010,
- /* 2680 */ 1667, 648, 1667, 1667, 1667, 2041, 1667, 1667, 1667, 2077,
- /* 2690 */ 2060, 1667, 343, 2043, 652, 2045, 2046, 647, 649, 642,
- /* 2700 */ 1667, 1667, 1667, 2010, 1667, 648, 1667, 1667, 1667, 1667,
- /* 2710 */ 650, 1667, 1667, 1667, 2077, 1667, 1667, 320, 2043, 652,
- /* 2720 */ 2045, 2046, 647, 1667, 642, 1667, 1667, 1667, 1667, 1667,
- /* 2730 */ 1667, 1667, 1667, 1667, 2041, 1667, 1667, 1667, 2077, 1667,
- /* 2740 */ 1667, 319, 2043, 652, 2045, 2046, 647, 1667, 642,
+ /* 0 */ 2065, 2243, 1976, 167, 2079, 2238, 491, 377, 492, 1731,
+ /* 10 */ 1803, 2061, 45, 43, 1619, 164, 1976, 1974, 629, 2065,
+ /* 20 */ 385, 2242, 1468, 617, 1859, 2239, 2241, 2079, 376, 1493,
+ /* 30 */ 2061, 1973, 629, 1549, 166, 1466, 1707, 2097, 1848, 44,
+ /* 40 */ 42, 41, 40, 39, 641, 620, 2057, 2063, 366, 2061,
+ /* 50 */ 2047, 500, 658, 492, 1731, 388, 139, 652, 1544, 176,
+ /* 60 */ 2097, 1493, 1910, 161, 18, 2057, 2063, 367, 659, 350,
+ /* 70 */ 364, 1474, 1859, 2047, 178, 658, 652, 497, 1908, 1908,
+ /* 80 */ 352, 1959, 2078, 493, 2057, 2063, 2114, 1897, 641, 109,
+ /* 90 */ 2080, 662, 2082, 2083, 657, 652, 652, 749, 35, 291,
+ /* 100 */ 14, 179, 617, 2167, 627, 2078, 430, 379, 2163, 2114,
+ /* 110 */ 45, 43, 168, 2080, 662, 2082, 2083, 657, 385, 652,
+ /* 120 */ 1468, 184, 270, 2175, 616, 1764, 133, 615, 2066, 2193,
+ /* 130 */ 2238, 1549, 1171, 1466, 1170, 139, 1551, 1552, 490, 2061,
+ /* 140 */ 605, 495, 1737, 1623, 2238, 604, 182, 222, 333, 1493,
+ /* 150 */ 2239, 606, 1695, 581, 2204, 1152, 1544, 1834, 141, 604,
+ /* 160 */ 182, 2138, 18, 1172, 2239, 606, 1524, 1534, 48, 1474,
+ /* 170 */ 1761, 509, 1550, 1553, 2057, 2063, 131, 130, 129, 128,
+ /* 180 */ 127, 126, 125, 124, 123, 652, 1469, 641, 1467, 176,
+ /* 190 */ 61, 545, 544, 543, 1154, 749, 1157, 1158, 14, 136,
+ /* 200 */ 539, 181, 2175, 2176, 538, 137, 2180, 1385, 1386, 537,
+ /* 210 */ 542, 1960, 468, 1472, 1473, 536, 1523, 1526, 1527, 1528,
+ /* 220 */ 1529, 1530, 1531, 1532, 1533, 654, 650, 1542, 1543, 1545,
+ /* 230 */ 1546, 1547, 1548, 2, 1551, 1552, 726, 725, 724, 723,
+ /* 240 */ 395, 600, 722, 721, 143, 716, 715, 714, 713, 712,
+ /* 250 */ 711, 710, 156, 706, 705, 704, 394, 393, 701, 700,
+ /* 260 */ 699, 698, 697, 1616, 1524, 1534, 595, 48, 696, 694,
+ /* 270 */ 1550, 1553, 122, 198, 197, 121, 120, 119, 118, 117,
+ /* 280 */ 116, 115, 114, 113, 1469, 694, 1467, 154, 153, 691,
+ /* 290 */ 690, 689, 151, 38, 37, 1525, 467, 44, 42, 41,
+ /* 300 */ 40, 39, 1492, 154, 153, 691, 690, 689, 151, 1693,
+ /* 310 */ 2182, 1472, 1473, 273, 1523, 1526, 1527, 1528, 1529, 1530,
+ /* 320 */ 1531, 1532, 1533, 654, 650, 1542, 1543, 1545, 1546, 1547,
+ /* 330 */ 1548, 2, 11, 45, 43, 390, 2179, 2097, 1903, 1905,
+ /* 340 */ 185, 385, 1296, 1468, 499, 599, 49, 495, 1737, 345,
+ /* 350 */ 601, 596, 589, 1940, 1549, 61, 1466, 92, 1287, 684,
+ /* 360 */ 683, 682, 1291, 681, 1293, 1294, 680, 677, 86, 1302,
+ /* 370 */ 674, 1304, 1305, 671, 668, 1696, 31, 398, 2079, 1544,
+ /* 380 */ 568, 397, 38, 37, 65, 18, 44, 42, 41, 40,
+ /* 390 */ 39, 598, 1474, 1853, 1578, 628, 122, 1494, 11, 121,
+ /* 400 */ 120, 119, 118, 117, 116, 115, 114, 113, 38, 37,
+ /* 410 */ 628, 2097, 44, 42, 41, 40, 39, 185, 749, 656,
+ /* 420 */ 1496, 14, 642, 580, 2047, 1474, 658, 2238, 11, 1910,
+ /* 430 */ 9, 45, 43, 1554, 628, 687, 363, 2015, 187, 385,
+ /* 440 */ 1250, 1468, 2244, 182, 507, 1908, 1969, 2239, 606, 1718,
+ /* 450 */ 1579, 1647, 1549, 1249, 1466, 1857, 2078, 1551, 1552, 626,
+ /* 460 */ 2114, 1969, 2243, 327, 2080, 662, 2082, 2083, 657, 655,
+ /* 470 */ 652, 643, 2132, 545, 544, 543, 1239, 1544, 617, 1495,
+ /* 480 */ 61, 136, 539, 637, 240, 1969, 538, 1524, 1534, 2242,
+ /* 490 */ 1474, 537, 542, 1550, 1553, 2047, 185, 536, 592, 591,
+ /* 500 */ 1645, 1646, 1648, 1649, 1650, 185, 708, 1469, 448, 1467,
+ /* 510 */ 1615, 139, 1241, 1330, 1331, 477, 749, 447, 152, 46,
+ /* 520 */ 541, 540, 34, 383, 1573, 1574, 1575, 1576, 1577, 1581,
+ /* 530 */ 1582, 1583, 1584, 1495, 1472, 1473, 575, 1523, 1526, 1527,
+ /* 540 */ 1528, 1529, 1530, 1531, 1532, 1533, 654, 650, 1542, 1543,
+ /* 550 */ 1545, 1546, 1547, 1548, 2, 1551, 1552, 38, 37, 1846,
+ /* 560 */ 1681, 44, 42, 41, 40, 39, 38, 37, 250, 1717,
+ /* 570 */ 44, 42, 41, 40, 39, 53, 619, 180, 2175, 2176,
+ /* 580 */ 2079, 137, 2180, 642, 605, 1524, 1534, 1708, 2238, 38,
+ /* 590 */ 37, 1550, 1553, 44, 42, 41, 40, 39, 2243, 132,
+ /* 600 */ 1842, 642, 2238, 604, 182, 1469, 530, 1467, 2239, 606,
+ /* 610 */ 1716, 1493, 644, 2097, 2139, 2047, 1857, 132, 2242, 239,
+ /* 620 */ 2068, 659, 2239, 2240, 535, 27, 2047, 272, 658, 646,
+ /* 630 */ 185, 2139, 1472, 1473, 1857, 1523, 1526, 1527, 1528, 1529,
+ /* 640 */ 1530, 1531, 1532, 1533, 654, 650, 1542, 1543, 1545, 1546,
+ /* 650 */ 1547, 1548, 2, 45, 43, 86, 2047, 2079, 2078, 1658,
+ /* 660 */ 424, 385, 2114, 1468, 423, 109, 2080, 662, 2082, 2083,
+ /* 670 */ 657, 354, 652, 2070, 1549, 142, 1466, 149, 2138, 2167,
+ /* 680 */ 1852, 272, 1580, 379, 2163, 1442, 1443, 1468, 38, 37,
+ /* 690 */ 2097, 61, 44, 42, 41, 40, 39, 1910, 659, 1544,
+ /* 700 */ 1466, 617, 2182, 2047, 373, 658, 580, 642, 33, 709,
+ /* 710 */ 2238, 1819, 1474, 1908, 38, 37, 1904, 1905, 44, 42,
+ /* 720 */ 41, 40, 39, 54, 1844, 2244, 182, 1688, 2178, 238,
+ /* 730 */ 2239, 606, 642, 237, 139, 2078, 1474, 642, 749, 2114,
+ /* 740 */ 1857, 46, 169, 2080, 662, 2082, 2083, 657, 621, 652,
+ /* 750 */ 357, 45, 43, 428, 32, 1171, 608, 1170, 388, 385,
+ /* 760 */ 1910, 1468, 749, 391, 1585, 1857, 164, 378, 282, 283,
+ /* 770 */ 1857, 164, 1549, 281, 1466, 1859, 1908, 1551, 1552, 1835,
+ /* 780 */ 1859, 1635, 1715, 38, 37, 1832, 1172, 44, 42, 41,
+ /* 790 */ 40, 39, 89, 340, 607, 2259, 362, 1544, 561, 2079,
+ /* 800 */ 183, 2175, 2176, 1714, 137, 2180, 106, 1524, 1534, 2182,
+ /* 810 */ 1474, 720, 718, 1550, 1553, 642, 358, 534, 356, 355,
+ /* 820 */ 417, 532, 140, 147, 1687, 534, 1910, 1469, 2047, 1467,
+ /* 830 */ 1849, 429, 2097, 389, 8, 2177, 749, 559, 533, 14,
+ /* 840 */ 659, 185, 1908, 419, 415, 2047, 533, 658, 1857, 2047,
+ /* 850 */ 557, 1469, 555, 1467, 1472, 1473, 1713, 1523, 1526, 1527,
+ /* 860 */ 1528, 1529, 1530, 1531, 1532, 1533, 654, 650, 1542, 1543,
+ /* 870 */ 1545, 1546, 1547, 1548, 2, 1551, 1552, 2078, 1472, 1473,
+ /* 880 */ 623, 2114, 13, 12, 110, 2080, 662, 2082, 2083, 657,
+ /* 890 */ 100, 652, 1496, 1559, 41, 40, 39, 694, 2167, 1493,
+ /* 900 */ 105, 1712, 2047, 2164, 164, 1524, 1534, 642, 642, 1494,
+ /* 910 */ 102, 1550, 1553, 1860, 1850, 154, 153, 691, 690, 689,
+ /* 920 */ 151, 1910, 1496, 438, 453, 1469, 580, 1467, 38, 37,
+ /* 930 */ 2238, 1804, 44, 42, 41, 40, 39, 1909, 1955, 688,
+ /* 940 */ 1857, 1857, 1901, 163, 1711, 2244, 182, 2047, 1833, 190,
+ /* 950 */ 2239, 606, 1472, 1473, 73, 1523, 1526, 1527, 1528, 1529,
+ /* 960 */ 1530, 1531, 1532, 1533, 654, 650, 1542, 1543, 1545, 1546,
+ /* 970 */ 1547, 1548, 2, 61, 336, 165, 1491, 2040, 382, 381,
+ /* 980 */ 311, 1955, 1592, 461, 1254, 550, 475, 2079, 1482, 474,
+ /* 990 */ 2047, 1955, 192, 305, 309, 72, 1887, 1253, 71, 1549,
+ /* 1000 */ 560, 1475, 196, 81, 444, 194, 476, 1710, 431, 446,
+ /* 1010 */ 1709, 696, 692, 609, 236, 1901, 205, 487, 485, 482,
+ /* 1020 */ 2097, 432, 1706, 580, 1544, 1402, 1403, 2238, 659, 553,
+ /* 1030 */ 1157, 1158, 1705, 2047, 547, 658, 1840, 1474, 642, 235,
+ /* 1040 */ 191, 1704, 2244, 182, 1612, 1525, 83, 2239, 606, 82,
+ /* 1050 */ 248, 1703, 1702, 2047, 625, 353, 2047, 61, 422, 479,
+ /* 1060 */ 421, 1401, 1404, 648, 1493, 2078, 612, 434, 2047, 2114,
+ /* 1070 */ 249, 1857, 109, 2080, 662, 2082, 2083, 657, 2047, 652,
+ /* 1080 */ 69, 1701, 2065, 68, 2142, 420, 2167, 2047, 1700, 693,
+ /* 1090 */ 379, 2163, 1901, 2061, 90, 108, 472, 2047, 2047, 466,
+ /* 1100 */ 465, 464, 463, 460, 459, 458, 457, 456, 452, 451,
+ /* 1110 */ 450, 449, 335, 441, 440, 439, 642, 436, 435, 351,
+ /* 1120 */ 686, 228, 642, 185, 226, 1699, 642, 2047, 2057, 2063,
+ /* 1130 */ 380, 642, 392, 2033, 2047, 80, 79, 427, 454, 652,
+ /* 1140 */ 189, 2079, 508, 2187, 1612, 642, 51, 1854, 3, 1857,
+ /* 1150 */ 1477, 145, 1483, 134, 1478, 1857, 649, 642, 245, 1857,
+ /* 1160 */ 334, 241, 1751, 413, 1857, 411, 407, 403, 400, 420,
+ /* 1170 */ 642, 2047, 2079, 576, 2097, 563, 653, 562, 1857, 1486,
+ /* 1180 */ 1488, 405, 620, 267, 546, 152, 286, 2047, 642, 658,
+ /* 1190 */ 1857, 1476, 650, 1542, 1543, 1545, 1546, 1547, 1548, 642,
+ /* 1200 */ 1698, 642, 1744, 1857, 639, 2097, 230, 185, 152, 229,
+ /* 1210 */ 1525, 232, 2207, 659, 231, 640, 63, 292, 2047, 2078,
+ /* 1220 */ 658, 1857, 2079, 2114, 548, 1742, 109, 2080, 662, 2082,
+ /* 1230 */ 2083, 657, 1857, 652, 1857, 63, 47, 254, 179, 2079,
+ /* 1240 */ 2167, 610, 1437, 579, 379, 2163, 2047, 551, 234, 152,
+ /* 1250 */ 2078, 233, 13, 12, 2114, 2097, 47, 109, 2080, 662,
+ /* 1260 */ 2082, 2083, 657, 659, 652, 1440, 2194, 1738, 2047, 2258,
+ /* 1270 */ 658, 2167, 2097, 1644, 593, 379, 2163, 279, 1690, 1691,
+ /* 1280 */ 659, 221, 70, 261, 150, 2047, 2201, 658, 2098, 152,
+ /* 1290 */ 1732, 63, 1643, 1535, 256, 396, 613, 47, 666, 2079,
+ /* 1300 */ 2078, 150, 152, 1480, 2114, 1570, 624, 168, 2080, 662,
+ /* 1310 */ 2082, 2083, 657, 1399, 652, 52, 744, 2078, 1964, 2079,
+ /* 1320 */ 1898, 2114, 135, 150, 109, 2080, 662, 2082, 2083, 657,
+ /* 1330 */ 2197, 652, 2097, 1201, 284, 702, 2258, 752, 2167, 634,
+ /* 1340 */ 659, 288, 379, 2163, 1479, 2047, 1280, 658, 1586, 2205,
+ /* 1350 */ 618, 298, 2097, 2214, 304, 1308, 703, 1220, 1312, 1319,
+ /* 1360 */ 659, 269, 266, 1, 4, 2047, 175, 658, 404, 1202,
+ /* 1370 */ 399, 349, 742, 738, 734, 730, 296, 2078, 1218, 1317,
+ /* 1380 */ 155, 2114, 1422, 299, 109, 2080, 662, 2082, 2083, 657,
+ /* 1390 */ 195, 652, 433, 1496, 1965, 437, 2258, 2078, 2167, 470,
+ /* 1400 */ 1491, 2114, 379, 2163, 109, 2080, 662, 2082, 2083, 657,
+ /* 1410 */ 442, 652, 455, 587, 1957, 462, 2258, 107, 2167, 469,
+ /* 1420 */ 289, 471, 379, 2163, 480, 481, 478, 199, 2079, 200,
+ /* 1430 */ 483, 484, 2041, 2232, 202, 223, 1497, 486, 488, 489,
+ /* 1440 */ 498, 1499, 501, 1494, 502, 208, 210, 1498, 2079, 503,
+ /* 1450 */ 171, 1500, 638, 504, 506, 1174, 526, 522, 518, 514,
+ /* 1460 */ 220, 2097, 510, 213, 215, 84, 85, 219, 527, 659,
+ /* 1470 */ 528, 529, 112, 339, 2047, 531, 658, 565, 580, 1847,
+ /* 1480 */ 567, 2097, 2238, 88, 148, 300, 570, 276, 225, 659,
+ /* 1490 */ 242, 1843, 275, 227, 2047, 157, 658, 2244, 182, 158,
+ /* 1500 */ 1845, 87, 2239, 606, 218, 1841, 2078, 2024, 1429, 2021,
+ /* 1510 */ 2114, 243, 569, 109, 2080, 662, 2082, 2083, 657, 159,
+ /* 1520 */ 652, 2020, 2079, 160, 246, 2258, 2078, 2167, 571, 574,
+ /* 1530 */ 2114, 379, 2163, 109, 2080, 662, 2082, 2083, 657, 244,
+ /* 1540 */ 652, 577, 2186, 2198, 584, 2140, 2079, 2167, 2208, 594,
+ /* 1550 */ 632, 379, 2163, 590, 2213, 2097, 252, 368, 255, 597,
+ /* 1560 */ 7, 603, 582, 659, 2212, 585, 611, 583, 2047, 265,
+ /* 1570 */ 658, 217, 211, 369, 614, 2261, 216, 1612, 505, 2097,
+ /* 1580 */ 138, 1495, 622, 2183, 372, 274, 1501, 659, 95, 301,
+ /* 1590 */ 1970, 630, 2047, 260, 658, 209, 2079, 631, 1984, 263,
+ /* 1600 */ 2078, 2189, 264, 172, 2114, 566, 1983, 109, 2080, 662,
+ /* 1610 */ 2082, 2083, 657, 2079, 652, 1982, 302, 2237, 268, 645,
+ /* 1620 */ 262, 2167, 635, 303, 2078, 379, 2163, 375, 2114, 2097,
+ /* 1630 */ 97, 110, 2080, 662, 2082, 2083, 657, 659, 652, 1858,
+ /* 1640 */ 636, 60, 2047, 2148, 658, 2167, 2097, 99, 101, 2166,
+ /* 1650 */ 2163, 580, 664, 306, 659, 2238, 295, 1820, 1902, 2047,
+ /* 1660 */ 745, 658, 746, 748, 341, 50, 330, 342, 308, 315,
+ /* 1670 */ 2244, 182, 310, 2079, 2078, 2239, 606, 2039, 2114, 2038,
+ /* 1680 */ 2037, 321, 2080, 662, 2082, 2083, 657, 77, 652, 329,
+ /* 1690 */ 2034, 2078, 319, 2079, 401, 2114, 402, 1459, 110, 2080,
+ /* 1700 */ 662, 2082, 2083, 657, 1460, 652, 2097, 188, 406, 2032,
+ /* 1710 */ 408, 409, 2167, 410, 659, 2031, 647, 2163, 412, 2047,
+ /* 1720 */ 2030, 658, 414, 2029, 416, 602, 2097, 2028, 418, 78,
+ /* 1730 */ 1425, 1424, 1996, 1995, 659, 1994, 425, 426, 1993, 2047,
+ /* 1740 */ 1992, 658, 1376, 1948, 1947, 1945, 144, 1944, 1943, 1946,
+ /* 1750 */ 1942, 660, 1941, 1939, 1938, 2114, 2079, 1937, 110, 2080,
+ /* 1760 */ 662, 2082, 2083, 657, 193, 652, 443, 1936, 445, 1950,
+ /* 1770 */ 1935, 2078, 2167, 1934, 1933, 2114, 344, 2163, 169, 2080,
+ /* 1780 */ 662, 2082, 2083, 657, 146, 652, 1932, 1931, 1930, 2097,
+ /* 1790 */ 1929, 1928, 1927, 1926, 374, 1925, 1924, 659, 1923, 1922,
+ /* 1800 */ 1921, 1920, 2047, 1919, 658, 1918, 1949, 1917, 1916, 1915,
+ /* 1810 */ 1914, 1378, 1913, 473, 2079, 1912, 1911, 337, 338, 1251,
+ /* 1820 */ 1767, 201, 1766, 203, 1255, 1765, 204, 1763, 1727, 1247,
+ /* 1830 */ 2067, 2260, 1160, 1159, 2078, 1726, 2011, 2003, 2114, 2079,
+ /* 1840 */ 1991, 328, 2080, 662, 2082, 2083, 657, 2097, 652, 1990,
+ /* 1850 */ 214, 494, 75, 206, 1968, 656, 1836, 1762, 177, 1760,
+ /* 1860 */ 2047, 207, 658, 76, 496, 212, 511, 1758, 513, 515,
+ /* 1870 */ 1756, 517, 2097, 519, 1754, 1741, 1740, 384, 512, 523,
+ /* 1880 */ 659, 516, 521, 1723, 1838, 2047, 525, 658, 1194, 520,
+ /* 1890 */ 62, 1323, 2078, 524, 1837, 1324, 2114, 1238, 1237, 327,
+ /* 1900 */ 2080, 662, 2082, 2083, 657, 1752, 652, 1236, 2133, 717,
+ /* 1910 */ 719, 1230, 2079, 1235, 1232, 1231, 1229, 2078, 359, 1745,
+ /* 1920 */ 360, 2114, 361, 549, 328, 2080, 662, 2082, 2083, 657,
+ /* 1930 */ 1743, 652, 552, 2079, 1722, 1721, 554, 556, 1720, 558,
+ /* 1940 */ 111, 1447, 1449, 1446, 2010, 2097, 224, 1451, 26, 1431,
+ /* 1950 */ 386, 66, 2002, 659, 1433, 162, 1989, 1987, 2047, 572,
+ /* 1960 */ 658, 2243, 2079, 259, 16, 19, 2097, 58, 59, 258,
+ /* 1970 */ 20, 30, 64, 2068, 659, 21, 1675, 28, 17, 2047,
+ /* 1980 */ 1674, 658, 251, 2079, 5, 586, 1660, 6, 588, 370,
+ /* 1990 */ 2078, 253, 57, 1642, 2114, 2097, 1634, 328, 2080, 662,
+ /* 2000 */ 2082, 2083, 657, 659, 652, 1680, 1679, 1678, 2047, 170,
+ /* 2010 */ 658, 564, 257, 29, 371, 2114, 2097, 271, 323, 2080,
+ /* 2020 */ 662, 2082, 2083, 657, 659, 652, 55, 578, 91, 2047,
+ /* 2030 */ 1681, 658, 573, 2079, 1609, 173, 1988, 1608, 247, 365,
+ /* 2040 */ 2078, 1986, 1985, 1967, 2114, 94, 93, 312, 2080, 662,
+ /* 2050 */ 2082, 2083, 657, 22, 652, 277, 278, 633, 2079, 96,
+ /* 2060 */ 1640, 2078, 280, 285, 67, 2114, 2097, 1966, 313, 2080,
+ /* 2070 */ 662, 2082, 2083, 657, 659, 652, 98, 102, 290, 2047,
+ /* 2080 */ 287, 658, 23, 1561, 1560, 12, 1484, 2117, 10, 663,
+ /* 2090 */ 1539, 2097, 651, 2079, 1537, 36, 174, 15, 56, 659,
+ /* 2100 */ 1536, 24, 186, 1508, 2047, 25, 658, 1516, 1309, 665,
+ /* 2110 */ 667, 2078, 1571, 387, 1306, 2114, 2079, 669, 314, 2080,
+ /* 2120 */ 662, 2082, 2083, 657, 670, 652, 2097, 1303, 672, 673,
+ /* 2130 */ 661, 1297, 675, 676, 659, 1295, 2078, 678, 1301, 2047,
+ /* 2140 */ 2114, 658, 1300, 320, 2080, 662, 2082, 2083, 657, 2097,
+ /* 2150 */ 652, 679, 1286, 103, 293, 1299, 685, 659, 1298, 1318,
+ /* 2160 */ 104, 74, 2047, 1314, 658, 1192, 1226, 695, 1225, 1224,
+ /* 2170 */ 1223, 2078, 1222, 1221, 2079, 2114, 1245, 1219, 324, 2080,
+ /* 2180 */ 662, 2082, 2083, 657, 1217, 652, 1216, 1215, 707, 294,
+ /* 2190 */ 1213, 1212, 1211, 2079, 2078, 1210, 1209, 1208, 2114, 1207,
+ /* 2200 */ 1242, 316, 2080, 662, 2082, 2083, 657, 2097, 652, 1240,
+ /* 2210 */ 1198, 1204, 1203, 1200, 1199, 659, 1197, 1759, 727, 728,
+ /* 2220 */ 2047, 729, 658, 1757, 731, 733, 2097, 1755, 732, 735,
+ /* 2230 */ 737, 1753, 736, 739, 659, 740, 741, 1739, 743, 2047,
+ /* 2240 */ 1149, 658, 1719, 297, 1470, 747, 751, 307, 1694, 750,
+ /* 2250 */ 1694, 1694, 2078, 1694, 2079, 1694, 2114, 1694, 1694, 325,
+ /* 2260 */ 2080, 662, 2082, 2083, 657, 1694, 652, 1694, 1694, 1694,
+ /* 2270 */ 1694, 2078, 1694, 1694, 1694, 2114, 1694, 1694, 317, 2080,
+ /* 2280 */ 662, 2082, 2083, 657, 1694, 652, 1694, 2097, 1694, 1694,
+ /* 2290 */ 1694, 1694, 1694, 1694, 1694, 659, 1694, 1694, 1694, 1694,
+ /* 2300 */ 2047, 1694, 658, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2310 */ 1694, 1694, 2079, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2320 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 2079, 1694,
+ /* 2330 */ 1694, 1694, 2078, 1694, 1694, 1694, 2114, 1694, 1694, 326,
+ /* 2340 */ 2080, 662, 2082, 2083, 657, 2097, 652, 1694, 1694, 1694,
+ /* 2350 */ 1694, 1694, 1694, 659, 1694, 1694, 1694, 1694, 2047, 1694,
+ /* 2360 */ 658, 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659,
+ /* 2370 */ 1694, 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694,
+ /* 2380 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2390 */ 2078, 2079, 1694, 1694, 2114, 1694, 1694, 318, 2080, 662,
+ /* 2400 */ 2082, 2083, 657, 1694, 652, 1694, 2078, 2079, 1694, 1694,
+ /* 2410 */ 2114, 1694, 1694, 331, 2080, 662, 2082, 2083, 657, 1694,
+ /* 2420 */ 652, 1694, 1694, 1694, 2097, 1694, 2079, 1694, 1694, 1694,
+ /* 2430 */ 1694, 1694, 659, 1694, 1694, 1694, 1694, 2047, 1694, 658,
+ /* 2440 */ 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659, 1694,
+ /* 2450 */ 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694, 2097,
+ /* 2460 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659, 1694, 2078,
+ /* 2470 */ 1694, 1694, 2047, 2114, 658, 1694, 332, 2080, 662, 2082,
+ /* 2480 */ 2083, 657, 1694, 652, 1694, 2078, 1694, 1694, 1694, 2114,
+ /* 2490 */ 2079, 1694, 2091, 2080, 662, 2082, 2083, 657, 1694, 652,
+ /* 2500 */ 1694, 1694, 1694, 1694, 2078, 1694, 1694, 2079, 2114, 1694,
+ /* 2510 */ 1694, 2090, 2080, 662, 2082, 2083, 657, 1694, 652, 1694,
+ /* 2520 */ 1694, 1694, 1694, 2097, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2530 */ 1694, 659, 1694, 1694, 1694, 1694, 2047, 1694, 658, 1694,
+ /* 2540 */ 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659, 1694,
+ /* 2550 */ 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694, 1694,
+ /* 2560 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 2079, 2078, 1694,
+ /* 2570 */ 1694, 1694, 2114, 1694, 1694, 2089, 2080, 662, 2082, 2083,
+ /* 2580 */ 657, 1694, 652, 1694, 1694, 2078, 1694, 2079, 1694, 2114,
+ /* 2590 */ 1694, 1694, 346, 2080, 662, 2082, 2083, 657, 1694, 652,
+ /* 2600 */ 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659, 1694,
+ /* 2610 */ 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694, 1694,
+ /* 2620 */ 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659, 1694,
+ /* 2630 */ 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694, 1694,
+ /* 2640 */ 1694, 1694, 1694, 1694, 1694, 2078, 1694, 1694, 1694, 2114,
+ /* 2650 */ 1694, 1694, 347, 2080, 662, 2082, 2083, 657, 1694, 652,
+ /* 2660 */ 1694, 2079, 1694, 1694, 1694, 2078, 1694, 1694, 1694, 2114,
+ /* 2670 */ 1694, 1694, 343, 2080, 662, 2082, 2083, 657, 2079, 652,
+ /* 2680 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2690 */ 1694, 1694, 1694, 1694, 2097, 1694, 1694, 1694, 1694, 1694,
+ /* 2700 */ 1694, 1694, 659, 1694, 1694, 1694, 1694, 2047, 1694, 658,
+ /* 2710 */ 1694, 2097, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 659,
+ /* 2720 */ 1694, 1694, 1694, 1694, 2047, 1694, 658, 1694, 1694, 1694,
+ /* 2730 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 2078,
+ /* 2740 */ 2079, 1694, 1694, 2114, 1694, 1694, 348, 2080, 662, 2082,
+ /* 2750 */ 2083, 657, 1694, 652, 1694, 1694, 660, 1694, 1694, 1694,
+ /* 2760 */ 2114, 1694, 1694, 323, 2080, 662, 2082, 2083, 657, 1694,
+ /* 2770 */ 652, 1694, 1694, 2097, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2780 */ 1694, 659, 1694, 1694, 1694, 1694, 2047, 1694, 658, 1694,
+ /* 2790 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2800 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ /* 2810 */ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694, 2078, 1694,
+ /* 2820 */ 1694, 1694, 2114, 1694, 1694, 322, 2080, 662, 2082, 2083,
+ /* 2830 */ 657, 1694, 652,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 377, 439, 0, 339, 335, 443, 337, 338, 335, 363,
- /* 10 */ 337, 338, 12, 13, 14, 392, 393, 2, 362, 361,
- /* 20 */ 20, 459, 22, 8, 9, 463, 464, 12, 13, 14,
- /* 30 */ 15, 16, 374, 33, 370, 35, 20, 331, 362, 383,
- /* 40 */ 384, 364, 8, 9, 394, 369, 12, 13, 14, 15,
- /* 50 */ 16, 339, 375, 439, 378, 8, 9, 443, 58, 12,
- /* 60 */ 13, 14, 15, 16, 64, 63, 373, 20, 362, 376,
- /* 70 */ 377, 71, 328, 459, 346, 339, 370, 463, 464, 351,
- /* 80 */ 20, 375, 22, 377, 12, 13, 409, 410, 411, 439,
- /* 90 */ 4, 379, 20, 443, 22, 35, 96, 420, 64, 435,
- /* 100 */ 436, 437, 21, 439, 440, 33, 370, 35, 458, 459,
- /* 110 */ 44, 51, 406, 463, 464, 34, 410, 36, 118, 413,
- /* 120 */ 414, 415, 416, 417, 418, 419, 420, 421, 422, 43,
- /* 130 */ 58, 45, 46, 133, 134, 20, 64, 336, 394, 105,
- /* 140 */ 339, 340, 398, 71, 331, 109, 110, 111, 112, 113,
- /* 150 */ 114, 115, 116, 117, 118, 119, 362, 121, 122, 123,
- /* 160 */ 124, 125, 126, 163, 164, 377, 339, 20, 96, 169,
- /* 170 */ 170, 435, 436, 437, 354, 439, 440, 389, 384, 443,
- /* 180 */ 392, 393, 362, 439, 184, 339, 186, 443, 375, 369,
- /* 190 */ 118, 371, 20, 58, 458, 459, 162, 370, 378, 463,
- /* 200 */ 464, 63, 458, 459, 20, 133, 134, 463, 464, 20,
- /* 210 */ 210, 211, 165, 213, 214, 215, 216, 217, 218, 219,
+ /* 0 */ 367, 443, 380, 347, 332, 447, 336, 357, 338, 339,
+ /* 10 */ 354, 378, 12, 13, 14, 365, 380, 395, 396, 367,
+ /* 20 */ 20, 463, 22, 340, 374, 467, 468, 332, 392, 20,
+ /* 30 */ 378, 395, 396, 33, 331, 35, 333, 365, 367, 12,
+ /* 40 */ 13, 14, 15, 16, 20, 373, 413, 414, 415, 378,
+ /* 50 */ 378, 336, 380, 338, 339, 357, 373, 424, 58, 365,
+ /* 60 */ 365, 20, 365, 365, 64, 413, 414, 415, 373, 372,
+ /* 70 */ 372, 71, 374, 378, 364, 380, 424, 14, 381, 381,
+ /* 80 */ 386, 387, 410, 20, 413, 414, 414, 377, 20, 417,
+ /* 90 */ 418, 419, 420, 421, 422, 424, 424, 97, 432, 433,
+ /* 100 */ 100, 429, 340, 431, 20, 410, 340, 435, 436, 414,
+ /* 110 */ 12, 13, 417, 418, 419, 420, 421, 422, 20, 424,
+ /* 120 */ 22, 449, 439, 440, 441, 0, 443, 444, 367, 457,
+ /* 130 */ 447, 33, 20, 35, 22, 373, 136, 137, 337, 378,
+ /* 140 */ 443, 340, 341, 14, 447, 462, 463, 35, 382, 20,
+ /* 150 */ 467, 468, 0, 458, 459, 4, 58, 0, 427, 462,
+ /* 160 */ 463, 430, 64, 51, 467, 468, 166, 167, 100, 71,
+ /* 170 */ 0, 63, 172, 173, 413, 414, 24, 25, 26, 27,
+ /* 180 */ 28, 29, 30, 31, 32, 424, 186, 20, 188, 365,
+ /* 190 */ 100, 66, 67, 68, 43, 97, 45, 46, 100, 74,
+ /* 200 */ 75, 439, 440, 441, 79, 443, 444, 166, 167, 84,
+ /* 210 */ 85, 387, 80, 213, 214, 90, 216, 217, 218, 219,
/* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
- /* 230 */ 230, 96, 386, 98, 388, 163, 164, 168, 343, 63,
- /* 240 */ 21, 169, 170, 24, 25, 26, 27, 28, 29, 30,
- /* 250 */ 31, 32, 357, 14, 37, 330, 184, 332, 186, 20,
- /* 260 */ 365, 434, 435, 436, 437, 20, 439, 440, 96, 235,
- /* 270 */ 236, 237, 238, 239, 240, 241, 242, 243, 244, 245,
- /* 280 */ 96, 96, 210, 211, 35, 213, 214, 215, 216, 217,
- /* 290 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
- /* 300 */ 228, 229, 230, 364, 232, 12, 13, 12, 13, 14,
- /* 310 */ 15, 16, 20, 20, 375, 22, 99, 19, 101, 102,
- /* 320 */ 71, 104, 253, 254, 255, 108, 33, 20, 35, 336,
- /* 330 */ 331, 33, 339, 340, 339, 428, 429, 8, 9, 273,
- /* 340 */ 179, 12, 13, 14, 15, 16, 48, 130, 409, 410,
- /* 350 */ 411, 58, 54, 55, 56, 57, 58, 64, 345, 420,
- /* 360 */ 14, 362, 201, 202, 71, 370, 20, 107, 183, 370,
- /* 370 */ 185, 412, 359, 20, 375, 22, 377, 12, 13, 14,
- /* 380 */ 20, 368, 3, 248, 232, 20, 234, 22, 96, 96,
- /* 390 */ 127, 128, 4, 95, 209, 132, 98, 438, 33, 20,
- /* 400 */ 35, 424, 163, 426, 51, 406, 0, 339, 331, 410,
- /* 410 */ 339, 118, 413, 414, 415, 416, 417, 418, 0, 420,
- /* 420 */ 248, 353, 372, 58, 353, 375, 133, 134, 360, 131,
- /* 430 */ 435, 436, 437, 248, 439, 440, 71, 339, 370, 21,
- /* 440 */ 232, 370, 24, 25, 26, 27, 28, 29, 30, 31,
- /* 450 */ 32, 353, 375, 454, 455, 58, 163, 164, 360, 362,
- /* 460 */ 343, 96, 169, 170, 166, 424, 369, 426, 370, 171,
- /* 470 */ 163, 164, 66, 67, 68, 378, 97, 184, 47, 186,
- /* 480 */ 74, 75, 365, 118, 96, 79, 188, 80, 190, 0,
- /* 490 */ 84, 85, 95, 133, 134, 98, 90, 127, 133, 134,
- /* 500 */ 376, 377, 20, 210, 211, 176, 213, 214, 215, 216,
- /* 510 */ 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
- /* 520 */ 227, 228, 229, 230, 66, 67, 68, 96, 163, 164,
- /* 530 */ 0, 362, 74, 75, 169, 170, 339, 79, 369, 339,
- /* 540 */ 248, 71, 84, 85, 165, 138, 139, 378, 90, 184,
- /* 550 */ 353, 186, 339, 353, 24, 25, 26, 27, 28, 29,
- /* 560 */ 30, 31, 32, 193, 194, 394, 107, 370, 161, 398,
- /* 570 */ 370, 14, 15, 16, 331, 210, 211, 339, 213, 214,
- /* 580 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
- /* 590 */ 225, 226, 227, 228, 229, 230, 12, 13, 20, 386,
- /* 600 */ 370, 388, 345, 274, 20, 362, 22, 339, 439, 339,
- /* 610 */ 439, 381, 443, 370, 443, 133, 134, 33, 375, 35,
- /* 620 */ 377, 353, 33, 353, 386, 368, 388, 458, 459, 458,
- /* 630 */ 459, 96, 463, 464, 463, 464, 248, 48, 370, 331,
- /* 640 */ 370, 152, 58, 54, 55, 56, 57, 58, 339, 406,
- /* 650 */ 161, 169, 170, 410, 210, 71, 413, 414, 415, 416,
- /* 660 */ 417, 418, 353, 420, 96, 354, 14, 331, 12, 13,
- /* 670 */ 427, 3, 20, 362, 431, 432, 20, 71, 22, 370,
- /* 680 */ 96, 4, 371, 375, 95, 331, 412, 98, 363, 33,
- /* 690 */ 331, 35, 423, 8, 9, 426, 19, 12, 13, 14,
- /* 700 */ 15, 16, 118, 259, 260, 261, 262, 263, 264, 265,
- /* 710 */ 33, 375, 438, 331, 58, 8, 9, 133, 134, 12,
- /* 720 */ 13, 14, 15, 16, 128, 48, 2, 71, 132, 375,
- /* 730 */ 53, 0, 8, 9, 375, 58, 12, 13, 14, 15,
- /* 740 */ 16, 331, 439, 165, 162, 412, 443, 163, 164, 362,
- /* 750 */ 339, 44, 96, 169, 170, 166, 167, 375, 1, 2,
- /* 760 */ 171, 458, 459, 174, 353, 378, 463, 464, 184, 354,
- /* 770 */ 186, 438, 95, 4, 118, 98, 362, 362, 331, 190,
- /* 780 */ 363, 370, 97, 248, 370, 375, 371, 191, 192, 133,
- /* 790 */ 134, 195, 358, 197, 210, 211, 20, 213, 214, 215,
- /* 800 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
- /* 810 */ 226, 227, 228, 229, 230, 163, 248, 235, 363, 163,
- /* 820 */ 164, 18, 375, 20, 108, 169, 170, 245, 362, 415,
- /* 830 */ 27, 348, 349, 30, 362, 44, 33, 371, 404, 108,
- /* 840 */ 184, 369, 186, 127, 128, 129, 130, 131, 132, 331,
- /* 850 */ 378, 48, 331, 50, 97, 363, 53, 370, 127, 128,
- /* 860 */ 129, 130, 131, 132, 348, 349, 210, 211, 381, 213,
- /* 870 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
- /* 880 */ 224, 225, 226, 227, 228, 229, 230, 350, 97, 352,
- /* 890 */ 339, 372, 18, 375, 375, 331, 375, 23, 95, 0,
- /* 900 */ 339, 8, 9, 0, 353, 12, 13, 14, 15, 16,
- /* 910 */ 107, 37, 38, 363, 353, 41, 331, 370, 363, 8,
- /* 920 */ 9, 370, 362, 12, 13, 14, 15, 16, 381, 369,
- /* 930 */ 42, 370, 44, 59, 60, 61, 62, 269, 378, 375,
- /* 940 */ 137, 165, 108, 140, 141, 142, 143, 144, 145, 146,
- /* 950 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
- /* 960 */ 375, 158, 159, 160, 130, 66, 67, 68, 69, 70,
- /* 970 */ 96, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- /* 980 */ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
- /* 990 */ 91, 92, 339, 339, 331, 8, 9, 399, 394, 12,
- /* 1000 */ 13, 14, 15, 16, 22, 339, 353, 353, 97, 135,
- /* 1010 */ 331, 108, 0, 339, 339, 339, 20, 35, 249, 353,
- /* 1020 */ 39, 331, 331, 370, 370, 331, 331, 353, 353, 353,
- /* 1030 */ 127, 128, 129, 130, 131, 132, 370, 372, 375, 20,
- /* 1040 */ 375, 362, 331, 439, 370, 370, 370, 443, 44, 370,
- /* 1050 */ 176, 177, 178, 71, 375, 181, 377, 339, 165, 331,
- /* 1060 */ 48, 355, 458, 459, 358, 375, 375, 463, 464, 375,
- /* 1070 */ 375, 353, 44, 364, 200, 45, 46, 203, 35, 205,
- /* 1080 */ 206, 207, 208, 209, 375, 406, 375, 332, 370, 410,
- /* 1090 */ 362, 364, 413, 414, 415, 416, 417, 418, 370, 420,
- /* 1100 */ 118, 97, 375, 375, 425, 377, 427, 351, 354, 339,
- /* 1110 */ 431, 432, 246, 247, 22, 64, 362, 364, 409, 410,
- /* 1120 */ 411, 339, 248, 353, 445, 371, 331, 35, 375, 420,
- /* 1130 */ 394, 42, 453, 44, 406, 353, 409, 410, 410, 0,
- /* 1140 */ 370, 413, 414, 415, 416, 417, 418, 420, 420, 165,
- /* 1150 */ 44, 423, 370, 425, 426, 427, 172, 362, 331, 431,
- /* 1160 */ 432, 165, 409, 410, 107, 370, 184, 0, 186, 0,
- /* 1170 */ 375, 100, 377, 420, 103, 439, 0, 100, 100, 443,
- /* 1180 */ 103, 103, 163, 44, 100, 58, 196, 103, 198, 362,
- /* 1190 */ 385, 22, 210, 211, 458, 459, 0, 370, 22, 463,
- /* 1200 */ 464, 406, 375, 97, 377, 410, 35, 331, 413, 414,
- /* 1210 */ 415, 416, 417, 418, 157, 420, 49, 44, 22, 44,
- /* 1220 */ 425, 44, 427, 133, 134, 98, 431, 432, 247, 186,
- /* 1230 */ 44, 44, 44, 406, 44, 1, 2, 410, 362, 96,
- /* 1240 */ 413, 414, 415, 416, 417, 418, 370, 420, 453, 106,
- /* 1250 */ 467, 375, 425, 377, 427, 456, 44, 394, 431, 432,
- /* 1260 */ 44, 210, 44, 44, 44, 341, 331, 450, 362, 442,
- /* 1270 */ 97, 44, 97, 13, 97, 44, 44, 44, 35, 44,
- /* 1280 */ 341, 385, 406, 97, 97, 97, 410, 97, 338, 413,
- /* 1290 */ 414, 415, 416, 417, 418, 35, 420, 362, 13, 271,
- /* 1300 */ 331, 425, 439, 427, 374, 370, 443, 431, 432, 97,
- /* 1310 */ 375, 385, 377, 97, 71, 97, 97, 97, 442, 441,
- /* 1320 */ 35, 458, 459, 433, 97, 460, 463, 464, 97, 97,
- /* 1330 */ 97, 362, 97, 444, 48, 250, 408, 396, 407, 370,
- /* 1340 */ 182, 406, 42, 382, 375, 410, 377, 20, 413, 414,
- /* 1350 */ 415, 416, 417, 418, 382, 420, 385, 186, 380, 162,
- /* 1360 */ 425, 20, 427, 339, 339, 382, 431, 432, 380, 380,
- /* 1370 */ 339, 94, 339, 331, 347, 406, 339, 442, 339, 410,
- /* 1380 */ 20, 333, 413, 414, 415, 416, 417, 418, 333, 420,
- /* 1390 */ 20, 345, 12, 13, 425, 401, 427, 20, 377, 345,
- /* 1400 */ 431, 432, 22, 20, 362, 340, 20, 345, 395, 340,
- /* 1410 */ 52, 442, 370, 33, 342, 35, 342, 375, 345, 377,
- /* 1420 */ 345, 345, 331, 362, 345, 339, 333, 375, 362, 362,
- /* 1430 */ 362, 333, 362, 339, 375, 375, 199, 405, 58, 96,
- /* 1440 */ 343, 403, 362, 362, 362, 362, 401, 189, 406, 362,
- /* 1450 */ 362, 71, 410, 362, 343, 413, 414, 415, 416, 417,
- /* 1460 */ 418, 370, 420, 400, 339, 258, 375, 425, 377, 427,
- /* 1470 */ 257, 449, 377, 431, 432, 449, 375, 375, 175, 375,
- /* 1480 */ 375, 385, 268, 266, 442, 385, 331, 452, 267, 390,
- /* 1490 */ 449, 451, 448, 390, 447, 251, 446, 406, 118, 275,
- /* 1500 */ 272, 410, 468, 247, 413, 414, 415, 416, 417, 418,
- /* 1510 */ 270, 420, 370, 20, 461, 408, 425, 362, 427, 339,
- /* 1520 */ 462, 412, 431, 432, 340, 370, 343, 20, 343, 388,
- /* 1530 */ 375, 375, 377, 167, 390, 375, 375, 375, 375, 390,
- /* 1540 */ 375, 387, 343, 343, 370, 96, 430, 358, 96, 339,
- /* 1550 */ 352, 343, 36, 375, 331, 402, 334, 366, 333, 391,
- /* 1560 */ 356, 406, 356, 397, 184, 410, 186, 356, 413, 414,
- /* 1570 */ 415, 416, 417, 418, 344, 420, 329, 0, 0, 0,
- /* 1580 */ 425, 42, 427, 391, 331, 362, 431, 432, 0, 35,
- /* 1590 */ 210, 211, 204, 370, 35, 35, 35, 204, 375, 0,
- /* 1600 */ 377, 204, 35, 223, 224, 225, 226, 227, 228, 229,
- /* 1610 */ 35, 0, 204, 0, 331, 362, 35, 0, 22, 0,
- /* 1620 */ 35, 191, 186, 370, 184, 0, 0, 0, 375, 406,
- /* 1630 */ 377, 180, 179, 410, 0, 0, 413, 414, 415, 416,
- /* 1640 */ 417, 418, 47, 420, 331, 362, 0, 0, 425, 0,
- /* 1650 */ 427, 42, 0, 370, 431, 432, 0, 0, 375, 406,
- /* 1660 */ 377, 0, 0, 410, 152, 35, 413, 414, 415, 416,
- /* 1670 */ 417, 418, 0, 420, 0, 362, 0, 0, 331, 152,
- /* 1680 */ 427, 0, 0, 370, 431, 432, 0, 0, 375, 406,
- /* 1690 */ 377, 0, 0, 410, 0, 0, 413, 414, 415, 416,
- /* 1700 */ 417, 418, 0, 420, 0, 331, 0, 0, 0, 362,
- /* 1710 */ 427, 0, 0, 0, 431, 432, 0, 370, 0, 406,
- /* 1720 */ 42, 0, 375, 410, 377, 0, 413, 414, 415, 416,
- /* 1730 */ 417, 418, 0, 420, 0, 0, 362, 22, 0, 0,
- /* 1740 */ 136, 0, 0, 0, 370, 35, 58, 0, 58, 375,
- /* 1750 */ 0, 377, 47, 406, 331, 58, 0, 410, 0, 42,
- /* 1760 */ 413, 414, 415, 416, 417, 418, 39, 420, 44, 14,
- /* 1770 */ 47, 14, 0, 47, 0, 0, 40, 0, 465, 466,
- /* 1780 */ 406, 175, 0, 39, 410, 362, 0, 413, 414, 415,
- /* 1790 */ 416, 417, 418, 370, 420, 0, 65, 0, 375, 39,
- /* 1800 */ 377, 427, 455, 0, 35, 39, 432, 48, 0, 48,
- /* 1810 */ 39, 35, 0, 35, 0, 48, 331, 0, 35, 39,
- /* 1820 */ 39, 48, 0, 0, 0, 105, 35, 22, 0, 406,
- /* 1830 */ 0, 103, 44, 410, 35, 35, 413, 414, 415, 416,
- /* 1840 */ 417, 418, 35, 420, 35, 35, 44, 362, 331, 22,
- /* 1850 */ 35, 35, 0, 22, 22, 370, 50, 0, 22, 0,
- /* 1860 */ 375, 35, 377, 0, 35, 0, 22, 20, 35, 35,
- /* 1870 */ 35, 0, 35, 35, 165, 0, 22, 0, 0, 362,
- /* 1880 */ 457, 97, 3, 96, 367, 96, 187, 370, 252, 167,
- /* 1890 */ 44, 406, 375, 97, 377, 410, 231, 331, 413, 414,
- /* 1900 */ 415, 416, 417, 418, 256, 420, 173, 96, 44, 96,
- /* 1910 */ 165, 165, 172, 44, 331, 97, 97, 96, 44, 47,
- /* 1920 */ 172, 96, 252, 406, 44, 3, 35, 410, 362, 47,
- /* 1930 */ 413, 414, 415, 416, 417, 418, 370, 420, 96, 44,
- /* 1940 */ 97, 375, 97, 377, 96, 362, 331, 97, 252, 35,
- /* 1950 */ 367, 466, 35, 370, 35, 35, 35, 97, 375, 97,
- /* 1960 */ 377, 0, 44, 47, 0, 246, 0, 0, 39, 96,
- /* 1970 */ 47, 331, 406, 47, 0, 39, 410, 362, 47, 413,
- /* 1980 */ 414, 415, 416, 417, 418, 370, 420, 97, 422, 406,
- /* 1990 */ 375, 97, 377, 410, 106, 331, 413, 414, 415, 416,
- /* 2000 */ 417, 418, 362, 420, 96, 96, 96, 367, 168, 96,
- /* 2010 */ 370, 2, 44, 22, 210, 375, 231, 377, 47, 166,
- /* 2020 */ 331, 406, 97, 96, 231, 410, 362, 233, 413, 414,
- /* 2030 */ 415, 416, 417, 418, 370, 420, 96, 96, 96, 375,
- /* 2040 */ 97, 377, 97, 97, 96, 96, 406, 47, 22, 96,
- /* 2050 */ 410, 362, 35, 413, 414, 415, 416, 417, 418, 370,
- /* 2060 */ 420, 212, 107, 35, 375, 96, 377, 97, 35, 96,
- /* 2070 */ 406, 35, 97, 97, 410, 96, 35, 413, 414, 415,
- /* 2080 */ 416, 417, 418, 331, 420, 97, 96, 35, 22, 97,
- /* 2090 */ 96, 108, 44, 96, 96, 406, 35, 120, 120, 410,
- /* 2100 */ 120, 120, 413, 414, 415, 416, 417, 418, 96, 420,
- /* 2110 */ 331, 22, 65, 64, 362, 35, 35, 35, 35, 44,
- /* 2120 */ 35, 35, 370, 35, 71, 35, 35, 375, 35, 377,
- /* 2130 */ 93, 35, 331, 35, 35, 22, 35, 35, 35, 71,
- /* 2140 */ 35, 362, 35, 35, 35, 35, 22, 35, 0, 370,
- /* 2150 */ 35, 0, 48, 39, 375, 35, 377, 39, 406, 0,
- /* 2160 */ 35, 39, 410, 362, 48, 413, 414, 415, 416, 417,
- /* 2170 */ 418, 370, 420, 0, 48, 35, 375, 48, 377, 0,
- /* 2180 */ 39, 35, 35, 0, 22, 406, 21, 20, 22, 410,
- /* 2190 */ 22, 21, 413, 414, 415, 416, 417, 418, 469, 420,
- /* 2200 */ 469, 469, 469, 469, 469, 469, 469, 406, 469, 469,
- /* 2210 */ 469, 410, 331, 469, 413, 414, 415, 416, 417, 418,
- /* 2220 */ 469, 420, 469, 469, 469, 469, 469, 469, 469, 331,
- /* 2230 */ 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
- /* 2240 */ 469, 469, 469, 362, 469, 469, 331, 469, 469, 469,
- /* 2250 */ 469, 370, 469, 469, 469, 469, 375, 469, 377, 469,
- /* 2260 */ 362, 469, 469, 469, 469, 469, 469, 469, 370, 469,
- /* 2270 */ 469, 469, 469, 375, 469, 377, 469, 362, 331, 469,
- /* 2280 */ 469, 469, 469, 469, 469, 370, 469, 406, 469, 469,
- /* 2290 */ 375, 410, 377, 469, 413, 414, 415, 416, 417, 418,
- /* 2300 */ 469, 420, 469, 331, 406, 469, 469, 469, 410, 362,
- /* 2310 */ 469, 413, 414, 415, 416, 417, 418, 370, 420, 469,
- /* 2320 */ 469, 406, 375, 469, 377, 410, 469, 331, 413, 414,
- /* 2330 */ 415, 416, 417, 418, 362, 420, 469, 469, 469, 469,
- /* 2340 */ 469, 469, 370, 469, 469, 469, 469, 375, 469, 377,
- /* 2350 */ 469, 469, 331, 406, 469, 469, 469, 410, 362, 469,
- /* 2360 */ 413, 414, 415, 416, 417, 418, 370, 420, 469, 469,
- /* 2370 */ 469, 375, 469, 377, 469, 469, 469, 469, 406, 469,
- /* 2380 */ 469, 469, 410, 362, 469, 413, 414, 415, 416, 417,
- /* 2390 */ 418, 370, 420, 469, 469, 469, 375, 469, 377, 469,
- /* 2400 */ 469, 469, 406, 469, 469, 469, 410, 469, 469, 413,
- /* 2410 */ 414, 415, 416, 417, 418, 331, 420, 469, 469, 469,
- /* 2420 */ 469, 469, 469, 469, 469, 469, 469, 406, 469, 469,
- /* 2430 */ 469, 410, 469, 469, 413, 414, 415, 416, 417, 418,
- /* 2440 */ 469, 420, 331, 469, 469, 469, 362, 469, 469, 469,
- /* 2450 */ 469, 469, 469, 469, 370, 469, 469, 469, 469, 375,
- /* 2460 */ 469, 377, 469, 469, 331, 469, 469, 469, 469, 469,
- /* 2470 */ 469, 469, 469, 362, 469, 469, 469, 469, 469, 469,
- /* 2480 */ 469, 370, 469, 469, 469, 469, 375, 469, 377, 469,
- /* 2490 */ 406, 469, 469, 469, 410, 362, 469, 413, 414, 415,
- /* 2500 */ 416, 417, 418, 370, 420, 469, 469, 469, 375, 469,
- /* 2510 */ 377, 469, 469, 469, 469, 469, 469, 406, 469, 469,
- /* 2520 */ 469, 410, 469, 469, 413, 414, 415, 416, 417, 418,
- /* 2530 */ 469, 420, 469, 469, 469, 469, 469, 469, 469, 406,
- /* 2540 */ 469, 469, 469, 410, 331, 469, 413, 414, 415, 416,
- /* 2550 */ 417, 418, 469, 420, 469, 469, 469, 469, 469, 469,
- /* 2560 */ 469, 331, 469, 469, 469, 469, 469, 469, 469, 469,
- /* 2570 */ 469, 469, 469, 469, 469, 362, 469, 469, 331, 469,
- /* 2580 */ 469, 469, 469, 370, 469, 469, 469, 469, 375, 469,
- /* 2590 */ 377, 469, 362, 469, 469, 469, 469, 469, 469, 469,
- /* 2600 */ 370, 469, 469, 469, 469, 375, 469, 377, 469, 362,
- /* 2610 */ 331, 469, 469, 469, 469, 469, 469, 370, 469, 406,
- /* 2620 */ 469, 469, 375, 410, 377, 469, 413, 414, 415, 416,
- /* 2630 */ 417, 418, 469, 420, 469, 331, 406, 469, 469, 469,
- /* 2640 */ 410, 362, 469, 413, 414, 415, 416, 417, 418, 370,
- /* 2650 */ 420, 469, 469, 406, 375, 469, 377, 410, 469, 331,
- /* 2660 */ 413, 414, 415, 416, 417, 418, 362, 420, 469, 469,
- /* 2670 */ 469, 469, 469, 469, 370, 469, 469, 469, 469, 375,
- /* 2680 */ 469, 377, 469, 469, 469, 406, 469, 469, 469, 410,
- /* 2690 */ 362, 469, 413, 414, 415, 416, 417, 418, 370, 420,
- /* 2700 */ 469, 469, 469, 375, 469, 377, 469, 469, 469, 469,
- /* 2710 */ 406, 469, 469, 469, 410, 469, 469, 413, 414, 415,
- /* 2720 */ 416, 417, 418, 469, 420, 469, 469, 469, 469, 469,
- /* 2730 */ 469, 469, 469, 469, 406, 469, 469, 469, 410, 469,
- /* 2740 */ 469, 413, 414, 415, 416, 417, 418, 469, 420,
+ /* 230 */ 230, 231, 232, 233, 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, 4, 166, 167, 171, 100, 63, 112,
+ /* 270 */ 172, 173, 21, 141, 142, 24, 25, 26, 27, 28,
+ /* 280 */ 29, 30, 31, 32, 186, 112, 188, 130, 131, 132,
+ /* 290 */ 133, 134, 135, 8, 9, 166, 164, 12, 13, 14,
+ /* 300 */ 15, 16, 20, 130, 131, 132, 133, 134, 135, 329,
+ /* 310 */ 416, 213, 214, 58, 216, 217, 218, 219, 220, 221,
+ /* 320 */ 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
+ /* 330 */ 232, 233, 234, 12, 13, 376, 442, 365, 379, 380,
+ /* 340 */ 250, 20, 97, 22, 337, 373, 100, 340, 341, 64,
+ /* 350 */ 255, 256, 257, 0, 33, 100, 35, 102, 113, 114,
+ /* 360 */ 115, 116, 117, 118, 119, 120, 121, 122, 346, 124,
+ /* 370 */ 125, 126, 127, 128, 129, 0, 2, 397, 332, 58,
+ /* 380 */ 111, 401, 8, 9, 4, 64, 12, 13, 14, 15,
+ /* 390 */ 16, 419, 71, 371, 109, 340, 21, 20, 234, 24,
+ /* 400 */ 25, 26, 27, 28, 29, 30, 31, 32, 8, 9,
+ /* 410 */ 340, 365, 12, 13, 14, 15, 16, 250, 97, 373,
+ /* 420 */ 20, 100, 340, 443, 378, 71, 380, 447, 234, 365,
+ /* 430 */ 236, 12, 13, 14, 340, 111, 372, 361, 356, 20,
+ /* 440 */ 22, 22, 462, 463, 389, 381, 391, 467, 468, 332,
+ /* 450 */ 165, 213, 33, 35, 35, 373, 410, 136, 137, 389,
+ /* 460 */ 414, 391, 3, 417, 418, 419, 420, 421, 422, 423,
+ /* 470 */ 424, 425, 426, 66, 67, 68, 35, 58, 340, 20,
+ /* 480 */ 100, 74, 75, 389, 408, 391, 79, 166, 167, 3,
+ /* 490 */ 71, 84, 85, 172, 173, 378, 250, 90, 260, 261,
+ /* 500 */ 262, 263, 264, 265, 266, 250, 71, 186, 155, 188,
+ /* 510 */ 251, 373, 71, 136, 137, 97, 97, 164, 44, 100,
+ /* 520 */ 351, 352, 237, 238, 239, 240, 241, 242, 243, 244,
+ /* 530 */ 245, 246, 247, 20, 213, 214, 402, 216, 217, 218,
+ /* 540 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
+ /* 550 */ 229, 230, 231, 232, 233, 136, 137, 8, 9, 366,
+ /* 560 */ 101, 12, 13, 14, 15, 16, 8, 9, 168, 332,
+ /* 570 */ 12, 13, 14, 15, 16, 101, 438, 439, 440, 441,
+ /* 580 */ 332, 443, 444, 340, 443, 166, 167, 333, 447, 8,
+ /* 590 */ 9, 172, 173, 12, 13, 14, 15, 16, 443, 356,
+ /* 600 */ 366, 340, 447, 462, 463, 186, 363, 188, 467, 468,
+ /* 610 */ 332, 20, 428, 365, 430, 378, 373, 356, 463, 130,
+ /* 620 */ 47, 373, 467, 468, 363, 44, 378, 168, 380, 428,
+ /* 630 */ 250, 430, 213, 214, 373, 216, 217, 218, 219, 220,
+ /* 640 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
+ /* 650 */ 231, 232, 233, 12, 13, 346, 378, 332, 410, 101,
+ /* 660 */ 397, 20, 414, 22, 401, 417, 418, 419, 420, 421,
+ /* 670 */ 422, 362, 424, 100, 33, 427, 35, 429, 430, 431,
+ /* 680 */ 371, 168, 165, 435, 436, 196, 197, 22, 8, 9,
+ /* 690 */ 365, 100, 12, 13, 14, 15, 16, 365, 373, 58,
+ /* 700 */ 35, 340, 416, 378, 372, 380, 443, 340, 2, 353,
+ /* 710 */ 447, 355, 71, 381, 8, 9, 379, 380, 12, 13,
+ /* 720 */ 14, 15, 16, 356, 366, 462, 463, 178, 442, 131,
+ /* 730 */ 467, 468, 340, 135, 373, 410, 71, 340, 97, 414,
+ /* 740 */ 373, 100, 417, 418, 419, 420, 421, 422, 356, 424,
+ /* 750 */ 37, 12, 13, 356, 237, 20, 270, 22, 357, 20,
+ /* 760 */ 365, 22, 97, 357, 247, 373, 365, 372, 130, 131,
+ /* 770 */ 373, 365, 33, 135, 35, 374, 381, 136, 137, 0,
+ /* 780 */ 374, 101, 332, 8, 9, 0, 51, 12, 13, 14,
+ /* 790 */ 15, 16, 194, 195, 469, 470, 198, 58, 200, 332,
+ /* 800 */ 439, 440, 441, 332, 443, 444, 344, 166, 167, 416,
+ /* 810 */ 71, 351, 352, 172, 173, 340, 103, 112, 105, 106,
+ /* 820 */ 181, 108, 360, 44, 275, 112, 365, 186, 378, 188,
+ /* 830 */ 368, 356, 365, 372, 39, 442, 97, 21, 133, 100,
+ /* 840 */ 373, 250, 381, 204, 205, 378, 133, 380, 373, 378,
+ /* 850 */ 34, 186, 36, 188, 213, 214, 332, 216, 217, 218,
+ /* 860 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
+ /* 870 */ 229, 230, 231, 232, 233, 136, 137, 410, 213, 214,
+ /* 880 */ 397, 414, 1, 2, 417, 418, 419, 420, 421, 422,
+ /* 890 */ 344, 424, 20, 14, 14, 15, 16, 112, 431, 20,
+ /* 900 */ 100, 332, 378, 436, 365, 166, 167, 340, 340, 20,
+ /* 910 */ 110, 172, 173, 374, 368, 130, 131, 132, 133, 134,
+ /* 920 */ 135, 365, 20, 356, 356, 186, 443, 188, 8, 9,
+ /* 930 */ 447, 354, 12, 13, 14, 15, 16, 381, 373, 375,
+ /* 940 */ 373, 373, 378, 168, 332, 462, 463, 378, 0, 384,
+ /* 950 */ 467, 468, 213, 214, 111, 216, 217, 218, 219, 220,
+ /* 960 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
+ /* 970 */ 231, 232, 233, 100, 18, 18, 20, 397, 12, 13,
+ /* 980 */ 23, 373, 101, 27, 22, 4, 30, 332, 22, 33,
+ /* 990 */ 378, 373, 384, 358, 37, 38, 361, 35, 41, 33,
+ /* 1000 */ 19, 35, 384, 160, 48, 58, 50, 332, 22, 53,
+ /* 1010 */ 332, 63, 375, 44, 33, 378, 59, 60, 61, 62,
+ /* 1020 */ 365, 35, 332, 443, 58, 136, 137, 447, 373, 48,
+ /* 1030 */ 45, 46, 332, 378, 53, 380, 366, 71, 340, 58,
+ /* 1040 */ 168, 332, 462, 463, 249, 166, 99, 467, 468, 102,
+ /* 1050 */ 58, 332, 332, 378, 356, 99, 378, 100, 185, 97,
+ /* 1060 */ 187, 172, 173, 97, 20, 410, 44, 111, 378, 414,
+ /* 1070 */ 168, 373, 417, 418, 419, 420, 421, 422, 378, 424,
+ /* 1080 */ 99, 332, 367, 102, 429, 212, 431, 378, 332, 375,
+ /* 1090 */ 435, 436, 378, 378, 102, 138, 140, 378, 378, 143,
+ /* 1100 */ 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
+ /* 1110 */ 154, 155, 156, 157, 158, 159, 340, 161, 162, 163,
+ /* 1120 */ 366, 104, 340, 250, 107, 332, 340, 378, 413, 414,
+ /* 1130 */ 415, 340, 356, 0, 378, 178, 179, 180, 356, 424,
+ /* 1140 */ 183, 332, 356, 248, 249, 340, 42, 356, 44, 373,
+ /* 1150 */ 35, 42, 186, 44, 188, 373, 64, 340, 366, 373,
+ /* 1160 */ 203, 356, 0, 206, 373, 208, 209, 210, 211, 212,
+ /* 1170 */ 340, 378, 332, 356, 365, 199, 366, 201, 373, 213,
+ /* 1180 */ 214, 48, 373, 471, 22, 44, 356, 378, 340, 380,
+ /* 1190 */ 373, 35, 226, 227, 228, 229, 230, 231, 232, 340,
+ /* 1200 */ 332, 340, 0, 373, 356, 365, 104, 250, 44, 107,
+ /* 1210 */ 166, 104, 388, 373, 107, 356, 44, 356, 378, 410,
+ /* 1220 */ 380, 373, 332, 414, 22, 0, 417, 418, 419, 420,
+ /* 1230 */ 421, 422, 373, 424, 373, 44, 44, 44, 429, 332,
+ /* 1240 */ 431, 272, 101, 96, 435, 436, 378, 22, 104, 44,
+ /* 1250 */ 410, 107, 1, 2, 414, 365, 44, 417, 418, 419,
+ /* 1260 */ 420, 421, 422, 373, 424, 101, 457, 0, 378, 429,
+ /* 1270 */ 380, 431, 365, 101, 460, 435, 436, 44, 136, 137,
+ /* 1280 */ 373, 342, 44, 454, 44, 378, 446, 380, 365, 44,
+ /* 1290 */ 339, 44, 101, 101, 101, 342, 274, 44, 44, 332,
+ /* 1300 */ 410, 44, 44, 188, 414, 213, 101, 417, 418, 419,
+ /* 1310 */ 420, 421, 422, 101, 424, 168, 49, 410, 388, 332,
+ /* 1320 */ 377, 414, 44, 44, 417, 418, 419, 420, 421, 422,
+ /* 1330 */ 388, 424, 365, 35, 101, 13, 429, 19, 431, 101,
+ /* 1340 */ 373, 101, 435, 436, 188, 378, 101, 380, 101, 459,
+ /* 1350 */ 445, 33, 365, 446, 101, 101, 13, 35, 101, 101,
+ /* 1360 */ 373, 464, 437, 448, 252, 378, 48, 380, 48, 71,
+ /* 1370 */ 412, 411, 54, 55, 56, 57, 58, 410, 35, 101,
+ /* 1380 */ 101, 414, 184, 399, 417, 418, 419, 420, 421, 422,
+ /* 1390 */ 42, 424, 385, 20, 388, 385, 429, 410, 431, 165,
+ /* 1400 */ 20, 414, 435, 436, 417, 418, 419, 420, 421, 422,
+ /* 1410 */ 383, 424, 340, 446, 340, 385, 429, 99, 431, 383,
+ /* 1420 */ 102, 383, 435, 436, 98, 350, 95, 349, 332, 340,
+ /* 1430 */ 94, 348, 397, 446, 340, 33, 20, 340, 340, 334,
+ /* 1440 */ 334, 20, 405, 20, 380, 346, 346, 20, 332, 341,
+ /* 1450 */ 48, 20, 134, 398, 341, 52, 54, 55, 56, 57,
+ /* 1460 */ 58, 365, 340, 346, 346, 346, 346, 346, 343, 373,
+ /* 1470 */ 343, 334, 340, 334, 378, 365, 380, 202, 443, 365,
+ /* 1480 */ 409, 365, 447, 100, 407, 405, 192, 169, 365, 373,
+ /* 1490 */ 344, 365, 174, 365, 378, 365, 380, 462, 463, 365,
+ /* 1500 */ 365, 99, 467, 468, 102, 365, 410, 378, 190, 378,
+ /* 1510 */ 414, 193, 191, 417, 418, 419, 420, 421, 422, 365,
+ /* 1520 */ 424, 378, 332, 365, 344, 429, 410, 431, 404, 380,
+ /* 1530 */ 414, 435, 436, 417, 418, 419, 420, 421, 422, 403,
+ /* 1540 */ 424, 340, 446, 388, 378, 429, 332, 431, 388, 259,
+ /* 1550 */ 258, 435, 436, 378, 453, 365, 393, 378, 393, 378,
+ /* 1560 */ 267, 177, 253, 373, 453, 269, 271, 268, 378, 412,
+ /* 1570 */ 380, 169, 170, 276, 273, 472, 174, 249, 176, 365,
+ /* 1580 */ 373, 20, 340, 416, 341, 344, 20, 373, 344, 393,
+ /* 1590 */ 391, 378, 378, 455, 380, 193, 332, 378, 378, 451,
+ /* 1600 */ 410, 456, 450, 453, 414, 397, 378, 417, 418, 419,
+ /* 1610 */ 420, 421, 422, 332, 424, 378, 393, 466, 465, 429,
+ /* 1620 */ 452, 431, 170, 361, 410, 435, 436, 378, 414, 365,
+ /* 1630 */ 344, 417, 418, 419, 420, 421, 422, 373, 424, 373,
+ /* 1640 */ 390, 100, 378, 434, 380, 431, 365, 344, 100, 435,
+ /* 1650 */ 436, 443, 369, 340, 373, 447, 344, 355, 378, 378,
+ /* 1660 */ 36, 380, 335, 334, 394, 400, 406, 394, 345, 359,
+ /* 1670 */ 462, 463, 330, 332, 410, 467, 468, 0, 414, 0,
+ /* 1680 */ 0, 417, 418, 419, 420, 421, 422, 42, 424, 359,
+ /* 1690 */ 0, 410, 359, 332, 35, 414, 207, 35, 417, 418,
+ /* 1700 */ 419, 420, 421, 422, 35, 424, 365, 35, 207, 0,
+ /* 1710 */ 35, 35, 431, 207, 373, 0, 435, 436, 207, 378,
+ /* 1720 */ 0, 380, 35, 0, 22, 461, 365, 0, 35, 194,
+ /* 1730 */ 188, 186, 0, 0, 373, 0, 182, 181, 0, 378,
+ /* 1740 */ 0, 380, 47, 0, 0, 0, 42, 0, 0, 0,
+ /* 1750 */ 0, 410, 0, 0, 0, 414, 332, 0, 417, 418,
+ /* 1760 */ 419, 420, 421, 422, 155, 424, 35, 0, 155, 0,
+ /* 1770 */ 0, 410, 431, 0, 0, 414, 435, 436, 417, 418,
+ /* 1780 */ 419, 420, 421, 422, 42, 424, 0, 0, 0, 365,
+ /* 1790 */ 0, 0, 0, 0, 370, 0, 0, 373, 0, 0,
+ /* 1800 */ 0, 0, 378, 0, 380, 0, 0, 0, 0, 0,
+ /* 1810 */ 0, 22, 0, 139, 332, 0, 0, 96, 96, 22,
+ /* 1820 */ 0, 58, 0, 58, 22, 0, 58, 0, 0, 35,
+ /* 1830 */ 47, 470, 14, 14, 410, 0, 0, 0, 414, 332,
+ /* 1840 */ 0, 417, 418, 419, 420, 421, 422, 365, 424, 0,
+ /* 1850 */ 177, 47, 39, 42, 0, 373, 0, 0, 44, 0,
+ /* 1860 */ 378, 40, 380, 39, 47, 39, 35, 0, 39, 35,
+ /* 1870 */ 0, 39, 365, 35, 0, 0, 0, 370, 48, 35,
+ /* 1880 */ 373, 48, 39, 0, 0, 378, 39, 380, 65, 48,
+ /* 1890 */ 109, 22, 410, 48, 0, 35, 414, 35, 35, 417,
+ /* 1900 */ 418, 419, 420, 421, 422, 0, 424, 35, 426, 44,
+ /* 1910 */ 44, 22, 332, 35, 35, 35, 35, 410, 22, 0,
+ /* 1920 */ 22, 414, 22, 50, 417, 418, 419, 420, 421, 422,
+ /* 1930 */ 0, 424, 35, 332, 0, 0, 35, 35, 0, 22,
+ /* 1940 */ 20, 35, 35, 35, 0, 365, 107, 101, 100, 35,
+ /* 1950 */ 370, 100, 0, 373, 22, 189, 0, 0, 378, 22,
+ /* 1960 */ 380, 3, 332, 47, 254, 44, 365, 44, 44, 44,
+ /* 1970 */ 254, 44, 3, 47, 373, 44, 35, 100, 254, 378,
+ /* 1980 */ 35, 380, 100, 332, 96, 98, 101, 96, 95, 35,
+ /* 1990 */ 410, 101, 44, 101, 414, 365, 101, 417, 418, 419,
+ /* 2000 */ 420, 421, 422, 373, 424, 101, 35, 35, 378, 100,
+ /* 2010 */ 380, 410, 100, 100, 35, 414, 365, 47, 417, 418,
+ /* 2020 */ 419, 420, 421, 422, 373, 424, 168, 175, 100, 378,
+ /* 2030 */ 101, 380, 168, 332, 101, 47, 0, 101, 170, 168,
+ /* 2040 */ 410, 0, 0, 0, 414, 39, 100, 417, 418, 419,
+ /* 2050 */ 420, 421, 422, 100, 424, 47, 101, 171, 332, 39,
+ /* 2060 */ 101, 410, 100, 100, 100, 414, 365, 0, 417, 418,
+ /* 2070 */ 419, 420, 421, 422, 373, 424, 100, 110, 47, 378,
+ /* 2080 */ 169, 380, 44, 98, 98, 2, 22, 100, 235, 111,
+ /* 2090 */ 101, 365, 100, 332, 101, 100, 47, 100, 248, 373,
+ /* 2100 */ 101, 100, 47, 101, 378, 100, 380, 22, 101, 35,
+ /* 2110 */ 100, 410, 213, 35, 101, 414, 332, 35, 417, 418,
+ /* 2120 */ 419, 420, 421, 422, 100, 424, 365, 101, 35, 100,
+ /* 2130 */ 215, 101, 35, 100, 373, 101, 410, 35, 123, 378,
+ /* 2140 */ 414, 380, 123, 417, 418, 419, 420, 421, 422, 365,
+ /* 2150 */ 424, 100, 22, 100, 44, 123, 112, 373, 123, 35,
+ /* 2160 */ 100, 100, 378, 22, 380, 65, 35, 64, 35, 35,
+ /* 2170 */ 35, 410, 35, 35, 332, 414, 71, 35, 417, 418,
+ /* 2180 */ 419, 420, 421, 422, 35, 424, 35, 35, 93, 44,
+ /* 2190 */ 35, 35, 35, 332, 410, 22, 35, 35, 414, 35,
+ /* 2200 */ 71, 417, 418, 419, 420, 421, 422, 365, 424, 35,
+ /* 2210 */ 22, 35, 35, 35, 35, 373, 35, 0, 35, 48,
+ /* 2220 */ 378, 39, 380, 0, 35, 39, 365, 0, 48, 35,
+ /* 2230 */ 39, 0, 48, 35, 373, 48, 39, 0, 35, 378,
+ /* 2240 */ 35, 380, 0, 22, 22, 21, 20, 22, 473, 21,
+ /* 2250 */ 473, 473, 410, 473, 332, 473, 414, 473, 473, 417,
+ /* 2260 */ 418, 419, 420, 421, 422, 473, 424, 473, 473, 473,
+ /* 2270 */ 473, 410, 473, 473, 473, 414, 473, 473, 417, 418,
+ /* 2280 */ 419, 420, 421, 422, 473, 424, 473, 365, 473, 473,
+ /* 2290 */ 473, 473, 473, 473, 473, 373, 473, 473, 473, 473,
+ /* 2300 */ 378, 473, 380, 473, 473, 473, 473, 473, 473, 473,
+ /* 2310 */ 473, 473, 332, 473, 473, 473, 473, 473, 473, 473,
+ /* 2320 */ 473, 473, 473, 473, 473, 473, 473, 473, 332, 473,
+ /* 2330 */ 473, 473, 410, 473, 473, 473, 414, 473, 473, 417,
+ /* 2340 */ 418, 419, 420, 421, 422, 365, 424, 473, 473, 473,
+ /* 2350 */ 473, 473, 473, 373, 473, 473, 473, 473, 378, 473,
+ /* 2360 */ 380, 365, 473, 473, 473, 473, 473, 473, 473, 373,
+ /* 2370 */ 473, 473, 473, 473, 378, 473, 380, 473, 473, 473,
+ /* 2380 */ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ /* 2390 */ 410, 332, 473, 473, 414, 473, 473, 417, 418, 419,
+ /* 2400 */ 420, 421, 422, 473, 424, 473, 410, 332, 473, 473,
+ /* 2410 */ 414, 473, 473, 417, 418, 419, 420, 421, 422, 473,
+ /* 2420 */ 424, 473, 473, 473, 365, 473, 332, 473, 473, 473,
+ /* 2430 */ 473, 473, 373, 473, 473, 473, 473, 378, 473, 380,
+ /* 2440 */ 365, 473, 473, 473, 473, 473, 473, 473, 373, 473,
+ /* 2450 */ 473, 473, 473, 378, 473, 380, 473, 473, 473, 365,
+ /* 2460 */ 473, 473, 473, 473, 473, 473, 473, 373, 473, 410,
+ /* 2470 */ 473, 473, 378, 414, 380, 473, 417, 418, 419, 420,
+ /* 2480 */ 421, 422, 473, 424, 473, 410, 473, 473, 473, 414,
+ /* 2490 */ 332, 473, 417, 418, 419, 420, 421, 422, 473, 424,
+ /* 2500 */ 473, 473, 473, 473, 410, 473, 473, 332, 414, 473,
+ /* 2510 */ 473, 417, 418, 419, 420, 421, 422, 473, 424, 473,
+ /* 2520 */ 473, 473, 473, 365, 473, 473, 473, 473, 473, 473,
+ /* 2530 */ 473, 373, 473, 473, 473, 473, 378, 473, 380, 473,
+ /* 2540 */ 365, 473, 473, 473, 473, 473, 473, 473, 373, 473,
+ /* 2550 */ 473, 473, 473, 378, 473, 380, 473, 473, 473, 473,
+ /* 2560 */ 473, 473, 473, 473, 473, 473, 473, 332, 410, 473,
+ /* 2570 */ 473, 473, 414, 473, 473, 417, 418, 419, 420, 421,
+ /* 2580 */ 422, 473, 424, 473, 473, 410, 473, 332, 473, 414,
+ /* 2590 */ 473, 473, 417, 418, 419, 420, 421, 422, 473, 424,
+ /* 2600 */ 365, 473, 473, 473, 473, 473, 473, 473, 373, 473,
+ /* 2610 */ 473, 473, 473, 378, 473, 380, 473, 473, 473, 473,
+ /* 2620 */ 365, 473, 473, 473, 473, 473, 473, 473, 373, 473,
+ /* 2630 */ 473, 473, 473, 378, 473, 380, 473, 473, 473, 473,
+ /* 2640 */ 473, 473, 473, 473, 473, 410, 473, 473, 473, 414,
+ /* 2650 */ 473, 473, 417, 418, 419, 420, 421, 422, 473, 424,
+ /* 2660 */ 473, 332, 473, 473, 473, 410, 473, 473, 473, 414,
+ /* 2670 */ 473, 473, 417, 418, 419, 420, 421, 422, 332, 424,
+ /* 2680 */ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ /* 2690 */ 473, 473, 473, 473, 365, 473, 473, 473, 473, 473,
+ /* 2700 */ 473, 473, 373, 473, 473, 473, 473, 378, 473, 380,
+ /* 2710 */ 473, 365, 473, 473, 473, 473, 473, 473, 473, 373,
+ /* 2720 */ 473, 473, 473, 473, 378, 473, 380, 473, 473, 473,
+ /* 2730 */ 473, 473, 473, 473, 473, 473, 473, 473, 473, 410,
+ /* 2740 */ 332, 473, 473, 414, 473, 473, 417, 418, 419, 420,
+ /* 2750 */ 421, 422, 473, 424, 473, 473, 410, 473, 473, 473,
+ /* 2760 */ 414, 473, 473, 417, 418, 419, 420, 421, 422, 473,
+ /* 2770 */ 424, 473, 473, 365, 473, 473, 473, 473, 473, 473,
+ /* 2780 */ 473, 373, 473, 473, 473, 473, 378, 473, 380, 473,
+ /* 2790 */ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ /* 2800 */ 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
+ /* 2810 */ 473, 473, 473, 473, 473, 473, 473, 473, 410, 473,
+ /* 2820 */ 473, 473, 414, 473, 473, 417, 418, 419, 420, 421,
+ /* 2830 */ 422, 473, 424,
};
-#define YY_SHIFT_COUNT (742)
+#define YY_SHIFT_COUNT (752)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (2183)
+#define YY_SHIFT_MAX (2242)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 874, 0, 72, 0, 293, 293, 293, 293, 293, 293,
- /* 10 */ 293, 293, 293, 293, 293, 365, 584, 584, 656, 584,
- /* 20 */ 584, 584, 584, 584, 584, 584, 584, 584, 584, 584,
- /* 30 */ 584, 584, 584, 584, 584, 584, 584, 584, 584, 584,
- /* 40 */ 584, 584, 584, 584, 584, 584, 584, 584, 172, 292,
- /* 50 */ 185, 184, 135, 535, 568, 535, 184, 184, 1380, 1380,
- /* 60 */ 1380, 535, 1380, 1380, 388, 535, 16, 482, 115, 115,
- /* 70 */ 482, 86, 86, 307, 360, 346, 346, 115, 115, 115,
- /* 80 */ 115, 115, 115, 115, 147, 115, 115, 138, 16, 115,
- /* 90 */ 115, 189, 115, 16, 115, 147, 115, 147, 16, 115,
- /* 100 */ 115, 16, 115, 16, 16, 16, 115, 176, 803, 34,
- /* 110 */ 34, 219, 458, 982, 982, 982, 982, 982, 982, 982,
- /* 120 */ 982, 982, 982, 982, 982, 982, 982, 982, 982, 982,
- /* 130 */ 982, 982, 217, 379, 307, 360, 249, 578, 578, 578,
- /* 140 */ 2, 152, 152, 249, 245, 245, 245, 138, 260, 208,
- /* 150 */ 16, 470, 16, 470, 470, 459, 606, 36, 36, 36,
- /* 160 */ 36, 36, 36, 36, 36, 298, 418, 406, 47, 329,
- /* 170 */ 444, 60, 69, 239, 652, 353, 776, 1030, 834, 996,
- /* 180 */ 866, 981, 668, 866, 888, 769, 1019, 1085, 1286, 1158,
- /* 190 */ 1300, 1327, 1300, 1197, 1341, 1341, 1300, 1197, 1197, 1341,
- /* 200 */ 1277, 1341, 1341, 1341, 1360, 1360, 1370, 138, 1377, 138,
- /* 210 */ 1383, 1386, 138, 1383, 138, 138, 138, 1341, 138, 1358,
- /* 220 */ 1358, 1360, 16, 16, 16, 16, 16, 16, 16, 16,
- /* 230 */ 16, 16, 16, 1341, 1360, 470, 470, 470, 1237, 1343,
- /* 240 */ 1370, 176, 1258, 1377, 176, 1341, 1327, 1327, 470, 1207,
- /* 250 */ 1213, 470, 1207, 1213, 470, 470, 16, 1217, 1303, 1207,
- /* 260 */ 1214, 1221, 1244, 1085, 1224, 1228, 1240, 1256, 245, 1493,
- /* 270 */ 1341, 1383, 176, 176, 1507, 1213, 470, 470, 470, 470,
- /* 280 */ 470, 1213, 470, 1366, 176, 459, 176, 245, 1449, 1452,
- /* 290 */ 470, 606, 1341, 176, 1516, 1360, 2749, 2749, 2749, 2749,
- /* 300 */ 2749, 2749, 2749, 2749, 2749, 899, 589, 530, 677, 685,
- /* 310 */ 707, 911, 731, 15, 724, 893, 903, 987, 987, 987,
- /* 320 */ 987, 987, 987, 987, 987, 987, 716, 596, 295, 295,
- /* 330 */ 407, 161, 489, 397, 81, 370, 263, 263, 557, 757,
- /* 340 */ 582, 557, 557, 557, 1012, 791, 1092, 1089, 1057, 1139,
- /* 350 */ 1071, 1077, 1078, 1084, 1169, 1176, 1196, 990, 1004, 1106,
- /* 360 */ 1127, 1173, 1175, 1177, 1090, 1028, 66, 984, 1186, 1187,
- /* 370 */ 1188, 1190, 1212, 1216, 1234, 1218, 1043, 1171, 1051, 1219,
- /* 380 */ 431, 1220, 1227, 1231, 1232, 1233, 1235, 1143, 1260, 1285,
- /* 390 */ 1243, 1167, 1577, 1578, 1579, 1539, 1588, 1554, 1388, 1559,
- /* 400 */ 1560, 1561, 1393, 1599, 1567, 1575, 1397, 1611, 1408, 1613,
- /* 410 */ 1581, 1617, 1596, 1619, 1585, 1430, 1436, 1440, 1625, 1626,
- /* 420 */ 1627, 1451, 1453, 1634, 1635, 1595, 1646, 1647, 1649, 1609,
- /* 430 */ 1652, 1656, 1657, 1661, 1662, 1672, 1674, 1676, 1512, 1630,
- /* 440 */ 1677, 1527, 1681, 1682, 1686, 1687, 1691, 1692, 1694, 1695,
- /* 450 */ 1702, 1704, 1706, 1707, 1708, 1711, 1712, 1713, 1678, 1716,
- /* 460 */ 1718, 1721, 1725, 1732, 1734, 1715, 1735, 1738, 1739, 1604,
- /* 470 */ 1741, 1742, 1743, 1688, 1710, 1747, 1690, 1750, 1697, 1756,
- /* 480 */ 1758, 1717, 1727, 1724, 1705, 1755, 1723, 1757, 1726, 1772,
- /* 490 */ 1736, 1744, 1774, 1775, 1777, 1760, 1606, 1782, 1786, 1795,
- /* 500 */ 1731, 1797, 1803, 1769, 1759, 1766, 1808, 1776, 1761, 1771,
- /* 510 */ 1812, 1778, 1767, 1780, 1814, 1783, 1773, 1781, 1817, 1822,
- /* 520 */ 1823, 1824, 1720, 1728, 1791, 1805, 1828, 1799, 1800, 1807,
- /* 530 */ 1809, 1788, 1802, 1810, 1815, 1827, 1816, 1830, 1831, 1852,
- /* 540 */ 1832, 1806, 1857, 1836, 1826, 1859, 1829, 1863, 1833, 1865,
- /* 550 */ 1844, 1847, 1834, 1835, 1837, 1784, 1787, 1871, 1709, 1789,
- /* 560 */ 1838, 1875, 1699, 1854, 1745, 1722, 1877, 1878, 1746, 1733,
- /* 570 */ 1879, 1846, 1636, 1811, 1796, 1813, 1740, 1665, 1748, 1648,
- /* 580 */ 1818, 1864, 1869, 1819, 1821, 1825, 1842, 1843, 1874, 1872,
- /* 590 */ 1882, 1848, 1880, 1670, 1845, 1850, 1922, 1895, 1696, 1891,
- /* 600 */ 1914, 1917, 1919, 1920, 1921, 1860, 1862, 1916, 1719, 1918,
- /* 610 */ 1923, 1961, 1964, 1966, 1967, 1873, 1929, 1705, 1926, 1908,
- /* 620 */ 1890, 1894, 1909, 1910, 1840, 1913, 1974, 1936, 1853, 1927,
- /* 630 */ 1888, 1705, 1931, 1968, 1785, 1794, 1793, 2009, 1991, 1804,
- /* 640 */ 1940, 1925, 1941, 1943, 1942, 1945, 1971, 1948, 1949, 2000,
- /* 650 */ 1946, 2026, 1849, 1953, 1955, 1970, 2017, 2028, 1969, 1975,
- /* 660 */ 2033, 1973, 1976, 2036, 1979, 1988, 2041, 1990, 1992, 2052,
- /* 670 */ 1994, 1977, 1978, 1980, 1981, 2066, 1983, 1997, 2048, 1998,
- /* 680 */ 2061, 2012, 2048, 2048, 2089, 2047, 2049, 2080, 2081, 2082,
- /* 690 */ 2083, 2085, 2086, 2088, 2090, 2091, 2093, 2053, 2037, 2075,
- /* 700 */ 2096, 2098, 2099, 2113, 2101, 2102, 2103, 2068, 1788, 2105,
- /* 710 */ 1802, 2107, 2108, 2109, 2110, 2124, 2112, 2148, 2115, 2104,
- /* 720 */ 2114, 2151, 2120, 2116, 2118, 2159, 2125, 2126, 2122, 2173,
- /* 730 */ 2140, 2129, 2141, 2179, 2146, 2147, 2183, 2162, 2165, 2166,
- /* 740 */ 2168, 2170, 2167,
+ /* 0 */ 957, 0, 98, 0, 321, 321, 321, 321, 321, 321,
+ /* 10 */ 321, 321, 321, 321, 321, 419, 641, 641, 739, 641,
+ /* 20 */ 641, 641, 641, 641, 641, 641, 641, 641, 641, 641,
+ /* 30 */ 641, 641, 641, 641, 641, 641, 641, 641, 641, 641,
+ /* 40 */ 641, 641, 641, 641, 641, 641, 641, 641, 167, 591,
+ /* 50 */ 873, 68, 255, 90, 246, 90, 68, 68, 966, 966,
+ /* 60 */ 966, 90, 966, 966, 380, 90, 9, 889, 24, 24,
+ /* 70 */ 889, 151, 151, 41, 377, 63, 63, 24, 24, 24,
+ /* 80 */ 24, 24, 24, 24, 84, 24, 24, 108, 9, 24,
+ /* 90 */ 24, 221, 24, 9, 24, 84, 24, 84, 9, 24,
+ /* 100 */ 24, 9, 24, 9, 9, 9, 24, 205, 956, 285,
+ /* 110 */ 285, 251, 407, 665, 665, 665, 665, 665, 665, 665,
+ /* 120 */ 665, 665, 665, 665, 665, 665, 665, 665, 665, 665,
+ /* 130 */ 665, 665, 713, 459, 41, 377, 441, 513, 513, 513,
+ /* 140 */ 948, 194, 194, 441, 282, 282, 282, 108, 269, 164,
+ /* 150 */ 9, 354, 9, 354, 354, 324, 435, 245, 245, 245,
+ /* 160 */ 245, 245, 245, 245, 245, 1318, 375, 125, 400, 549,
+ /* 170 */ 238, 112, 95, 129, 879, 735, 872, 985, 705, 902,
+ /* 180 */ 895, 795, 486, 895, 1104, 259, 1044, 1112, 1320, 1198,
+ /* 190 */ 1348, 1373, 1348, 1234, 1380, 1380, 1348, 1234, 1234, 1326,
+ /* 200 */ 1331, 1380, 1336, 1380, 1380, 1380, 1416, 1416, 1421, 108,
+ /* 210 */ 1423, 108, 1427, 1431, 108, 1427, 108, 108, 108, 1380,
+ /* 220 */ 108, 1403, 1403, 1416, 9, 9, 9, 9, 9, 9,
+ /* 230 */ 9, 9, 9, 9, 9, 1380, 1416, 354, 354, 354,
+ /* 240 */ 1275, 1383, 1421, 205, 1294, 1321, 1423, 205, 1380, 1373,
+ /* 250 */ 1373, 354, 1290, 1292, 354, 1290, 1292, 354, 354, 9,
+ /* 260 */ 1293, 1384, 1290, 1296, 1299, 1309, 1112, 1297, 1301, 1295,
+ /* 270 */ 1328, 282, 1561, 1380, 1427, 205, 205, 1566, 1292, 354,
+ /* 280 */ 354, 354, 354, 354, 1292, 354, 1452, 205, 324, 205,
+ /* 290 */ 282, 1541, 1548, 354, 435, 1380, 205, 1624, 1416, 2833,
+ /* 300 */ 2833, 2833, 2833, 2833, 2833, 2833, 2833, 2833, 170, 1402,
+ /* 310 */ 152, 981, 558, 581, 680, 157, 374, 706, 775, 785,
+ /* 320 */ 920, 920, 920, 920, 920, 920, 920, 920, 920, 173,
+ /* 330 */ 598, 27, 27, 132, 639, 353, 947, 418, 962, 816,
+ /* 340 */ 489, 638, 638, 880, 881, 517, 880, 880, 880, 1133,
+ /* 350 */ 474, 986, 1109, 843, 779, 1017, 1102, 1107, 1144, 1162,
+ /* 360 */ 1202, 1225, 976, 1141, 1164, 992, 1172, 1191, 1193, 1142,
+ /* 370 */ 969, 1022, 1147, 1205, 1212, 1233, 1238, 1240, 1245, 1251,
+ /* 380 */ 1247, 1115, 1156, 1092, 1192, 573, 1253, 1254, 1257, 1258,
+ /* 390 */ 1278, 1279, 800, 1322, 1343, 1298, 1267, 1677, 1679, 1680,
+ /* 400 */ 1645, 1690, 1659, 1489, 1662, 1669, 1672, 1501, 1709, 1675,
+ /* 410 */ 1676, 1506, 1715, 1511, 1720, 1687, 1723, 1702, 1727, 1693,
+ /* 420 */ 1535, 1542, 1545, 1732, 1733, 1735, 1554, 1556, 1738, 1740,
+ /* 430 */ 1695, 1743, 1744, 1745, 1704, 1747, 1748, 1749, 1750, 1752,
+ /* 440 */ 1753, 1754, 1757, 1609, 1731, 1767, 1613, 1769, 1770, 1773,
+ /* 450 */ 1774, 1786, 1787, 1788, 1790, 1791, 1792, 1793, 1795, 1796,
+ /* 460 */ 1798, 1799, 1800, 1742, 1801, 1803, 1805, 1806, 1807, 1808,
+ /* 470 */ 1789, 1809, 1810, 1812, 1674, 1815, 1816, 1797, 1721, 1802,
+ /* 480 */ 1722, 1820, 1763, 1794, 1822, 1765, 1825, 1768, 1827, 1828,
+ /* 490 */ 1811, 1813, 1814, 1783, 1818, 1804, 1819, 1817, 1835, 1821,
+ /* 500 */ 1824, 1836, 1837, 1840, 1826, 1673, 1849, 1854, 1856, 1823,
+ /* 510 */ 1857, 1859, 1831, 1830, 1829, 1867, 1834, 1833, 1832, 1870,
+ /* 520 */ 1838, 1841, 1843, 1874, 1844, 1845, 1847, 1875, 1876, 1883,
+ /* 530 */ 1884, 1781, 1839, 1860, 1869, 1894, 1862, 1863, 1872, 1878,
+ /* 540 */ 1865, 1866, 1879, 1880, 1889, 1881, 1905, 1896, 1919, 1898,
+ /* 550 */ 1873, 1930, 1900, 1897, 1934, 1901, 1935, 1902, 1938, 1917,
+ /* 560 */ 1920, 1906, 1907, 1908, 1846, 1848, 1944, 1858, 1851, 1914,
+ /* 570 */ 1932, 1952, 1766, 1937, 1864, 1868, 1956, 1957, 1871, 1852,
+ /* 580 */ 1958, 1921, 1710, 1877, 1885, 1882, 1888, 1887, 1891, 1893,
+ /* 590 */ 1890, 1923, 1924, 1892, 1909, 1912, 1913, 1895, 1925, 1916,
+ /* 600 */ 1926, 1928, 1927, 1716, 1904, 1929, 1969, 1931, 1724, 1941,
+ /* 610 */ 1945, 1954, 1971, 1972, 1979, 1933, 1936, 1970, 1850, 1948,
+ /* 620 */ 1988, 2036, 2041, 2042, 2043, 1946, 2006, 1783, 2008, 1953,
+ /* 630 */ 1955, 1959, 1962, 1963, 1886, 1964, 2067, 2020, 1911, 1976,
+ /* 640 */ 1967, 1783, 2031, 2038, 1985, 1853, 1986, 2083, 2064, 1899,
+ /* 650 */ 1987, 1989, 1992, 1993, 1995, 1999, 2049, 1997, 2001, 2055,
+ /* 660 */ 2002, 2085, 1915, 2005, 1978, 2007, 2074, 2078, 2010, 2013,
+ /* 670 */ 2082, 2024, 2026, 2093, 2029, 2030, 2097, 2033, 2034, 2102,
+ /* 680 */ 2051, 2015, 2019, 2032, 2035, 2130, 2044, 2053, 2110, 2060,
+ /* 690 */ 2124, 2061, 2110, 2110, 2141, 2100, 2103, 2131, 2133, 2134,
+ /* 700 */ 2135, 2137, 2138, 2142, 2149, 2151, 2152, 2105, 2095, 2145,
+ /* 710 */ 2155, 2156, 2157, 2173, 2161, 2162, 2164, 2129, 1865, 2174,
+ /* 720 */ 1866, 2176, 2177, 2178, 2179, 2188, 2181, 2217, 2183, 2171,
+ /* 730 */ 2182, 2223, 2189, 2180, 2186, 2227, 2194, 2184, 2191, 2231,
+ /* 740 */ 2198, 2187, 2197, 2237, 2203, 2205, 2242, 2221, 2224, 2222,
+ /* 750 */ 2225, 2228, 2226,
};
-#define YY_REDUCE_COUNT (304)
-#define YY_REDUCE_MIN (-438)
-#define YY_REDUCE_MAX (2328)
+#define YY_REDUCE_COUNT (307)
+#define YY_REDUCE_MIN (-442)
+#define YY_REDUCE_MAX (2408)
static const short yy_reduce_ofst[] = {
- /* 0 */ -256, 679, 728, 795, 827, 876, 935, 969, 1042, 1091,
- /* 10 */ 1155, 1223, 243, 1253, 1283, -294, -1, 1313, 1374, 1347,
- /* 20 */ 1423, 1485, 1517, 1566, 1583, 1640, 1615, 1664, 1689, 1752,
- /* 30 */ 1779, 1801, 1881, 1898, 1915, 1947, 1972, 1996, 2021, 2084,
- /* 40 */ 2111, 2133, 2213, 2230, 2247, 2279, 2304, 2328, -264, 169,
- /* 50 */ 171, -173, -350, 604, 736, 863, -336, -5, -323, -61,
- /* 60 */ 709, 303, 727, 753, -438, -386, -180, -212, 68, 98,
- /* 70 */ -377, -331, -327, -344, -307, -199, -7, 71, 197, 200,
- /* 80 */ 268, 270, 309, 411, -154, 551, 561, 13, -324, 653,
- /* 90 */ 654, 414, 675, 97, 676, 213, 718, 238, 311, 666,
- /* 100 */ 674, 472, 782, 415, 560, 754, 770, -105, -288, -93,
- /* 110 */ -93, -75, -272, -187, 77, 308, 336, 354, 359, 382,
- /* 120 */ 410, 447, 518, 521, 564, 585, 663, 690, 691, 694,
- /* 130 */ 695, 711, -342, -41, -206, 124, 516, -41, 274, 333,
- /* 140 */ 117, -23, 41, 483, 230, 487, 547, 257, 434, 269,
- /* 150 */ 466, 50, 387, 519, 665, 706, 537, -354, 325, 417,
- /* 160 */ 455, 492, 550, 555, 492, 598, 755, 756, 805, 783,
- /* 170 */ 799, 924, 817, 906, 906, 939, 896, 950, 930, 926,
- /* 180 */ 878, 878, 865, 878, 890, 889, 906, 928, 931, 941,
- /* 190 */ 961, 971, 972, 978, 1024, 1025, 983, 988, 989, 1031,
- /* 200 */ 1027, 1033, 1037, 1039, 1048, 1055, 994, 1046, 1021, 1054,
- /* 210 */ 1065, 1013, 1062, 1069, 1073, 1075, 1076, 1086, 1079, 1072,
- /* 220 */ 1074, 1093, 1061, 1066, 1067, 1068, 1070, 1080, 1081, 1082,
- /* 230 */ 1083, 1087, 1088, 1094, 1098, 1052, 1059, 1060, 1032, 1038,
- /* 240 */ 1045, 1097, 1063, 1095, 1111, 1125, 1096, 1100, 1101, 1022,
- /* 250 */ 1099, 1102, 1026, 1103, 1104, 1105, 906, 1035, 1040, 1041,
- /* 260 */ 1044, 1047, 1050, 1107, 1034, 1058, 1053, 878, 1142, 1109,
- /* 270 */ 1180, 1184, 1183, 1185, 1141, 1144, 1156, 1160, 1161, 1162,
- /* 280 */ 1163, 1149, 1165, 1154, 1199, 1189, 1200, 1174, 1116, 1191,
- /* 290 */ 1178, 1198, 1210, 1208, 1222, 1225, 1166, 1153, 1168, 1192,
- /* 300 */ 1204, 1206, 1211, 1230, 1247,
+ /* 0 */ -20, -328, 248, 809, 840, 907, 967, 987, 1096, 655,
+ /* 10 */ 1116, 1190, 1214, 1281, 1341, 46, -305, 325, 467, 890,
+ /* 20 */ 1264, 1361, 1424, 1482, 1507, 1580, 1601, 1630, 1651, 1701,
+ /* 30 */ 1726, 1761, 1784, 1842, 1861, 1922, 1980, 1996, 2059, 2075,
+ /* 40 */ 2094, 2158, 2175, 2235, 2255, 2329, 2346, 2408, -317, -303,
+ /* 50 */ 263, 138, 483, 580, 1035, 1208, -238, 361, -367, -348,
+ /* 60 */ 715, 141, -329, -239, -442, 155, -302, -364, 243, 261,
+ /* 70 */ -378, -330, -285, -306, -41, -199, 7, 82, 367, 397,
+ /* 80 */ 475, 567, 568, 782, 55, 786, 791, 309, 64, 805,
+ /* 90 */ 817, -28, 392, 332, 698, 70, 830, 94, -350, 848,
+ /* 100 */ 859, 395, 861, 401, 461, 406, 776, 462, -234, -334,
+ /* 110 */ -334, -297, -344, 117, 237, 278, 450, 471, 524, 569,
+ /* 120 */ 612, 675, 678, 690, 700, 709, 719, 720, 749, 756,
+ /* 130 */ 793, 868, -290, -106, -176, 337, 169, -106, 286, 393,
+ /* 140 */ 546, 184, 201, 460, 565, 608, 618, 22, 76, -269,
+ /* 150 */ 539, 564, 556, 637, 714, 635, 356, 193, 234, 358,
+ /* 160 */ 670, 754, 792, 810, 754, 134, 254, 577, 824, 712,
+ /* 170 */ 814, 939, 829, 923, 923, 953, 930, 951, 943, 942,
+ /* 180 */ 905, 905, 897, 905, 925, 915, 923, 958, 960, 984,
+ /* 190 */ 1007, 1006, 1010, 1027, 1072, 1074, 1030, 1036, 1038, 1075,
+ /* 200 */ 1078, 1089, 1083, 1094, 1097, 1098, 1105, 1106, 1037, 1099,
+ /* 210 */ 1064, 1100, 1108, 1055, 1117, 1113, 1118, 1119, 1120, 1122,
+ /* 220 */ 1121, 1125, 1127, 1137, 1110, 1114, 1123, 1126, 1128, 1130,
+ /* 230 */ 1134, 1135, 1140, 1154, 1158, 1132, 1139, 1129, 1131, 1143,
+ /* 240 */ 1071, 1077, 1080, 1146, 1124, 1136, 1149, 1180, 1201, 1155,
+ /* 250 */ 1160, 1166, 1101, 1163, 1175, 1111, 1165, 1179, 1181, 923,
+ /* 260 */ 1145, 1138, 1150, 1168, 1148, 1152, 1157, 1103, 1151, 1153,
+ /* 270 */ 905, 1207, 1167, 1242, 1243, 1241, 1244, 1199, 1196, 1213,
+ /* 280 */ 1219, 1220, 1228, 1237, 1223, 1249, 1250, 1286, 1262, 1303,
+ /* 290 */ 1266, 1209, 1283, 1280, 1302, 1313, 1312, 1327, 1329, 1265,
+ /* 300 */ 1260, 1270, 1273, 1310, 1330, 1333, 1323, 1342,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 10 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 20 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 30 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 40 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 50 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 60 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 70 */ 1665, 1665, 1665, 1923, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 80 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1744, 1665, 1665,
- /* 90 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 100 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1742, 1916, 2132,
- /* 110 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 120 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 130 */ 1665, 1665, 1665, 2144, 1665, 1665, 1665, 2144, 2144, 2144,
- /* 140 */ 1742, 2104, 2104, 1665, 1665, 1665, 1665, 1744, 1977, 1665,
- /* 150 */ 1665, 1665, 1665, 1665, 1665, 1851, 1665, 1665, 1665, 1665,
- /* 160 */ 1665, 1875, 1665, 1665, 1665, 1969, 1665, 1665, 2169, 2225,
- /* 170 */ 1665, 1665, 2172, 1665, 1665, 1665, 1928, 1665, 1804, 2159,
- /* 180 */ 2136, 2150, 2209, 2137, 2134, 2153, 1665, 2163, 1665, 1962,
- /* 190 */ 1921, 1665, 1921, 1918, 1665, 1665, 1921, 1918, 1918, 1665,
- /* 200 */ 1795, 1665, 1665, 1665, 1665, 1665, 1665, 1744, 1665, 1744,
- /* 210 */ 1665, 1665, 1744, 1665, 1744, 1744, 1744, 1665, 1744, 1722,
- /* 220 */ 1722, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 230 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1989, 1975,
- /* 240 */ 1665, 1742, 1971, 1665, 1742, 1665, 1665, 1665, 1665, 2180,
- /* 250 */ 2178, 1665, 2180, 2178, 1665, 1665, 1665, 2194, 2190, 2180,
- /* 260 */ 2198, 2196, 2165, 2163, 2228, 2215, 2211, 2150, 1665, 1665,
- /* 270 */ 1665, 1665, 1742, 1742, 1665, 2178, 1665, 1665, 1665, 1665,
- /* 280 */ 1665, 2178, 1665, 1665, 1742, 1665, 1742, 1665, 1665, 1820,
- /* 290 */ 1665, 1665, 1665, 1742, 1697, 1665, 1964, 1980, 1946, 1946,
- /* 300 */ 1854, 1854, 1854, 1745, 1670, 1665, 1665, 1665, 1665, 1665,
- /* 310 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 2193, 2192, 2059,
- /* 320 */ 1665, 2108, 2107, 2106, 2097, 2058, 1816, 1665, 2057, 2056,
- /* 330 */ 1665, 1665, 1665, 1665, 1665, 1665, 1937, 1936, 2050, 1665,
- /* 340 */ 1665, 2051, 2049, 2048, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 350 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 360 */ 1665, 1665, 1665, 1665, 1665, 2212, 2216, 1665, 1665, 1665,
- /* 370 */ 1665, 1665, 1665, 1665, 2133, 1665, 1665, 1665, 1665, 1665,
- /* 380 */ 2032, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 390 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 400 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 410 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 420 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 430 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 440 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 450 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 460 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 470 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 480 */ 1665, 1665, 1665, 1702, 2037, 1665, 1665, 1665, 1665, 1665,
- /* 490 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 500 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 510 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 520 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 530 */ 1665, 1783, 1782, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 540 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 550 */ 1665, 1665, 1665, 1665, 1665, 2041, 1665, 1665, 1665, 1665,
- /* 560 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 570 */ 2208, 2166, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 580 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 590 */ 2032, 1665, 2191, 1665, 1665, 2206, 1665, 2210, 1665, 1665,
- /* 600 */ 1665, 1665, 1665, 1665, 1665, 2143, 2139, 1665, 1665, 2135,
- /* 610 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 2040, 1665, 1665,
- /* 620 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 630 */ 1665, 2031, 1665, 2094, 1665, 1665, 1665, 2128, 1665, 1665,
- /* 640 */ 2079, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 650 */ 2041, 1665, 2044, 1665, 1665, 1665, 1665, 1665, 1848, 1665,
- /* 660 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 670 */ 1665, 1833, 1831, 1830, 1829, 1665, 1826, 1665, 1861, 1665,
- /* 680 */ 1665, 1665, 1857, 1856, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 690 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1763,
- /* 700 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1755, 1665,
- /* 710 */ 1754, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 720 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 730 */ 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
- /* 740 */ 1665, 1665, 1665,
+ /* 0 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 10 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 20 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 30 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 40 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 50 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 60 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 70 */ 1692, 1692, 1692, 1958, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 80 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1771, 1692, 1692,
+ /* 90 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 100 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1769, 1951, 2169,
+ /* 110 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 120 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 130 */ 1692, 1692, 1692, 2181, 1692, 1692, 1692, 2181, 2181, 2181,
+ /* 140 */ 1769, 2141, 2141, 1692, 1692, 1692, 1692, 1771, 2014, 1692,
+ /* 150 */ 1692, 1692, 1692, 1692, 1692, 1886, 1692, 1692, 1692, 1692,
+ /* 160 */ 1692, 1910, 1692, 1692, 1692, 2004, 1692, 1692, 2206, 2262,
+ /* 170 */ 1692, 1692, 2209, 1692, 1692, 1692, 1963, 1692, 1839, 2196,
+ /* 180 */ 2173, 2187, 2246, 2174, 2171, 2190, 1692, 2200, 1692, 1997,
+ /* 190 */ 1956, 1692, 1956, 1953, 1692, 1692, 1956, 1953, 1953, 1828,
+ /* 200 */ 1824, 1692, 1822, 1692, 1692, 1692, 1692, 1692, 1692, 1771,
+ /* 210 */ 1692, 1771, 1692, 1692, 1771, 1692, 1771, 1771, 1771, 1692,
+ /* 220 */ 1771, 1749, 1749, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 230 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 240 */ 2026, 2012, 1692, 1769, 2008, 2006, 1692, 1769, 1692, 1692,
+ /* 250 */ 1692, 1692, 2217, 2215, 1692, 2217, 2215, 1692, 1692, 1692,
+ /* 260 */ 2231, 2227, 2217, 2235, 2233, 2202, 2200, 2265, 2252, 2248,
+ /* 270 */ 2187, 1692, 1692, 1692, 1692, 1769, 1769, 1692, 2215, 1692,
+ /* 280 */ 1692, 1692, 1692, 1692, 2215, 1692, 1692, 1769, 1692, 1769,
+ /* 290 */ 1692, 1692, 1855, 1692, 1692, 1692, 1769, 1724, 1692, 1999,
+ /* 300 */ 2017, 1981, 1981, 1889, 1889, 1889, 1772, 1697, 1692, 1692,
+ /* 310 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 320 */ 2230, 2229, 2096, 1692, 2145, 2144, 2143, 2134, 2095, 1851,
+ /* 330 */ 1692, 2094, 2093, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 340 */ 1692, 1972, 1971, 2087, 1692, 1692, 2088, 2086, 2085, 1692,
+ /* 350 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 360 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 370 */ 2249, 2253, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 2170,
+ /* 380 */ 1692, 1692, 1692, 1692, 1692, 2069, 1692, 1692, 1692, 1692,
+ /* 390 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 400 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 410 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 420 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 430 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 440 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 450 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 460 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 470 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 480 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 490 */ 1692, 1692, 1729, 2074, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 500 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 510 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 520 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 530 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 540 */ 1810, 1809, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 550 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 560 */ 1692, 1692, 1692, 1692, 2078, 1692, 1692, 1692, 1692, 1692,
+ /* 570 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 580 */ 2245, 2203, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 590 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 600 */ 2069, 1692, 2228, 1692, 1692, 2243, 1692, 2247, 1692, 1692,
+ /* 610 */ 1692, 1692, 1692, 1692, 1692, 2180, 2176, 1692, 1692, 2172,
+ /* 620 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 2077, 1692, 1692,
+ /* 630 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 640 */ 1692, 2068, 1692, 2131, 1692, 1692, 1692, 2165, 1692, 1692,
+ /* 650 */ 2116, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 660 */ 2078, 1692, 2081, 1692, 1692, 1692, 1692, 1692, 1883, 1692,
+ /* 670 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 680 */ 1692, 1868, 1866, 1865, 1864, 1692, 1861, 1692, 1896, 1692,
+ /* 690 */ 1692, 1692, 1892, 1891, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 700 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1790,
+ /* 710 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1782, 1692,
+ /* 720 */ 1781, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 730 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 740 */ 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692,
+ /* 750 */ 1692, 1692, 1692,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1077,6 +1097,10 @@ static const YYCODETYPE yyFallback[] = {
0, /* TABLE_SUFFIX => nothing */
0, /* NK_COLON => nothing */
0, /* MAX_SPEED => nothing */
+ 0, /* START => nothing */
+ 0, /* WITH => nothing */
+ 0, /* TIMESTAMP => nothing */
+ 277, /* END => ABORT */
0, /* TABLE => nothing */
0, /* NK_LP => nothing */
0, /* NK_RP => nothing */
@@ -1100,7 +1124,6 @@ static const YYCODETYPE yyFallback[] = {
0, /* FLOAT => nothing */
0, /* DOUBLE => nothing */
0, /* BINARY => nothing */
- 0, /* TIMESTAMP => nothing */
0, /* NCHAR => nothing */
0, /* UNSIGNED => nothing */
0, /* JSON => nothing */
@@ -1154,7 +1177,6 @@ static const YYCODETYPE yyFallback[] = {
0, /* COUNT => nothing */
0, /* LAST_ROW => nothing */
0, /* TOPIC => nothing */
- 0, /* WITH => nothing */
0, /* META => nothing */
0, /* CONSUMER => nothing */
0, /* GROUP => nothing */
@@ -1172,6 +1194,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* OUTPUTTYPE => nothing */
0, /* AGGREGATE => nothing */
0, /* BUFSIZE => nothing */
+ 0, /* LANGUAGE => nothing */
0, /* STREAM => nothing */
0, /* INTO => nothing */
0, /* TRIGGER => nothing */
@@ -1213,7 +1236,6 @@ static const YYCODETYPE yyFallback[] = {
0, /* SERVER_STATUS => nothing */
0, /* CURRENT_USER => nothing */
0, /* CASE => nothing */
- 276, /* END => ABORT */
0, /* WHEN => nothing */
0, /* THEN => nothing */
0, /* ELSE => nothing */
@@ -1238,7 +1260,6 @@ static const YYCODETYPE yyFallback[] = {
0, /* SESSION => nothing */
0, /* STATE_WINDOW => nothing */
0, /* EVENT_WINDOW => nothing */
- 0, /* START => nothing */
0, /* SLIDING => nothing */
0, /* FILL => nothing */
0, /* VALUE => nothing */
@@ -1259,57 +1280,57 @@ 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 */
+ 277, /* AFTER => ABORT */
+ 277, /* ATTACH => ABORT */
+ 277, /* BEFORE => ABORT */
+ 277, /* BEGIN => ABORT */
+ 277, /* BITAND => ABORT */
+ 277, /* BITNOT => ABORT */
+ 277, /* BITOR => ABORT */
+ 277, /* BLOCKS => ABORT */
+ 277, /* CHANGE => ABORT */
+ 277, /* COMMA => ABORT */
+ 277, /* CONCAT => ABORT */
+ 277, /* CONFLICT => ABORT */
+ 277, /* COPY => ABORT */
+ 277, /* DEFERRED => ABORT */
+ 277, /* DELIMITERS => ABORT */
+ 277, /* DETACH => ABORT */
+ 277, /* DIVIDE => ABORT */
+ 277, /* DOT => ABORT */
+ 277, /* EACH => ABORT */
+ 277, /* FAIL => ABORT */
+ 277, /* FILE => ABORT */
+ 277, /* FOR => ABORT */
+ 277, /* GLOB => ABORT */
+ 277, /* ID => ABORT */
+ 277, /* IMMEDIATE => ABORT */
+ 277, /* IMPORT => ABORT */
+ 277, /* INITIALLY => ABORT */
+ 277, /* INSTEAD => ABORT */
+ 277, /* ISNULL => ABORT */
+ 277, /* KEY => ABORT */
+ 277, /* MODULES => ABORT */
+ 277, /* NK_BITNOT => ABORT */
+ 277, /* NK_SEMI => ABORT */
+ 277, /* NOTNULL => ABORT */
+ 277, /* OF => ABORT */
+ 277, /* PLUS => ABORT */
+ 277, /* PRIVILEGE => ABORT */
+ 277, /* RAISE => ABORT */
+ 277, /* REPLACE => ABORT */
+ 277, /* RESTRICT => ABORT */
+ 277, /* ROW => ABORT */
+ 277, /* SEMI => ABORT */
+ 277, /* STAR => ABORT */
+ 277, /* STATEMENT => ABORT */
+ 277, /* STRICT => ABORT */
+ 277, /* STRING => ABORT */
+ 277, /* TIMES => ABORT */
+ 277, /* VALUES => ABORT */
+ 277, /* VARIABLE => ABORT */
+ 277, /* VIEW => ABORT */
+ 277, /* WAL => ABORT */
};
#endif /* YYFALLBACK */
@@ -1492,380 +1513,384 @@ static const char *const yyTokenName[] = {
/* 92 */ "TABLE_SUFFIX",
/* 93 */ "NK_COLON",
/* 94 */ "MAX_SPEED",
- /* 95 */ "TABLE",
- /* 96 */ "NK_LP",
- /* 97 */ "NK_RP",
- /* 98 */ "STABLE",
- /* 99 */ "ADD",
- /* 100 */ "COLUMN",
- /* 101 */ "MODIFY",
- /* 102 */ "RENAME",
- /* 103 */ "TAG",
- /* 104 */ "SET",
- /* 105 */ "NK_EQ",
- /* 106 */ "USING",
- /* 107 */ "TAGS",
- /* 108 */ "COMMENT",
- /* 109 */ "BOOL",
- /* 110 */ "TINYINT",
- /* 111 */ "SMALLINT",
- /* 112 */ "INT",
- /* 113 */ "INTEGER",
- /* 114 */ "BIGINT",
- /* 115 */ "FLOAT",
- /* 116 */ "DOUBLE",
- /* 117 */ "BINARY",
- /* 118 */ "TIMESTAMP",
- /* 119 */ "NCHAR",
- /* 120 */ "UNSIGNED",
- /* 121 */ "JSON",
- /* 122 */ "VARCHAR",
- /* 123 */ "MEDIUMBLOB",
- /* 124 */ "BLOB",
- /* 125 */ "VARBINARY",
- /* 126 */ "DECIMAL",
- /* 127 */ "MAX_DELAY",
- /* 128 */ "WATERMARK",
- /* 129 */ "ROLLUP",
- /* 130 */ "TTL",
- /* 131 */ "SMA",
- /* 132 */ "DELETE_MARK",
- /* 133 */ "FIRST",
- /* 134 */ "LAST",
- /* 135 */ "SHOW",
- /* 136 */ "PRIVILEGES",
- /* 137 */ "DATABASES",
- /* 138 */ "TABLES",
- /* 139 */ "STABLES",
- /* 140 */ "MNODES",
- /* 141 */ "QNODES",
- /* 142 */ "FUNCTIONS",
- /* 143 */ "INDEXES",
- /* 144 */ "ACCOUNTS",
- /* 145 */ "APPS",
- /* 146 */ "CONNECTIONS",
- /* 147 */ "LICENCES",
- /* 148 */ "GRANTS",
- /* 149 */ "QUERIES",
- /* 150 */ "SCORES",
- /* 151 */ "TOPICS",
- /* 152 */ "VARIABLES",
- /* 153 */ "CLUSTER",
- /* 154 */ "BNODES",
- /* 155 */ "SNODES",
- /* 156 */ "TRANSACTIONS",
- /* 157 */ "DISTRIBUTED",
- /* 158 */ "CONSUMERS",
- /* 159 */ "SUBSCRIPTIONS",
- /* 160 */ "VNODES",
- /* 161 */ "ALIVE",
- /* 162 */ "LIKE",
- /* 163 */ "TBNAME",
- /* 164 */ "QTAGS",
- /* 165 */ "AS",
- /* 166 */ "INDEX",
- /* 167 */ "FUNCTION",
- /* 168 */ "INTERVAL",
- /* 169 */ "COUNT",
- /* 170 */ "LAST_ROW",
- /* 171 */ "TOPIC",
- /* 172 */ "WITH",
- /* 173 */ "META",
- /* 174 */ "CONSUMER",
- /* 175 */ "GROUP",
- /* 176 */ "DESC",
- /* 177 */ "DESCRIBE",
- /* 178 */ "RESET",
- /* 179 */ "QUERY",
- /* 180 */ "CACHE",
- /* 181 */ "EXPLAIN",
- /* 182 */ "ANALYZE",
- /* 183 */ "VERBOSE",
- /* 184 */ "NK_BOOL",
- /* 185 */ "RATIO",
- /* 186 */ "NK_FLOAT",
- /* 187 */ "OUTPUTTYPE",
- /* 188 */ "AGGREGATE",
- /* 189 */ "BUFSIZE",
- /* 190 */ "STREAM",
- /* 191 */ "INTO",
- /* 192 */ "TRIGGER",
- /* 193 */ "AT_ONCE",
- /* 194 */ "WINDOW_CLOSE",
- /* 195 */ "IGNORE",
- /* 196 */ "EXPIRED",
- /* 197 */ "FILL_HISTORY",
- /* 198 */ "UPDATE",
- /* 199 */ "SUBTABLE",
- /* 200 */ "KILL",
- /* 201 */ "CONNECTION",
- /* 202 */ "TRANSACTION",
- /* 203 */ "BALANCE",
- /* 204 */ "VGROUP",
- /* 205 */ "MERGE",
- /* 206 */ "REDISTRIBUTE",
- /* 207 */ "SPLIT",
- /* 208 */ "DELETE",
- /* 209 */ "INSERT",
- /* 210 */ "NULL",
- /* 211 */ "NK_QUESTION",
- /* 212 */ "NK_ARROW",
- /* 213 */ "ROWTS",
- /* 214 */ "QSTART",
- /* 215 */ "QEND",
- /* 216 */ "QDURATION",
- /* 217 */ "WSTART",
- /* 218 */ "WEND",
- /* 219 */ "WDURATION",
- /* 220 */ "IROWTS",
- /* 221 */ "ISFILLED",
- /* 222 */ "CAST",
- /* 223 */ "NOW",
- /* 224 */ "TODAY",
- /* 225 */ "TIMEZONE",
- /* 226 */ "CLIENT_VERSION",
- /* 227 */ "SERVER_VERSION",
- /* 228 */ "SERVER_STATUS",
- /* 229 */ "CURRENT_USER",
- /* 230 */ "CASE",
- /* 231 */ "END",
- /* 232 */ "WHEN",
- /* 233 */ "THEN",
- /* 234 */ "ELSE",
- /* 235 */ "BETWEEN",
- /* 236 */ "IS",
- /* 237 */ "NK_LT",
- /* 238 */ "NK_GT",
- /* 239 */ "NK_LE",
- /* 240 */ "NK_GE",
- /* 241 */ "NK_NE",
- /* 242 */ "MATCH",
- /* 243 */ "NMATCH",
- /* 244 */ "CONTAINS",
- /* 245 */ "IN",
- /* 246 */ "JOIN",
- /* 247 */ "INNER",
- /* 248 */ "SELECT",
- /* 249 */ "DISTINCT",
- /* 250 */ "WHERE",
- /* 251 */ "PARTITION",
- /* 252 */ "BY",
- /* 253 */ "SESSION",
- /* 254 */ "STATE_WINDOW",
- /* 255 */ "EVENT_WINDOW",
- /* 256 */ "START",
- /* 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 */ "integer_list",
- /* 349 */ "variable_list",
- /* 350 */ "retention_list",
- /* 351 */ "alter_db_option",
- /* 352 */ "retention",
- /* 353 */ "full_table_name",
- /* 354 */ "column_def_list",
- /* 355 */ "tags_def_opt",
- /* 356 */ "table_options",
- /* 357 */ "multi_create_clause",
- /* 358 */ "tags_def",
- /* 359 */ "multi_drop_clause",
- /* 360 */ "alter_table_clause",
- /* 361 */ "alter_table_options",
- /* 362 */ "column_name",
- /* 363 */ "type_name",
- /* 364 */ "signed_literal",
- /* 365 */ "create_subtable_clause",
- /* 366 */ "specific_cols_opt",
- /* 367 */ "expression_list",
- /* 368 */ "drop_table_clause",
- /* 369 */ "col_name_list",
- /* 370 */ "table_name",
- /* 371 */ "column_def",
- /* 372 */ "duration_list",
- /* 373 */ "rollup_func_list",
- /* 374 */ "alter_table_option",
- /* 375 */ "duration_literal",
- /* 376 */ "rollup_func_name",
- /* 377 */ "function_name",
- /* 378 */ "col_name",
- /* 379 */ "db_name_cond_opt",
- /* 380 */ "like_pattern_opt",
- /* 381 */ "table_name_cond",
- /* 382 */ "from_db_opt",
- /* 383 */ "tag_list_opt",
- /* 384 */ "tag_item",
- /* 385 */ "column_alias",
- /* 386 */ "full_index_name",
- /* 387 */ "index_options",
- /* 388 */ "index_name",
- /* 389 */ "func_list",
- /* 390 */ "sliding_opt",
- /* 391 */ "sma_stream_opt",
- /* 392 */ "func",
- /* 393 */ "sma_func_name",
- /* 394 */ "query_or_subquery",
- /* 395 */ "cgroup_name",
- /* 396 */ "analyze_opt",
- /* 397 */ "explain_options",
- /* 398 */ "insert_query",
- /* 399 */ "agg_func_opt",
- /* 400 */ "bufsize_opt",
- /* 401 */ "stream_name",
- /* 402 */ "stream_options",
- /* 403 */ "col_list_opt",
- /* 404 */ "tag_def_or_ref_opt",
- /* 405 */ "subtable_opt",
- /* 406 */ "expression",
- /* 407 */ "dnode_list",
- /* 408 */ "where_clause_opt",
- /* 409 */ "signed",
- /* 410 */ "literal_func",
- /* 411 */ "literal_list",
- /* 412 */ "table_alias",
- /* 413 */ "expr_or_subquery",
- /* 414 */ "pseudo_column",
- /* 415 */ "column_reference",
- /* 416 */ "function_expression",
- /* 417 */ "case_when_expression",
- /* 418 */ "star_func",
- /* 419 */ "star_func_para_list",
- /* 420 */ "noarg_func",
- /* 421 */ "other_para_list",
- /* 422 */ "star_func_para",
- /* 423 */ "when_then_list",
- /* 424 */ "case_when_else_opt",
- /* 425 */ "common_expression",
- /* 426 */ "when_then_expr",
- /* 427 */ "predicate",
- /* 428 */ "compare_op",
- /* 429 */ "in_op",
- /* 430 */ "in_predicate_value",
- /* 431 */ "boolean_value_expression",
- /* 432 */ "boolean_primary",
- /* 433 */ "from_clause_opt",
- /* 434 */ "table_reference_list",
- /* 435 */ "table_reference",
- /* 436 */ "table_primary",
- /* 437 */ "joined_table",
- /* 438 */ "alias_opt",
- /* 439 */ "subquery",
- /* 440 */ "parenthesized_joined_table",
- /* 441 */ "join_type",
- /* 442 */ "search_condition",
- /* 443 */ "query_specification",
- /* 444 */ "set_quantifier_opt",
- /* 445 */ "select_list",
- /* 446 */ "partition_by_clause_opt",
- /* 447 */ "range_opt",
- /* 448 */ "every_opt",
- /* 449 */ "fill_opt",
- /* 450 */ "twindow_clause_opt",
- /* 451 */ "group_by_clause_opt",
- /* 452 */ "having_clause_opt",
- /* 453 */ "select_item",
- /* 454 */ "partition_list",
- /* 455 */ "partition_item",
- /* 456 */ "fill_mode",
- /* 457 */ "group_by_list",
- /* 458 */ "query_expression",
- /* 459 */ "query_simple",
- /* 460 */ "order_by_clause_opt",
- /* 461 */ "slimit_clause_opt",
- /* 462 */ "limit_clause_opt",
- /* 463 */ "union_query_expression",
- /* 464 */ "query_simple_or_subquery",
- /* 465 */ "sort_specification_list",
- /* 466 */ "sort_specification",
- /* 467 */ "ordering_specification_opt",
- /* 468 */ "null_ordering_opt",
+ /* 95 */ "START",
+ /* 96 */ "WITH",
+ /* 97 */ "TIMESTAMP",
+ /* 98 */ "END",
+ /* 99 */ "TABLE",
+ /* 100 */ "NK_LP",
+ /* 101 */ "NK_RP",
+ /* 102 */ "STABLE",
+ /* 103 */ "ADD",
+ /* 104 */ "COLUMN",
+ /* 105 */ "MODIFY",
+ /* 106 */ "RENAME",
+ /* 107 */ "TAG",
+ /* 108 */ "SET",
+ /* 109 */ "NK_EQ",
+ /* 110 */ "USING",
+ /* 111 */ "TAGS",
+ /* 112 */ "COMMENT",
+ /* 113 */ "BOOL",
+ /* 114 */ "TINYINT",
+ /* 115 */ "SMALLINT",
+ /* 116 */ "INT",
+ /* 117 */ "INTEGER",
+ /* 118 */ "BIGINT",
+ /* 119 */ "FLOAT",
+ /* 120 */ "DOUBLE",
+ /* 121 */ "BINARY",
+ /* 122 */ "NCHAR",
+ /* 123 */ "UNSIGNED",
+ /* 124 */ "JSON",
+ /* 125 */ "VARCHAR",
+ /* 126 */ "MEDIUMBLOB",
+ /* 127 */ "BLOB",
+ /* 128 */ "VARBINARY",
+ /* 129 */ "DECIMAL",
+ /* 130 */ "MAX_DELAY",
+ /* 131 */ "WATERMARK",
+ /* 132 */ "ROLLUP",
+ /* 133 */ "TTL",
+ /* 134 */ "SMA",
+ /* 135 */ "DELETE_MARK",
+ /* 136 */ "FIRST",
+ /* 137 */ "LAST",
+ /* 138 */ "SHOW",
+ /* 139 */ "PRIVILEGES",
+ /* 140 */ "DATABASES",
+ /* 141 */ "TABLES",
+ /* 142 */ "STABLES",
+ /* 143 */ "MNODES",
+ /* 144 */ "QNODES",
+ /* 145 */ "FUNCTIONS",
+ /* 146 */ "INDEXES",
+ /* 147 */ "ACCOUNTS",
+ /* 148 */ "APPS",
+ /* 149 */ "CONNECTIONS",
+ /* 150 */ "LICENCES",
+ /* 151 */ "GRANTS",
+ /* 152 */ "QUERIES",
+ /* 153 */ "SCORES",
+ /* 154 */ "TOPICS",
+ /* 155 */ "VARIABLES",
+ /* 156 */ "CLUSTER",
+ /* 157 */ "BNODES",
+ /* 158 */ "SNODES",
+ /* 159 */ "TRANSACTIONS",
+ /* 160 */ "DISTRIBUTED",
+ /* 161 */ "CONSUMERS",
+ /* 162 */ "SUBSCRIPTIONS",
+ /* 163 */ "VNODES",
+ /* 164 */ "ALIVE",
+ /* 165 */ "LIKE",
+ /* 166 */ "TBNAME",
+ /* 167 */ "QTAGS",
+ /* 168 */ "AS",
+ /* 169 */ "INDEX",
+ /* 170 */ "FUNCTION",
+ /* 171 */ "INTERVAL",
+ /* 172 */ "COUNT",
+ /* 173 */ "LAST_ROW",
+ /* 174 */ "TOPIC",
+ /* 175 */ "META",
+ /* 176 */ "CONSUMER",
+ /* 177 */ "GROUP",
+ /* 178 */ "DESC",
+ /* 179 */ "DESCRIBE",
+ /* 180 */ "RESET",
+ /* 181 */ "QUERY",
+ /* 182 */ "CACHE",
+ /* 183 */ "EXPLAIN",
+ /* 184 */ "ANALYZE",
+ /* 185 */ "VERBOSE",
+ /* 186 */ "NK_BOOL",
+ /* 187 */ "RATIO",
+ /* 188 */ "NK_FLOAT",
+ /* 189 */ "OUTPUTTYPE",
+ /* 190 */ "AGGREGATE",
+ /* 191 */ "BUFSIZE",
+ /* 192 */ "LANGUAGE",
+ /* 193 */ "STREAM",
+ /* 194 */ "INTO",
+ /* 195 */ "TRIGGER",
+ /* 196 */ "AT_ONCE",
+ /* 197 */ "WINDOW_CLOSE",
+ /* 198 */ "IGNORE",
+ /* 199 */ "EXPIRED",
+ /* 200 */ "FILL_HISTORY",
+ /* 201 */ "UPDATE",
+ /* 202 */ "SUBTABLE",
+ /* 203 */ "KILL",
+ /* 204 */ "CONNECTION",
+ /* 205 */ "TRANSACTION",
+ /* 206 */ "BALANCE",
+ /* 207 */ "VGROUP",
+ /* 208 */ "MERGE",
+ /* 209 */ "REDISTRIBUTE",
+ /* 210 */ "SPLIT",
+ /* 211 */ "DELETE",
+ /* 212 */ "INSERT",
+ /* 213 */ "NULL",
+ /* 214 */ "NK_QUESTION",
+ /* 215 */ "NK_ARROW",
+ /* 216 */ "ROWTS",
+ /* 217 */ "QSTART",
+ /* 218 */ "QEND",
+ /* 219 */ "QDURATION",
+ /* 220 */ "WSTART",
+ /* 221 */ "WEND",
+ /* 222 */ "WDURATION",
+ /* 223 */ "IROWTS",
+ /* 224 */ "ISFILLED",
+ /* 225 */ "CAST",
+ /* 226 */ "NOW",
+ /* 227 */ "TODAY",
+ /* 228 */ "TIMEZONE",
+ /* 229 */ "CLIENT_VERSION",
+ /* 230 */ "SERVER_VERSION",
+ /* 231 */ "SERVER_STATUS",
+ /* 232 */ "CURRENT_USER",
+ /* 233 */ "CASE",
+ /* 234 */ "WHEN",
+ /* 235 */ "THEN",
+ /* 236 */ "ELSE",
+ /* 237 */ "BETWEEN",
+ /* 238 */ "IS",
+ /* 239 */ "NK_LT",
+ /* 240 */ "NK_GT",
+ /* 241 */ "NK_LE",
+ /* 242 */ "NK_GE",
+ /* 243 */ "NK_NE",
+ /* 244 */ "MATCH",
+ /* 245 */ "NMATCH",
+ /* 246 */ "CONTAINS",
+ /* 247 */ "IN",
+ /* 248 */ "JOIN",
+ /* 249 */ "INNER",
+ /* 250 */ "SELECT",
+ /* 251 */ "DISTINCT",
+ /* 252 */ "WHERE",
+ /* 253 */ "PARTITION",
+ /* 254 */ "BY",
+ /* 255 */ "SESSION",
+ /* 256 */ "STATE_WINDOW",
+ /* 257 */ "EVENT_WINDOW",
+ /* 258 */ "SLIDING",
+ /* 259 */ "FILL",
+ /* 260 */ "VALUE",
+ /* 261 */ "VALUE_F",
+ /* 262 */ "NONE",
+ /* 263 */ "PREV",
+ /* 264 */ "NULL_F",
+ /* 265 */ "LINEAR",
+ /* 266 */ "NEXT",
+ /* 267 */ "HAVING",
+ /* 268 */ "RANGE",
+ /* 269 */ "EVERY",
+ /* 270 */ "ORDER",
+ /* 271 */ "SLIMIT",
+ /* 272 */ "SOFFSET",
+ /* 273 */ "LIMIT",
+ /* 274 */ "OFFSET",
+ /* 275 */ "ASC",
+ /* 276 */ "NULLS",
+ /* 277 */ "ABORT",
+ /* 278 */ "AFTER",
+ /* 279 */ "ATTACH",
+ /* 280 */ "BEFORE",
+ /* 281 */ "BEGIN",
+ /* 282 */ "BITAND",
+ /* 283 */ "BITNOT",
+ /* 284 */ "BITOR",
+ /* 285 */ "BLOCKS",
+ /* 286 */ "CHANGE",
+ /* 287 */ "COMMA",
+ /* 288 */ "CONCAT",
+ /* 289 */ "CONFLICT",
+ /* 290 */ "COPY",
+ /* 291 */ "DEFERRED",
+ /* 292 */ "DELIMITERS",
+ /* 293 */ "DETACH",
+ /* 294 */ "DIVIDE",
+ /* 295 */ "DOT",
+ /* 296 */ "EACH",
+ /* 297 */ "FAIL",
+ /* 298 */ "FILE",
+ /* 299 */ "FOR",
+ /* 300 */ "GLOB",
+ /* 301 */ "ID",
+ /* 302 */ "IMMEDIATE",
+ /* 303 */ "IMPORT",
+ /* 304 */ "INITIALLY",
+ /* 305 */ "INSTEAD",
+ /* 306 */ "ISNULL",
+ /* 307 */ "KEY",
+ /* 308 */ "MODULES",
+ /* 309 */ "NK_BITNOT",
+ /* 310 */ "NK_SEMI",
+ /* 311 */ "NOTNULL",
+ /* 312 */ "OF",
+ /* 313 */ "PLUS",
+ /* 314 */ "PRIVILEGE",
+ /* 315 */ "RAISE",
+ /* 316 */ "REPLACE",
+ /* 317 */ "RESTRICT",
+ /* 318 */ "ROW",
+ /* 319 */ "SEMI",
+ /* 320 */ "STAR",
+ /* 321 */ "STATEMENT",
+ /* 322 */ "STRICT",
+ /* 323 */ "STRING",
+ /* 324 */ "TIMES",
+ /* 325 */ "VALUES",
+ /* 326 */ "VARIABLE",
+ /* 327 */ "VIEW",
+ /* 328 */ "WAL",
+ /* 329 */ "cmd",
+ /* 330 */ "account_options",
+ /* 331 */ "alter_account_options",
+ /* 332 */ "literal",
+ /* 333 */ "alter_account_option",
+ /* 334 */ "user_name",
+ /* 335 */ "sysinfo_opt",
+ /* 336 */ "privileges",
+ /* 337 */ "priv_level",
+ /* 338 */ "priv_type_list",
+ /* 339 */ "priv_type",
+ /* 340 */ "db_name",
+ /* 341 */ "topic_name",
+ /* 342 */ "dnode_endpoint",
+ /* 343 */ "force_opt",
+ /* 344 */ "not_exists_opt",
+ /* 345 */ "db_options",
+ /* 346 */ "exists_opt",
+ /* 347 */ "alter_db_options",
+ /* 348 */ "speed_opt",
+ /* 349 */ "start_opt",
+ /* 350 */ "end_opt",
+ /* 351 */ "integer_list",
+ /* 352 */ "variable_list",
+ /* 353 */ "retention_list",
+ /* 354 */ "alter_db_option",
+ /* 355 */ "retention",
+ /* 356 */ "full_table_name",
+ /* 357 */ "column_def_list",
+ /* 358 */ "tags_def_opt",
+ /* 359 */ "table_options",
+ /* 360 */ "multi_create_clause",
+ /* 361 */ "tags_def",
+ /* 362 */ "multi_drop_clause",
+ /* 363 */ "alter_table_clause",
+ /* 364 */ "alter_table_options",
+ /* 365 */ "column_name",
+ /* 366 */ "type_name",
+ /* 367 */ "signed_literal",
+ /* 368 */ "create_subtable_clause",
+ /* 369 */ "specific_cols_opt",
+ /* 370 */ "expression_list",
+ /* 371 */ "drop_table_clause",
+ /* 372 */ "col_name_list",
+ /* 373 */ "table_name",
+ /* 374 */ "column_def",
+ /* 375 */ "duration_list",
+ /* 376 */ "rollup_func_list",
+ /* 377 */ "alter_table_option",
+ /* 378 */ "duration_literal",
+ /* 379 */ "rollup_func_name",
+ /* 380 */ "function_name",
+ /* 381 */ "col_name",
+ /* 382 */ "db_name_cond_opt",
+ /* 383 */ "like_pattern_opt",
+ /* 384 */ "table_name_cond",
+ /* 385 */ "from_db_opt",
+ /* 386 */ "tag_list_opt",
+ /* 387 */ "tag_item",
+ /* 388 */ "column_alias",
+ /* 389 */ "full_index_name",
+ /* 390 */ "index_options",
+ /* 391 */ "index_name",
+ /* 392 */ "func_list",
+ /* 393 */ "sliding_opt",
+ /* 394 */ "sma_stream_opt",
+ /* 395 */ "func",
+ /* 396 */ "sma_func_name",
+ /* 397 */ "query_or_subquery",
+ /* 398 */ "cgroup_name",
+ /* 399 */ "analyze_opt",
+ /* 400 */ "explain_options",
+ /* 401 */ "insert_query",
+ /* 402 */ "agg_func_opt",
+ /* 403 */ "bufsize_opt",
+ /* 404 */ "language_opt",
+ /* 405 */ "stream_name",
+ /* 406 */ "stream_options",
+ /* 407 */ "col_list_opt",
+ /* 408 */ "tag_def_or_ref_opt",
+ /* 409 */ "subtable_opt",
+ /* 410 */ "expression",
+ /* 411 */ "dnode_list",
+ /* 412 */ "where_clause_opt",
+ /* 413 */ "signed",
+ /* 414 */ "literal_func",
+ /* 415 */ "literal_list",
+ /* 416 */ "table_alias",
+ /* 417 */ "expr_or_subquery",
+ /* 418 */ "pseudo_column",
+ /* 419 */ "column_reference",
+ /* 420 */ "function_expression",
+ /* 421 */ "case_when_expression",
+ /* 422 */ "star_func",
+ /* 423 */ "star_func_para_list",
+ /* 424 */ "noarg_func",
+ /* 425 */ "other_para_list",
+ /* 426 */ "star_func_para",
+ /* 427 */ "when_then_list",
+ /* 428 */ "case_when_else_opt",
+ /* 429 */ "common_expression",
+ /* 430 */ "when_then_expr",
+ /* 431 */ "predicate",
+ /* 432 */ "compare_op",
+ /* 433 */ "in_op",
+ /* 434 */ "in_predicate_value",
+ /* 435 */ "boolean_value_expression",
+ /* 436 */ "boolean_primary",
+ /* 437 */ "from_clause_opt",
+ /* 438 */ "table_reference_list",
+ /* 439 */ "table_reference",
+ /* 440 */ "table_primary",
+ /* 441 */ "joined_table",
+ /* 442 */ "alias_opt",
+ /* 443 */ "subquery",
+ /* 444 */ "parenthesized_joined_table",
+ /* 445 */ "join_type",
+ /* 446 */ "search_condition",
+ /* 447 */ "query_specification",
+ /* 448 */ "set_quantifier_opt",
+ /* 449 */ "select_list",
+ /* 450 */ "partition_by_clause_opt",
+ /* 451 */ "range_opt",
+ /* 452 */ "every_opt",
+ /* 453 */ "fill_opt",
+ /* 454 */ "twindow_clause_opt",
+ /* 455 */ "group_by_clause_opt",
+ /* 456 */ "having_clause_opt",
+ /* 457 */ "select_item",
+ /* 458 */ "partition_list",
+ /* 459 */ "partition_item",
+ /* 460 */ "fill_mode",
+ /* 461 */ "group_by_list",
+ /* 462 */ "query_expression",
+ /* 463 */ "query_simple",
+ /* 464 */ "order_by_clause_opt",
+ /* 465 */ "slimit_clause_opt",
+ /* 466 */ "limit_clause_opt",
+ /* 467 */ "union_query_expression",
+ /* 468 */ "query_simple_or_subquery",
+ /* 469 */ "sort_specification_list",
+ /* 470 */ "sort_specification",
+ /* 471 */ "ordering_specification_opt",
+ /* 472 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -1945,7 +1970,7 @@ static const char *const yyRuleName[] = {
/* 69 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
/* 70 */ "cmd ::= FLUSH DATABASE db_name",
/* 71 */ "cmd ::= TRIM DATABASE db_name speed_opt",
- /* 72 */ "cmd ::= COMPACT DATABASE db_name",
+ /* 72 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt",
/* 73 */ "not_exists_opt ::= IF NOT EXISTS",
/* 74 */ "not_exists_opt ::=",
/* 75 */ "exists_opt ::= IF EXISTS",
@@ -2002,440 +2027,450 @@ static const char *const yyRuleName[] = {
/* 126 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
/* 127 */ "speed_opt ::=",
/* 128 */ "speed_opt ::= MAX_SPEED NK_INTEGER",
- /* 129 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
- /* 130 */ "cmd ::= CREATE TABLE multi_create_clause",
- /* 131 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
- /* 132 */ "cmd ::= DROP TABLE multi_drop_clause",
- /* 133 */ "cmd ::= DROP STABLE exists_opt full_table_name",
- /* 134 */ "cmd ::= ALTER TABLE alter_table_clause",
- /* 135 */ "cmd ::= ALTER STABLE alter_table_clause",
- /* 136 */ "alter_table_clause ::= full_table_name alter_table_options",
- /* 137 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
- /* 138 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
- /* 139 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
- /* 140 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
- /* 141 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
- /* 142 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
- /* 143 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
- /* 144 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
- /* 145 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal",
- /* 146 */ "multi_create_clause ::= create_subtable_clause",
- /* 147 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
- /* 148 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options",
- /* 149 */ "multi_drop_clause ::= drop_table_clause",
- /* 150 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
- /* 151 */ "drop_table_clause ::= exists_opt full_table_name",
- /* 152 */ "specific_cols_opt ::=",
- /* 153 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
- /* 154 */ "full_table_name ::= table_name",
- /* 155 */ "full_table_name ::= db_name NK_DOT table_name",
- /* 156 */ "column_def_list ::= column_def",
- /* 157 */ "column_def_list ::= column_def_list NK_COMMA column_def",
- /* 158 */ "column_def ::= column_name type_name",
- /* 159 */ "column_def ::= column_name type_name COMMENT NK_STRING",
- /* 160 */ "type_name ::= BOOL",
- /* 161 */ "type_name ::= TINYINT",
- /* 162 */ "type_name ::= SMALLINT",
- /* 163 */ "type_name ::= INT",
- /* 164 */ "type_name ::= INTEGER",
- /* 165 */ "type_name ::= BIGINT",
- /* 166 */ "type_name ::= FLOAT",
- /* 167 */ "type_name ::= DOUBLE",
- /* 168 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
- /* 169 */ "type_name ::= TIMESTAMP",
- /* 170 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
- /* 171 */ "type_name ::= TINYINT UNSIGNED",
- /* 172 */ "type_name ::= SMALLINT UNSIGNED",
- /* 173 */ "type_name ::= INT UNSIGNED",
- /* 174 */ "type_name ::= BIGINT UNSIGNED",
- /* 175 */ "type_name ::= JSON",
- /* 176 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
- /* 177 */ "type_name ::= MEDIUMBLOB",
- /* 178 */ "type_name ::= BLOB",
- /* 179 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
- /* 180 */ "type_name ::= DECIMAL",
- /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
- /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
- /* 183 */ "tags_def_opt ::=",
- /* 184 */ "tags_def_opt ::= tags_def",
- /* 185 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
- /* 186 */ "table_options ::=",
- /* 187 */ "table_options ::= table_options COMMENT NK_STRING",
- /* 188 */ "table_options ::= table_options MAX_DELAY duration_list",
- /* 189 */ "table_options ::= table_options WATERMARK duration_list",
- /* 190 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
- /* 191 */ "table_options ::= table_options TTL NK_INTEGER",
- /* 192 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
- /* 193 */ "table_options ::= table_options DELETE_MARK duration_list",
- /* 194 */ "alter_table_options ::= alter_table_option",
- /* 195 */ "alter_table_options ::= alter_table_options alter_table_option",
- /* 196 */ "alter_table_option ::= COMMENT NK_STRING",
- /* 197 */ "alter_table_option ::= TTL NK_INTEGER",
- /* 198 */ "duration_list ::= duration_literal",
- /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal",
- /* 200 */ "rollup_func_list ::= rollup_func_name",
- /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
- /* 202 */ "rollup_func_name ::= function_name",
- /* 203 */ "rollup_func_name ::= FIRST",
- /* 204 */ "rollup_func_name ::= LAST",
- /* 205 */ "col_name_list ::= col_name",
- /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name",
- /* 207 */ "col_name ::= column_name",
- /* 208 */ "cmd ::= SHOW DNODES",
- /* 209 */ "cmd ::= SHOW USERS",
- /* 210 */ "cmd ::= SHOW USER PRIVILEGES",
- /* 211 */ "cmd ::= SHOW DATABASES",
- /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
- /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
- /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
- /* 215 */ "cmd ::= SHOW MNODES",
- /* 216 */ "cmd ::= SHOW QNODES",
- /* 217 */ "cmd ::= SHOW FUNCTIONS",
- /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
- /* 219 */ "cmd ::= SHOW STREAMS",
- /* 220 */ "cmd ::= SHOW ACCOUNTS",
- /* 221 */ "cmd ::= SHOW APPS",
- /* 222 */ "cmd ::= SHOW CONNECTIONS",
- /* 223 */ "cmd ::= SHOW LICENCES",
- /* 224 */ "cmd ::= SHOW GRANTS",
- /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name",
- /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name",
- /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name",
- /* 228 */ "cmd ::= SHOW QUERIES",
- /* 229 */ "cmd ::= SHOW SCORES",
- /* 230 */ "cmd ::= SHOW TOPICS",
- /* 231 */ "cmd ::= SHOW VARIABLES",
- /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES",
- /* 233 */ "cmd ::= SHOW LOCAL VARIABLES",
- /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
- /* 235 */ "cmd ::= SHOW BNODES",
- /* 236 */ "cmd ::= SHOW SNODES",
- /* 237 */ "cmd ::= SHOW CLUSTER",
- /* 238 */ "cmd ::= SHOW TRANSACTIONS",
- /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
- /* 240 */ "cmd ::= SHOW CONSUMERS",
- /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS",
- /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
- /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
- /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER",
- /* 245 */ "cmd ::= SHOW VNODES NK_STRING",
- /* 246 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
- /* 247 */ "cmd ::= SHOW CLUSTER ALIVE",
- /* 248 */ "db_name_cond_opt ::=",
- /* 249 */ "db_name_cond_opt ::= db_name NK_DOT",
- /* 250 */ "like_pattern_opt ::=",
- /* 251 */ "like_pattern_opt ::= LIKE NK_STRING",
- /* 252 */ "table_name_cond ::= table_name",
- /* 253 */ "from_db_opt ::=",
- /* 254 */ "from_db_opt ::= FROM db_name",
- /* 255 */ "tag_list_opt ::=",
- /* 256 */ "tag_list_opt ::= tag_item",
- /* 257 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
- /* 258 */ "tag_item ::= TBNAME",
- /* 259 */ "tag_item ::= QTAGS",
- /* 260 */ "tag_item ::= column_name",
- /* 261 */ "tag_item ::= column_name column_alias",
- /* 262 */ "tag_item ::= column_name AS column_alias",
- /* 263 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options",
- /* 264 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP",
- /* 265 */ "cmd ::= DROP INDEX exists_opt full_index_name",
- /* 266 */ "full_index_name ::= index_name",
- /* 267 */ "full_index_name ::= db_name NK_DOT index_name",
- /* 268 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
- /* 269 */ "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",
- /* 270 */ "func_list ::= func",
- /* 271 */ "func_list ::= func_list NK_COMMA func",
- /* 272 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
- /* 273 */ "sma_func_name ::= function_name",
- /* 274 */ "sma_func_name ::= COUNT",
- /* 275 */ "sma_func_name ::= FIRST",
- /* 276 */ "sma_func_name ::= LAST",
- /* 277 */ "sma_func_name ::= LAST_ROW",
- /* 278 */ "sma_stream_opt ::=",
- /* 279 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
- /* 280 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
- /* 281 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
- /* 282 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
- /* 283 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name",
- /* 284 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name",
- /* 285 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name",
- /* 286 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name",
- /* 287 */ "cmd ::= DROP TOPIC exists_opt topic_name",
- /* 288 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
- /* 289 */ "cmd ::= DESC full_table_name",
- /* 290 */ "cmd ::= DESCRIBE full_table_name",
- /* 291 */ "cmd ::= RESET QUERY CACHE",
- /* 292 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
- /* 293 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
- /* 294 */ "analyze_opt ::=",
- /* 295 */ "analyze_opt ::= ANALYZE",
- /* 296 */ "explain_options ::=",
- /* 297 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
- /* 298 */ "explain_options ::= explain_options RATIO NK_FLOAT",
- /* 299 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
- /* 300 */ "cmd ::= DROP FUNCTION exists_opt function_name",
- /* 301 */ "agg_func_opt ::=",
- /* 302 */ "agg_func_opt ::= AGGREGATE",
- /* 303 */ "bufsize_opt ::=",
- /* 304 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
- /* 305 */ "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",
- /* 306 */ "cmd ::= DROP STREAM exists_opt stream_name",
- /* 307 */ "col_list_opt ::=",
- /* 308 */ "col_list_opt ::= NK_LP col_name_list NK_RP",
- /* 309 */ "tag_def_or_ref_opt ::=",
- /* 310 */ "tag_def_or_ref_opt ::= tags_def",
- /* 311 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP",
- /* 312 */ "stream_options ::=",
- /* 313 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
- /* 314 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
- /* 315 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
- /* 316 */ "stream_options ::= stream_options WATERMARK duration_literal",
- /* 317 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
- /* 318 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
- /* 319 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
- /* 320 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
- /* 321 */ "subtable_opt ::=",
- /* 322 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
- /* 323 */ "cmd ::= KILL CONNECTION NK_INTEGER",
- /* 324 */ "cmd ::= KILL QUERY NK_STRING",
- /* 325 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
- /* 326 */ "cmd ::= BALANCE VGROUP",
- /* 327 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
- /* 328 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
- /* 329 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
- /* 330 */ "dnode_list ::= DNODE NK_INTEGER",
- /* 331 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
- /* 332 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
- /* 333 */ "cmd ::= query_or_subquery",
- /* 334 */ "cmd ::= insert_query",
- /* 335 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
- /* 336 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
- /* 337 */ "literal ::= NK_INTEGER",
- /* 338 */ "literal ::= NK_FLOAT",
- /* 339 */ "literal ::= NK_STRING",
- /* 340 */ "literal ::= NK_BOOL",
- /* 341 */ "literal ::= TIMESTAMP NK_STRING",
- /* 342 */ "literal ::= duration_literal",
- /* 343 */ "literal ::= NULL",
- /* 344 */ "literal ::= NK_QUESTION",
- /* 345 */ "duration_literal ::= NK_VARIABLE",
- /* 346 */ "signed ::= NK_INTEGER",
- /* 347 */ "signed ::= NK_PLUS NK_INTEGER",
- /* 348 */ "signed ::= NK_MINUS NK_INTEGER",
- /* 349 */ "signed ::= NK_FLOAT",
- /* 350 */ "signed ::= NK_PLUS NK_FLOAT",
- /* 351 */ "signed ::= NK_MINUS NK_FLOAT",
- /* 352 */ "signed_literal ::= signed",
- /* 353 */ "signed_literal ::= NK_STRING",
- /* 354 */ "signed_literal ::= NK_BOOL",
- /* 355 */ "signed_literal ::= TIMESTAMP NK_STRING",
- /* 356 */ "signed_literal ::= duration_literal",
- /* 357 */ "signed_literal ::= NULL",
- /* 358 */ "signed_literal ::= literal_func",
- /* 359 */ "signed_literal ::= NK_QUESTION",
- /* 360 */ "literal_list ::= signed_literal",
- /* 361 */ "literal_list ::= literal_list NK_COMMA signed_literal",
- /* 362 */ "db_name ::= NK_ID",
- /* 363 */ "table_name ::= NK_ID",
- /* 364 */ "column_name ::= NK_ID",
- /* 365 */ "function_name ::= NK_ID",
- /* 366 */ "table_alias ::= NK_ID",
- /* 367 */ "column_alias ::= NK_ID",
- /* 368 */ "user_name ::= NK_ID",
- /* 369 */ "topic_name ::= NK_ID",
- /* 370 */ "stream_name ::= NK_ID",
- /* 371 */ "cgroup_name ::= NK_ID",
- /* 372 */ "index_name ::= NK_ID",
- /* 373 */ "expr_or_subquery ::= expression",
- /* 374 */ "expression ::= literal",
- /* 375 */ "expression ::= pseudo_column",
- /* 376 */ "expression ::= column_reference",
- /* 377 */ "expression ::= function_expression",
- /* 378 */ "expression ::= case_when_expression",
- /* 379 */ "expression ::= NK_LP expression NK_RP",
- /* 380 */ "expression ::= NK_PLUS expr_or_subquery",
- /* 381 */ "expression ::= NK_MINUS expr_or_subquery",
- /* 382 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
- /* 383 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
- /* 384 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
- /* 385 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
- /* 386 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
- /* 387 */ "expression ::= column_reference NK_ARROW NK_STRING",
- /* 388 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
- /* 389 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
- /* 390 */ "expression_list ::= expr_or_subquery",
- /* 391 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
- /* 392 */ "column_reference ::= column_name",
- /* 393 */ "column_reference ::= table_name NK_DOT column_name",
- /* 394 */ "pseudo_column ::= ROWTS",
- /* 395 */ "pseudo_column ::= TBNAME",
- /* 396 */ "pseudo_column ::= table_name NK_DOT TBNAME",
- /* 397 */ "pseudo_column ::= QSTART",
- /* 398 */ "pseudo_column ::= QEND",
- /* 399 */ "pseudo_column ::= QDURATION",
- /* 400 */ "pseudo_column ::= WSTART",
- /* 401 */ "pseudo_column ::= WEND",
- /* 402 */ "pseudo_column ::= WDURATION",
- /* 403 */ "pseudo_column ::= IROWTS",
- /* 404 */ "pseudo_column ::= ISFILLED",
- /* 405 */ "pseudo_column ::= QTAGS",
- /* 406 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
- /* 407 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
- /* 408 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
- /* 409 */ "function_expression ::= literal_func",
- /* 410 */ "literal_func ::= noarg_func NK_LP NK_RP",
- /* 411 */ "literal_func ::= NOW",
- /* 412 */ "noarg_func ::= NOW",
- /* 413 */ "noarg_func ::= TODAY",
- /* 414 */ "noarg_func ::= TIMEZONE",
- /* 415 */ "noarg_func ::= DATABASE",
- /* 416 */ "noarg_func ::= CLIENT_VERSION",
- /* 417 */ "noarg_func ::= SERVER_VERSION",
- /* 418 */ "noarg_func ::= SERVER_STATUS",
- /* 419 */ "noarg_func ::= CURRENT_USER",
- /* 420 */ "noarg_func ::= USER",
- /* 421 */ "star_func ::= COUNT",
- /* 422 */ "star_func ::= FIRST",
- /* 423 */ "star_func ::= LAST",
- /* 424 */ "star_func ::= LAST_ROW",
- /* 425 */ "star_func_para_list ::= NK_STAR",
- /* 426 */ "star_func_para_list ::= other_para_list",
- /* 427 */ "other_para_list ::= star_func_para",
- /* 428 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
- /* 429 */ "star_func_para ::= expr_or_subquery",
- /* 430 */ "star_func_para ::= table_name NK_DOT NK_STAR",
- /* 431 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
- /* 432 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
- /* 433 */ "when_then_list ::= when_then_expr",
- /* 434 */ "when_then_list ::= when_then_list when_then_expr",
- /* 435 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
- /* 436 */ "case_when_else_opt ::=",
- /* 437 */ "case_when_else_opt ::= ELSE common_expression",
- /* 438 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
- /* 439 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 440 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 441 */ "predicate ::= expr_or_subquery IS NULL",
- /* 442 */ "predicate ::= expr_or_subquery IS NOT NULL",
- /* 443 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
- /* 444 */ "compare_op ::= NK_LT",
- /* 445 */ "compare_op ::= NK_GT",
- /* 446 */ "compare_op ::= NK_LE",
- /* 447 */ "compare_op ::= NK_GE",
- /* 448 */ "compare_op ::= NK_NE",
- /* 449 */ "compare_op ::= NK_EQ",
- /* 450 */ "compare_op ::= LIKE",
- /* 451 */ "compare_op ::= NOT LIKE",
- /* 452 */ "compare_op ::= MATCH",
- /* 453 */ "compare_op ::= NMATCH",
- /* 454 */ "compare_op ::= CONTAINS",
- /* 455 */ "in_op ::= IN",
- /* 456 */ "in_op ::= NOT IN",
- /* 457 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
- /* 458 */ "boolean_value_expression ::= boolean_primary",
- /* 459 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 460 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 461 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 462 */ "boolean_primary ::= predicate",
- /* 463 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 464 */ "common_expression ::= expr_or_subquery",
- /* 465 */ "common_expression ::= boolean_value_expression",
- /* 466 */ "from_clause_opt ::=",
- /* 467 */ "from_clause_opt ::= FROM table_reference_list",
- /* 468 */ "table_reference_list ::= table_reference",
- /* 469 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 470 */ "table_reference ::= table_primary",
- /* 471 */ "table_reference ::= joined_table",
- /* 472 */ "table_primary ::= table_name alias_opt",
- /* 473 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 474 */ "table_primary ::= subquery alias_opt",
- /* 475 */ "table_primary ::= parenthesized_joined_table",
- /* 476 */ "alias_opt ::=",
- /* 477 */ "alias_opt ::= table_alias",
- /* 478 */ "alias_opt ::= AS table_alias",
- /* 479 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 480 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 481 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
- /* 482 */ "join_type ::=",
- /* 483 */ "join_type ::= INNER",
- /* 484 */ "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",
- /* 485 */ "set_quantifier_opt ::=",
- /* 486 */ "set_quantifier_opt ::= DISTINCT",
- /* 487 */ "set_quantifier_opt ::= ALL",
- /* 488 */ "select_list ::= select_item",
- /* 489 */ "select_list ::= select_list NK_COMMA select_item",
- /* 490 */ "select_item ::= NK_STAR",
- /* 491 */ "select_item ::= common_expression",
- /* 492 */ "select_item ::= common_expression column_alias",
- /* 493 */ "select_item ::= common_expression AS column_alias",
- /* 494 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 495 */ "where_clause_opt ::=",
- /* 496 */ "where_clause_opt ::= WHERE search_condition",
- /* 497 */ "partition_by_clause_opt ::=",
- /* 498 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
- /* 499 */ "partition_list ::= partition_item",
- /* 500 */ "partition_list ::= partition_list NK_COMMA partition_item",
- /* 501 */ "partition_item ::= expr_or_subquery",
- /* 502 */ "partition_item ::= expr_or_subquery column_alias",
- /* 503 */ "partition_item ::= expr_or_subquery AS column_alias",
- /* 504 */ "twindow_clause_opt ::=",
- /* 505 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
- /* 506 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
- /* 507 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
- /* 508 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
- /* 509 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
- /* 510 */ "sliding_opt ::=",
- /* 511 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
- /* 512 */ "fill_opt ::=",
- /* 513 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 514 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
- /* 515 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP",
- /* 516 */ "fill_mode ::= NONE",
- /* 517 */ "fill_mode ::= PREV",
- /* 518 */ "fill_mode ::= NULL",
- /* 519 */ "fill_mode ::= NULL_F",
- /* 520 */ "fill_mode ::= LINEAR",
- /* 521 */ "fill_mode ::= NEXT",
- /* 522 */ "group_by_clause_opt ::=",
- /* 523 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 524 */ "group_by_list ::= expr_or_subquery",
- /* 525 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
- /* 526 */ "having_clause_opt ::=",
- /* 527 */ "having_clause_opt ::= HAVING search_condition",
- /* 528 */ "range_opt ::=",
- /* 529 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
- /* 530 */ "every_opt ::=",
- /* 531 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
- /* 532 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 533 */ "query_simple ::= query_specification",
- /* 534 */ "query_simple ::= union_query_expression",
- /* 535 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
- /* 536 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
- /* 537 */ "query_simple_or_subquery ::= query_simple",
- /* 538 */ "query_simple_or_subquery ::= subquery",
- /* 539 */ "query_or_subquery ::= query_expression",
- /* 540 */ "query_or_subquery ::= subquery",
- /* 541 */ "order_by_clause_opt ::=",
- /* 542 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 543 */ "slimit_clause_opt ::=",
- /* 544 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 545 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 546 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 547 */ "limit_clause_opt ::=",
- /* 548 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 549 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 550 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 551 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 552 */ "subquery ::= NK_LP subquery NK_RP",
- /* 553 */ "search_condition ::= common_expression",
- /* 554 */ "sort_specification_list ::= sort_specification",
- /* 555 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 556 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
- /* 557 */ "ordering_specification_opt ::=",
- /* 558 */ "ordering_specification_opt ::= ASC",
- /* 559 */ "ordering_specification_opt ::= DESC",
- /* 560 */ "null_ordering_opt ::=",
- /* 561 */ "null_ordering_opt ::= NULLS FIRST",
- /* 562 */ "null_ordering_opt ::= NULLS LAST",
+ /* 129 */ "start_opt ::=",
+ /* 130 */ "start_opt ::= START WITH NK_INTEGER",
+ /* 131 */ "start_opt ::= START WITH NK_STRING",
+ /* 132 */ "start_opt ::= START WITH TIMESTAMP NK_STRING",
+ /* 133 */ "end_opt ::=",
+ /* 134 */ "end_opt ::= END WITH NK_INTEGER",
+ /* 135 */ "end_opt ::= END WITH NK_STRING",
+ /* 136 */ "end_opt ::= END WITH TIMESTAMP NK_STRING",
+ /* 137 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
+ /* 138 */ "cmd ::= CREATE TABLE multi_create_clause",
+ /* 139 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
+ /* 140 */ "cmd ::= DROP TABLE multi_drop_clause",
+ /* 141 */ "cmd ::= DROP STABLE exists_opt full_table_name",
+ /* 142 */ "cmd ::= ALTER TABLE alter_table_clause",
+ /* 143 */ "cmd ::= ALTER STABLE alter_table_clause",
+ /* 144 */ "alter_table_clause ::= full_table_name alter_table_options",
+ /* 145 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
+ /* 146 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
+ /* 147 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
+ /* 148 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
+ /* 149 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
+ /* 150 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
+ /* 151 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
+ /* 152 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
+ /* 153 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal",
+ /* 154 */ "multi_create_clause ::= create_subtable_clause",
+ /* 155 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
+ /* 156 */ "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",
+ /* 157 */ "multi_drop_clause ::= drop_table_clause",
+ /* 158 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
+ /* 159 */ "drop_table_clause ::= exists_opt full_table_name",
+ /* 160 */ "specific_cols_opt ::=",
+ /* 161 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
+ /* 162 */ "full_table_name ::= table_name",
+ /* 163 */ "full_table_name ::= db_name NK_DOT table_name",
+ /* 164 */ "column_def_list ::= column_def",
+ /* 165 */ "column_def_list ::= column_def_list NK_COMMA column_def",
+ /* 166 */ "column_def ::= column_name type_name",
+ /* 167 */ "column_def ::= column_name type_name COMMENT NK_STRING",
+ /* 168 */ "type_name ::= BOOL",
+ /* 169 */ "type_name ::= TINYINT",
+ /* 170 */ "type_name ::= SMALLINT",
+ /* 171 */ "type_name ::= INT",
+ /* 172 */ "type_name ::= INTEGER",
+ /* 173 */ "type_name ::= BIGINT",
+ /* 174 */ "type_name ::= FLOAT",
+ /* 175 */ "type_name ::= DOUBLE",
+ /* 176 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
+ /* 177 */ "type_name ::= TIMESTAMP",
+ /* 178 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
+ /* 179 */ "type_name ::= TINYINT UNSIGNED",
+ /* 180 */ "type_name ::= SMALLINT UNSIGNED",
+ /* 181 */ "type_name ::= INT UNSIGNED",
+ /* 182 */ "type_name ::= BIGINT UNSIGNED",
+ /* 183 */ "type_name ::= JSON",
+ /* 184 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
+ /* 185 */ "type_name ::= MEDIUMBLOB",
+ /* 186 */ "type_name ::= BLOB",
+ /* 187 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
+ /* 188 */ "type_name ::= DECIMAL",
+ /* 189 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
+ /* 190 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
+ /* 191 */ "tags_def_opt ::=",
+ /* 192 */ "tags_def_opt ::= tags_def",
+ /* 193 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
+ /* 194 */ "table_options ::=",
+ /* 195 */ "table_options ::= table_options COMMENT NK_STRING",
+ /* 196 */ "table_options ::= table_options MAX_DELAY duration_list",
+ /* 197 */ "table_options ::= table_options WATERMARK duration_list",
+ /* 198 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
+ /* 199 */ "table_options ::= table_options TTL NK_INTEGER",
+ /* 200 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
+ /* 201 */ "table_options ::= table_options DELETE_MARK duration_list",
+ /* 202 */ "alter_table_options ::= alter_table_option",
+ /* 203 */ "alter_table_options ::= alter_table_options alter_table_option",
+ /* 204 */ "alter_table_option ::= COMMENT NK_STRING",
+ /* 205 */ "alter_table_option ::= TTL NK_INTEGER",
+ /* 206 */ "duration_list ::= duration_literal",
+ /* 207 */ "duration_list ::= duration_list NK_COMMA duration_literal",
+ /* 208 */ "rollup_func_list ::= rollup_func_name",
+ /* 209 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
+ /* 210 */ "rollup_func_name ::= function_name",
+ /* 211 */ "rollup_func_name ::= FIRST",
+ /* 212 */ "rollup_func_name ::= LAST",
+ /* 213 */ "col_name_list ::= col_name",
+ /* 214 */ "col_name_list ::= col_name_list NK_COMMA col_name",
+ /* 215 */ "col_name ::= column_name",
+ /* 216 */ "cmd ::= SHOW DNODES",
+ /* 217 */ "cmd ::= SHOW USERS",
+ /* 218 */ "cmd ::= SHOW USER PRIVILEGES",
+ /* 219 */ "cmd ::= SHOW DATABASES",
+ /* 220 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
+ /* 221 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
+ /* 222 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
+ /* 223 */ "cmd ::= SHOW MNODES",
+ /* 224 */ "cmd ::= SHOW QNODES",
+ /* 225 */ "cmd ::= SHOW FUNCTIONS",
+ /* 226 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
+ /* 227 */ "cmd ::= SHOW STREAMS",
+ /* 228 */ "cmd ::= SHOW ACCOUNTS",
+ /* 229 */ "cmd ::= SHOW APPS",
+ /* 230 */ "cmd ::= SHOW CONNECTIONS",
+ /* 231 */ "cmd ::= SHOW LICENCES",
+ /* 232 */ "cmd ::= SHOW GRANTS",
+ /* 233 */ "cmd ::= SHOW CREATE DATABASE db_name",
+ /* 234 */ "cmd ::= SHOW CREATE TABLE full_table_name",
+ /* 235 */ "cmd ::= SHOW CREATE STABLE full_table_name",
+ /* 236 */ "cmd ::= SHOW QUERIES",
+ /* 237 */ "cmd ::= SHOW SCORES",
+ /* 238 */ "cmd ::= SHOW TOPICS",
+ /* 239 */ "cmd ::= SHOW VARIABLES",
+ /* 240 */ "cmd ::= SHOW CLUSTER VARIABLES",
+ /* 241 */ "cmd ::= SHOW LOCAL VARIABLES",
+ /* 242 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
+ /* 243 */ "cmd ::= SHOW BNODES",
+ /* 244 */ "cmd ::= SHOW SNODES",
+ /* 245 */ "cmd ::= SHOW CLUSTER",
+ /* 246 */ "cmd ::= SHOW TRANSACTIONS",
+ /* 247 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
+ /* 248 */ "cmd ::= SHOW CONSUMERS",
+ /* 249 */ "cmd ::= SHOW SUBSCRIPTIONS",
+ /* 250 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
+ /* 251 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
+ /* 252 */ "cmd ::= SHOW VNODES NK_INTEGER",
+ /* 253 */ "cmd ::= SHOW VNODES NK_STRING",
+ /* 254 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
+ /* 255 */ "cmd ::= SHOW CLUSTER ALIVE",
+ /* 256 */ "db_name_cond_opt ::=",
+ /* 257 */ "db_name_cond_opt ::= db_name NK_DOT",
+ /* 258 */ "like_pattern_opt ::=",
+ /* 259 */ "like_pattern_opt ::= LIKE NK_STRING",
+ /* 260 */ "table_name_cond ::= table_name",
+ /* 261 */ "from_db_opt ::=",
+ /* 262 */ "from_db_opt ::= FROM db_name",
+ /* 263 */ "tag_list_opt ::=",
+ /* 264 */ "tag_list_opt ::= tag_item",
+ /* 265 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
+ /* 266 */ "tag_item ::= TBNAME",
+ /* 267 */ "tag_item ::= QTAGS",
+ /* 268 */ "tag_item ::= column_name",
+ /* 269 */ "tag_item ::= column_name column_alias",
+ /* 270 */ "tag_item ::= column_name AS column_alias",
+ /* 271 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options",
+ /* 272 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP",
+ /* 273 */ "cmd ::= DROP INDEX exists_opt full_index_name",
+ /* 274 */ "full_index_name ::= index_name",
+ /* 275 */ "full_index_name ::= db_name NK_DOT index_name",
+ /* 276 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
+ /* 277 */ "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",
+ /* 278 */ "func_list ::= func",
+ /* 279 */ "func_list ::= func_list NK_COMMA func",
+ /* 280 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
+ /* 281 */ "sma_func_name ::= function_name",
+ /* 282 */ "sma_func_name ::= COUNT",
+ /* 283 */ "sma_func_name ::= FIRST",
+ /* 284 */ "sma_func_name ::= LAST",
+ /* 285 */ "sma_func_name ::= LAST_ROW",
+ /* 286 */ "sma_stream_opt ::=",
+ /* 287 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
+ /* 288 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
+ /* 289 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
+ /* 290 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
+ /* 291 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name",
+ /* 292 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name",
+ /* 293 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name",
+ /* 294 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name",
+ /* 295 */ "cmd ::= DROP TOPIC exists_opt topic_name",
+ /* 296 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
+ /* 297 */ "cmd ::= DESC full_table_name",
+ /* 298 */ "cmd ::= DESCRIBE full_table_name",
+ /* 299 */ "cmd ::= RESET QUERY CACHE",
+ /* 300 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
+ /* 301 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
+ /* 302 */ "analyze_opt ::=",
+ /* 303 */ "analyze_opt ::= ANALYZE",
+ /* 304 */ "explain_options ::=",
+ /* 305 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
+ /* 306 */ "explain_options ::= explain_options RATIO NK_FLOAT",
+ /* 307 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt",
+ /* 308 */ "cmd ::= DROP FUNCTION exists_opt function_name",
+ /* 309 */ "agg_func_opt ::=",
+ /* 310 */ "agg_func_opt ::= AGGREGATE",
+ /* 311 */ "bufsize_opt ::=",
+ /* 312 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
+ /* 313 */ "language_opt ::=",
+ /* 314 */ "language_opt ::= LANGUAGE NK_STRING",
+ /* 315 */ "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",
+ /* 316 */ "cmd ::= DROP STREAM exists_opt stream_name",
+ /* 317 */ "col_list_opt ::=",
+ /* 318 */ "col_list_opt ::= NK_LP col_name_list NK_RP",
+ /* 319 */ "tag_def_or_ref_opt ::=",
+ /* 320 */ "tag_def_or_ref_opt ::= tags_def",
+ /* 321 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP",
+ /* 322 */ "stream_options ::=",
+ /* 323 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
+ /* 324 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
+ /* 325 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
+ /* 326 */ "stream_options ::= stream_options WATERMARK duration_literal",
+ /* 327 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
+ /* 328 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
+ /* 329 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
+ /* 330 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
+ /* 331 */ "subtable_opt ::=",
+ /* 332 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
+ /* 333 */ "cmd ::= KILL CONNECTION NK_INTEGER",
+ /* 334 */ "cmd ::= KILL QUERY NK_STRING",
+ /* 335 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
+ /* 336 */ "cmd ::= BALANCE VGROUP",
+ /* 337 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
+ /* 338 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
+ /* 339 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
+ /* 340 */ "dnode_list ::= DNODE NK_INTEGER",
+ /* 341 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
+ /* 342 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
+ /* 343 */ "cmd ::= query_or_subquery",
+ /* 344 */ "cmd ::= insert_query",
+ /* 345 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
+ /* 346 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
+ /* 347 */ "literal ::= NK_INTEGER",
+ /* 348 */ "literal ::= NK_FLOAT",
+ /* 349 */ "literal ::= NK_STRING",
+ /* 350 */ "literal ::= NK_BOOL",
+ /* 351 */ "literal ::= TIMESTAMP NK_STRING",
+ /* 352 */ "literal ::= duration_literal",
+ /* 353 */ "literal ::= NULL",
+ /* 354 */ "literal ::= NK_QUESTION",
+ /* 355 */ "duration_literal ::= NK_VARIABLE",
+ /* 356 */ "signed ::= NK_INTEGER",
+ /* 357 */ "signed ::= NK_PLUS NK_INTEGER",
+ /* 358 */ "signed ::= NK_MINUS NK_INTEGER",
+ /* 359 */ "signed ::= NK_FLOAT",
+ /* 360 */ "signed ::= NK_PLUS NK_FLOAT",
+ /* 361 */ "signed ::= NK_MINUS NK_FLOAT",
+ /* 362 */ "signed_literal ::= signed",
+ /* 363 */ "signed_literal ::= NK_STRING",
+ /* 364 */ "signed_literal ::= NK_BOOL",
+ /* 365 */ "signed_literal ::= TIMESTAMP NK_STRING",
+ /* 366 */ "signed_literal ::= duration_literal",
+ /* 367 */ "signed_literal ::= NULL",
+ /* 368 */ "signed_literal ::= literal_func",
+ /* 369 */ "signed_literal ::= NK_QUESTION",
+ /* 370 */ "literal_list ::= signed_literal",
+ /* 371 */ "literal_list ::= literal_list NK_COMMA signed_literal",
+ /* 372 */ "db_name ::= NK_ID",
+ /* 373 */ "table_name ::= NK_ID",
+ /* 374 */ "column_name ::= NK_ID",
+ /* 375 */ "function_name ::= NK_ID",
+ /* 376 */ "table_alias ::= NK_ID",
+ /* 377 */ "column_alias ::= NK_ID",
+ /* 378 */ "user_name ::= NK_ID",
+ /* 379 */ "topic_name ::= NK_ID",
+ /* 380 */ "stream_name ::= NK_ID",
+ /* 381 */ "cgroup_name ::= NK_ID",
+ /* 382 */ "index_name ::= NK_ID",
+ /* 383 */ "expr_or_subquery ::= expression",
+ /* 384 */ "expression ::= literal",
+ /* 385 */ "expression ::= pseudo_column",
+ /* 386 */ "expression ::= column_reference",
+ /* 387 */ "expression ::= function_expression",
+ /* 388 */ "expression ::= case_when_expression",
+ /* 389 */ "expression ::= NK_LP expression NK_RP",
+ /* 390 */ "expression ::= NK_PLUS expr_or_subquery",
+ /* 391 */ "expression ::= NK_MINUS expr_or_subquery",
+ /* 392 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
+ /* 393 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
+ /* 394 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
+ /* 395 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
+ /* 396 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
+ /* 397 */ "expression ::= column_reference NK_ARROW NK_STRING",
+ /* 398 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
+ /* 399 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
+ /* 400 */ "expression_list ::= expr_or_subquery",
+ /* 401 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
+ /* 402 */ "column_reference ::= column_name",
+ /* 403 */ "column_reference ::= table_name NK_DOT column_name",
+ /* 404 */ "pseudo_column ::= ROWTS",
+ /* 405 */ "pseudo_column ::= TBNAME",
+ /* 406 */ "pseudo_column ::= table_name NK_DOT TBNAME",
+ /* 407 */ "pseudo_column ::= QSTART",
+ /* 408 */ "pseudo_column ::= QEND",
+ /* 409 */ "pseudo_column ::= QDURATION",
+ /* 410 */ "pseudo_column ::= WSTART",
+ /* 411 */ "pseudo_column ::= WEND",
+ /* 412 */ "pseudo_column ::= WDURATION",
+ /* 413 */ "pseudo_column ::= IROWTS",
+ /* 414 */ "pseudo_column ::= ISFILLED",
+ /* 415 */ "pseudo_column ::= QTAGS",
+ /* 416 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
+ /* 417 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
+ /* 418 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
+ /* 419 */ "function_expression ::= literal_func",
+ /* 420 */ "literal_func ::= noarg_func NK_LP NK_RP",
+ /* 421 */ "literal_func ::= NOW",
+ /* 422 */ "noarg_func ::= NOW",
+ /* 423 */ "noarg_func ::= TODAY",
+ /* 424 */ "noarg_func ::= TIMEZONE",
+ /* 425 */ "noarg_func ::= DATABASE",
+ /* 426 */ "noarg_func ::= CLIENT_VERSION",
+ /* 427 */ "noarg_func ::= SERVER_VERSION",
+ /* 428 */ "noarg_func ::= SERVER_STATUS",
+ /* 429 */ "noarg_func ::= CURRENT_USER",
+ /* 430 */ "noarg_func ::= USER",
+ /* 431 */ "star_func ::= COUNT",
+ /* 432 */ "star_func ::= FIRST",
+ /* 433 */ "star_func ::= LAST",
+ /* 434 */ "star_func ::= LAST_ROW",
+ /* 435 */ "star_func_para_list ::= NK_STAR",
+ /* 436 */ "star_func_para_list ::= other_para_list",
+ /* 437 */ "other_para_list ::= star_func_para",
+ /* 438 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
+ /* 439 */ "star_func_para ::= expr_or_subquery",
+ /* 440 */ "star_func_para ::= table_name NK_DOT NK_STAR",
+ /* 441 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
+ /* 442 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
+ /* 443 */ "when_then_list ::= when_then_expr",
+ /* 444 */ "when_then_list ::= when_then_list when_then_expr",
+ /* 445 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
+ /* 446 */ "case_when_else_opt ::=",
+ /* 447 */ "case_when_else_opt ::= ELSE common_expression",
+ /* 448 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
+ /* 449 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 450 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 451 */ "predicate ::= expr_or_subquery IS NULL",
+ /* 452 */ "predicate ::= expr_or_subquery IS NOT NULL",
+ /* 453 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
+ /* 454 */ "compare_op ::= NK_LT",
+ /* 455 */ "compare_op ::= NK_GT",
+ /* 456 */ "compare_op ::= NK_LE",
+ /* 457 */ "compare_op ::= NK_GE",
+ /* 458 */ "compare_op ::= NK_NE",
+ /* 459 */ "compare_op ::= NK_EQ",
+ /* 460 */ "compare_op ::= LIKE",
+ /* 461 */ "compare_op ::= NOT LIKE",
+ /* 462 */ "compare_op ::= MATCH",
+ /* 463 */ "compare_op ::= NMATCH",
+ /* 464 */ "compare_op ::= CONTAINS",
+ /* 465 */ "in_op ::= IN",
+ /* 466 */ "in_op ::= NOT IN",
+ /* 467 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
+ /* 468 */ "boolean_value_expression ::= boolean_primary",
+ /* 469 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 470 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 471 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 472 */ "boolean_primary ::= predicate",
+ /* 473 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 474 */ "common_expression ::= expr_or_subquery",
+ /* 475 */ "common_expression ::= boolean_value_expression",
+ /* 476 */ "from_clause_opt ::=",
+ /* 477 */ "from_clause_opt ::= FROM table_reference_list",
+ /* 478 */ "table_reference_list ::= table_reference",
+ /* 479 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 480 */ "table_reference ::= table_primary",
+ /* 481 */ "table_reference ::= joined_table",
+ /* 482 */ "table_primary ::= table_name alias_opt",
+ /* 483 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 484 */ "table_primary ::= subquery alias_opt",
+ /* 485 */ "table_primary ::= parenthesized_joined_table",
+ /* 486 */ "alias_opt ::=",
+ /* 487 */ "alias_opt ::= table_alias",
+ /* 488 */ "alias_opt ::= AS table_alias",
+ /* 489 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 490 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 491 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
+ /* 492 */ "join_type ::=",
+ /* 493 */ "join_type ::= INNER",
+ /* 494 */ "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",
+ /* 495 */ "set_quantifier_opt ::=",
+ /* 496 */ "set_quantifier_opt ::= DISTINCT",
+ /* 497 */ "set_quantifier_opt ::= ALL",
+ /* 498 */ "select_list ::= select_item",
+ /* 499 */ "select_list ::= select_list NK_COMMA select_item",
+ /* 500 */ "select_item ::= NK_STAR",
+ /* 501 */ "select_item ::= common_expression",
+ /* 502 */ "select_item ::= common_expression column_alias",
+ /* 503 */ "select_item ::= common_expression AS column_alias",
+ /* 504 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 505 */ "where_clause_opt ::=",
+ /* 506 */ "where_clause_opt ::= WHERE search_condition",
+ /* 507 */ "partition_by_clause_opt ::=",
+ /* 508 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
+ /* 509 */ "partition_list ::= partition_item",
+ /* 510 */ "partition_list ::= partition_list NK_COMMA partition_item",
+ /* 511 */ "partition_item ::= expr_or_subquery",
+ /* 512 */ "partition_item ::= expr_or_subquery column_alias",
+ /* 513 */ "partition_item ::= expr_or_subquery AS column_alias",
+ /* 514 */ "twindow_clause_opt ::=",
+ /* 515 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
+ /* 516 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
+ /* 517 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
+ /* 518 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
+ /* 519 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
+ /* 520 */ "sliding_opt ::=",
+ /* 521 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
+ /* 522 */ "fill_opt ::=",
+ /* 523 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 524 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
+ /* 525 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP",
+ /* 526 */ "fill_mode ::= NONE",
+ /* 527 */ "fill_mode ::= PREV",
+ /* 528 */ "fill_mode ::= NULL",
+ /* 529 */ "fill_mode ::= NULL_F",
+ /* 530 */ "fill_mode ::= LINEAR",
+ /* 531 */ "fill_mode ::= NEXT",
+ /* 532 */ "group_by_clause_opt ::=",
+ /* 533 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 534 */ "group_by_list ::= expr_or_subquery",
+ /* 535 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
+ /* 536 */ "having_clause_opt ::=",
+ /* 537 */ "having_clause_opt ::= HAVING search_condition",
+ /* 538 */ "range_opt ::=",
+ /* 539 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
+ /* 540 */ "every_opt ::=",
+ /* 541 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
+ /* 542 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 543 */ "query_simple ::= query_specification",
+ /* 544 */ "query_simple ::= union_query_expression",
+ /* 545 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
+ /* 546 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
+ /* 547 */ "query_simple_or_subquery ::= query_simple",
+ /* 548 */ "query_simple_or_subquery ::= subquery",
+ /* 549 */ "query_or_subquery ::= query_expression",
+ /* 550 */ "query_or_subquery ::= subquery",
+ /* 551 */ "order_by_clause_opt ::=",
+ /* 552 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 553 */ "slimit_clause_opt ::=",
+ /* 554 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 555 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 556 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 557 */ "limit_clause_opt ::=",
+ /* 558 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 559 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 560 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 561 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 562 */ "subquery ::= NK_LP subquery NK_RP",
+ /* 563 */ "search_condition ::= common_expression",
+ /* 564 */ "sort_specification_list ::= sort_specification",
+ /* 565 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 566 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
+ /* 567 */ "ordering_specification_opt ::=",
+ /* 568 */ "ordering_specification_opt ::= ASC",
+ /* 569 */ "ordering_specification_opt ::= DESC",
+ /* 570 */ "null_ordering_opt ::=",
+ /* 571 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 572 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
@@ -2562,199 +2597,202 @@ 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 352: /* retention */
- case 353: /* full_table_name */
- case 356: /* table_options */
- case 360: /* alter_table_clause */
- case 361: /* alter_table_options */
- case 364: /* signed_literal */
- case 365: /* create_subtable_clause */
- case 368: /* drop_table_clause */
- case 371: /* column_def */
- case 375: /* duration_literal */
- case 376: /* rollup_func_name */
- case 378: /* col_name */
- case 379: /* db_name_cond_opt */
- case 380: /* like_pattern_opt */
- case 381: /* table_name_cond */
- case 382: /* from_db_opt */
- case 384: /* tag_item */
- case 386: /* full_index_name */
- case 387: /* index_options */
- case 390: /* sliding_opt */
- case 391: /* sma_stream_opt */
- case 392: /* func */
- case 394: /* query_or_subquery */
- case 397: /* explain_options */
- case 398: /* insert_query */
- case 402: /* stream_options */
- case 405: /* subtable_opt */
- case 406: /* expression */
- case 408: /* where_clause_opt */
- case 409: /* signed */
- case 410: /* literal_func */
- case 413: /* expr_or_subquery */
- case 414: /* pseudo_column */
- case 415: /* column_reference */
- case 416: /* function_expression */
- case 417: /* case_when_expression */
- case 422: /* star_func_para */
- case 424: /* case_when_else_opt */
- case 425: /* common_expression */
- case 426: /* when_then_expr */
- case 427: /* predicate */
- case 430: /* in_predicate_value */
- case 431: /* boolean_value_expression */
- case 432: /* boolean_primary */
- case 433: /* from_clause_opt */
- case 434: /* table_reference_list */
- case 435: /* table_reference */
- case 436: /* table_primary */
- case 437: /* joined_table */
- case 439: /* subquery */
- case 440: /* parenthesized_joined_table */
- case 442: /* search_condition */
- case 443: /* query_specification */
- case 447: /* range_opt */
- case 448: /* every_opt */
- case 449: /* fill_opt */
- case 450: /* twindow_clause_opt */
- case 452: /* having_clause_opt */
- case 453: /* select_item */
- case 455: /* partition_item */
- case 458: /* query_expression */
- case 459: /* query_simple */
- case 461: /* slimit_clause_opt */
- case 462: /* limit_clause_opt */
- case 463: /* union_query_expression */
- case 464: /* query_simple_or_subquery */
- case 466: /* sort_specification */
+ case 329: /* cmd */
+ case 332: /* literal */
+ case 345: /* db_options */
+ case 347: /* alter_db_options */
+ case 349: /* start_opt */
+ case 350: /* end_opt */
+ case 355: /* retention */
+ case 356: /* full_table_name */
+ case 359: /* table_options */
+ case 363: /* alter_table_clause */
+ case 364: /* alter_table_options */
+ case 367: /* signed_literal */
+ case 368: /* create_subtable_clause */
+ case 371: /* drop_table_clause */
+ case 374: /* column_def */
+ case 378: /* duration_literal */
+ case 379: /* rollup_func_name */
+ case 381: /* col_name */
+ case 382: /* db_name_cond_opt */
+ case 383: /* like_pattern_opt */
+ case 384: /* table_name_cond */
+ case 385: /* from_db_opt */
+ case 387: /* tag_item */
+ case 389: /* full_index_name */
+ case 390: /* index_options */
+ case 393: /* sliding_opt */
+ case 394: /* sma_stream_opt */
+ case 395: /* func */
+ case 397: /* query_or_subquery */
+ case 400: /* explain_options */
+ case 401: /* insert_query */
+ case 406: /* stream_options */
+ case 409: /* subtable_opt */
+ case 410: /* expression */
+ case 412: /* where_clause_opt */
+ case 413: /* signed */
+ case 414: /* literal_func */
+ case 417: /* expr_or_subquery */
+ case 418: /* pseudo_column */
+ case 419: /* column_reference */
+ case 420: /* function_expression */
+ case 421: /* case_when_expression */
+ case 426: /* star_func_para */
+ case 428: /* case_when_else_opt */
+ case 429: /* common_expression */
+ case 430: /* when_then_expr */
+ case 431: /* predicate */
+ case 434: /* in_predicate_value */
+ case 435: /* boolean_value_expression */
+ case 436: /* boolean_primary */
+ case 437: /* from_clause_opt */
+ case 438: /* table_reference_list */
+ case 439: /* table_reference */
+ case 440: /* table_primary */
+ case 441: /* joined_table */
+ case 443: /* subquery */
+ case 444: /* parenthesized_joined_table */
+ case 446: /* search_condition */
+ case 447: /* query_specification */
+ case 451: /* range_opt */
+ case 452: /* every_opt */
+ case 453: /* fill_opt */
+ case 454: /* twindow_clause_opt */
+ case 456: /* having_clause_opt */
+ case 457: /* select_item */
+ case 459: /* partition_item */
+ case 462: /* query_expression */
+ case 463: /* query_simple */
+ case 465: /* slimit_clause_opt */
+ case 466: /* limit_clause_opt */
+ case 467: /* union_query_expression */
+ case 468: /* query_simple_or_subquery */
+ case 470: /* sort_specification */
{
- nodesDestroyNode((yypminor->yy42));
+ nodesDestroyNode((yypminor->yy828));
}
break;
- case 329: /* account_options */
- case 330: /* alter_account_options */
- case 332: /* alter_account_option */
- case 347: /* speed_opt */
- case 400: /* bufsize_opt */
+ case 330: /* account_options */
+ case 331: /* alter_account_options */
+ case 333: /* alter_account_option */
+ case 348: /* speed_opt */
+ case 403: /* bufsize_opt */
{
}
break;
- case 333: /* user_name */
- case 336: /* priv_level */
- case 339: /* db_name */
- case 340: /* topic_name */
- case 341: /* dnode_endpoint */
- case 362: /* column_name */
- case 370: /* table_name */
- case 377: /* function_name */
- case 385: /* column_alias */
- case 388: /* index_name */
- case 393: /* sma_func_name */
- case 395: /* cgroup_name */
- case 401: /* stream_name */
- case 412: /* table_alias */
- case 418: /* star_func */
- case 420: /* noarg_func */
- case 438: /* alias_opt */
+ case 334: /* user_name */
+ case 337: /* priv_level */
+ case 340: /* db_name */
+ case 341: /* topic_name */
+ case 342: /* dnode_endpoint */
+ case 365: /* column_name */
+ case 373: /* table_name */
+ case 380: /* function_name */
+ case 388: /* column_alias */
+ case 391: /* index_name */
+ case 396: /* sma_func_name */
+ case 398: /* cgroup_name */
+ case 404: /* language_opt */
+ case 405: /* stream_name */
+ case 416: /* table_alias */
+ case 422: /* star_func */
+ case 424: /* noarg_func */
+ case 442: /* alias_opt */
{
}
break;
- case 334: /* sysinfo_opt */
+ case 335: /* sysinfo_opt */
{
}
break;
- case 335: /* privileges */
- case 337: /* priv_type_list */
- case 338: /* priv_type */
+ case 336: /* privileges */
+ case 338: /* priv_type_list */
+ case 339: /* priv_type */
{
}
break;
- case 342: /* force_opt */
- case 343: /* not_exists_opt */
- case 345: /* exists_opt */
- case 396: /* analyze_opt */
- case 399: /* agg_func_opt */
- case 444: /* set_quantifier_opt */
+ case 343: /* force_opt */
+ case 344: /* not_exists_opt */
+ case 346: /* exists_opt */
+ case 399: /* analyze_opt */
+ case 402: /* agg_func_opt */
+ case 448: /* set_quantifier_opt */
{
}
break;
- case 348: /* integer_list */
- case 349: /* variable_list */
- case 350: /* retention_list */
- case 354: /* column_def_list */
- case 355: /* tags_def_opt */
- case 357: /* multi_create_clause */
- case 358: /* tags_def */
- case 359: /* multi_drop_clause */
- case 366: /* specific_cols_opt */
- case 367: /* expression_list */
- case 369: /* col_name_list */
- case 372: /* duration_list */
- case 373: /* rollup_func_list */
- case 383: /* tag_list_opt */
- case 389: /* func_list */
- case 403: /* col_list_opt */
- case 404: /* tag_def_or_ref_opt */
- case 407: /* dnode_list */
- case 411: /* literal_list */
- case 419: /* star_func_para_list */
- case 421: /* other_para_list */
- case 423: /* when_then_list */
- case 445: /* select_list */
- case 446: /* partition_by_clause_opt */
- case 451: /* group_by_clause_opt */
- case 454: /* partition_list */
- case 457: /* group_by_list */
- case 460: /* order_by_clause_opt */
- case 465: /* sort_specification_list */
+ case 351: /* integer_list */
+ case 352: /* variable_list */
+ case 353: /* retention_list */
+ case 357: /* column_def_list */
+ case 358: /* tags_def_opt */
+ case 360: /* multi_create_clause */
+ case 361: /* tags_def */
+ case 362: /* multi_drop_clause */
+ case 369: /* specific_cols_opt */
+ case 370: /* expression_list */
+ case 372: /* col_name_list */
+ case 375: /* duration_list */
+ case 376: /* rollup_func_list */
+ case 386: /* tag_list_opt */
+ case 392: /* func_list */
+ case 407: /* col_list_opt */
+ case 408: /* tag_def_or_ref_opt */
+ case 411: /* dnode_list */
+ case 415: /* literal_list */
+ case 423: /* star_func_para_list */
+ case 425: /* other_para_list */
+ case 427: /* when_then_list */
+ case 449: /* select_list */
+ case 450: /* partition_by_clause_opt */
+ case 455: /* group_by_clause_opt */
+ case 458: /* partition_list */
+ case 461: /* group_by_list */
+ case 464: /* order_by_clause_opt */
+ case 469: /* sort_specification_list */
{
- nodesDestroyList((yypminor->yy110));
+ nodesDestroyList((yypminor->yy222));
}
break;
- case 351: /* alter_db_option */
- case 374: /* alter_table_option */
+ case 354: /* alter_db_option */
+ case 377: /* alter_table_option */
{
}
break;
- case 363: /* type_name */
+ case 366: /* type_name */
{
}
break;
- case 428: /* compare_op */
- case 429: /* in_op */
+ case 432: /* compare_op */
+ case 433: /* in_op */
{
}
break;
- case 441: /* join_type */
+ case 445: /* join_type */
{
}
break;
- case 456: /* fill_mode */
+ case 460: /* fill_mode */
{
}
break;
- case 467: /* ordering_specification_opt */
+ case 471: /* ordering_specification_opt */
{
}
break;
- case 468: /* null_ordering_opt */
+ case 472: /* null_ordering_opt */
{
}
@@ -3053,569 +3091,579 @@ 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, -3 }, /* (72) cmd ::= COMPACT DATABASE db_name */
- { 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 */
- { 351, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */
- { 351, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */
- { 351, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */
- { 351, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
- { 351, -2 }, /* (114) alter_db_option ::= KEEP integer_list */
- { 351, -2 }, /* (115) alter_db_option ::= KEEP variable_list */
- { 351, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */
- { 351, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */
- { 351, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */
- { 351, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */
- { 348, -1 }, /* (120) integer_list ::= NK_INTEGER */
- { 348, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */
- { 349, -1 }, /* (122) variable_list ::= NK_VARIABLE */
- { 349, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
- { 350, -1 }, /* (124) retention_list ::= retention */
- { 350, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */
- { 352, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
- { 347, 0 }, /* (127) speed_opt ::= */
- { 347, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */
- { 328, -9 }, /* (129) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- { 328, -3 }, /* (130) cmd ::= CREATE TABLE multi_create_clause */
- { 328, -9 }, /* (131) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
- { 328, -3 }, /* (132) cmd ::= DROP TABLE multi_drop_clause */
- { 328, -4 }, /* (133) cmd ::= DROP STABLE exists_opt full_table_name */
- { 328, -3 }, /* (134) cmd ::= ALTER TABLE alter_table_clause */
- { 328, -3 }, /* (135) cmd ::= ALTER STABLE alter_table_clause */
- { 360, -2 }, /* (136) alter_table_clause ::= full_table_name alter_table_options */
- { 360, -5 }, /* (137) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
- { 360, -4 }, /* (138) alter_table_clause ::= full_table_name DROP COLUMN column_name */
- { 360, -5 }, /* (139) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
- { 360, -5 }, /* (140) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
- { 360, -5 }, /* (141) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
- { 360, -4 }, /* (142) alter_table_clause ::= full_table_name DROP TAG column_name */
- { 360, -5 }, /* (143) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
- { 360, -5 }, /* (144) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
- { 360, -6 }, /* (145) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
- { 357, -1 }, /* (146) multi_create_clause ::= create_subtable_clause */
- { 357, -2 }, /* (147) multi_create_clause ::= multi_create_clause create_subtable_clause */
- { 365, -10 }, /* (148) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */
- { 359, -1 }, /* (149) multi_drop_clause ::= drop_table_clause */
- { 359, -3 }, /* (150) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */
- { 368, -2 }, /* (151) drop_table_clause ::= exists_opt full_table_name */
- { 366, 0 }, /* (152) specific_cols_opt ::= */
- { 366, -3 }, /* (153) specific_cols_opt ::= NK_LP col_name_list NK_RP */
- { 353, -1 }, /* (154) full_table_name ::= table_name */
- { 353, -3 }, /* (155) full_table_name ::= db_name NK_DOT table_name */
- { 354, -1 }, /* (156) column_def_list ::= column_def */
- { 354, -3 }, /* (157) column_def_list ::= column_def_list NK_COMMA column_def */
- { 371, -2 }, /* (158) column_def ::= column_name type_name */
- { 371, -4 }, /* (159) column_def ::= column_name type_name COMMENT NK_STRING */
- { 363, -1 }, /* (160) type_name ::= BOOL */
- { 363, -1 }, /* (161) type_name ::= TINYINT */
- { 363, -1 }, /* (162) type_name ::= SMALLINT */
- { 363, -1 }, /* (163) type_name ::= INT */
- { 363, -1 }, /* (164) type_name ::= INTEGER */
- { 363, -1 }, /* (165) type_name ::= BIGINT */
- { 363, -1 }, /* (166) type_name ::= FLOAT */
- { 363, -1 }, /* (167) type_name ::= DOUBLE */
- { 363, -4 }, /* (168) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
- { 363, -1 }, /* (169) type_name ::= TIMESTAMP */
- { 363, -4 }, /* (170) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
- { 363, -2 }, /* (171) type_name ::= TINYINT UNSIGNED */
- { 363, -2 }, /* (172) type_name ::= SMALLINT UNSIGNED */
- { 363, -2 }, /* (173) type_name ::= INT UNSIGNED */
- { 363, -2 }, /* (174) type_name ::= BIGINT UNSIGNED */
- { 363, -1 }, /* (175) type_name ::= JSON */
- { 363, -4 }, /* (176) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
- { 363, -1 }, /* (177) type_name ::= MEDIUMBLOB */
- { 363, -1 }, /* (178) type_name ::= BLOB */
- { 363, -4 }, /* (179) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
- { 363, -1 }, /* (180) type_name ::= DECIMAL */
- { 363, -4 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
- { 363, -6 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
- { 355, 0 }, /* (183) tags_def_opt ::= */
- { 355, -1 }, /* (184) tags_def_opt ::= tags_def */
- { 358, -4 }, /* (185) tags_def ::= TAGS NK_LP column_def_list NK_RP */
- { 356, 0 }, /* (186) table_options ::= */
- { 356, -3 }, /* (187) table_options ::= table_options COMMENT NK_STRING */
- { 356, -3 }, /* (188) table_options ::= table_options MAX_DELAY duration_list */
- { 356, -3 }, /* (189) table_options ::= table_options WATERMARK duration_list */
- { 356, -5 }, /* (190) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
- { 356, -3 }, /* (191) table_options ::= table_options TTL NK_INTEGER */
- { 356, -5 }, /* (192) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
- { 356, -3 }, /* (193) table_options ::= table_options DELETE_MARK duration_list */
- { 361, -1 }, /* (194) alter_table_options ::= alter_table_option */
- { 361, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */
- { 374, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */
- { 374, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */
- { 372, -1 }, /* (198) duration_list ::= duration_literal */
- { 372, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */
- { 373, -1 }, /* (200) rollup_func_list ::= rollup_func_name */
- { 373, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
- { 376, -1 }, /* (202) rollup_func_name ::= function_name */
- { 376, -1 }, /* (203) rollup_func_name ::= FIRST */
- { 376, -1 }, /* (204) rollup_func_name ::= LAST */
- { 369, -1 }, /* (205) col_name_list ::= col_name */
- { 369, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */
- { 378, -1 }, /* (207) col_name ::= column_name */
- { 328, -2 }, /* (208) cmd ::= SHOW DNODES */
- { 328, -2 }, /* (209) cmd ::= SHOW USERS */
- { 328, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */
- { 328, -2 }, /* (211) cmd ::= SHOW DATABASES */
- { 328, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
- { 328, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
- { 328, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */
- { 328, -2 }, /* (215) cmd ::= SHOW MNODES */
- { 328, -2 }, /* (216) cmd ::= SHOW QNODES */
- { 328, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */
- { 328, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
- { 328, -2 }, /* (219) cmd ::= SHOW STREAMS */
- { 328, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */
- { 328, -2 }, /* (221) cmd ::= SHOW APPS */
- { 328, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */
- { 328, -2 }, /* (223) cmd ::= SHOW LICENCES */
- { 328, -2 }, /* (224) cmd ::= SHOW GRANTS */
- { 328, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */
- { 328, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */
- { 328, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */
- { 328, -2 }, /* (228) cmd ::= SHOW QUERIES */
- { 328, -2 }, /* (229) cmd ::= SHOW SCORES */
- { 328, -2 }, /* (230) cmd ::= SHOW TOPICS */
- { 328, -2 }, /* (231) cmd ::= SHOW VARIABLES */
- { 328, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */
- { 328, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */
- { 328, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
- { 328, -2 }, /* (235) cmd ::= SHOW BNODES */
- { 328, -2 }, /* (236) cmd ::= SHOW SNODES */
- { 328, -2 }, /* (237) cmd ::= SHOW CLUSTER */
- { 328, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */
- { 328, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
- { 328, -2 }, /* (240) cmd ::= SHOW CONSUMERS */
- { 328, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */
- { 328, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
- { 328, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
- { 328, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */
- { 328, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */
- { 328, -3 }, /* (246) cmd ::= SHOW db_name_cond_opt ALIVE */
- { 328, -3 }, /* (247) cmd ::= SHOW CLUSTER ALIVE */
- { 379, 0 }, /* (248) db_name_cond_opt ::= */
- { 379, -2 }, /* (249) db_name_cond_opt ::= db_name NK_DOT */
- { 380, 0 }, /* (250) like_pattern_opt ::= */
- { 380, -2 }, /* (251) like_pattern_opt ::= LIKE NK_STRING */
- { 381, -1 }, /* (252) table_name_cond ::= table_name */
- { 382, 0 }, /* (253) from_db_opt ::= */
- { 382, -2 }, /* (254) from_db_opt ::= FROM db_name */
- { 383, 0 }, /* (255) tag_list_opt ::= */
- { 383, -1 }, /* (256) tag_list_opt ::= tag_item */
- { 383, -3 }, /* (257) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */
- { 384, -1 }, /* (258) tag_item ::= TBNAME */
- { 384, -1 }, /* (259) tag_item ::= QTAGS */
- { 384, -1 }, /* (260) tag_item ::= column_name */
- { 384, -2 }, /* (261) tag_item ::= column_name column_alias */
- { 384, -3 }, /* (262) tag_item ::= column_name AS column_alias */
- { 328, -8 }, /* (263) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
- { 328, -9 }, /* (264) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
- { 328, -4 }, /* (265) cmd ::= DROP INDEX exists_opt full_index_name */
- { 386, -1 }, /* (266) full_index_name ::= index_name */
- { 386, -3 }, /* (267) full_index_name ::= db_name NK_DOT index_name */
- { 387, -10 }, /* (268) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
- { 387, -12 }, /* (269) 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 */
- { 389, -1 }, /* (270) func_list ::= func */
- { 389, -3 }, /* (271) func_list ::= func_list NK_COMMA func */
- { 392, -4 }, /* (272) func ::= sma_func_name NK_LP expression_list NK_RP */
- { 393, -1 }, /* (273) sma_func_name ::= function_name */
- { 393, -1 }, /* (274) sma_func_name ::= COUNT */
- { 393, -1 }, /* (275) sma_func_name ::= FIRST */
- { 393, -1 }, /* (276) sma_func_name ::= LAST */
- { 393, -1 }, /* (277) sma_func_name ::= LAST_ROW */
- { 391, 0 }, /* (278) sma_stream_opt ::= */
- { 391, -3 }, /* (279) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
- { 391, -3 }, /* (280) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
- { 391, -3 }, /* (281) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
- { 328, -6 }, /* (282) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
- { 328, -7 }, /* (283) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
- { 328, -9 }, /* (284) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
- { 328, -7 }, /* (285) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
- { 328, -9 }, /* (286) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
- { 328, -4 }, /* (287) cmd ::= DROP TOPIC exists_opt topic_name */
- { 328, -7 }, /* (288) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
- { 328, -2 }, /* (289) cmd ::= DESC full_table_name */
- { 328, -2 }, /* (290) cmd ::= DESCRIBE full_table_name */
- { 328, -3 }, /* (291) cmd ::= RESET QUERY CACHE */
- { 328, -4 }, /* (292) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
- { 328, -4 }, /* (293) cmd ::= EXPLAIN analyze_opt explain_options insert_query */
- { 396, 0 }, /* (294) analyze_opt ::= */
- { 396, -1 }, /* (295) analyze_opt ::= ANALYZE */
- { 397, 0 }, /* (296) explain_options ::= */
- { 397, -3 }, /* (297) explain_options ::= explain_options VERBOSE NK_BOOL */
- { 397, -3 }, /* (298) explain_options ::= explain_options RATIO NK_FLOAT */
- { 328, -10 }, /* (299) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
- { 328, -4 }, /* (300) cmd ::= DROP FUNCTION exists_opt function_name */
- { 399, 0 }, /* (301) agg_func_opt ::= */
- { 399, -1 }, /* (302) agg_func_opt ::= AGGREGATE */
- { 400, 0 }, /* (303) bufsize_opt ::= */
- { 400, -2 }, /* (304) bufsize_opt ::= BUFSIZE NK_INTEGER */
- { 328, -12 }, /* (305) 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 }, /* (306) cmd ::= DROP STREAM exists_opt stream_name */
- { 403, 0 }, /* (307) col_list_opt ::= */
- { 403, -3 }, /* (308) col_list_opt ::= NK_LP col_name_list NK_RP */
- { 404, 0 }, /* (309) tag_def_or_ref_opt ::= */
- { 404, -1 }, /* (310) tag_def_or_ref_opt ::= tags_def */
- { 404, -4 }, /* (311) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */
- { 402, 0 }, /* (312) stream_options ::= */
- { 402, -3 }, /* (313) stream_options ::= stream_options TRIGGER AT_ONCE */
- { 402, -3 }, /* (314) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
- { 402, -4 }, /* (315) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
- { 402, -3 }, /* (316) stream_options ::= stream_options WATERMARK duration_literal */
- { 402, -4 }, /* (317) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
- { 402, -3 }, /* (318) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
- { 402, -3 }, /* (319) stream_options ::= stream_options DELETE_MARK duration_literal */
- { 402, -4 }, /* (320) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
- { 405, 0 }, /* (321) subtable_opt ::= */
- { 405, -4 }, /* (322) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
- { 328, -3 }, /* (323) cmd ::= KILL CONNECTION NK_INTEGER */
- { 328, -3 }, /* (324) cmd ::= KILL QUERY NK_STRING */
- { 328, -3 }, /* (325) cmd ::= KILL TRANSACTION NK_INTEGER */
- { 328, -2 }, /* (326) cmd ::= BALANCE VGROUP */
- { 328, -4 }, /* (327) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
- { 328, -4 }, /* (328) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
- { 328, -3 }, /* (329) cmd ::= SPLIT VGROUP NK_INTEGER */
- { 407, -2 }, /* (330) dnode_list ::= DNODE NK_INTEGER */
- { 407, -3 }, /* (331) dnode_list ::= dnode_list DNODE NK_INTEGER */
- { 328, -4 }, /* (332) cmd ::= DELETE FROM full_table_name where_clause_opt */
- { 328, -1 }, /* (333) cmd ::= query_or_subquery */
- { 328, -1 }, /* (334) cmd ::= insert_query */
- { 398, -7 }, /* (335) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
- { 398, -4 }, /* (336) insert_query ::= INSERT INTO full_table_name query_or_subquery */
- { 331, -1 }, /* (337) literal ::= NK_INTEGER */
- { 331, -1 }, /* (338) literal ::= NK_FLOAT */
- { 331, -1 }, /* (339) literal ::= NK_STRING */
- { 331, -1 }, /* (340) literal ::= NK_BOOL */
- { 331, -2 }, /* (341) literal ::= TIMESTAMP NK_STRING */
- { 331, -1 }, /* (342) literal ::= duration_literal */
- { 331, -1 }, /* (343) literal ::= NULL */
- { 331, -1 }, /* (344) literal ::= NK_QUESTION */
- { 375, -1 }, /* (345) duration_literal ::= NK_VARIABLE */
- { 409, -1 }, /* (346) signed ::= NK_INTEGER */
- { 409, -2 }, /* (347) signed ::= NK_PLUS NK_INTEGER */
- { 409, -2 }, /* (348) signed ::= NK_MINUS NK_INTEGER */
- { 409, -1 }, /* (349) signed ::= NK_FLOAT */
- { 409, -2 }, /* (350) signed ::= NK_PLUS NK_FLOAT */
- { 409, -2 }, /* (351) signed ::= NK_MINUS NK_FLOAT */
- { 364, -1 }, /* (352) signed_literal ::= signed */
- { 364, -1 }, /* (353) signed_literal ::= NK_STRING */
- { 364, -1 }, /* (354) signed_literal ::= NK_BOOL */
- { 364, -2 }, /* (355) signed_literal ::= TIMESTAMP NK_STRING */
- { 364, -1 }, /* (356) signed_literal ::= duration_literal */
- { 364, -1 }, /* (357) signed_literal ::= NULL */
- { 364, -1 }, /* (358) signed_literal ::= literal_func */
- { 364, -1 }, /* (359) signed_literal ::= NK_QUESTION */
- { 411, -1 }, /* (360) literal_list ::= signed_literal */
- { 411, -3 }, /* (361) literal_list ::= literal_list NK_COMMA signed_literal */
- { 339, -1 }, /* (362) db_name ::= NK_ID */
- { 370, -1 }, /* (363) table_name ::= NK_ID */
- { 362, -1 }, /* (364) column_name ::= NK_ID */
- { 377, -1 }, /* (365) function_name ::= NK_ID */
- { 412, -1 }, /* (366) table_alias ::= NK_ID */
- { 385, -1 }, /* (367) column_alias ::= NK_ID */
- { 333, -1 }, /* (368) user_name ::= NK_ID */
- { 340, -1 }, /* (369) topic_name ::= NK_ID */
- { 401, -1 }, /* (370) stream_name ::= NK_ID */
- { 395, -1 }, /* (371) cgroup_name ::= NK_ID */
- { 388, -1 }, /* (372) index_name ::= NK_ID */
- { 413, -1 }, /* (373) expr_or_subquery ::= expression */
- { 406, -1 }, /* (374) expression ::= literal */
- { 406, -1 }, /* (375) expression ::= pseudo_column */
- { 406, -1 }, /* (376) expression ::= column_reference */
- { 406, -1 }, /* (377) expression ::= function_expression */
- { 406, -1 }, /* (378) expression ::= case_when_expression */
- { 406, -3 }, /* (379) expression ::= NK_LP expression NK_RP */
- { 406, -2 }, /* (380) expression ::= NK_PLUS expr_or_subquery */
- { 406, -2 }, /* (381) expression ::= NK_MINUS expr_or_subquery */
- { 406, -3 }, /* (382) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
- { 406, -3 }, /* (383) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
- { 406, -3 }, /* (384) expression ::= expr_or_subquery NK_STAR expr_or_subquery */
- { 406, -3 }, /* (385) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
- { 406, -3 }, /* (386) expression ::= expr_or_subquery NK_REM expr_or_subquery */
- { 406, -3 }, /* (387) expression ::= column_reference NK_ARROW NK_STRING */
- { 406, -3 }, /* (388) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
- { 406, -3 }, /* (389) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
- { 367, -1 }, /* (390) expression_list ::= expr_or_subquery */
- { 367, -3 }, /* (391) expression_list ::= expression_list NK_COMMA expr_or_subquery */
- { 415, -1 }, /* (392) column_reference ::= column_name */
- { 415, -3 }, /* (393) column_reference ::= table_name NK_DOT column_name */
- { 414, -1 }, /* (394) pseudo_column ::= ROWTS */
- { 414, -1 }, /* (395) pseudo_column ::= TBNAME */
- { 414, -3 }, /* (396) pseudo_column ::= table_name NK_DOT TBNAME */
- { 414, -1 }, /* (397) pseudo_column ::= QSTART */
- { 414, -1 }, /* (398) pseudo_column ::= QEND */
- { 414, -1 }, /* (399) pseudo_column ::= QDURATION */
- { 414, -1 }, /* (400) pseudo_column ::= WSTART */
- { 414, -1 }, /* (401) pseudo_column ::= WEND */
- { 414, -1 }, /* (402) pseudo_column ::= WDURATION */
- { 414, -1 }, /* (403) pseudo_column ::= IROWTS */
- { 414, -1 }, /* (404) pseudo_column ::= ISFILLED */
- { 414, -1 }, /* (405) pseudo_column ::= QTAGS */
- { 416, -4 }, /* (406) function_expression ::= function_name NK_LP expression_list NK_RP */
- { 416, -4 }, /* (407) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
- { 416, -6 }, /* (408) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
- { 416, -1 }, /* (409) function_expression ::= literal_func */
- { 410, -3 }, /* (410) literal_func ::= noarg_func NK_LP NK_RP */
- { 410, -1 }, /* (411) literal_func ::= NOW */
- { 420, -1 }, /* (412) noarg_func ::= NOW */
- { 420, -1 }, /* (413) noarg_func ::= TODAY */
- { 420, -1 }, /* (414) noarg_func ::= TIMEZONE */
- { 420, -1 }, /* (415) noarg_func ::= DATABASE */
- { 420, -1 }, /* (416) noarg_func ::= CLIENT_VERSION */
- { 420, -1 }, /* (417) noarg_func ::= SERVER_VERSION */
- { 420, -1 }, /* (418) noarg_func ::= SERVER_STATUS */
- { 420, -1 }, /* (419) noarg_func ::= CURRENT_USER */
- { 420, -1 }, /* (420) noarg_func ::= USER */
- { 418, -1 }, /* (421) star_func ::= COUNT */
- { 418, -1 }, /* (422) star_func ::= FIRST */
- { 418, -1 }, /* (423) star_func ::= LAST */
- { 418, -1 }, /* (424) star_func ::= LAST_ROW */
- { 419, -1 }, /* (425) star_func_para_list ::= NK_STAR */
- { 419, -1 }, /* (426) star_func_para_list ::= other_para_list */
- { 421, -1 }, /* (427) other_para_list ::= star_func_para */
- { 421, -3 }, /* (428) other_para_list ::= other_para_list NK_COMMA star_func_para */
- { 422, -1 }, /* (429) star_func_para ::= expr_or_subquery */
- { 422, -3 }, /* (430) star_func_para ::= table_name NK_DOT NK_STAR */
- { 417, -4 }, /* (431) case_when_expression ::= CASE when_then_list case_when_else_opt END */
- { 417, -5 }, /* (432) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
- { 423, -1 }, /* (433) when_then_list ::= when_then_expr */
- { 423, -2 }, /* (434) when_then_list ::= when_then_list when_then_expr */
- { 426, -4 }, /* (435) when_then_expr ::= WHEN common_expression THEN common_expression */
- { 424, 0 }, /* (436) case_when_else_opt ::= */
- { 424, -2 }, /* (437) case_when_else_opt ::= ELSE common_expression */
- { 427, -3 }, /* (438) predicate ::= expr_or_subquery compare_op expr_or_subquery */
- { 427, -5 }, /* (439) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
- { 427, -6 }, /* (440) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
- { 427, -3 }, /* (441) predicate ::= expr_or_subquery IS NULL */
- { 427, -4 }, /* (442) predicate ::= expr_or_subquery IS NOT NULL */
- { 427, -3 }, /* (443) predicate ::= expr_or_subquery in_op in_predicate_value */
- { 428, -1 }, /* (444) compare_op ::= NK_LT */
- { 428, -1 }, /* (445) compare_op ::= NK_GT */
- { 428, -1 }, /* (446) compare_op ::= NK_LE */
- { 428, -1 }, /* (447) compare_op ::= NK_GE */
- { 428, -1 }, /* (448) compare_op ::= NK_NE */
- { 428, -1 }, /* (449) compare_op ::= NK_EQ */
- { 428, -1 }, /* (450) compare_op ::= LIKE */
- { 428, -2 }, /* (451) compare_op ::= NOT LIKE */
- { 428, -1 }, /* (452) compare_op ::= MATCH */
- { 428, -1 }, /* (453) compare_op ::= NMATCH */
- { 428, -1 }, /* (454) compare_op ::= CONTAINS */
- { 429, -1 }, /* (455) in_op ::= IN */
- { 429, -2 }, /* (456) in_op ::= NOT IN */
- { 430, -3 }, /* (457) in_predicate_value ::= NK_LP literal_list NK_RP */
- { 431, -1 }, /* (458) boolean_value_expression ::= boolean_primary */
- { 431, -2 }, /* (459) boolean_value_expression ::= NOT boolean_primary */
- { 431, -3 }, /* (460) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
- { 431, -3 }, /* (461) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
- { 432, -1 }, /* (462) boolean_primary ::= predicate */
- { 432, -3 }, /* (463) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
- { 425, -1 }, /* (464) common_expression ::= expr_or_subquery */
- { 425, -1 }, /* (465) common_expression ::= boolean_value_expression */
- { 433, 0 }, /* (466) from_clause_opt ::= */
- { 433, -2 }, /* (467) from_clause_opt ::= FROM table_reference_list */
- { 434, -1 }, /* (468) table_reference_list ::= table_reference */
- { 434, -3 }, /* (469) table_reference_list ::= table_reference_list NK_COMMA table_reference */
- { 435, -1 }, /* (470) table_reference ::= table_primary */
- { 435, -1 }, /* (471) table_reference ::= joined_table */
- { 436, -2 }, /* (472) table_primary ::= table_name alias_opt */
- { 436, -4 }, /* (473) table_primary ::= db_name NK_DOT table_name alias_opt */
- { 436, -2 }, /* (474) table_primary ::= subquery alias_opt */
- { 436, -1 }, /* (475) table_primary ::= parenthesized_joined_table */
- { 438, 0 }, /* (476) alias_opt ::= */
- { 438, -1 }, /* (477) alias_opt ::= table_alias */
- { 438, -2 }, /* (478) alias_opt ::= AS table_alias */
- { 440, -3 }, /* (479) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- { 440, -3 }, /* (480) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
- { 437, -6 }, /* (481) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
- { 441, 0 }, /* (482) join_type ::= */
- { 441, -1 }, /* (483) join_type ::= INNER */
- { 443, -12 }, /* (484) 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 */
- { 444, 0 }, /* (485) set_quantifier_opt ::= */
- { 444, -1 }, /* (486) set_quantifier_opt ::= DISTINCT */
- { 444, -1 }, /* (487) set_quantifier_opt ::= ALL */
- { 445, -1 }, /* (488) select_list ::= select_item */
- { 445, -3 }, /* (489) select_list ::= select_list NK_COMMA select_item */
- { 453, -1 }, /* (490) select_item ::= NK_STAR */
- { 453, -1 }, /* (491) select_item ::= common_expression */
- { 453, -2 }, /* (492) select_item ::= common_expression column_alias */
- { 453, -3 }, /* (493) select_item ::= common_expression AS column_alias */
- { 453, -3 }, /* (494) select_item ::= table_name NK_DOT NK_STAR */
- { 408, 0 }, /* (495) where_clause_opt ::= */
- { 408, -2 }, /* (496) where_clause_opt ::= WHERE search_condition */
- { 446, 0 }, /* (497) partition_by_clause_opt ::= */
- { 446, -3 }, /* (498) partition_by_clause_opt ::= PARTITION BY partition_list */
- { 454, -1 }, /* (499) partition_list ::= partition_item */
- { 454, -3 }, /* (500) partition_list ::= partition_list NK_COMMA partition_item */
- { 455, -1 }, /* (501) partition_item ::= expr_or_subquery */
- { 455, -2 }, /* (502) partition_item ::= expr_or_subquery column_alias */
- { 455, -3 }, /* (503) partition_item ::= expr_or_subquery AS column_alias */
- { 450, 0 }, /* (504) twindow_clause_opt ::= */
- { 450, -6 }, /* (505) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
- { 450, -4 }, /* (506) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
- { 450, -6 }, /* (507) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
- { 450, -8 }, /* (508) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
- { 450, -7 }, /* (509) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
- { 390, 0 }, /* (510) sliding_opt ::= */
- { 390, -4 }, /* (511) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
- { 449, 0 }, /* (512) fill_opt ::= */
- { 449, -4 }, /* (513) fill_opt ::= FILL NK_LP fill_mode NK_RP */
- { 449, -6 }, /* (514) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
- { 449, -6 }, /* (515) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
- { 456, -1 }, /* (516) fill_mode ::= NONE */
- { 456, -1 }, /* (517) fill_mode ::= PREV */
- { 456, -1 }, /* (518) fill_mode ::= NULL */
- { 456, -1 }, /* (519) fill_mode ::= NULL_F */
- { 456, -1 }, /* (520) fill_mode ::= LINEAR */
- { 456, -1 }, /* (521) fill_mode ::= NEXT */
- { 451, 0 }, /* (522) group_by_clause_opt ::= */
- { 451, -3 }, /* (523) group_by_clause_opt ::= GROUP BY group_by_list */
- { 457, -1 }, /* (524) group_by_list ::= expr_or_subquery */
- { 457, -3 }, /* (525) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
- { 452, 0 }, /* (526) having_clause_opt ::= */
- { 452, -2 }, /* (527) having_clause_opt ::= HAVING search_condition */
- { 447, 0 }, /* (528) range_opt ::= */
- { 447, -6 }, /* (529) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
- { 448, 0 }, /* (530) every_opt ::= */
- { 448, -4 }, /* (531) every_opt ::= EVERY NK_LP duration_literal NK_RP */
- { 458, -4 }, /* (532) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
- { 459, -1 }, /* (533) query_simple ::= query_specification */
- { 459, -1 }, /* (534) query_simple ::= union_query_expression */
- { 463, -4 }, /* (535) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
- { 463, -3 }, /* (536) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
- { 464, -1 }, /* (537) query_simple_or_subquery ::= query_simple */
- { 464, -1 }, /* (538) query_simple_or_subquery ::= subquery */
- { 394, -1 }, /* (539) query_or_subquery ::= query_expression */
- { 394, -1 }, /* (540) query_or_subquery ::= subquery */
- { 460, 0 }, /* (541) order_by_clause_opt ::= */
- { 460, -3 }, /* (542) order_by_clause_opt ::= ORDER BY sort_specification_list */
- { 461, 0 }, /* (543) slimit_clause_opt ::= */
- { 461, -2 }, /* (544) slimit_clause_opt ::= SLIMIT NK_INTEGER */
- { 461, -4 }, /* (545) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- { 461, -4 }, /* (546) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 462, 0 }, /* (547) limit_clause_opt ::= */
- { 462, -2 }, /* (548) limit_clause_opt ::= LIMIT NK_INTEGER */
- { 462, -4 }, /* (549) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
- { 462, -4 }, /* (550) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 439, -3 }, /* (551) subquery ::= NK_LP query_expression NK_RP */
- { 439, -3 }, /* (552) subquery ::= NK_LP subquery NK_RP */
- { 442, -1 }, /* (553) search_condition ::= common_expression */
- { 465, -1 }, /* (554) sort_specification_list ::= sort_specification */
- { 465, -3 }, /* (555) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
- { 466, -3 }, /* (556) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
- { 467, 0 }, /* (557) ordering_specification_opt ::= */
- { 467, -1 }, /* (558) ordering_specification_opt ::= ASC */
- { 467, -1 }, /* (559) ordering_specification_opt ::= DESC */
- { 468, 0 }, /* (560) null_ordering_opt ::= */
- { 468, -2 }, /* (561) null_ordering_opt ::= NULLS FIRST */
- { 468, -2 }, /* (562) null_ordering_opt ::= NULLS LAST */
+ { 329, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
+ { 329, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+ { 330, 0 }, /* (2) account_options ::= */
+ { 330, -3 }, /* (3) account_options ::= account_options PPS literal */
+ { 330, -3 }, /* (4) account_options ::= account_options TSERIES literal */
+ { 330, -3 }, /* (5) account_options ::= account_options STORAGE literal */
+ { 330, -3 }, /* (6) account_options ::= account_options STREAMS literal */
+ { 330, -3 }, /* (7) account_options ::= account_options QTIME literal */
+ { 330, -3 }, /* (8) account_options ::= account_options DBS literal */
+ { 330, -3 }, /* (9) account_options ::= account_options USERS literal */
+ { 330, -3 }, /* (10) account_options ::= account_options CONNS literal */
+ { 330, -3 }, /* (11) account_options ::= account_options STATE literal */
+ { 331, -1 }, /* (12) alter_account_options ::= alter_account_option */
+ { 331, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
+ { 333, -2 }, /* (14) alter_account_option ::= PASS literal */
+ { 333, -2 }, /* (15) alter_account_option ::= PPS literal */
+ { 333, -2 }, /* (16) alter_account_option ::= TSERIES literal */
+ { 333, -2 }, /* (17) alter_account_option ::= STORAGE literal */
+ { 333, -2 }, /* (18) alter_account_option ::= STREAMS literal */
+ { 333, -2 }, /* (19) alter_account_option ::= QTIME literal */
+ { 333, -2 }, /* (20) alter_account_option ::= DBS literal */
+ { 333, -2 }, /* (21) alter_account_option ::= USERS literal */
+ { 333, -2 }, /* (22) alter_account_option ::= CONNS literal */
+ { 333, -2 }, /* (23) alter_account_option ::= STATE literal */
+ { 329, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
+ { 329, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
+ { 329, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
+ { 329, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
+ { 329, -3 }, /* (28) cmd ::= DROP USER user_name */
+ { 335, 0 }, /* (29) sysinfo_opt ::= */
+ { 335, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
+ { 329, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
+ { 329, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
+ { 336, -1 }, /* (33) privileges ::= ALL */
+ { 336, -1 }, /* (34) privileges ::= priv_type_list */
+ { 336, -1 }, /* (35) privileges ::= SUBSCRIBE */
+ { 338, -1 }, /* (36) priv_type_list ::= priv_type */
+ { 338, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */
+ { 339, -1 }, /* (38) priv_type ::= READ */
+ { 339, -1 }, /* (39) priv_type ::= WRITE */
+ { 337, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */
+ { 337, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */
+ { 337, -1 }, /* (42) priv_level ::= topic_name */
+ { 329, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */
+ { 329, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
+ { 329, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */
+ { 329, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */
+ { 329, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
+ { 329, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
+ { 329, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */
+ { 329, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
+ { 342, -1 }, /* (51) dnode_endpoint ::= NK_STRING */
+ { 342, -1 }, /* (52) dnode_endpoint ::= NK_ID */
+ { 342, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */
+ { 343, 0 }, /* (54) force_opt ::= */
+ { 343, -1 }, /* (55) force_opt ::= FORCE */
+ { 329, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */
+ { 329, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+ { 329, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
+ { 329, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+ { 329, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */
+ { 329, -2 }, /* (68) cmd ::= USE db_name */
+ { 329, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */
+ { 329, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */
+ { 329, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */
+ { 329, -5 }, /* (72) cmd ::= COMPACT DATABASE db_name start_opt end_opt */
+ { 344, -3 }, /* (73) not_exists_opt ::= IF NOT EXISTS */
+ { 344, 0 }, /* (74) not_exists_opt ::= */
+ { 346, -2 }, /* (75) exists_opt ::= IF EXISTS */
+ { 346, 0 }, /* (76) exists_opt ::= */
+ { 345, 0 }, /* (77) db_options ::= */
+ { 345, -3 }, /* (78) db_options ::= db_options BUFFER NK_INTEGER */
+ { 345, -3 }, /* (79) db_options ::= db_options CACHEMODEL NK_STRING */
+ { 345, -3 }, /* (80) db_options ::= db_options CACHESIZE NK_INTEGER */
+ { 345, -3 }, /* (81) db_options ::= db_options COMP NK_INTEGER */
+ { 345, -3 }, /* (82) db_options ::= db_options DURATION NK_INTEGER */
+ { 345, -3 }, /* (83) db_options ::= db_options DURATION NK_VARIABLE */
+ { 345, -3 }, /* (84) db_options ::= db_options MAXROWS NK_INTEGER */
+ { 345, -3 }, /* (85) db_options ::= db_options MINROWS NK_INTEGER */
+ { 345, -3 }, /* (86) db_options ::= db_options KEEP integer_list */
+ { 345, -3 }, /* (87) db_options ::= db_options KEEP variable_list */
+ { 345, -3 }, /* (88) db_options ::= db_options PAGES NK_INTEGER */
+ { 345, -3 }, /* (89) db_options ::= db_options PAGESIZE NK_INTEGER */
+ { 345, -3 }, /* (90) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
+ { 345, -3 }, /* (91) db_options ::= db_options PRECISION NK_STRING */
+ { 345, -3 }, /* (92) db_options ::= db_options REPLICA NK_INTEGER */
+ { 345, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */
+ { 345, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+ { 345, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */
+ { 345, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */
+ { 345, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */
+ { 345, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
+ { 345, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
+ { 345, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+ { 345, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
+ { 345, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+ { 345, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
+ { 345, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
+ { 345, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */
+ { 345, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */
+ { 345, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
+ { 347, -1 }, /* (108) alter_db_options ::= alter_db_option */
+ { 347, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */
+ { 354, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */
+ { 354, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */
+ { 354, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */
+ { 354, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
+ { 354, -2 }, /* (114) alter_db_option ::= KEEP integer_list */
+ { 354, -2 }, /* (115) alter_db_option ::= KEEP variable_list */
+ { 354, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */
+ { 354, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */
+ { 354, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */
+ { 354, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */
+ { 351, -1 }, /* (120) integer_list ::= NK_INTEGER */
+ { 351, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */
+ { 352, -1 }, /* (122) variable_list ::= NK_VARIABLE */
+ { 352, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+ { 353, -1 }, /* (124) retention_list ::= retention */
+ { 353, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */
+ { 355, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
+ { 348, 0 }, /* (127) speed_opt ::= */
+ { 348, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */
+ { 349, 0 }, /* (129) start_opt ::= */
+ { 349, -3 }, /* (130) start_opt ::= START WITH NK_INTEGER */
+ { 349, -3 }, /* (131) start_opt ::= START WITH NK_STRING */
+ { 349, -4 }, /* (132) start_opt ::= START WITH TIMESTAMP NK_STRING */
+ { 350, 0 }, /* (133) end_opt ::= */
+ { 350, -3 }, /* (134) end_opt ::= END WITH NK_INTEGER */
+ { 350, -3 }, /* (135) end_opt ::= END WITH NK_STRING */
+ { 350, -4 }, /* (136) end_opt ::= END WITH TIMESTAMP NK_STRING */
+ { 329, -9 }, /* (137) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ { 329, -3 }, /* (138) cmd ::= CREATE TABLE multi_create_clause */
+ { 329, -9 }, /* (139) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
+ { 329, -3 }, /* (140) cmd ::= DROP TABLE multi_drop_clause */
+ { 329, -4 }, /* (141) cmd ::= DROP STABLE exists_opt full_table_name */
+ { 329, -3 }, /* (142) cmd ::= ALTER TABLE alter_table_clause */
+ { 329, -3 }, /* (143) cmd ::= ALTER STABLE alter_table_clause */
+ { 363, -2 }, /* (144) alter_table_clause ::= full_table_name alter_table_options */
+ { 363, -5 }, /* (145) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+ { 363, -4 }, /* (146) alter_table_clause ::= full_table_name DROP COLUMN column_name */
+ { 363, -5 }, /* (147) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+ { 363, -5 }, /* (148) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+ { 363, -5 }, /* (149) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+ { 363, -4 }, /* (150) alter_table_clause ::= full_table_name DROP TAG column_name */
+ { 363, -5 }, /* (151) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+ { 363, -5 }, /* (152) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+ { 363, -6 }, /* (153) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+ { 360, -1 }, /* (154) multi_create_clause ::= create_subtable_clause */
+ { 360, -2 }, /* (155) multi_create_clause ::= multi_create_clause create_subtable_clause */
+ { 368, -10 }, /* (156) 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 */
+ { 362, -1 }, /* (157) multi_drop_clause ::= drop_table_clause */
+ { 362, -3 }, /* (158) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */
+ { 371, -2 }, /* (159) drop_table_clause ::= exists_opt full_table_name */
+ { 369, 0 }, /* (160) specific_cols_opt ::= */
+ { 369, -3 }, /* (161) specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ { 356, -1 }, /* (162) full_table_name ::= table_name */
+ { 356, -3 }, /* (163) full_table_name ::= db_name NK_DOT table_name */
+ { 357, -1 }, /* (164) column_def_list ::= column_def */
+ { 357, -3 }, /* (165) column_def_list ::= column_def_list NK_COMMA column_def */
+ { 374, -2 }, /* (166) column_def ::= column_name type_name */
+ { 374, -4 }, /* (167) column_def ::= column_name type_name COMMENT NK_STRING */
+ { 366, -1 }, /* (168) type_name ::= BOOL */
+ { 366, -1 }, /* (169) type_name ::= TINYINT */
+ { 366, -1 }, /* (170) type_name ::= SMALLINT */
+ { 366, -1 }, /* (171) type_name ::= INT */
+ { 366, -1 }, /* (172) type_name ::= INTEGER */
+ { 366, -1 }, /* (173) type_name ::= BIGINT */
+ { 366, -1 }, /* (174) type_name ::= FLOAT */
+ { 366, -1 }, /* (175) type_name ::= DOUBLE */
+ { 366, -4 }, /* (176) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+ { 366, -1 }, /* (177) type_name ::= TIMESTAMP */
+ { 366, -4 }, /* (178) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+ { 366, -2 }, /* (179) type_name ::= TINYINT UNSIGNED */
+ { 366, -2 }, /* (180) type_name ::= SMALLINT UNSIGNED */
+ { 366, -2 }, /* (181) type_name ::= INT UNSIGNED */
+ { 366, -2 }, /* (182) type_name ::= BIGINT UNSIGNED */
+ { 366, -1 }, /* (183) type_name ::= JSON */
+ { 366, -4 }, /* (184) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+ { 366, -1 }, /* (185) type_name ::= MEDIUMBLOB */
+ { 366, -1 }, /* (186) type_name ::= BLOB */
+ { 366, -4 }, /* (187) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+ { 366, -1 }, /* (188) type_name ::= DECIMAL */
+ { 366, -4 }, /* (189) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+ { 366, -6 }, /* (190) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+ { 358, 0 }, /* (191) tags_def_opt ::= */
+ { 358, -1 }, /* (192) tags_def_opt ::= tags_def */
+ { 361, -4 }, /* (193) tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ { 359, 0 }, /* (194) table_options ::= */
+ { 359, -3 }, /* (195) table_options ::= table_options COMMENT NK_STRING */
+ { 359, -3 }, /* (196) table_options ::= table_options MAX_DELAY duration_list */
+ { 359, -3 }, /* (197) table_options ::= table_options WATERMARK duration_list */
+ { 359, -5 }, /* (198) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+ { 359, -3 }, /* (199) table_options ::= table_options TTL NK_INTEGER */
+ { 359, -5 }, /* (200) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+ { 359, -3 }, /* (201) table_options ::= table_options DELETE_MARK duration_list */
+ { 364, -1 }, /* (202) alter_table_options ::= alter_table_option */
+ { 364, -2 }, /* (203) alter_table_options ::= alter_table_options alter_table_option */
+ { 377, -2 }, /* (204) alter_table_option ::= COMMENT NK_STRING */
+ { 377, -2 }, /* (205) alter_table_option ::= TTL NK_INTEGER */
+ { 375, -1 }, /* (206) duration_list ::= duration_literal */
+ { 375, -3 }, /* (207) duration_list ::= duration_list NK_COMMA duration_literal */
+ { 376, -1 }, /* (208) rollup_func_list ::= rollup_func_name */
+ { 376, -3 }, /* (209) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
+ { 379, -1 }, /* (210) rollup_func_name ::= function_name */
+ { 379, -1 }, /* (211) rollup_func_name ::= FIRST */
+ { 379, -1 }, /* (212) rollup_func_name ::= LAST */
+ { 372, -1 }, /* (213) col_name_list ::= col_name */
+ { 372, -3 }, /* (214) col_name_list ::= col_name_list NK_COMMA col_name */
+ { 381, -1 }, /* (215) col_name ::= column_name */
+ { 329, -2 }, /* (216) cmd ::= SHOW DNODES */
+ { 329, -2 }, /* (217) cmd ::= SHOW USERS */
+ { 329, -3 }, /* (218) cmd ::= SHOW USER PRIVILEGES */
+ { 329, -2 }, /* (219) cmd ::= SHOW DATABASES */
+ { 329, -4 }, /* (220) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
+ { 329, -4 }, /* (221) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+ { 329, -3 }, /* (222) cmd ::= SHOW db_name_cond_opt VGROUPS */
+ { 329, -2 }, /* (223) cmd ::= SHOW MNODES */
+ { 329, -2 }, /* (224) cmd ::= SHOW QNODES */
+ { 329, -2 }, /* (225) cmd ::= SHOW FUNCTIONS */
+ { 329, -5 }, /* (226) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+ { 329, -2 }, /* (227) cmd ::= SHOW STREAMS */
+ { 329, -2 }, /* (228) cmd ::= SHOW ACCOUNTS */
+ { 329, -2 }, /* (229) cmd ::= SHOW APPS */
+ { 329, -2 }, /* (230) cmd ::= SHOW CONNECTIONS */
+ { 329, -2 }, /* (231) cmd ::= SHOW LICENCES */
+ { 329, -2 }, /* (232) cmd ::= SHOW GRANTS */
+ { 329, -4 }, /* (233) cmd ::= SHOW CREATE DATABASE db_name */
+ { 329, -4 }, /* (234) cmd ::= SHOW CREATE TABLE full_table_name */
+ { 329, -4 }, /* (235) cmd ::= SHOW CREATE STABLE full_table_name */
+ { 329, -2 }, /* (236) cmd ::= SHOW QUERIES */
+ { 329, -2 }, /* (237) cmd ::= SHOW SCORES */
+ { 329, -2 }, /* (238) cmd ::= SHOW TOPICS */
+ { 329, -2 }, /* (239) cmd ::= SHOW VARIABLES */
+ { 329, -3 }, /* (240) cmd ::= SHOW CLUSTER VARIABLES */
+ { 329, -3 }, /* (241) cmd ::= SHOW LOCAL VARIABLES */
+ { 329, -5 }, /* (242) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
+ { 329, -2 }, /* (243) cmd ::= SHOW BNODES */
+ { 329, -2 }, /* (244) cmd ::= SHOW SNODES */
+ { 329, -2 }, /* (245) cmd ::= SHOW CLUSTER */
+ { 329, -2 }, /* (246) cmd ::= SHOW TRANSACTIONS */
+ { 329, -4 }, /* (247) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+ { 329, -2 }, /* (248) cmd ::= SHOW CONSUMERS */
+ { 329, -2 }, /* (249) cmd ::= SHOW SUBSCRIPTIONS */
+ { 329, -5 }, /* (250) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+ { 329, -7 }, /* (251) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+ { 329, -3 }, /* (252) cmd ::= SHOW VNODES NK_INTEGER */
+ { 329, -3 }, /* (253) cmd ::= SHOW VNODES NK_STRING */
+ { 329, -3 }, /* (254) cmd ::= SHOW db_name_cond_opt ALIVE */
+ { 329, -3 }, /* (255) cmd ::= SHOW CLUSTER ALIVE */
+ { 382, 0 }, /* (256) db_name_cond_opt ::= */
+ { 382, -2 }, /* (257) db_name_cond_opt ::= db_name NK_DOT */
+ { 383, 0 }, /* (258) like_pattern_opt ::= */
+ { 383, -2 }, /* (259) like_pattern_opt ::= LIKE NK_STRING */
+ { 384, -1 }, /* (260) table_name_cond ::= table_name */
+ { 385, 0 }, /* (261) from_db_opt ::= */
+ { 385, -2 }, /* (262) from_db_opt ::= FROM db_name */
+ { 386, 0 }, /* (263) tag_list_opt ::= */
+ { 386, -1 }, /* (264) tag_list_opt ::= tag_item */
+ { 386, -3 }, /* (265) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */
+ { 387, -1 }, /* (266) tag_item ::= TBNAME */
+ { 387, -1 }, /* (267) tag_item ::= QTAGS */
+ { 387, -1 }, /* (268) tag_item ::= column_name */
+ { 387, -2 }, /* (269) tag_item ::= column_name column_alias */
+ { 387, -3 }, /* (270) tag_item ::= column_name AS column_alias */
+ { 329, -8 }, /* (271) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
+ { 329, -9 }, /* (272) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
+ { 329, -4 }, /* (273) cmd ::= DROP INDEX exists_opt full_index_name */
+ { 389, -1 }, /* (274) full_index_name ::= index_name */
+ { 389, -3 }, /* (275) full_index_name ::= db_name NK_DOT index_name */
+ { 390, -10 }, /* (276) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+ { 390, -12 }, /* (277) 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 */
+ { 392, -1 }, /* (278) func_list ::= func */
+ { 392, -3 }, /* (279) func_list ::= func_list NK_COMMA func */
+ { 395, -4 }, /* (280) func ::= sma_func_name NK_LP expression_list NK_RP */
+ { 396, -1 }, /* (281) sma_func_name ::= function_name */
+ { 396, -1 }, /* (282) sma_func_name ::= COUNT */
+ { 396, -1 }, /* (283) sma_func_name ::= FIRST */
+ { 396, -1 }, /* (284) sma_func_name ::= LAST */
+ { 396, -1 }, /* (285) sma_func_name ::= LAST_ROW */
+ { 394, 0 }, /* (286) sma_stream_opt ::= */
+ { 394, -3 }, /* (287) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+ { 394, -3 }, /* (288) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+ { 394, -3 }, /* (289) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+ { 329, -6 }, /* (290) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+ { 329, -7 }, /* (291) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
+ { 329, -9 }, /* (292) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
+ { 329, -7 }, /* (293) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
+ { 329, -9 }, /* (294) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
+ { 329, -4 }, /* (295) cmd ::= DROP TOPIC exists_opt topic_name */
+ { 329, -7 }, /* (296) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+ { 329, -2 }, /* (297) cmd ::= DESC full_table_name */
+ { 329, -2 }, /* (298) cmd ::= DESCRIBE full_table_name */
+ { 329, -3 }, /* (299) cmd ::= RESET QUERY CACHE */
+ { 329, -4 }, /* (300) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
+ { 329, -4 }, /* (301) cmd ::= EXPLAIN analyze_opt explain_options insert_query */
+ { 399, 0 }, /* (302) analyze_opt ::= */
+ { 399, -1 }, /* (303) analyze_opt ::= ANALYZE */
+ { 400, 0 }, /* (304) explain_options ::= */
+ { 400, -3 }, /* (305) explain_options ::= explain_options VERBOSE NK_BOOL */
+ { 400, -3 }, /* (306) explain_options ::= explain_options RATIO NK_FLOAT */
+ { 329, -11 }, /* (307) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */
+ { 329, -4 }, /* (308) cmd ::= DROP FUNCTION exists_opt function_name */
+ { 402, 0 }, /* (309) agg_func_opt ::= */
+ { 402, -1 }, /* (310) agg_func_opt ::= AGGREGATE */
+ { 403, 0 }, /* (311) bufsize_opt ::= */
+ { 403, -2 }, /* (312) bufsize_opt ::= BUFSIZE NK_INTEGER */
+ { 404, 0 }, /* (313) language_opt ::= */
+ { 404, -2 }, /* (314) language_opt ::= LANGUAGE NK_STRING */
+ { 329, -12 }, /* (315) 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 */
+ { 329, -4 }, /* (316) cmd ::= DROP STREAM exists_opt stream_name */
+ { 407, 0 }, /* (317) col_list_opt ::= */
+ { 407, -3 }, /* (318) col_list_opt ::= NK_LP col_name_list NK_RP */
+ { 408, 0 }, /* (319) tag_def_or_ref_opt ::= */
+ { 408, -1 }, /* (320) tag_def_or_ref_opt ::= tags_def */
+ { 408, -4 }, /* (321) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */
+ { 406, 0 }, /* (322) stream_options ::= */
+ { 406, -3 }, /* (323) stream_options ::= stream_options TRIGGER AT_ONCE */
+ { 406, -3 }, /* (324) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
+ { 406, -4 }, /* (325) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+ { 406, -3 }, /* (326) stream_options ::= stream_options WATERMARK duration_literal */
+ { 406, -4 }, /* (327) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+ { 406, -3 }, /* (328) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+ { 406, -3 }, /* (329) stream_options ::= stream_options DELETE_MARK duration_literal */
+ { 406, -4 }, /* (330) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+ { 409, 0 }, /* (331) subtable_opt ::= */
+ { 409, -4 }, /* (332) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
+ { 329, -3 }, /* (333) cmd ::= KILL CONNECTION NK_INTEGER */
+ { 329, -3 }, /* (334) cmd ::= KILL QUERY NK_STRING */
+ { 329, -3 }, /* (335) cmd ::= KILL TRANSACTION NK_INTEGER */
+ { 329, -2 }, /* (336) cmd ::= BALANCE VGROUP */
+ { 329, -4 }, /* (337) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+ { 329, -4 }, /* (338) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+ { 329, -3 }, /* (339) cmd ::= SPLIT VGROUP NK_INTEGER */
+ { 411, -2 }, /* (340) dnode_list ::= DNODE NK_INTEGER */
+ { 411, -3 }, /* (341) dnode_list ::= dnode_list DNODE NK_INTEGER */
+ { 329, -4 }, /* (342) cmd ::= DELETE FROM full_table_name where_clause_opt */
+ { 329, -1 }, /* (343) cmd ::= query_or_subquery */
+ { 329, -1 }, /* (344) cmd ::= insert_query */
+ { 401, -7 }, /* (345) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+ { 401, -4 }, /* (346) insert_query ::= INSERT INTO full_table_name query_or_subquery */
+ { 332, -1 }, /* (347) literal ::= NK_INTEGER */
+ { 332, -1 }, /* (348) literal ::= NK_FLOAT */
+ { 332, -1 }, /* (349) literal ::= NK_STRING */
+ { 332, -1 }, /* (350) literal ::= NK_BOOL */
+ { 332, -2 }, /* (351) literal ::= TIMESTAMP NK_STRING */
+ { 332, -1 }, /* (352) literal ::= duration_literal */
+ { 332, -1 }, /* (353) literal ::= NULL */
+ { 332, -1 }, /* (354) literal ::= NK_QUESTION */
+ { 378, -1 }, /* (355) duration_literal ::= NK_VARIABLE */
+ { 413, -1 }, /* (356) signed ::= NK_INTEGER */
+ { 413, -2 }, /* (357) signed ::= NK_PLUS NK_INTEGER */
+ { 413, -2 }, /* (358) signed ::= NK_MINUS NK_INTEGER */
+ { 413, -1 }, /* (359) signed ::= NK_FLOAT */
+ { 413, -2 }, /* (360) signed ::= NK_PLUS NK_FLOAT */
+ { 413, -2 }, /* (361) signed ::= NK_MINUS NK_FLOAT */
+ { 367, -1 }, /* (362) signed_literal ::= signed */
+ { 367, -1 }, /* (363) signed_literal ::= NK_STRING */
+ { 367, -1 }, /* (364) signed_literal ::= NK_BOOL */
+ { 367, -2 }, /* (365) signed_literal ::= TIMESTAMP NK_STRING */
+ { 367, -1 }, /* (366) signed_literal ::= duration_literal */
+ { 367, -1 }, /* (367) signed_literal ::= NULL */
+ { 367, -1 }, /* (368) signed_literal ::= literal_func */
+ { 367, -1 }, /* (369) signed_literal ::= NK_QUESTION */
+ { 415, -1 }, /* (370) literal_list ::= signed_literal */
+ { 415, -3 }, /* (371) literal_list ::= literal_list NK_COMMA signed_literal */
+ { 340, -1 }, /* (372) db_name ::= NK_ID */
+ { 373, -1 }, /* (373) table_name ::= NK_ID */
+ { 365, -1 }, /* (374) column_name ::= NK_ID */
+ { 380, -1 }, /* (375) function_name ::= NK_ID */
+ { 416, -1 }, /* (376) table_alias ::= NK_ID */
+ { 388, -1 }, /* (377) column_alias ::= NK_ID */
+ { 334, -1 }, /* (378) user_name ::= NK_ID */
+ { 341, -1 }, /* (379) topic_name ::= NK_ID */
+ { 405, -1 }, /* (380) stream_name ::= NK_ID */
+ { 398, -1 }, /* (381) cgroup_name ::= NK_ID */
+ { 391, -1 }, /* (382) index_name ::= NK_ID */
+ { 417, -1 }, /* (383) expr_or_subquery ::= expression */
+ { 410, -1 }, /* (384) expression ::= literal */
+ { 410, -1 }, /* (385) expression ::= pseudo_column */
+ { 410, -1 }, /* (386) expression ::= column_reference */
+ { 410, -1 }, /* (387) expression ::= function_expression */
+ { 410, -1 }, /* (388) expression ::= case_when_expression */
+ { 410, -3 }, /* (389) expression ::= NK_LP expression NK_RP */
+ { 410, -2 }, /* (390) expression ::= NK_PLUS expr_or_subquery */
+ { 410, -2 }, /* (391) expression ::= NK_MINUS expr_or_subquery */
+ { 410, -3 }, /* (392) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
+ { 410, -3 }, /* (393) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
+ { 410, -3 }, /* (394) expression ::= expr_or_subquery NK_STAR expr_or_subquery */
+ { 410, -3 }, /* (395) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
+ { 410, -3 }, /* (396) expression ::= expr_or_subquery NK_REM expr_or_subquery */
+ { 410, -3 }, /* (397) expression ::= column_reference NK_ARROW NK_STRING */
+ { 410, -3 }, /* (398) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
+ { 410, -3 }, /* (399) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
+ { 370, -1 }, /* (400) expression_list ::= expr_or_subquery */
+ { 370, -3 }, /* (401) expression_list ::= expression_list NK_COMMA expr_or_subquery */
+ { 419, -1 }, /* (402) column_reference ::= column_name */
+ { 419, -3 }, /* (403) column_reference ::= table_name NK_DOT column_name */
+ { 418, -1 }, /* (404) pseudo_column ::= ROWTS */
+ { 418, -1 }, /* (405) pseudo_column ::= TBNAME */
+ { 418, -3 }, /* (406) pseudo_column ::= table_name NK_DOT TBNAME */
+ { 418, -1 }, /* (407) pseudo_column ::= QSTART */
+ { 418, -1 }, /* (408) pseudo_column ::= QEND */
+ { 418, -1 }, /* (409) pseudo_column ::= QDURATION */
+ { 418, -1 }, /* (410) pseudo_column ::= WSTART */
+ { 418, -1 }, /* (411) pseudo_column ::= WEND */
+ { 418, -1 }, /* (412) pseudo_column ::= WDURATION */
+ { 418, -1 }, /* (413) pseudo_column ::= IROWTS */
+ { 418, -1 }, /* (414) pseudo_column ::= ISFILLED */
+ { 418, -1 }, /* (415) pseudo_column ::= QTAGS */
+ { 420, -4 }, /* (416) function_expression ::= function_name NK_LP expression_list NK_RP */
+ { 420, -4 }, /* (417) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
+ { 420, -6 }, /* (418) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+ { 420, -1 }, /* (419) function_expression ::= literal_func */
+ { 414, -3 }, /* (420) literal_func ::= noarg_func NK_LP NK_RP */
+ { 414, -1 }, /* (421) literal_func ::= NOW */
+ { 424, -1 }, /* (422) noarg_func ::= NOW */
+ { 424, -1 }, /* (423) noarg_func ::= TODAY */
+ { 424, -1 }, /* (424) noarg_func ::= TIMEZONE */
+ { 424, -1 }, /* (425) noarg_func ::= DATABASE */
+ { 424, -1 }, /* (426) noarg_func ::= CLIENT_VERSION */
+ { 424, -1 }, /* (427) noarg_func ::= SERVER_VERSION */
+ { 424, -1 }, /* (428) noarg_func ::= SERVER_STATUS */
+ { 424, -1 }, /* (429) noarg_func ::= CURRENT_USER */
+ { 424, -1 }, /* (430) noarg_func ::= USER */
+ { 422, -1 }, /* (431) star_func ::= COUNT */
+ { 422, -1 }, /* (432) star_func ::= FIRST */
+ { 422, -1 }, /* (433) star_func ::= LAST */
+ { 422, -1 }, /* (434) star_func ::= LAST_ROW */
+ { 423, -1 }, /* (435) star_func_para_list ::= NK_STAR */
+ { 423, -1 }, /* (436) star_func_para_list ::= other_para_list */
+ { 425, -1 }, /* (437) other_para_list ::= star_func_para */
+ { 425, -3 }, /* (438) other_para_list ::= other_para_list NK_COMMA star_func_para */
+ { 426, -1 }, /* (439) star_func_para ::= expr_or_subquery */
+ { 426, -3 }, /* (440) star_func_para ::= table_name NK_DOT NK_STAR */
+ { 421, -4 }, /* (441) case_when_expression ::= CASE when_then_list case_when_else_opt END */
+ { 421, -5 }, /* (442) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+ { 427, -1 }, /* (443) when_then_list ::= when_then_expr */
+ { 427, -2 }, /* (444) when_then_list ::= when_then_list when_then_expr */
+ { 430, -4 }, /* (445) when_then_expr ::= WHEN common_expression THEN common_expression */
+ { 428, 0 }, /* (446) case_when_else_opt ::= */
+ { 428, -2 }, /* (447) case_when_else_opt ::= ELSE common_expression */
+ { 431, -3 }, /* (448) predicate ::= expr_or_subquery compare_op expr_or_subquery */
+ { 431, -5 }, /* (449) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
+ { 431, -6 }, /* (450) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
+ { 431, -3 }, /* (451) predicate ::= expr_or_subquery IS NULL */
+ { 431, -4 }, /* (452) predicate ::= expr_or_subquery IS NOT NULL */
+ { 431, -3 }, /* (453) predicate ::= expr_or_subquery in_op in_predicate_value */
+ { 432, -1 }, /* (454) compare_op ::= NK_LT */
+ { 432, -1 }, /* (455) compare_op ::= NK_GT */
+ { 432, -1 }, /* (456) compare_op ::= NK_LE */
+ { 432, -1 }, /* (457) compare_op ::= NK_GE */
+ { 432, -1 }, /* (458) compare_op ::= NK_NE */
+ { 432, -1 }, /* (459) compare_op ::= NK_EQ */
+ { 432, -1 }, /* (460) compare_op ::= LIKE */
+ { 432, -2 }, /* (461) compare_op ::= NOT LIKE */
+ { 432, -1 }, /* (462) compare_op ::= MATCH */
+ { 432, -1 }, /* (463) compare_op ::= NMATCH */
+ { 432, -1 }, /* (464) compare_op ::= CONTAINS */
+ { 433, -1 }, /* (465) in_op ::= IN */
+ { 433, -2 }, /* (466) in_op ::= NOT IN */
+ { 434, -3 }, /* (467) in_predicate_value ::= NK_LP literal_list NK_RP */
+ { 435, -1 }, /* (468) boolean_value_expression ::= boolean_primary */
+ { 435, -2 }, /* (469) boolean_value_expression ::= NOT boolean_primary */
+ { 435, -3 }, /* (470) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ { 435, -3 }, /* (471) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ { 436, -1 }, /* (472) boolean_primary ::= predicate */
+ { 436, -3 }, /* (473) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
+ { 429, -1 }, /* (474) common_expression ::= expr_or_subquery */
+ { 429, -1 }, /* (475) common_expression ::= boolean_value_expression */
+ { 437, 0 }, /* (476) from_clause_opt ::= */
+ { 437, -2 }, /* (477) from_clause_opt ::= FROM table_reference_list */
+ { 438, -1 }, /* (478) table_reference_list ::= table_reference */
+ { 438, -3 }, /* (479) table_reference_list ::= table_reference_list NK_COMMA table_reference */
+ { 439, -1 }, /* (480) table_reference ::= table_primary */
+ { 439, -1 }, /* (481) table_reference ::= joined_table */
+ { 440, -2 }, /* (482) table_primary ::= table_name alias_opt */
+ { 440, -4 }, /* (483) table_primary ::= db_name NK_DOT table_name alias_opt */
+ { 440, -2 }, /* (484) table_primary ::= subquery alias_opt */
+ { 440, -1 }, /* (485) table_primary ::= parenthesized_joined_table */
+ { 442, 0 }, /* (486) alias_opt ::= */
+ { 442, -1 }, /* (487) alias_opt ::= table_alias */
+ { 442, -2 }, /* (488) alias_opt ::= AS table_alias */
+ { 444, -3 }, /* (489) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ { 444, -3 }, /* (490) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
+ { 441, -6 }, /* (491) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+ { 445, 0 }, /* (492) join_type ::= */
+ { 445, -1 }, /* (493) join_type ::= INNER */
+ { 447, -12 }, /* (494) 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 */
+ { 448, 0 }, /* (495) set_quantifier_opt ::= */
+ { 448, -1 }, /* (496) set_quantifier_opt ::= DISTINCT */
+ { 448, -1 }, /* (497) set_quantifier_opt ::= ALL */
+ { 449, -1 }, /* (498) select_list ::= select_item */
+ { 449, -3 }, /* (499) select_list ::= select_list NK_COMMA select_item */
+ { 457, -1 }, /* (500) select_item ::= NK_STAR */
+ { 457, -1 }, /* (501) select_item ::= common_expression */
+ { 457, -2 }, /* (502) select_item ::= common_expression column_alias */
+ { 457, -3 }, /* (503) select_item ::= common_expression AS column_alias */
+ { 457, -3 }, /* (504) select_item ::= table_name NK_DOT NK_STAR */
+ { 412, 0 }, /* (505) where_clause_opt ::= */
+ { 412, -2 }, /* (506) where_clause_opt ::= WHERE search_condition */
+ { 450, 0 }, /* (507) partition_by_clause_opt ::= */
+ { 450, -3 }, /* (508) partition_by_clause_opt ::= PARTITION BY partition_list */
+ { 458, -1 }, /* (509) partition_list ::= partition_item */
+ { 458, -3 }, /* (510) partition_list ::= partition_list NK_COMMA partition_item */
+ { 459, -1 }, /* (511) partition_item ::= expr_or_subquery */
+ { 459, -2 }, /* (512) partition_item ::= expr_or_subquery column_alias */
+ { 459, -3 }, /* (513) partition_item ::= expr_or_subquery AS column_alias */
+ { 454, 0 }, /* (514) twindow_clause_opt ::= */
+ { 454, -6 }, /* (515) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+ { 454, -4 }, /* (516) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+ { 454, -6 }, /* (517) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+ { 454, -8 }, /* (518) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+ { 454, -7 }, /* (519) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+ { 393, 0 }, /* (520) sliding_opt ::= */
+ { 393, -4 }, /* (521) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+ { 453, 0 }, /* (522) fill_opt ::= */
+ { 453, -4 }, /* (523) fill_opt ::= FILL NK_LP fill_mode NK_RP */
+ { 453, -6 }, /* (524) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+ { 453, -6 }, /* (525) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
+ { 460, -1 }, /* (526) fill_mode ::= NONE */
+ { 460, -1 }, /* (527) fill_mode ::= PREV */
+ { 460, -1 }, /* (528) fill_mode ::= NULL */
+ { 460, -1 }, /* (529) fill_mode ::= NULL_F */
+ { 460, -1 }, /* (530) fill_mode ::= LINEAR */
+ { 460, -1 }, /* (531) fill_mode ::= NEXT */
+ { 455, 0 }, /* (532) group_by_clause_opt ::= */
+ { 455, -3 }, /* (533) group_by_clause_opt ::= GROUP BY group_by_list */
+ { 461, -1 }, /* (534) group_by_list ::= expr_or_subquery */
+ { 461, -3 }, /* (535) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+ { 456, 0 }, /* (536) having_clause_opt ::= */
+ { 456, -2 }, /* (537) having_clause_opt ::= HAVING search_condition */
+ { 451, 0 }, /* (538) range_opt ::= */
+ { 451, -6 }, /* (539) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+ { 452, 0 }, /* (540) every_opt ::= */
+ { 452, -4 }, /* (541) every_opt ::= EVERY NK_LP duration_literal NK_RP */
+ { 462, -4 }, /* (542) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ { 463, -1 }, /* (543) query_simple ::= query_specification */
+ { 463, -1 }, /* (544) query_simple ::= union_query_expression */
+ { 467, -4 }, /* (545) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+ { 467, -3 }, /* (546) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+ { 468, -1 }, /* (547) query_simple_or_subquery ::= query_simple */
+ { 468, -1 }, /* (548) query_simple_or_subquery ::= subquery */
+ { 397, -1 }, /* (549) query_or_subquery ::= query_expression */
+ { 397, -1 }, /* (550) query_or_subquery ::= subquery */
+ { 464, 0 }, /* (551) order_by_clause_opt ::= */
+ { 464, -3 }, /* (552) order_by_clause_opt ::= ORDER BY sort_specification_list */
+ { 465, 0 }, /* (553) slimit_clause_opt ::= */
+ { 465, -2 }, /* (554) slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ { 465, -4 }, /* (555) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ { 465, -4 }, /* (556) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 466, 0 }, /* (557) limit_clause_opt ::= */
+ { 466, -2 }, /* (558) limit_clause_opt ::= LIMIT NK_INTEGER */
+ { 466, -4 }, /* (559) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
+ { 466, -4 }, /* (560) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 443, -3 }, /* (561) subquery ::= NK_LP query_expression NK_RP */
+ { 443, -3 }, /* (562) subquery ::= NK_LP subquery NK_RP */
+ { 446, -1 }, /* (563) search_condition ::= common_expression */
+ { 469, -1 }, /* (564) sort_specification_list ::= sort_specification */
+ { 469, -3 }, /* (565) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
+ { 470, -3 }, /* (566) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+ { 471, 0 }, /* (567) ordering_specification_opt ::= */
+ { 471, -1 }, /* (568) ordering_specification_opt ::= ASC */
+ { 471, -1 }, /* (569) ordering_specification_opt ::= DESC */
+ { 472, 0 }, /* (570) null_ordering_opt ::= */
+ { 472, -2 }, /* (571) null_ordering_opt ::= NULLS FIRST */
+ { 472, -2 }, /* (572) null_ordering_opt ::= NULLS LAST */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -3704,11 +3752,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,330,&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,331,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
{ }
@@ -3722,20 +3770,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,330,&yymsp[-2].minor);
{ }
- yy_destructor(yypParser,331,&yymsp[0].minor);
+ yy_destructor(yypParser,332,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
-{ yy_destructor(yypParser,332,&yymsp[0].minor);
+{ yy_destructor(yypParser,333,&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,331,&yymsp[-1].minor);
{ }
- yy_destructor(yypParser,332,&yymsp[0].minor);
+ yy_destructor(yypParser,333,&yymsp[0].minor);
}
break;
case 14: /* alter_account_option ::= PASS literal */
@@ -3749,81 +3797,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,332,&yymsp[0].minor);
break;
case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
-{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy225, &yymsp[-1].minor.yy0, yymsp[0].minor.yy705); }
+{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy63, &yymsp[-1].minor.yy0, yymsp[0].minor.yy707); }
break;
case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy225, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy63, 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.yy225, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy63, 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.yy225, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy63, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
break;
case 28: /* cmd ::= DROP USER user_name */
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy63); }
break;
case 29: /* sysinfo_opt ::= */
-{ yymsp[1].minor.yy705 = 1; }
+{ yymsp[1].minor.yy707 = 1; }
break;
case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
-{ yymsp[-1].minor.yy705 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
+{ yymsp[-1].minor.yy707 = 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.yy641, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy393, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63); }
break;
case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */
-{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy641, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy393, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63); }
break;
case 33: /* privileges ::= ALL */
-{ yymsp[0].minor.yy641 = PRIVILEGE_TYPE_ALL; }
+{ yymsp[0].minor.yy393 = PRIVILEGE_TYPE_ALL; }
break;
case 34: /* privileges ::= priv_type_list */
case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36);
-{ yylhsminor.yy641 = yymsp[0].minor.yy641; }
- yymsp[0].minor.yy641 = yylhsminor.yy641;
+{ yylhsminor.yy393 = yymsp[0].minor.yy393; }
+ yymsp[0].minor.yy393 = yylhsminor.yy393;
break;
case 35: /* privileges ::= SUBSCRIBE */
-{ yymsp[0].minor.yy641 = PRIVILEGE_TYPE_SUBSCRIBE; }
+{ yymsp[0].minor.yy393 = PRIVILEGE_TYPE_SUBSCRIBE; }
break;
case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
-{ yylhsminor.yy641 = yymsp[-2].minor.yy641 | yymsp[0].minor.yy641; }
- yymsp[-2].minor.yy641 = yylhsminor.yy641;
+{ yylhsminor.yy393 = yymsp[-2].minor.yy393 | yymsp[0].minor.yy393; }
+ yymsp[-2].minor.yy393 = yylhsminor.yy393;
break;
case 38: /* priv_type ::= READ */
-{ yymsp[0].minor.yy641 = PRIVILEGE_TYPE_READ; }
+{ yymsp[0].minor.yy393 = PRIVILEGE_TYPE_READ; }
break;
case 39: /* priv_type ::= WRITE */
-{ yymsp[0].minor.yy641 = PRIVILEGE_TYPE_WRITE; }
+{ yymsp[0].minor.yy393 = PRIVILEGE_TYPE_WRITE; }
break;
case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
-{ yylhsminor.yy225 = yymsp[-2].minor.yy0; }
- yymsp[-2].minor.yy225 = yylhsminor.yy225;
+{ yylhsminor.yy63 = yymsp[-2].minor.yy0; }
+ yymsp[-2].minor.yy63 = yylhsminor.yy63;
break;
case 41: /* priv_level ::= db_name NK_DOT NK_STAR */
-{ yylhsminor.yy225 = yymsp[-2].minor.yy225; }
- yymsp[-2].minor.yy225 = yylhsminor.yy225;
+{ yylhsminor.yy63 = yymsp[-2].minor.yy63; }
+ yymsp[-2].minor.yy63 = yylhsminor.yy63;
break;
case 42: /* priv_level ::= topic_name */
- case 273: /* sma_func_name ::= function_name */ yytestcase(yyruleno==273);
- case 477: /* alias_opt ::= table_alias */ yytestcase(yyruleno==477);
-{ yylhsminor.yy225 = yymsp[0].minor.yy225; }
- yymsp[0].minor.yy225 = yylhsminor.yy225;
+ case 281: /* sma_func_name ::= function_name */ yytestcase(yyruleno==281);
+ case 487: /* alias_opt ::= table_alias */ yytestcase(yyruleno==487);
+{ yylhsminor.yy63 = yymsp[0].minor.yy63; }
+ yymsp[0].minor.yy63 = yylhsminor.yy63;
break;
case 43: /* cmd ::= CREATE DNODE dnode_endpoint */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy225, NULL); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy63, NULL); }
break;
case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0); }
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy63, &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.yy103); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy669); }
break;
case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy103); }
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy63, yymsp[0].minor.yy669); }
break;
case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
@@ -3840,50 +3888,50 @@ 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 274: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==274);
- case 275: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==275);
- case 276: /* sma_func_name ::= LAST */ yytestcase(yyruleno==276);
- case 277: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==277);
- case 362: /* db_name ::= NK_ID */ yytestcase(yyruleno==362);
- case 363: /* table_name ::= NK_ID */ yytestcase(yyruleno==363);
- case 364: /* column_name ::= NK_ID */ yytestcase(yyruleno==364);
- case 365: /* function_name ::= NK_ID */ yytestcase(yyruleno==365);
- case 366: /* table_alias ::= NK_ID */ yytestcase(yyruleno==366);
- case 367: /* column_alias ::= NK_ID */ yytestcase(yyruleno==367);
- case 368: /* user_name ::= NK_ID */ yytestcase(yyruleno==368);
- case 369: /* topic_name ::= NK_ID */ yytestcase(yyruleno==369);
- case 370: /* stream_name ::= NK_ID */ yytestcase(yyruleno==370);
- case 371: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==371);
- case 372: /* index_name ::= NK_ID */ yytestcase(yyruleno==372);
- case 412: /* noarg_func ::= NOW */ yytestcase(yyruleno==412);
- case 413: /* noarg_func ::= TODAY */ yytestcase(yyruleno==413);
- case 414: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==414);
- case 415: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==415);
- case 416: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==416);
- case 417: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==417);
- case 418: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==418);
- case 419: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==419);
- case 420: /* noarg_func ::= USER */ yytestcase(yyruleno==420);
- case 421: /* star_func ::= COUNT */ yytestcase(yyruleno==421);
- case 422: /* star_func ::= FIRST */ yytestcase(yyruleno==422);
- case 423: /* star_func ::= LAST */ yytestcase(yyruleno==423);
- case 424: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==424);
-{ yylhsminor.yy225 = yymsp[0].minor.yy0; }
- yymsp[0].minor.yy225 = yylhsminor.yy225;
+ case 282: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==282);
+ case 283: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==283);
+ case 284: /* sma_func_name ::= LAST */ yytestcase(yyruleno==284);
+ case 285: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==285);
+ case 372: /* db_name ::= NK_ID */ yytestcase(yyruleno==372);
+ case 373: /* table_name ::= NK_ID */ yytestcase(yyruleno==373);
+ case 374: /* column_name ::= NK_ID */ yytestcase(yyruleno==374);
+ case 375: /* function_name ::= NK_ID */ yytestcase(yyruleno==375);
+ case 376: /* table_alias ::= NK_ID */ yytestcase(yyruleno==376);
+ case 377: /* column_alias ::= NK_ID */ yytestcase(yyruleno==377);
+ case 378: /* user_name ::= NK_ID */ yytestcase(yyruleno==378);
+ case 379: /* topic_name ::= NK_ID */ yytestcase(yyruleno==379);
+ case 380: /* stream_name ::= NK_ID */ yytestcase(yyruleno==380);
+ case 381: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==381);
+ case 382: /* index_name ::= NK_ID */ yytestcase(yyruleno==382);
+ case 422: /* noarg_func ::= NOW */ yytestcase(yyruleno==422);
+ case 423: /* noarg_func ::= TODAY */ yytestcase(yyruleno==423);
+ case 424: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==424);
+ case 425: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==425);
+ case 426: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==426);
+ case 427: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==427);
+ case 428: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==428);
+ case 429: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==429);
+ case 430: /* noarg_func ::= USER */ yytestcase(yyruleno==430);
+ case 431: /* star_func ::= COUNT */ yytestcase(yyruleno==431);
+ case 432: /* star_func ::= FIRST */ yytestcase(yyruleno==432);
+ case 433: /* star_func ::= LAST */ yytestcase(yyruleno==433);
+ case 434: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==434);
+{ yylhsminor.yy63 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy63 = yylhsminor.yy63;
break;
case 54: /* force_opt ::= */
case 74: /* not_exists_opt ::= */ yytestcase(yyruleno==74);
case 76: /* exists_opt ::= */ yytestcase(yyruleno==76);
- case 294: /* analyze_opt ::= */ yytestcase(yyruleno==294);
- case 301: /* agg_func_opt ::= */ yytestcase(yyruleno==301);
- case 485: /* set_quantifier_opt ::= */ yytestcase(yyruleno==485);
-{ yymsp[1].minor.yy103 = false; }
+ case 302: /* analyze_opt ::= */ yytestcase(yyruleno==302);
+ case 309: /* agg_func_opt ::= */ yytestcase(yyruleno==309);
+ case 495: /* set_quantifier_opt ::= */ yytestcase(yyruleno==495);
+{ yymsp[1].minor.yy669 = false; }
break;
case 55: /* force_opt ::= FORCE */
- case 295: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==295);
- case 302: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==302);
- case 486: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==486);
-{ yymsp[0].minor.yy103 = true; }
+ case 303: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==303);
+ case 310: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==310);
+ case 496: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==496);
+{ yymsp[0].minor.yy669 = true; }
break;
case 56: /* cmd ::= ALTER LOCAL NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
@@ -3916,1377 +3964,1400 @@ 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.yy103, &yymsp[-1].minor.yy225, yymsp[0].minor.yy42); }
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy669, &yymsp[-1].minor.yy63, yymsp[0].minor.yy828); }
break;
case 67: /* cmd ::= DROP DATABASE exists_opt db_name */
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy103, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy669, &yymsp[0].minor.yy63); }
break;
case 68: /* cmd ::= USE db_name */
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy63); }
break;
case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy42); }
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy63, yymsp[0].minor.yy828); }
break;
case 70: /* cmd ::= FLUSH DATABASE db_name */
-{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy225); }
+{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy63); }
break;
case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */
-{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy508); }
+{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy63, yymsp[0].minor.yy332); }
break;
- case 72: /* cmd ::= COMPACT DATABASE db_name */
-{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[0].minor.yy225); }
+ case 72: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
+{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy63, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
case 73: /* not_exists_opt ::= IF NOT EXISTS */
-{ yymsp[-2].minor.yy103 = true; }
+{ yymsp[-2].minor.yy669 = true; }
break;
case 75: /* exists_opt ::= IF EXISTS */
-{ yymsp[-1].minor.yy103 = true; }
+{ yymsp[-1].minor.yy669 = true; }
break;
case 77: /* db_options ::= */
-{ yymsp[1].minor.yy42 = createDefaultDatabaseOptions(pCxt); }
+{ yymsp[1].minor.yy828 = createDefaultDatabaseOptions(pCxt); }
break;
case 78: /* db_options ::= db_options BUFFER NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 79: /* db_options ::= db_options CACHEMODEL NK_STRING */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 80: /* db_options ::= db_options CACHESIZE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 81: /* db_options ::= db_options COMP NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 82: /* db_options ::= db_options DURATION NK_INTEGER */
case 83: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==83);
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 84: /* db_options ::= db_options MAXROWS NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 85: /* db_options ::= db_options MINROWS NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 86: /* db_options ::= db_options KEEP integer_list */
case 87: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==87);
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_KEEP, yymsp[0].minor.yy110); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_KEEP, yymsp[0].minor.yy222); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 88: /* db_options ::= db_options PAGES NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 89: /* db_options ::= db_options PAGESIZE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 90: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 91: /* db_options ::= db_options PRECISION NK_STRING */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 92: /* db_options ::= db_options REPLICA NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 95: /* db_options ::= db_options RETENTIONS retention_list */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_RETENTIONS, yymsp[0].minor.yy110); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_RETENTIONS, yymsp[0].minor.yy222); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
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.yy42 = setDatabaseOption(pCxt, yymsp[-3].minor.yy42, DB_OPTION_WAL_RETENTION_PERIOD, &t);
+ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-3].minor.yy828, DB_OPTION_WAL_RETENTION_PERIOD, &t);
}
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
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.yy42 = setDatabaseOption(pCxt, yymsp[-3].minor.yy42, DB_OPTION_WAL_RETENTION_SIZE, &t);
+ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-3].minor.yy828, DB_OPTION_WAL_RETENTION_SIZE, &t);
}
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
-{ yylhsminor.yy42 = setDatabaseOption(pCxt, yymsp[-2].minor.yy42, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setDatabaseOption(pCxt, yymsp[-2].minor.yy828, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 108: /* alter_db_options ::= alter_db_option */
-{ yylhsminor.yy42 = createAlterDatabaseOptions(pCxt); yylhsminor.yy42 = setAlterDatabaseOption(pCxt, yylhsminor.yy42, &yymsp[0].minor.yy459); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = createAlterDatabaseOptions(pCxt); yylhsminor.yy828 = setAlterDatabaseOption(pCxt, yylhsminor.yy828, &yymsp[0].minor.yy233); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
case 109: /* alter_db_options ::= alter_db_options alter_db_option */
-{ yylhsminor.yy42 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy42, &yymsp[0].minor.yy459); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy828, &yymsp[0].minor.yy233); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
case 110: /* alter_db_option ::= BUFFER NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy233.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.yy459.type = DB_OPTION_KEEP; yymsp[-1].minor.yy459.pList = yymsp[0].minor.yy110; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_KEEP; yymsp[-1].minor.yy233.pList = yymsp[0].minor.yy222; }
break;
case 116: /* alter_db_option ::= PAGES NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_PAGES; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_PAGES; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 117: /* alter_db_option ::= REPLICA NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_WAL; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_WAL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
+{ yymsp[-1].minor.yy233.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
case 120: /* integer_list ::= NK_INTEGER */
-{ yylhsminor.yy110 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+{ yylhsminor.yy222 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
case 121: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
- case 331: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==331);
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-2].minor.yy110, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy110 = yylhsminor.yy110;
+ case 341: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==341);
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-2].minor.yy222, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy222 = yylhsminor.yy222;
break;
case 122: /* variable_list ::= NK_VARIABLE */
-{ yylhsminor.yy110 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+{ yylhsminor.yy222 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
case 123: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-2].minor.yy110, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy110 = yylhsminor.yy110;
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-2].minor.yy222, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy222 = yylhsminor.yy222;
break;
case 124: /* retention_list ::= retention */
- case 146: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==146);
- case 149: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==149);
- case 156: /* column_def_list ::= column_def */ yytestcase(yyruleno==156);
- case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200);
- case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205);
- case 256: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==256);
- case 270: /* func_list ::= func */ yytestcase(yyruleno==270);
- case 360: /* literal_list ::= signed_literal */ yytestcase(yyruleno==360);
- case 427: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==427);
- case 433: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==433);
- case 488: /* select_list ::= select_item */ yytestcase(yyruleno==488);
- case 499: /* partition_list ::= partition_item */ yytestcase(yyruleno==499);
- case 554: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==554);
-{ yylhsminor.yy110 = createNodeList(pCxt, yymsp[0].minor.yy42); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+ case 154: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==154);
+ case 157: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==157);
+ case 164: /* column_def_list ::= column_def */ yytestcase(yyruleno==164);
+ case 208: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==208);
+ case 213: /* col_name_list ::= col_name */ yytestcase(yyruleno==213);
+ case 264: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==264);
+ case 278: /* func_list ::= func */ yytestcase(yyruleno==278);
+ case 370: /* literal_list ::= signed_literal */ yytestcase(yyruleno==370);
+ case 437: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==437);
+ case 443: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==443);
+ case 498: /* select_list ::= select_item */ yytestcase(yyruleno==498);
+ case 509: /* partition_list ::= partition_item */ yytestcase(yyruleno==509);
+ case 564: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==564);
+{ yylhsminor.yy222 = createNodeList(pCxt, yymsp[0].minor.yy828); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
case 125: /* retention_list ::= retention_list NK_COMMA retention */
- case 150: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==150);
- case 157: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==157);
- case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201);
- case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206);
- case 257: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==257);
- case 271: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==271);
- case 361: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==361);
- case 428: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==428);
- case 489: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==489);
- case 500: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==500);
- case 555: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==555);
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-2].minor.yy110, yymsp[0].minor.yy42); }
- yymsp[-2].minor.yy110 = yylhsminor.yy110;
+ case 158: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==158);
+ case 165: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==165);
+ case 209: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==209);
+ case 214: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==214);
+ case 265: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==265);
+ case 279: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==279);
+ case 371: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==371);
+ case 438: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==438);
+ case 499: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==499);
+ case 510: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==510);
+ case 565: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==565);
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-2].minor.yy222, yymsp[0].minor.yy828); }
+ yymsp[-2].minor.yy222 = yylhsminor.yy222;
break;
case 126: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
-{ yylhsminor.yy42 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+{ yylhsminor.yy828 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
case 127: /* speed_opt ::= */
- case 303: /* bufsize_opt ::= */ yytestcase(yyruleno==303);
-{ yymsp[1].minor.yy508 = 0; }
+ case 311: /* bufsize_opt ::= */ yytestcase(yyruleno==311);
+{ yymsp[1].minor.yy332 = 0; }
break;
case 128: /* speed_opt ::= MAX_SPEED NK_INTEGER */
- case 304: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==304);
-{ yymsp[-1].minor.yy508 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+ case 312: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==312);
+{ yymsp[-1].minor.yy332 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+ break;
+ case 129: /* start_opt ::= */
+ case 133: /* end_opt ::= */ yytestcase(yyruleno==133);
+ case 258: /* like_pattern_opt ::= */ yytestcase(yyruleno==258);
+ case 331: /* subtable_opt ::= */ yytestcase(yyruleno==331);
+ case 446: /* case_when_else_opt ::= */ yytestcase(yyruleno==446);
+ case 476: /* from_clause_opt ::= */ yytestcase(yyruleno==476);
+ case 505: /* where_clause_opt ::= */ yytestcase(yyruleno==505);
+ case 514: /* twindow_clause_opt ::= */ yytestcase(yyruleno==514);
+ case 520: /* sliding_opt ::= */ yytestcase(yyruleno==520);
+ case 522: /* fill_opt ::= */ yytestcase(yyruleno==522);
+ case 536: /* having_clause_opt ::= */ yytestcase(yyruleno==536);
+ case 538: /* range_opt ::= */ yytestcase(yyruleno==538);
+ case 540: /* every_opt ::= */ yytestcase(yyruleno==540);
+ case 553: /* slimit_clause_opt ::= */ yytestcase(yyruleno==553);
+ case 557: /* limit_clause_opt ::= */ yytestcase(yyruleno==557);
+{ yymsp[1].minor.yy828 = NULL; }
+ break;
+ case 130: /* start_opt ::= START WITH NK_INTEGER */
+ case 134: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==134);
+{ yymsp[-2].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ break;
+ case 131: /* start_opt ::= START WITH NK_STRING */
+ case 135: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==135);
+{ yymsp[-2].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 132: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
+ case 136: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==136);
+{ yymsp[-3].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 137: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ case 139: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==139);
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy669, yymsp[-5].minor.yy828, yymsp[-3].minor.yy222, yymsp[-1].minor.yy222, yymsp[0].minor.yy828); }
+ break;
+ case 138: /* cmd ::= CREATE TABLE multi_create_clause */
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy222); }
+ break;
+ case 140: /* cmd ::= DROP TABLE multi_drop_clause */
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy222); }
+ break;
+ case 141: /* cmd ::= DROP STABLE exists_opt full_table_name */
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy669, yymsp[0].minor.yy828); }
+ break;
+ case 142: /* cmd ::= ALTER TABLE alter_table_clause */
+ case 343: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==343);
+ case 344: /* cmd ::= insert_query */ yytestcase(yyruleno==344);
+{ pCxt->pRootNode = yymsp[0].minor.yy828; }
+ break;
+ case 143: /* cmd ::= ALTER STABLE alter_table_clause */
+{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy828); }
+ break;
+ case 144: /* alter_table_clause ::= full_table_name alter_table_options */
+{ yylhsminor.yy828 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 145: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+{ yylhsminor.yy828 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy63, yymsp[0].minor.yy686); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 146: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
+{ yylhsminor.yy828 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy828, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy63); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 147: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+{ yylhsminor.yy828 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy63, yymsp[0].minor.yy686); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 148: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+{ yylhsminor.yy828 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy63, &yymsp[0].minor.yy63); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 149: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+{ yylhsminor.yy828 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy63, yymsp[0].minor.yy686); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 150: /* alter_table_clause ::= full_table_name DROP TAG column_name */
+{ yylhsminor.yy828 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy828, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy63); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 151: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+{ yylhsminor.yy828 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy63, yymsp[0].minor.yy686); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 129: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- case 131: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==131);
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy103, yymsp[-5].minor.yy42, yymsp[-3].minor.yy110, yymsp[-1].minor.yy110, yymsp[0].minor.yy42); }
+ case 152: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+{ yylhsminor.yy828 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy828, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy63, &yymsp[0].minor.yy63); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 130: /* cmd ::= CREATE TABLE multi_create_clause */
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy110); }
+ case 153: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+{ yylhsminor.yy828 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy828, &yymsp[-2].minor.yy63, yymsp[0].minor.yy828); }
+ yymsp[-5].minor.yy828 = yylhsminor.yy828;
break;
- case 132: /* cmd ::= DROP TABLE multi_drop_clause */
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy110); }
+ case 155: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
+ case 444: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==444);
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-1].minor.yy222, yymsp[0].minor.yy828); }
+ yymsp[-1].minor.yy222 = yylhsminor.yy222;
break;
- case 133: /* cmd ::= DROP STABLE exists_opt full_table_name */
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy103, yymsp[0].minor.yy42); }
+ case 156: /* 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.yy828 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy669, yymsp[-8].minor.yy828, yymsp[-6].minor.yy828, yymsp[-5].minor.yy222, yymsp[-2].minor.yy222, yymsp[0].minor.yy828); }
+ yymsp[-9].minor.yy828 = yylhsminor.yy828;
break;
- case 134: /* cmd ::= ALTER TABLE alter_table_clause */
- case 333: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==333);
- case 334: /* cmd ::= insert_query */ yytestcase(yyruleno==334);
-{ pCxt->pRootNode = yymsp[0].minor.yy42; }
+ case 159: /* drop_table_clause ::= exists_opt full_table_name */
+{ yylhsminor.yy828 = createDropTableClause(pCxt, yymsp[-1].minor.yy669, yymsp[0].minor.yy828); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 135: /* cmd ::= ALTER STABLE alter_table_clause */
-{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy42); }
+ case 160: /* specific_cols_opt ::= */
+ case 191: /* tags_def_opt ::= */ yytestcase(yyruleno==191);
+ case 263: /* tag_list_opt ::= */ yytestcase(yyruleno==263);
+ case 317: /* col_list_opt ::= */ yytestcase(yyruleno==317);
+ case 319: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==319);
+ case 507: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==507);
+ case 532: /* group_by_clause_opt ::= */ yytestcase(yyruleno==532);
+ case 551: /* order_by_clause_opt ::= */ yytestcase(yyruleno==551);
+{ yymsp[1].minor.yy222 = NULL; }
break;
- case 136: /* alter_table_clause ::= full_table_name alter_table_options */
-{ yylhsminor.yy42 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 161: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ case 318: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==318);
+{ yymsp[-2].minor.yy222 = yymsp[-1].minor.yy222; }
break;
- case 137: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
-{ yylhsminor.yy42 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 162: /* full_table_name ::= table_name */
+{ yylhsminor.yy828 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy63, NULL); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 138: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-{ yylhsminor.yy42 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy42, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy225); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 163: /* full_table_name ::= db_name NK_DOT table_name */
+{ yylhsminor.yy828 = createRealTableNode(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63, NULL); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 139: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-{ yylhsminor.yy42 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 166: /* column_def ::= column_name type_name */
+{ yylhsminor.yy828 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy63, yymsp[0].minor.yy686, NULL); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 140: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-{ yylhsminor.yy42 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 167: /* column_def ::= column_name type_name COMMENT NK_STRING */
+{ yylhsminor.yy828 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy63, yymsp[-2].minor.yy686, &yymsp[0].minor.yy0); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 141: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-{ yylhsminor.yy42 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 168: /* type_name ::= BOOL */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
- case 142: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-{ yylhsminor.yy42 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy42, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy225); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 169: /* type_name ::= TINYINT */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
- case 143: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-{ yylhsminor.yy42 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 170: /* type_name ::= SMALLINT */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
- case 144: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-{ yylhsminor.yy42 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy42, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 171: /* type_name ::= INT */
+ case 172: /* type_name ::= INTEGER */ yytestcase(yyruleno==172);
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_INT); }
break;
- case 145: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
-{ yylhsminor.yy42 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy42, &yymsp[-2].minor.yy225, yymsp[0].minor.yy42); }
- yymsp[-5].minor.yy42 = yylhsminor.yy42;
+ case 173: /* type_name ::= BIGINT */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
- case 147: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
- case 434: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==434);
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-1].minor.yy110, yymsp[0].minor.yy42); }
- yymsp[-1].minor.yy110 = yylhsminor.yy110;
+ case 174: /* type_name ::= FLOAT */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
- case 148: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */
-{ yylhsminor.yy42 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy103, yymsp[-8].minor.yy42, yymsp[-6].minor.yy42, yymsp[-5].minor.yy110, yymsp[-2].minor.yy110, yymsp[0].minor.yy42); }
- yymsp[-9].minor.yy42 = yylhsminor.yy42;
+ case 175: /* type_name ::= DOUBLE */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
- case 151: /* drop_table_clause ::= exists_opt full_table_name */
-{ yylhsminor.yy42 = createDropTableClause(pCxt, yymsp[-1].minor.yy103, yymsp[0].minor.yy42); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 176: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy686 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
- case 152: /* specific_cols_opt ::= */
- case 183: /* tags_def_opt ::= */ yytestcase(yyruleno==183);
- case 255: /* tag_list_opt ::= */ yytestcase(yyruleno==255);
- case 307: /* col_list_opt ::= */ yytestcase(yyruleno==307);
- case 309: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==309);
- case 497: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==497);
- case 522: /* group_by_clause_opt ::= */ yytestcase(yyruleno==522);
- case 541: /* order_by_clause_opt ::= */ yytestcase(yyruleno==541);
-{ yymsp[1].minor.yy110 = NULL; }
+ case 177: /* type_name ::= TIMESTAMP */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
- case 153: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
- case 308: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==308);
-{ yymsp[-2].minor.yy110 = yymsp[-1].minor.yy110; }
+ case 178: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy686 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
- case 154: /* full_table_name ::= table_name */
-{ yylhsminor.yy42 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy225, NULL); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 179: /* type_name ::= TINYINT UNSIGNED */
+{ yymsp[-1].minor.yy686 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
- case 155: /* full_table_name ::= db_name NK_DOT table_name */
-{ yylhsminor.yy42 = createRealTableNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225, NULL); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 180: /* type_name ::= SMALLINT UNSIGNED */
+{ yymsp[-1].minor.yy686 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
- case 158: /* column_def ::= column_name type_name */
-{ yylhsminor.yy42 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448, NULL); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 181: /* type_name ::= INT UNSIGNED */
+{ yymsp[-1].minor.yy686 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
- case 159: /* column_def ::= column_name type_name COMMENT NK_STRING */
-{ yylhsminor.yy42 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-2].minor.yy448, &yymsp[0].minor.yy0); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 182: /* type_name ::= BIGINT UNSIGNED */
+{ yymsp[-1].minor.yy686 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
- case 160: /* type_name ::= BOOL */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BOOL); }
+ case 183: /* type_name ::= JSON */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
- case 161: /* type_name ::= TINYINT */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+ case 184: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy686 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
- case 162: /* type_name ::= SMALLINT */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+ case 185: /* type_name ::= MEDIUMBLOB */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
- case 163: /* type_name ::= INT */
- case 164: /* type_name ::= INTEGER */ yytestcase(yyruleno==164);
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_INT); }
+ case 186: /* type_name ::= BLOB */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
- case 165: /* type_name ::= BIGINT */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+ case 187: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy686 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
- case 166: /* type_name ::= FLOAT */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+ case 188: /* type_name ::= DECIMAL */
+{ yymsp[0].minor.yy686 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 167: /* type_name ::= DOUBLE */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+ case 189: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy686 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 168: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+ case 190: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy686 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 169: /* type_name ::= TIMESTAMP */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+ case 192: /* tags_def_opt ::= tags_def */
+ case 320: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==320);
+ case 436: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==436);
+{ yylhsminor.yy222 = yymsp[0].minor.yy222; }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
- case 170: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+ case 193: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ case 321: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==321);
+{ yymsp[-3].minor.yy222 = yymsp[-1].minor.yy222; }
break;
- case 171: /* type_name ::= TINYINT UNSIGNED */
-{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+ case 194: /* table_options ::= */
+{ yymsp[1].minor.yy828 = createDefaultTableOptions(pCxt); }
break;
- case 172: /* type_name ::= SMALLINT UNSIGNED */
-{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+ case 195: /* table_options ::= table_options COMMENT NK_STRING */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-2].minor.yy828, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 173: /* type_name ::= INT UNSIGNED */
-{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UINT); }
+ case 196: /* table_options ::= table_options MAX_DELAY duration_list */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-2].minor.yy828, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy222); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 174: /* type_name ::= BIGINT UNSIGNED */
-{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+ case 197: /* table_options ::= table_options WATERMARK duration_list */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-2].minor.yy828, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy222); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 175: /* type_name ::= JSON */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_JSON); }
+ case 198: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-4].minor.yy828, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy222); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 176: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+ case 199: /* table_options ::= table_options TTL NK_INTEGER */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-2].minor.yy828, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 177: /* type_name ::= MEDIUMBLOB */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+ case 200: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-4].minor.yy828, TABLE_OPTION_SMA, yymsp[-1].minor.yy222); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 178: /* type_name ::= BLOB */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BLOB); }
+ case 201: /* table_options ::= table_options DELETE_MARK duration_list */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-2].minor.yy828, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy222); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 179: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+ case 202: /* alter_table_options ::= alter_table_option */
+{ yylhsminor.yy828 = createAlterTableOptions(pCxt); yylhsminor.yy828 = setTableOption(pCxt, yylhsminor.yy828, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 180: /* type_name ::= DECIMAL */
-{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 203: /* alter_table_options ::= alter_table_options alter_table_option */
+{ yylhsminor.yy828 = setTableOption(pCxt, yymsp[-1].minor.yy828, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 204: /* alter_table_option ::= COMMENT NK_STRING */
+{ yymsp[-1].minor.yy233.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
- case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 205: /* alter_table_option ::= TTL NK_INTEGER */
+{ yymsp[-1].minor.yy233.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; }
break;
- case 184: /* tags_def_opt ::= tags_def */
- case 310: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==310);
- case 426: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==426);
-{ yylhsminor.yy110 = yymsp[0].minor.yy110; }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+ case 206: /* duration_list ::= duration_literal */
+ case 400: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==400);
+{ yylhsminor.yy222 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
- case 185: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
- case 311: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==311);
-{ yymsp[-3].minor.yy110 = yymsp[-1].minor.yy110; }
+ case 207: /* duration_list ::= duration_list NK_COMMA duration_literal */
+ case 401: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==401);
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-2].minor.yy222, releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
+ yymsp[-2].minor.yy222 = yylhsminor.yy222;
break;
- case 186: /* table_options ::= */
-{ yymsp[1].minor.yy42 = createDefaultTableOptions(pCxt); }
+ case 210: /* rollup_func_name ::= function_name */
+{ yylhsminor.yy828 = createFunctionNode(pCxt, &yymsp[0].minor.yy63, NULL); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 187: /* table_options ::= table_options COMMENT NK_STRING */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-2].minor.yy42, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 211: /* rollup_func_name ::= FIRST */
+ case 212: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==212);
+ case 267: /* tag_item ::= QTAGS */ yytestcase(yyruleno==267);
+{ yylhsminor.yy828 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 188: /* table_options ::= table_options MAX_DELAY duration_list */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-2].minor.yy42, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy110); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 215: /* col_name ::= column_name */
+ case 268: /* tag_item ::= column_name */ yytestcase(yyruleno==268);
+{ yylhsminor.yy828 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy63); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 189: /* table_options ::= table_options WATERMARK duration_list */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-2].minor.yy42, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy110); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
- break;
- case 190: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-4].minor.yy42, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy110); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
- break;
- case 191: /* table_options ::= table_options TTL NK_INTEGER */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-2].minor.yy42, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
- break;
- case 192: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-4].minor.yy42, TABLE_OPTION_SMA, yymsp[-1].minor.yy110); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
- break;
- case 193: /* table_options ::= table_options DELETE_MARK duration_list */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-2].minor.yy42, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy110); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
- break;
- case 194: /* alter_table_options ::= alter_table_option */
-{ yylhsminor.yy42 = createAlterTableOptions(pCxt); yylhsminor.yy42 = setTableOption(pCxt, yylhsminor.yy42, yymsp[0].minor.yy459.type, &yymsp[0].minor.yy459.val); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
- break;
- case 195: /* alter_table_options ::= alter_table_options alter_table_option */
-{ yylhsminor.yy42 = setTableOption(pCxt, yymsp[-1].minor.yy42, yymsp[0].minor.yy459.type, &yymsp[0].minor.yy459.val); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
- break;
- case 196: /* alter_table_option ::= COMMENT NK_STRING */
-{ yymsp[-1].minor.yy459.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
- break;
- case 197: /* alter_table_option ::= TTL NK_INTEGER */
-{ yymsp[-1].minor.yy459.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy459.val = yymsp[0].minor.yy0; }
- break;
- case 198: /* duration_list ::= duration_literal */
- case 390: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==390);
-{ yylhsminor.yy110 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy42)); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
- break;
- case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */
- case 391: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==391);
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-2].minor.yy110, releaseRawExprNode(pCxt, yymsp[0].minor.yy42)); }
- yymsp[-2].minor.yy110 = yylhsminor.yy110;
- break;
- case 202: /* rollup_func_name ::= function_name */
-{ yylhsminor.yy42 = createFunctionNode(pCxt, &yymsp[0].minor.yy225, NULL); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
- break;
- case 203: /* rollup_func_name ::= FIRST */
- case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204);
- case 259: /* tag_item ::= QTAGS */ yytestcase(yyruleno==259);
-{ yylhsminor.yy42 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
- break;
- case 207: /* col_name ::= column_name */
- case 260: /* tag_item ::= column_name */ yytestcase(yyruleno==260);
-{ yylhsminor.yy42 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy225); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
- break;
- case 208: /* cmd ::= SHOW DNODES */
+ case 216: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
break;
- case 209: /* cmd ::= SHOW USERS */
+ case 217: /* cmd ::= SHOW USERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
break;
- case 210: /* cmd ::= SHOW USER PRIVILEGES */
+ case 218: /* cmd ::= SHOW USER PRIVILEGES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
break;
- case 211: /* cmd ::= SHOW DATABASES */
+ case 219: /* cmd ::= SHOW DATABASES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
break;
- case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy42, yymsp[0].minor.yy42, OP_TYPE_LIKE); }
+ case 220: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy828, yymsp[0].minor.yy828, OP_TYPE_LIKE); }
break;
- case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy42, yymsp[0].minor.yy42, OP_TYPE_LIKE); }
+ case 221: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy828, yymsp[0].minor.yy828, OP_TYPE_LIKE); }
break;
- case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy42, NULL, OP_TYPE_LIKE); }
+ case 222: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy828, NULL, OP_TYPE_LIKE); }
break;
- case 215: /* cmd ::= SHOW MNODES */
+ case 223: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
break;
- case 216: /* cmd ::= SHOW QNODES */
+ case 224: /* cmd ::= SHOW QNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
break;
- case 217: /* cmd ::= SHOW FUNCTIONS */
+ case 225: /* cmd ::= SHOW FUNCTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
break;
- case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy42, yymsp[-1].minor.yy42, OP_TYPE_EQUAL); }
+ case 226: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy828, yymsp[-1].minor.yy828, OP_TYPE_EQUAL); }
break;
- case 219: /* cmd ::= SHOW STREAMS */
+ case 227: /* cmd ::= SHOW STREAMS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
break;
- case 220: /* cmd ::= SHOW ACCOUNTS */
+ case 228: /* cmd ::= SHOW ACCOUNTS */
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
break;
- case 221: /* cmd ::= SHOW APPS */
+ case 229: /* cmd ::= SHOW APPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
break;
- case 222: /* cmd ::= SHOW CONNECTIONS */
+ case 230: /* cmd ::= SHOW CONNECTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
break;
- case 223: /* cmd ::= SHOW LICENCES */
- case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224);
+ case 231: /* cmd ::= SHOW LICENCES */
+ case 232: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==232);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
break;
- case 225: /* cmd ::= SHOW CREATE DATABASE db_name */
-{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy225); }
+ case 233: /* cmd ::= SHOW CREATE DATABASE db_name */
+{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy63); }
break;
- case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy42); }
+ case 234: /* cmd ::= SHOW CREATE TABLE full_table_name */
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy828); }
break;
- case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy42); }
+ case 235: /* cmd ::= SHOW CREATE STABLE full_table_name */
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy828); }
break;
- case 228: /* cmd ::= SHOW QUERIES */
+ case 236: /* cmd ::= SHOW QUERIES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
break;
- case 229: /* cmd ::= SHOW SCORES */
+ case 237: /* cmd ::= SHOW SCORES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
break;
- case 230: /* cmd ::= SHOW TOPICS */
+ case 238: /* cmd ::= SHOW TOPICS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
break;
- case 231: /* cmd ::= SHOW VARIABLES */
- case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232);
+ case 239: /* cmd ::= SHOW VARIABLES */
+ case 240: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==240);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
break;
- case 233: /* cmd ::= SHOW LOCAL VARIABLES */
+ case 241: /* cmd ::= SHOW LOCAL VARIABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
break;
- case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
-{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy42); }
+ case 242: /* 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.yy828); }
break;
- case 235: /* cmd ::= SHOW BNODES */
+ case 243: /* cmd ::= SHOW BNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
break;
- case 236: /* cmd ::= SHOW SNODES */
+ case 244: /* cmd ::= SHOW SNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
break;
- case 237: /* cmd ::= SHOW CLUSTER */
+ case 245: /* cmd ::= SHOW CLUSTER */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
break;
- case 238: /* cmd ::= SHOW TRANSACTIONS */
+ case 246: /* cmd ::= SHOW TRANSACTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
break;
- case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
-{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy42); }
+ case 247: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy828); }
break;
- case 240: /* cmd ::= SHOW CONSUMERS */
+ case 248: /* cmd ::= SHOW CONSUMERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
break;
- case 241: /* cmd ::= SHOW SUBSCRIPTIONS */
+ case 249: /* cmd ::= SHOW SUBSCRIPTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
break;
- case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy42, yymsp[-1].minor.yy42, OP_TYPE_EQUAL); }
+ case 250: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy828, yymsp[-1].minor.yy828, OP_TYPE_EQUAL); }
break;
- case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
-{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy42, yymsp[0].minor.yy42, yymsp[-3].minor.yy110); }
+ case 251: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy828, yymsp[0].minor.yy828, yymsp[-3].minor.yy222); }
break;
- case 244: /* cmd ::= SHOW VNODES NK_INTEGER */
+ case 252: /* cmd ::= SHOW VNODES NK_INTEGER */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
break;
- case 245: /* cmd ::= SHOW VNODES NK_STRING */
+ case 253: /* cmd ::= SHOW VNODES NK_STRING */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); }
break;
- case 246: /* cmd ::= SHOW db_name_cond_opt ALIVE */
-{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy42, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
+ case 254: /* cmd ::= SHOW db_name_cond_opt ALIVE */
+{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy828, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
break;
- case 247: /* cmd ::= SHOW CLUSTER ALIVE */
+ case 255: /* cmd ::= SHOW CLUSTER ALIVE */
{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); }
break;
- case 248: /* db_name_cond_opt ::= */
- case 253: /* from_db_opt ::= */ yytestcase(yyruleno==253);
-{ yymsp[1].minor.yy42 = createDefaultDatabaseCondValue(pCxt); }
+ case 256: /* db_name_cond_opt ::= */
+ case 261: /* from_db_opt ::= */ yytestcase(yyruleno==261);
+{ yymsp[1].minor.yy828 = createDefaultDatabaseCondValue(pCxt); }
break;
- case 249: /* db_name_cond_opt ::= db_name NK_DOT */
-{ yylhsminor.yy42 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy225); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 257: /* db_name_cond_opt ::= db_name NK_DOT */
+{ yylhsminor.yy828 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy63); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 250: /* like_pattern_opt ::= */
- case 321: /* subtable_opt ::= */ yytestcase(yyruleno==321);
- case 436: /* case_when_else_opt ::= */ yytestcase(yyruleno==436);
- case 466: /* from_clause_opt ::= */ yytestcase(yyruleno==466);
- case 495: /* where_clause_opt ::= */ yytestcase(yyruleno==495);
- case 504: /* twindow_clause_opt ::= */ yytestcase(yyruleno==504);
- case 510: /* sliding_opt ::= */ yytestcase(yyruleno==510);
- case 512: /* fill_opt ::= */ yytestcase(yyruleno==512);
- case 526: /* having_clause_opt ::= */ yytestcase(yyruleno==526);
- case 528: /* range_opt ::= */ yytestcase(yyruleno==528);
- case 530: /* every_opt ::= */ yytestcase(yyruleno==530);
- case 543: /* slimit_clause_opt ::= */ yytestcase(yyruleno==543);
- case 547: /* limit_clause_opt ::= */ yytestcase(yyruleno==547);
-{ yymsp[1].minor.yy42 = NULL; }
+ case 259: /* like_pattern_opt ::= LIKE NK_STRING */
+{ yymsp[-1].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
- case 251: /* like_pattern_opt ::= LIKE NK_STRING */
-{ yymsp[-1].minor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ case 260: /* table_name_cond ::= table_name */
+{ yylhsminor.yy828 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy63); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 252: /* table_name_cond ::= table_name */
-{ yylhsminor.yy42 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy225); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 262: /* from_db_opt ::= FROM db_name */
+{ yymsp[-1].minor.yy828 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy63); }
break;
- case 254: /* from_db_opt ::= FROM db_name */
-{ yymsp[-1].minor.yy42 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy225); }
+ case 266: /* tag_item ::= TBNAME */
+{ yylhsminor.yy828 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 258: /* tag_item ::= TBNAME */
-{ yylhsminor.yy42 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 269: /* tag_item ::= column_name column_alias */
+{ yylhsminor.yy828 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy63), &yymsp[0].minor.yy63); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 261: /* tag_item ::= column_name column_alias */
-{ yylhsminor.yy42 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy225), &yymsp[0].minor.yy225); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 270: /* tag_item ::= column_name AS column_alias */
+{ yylhsminor.yy828 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy63), &yymsp[0].minor.yy63); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 262: /* tag_item ::= column_name AS column_alias */
-{ yylhsminor.yy42 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy225), &yymsp[0].minor.yy225); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 271: /* 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.yy669, yymsp[-3].minor.yy828, yymsp[-1].minor.yy828, NULL, yymsp[0].minor.yy828); }
break;
- case 263: /* 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.yy103, yymsp[-3].minor.yy42, yymsp[-1].minor.yy42, NULL, yymsp[0].minor.yy42); }
+ case 272: /* 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.yy669, yymsp[-5].minor.yy828, yymsp[-3].minor.yy828, yymsp[-1].minor.yy222, NULL); }
break;
- case 264: /* 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.yy103, yymsp[-5].minor.yy42, yymsp[-3].minor.yy42, yymsp[-1].minor.yy110, NULL); }
+ case 273: /* cmd ::= DROP INDEX exists_opt full_index_name */
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy669, yymsp[0].minor.yy828); }
break;
- case 265: /* cmd ::= DROP INDEX exists_opt full_index_name */
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy103, yymsp[0].minor.yy42); }
+ case 274: /* full_index_name ::= index_name */
+{ yylhsminor.yy828 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy63); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 266: /* full_index_name ::= index_name */
-{ yylhsminor.yy42 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy225); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 275: /* full_index_name ::= db_name NK_DOT index_name */
+{ yylhsminor.yy828 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 267: /* full_index_name ::= db_name NK_DOT index_name */
-{ yylhsminor.yy42 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 276: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+{ yymsp[-9].minor.yy828 = createIndexOption(pCxt, yymsp[-7].minor.yy222, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), NULL, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 268: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
-{ yymsp[-9].minor.yy42 = createIndexOption(pCxt, yymsp[-7].minor.yy110, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), NULL, yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 277: /* 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.yy828 = createIndexOption(pCxt, yymsp[-9].minor.yy222, releaseRawExprNode(pCxt, yymsp[-5].minor.yy828), releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 269: /* 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.yy42 = createIndexOption(pCxt, yymsp[-9].minor.yy110, releaseRawExprNode(pCxt, yymsp[-5].minor.yy42), releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 280: /* func ::= sma_func_name NK_LP expression_list NK_RP */
+{ yylhsminor.yy828 = createFunctionNode(pCxt, &yymsp[-3].minor.yy63, yymsp[-1].minor.yy222); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 272: /* func ::= sma_func_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy42 = createFunctionNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-1].minor.yy110); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 286: /* sma_stream_opt ::= */
+ case 322: /* stream_options ::= */ yytestcase(yyruleno==322);
+{ yymsp[1].minor.yy828 = createStreamOptions(pCxt); }
break;
- case 278: /* sma_stream_opt ::= */
- case 312: /* stream_options ::= */ yytestcase(yyruleno==312);
-{ yymsp[1].minor.yy42 = createStreamOptions(pCxt); }
+ case 287: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy828)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy828); yylhsminor.yy828 = yymsp[-2].minor.yy828; }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 279: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
- case 316: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==316);
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 288: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy828)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy828); yylhsminor.yy828 = yymsp[-2].minor.yy828; }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 280: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 289: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy828)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy828); yylhsminor.yy828 = yymsp[-2].minor.yy828; }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 281: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
- case 319: /* stream_options ::= stream_options DELETE_MARK duration_literal */ yytestcase(yyruleno==319);
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 290: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy669, &yymsp[-2].minor.yy63, yymsp[0].minor.yy828); }
break;
- case 282: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
-{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy103, &yymsp[-2].minor.yy225, yymsp[0].minor.yy42); }
+ case 291: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy669, &yymsp[-3].minor.yy63, &yymsp[0].minor.yy63, false); }
break;
- case 283: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy103, &yymsp[-3].minor.yy225, &yymsp[0].minor.yy225, false); }
+ case 292: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy669, &yymsp[-5].minor.yy63, &yymsp[0].minor.yy63, true); }
break;
- case 284: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy103, &yymsp[-5].minor.yy225, &yymsp[0].minor.yy225, true); }
+ case 293: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy669, &yymsp[-3].minor.yy63, yymsp[0].minor.yy828, false); }
break;
- case 285: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy103, &yymsp[-3].minor.yy225, yymsp[0].minor.yy42, false); }
+ case 294: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy669, &yymsp[-5].minor.yy63, yymsp[0].minor.yy828, true); }
break;
- case 286: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy103, &yymsp[-5].minor.yy225, yymsp[0].minor.yy42, true); }
+ case 295: /* cmd ::= DROP TOPIC exists_opt topic_name */
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy669, &yymsp[0].minor.yy63); }
break;
- case 287: /* cmd ::= DROP TOPIC exists_opt topic_name */
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy103, &yymsp[0].minor.yy225); }
+ case 296: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy669, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63); }
break;
- case 288: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
-{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy103, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225); }
+ case 297: /* cmd ::= DESC full_table_name */
+ case 298: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==298);
+{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy828); }
break;
- case 289: /* cmd ::= DESC full_table_name */
- case 290: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==290);
-{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy42); }
- break;
- case 291: /* cmd ::= RESET QUERY CACHE */
+ case 299: /* cmd ::= RESET QUERY CACHE */
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
break;
- case 292: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
- case 293: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==293);
-{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy103, yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 300: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
+ case 301: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==301);
+{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy669, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 296: /* explain_options ::= */
-{ yymsp[1].minor.yy42 = createDefaultExplainOptions(pCxt); }
+ case 304: /* explain_options ::= */
+{ yymsp[1].minor.yy828 = createDefaultExplainOptions(pCxt); }
break;
- case 297: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-{ yylhsminor.yy42 = setExplainVerbose(pCxt, yymsp[-2].minor.yy42, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 305: /* explain_options ::= explain_options VERBOSE NK_BOOL */
+{ yylhsminor.yy828 = setExplainVerbose(pCxt, yymsp[-2].minor.yy828, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 298: /* explain_options ::= explain_options RATIO NK_FLOAT */
-{ yylhsminor.yy42 = setExplainRatio(pCxt, yymsp[-2].minor.yy42, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 306: /* explain_options ::= explain_options RATIO NK_FLOAT */
+{ yylhsminor.yy828 = setExplainRatio(pCxt, yymsp[-2].minor.yy828, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 299: /* 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.yy103, yymsp[-8].minor.yy103, &yymsp[-5].minor.yy225, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy448, yymsp[0].minor.yy508); }
+ case 307: /* cmd ::= CREATE 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.yy669, yymsp[-9].minor.yy669, &yymsp[-6].minor.yy63, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy686, yymsp[-1].minor.yy332, &yymsp[0].minor.yy63); }
break;
- case 300: /* cmd ::= DROP FUNCTION exists_opt function_name */
-{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy103, &yymsp[0].minor.yy225); }
+ case 308: /* cmd ::= DROP FUNCTION exists_opt function_name */
+{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy669, &yymsp[0].minor.yy63); }
break;
- case 305: /* 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.yy103, &yymsp[-8].minor.yy225, yymsp[-5].minor.yy42, yymsp[-7].minor.yy42, yymsp[-3].minor.yy110, yymsp[-2].minor.yy42, yymsp[0].minor.yy42, yymsp[-4].minor.yy110); }
+ case 313: /* language_opt ::= */
+{ yymsp[1].minor.yy63 = nil_token; }
break;
- case 306: /* cmd ::= DROP STREAM exists_opt stream_name */
-{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy103, &yymsp[0].minor.yy225); }
+ case 314: /* language_opt ::= LANGUAGE NK_STRING */
+{ yymsp[-1].minor.yy63 = yymsp[0].minor.yy0; }
break;
- case 313: /* stream_options ::= stream_options TRIGGER AT_ONCE */
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 315: /* 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.yy669, &yymsp[-8].minor.yy63, yymsp[-5].minor.yy828, yymsp[-7].minor.yy828, yymsp[-3].minor.yy222, yymsp[-2].minor.yy828, yymsp[0].minor.yy828, yymsp[-4].minor.yy222); }
break;
- case 314: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 316: /* cmd ::= DROP STREAM exists_opt stream_name */
+{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy669, &yymsp[0].minor.yy63); }
break;
- case 315: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
-{ ((SStreamOptions*)yymsp[-3].minor.yy42)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy42)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); yylhsminor.yy42 = yymsp[-3].minor.yy42; }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 323: /* stream_options ::= stream_options TRIGGER AT_ONCE */
+ case 324: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==324);
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-2].minor.yy828, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 317: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
-{ ((SStreamOptions*)yymsp[-3].minor.yy42)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy42 = yymsp[-3].minor.yy42; }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 325: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-3].minor.yy828, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 318: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
-{ ((SStreamOptions*)yymsp[-2].minor.yy42)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy42 = yymsp[-2].minor.yy42; }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 326: /* stream_options ::= stream_options WATERMARK duration_literal */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-2].minor.yy828, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 320: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
-{ ((SStreamOptions*)yymsp[-3].minor.yy42)->ignoreUpdate = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy42 = yymsp[-3].minor.yy42; }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 327: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-3].minor.yy828, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 322: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
- case 511: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==511);
- case 531: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==531);
-{ yymsp[-3].minor.yy42 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy42); }
+ case 328: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-2].minor.yy828, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 323: /* cmd ::= KILL CONNECTION NK_INTEGER */
+ case 329: /* stream_options ::= stream_options DELETE_MARK duration_literal */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-2].minor.yy828, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 330: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+{ yylhsminor.yy828 = setStreamOptions(pCxt, yymsp[-3].minor.yy828, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
+ break;
+ case 332: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
+ case 521: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==521);
+ case 541: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==541);
+{ yymsp[-3].minor.yy828 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy828); }
+ break;
+ case 333: /* cmd ::= KILL CONNECTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
break;
- case 324: /* cmd ::= KILL QUERY NK_STRING */
+ case 334: /* cmd ::= KILL QUERY NK_STRING */
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 325: /* cmd ::= KILL TRANSACTION NK_INTEGER */
+ case 335: /* cmd ::= KILL TRANSACTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
break;
- case 326: /* cmd ::= BALANCE VGROUP */
+ case 336: /* cmd ::= BALANCE VGROUP */
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
break;
- case 327: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+ case 337: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 328: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy110); }
+ case 338: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy222); }
break;
- case 329: /* cmd ::= SPLIT VGROUP NK_INTEGER */
+ case 339: /* cmd ::= SPLIT VGROUP NK_INTEGER */
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 330: /* dnode_list ::= DNODE NK_INTEGER */
-{ yymsp[-1].minor.yy110 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ case 340: /* dnode_list ::= DNODE NK_INTEGER */
+{ yymsp[-1].minor.yy222 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
break;
- case 332: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
-{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 342: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
+{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 335: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
-{ yymsp[-6].minor.yy42 = createInsertStmt(pCxt, yymsp[-4].minor.yy42, yymsp[-2].minor.yy110, yymsp[0].minor.yy42); }
+ case 345: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+{ yymsp[-6].minor.yy828 = createInsertStmt(pCxt, yymsp[-4].minor.yy828, yymsp[-2].minor.yy222, yymsp[0].minor.yy828); }
break;
- case 336: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
-{ yymsp[-3].minor.yy42 = createInsertStmt(pCxt, yymsp[-1].minor.yy42, NULL, yymsp[0].minor.yy42); }
+ case 346: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
+{ yymsp[-3].minor.yy828 = createInsertStmt(pCxt, yymsp[-1].minor.yy828, NULL, yymsp[0].minor.yy828); }
break;
- case 337: /* literal ::= NK_INTEGER */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 347: /* literal ::= NK_INTEGER */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 338: /* literal ::= NK_FLOAT */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 348: /* literal ::= NK_FLOAT */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 339: /* literal ::= NK_STRING */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 349: /* literal ::= NK_STRING */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 340: /* literal ::= NK_BOOL */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 350: /* literal ::= NK_BOOL */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 341: /* literal ::= TIMESTAMP NK_STRING */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 351: /* literal ::= TIMESTAMP NK_STRING */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 342: /* literal ::= duration_literal */
- case 352: /* signed_literal ::= signed */ yytestcase(yyruleno==352);
- case 373: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==373);
- case 374: /* expression ::= literal */ yytestcase(yyruleno==374);
- case 375: /* expression ::= pseudo_column */ yytestcase(yyruleno==375);
- case 376: /* expression ::= column_reference */ yytestcase(yyruleno==376);
- case 377: /* expression ::= function_expression */ yytestcase(yyruleno==377);
- case 378: /* expression ::= case_when_expression */ yytestcase(yyruleno==378);
- case 409: /* function_expression ::= literal_func */ yytestcase(yyruleno==409);
- case 458: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==458);
- case 462: /* boolean_primary ::= predicate */ yytestcase(yyruleno==462);
- case 464: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==464);
- case 465: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==465);
- case 468: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==468);
- case 470: /* table_reference ::= table_primary */ yytestcase(yyruleno==470);
- case 471: /* table_reference ::= joined_table */ yytestcase(yyruleno==471);
- case 475: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==475);
- case 533: /* query_simple ::= query_specification */ yytestcase(yyruleno==533);
- case 534: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==534);
- case 537: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==537);
- case 539: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==539);
-{ yylhsminor.yy42 = yymsp[0].minor.yy42; }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 352: /* literal ::= duration_literal */
+ case 362: /* signed_literal ::= signed */ yytestcase(yyruleno==362);
+ case 383: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==383);
+ case 384: /* expression ::= literal */ yytestcase(yyruleno==384);
+ case 385: /* expression ::= pseudo_column */ yytestcase(yyruleno==385);
+ case 386: /* expression ::= column_reference */ yytestcase(yyruleno==386);
+ case 387: /* expression ::= function_expression */ yytestcase(yyruleno==387);
+ case 388: /* expression ::= case_when_expression */ yytestcase(yyruleno==388);
+ case 419: /* function_expression ::= literal_func */ yytestcase(yyruleno==419);
+ case 468: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==468);
+ case 472: /* boolean_primary ::= predicate */ yytestcase(yyruleno==472);
+ case 474: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==474);
+ case 475: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==475);
+ case 478: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==478);
+ case 480: /* table_reference ::= table_primary */ yytestcase(yyruleno==480);
+ case 481: /* table_reference ::= joined_table */ yytestcase(yyruleno==481);
+ case 485: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==485);
+ case 543: /* query_simple ::= query_specification */ yytestcase(yyruleno==543);
+ case 544: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==544);
+ case 547: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==547);
+ case 549: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==549);
+{ yylhsminor.yy828 = yymsp[0].minor.yy828; }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 343: /* literal ::= NULL */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 353: /* literal ::= NULL */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 344: /* literal ::= NK_QUESTION */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 354: /* literal ::= NK_QUESTION */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 345: /* duration_literal ::= NK_VARIABLE */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 355: /* duration_literal ::= NK_VARIABLE */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 346: /* signed ::= NK_INTEGER */
-{ yylhsminor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 356: /* signed ::= NK_INTEGER */
+{ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 347: /* signed ::= NK_PLUS NK_INTEGER */
-{ yymsp[-1].minor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+ case 357: /* signed ::= NK_PLUS NK_INTEGER */
+{ yymsp[-1].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
break;
- case 348: /* signed ::= NK_MINUS NK_INTEGER */
+ case 358: /* 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.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
+ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 349: /* signed ::= NK_FLOAT */
-{ yylhsminor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 359: /* signed ::= NK_FLOAT */
+{ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 350: /* signed ::= NK_PLUS NK_FLOAT */
-{ yymsp[-1].minor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ case 360: /* signed ::= NK_PLUS NK_FLOAT */
+{ yymsp[-1].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
break;
- case 351: /* signed ::= NK_MINUS NK_FLOAT */
+ case 361: /* 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.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
+ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 353: /* signed_literal ::= NK_STRING */
-{ yylhsminor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 363: /* signed_literal ::= NK_STRING */
+{ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 354: /* signed_literal ::= NK_BOOL */
-{ yylhsminor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 364: /* signed_literal ::= NK_BOOL */
+{ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 355: /* signed_literal ::= TIMESTAMP NK_STRING */
-{ yymsp[-1].minor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ case 365: /* signed_literal ::= TIMESTAMP NK_STRING */
+{ yymsp[-1].minor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
break;
- case 356: /* signed_literal ::= duration_literal */
- case 358: /* signed_literal ::= literal_func */ yytestcase(yyruleno==358);
- case 429: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==429);
- case 491: /* select_item ::= common_expression */ yytestcase(yyruleno==491);
- case 501: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==501);
- case 538: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==538);
- case 540: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==540);
- case 553: /* search_condition ::= common_expression */ yytestcase(yyruleno==553);
-{ yylhsminor.yy42 = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 366: /* signed_literal ::= duration_literal */
+ case 368: /* signed_literal ::= literal_func */ yytestcase(yyruleno==368);
+ case 439: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==439);
+ case 501: /* select_item ::= common_expression */ yytestcase(yyruleno==501);
+ case 511: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==511);
+ case 548: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==548);
+ case 550: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==550);
+ case 563: /* search_condition ::= common_expression */ yytestcase(yyruleno==563);
+{ yylhsminor.yy828 = releaseRawExprNode(pCxt, yymsp[0].minor.yy828); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 357: /* signed_literal ::= NULL */
-{ yylhsminor.yy42 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 367: /* signed_literal ::= NULL */
+{ yylhsminor.yy828 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 359: /* signed_literal ::= NK_QUESTION */
-{ yylhsminor.yy42 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 369: /* signed_literal ::= NK_QUESTION */
+{ yylhsminor.yy828 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 379: /* expression ::= NK_LP expression NK_RP */
- case 463: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==463);
- case 552: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==552);
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy42)); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 389: /* expression ::= NK_LP expression NK_RP */
+ case 473: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==473);
+ case 562: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==562);
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy828)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 380: /* expression ::= NK_PLUS expr_or_subquery */
+ case 390: /* expression ::= NK_PLUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy42));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy828));
}
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 381: /* expression ::= NK_MINUS expr_or_subquery */
+ case 391: /* expression ::= NK_MINUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy42), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy828), NULL));
}
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 382: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
+ case 392: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 383: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
+ case 393: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 384: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
+ case 394: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 385: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
+ case 395: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 386: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
+ case 396: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 387: /* expression ::= column_reference NK_ARROW NK_STRING */
+ case 397: /* expression ::= column_reference NK_ARROW NK_STRING */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 388: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
+ case 398: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 389: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
+ case 399: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 392: /* column_reference ::= column_name */
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy225, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy225)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 402: /* column_reference ::= column_name */
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy63, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy63)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 393: /* column_reference ::= table_name NK_DOT column_name */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225, createColumnNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225)); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 403: /* column_reference ::= table_name NK_DOT column_name */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63, createColumnNode(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy63)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 394: /* pseudo_column ::= ROWTS */
- case 395: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==395);
- case 397: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==397);
- case 398: /* pseudo_column ::= QEND */ yytestcase(yyruleno==398);
- case 399: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==399);
- case 400: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==400);
- case 401: /* pseudo_column ::= WEND */ yytestcase(yyruleno==401);
- case 402: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==402);
- case 403: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==403);
- case 404: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==404);
- case 405: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==405);
- case 411: /* literal_func ::= NOW */ yytestcase(yyruleno==411);
-{ yylhsminor.yy42 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 404: /* pseudo_column ::= ROWTS */
+ case 405: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==405);
+ case 407: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==407);
+ case 408: /* pseudo_column ::= QEND */ yytestcase(yyruleno==408);
+ case 409: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==409);
+ case 410: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==410);
+ case 411: /* pseudo_column ::= WEND */ yytestcase(yyruleno==411);
+ case 412: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==412);
+ case 413: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==413);
+ case 414: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==414);
+ case 415: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==415);
+ case 421: /* literal_func ::= NOW */ yytestcase(yyruleno==421);
+{ yylhsminor.yy828 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 396: /* pseudo_column ::= table_name NK_DOT TBNAME */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy225)))); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 406: /* pseudo_column ::= table_name NK_DOT TBNAME */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy63)))); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 406: /* function_expression ::= function_name NK_LP expression_list NK_RP */
- case 407: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==407);
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy225, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-1].minor.yy110)); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 416: /* function_expression ::= function_name NK_LP expression_list NK_RP */
+ case 417: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==417);
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy63, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy63, yymsp[-1].minor.yy222)); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 408: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), yymsp[-1].minor.yy448)); }
- yymsp[-5].minor.yy42 = yylhsminor.yy42;
+ case 418: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), yymsp[-1].minor.yy686)); }
+ yymsp[-5].minor.yy828 = yylhsminor.yy828;
break;
- case 410: /* literal_func ::= noarg_func NK_LP NK_RP */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy225, NULL)); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 420: /* literal_func ::= noarg_func NK_LP NK_RP */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy63, NULL)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 425: /* star_func_para_list ::= NK_STAR */
-{ yylhsminor.yy110 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+ case 435: /* star_func_para_list ::= NK_STAR */
+{ yylhsminor.yy222 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
- case 430: /* star_func_para ::= table_name NK_DOT NK_STAR */
- case 494: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==494);
-{ yylhsminor.yy42 = createColumnNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 440: /* star_func_para ::= table_name NK_DOT NK_STAR */
+ case 504: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==504);
+{ yylhsminor.yy828 = createColumnNode(pCxt, &yymsp[-2].minor.yy63, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 431: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy110, yymsp[-1].minor.yy42)); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 441: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy222, yymsp[-1].minor.yy828)); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 432: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), yymsp[-2].minor.yy110, yymsp[-1].minor.yy42)); }
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ case 442: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), yymsp[-2].minor.yy222, yymsp[-1].minor.yy828)); }
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 435: /* when_then_expr ::= WHEN common_expression THEN common_expression */
-{ yymsp[-3].minor.yy42 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)); }
+ case 445: /* when_then_expr ::= WHEN common_expression THEN common_expression */
+{ yymsp[-3].minor.yy828 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)); }
break;
- case 437: /* case_when_else_opt ::= ELSE common_expression */
-{ yymsp[-1].minor.yy42 = releaseRawExprNode(pCxt, yymsp[0].minor.yy42); }
+ case 447: /* case_when_else_opt ::= ELSE common_expression */
+{ yymsp[-1].minor.yy828 = releaseRawExprNode(pCxt, yymsp[0].minor.yy828); }
break;
- case 438: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
- case 443: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==443);
+ case 448: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
+ case 453: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==453);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy2, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy62, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 439: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
+ case 449: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy42), releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy828), releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-4].minor.yy42 = yylhsminor.yy42;
+ yymsp[-4].minor.yy828 = yylhsminor.yy828;
break;
- case 440: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
+ case 450: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy42), releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy828), releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-5].minor.yy42 = yylhsminor.yy42;
+ yymsp[-5].minor.yy828 = yylhsminor.yy828;
break;
- case 441: /* predicate ::= expr_or_subquery IS NULL */
+ case 451: /* predicate ::= expr_or_subquery IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), NULL));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 442: /* predicate ::= expr_or_subquery IS NOT NULL */
+ case 452: /* predicate ::= expr_or_subquery IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), NULL));
}
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 444: /* compare_op ::= NK_LT */
-{ yymsp[0].minor.yy2 = OP_TYPE_LOWER_THAN; }
+ case 454: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy62 = OP_TYPE_LOWER_THAN; }
break;
- case 445: /* compare_op ::= NK_GT */
-{ yymsp[0].minor.yy2 = OP_TYPE_GREATER_THAN; }
+ case 455: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy62 = OP_TYPE_GREATER_THAN; }
break;
- case 446: /* compare_op ::= NK_LE */
-{ yymsp[0].minor.yy2 = OP_TYPE_LOWER_EQUAL; }
+ case 456: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy62 = OP_TYPE_LOWER_EQUAL; }
break;
- case 447: /* compare_op ::= NK_GE */
-{ yymsp[0].minor.yy2 = OP_TYPE_GREATER_EQUAL; }
+ case 457: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy62 = OP_TYPE_GREATER_EQUAL; }
break;
- case 448: /* compare_op ::= NK_NE */
-{ yymsp[0].minor.yy2 = OP_TYPE_NOT_EQUAL; }
+ case 458: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy62 = OP_TYPE_NOT_EQUAL; }
break;
- case 449: /* compare_op ::= NK_EQ */
-{ yymsp[0].minor.yy2 = OP_TYPE_EQUAL; }
+ case 459: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy62 = OP_TYPE_EQUAL; }
break;
- case 450: /* compare_op ::= LIKE */
-{ yymsp[0].minor.yy2 = OP_TYPE_LIKE; }
+ case 460: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy62 = OP_TYPE_LIKE; }
break;
- case 451: /* compare_op ::= NOT LIKE */
-{ yymsp[-1].minor.yy2 = OP_TYPE_NOT_LIKE; }
+ case 461: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy62 = OP_TYPE_NOT_LIKE; }
break;
- case 452: /* compare_op ::= MATCH */
-{ yymsp[0].minor.yy2 = OP_TYPE_MATCH; }
+ case 462: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy62 = OP_TYPE_MATCH; }
break;
- case 453: /* compare_op ::= NMATCH */
-{ yymsp[0].minor.yy2 = OP_TYPE_NMATCH; }
+ case 463: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy62 = OP_TYPE_NMATCH; }
break;
- case 454: /* compare_op ::= CONTAINS */
-{ yymsp[0].minor.yy2 = OP_TYPE_JSON_CONTAINS; }
+ case 464: /* compare_op ::= CONTAINS */
+{ yymsp[0].minor.yy62 = OP_TYPE_JSON_CONTAINS; }
break;
- case 455: /* in_op ::= IN */
-{ yymsp[0].minor.yy2 = OP_TYPE_IN; }
+ case 465: /* in_op ::= IN */
+{ yymsp[0].minor.yy62 = OP_TYPE_IN; }
break;
- case 456: /* in_op ::= NOT IN */
-{ yymsp[-1].minor.yy2 = OP_TYPE_NOT_IN; }
+ case 466: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy62 = OP_TYPE_NOT_IN; }
break;
- case 457: /* in_predicate_value ::= NK_LP literal_list NK_RP */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy110)); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 467: /* in_predicate_value ::= NK_LP literal_list NK_RP */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy222)); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 459: /* boolean_value_expression ::= NOT boolean_primary */
+ case 469: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy42), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy828), NULL));
}
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 460: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ case 470: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 461: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ case 471: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy42);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy42);
- yylhsminor.yy42 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), releaseRawExprNode(pCxt, yymsp[0].minor.yy42)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy828);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy828);
+ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), releaseRawExprNode(pCxt, yymsp[0].minor.yy828)));
}
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 467: /* from_clause_opt ::= FROM table_reference_list */
- case 496: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==496);
- case 527: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==527);
-{ yymsp[-1].minor.yy42 = yymsp[0].minor.yy42; }
+ case 477: /* from_clause_opt ::= FROM table_reference_list */
+ case 506: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==506);
+ case 537: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==537);
+{ yymsp[-1].minor.yy828 = yymsp[0].minor.yy828; }
break;
- case 469: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-{ yylhsminor.yy42 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy42, yymsp[0].minor.yy42, NULL); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 479: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy828 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy828, yymsp[0].minor.yy828, NULL); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 472: /* table_primary ::= table_name alias_opt */
-{ yylhsminor.yy42 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 482: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy828 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy63, &yymsp[0].minor.yy63); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 473: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-{ yylhsminor.yy42 = createRealTableNode(pCxt, &yymsp[-3].minor.yy225, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 483: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy828 = createRealTableNode(pCxt, &yymsp[-3].minor.yy63, &yymsp[-1].minor.yy63, &yymsp[0].minor.yy63); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 474: /* table_primary ::= subquery alias_opt */
-{ yylhsminor.yy42 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy42), &yymsp[0].minor.yy225); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 484: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy828 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy828), &yymsp[0].minor.yy63); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 476: /* alias_opt ::= */
-{ yymsp[1].minor.yy225 = nil_token; }
+ case 486: /* alias_opt ::= */
+{ yymsp[1].minor.yy63 = nil_token; }
break;
- case 478: /* alias_opt ::= AS table_alias */
-{ yymsp[-1].minor.yy225 = yymsp[0].minor.yy225; }
+ case 488: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy63 = yymsp[0].minor.yy63; }
break;
- case 479: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 480: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==480);
-{ yymsp[-2].minor.yy42 = yymsp[-1].minor.yy42; }
+ case 489: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 490: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==490);
+{ yymsp[-2].minor.yy828 = yymsp[-1].minor.yy828; }
break;
- case 481: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-{ yylhsminor.yy42 = createJoinTableNode(pCxt, yymsp[-4].minor.yy638, yymsp[-5].minor.yy42, yymsp[-2].minor.yy42, yymsp[0].minor.yy42); }
- yymsp[-5].minor.yy42 = yylhsminor.yy42;
+ case 491: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+{ yylhsminor.yy828 = createJoinTableNode(pCxt, yymsp[-4].minor.yy574, yymsp[-5].minor.yy828, yymsp[-2].minor.yy828, yymsp[0].minor.yy828); }
+ yymsp[-5].minor.yy828 = yylhsminor.yy828;
break;
- case 482: /* join_type ::= */
-{ yymsp[1].minor.yy638 = JOIN_TYPE_INNER; }
+ case 492: /* join_type ::= */
+{ yymsp[1].minor.yy574 = JOIN_TYPE_INNER; }
break;
- case 483: /* join_type ::= INNER */
-{ yymsp[0].minor.yy638 = JOIN_TYPE_INNER; }
+ case 493: /* join_type ::= INNER */
+{ yymsp[0].minor.yy574 = JOIN_TYPE_INNER; }
break;
- case 484: /* 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 494: /* 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.yy42 = createSelectStmt(pCxt, yymsp[-10].minor.yy103, yymsp[-9].minor.yy110, yymsp[-8].minor.yy42);
- yymsp[-11].minor.yy42 = addWhereClause(pCxt, yymsp[-11].minor.yy42, yymsp[-7].minor.yy42);
- yymsp[-11].minor.yy42 = addPartitionByClause(pCxt, yymsp[-11].minor.yy42, yymsp[-6].minor.yy110);
- yymsp[-11].minor.yy42 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy42, yymsp[-2].minor.yy42);
- yymsp[-11].minor.yy42 = addGroupByClause(pCxt, yymsp[-11].minor.yy42, yymsp[-1].minor.yy110);
- yymsp[-11].minor.yy42 = addHavingClause(pCxt, yymsp[-11].minor.yy42, yymsp[0].minor.yy42);
- yymsp[-11].minor.yy42 = addRangeClause(pCxt, yymsp[-11].minor.yy42, yymsp[-5].minor.yy42);
- yymsp[-11].minor.yy42 = addEveryClause(pCxt, yymsp[-11].minor.yy42, yymsp[-4].minor.yy42);
- yymsp[-11].minor.yy42 = addFillClause(pCxt, yymsp[-11].minor.yy42, yymsp[-3].minor.yy42);
+ yymsp[-11].minor.yy828 = createSelectStmt(pCxt, yymsp[-10].minor.yy669, yymsp[-9].minor.yy222, yymsp[-8].minor.yy828);
+ yymsp[-11].minor.yy828 = addWhereClause(pCxt, yymsp[-11].minor.yy828, yymsp[-7].minor.yy828);
+ yymsp[-11].minor.yy828 = addPartitionByClause(pCxt, yymsp[-11].minor.yy828, yymsp[-6].minor.yy222);
+ yymsp[-11].minor.yy828 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy828, yymsp[-2].minor.yy828);
+ yymsp[-11].minor.yy828 = addGroupByClause(pCxt, yymsp[-11].minor.yy828, yymsp[-1].minor.yy222);
+ yymsp[-11].minor.yy828 = addHavingClause(pCxt, yymsp[-11].minor.yy828, yymsp[0].minor.yy828);
+ yymsp[-11].minor.yy828 = addRangeClause(pCxt, yymsp[-11].minor.yy828, yymsp[-5].minor.yy828);
+ yymsp[-11].minor.yy828 = addEveryClause(pCxt, yymsp[-11].minor.yy828, yymsp[-4].minor.yy828);
+ yymsp[-11].minor.yy828 = addFillClause(pCxt, yymsp[-11].minor.yy828, yymsp[-3].minor.yy828);
}
break;
- case 487: /* set_quantifier_opt ::= ALL */
-{ yymsp[0].minor.yy103 = false; }
+ case 497: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy669 = false; }
break;
- case 490: /* select_item ::= NK_STAR */
-{ yylhsminor.yy42 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
- yymsp[0].minor.yy42 = yylhsminor.yy42;
+ case 500: /* select_item ::= NK_STAR */
+{ yylhsminor.yy828 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy828 = yylhsminor.yy828;
break;
- case 492: /* select_item ::= common_expression column_alias */
- case 502: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==502);
-{ yylhsminor.yy42 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy42), &yymsp[0].minor.yy225); }
- yymsp[-1].minor.yy42 = yylhsminor.yy42;
+ case 502: /* select_item ::= common_expression column_alias */
+ case 512: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==512);
+{ yylhsminor.yy828 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy828), &yymsp[0].minor.yy63); }
+ yymsp[-1].minor.yy828 = yylhsminor.yy828;
break;
- case 493: /* select_item ::= common_expression AS column_alias */
- case 503: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==503);
-{ yylhsminor.yy42 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), &yymsp[0].minor.yy225); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 503: /* select_item ::= common_expression AS column_alias */
+ case 513: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==513);
+{ yylhsminor.yy828 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), &yymsp[0].minor.yy63); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 498: /* partition_by_clause_opt ::= PARTITION BY partition_list */
- case 523: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==523);
- case 542: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==542);
-{ yymsp[-2].minor.yy110 = yymsp[0].minor.yy110; }
+ case 508: /* partition_by_clause_opt ::= PARTITION BY partition_list */
+ case 533: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==533);
+ case 552: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==552);
+{ yymsp[-2].minor.yy222 = yymsp[0].minor.yy222; }
break;
- case 505: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
-{ yymsp[-5].minor.yy42 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), releaseRawExprNode(pCxt, yymsp[-1].minor.yy42)); }
+ case 515: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
+{ yymsp[-5].minor.yy828 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), releaseRawExprNode(pCxt, yymsp[-1].minor.yy828)); }
break;
- case 506: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
-{ yymsp[-3].minor.yy42 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy42)); }
+ case 516: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+{ yymsp[-3].minor.yy828 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy828)); }
break;
- case 507: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-5].minor.yy42 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), NULL, yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 517: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy828 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), NULL, yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 508: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-7].minor.yy42 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy42), releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), yymsp[-1].minor.yy42, yymsp[0].minor.yy42); }
+ case 518: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy828 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy828), releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), yymsp[-1].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 509: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
-{ yymsp[-6].minor.yy42 = createEventWindowNode(pCxt, yymsp[-3].minor.yy42, yymsp[0].minor.yy42); }
+ case 519: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+{ yymsp[-6].minor.yy828 = createEventWindowNode(pCxt, yymsp[-3].minor.yy828, yymsp[0].minor.yy828); }
break;
- case 513: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-{ yymsp[-3].minor.yy42 = createFillNode(pCxt, yymsp[-1].minor.yy410, NULL); }
+ case 523: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy828 = createFillNode(pCxt, yymsp[-1].minor.yy822, NULL); }
break;
- case 514: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy42 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy110)); }
+ case 524: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy828 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy222)); }
break;
- case 515: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy42 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy110)); }
+ case 525: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy828 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy222)); }
break;
- case 516: /* fill_mode ::= NONE */
-{ yymsp[0].minor.yy410 = FILL_MODE_NONE; }
+ case 526: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy822 = FILL_MODE_NONE; }
break;
- case 517: /* fill_mode ::= PREV */
-{ yymsp[0].minor.yy410 = FILL_MODE_PREV; }
+ case 527: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy822 = FILL_MODE_PREV; }
break;
- case 518: /* fill_mode ::= NULL */
-{ yymsp[0].minor.yy410 = FILL_MODE_NULL; }
+ case 528: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy822 = FILL_MODE_NULL; }
break;
- case 519: /* fill_mode ::= NULL_F */
-{ yymsp[0].minor.yy410 = FILL_MODE_NULL_F; }
+ case 529: /* fill_mode ::= NULL_F */
+{ yymsp[0].minor.yy822 = FILL_MODE_NULL_F; }
break;
- case 520: /* fill_mode ::= LINEAR */
-{ yymsp[0].minor.yy410 = FILL_MODE_LINEAR; }
+ case 530: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy822 = FILL_MODE_LINEAR; }
break;
- case 521: /* fill_mode ::= NEXT */
-{ yymsp[0].minor.yy410 = FILL_MODE_NEXT; }
+ case 531: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy822 = FILL_MODE_NEXT; }
break;
- case 524: /* group_by_list ::= expr_or_subquery */
-{ yylhsminor.yy110 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy42))); }
- yymsp[0].minor.yy110 = yylhsminor.yy110;
+ case 534: /* group_by_list ::= expr_or_subquery */
+{ yylhsminor.yy222 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy828))); }
+ yymsp[0].minor.yy222 = yylhsminor.yy222;
break;
- case 525: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
-{ yylhsminor.yy110 = addNodeToList(pCxt, yymsp[-2].minor.yy110, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy42))); }
- yymsp[-2].minor.yy110 = yylhsminor.yy110;
+ case 535: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+{ yylhsminor.yy222 = addNodeToList(pCxt, yymsp[-2].minor.yy222, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy828))); }
+ yymsp[-2].minor.yy222 = yylhsminor.yy222;
break;
- case 529: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
-{ yymsp[-5].minor.yy42 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy42), releaseRawExprNode(pCxt, yymsp[-1].minor.yy42)); }
+ case 539: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+{ yymsp[-5].minor.yy828 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy828), releaseRawExprNode(pCxt, yymsp[-1].minor.yy828)); }
break;
- case 532: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ case 542: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy42 = addOrderByClause(pCxt, yymsp[-3].minor.yy42, yymsp[-2].minor.yy110);
- yylhsminor.yy42 = addSlimitClause(pCxt, yylhsminor.yy42, yymsp[-1].minor.yy42);
- yylhsminor.yy42 = addLimitClause(pCxt, yylhsminor.yy42, yymsp[0].minor.yy42);
+ yylhsminor.yy828 = addOrderByClause(pCxt, yymsp[-3].minor.yy828, yymsp[-2].minor.yy222);
+ yylhsminor.yy828 = addSlimitClause(pCxt, yylhsminor.yy828, yymsp[-1].minor.yy828);
+ yylhsminor.yy828 = addLimitClause(pCxt, yylhsminor.yy828, yymsp[0].minor.yy828);
}
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 535: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
-{ yylhsminor.yy42 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy42, yymsp[0].minor.yy42); }
- yymsp[-3].minor.yy42 = yylhsminor.yy42;
+ case 545: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+{ yylhsminor.yy828 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy828, yymsp[0].minor.yy828); }
+ yymsp[-3].minor.yy828 = yylhsminor.yy828;
break;
- case 536: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
-{ yylhsminor.yy42 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy42, yymsp[0].minor.yy42); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 546: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+{ yylhsminor.yy828 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy828, yymsp[0].minor.yy828); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 544: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
- case 548: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==548);
-{ yymsp[-1].minor.yy42 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ case 554: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ case 558: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==558);
+{ yymsp[-1].minor.yy828 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 545: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 549: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==549);
-{ yymsp[-3].minor.yy42 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+ case 555: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 559: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==559);
+{ yymsp[-3].minor.yy828 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 546: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 550: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==550);
-{ yymsp[-3].minor.yy42 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+ case 556: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 560: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==560);
+{ yymsp[-3].minor.yy828 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 551: /* subquery ::= NK_LP query_expression NK_RP */
-{ yylhsminor.yy42 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy42); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 561: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy828 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy828); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 556: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
-{ yylhsminor.yy42 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy42), yymsp[-1].minor.yy106, yymsp[0].minor.yy599); }
- yymsp[-2].minor.yy42 = yylhsminor.yy42;
+ case 566: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy828 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy828), yymsp[-1].minor.yy158, yymsp[0].minor.yy675); }
+ yymsp[-2].minor.yy828 = yylhsminor.yy828;
break;
- case 557: /* ordering_specification_opt ::= */
-{ yymsp[1].minor.yy106 = ORDER_ASC; }
+ case 567: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy158 = ORDER_ASC; }
break;
- case 558: /* ordering_specification_opt ::= ASC */
-{ yymsp[0].minor.yy106 = ORDER_ASC; }
+ case 568: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy158 = ORDER_ASC; }
break;
- case 559: /* ordering_specification_opt ::= DESC */
-{ yymsp[0].minor.yy106 = ORDER_DESC; }
+ case 569: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy158 = ORDER_DESC; }
break;
- case 560: /* null_ordering_opt ::= */
-{ yymsp[1].minor.yy599 = NULL_ORDER_DEFAULT; }
+ case 570: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy675 = NULL_ORDER_DEFAULT; }
break;
- case 561: /* null_ordering_opt ::= NULLS FIRST */
-{ yymsp[-1].minor.yy599 = NULL_ORDER_FIRST; }
+ case 571: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy675 = NULL_ORDER_FIRST; }
break;
- case 562: /* null_ordering_opt ::= NULLS LAST */
-{ yymsp[-1].minor.yy599 = NULL_ORDER_LAST; }
+ case 572: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy675 = NULL_ORDER_LAST; }
break;
default:
break;
diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp
index c3f6c3ac72..1af214bfb4 100644
--- a/source/libs/parser/test/mockCatalog.cpp
+++ b/source/libs/parser/test/mockCatalog.cpp
@@ -226,6 +226,7 @@ void generateDatabases(MockCatalogService* mcs) {
generateTestTables(g_mockCatalogService.get(), "cache_db");
generateTestStables(g_mockCatalogService.get(), "cache_db");
mcs->createDatabase("rollup_db", true);
+ mcs->createDatabase("testus", false, 0, TSDB_TIME_PRECISION_NANO);
}
} // namespace
@@ -252,7 +253,8 @@ int32_t __catalogGetCachedTableHashVgroup(SCatalog* pCtg, const SName* pTableNam
return code;
}
-int32_t __catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta) {
+int32_t __catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup,
+ STableMeta** pTableMeta) {
int32_t code = g_mockCatalogService->catalogGetTableMeta(pTableName, pTableMeta, true);
if (code) return code;
code = g_mockCatalogService->catalogGetTableHashVgroup(pTableName, pVgroup, true);
diff --git a/source/libs/parser/test/mockCatalogService.cpp b/source/libs/parser/test/mockCatalogService.cpp
index 71b7c1a678..4d1ef597d0 100644
--- a/source/libs/parser/test/mockCatalogService.cpp
+++ b/source/libs/parser/test/mockCatalogService.cpp
@@ -346,12 +346,13 @@ class MockCatalogServiceImpl {
dnode_.insert(std::make_pair(dnodeId, epSet));
}
- void createDatabase(const string& db, bool rollup, int8_t cacheLast) {
+ void createDatabase(const string& db, bool rollup, int8_t cacheLast, int8_t precision) {
SDbCfgInfo cfg = {0};
if (rollup) {
cfg.pRetensions = taosArrayInit(TARRAY_MIN_SIZE, sizeof(SRetention));
}
cfg.cacheLast = cacheLast;
+ cfg.precision = precision;
dbCfg_.insert(std::make_pair(db, cfg));
}
@@ -681,8 +682,8 @@ void MockCatalogService::createDnode(int32_t dnodeId, const string& host, int16_
impl_->createDnode(dnodeId, host, port);
}
-void MockCatalogService::createDatabase(const string& db, bool rollup, int8_t cacheLast) {
- impl_->createDatabase(db, rollup, cacheLast);
+void MockCatalogService::createDatabase(const string& db, bool rollup, int8_t cacheLast, int8_t precision) {
+ impl_->createDatabase(db, rollup, cacheLast, precision);
}
int32_t MockCatalogService::catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta,
diff --git a/source/libs/parser/test/mockCatalogService.h b/source/libs/parser/test/mockCatalogService.h
index acd7fab8e1..cc955df2b0 100644
--- a/source/libs/parser/test/mockCatalogService.h
+++ b/source/libs/parser/test/mockCatalogService.h
@@ -65,7 +65,8 @@ class MockCatalogService {
void createFunction(const std::string& func, int8_t funcType, int8_t outputType, int32_t outputLen, int32_t bufSize);
void createSmaIndex(const SMCreateSmaReq* pReq);
void createDnode(int32_t dnodeId, const std::string& host, int16_t port);
- void createDatabase(const std::string& db, bool rollup = false, int8_t cacheLast = 0);
+ void createDatabase(const std::string& db, bool rollup = false, int8_t cacheLast = 0,
+ int8_t precision = TSDB_TIME_PRECISION_MILLI);
int32_t catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta, bool onlyCache = false) const;
int32_t catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo, bool onlyCache = false) const;
diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp
index 8ba5802ad6..2dffdae934 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;
@@ -22,12 +24,16 @@ namespace ParserTest {
class ParserInitialCTest : public ParserDdlTest {};
/*
- * COMPACT DATABASE db_name
+ * COMPACT DATABASE db_name [START WITH start_time] [END WITH END_time]
*/
TEST_F(ParserInitialCTest, compact) {
SCompactDbReq expect = {0};
- auto setCompactDbReq = [&](const char* pDb) { snprintf(expect.db, sizeof(expect.db), "0.%s", pDb); };
+ auto setCompactDbReq = [&](const char* pDb, int64_t start = INT64_MIN, int64_t end = INT64_MAX) {
+ snprintf(expect.db, sizeof(expect.db), "0.%s", pDb);
+ expect.timeRange.skey = start;
+ expect.timeRange.ekey = end;
+ };
setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) {
ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_COMPACT_DATABASE_STMT);
@@ -35,10 +41,21 @@ TEST_F(ParserInitialCTest, compact) {
SCompactDbReq req = {0};
ASSERT_EQ(tDeserializeSCompactDbReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req), TSDB_CODE_SUCCESS);
ASSERT_EQ(std::string(req.db), std::string(expect.db));
+ ASSERT_EQ(req.timeRange.skey, expect.timeRange.skey);
+ ASSERT_EQ(req.timeRange.ekey, expect.timeRange.ekey);
});
- setCompactDbReq("wxy_db");
- run("COMPACT DATABASE wxy_db");
+ setCompactDbReq("test");
+ run("COMPACT DATABASE test");
+
+ setCompactDbReq("test", 1678168883000, 1678255283000);
+ run("COMPACT DATABASE test START WITH '2023-03-07 14:01:23' END WITH '2023-03-08 14:01:23'");
+
+ setCompactDbReq("testus", 1673071283000000000);
+ run("COMPACT DATABASE testus START WITH TIMESTAMP '2023-01-07 14:01:23'");
+
+ setCompactDbReq("testus", INT64_MIN, 1675749683000000000);
+ run("COMPACT DATABASE testus END WITH 1675749683000000000");
}
/*
@@ -381,7 +398,8 @@ TEST_F(ParserInitialCTest, createDnode) {
}
/*
- * CREATE [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name AS library_path OUTPUTTYPE type_name [BUFSIZE value]
+ * CREATE [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name
+ * AS library_path OUTPUTTYPE type_name [BUFSIZE value] [LANGUAGE value]
*/
TEST_F(ParserInitialCTest, createFunction) {
useDb("root", "test");
@@ -389,12 +407,13 @@ 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) {
memset(&expect, 0, sizeof(SCreateFuncReq));
strcpy(expect.name, pUdfName);
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;
@@ -412,13 +431,25 @@ TEST_F(ParserInitialCTest, createFunction) {
ASSERT_EQ(req.outputType, expect.outputType);
ASSERT_EQ(req.outputLen, expect.outputLen);
ASSERT_EQ(req.bufSize, expect.bufSize);
+
+ tFreeSCreateFuncReq(&req);
});
- setCreateFuncReq("udf1", TSDB_DATA_TYPE_INT);
- // run("CREATE FUNCTION udf1 AS './build/lib/libudf1.so' OUTPUTTYPE INT");
+ 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("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("udf1", TSDB_DATA_TYPE_INT);
+ run("CREATE FUNCTION udf1 AS 'udf' OUTPUTTYPE INT");
+
+ setCreateFuncReq("udf2", TSDB_DATA_TYPE_DOUBLE, 0, TSDB_FUNC_TYPE_AGGREGATE, 1, 8, TSDB_FUNC_SCRIPT_PYTHON);
+ run("CREATE AGGREGATE FUNCTION IF NOT EXISTS udf2 AS 'udf' OUTPUTTYPE DOUBLE BUFSIZE 8 LANGUAGE 'python'");
}
/*
@@ -781,16 +812,10 @@ TEST_F(ParserInitialCTest, createStream) {
snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb);
expect.igExists = igExists;
expect.sql = taosStrdup(pSql);
- expect.createStb = STREAM_CREATE_STABLE_TRUE;
- expect.triggerType = STREAM_TRIGGER_AT_ONCE;
- expect.maxDelay = 0;
- expect.watermark = 0;
- expect.fillHistory = STREAM_DEFAULT_FILL_HISTORY;
- expect.igExpired = STREAM_DEFAULT_IGNORE_EXPIRED;
};
auto setStreamOptions =
- [&](int8_t createStb = STREAM_CREATE_STABLE_TRUE, int8_t triggerType = STREAM_TRIGGER_AT_ONCE,
+ [&](int8_t createStb = STREAM_CREATE_STABLE_TRUE, int8_t triggerType = STREAM_TRIGGER_WINDOW_CLOSE,
int64_t maxDelay = 0, int64_t watermark = 0, int8_t igExpired = STREAM_DEFAULT_IGNORE_EXPIRED,
int8_t fillHistory = STREAM_DEFAULT_FILL_HISTORY, int8_t igUpdate = STREAM_DEFAULT_IGNORE_UPDATE) {
expect.createStb = createStb;
@@ -852,6 +877,7 @@ TEST_F(ParserInitialCTest, createStream) {
});
setCreateStreamReq("s1", "test", "create stream s1 into st3 as select count(*) from t1 interval(10s)", "st3");
+ setStreamOptions();
run("CREATE STREAM s1 INTO st3 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)");
clearCreateStreamReq();
@@ -872,6 +898,7 @@ TEST_F(ParserInitialCTest, createStream) {
"st3");
addTag("tname", TSDB_DATA_TYPE_VARCHAR, 10 + VARSTR_HEADER_SIZE);
addTag("id", TSDB_DATA_TYPE_INT);
+ setStreamOptions();
run("CREATE STREAM s1 INTO st3 TAGS(tname VARCHAR(10), id INT) SUBTABLE(CONCAT('new-', tname)) "
"AS SELECT _WSTART wstart, COUNT(*) cnt FROM st1 PARTITION BY TBNAME tname, tag1 id INTERVAL(10S)");
clearCreateStreamReq();
diff --git a/source/libs/parser/test/parTestUtil.cpp b/source/libs/parser/test/parTestUtil.cpp
index f18dd4f17f..dfe9fcf96e 100644
--- a/source/libs/parser/test/parTestUtil.cpp
+++ b/source/libs/parser/test/parTestUtil.cpp
@@ -65,15 +65,16 @@ int32_t getLogLevel() { return g_logLevel; }
class ParserTestBaseImpl {
public:
- ParserTestBaseImpl(ParserTestBase* pBase) : pBase_(pBase), sqlNo_(0), sqlNum_(0) {}
+ ParserTestBaseImpl(ParserTestBase* pBase) : pBase_(pBase), sqlNo_(0), sqlNum_(0) {
+ caseEnv_.numOfSkipSql_ = g_skipSql;
+ caseEnv_.numOfLimitSql_ = g_limitSql;
+ }
void login(const std::string& user) { caseEnv_.user_ = user; }
void useDb(const string& acctId, const string& db) {
caseEnv_.acctId_ = acctId;
caseEnv_.db_ = db;
- caseEnv_.numOfSkipSql_ = g_skipSql;
- caseEnv_.numOfLimitSql_ = g_limitSql;
}
void run(const string& sql, int32_t expect, ParserStage checkStage) {
diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c
index 144a9536b9..02a21b66ed 100644
--- a/source/libs/scalar/src/filter.c
+++ b/source/libs/scalar/src/filter.c
@@ -1631,12 +1631,7 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options)
SValueNode *var = (SValueNode *)field->desc;
SDataType *dType = &var->node.resType;
- // if (dType->type == TSDB_DATA_TYPE_VALUE_ARRAY) {
- // qDebug("VAL%d => [type:TS][val:[%" PRIi64 "] - [%" PRId64 "]]", i, *(int64_t *)field->data,
- // *(((int64_t *)field->data) + 1));
- // } else {
qDebug("VAL%d => [type:%d][val:%" PRIx64 "]", i, dType->type, var->datum.i); // TODO
- //}
} else if (field->data) {
qDebug("VAL%d => [type:NIL][val:NIL]", i); // TODO
}
@@ -1956,18 +1951,7 @@ int32_t fltInitValFieldData(SFilterInfo *info) {
fi->data = taosMemoryCalloc(1, bytes);
} else {
- if (dType->type == TSDB_DATA_TYPE_VALUE_ARRAY) { // TIME RANGE
- /*
- fi->data = taosMemoryCalloc(dType->bytes, tDataTypes[type].bytes);
- for (int32_t a = 0; a < dType->bytes; ++a) {
- int64_t *v = taosArrayGet(var->arr, a);
- assignVal((char *)fi->data + a * tDataTypes[type].bytes, (char *)v, 0, type);
- }
- */
- continue;
- } else {
- fi->data = taosMemoryCalloc(1, sizeof(int64_t));
- }
+ fi->data = taosMemoryCalloc(1, sizeof(int64_t));
}
if (dType->type == type) {
diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c
index 3fe016d444..4d803cb638 100644
--- a/source/libs/scalar/src/sclvector.c
+++ b/source/libs/scalar/src/sclvector.c
@@ -915,6 +915,7 @@ int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_
SDataType t = {.type = type};
t.bytes = IS_VAR_DATA_TYPE(t.type)? input->columnData->info.bytes:tDataTypes[type].bytes;
+ t.precision = input->columnData->info.precision;
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
if (code != TSDB_CODE_SUCCESS) {
diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c
index f2b1db19e8..7e7c23f98a 100644
--- a/source/libs/stream/src/streamDispatch.c
+++ b/source/libs/stream/src/streamDispatch.c
@@ -278,6 +278,7 @@ int32_t streamDispatchOneRecoverFinishReq(SStreamTask* pTask, const SStreamRecov
msg.contLen = tlen + sizeof(SMsgHead);
msg.pCont = buf;
msg.msgType = TDMT_STREAM_RECOVER_FINISH;
+ msg.info.noResp = 1;
tmsgSendReq(pEpSet, &msg);
@@ -522,4 +523,3 @@ FREE:
taosFreeQitem(pBlock);
return code;
}
-
diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c
index 9226d6ebb8..cb9774b584 100644
--- a/source/libs/stream/src/streamExec.c
+++ b/source/libs/stream/src/streamExec.c
@@ -20,6 +20,11 @@
static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray* pRes) {
int32_t code;
void* exec = pTask->exec.executor;
+ while(atomic_load_8(&pTask->taskStatus) != TASK_STATUS__NORMAL) {
+ qError("stream task wait for the end of fill history");
+ taosMsleep(2);
+ continue;
+ }
// set input
const SStreamQueueItem* pItem = (const SStreamQueueItem*)data;
@@ -58,6 +63,9 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray*
SSDataBlock* output = NULL;
uint64_t ts = 0;
if ((code = qExecTask(exec, &output, &ts)) < 0) {
+ if (code == TSDB_CODE_QRY_IN_EXEC) {
+ resetTaskInfo(exec);
+ }
/*ASSERT(false);*/
qError("unexpected stream execution, stream %" PRId64 " task: %d, since %s", pTask->streamId, pTask->taskId,
terrstr());
@@ -121,8 +129,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
SSDataBlock* output = NULL;
uint64_t ts = 0;
if (qExecTask(exec, &output, &ts) < 0) {
- taosArrayDestroy(pRes);
- return -1;
+ continue;
}
if (output == NULL) {
if (qStreamRecoverScanFinished(exec)) {
diff --git a/source/libs/stream/src/streamRecover.c b/source/libs/stream/src/streamRecover.c
index 061b211ddf..87058bf490 100644
--- a/source/libs/stream/src/streamRecover.c
+++ b/source/libs/stream/src/streamRecover.c
@@ -168,7 +168,7 @@ int32_t streamRestoreParam(SStreamTask* pTask) {
return qStreamRestoreParam(exec);
}
int32_t streamSetStatusNormal(SStreamTask* pTask) {
- pTask->taskStatus = TASK_STATUS__NORMAL;
+ atomic_store_8(&pTask->taskStatus, TASK_STATUS__NORMAL);
return 0;
}
diff --git a/source/libs/sync/inc/syncReplication.h b/source/libs/sync/inc/syncReplication.h
index f2e240344f..a55fd7ead3 100644
--- a/source/libs/sync/inc/syncReplication.h
+++ b/source/libs/sync/inc/syncReplication.h
@@ -51,7 +51,7 @@ int32_t syncNodeHeartbeatPeers(SSyncNode* pSyncNode);
int32_t syncNodeSendHeartbeat(SSyncNode* pSyncNode, const SRaftId* pDestId, SRpcMsg* pMsg);
int32_t syncNodeReplicate(SSyncNode* pSyncNode);
-int32_t syncNodeReplicateOne(SSyncNode* pSyncNode, SRaftId* pDestId, bool snapshot);
+int32_t syncNodeReplicateReset(SSyncNode* pSyncNode, SRaftId* pDestId);
int32_t syncNodeReplicateWithoutLock(SSyncNode* pNode);
int32_t syncNodeSendAppendEntries(SSyncNode* pNode, const SRaftId* destRaftId, SRpcMsg* pRpcMsg);
diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c
index b07c05dcfe..04e4859c5e 100644
--- a/source/libs/sync/src/syncMain.c
+++ b/source/libs/sync/src/syncMain.c
@@ -285,7 +285,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) {
if (syncNodeIsMnode(pSyncNode)) {
// mnode
- logRetention = SYNC_MNODE_LOG_RETENTION;
+ logRetention = tsMndLogRetention;
} else {
// vnode
if (pSyncNode->replicaNum > 1) {
@@ -301,7 +301,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) {
syncNodeRelease(pSyncNode);
return 0;
}
- logRetention = TMAX(logRetention, lastApplyIndex - pSyncNode->minMatchIndex);
+ logRetention = TMAX(logRetention, lastApplyIndex - pSyncNode->minMatchIndex + logRetention);
}
_DEL_WAL:
diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c
index faa44a626c..cc1a40a430 100644
--- a/source/libs/sync/src/syncPipeline.c
+++ b/source/libs/sync/src/syncPipeline.c
@@ -742,7 +742,8 @@ int32_t syncLogReplMgrProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* p
if (pMsg->matchIndex < pNode->pLogBuf->matchIndex) {
term = syncLogReplMgrGetPrevLogTerm(pMgr, pNode, index + 1);
- if (term < 0 || (term != pMsg->lastMatchTerm && (index + 1 == firstVer || index == firstVer))) {
+ if ((index + 1 < firstVer) || (term < 0) ||
+ (term != pMsg->lastMatchTerm && (index + 1 == firstVer || index == firstVer))) {
ASSERT(term >= 0 || terrno == TSDB_CODE_WAL_LOG_NOT_EXIST);
if (syncNodeStartSnapshot(pNode, &destId) < 0) {
sError("vgId:%d, failed to start snapshot for peer dnode:%d", pNode->vgId, DID(&destId));
diff --git a/source/libs/sync/src/syncRaftStore.c b/source/libs/sync/src/syncRaftStore.c
index 68e735cf0d..bd15567c87 100644
--- a/source/libs/sync/src/syncRaftStore.c
+++ b/source/libs/sync/src/syncRaftStore.c
@@ -139,7 +139,7 @@ int32_t raftStoreWriteFile(SSyncNode *pNode) {
if (taosRenameFile(file, realfile) != 0) goto _OVER;
code = 0;
- sInfo("vgId:%d, succeed to write raft store file:%s, len:%d", pNode->vgId, realfile, len);
+ sInfo("vgId:%d, succeed to write raft store file:%s, term:%" PRId64, pNode->vgId, realfile, pStore->currentTerm);
_OVER:
if (pJson != NULL) tjsonDelete(pJson);
diff --git a/source/libs/sync/src/syncReplication.c b/source/libs/sync/src/syncReplication.c
index 8cdf821cff..1d94b288d3 100644
--- a/source/libs/sync/src/syncReplication.c
+++ b/source/libs/sync/src/syncReplication.c
@@ -48,6 +48,15 @@
int32_t syncNodeMaybeSendAppendEntries(SSyncNode* pSyncNode, const SRaftId* destRaftId, SRpcMsg* pRpcMsg);
+int32_t syncNodeReplicateReset(SSyncNode* pNode, SRaftId* pDestId) {
+ SSyncLogBuffer* pBuf = pNode->pLogBuf;
+ taosThreadMutexLock(&pBuf->mutex);
+ SSyncLogReplMgr* pMgr = syncNodeGetLogReplMgr(pNode, pDestId);
+ syncLogReplMgrReset(pMgr);
+ taosThreadMutexUnlock(&pBuf->mutex);
+ return 0;
+}
+
int32_t syncNodeReplicate(SSyncNode* pNode) {
SSyncLogBuffer* pBuf = pNode->pLogBuf;
taosThreadMutexLock(&pBuf->mutex);
diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c
index 381327d4d7..413d6adf05 100644
--- a/source/libs/sync/src/syncSnapshot.c
+++ b/source/libs/sync/src/syncSnapshot.c
@@ -992,8 +992,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) {
if (pMsg->ack == SYNC_SNAPSHOT_SEQ_END) {
syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "process seq end");
snapshotSenderStop(pSender, true);
- SSyncLogReplMgr *pMgr = syncNodeGetLogReplMgr(pSyncNode, &pMsg->srcId);
- syncLogReplMgrReset(pMgr);
+ syncNodeReplicateReset(pSyncNode, &pMsg->srcId);
return 0;
}
@@ -1018,8 +1017,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) {
syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "receive error ack");
sSError(pSender, "snapshot sender receive error ack:%d, my seq:%d", pMsg->ack, pSender->seq);
snapshotSenderStop(pSender, true);
- SSyncLogReplMgr *pMgr = syncNodeGetLogReplMgr(pSyncNode, &pMsg->srcId);
- syncLogReplMgrReset(pMgr);
+ syncNodeReplicateReset(pSyncNode, &pMsg->srcId);
return -1;
}
@@ -1027,8 +1025,6 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) {
_ERROR:
snapshotSenderStop(pSender, true);
- SSyncLogReplMgr *pMgr = syncNodeGetLogReplMgr(pSyncNode, &pMsg->srcId);
- syncLogReplMgrReset(pMgr);
-
+ syncNodeReplicateReset(pSyncNode, &pMsg->srcId);
return -1;
}
diff --git a/source/libs/transport/inc/transComm.h b/source/libs/transport/inc/transComm.h
index 5ff67c87ca..a2c486767f 100644
--- a/source/libs/transport/inc/transComm.h
+++ b/source/libs/transport/inc/transComm.h
@@ -148,7 +148,8 @@ typedef struct {
int8_t epsetRetryCnt;
int32_t retryCode;
- int hThrdIdx;
+ void* task;
+ int hThrdIdx;
} STransConnCtx;
#pragma pack(push, 1)
diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h
index 1f3c98ad72..8ea0064d44 100644
--- a/source/libs/transport/inc/transportInt.h
+++ b/source/libs/transport/inc/transportInt.h
@@ -64,11 +64,11 @@ typedef struct {
void (*destroyFp)(void* ahandle);
bool (*failFastFp)(tmsg_t msgType);
- int32_t connLimitNum;
- int8_t connLimitLock; // 0: no lock. 1. lock
- int8_t supportBatch; // 0: no batch, 1: support batch
- int32_t batchSize;
-
+ int32_t connLimitNum;
+ int8_t connLimitLock; // 0: no lock. 1. lock
+ int8_t supportBatch; // 0: no batch, 1: support batch
+ int32_t batchSize;
+ int32_t timeToGetConn;
int index;
void* parent;
void* tcphandle; // returned handle from TCP initialization
diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c
index bab86948fa..04b546b36a 100644
--- a/source/libs/transport/src/thttp.c
+++ b/source/libs/transport/src/thttp.c
@@ -26,6 +26,8 @@
#define HTTP_RECV_BUF_SIZE 1024
+static int32_t httpRefMgt = 0;
+static int64_t httpRef = -1;
typedef struct SHttpModule {
uv_loop_t* loop;
SAsyncPool* asyncPool;
@@ -41,7 +43,6 @@ typedef struct SHttpMsg {
int32_t len;
EHttpCompFlag flag;
int8_t quit;
- SHttpModule* http;
} SHttpMsg;
@@ -57,7 +58,6 @@ typedef struct SHttpClient {
} SHttpClient;
static TdThreadOnce transHttpInit = PTHREAD_ONCE_INIT;
-static SHttpModule* thttp = NULL;
static void transHttpEnvInit();
static void httpHandleReq(SHttpMsg* msg);
@@ -280,26 +280,29 @@ static void clientConnCb(uv_connect_t* req, int32_t status) {
}
int32_t httpSendQuit() {
+ SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef);
+ if (http == NULL) return 0;
+
SHttpMsg* msg = taosMemoryCalloc(1, sizeof(SHttpMsg));
msg->quit = 1;
- SHttpModule* load = atomic_load_ptr(&thttp);
- if (load == NULL) {
- httpDestroyMsg(msg);
- tError("http-report already released");
- return -1;
- } else {
- msg->http = load;
- }
- transAsyncSend(load->asyncPool, &(msg->q));
+ transAsyncSend(http->asyncPool, &(msg->q));
+ taosReleaseRef(httpRefMgt, httpRef);
return 0;
}
static int32_t taosSendHttpReportImpl(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen,
EHttpCompFlag flag) {
+ SHttpModule* load = taosAcquireRef(httpRefMgt, httpRef);
+ if (load == NULL) {
+ tError("http-report already released");
+ return -1;
+ }
+
SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg));
+
msg->server = taosStrdup(server);
- msg->uri = taosStrdup(uri);
+ msg->uri = taosStrdup(uri);
msg->port = port;
msg->cont = taosMemoryMalloc(contLen);
memcpy(msg->cont, pCont, contLen);
@@ -307,15 +310,9 @@ static int32_t taosSendHttpReportImpl(const char* server, const char* uri, uint1
msg->flag = flag;
msg->quit = 0;
- SHttpModule* load = atomic_load_ptr(&thttp);
- if (load == NULL) {
- httpDestroyMsg(msg);
- tError("http-report already released");
- return -1;
- }
-
- msg->http = load;
- return transAsyncSend(load->asyncPool, &(msg->q));
+ int ret = transAsyncSend(load->asyncPool, &(msg->q));
+ taosReleaseRef(httpRefMgt, httpRef);
+ return ret;
}
static void httpDestroyClientCb(uv_handle_t* handle) {
@@ -335,13 +332,19 @@ static void httpWalkCb(uv_handle_t* handle, void* arg) {
return;
}
static void httpHandleQuit(SHttpMsg* msg) {
- SHttpModule* http = msg->http;
taosMemoryFree(msg);
+ SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef);
+ if (http == NULL) return;
+
uv_walk(http->loop, httpWalkCb, NULL);
+ taosReleaseRef(httpRefMgt, httpRef);
}
static void httpHandleReq(SHttpMsg* msg) {
- SHttpModule* http = msg->http;
+ SHttpModule* http = taosAcquireRef(httpRefMgt, httpRef);
+ if (http == NULL) {
+ goto END;
+ }
struct sockaddr_in dest = {0};
if (taosBuildDstAddr(msg->server, msg->port, &dest) < 0) {
@@ -391,6 +394,7 @@ static void httpHandleReq(SHttpMsg* msg) {
int ret = uv_tcp_open((uv_tcp_t*)&cli->tcp, fd);
if (ret != 0) {
tError("http-report failed to open socket, reason:%s, dst:%s:%d", uv_strerror(ret), cli->addr, cli->port);
+ taosReleaseRef(httpRefMgt, httpRef);
destroyHttpClient(cli);
return;
}
@@ -401,21 +405,26 @@ static void httpHandleReq(SHttpMsg* msg) {
cli->port);
destroyHttpClient(cli);
}
+ taosReleaseRef(httpRefMgt, httpRef);
return;
END:
tError("http-report failed to report, reason: %s, addr: %s:%d", terrstr(), msg->server, msg->port);
httpDestroyMsg(msg);
+ taosReleaseRef(httpRefMgt, httpRef);
}
-int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen, EHttpCompFlag flag) {
+int32_t taosSendHttpReport(const char* server, const char* uri, uint16_t port, char* pCont, int32_t contLen,
+ EHttpCompFlag flag) {
taosThreadOnce(&transHttpInit, transHttpEnvInit);
return taosSendHttpReportImpl(server, uri, port, pCont, contLen, flag);
}
+static void transHttpDestroyHandle(void* handle) { taosMemoryFree(handle); }
static void transHttpEnvInit() {
- SHttpModule* http = taosMemoryMalloc(sizeof(SHttpModule));
+ httpRefMgt = taosOpenRef(1, transHttpDestroyHandle);
+ SHttpModule* http = taosMemoryMalloc(sizeof(SHttpModule));
http->loop = taosMemoryMalloc(sizeof(uv_loop_t));
uv_loop_init(http->loop);
@@ -426,21 +435,22 @@ static void transHttpEnvInit() {
http = NULL;
return;
}
-
+
int err = taosThreadCreate(&http->thread, NULL, httpThread, (void*)http);
if (err != 0) {
taosMemoryFree(http->loop);
taosMemoryFree(http);
http = NULL;
}
- atomic_store_ptr(&thttp, http);
+ httpRef = taosAddRef(httpRefMgt, http);
}
void transHttpEnvDestroy() {
- SHttpModule* load = atomic_load_ptr(&thttp);
- if (load == NULL) {
+ // remove http
+ if (httpRef == -1) {
return;
}
+ SHttpModule* load = taosAcquireRef(httpRefMgt, httpRef);
httpSendQuit();
taosThreadJoin(load->thread, NULL);
@@ -448,7 +458,7 @@ void transHttpEnvDestroy() {
transAsyncPoolDestroy(load->asyncPool);
uv_loop_close(load->loop);
taosMemoryFree(load->loop);
- taosMemoryFree(load);
- atomic_store_ptr(&thttp, NULL);
+ taosReleaseRef(httpRefMgt, httpRef);
+ taosRemoveRef(httpRefMgt, httpRef);
}
diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c
index f5f3b52f50..0771f9198a 100644
--- a/source/libs/transport/src/trans.c
+++ b/source/libs/transport/src/trans.c
@@ -66,6 +66,10 @@ void* rpcOpen(const SRpcInit* pInit) {
pRpc->destroyFp = pInit->dfp;
pRpc->failFastFp = pInit->ffp;
pRpc->connLimitNum = pInit->connLimitNum;
+ if (pRpc->connLimitNum == 0) {
+ pRpc->connLimitNum = 20;
+ }
+
pRpc->connLimitLock = pInit->connLimitLock;
pRpc->supportBatch = pInit->supportBatch;
pRpc->batchSize = pInit->batchSize;
@@ -90,7 +94,10 @@ void* rpcOpen(const SRpcInit* pInit) {
if (pInit->user) {
tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
}
-
+ pRpc->timeToGetConn = pInit->timeToGetConn;
+ if (pRpc->timeToGetConn == 0) {
+ pRpc->timeToGetConn = 10 * 1000;
+ }
pRpc->tcphandle =
(*taosInitHandle[pRpc->connType])(ip, pInit->localPort, pRpc->label, pRpc->numOfThreads, NULL, pRpc);
diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c
index e008320222..b6f995b11e 100644
--- a/source/libs/transport/src/transCli.c
+++ b/source/libs/transport/src/transCli.c
@@ -11,11 +11,18 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+
#include "transComm.h"
+typedef struct {
+ int32_t numOfConn;
+ queue msgQ;
+} SMsgList;
+
typedef struct SConnList {
- queue conns;
- int32_t size;
+ queue conns;
+ int32_t size;
+ SMsgList* list;
} SConnList;
typedef struct {
@@ -64,15 +71,13 @@ typedef struct SCliConn {
SCliBatch* pBatch;
- int64_t refId;
- char* ip;
-
SDelayTask* task;
- // debug and log info
- char src[32];
- char dst[32];
+ char* ip;
+ char src[32];
+ char dst[32];
+ int64_t refId;
} SCliConn;
typedef struct SCliMsg {
@@ -100,6 +105,7 @@ typedef struct SCliThrd {
TdThreadMutex msgMtx;
SDelayQueue* delayQueue;
SDelayQueue* timeoutQueue;
+ SDelayQueue* waitConnQueue;
uint64_t nextTimeout; // next timeout
void* pTransInst; //
@@ -109,12 +115,14 @@ typedef struct SCliThrd {
SCvtAddr cvtAddr;
SHashObj* failFastCache;
- SHashObj* connLimitCache;
SHashObj* batchCache;
SCliMsg* stopMsg;
bool quit;
+
+ int newConnCount;
+ SHashObj* msgCount;
} SCliThrd;
typedef struct SCliObj {
@@ -131,11 +139,12 @@ typedef struct {
int32_t threshold;
int64_t interval;
} SFailFastItem;
+
// conn pool
// add expire timeout and capacity limit
static void* createConnPool(int size);
-static void* destroyConnPool(void* pool);
-static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port);
+static void* destroyConnPool(SCliThrd* thread);
+static SCliConn* getConnFromPool(SCliThrd* thread, char* key, bool* exceed);
static void addConnToPool(void* pool, SCliConn* conn);
static void doCloseIdleConn(void* param);
@@ -175,7 +184,8 @@ static void cliSend(SCliConn* pConn);
static void cliSendBatch(SCliConn* pConn);
static void cliDestroyConnMsgs(SCliConn* conn, bool destroy);
-static int32_t cliPreCheckSessionLimit(SCliThrd* pThrd, char* ip, uint16_t port);
+static void doFreeTimeoutMsg(void* param);
+static int32_t cliPreCheckSessionLimitForMsg(SCliThrd* pThrd, char* addr, SCliMsg** pMsg);
// cli util func
static FORCE_INLINE bool cliIsEpsetUpdated(int32_t code, STransConnCtx* pCtx);
@@ -193,6 +203,7 @@ static void cliHandleExcept(SCliConn* conn);
static void cliReleaseUnfinishedMsg(SCliConn* conn);
static void cliHandleFastFail(SCliConn* pConn, int status);
+static void doNotifyApp(SCliMsg* pMsg, SCliThrd* pThrd);
// handle req from app
static void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd);
static void cliHandleQuit(SCliMsg* pMsg, SCliThrd* pThrd);
@@ -225,11 +236,11 @@ static void cliWalkCb(uv_handle_t* handle, void* arg);
// snprintf may cause performance problem
#define CONN_CONSTRUCT_HASH_KEY(key, ip, port) \
do { \
- char* p = key; \
- int32_t len = strlen(ip); \
- if (p != NULL) memcpy(p, ip, len); \
- p[len] = ':'; \
- titoa(port, 10, &p[len + 1]); \
+ char* t = key; \
+ int16_t len = strlen(ip); \
+ if (ip != NULL) memcpy(t, ip, len); \
+ t[len] = ':'; \
+ titoa(port, 10, &t[len + 1]); \
} while (0)
#define CONN_PERSIST_TIME(para) ((para) <= 90000 ? 90000 : (para))
@@ -333,12 +344,8 @@ bool cliMaySendCachedMsg(SCliConn* conn) {
if (!transQueueEmpty(&conn->cliMsgs)) {
SCliMsg* pCliMsg = NULL;
CONN_GET_NEXT_SENDMSG(conn);
- if (pCliMsg == NULL)
- return false;
- else {
- cliSend(conn);
- return true;
- }
+ cliSend(conn);
+ return true;
}
return false;
_RETURN:
@@ -362,6 +369,7 @@ void cliHandleResp(SCliConn* conn) {
int32_t msgLen = transDumpFromBuffer(&conn->readBuf, (char**)&pHead);
if (msgLen <= 0) {
+ taosMemoryFree(pHead);
tDebug("%s conn %p recv invalid packet ", CONN_GET_INST_LABEL(conn), conn);
return;
}
@@ -417,6 +425,21 @@ void cliHandleResp(SCliConn* conn) {
tDebug("%s conn %p ref by app", CONN_GET_INST_LABEL(conn), conn);
}
+ // if (TMSG_INFO(pHead->msgType - 1) != 0) {
+ // char buf[128] = {0};
+ // sprintf(buf, "%s", TMSG_INFO(pHead->msgType - 1));
+ // int* count = taosHashGet(pThrd->msgCount, TMSG_INFO(pHead->msgType - 1), strlen(TMSG_INFO(pHead->msgType - 1)));
+ // if (NULL == 0) {
+ // int localCount = 1;
+ // taosHashPut(pThrd->msgCount, TMSG_INFO(pHead->msgType - 1), strlen(TMSG_INFO(pHead->msgType - 1)), &localCount,
+ // sizeof(localCount));
+ // } else {
+ // int localCount = *count - 1;
+ // taosHashPut(pThrd->msgCount, TMSG_INFO(pHead->msgType - 1), strlen(TMSG_INFO(pHead->msgType - 1)), &localCount,
+ // sizeof(localCount));
+ // }
+ // }
+
STraceId* trace = &transMsg.info.traceId;
tGDebug("%s conn %p %s received from %s, local info:%s, len:%d, code str:%s", CONN_GET_INST_LABEL(conn), conn,
TMSG_INFO(pHead->msgType), conn->dst, conn->src, pHead->msgLen, tstrerror(transMsg.code));
@@ -545,7 +568,8 @@ void* createConnPool(int size) {
// thread local, no lock
return taosHashInit(size, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
}
-void* destroyConnPool(void* pool) {
+void* destroyConnPool(SCliThrd* pThrd) {
+ void* pool = pThrd->pool;
SConnList* connList = taosHashIterate((SHashObj*)pool, NULL);
while (connList != NULL) {
while (!QUEUE_IS_EMPTY(&connList->conns)) {
@@ -553,34 +577,131 @@ void* destroyConnPool(void* pool) {
SCliConn* c = QUEUE_DATA(h, SCliConn, q);
cliDestroyConn(c, true);
}
+
+ SMsgList* msglist = connList->list;
+ while (!QUEUE_IS_EMPTY(&msglist->msgQ)) {
+ queue* h = QUEUE_HEAD(&msglist->msgQ);
+ QUEUE_REMOVE(h);
+
+ SCliMsg* pMsg = QUEUE_DATA(h, SCliMsg, q);
+
+ transDQCancel(pThrd->waitConnQueue, pMsg->ctx->task);
+ pMsg->ctx->task = NULL;
+
+ doNotifyApp(pMsg, pThrd);
+ }
+ taosMemoryFree(msglist);
+
connList = taosHashIterate((SHashObj*)pool, connList);
}
taosHashCleanup(pool);
return NULL;
}
-static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
- char key[TSDB_FQDN_LEN + 64] = {0};
- CONN_CONSTRUCT_HASH_KEY(key, ip, port);
+static SCliConn* getConnFromPool(SCliThrd* pThrd, char* key, bool* exceed) {
+ void* pool = pThrd->pool;
+ SConnList* plist = taosHashGet((SHashObj*)pool, key, strlen(key));
+ STrans* pTranInst = pThrd->pTransInst;
+ if (plist == NULL) {
+ SConnList list = {0};
+ taosHashPut((SHashObj*)pool, key, strlen(key), (void*)&list, sizeof(list));
+ plist = taosHashGet(pool, key, strlen(key));
+ SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
+ QUEUE_INIT(&nList->msgQ);
+ nList->numOfConn++;
+
+ QUEUE_INIT(&plist->conns);
+ plist->list = nList;
+ }
+
+ if (QUEUE_IS_EMPTY(&plist->conns)) {
+ if (plist->list->numOfConn >= pTranInst->connLimitNum) {
+ *exceed = true;
+ }
+ return NULL;
+ }
+
+ queue* h = QUEUE_TAIL(&plist->conns);
+ QUEUE_REMOVE(h);
+ plist->size -= 1;
+
+ SCliConn* conn = QUEUE_DATA(h, SCliConn, q);
+ conn->status = ConnNormal;
+ QUEUE_INIT(&conn->q);
+
+ if (conn->task != NULL) {
+ transDQCancel(((SCliThrd*)conn->hostThrd)->timeoutQueue, conn->task);
+ conn->task = NULL;
+ }
+ return conn;
+}
+
+static SCliConn* getConnFromPool2(SCliThrd* pThrd, char* key, SCliMsg** pMsg) {
+ void* pool = pThrd->pool;
+ STrans* pTransInst = pThrd->pTransInst;
SConnList* plist = taosHashGet((SHashObj*)pool, key, strlen(key));
if (plist == NULL) {
SConnList list = {0};
taosHashPut((SHashObj*)pool, key, strlen(key), (void*)&list, sizeof(list));
- plist = taosHashGet((SHashObj*)pool, key, strlen(key));
- if (plist == NULL) return NULL;
+ plist = taosHashGet(pool, key, strlen(key));
+
+ SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
+ QUEUE_INIT(&nList->msgQ);
+ nList->numOfConn++;
+
QUEUE_INIT(&plist->conns);
+ plist->list = nList;
}
+ STraceId* trace = &(*pMsg)->msg.info.traceId;
+ // no avaliable conn in pool
if (QUEUE_IS_EMPTY(&plist->conns)) {
+ SMsgList* list = plist->list;
+ if ((list)->numOfConn >= pTransInst->connLimitNum) {
+ STraceId* trace = &(*pMsg)->msg.info.traceId;
+ STaskArg* arg = taosMemoryMalloc(sizeof(STaskArg));
+ arg->param1 = *pMsg;
+ arg->param2 = pThrd;
+ (*pMsg)->ctx->task = transDQSched(pThrd->waitConnQueue, doFreeTimeoutMsg, arg, pTransInst->timeToGetConn);
+
+ tGTrace("%s msg %s delay to send, wait for avaiable connect", pTransInst->label, TMSG_INFO((*pMsg)->msg.msgType));
+
+ QUEUE_PUSH(&(list)->msgQ, &(*pMsg)->q);
+ *pMsg = NULL;
+ } else {
+ // send msg in delay queue
+ if (!(QUEUE_IS_EMPTY(&(list)->msgQ))) {
+ STaskArg* arg = taosMemoryMalloc(sizeof(STaskArg));
+ arg->param1 = *pMsg;
+ arg->param2 = pThrd;
+ (*pMsg)->ctx->task = transDQSched(pThrd->waitConnQueue, doFreeTimeoutMsg, arg, pTransInst->timeToGetConn);
+ tGTrace("%s msg %s delay to send, wait for avaiable connect", pTransInst->label,
+ TMSG_INFO((*pMsg)->msg.msgType));
+
+ QUEUE_PUSH(&(list)->msgQ, &(*pMsg)->q);
+ queue* h = QUEUE_HEAD(&(list)->msgQ);
+ QUEUE_REMOVE(h);
+ SCliMsg* ans = QUEUE_DATA(h, SCliMsg, q);
+
+ *pMsg = ans;
+
+ trace = &(*pMsg)->msg.info.traceId;
+ tGTrace("%s msg %s pop from delay queue, start to send", pTransInst->label, TMSG_INFO((*pMsg)->msg.msgType));
+ transDQCancel(pThrd->waitConnQueue, ans->ctx->task);
+ }
+ list->numOfConn++;
+ }
+ tTrace("%s numOfConn: %d, limit: %d", pTransInst->label, list->numOfConn, pTransInst->connLimitNum);
return NULL;
}
+ queue* h = QUEUE_TAIL(&plist->conns);
plist->size -= 1;
- queue* h = QUEUE_HEAD(&plist->conns);
+ QUEUE_REMOVE(h);
+
SCliConn* conn = QUEUE_DATA(h, SCliConn, q);
conn->status = ConnNormal;
- QUEUE_REMOVE(&conn->q);
QUEUE_INIT(&conn->q);
if (conn->task != NULL) {
@@ -608,18 +729,34 @@ static void addConnToPool(void* pool, SCliConn* conn) {
cliDestroyConnMsgs(conn, false);
- conn->status = ConnInPool;
-
if (conn->list == NULL) {
- tTrace("%s conn %p added to conn pool, read buf cap:%d", CONN_GET_INST_LABEL(conn), conn, conn->readBuf.cap);
conn->list = taosHashGet((SHashObj*)pool, conn->ip, strlen(conn->ip));
- } else {
- tTrace("%s conn %p added to conn pool, read buf cap:%d", CONN_GET_INST_LABEL(conn), conn, conn->readBuf.cap);
}
+
+ SConnList* pList = conn->list;
+ SMsgList* msgList = pList->list;
+ if (!QUEUE_IS_EMPTY(&msgList->msgQ)) {
+ queue* h = QUEUE_HEAD(&(msgList)->msgQ);
+ QUEUE_REMOVE(h);
+
+ SCliMsg* pMsg = QUEUE_DATA(h, SCliMsg, q);
+
+ transDQCancel(thrd->waitConnQueue, pMsg->ctx->task);
+ pMsg->ctx->task = NULL;
+
+ transCtxMerge(&conn->ctx, &pMsg->ctx->appCtx);
+ transQueuePush(&conn->cliMsgs, pMsg);
+
+ conn->status = ConnNormal;
+ cliSend(conn);
+ return;
+ }
+
+ conn->status = ConnInPool;
QUEUE_PUSH(&conn->list->conns, &conn->q);
conn->list->size += 1;
- if (conn->list->size >= 250) {
+ if (conn->list->size >= 20) {
STaskArg* arg = taosMemoryCalloc(1, sizeof(STaskArg));
arg->param1 = conn;
arg->param2 = thrd;
@@ -667,7 +804,6 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
static void cliAllocRecvBufferCb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
SCliConn* conn = handle->data;
SConnBuffer* pBuf = &conn->readBuf;
- tTrace("%s conn %p alloc read buf", CONN_GET_INST_LABEL(conn), conn);
transAllocBuffer(pBuf, buf);
}
static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
@@ -741,8 +877,23 @@ static SCliConn* cliCreateConn(SCliThrd* pThrd) {
static void cliDestroyConn(SCliConn* conn, bool clear) {
SCliThrd* pThrd = conn->hostThrd;
tTrace("%s conn %p remove from conn pool", CONN_GET_INST_LABEL(conn), conn);
+ conn->broken = true;
QUEUE_REMOVE(&conn->q);
QUEUE_INIT(&conn->q);
+
+ conn->broken = true;
+
+ if (conn->list != NULL) {
+ SConnList* connList = conn->list;
+ connList->list->numOfConn--;
+ connList->size--;
+ } else {
+ SConnList* connList = taosHashGet((SHashObj*)pThrd->pool, conn->ip, strlen(conn->ip));
+ connList->list->numOfConn--;
+ }
+ conn->list = NULL;
+ pThrd->newConnCount--;
+
transReleaseExHandle(transGetRefMgt(), conn->refId);
transRemoveExHandle(transGetRefMgt(), conn->refId);
conn->refId = -1;
@@ -777,9 +928,6 @@ static void cliDestroy(uv_handle_t* handle) {
conn->timer->data = NULL;
conn->timer = NULL;
}
- int32_t* oVal = taosHashGet(pThrd->connLimitCache, conn->ip, strlen(conn->ip));
- int32_t nVal = oVal == NULL ? 0 : (*oVal) - 1;
- taosHashPut(pThrd->connLimitCache, conn->ip, strlen(conn->ip), &nVal, sizeof(nVal));
atomic_sub_fetch_32(&pThrd->connCount, 1);
@@ -970,6 +1118,19 @@ void cliSend(SCliConn* pConn) {
msgLen = (int32_t)ntohl((uint32_t)(pHead->msgLen));
}
+ // if (tmsgIsValid(pHead->msgType)) {
+ // char buf[128] = {0};
+ // sprintf(buf, "%s", TMSG_INFO(pHead->msgType));
+ // int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));
+ // if (NULL == 0) {
+ // int localCount = 1;
+ // taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
+ // } else {
+ // int localCount = *count + 1;
+ // taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
+ // }
+ // }
+
tGDebug("%s conn %p %s is sent to %s, local info %s, len:%d", CONN_GET_INST_LABEL(pConn), pConn,
TMSG_INFO(pHead->msgType), pConn->dst, pConn->src, msgLen);
@@ -1012,11 +1173,15 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
STrans* pTransInst = pThrd->pTransInst;
SCliBatchList* pList = pBatch->pList;
- SCliConn* conn = getConnFromPool(pThrd->pool, pList->ip, pList->port);
+ char key[TSDB_FQDN_LEN + 64] = {0};
+ CONN_CONSTRUCT_HASH_KEY(key, pList->ip, pList->port);
- if (conn == NULL && 0 != cliPreCheckSessionLimit(pThrd, pList->ip, pList->port)) {
- tError("%s failed to send batch msg, batch size:%d, msgLen: %d", pTransInst->label, pBatch->wLen,
- pBatch->batchSize);
+ bool exceed = false;
+ SCliConn* conn = getConnFromPool(pThrd, key, &exceed);
+
+ if (conn == NULL && exceed) {
+ tError("%s failed to send batch msg, batch size:%d, msgLen: %d, conn limit:%d", pTransInst->label, pBatch->wLen,
+ pBatch->batchSize, pTransInst->connLimitNum);
cliDestroyBatch(pBatch);
return;
}
@@ -1041,7 +1206,8 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
addr.sin_port = (uint16_t)htons(pList->port);
tTrace("%s conn %p try to connect to %s", pTransInst->label, conn, pList->dst);
- int32_t fd = taosCreateSocketWithTimeout(TRANS_CONN_TIMEOUT * 4);
+ pThrd->newConnCount++;
+ int32_t fd = taosCreateSocketWithTimeout(TRANS_CONN_TIMEOUT * 10);
if (fd == -1) {
tError("%s conn %p failed to create socket, reason:%s", transLabel(pTransInst), conn,
tstrerror(TAOS_SYSTEM_ERROR(errno)));
@@ -1098,7 +1264,7 @@ static void cliSendBatchCb(uv_write_t* req, int status) {
} else {
tDebug("%s conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, p->wLen,
p->batchSize);
- if (!uv_is_closing((uv_handle_t*)&conn->stream)) {
+ if (!uv_is_closing((uv_handle_t*)&conn->stream) && conn->broken == false) {
if (nxtBatch != NULL) {
conn->pBatch = nxtBatch;
cliSendBatch(conn);
@@ -1176,10 +1342,6 @@ void cliConnCb(uv_connect_t* req, int status) {
return;
}
- int32_t* oVal = taosHashGet(pThrd->connLimitCache, pConn->ip, strlen(pConn->ip));
- int32_t nVal = oVal == NULL ? 0 : (*oVal) + 1;
- taosHashPut(pThrd->connLimitCache, pConn->ip, strlen(pConn->ip), &nVal, sizeof(nVal));
-
struct sockaddr peername, sockname;
int addrlen = sizeof(peername);
uv_tcp_getpeername((uv_tcp_t*)pConn->stream, &peername, &addrlen);
@@ -1197,6 +1359,29 @@ void cliConnCb(uv_connect_t* req, int status) {
}
}
+static void doNotifyApp(SCliMsg* pMsg, SCliThrd* pThrd) {
+ STransConnCtx* pCtx = pMsg->ctx;
+ STrans* pTransInst = pThrd->pTransInst;
+
+ STransMsg transMsg = {0};
+ transMsg.contLen = 0;
+ transMsg.pCont = NULL;
+ transMsg.code = TSDB_CODE_RPC_MAX_SESSIONS;
+ transMsg.msgType = pMsg->msg.msgType + 1;
+ transMsg.info.ahandle = pMsg->ctx->ahandle;
+ transMsg.info.traceId = pMsg->msg.info.traceId;
+ transMsg.info.hasEpSet = false;
+ if (pCtx->pSem != NULL) {
+ if (pCtx->pRsp == NULL) {
+ } else {
+ memcpy((char*)pCtx->pRsp, (char*)&transMsg, sizeof(transMsg));
+ }
+ } else {
+ pTransInst->cfp(pTransInst->parent, &transMsg, NULL);
+ }
+
+ destroyCmsg(pMsg);
+}
static void cliHandleQuit(SCliMsg* pMsg, SCliThrd* pThrd) {
if (!transAsyncPoolIsEmpty(pThrd->asyncPool)) {
pThrd->stopMsg = pMsg;
@@ -1206,7 +1391,8 @@ static void cliHandleQuit(SCliMsg* pMsg, SCliThrd* pThrd) {
pThrd->quit = true;
tDebug("cli work thread %p start to quit", pThrd);
destroyCmsg(pMsg);
- destroyConnPool(pThrd->pool);
+
+ destroyConnPool(pThrd);
uv_walk(pThrd->loop, cliWalkCb, NULL);
}
static void cliHandleRelease(SCliMsg* pMsg, SCliThrd* pThrd) {
@@ -1239,11 +1425,11 @@ static void cliHandleUpdate(SCliMsg* pMsg, SCliThrd* pThrd) {
destroyCmsg(pMsg);
}
-SCliConn* cliGetConn(SCliMsg* pMsg, SCliThrd* pThrd, bool* ignore) {
- STransConnCtx* pCtx = pMsg->ctx;
+SCliConn* cliGetConn(SCliMsg** pMsg, SCliThrd* pThrd, bool* ignore, char* addr) {
+ STransConnCtx* pCtx = (*pMsg)->ctx;
SCliConn* conn = NULL;
- int64_t refId = (int64_t)(pMsg->msg.info.handle);
+ int64_t refId = (int64_t)((*pMsg)->msg.info.handle);
if (refId != 0) {
SExHandle* exh = transAcquireExHandle(transGetRefMgt(), refId);
if (exh == NULL) {
@@ -1253,7 +1439,7 @@ SCliConn* cliGetConn(SCliMsg* pMsg, SCliThrd* pThrd, bool* ignore) {
} else {
conn = exh->handle;
if (conn == NULL) {
- conn = getConnFromPool(pThrd->pool, EPSET_GET_INUSE_IP(&pCtx->epSet), EPSET_GET_INUSE_PORT(&pCtx->epSet));
+ conn = getConnFromPool2(pThrd, addr, pMsg);
if (conn != NULL) specifyConnRef(conn, true, refId);
}
transReleaseExHandle(transGetRefMgt(), refId);
@@ -1261,7 +1447,7 @@ SCliConn* cliGetConn(SCliMsg* pMsg, SCliThrd* pThrd, bool* ignore) {
return conn;
};
- conn = getConnFromPool(pThrd->pool, EPSET_GET_INUSE_IP(&pCtx->epSet), EPSET_GET_INUSE_PORT(&pCtx->epSet));
+ conn = getConnFromPool2(pThrd, addr, pMsg);
if (conn != NULL) {
tTrace("%s conn %p get from conn pool:%p", CONN_GET_INST_LABEL(conn), conn, pThrd->pool);
} else {
@@ -1319,57 +1505,46 @@ static FORCE_INLINE void cliUpdateFqdnCache(SHashObj* cache, char* fqdn) {
return;
}
-static int32_t cliPreCheckSessionLimit(SCliThrd* pThrd, char* ip, uint16_t port) {
- STrans* pTransInst = pThrd->pTransInst;
+static void doFreeTimeoutMsg(void* param) {
+ STaskArg* arg = param;
+ SCliMsg* pMsg = arg->param1;
+ SCliThrd* pThrd = arg->param2;
+ STrans* pTransInst = pThrd->pTransInst;
- // STransConnCtx* pCtx = pMsg->ctx;
- // char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet);
- // int32_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet);
-
- char key[TSDB_FQDN_LEN + 64] = {0};
- CONN_CONSTRUCT_HASH_KEY(key, ip, port);
-
- int32_t* val = taosHashGet(pThrd->connLimitCache, key, strlen(key));
- if (val == NULL) return 0;
-
- if (*val >= pTransInst->connLimitNum) {
- return -1;
- }
- return 0;
+ QUEUE_REMOVE(&pMsg->q);
+ STraceId* trace = &pMsg->msg.info.traceId;
+ tGTrace("%s msg %s cannot get available conn after timeout", pTransInst->label, TMSG_INFO(pMsg->msg.msgType));
+ doNotifyApp(pMsg, pThrd);
+ taosMemoryFree(arg);
}
void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
- STrans* pTransInst = pThrd->pTransInst;
- STransConnCtx* pCtx = pMsg->ctx;
+ STrans* pTransInst = pThrd->pTransInst;
- cliMayCvtFqdnToIp(&pCtx->epSet, &pThrd->cvtAddr);
- STraceId* trace = &pMsg->msg.info.traceId;
- char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet);
- uint16_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet);
-
- if (!EPSET_IS_VALID(&pCtx->epSet)) {
- tGError("%s, msg %s sent with invalid epset", pTransInst->label, TMSG_INFO(pMsg->msg.msgType));
+ cliMayCvtFqdnToIp(&pMsg->ctx->epSet, &pThrd->cvtAddr);
+ if (!EPSET_IS_VALID(&pMsg->ctx->epSet)) {
destroyCmsg(pMsg);
return;
}
-
- if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) {
- char key[TSDB_FQDN_LEN + 64] = {0};
- CONN_CONSTRUCT_HASH_KEY(key, ip, port);
-
- SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key));
- if (item != NULL) {
- int32_t elapse = (int32_t)(taosGetTimestampMs() - item->timestamp);
- if (item->count >= pTransInst->failFastThreshold && (elapse >= 0 && elapse <= pTransInst->failFastInterval)) {
- tGTrace("%s, msg %s cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label,
- TMSG_INFO(pMsg->msg.msgType), ip, port, item->count, elapse);
- destroyCmsg(pMsg);
- return;
- }
+ if (tmsgIsValid(pMsg->msg.msgType)) {
+ char buf[128] = {0};
+ sprintf(buf, "%s", TMSG_INFO(pMsg->msg.msgType));
+ int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));
+ if (NULL == 0) {
+ int localCount = 1;
+ taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
+ } else {
+ int localCount = *count + 1;
+ taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
}
}
+ char* fqdn = EPSET_GET_INUSE_IP(&pMsg->ctx->epSet);
+ uint16_t port = EPSET_GET_INUSE_PORT(&pMsg->ctx->epSet);
+ char addr[TSDB_FQDN_LEN + 64] = {0};
+ CONN_CONSTRUCT_HASH_KEY(addr, fqdn, port);
+
bool ignore = false;
- SCliConn* conn = cliGetConn(pMsg, pThrd, &ignore);
+ SCliConn* conn = cliGetConn(&pMsg, pThrd, &ignore, addr);
if (ignore == true) {
// persist conn already release by server
STransMsg resp;
@@ -1380,16 +1555,13 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
destroyCmsg(pMsg);
return;
}
-
- if (conn == NULL && REQUEST_NO_RESP(&pMsg->msg) && 0 != cliPreCheckSessionLimit(pThrd, ip, port)) {
- tGTrace("%s, msg %s cancel to send, reason: %s", pTransInst->label, TMSG_INFO(pMsg->msg.msgType),
- tstrerror(TSDB_CODE_RPC_MAX_SESSIONS));
- destroyCmsg(pMsg);
+ if (conn == NULL && pMsg == NULL) {
return;
}
+ STraceId* trace = &pMsg->msg.info.traceId;
if (conn != NULL) {
- transCtxMerge(&conn->ctx, &pCtx->appCtx);
+ transCtxMerge(&conn->ctx, &pMsg->ctx->appCtx);
transQueuePush(&conn->cliMsgs, pMsg);
cliSend(conn);
} else {
@@ -1398,15 +1570,10 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
int64_t refId = (int64_t)pMsg->msg.info.handle;
if (refId != 0) specifyConnRef(conn, true, refId);
- transCtxMerge(&conn->ctx, &pCtx->appCtx);
+ transCtxMerge(&conn->ctx, &pMsg->ctx->appCtx);
transQueuePush(&conn->cliMsgs, pMsg);
- char key[TSDB_FQDN_LEN + 64] = {0};
- char* fqdn = EPSET_GET_INUSE_IP(&pCtx->epSet);
- uint16_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet);
- CONN_CONSTRUCT_HASH_KEY(key, fqdn, port);
-
- conn->ip = taosStrdup(key);
+ conn->ip = taosStrdup(addr);
uint32_t ipaddr = cliGetIpFromFqdnCache(pThrd->fqdn2ipCache, fqdn);
if (ipaddr == 0xffffffff) {
@@ -1425,6 +1592,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
addr.sin_port = (uint16_t)htons(port);
tGTrace("%s conn %p try to connect to %s", pTransInst->label, conn, conn->ip);
+ pThrd->newConnCount++;
int32_t fd = taosCreateSocketWithTimeout(TRANS_CONN_TIMEOUT * 4);
if (fd == -1) {
tGError("%s conn %p failed to create socket, reason:%s", transLabel(pTransInst), conn,
@@ -1614,6 +1782,19 @@ static void cliAsyncCb(uv_async_t* handle) {
QUEUE_MOVE(&item->qmsg, &wq);
taosThreadMutexUnlock(&item->mtx);
+ void* pIter = taosHashIterate(pThrd->msgCount, NULL);
+ while (pIter != NULL) {
+ int* count = pIter;
+ size_t len = 0;
+ char* key = taosHashGetKey(pIter, &len);
+ if (*count != 0) {
+ tDebug("key: %s count: %d", key, *count);
+ }
+
+ pIter = taosHashIterate(pThrd->msgCount, pIter);
+ }
+ tDebug("all conn count: %d", pThrd->newConnCount);
+
int8_t supportBatch = pTransInst->supportBatch;
if (supportBatch == 0) {
cliNoBatchDealReq(&wq, pThrd);
@@ -1730,17 +1911,23 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
for (int i = 0; i < cli->numOfThreads; i++) {
SCliThrd* pThrd = createThrdObj(shandle);
if (pThrd == NULL) {
- return NULL;
+ goto _err;
}
int err = taosThreadCreate(&pThrd->thread, NULL, cliWorkThread, (void*)(pThrd));
- if (err == 0) {
+ if (err != 0) {
+ goto _err;
+ } else {
tDebug("success to create tranport-cli thread:%d", i);
}
cli->pThreadObj[i] = pThrd;
}
-
return cli;
+
+_err:
+ taosMemoryFree(cli->pThreadObj);
+ taosMemoryFree(cli);
+ return NULL;
}
static FORCE_INLINE void destroyUserdata(STransMsg* userdata) {
@@ -1830,18 +2017,21 @@ static SCliThrd* createThrdObj(void* trans) {
transDQCreate(pThrd->loop, &pThrd->timeoutQueue);
+ transDQCreate(pThrd->loop, &pThrd->waitConnQueue);
+
pThrd->nextTimeout = taosGetTimestampMs() + CONN_PERSIST_TIME(pTransInst->idleTime);
pThrd->pTransInst = trans;
pThrd->destroyAhandleFp = pTransInst->destroyFp;
pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
- pThrd->connLimitCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true,
- pTransInst->connLimitLock == 0 ? HASH_NO_LOCK : HASH_ENTRY_LOCK);
pThrd->batchCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
pThrd->quit = false;
+
+ pThrd->newConnCount = 0;
+ pThrd->msgCount = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
return pThrd;
}
static void destroyThrdObj(SCliThrd* pThrd) {
@@ -1857,6 +2047,7 @@ static void destroyThrdObj(SCliThrd* pThrd) {
transDQDestroy(pThrd->delayQueue, destroyCmsgAndAhandle);
transDQDestroy(pThrd->timeoutQueue, NULL);
+ transDQDestroy(pThrd->waitConnQueue, NULL);
tDebug("thread destroy %" PRId64, pThrd->pid);
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
@@ -1868,7 +2059,6 @@ static void destroyThrdObj(SCliThrd* pThrd) {
taosMemoryFree(pThrd->loop);
taosHashCleanup(pThrd->fqdn2ipCache);
taosHashCleanup(pThrd->failFastCache);
- taosHashCleanup(pThrd->connLimitCache);
void** pIter = taosHashIterate(pThrd->batchCache, NULL);
while (pIter != NULL) {
@@ -1887,6 +2077,7 @@ static void destroyThrdObj(SCliThrd* pThrd) {
pIter = (void**)taosHashIterate(pThrd->batchCache, pIter);
}
taosHashCleanup(pThrd->batchCache);
+ taosHashCleanup(pThrd->msgCount);
taosMemoryFree(pThrd);
}
@@ -2189,6 +2380,18 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
}
}
+ if (tmsgIsValid(pResp->msgType - 1)) {
+ char buf[128] = {0};
+ sprintf(buf, "%s", TMSG_INFO(pResp->msgType - 1));
+ int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));
+ if (NULL == 0) {
+ int localCount = 0;
+ taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
+ } else {
+ int localCount = *count - 1;
+ taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
+ }
+ }
if (pCtx->pSem != NULL) {
tGTrace("%s conn %p(sync) handle resp", CONN_GET_INST_LABEL(pConn), pConn);
if (pCtx->pRsp == NULL) {
diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c
index 04e094ae9a..28fb474972 100644
--- a/source/libs/transport/src/transSvr.c
+++ b/source/libs/transport/src/transSvr.c
@@ -677,14 +677,21 @@ void uvOnAcceptCb(uv_stream_t* stream, int status) {
SServerObj* pObj = container_of(stream, SServerObj, server);
uv_tcp_t* cli = (uv_tcp_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
- uv_tcp_init(pObj->loop, cli);
+ if (cli == NULL) return;
- if (uv_accept(stream, (uv_stream_t*)cli) == 0) {
+ int err = uv_tcp_init(pObj->loop, cli);
+ if (err != 0) {
+ tError("failed to create tcp: %s", uv_err_name(err));
+ taosMemoryFree(cli);
+ return;
+ }
+ err = uv_accept(stream, (uv_stream_t*)cli);
+ if (err == 0) {
#if defined(WINDOWS) || defined(DARWIN)
if (pObj->numOfWorkerReady < pObj->numOfThreads) {
tError("worker-threads are not ready for all, need %d instead of %d.", pObj->numOfThreads,
pObj->numOfWorkerReady);
- uv_close((uv_handle_t*)cli, NULL);
+ uv_close((uv_handle_t*)cli, uvFreeCb);
return;
}
#endif
@@ -700,8 +707,10 @@ void uvOnAcceptCb(uv_stream_t* stream, int status) {
uv_write2(wr, (uv_stream_t*)&(pObj->pipe[pObj->workerIdx][0]), &buf, 1, (uv_stream_t*)cli, uvOnPipeWriteCb);
} else {
if (!uv_is_closing((uv_handle_t*)cli)) {
- uv_close((uv_handle_t*)cli, NULL);
+ tError("failed to accept tcp: %s", uv_err_name(err));
+ uv_close((uv_handle_t*)cli, uvFreeCb);
} else {
+ tError("failed to accept tcp: %s", uv_err_name(err));
taosMemoryFree(cli);
}
}
diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c
index 7bfd3df9e0..3e1e36ccc1 100644
--- a/source/libs/wal/src/walRead.c
+++ b/source/libs/wal/src/walRead.c
@@ -200,6 +200,7 @@ int32_t walReadSeekVerImpl(SWalReader *pReader, int64_t ver) {
pReader->curVersion, pReader->curInvalid, ver);
pReader->curVersion = ver;
+ pReader->curInvalid = 0;
return 0;
}
@@ -210,8 +211,8 @@ int32_t walReadSeekVer(SWalReader *pReader, int64_t ver) {
return 0;
}
- pReader->curInvalid = 1;
- pReader->curVersion = ver;
+// pReader->curInvalid = 1;
+// pReader->curVersion = ver;
if (ver > pWal->vers.lastVer || ver < pWal->vers.firstVer) {
wDebug("vgId:%d, invalid index:%" PRId64 ", first index:%" PRId64 ", last index:%" PRId64, pReader->pWal->cfg.vgId,
@@ -219,8 +220,8 @@ int32_t walReadSeekVer(SWalReader *pReader, int64_t ver) {
terrno = TSDB_CODE_WAL_LOG_NOT_EXIST;
return -1;
}
- if (ver < pWal->vers.snapshotVer) {
- }
+// if (ver < pWal->vers.snapshotVer) {
+// }
if (walReadSeekVerImpl(pReader, ver) < 0) {
return -1;
@@ -239,8 +240,8 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
if (pRead->curInvalid || pRead->curVersion != fetchVer) {
if (walReadSeekVer(pRead, fetchVer) < 0) {
- pRead->curVersion = fetchVer;
- pRead->curInvalid = 1;
+// pRead->curVersion = fetchVer;
+// pRead->curInvalid = 1;
return -1;
}
seeked = true;
@@ -259,11 +260,11 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
} else {
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
}
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
}
- pRead->curInvalid = 0;
+// pRead->curInvalid = 0;
return 0;
}
@@ -295,13 +296,14 @@ static int32_t walFetchBodyNew(SWalReader *pReader) {
pReader->pWal->cfg.vgId, pReader->pHead->head.version, ver);
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
}
- pReader->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
if (walValidBodyCksum(pReader->pHead) != 0) {
wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pReader->pWal->cfg.vgId, ver);
- pReader->curInvalid = 1;
+// pRead->curInvalid = 1;
+
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
return -1;
}
@@ -317,7 +319,7 @@ static int32_t walSkipFetchBodyNew(SWalReader *pRead) {
code = taosLSeekFile(pRead->pLogFile, pRead->pHead->head.bodyLen, SEEK_CUR);
if (code < 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
@@ -345,8 +347,8 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
if (pRead->curInvalid || pRead->curVersion != ver) {
code = walReadSeekVer(pRead, ver);
if (code < 0) {
- pRead->curVersion = ver;
- pRead->curInvalid = 1;
+// pRead->curVersion = ver;
+// pRead->curInvalid = 1;
return -1;
}
seeked = true;
@@ -366,7 +368,7 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
} else {
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
}
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
}
@@ -379,7 +381,7 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
return -1;
}
- pRead->curInvalid = 0;
+// pRead->curInvalid = 0;
return 0;
}
@@ -394,7 +396,7 @@ int32_t walSkipFetchBody(SWalReader *pRead, const SWalCkHead *pHead) {
code = taosLSeekFile(pRead->pLogFile, pHead->head.bodyLen, SEEK_CUR);
if (code < 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
@@ -433,14 +435,14 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
pRead->pWal->cfg.vgId, pReadHead->version, ver);
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
}
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
return -1;
}
if (pReadHead->version != ver) {
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId,
pReadHead->version, ver);
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
return -1;
}
@@ -448,7 +450,7 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
if (walValidBodyCksum(*ppHead) != 0) {
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId,
ver);
- pRead->curInvalid = 1;
+// pRead->curInvalid = 1;
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
return -1;
}
@@ -544,7 +546,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
if (pReader->pHead->head.version != ver) {
wError("vgId:%d, unexpected wal log, index:%" PRId64 ", read request index:%" PRId64, pReader->pWal->cfg.vgId,
pReader->pHead->head.version, ver);
- pReader->curInvalid = 1;
+// pReader->curInvalid = 1;
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
taosThreadMutexUnlock(&pReader->mutex);
return -1;
@@ -557,7 +559,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
uint32_t readCkSum = walCalcBodyCksum(pReader->pHead->head.body, pReader->pHead->head.bodyLen);
uint32_t logCkSum = pReader->pHead->cksumBody;
wError("checksum written into log:%u, checksum calculated:%u", logCkSum, readCkSum);
- pReader->curInvalid = 1;
+// pReader->curInvalid = 1;
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
taosThreadMutexUnlock(&pReader->mutex);
return -1;
@@ -575,5 +577,6 @@ void walReadReset(SWalReader *pReader) {
taosCloseFile(&pReader->pLogFile);
pReader->curInvalid = 1;
pReader->curFileFirstVer = -1;
+ pReader->curVersion = -1;
taosThreadMutexUnlock(&pReader->mutex);
}
diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c
index a992c951fa..00ad7a3d67 100644
--- a/source/libs/wal/src/walWrite.c
+++ b/source/libs/wal/src/walWrite.c
@@ -328,8 +328,8 @@ int32_t walEndSnapshot(SWal *pWal) {
"), 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)) ||
- ((pWal->cfg.retentionPeriod == 0) ||
- (pWal->cfg.retentionPeriod != -1 && iter->closeTs + pWal->cfg.retentionPeriod > ts))) {
+ ((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
wDebug("vgId:%d, check pass", pWal->cfg.vgId);
deleteCnt++;
@@ -387,20 +387,33 @@ END:
int32_t walRollImpl(SWal *pWal) {
int32_t code = 0;
+
if (pWal->pIdxFile != NULL) {
+ code = taosFsyncFile(pWal->pIdxFile);
+ if (code != 0) {
+ terrno = TAOS_SYSTEM_ERROR(errno);
+ goto END;
+ }
code = taosCloseFile(&pWal->pIdxFile);
if (code != 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
goto END;
}
}
+
if (pWal->pLogFile != NULL) {
+ code = taosFsyncFile(pWal->pLogFile);
+ if (code != 0) {
+ terrno = TAOS_SYSTEM_ERROR(errno);
+ goto END;
+ }
code = taosCloseFile(&pWal->pLogFile);
if (code != 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
goto END;
}
}
+
TdFilePtr pIdxFile, pLogFile;
// create new file
int64_t newFileFirstVer = pWal->vers.lastVer + 1;
diff --git a/source/os/src/osMath.c b/source/os/src/osMath.c
index b466f89a1d..1c7c825ce8 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);
diff --git a/source/os/src/osSleep.c b/source/os/src/osSleep.c
index a2373f952f..f6cc7d608d 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 ae4a8a5cad..0f459b58cd 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/osTimer.c b/source/os/src/osTimer.c
index 5a57007d17..b8eb54e10e 100644
--- a/source/os/src/osTimer.c
+++ b/source/os/src/osTimer.c
@@ -114,27 +114,28 @@ static void *taosProcessAlarmSignal(void *tharg) {
taosThreadCleanupPush(taosDeleteTimer, &timerId);
- struct itimerspec ts;
- ts.it_value.tv_sec = 0;
- ts.it_value.tv_nsec = 1000000 * MSECONDS_PER_TICK;
- ts.it_interval.tv_sec = 0;
- ts.it_interval.tv_nsec = 1000000 * MSECONDS_PER_TICK;
+ do {
+ struct itimerspec ts;
+ ts.it_value.tv_sec = 0;
+ ts.it_value.tv_nsec = 1000000 * MSECONDS_PER_TICK;
+ ts.it_interval.tv_sec = 0;
+ ts.it_interval.tv_nsec = 1000000 * MSECONDS_PER_TICK;
- if (timer_settime(timerId, 0, &ts, NULL)) {
- // printf("Failed to init timer");
- return NULL;
- }
-
- int signo;
- while (!stopTimer) {
- if (sigwait(&sigset, &signo)) {
- // printf("Failed to wait signal: number %d", signo);
- continue;
+ if (timer_settime(timerId, 0, &ts, NULL)) {
+ // printf("Failed to init timer");
+ break;
}
- /* //printf("Signal handling: number %d ......\n", signo); */
- callback(0);
- }
+ int signo;
+ while (!stopTimer) {
+ if (sigwait(&sigset, &signo)) {
+ // printf("Failed to wait signal: number %d", signo);
+ continue;
+ }
+ /* //printf("Signal handling: number %d ......\n", signo); */
+ callback(0);
+ }
+ } while (0);
taosThreadCleanupPop(1);
diff --git a/source/os/test/CMakeLists.txt b/source/os/test/CMakeLists.txt
index 21fb2ee630..fba4d23e3f 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 0000000000..eebc1574c3
--- /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 0000000000..93c8d1f8da
--- /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 0000000000..f4cc6e9e58
--- /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 0000000000..5faa837a0a
--- /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 0000000000..5e07636b1f
--- /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 0000000000..dfc92a1b72
--- /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 0000000000..e7fc4f1356
--- /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 0000000000..366c3fc720
--- /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 4bb082800d..33b562c8dd 100644
--- a/source/util/src/terror.c
+++ b/source/util/src/terror.c
@@ -94,6 +94,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NO_AVAIL_DISK, "No available disk")
TAOS_DEFINE_ERROR(TSDB_CODE_NOT_FOUND, "Not found")
TAOS_DEFINE_ERROR(TSDB_CODE_NO_DISKSPACE, "Out of disk space")
TAOS_DEFINE_ERROR(TSDB_CODE_TIMEOUT_ERROR, "Operation timeout")
+TAOS_DEFINE_ERROR(TSDB_CODE_NO_ENOUGH_DISKSPACE, "No enough disk space")
TAOS_DEFINE_ERROR(TSDB_CODE_APP_IS_STARTING, "Database is starting up")
TAOS_DEFINE_ERROR(TSDB_CODE_APP_IS_STOPPING, "Database is closing down")
@@ -434,7 +435,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TQ_META_KEY_NOT_IN_TXN, "TQ meta key not in tx
TAOS_DEFINE_ERROR(TSDB_CODE_TQ_META_KEY_DUP_IN_TXN, "TQ met key dup in txn")
TAOS_DEFINE_ERROR(TSDB_CODE_TQ_GROUP_NOT_SET, "TQ group not exist")
TAOS_DEFINE_ERROR(TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND, "TQ table schema not found")
-TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_COMMITTED_OFFSET, "TQ no commited offset")
+TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_COMMITTED_OFFSET, "TQ no committed offset")
// wal
TAOS_DEFINE_ERROR(TSDB_CODE_WAL_FILE_CORRUPTED, "WAL file is corrupted")
diff --git a/source/util/src/thashutil.c b/source/util/src/thashutil.c
index 21b9359076..f9c7eb1f56 100644
--- a/source/util/src/thashutil.c
+++ b/source/util/src/thashutil.c
@@ -50,11 +50,6 @@ uint32_t taosDJB2Hash(const char *key, uint32_t len) {
return hash;
}
-uint32_t xxHash(const char *key, uint32_t len) {
- int32_t seed = 0xcc9e2d51;
- return XXH32(key, len, seed);
-}
-
uint32_t MurmurHash3_32(const char *key, uint32_t len) {
const uint8_t *data = (const uint8_t *)key;
const int32_t nblocks = len >> 2u;
diff --git a/source/util/src/tutil.c b/source/util/src/tutil.c
index 1f9ca7407e..6d95660103 100644
--- a/source/util/src/tutil.c
+++ b/source/util/src/tutil.c
@@ -468,7 +468,7 @@ size_t tstrncspn(const char *str, size_t size, const char *reject, size_t rsize)
c3 = p[s[j + 3]];
if ((c0 | c1 | c2 | c3) != 0) {
- size_t count = ((i + 1) >> 2);
+ size_t count = i * 4;
return (c0 | c1) != 0 ? count - c0 + 1 : count - c2 + 3;
}
}
diff --git a/source/util/src/tversion.c b/source/util/src/tversion.c
index c70fdc87a6..dc357c61a1 100644
--- a/source/util/src/tversion.c
+++ b/source/util/src/tversion.c
@@ -89,3 +89,20 @@ int32_t taosCheckVersionCompatible(int32_t clientVer, int32_t serverVer, int32_t
return -1;
}
}
+
+int32_t taosCheckVersionCompatibleFromStr(const char *pClientVersion, const char *pServerVersion,
+ int32_t comparedSegments) {
+ int32_t clientVersion = 0;
+ int32_t serverVersion = 0;
+ int32_t code = taosVersionStrToInt(pClientVersion, &clientVersion);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = taosVersionStrToInt(pServerVersion, &serverVersion);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = taosCheckVersionCompatible(clientVersion, serverVersion, comparedSegments);
+ }
+ if (TSDB_CODE_SUCCESS != code) {
+ code = terrno;
+ }
+ return code;
+}
\ No newline at end of file
diff --git a/source/util/test/utilTests.cpp b/source/util/test/utilTests.cpp
index a355125410..ff1d91aa9d 100644
--- a/source/util/test/utilTests.cpp
+++ b/source/util/test/utilTests.cpp
@@ -294,6 +294,10 @@ TEST(utilTest, tstrncspn) {
const char* reject5 = "911";
v = tstrncspn(p2, strlen(p2), reject5, 0);
ASSERT_EQ(v, 14);
+
+ const char* reject6 = "Kk";
+ v = tstrncspn(p2, strlen(p2), reject6, 2);
+ ASSERT_EQ(v, 10);
}
TEST(utilTest, intToHextStr) {
@@ -322,4 +326,4 @@ TEST(utilTest, intToHextStr) {
sprintf(destBuf, "%" PRIx64, v);
ASSERT_STREQ(buf, destBuf);
}
-}
\ No newline at end of file
+}
diff --git a/tests/develop-test/2-query/show_create_db.py b/tests/develop-test/2-query/show_create_db.py
index e5a79074ef..5574a59ec2 100644
--- a/tests/develop-test/2-query/show_create_db.py
+++ b/tests/develop-test/2-query/show_create_db.py
@@ -42,17 +42,17 @@ class TDTestCase:
tdSql.query('show create database scd;')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 1 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 1 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
tdSql.query('show create database scd2;')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd2')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd2` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 3 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd2` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 3 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
tdSql.query('show create database scd4')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd4')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd4` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 13 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd4` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 13 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
self.restartTaosd(1, dbname='scd')
@@ -60,17 +60,17 @@ class TDTestCase:
tdSql.query('show create database scd;')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 1 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 1 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
tdSql.query('show create database scd2;')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd2')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd2` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 3 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd2` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 3 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
tdSql.query('show create database scd4')
tdSql.checkRows(1)
tdSql.checkData(0, 0, 'scd4')
- tdSql.checkData(0, 1, "CREATE DATABASE `scd4` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 13 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0")
+ tdSql.checkData(0, 1, "CREATE DATABASE `scd4` BUFFER 256 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 STT_TRIGGER 13 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0 TABLE_PREFIX 0 TABLE_SUFFIX 0 TSDB_PAGESIZE 4 WAL_RETENTION_PERIOD 0 WAL_RETENTION_SIZE 0 WAL_ROLL_PERIOD 0 WAL_SEGMENT_SIZE 0")
tdSql.execute('drop database scd')
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 a6167158a2..9da678bf81 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
@@ -108,49 +108,49 @@ class TDTestCase:
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.stb2)")
+ tdSql.query("select count(*) from (select distinct(tbname) from stmt_db.stb2)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.stb2")
+ tdSql.query("select count(*) from stmt_db.stb2")
tdSql.checkData(0, 0, 160)
- tdSql.query("select * from information_schema.ins_databases")
- tdSql.checkData(2, 14, "us")
+ tdSql.query("select * from information_schema.ins_databases where name='stmt_db'")
+ tdSql.checkData(0, 14, "us")
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.`stb2-2`)")
+ tdSql.query("select count(*) from (select distinct(tbname) from stmt_db.`stb2-2`)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.`stb2-2`")
+ tdSql.query("select count(*) from stmt_db.`stb2-2`")
tdSql.checkData(0, 0, 160)
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/rest_auto_create_table.json" %binPath
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.stb3)")
+ tdSql.query("select count(*) from (select distinct(tbname) from rest_db.stb3)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.stb3")
+ tdSql.query("select count(*) from rest_db.stb3")
tdSql.checkData(0, 0, 160)
- tdSql.query("select * from information_schema.ins_databases")
- tdSql.checkData(2, 14, "ns")
+ tdSql.query("select * from information_schema.ins_databases where name='rest_db'")
+ tdSql.checkData(0, 14, "ns")
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.`stb3-2`)")
+ tdSql.query("select count(*) from (select distinct(tbname) from rest_db.`stb3-2`)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.`stb3-2`")
+ tdSql.query("select count(*) from rest_db.`stb3-2`")
tdSql.checkData(0, 0, 160)
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_auto_create_table.json" %binPath
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.stb4)")
+ tdSql.query("select count(*) from (select distinct(tbname) from sml_db.stb4)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.stb4")
+ tdSql.query("select count(*) from sml_db.stb4")
tdSql.checkData(0, 0, 160)
tdSql.execute("reset query cache")
- tdSql.query("select count(*) from (select distinct(tbname) from db.`stb4-2`)")
+ tdSql.query("select count(*) from (select distinct(tbname) from sml_db.`stb4-2`)")
tdSql.checkData(0, 0, 8)
- tdSql.query("select count(*) from db.`stb4-2`")
+ tdSql.query("select count(*) from sml_db.`stb4-2`")
tdSql.checkData(0, 0, 160)
tAdapter.stop()
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json
index 868ff99842..9b99521f52 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/rest_auto_create_table.json
@@ -15,7 +15,7 @@
"num_of_records_per_req": 10,
"databases": [{
"dbinfo": {
- "name": "db",
+ "name": "rest_db",
"drop": "yes",
"replica": 1,
"precision": "ns",
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json
index 1bbeca672b..7b87919a6d 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/sml_auto_create_table.json
@@ -15,7 +15,7 @@
"num_of_records_per_req": 10,
"databases": [{
"dbinfo": {
- "name": "db",
+ "name": "sml_db",
"drop": "yes",
"replica": 1,
"precision": "ms",
diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json
index e6e773f616..baf0384e46 100644
--- a/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json
+++ b/tests/develop-test/5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json
@@ -15,7 +15,7 @@
"num_of_records_per_req": 10,
"databases": [{
"dbinfo": {
- "name": "db",
+ "name": "stmt_db",
"drop": "yes",
"replica": 1,
"precision": "us",
diff --git a/tests/develop-test/test.py b/tests/develop-test/test.py
index 1b0f0d0aed..600925174f 100644
--- a/tests/develop-test/test.py
+++ b/tests/develop-test/test.py
@@ -343,7 +343,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy":
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(
+ tdLog.info(
f"alter queryPolicy to {queryPolicy} successfully"
)
else:
@@ -402,7 +402,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy":
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(
+ tdLog.info(
f"alter queryPolicy to {queryPolicy} successfully"
)
else:
@@ -471,7 +471,7 @@ if __name__ == "__main__":
# for i in range(tdSql.queryRows):
# if tdSql.queryResult[i][0] == "queryPolicy" :
# if int(tdSql.queryResult[i][1]) == int(queryPolicy):
- # tdLog.success('alter queryPolicy to %d successfully'%queryPolicy)
+ # tdLog.info('alter queryPolicy to %d successfully'%queryPolicy)
# else :
# tdLog.debug(tdSql.queryResult)
# tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
@@ -484,7 +484,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy":
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(
+ tdLog.info(
f"alter queryPolicy to {queryPolicy} successfully"
)
else:
@@ -545,7 +545,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy":
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(
+ tdLog.info(
f"alter queryPolicy to {queryPolicy} successfully"
)
else:
diff --git a/tests/docs-examples-test/python.sh b/tests/docs-examples-test/python.sh
index 31342b33d7..a7501b54ed 100644
--- a/tests/docs-examples-test/python.sh
+++ b/tests/docs-examples-test/python.sh
@@ -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 c7b5e97234..dfb8230cc7 100644
--- a/tests/parallel_test/cases.task
+++ b/tests/parallel_test/cases.task
@@ -168,6 +168,7 @@
,,y,script,./test.sh -f tsim/parser/union.sim
,,y,script,./test.sh -f tsim/parser/union_sysinfo.sim
,,y,script,./test.sh -f tsim/parser/where.sim
+,,y,script,./test.sh -f tsim/query/tagLikeFilter.sim
,,y,script,./test.sh -f tsim/query/charScalarFunction.sim
,,y,script,./test.sh -f tsim/query/explain.sim
,,y,script,./test.sh -f tsim/query/interval-offset.sim
@@ -181,6 +182,7 @@
,,y,script,./test.sh -f tsim/query/groupby.sim
,,y,script,./test.sh -f tsim/query/event.sim
,,y,script,./test.sh -f tsim/query/forceFill.sim
+,,y,script,./test.sh -f tsim/query/emptyTsRange.sim
,,y,script,./test.sh -f tsim/query/partitionby.sim
,,y,script,./test.sh -f tsim/qnode/basic1.sim
,,y,script,./test.sh -f tsim/snode/basic1.sim
@@ -306,7 +308,7 @@
,,y,script,./test.sh -f tsim/vnode/replica3_repeat.sim
,,y,script,./test.sh -f tsim/vnode/replica3_vgroup.sim
,,y,script,./test.sh -f tsim/vnode/replica3_many.sim
-#,,y,script,./test.sh -f tsim/vnode/replica3_import.sim
+,,y,script,./test.sh -f tsim/vnode/replica3_import.sim
,,y,script,./test.sh -f tsim/vnode/stable_balance_replica1.sim
,,y,script,./test.sh -f tsim/vnode/stable_dnode2_stop.sim
,,y,script,./test.sh -f tsim/vnode/stable_dnode2.sim
@@ -630,6 +632,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -R
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/update_data.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/tb_100w_data_order.py
,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_stable.py
@@ -653,6 +657,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tagFilter.py
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py
,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5
@@ -728,7 +733,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py
-,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
+#,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDnodeRestart1.py
@@ -736,7 +741,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py -N 3 -n 3
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py
-,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
+# ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py -N 3 -n 3
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStb.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqDropStbCtb.py
@@ -852,6 +857,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 2
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 3
@@ -911,11 +917,11 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arccos.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/arctan.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery.py -Q 3
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 3
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_math.py -Q 3
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_time.py -Q 3
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_math.py -Q 3
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_time.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity_1.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 3
@@ -950,6 +956,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interp.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 3
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 4
@@ -989,7 +996,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
@@ -1013,8 +1020,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_math.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_time.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity.py -Q 4
-,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity_1.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity.py -Q 4
+#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stablity_1.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/avg.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/elapsed.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py -Q 4
@@ -1023,9 +1030,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
@@ -1068,6 +1075,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_data.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_data.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 4
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/odbc.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
@@ -1084,7 +1092,7 @@
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py
-,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
+#,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R
diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh
index d0086c733e..edb9b4ab3c 100755
--- a/tests/parallel_test/container_build.sh
+++ b/tests/parallel_test/container_build.sh
@@ -51,10 +51,24 @@ else
REP_DIR=/home/TDinternal
REP_REAL_PATH=$WORKDIR/TDinternal
REP_MOUNT_PARAM=$REP_REAL_PATH:/home/TDinternal
+
fi
date
docker run \
-v $REP_MOUNT_PARAM \
+ -v /root/.cargo/registry:/root/.cargo/registry \
+ -v /root/.cargo/git:/root/.cargo/git \
+ -v /root/go/pkg/mod:/root/go/pkg/mod \
+ -v /root/.cache/go-build:/root/.cache/go-build \
+ -v ${REP_REAL_PATH}/enterprise/src/plugins/taosx/target:${REP_DIR}/enterprise/src/plugins/taosx/target \
+ -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \
+ -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \
+ -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \
+ -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \
+ -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \
+ -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \
+ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \
+ -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \
--rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=true;make -j || exit 1"
if [[ -d ${WORKDIR}/debugNoSan ]] ;then
@@ -70,6 +84,19 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan
date
docker run \
-v $REP_MOUNT_PARAM \
+ -v /root/.cargo/registry:/root/.cargo/registry \
+ -v /root/.cargo/git:/root/.cargo/git \
+ -v /root/go/pkg/mod:/root/go/pkg/mod \
+ -v /root/.cache/go-build:/root/.cache/go-build \
+ -v ${REP_REAL_PATH}/enterprise/src/plugins/taosx/target:${REP_DIR}/enterprise/src/plugins/taosx/target \
+ -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \
+ -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \
+ -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \
+ -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \
+ -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \
+ -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \
+ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \
+ -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \
--rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=true;make -j || exit 1 "
mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan
diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh
index e0b905375a..95115bc437 100755
--- a/tests/parallel_test/run_case.sh
+++ b/tests/parallel_test/run_case.sh
@@ -69,6 +69,12 @@ ulimit -c unlimited
md5sum /usr/lib/libtaos.so.1
md5sum /home/TDinternal/debug/build/lib/libtaos.so
+
+#define taospy 2.7.6
+pip3 list|grep taospy
+pip3 uninstall taospy -y
+pip3 install taospy==2.7.6
+
$TIMEOUT_CMD $cmd
RET=$?
echo "cmd exit code: $RET"
diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh
index b5deb09341..8ea2f249c1 100755
--- a/tests/parallel_test/run_container.sh
+++ b/tests/parallel_test/run_container.sh
@@ -130,8 +130,6 @@ docker run \
-v ${SOURCEDIR}:/usr/local/src/ \
-v "$TMP_DIR/thread_volume/$thread_no/sim:${SIM_DIR}" \
-v ${TMP_DIR}/thread_volume/$thread_no/coredump:$coredump_dir \
- -v $WORKDIR/taos-connector-python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \
- -v $WORKDIR/taos-connector-python/taosrest:/usr/local/lib/python3.8/site-packages/taosrest:ro \
--rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param
ret=$?
exit $ret
diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py
index ddb3bfaa26..360843c46c 100644
--- a/tests/pytest/util/dnodes.py
+++ b/tests/pytest/util/dnodes.py
@@ -45,6 +45,8 @@ class TDSimClient:
"supportVnodes": "1024",
"enableQueryHb": "1",
"telemetryReporting": "0",
+ "tqDebugflag": "135",
+ "wDebugflag":"135",
}
def getLogDir(self):
diff --git a/tests/script/api/insertSameTs.c b/tests/script/api/insertSameTs.c
new file mode 100644
index 0000000000..ff5e4dd154
--- /dev/null
+++ b/tests/script/api/insertSameTs.c
@@ -0,0 +1,136 @@
+/*
+ * 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 .
+ */
+
+// TAOS standard API example. The same syntax as MySQL, but only a subset
+// to compile: gcc -o demo demo.c -ltaos
+
+#include
+#include
+#include
+#include
+#include "taos.h" // TAOS header file
+
+static void queryDB(TAOS *taos, char *command) {
+ int i;
+ TAOS_RES *pSql = NULL;
+ int32_t code = -1;
+
+ for (i = 0; i < 5; i++) {
+ if (NULL != pSql) {
+ taos_free_result(pSql);
+ pSql = NULL;
+ }
+
+ pSql = taos_query(taos, command);
+ code = taos_errno(pSql);
+ if (0 == code) {
+ break;
+ }
+ }
+
+ if (code != 0) {
+ fprintf(stderr, "Failed to run %s, reason: %s\n", command, taos_errstr(pSql));
+ taos_free_result(pSql);
+ taos_close(taos);
+ exit(EXIT_FAILURE);
+ }
+
+ taos_free_result(pSql);
+}
+
+void Test(TAOS *taos, char *qstr);
+
+int main(int argc, char *argv[]) {
+ char qstr[1024];
+
+ // connect to server
+ if (argc < 2) {
+ printf("please input server-ip \n");
+ return 0;
+ }
+
+ TAOS *taos = taos_connect(argv[1], "root", "taosdata", NULL, 0);
+ if (taos == NULL) {
+ printf("failed to connect to server, reason:%s\n", "null taos"/*taos_errstr(taos)*/);
+ exit(1);
+ }
+ Test(taos, qstr);
+ taos_close(taos);
+ taos_cleanup();
+}
+void Test(TAOS *taos, char *qstr) {
+ queryDB(taos, "drop database if exists demo");
+ queryDB(taos, "create database demo vgroups 1 minrows 10");
+ TAOS_RES *result;
+ queryDB(taos, "use demo");
+
+ queryDB(taos, "create table m1 (ts timestamp, ti tinyint, si smallint, i int, bi bigint, f float, d double, b binary(10))");
+ printf("success to create table\n");
+
+ int i = 0;
+ for (int32_t n = 0; n < 10; ++n) {
+ for (i = 0; i < 10; ++i) {
+ int32_t v = n * 10 + i;
+ sprintf(qstr, "insert into m1 values (%" PRId64 ", %d, %d, %d, %d, %f, %lf, '%s')", (uint64_t)1546300800000, v, v, v, v*10000000, v*1.0, v*2.0, "hello");
+ printf("qstr: %s\n", qstr);
+
+ TAOS_RES *result1 = taos_query(taos, qstr);
+ if (result1 == NULL || taos_errno(result1) != 0) {
+ printf("failed to insert row, reason:%s\n", taos_errstr(result1));
+ taos_free_result(result1);
+ exit(1);
+ } else {
+ printf("insert row: %i\n", v);
+ }
+ taos_free_result(result1);
+
+ strcpy(qstr, "flush database demo");
+ result1 = taos_query(taos, qstr);
+ if (result1 == NULL || taos_errno(result1) != 0) {
+ printf("failed to fluash database, reason:%s\n", taos_errstr(result1));
+ taos_free_result(result1);
+ exit(1);
+ }
+ taos_free_result(result1);
+ }
+ }
+
+ // query the records
+ sprintf(qstr, "SELECT * FROM m1 order by ts desc");
+ result = taos_query(taos, qstr);
+ if (result == NULL || taos_errno(result) != 0) {
+ printf("failed to select, reason:%s\n", taos_errstr(result));
+ taos_free_result(result);
+ exit(1);
+ }
+
+ TAOS_ROW row;
+ int rows = 0;
+ int num_fields = taos_field_count(result);
+ TAOS_FIELD *fields = taos_fetch_fields(result);
+
+ printf("num_fields = %d\n", num_fields);
+ printf("select * from table order by ts desc, result:\n");
+ // fetch the records row by row
+ while ((row = taos_fetch_row(result))) {
+ char temp[1024] = {0};
+ rows++;
+ taos_print_row(temp, row, fields, num_fields);
+ printf("%s\n", temp);
+ }
+
+ taos_free_result(result);
+}
+
diff --git a/tests/script/api/makefile b/tests/script/api/makefile
index 75a2273f12..6739794cc8 100644
--- a/tests/script/api/makefile
+++ b/tests/script/api/makefile
@@ -14,6 +14,7 @@ exe:
gcc $(CFLAGS) ./batchprepare.c -o $(ROOT)batchprepare $(LFLAGS)
gcc $(CFLAGS) ./stopquery.c -o $(ROOT)stopquery $(LFLAGS)
gcc $(CFLAGS) ./dbTableRoute.c -o $(ROOT)dbTableRoute $(LFLAGS)
+ gcc $(CFLAGS) ./insertSameTs.c -o $(ROOT)insertSameTs $(LFLAGS)
clean:
rm $(ROOT)batchprepare
diff --git a/tests/script/coverage_test.sh b/tests/script/coverage_test.sh
index 3f99dde544..a74e6dae73 100755
--- a/tests/script/coverage_test.sh
+++ b/tests/script/coverage_test.sh
@@ -56,9 +56,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
@@ -108,6 +108,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"
}
@@ -115,7 +128,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
@@ -163,8 +176,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/tsim/dnode/offline_reason.sim b/tests/script/tsim/dnode/offline_reason.sim
index 6b1686dbb4..8c4d8b47f7 100644
--- a/tests/script/tsim/dnode/offline_reason.sim
+++ b/tests/script/tsim/dnode/offline_reason.sim
@@ -8,10 +8,10 @@ sql connect
sql create dnode $hostname port 7200
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode2 off: $data(2)[6]
+print dnode1 off: $data(1)[7]
+print dnode2 off: $data(2)[7]
-if $data(2)[6] != @status not received@ then
+if $data(2)[7] != @status not received@ then
return -1
endi
@@ -50,9 +50,9 @@ step3:
return -1
endi
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode2 off: $data(2)[6]
-if $data(2)[6] != @status msg timeout@ then
+print dnode1 off: $data(1)[7]
+print dnode2 off: $data(2)[7]
+if $data(2)[7] != @status msg timeout@ then
goto step3
endi
@@ -77,9 +77,9 @@ step5:
endi
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode2 off: $data(3)[6]
-if $data(3)[6] != @dnodeId not match@ then
+print dnode1 off: $data(1)[7]
+print dnode2 off: $data(3)[7]
+if $data(3)[7] != @dnodeId not match@ then
goto step5
endi
@@ -98,10 +98,10 @@ step6:
endi
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode2 off: $data(3)[6]
-print dnode3 off: $data(4)[6]
-if $data(4)[6] != @interval not match@ then
+print dnode1 off: $data(1)[7]
+print dnode2 off: $data(3)[7]
+print dnode3 off: $data(4)[67
+if $data(4)[7] != @interval not match@ then
goto step6
endi
@@ -120,11 +120,11 @@ step7:
endi
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode3 off: $data(3)[6]
-print dnode4 off: $data(4)[6]
-print dnode5 off: $data(5)[6]
-if $data(5)[6] != @locale not match@ then
+print dnode1 off: $data(1)[7]
+print dnode3 off: $data(3)[7]
+print dnode4 off: $data(4)[7]
+print dnode5 off: $data(5)[7]
+if $data(5)[7] != @locale not match@ then
goto step7
endi
@@ -143,12 +143,12 @@ step8:
endi
sql select * from information_schema.ins_dnodes
-print dnode1 off: $data(1)[6]
-print dnode3 off: $data(3)[6]
-print dnode4 off: $data(4)[6]
-print dnode5 off: $data(5)[6]
-print dnode6 off: $data(6)[6]
-if $data(6)[6] != @charset not match@ then
+print dnode1 off: $data(1)[7]
+print dnode3 off: $data(3)[7]
+print dnode4 off: $data(4)[7]
+print dnode5 off: $data(5)[7]
+print dnode6 off: $data(6)[7]
+if $data(6)[7] != @charset not match@ then
goto step8
endi
diff --git a/tests/script/tsim/parser/sliding.sim b/tests/script/tsim/parser/sliding.sim
index b9353e2c61..45a49fbc4e 100644
--- a/tests/script/tsim/parser/sliding.sim
+++ b/tests/script/tsim/parser/sliding.sim
@@ -49,9 +49,23 @@ while $i < $tbNum
$nchar = $nchar . $c
$nchar = $nchar . '
- sql insert into $tb values ($tstart , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar )
- $tstart = $tstart + 30
- $x = $x + 1
+ $next = $tstart + 30
+ $f = $x + 1
+ $c1 = $f / 100
+ $c1 = $c1 * 100
+ $c1 = $f - $c1
+
+ $binary1 = ' . binary
+ $binary1 = $binary1 . $c1
+ $binary1 = $binary1 . '
+
+ $nchar1 = ' . nchar
+ $nchar1 = $nchar1 . $c1
+ $nchar1 = $nchar1 . '
+
+ sql insert into $tb values ($tstart , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar ) ($next , $c1 , $c1 , $c1 , $c1 , $c1 , $c1 , $c1 , $binary1 , $nchar1 )
+ $tstart = $tstart + 60
+ $x = $x + 2
endw
$i = $i + 1
diff --git a/tests/script/tsim/query/emptyTsRange.sim b/tests/script/tsim/query/emptyTsRange.sim
new file mode 100644
index 0000000000..ca3daf2bbb
--- /dev/null
+++ b/tests/script/tsim/query/emptyTsRange.sim
@@ -0,0 +1,20 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+sql drop database if exists db1;
+sql create database if not exists db1;
+sql use db1;
+sql create stable sta (ts timestamp, f1 double, f2 binary(200)) tags(t1 int);
+sql create table tba1 using sta tags(1);
+sql insert into tba1 values ('2022-04-26 15:15:01', 1.0, "a");
+sql insert into tba1 values ('2022-04-26 15:15:02', 2.0, "b");
+sql insert into tba1 values ('2022-04-26 15:15:04', 4.0, "b");
+sql insert into tba1 values ('2022-04-26 15:15:05', 5.0, "b");
+sql select last_row(*) from sta where ts >= 1678901803783 and ts <= 1678901803783 and _c0 <= 1678901803782 interval(10d,8d) fill(linear) order by _wstart desc;
+if $rows != 0 then
+ return -1
+endi
+
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/query/tagLikeFilter.sim b/tests/script/tsim/query/tagLikeFilter.sim
new file mode 100644
index 0000000000..79c1bc7c0b
--- /dev/null
+++ b/tests/script/tsim/query/tagLikeFilter.sim
@@ -0,0 +1,36 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+sql drop database if exists db1;
+sql create database if not exists db1 vgroups 10;
+sql use db1;
+sql create stable sta (ts timestamp, f1 double, f2 binary(200)) tags(t1 binary(100));
+sql create table tba1 using sta tags('ZQMPvstuzZVzCRjFTQawILuGSqZKSqlJwcBtZMxrAEqBbzChHWVDMiAZJwESzJAf');
+sql create table tba2 using sta tags('ieofwehughkreghughuerugu34jf9340aieefjalie28ffj8fj8fafjaekdfjfii');
+sql create table tba3 using sta tags('ZQMPvstuzZVzCRjFTQawILuGSqabSqlJwcBtZMxrAEqBbzChHWVDMiAZJwESzJAf');
+sql insert into tba1 values ('2022-04-26 15:15:01', 1.0, "a");
+sql insert into tba2 values ('2022-04-26 15:15:01', 1.0, "a");
+sql insert into tba2 values ('2022-04-26 15:15:02', 1.0, "a");
+sql insert into tba3 values ('2022-04-26 15:15:01', 1.0, "a");
+sql insert into tba3 values ('2022-04-26 15:15:02', 1.0, "a");
+sql insert into tba3 values ('2022-04-26 15:15:03', 1.0, "a");
+sql select t1 from sta where t1 like '%ab%';
+if $rows != 3 then
+ return -1
+endi
+sql select t1 from sta where t1 like '%ax%';
+if $rows != 0 then
+ return -1
+endi
+sql select t1 from sta where t1 like '%cd%';
+if $rows != 0 then
+ return -1
+endi
+sql select t1 from sta where t1 like '%ii';
+if $rows != 2 then
+ return -1
+endi
+
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/stream/basic0.sim b/tests/script/tsim/stream/basic0.sim
index 8e3e99978b..68c5894cbf 100644
--- a/tests/script/tsim/stream/basic0.sim
+++ b/tests/script/tsim/stream/basic0.sim
@@ -48,24 +48,35 @@ sleep 100
#===================================================================
print =============== query data from child table
+$loop_count = 0
+
+loop0:
+sleep 200
+
+$loop_count = $loop_count + 1
+if $loop_count == 20 then
+ return -1
+endi
+
sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
+
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
- return -1
+ goto loop0
endi
if $data01 != 234 then
- return -1
+ goto loop0
endi
if $data02 != 234 then
- return -1
+ goto loop0
endi
if $data03 != 234 then
print expect 234, actual $data03
- return -1
+ goto loop0
endi
#===================================================================
@@ -77,23 +88,34 @@ sleep 100
#===================================================================
print =============== query data from child table
+$loop_count = 0
+
+loop1:
+sleep 200
+
+$loop_count = $loop_count + 1
+if $loop_count == 20 then
+ return -1
+endi
+
sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
+
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
- return -1
+ goto loop1
endi
if $data01 != -111 then
- return -1
+ goto loop1
endi
if $data02 != 234 then
- return -1
+ goto loop1
endi
if $data03 != 123 then
- return -1
+ goto loop1
endi
#===================================================================
@@ -105,36 +127,46 @@ sleep 100
#===================================================================
print =============== query data from child table
+$loop_count = 0
+
+loop2:
+sleep 200
+
+$loop_count = $loop_count + 1
+if $loop_count == 20 then
+ return -1
+endi
+
sql select `_wstart`,`min(k)`,`max(k)`,sum_alias from outstb
print rows: $rows
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
if $rows != 2 then
- return -1
+ goto loop2
endi
if $data01 != -111 then
- return -1
+ goto loop2
endi
if $data02 != 234 then
- return -1
+ goto loop2
endi
if $data03 != 123 then
- return -1
+ goto loop2
endi
if $data11 != 789 then
- return -1
+ goto loop2
endi
if $data12 != 789 then
- return -1
+ goto loop2
endi
if $data13 != 789 then
- return -1
+ goto loop2
endi
_OVER:
diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim
index c61c7667f8..e69875d69f 100644
--- a/tests/script/tsim/stream/basic1.sim
+++ b/tests/script/tsim/stream/basic1.sim
@@ -17,7 +17,7 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,2,2,3,1.1);
sql insert into t1 values(1648791233002,3,2,3,2.1);
@@ -545,8 +545,8 @@ sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(2,2,2);
sql create table t4 using st tags(2,2,2);
sql create table t5 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3,max(b) c4 from st partition by tbname interval(10s);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1, sum(a) c3,max(b) c4, now c5 from st partition by tbname interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a) c3,max(b) c4 from st partition by tbname interval(10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart, count(*) c1, sum(a) c3,max(b) c4, now c5 from st partition by tbname interval(10s);
sql insert into t1 values(1648791213000,1,1,1,1.0) t2 values(1648791213000,2,2,2,2.0) t3 values(1648791213000,3,3,3,3.0) t4 values(1648791213000,4,4,4,4.0);
@@ -667,7 +667,7 @@ sql create database test3 vgroups 1;
sql use test3;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
-sql create stream stream_t3 trigger at_once into streamtST3 as select ts, min(a) c6, a, b, c, ta, tb, tc from ts1 interval(10s) ;
+sql create stream stream_t3 trigger at_once IGNORE EXPIRED 0 into streamtST3 as select ts, min(a) c6, a, b, c, ta, tb, tc from ts1 interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sleep 50
@@ -701,7 +701,7 @@ endi
sql create database test4 vgroups 1;
sql use test4;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart, count(*) c1 from t1 where a > 5 interval(10s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart, count(*) c1 from t1 where a > 5 interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
$loop_count = 0
@@ -797,8 +797,8 @@ sql create database test5 vgroups 1;
sql use test5;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
-sql create stream streams5 trigger at_once into streamt5 as select count(*), _wstart, _wend, max(a) from ts1 interval(10s) ;
-sql create stream streams6 trigger at_once into streamt6 as select count(*), _wstart, _wend, max(a), _wstart as ts from ts1 interval(10s) ;
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into streamt5 as select count(*), _wstart, _wend, max(a) from ts1 interval(10s) ;
+sql create stream streams6 trigger at_once IGNORE EXPIRED 0 into streamt6 as select count(*), _wstart, _wend, max(a), _wstart as ts from ts1 interval(10s) ;
sql_error create stream streams7 trigger at_once into streamt7 as select _wstart, count(*), _wstart, _wend, max(a) from ts1 interval(10s) ;
sql_error create stream streams8 trigger at_once into streamt8 as select count(*), _wstart, _wstart, _wend, max(a) from ts1 interval(10s) ;
@@ -840,7 +840,7 @@ sql create database test7 vgroups 1;
sql use test7;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
-sql create stream streams7 trigger at_once into streamt7 as select _wstart, count(*) from ts1 interval(10s) ;
+sql create stream streams7 trigger at_once IGNORE EXPIRED 0 into streamt7 as select _wstart, count(*) from ts1 interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sql_error insert into ts1 values(-1648791211000,1,2,3);
@@ -887,4 +887,20 @@ if $rows != 1 then
goto loop19
endi
+print select * from information_schema.ins_stream_tasks;
+sql select * from information_schema.ins_stream_tasks;
+
+if $rows == 0 then
+ print =====rows=$rows
+ return -1
+endi
+
+print select * from information_schema.ins_streams;
+sql select * from information_schema.ins_streams;
+
+if $rows == 0 then
+ print =====rows=$rows
+ return -1
+endi
+
system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/stream/deleteInterval.sim b/tests/script/tsim/stream/deleteInterval.sim
index 7532b2d5de..9540e448d4 100644
--- a/tests/script/tsim/stream/deleteInterval.sim
+++ b/tests/script/tsim/stream/deleteInterval.sim
@@ -16,7 +16,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3 from t1 interval(10s);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3 from t1 interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sleep 200
@@ -193,7 +193,7 @@ sql use test2;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -419,7 +419,7 @@ sql use test3;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams3 trigger at_once into test.streamt3 as select _wstart c1, count(*) c2, max(a) c3 from st interval(10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into test.streamt3 as select _wstart c1, count(*) c2, max(a) c3 from st interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL);
diff --git a/tests/script/tsim/stream/deleteSession.sim b/tests/script/tsim/stream/deleteSession.sim
index c3c64a5977..3645939178 100644
--- a/tests/script/tsim/stream/deleteSession.sim
+++ b/tests/script/tsim/stream/deleteSession.sim
@@ -16,7 +16,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3 from t1 session(ts, 5s);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3 from t1 session(ts, 5s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sleep 200
@@ -191,7 +191,7 @@ sql use test2;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st session(ts,5s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st session(ts,5s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -422,7 +422,7 @@ sql use test3;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams3 trigger at_once into test.streamt3 as select _wstart c1, count(*) c2, max(a) c3 from st session(ts,5s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into test.streamt3 as select _wstart c1, count(*) c2, max(a) c3 from st session(ts,5s);
sql insert into t1 values(1648791210000,1,1,1,NULL);
sql insert into t1 values(1648791210001,2,2,2,NULL);
@@ -532,8 +532,8 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-print create stream streams4 trigger at_once into streamt4 as select _wstart, count(*) c1 from st partition by tbname session(ts, 2s);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart, count(*) c1 from st partition by tbname session(ts, 2s);
+print create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart, count(*) c1 from st partition by tbname session(ts, 2s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart, count(*) c1 from st partition by tbname session(ts, 2s);
sql insert into t1 values(1648791210000,1,2,3);
sql insert into t1 values(1648791220000,2,2,3);
diff --git a/tests/script/tsim/stream/deleteState.sim b/tests/script/tsim/stream/deleteState.sim
index 45d9bc3e39..dd74b73dce 100644
--- a/tests/script/tsim/stream/deleteState.sim
+++ b/tests/script/tsim/stream/deleteState.sim
@@ -16,7 +16,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 state_window(a);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 state_window(a);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sleep 200
@@ -197,8 +197,8 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-print create stream streams4 trigger at_once into streamt4 as select _wstart, count(*) c1 from st partition by tbname state_window(c);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart, count(*) c1 from st partition by tbname state_window(c);
+print create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart, count(*) c1 from st partition by tbname state_window(c);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart, count(*) c1 from st partition by tbname state_window(c);
sql insert into t1 values(1648791210000,1,2,1);
sql insert into t1 values(1648791220000,2,2,2);
diff --git a/tests/script/tsim/stream/distributeIntervalRetrive0.sim b/tests/script/tsim/stream/distributeIntervalRetrive0.sim
index ae2f9afdb5..529a2a1b30 100644
--- a/tests/script/tsim/stream/distributeIntervalRetrive0.sim
+++ b/tests/script/tsim/stream/distributeIntervalRetrive0.sim
@@ -44,7 +44,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into streamtST1 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
@@ -243,7 +243,7 @@ sql use test1;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as c0, count(*) c1, count(a) c2 from st interval(10s) ;
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as c0, count(*) c1, count(a) c2 from st interval(10s) ;
sql insert into t1 values(1648791211000,1,2,3);
diff --git a/tests/script/tsim/stream/distributeSession0.sim b/tests/script/tsim/stream/distributeSession0.sim
index d752f5c29c..25ac479a38 100644
--- a/tests/script/tsim/stream/distributeSession0.sim
+++ b/tests/script/tsim/stream/distributeSession0.sim
@@ -39,7 +39,7 @@ sql use test;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c2 , max(b) c3 from st session(ts, 10s) ;
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into streamtST as select _wstart, count(*) c1, sum(a) c2 , max(b) c3 from st session(ts, 10s) ;
sleep 1000
diff --git a/tests/script/tsim/stream/fillHistoryBasic1.sim b/tests/script/tsim/stream/fillHistoryBasic1.sim
index 772a09c017..e7a8da90e2 100644
--- a/tests/script/tsim/stream/fillHistoryBasic1.sim
+++ b/tests/script/tsim/stream/fillHistoryBasic1.sim
@@ -17,7 +17,7 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream stream1 trigger at_once fill_history 1 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream stream1 trigger at_once fill_history 1 IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,2,2,3,1.1);
@@ -479,7 +479,7 @@ sql insert into t1 values(1648791233002,3,2,3,2.1);
sql insert into t1 values(1648791243003,4,2,3,3.1);
sql insert into t1 values(1648791213004,4,2,3,4.1);
-sql create stream stream2 trigger at_once fill_history 1 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream stream2 trigger at_once fill_history 1 IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sleep 5000
sql select `_wstart`, c1, c2 ,c3 ,c4, c5 from streamt;
diff --git a/tests/script/tsim/stream/fillHistoryBasic2.sim b/tests/script/tsim/stream/fillHistoryBasic2.sim
index 3af198259d..2f6c3ea92d 100644
--- a/tests/script/tsim/stream/fillHistoryBasic2.sim
+++ b/tests/script/tsim/stream/fillHistoryBasic2.sim
@@ -79,7 +79,7 @@ sql insert into ts3 values(1648791243005,4,42,3,3.1) (1648791243003,4,2,33,3.1)
sql insert into ts4 values(1648791243005,4,42,3,3.1) (1648791243003,4,2,33,3.1) (1648791243006,4,2,3,3.1) (1648791213001,1,52,13,1.0) (1648791223001,22,22,83,1.1) (1648791233004,13,12,13,2.1) ;
sql insert into ts3 values(1648791243006,4,2,3,3.1) (1648791213001,1,52,13,1.0) (1648791223001,22,22,83,1.1) ;
-sql create stream stream_t1 trigger at_once fill_history 1 watermark 1d into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once fill_history 1 watermark 1d IGNORE EXPIRED 0 into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
@@ -211,7 +211,7 @@ sql insert into ts1 values(1648791222001,2,2,3);
sql insert into ts2 values(1648791211000,1,2,3);
sql insert into ts2 values(1648791222001,2,2,3);
-sql create stream stream_t2 trigger at_once fill_history 1 watermark 20s into streamtST1 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
+sql create stream stream_t2 trigger at_once fill_history 1 watermark 20s IGNORE EXPIRED 0 into streamtST1 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st interval(10s) ;
$loop_count = 0
loop2:
@@ -241,7 +241,7 @@ sql use test3;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t3 trigger at_once into streamtST3 as select ts, min(a) c6, a, b, c, ta, tb, tc from st interval(10s) ;
+sql create stream stream_t3 trigger at_once IGNORE EXPIRED 0 into streamtST3 as select ts, min(a) c6, a, b, c, ta, tb, tc from st interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sleep 50
diff --git a/tests/script/tsim/stream/fillHistoryBasic3.sim b/tests/script/tsim/stream/fillHistoryBasic3.sim
index db8d6bc2d0..44d7ee9d9e 100644
--- a/tests/script/tsim/stream/fillHistoryBasic3.sim
+++ b/tests/script/tsim/stream/fillHistoryBasic3.sim
@@ -17,7 +17,7 @@ sql create table t2 using st tags(2,2,2);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL);
-sql create stream streams2 trigger at_once fill_history 1 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
+sql create stream streams2 trigger at_once fill_history 1 IGNORE EXPIRED 0 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
sleep 3000
diff --git a/tests/script/tsim/stream/fillIntervalDelete0.sim b/tests/script/tsim/stream/fillIntervalDelete0.sim
index 1c0647d57b..41b018a862 100644
--- a/tests/script/tsim/stream/fillIntervalDelete0.sim
+++ b/tests/script/tsim/stream/fillIntervalDelete0.sim
@@ -16,11 +16,11 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791213000,1,1,1,1.0,'aaa');
sleep 200
@@ -256,11 +256,11 @@ sql use test6;
sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(1,1,1);
-sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
-sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
-sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
-sql create stream streams9 trigger at_once into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams10 trigger at_once into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams6 trigger at_once IGNORE EXPIRED 0 into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
+sql create stream streams7 trigger at_once IGNORE EXPIRED 0 into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
+sql create stream streams8 trigger at_once IGNORE EXPIRED 0 into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams9 trigger at_once IGNORE EXPIRED 0 into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams10 trigger at_once IGNORE EXPIRED 0 into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791210000,1,1,1,1.0,'aaa');
sql insert into t1 values(1648791217000,1,1,1,1.0,'aaa');
diff --git a/tests/script/tsim/stream/fillIntervalDelete1.sim b/tests/script/tsim/stream/fillIntervalDelete1.sim
index 0206b88fdc..108f5f862d 100644
--- a/tests/script/tsim/stream/fillIntervalDelete1.sim
+++ b/tests/script/tsim/stream/fillIntervalDelete1.sim
@@ -18,11 +18,11 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into streamt5 as select _wstart as ts, max(a), sum(b), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791210000,0,0,0,0.0,'aaa');
sql insert into t1 values(1648791213000,1,1,1,1.0,'bbb');
@@ -221,11 +221,11 @@ sql use test6;
sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(1,1,1);
-sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
-sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
-sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
-sql create stream streams9 trigger at_once into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams10 trigger at_once into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams6 trigger at_once IGNORE EXPIRED 0 into streamt6 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(NULL);
+sql create stream streams7 trigger at_once IGNORE EXPIRED 0 into streamt7 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value,100,200,300);
+sql create stream streams8 trigger at_once IGNORE EXPIRED 0 into streamt8 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams9 trigger at_once IGNORE EXPIRED 0 into streamt9 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams10 trigger at_once IGNORE EXPIRED 0 into streamt10 as select _wstart as ts, max(a), sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791210000,1,1,1,1.0,'aaa');
sql insert into t1 values(1648791215000,6,8,8,8.0,'bbb');
@@ -353,11 +353,11 @@ sql drop database if exists test7;
sql create database test7 vgroups 1;
sql use test7;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams11 trigger at_once into streamt11 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(NULL);
-sql create stream streams12 trigger at_once into streamt12 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(value,100.0,200);
-sql create stream streams13 trigger at_once into streamt13 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(next);
-sql create stream streams14 trigger at_once into streamt14 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(prev);
-sql create stream streams15 trigger at_once into streamt15 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(linear);
+sql create stream streams11 trigger at_once IGNORE EXPIRED 0 into streamt11 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(NULL);
+sql create stream streams12 trigger at_once IGNORE EXPIRED 0 into streamt12 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(value,100.0,200);
+sql create stream streams13 trigger at_once IGNORE EXPIRED 0 into streamt13 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(next);
+sql create stream streams14 trigger at_once IGNORE EXPIRED 0 into streamt14 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(prev);
+sql create stream streams15 trigger at_once IGNORE EXPIRED 0 into streamt15 as select _wstart as ts, avg(a), count(*), timezone(), to_iso8601(1) from t1 where ts >= 1648791210000 and ts < 1648791240000 interval(1s) fill(linear);
sql insert into t1 values(1648791210000,1,1,1,1.0,'aaa');
diff --git a/tests/script/tsim/stream/fillIntervalLinear.sim b/tests/script/tsim/stream/fillIntervalLinear.sim
index b9f301d81b..3fa369d8d5 100644
--- a/tests/script/tsim/stream/fillIntervalLinear.sim
+++ b/tests/script/tsim/stream/fillIntervalLinear.sim
@@ -16,7 +16,7 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791216000,5,5,5,5.0,'bbb');
sql insert into t1 values(1648791210000,1,1,1,1.0,'ccc') (1648791219000,2,2,2,2.0,'ddd') (1648791222000,3,3,3,3.0,'eee');
@@ -205,7 +205,7 @@ sql drop database if exists test2;
sql create database test2 vgroups 1;
sql use test2;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, max(a)+sum(c), avg(b), first(s), count(*) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791210000,1,1,1,1.0,'ccc') (1648791219000,2,2,2,2.0,'ddd') (1648791222000,3,3,3,3.0,'eee');
sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791216000,5,5,5,5.0,'bbb');
@@ -393,7 +393,7 @@ sql drop database if exists test3;
sql create database test3 vgroups 1;
sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a), b+c, s, b+1, 1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(linear);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart as ts, max(a), b+c, s, b+1, 1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(linear);
sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa');
sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb');
sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc');
diff --git a/tests/script/tsim/stream/fillIntervalPartitionBy.sim b/tests/script/tsim/stream/fillIntervalPartitionBy.sim
index 168452fdc8..6a11b9952c 100644
--- a/tests/script/tsim/stream/fillIntervalPartitionBy.sim
+++ b/tests/script/tsim/stream/fillIntervalPartitionBy.sim
@@ -18,11 +18,11 @@ sql use test1;
sql create stable st(ts timestamp, a int, b int , c int, d double, s varchar(20)) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(NULL);
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(value,100,200,300);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(next);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(prev);
-sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(linear);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(NULL);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(value,100,200,300);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(next);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(prev);
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into streamt5 as select _wstart as ts, max(a) c1, sum(b), count(*) from st where ts >= 1648791210000 and ts < 1648791261000 partition by ta interval(1s) fill(linear);
sql insert into t1 values(1648791210000,0,0,0,0.0,'aaa');
sql insert into t1 values(1648791213000,1,1,1,1.0,'bbb');
diff --git a/tests/script/tsim/stream/fillIntervalPrevNext.sim b/tests/script/tsim/stream/fillIntervalPrevNext.sim
index 99f7dcb5cb..ec963e1d4a 100644
--- a/tests/script/tsim/stream/fillIntervalPrevNext.sim
+++ b/tests/script/tsim/stream/fillIntervalPrevNext.sim
@@ -15,8 +15,8 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams1 trigger at_once into streamt1 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa');
sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa');
@@ -263,8 +263,8 @@ sql drop database if exists test5;
sql create database test5 vgroups 1;
sql use test5;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams5 trigger at_once into streamt5 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams6 trigger at_once into streamt6 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into streamt5 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams6 trigger at_once IGNORE EXPIRED 0 into streamt6 as select _wstart as ts, count(*) c1, max(a)+min(c), avg(b) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(next);
sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa');
sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa');
diff --git a/tests/script/tsim/stream/fillIntervalPrevNext1.sim b/tests/script/tsim/stream/fillIntervalPrevNext1.sim
index 8058065bcf..40ef895c5a 100644
--- a/tests/script/tsim/stream/fillIntervalPrevNext1.sim
+++ b/tests/script/tsim/stream/fillIntervalPrevNext1.sim
@@ -16,8 +16,8 @@ sql drop database if exists test7;
sql create database test7 vgroups 1;
sql use test7;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev);
-sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next);
+sql create stream streams7 trigger at_once IGNORE EXPIRED 0 into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev);
+sql create stream streams8 trigger at_once IGNORE EXPIRED 0 into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next);
sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa');
sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb');
sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc');
diff --git a/tests/script/tsim/stream/fillIntervalRange.sim b/tests/script/tsim/stream/fillIntervalRange.sim
index a0905141f2..0e0dfb46d8 100644
--- a/tests/script/tsim/stream/fillIntervalRange.sim
+++ b/tests/script/tsim/stream/fillIntervalRange.sim
@@ -13,7 +13,7 @@ sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
-sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 interval(1s) fill(NULL);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart ts, count(*) c1 from t1 interval(1s) fill(NULL);
sql insert into t1 values(1648791211000,1,2,3,1.0,'aaa');
sleep 100
sql insert into t1 values(1648795308000,1,2,3,1.0,'aaa');
@@ -126,10 +126,10 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
print create stream streams1 trigger at_once into streamt as select _wstart ts, max(a) c1 from t1 interval(1s) fill(linear);
-sql create stream streams1 trigger at_once into streamt as select _wstart ts, max(a) c1 from t1 interval(1s) fill(linear);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart ts, max(a) c1 from t1 interval(1s) fill(linear);
print create stream streams2 trigger at_once into streamt2 as select _wstart ts, max(a) c1 from t1 interval(1s) fill(prev);
-sql create stream streams2 trigger at_once into streamt2 as select _wstart ts, max(a) c1 from t1 interval(1s) fill(prev);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart ts, max(a) c1 from t1 interval(1s) fill(prev);
sql insert into t1 values(1648791211000,1,2,3,1.0,'aaa');
sleep 100
diff --git a/tests/script/tsim/stream/fillIntervalValue.sim b/tests/script/tsim/stream/fillIntervalValue.sim
index 2cd419397f..b447e9a559 100644
--- a/tests/script/tsim/stream/fillIntervalValue.sim
+++ b/tests/script/tsim/stream/fillIntervalValue.sim
@@ -13,8 +13,8 @@ sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
-sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
-sql create stream streams1a trigger at_once into streamta as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value_f, 100);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value, 100);
+sql create stream streams1a trigger at_once IGNORE EXPIRED 0 into streamta as select _wstart ts, count(*) c1 from t1 where ts > 1648791210000 and ts < 1648791413000 interval(10s) fill(value_f, 100);
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
sleep 100
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
@@ -146,7 +146,7 @@ sql drop database if exists test2;
sql create database test2 vgroups 1;
sql use test2;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams2 trigger at_once into streamt2 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value, 100,200);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart as ts, count(*) c1, max(b)+sum(a) from t1 where ts >= 1648791210000 and ts < 1648791261000 interval(1s) fill(value, 100,200);
sql insert into t1 values(1648791211000,1,1,1,1.0,'aaa') (1648791217000,2,2,2,2.0,'aaa') (1648791220000,3,3,3,3.0,'aaa');
sql insert into t1 values(1648791213000,4,4,4,4.0,'aaa') (1648791215000,5,5,5,5.0,'aaa');
@@ -280,7 +280,7 @@ sql drop database if exists test3;
sql create database test3 vgroups 1;
sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
-sql create stream streams3 trigger at_once into streamt3 as select _wstart as ts, max(b), a+b, c from t1 where ts >= 1648791200000 and ts < 1648791261000 interval(10s) sliding(3s) fill(value, 100,200,300);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart as ts, max(b), a+b, c from t1 where ts >= 1648791200000 and ts < 1648791261000 interval(10s) sliding(3s) fill(value, 100,200,300);
sql insert into t1 values(1648791220000,1,1,1,1.0,'aaa');
sleep 100
@@ -471,8 +471,8 @@ sql create stable st(ts timestamp,a int,b int,c int, d double, s varchar(20) ) t
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
-sql create stream streams4a trigger at_once into streamt4a as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL_F);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL);
+sql create stream streams4a trigger at_once IGNORE EXPIRED 0 into streamt4a as select _wstart ts, count(*) c1, concat(tbname, 'aaa') as pname, timezone() from st where ts > 1648791000000 and ts < 1648793000000 partition by tbname interval(10s) fill(NULL_F);
sql insert into t1 values(1648791213000,1,2,3,1.0,'aaa');
sql insert into t1 values(1648791233000,1,2,3,1.0,'aaa');
sql insert into t1 values(1648791273000,1,2,3,1.0,'aaa');
diff --git a/tests/script/tsim/stream/ignoreCheckUpdate.sim b/tests/script/tsim/stream/ignoreCheckUpdate.sim
index 7f99c534c8..2cd0117feb 100644
--- a/tests/script/tsim/stream/ignoreCheckUpdate.sim
+++ b/tests/script/tsim/stream/ignoreCheckUpdate.sim
@@ -12,9 +12,9 @@ sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int);
-print create stream streams0 trigger at_once ignore update 1 into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 interval(10s);
+print create stream streams0 trigger at_once IGNORE EXPIRED 0 ignore update 1 into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 interval(10s);
-sql create stream streams0 trigger at_once ignore update 1 into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 interval(10s);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 ignore update 1 into streamt as select _wstart c1, count(*) c2, max(b) c3 from t1 interval(10s);
sql insert into t1 values(1648791213000,1,1,1);
sql insert into t1 values(1648791213000,2,2,2);
diff --git a/tests/script/tsim/stream/partitionby.sim b/tests/script/tsim/stream/partitionby.sim
index bc2c07b951..e63459e97d 100644
--- a/tests/script/tsim/stream/partitionby.sim
+++ b/tests/script/tsim/stream/partitionby.sim
@@ -12,7 +12,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into test0.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s);
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into test0.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by ta,tb,tc interval(10s);
sql insert into ts1 values(1648791213001,1,12,3,1.0);
sql insert into ts2 values(1648791213001,1,12,3,1.0);
@@ -67,7 +67,7 @@ sql create table ts1 using st tags(1,2,3);
sql create table ts2 using st tags(1,3,4);
sql create table ts3 using st tags(1,4,5);
-sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by ta,tb,tc interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by ta,tb,tc interval(10s);
sql insert into ts1 values(1648791211000,1,2,3);
@@ -98,7 +98,7 @@ sql create stable st(ts timestamp,a int,b int,c int,id int) tags(ta int,tb int,t
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t2 trigger at_once watermark 20s into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by ta interval(10s) ;
+sql create stream stream_t2 trigger at_once watermark 20s IGNORE EXPIRED 0 into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by ta interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3,1);
sql insert into ts1 values(1648791222001,2,2,3,2);
sql insert into ts2 values(1648791211000,1,2,3,3);
diff --git a/tests/script/tsim/stream/partitionby1.sim b/tests/script/tsim/stream/partitionby1.sim
index b29666cad7..c8bb25e0dd 100644
--- a/tests/script/tsim/stream/partitionby1.sim
+++ b/tests/script/tsim/stream/partitionby1.sim
@@ -11,7 +11,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by tbname interval(10s);
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st partition by tbname interval(10s);
sql insert into ts1 values(1648791213001,1,12,3,1.0);
sql insert into ts2 values(1648791213001,1,12,3,1.0);
@@ -43,7 +43,7 @@ sql create table ts1 using st tags(1,2,3);
sql create table ts2 using st tags(1,3,4);
sql create table ts3 using st tags(1,4,5);
-sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by tbname interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(a) c2 from st partition by tbname interval(10s);
sql insert into ts1 values(1648791211000,1,2,3);
@@ -74,7 +74,7 @@ sql create stable st(ts timestamp,a int,b int,c int,id int) tags(ta int,tb int,t
sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
-sql create stream stream_t2 trigger at_once into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by tbname interval(10s) ;
+sql create stream stream_t2 trigger at_once IGNORE EXPIRED 0 into streamtST as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6, max(id) c7 from st partition by tbname interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3,1);
sql insert into ts1 values(1648791222001,2,2,3,2);
sql insert into ts2 values(1648791211000,1,2,3,3);
diff --git a/tests/script/tsim/stream/partitionbyColumnInterval.sim b/tests/script/tsim/stream/partitionbyColumnInterval.sim
index 2e57e8d699..94053990e4 100644
--- a/tests/script/tsim/stream/partitionbyColumnInterval.sim
+++ b/tests/script/tsim/stream/partitionbyColumnInterval.sim
@@ -16,7 +16,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a interval(10s);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -197,7 +197,7 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -284,7 +284,7 @@ sql use test2;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -481,7 +481,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(2,2,2);
sql create table t4 using st tags(2,2,2);
-sql create stream streams4 trigger at_once into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
sql insert into t1 values(1648791213000,2,2,3,1.0);
sql insert into t2 values(1648791213000,2,2,3,1.0);
@@ -571,7 +571,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(2,2,2);
sql create table t4 using st tags(2,2,2);
-sql create stream streams5 trigger at_once into test.streamt5 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
+sql create stream streams5 trigger at_once IGNORE EXPIRED 0 into test.streamt5 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t2 values(1648791213000,2,2,3,1.0);
diff --git a/tests/script/tsim/stream/partitionbyColumnSession.sim b/tests/script/tsim/stream/partitionbyColumnSession.sim
index 1742d52cf0..bb3f6015c7 100644
--- a/tests/script/tsim/stream/partitionbyColumnSession.sim
+++ b/tests/script/tsim/stream/partitionbyColumnSession.sim
@@ -16,7 +16,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a session(ts, 5s);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a session(ts, 5s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -196,7 +196,7 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b session(ts, 5s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b session(ts, 5s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -282,7 +282,7 @@ sql use test2;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -478,7 +478,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(2,2,2);
sql create table t4 using st tags(2,2,2);
-sql create stream streams4 trigger at_once into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s);
sql insert into t1 values(1648791213000,2,2,3,1.0);
sql insert into t2 values(1648791213000,2,2,3,1.0);
diff --git a/tests/script/tsim/stream/partitionbyColumnState.sim b/tests/script/tsim/stream/partitionbyColumnState.sim
index 75d01b17ec..62262a490c 100644
--- a/tests/script/tsim/stream/partitionbyColumnState.sim
+++ b/tests/script/tsim/stream/partitionbyColumnState.sim
@@ -11,7 +11,7 @@ sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a state_window(b);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a state_window(b);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
@@ -191,7 +191,7 @@ sql drop database if exists test1;
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d int);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(d) c3, _group_key(a+b) c4 from t1 partition by a+b state_window(c);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart c1, count(*) c2, max(d) c3, _group_key(a+b) c4 from t1 partition by a+b state_window(c);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL);
diff --git a/tests/script/tsim/stream/schedSnode.sim b/tests/script/tsim/stream/schedSnode.sim
index 2caecf50a2..6a4d6f79bb 100644
--- a/tests/script/tsim/stream/schedSnode.sim
+++ b/tests/script/tsim/stream/schedSnode.sim
@@ -20,7 +20,7 @@ sql create table ts1 using st tags(1,1,1);
sql create table ts2 using st tags(2,2,2);
sql create table ts3 using st tags(3,2,2);
sql create table ts4 using st tags(4,2,2);
-sql create stream stream_t1 trigger at_once into target.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into target.streamtST1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s);
sleep 1000
diff --git a/tests/script/tsim/stream/session0.sim b/tests/script/tsim/stream/session0.sim
index 5e95428e0a..622c5f7c6d 100644
--- a/tests/script/tsim/stream/session0.sim
+++ b/tests/script/tsim/stream/session0.sim
@@ -17,7 +17,7 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double,id int);
-sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a), max(a), min(d), stddev(a), last(a), first(d), max(id) s from t1 session(ts,10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a), max(a), min(d), stddev(a), last(a), first(d), max(id) s from t1 session(ts,10s);
sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL,1);
sql insert into t1 values(1648791223001,10,2,3,1.1,2);
sql insert into t1 values(1648791233002,3,2,3,2.1,3);
@@ -179,7 +179,7 @@ endi
sql create database test2 vgroups 1;
sql use test2;
sql create table t2(ts timestamp, a int, b int , c int, d double, id int);
-sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart,apercentile(a,30) c1, apercentile(a,70), apercentile(a,20,"t-digest") c2, apercentile(a,60,"t-digest") c3, max(id) c4 from t2 session(ts,10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 watermark 1d into streamt2 as select _wstart,apercentile(a,30) c1, apercentile(a,70), apercentile(a,20,"t-digest") c2, apercentile(a,60,"t-digest") c3, max(id) c4 from t2 session(ts,10s);
sql insert into t2 values(1648791213001,1,1,3,1.0,1);
sql insert into t2 values(1648791213002,2,2,6,3.4,2);
sql insert into t2 values(1648791213003,4,9,3,4.8,3);
@@ -229,13 +229,13 @@ endi
sql create database test3 vgroups 1;
sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams3 trigger at_once watermark 1d into streamt3 as select _wstart, min(b), a,c from t1 session(ts,10s);
-sql create stream streams4 trigger at_once watermark 1d into streamt4 as select _wstart, max(b), a,c from t1 session(ts,10s);
-# sql create stream streams5 trigger at_once watermark 1d into streamt5 as select _wstart, top(b,3), a,c from t1 session(ts,10s);
-# sql create stream streams6 trigger at_once watermark 1d into streamt6 as select _wstart, bottom(b,3), a,c from t1 session(ts,10s);
-# sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstart, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s);
-sql create stream streams7 trigger at_once watermark 1d into streamt7 as select _wstart, spread(a), hyperloglog(a) from t1 session(ts,10s);
-# sql create stream streams8 trigger at_once watermark 1d into streamt8 as select _wstart, histogram(a,"user_input", "[1,3,5,7]", 1), histogram(a,"user_input", "[1,3,5,7]", 0) from t1 session(ts,10s);
+sql create stream streams3 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt3 as select _wstart, min(b), a,c from t1 session(ts,10s);
+sql create stream streams4 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt4 as select _wstart, max(b), a,c from t1 session(ts,10s);
+# sql create stream streams5 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt5 as select _wstart, top(b,3), a,c from t1 session(ts,10s);
+# sql create stream streams6 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt6 as select _wstart, bottom(b,3), a,c from t1 session(ts,10s);
+# sql create stream streams7 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt7 as select _wstart, spread(a), elapsed(ts), hyperloglog(a) from t1 session(ts,10s);
+sql create stream streams7 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt7 as select _wstart, spread(a), hyperloglog(a) from t1 session(ts,10s);
+# sql create stream streams8 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt8 as select _wstart, histogram(a,"user_input", "[1,3,5,7]", 1), histogram(a,"user_input", "[1,3,5,7]", 0) from t1 session(ts,10s);
sql insert into t1 values(1648791213001,1,1,1,1.0);
sql insert into t1 values(1648791213002,2,3,2,3.4);
sql insert into t1 values(1648791213003,4,9,3,4.8);
diff --git a/tests/script/tsim/stream/session1.sim b/tests/script/tsim/stream/session1.sim
index f535fd619f..3ad7c6f04e 100644
--- a/tests/script/tsim/stream/session1.sim
+++ b/tests/script/tsim/stream/session1.sim
@@ -17,7 +17,7 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double,id int);
-sql create stream streams2 trigger at_once into streamt as select _wstart, count(*) c1, sum(a), min(b), max(id) s from t1 session(ts,10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a), min(b), max(id) s from t1 session(ts,10s);
sql insert into t1 values(1648791210000,1,1,1,1.1,1);
sql insert into t1 values(1648791220000,2,2,2,2.1,2);
sql insert into t1 values(1648791230000,3,3,3,3.1,3);
@@ -200,7 +200,7 @@ endi
sql create database test1 vgroups 1;
sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1 from t1 where a > 5 session(ts, 5s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart, count(*) c1 from t1 where a > 5 session(ts, 5s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
$loop_count = 0
diff --git a/tests/script/tsim/stream/sliding.sim b/tests/script/tsim/stream/sliding.sim
index 8287274cd2..e12e3c6686 100644
--- a/tests/script/tsim/stream/sliding.sim
+++ b/tests/script/tsim/stream/sliding.sim
@@ -17,10 +17,10 @@ sql use test;
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
-sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
-sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
-sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
+sql create stream streams2 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
+sql create stream stream_t1 trigger at_once IGNORE EXPIRED 0 into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
+sql create stream stream_t2 trigger at_once watermark 1d IGNORE EXPIRED 0 into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql insert into t1 values(1648791210000,1,2,3,1.0);
sql insert into t1 values(1648791216000,2,2,3,1.1);
@@ -309,8 +309,8 @@ sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams11 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s, 5s);
-sql create stream streams12 trigger at_once into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s, 5s);
+sql create stream streams11 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s, 5s);
+sql create stream streams12 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s, 5s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,2,2,3,1.1);
@@ -442,9 +442,9 @@ sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams21 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s, 5s);
-sql create stream streams22 trigger at_once into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s, 5s);
-sql create stream streams23 trigger at_once into streamt3 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(20s) sliding(10s);
+sql create stream streams21 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s, 5s);
+sql create stream streams22 trigger at_once IGNORE EXPIRED 0 into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s, 5s);
+sql create stream streams23 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(20s) sliding(10s);
sql insert into t1 values(1648791213000,1,1,1,1.0);
sql insert into t1 values(1648791223001,2,2,2,1.1);
@@ -683,7 +683,7 @@ sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams4 trigger at_once into streamt4 as select _wstart as ts, count(*),min(a) c1 from st interval(10s) sliding(5s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into streamt4 as select _wstart as ts, count(*),min(a) c1 from st interval(10s) sliding(5s);
sql insert into t1 values(1648791213000,1,1,1,1.0);
sql insert into t1 values(1648791243000,2,1,1,1.0);
diff --git a/tests/script/tsim/stream/state0.sim b/tests/script/tsim/stream/state0.sim
index 07abdc0040..d009f742b7 100644
--- a/tests/script/tsim/stream/state0.sim
+++ b/tests/script/tsim/stream/state0.sim
@@ -17,9 +17,9 @@ sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
-print create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+print create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
-sql create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
sql insert into t1 values(1648791213000,1,2,3,1.0,1);
sql insert into t1 values(1648791213000,1,2,3,1.0,2);
@@ -453,9 +453,9 @@ sql use test1;
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
-print create stream streams2 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+print create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
-sql create stream streams2 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
sql insert into t1 values(1648791212000,2,2,3,1.0,1);
sql insert into t1 values(1648791213000,1,2,3,1.0,1);
@@ -501,9 +501,9 @@ sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
-print create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1, sum(b) c3 from t1 state_window(a);
+print create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart, count(*) c1, sum(b) c3 from t1 state_window(a);
-sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1, sum(b) c3 from t1 state_window(a);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into streamt3 as select _wstart, count(*) c1, sum(b) c3 from t1 state_window(a);
sql insert into t1 values(1648791212000,1,2,3,1.0,1);
sql insert into t1 values(1648791213000,2,2,3,1.0,1);
sql insert into t1 values(1648791214000,3,2,4,1.0,2);
@@ -553,9 +553,9 @@ sql create table st (ts timestamp, c1 tinyint, c2 smallint) tags (t1 tinyint) ;
sql create table t1 using st tags (-81) ;
sql create table t2 using st tags (-81) ;
-print create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1);
+print create stream if not exists streams4 trigger window_close IGNORE EXPIRED 0 into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1);
-sql create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1);
+sql create stream if not exists streams4 trigger window_close IGNORE EXPIRED 0 into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1);
sql insert into t1 (ts, c1) values (1668073288209, 11);
sql insert into t1 (ts, c1) values (1668073288210, 11);
@@ -742,9 +742,9 @@ sql create table tb (ts timestamp, a int);
sql insert into tb values (now + 1m , 1 );
sql create table b (c timestamp, d int, e int , f int, g double);
-print create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3 from tb state_window(a);
+print create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3 from tb state_window(a);
-sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3 from tb state_window(a);
+sql create stream streams0 trigger at_once IGNORE EXPIRED 0 into streamt as select _wstart c1, count(*) c2, max(a) c3 from tb state_window(a);
sql insert into b values(1648791213000,NULL,NULL,NULL,NULL);
sql select * from streamt order by c1, c2, c3;
diff --git a/tests/script/tsim/stream/triggerInterval0.sim b/tests/script/tsim/stream/triggerInterval0.sim
index b522dcf035..1c62f689ac 100644
--- a/tests/script/tsim/stream/triggerInterval0.sim
+++ b/tests/script/tsim/stream/triggerInterval0.sim
@@ -15,7 +15,7 @@ print $data00 $data01 $data02
sql use test
sql create table t1(ts timestamp, a int, b int , c int, d double);
-sql create stream streams1 trigger window_close into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
+sql create stream streams1 trigger window_close IGNORE EXPIRED 0 into streamt as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s);
sql insert into t1 values(1648791213001,1,2,3,1.0);
sleep 300
diff --git a/tests/script/tsim/stream/triggerSession0.sim b/tests/script/tsim/stream/triggerSession0.sim
index 4c664cf7c7..81a016be2b 100644
--- a/tests/script/tsim/stream/triggerSession0.sim
+++ b/tests/script/tsim/stream/triggerSession0.sim
@@ -15,7 +15,7 @@ print $data00 $data01 $data02
sql use test;
sql create table t2(ts timestamp, a int, b int , c int, d double);
-sql create stream streams2 trigger window_close into streamt2 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t2 session(ts, 10s);
+sql create stream streams2 trigger window_close IGNORE EXPIRED 0 into streamt2 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(b) c4, min(c) c5 from t2 session(ts, 10s);
sql insert into t2 values(1648791213000,1,2,3,1.0);
sql insert into t2 values(1648791222999,1,2,3,1.0);
diff --git a/tests/script/tsim/stream/udTableAndTag0.sim b/tests/script/tsim/stream/udTableAndTag0.sim
index 8bf34dc54c..e3ab344bbe 100644
--- a/tests/script/tsim/stream/udTableAndTag0.sim
+++ b/tests/script/tsim/stream/udTableAndTag0.sim
@@ -20,8 +20,8 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-#sql_error create stream streams1 trigger at_once into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
-sql create stream streams1 trigger at_once into result.streamt SUBTABLE(concat("aaa-", tbname)) as select _wstart, count(*) c1 from st partition by tbname interval(10s);
+#sql_error create stream streams1 trigger at_once IGNORE EXPIRED 0 into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into result.streamt SUBTABLE(concat("aaa-", tbname)) as select _wstart, count(*) c1 from st partition by tbname interval(10s);
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,1,2,3);
@@ -88,7 +88,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as cc interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as cc interval(10s);
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,1,2,3);
@@ -173,7 +173,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams3 trigger at_once into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", tbname)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as dd, tbname interval(10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", tbname)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as dd, tbname interval(10s);
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,1,2,3);
@@ -285,7 +285,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(3,3,3);
-sql create stream streams4 trigger at_once into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", tbname)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as dd, tbname interval(10s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", tbname)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as dd, tbname interval(10s);
sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3);
@@ -404,7 +404,7 @@ sql create table t1 using st tags("1",1,1);
sql create table t2 using st tags("2",2,2);
sql create table t3 using st tags("3",3,3);
-sql create stream streams6 trigger at_once into result6.streamt6 TAGS(dd int) as select _wstart, count(*) c1 from st partition by concat(ta, "0") as dd, tbname interval(10s);
+sql create stream streams6 trigger at_once IGNORE EXPIRED 0 into result6.streamt6 TAGS(dd int) as select _wstart, count(*) c1 from st partition by concat(ta, "0") as dd, tbname interval(10s);
sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3);
diff --git a/tests/script/tsim/stream/udTableAndTag1.sim b/tests/script/tsim/stream/udTableAndTag1.sim
index 4229de2cf0..fbedaa6e4e 100644
--- a/tests/script/tsim/stream/udTableAndTag1.sim
+++ b/tests/script/tsim/stream/udTableAndTag1.sim
@@ -20,8 +20,8 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-#sql_error create stream streams1 trigger at_once into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
-sql create stream streams1 trigger at_once into result.streamt SUBTABLE( concat("aaa-", cast(a as varchar(10) ) ) ) as select _wstart, count(*) c1 from st partition by a interval(10s);
+#sql_error create stream streams1 trigger at_once IGNORE EXPIRED 0 into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into result.streamt SUBTABLE( concat("aaa-", cast(a as varchar(10) ) ) ) as select _wstart, count(*) c1 from st partition by a interval(10s);
print ===== insert into 1
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -87,7 +87,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st partition by concat("col-", cast(a as varchar(10) ) ) as cc interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st partition by concat("col-", cast(a as varchar(10) ) ) as cc interval(10s);
print ===== insert into 2
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -171,7 +171,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams3 trigger at_once into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", cast(a as varchar(10) ) ) ) as select _wstart, count(*) c1 from st partition by concat("col-", cast(a as varchar(10) ) ) as dd, a interval(10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", cast(a as varchar(10) ) ) ) as select _wstart, count(*) c1 from st partition by concat("col-", cast(a as varchar(10) ) ) as dd, a interval(10s);
print ===== insert into 3
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -283,7 +283,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(3,3,3);
-sql create stream streams4 trigger at_once into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", dd)) as select _wstart, count(*) c1 from st partition by concat("t", cast(a as varchar(10) ) ) as dd interval(10s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", dd)) as select _wstart, count(*) c1 from st partition by concat("t", cast(a as varchar(10) ) ) as dd interval(10s);
sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3);
diff --git a/tests/script/tsim/stream/udTableAndTag2.sim b/tests/script/tsim/stream/udTableAndTag2.sim
index bacc301ad0..c0e72712df 100644
--- a/tests/script/tsim/stream/udTableAndTag2.sim
+++ b/tests/script/tsim/stream/udTableAndTag2.sim
@@ -20,7 +20,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams1 trigger at_once into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams1 trigger at_once IGNORE EXPIRED 0 into result.streamt SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
print ===== insert into 1
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -93,7 +93,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams2 trigger at_once into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams2 trigger at_once IGNORE EXPIRED 0 into result2.streamt2 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st interval(10s);
print ===== insert into 2
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -195,7 +195,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams3 trigger at_once into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", "1") ) as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams3 trigger at_once IGNORE EXPIRED 0 into result3.streamt3 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", "1") ) as select _wstart, count(*) c1 from st interval(10s);
print ===== insert into 3
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
@@ -305,7 +305,7 @@ sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create table t3 using st tags(3,3,3);
-sql create stream streams4 trigger at_once into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", "1")) as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams4 trigger at_once IGNORE EXPIRED 0 into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", "1")) as select _wstart, count(*) c1 from st interval(10s);
sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3);
@@ -375,9 +375,9 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
-sql create stream streams51 trigger at_once into result5.streamt51 SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
-sql create stream streams52 trigger at_once into result5.streamt52 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st interval(10s);
-sql create stream streams53 trigger at_once into result5.streamt53 TAGS(dd varchar(100)) SUBTABLE(concat("aaa-", "1") ) as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams51 trigger at_once IGNORE EXPIRED 0 into result5.streamt51 SUBTABLE("aaa") as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams52 trigger at_once IGNORE EXPIRED 0 into result5.streamt52 TAGS(cc varchar(100)) as select _wstart, count(*) c1 from st interval(10s);
+sql create stream streams53 trigger at_once IGNORE EXPIRED 0 into result5.streamt53 TAGS(dd varchar(100)) SUBTABLE(concat("aaa-", "1") ) as select _wstart, count(*) c1 from st interval(10s);
sql insert into t1 values(1648791213000,1,2,3);
sql insert into t2 values(1648791213000,2,2,3);
diff --git a/tests/script/tsim/tag/tbNameIn.sim b/tests/script/tsim/tag/tbNameIn.sim
index 1af4bd6a9e..f5119208ba 100644
--- a/tests/script/tsim/tag/tbNameIn.sim
+++ b/tests/script/tsim/tag/tbNameIn.sim
@@ -99,4 +99,14 @@ if $rows != 7 then
return -1
endi
+sql select * from st1 where tbname in('tb1') and tbname in ('tb2');
+if $rows != 0 then
+ return -1
+endi
+
+sql select * from st1 where tbname in ('tb1') and tbname != 'tb1';
+if $rows != 0 then
+ return -1
+endi
+
system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/tagindex/add_index.sim b/tests/script/tsim/tagindex/add_index.sim
index 4e883ef150..cfbec90542 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/consume.sh b/tests/script/tsim/tmq/consume.sh
index 001ce6ae49..f0c9197a59 100755
--- a/tests/script/tsim/tmq/consume.sh
+++ b/tests/script/tsim/tmq/consume.sh
@@ -79,15 +79,15 @@ CFG_DIR=$PRG_DIR/cfg
LOG_DIR=$PRG_DIR/log
echo "------------------------------------------------------------------------"
+echo "TOP_DIR: $TOP_DIR"
echo "BUILD_DIR: $BUILD_DIR"
echo "SIM_DIR : $SIM_DIR"
echo "CFG_DIR : $CFG_DIR"
-
-echo "PROGRAM: $PROGRAM
-echo "CFG_DIR: $CFG_DIR
-echo "POLL_DELAY: $POLL_DELAY
-echo "DB_NAME: $DB_NAME
+echo "PROGRAM: $PROGRAM"
+echo "CFG_DIR: $CFG_DIR"
+echo "POLL_DELAY: $POLL_DELAY"
+echo "DB_NAME: $DB_NAME"
echo "------------------------------------------------------------------------"
if [ "$EXEC_OPTON" = "start" ]; then
diff --git a/tests/script/tsim/trans/create_stb.sim b/tests/script/tsim/trans/create_stb.sim
new file mode 100644
index 0000000000..94041645d5
--- /dev/null
+++ b/tests/script/tsim/trans/create_stb.sim
@@ -0,0 +1,72 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/deploy.sh -n dnode2 -i 2
+system sh/deploy.sh -n dnode3 -i 3
+system sh/deploy.sh -n dnode4 -i 4
+system sh/cfg.sh -n dnode1 -c transPullupInterval -v 1
+system sh/cfg.sh -n dnode2 -c transPullupInterval -v 1
+system sh/cfg.sh -n dnode3 -c transPullupInterval -v 1
+system sh/cfg.sh -n dnode4 -c transPullupInterval -v 1
+system sh/exec.sh -n dnode1 -s start
+system sh/exec.sh -n dnode2 -s start
+system sh/exec.sh -n dnode3 -s start
+system sh/exec.sh -n dnode4 -s start
+sql connect
+
+print =============== step1: create dnodes
+sql create dnode $hostname port 7200
+sql create dnode $hostname port 7300
+sql create dnode $hostname port 7400
+
+$x = 0
+step1:
+ $x = $x + 1
+ sleep 1000
+ if $x == 10 then
+ return -1
+ endi
+sql select * from information_schema.ins_dnodes -x step1
+if $data(1)[4] != ready then
+ goto step1
+endi
+if $data(2)[4] != ready then
+ goto step1
+endi
+if $data(3)[4] != ready then
+ goto step1
+endi
+
+print =============== step2: create mnode 2 and 3
+sql create mnode on dnode 2
+sql create mnode on dnode 3
+sql create database db vgroups 2
+
+print =============== step3: kill dnode4
+system sh/exec.sh -n dnode4 -s stop -x SIGKILL
+sql use db
+sql_error create table stb (ts timestamp, i int) tags (j int)
+
+print =============== step4: create database
+sql show transactions
+if $rows != 1 then
+ return -1
+endi
+
+sleep 3000
+system sh/exec.sh -n dnode4 -s start
+
+$wt = 0
+step4:
+$wt = $wt + 1
+sleep 1000
+if $wt == 200 then
+ print ====> transaction already running
+ return -1
+endi
+
+sql show transactions
+if $rows != 0 then
+ print wait 1 seconds to alter
+ goto step4
+endi
+
diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py
index a5cded7a6b..21d307ce37 100644
--- a/tests/system-test/0-others/compatibility.py
+++ b/tests/system-test/0-others/compatibility.py
@@ -3,6 +3,8 @@ import taos
import sys
import os
import time
+import inspect
+from taos.tmq import Consumer
from pathlib import Path
from util.log import *
@@ -99,6 +101,7 @@ class TDTestCase:
def run(self):
+ scriptsPath = os.path.dirname(os.path.realpath(__file__))
distro_id = distro.id()
if distro_id == "alpine":
tdLog.info(f"alpine skip compatibility test")
@@ -128,19 +131,18 @@ class TDTestCase:
tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{BASEVERSION}")
tdLog.info(f" LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
os.system(f"LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
- sleep(3)
+ os.system(f"LD_LIBRARY_PATH=/usr/lib taos -s 'use test;create stream current_stream into current_stream_output_stb as select _wstart as `start`, _wend as wend, max(current) as max_current from meters where voltage <= 220 interval (5s);' ")
+ os.system('LD_LIBRARY_PATH=/usr/lib taos -s "use test;create stream power_stream into power_stream_output_stb as select ts, concat_ws(\\".\\", location, tbname) as meter_location, current*voltage*cos(phase) as active_power, current*voltage*sin(phase) as reactive_power from meters partition by tbname;" ')
+ os.system('LD_LIBRARY_PATH=/usr/lib taos -s "use test;show streams;" ')
+ os.system(f"sed -i 's/\/etc\/taos/{cPath}/' 0-others/tmqBasic.json ")
+ # os.system("LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/tmqBasic.json -y ")
+ os.system('LD_LIBRARY_PATH=/usr/lib taos -s "create topic if not exists tmq_test_topic as select current,voltage,phase from test.meters where voltage <= 106 and current <= 5;" ')
+ os.system('LD_LIBRARY_PATH=/usr/lib taos -s "use test;show topics;" ')
- # tdsqlF.query(f"select count(*) from {stb}")
- # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1)
- os.system("pkill taosd")
- self.checkProcessPid("taosd")
-
- print(f"start taosd: nohup taosd -c {cPath} & ")
- os.system(f" nohup taosd -c {cPath} & " )
- sleep(10)
tdLog.info(" LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y ")
os.system("LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y")
- os.system("pkill taosd") # make sure all the data are saved in disk.
+ os.system("LD_LIBRARY_PATH=/usr/lib taos -s 'flush database db4096 '")
+ os.system("pkill taosd") # make sure all the data are saved in disk.
self.checkProcessPid("taosd")
@@ -161,10 +163,12 @@ 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)
- os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
- tdsql.query(f"select count(*) from {stb}")
- tdsql.checkData(0,0,tableNumbers*recordNumbers2)
+ tdsql.checkData(0,0,tableNumbers*recordNumbers1)
+ # tdsql.query("show streams;")
+ # os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
+ # tdsql.query("show streams;")
+ # tdsql.query(f"select count(*) from {stb}")
+ # tdsql.checkData(0,0,tableNumbers*recordNumbers2)
tdsql.query(f"select count(*) from db4096.stb0")
tdsql.checkData(0,0,50000)
@@ -183,13 +187,58 @@ class TDTestCase:
tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);")
tdsql.query("select * from db.ct4")
tdsql.checkData(0,1,14)
+ print(1)
+ tdsql=tdCom.newTdSql()
tdsql.query("describe information_schema.ins_databases;")
qRows=tdsql.queryRows
- for i in range(qRows) :
- if tdsql.queryResult[i][0]=="retentions" :
- return True
- else:
- return False
+ comFlag=True
+ 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
+ j=j+1
+ if j == qRows:
+ print("parameters don't include retentions")
+ caller = inspect.getframeinfo(inspect.stack()[0][0])
+ args = (caller.filename, caller.lineno)
+ tdLog.exit("%s(%d) failed" % args)
+ tdsql.query("show streams;")
+ tdsql.checkRows(2)
+ tdsql.execute("insert into test.d80 values (now+1s, 11, 103, 0.21);")
+ tdsql.execute("insert into test.d9 values (now+5s, 4.3, 104, 0.4);")
+
+ conn = taos.connect()
+
+ consumer = Consumer(
+ {
+ "group.id": "tg75",
+ "client.id": "124",
+ "td.connect.user": "root",
+ "td.connect.pass": "taosdata",
+ "enable.auto.commit": "true",
+ "experimental.snapshot.enable": "true",
+ }
+ )
+ consumer.subscribe(["tmq_test_topic"])
+
+ while True:
+ res = consumer.poll(10)
+ if not res:
+ break
+ err = res.error()
+ if err is not None:
+ raise err
+ val = res.value()
+
+ for block in val:
+ print(block.fetchall())
+ tdsql.query("show topics;")
+ tdsql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py
index b5d6a0d1a3..3e176fe251 100644
--- a/tests/system-test/0-others/show.py
+++ b/tests/system-test/0-others/show.py
@@ -11,14 +11,13 @@
# -*- coding: utf-8 -*-
-
+import re
from util.log import *
from util.cases import *
from util.sql import *
from util.common import *
from util.sqlset import *
-
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
@@ -28,10 +27,35 @@ class TDTestCase:
self.ins_param_list = ['dnodes','mnodes','qnodes','cluster','functions','users','grants','topics','subscriptions','streams']
self.perf_param = ['apps','connections','consumers','queries','transactions']
self.perf_param_list = ['apps','connections','consumers','queries','trans']
-
+ self.dbname = "db"
+ self.vgroups = 10
+ self.stbname = f'`{tdCom.getLongName(5)}`'
+ self.tbname = f'`{tdCom.getLongName(3)}`'
+ self.db_param = {
+ "database":f"{self.dbname}",
+ "buffer":100,
+ "cachemodel":"'none'",
+ "cachesize":1,
+ "comp":2,
+ "maxrows":1000,
+ "minrows":200,
+ "pages":512,
+ "pagesize":16,
+ "precision":"'ms'",
+ "replica":1,
+ "wal_level":1,
+ "wal_fsync_period":6000,
+ "wal_roll_period":0,
+ "wal_segment_size":1024,
+ "vgroups":self.vgroups,
+ "stt_trigger":1,
+ "tsdb_pagesize":16
+ }
def ins_check(self):
tdSql.prepare()
for param in self.ins_param_list:
+ if param.lower() == 'qnodes':
+ tdSql.execute('create qnode on dnode 1')
tdSql.query(f'show {param}')
show_result = tdSql.queryResult
tdSql.query(f'select * from information_schema.ins_{param}')
@@ -59,11 +83,32 @@ class TDTestCase:
tag_sql += f"{k} {v}, "
create_stb_sql = f'create stable {stbname} ({column_sql[:-2]}) tags ({tag_sql[:-2]})'
return create_stb_sql
- def show_sql(self):
- tdSql.prepare()
- tdSql.execute('use db')
- stbname = f'`{tdCom.getLongName(5)}`'
- tbname = f'`{tdCom.getLongName(3)}`'
+
+ def set_create_database_sql(self,sql_dict):
+ create_sql = 'create'
+ for key,value in sql_dict.items():
+ create_sql += f' {key} {value}'
+ return create_sql
+ def show_create_sql(self):
+ create_db_sql = self.set_create_database_sql(self.db_param)
+ print(create_db_sql)
+ tdSql.execute(create_db_sql)
+ tdSql.query(f'show create database {self.dbname}')
+ tdSql.checkEqual(self.dbname,tdSql.queryResult[0][0])
+ for key,value in self.db_param.items():
+ if key == 'database':
+ continue
+ else:
+ param = f'{key} {value}'
+ if param in tdSql.queryResult[0][1].lower():
+ tdLog.info(f'show create database check success with {key} {value}')
+ continue
+ else:
+ tdLog.exit(f"show create database check failed with {key} {value}")
+ tdSql.query('show vnodes 1')
+ tdSql.checkRows(self.vgroups)
+ tdSql.execute(f'use {self.dbname}')
+
column_dict = {
'`ts`': 'timestamp',
'`col1`': 'tinyint',
@@ -98,25 +143,56 @@ class TDTestCase:
'`t14`': 'timestamp'
}
- create_table_sql = self.set_stb_sql(stbname,column_dict,tag_dict)
+ create_table_sql = self.set_stb_sql(self.stbname,column_dict,tag_dict)
tdSql.execute(create_table_sql)
- tdSql.query(f'show create table {stbname}')
+ tdSql.query(f'show create stable {self.stbname}')
query_result = tdSql.queryResult
tdSql.checkEqual(query_result[0][1].lower(),create_table_sql)
- tdSql.execute(f'create table {tbname} using {stbname} tags(1,1,1,1,1,1,1,1,1.000000e+00,1.000000e+00,true,"abc","abc123",0)')
+ tdSql.execute(f'create table {self.tbname} using {self.stbname} tags(1,1,1,1,1,1,1,1,1.000000e+00,1.000000e+00,true,"abc","abc123",0)')
tag_sql = '('
for tag_keys in tag_dict.keys():
tag_sql += f'{tag_keys}, '
tags = f'{tag_sql[:-2]})'
- sql = f'create table {tbname} using {stbname} {tags} tags (1, 1, 1, 1, 1, 1, 1, 1, 1.000000e+00, 1.000000e+00, true, "abc", "abc123", 0)'
- tdSql.query(f'show create table {tbname}')
+ sql = f'create table {self.tbname} using {self.stbname} {tags} tags (1, 1, 1, 1, 1, 1, 1, 1, 1.000000e+00, 1.000000e+00, true, "abc", "abc123", 0)'
+ tdSql.query(f'show create table {self.tbname}')
query_result = tdSql.queryResult
tdSql.checkEqual(query_result[0][1].lower(),sql)
- tdSql.execute('drop database db')
+ tdSql.execute(f'drop database {self.dbname}')
+ def check_gitinfo(self):
+ taosd_gitinfo_sql = ''
+ tdSql.query('show dnode 1 variables')
+ for i in tdSql.queryResult:
+ if i[1].lower() == "gitinfo":
+ taosd_gitinfo_sql = f"gitinfo: {i[2]}"
+ taos_gitinfo_sql = ''
+ tdSql.query('show local variables')
+ for i in tdSql.queryResult:
+ if i[0].lower() == "gitinfo":
+ taos_gitinfo_sql = f"gitinfo: {i[1]}"
+ taos_info = os.popen('taos -V').read()
+ taos_gitinfo = re.findall("^gitinfo.*",taos_info,re.M)
+ tdSql.checkEqual(taos_gitinfo_sql,taos_gitinfo[0])
+ taosd_info = os.popen('taosd -V').read()
+ taosd_gitinfo = re.findall("^gitinfo.*",taosd_info,re.M)
+ tdSql.checkEqual(taosd_gitinfo_sql,taosd_gitinfo[0])
+
+ def show_base(self):
+ for sql in ['dnodes','mnodes','cluster']:
+ tdSql.query(f'show {sql}')
+ print(tdSql.queryResult)
+ tdSql.checkRows(1)
+ tdSql.query('show grants')
+ grants_info = tdSql.queryResult
+ tdSql.query('show licences')
+ licences_info = tdSql.queryResult
+ tdSql.checkEqual(grants_info,licences_info)
+
def run(self):
+ self.check_gitinfo()
+ self.show_base()
self.ins_check()
self.perf_check()
- self.show_sql()
+ self.show_create_sql()
def stop(self):
tdSql.close()
@@ -124,4 +200,3 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
-
diff --git a/tests/system-test/0-others/tag_index_advance.py b/tests/system-test/0-others/tag_index_advance.py
new file mode 100644
index 0000000000..a8d6cde85a
--- /dev/null
+++ b/tests/system-test/0-others/tag_index_advance.py
@@ -0,0 +1,520 @@
+###################################################################
+# 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 ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
+import taos
+import sys
+import time
+import os
+import socket
+import subprocess
+import random
+import string
+import random
+
+
+from util.log import *
+from util.sql import *
+from util.cases import *
+from util.common import *
+from util.sqlset import *
+
+from util.dnodes import *
+from util.dnodes import TDDnodes
+from util.dnodes import TDDnode
+
+#
+# -------------- 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
+
+ '''
+ total = 0
+ with os.scandir(path) as it:
+ for entry in it:
+ if entry.is_file():
+ total += entry.stat().st_size
+ elif entry.is_dir():
+ total += pathSize(entry.path)
+
+ print(" %s %.02f MB"%(path, total/1024/1024))
+ return total
+ '''
+
+#
+# --------------- cluster ------------------------
+#
+
+class MyDnodes(TDDnodes):
+ def __init__(self ,dnodes_lists):
+ super(MyDnodes,self).__init__()
+ self.dnodes = dnodes_lists # dnode must be TDDnode instance
+ self.simDeployed = False
+
+class TagCluster:
+ noConn = True
+ def init(self, conn, logSql, replicaVar=1):
+ tdLog.debug(f"start to excute {__file__}")
+ self.TDDnodes = None
+ self.depoly_cluster(5)
+ self.master_dnode = self.TDDnodes.dnodes[0]
+ self.host=self.master_dnode.cfgDict["fqdn"]
+ conn1 = taos.connect(self.master_dnode.cfgDict["fqdn"] , config=self.master_dnode.cfgDir)
+ tdSql.init(conn1.cursor())
+
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosd" in files or "taosd.exe" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+
+ def depoly_cluster(self ,dnodes_nums):
+
+ testCluster = False
+ valgrind = 0
+ hostname = socket.gethostname()
+ dnodes = []
+ start_port = 6030
+ for num in range(1, dnodes_nums+1):
+ dnode = TDDnode(num)
+ dnode.addExtraCfg("firstEp", f"{hostname}:{start_port}")
+ dnode.addExtraCfg("fqdn", f"{hostname}")
+ dnode.addExtraCfg("serverPort", f"{start_port + (num-1)*100}")
+ dnode.addExtraCfg("monitorFqdn", hostname)
+ dnode.addExtraCfg("monitorPort", 7043)
+ dnodes.append(dnode)
+
+ self.TDDnodes = MyDnodes(dnodes)
+ self.TDDnodes.init("")
+ self.TDDnodes.setTestCluster(testCluster)
+ self.TDDnodes.setValgrind(valgrind)
+
+ self.TDDnodes.setAsan(tdDnodes.getAsan())
+ self.TDDnodes.stopAll()
+ for dnode in self.TDDnodes.dnodes:
+ self.TDDnodes.deploy(dnode.index,{})
+
+ for dnode in self.TDDnodes.dnodes:
+ self.TDDnodes.starttaosd(dnode.index)
+
+ # create cluster
+ dnode_first_host = ""
+ sql = ""
+ for dnode in self.TDDnodes.dnodes[1:]:
+ # print(dnode.cfgDict)
+ dnode_id = dnode.cfgDict["fqdn"] + ":" +dnode.cfgDict["serverPort"]
+ if dnode_first_host == "":
+ dnode_first_host = dnode.cfgDict["firstEp"].split(":")[0]
+ dnode_first_port = dnode.cfgDict["firstEp"].split(":")[-1]
+ sql += f"create dnode '{dnode_id}'; "
+
+ cmd = f"{self.getBuildPath()}/build/bin/taos -h {dnode_first_host} -P {dnode_first_port} -s "
+ cmd += f'"{sql}"'
+ print(cmd)
+ os.system(cmd)
+
+ time.sleep(2)
+ tdLog.info(" create cluster done! ")
+
+
+ def getConnection(self, dnode):
+ host = dnode.cfgDict["fqdn"]
+ port = dnode.cfgDict["serverPort"]
+ config_dir = dnode.cfgDir
+ return taos.connect(host=host, port=int(port), config=config_dir)
+
+ def run(self):
+ tdLog.info(" create cluster ok.")
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success(f"{__file__} successfully executed")
+
+
+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
+
+
+#
+# ----------------- TDTestCase ------------------
+#
+class TDTestCase:
+ def init(self, conn, logSql, replicaVar=1):
+ tdLog.debug("start to execute %s" % __file__)
+ self.dbs = [PerfDB(), PerfDB()]
+ self.cur = 0
+ self.tagCluster = TagCluster()
+ self.tagCluster.init(conn, logSql, replicaVar)
+ self.lenBinary = 64
+ self.lenNchar = 32
+
+ # column
+ 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': f'varchar({self.lenBinary})',
+ 'col13': f'nchar({self.lenNchar})'
+ }
+ # tag
+ 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': f'varchar({self.lenBinary})',
+ 't13': f'nchar({self.lenNchar})',
+ 't14': 'timestamp'
+ }
+
+ # generate specail wide random string
+ def random_string(self, count):
+ letters = string.ascii_letters
+ return ''.join(random.choice(letters) for i in range(count))
+
+ # execute
+ def execute(self, sql):
+ obj = self.dbs[self.cur]
+ return obj.execute(sql)
+
+ # query
+ def query(self, sql):
+ return self.dbs[self.cur].query(sql)
+
+ 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 datbase
+ def create_database(self, dbname, vgroups, replica):
+ sql = f'create database {dbname} vgroups {vgroups} replica {replica}'
+ tdSql.execute(sql)
+ #tdSql.execute(sql)
+ tdSql.execute(f'use {dbname}')
+
+ # create stable and child tables
+ def create_table(self, stbname, tbname, count):
+ # create stable
+ create_table_sql = self.set_stb_sql(stbname, self.column_dict, self.tag_dict)
+ tdSql.execute(create_table_sql)
+
+ # create child table
+ tdLog.info(f" start create {count} child tables.")
+ for i in range(count):
+ ti = i % 128
+ binTxt = self.random_string(self.lenBinary)
+ tags = f'{ti},{ti},{i},{i},{ti},{ti},{i},{i},{i}.000{i},{i}.000{i},true,"{binTxt}","nch{i}",now'
+ sql = f'create table {tbname}{i} using {stbname} tags({tags})'
+ tdSql.execute(sql)
+ if i > 0 and i % 1000 == 0:
+ tdLog.info(f" child table count = {i}")
+
+ tdLog.info(f" end create {count} child tables.")
+
+
+ # create stable and child tables
+ def create_tagidx(self, stbname):
+ cnt = -1
+ for key in self.tag_dict.keys():
+ # first tag have default index, so skip
+ if cnt == -1:
+ cnt = 0
+ continue;
+ sql = f'create index idx_{key} on {stbname} ({key})'
+ tdLog.info(f" sql={sql}")
+ tdSql.execute(sql)
+ cnt += 1
+ tdLog.info(f' create {cnt} tag indexs ok.')
+
+ # insert to child table d1 data
+ def insert_data(self, tbname):
+ # d1 insert 3 rows
+ for i in range(3):
+ sql = f'insert into {tbname}1(ts,col1) values(now+{i}s,{i});'
+ tdSql.execute(sql)
+ # d20 insert 4
+ for i in range(4):
+ sql = f'insert into {tbname}20(ts,col1) values(now+{i}s,{i});'
+ tdSql.execute(sql)
+
+ # check show indexs
+ def show_tagidx(self, dbname, stbname):
+ sql = f'select index_name,column_name from information_schema.ins_indexes where db_name="{dbname}"'
+ tdSql.query(sql)
+ rows = len(self.tag_dict.keys())-1
+ tdSql.checkRows(rows)
+
+ for i in range(rows):
+ col_name = tdSql.getData(i, 1)
+ idx_name = f'idx_{col_name}'
+ tdSql.checkData(i, 0, idx_name)
+
+ tdLog.info(f' show {rows} tag indexs ok.')
+
+ # query with tag idx
+ def query_tagidx(self, stbname):
+ sql = f'select * from meters where t2=1'
+ self.query(sql)
+ tdSql.checkRows(3)
+
+ sql = f'select * from meters where t2<10'
+ self.query(sql)
+ tdSql.checkRows(3)
+
+ sql = f'select * from meters where t2>10'
+ self.query(sql)
+ tdSql.checkRows(4)
+
+ sql = f'select * from meters where t3<30'
+ self.query(sql)
+ tdSql.checkRows(7)
+
+ sql = f'select * from meters where t12="11"'
+ tdSql.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where (t4 < 10 or t5 = 20) and t6= 30'
+ self.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where (t7 < 20 and t8 = 20) or t4 = 20'
+ self.query(sql)
+ tdSql.checkRows(4)
+
+ sql = f'select * from meters where t12 like "%ab%" '
+ self.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where t13 = "d20" '
+ self.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where t13 = "nch20" '
+ self.query(sql)
+ tdSql.checkRows(4)
+
+ sql = f'select * from meters where tbname = "d20" '
+ self.query(sql)
+ tdSql.checkRows(4)
+
+
+ # drop child table
+ def drop_tables(self, tbname, count):
+ # table d1 and d20 have verify data , so can not drop
+ start = random.randint(21, count/2)
+ end = random.randint(count/2 + 1, count - 1)
+ for i in range(start, end):
+ sql = f'drop table {tbname}{i}'
+ tdSql.execute(sql)
+ cnt = end - start + 1
+ tdLog.info(f' drop table from {start} to {end} count={cnt}')
+
+ # drop tag index
+ def drop_tagidx(self, dbname, stbname):
+ # drop index
+ cnt = -1
+ for key in self.tag_dict.keys():
+ # first tag have default index, so skip
+ if cnt == -1:
+ cnt = 0
+ continue;
+ sql = f'drop index idx_{key}'
+ tdSql.execute(sql)
+ cnt += 1
+
+ # check idx result is 0
+ sql = f'select index_name,column_name from information_schema.ins_indexes where db_name="{dbname}"'
+ tdSql.query(sql)
+ tdSql.checkRows(0)
+ tdLog.info(f' drop {cnt} tag indexs ok.')
+
+ # show performance
+ def show_performance(self, count) :
+ db = self.dbs[0]
+ db1 = self.dbs[1]
+ cnt = len(db.sqls)
+ cnt1 = len(db1.sqls)
+ if cnt != len(db1.sqls):
+ tdLog.info(f" datebase sql count not equal. cnt={cnt} cnt1={cnt1}\n")
+ return False
+
+ tdLog.info(f" database sql cnt ={cnt}")
+ print(f" ----------------- performance (child tables = {count})--------------------")
+ print(" No time(index) time(no-index) diff(col3-col2) rate(col2/col3) sql")
+ for i in range(cnt):
+ key = db.sqls[i]
+ value = db.spends[i]
+ key1 = db1.sqls[i]
+ value1 = db1.spends[i]
+ diff = value1 - value
+ rate = value/value1*100
+ print(" %d %.3fs %.3fs %.3fs %d%% %s"%(i+1, value, value1, diff, rate, key))
+ print(" --------------------- end ------------------------")
+ return True
+
+ def show_diskspace(self):
+ #calc
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+ projPath = ""
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ # total
+ vnode2_size = pathSize(projPath + "sim/dnode2/data/vnode/vnode2/")
+ vnode3_size = pathSize(projPath + "sim/dnode3/data/vnode/vnode3/")
+ vnode4_size = pathSize(projPath + "sim/dnode4/data/vnode/vnode4/")
+ vnode5_size = pathSize(projPath + "sim/dnode5/data/vnode/vnode5/")
+
+ # show
+ print(" ----------------- disk space --------------------")
+ idx_size = vnode2_size + vnode3_size
+ noidx_size = vnode4_size + vnode5_size
+
+ print(" index = %.02f M"%(idx_size/1024/1024))
+ print(" no-index = %.02f M"%(noidx_size/1024/1024))
+ print(" index/no-index = %.2f multiple"%(idx_size/noidx_size))
+
+ print(" -------------------- end ------------------------")
+
+
+
+
+ # main
+ def testdb(self, dbname, stable, tbname, count, createidx):
+ # cur
+ if createidx:
+ self.cur = 0
+ else :
+ self.cur = 1
+
+ # do
+ self.create_database(dbname, 2, 1)
+ self.create_table(stable, tbname, count)
+ if(createidx):
+ self.create_tagidx(stable)
+ self.insert_data(tbname)
+ if(createidx):
+ self.show_tagidx(dbname,stable)
+ self.query_tagidx(stable)
+ #self.drop_tables(tbname, count)
+ #if(createidx):
+ # self.drop_tagidx(dbname, stable)
+ # query after delete , expect no crash
+ #self.query_tagidx(stable)
+ tdSql.execute(f'flush database {dbname}')
+
+ # run
+ def run(self):
+ self.tagCluster.run()
+
+ # var
+ dbname = "tagindex"
+ dbname1 = dbname + "1"
+ stable = "meters"
+ tbname = "d"
+ count = 10000
+
+ # test db
+ tdLog.info(f" ------------- {dbname} ----------")
+ self.testdb(dbname, stable, tbname, count, True)
+ tdLog.info(f" ------------- {dbname1} ----------")
+ self.testdb(dbname1, stable, tbname, count, False)
+
+ # show test result
+ self.show_performance(count)
+
+ self.tagCluster.TDDnodes.stopAll()
+ sec = 10
+ print(f" sleep {sec}s wait taosd stopping ...")
+ time.sleep(sec)
+
+ self.show_diskspace()
+
+
+ def stop(self):
+ self.tagCluster.stop()
+ tdLog.success("%s successfully executed" % __file__)
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
diff --git a/tests/system-test/0-others/tag_index_basic.py b/tests/system-test/0-others/tag_index_basic.py
index 195d8910e7..96c3dca016 100644
--- a/tests/system-test/0-others/tag_index_basic.py
+++ b/tests/system-test/0-others/tag_index_basic.py
@@ -107,11 +107,11 @@ class TDTestCase:
def insert_data(self, tbname):
# d1 insert 3 rows
for i in range(3):
- sql = f'insert into {tbname}1(ts,col1) values(now,{i});'
+ sql = f'insert into {tbname}1(ts,col1) values(now+{i}s,{i});'
tdSql.execute(sql)
# d20 insert 4
for i in range(4):
- sql = f'insert into {tbname}20(ts,col1) values(now,{i});'
+ sql = f'insert into {tbname}20(ts,col1) values(now+{i}s,{i});'
tdSql.execute(sql)
# check show indexs
@@ -150,6 +150,22 @@ class TDTestCase:
tdSql.query(sql)
tdSql.checkRows(0)
+ sql = f'select t12 ,t13,tbname from meters where t13="nch20"'
+ tdSql.query(sql)
+ tdSql.checkRows(4)
+
+ sql = f'select * from meters where t12 like "%ab%" '
+ tdSql.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where t13 = "d20" '
+ tdSql.query(sql)
+ tdSql.checkRows(0)
+
+ sql = f'select * from meters where tbname = "d20" '
+ tdSql.query(sql)
+ tdSql.checkRows(4)
+
sql = f'select * from meters where (t4 < 10 or t5 = 20) and t6= 30'
tdSql.query(sql)
tdSql.checkRows(0)
@@ -188,6 +204,22 @@ class TDTestCase:
tdSql.checkRows(0)
tdLog.info(f' drop {cnt} tag indexs ok.')
+ # create long name idx
+ def longname_idx(self, stbname):
+ long_name = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmm"
+ key = "t3"
+ sql = f'create index {long_name} on {stbname} ({key})'
+ tdSql.error(sql)
+
+ long_name = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffff"
+ key = "t3"
+ sql = f'create index {long_name} on {stbname} ({key})'
+ tdLog.info(f"{sql}")
+ tdSql.execute(sql)
+ sql = f'drop index {long_name}'
+ tdLog.info(f"{sql}")
+ tdSql.execute(sql)
+
# run
def run(self):
# var
@@ -204,6 +236,7 @@ class TDTestCase:
self.drop_tagidx(stable)
# query after delete , expect no crash
self.query_tagidx(stable)
+ self.longname_idx(stable)
def stop(self):
diff --git a/tests/system-test/0-others/testRoll.py b/tests/system-test/0-others/testRoll.py
new file mode 100644
index 0000000000..56e5b3630a
--- /dev/null
+++ b/tests/system-test/0-others/testRoll.py
@@ -0,0 +1,83 @@
+from taos.tmq import Consumer
+import taos
+import taosrest
+import socket
+
+
+def init_tmq_env(db, topic):
+ conn = taos.connect()
+ # conn.execute("create dnode test209")
+ # conn.execute("create dnode test216")
+ # conn.execute("create mnode on dnode 2")
+ # conn.execute("create mnode on dnode 3")
+
+ 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.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))")
+ conn.execute("create table if not exists tb1 using stb1 tags(1, 't1')")
+ conn.execute("create table if not exists tb2 using stb1 tags(2, 't2')")
+ conn.execute("create table if not exists tb3 using stb1 tags(3, 't3')")
+ conn.execute("create topic if not exists {} as select ts, c1, c2, c3 from stb1".format(topic))
+ conn.execute("insert into tb1 values (now+10s, 1, 1.0, 'tmq test')")
+ conn.execute("insert into tb2 values (now+100s, 2, 2.0, 'tmq test')")
+ conn.execute("insert into tb3 values (now+20s, 3, 3.0, 'tmq test')")
+ conn.execute("insert into tb3 values (now+30s, 4, 4.0, 'tmq test4')")
+
+def init_tmq_rest_env(db, topic):
+ host = socket.gethostname()
+ conn = taosrest.connect(url=f"http://{host}:6041")
+
+ # conn.execute("create dnode test209")
+ # conn.execute("create dnode test216")
+ # conn.execute("create mnode on dnode 2")
+ # conn.execute("create mnode on dnode 3")
+
+ 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.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))")
+ conn.execute("create table if not exists tb1 using stb1 tags(1, 't1')")
+ conn.execute("create table if not exists tb2 using stb1 tags(2, 't2')")
+ conn.execute("create table if not exists tb3 using stb1 tags(3, 't3')")
+ conn.execute("create topic if not exists {} as select ts, c1, c2, c3 from stb1".format(topic))
+ conn.execute("insert into tb1 values (now+10s, 1, 1.0, 'tmq test')")
+ conn.execute("insert into tb2 values (now+100s, 2, 2.0, 'tmq test')")
+ conn.execute("insert into tb3 values (now+20s, 3, 3.0, 'tmq test')")
+ conn.execute("insert into tb3 values (now+30s, 4, 4.0, 'tmq test4')")
+
+
+
+
+if __name__ == '__main__':
+ conn = taos.connect()
+
+ init_tmq_env("tmq_test", "tmq_test_topic") # init env
+ # init_tmq_rest_env("tmq_test", "tmq_test_topic")
+ consumer = Consumer(
+ {
+ "group.id": "tg75",
+ "client.id": "124",
+ "td.connect.user": "root",
+ "td.connect.pass": "taosdata",
+ "enable.auto.commit": "true",
+ "experimental.snapshot.enable": "true",
+ }
+ )
+ consumer.subscribe(["tmq_test_topic"])
+
+ while True:
+ res = consumer.poll(10)
+ if not res:
+ break
+ err = res.error()
+ if err is not None:
+ raise err
+ val = res.value()
+
+ for block in val:
+ print(block.fetchall())
\ No newline at end of file
diff --git a/tests/system-test/0-others/tmqBasic.json b/tests/system-test/0-others/tmqBasic.json
new file mode 100644
index 0000000000..24e815708a
--- /dev/null
+++ b/tests/system-test/0-others/tmqBasic.json
@@ -0,0 +1,24 @@
+{
+ "filetype": "subscribe",
+ "cfgdir": "/etc/taos",
+ "host": "127.0.0.1",
+ "port": 6030,
+ "user": "root",
+ "password": "taosdata",
+ "confirm_parameter_prompt": "no",
+ "tmq_info": {
+ "concurrent": 1,
+ "poll_delay": 10000,
+ "group.id": "grpId_0",
+ "client.id": "clientId",
+ "auto.offset.reset": "earliest",
+ "enable.auto.commit": "true",
+ "auto.commit.interval.ms": 1000,
+ "enable.heartbeat.background": "true",
+ "experimental.snapshot.enable": "true",
+ "msg.with.table.name": "false",
+ "topic_list": [
+ {"name": "tmq_topic_1", "sql": "select current,voltage,phase from test.meters where voltage <= 106 ;"}
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/system-test/1-insert/database_pre_suf.py b/tests/system-test/1-insert/database_pre_suf.py
index 488dfebff5..a6ff95ab3f 100755
--- a/tests/system-test/1-insert/database_pre_suf.py
+++ b/tests/system-test/1-insert/database_pre_suf.py
@@ -108,7 +108,7 @@ class TDTestCase:
# create stream
- tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
+ tdSql.execute('''create stream current_stream trigger at_once IGNORE EXPIRED 0 into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
# insert data
for i in range(num_random*n):
diff --git a/tests/system-test/1-insert/drop.py b/tests/system-test/1-insert/drop.py
index c15a9bbc35..a8bfea2741 100644
--- a/tests/system-test/1-insert/drop.py
+++ b/tests/system-test/1-insert/drop.py
@@ -138,14 +138,14 @@ class TDTestCase:
stream_name = tdCom.getLongName(5,"letters")
tdSql.execute(f'create table {stbname} (ts timestamp,c0 int) tags(t0 int)')
tdSql.execute(f'create table tb using {stbname} tags(1)')
- tdSql.execute(f'create stream {stream_name} into stb as select * from {self.dbname}.{stbname} partition by tbname')
+ tdSql.execute(f'create stream {stream_name} trigger at_once ignore expired 0 into stb as select * from {self.dbname}.{stbname} partition by tbname')
tdSql.query(f'select * from information_schema.ins_streams where stream_name = "{stream_name}"')
print(tdSql.queryResult)
- tdSql.checkEqual(tdSql.queryResult[0][2],f'create stream {stream_name} into stb as select * from {self.dbname}.{stbname} partition by tbname')
+ tdSql.checkEqual(tdSql.queryResult[0][2],f'create stream {stream_name} trigger at_once ignore expired 0 into stb as select * from {self.dbname}.{stbname} partition by tbname')
tdSql.execute(f'drop stream {stream_name}')
- tdSql.execute(f'create stream {stream_name} into stb1 as select * from tb')
+ tdSql.execute(f'create stream {stream_name} trigger at_once ignore expired 0 into stb1 as select * from tb')
tdSql.query(f'select * from information_schema.ins_streams where stream_name = "{stream_name}"')
- tdSql.checkEqual(tdSql.queryResult[0][2],f'create stream {stream_name} into stb1 as select * from tb')
+ tdSql.checkEqual(tdSql.queryResult[0][2],f'create stream {stream_name} trigger at_once ignore expired 0 into stb1 as select * from tb')
tdSql.execute(f'drop database {self.dbname}')
def run(self):
self.drop_ntb_check()
diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py
index 2325b01c35..f26f0abda0 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, 269)
+ tdSql.checkData(0, 0, 271)
tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'")
tdSql.checkRows(14)
diff --git a/tests/system-test/2-query/projectionDesc.py b/tests/system-test/2-query/projectionDesc.py
new file mode 100644
index 0000000000..1edceaa6f2
--- /dev/null
+++ b/tests/system-test/2-query/projectionDesc.py
@@ -0,0 +1,48 @@
+from wsgiref.headers import tspecials
+from util.log import *
+from util.cases import *
+from util.sql import *
+import numpy as np
+
+
+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.rowNum = 10
+ self.batchNum = 5
+ self.ts = 1537146000000
+
+ def run(self):
+ dbname = "db"
+ tdSql.prepare()
+
+ intData = []
+ floatData = []
+
+ tdSql.execute(f'''create table {dbname}.stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
+ col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
+ tdSql.execute(f"create table {dbname}.stb_1 using {dbname}.stb tags('beijing')")
+ for n in range(self.batchNum):
+ for i in range(self.rowNum):
+ tdSql.execute(f"insert into {dbname}.stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
+ % (self.ts, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
+ intData.append(i + 1)
+ floatData.append(i + 0.1)
+ tdSql.execute(f"flush database {dbname}")
+
+ tdSql.query(f"select * from {dbname}.stb_1 order by ts desc")
+ tdSql.checkRows(1)
+ #tdSql.checkData(0,0,1537146000000)
+ tdSql.checkData(0,1,10)
+
+ tdSql.query(f"select * from {dbname}.stb_1 order by 'aaa' desc")
+
+ 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/2-query/tsbsQuery.py b/tests/system-test/2-query/tsbsQuery.py
index 106d43ea38..4f415550b8 100644
--- a/tests/system-test/2-query/tsbsQuery.py
+++ b/tests/system-test/2-query/tsbsQuery.py
@@ -86,7 +86,7 @@ class TDTestCase:
self.ctbNums=ctbNums
rowNUms=5000
ts=1451606400000
- tdSql.execute(f"create database {dbname};")
+ tdSql.execute(f"create database {dbname} cachemodel 'both';")
tdSql.execute(f"use {dbname} ")
tdSql.execute(f'''
create table {stabname1} (ts timestamp,latitude double,longitude double,elevation double,velocity double,heading double,grade double,fuel_consumption double) tags (name binary(30),fleet binary(30),driver binary(30),model binary(30),device_version binary(30),load_capacity double,fuel_capacity double,nominal_fuel_consumption double);
diff --git a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
index 66c2fdd14f..04c69ad618 100644
--- a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
+++ b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
@@ -143,7 +143,8 @@ class TDTestCase:
stableName= '%s_%d'%(paraDict['stbName'],i)
newTdSql=tdCom.newTdSql()
threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"])))
- threads.append(threading.Thread(target=self.reCreateUser,args=(newTdSql,i,"user","passwd")))
+ createTdSql=tdCom.newTdSql()
+ threads.append(threading.Thread(target=self.reCreateUser,args=(createTdSql,i,"user","passwd")))
for tr in threads:
tr.start()
diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
index 4dcc0b963f..c11159c6e5 100644
--- a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
+++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py
@@ -200,7 +200,7 @@ class TDTestCase:
tdLog.info("pkill consume processor")
tdCom.killProcessor("tmq_sim")
- # time.sleep(10)
+ time.sleep(10)
# reinit consume info, and start tmq_sim, then check consume result
tmqCom.initConsumerTable()
diff --git a/tests/system-test/7-tmq/tmqDelete-1ctb.py b/tests/system-test/7-tmq/tmqDelete-1ctb.py
index 4b45b1a834..b09efdd1e6 100644
--- a/tests/system-test/7-tmq/tmqDelete-1ctb.py
+++ b/tests/system-test/7-tmq/tmqDelete-1ctb.py
@@ -80,16 +80,16 @@ class TDTestCase:
tdLog.debug("del data ............ [OK]")
return
- def threadFunctionForDeletaData(self, **paraDict):
+ def threadFunctionForDeletaData(self, paraDict):
# create new connector for new tdSql instance in my thread
newTdSql = tdCom.newTdSql()
self.delData(newTdSql,paraDict["dbName"],paraDict["ctbPrefix"],paraDict["ctbNum"],paraDict["startTs"],paraDict["endTs"],paraDict["ctbStartIdx"])
return
- def asyncDeleteData(self, paraDict):
- pThread = threading.Thread(target=self.threadFunctionForDeletaData, kwargs=paraDict)
- pThread.start()
- return pThread
+ # def asyncDeleteData(self, paraDict):
+ # pThread = threading.Thread(target=self.threadFunctionForDeletaData, kwargs=paraDict)
+ # pThread.start()
+ # return pThread
def tmqCase1(self):
tdLog.printNoPrefix("======== test case 1: ")
@@ -109,7 +109,7 @@ class TDTestCase:
'batchNum': 3000,
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
'endTs': 0,
- 'pollDelay': 5,
+ 'pollDelay': 15,
'showMsg': 1,
'showRow': 1,
'snapshot': 0}
@@ -194,7 +194,7 @@ class TDTestCase:
'rowsPerTbl': 10000,
'batchNum': 5000,
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
- 'pollDelay': 5,
+ 'pollDelay': 15,
'showMsg': 1,
'showRow': 1,
'snapshot': 0}
@@ -296,7 +296,7 @@ class TDTestCase:
'rowsPerTbl': 10000,
'batchNum': 5000,
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
- 'pollDelay': 5,
+ 'pollDelay': 15,
'showMsg': 1,
'showRow': 1,
'snapshot': 0}
@@ -340,7 +340,8 @@ class TDTestCase:
# del some data
rowsOfDelete = int(self.rowsPerTbl / 4 )
paraDict["endTs"] = paraDict["startTs"] + rowsOfDelete - 1
- pDeleteThread = self.asyncDeleteData(paraDict)
+ # pDeleteThread = self.asyncDeleteData(paraDict)
+ self.threadFunctionForDeletaData(paraDict)
tdLog.info("start consume processor")
tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
diff --git a/tests/system-test/pytest.sh b/tests/system-test/pytest.sh
index 792cab98f7..dfdfc32ed0 100755
--- a/tests/system-test/pytest.sh
+++ b/tests/system-test/pytest.sh
@@ -93,8 +93,8 @@ else
fi
sleep 1
done
-
- AsanFileSuccessLen=$(grep -w successfully $AsanFile | wc -l)
+ # check case successful
+ AsanFileSuccessLen=$(grep -w "successfully executed" $AsanFile | wc -l)
echo "AsanFileSuccessLen:" $AsanFileSuccessLen
if [ $AsanFileSuccessLen -gt 0 ]; then
@@ -104,4 +104,4 @@ else
echo "Execute script failure"
exit 1
fi
-fi
+fi
\ No newline at end of file
diff --git a/tests/system-test/test.py b/tests/system-test/test.py
index 2017aad1ca..0c62c182f7 100644
--- a/tests/system-test/test.py
+++ b/tests/system-test/test.py
@@ -318,7 +318,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy" :
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(f'alter queryPolicy to {queryPolicy} successfully')
+ tdLog.info(f'alter queryPolicy to {queryPolicy} successfully')
else:
tdLog.debug(res)
tdLog.exit(f"alter queryPolicy to {queryPolicy} failed")
@@ -371,7 +371,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy" :
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(f'alter queryPolicy to {queryPolicy} successfully')
+ tdLog.info(f'alter queryPolicy to {queryPolicy} successfully')
else:
tdLog.debug(res)
tdLog.exit(f"alter queryPolicy to {queryPolicy} failed")
@@ -439,7 +439,7 @@ if __name__ == "__main__":
# for i in range(tdSql.queryRows):
# if tdSql.queryResult[i][0] == "queryPolicy" :
# if int(tdSql.queryResult[i][1]) == int(queryPolicy):
- # tdLog.success('alter queryPolicy to %d successfully'%queryPolicy)
+ # tdLog.info('alter queryPolicy to %d successfully'%queryPolicy)
# else :
# tdLog.debug(tdSql.queryResult)
# tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
@@ -452,7 +452,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy" :
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(f'alter queryPolicy to {queryPolicy} successfully')
+ tdLog.info(f'alter queryPolicy to {queryPolicy} successfully')
else:
tdLog.debug(res)
tdLog.exit(f"alter queryPolicy to {queryPolicy} failed")
@@ -509,7 +509,7 @@ if __name__ == "__main__":
for i in range(cursor.rowcount):
if res[i][0] == "queryPolicy" :
if int(res[i][1]) == int(queryPolicy):
- tdLog.success(f'alter queryPolicy to {queryPolicy} successfully')
+ tdLog.info(f'alter queryPolicy to {queryPolicy} successfully')
else:
tdLog.debug(res)
tdLog.exit(f"alter queryPolicy to {queryPolicy} failed")
diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c
index 1d872e3f0d..a8986351b7 100644
--- a/tools/shell/src/shellAuto.c
+++ b/tools/shell/src/shellAuto.c
@@ -86,8 +86,8 @@ SWords shellCommands[] = {
" "
" ;",
0, 0, NULL},
- {"create dnode ", 0, 0, NULL},
- {"create index ", 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
@@ -98,6 +98,7 @@ SWords shellCommands[] = {
{"describe ", 0, 0, NULL},
{"delete from where ", 0, 0, NULL},
{"drop database ", 0, 0, NULL},
+ {"drop index ", 0, 0, NULL},
{"drop table ", 0, 0, NULL},
{"drop dnode ", 0, 0, NULL},
{"drop mnode on dnode ;", 0, 0, NULL},
@@ -384,7 +385,7 @@ void showHelp() {
create table using tags ...\n\
create database ...\n\
create dnode \"fqdn:port\" ...\n\
- create index ...\n\
+ create index on (tag_column_name);\n\
create mnode on dnode ;\n\
create qnode on dnode ;\n\
create stream into as select ...\n\
@@ -404,6 +405,7 @@ void showHelp() {
drop consumer group ... \n\
drop topic ;\n\
drop stream ;\n\
+ drop index ;\n\
----- E ----- \n\
explain select clause ...\n\
----- F ----- \n\
@@ -534,7 +536,7 @@ SWord* addWord(const char* p, int32_t len, bool pattern) {
word->len = len;
// check format
- if (pattern) {
+ if (pattern && len > 0) {
word->type = wordType(p, len);
} else {
word->type = WT_TEXT;
@@ -1724,6 +1726,9 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) {
if (strlen(last) == 0) {
goto _return;
}
+ if (strcmp(last, " ") == 0) {
+ goto _return;
+ }
// match database
if (elast == NULL) {
diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c
index 655fef383e..05183a036c 100644
--- a/tools/shell/src/shellEngine.c
+++ b/tools/shell/src/shellEngine.c
@@ -1048,26 +1048,28 @@ void *shellThreadLoop(void *arg) {
taosGetOldTerminalMode();
taosThreadCleanupPush(shellCleanup, NULL);
- char *command = taosMemoryMalloc(SHELL_MAX_COMMAND_SIZE);
- if (command == NULL) {
- printf("failed to malloc command\r\n");
- return NULL;
- }
-
do {
- memset(command, 0, SHELL_MAX_COMMAND_SIZE);
- taosSetTerminalMode();
-
- if (shellReadCommand(command) != 0) {
+ char *command = taosMemoryMalloc(SHELL_MAX_COMMAND_SIZE);
+ if (command == NULL) {
+ printf("failed to malloc command\r\n");
break;
}
- taosResetTerminalMode();
- } while (shellRunCommand(command, true) == 0);
+ do {
+ memset(command, 0, SHELL_MAX_COMMAND_SIZE);
+ taosSetTerminalMode();
- taosMemoryFreeClear(command);
- shellWriteHistory();
- shellExit();
+ if (shellReadCommand(command) != 0) {
+ break;
+ }
+
+ taosResetTerminalMode();
+ } while (shellRunCommand(command, true) == 0);
+
+ taosMemoryFreeClear(command);
+ shellWriteHistory();
+ shellExit();
+ } while (0);
taosThreadCleanupPop(1);
return NULL;
diff --git a/tools/shell/src/shellNettest.c b/tools/shell/src/shellNettest.c
index 52ce37b22c..1a6ac3489d 100644
--- a/tools/shell/src/shellNettest.c
+++ b/tools/shell/src/shellNettest.c
@@ -21,7 +21,7 @@ static void shellWorkAsClient() {
SRpcInit rpcInit = {0};
SEpSet epSet = {.inUse = 0, .numOfEps = 1};
SRpcMsg rpcRsp = {0};
- void * clientRpc = NULL;
+ void *clientRpc = NULL;
char pass[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t *)("_pwd"), strlen("_pwd"), pass);
@@ -31,6 +31,7 @@ static void shellWorkAsClient() {
rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.idleTime = tsShellActivityTimer * 1000;
rpcInit.user = "_dnd";
+ rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
clientRpc = rpcOpen(&rpcInit);
if (clientRpc == NULL) {
diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c
index c36ab38877..73c4454178 100644
--- a/utils/test/c/sml_test.c
+++ b/utils/test/c/sml_test.c
@@ -137,6 +137,8 @@ int smlProcess_json1_Test() {
for (int i = 0; i < 1; i++) {
taosMemoryFree(sql1[i]);
}
+ ASSERT(code == 0);
+
const char *sql2[] = {
"[{\"metric\":\"sys.cpu.nice\",\"timestamp\":1662344041,\"value\":13,\"tags\":{\"host\":\"web01\",\"dc\":\"lga\"}"
@@ -164,6 +166,34 @@ int smlProcess_json1_Test() {
taosMemoryFree(sql3[i]);
}
+ ASSERT(code == 0);
+
+
+ // TD-22903
+ const char *sql4[] = {
+ "[{\"metric\": \"test_us\", \"timestamp\": {\"value\": 1626006833639, \"type\": \"ms\"}, \"value\": true, \"tags\": {\"t0\": true}}, {\"metric\": \"test_us\", \"timestamp\": {\"value\": 1626006833638, \"type\": \"ms\"}, \"value\": false, \"tags\": {\"t0\": true}}]"
+ };
+ char *sql5[1] = {0};
+ for (int i = 0; i < 1; i++) {
+ sql5[i] = taosMemoryCalloc(1, 1024);
+ strncpy(sql5[i], sql4[i], 1023);
+ }
+
+ pRes = taos_schemaless_insert(taos, (char **)sql5, sizeof(sql5) / sizeof(sql5[0]), TSDB_SML_JSON_PROTOCOL,
+ TSDB_SML_TIMESTAMP_NANO_SECONDS);
+ code = taos_errno(pRes);
+ if (code != 0) {
+ printf("%s result:%s\n", __FUNCTION__, taos_errstr(pRes));
+ } else {
+ printf("%s result:success\n", __FUNCTION__);
+ }
+ taos_free_result(pRes);
+
+ for (int i = 0; i < 1; i++) {
+ taosMemoryFree(sql5[i]);
+ }
+ ASSERT(code == 0);
+
taos_close(taos);
return code;
@@ -215,8 +245,8 @@ int smlProcess_json3_Test() {
taos_free_result(pRes);
const char *sql[] = {
- "[{\"metric\":\"sys.cpu.nice3\",\"timestamp\":0,\"value\":\"18\",\"tags\":{\"host\":\"web01\",\"id\":\"t1\","
- "\"dc\":\"lga\"}}]"};
+ "[{\"metric\":\"sys.cpu.nice3\",\"timestamp\":0,\"value\":\"18\",\"tags\":{\"host\":\"web01\",\"id\":\"t1\",\"dc\":\"lga\"}}]"
+ };
char *sql1[1] = {0};
for (int i = 0; i < 1; i++) {
sql1[i] = taosMemoryCalloc(1, 1024);
@@ -927,6 +957,71 @@ int sml_ts2164_Test() {
return code;
}
+int sml_td22898_Test() {
+ TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);
+
+ TAOS_RES *pRes =
+ taos_query(taos, "CREATE DATABASE IF NOT EXISTS line_test BUFFER 384 MINROWS 1000 PAGES 256 PRECISION 'ns'");
+ taos_free_result(pRes);
+
+ const char *sql[] = {
+ "svlzxdfutx,id=nyavpjyfas,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=t,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64 1626006833639"
+ };
+
+ pRes = taos_query(taos, "use line_test");
+ taos_free_result(pRes);
+
+ pRes = taos_schemaless_insert(taos, (char **)sql, sizeof(sql) / sizeof(sql[0]), TSDB_SML_LINE_PROTOCOL,
+ TSDB_SML_TIMESTAMP_MILLI_SECONDS);
+
+ printf("%s result:%s\n", __FUNCTION__, taos_errstr(pRes));
+ int code = taos_errno(pRes);
+ taos_free_result(pRes);
+
+ const char *sql1[] = {
+ "svlzxdfutx,id=nyavpjyfas,t0=True,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"tgqkvsws\",t8=L\"ncharTagValue\" c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"htvnnldm\",c8=L\"ncharColValue\",c9=7u64 1626006833639"
+ };
+
+ pRes = taos_schemaless_insert(taos, (char **)sql1, sizeof(sql1) / sizeof(sql1[0]), TSDB_SML_LINE_PROTOCOL,
+ TSDB_SML_TIMESTAMP_MILLI_SECONDS);
+
+ printf("%s result:%s\n", __FUNCTION__, taos_errstr(pRes));
+ code = taos_errno(pRes);
+ taos_free_result(pRes);
+
+ pRes = taos_query(taos, "select * from svlzxdfutx");
+ taos_free_result(pRes);
+
+ taos_close(taos);
+
+ return code;
+}
+
+int sml_td22900_Test() {
+ TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);
+
+ TAOS_RES *pRes =
+ taos_query(taos, "CREATE DATABASE IF NOT EXISTS line_test BUFFER 384 MINROWS 1000 PAGES 256 PRECISION 'ns'");
+ taos_free_result(pRes);
+
+ const char *sql[] = {
+ "qddkgilwfu,id=qddkgilwfu_42383_49198,t0=t,t1=127i8 c4=9223372036854775807i64,c6=11.12345f32,c6=22.123456789f64 1626006833639"
+ };
+
+ pRes = taos_query(taos, "use line_test");
+ taos_free_result(pRes);
+
+ pRes = taos_schemaless_insert(taos, (char **)sql, sizeof(sql) / sizeof(sql[0]), TSDB_SML_LINE_PROTOCOL,
+ TSDB_SML_TIMESTAMP_MILLI_SECONDS);
+
+ printf("%s result:%s\n", __FUNCTION__, taos_errstr(pRes));
+ int code = taos_errno(pRes);
+ taos_free_result(pRes);
+ taos_close(taos);
+
+ return code;
+}
+
int sml_ttl_Test() {
TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);
@@ -1106,6 +1201,10 @@ int main(int argc, char *argv[]) {
ASSERT(!ret);
ret = sml_ts2164_Test();
ASSERT(!ret);
+ ret = sml_td22898_Test();
+ ASSERT(!ret);
+ ret = sml_td22900_Test();
+ ASSERT(ret);
ret = smlProcess_influx_Test();
ASSERT(!ret);
ret = smlProcess_telnet_Test();
diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c
index 1acf50a7d8..026067e7f8 100644
--- a/utils/test/c/tmqSim.c
+++ b/utils/test/c/tmqSim.c
@@ -856,7 +856,9 @@ void loop_consume(SThreadInfo* pInfo) {
taosFprintfFile(g_fp, "==== consumerId: %d, consumeMsgCnt: %" PRId64 ", consumeRowCnt: %" PRId64 "\n",
pInfo->consumerId, pInfo->consumeMsgCnt, pInfo->consumeRowCnt);
- taosFsyncFile(pInfo->pConsumeRowsFile);
+ if(taosFsyncFile(pInfo->pConsumeRowsFile) < 0){
+ printf("taosFsyncFile error:%s", strerror(errno));
+ }
taosCloseFile(&pInfo->pConsumeRowsFile);
}
diff --git a/utils/test/c/tmq_taosx_ci.c b/utils/test/c/tmq_taosx_ci.c
index 3d458d90c1..1f25eae366 100644
--- a/utils/test/c/tmq_taosx_ci.c
+++ b/utils/test/c/tmq_taosx_ci.c
@@ -409,7 +409,7 @@ int buildStable(TAOS* pConn, TAOS_RES* pRes) {
taos_free_result(pRes);
pRes = taos_query(pConn,
- "create stream meters_summary_s into meters_summary as select _wstart, max(current) as current, "
+ "create stream meters_summary_s trigger at_once IGNORE EXPIRED 0 into meters_summary as select _wstart, max(current) as current, "
"groupid, location from meters partition by groupid, location interval(10m)");
if (taos_errno(pRes) != 0) {
printf("failed to create super table meters_summary, reason:%s\n", taos_errstr(pRes));