diff --git a/cmake/cmake.define b/cmake/cmake.define index 5b65738c70..dcb4ce2702 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -120,8 +120,14 @@ ELSE () SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -fsanitize=address -fsanitize=undefined -fsanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=shift-base -fno-sanitize=alignment -g3 -Wformat=0") MESSAGE(STATUS "Compile with Address Sanitizer!") ELSE () - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-reserved-user-defined-literal -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") + MESSAGE(STATUS "XXXXXXXXXXXXXX Clang/AppleClang" ${TD_DARWIN}) + IF (${TD_DARWIN}) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-y2k") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-reserved-user-defined-literal -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-y2k") + ELSE () + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-reserved-user-defined-literal -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") + ENDIF () ENDIF () # disable all assert diff --git a/cmake/cmake.options b/cmake/cmake.options index 60ff00affc..4ec9d18e08 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -109,7 +109,7 @@ option( option( BUILD_WITH_ROCKSDB "If build with rocksdb" - OFF + ON ) option( diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 8f94313382..942e77dacb 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -223,17 +223,31 @@ endif(${BUILD_WITH_LEVELDB}) # rocksdb # To support rocksdb build on ubuntu: sudo apt-get install libgflags-dev if(${BUILD_WITH_ROCKSDB}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized") + #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized") option(WITH_TESTS "" OFF) option(WITH_BENCHMARK_TOOLS "" OFF) option(WITH_TOOLS "" OFF) option(WITH_LIBURING "" OFF) + option(WITH_IOSTATS_CONTEXT "" OFF) + option(WITH_PERF_CONTEXT "" OFF) + option(FAIL_ON_WARNINGS "" OFF) + #option(WITH_JEMALLOC "" ON) option(ROCKSDB_BUILD_SHARED "Build shared versions of the RocksDB libraries" OFF) + IF (${TD_WINDOWS}) + option(WITH_MD_LIBRARY "build with MD" OFF) + set(SYSTEM_LIBS ${SYSTEM_LIBS} shlwapi.lib rpcrt4.lib) + endif(${TD_WINDOWS}) add_subdirectory(rocksdb EXCLUDE_FROM_ALL) target_include_directories( rocksdb PUBLIC $ ) + IF (${TD_DARWIN}) + target_compile_options( + rocksdb + PRIVATE -Wno-unused-private-field + ) + endif(${TD_DARWIN}) endif(${BUILD_WITH_ROCKSDB}) # lucene diff --git a/contrib/test/rocksdb/CMakeLists.txt b/contrib/test/rocksdb/CMakeLists.txt index b500e0a661..5ae1b0395b 100644 --- a/contrib/test/rocksdb/CMakeLists.txt +++ b/contrib/test/rocksdb/CMakeLists.txt @@ -1,6 +1,8 @@ +message("contrib test/rocksdb:" ${BUILD_DEPENDENCY_TESTS}) + add_executable(rocksdbTest "") target_sources(rocksdbTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/main.c" ) -target_link_libraries(rocksdbTest rocksdb) \ No newline at end of file +target_link_libraries(rocksdbTest rocksdb) diff --git a/contrib/test/rocksdb/main.c b/contrib/test/rocksdb/main.c index d1cbd373da..09435790cc 100644 --- a/contrib/test/rocksdb/main.c +++ b/contrib/test/rocksdb/main.c @@ -25,10 +25,12 @@ int main(int argc, char const *argv[]) { // Read rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); - rocksdb_readoptions_set_snapshot(readoptions, rocksdb_create_snapshot(db)); +//rocksdb_readoptions_set_snapshot(readoptions, rocksdb_create_snapshot(db)); + char buf[256] = {0}; size_t vallen = 0; char * val = rocksdb_get(db, readoptions, "key", 3, &vallen, &err); - printf("val:%s\n", val); + snprintf(buf, vallen+5, "val:%s", val); + printf("%ld %ld %s\n", strlen(val), vallen, buf); // Update // rocksdb_put(db, writeoptions, "key", 3, "eulav", 5, &err); @@ -43,4 +45,4 @@ int main(int argc, char const *argv[]) { rocksdb_close(db); return 0; -} \ No newline at end of file +} diff --git a/docs/en/02-intro/index.md b/docs/en/02-intro/index.md index 79d170eeb9..9324ca9f7e 100644 --- a/docs/en/02-intro/index.md +++ b/docs/en/02-intro/index.md @@ -44,7 +44,7 @@ For more details on features, please read through the entire documentation. ## Competitive Advantages -By making full use of [characteristics of time series data](https://tdengine.com/tsdb/characteristics-of-time-series-data/), TDengine differentiates itself from other [time series databases](https://tdengine.com/tsdb), with the following advantages. +By making full use of [characteristics of time series data](https://tdengine.com/tsdb/characteristics-of-time-series-data/), TDengine differentiates itself from other [time series databases](https://tdengine.com/tsdb/), with the following advantages. - **[High-Performance](https://tdengine.com/tdengine/high-performance-time-series-database/)**: TDengine is the only time-series database to solve the high cardinality issue to support billions of data collection points while out performing other time-series databases for data ingestion, querying and data compression. @@ -123,13 +123,12 @@ 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/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/) +- [TDengine vs. InfluxDB](https://tdengine.com/tsdb-comparison-influxdb-vs-tdengine/) +- [TDengine vs. TimescaleDB](https://tdengine.com/tsdb-comparison-timescaledb-vs-tdengine/) +- [TDengine vs. OpenTSDB](https://tdengine.com/performance-tdengine-vs-opentsdb/) +- [TDengine vs. Cassandra](https://tdengine.com/performance-tdengine-vs-cassandra/) ## More readings - [Introduction to Time-Series Database](https://tdengine.com/tsdb/) - [Introduction to TDengine competitive advantages](https://tdengine.com/tdengine/) - + diff --git a/docs/en/05-get-started/01-docker.md b/docs/en/05-get-started/01-docker.md index 42e6861674..2049e1615f 100644 --- a/docs/en/05-get-started/01-docker.md +++ b/docs/en/05-get-started/01-docker.md @@ -6,7 +6,7 @@ description: This document describes how to install TDengine in a Docker contain This document describes how to install TDengine in a Docker container and perform queries and inserts. -- The easiest way to explore TDengine is through [TDengine Cloud](http://cloud.tdengine.com). +- The easiest way to explore TDengine is through [TDengine Cloud](https://cloud.tdengine.com). - To get started with TDengine in a non-containerized environment, see [Quick Install from Package](../../get-started/package). - If you want to view the source code, build TDengine yourself, or contribute to the project, see the [TDengine GitHub repository](https://github.com/taosdata/TDengine). diff --git a/docs/en/05-get-started/03-package.md b/docs/en/05-get-started/03-package.md index 3282f600ac..8f9cb9aedc 100644 --- a/docs/en/05-get-started/03-package.md +++ b/docs/en/05-get-started/03-package.md @@ -10,7 +10,7 @@ import PkgListV3 from "/components/PkgListV3"; This document describes how to install TDengine on Linux/Windows/macOS and perform queries and inserts. -- The easiest way to explore TDengine is through [TDengine Cloud](http://cloud.tdengine.com). +- The easiest way to explore TDengine is through [TDengine Cloud](https://cloud.tdengine.com). - To get started with TDengine on Docker, see [Quick Install on Docker](../../get-started/docker). - If you want to view the source code, build TDengine yourself, or contribute to the project, see the [TDengine GitHub repository](https://github.com/taosdata/TDengine). @@ -208,6 +208,8 @@ The following `launchctl` commands can help you manage TDengine service: - Check TDengine Server status: `sudo launchctl list | grep taosd` +- Check TDengine Server status details: `launchctl print system/com.tdengine.taosd` + :::info - 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. diff --git a/docs/en/07-develop/01-connect/index.md b/docs/en/07-develop/01-connect/index.md index 913c24f189..8cf3c463af 100644 --- a/docs/en/07-develop/01-connect/index.md +++ b/docs/en/07-develop/01-connect/index.md @@ -288,6 +288,6 @@ Prior to establishing connection, please make sure TDengine is already running a :::tip -If the connection fails, in most cases it's caused by improper configuration for FQDN or firewall. Please refer to the section "Unable to establish connection" in [FAQ](https://docs.tdengine.com/train-faq/faq). +If the connection fails, in most cases it's caused by improper configuration for FQDN or firewall. Please refer to the section "Unable to establish connection" in [FAQ](../../train-faq/faq). ::: diff --git a/docs/en/07-develop/03-insert-data/_rust_schemaless.mdx b/docs/en/07-develop/03-insert-data/_rust_schemaless.mdx new file mode 100644 index 0000000000..a26613bd15 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_schemaless.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/nativeexample/examples/schemaless_insert_line.rs}} +``` diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx index 739eabd1cf..a4eb41bd7e 100644 --- a/docs/en/07-develop/07-tmq.mdx +++ b/docs/en/07-develop/07-tmq.mdx @@ -23,7 +23,7 @@ By subscribing to a topic, a consumer can obtain the latest data in that topic i To implement these features, TDengine indexes its write-ahead log (WAL) file for fast random access and provides configurable methods for replacing and retaining this file. You can define a retention period and size for this file. For information, see the CREATE DATABASE statement. In this way, the WAL file is transformed into a persistent storage engine that remembers the order in which events occur. However, note that configuring an overly long retention period for your WAL files makes database compression inefficient. TDengine then uses the WAL file instead of the time-series database as its storage engine for queries in the form of topics. TDengine reads the data from the WAL file; uses a unified query engine instance to perform filtering, transformations, and other operations; and finally pushes the data to consumers. -Tips:The default data subscription is to consume data from the wal. If the wal is deleted, the consumed data will be incomplete. At this time, you can set the parameter experimental.snapshot.enable to true to obtain all data from the tsdb, but in this way, the consumption order of the data cannot be guaranteed. Therefore, it is recommended to set a reasonable retention policy for WAL based on your consumption situation to ensure that you can subscribe all data from WAL. +Tips: Data subscription is to consume data from the wal. If some wal files are deleted according to WAL retention policy, the deleted data can't be consumed any more. So you need to set a reasonable value for parameter `WAL_RETENTION_PERIOD` or `WAL_RETENTION_SIZE` when creating the database and make sure your application consume the data in a timely way to make sure there is no data loss. This behavior is similar to Kafka and other widely used message queue products. ## Data Schema and API @@ -294,7 +294,6 @@ You configure the following parameters when creating a consumer: | `auto.offset.reset` | enum | Initial offset for the consumer group | Specify `earliest`, `latest`, or `none`(default) | | `enable.auto.commit` | boolean | Commit automatically; true: user application doesn't need to explicitly commit; false: user application need to handle commit by itself | Default value is true | | `auto.commit.interval.ms` | integer | Interval for automatic commits, in milliseconds | -| `experimental.snapshot.enable` | boolean | Specify whether to consume data in TSDB; true: both data in WAL and in TSDB can be consumed; false: only data in WAL can be consumed | default value: false | | `msg.with.table.name` | boolean | Specify whether to deserialize table names from messages | default value: false The method of specifying these parameters depends on the language used: @@ -312,7 +311,6 @@ tmq_conf_set(conf, "group.id", "cgrpName"); tmq_conf_set(conf, "td.connect.user", "root"); tmq_conf_set(conf, "td.connect.pass", "taosdata"); tmq_conf_set(conf, "auto.offset.reset", "earliest"); -tmq_conf_set(conf, "experimental.snapshot.enable", "true"); tmq_conf_set(conf, "msg.with.table.name", "true"); tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); @@ -368,7 +366,6 @@ conf := &tmq.ConfigMap{ "td.connect.port": "6030", "client.id": "test_tmq_c", "enable.auto.commit": "false", - "experimental.snapshot.enable": "true", "msg.with.table.name": "true", } consumer, err := NewConsumer(conf) @@ -416,7 +413,6 @@ 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 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` | diff --git a/docs/en/07-develop/09-udf.md b/docs/en/07-develop/09-udf.md index dc42743b51..a7753647e3 100644 --- a/docs/en/07-develop/09-udf.md +++ b/docs/en/07-develop/09-udf.md @@ -6,10 +6,12 @@ description: This document describes how to create user-defined functions (UDF), The built-in functions of TDengine may not be sufficient for the use cases of every application. In this case, you can define custom functions for use in TDengine queries. These are known as user-defined functions (UDF). A user-defined function takes one column of data or the result of a subquery as its input. -TDengine supports user-defined functions written in C or C++. This document describes the usage of user-defined functions. - User-defined functions can be scalar functions or aggregate functions. Scalar functions, such as `abs`, `sin`, and `concat`, output a value for every row of data. Aggregate functions, such as `avg` and `max` output one value for multiple rows of data. +TDengine supports user-defined functions written in C or Python. This document describes the usage of user-defined functions. + +## Implement a UDF in C + When you create a user-defined function, you must implement standard interface functions: - For scalar functions, implement the `scalarfn` interface function. - For aggregate functions, implement the `aggfn_start`, `aggfn`, and `aggfn_finish` interface functions. @@ -17,7 +19,7 @@ When you create a user-defined function, you must implement standard interface f There are strict naming conventions for these interface functions. The names of the start, finish, init, and destroy interfaces must be _start, _finish, _init, and _destroy, respectively. Replace `scalarfn`, `aggfn`, and `udf` with the name of your user-defined function. -## Implementing a Scalar Function +### Implementing a Scalar Function in C The implementation of a scalar function is described as follows: ```c #include "taos.h" @@ -49,7 +51,7 @@ int32_t scalarfn_destroy() { ``` Replace `scalarfn` with the name of your function. -## Implementing an Aggregate Function +### Implementing an Aggregate Function in C The implementation of an aggregate function is described as follows: ```c @@ -100,7 +102,7 @@ int32_t aggfn_destroy() { ``` Replace `aggfn` with the name of your function. -## Interface Functions +### UDF Interface Definition in C There are strict naming conventions for interface functions. The names of the start, finish, init, and destroy interfaces must be _start, _finish, _init, and _destroy, respectively. Replace `scalarfn`, `aggfn`, and `udf` with the name of your user-defined function. @@ -108,8 +110,7 @@ Interface functions return a value that indicates whether the operation was succ For information about the parameters for interface functions, see Data Model -### Interfaces for Scalar Functions - +#### Scalar Interface `int32_t scalarfn(SUdfDataBlock* inputDataBlock, SUdfColumn *resultColumn)` Replace `scalarfn` with the name of your function. This function performs scalar calculations on data blocks. You can configure a value through the parameters in the `resultColumn` structure. @@ -118,7 +119,7 @@ The parameters in the function are defined as follows: - inputDataBlock: The data block to input. - resultColumn: The column to output. The column to output. -### Interfaces for Aggregate Functions +#### Aggregate Interface `int32_t aggfn_start(SUdfInterBuf *interBuf)` @@ -126,7 +127,7 @@ The parameters in the function are defined as follows: `int32_t aggfn_finish(SUdfInterBuf* interBuf, SUdfInterBuf *result)` -Replace `aggfn` with the name of your function. In the function, aggfn_start is called to generate a result buffer. Data is then divided between multiple blocks, and aggfn is called on each block to update the result. Finally, aggfn_finish is called to generate final results from the intermediate results. The final result contains only one or zero data points. +Replace `aggfn` with the name of your function. In the function, aggfn_start is called to generate a result buffer. Data is then divided between multiple blocks, and the `aggfn` function is called on each block to update the result. Finally, aggfn_finish is called to generate the final results from the intermediate results. The final result contains only one or zero data points. The parameters in the function are defined as follows: - interBuf: The intermediate result buffer. @@ -135,15 +136,15 @@ The parameters in the function are defined as follows: - result: The final result. -### Initializing and Terminating User-Defined Functions +#### Initialization and Cleanup Interface `int32_t udf_init()` `int32_t udf_destroy()` -Replace `udf`with the name of your function. udf_init initializes the function. udf_destroy terminates the function. If it is not necessary to initialize your function, udf_init is not required. If it is not necessary to terminate your function, udf_destroy is not required. +Replace `udf` with the name of your function. udf_init initializes the function. udf_destroy terminates the function. If it is not necessary to initialize your function, udf_init is not required. If it is not necessary to terminate your function, udf_destroy is not required. -## Data Structure of User-Defined Functions +### Data Structures for UDF in C ```c typedef struct SUdfColumnMeta { int16_t type; @@ -193,7 +194,7 @@ typedef struct SUdfInterBuf { ``` The data structure is described as follows: -- The SUdfDataBlock block includes the number of rows (numOfRows) and number of columns (numCols). udfCols[i] (0 <= i <= numCols-1) indicates that each column is of type SUdfColumn. +- The SUdfDataBlock block includes the number of rows (numOfRows) and the number of columns (numCols). udfCols[i] (0 <= i <= numCols-1) indicates that each column is of type SUdfColumn. - SUdfColumn includes the definition of the data type of the column (colMeta) and the data in the column (colData). - The member definitions of SUdfColumnMeta are the same as the data type definitions in `taos.h`. - The data in SUdfColumnData can become longer. varLenCol indicates variable-length data, and fixLenCol indicates fixed-length data. @@ -201,9 +202,9 @@ The data structure is described as follows: Additional functions are defined in `taosudf.h` to make it easier to work with these structures. -## Compile UDF +### Compiling C UDF -To use your user-defined function in TDengine, first compile it to a dynamically linked library (DLL). +To use your user-defined function in TDengine, first, compile it to a shared library. For example, the sample UDF `bit_and.c` can be compiled into a DLL as follows: @@ -213,12 +214,9 @@ gcc -g -O0 -fPIC -shared bit_and.c -o libbitand.so The generated DLL file `libbitand.so` can now be used to implement your function. Note: GCC 7.5 or later is required. -## Manage and Use User-Defined Functions -After compiling your function into a DLL, you add it to TDengine. For more information, see [User-Defined Functions](../12-taos-sql/26-udf.md). +### UDF Sample Code in C -## Sample Code - -### Sample scalar function: [bit_and](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/bit_and.c) +#### Scalar function: [bit_and](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/bit_and.c) The bit_and function implements bitwise addition for multiple columns. If there is only one column, the column is returned. The bit_and function ignores null values. @@ -231,7 +229,7 @@ The bit_and function implements bitwise addition for multiple columns. If there -### Sample aggregate function: [l2norm](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/l2norm.c) +#### Aggregate function 1: [l2norm](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/l2norm.c) The l2norm function finds the second-order norm for all data in the input column. This squares the values, takes a cumulative sum, and finds the square root. @@ -243,3 +241,151 @@ The l2norm function finds the second-order norm for all data in the input column ``` + +#### Aggregate function 2: [max_vol](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/max_vol.c) + +The max_vol function returns a string concatenating the deviceId column, the row number and column number of the maximum voltage and the maximum voltage given several voltage columns as input. + +Create Table: +```bash +create table battery(ts timestamp, vol1 float, vol2 float, vol3 float, deviceId varchar(16)); +``` +Create the UDF: +```bash +create aggregate function max_vol as '/root/udf/libmaxvol.so' outputtype binary(64) bufsize 10240 language 'C'; +``` +Use the UDF in the query: +```bash +select max_vol(vol1,vol2,vol3,deviceid) from battery; +``` + +
+max_vol.c + +```c +{{#include tests/script/sh/max_vol.c}} +``` + +
+ +## Implement a UDF in Python + +Implement the specified interface functions when implementing a UDF in Python. +- implement `process` function for the scalar UDF。 +- implement `start`, `reduce`, `finish` for the aggregate UDF。 +- implement `init` for initialization and `destroy` for termination。 + +### Implement a Scalar UDF in Python + +The implementation of a scalar UDF is described as follows: + +```Python +def init(): + # initialization +def destroy(): + # destroy +def process(input: datablock) -> tuple[output_type]: + # process input datablock, + # datablock.data(row, col) is to access the python object in location(row,col) + # return tuple object consisted of object of type outputtype +``` + +### Implement an Aggregate UDF in Python + +The implementation of an aggregate function is described as follows: + +```Python +def init(): + #initialization +def destroy(): + #destroy +def start() -> bytes: + #return serialize(init_state) +def reduce(inputs: datablock, buf: bytes) -> bytes + # deserialize buf to state + # reduce the inputs and state into new_state. + # use inputs.data(i,j) to access python ojbect of location(i,j) + # serialize new_state into new_state_bytes + return new_state_bytes +def finish(buf: bytes) -> output_type: + #return obj of type outputtype +``` + +### Python UDF Interface Definition + +#### Scalar interface +```Python +def process(input: datablock) -> tuple[output_type]: +``` +- `input` is a data block two-dimension matrix-like object, of which method `data(row, col)` returns the Python object located at location (`row`, `col`) +- return a Python tuple object, of which each item is a Python object of type `output_type` + +#### Aggregate Interface +```Python +def start() -> bytes: +def reduce(input: datablock, buf: bytes) -> bytes +def finish(buf: bytes) -> output_type: +``` + +- first `start()` is called to return the initial result in type `bytes` +- then the input data are divided into multiple data blocks and for each block `input`, `reduce` is called with the data block `input` and the current result `buf` bytes and generates a new intermediate result buffer. +- finally, the `finish` function is called on the intermediate result `buf` and outputs 0 or 1 data of type `output_type` + + +#### Initialization and Cleanup Interface +```Python +def init() +def destroy() +``` +Implement `init` for initialization and `destroy` for termination. + +### Data Mapping between TDengine SQL and Python UDF + +The following table describes the mapping between TDengine SQL data type and Python UDF Data Type. The `NULL` value of all TDengine SQL types is mapped to the `None` value in Python. + +| **TDengine SQL Data Type** | **Python Data Type** | +| :-----------------------: | ------------ | +|TINYINT / SMALLINT / INT / BIGINT | int | +|TINYINT UNSIGNED / SMALLINT UNSIGNED / INT UNSIGNED / BIGINT UNSIGNED | int | +|FLOAT / DOUBLE | float | +|BOOL | bool | +|BINARY / VARCHAR / NCHAR | bytes| +|TIMESTAMP | int | +|JSON and other types | Not Supported | + +### Installing Python UDF +1. Install Python package `taospyudf` that executes Python UDF +```bash +sudo pip install taospyudf +ldconfig +``` +2. If PYTHONPATH is needed to find Python packages when the Python UDF executes, include the PYTHONPATH contents into the udfdLdLibPath variable of the taos.cfg configuration file + +### Python UDF Sample Code +#### Scalar Function [pybitand](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/pybitand.py) + +The `pybitand` function implements bitwise addition for multiple columns. If there is only one column, the column is returned. The `pybitand` function ignores null values. + +
+pybitand.py + +```Python +{{#include tests/script/sh/pybitand.py}} +``` + +
+ +#### Aggregate Function [pyl2norm](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/pyl2norm.py) + +The `pyl2norm` function finds the second-order norm for all data in the input column. This squares the values, takes a cumulative sum, and finds the square root. +
+pyl2norm.py + +```c +{{#include tests/script/sh/pyl2norm.py}} +``` + +
+ +## Manage and Use UDF +You need to add UDF to TDengine before using it in SQL queries. For more information about how to manage UDF and how to invoke UDF, please see [Manage and Use UDF](../12-taos-sql/26-udf.md). diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index ec007d6830..8c579622c9 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -72,8 +72,8 @@ database_option: { - 0: The database can contain multiple supertables. - 1: The database can contain only one supertable. - STT_TRIGGER: specifies the number of file merges triggered by flushed files. The default is 8, ranging from 1 to 16. For high-frequency scenarios with few tables, it is recommended to use the default configuration or a smaller value for this parameter; For multi-table low-frequency scenarios, it is recommended to configure this parameter with a larger value. -- 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. +- TABLE_PREFIX: The prefix in the table name that is ignored when distributing a table to a vgroup when it's a positive number, or only the prefix is used when distributing a table to a vgroup, the default value is 0; For example, if the table name v30001, then "0001" is used if TSDB_PREFIX is set to 2 but "v3" is used if TSDB_PREFIX is set to -2; It can help you to control the distribution of tables. +- TABLE_SUFFIX:The suffix in the table name that is ignored when distributing a table to a vgroup when it's a positive number, or only the suffix is used when distributing a table to a vgroup, the default value is 0; For example, if the table name v30001, then "v300" is used if TSDB_SUFFIX is set to 2 but "01" is used if TSDB_SUFFIX is set to -2; It can help you to control the distribution of tables. - TSDB_PAGESIZE: The page size of the data storage engine in a vnode. The unit is KB. The default is 4 KB. The range is 1 to 16384, that is, 1 KB to 16 MB. - WAL_RETENTION_PERIOD: specifies the maximum time of which WAL files are to be kept for consumption. This parameter is used for data subscription. Enter a time in seconds. The default value 0. A value of 0 indicates that WAL files are not required to keep for consumption. Alter it with a proper value at first to create topics. - WAL_RETENTION_SIZE: specifies the maximum total size of which WAL files are to be kept for consumption. This parameter is used for data subscription. Enter a size in KB. The default value is 0. A value of 0 indicates that the total size of WAL files to keep for consumption has no upper limit. diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index de7294f7a9..070fd41653 100644 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -55,7 +55,7 @@ window_clause: { | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] interp_clause: - RANGE(ts_val, ts_val), EVERY(every_val), FILL(fill_mod_and_val) + RANGE(ts_val, ts_val) EVERY(every_val) FILL(fill_mod_and_val) partition_by_clause: PARTITION BY expr [, expr] ... diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index 0b5f9103c7..5c0ad8a71d 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -886,7 +886,7 @@ INTERP(expr) - The output time range of `INTERP` is specified by `RANGE(timestamp1,timestamp2)` parameter, with timestamp1 <= timestamp2. timestamp1 is the starting point of the output time range and must be specified. timestamp2 is the ending point of the output time range and must be specified. - The number of rows in the result set of `INTERP` is determined by the parameter `EVERY(time_unit)`. Starting from timestamp1, one interpolation is performed for every time interval specified `time_unit` parameter. The parameter `time_unit` must be an integer, with no quotes, with a time unit of: a(millisecond)), s(second), m(minute), h(hour), d(day), or w(week). For example, `EVERY(500a)` will interpolate every 500 milliseconds. - Interpolation is performed based on `FILL` parameter. For more information about FILL clause, see [FILL Clause](../distinguished/#fill-clause). -- `INTERP` can only be used to interpolate in single timeline. So it must be used with `partition by tbname` when it's used on a STable. +- `INTERP` can be applied to supertable by interpolating primary key sorted data of all its childtables. It can also be used with `partition by tbname` when applied to supertable to generate interpolation on each single timeline. - 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). diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md index d99c5bdae4..43c49c03cd 100644 --- a/docs/en/12-taos-sql/14-stream.md +++ b/docs/en/12-taos-sql/14-stream.md @@ -147,7 +147,7 @@ In both of these methods, configuring the watermark is essential for obtaining a ## Supported functions -All [scalar functions](../function/#scalar-functions) are available in stream processing. All [System information functions](../function/#system-information-functions) are not allowed in stream processing. All [Aggregate functions](../function/#aggregate-functions) and [Selection functions](../function/#selection-functions) are available in stream processing, except the followings: +All [scalar functions](../function/#scalar-functions) are available in stream processing. All [Aggregate functions](../function/#aggregate-functions) and [Selection functions](../function/#selection-functions) are available in stream processing, except the followings: - [leastsquares](../function/#leastsquares) - [percentile](../function/#percentile) - [top](../function/#top) diff --git a/docs/en/12-taos-sql/22-meta.md b/docs/en/12-taos-sql/22-meta.md index 81284aeaed..e63f682761 100644 --- a/docs/en/12-taos-sql/22-meta.md +++ b/docs/en/12-taos-sql/22-meta.md @@ -120,6 +120,9 @@ Provides information about user-defined functions. | 5 | create_time | TIMESTAMP | Creation time | | 6 | code_len | INT | Length of the source code | | 7 | bufsize | INT | Buffer size | +| 8 | func_language | BINARY(31) | UDF programming language | +| 9 | func_body | BINARY(16384) | UDF function body | +| 10 | func_version | INT | UDF function version. starting from 0. Increasing by 1 each time it is updated| ## INS_INDEXES diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md index e2aff7a878..886214df0e 100644 --- a/docs/en/12-taos-sql/24-show.md +++ b/docs/en/12-taos-sql/24-show.md @@ -129,6 +129,14 @@ SHOW QNODES; Shows information about qnodes in the system. +## SHOW QUERIES + +```sql +SHOW QUERIES; +``` + +Shows the queries in progress in the system. + ## SHOW SCORES ```sql diff --git a/docs/en/12-taos-sql/26-udf.md b/docs/en/12-taos-sql/26-udf.md index cb64873705..c4d6d4fca4 100644 --- a/docs/en/12-taos-sql/26-udf.md +++ b/docs/en/12-taos-sql/26-udf.md @@ -7,17 +7,18 @@ description: This document describes the SQL statements related to user-defined You can create user-defined functions and import them into TDengine. ## Create UDF -SQL command can be executed on the host where the generated UDF DLL resides to load the UDF DLL into TDengine. This operation cannot be done through REST interface or web console. Once created, any client of the current TDengine can use these UDF functions in their SQL commands. UDF are stored in the management node of TDengine. The UDFs loaded in TDengine would be still available after TDengine is restarted. +SQL command can be executed on the host where the generated UDF DLL resides to load the UDF DLL into TDengine. This operation cannot be done through REST interface or web console. Once created, any client of the current TDengine can use these UDF functions in their SQL commands. UDF is stored in the management node of TDengine. The UDFs loaded in TDengine would be still available after TDengine is restarted. When creating UDF, the type of UDF, i.e. a scalar function or aggregate function must be specified. If the specified type is wrong, the SQL statements using the function would fail with errors. The input data type and output data type must be consistent with the UDF definition. - Create Scalar Function ```sql -CREATE FUNCTION function_name AS library_path OUTPUTTYPE output_type; +CREATE [OR REPLACE] FUNCTION function_name AS library_path OUTPUTTYPE output_type [LANGUAGE 'C|Python']; ``` - - - function_name: The scalar function name to be used in SQL statement which must be consistent with the UDF name and is also the name of the compiled DLL (.so file). - - library_path: The absolute path of the DLL file including the name of the shared object file (.so). The path must be quoted with single or double quotes. + - OR REPLACE: if the UDF exists, the UDF properties are modified + - function_name: The scalar function name to be used in the SQL statement + - LANGUAGE 'C|Python': the programming language of UDF. Now C or Python is supported. If this clause is omitted, C is assumed as the programming language. + - library_path: For C programming language, The absolute path of the DLL file including the name of the shared object file (.so). For Python programming language, the absolute path of the Python UDF script. The path must be quoted with single or double quotes. - output_type: The data type of the results of the UDF. For example, the following SQL statement can be used to create a UDF from `libbitand.so`. @@ -25,14 +26,20 @@ CREATE FUNCTION function_name AS library_path OUTPUTTYPE output_type; ```sql CREATE FUNCTION bit_and AS "/home/taos/udf_example/libbitand.so" OUTPUTTYPE INT; ``` + For Example, the following SQL statement can be used to modify the existing function `bit_and`. The OUTPUT type is changed to BIGINT and the programming language is changed to Python. + + ```sql + CREATE OR REPLACE FUNCTION bit_and AS "/home/taos/udf_example/bit_and.py" OUTPUTTYPE BIGINT LANGUAGE 'Python'; + ``` - Create Aggregate Function ```sql CREATE AGGREGATE FUNCTION function_name AS library_path OUTPUTTYPE output_type [ BUFSIZE buffer_size ]; ``` - - - function_name: The aggregate function name to be used in SQL statement which must be consistent with the udfNormalFunc name and is also the name of the compiled DLL (.so file). - - library_path: The absolute path of the DLL file including the name of the shared object file (.so). The path must be quoted with single or double quotes. + - OR REPLACE: if the UDF exists, the UDF properties are modified + - function_name: The aggregate function name to be used in the SQL statement + - LANGUAGE 'C|Python': the programming language of the UDF. Now C or Python is supported. If this clause is omitted, C is assumed as the programming language. + - library_path: For C programming language, The absolute path of the DLL file including the name of the shared object file (.so). For Python programming language, the absolute path of the Python UDF script. The path must be quoted with single or double quotes. - output_type: The output data type, the value is the literal string of the supported TDengine data type. - buffer_size: The size of the intermediate buffer in bytes. This parameter is optional. @@ -41,6 +48,11 @@ 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; ``` + For example, the following SQL statement modifies the buffer size of existing UDF `l2norm` to 64 + ```sql + CREATE AGGREGATE FUNCTION l2norm AS "/home/taos/udf_example/libl2norm.so" OUTPUTTYPE DOUBLE bufsize 64; + ``` + For more information about user-defined functions, see [User-Defined Functions](/develop/udf). ## Manage UDF @@ -61,9 +73,9 @@ SHOW FUNCTIONS; ## Call UDF -The function name specified when creating UDF can be used directly in SQL statements, just like builtin functions. For example: +The function name specified when creating UDF can be used directly in SQL statements, just like built-in functions. For example: ```sql SELECT bit_and(c1,c2) FROM table; ``` -The above SQL statement invokes function X for column c1 and c2 on table. You can use query keywords like WHERE with user-defined functions. +The above SQL statement invokes function X for columns c1 and c2 on the table. You can use query keywords like WHERE with user-defined functions. diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx index 2847bf20f8..b878d47a1c 100644 --- a/docs/en/14-reference/03-connector/04-java.mdx +++ b/docs/en/14-reference/03-connector/04-java.mdx @@ -36,6 +36,104 @@ REST connection supports all platforms that can run Java. Please refer to [version support list](/reference/connector#version-support) +## Recent update logs + +| taos-jdbcdriver version | major changes | +| :---------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------: | +| 3.2.1 | JDBC REST connection supports schemaless/prepareStatement over WebSocket | +| 3.2.0 | This version has been deprecated | +| 3.1.0 | JDBC REST connection supports subscription over WebSocket | +| 3.0.1 - 3.0.4 | fix the resultSet data is parsed incorrectly sometimes. 3.0.1 is compiled on JDK 11, you are advised to use other version in the JDK 8 environment | +| 3.0.0 | Support for TDengine 3.0 | +| 2.0.42 | fix wasNull interface return value in WebSocket connection | +| 2.0.41 | fix decode method of username and password in REST connection | +| 2.0.39 - 2.0.40 | Add REST connection/request timeout parameters | +| 2.0.38 | JDBC REST connections add bulk pull function | +| 2.0.37 | Support json tags | +| 2.0.36 | Support schemaless writing | + +**Note**: adding `batchfetch` to the REST connection and setting it to true will enable the WebSocket connection. + +### Handling exceptions + +After an error is reported, the error message and error code can be obtained through SQLException. + +```java +try (Statement statement = connection.createStatement()) { + // executeQuery + ResultSet resultSet = statement.executeQuery(sql); + // print result + printResult(resultSet); +} catch (SQLException e) { + System.out.println("ERROR Message: " + e.getMessage()); + System.out.println("ERROR Code: " + e.getErrorCode()); + e.printStackTrace(); +} +``` + +There are four types of error codes that the JDBC connector can report: + +- Error code of the JDBC driver itself (error code between 0x2301 and 0x2350), +- Error code of the native connection method (error code between 0x2351 and 0x2360) +- Error code of the consumer method (error code between 0x2371 and 0x2380) +- Error code of other TDengine function modules. + +For specific error codes, please refer to. + +| Error Code | Description | Suggested Actions | +| ---------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| 0x2301 | connection already closed | The connection has been closed, check the connection status, or recreate the connection to execute the relevant instructions. | +| 0x2302 | this operation is NOT supported currently! | The current interface does not support the connection. You can use another connection mode. | +| 0x2303 | invalid variables | The parameter is invalid. Check the interface specification and adjust the parameter type and size. | +| 0x2304 | statement is closed | The statement is closed. Check whether the statement is closed and used again, or whether the connection is normal. | +| 0x2305 | resultSet is closed | result set The result set is released. Check whether the result set is released and used again. | +| 0x2306 | Batch is empty! | prepare statement Add parameters and then execute batch. | +| 0x2307 | Can not issue data manipulation statements with executeQuery() | The update operation should use execute update(), not execute query(). | +| 0x2308 | Can not issue SELECT via executeUpdate() | The query operation should use execute query(), not execute update(). | +| 0x2309 | invalid sql for executeQuery: (?) | - | +| 0x230a | Database not specified or available | - | +| 0x230b | invalid sql for executeUpdate: (?) | - | +| 0x230c | invalid sql for execute: (?) | - | +| 0x230d | parameter index out of range | The parameter is out of bounds. Check the proper range of the parameter. | +| 0x230e | connection already closed | The connection has been closed. Please check whether the connection is closed and used again, or whether the connection is normal. | +| 0x230f | unknown sql type in tdengine | Check the data type supported by TDengine. | +| 0x2310 | can't register JDBC-JNI driver | The native driver cannot be registered. Please check whether the url is correct. | +| 0x2311 | can't register JDBC-RESTful driver | - | +| 0x2312 | url is not set | Check whether the REST connection url is correct. | +| 0x2313 | invalid sql | - | +| 0x2314 | numeric value out of range | Check that the correct interface is used for the numeric types in the obtained result set. | +| 0x2315 | unknown taos type in tdengine | Whether the correct TDengine data type is specified when converting the TDengine data type to the JDBC data type. | +| 0x2316 | unknown timestamp precision | - | +| 0x2317 | | wrong request type was used in the REST connection. | +| 0x2318 | | data transmission exception occurred during the REST connection. Please check the network status and try again. | +| 0x2319 | user is required | The user name information is missing when creating the connection | +| 0x231a | password is required | Password information is missing when creating a connection | +| 0x231b | invalid json format | - | +| 0x231c | httpEntity is null, sql: | Execution exception occurred during the REST connection | +| 0x2350 | unknown error | Unknown exception, please return to the developer on github. | +| 0x2351 | failed to create subscription | - | +| 0x2352 | Unsupported encoding | An unsupported character encoding set is specified under the native Connection. | +| 0x2353 | internal error of database, please see taoslog for more details | An error occurs when the prepare statement is executed on the native connection. Check the taos log to locate the fault. | +| 0x2354 | JNI connection is NULL | When the command is executed, the native Connection is closed. Check the connection to TDengine. | +| 0x2355 | JNI result set is NULL | The result set is abnormal. Please check the connection status and try again. | +| 0x2356 | invalid num of fields | The meta information of the result set obtained by the native connection does not match. | +| 0x2357 | empty sql string | Fill in the correct SQL for execution. | +| 0x2358 | fetch to the end of resultSet | - | +| 0x2359 | JNI alloc memory failed, please see taoslog for more details | Memory allocation for the native connection failed. Check the taos log to locate the problem. | +| 0x2371 | consumer properties must not be null! | The parameter is empty when you create a subscription. Please fill in the correct parameter. | +| 0x2372 | configs contain empty key, failed to set consumer property | The parameter key contains a null value. Please enter the correct parameter. | +| 0x2373 | failed to set consumer property, | The parameter value contains a null value. Please enter the correct parameter. | +| 0x2374 | consumer config error | - | +| 0x2375 | topic reference has been destroyed | The topic reference is released during the creation of the data subscription. Check the connection to TDengine. | +| 0x2376 | failed to set consumer topic, topic name is empty | During data subscription creation, the subscription topic name is empty. Check that the specified topic name is correct. | +| 0x2377 | consumer reference has been destroyed | The subscription data transfer channel has been closed. Please check the connection to TDengine. | +| 0x2378 | consumer create error | Failed to create a data subscription. Check the taos log according to the error message to locate the fault. | +| - | can't create connection with server within: | Increase the connection time by adding the httpConnectTimeout parameter, or check the connection to the taos adapter. | +| - | failed to complete the task within the specified time : | Increase the execution time by adding the messageWaitTimeout parameter, or check the connection to the taos adapter. | + +- [TDengine Java Connector](https://github.com/taosdata/taos-connector-jdbc/blob/main/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java) + + ## TDengine DataType vs. Java DataType TDengine currently supports timestamp, number, character, Boolean type, and the corresponding type conversion with Java is as follows: @@ -82,7 +180,7 @@ Add following dependency in the `pom.xml` file of your Maven project: com.taosdata.jdbc taos-jdbcdriver - 3.1.0 + 3.2.1 ``` @@ -97,7 +195,7 @@ cd taos-connector-jdbc mvn clean install -Dmaven.test.skip=true ``` -After you have compiled taos-jdbcdriver, the `taos-jdbcdriver-3.0.*-dist.jar` file is created in the target directory. The compiled JAR file is automatically stored in your local Maven repository. +After you have compiled taos-jdbcdriver, the `taos-jdbcdriver-3.2.*-dist.jar` file is created in the target directory. The compiled JAR file is automatically stored in your local Maven repository. @@ -333,35 +431,6 @@ while(resultSet.next()){ > The query is consistent with operating a relational database. When using subscripts to get the contents of the returned fields, you have to start from 1. However, we recommend using the field names to get the values of the fields in the result set. -### Handling exceptions - -After an error is reported, the error message and error code can be obtained through SQLException. - -```java -try (Statement statement = connection.createStatement()) { - // executeQuery - ResultSet resultSet = statement.executeQuery(sql); - // print result - printResult(resultSet); -} catch (SQLException e) { - System.out.println("ERROR Message: " + e.getMessage()); - System.out.println("ERROR Code: " + e.getErrorCode()); - e.printStackTrace(); -} -``` - -There are four types of error codes that the JDBC connector can report: - -- Error code of the JDBC driver itself (error code between 0x2301 and 0x2350), -- Error code of the native connection method (error code between 0x2351 and 0x2360) -- Error code of the consumer method (error code between 0x2371 and 0x2380) -- Error code of other TDengine function modules. - -For specific error codes, please refer to. - -- [TDengine Java Connector](https://github.com/taosdata/taos-connector-jdbc/blob/main/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java) - - ### Writing data via parameter binding TDengine has significantly improved the bind APIs to support data writing (INSERT) scenarios. Writing data in this way avoids the resource consumption of SQL syntax parsing, resulting in significant write performance improvements in many cases. @@ -369,9 +438,12 @@ TDengine has significantly improved the bind APIs to support data writing (INSER **Note:** - JDBC REST connections do not currently support bind interface -- The following sample code is based on taos-jdbcdriver-3.1.0 +- The following sample code is based on taos-jdbcdriver-3.2.1 - The setString method should be called for binary type data, and the setNString method should be called for nchar type data -- both setString and setNString require the user to declare the width of the corresponding column in the size parameter of the table definition +- Do not use `db.?` in prepareStatement when specify the database with the table name, should directly use `?`, then specify the database in setTableName, for example: `prepareStatement.setTableName("db.t1")`. + + + ```java public class ParameterBindingDemo { @@ -599,21 +671,7 @@ public class ParameterBindingDemo { } ``` -The methods to set TAGS values: - -```java -public void setTagNull(int index, int type) -public void setTagBoolean(int index, boolean value) -public void setTagInt(int index, int value) -public void setTagByte(int index, byte value) -public void setTagShort(int index, short value) -public void setTagLong(int index, long value) -public void setTagTimestamp(int index, long value) -public void setTagFloat(int index, float value) -public void setTagDouble(int index, double value) -public void setTagString(int index, String value) -public void setTagNString(int index, String value) -``` +**Note**: both setString and setNString require the user to declare the width of the corresponding column in the size parameter of the table definition The methods to set VALUES columns: @@ -630,17 +688,203 @@ public void setString(int columnIndex, ArrayList list, int size) throws public void setNString(int columnIndex, ArrayList list, int size) throws SQLException ``` + + + +```java +public class ParameterBindingDemo { + private static final String host = "127.0.0.1"; + private static final Random random = new Random(System.currentTimeMillis()); + private static final int BINARY_COLUMN_SIZE = 30; + private static final String[] schemaList = { + "create table stable1(ts timestamp, f1 tinyint, f2 smallint, f3 int, f4 bigint) tags(t1 tinyint, t2 smallint, t3 int, t4 bigint)", + "create table stable2(ts timestamp, f1 float, f2 double) tags(t1 float, t2 double)", + "create table stable3(ts timestamp, f1 bool) tags(t1 bool)", + "create table stable4(ts timestamp, f1 binary(" + BINARY_COLUMN_SIZE + ")) tags(t1 binary(" + BINARY_COLUMN_SIZE + "))", + "create table stable5(ts timestamp, f1 nchar(" + BINARY_COLUMN_SIZE + ")) tags(t1 nchar(" + BINARY_COLUMN_SIZE + "))" + }; + private static final int numOfSubTable = 10, numOfRow = 10; + + public static void main(String[] args) throws SQLException { + + String jdbcUrl = "jdbc:TAOS-RS://" + host + ":6041/?batchfetch=true"; + Connection conn = DriverManager.getConnection(jdbcUrl, "root", "taosdata"); + + init(conn); + + bindInteger(conn); + + bindFloat(conn); + + bindBoolean(conn); + + bindBytes(conn); + + bindString(conn); + + conn.close(); + } + + private static void init(Connection conn) throws SQLException { + try (Statement stmt = conn.createStatement()) { + stmt.execute("drop database if exists test_ws_parabind"); + stmt.execute("create database if not exists test_ws_parabind"); + stmt.execute("use test_ws_parabind"); + for (int i = 0; i < schemaList.length; i++) { + stmt.execute(schemaList[i]); + } + } + } + + private static void bindInteger(Connection conn) throws SQLException { + String sql = "insert into ? using stable1 tags(?,?,?,?) values(?,?,?,?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t1_" + i); + // set tags + pstmt.setTagByte(1, Byte.parseByte(Integer.toString(random.nextInt(Byte.MAX_VALUE)))); + pstmt.setTagShort(2, Short.parseShort(Integer.toString(random.nextInt(Short.MAX_VALUE)))); + pstmt.setTagInt(3, random.nextInt(Integer.MAX_VALUE)); + pstmt.setTagLong(4, random.nextLong()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setByte(2, Byte.parseByte(Integer.toString(random.nextInt(Byte.MAX_VALUE)))); + pstmt.setShort(3, Short.parseShort(Integer.toString(random.nextInt(Short.MAX_VALUE)))); + pstmt.setInt(4, random.nextInt(Integer.MAX_VALUE)); + pstmt.setLong(5, random.nextLong()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindFloat(Connection conn) throws SQLException { + String sql = "insert into ? using stable2 tags(?,?) values(?,?,?)"; + + try(TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t2_" + i); + // set tags + pstmt.setTagFloat(1, random.nextFloat()); + pstmt.setTagDouble(2, random.nextDouble()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setFloat(2, random.nextFloat()); + pstmt.setDouble(3, random.nextDouble()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindBoolean(Connection conn) throws SQLException { + String sql = "insert into ? using stable3 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t3_" + i); + // set tags + pstmt.setTagBoolean(1, random.nextBoolean()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setBoolean(2, random.nextBoolean()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindBytes(Connection conn) throws SQLException { + String sql = "insert into ? using stable4 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t4_" + i); + // set tags + pstmt.setTagString(1, new String("abc")); + + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setString(2, "abc"); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindString(Connection conn) throws SQLException { + String sql = "insert into ? using stable5 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t5_" + i); + // set tags + pstmt.setTagNString(1, "California.SanFrancisco"); + + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(0, new Timestamp(current + j)); + pstmt.setNString(1, "California.SanFrancisco"); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } +} +``` + + + + +The methods to set TAGS values: + +```java +public void setTagNull(int index, int type) +public void setTagBoolean(int index, boolean value) +public void setTagInt(int index, int value) +public void setTagByte(int index, byte value) +public void setTagShort(int index, short value) +public void setTagLong(int index, long value) +public void setTagTimestamp(int index, long value) +public void setTagFloat(int index, float value) +public void setTagDouble(int index, double value) +public void setTagString(int index, String value) +public void setTagNString(int index, String value) +``` + ### Schemaless Writing TDengine supports schemaless writing. It is compatible with InfluxDB's Line Protocol, OpenTSDB's telnet line protocol, and OpenTSDB's JSON format protocol. For more information, see [Schemaless Writing](../../schemaless). -Note: - -- JDBC REST connections do not currently support schemaless writes -- The following sample code is based on taos-jdbcdriver-3.1.0 + + ```java -public class SchemalessInsertTest { +public class SchemalessJniTest { private static final String host = "127.0.0.1"; private static final String lineDemo = "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; private static final String telnetDemo = "stb0_0 1626006833 4 host=host0 interface=eth0"; @@ -668,6 +912,41 @@ public class SchemalessInsertTest { } ``` + + + +```java +public class SchemalessWsTest { + private static final String host = "127.0.0.1"; + private static final String lineDemo = "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + private static final String telnetDemo = "stb0_0 1626006833 4 host=host0 interface=eth0"; + private static final String jsonDemo = "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + + public static void main(String[] args) throws SQLException { + final String url = "jdbc:TAOS-RS://" + host + ":6041/?user=root&password=taosdata&batchfetch=true"; + Connection connection = DriverManager.getConnection(url); + init(connection); + + SchemalessWriter writer = new SchemalessWriter(connection, "test_ws_schemaless"); + writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS); + writer.write(telnetDemo, SchemalessProtocolType.TELNET, SchemalessTimestampType.MILLI_SECONDS); + writer.write(jsonDemo, SchemalessProtocolType.JSON, SchemalessTimestampType.SECONDS); + System.exit(0); + } + + private static void init(Connection connection) throws SQLException { + try (Statement stmt = connection.createStatement()) { + stmt.executeUpdate("drop database if exists test_ws_schemaless"); + stmt.executeUpdate("create database if not exists test_ws_schemaless keep 36500"); + stmt.executeUpdate("use test_ws_schemaless"); + } + } +} +``` + + + + ### Data Subscription The TDengine Java Connector supports subscription functionality with the following application API. @@ -711,8 +990,9 @@ TaosConsumer consumer = new TaosConsumer<>(config); ```java while(true) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } ``` @@ -765,8 +1045,9 @@ public abstract class ConsumerLoop { while (!shutdown.get()) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } consumer.unsubscribe(); @@ -841,8 +1122,9 @@ public abstract class ConsumerLoop { while (!shutdown.get()) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } consumer.unsubscribe(); @@ -968,20 +1250,6 @@ The source code of the sample application is under `TDengine/examples/JDBC`: [JDBC example](https://github.com/taosdata/TDengine/tree/3.0/examples/JDBC) -## Recent update logs - -| taos-jdbcdriver version | major changes | -| :---------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------: | -| 3.1.0 | JDBC REST connection supports subscription over WebSocket | -| 3.0.1 - 3.0.4 | fix the resultSet data is parsed incorrectly sometimes. 3.0.1 is compiled on JDK 11, you are advised to use other version in the JDK 8 environment | -| 3.0.0 | Support for TDengine 3.0 | -| 2.0.42 | fix wasNull interface return value in WebSocket connection | -| 2.0.41 | fix decode method of username and password in REST connection | -| 2.0.39 - 2.0.40 | Add REST connection/request timeout parameters | -| 2.0.38 | JDBC REST connections add bulk pull function | -| 2.0.37 | Support json tags | -| 2.0.36 | Support schemaless writing | - ## Frequently Asked Questions 1. Why is there no performance improvement when using Statement's `addBatch()` and `executeBatch()` to perform `batch data writing/update`? diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index ad522e9d2b..597a9b0f52 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -11,6 +11,7 @@ import TabItem from '@theme/TabItem'; import Preparition from "./_preparation.mdx" import RustInsert from "../../07-develop/03-insert-data/_rust_sql.mdx" import RustBind from "../../07-develop/03-insert-data/_rust_stmt.mdx" +import RustSml from "../../07-develop/03-insert-data/_rust_schemaless.mdx" import RustQuery from "../../07-develop/04-query-data/_rust.mdx" [![Crates.io](https://img.shields.io/crates/v/taos)](https://crates.io/crates/taos) ![Crates.io](https://img.shields.io/crates/d/taos) [![docs.rs](https://img.shields.io/docsrs/taos)](https://docs.rs/taos) @@ -232,6 +233,10 @@ There are two ways to query data: Using built-in types or the [serde](https://se +#### Schemaless Write + + + ### Query data diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md index dcfc068a3d..7348add4bd 100644 --- a/docs/en/14-reference/06-taosdump.md +++ b/docs/en/14-reference/06-taosdump.md @@ -76,6 +76,7 @@ Usage: taosdump [OPTION...] dbname [tbname ...] -A, --all-databases Dump all databases. -D, --databases=DATABASES Dump listed databases. Use comma to separate database names. + -e, --escape-character Use escaped character for database name -N, --without-property Dump database without its properties. -s, --schemaonly Only dump table schemas. -y, --answer-yes Input yes for prompt. It will skip data file diff --git a/docs/en/14-reference/07-tdinsight/index.md b/docs/en/14-reference/07-tdinsight/index.md index 652d5ded0b..8d97dafa7c 100644 --- a/docs/en/14-reference/07-tdinsight/index.md +++ b/docs/en/14-reference/07-tdinsight/index.md @@ -12,8 +12,8 @@ After TDengine starts, it automatically writes many metrics in specific interval To deploy TDinsight, we need - a single-node TDengine server or a multi-node TDengine cluster and a [Grafana] server are required. This dashboard requires TDengine 3.0.1.0 and above, with the monitoring feature enabled. For detailed configuration, please refer to [TDengine monitoring configuration](../config/#monitoring-parameters). -- taosAdapter has been instaleld and running, please refer to [taosAdapter](../taosadapter). -- taosKeeper has been installed and running, please refer to [taosKeeper](../taoskeeper). +- taosAdapter has been installed and running, please refer to [taosAdapter](../taosadapter). +- taosKeeper has been installed and running, please refer to [taosKeeper](../taosKeeper). Please record - The endpoint of taosAdapter REST service, for example `http://tdengine.local:6041` diff --git a/docs/en/25-application/01-telegraf.md b/docs/en/25-application/01-telegraf.md index b84b30bb71..1e3325b2b2 100644 --- a/docs/en/25-application/01-telegraf.md +++ b/docs/en/25-application/01-telegraf.md @@ -35,7 +35,7 @@ Please refer to the [official documentation](https://grafana.com/grafana/downloa ### TDengine -Download the latest TDengine-server from the [Downloads](http://tdengine.com/en/all-downloads/) page on the TAOSData website and install it. +Download and install the [latest version of TDengine](https://docs.tdengine.com/releases/tdengine/). ## Data Connection Setup diff --git a/docs/en/25-application/02-collectd.md b/docs/en/25-application/02-collectd.md index 6ac7253fc4..ee1e944928 100644 --- a/docs/en/25-application/02-collectd.md +++ b/docs/en/25-application/02-collectd.md @@ -38,7 +38,7 @@ Please refer to the [official documentation](https://grafana.com/grafana/downloa ### Install TDengine -Download the latest TDengine-server from the [Downloads](http://tdengine.com/en/all-downloads/) page on the TAOSData website and install it. +Download and install the [latest version of TDengine](https://docs.tdengine.com/releases/tdengine/). ## Data Connection Setup diff --git a/docs/en/27-train-faq/01-faq.md b/docs/en/27-train-faq/01-faq.md index 9e7f4f8e0d..aa28303f5d 100644 --- a/docs/en/27-train-faq/01-faq.md +++ b/docs/en/27-train-faq/01-faq.md @@ -32,7 +32,7 @@ TDengine 3.0 is not compatible with the configuration and data files from previo 2. Run `sudo rm -rf /var/log/taos/` to delete your log files. 3. Run `sudo rm -rf /var/lib/taos/` to delete your data files. 4. Install TDengine 3.0. -5. For assistance in migrating data to TDengine 3.0, contact [TDengine Support](https://tdengine.com/support). +5. For assistance in migrating data to TDengine 3.0, contact [TDengine Support](https://tdengine.com/support/). ### 2. How can I resolve the "Unable to establish connection" error? diff --git a/docs/examples/c/async_query_example.c b/docs/examples/c/async_query_example.c index b370420b12..3807c4bfd7 100644 --- a/docs/examples/c/async_query_example.c +++ b/docs/examples/c/async_query_example.c @@ -8,7 +8,7 @@ #include #include -typedef int16_t VarDataLenT; +typedef uint16_t VarDataLenT; #define TSDB_NCHAR_SIZE sizeof(int32_t) #define VARSTR_HEADER_SIZE sizeof(VarDataLenT) diff --git a/docs/examples/c/query_example.c b/docs/examples/c/query_example.c index fcae95bcd4..c7d52115b5 100644 --- a/docs/examples/c/query_example.c +++ b/docs/examples/c/query_example.c @@ -6,7 +6,7 @@ #include #include -typedef int16_t VarDataLenT; +typedef uint16_t VarDataLenT; #define TSDB_NCHAR_SIZE sizeof(int32_t) #define VARSTR_HEADER_SIZE sizeof(VarDataLenT) diff --git a/docs/examples/java/pom.xml b/docs/examples/java/pom.xml index 01d0ce936c..4bdb2062b2 100644 --- a/docs/examples/java/pom.xml +++ b/docs/examples/java/pom.xml @@ -22,7 +22,7 @@ com.taosdata.jdbc taos-jdbcdriver - 3.1.0 + 3.2.1 diff --git a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java index 8da6f77bae..b5cdedc34f 100644 --- a/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java +++ b/docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java @@ -1,5 +1,6 @@ package com.taos.example; +import com.taosdata.jdbc.tmq.ConsumerRecord; import com.taosdata.jdbc.tmq.ConsumerRecords; import com.taosdata.jdbc.tmq.TMQConstants; import com.taosdata.jdbc.tmq.TaosConsumer; @@ -64,7 +65,8 @@ public class SubscribeDemo { consumer.subscribe(Collections.singletonList(TOPIC)); while (!shutdown.get()) { ConsumerRecords meters = consumer.poll(Duration.ofMillis(100)); - for (Meters meter : meters) { + for (ConsumerRecord recode : meters) { + Meters meter = recode.value(); System.out.println(meter); } } diff --git a/docs/examples/rust/nativeexample/examples/schemaless_insert_json.rs b/docs/examples/rust/nativeexample/examples/schemaless_insert_json.rs new file mode 100644 index 0000000000..d5aa45016e --- /dev/null +++ b/docs/examples/rust/nativeexample/examples/schemaless_insert_json.rs @@ -0,0 +1,74 @@ +use taos_query::common::SchemalessPrecision; +use taos_query::common::SchemalessProtocol; +use taos_query::common::SmlDataBuilder; + +use crate::AsyncQueryable; +use crate::AsyncTBuilder; +use crate::TaosBuilder; + +async fn put_json() -> anyhow::Result<()> { + // std::env::set_var("RUST_LOG", "taos=trace"); + std::env::set_var("RUST_LOG", "taos=debug"); + pretty_env_logger::init(); + let dsn = + std::env::var("TDENGINE_ClOUD_DSN").unwrap_or("http://localhost:6041".to_string()); + log::debug!("dsn: {:?}", &dsn); + + let client = TaosBuilder::from_dsn(dsn)?.build().await?; + + let db = "demo_schemaless_ws"; + + client.exec(format!("drop database if exists {db}")).await?; + + client + .exec(format!("create database if not exists {db}")) + .await?; + + // should specify database before insert + client.exec(format!("use {db}")).await?; + + // SchemalessProtocol::Json + let data = [ + r#"[{"metric": "meters.current", "timestamp": 1681345954000, "value": 10.3, "tags": {"location": "California.SanFrancisco", "groupid": 2}}, {"metric": "meters.voltage", "timestamp": 1648432611249, "value": 219, "tags": {"location": "California.LosAngeles", "groupid": 1}}, {"metric": "meters.current", "timestamp": 1648432611250, "value": 12.6, "tags": {"location": "California.SanFrancisco", "groupid": 2}}, {"metric": "meters.voltage", "timestamp": 1648432611250, "value": 221, "tags": {"location": "California.LosAngeles", "groupid": 1}}]"# + ] + .map(String::from) + .to_vec(); + + // demo with all fields + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Json) + .precision(SchemalessPrecision::Millisecond) + .data(data.clone()) + .ttl(1000) + .req_id(300u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default precision + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Json) + .data(data.clone()) + .ttl(1000) + .req_id(301u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default ttl + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Json) + .data(data.clone()) + .req_id(302u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default req_id + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Json) + .data(data.clone()) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + client.exec(format!("drop database if exists {db}")).await?; + + Ok(()) +} diff --git a/docs/examples/rust/nativeexample/examples/schemaless_insert_line.rs b/docs/examples/rust/nativeexample/examples/schemaless_insert_line.rs new file mode 100644 index 0000000000..3cf4d969ce --- /dev/null +++ b/docs/examples/rust/nativeexample/examples/schemaless_insert_line.rs @@ -0,0 +1,78 @@ +use taos_query::common::SchemalessPrecision; +use taos_query::common::SchemalessProtocol; +use taos_query::common::SmlDataBuilder; + +use crate::AsyncQueryable; +use crate::AsyncTBuilder; +use crate::TaosBuilder; + +async fn put_line() -> anyhow::Result<()> { + // std::env::set_var("RUST_LOG", "taos=trace"); + std::env::set_var("RUST_LOG", "taos=debug"); + pretty_env_logger::init(); + + let dsn = + std::env::var("TDENGINE_ClOUD_DSN").unwrap_or("http://localhost:6041".to_string()); + log::debug!("dsn: {:?}", &dsn); + + let client = TaosBuilder::from_dsn(dsn)?.build().await?; + + let db = "demo_schemaless_ws"; + + client.exec(format!("drop database if exists {db}")).await?; + + client + .exec(format!("create database if not exists {db}")) + .await?; + + // should specify database before insert + client.exec(format!("use {db}")).await?; + + let data = [ + "measurement,host=host1 field1=2i,field2=2.0 1577837300000", + "measurement,host=host1 field1=2i,field2=2.0 1577837400000", + "measurement,host=host1 field1=2i,field2=2.0 1577837500000", + "measurement,host=host1 field1=2i,field2=2.0 1577837600000", + ] + .map(String::from) + .to_vec(); + + // demo with all fields + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Line) + .precision(SchemalessPrecision::Millisecond) + .data(data.clone()) + .ttl(1000) + .req_id(100u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default ttl + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Line) + .precision(SchemalessPrecision::Millisecond) + .data(data.clone()) + .req_id(101u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default ttl and req_id + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Line) + .precision(SchemalessPrecision::Millisecond) + .data(data.clone()) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default precision + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Line) + .data(data) + .req_id(103u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + client.exec(format!("drop database if exists {db}")).await?; + + Ok(()) +} diff --git a/docs/examples/rust/nativeexample/examples/schemaless_insert_telnet.rs b/docs/examples/rust/nativeexample/examples/schemaless_insert_telnet.rs new file mode 100644 index 0000000000..d2bbc69261 --- /dev/null +++ b/docs/examples/rust/nativeexample/examples/schemaless_insert_telnet.rs @@ -0,0 +1,80 @@ +use taos_query::common::SchemalessPrecision; +use taos_query::common::SchemalessProtocol; +use taos_query::common::SmlDataBuilder; + +use crate::AsyncQueryable; +use crate::AsyncTBuilder; +use crate::TaosBuilder; + +async fn put_telnet() -> anyhow::Result<()> { + // std::env::set_var("RUST_LOG", "taos=trace"); + std::env::set_var("RUST_LOG", "taos=debug"); + pretty_env_logger::init(); + let dsn = + std::env::var("TDENGINE_ClOUD_DSN").unwrap_or("http://localhost:6041".to_string()); + log::debug!("dsn: {:?}", &dsn); + + let client = TaosBuilder::from_dsn(dsn)?.build().await?; + + let db = "demo_schemaless_ws"; + + client.exec(format!("drop database if exists {db}")).await?; + + client + .exec(format!("create database if not exists {db}")) + .await?; + + // should specify database before insert + client.exec(format!("use {db}")).await?; + + let data = [ + "meters.current 1648432611249 10.3 location=California.SanFrancisco group=2", + "meters.current 1648432611250 12.6 location=California.SanFrancisco group=2", + "meters.current 1648432611249 10.8 location=California.LosAngeles group=3", + "meters.current 1648432611250 11.3 location=California.LosAngeles group=3", + "meters.voltage 1648432611249 219 location=California.SanFrancisco group=2", + "meters.voltage 1648432611250 218 location=California.SanFrancisco group=2", + "meters.voltage 1648432611249 221 location=California.LosAngeles group=3", + "meters.voltage 1648432611250 217 location=California.LosAngeles group=3", + ] + .map(String::from) + .to_vec(); + + // demo with all fields + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Telnet) + .precision(SchemalessPrecision::Millisecond) + .data(data.clone()) + .ttl(1000) + .req_id(200u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default precision + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Telnet) + .data(data.clone()) + .ttl(1000) + .req_id(201u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default ttl + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Telnet) + .data(data.clone()) + .req_id(202u64) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + // demo with default req_id + let sml_data = SmlDataBuilder::default() + .protocol(SchemalessProtocol::Telnet) + .data(data.clone()) + .build()?; + assert_eq!(client.put(&sml_data).await?, ()); + + client.exec(format!("drop database if exists {db}")).await?; + + Ok(()) +} diff --git a/docs/examples/rust/nativeexample/examples/subscribe_demo.rs b/docs/examples/rust/nativeexample/examples/subscribe_demo.rs index 7551ad46b1..d54bb60e93 100644 --- a/docs/examples/rust/nativeexample/examples/subscribe_demo.rs +++ b/docs/examples/rust/nativeexample/examples/subscribe_demo.rs @@ -45,7 +45,7 @@ async fn main() -> anyhow::Result<()> { taos.exec_many([ format!("DROP TOPIC IF EXISTS tmq_meters"), format!("DROP DATABASE IF EXISTS `{db}`"), - format!("CREATE DATABASE `{db}`"), + format!("CREATE DATABASE `{db}` WAL_RETENTION_PERIOD 3600"), format!("USE `{db}`"), // create super table format!("CREATE TABLE `meters` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT, `phase` FLOAT) TAGS (`groupid` INT, `location` BINARY(24))"), diff --git a/docs/zh/05-get-started/03-package.md b/docs/zh/05-get-started/03-package.md index b327d33350..1cd0076ba5 100644 --- a/docs/zh/05-get-started/03-package.md +++ b/docs/zh/05-get-started/03-package.md @@ -207,6 +207,8 @@ Active: inactive (dead) - 查看服务状态:`sudo launchctl list | grep taosd` +- 查看服务详细信息:`launchctl print system/com.tdengine.taosd` + :::info - `launchctl` 命令管理`com.tdengine.taosd`需要管理员权限,务必在前面加 `sudo` 来增强安全性。 diff --git a/docs/zh/07-develop/03-insert-data/_rust_schemaless.mdx b/docs/zh/07-develop/03-insert-data/_rust_schemaless.mdx new file mode 100644 index 0000000000..a26613bd15 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_schemaless.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/nativeexample/examples/schemaless_insert_line.rs}} +``` diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx index a3833438a2..11aef1f7e8 100644 --- a/docs/zh/07-develop/07-tmq.mdx +++ b/docs/zh/07-develop/07-tmq.mdx @@ -25,7 +25,8 @@ import CDemo from "./_sub_c.mdx"; 本文档不对消息队列本身的基础知识做介绍,如果需要了解,请自行搜索。 -注意:默认是从wal消费数据,如果wal被删除,消费到的数据会不全,此时可以将参数 experimental.snapshot.enable 设置为true,从tsdb获取全部数据,但是这样的话就不能保证数据的消费顺序。所以建议根据自己的消费情况合理的设置wal的保留策略,保证可以从wal里订阅到全部数据。 +注意:数据订阅是从 WAL 消费数据,如果一些 WAL 文件被基于 WAL 保留策略删除,则已经删除的 WAL 文件中的数据就无法再消费到。需要根据业务需要在创建数据库时合理设置 `WAL_RETENTION_PERIOD` 或 `WAL_RETENTION_SIZE` ,并确保应用及时消费数据,这样才不会产生数据丢失的现象。数据订阅的行为与 Kafka 等广泛使用的消息队列类产品的行为相似。 + ## 主要数据结构和 API 不同语言下, TMQ 订阅相关的 API 及数据结构如下: @@ -293,7 +294,6 @@ CREATE TOPIC topic_name AS DATABASE db_name; | `auto.offset.reset` | enum | 消费组订阅的初始位置 |
`earliest`: default;从头开始订阅;
`latest`: 仅从最新数据开始订阅;
`none`: 没有提交的 offset 无法订阅 | | `enable.auto.commit` | boolean | 是否启用消费位点自动提交,true: 自动提交,客户端应用无需commit;false:客户端应用需要自行commit | 默认值为 true | | `auto.commit.interval.ms` | integer | 消费记录自动提交消费位点时间间隔,单位为毫秒 | 默认值为 5000 | -| `experimental.snapshot.enable` | boolean | 是否允许从 TSDB 消费数据。当其关闭时,只能消费依据 WAL 保留策略仍然在WAL中的数据;当其打开时,除WAL中的数据以外,也能够消费已经从WAL中删除但落盘到TSDB中的数据 | 实验功能,默认关闭 | | `msg.with.table.name` | boolean | 是否允许从消息中解析表名, 不适用于列订阅(列订阅时可将 tbname 作为列写入 subquery 语句) |默认关闭 | 对于不同编程语言,其设置方式如下: @@ -311,7 +311,6 @@ tmq_conf_set(conf, "group.id", "cgrpName"); tmq_conf_set(conf, "td.connect.user", "root"); tmq_conf_set(conf, "td.connect.pass", "taosdata"); tmq_conf_set(conf, "auto.offset.reset", "earliest"); -tmq_conf_set(conf, "experimental.snapshot.enable", "true"); tmq_conf_set(conf, "msg.with.table.name", "true"); tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); @@ -367,7 +366,6 @@ conf := &tmq.ConfigMap{ "td.connect.port": "6030", "client.id": "test_tmq_c", "enable.auto.commit": "false", - "experimental.snapshot.enable": "true", "msg.with.table.name": "true", } consumer, err := NewConsumer(conf) @@ -417,7 +415,6 @@ consumer = Consumer({"group.id": "local", "td.connect.ip": "127.0.0.1"}) | `enable.auto.commit` | string | 启用自动提交 | 合法值:`true`, `false` | | `auto.commit.interval.ms` | string | 以毫秒为单位的自动提交时间间隔 | 默认值:5000 ms | | `auto.offset.reset` | string | 消费组订阅的初始位置 | 可选:`earliest`(default), `latest`, `none` | -| `experimental.snapshot.enable` | string | 是否允许从 TSDB 消费数据 | 合法值:`true`, `false` | diff --git a/docs/zh/07-develop/09-udf.md b/docs/zh/07-develop/09-udf.md index 8a8ef82009..99ecd903b4 100644 --- a/docs/zh/07-develop/09-udf.md +++ b/docs/zh/07-develop/09-udf.md @@ -6,18 +6,20 @@ description: "支持用户编码的聚合函数和标量函数,在查询中嵌 在有些应用场景中,应用逻辑需要的查询无法直接使用系统内置的函数来表示。利用 UDF(User Defined Function) 功能,TDengine 可以插入用户编写的处理代码并在查询中使用它们,就能够很方便地解决特殊应用场景中的使用需求。 UDF 通常以数据表中的一列数据做为输入,同时支持以嵌套子查询的结果作为输入。 -TDengine 支持通过 C/C++ 语言进行 UDF 定义。接下来结合示例讲解 UDF 的使用方法。 - 用户可以通过 UDF 实现两类函数:标量函数和聚合函数。标量函数对每行数据输出一个值,如求绝对值 abs,正弦函数 sin,字符串拼接函数 concat 等。聚合函数对多行数据进行输出一个值,如求平均数 avg,最大值 max 等。 -实现 UDF 时,需要实现规定的接口函数 +TDengine 支持通过 C/Python 语言进行 UDF 定义。接下来结合示例讲解 UDF 的使用方法。 + +## 用 C 语言实现 UDF + +使用 C 语言实现 UDF 时,需要实现规定的接口函数 - 标量函数需要实现标量接口函数 scalarfn 。 - 聚合函数需要实现聚合接口函数 aggfn_start , aggfn , aggfn_finish。 - 如果需要初始化,实现 udf_init;如果需要清理工作,实现udf_destroy。 接口函数的名称是 UDF 名称,或者是 UDF 名称和特定后缀(_start, _finish, _init, _destroy)的连接。列表中的scalarfn,aggfn, udf需要替换成udf函数名。 -## 实现标量函数 +### 用 C 语言实现标量函数 标量函数实现模板如下 ```c #include "taos.h" @@ -49,7 +51,7 @@ int32_t scalarfn_destroy() { ``` scalarfn 为函数名的占位符,需要替换成函数名,如bit_and。 -## 实现聚合函数 +### 用 C 语言实现聚合函数 聚合函数的实现模板如下 ```c @@ -100,7 +102,7 @@ int32_t aggfn_destroy() { ``` aggfn为函数名的占位符,需要修改为自己的函数名,如l2norm。 -## 接口函数定义 +### C 语言 UDF 接口函数定义 接口函数的名称是 udf 名称,或者是 udf 名称和特定后缀(_start, _finish, _init, _destroy)的连接。以下描述中函数名称中的 scalarfn,aggfn, udf 需要替换成udf函数名。 @@ -108,7 +110,7 @@ aggfn为函数名的占位符,需要修改为自己的函数名,如l2norm。 接口函数参数类型见数据结构定义。 -### 标量接口函数 +#### 标量函数接口 `int32_t scalarfn(SUdfDataBlock* inputDataBlock, SUdfColumn *resultColumn)` @@ -118,7 +120,7 @@ aggfn为函数名的占位符,需要修改为自己的函数名,如l2norm。 - inputDataBlock: 输入的数据块 - resultColumn: 输出列 -### 聚合接口函数 +#### 聚合函数接口 `int32_t aggfn_start(SUdfInterBuf *interBuf)` @@ -135,7 +137,7 @@ aggfn为函数名的占位符,需要修改为自己的函数名,如l2norm。 - result:最终结果。 -### UDF 初始化和销毁 +#### 初始化和销毁接口 `int32_t udf_init()` `int32_t udf_destroy()` @@ -143,7 +145,7 @@ aggfn为函数名的占位符,需要修改为自己的函数名,如l2norm。 其中 udf 是函数名的占位符。udf_init 完成初始化工作。 udf_destroy 完成清理工作。如果没有初始化工作,无需定义udf_init函数。如果没有清理工作,无需定义udf_destroy函数。 -## UDF 数据结构 +### C 语言 UDF 数据结构 ```c typedef struct SUdfColumnMeta { int16_t type; @@ -201,7 +203,7 @@ typedef struct SUdfInterBuf { 为了更好的操作以上数据结构,提供了一些便利函数,定义在 taosudf.h。 -## 编译 UDF +### 编译 C UDF 用户定义函数的 C 语言源代码无法直接被 TDengine 系统使用,而是需要先编译为 动态链接库,之后才能载入 TDengine 系统。 @@ -213,12 +215,9 @@ gcc -g -O0 -fPIC -shared bit_and.c -o libbitand.so 这样就准备好了动态链接库 libbitand.so 文件,可以供后文创建 UDF 时使用了。为了保证可靠的系统运行,编译器 GCC 推荐使用 7.5 及以上版本。 -## 管理和使用UDF -编译好的UDF,还需要将其加入到系统才能被正常的SQL调用。关于如何管理和使用UDF,参见[UDF使用说明](../12-taos-sql/26-udf.md) +### C UDF 示例代码 -## 示例代码 - -### 标量函数示例 [bit_and](https://github.com/taosdata/TDengine/blob/develop/tests/script/sh/bit_and.c) +#### 标量函数示例 [bit_and](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/bit_and.c) bit_add 实现多列的按位与功能。如果只有一列,返回这一列。bit_add 忽略空值。 @@ -231,7 +230,7 @@ bit_add 实现多列的按位与功能。如果只有一列,返回这一列。 -### 聚合函数示例1 返回值为数值类型 [l2norm](https://github.com/taosdata/TDengine/blob/develop/tests/script/sh/l2norm.c) +#### 聚合函数示例1 返回值为数值类型 [l2norm](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/l2norm.c) l2norm 实现了输入列的所有数据的二阶范数,即对每个数据先平方,再累加求和,最后开方。 @@ -244,7 +243,7 @@ l2norm 实现了输入列的所有数据的二阶范数,即对每个数据先 -### 聚合函数示例2 返回值为字符串类型 [max_vol](https://github.com/taosdata/TDengine/blob/develop/tests/script/sh/max_vol.c) +#### 聚合函数示例2 返回值为字符串类型 [max_vol](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/max_vol.c) max_vol 实现了从多个输入的电压列中找到最大电压,返回由设备ID + 最大电压所在(行,列)+ 最大电压值 组成的组合字符串值 @@ -268,4 +267,125 @@ select max_vol(vol1,vol2,vol3,deviceid) from battery; {{#include tests/script/sh/max_vol.c}} ``` - \ No newline at end of file + + +## 用 Python 语言实现 UDF + +使用 Python 语言实现 UDF 时,需要实现规定的接口函数 +- 标量函数需要实现标量接口函数 process 。 +- 聚合函数需要实现聚合接口函数 start ,reduce ,finish。 +- 如果需要初始化,实现 init;如果需要清理工作,实现 destroy。 + +### 用 Python 实现标量函数 + +标量函数实现模版如下 +```Python +def init(): + # initialization +def destroy(): + # destroy +def process(input: datablock) -> tuple[output_type]: + # process input datablock, + # datablock.data(row, col) is to access the python object in location(row,col) + # return tuple object consisted of object of type outputtype +``` + +### 用 Python 实现聚合函数 + +聚合函数实现模版如下 +```Python +def init(): + #initialization +def destroy(): + #destroy +def start() -> bytes: + #return serialize(init_state) +def reduce(inputs: datablock, buf: bytes) -> bytes + # deserialize buf to state + # reduce the inputs and state into new_state. + # use inputs.data(i,j) to access python ojbect of location(i,j) + # serialize new_state into new_state_bytes + return new_state_bytes +def finish(buf: bytes) -> output_type: + #return obj of type outputtype +``` + +### Python UDF 接口函数定义 + +#### 标量函数接口 +```Python +def process(input: datablock) -> tuple[output_type]: +``` +- input:datablock 类似二维矩阵,通过成员方法 data(row,col)返回位于 row 行,col 列的 python 对象 +- 返回值是一个 Python 对象元组,每个元素类型为输出类型。 + +#### 聚合函数接口 +```Python +def start() -> bytes: +def reduce(inputs: datablock, buf: bytes) -> bytes +def finish(buf: bytes) -> output_type: +``` + +首先调用 start 生成最初结果 buffer,然后输入数据会被分为多个行数据块,对每个数据块 inputs 和当前中间结果 buf 调用 reduce,得到新的中间结果,最后再调用 finish 从中间结果 buf 产生最终输出,最终输出只能含 0 或 1 条数据。 + + +#### 初始化和销毁接口 +```Python +def init() +def destroy() +``` + +其中 init 完成初始化工作。 destroy 完成清理工作。如果没有初始化工作,无需定义 init 函数。如果没有清理工作,无需定义 destroy 函数。 + +### Python 和 TDengine之间的数据类型映射 + +下表描述了TDengine SQL数据类型和Python数据类型的映射。任何类型的NULL值都映射成Python的None值。 + +| **TDengine SQL数据类型** | **Python数据类型** | +| :-----------------------: | ------------ | +|TINYINT / SMALLINT / INT / BIGINT | int | +|TINYINT UNSIGNED / SMALLINT UNSIGNED / INT UNSIGNED / BIGINT UNSIGNED | int | +|FLOAT / DOUBLE | float | +|BOOL | bool | +|BINARY / VARCHAR / NCHAR | bytes| +|TIMESTAMP | int | +|JSON and other types | 不支持 | + +### Python UDF 环境的安装 +1. 安装 taospyudf 包。此包执行Python UDF程序。 +```bash +sudo pip install taospyudf +ldconfig +``` +2. 如果 Python UDF 程序执行时,通过 PYTHONPATH 引用其它的包,可以设置 taos.cfg 的 UdfdLdLibPath 变量为PYTHONPATH的内容 + +### Python UDF 示例代码 +#### 标量函数示例 [pybitand](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/pybitand.py) + +pybitand 实现多列的按位与功能。如果只有一列,返回这一列。pybitand 忽略空值。 + +
+pybitand.py + +```Python +{{#include tests/script/sh/pybitand.py}} +``` + +
+ +#### 聚合函数示例 [pyl2norm](https://github.com/taosdata/TDengine/blob/3.0/tests/script/sh/pyl2norm.py) + +pyl2norm 实现了输入列的所有数据的二阶范数,即对每个数据先平方,再累加求和,最后开方。 + +
+pyl2norm.py + +```c +{{#include tests/script/sh/pyl2norm.py}} +``` + +
+ +## 管理和使用 UDF +在使用 UDF 之前需要先将其加入到 TDengine 系统中。关于如何管理和使用 UDF,请参考[管理和使用 UDF](../12-taos-sql/26-udf.md) + diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx index bf89b1df83..0bc113e58b 100644 --- a/docs/zh/08-connector/14-java.mdx +++ b/docs/zh/08-connector/14-java.mdx @@ -36,6 +36,104 @@ REST 连接支持所有能运行 Java 的平台。 请参考[版本支持列表](../#版本支持) +## 最近更新记录 + +| taos-jdbcdriver 版本 | 主要变化 | +| :------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------: | +| 3.2.1 | 新增功能:WebSocket 连接支持 schemaless 与 prepareStatement 写入。变更:consumer poll 返回结果集为 ConsumerRecord,可通过 value() 获取指定结果集数据。 | +| 3.2.0 | 存在连接问题,不推荐使用 | +| 3.1.0 | WebSocket 连接支持订阅功能 | +| 3.0.1 - 3.0.4 | 修复一些情况下结果集数据解析错误的问题。3.0.1 在 JDK 11 环境编译,JDK 8 环境下建议使用其他版本 | +| 3.0.0 | 支持 TDengine 3.0 | +| 2.0.42 | 修在 WebSocket 连接中 wasNull 接口返回值 | +| 2.0.41 | 修正 REST 连接中用户名和密码转码方式 | +| 2.0.39 - 2.0.40 | 增加 REST 连接/请求 超时设置 | +| 2.0.38 | JDBC REST 连接增加批量拉取功能 | +| 2.0.37 | 增加对 json tag 支持 | +| 2.0.36 | 增加对 schemaless 写入支持 | + +**注**:REST 连接中增加 `batchfetch` 参数并设置为 true,将开启 WebSocket 连接。 + +## 处理异常 + +在报错后,通过 SQLException 可以获取到错误的信息和错误码: + +```java +try (Statement statement = connection.createStatement()) { + // executeQuery + ResultSet resultSet = statement.executeQuery(sql); + // print result + printResult(resultSet); +} catch (SQLException e) { + System.out.println("ERROR Message: " + e.getMessage()); + System.out.println("ERROR Code: " + e.getErrorCode()); + e.printStackTrace(); +} +``` + +JDBC 连接器可能报错的错误码包括 4 种: + +- JDBC driver 本身的报错(错误码在 0x2301 到 0x2350 之间) +- 原生连接方法的报错(错误码在 0x2351 到 0x2360 之间) +- 数据订阅的报错(错误码在 0x2371 到 0x2380 之间) +- TDengine 其他功能模块的报错。 + +具体的错误码请参考: + +| Error Code | Description | Suggested Actions | +| ---------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| 0x2301 | connection already closed | 连接已经关闭,检查连接情况,或重新创建连接去执行相关指令。 | +| 0x2302 | this operation is NOT supported currently! | 当前使用接口不支持,可以更换其他连接方式。 | +| 0x2303 | invalid variables | 参数不合法,请检查相应接口规范,调整参数类型及大小。 | +| 0x2304 | statement is closed | statement 已经关闭,请检查 statement 是否关闭后再次使用,或是连接是否正常。 | +| 0x2305 | resultSet is closed | resultSet 结果集已经释放,请检查 resultSet 是否释放后再次使用。 | +| 0x2306 | Batch is empty! | prepareStatement 添加参数后再执行 executeBatch。 | +| 0x2307 | Can not issue data manipulation statements with executeQuery() | 更新操作应该使用 executeUpdate(),而不是 executeQuery()。 | +| 0x2308 | Can not issue SELECT via executeUpdate() | 查询操作应该使用 executeQuery(),而不是 executeUpdate()。 | +| 0x2309 | invalid sql for executeQuery: (?) | - | +| 0x230a | Database not specified or available | - | +| 0x230b | invalid sql for executeUpdate: (?) | - | +| 0x230c | invalid sql for execute: (?) | - | +| 0x230d | parameter index out of range | 参数越界,请检查参数的合理范围。 | +| 0x230e | connection already closed | 连接已经关闭,请检查 Connection 是否关闭后再次使用,或是连接是否正常。 | +| 0x230f | unknown sql type in tdengine | 请检查 TDengine 支持的 Data Type 类型。 | +| 0x2310 | can't register JDBC-JNI driver | 不能注册 JNI 驱动,请检查 url 是否填写正确。 | +| 0x2311 | can't register JDBC-RESTful driver | - | +| 0x2312 | url is not set | 请检查 REST 连接 url 是否填写正确。 | +| 0x2313 | invalid sql | - | +| 0x2314 | numeric value out of range | 请检查获取结果集中数值类型是否使用了正确的接口。 | +| 0x2315 | unknown taos type in tdengine | 在 TDengine 数据类型与 JDBC 数据类型转换时,是否指定了正确的 TDengine 数据类型。 | +| 0x2316 | unknown timestamp precision | - | +| 0x2317 | | REST 连接中使用了错误的请求类型。 | +| 0x2318 | | REST 连接中出现了数据传输异常,请检查网络情况并重试。 | +| 0x2319 | user is required | 创建连接时缺少用户名信息 | +| 0x231a | password is required | 创建连接时缺少密码信息 | +| 0x231b | invalid json format | - | +| 0x231c | httpEntity is null, sql: | REST 连接中执行出现异常 | +| 0x2350 | unknown error | 未知异常,请在 github 返回给开发人员。 | +| 0x2351 | failed to create subscription | - | +| 0x2352 | Unsupported encoding | 本地连接下指定了不支持的字符编码集 | +| 0x2353 | internal error of database, please see taoslog for more details | 本地连接执行 prepareStatement 时出现错误,请检查 taos log 进行问题定位。 | +| 0x2354 | JNI connection is NULL | 本地连接执行命令时,Connection 已经关闭。请检查与 TDengine 的连接情况。 | +| 0x2355 | JNI result set is NULL | 本地连接获取结果集,结果集异常,请检查连接情况,并重试。 | +| 0x2356 | invalid num of fields | 本地连接获取结果集的 meta 信息不匹配。 | +| 0x2357 | empty sql string | 填写正确的 SQL 进行执行。 | +| 0x2358 | fetch to the end of resultSet | - | +| 0x2359 | JNI alloc memory failed, please see taoslog for more details | 本地连接分配内存错误,请检查 taos log 进行问题定位。 | +| 0x2371 | consumer properties must not be null! | 创建订阅时参数为空,请填写正确的参数。 | +| 0x2372 | configs contain empty key, failed to set consumer property | 参数 key 中包含空值,请填写正确的参数。 | +| 0x2373 | failed to set consumer property, | 参数 value 中包含空值,请填写正确的参数。 | +| 0x2374 | consumer config error | - | +| 0x2375 | topic reference has been destroyed | 创建数据订阅过程中,topic 引用被释放。请检查与 TDengine 的连接情况。 | +| 0x2376 | failed to set consumer topic, topic name is empty | 创建数据订阅过程中,订阅 topic 名称为空。请检查指定的 topic 名称是否填写正确。 | +| 0x2377 | consumer reference has been destroyed | 订阅数据传输通道已经关闭,请检查与 TDengine 的连接情况。 | +| 0x2378 | consumer create error | 创建数据订阅失败,请根据错误信息检查 taos log 进行问题定位。 | +| - | can't create connection with server within: | 通过增加参数 httpConnectTimeout 增加连接耗时,或是请检查与 taosAdapter 之间的连接情况。 | +| - | failed to complete the task within the specified time : | 通过增加参数 messageWaitTimeout 增加执行耗时,或是请检查与 taosAdapter 之间的连接情况。 | + +- [TDengine Java Connector](https://github.com/taosdata/taos-connector-jdbc/blob/main/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java) + + ## TDengine DataType 和 Java DataType TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对应类型转换如下: @@ -82,7 +180,7 @@ Maven 项目中,在 pom.xml 中添加以下依赖: com.taosdata.jdbc taos-jdbcdriver - 3.1.0 + 3.2.1 ``` @@ -97,7 +195,7 @@ cd taos-connector-jdbc mvn clean install -Dmaven.test.skip=true ``` -编译后,在 target 目录下会产生 taos-jdbcdriver-3.0.\*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。 +编译后,在 target 目录下会产生 taos-jdbcdriver-3.2.\*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。 @@ -336,35 +434,6 @@ while(resultSet.next()){ > 查询和操作关系型数据库一致,使用下标获取返回字段内容时从 1 开始,建议使用字段名称获取。 -### 处理异常 - -在报错后,通过 SQLException 可以获取到错误的信息和错误码: - -```java -try (Statement statement = connection.createStatement()) { - // executeQuery - ResultSet resultSet = statement.executeQuery(sql); - // print result - printResult(resultSet); -} catch (SQLException e) { - System.out.println("ERROR Message: " + e.getMessage()); - System.out.println("ERROR Code: " + e.getErrorCode()); - e.printStackTrace(); -} -``` - -JDBC 连接器可能报错的错误码包括 4 种: - -- JDBC driver 本身的报错(错误码在 0x2301 到 0x2350 之间) -- 原生连接方法的报错(错误码在 0x2351 到 0x2360 之间) -- 数据订阅的报错(错误码在 0x2371 到 0x2380 之间) -- TDengine 其他功能模块的报错。 - -具体的错误码请参考: - -- [TDengine Java Connector](https://github.com/taosdata/taos-connector-jdbc/blob/main/src/main/java/com/taosdata/jdbc/TSDBErrorNumbers.java) - - ### 通过参数绑定写入数据 TDengine 的 JDBC 原生连接实现大幅改进了参数绑定方式对数据写入(INSERT)场景的支持。采用这种方式写入数据时,能避免 SQL 语法解析的资源消耗,从而在很多情况下显著提升写入性能。 @@ -372,9 +441,12 @@ TDengine 的 JDBC 原生连接实现大幅改进了参数绑定方式对数据 **注意**: - JDBC REST 连接目前不支持参数绑定 -- 以下示例代码基于 taos-jdbcdriver-3.1.0 +- 以下示例代码基于 taos-jdbcdriver-3.2.1 - binary 类型数据需要调用 setString 方法,nchar 类型数据需要调用 setNString 方法 -- setString 和 setNString 都要求用户在 size 参数里声明表定义中对应列的列宽 +- 预处理语句中指定数据库与子表名称不要使用 `db.?`,应直接使用 `?`,然后在 setTableName 中指定数据库,如:`prepareStatement.setTableName("db.t1")`。 + + + ```java public class ParameterBindingDemo { @@ -602,21 +674,7 @@ public class ParameterBindingDemo { } ``` -用于设定 TAGS 取值的方法总共有: - -```java -public void setTagNull(int index, int type) -public void setTagBoolean(int index, boolean value) -public void setTagInt(int index, int value) -public void setTagByte(int index, byte value) -public void setTagShort(int index, short value) -public void setTagLong(int index, long value) -public void setTagTimestamp(int index, long value) -public void setTagFloat(int index, float value) -public void setTagDouble(int index, double value) -public void setTagString(int index, String value) -public void setTagNString(int index, String value) -``` +**注**:setString 和 setNString 都要求用户在 size 参数里声明表定义中对应列的列宽 用于设定 VALUES 数据列的取值的方法总共有: @@ -633,17 +691,203 @@ public void setString(int columnIndex, ArrayList list, int size) throws public void setNString(int columnIndex, ArrayList list, int size) throws SQLException ``` + + + +```java +public class ParameterBindingDemo { + private static final String host = "127.0.0.1"; + private static final Random random = new Random(System.currentTimeMillis()); + private static final int BINARY_COLUMN_SIZE = 30; + private static final String[] schemaList = { + "create table stable1(ts timestamp, f1 tinyint, f2 smallint, f3 int, f4 bigint) tags(t1 tinyint, t2 smallint, t3 int, t4 bigint)", + "create table stable2(ts timestamp, f1 float, f2 double) tags(t1 float, t2 double)", + "create table stable3(ts timestamp, f1 bool) tags(t1 bool)", + "create table stable4(ts timestamp, f1 binary(" + BINARY_COLUMN_SIZE + ")) tags(t1 binary(" + BINARY_COLUMN_SIZE + "))", + "create table stable5(ts timestamp, f1 nchar(" + BINARY_COLUMN_SIZE + ")) tags(t1 nchar(" + BINARY_COLUMN_SIZE + "))" + }; + private static final int numOfSubTable = 10, numOfRow = 10; + + public static void main(String[] args) throws SQLException { + + String jdbcUrl = "jdbc:TAOS-RS://" + host + ":6041/?batchfetch=true"; + Connection conn = DriverManager.getConnection(jdbcUrl, "root", "taosdata"); + + init(conn); + + bindInteger(conn); + + bindFloat(conn); + + bindBoolean(conn); + + bindBytes(conn); + + bindString(conn); + + conn.close(); + } + + private static void init(Connection conn) throws SQLException { + try (Statement stmt = conn.createStatement()) { + stmt.execute("drop database if exists test_ws_parabind"); + stmt.execute("create database if not exists test_ws_parabind"); + stmt.execute("use test_ws_parabind"); + for (int i = 0; i < schemaList.length; i++) { + stmt.execute(schemaList[i]); + } + } + } + + private static void bindInteger(Connection conn) throws SQLException { + String sql = "insert into ? using stable1 tags(?,?,?,?) values(?,?,?,?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t1_" + i); + // set tags + pstmt.setTagByte(1, Byte.parseByte(Integer.toString(random.nextInt(Byte.MAX_VALUE)))); + pstmt.setTagShort(2, Short.parseShort(Integer.toString(random.nextInt(Short.MAX_VALUE)))); + pstmt.setTagInt(3, random.nextInt(Integer.MAX_VALUE)); + pstmt.setTagLong(4, random.nextLong()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setByte(2, Byte.parseByte(Integer.toString(random.nextInt(Byte.MAX_VALUE)))); + pstmt.setShort(3, Short.parseShort(Integer.toString(random.nextInt(Short.MAX_VALUE)))); + pstmt.setInt(4, random.nextInt(Integer.MAX_VALUE)); + pstmt.setLong(5, random.nextLong()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindFloat(Connection conn) throws SQLException { + String sql = "insert into ? using stable2 tags(?,?) values(?,?,?)"; + + try(TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t2_" + i); + // set tags + pstmt.setTagFloat(1, random.nextFloat()); + pstmt.setTagDouble(2, random.nextDouble()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setFloat(2, random.nextFloat()); + pstmt.setDouble(3, random.nextDouble()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindBoolean(Connection conn) throws SQLException { + String sql = "insert into ? using stable3 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t3_" + i); + // set tags + pstmt.setTagBoolean(1, random.nextBoolean()); + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setBoolean(2, random.nextBoolean()); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindBytes(Connection conn) throws SQLException { + String sql = "insert into ? using stable4 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t4_" + i); + // set tags + pstmt.setTagString(1, new String("abc")); + + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(1, new Timestamp(current + j)); + pstmt.setString(2, "abc"); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } + + private static void bindString(Connection conn) throws SQLException { + String sql = "insert into ? using stable5 tags(?) values(?,?)"; + + try (TSWSPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSWSPreparedStatement.class)) { + + for (int i = 1; i <= numOfSubTable; i++) { + // set table name + pstmt.setTableName("t5_" + i); + // set tags + pstmt.setTagNString(1, "California.SanFrancisco"); + + // set columns + long current = System.currentTimeMillis(); + for (int j = 0; j < numOfRow; j++) { + pstmt.setTimestamp(0, new Timestamp(current + j)); + pstmt.setNString(1, "California.SanFrancisco"); + pstmt.addBatch(); + } + pstmt.executeBatch(); + } + } + } +} +``` + + + + +用于设定 TAGS 取值的方法总共有: + +```java +public void setTagNull(int index, int type) +public void setTagBoolean(int index, boolean value) +public void setTagInt(int index, int value) +public void setTagByte(int index, byte value) +public void setTagShort(int index, short value) +public void setTagLong(int index, long value) +public void setTagTimestamp(int index, long value) +public void setTagFloat(int index, float value) +public void setTagDouble(int index, double value) +public void setTagString(int index, String value) +public void setTagNString(int index, String value) +``` + ### 无模式写入 TDengine 支持无模式写入功能。无模式写入兼容 InfluxDB 的 行协议(Line Protocol)、OpenTSDB 的 telnet 行协议和 OpenTSDB 的 JSON 格式协议。详情请参见[无模式写入](../../reference/schemaless/)。 -**注意**: - -- JDBC REST 连接目前不支持无模式写入 -- 以下示例代码基于 taos-jdbcdriver-3.1.0 + + ```java -public class SchemalessInsertTest { +public class SchemalessJniTest { private static final String host = "127.0.0.1"; private static final String lineDemo = "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; private static final String telnetDemo = "stb0_0 1626006833 4 host=host0 interface=eth0"; @@ -671,6 +915,41 @@ public class SchemalessInsertTest { } ``` + + + +```java +public class SchemalessWsTest { + private static final String host = "127.0.0.1"; + private static final String lineDemo = "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + private static final String telnetDemo = "stb0_0 1626006833 4 host=host0 interface=eth0"; + private static final String jsonDemo = "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + + public static void main(String[] args) throws SQLException { + final String url = "jdbc:TAOS-RS://" + host + ":6041/?user=root&password=taosdata&batchfetch=true"; + Connection connection = DriverManager.getConnection(url); + init(connection); + + SchemalessWriter writer = new SchemalessWriter(connection, "test_ws_schemaless"); + writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS); + writer.write(telnetDemo, SchemalessProtocolType.TELNET, SchemalessTimestampType.MILLI_SECONDS); + writer.write(jsonDemo, SchemalessProtocolType.JSON, SchemalessTimestampType.SECONDS); + System.exit(0); + } + + private static void init(Connection connection) throws SQLException { + try (Statement stmt = connection.createStatement()) { + stmt.executeUpdate("drop database if exists test_ws_schemaless"); + stmt.executeUpdate("create database if not exists test_ws_schemaless keep 36500"); + stmt.executeUpdate("use test_ws_schemaless"); + } + } +} +``` + + + + ### 数据订阅 TDengine Java 连接器支持订阅功能,应用 API 如下: @@ -714,8 +993,9 @@ TaosConsumer consumer = new TaosConsumer<>(config); ```java while(true) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } ``` @@ -766,8 +1046,9 @@ public abstract class ConsumerLoop { while (!shutdown.get()) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } consumer.unsubscribe(); @@ -844,8 +1125,9 @@ public abstract class ConsumerLoop { while (!shutdown.get()) { ConsumerRecords records = consumer.poll(Duration.ofMillis(100)); - for (ResultBean record : records) { - process(record); + for (ConsumerRecord record : records) { + ResultBean bean = record.value(); + process(bean); } } consumer.unsubscribe(); @@ -971,20 +1253,6 @@ public static void main(String[] args) throws Exception { 请参考:[JDBC example](https://github.com/taosdata/TDengine/tree/3.0/examples/JDBC) -## 最近更新记录 - -| taos-jdbcdriver 版本 | 主要变化 | -| :------------------: | :--------------------------------------------------------------------------------------------: | -| 3.1.0 | WebSocket 连接支持订阅功能 | -| 3.0.1 - 3.0.4 | 修复一些情况下结果集数据解析错误的问题。3.0.1 在 JDK 11 环境编译,JDK 8 环境下建议使用其他版本 | -| 3.0.0 | 支持 TDengine 3.0 | -| 2.0.42 | 修在 WebSocket 连接中 wasNull 接口返回值 | -| 2.0.41 | 修正 REST 连接中用户名和密码转码方式 | -| 2.0.39 - 2.0.40 | 增加 REST 连接/请求 超时设置 | -| 2.0.38 | JDBC REST 连接增加批量拉取功能 | -| 2.0.37 | 增加对 json tag 支持 | -| 2.0.36 | 增加对 schemaless 写入支持 | - ## 常见问题 1. 使用 Statement 的 `addBatch()` 和 `executeBatch()` 来执行“批量写入/更新”,为什么没有带来性能上的提升? diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index eeb93a6558..d4ca25be81 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -10,6 +10,7 @@ import TabItem from '@theme/TabItem'; import Preparation from "./_preparation.mdx" import RustInsert from "../07-develop/03-insert-data/_rust_sql.mdx" import RustBind from "../07-develop/03-insert-data/_rust_stmt.mdx" +import RustSml from "../07-develop/03-insert-data/_rust_schemaless.mdx" import RustQuery from "../07-develop/04-query-data/_rust.mdx" [![Crates.io](https://img.shields.io/crates/v/taos)](https://crates.io/crates/taos) ![Crates.io](https://img.shields.io/crates/d/taos) [![docs.rs](https://img.shields.io/docsrs/taos)](https://docs.rs/taos) @@ -230,6 +231,10 @@ async fn demo(taos: &Taos, db: &str) -> Result<(), Error> { +#### Schemaless 写入 + + + ### 查询数据 diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index dd30635660..a2a0914120 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -71,8 +71,8 @@ database_option: { - 0:表示可以创建多张超级表。 - 1:表示只可以创建一张超级表。 - STT_TRIGGER:表示落盘文件触发文件合并的个数。默认为 1,范围 1 到 16。对于少表高频场景,此参数建议使用默认配置,或较小的值;而对于多表低频场景,此参数建议配置较大的值。 -- TABLE_PREFIX:内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的前缀的长度。 -- TABLE_SUFFIX:内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的后缀的长度。 +- TABLE_PREFIX:当其为正值时,在决定把一个表分配到哪个 vgroup 时要忽略表名中指定长度的前缀;当其为负值时,在决定把一个表分配到哪个 vgroup 时只使用表名中指定长度的前缀;例如,假定表名为 "v30001",当 TSDB_PREFIX = 2 时 使用 "0001" 来决定分配到哪个 vgroup ,当 TSDB_PREFIX = -2 时使用 "v3" 来决定分配到哪个 vgroup +- TABLE_SUFFIX:当其为正值时,在决定把一个表分配到哪个 vgroup 时要忽略表名中指定长度的后缀;当其为负值时,在决定把一个表分配到哪个 vgroup 时只使用表名中指定长度的后缀;例如,假定表名为 "v30001",当 TSDB_SUFFIX = 2 时 使用 "v300" 来决定分配到哪个 vgroup ,当 TSDB_SUFFIX = -2 时使用 "01" 来决定分配到哪个 vgroup。 - TSDB_PAGESIZE:一个 VNODE 中时序数据存储引擎的页大小,单位为 KB,默认为 4 KB。范围为 1 到 16384,即 1 KB到 16 MB。 - WAL_RETENTION_PERIOD: 为了数据订阅消费,需要WAL日志文件额外保留的最大时长策略。WAL日志清理,不受订阅客户端消费状态影响。单位为 s。默认为 0,表示无需为订阅保留。新建订阅,应先设置恰当的时长策略。 - WAL_RETENTION_SIZE:为了数据订阅消费,需要WAL日志文件额外保留的最大累计大小策略。单位为 KB。默认为 0,表示累计大小无上限。 diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index e4ba5b76e4..870df73471 100644 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -55,7 +55,7 @@ window_clause: { | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] interp_clause: - RANGE(ts_val, ts_val), EVERY(every_val), FILL(fill_mod_and_val) + RANGE(ts_val, ts_val) EVERY(every_val) FILL(fill_mod_and_val) partition_by_clause: PARTITION BY expr [, expr] ... diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index 50e82e6b90..458fc9c7a2 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -888,7 +888,7 @@ INTERP(expr) - INTERP 的输出时间范围根据 RANGE(timestamp1,timestamp2)字段来指定,需满足 timestamp1 <= timestamp2。其中 timestamp1(必选值)为输出时间范围的起始值,即如果 timestamp1 时刻符合插值条件则 timestamp1 为输出的第一条记录,timestamp2(必选值)为输出时间范围的结束值,即输出的最后一条记录的 timestamp 不能大于 timestamp2。 - INTERP 根据 EVERY(time_unit) 字段来确定输出时间范围内的结果条数,即从 timestamp1 开始每隔固定长度的时间(time_unit 值)进行插值,time_unit 可取值时间单位:1a(毫秒),1s(秒),1m(分),1h(小时),1d(天),1w(周)。例如 EVERY(500a) 将对于指定数据每500毫秒间隔进行一次插值. - INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。关于 FILL 子句如何使用请参考 [FILL 子句](../distinguished/#fill-子句) -- INTERP 只能在一个时间序列内进行插值,因此当作用于超级表时必须跟 partition by tbname 一起使用。 +- INTERP 作用于超级表时, 会将该超级表下的所有子表数据按照主键列排序后进行插值计算,也可以搭配 PARTITION BY tbname 使用,将结果强制规约到单个时间线。 - INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.2.0版本以后支持)。 - INTERP 可以与伪列 _isfilled 一起使用,显示返回结果是否为原始记录或插值算法产生的数据(3.0.3.0版本以后支持)。 diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md index d90db3cab0..634f50356d 100644 --- a/docs/zh/12-taos-sql/14-stream.md +++ b/docs/zh/12-taos-sql/14-stream.md @@ -227,7 +227,7 @@ T = 最新事件时间 - DELETE_MARK ## 流式计算支持的函数 1. 所有的 [单行函数](../function/#单行函数) 均可用于流计算。 -2. 以下 19 个聚合/选择函数 不能 应用在创建流计算的 SQL 语句,[系统信息函数](../function/#系统信息函数) 也不能用于流计算中。此外的其他类型的函数均可用于流计算。 +2. 以下 19 个聚合/选择函数 不能 应用在创建流计算的 SQL 语句。此外的其他类型的函数均可用于流计算。 - [leastsquares](../function/#leastsquares) - [percentile](../function/#percentile) diff --git a/docs/zh/12-taos-sql/22-meta.md b/docs/zh/12-taos-sql/22-meta.md index 1f2e3fb7d5..7fb60b85a7 100644 --- a/docs/zh/12-taos-sql/22-meta.md +++ b/docs/zh/12-taos-sql/22-meta.md @@ -120,6 +120,10 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数 | 5 | create_time | TIMESTAMP | 创建时间 | | 6 | code_len | INT | 代码长度 | | 7 | bufsize | INT | buffer 大小 | +| 8 | func_language | BINARY(31) | 自定义函数编程语言 | +| 9 | func_body | BINARY(16384) | 函数体定义 | +| 10 | func_version | INT | 函数版本号。初始版本为0,每次替换更新,版本号加1。| + ## INS_INDEXES diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md index c85efa2376..53692ef4c0 100644 --- a/docs/zh/12-taos-sql/24-show.md +++ b/docs/zh/12-taos-sql/24-show.md @@ -129,6 +129,14 @@ SHOW QNODES; 显示当前系统中 QNODE (查询节点)的信息。 +## SHOW QUERIES + +```sql +SHOW QUERIES; +``` + +显示当前系统中正在进行的查询。 + ## SHOW SCORES ```sql diff --git a/docs/zh/12-taos-sql/26-udf.md b/docs/zh/12-taos-sql/26-udf.md index 7697944f9a..c1d2761d7d 100644 --- a/docs/zh/12-taos-sql/26-udf.md +++ b/docs/zh/12-taos-sql/26-udf.md @@ -13,27 +13,34 @@ description: 使用 UDF 的详细指南 - 创建标量函数 ```sql -CREATE FUNCTION function_name AS library_path OUTPUTTYPE output_type; +CREATE [OR REPLACE] FUNCTION function_name AS library_path OUTPUTTYPE output_type [LANGUAGE 'C|Python']; ``` - - - function_name:标量函数未来在 SQL 中被调用时的函数名,必须与函数实现中 udf 的实际名称一致; - - library_path:包含 UDF 函数实现的动态链接库的库文件绝对路径(指的是库文件在当前客户端所在主机上的保存路径,通常是指向一个 .so 文件),这个路径需要用英文单引号或英文双引号括起来; + - OR REPLACE: 如果函数已经存在,会修改已有的函数属性。 + - function_name:标量函数未来在 SQL 中被调用时的函数名; + - LANGUAGE 'C|Python':函数编程语言,目前支持C语言和Python语言。 如果这个从句忽略,编程语言是C语言 + - library_path:如果编程语言是C,路径是包含 UDF 函数实现的动态链接库的库文件绝对路径(指的是库文件在当前客户端所在主机上的保存路径,通常是指向一个 .so 文件)。如果编程语言是Python,路径是包含 UDF 函数实现的Python文件路径。这个路径需要用英文单引号或英文双引号括起来; - output_type:此函数计算结果的数据类型名称; - 例如,如下语句可以把 libbitand.so 创建为系统中可用的 UDF: +例如,如下语句可以把 libbitand.so 创建为系统中可用的 UDF: ```sql CREATE FUNCTION bit_and AS "/home/taos/udf_example/libbitand.so" OUTPUTTYPE INT; ``` +例如,使用以下语句可以修改已经定义的 bit_and 函数,输出类型是 BIGINT,使用Python语言实现。 + + ```sql + CREATE OR REPLACE FUNCTION bit_and AS "/home/taos/udf_example/bit_and.py" OUTPUTTYPE BIGINT LANGUAGE 'Python'; + ``` - 创建聚合函数: ```sql -CREATE AGGREGATE FUNCTION function_name AS library_path OUTPUTTYPE output_type [ BUFSIZE buffer_size ]; +CREATE [OR REPLACE] AGGREGATE FUNCTION function_name AS library_path OUTPUTTYPE output_type [ BUFSIZE buffer_size ] [LANGUAGE 'C|Python']; ``` - + - OR REPLACE: 如果函数已经存在,会修改已有的函数属性。 - function_name:聚合函数未来在 SQL 中被调用时的函数名,必须与函数实现中 udfNormalFunc 的实际名称一致; - - library_path:包含 UDF 函数实现的动态链接库的库文件绝对路径(指的是库文件在当前客户端所在主机上的保存路径,通常是指向一个 .so 文件),这个路径需要用英文单引号或英文双引号括起来; - - output_type:此函数计算结果的数据类型,与上文中 udfNormalFunc 的 itype 参数不同,这里不是使用数字表示法,而是直接写类型名称即可; + - LANGUAGE 'C|Python':函数编程语言,目前支持C语言和Python语言。 + - library_path:如果编程语言是C,路径是包含 UDF 函数实现的动态链接库的库文件绝对路径(指的是库文件在当前客户端所在主机上的保存路径,通常是指向一个 .so 文件)。如果编程语言是Python,路径是包含 UDF 函数实现的Python文件路径。这个路径需要用英文单引号或英文双引号括起来;; + - output_type:此函数计算结果的数据类型名称; - buffer_size:中间计算结果的缓冲区大小,单位是字节。如果不使用可以不设置。 例如,如下语句可以把 libl2norm.so 创建为系统中可用的 UDF: @@ -41,6 +48,11 @@ 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; ``` + 例如,使用以下语句可以修改已经定义的 l2norm 函数的缓冲区大小为64。 + ```sql + CREATE AGGREGATE FUNCTION l2norm AS "/home/taos/udf_example/libl2norm.so" OUTPUTTYPE DOUBLE bufsize 64; + ``` + 关于如何开发自定义函数,请参考 [UDF使用说明](/develop/udf)。 ## 管理 UDF diff --git a/docs/zh/12-taos-sql/29-changes.md b/docs/zh/12-taos-sql/29-changes.md index 8a5f1b20e3..27dd3294b7 100644 --- a/docs/zh/12-taos-sql/29-changes.md +++ b/docs/zh/12-taos-sql/29-changes.md @@ -27,7 +27,7 @@ description: "TDengine 3.0 版本的语法变更说明" | - | :------- | :-------- | :------- | | 1 | ALTER ACCOUNT | 废除 | 2.x中为企业版功能,3.0不再支持。语法暂时保留了,执行报“This statement is no longer supported”错误。 | 2 | ALTER ALL DNODES | 新增 | 修改所有DNODE的参数。 -| 3 | ALTER DATABASE | 调整 |

废除

  • QUORUM:写入需要的副本确认数。3.0 版本默认行为是强一致性,且不支持修改为弱一致性。
  • BLOCKS:VNODE使用的内存块数。3.0版本使用BUFFER来表示VNODE写入内存池的大小。
  • UPDATE:更新操作的支持模式。3.0版本所有数据库都支持部分列更新。
  • CACHELAST:缓存最新一行数据的模式。3.0版本用CACHEMODEL代替。
  • COMP:3.0版本暂不支持修改。

新增

  • CACHEMODEL:表示是否在内存中缓存子表的最近数据。
  • CACHESIZE:表示缓存子表最近数据的内存大小。
  • WAL_FSYNC_PERIOD:代替原FSYNC参数。
  • WAL_LEVEL:代替原WAL参数。
  • WAL_RETENTION_PERIOD:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。
  • WAL_RETENTION_SIZE:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。

调整

  • REPLICA:3.0.0版本暂不支持修改。
  • KEEP:3.0版本新增支持带单位的设置方式。
+| 3 | ALTER DATABASE | 调整 |

废除

  • QUORUM:写入需要的副本确认数。3.0 版本默认行为是强一致性,且不支持修改为弱一致性。
  • BLOCKS:VNODE使用的内存块数。3.0版本使用BUFFER来表示VNODE写入内存池的大小。
  • UPDATE:更新操作的支持模式。3.0版本所有数据库都支持部分列更新。
  • CACHELAST:缓存最新一行数据的模式。3.0版本用CACHEMODEL代替。
  • COMP:3.0版本暂不支持修改。

新增

  • CACHEMODEL:表示是否在内存中缓存子表的最近数据。
  • CACHESIZE:表示缓存子表最近数据的内存大小。
  • WAL_FSYNC_PERIOD:代替原FSYNC参数。
  • WAL_LEVEL:代替原WAL参数。
  • WAL_RETENTION_PERIOD:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。
  • WAL_RETENTION_SIZE:3.0.4.0版本新增,wal文件的额外保留策略,用于数据订阅。

调整

  • KEEP:3.0版本新增支持带单位的设置方式。
| 4 | ALTER STABLE | 调整 | 废除
  • CHANGE TAG:修改标签列的名称。3.0版本使用RENAME TAG代替。
    新增
  • RENAME TAG:代替原CHANGE TAG子句。
  • COMMENT:修改超级表的注释。
| 5 | ALTER TABLE | 调整 | 废除
  • CHANGE TAG:修改标签列的名称。3.0版本使用RENAME TAG代替。
    新增
  • RENAME TAG:代替原CHANGE TAG子句。
  • COMMENT:修改表的注释。
  • TTL:修改表的生命周期。
| 6 | ALTER USER | 调整 | 废除
  • PRIVILEGE:修改用户权限。3.0版本使用GRANT和REVOKE来授予和回收权限。
    新增
  • ENABLE:启用或停用此用户。
  • SYSINFO:修改用户是否可查看系统信息。
diff --git a/docs/zh/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md index 8a031d1473..8ff1287c3e 100644 --- a/docs/zh/14-reference/06-taosdump.md +++ b/docs/zh/14-reference/06-taosdump.md @@ -79,6 +79,7 @@ Usage: taosdump [OPTION...] dbname [tbname ...] -A, --all-databases Dump all databases. -D, --databases=DATABASES Dump inputted databases. Use comma to separate databases' name. + -e, --escape-character Use escaped character for database name -N, --without-property Dump database without its properties. -s, --schemaonly Only dump tables' schema. -y, --answer-yes Input yes for prompt. It will skip data file diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index c1d23df409..2694086f59 100644 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -735,7 +735,6 @@ charset 的有效值是 UTF-8。 | 16 | maxTmrCtrl | 是 | 否 | 3.0 行为未知 | | 17 | monitorReplica | 是 | 否 | 由 RAFT 协议管理多副本 | | 18 | smlTagNullName | 是 | 否 | 3.0 行为未知 | -| 19 | keepColumnName | 是 | 否 | 3.0 行为未知 | | 20 | ratioOfQueryCores | 是 | 否 | 由 线程池 相关配置参数决定 | | 21 | maxStreamCompDelay | 是 | 否 | 3.0 行为未知 | | 22 | maxFirstStreamCompDelay | 是 | 否 | 3.0 行为未知 | diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 8a47b850c4..46e09a56b6 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -26,6 +26,10 @@ extern "C" { #include "tgrantCfg.h" #endif +#ifndef GRANTS_COL_MAX_LEN +#define GRANTS_COL_MAX_LEN 196 +#endif + typedef enum { TSDB_GRANT_ALL, TSDB_GRANT_TIME, @@ -47,23 +51,49 @@ typedef enum { int32_t grantCheck(EGrantType grant); #ifndef GRANTS_CFG -#define GRANTS_SCHEMA \ - static const SSysDbTableSchema grantsSchema[] = { \ - {.name = "version", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "expire_time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "expired", .bytes = 5 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "storage", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "databases", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "users", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "accounts", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "connections", .bytes = 11 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "streams", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "cpu_cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "speed", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "querytime", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ +#ifdef TD_ENTERPRISE +#define GRANTS_SCHEMA \ + static const SSysDbTableSchema grantsSchema[] = { \ + {.name = "version", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "expire_time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "expired", .bytes = 5 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "storage", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "databases", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "users", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "accounts", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "connections", .bytes = 11 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "streams", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "cpu_cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "speed", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "querytime", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "opc_da", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "opc_ua", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "pi", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "kafka", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "influxdb", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "mqtt", .bytes = GRANTS_COL_MAX_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ } +#else +#define GRANTS_SCHEMA \ + static const SSysDbTableSchema grantsSchema[] = { \ + {.name = "version", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "expire_time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "expired", .bytes = 5 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "storage", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "databases", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "users", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "accounts", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "connections", .bytes = 11 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "streams", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "cpu_cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "speed", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "querytime", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + } +#endif #define GRANT_CFG_ADD #define GRANT_CFG_SET #define GRANT_CFG_GET diff --git a/include/common/tmsg.h b/include/common/tmsg.h index f377ad0d63..b71d5c3a52 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1232,6 +1232,14 @@ typedef struct { SEp ep; } SDnodeEp; +typedef struct { + int32_t id; + int8_t isMnode; + SEp ep; + char active[TSDB_ACTIVE_KEY_LEN]; + char connActive[TSDB_CONN_ACTIVE_KEY_LEN]; +} SDnodeInfo; + typedef struct { int64_t dnodeVer; SDnodeCfg dnodeCfg; @@ -1625,6 +1633,21 @@ typedef struct { int32_t tSerializeSDropDnodeReq(void* buf, int32_t bufLen, SDropDnodeReq* pReq); int32_t tDeserializeSDropDnodeReq(void* buf, int32_t bufLen, SDropDnodeReq* pReq); +enum { + RESTORE_TYPE__ALL = 1, + RESTORE_TYPE__MNODE, + RESTORE_TYPE__VNODE, + RESTORE_TYPE__QNODE, +}; + +typedef struct { + int32_t dnodeId; + int8_t restoreType; +} SRestoreDnodeReq; + +int32_t tSerializeSRestoreDnodeReq(void* buf, int32_t bufLen, SRestoreDnodeReq* pReq); +int32_t tDeserializeSRestoreDnodeReq(void* buf, int32_t bufLen, SRestoreDnodeReq* pReq); + typedef struct { int32_t dnodeId; char config[TSDB_DNODE_CONFIG_LEN]; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index ffad6f6646..499f19f70e 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -178,6 +178,7 @@ enum { // TD_DEF_MSG_TYPE(TDMT_MND_STREAM_BEGIN_CHECKPOINT, "stream-begin-checkpoint", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_MAX_MSG, "mnd-max", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_BALANCE_VGROUP_LEADER, "balance-vgroup-leader", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_RESTORE_DNODE, "restore-dnode", NULL, NULL) TD_NEW_MSG_SEG(TDMT_VND_MSG) TD_DEF_MSG_TYPE(TDMT_VND_SUBMIT, "submit", SSubmitReq, SSubmitRsp) @@ -225,7 +226,6 @@ enum { TD_DEF_MSG_TYPE(TDMT_VND_COMMIT, "vnode-commit", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_CREATE_INDEX, "vnode-create-index", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DROP_INDEX, "vnode-drop-index", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_DISABLE_WRITE, "vnode-disable-write", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_MAX_MSG, "vnd-max", NULL, NULL) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 641cbbb588..95c548977c 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -16,335 +16,338 @@ #ifndef _TD_COMMON_TOKEN_H_ #define _TD_COMMON_TOKEN_H_ -#define TK_OR 1 -#define TK_AND 2 -#define TK_UNION 3 -#define TK_ALL 4 -#define TK_MINUS 5 -#define TK_EXCEPT 6 -#define TK_INTERSECT 7 -#define TK_NK_BITAND 8 -#define TK_NK_BITOR 9 -#define TK_NK_LSHIFT 10 -#define TK_NK_RSHIFT 11 -#define TK_NK_PLUS 12 -#define TK_NK_MINUS 13 -#define TK_NK_STAR 14 -#define TK_NK_SLASH 15 -#define TK_NK_REM 16 -#define TK_NK_CONCAT 17 -#define TK_CREATE 18 -#define TK_ACCOUNT 19 -#define TK_NK_ID 20 -#define TK_PASS 21 -#define TK_NK_STRING 22 -#define TK_ALTER 23 -#define TK_PPS 24 -#define TK_TSERIES 25 -#define TK_STORAGE 26 -#define TK_STREAMS 27 -#define TK_QTIME 28 -#define TK_DBS 29 -#define TK_USERS 30 -#define TK_CONNS 31 -#define TK_STATE 32 -#define TK_USER 33 -#define TK_ENABLE 34 -#define TK_NK_INTEGER 35 -#define TK_SYSINFO 36 -#define TK_DROP 37 -#define TK_GRANT 38 -#define TK_ON 39 -#define TK_TO 40 -#define TK_REVOKE 41 -#define TK_FROM 42 -#define TK_SUBSCRIBE 43 -#define TK_NK_COMMA 44 -#define TK_READ 45 -#define TK_WRITE 46 -#define TK_NK_DOT 47 -#define TK_WITH 48 -#define TK_DNODE 49 -#define TK_PORT 50 -#define TK_DNODES 51 -#define TK_NK_IPTOKEN 52 -#define TK_FORCE 53 -#define TK_LOCAL 54 -#define TK_QNODE 55 -#define TK_BNODE 56 -#define TK_SNODE 57 -#define TK_MNODE 58 -#define TK_DATABASE 59 -#define TK_USE 60 -#define TK_FLUSH 61 -#define TK_TRIM 62 -#define TK_COMPACT 63 -#define TK_IF 64 -#define TK_NOT 65 -#define TK_EXISTS 66 -#define TK_BUFFER 67 -#define TK_CACHEMODEL 68 -#define TK_CACHESIZE 69 -#define TK_COMP 70 -#define TK_DURATION 71 -#define TK_NK_VARIABLE 72 -#define TK_MAXROWS 73 -#define TK_MINROWS 74 -#define TK_KEEP 75 -#define TK_PAGES 76 -#define TK_PAGESIZE 77 -#define TK_TSDB_PAGESIZE 78 -#define TK_PRECISION 79 -#define TK_REPLICA 80 -#define TK_VGROUPS 81 -#define TK_SINGLE_STABLE 82 -#define TK_RETENTIONS 83 -#define TK_SCHEMALESS 84 -#define TK_WAL_LEVEL 85 -#define TK_WAL_FSYNC_PERIOD 86 -#define TK_WAL_RETENTION_PERIOD 87 -#define TK_WAL_RETENTION_SIZE 88 -#define TK_WAL_ROLL_PERIOD 89 -#define TK_WAL_SEGMENT_SIZE 90 -#define TK_STT_TRIGGER 91 -#define TK_TABLE_PREFIX 92 -#define TK_TABLE_SUFFIX 93 -#define TK_NK_COLON 94 -#define TK_MAX_SPEED 95 -#define TK_START 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_BOOL 112 -#define TK_TINYINT 113 -#define TK_SMALLINT 114 -#define TK_INT 115 -#define TK_INTEGER 116 -#define TK_BIGINT 117 -#define TK_FLOAT 118 -#define TK_DOUBLE 119 -#define TK_BINARY 120 -#define TK_NCHAR 121 -#define TK_UNSIGNED 122 -#define TK_JSON 123 -#define TK_VARCHAR 124 -#define TK_MEDIUMBLOB 125 -#define TK_BLOB 126 -#define TK_VARBINARY 127 -#define TK_DECIMAL 128 -#define TK_COMMENT 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_REPLACE 193 -#define TK_STREAM 194 -#define TK_INTO 195 -#define TK_TRIGGER 196 -#define TK_AT_ONCE 197 -#define TK_WINDOW_CLOSE 198 -#define TK_IGNORE 199 -#define TK_EXPIRED 200 -#define TK_FILL_HISTORY 201 -#define TK_UPDATE 202 -#define TK_SUBTABLE 203 -#define TK_KILL 204 -#define TK_CONNECTION 205 -#define TK_TRANSACTION 206 -#define TK_BALANCE 207 -#define TK_VGROUP 208 -#define TK_LEADER 209 -#define TK_MERGE 210 -#define TK_REDISTRIBUTE 211 -#define TK_SPLIT 212 -#define TK_DELETE 213 -#define TK_INSERT 214 -#define TK_NULL 215 -#define TK_NK_QUESTION 216 -#define TK_NK_ARROW 217 -#define TK_ROWTS 218 -#define TK_QSTART 219 -#define TK_QEND 220 -#define TK_QDURATION 221 -#define TK_WSTART 222 -#define TK_WEND 223 -#define TK_WDURATION 224 -#define TK_IROWTS 225 -#define TK_ISFILLED 226 -#define TK_CAST 227 -#define TK_NOW 228 -#define TK_TODAY 229 -#define TK_TIMEZONE 230 -#define TK_CLIENT_VERSION 231 -#define TK_SERVER_VERSION 232 -#define TK_SERVER_STATUS 233 -#define TK_CURRENT_USER 234 -#define TK_CASE 235 -#define TK_WHEN 236 -#define TK_THEN 237 -#define TK_ELSE 238 -#define TK_BETWEEN 239 -#define TK_IS 240 -#define TK_NK_LT 241 -#define TK_NK_GT 242 -#define TK_NK_LE 243 -#define TK_NK_GE 244 -#define TK_NK_NE 245 -#define TK_MATCH 246 -#define TK_NMATCH 247 -#define TK_CONTAINS 248 -#define TK_IN 249 -#define TK_JOIN 250 -#define TK_INNER 251 -#define TK_SELECT 252 -#define TK_DISTINCT 253 -#define TK_WHERE 254 -#define TK_PARTITION 255 -#define TK_BY 256 -#define TK_SESSION 257 -#define TK_STATE_WINDOW 258 -#define TK_EVENT_WINDOW 259 -#define TK_SLIDING 260 -#define TK_FILL 261 -#define TK_VALUE 262 -#define TK_VALUE_F 263 -#define TK_NONE 264 -#define TK_PREV 265 -#define TK_NULL_F 266 -#define TK_LINEAR 267 -#define TK_NEXT 268 -#define TK_HAVING 269 -#define TK_RANGE 270 -#define TK_EVERY 271 -#define TK_ORDER 272 -#define TK_SLIMIT 273 -#define TK_SOFFSET 274 -#define TK_LIMIT 275 -#define TK_OFFSET 276 -#define TK_ASC 277 -#define TK_NULLS 278 -#define TK_ABORT 279 -#define TK_AFTER 280 -#define TK_ATTACH 281 -#define TK_BEFORE 282 -#define TK_BEGIN 283 -#define TK_BITAND 284 -#define TK_BITNOT 285 -#define TK_BITOR 286 -#define TK_BLOCKS 287 -#define TK_CHANGE 288 -#define TK_COMMA 289 -#define TK_CONCAT 290 -#define TK_CONFLICT 291 -#define TK_COPY 292 -#define TK_DEFERRED 293 -#define TK_DELIMITERS 294 -#define TK_DETACH 295 -#define TK_DIVIDE 296 -#define TK_DOT 297 -#define TK_EACH 298 -#define TK_FAIL 299 -#define TK_FILE 300 -#define TK_FOR 301 -#define TK_GLOB 302 -#define TK_ID 303 -#define TK_IMMEDIATE 304 -#define TK_IMPORT 305 -#define TK_INITIALLY 306 -#define TK_INSTEAD 307 -#define TK_ISNULL 308 -#define TK_KEY 309 -#define TK_MODULES 310 -#define TK_NK_BITNOT 311 -#define TK_NK_SEMI 312 -#define TK_NOTNULL 313 -#define TK_OF 314 -#define TK_PLUS 315 -#define TK_PRIVILEGE 316 -#define TK_RAISE 317 -#define TK_RESTRICT 318 -#define TK_ROW 319 -#define TK_SEMI 320 -#define TK_STAR 321 -#define TK_STATEMENT 322 -#define TK_STRICT 323 -#define TK_STRING 324 -#define TK_TIMES 325 -#define TK_VALUES 326 -#define TK_VARIABLE 327 -#define TK_VIEW 328 -#define TK_WAL 329 +#define TK_OR 1 +#define TK_AND 2 +#define TK_UNION 3 +#define TK_ALL 4 +#define TK_MINUS 5 +#define TK_EXCEPT 6 +#define TK_INTERSECT 7 +#define TK_NK_BITAND 8 +#define TK_NK_BITOR 9 +#define TK_NK_LSHIFT 10 +#define TK_NK_RSHIFT 11 +#define TK_NK_PLUS 12 +#define TK_NK_MINUS 13 +#define TK_NK_STAR 14 +#define TK_NK_SLASH 15 +#define TK_NK_REM 16 +#define TK_NK_CONCAT 17 +#define TK_CREATE 18 +#define TK_ACCOUNT 19 +#define TK_NK_ID 20 +#define TK_PASS 21 +#define TK_NK_STRING 22 +#define TK_ALTER 23 +#define TK_PPS 24 +#define TK_TSERIES 25 +#define TK_STORAGE 26 +#define TK_STREAMS 27 +#define TK_QTIME 28 +#define TK_DBS 29 +#define TK_USERS 30 +#define TK_CONNS 31 +#define TK_STATE 32 +#define TK_USER 33 +#define TK_ENABLE 34 +#define TK_NK_INTEGER 35 +#define TK_SYSINFO 36 +#define TK_DROP 37 +#define TK_GRANT 38 +#define TK_ON 39 +#define TK_TO 40 +#define TK_REVOKE 41 +#define TK_FROM 42 +#define TK_SUBSCRIBE 43 +#define TK_NK_COMMA 44 +#define TK_READ 45 +#define TK_WRITE 46 +#define TK_NK_DOT 47 +#define TK_WITH 48 +#define TK_DNODE 49 +#define TK_PORT 50 +#define TK_DNODES 51 +#define TK_RESTORE 52 +#define TK_NK_IPTOKEN 53 +#define TK_FORCE 54 +#define TK_LOCAL 55 +#define TK_QNODE 56 +#define TK_BNODE 57 +#define TK_SNODE 58 +#define TK_MNODE 59 +#define TK_VNODE 60 +#define TK_DATABASE 61 +#define TK_USE 62 +#define TK_FLUSH 63 +#define TK_TRIM 64 +#define TK_COMPACT 65 +#define TK_IF 66 +#define TK_NOT 67 +#define TK_EXISTS 68 +#define TK_BUFFER 69 +#define TK_CACHEMODEL 70 +#define TK_CACHESIZE 71 +#define TK_COMP 72 +#define TK_DURATION 73 +#define TK_NK_VARIABLE 74 +#define TK_MAXROWS 75 +#define TK_MINROWS 76 +#define TK_KEEP 77 +#define TK_PAGES 78 +#define TK_PAGESIZE 79 +#define TK_TSDB_PAGESIZE 80 +#define TK_PRECISION 81 +#define TK_REPLICA 82 +#define TK_VGROUPS 83 +#define TK_SINGLE_STABLE 84 +#define TK_RETENTIONS 85 +#define TK_SCHEMALESS 86 +#define TK_WAL_LEVEL 87 +#define TK_WAL_FSYNC_PERIOD 88 +#define TK_WAL_RETENTION_PERIOD 89 +#define TK_WAL_RETENTION_SIZE 90 +#define TK_WAL_ROLL_PERIOD 91 +#define TK_WAL_SEGMENT_SIZE 92 +#define TK_STT_TRIGGER 93 +#define TK_TABLE_PREFIX 94 +#define TK_TABLE_SUFFIX 95 +#define TK_NK_COLON 96 +#define TK_MAX_SPEED 97 +#define TK_START 98 +#define TK_TIMESTAMP 99 +#define TK_END 100 +#define TK_TABLE 101 +#define TK_NK_LP 102 +#define TK_NK_RP 103 +#define TK_STABLE 104 +#define TK_ADD 105 +#define TK_COLUMN 106 +#define TK_MODIFY 107 +#define TK_RENAME 108 +#define TK_TAG 109 +#define TK_SET 110 +#define TK_NK_EQ 111 +#define TK_USING 112 +#define TK_TAGS 113 +#define TK_BOOL 114 +#define TK_TINYINT 115 +#define TK_SMALLINT 116 +#define TK_INT 117 +#define TK_INTEGER 118 +#define TK_BIGINT 119 +#define TK_FLOAT 120 +#define TK_DOUBLE 121 +#define TK_BINARY 122 +#define TK_NCHAR 123 +#define TK_UNSIGNED 124 +#define TK_JSON 125 +#define TK_VARCHAR 126 +#define TK_MEDIUMBLOB 127 +#define TK_BLOB 128 +#define TK_VARBINARY 129 +#define TK_DECIMAL 130 +#define TK_COMMENT 131 +#define TK_MAX_DELAY 132 +#define TK_WATERMARK 133 +#define TK_ROLLUP 134 +#define TK_TTL 135 +#define TK_SMA 136 +#define TK_DELETE_MARK 137 +#define TK_FIRST 138 +#define TK_LAST 139 +#define TK_SHOW 140 +#define TK_PRIVILEGES 141 +#define TK_DATABASES 142 +#define TK_TABLES 143 +#define TK_STABLES 144 +#define TK_MNODES 145 +#define TK_QNODES 146 +#define TK_FUNCTIONS 147 +#define TK_INDEXES 148 +#define TK_ACCOUNTS 149 +#define TK_APPS 150 +#define TK_CONNECTIONS 151 +#define TK_LICENCES 152 +#define TK_GRANTS 153 +#define TK_QUERIES 154 +#define TK_SCORES 155 +#define TK_TOPICS 156 +#define TK_VARIABLES 157 +#define TK_CLUSTER 158 +#define TK_BNODES 159 +#define TK_SNODES 160 +#define TK_TRANSACTIONS 161 +#define TK_DISTRIBUTED 162 +#define TK_CONSUMERS 163 +#define TK_SUBSCRIPTIONS 164 +#define TK_VNODES 165 +#define TK_ALIVE 166 +#define TK_LIKE 167 +#define TK_TBNAME 168 +#define TK_QTAGS 169 +#define TK_AS 170 +#define TK_INDEX 171 +#define TK_FUNCTION 172 +#define TK_INTERVAL 173 +#define TK_COUNT 174 +#define TK_LAST_ROW 175 +#define TK_TOPIC 176 +#define TK_META 177 +#define TK_CONSUMER 178 +#define TK_GROUP 179 +#define TK_DESC 180 +#define TK_DESCRIBE 181 +#define TK_RESET 182 +#define TK_QUERY 183 +#define TK_CACHE 184 +#define TK_EXPLAIN 185 +#define TK_ANALYZE 186 +#define TK_VERBOSE 187 +#define TK_NK_BOOL 188 +#define TK_RATIO 189 +#define TK_NK_FLOAT 190 +#define TK_OUTPUTTYPE 191 +#define TK_AGGREGATE 192 +#define TK_BUFSIZE 193 +#define TK_LANGUAGE 194 +#define TK_REPLACE 195 +#define TK_STREAM 196 +#define TK_INTO 197 +#define TK_TRIGGER 198 +#define TK_AT_ONCE 199 +#define TK_WINDOW_CLOSE 200 +#define TK_IGNORE 201 +#define TK_EXPIRED 202 +#define TK_FILL_HISTORY 203 +#define TK_UPDATE 204 +#define TK_SUBTABLE 205 +#define TK_KILL 206 +#define TK_CONNECTION 207 +#define TK_TRANSACTION 208 +#define TK_BALANCE 209 +#define TK_VGROUP 210 +#define TK_LEADER 211 +#define TK_MERGE 212 +#define TK_REDISTRIBUTE 213 +#define TK_SPLIT 214 +#define TK_DELETE 215 +#define TK_INSERT 216 +#define TK_NULL 217 +#define TK_NK_QUESTION 218 +#define TK_NK_ARROW 219 +#define TK_ROWTS 220 +#define TK_QSTART 221 +#define TK_QEND 222 +#define TK_QDURATION 223 +#define TK_WSTART 224 +#define TK_WEND 225 +#define TK_WDURATION 226 +#define TK_IROWTS 227 +#define TK_ISFILLED 228 +#define TK_CAST 229 +#define TK_NOW 230 +#define TK_TODAY 231 +#define TK_TIMEZONE 232 +#define TK_CLIENT_VERSION 233 +#define TK_SERVER_VERSION 234 +#define TK_SERVER_STATUS 235 +#define TK_CURRENT_USER 236 +#define TK_CASE 237 +#define TK_WHEN 238 +#define TK_THEN 239 +#define TK_ELSE 240 +#define TK_BETWEEN 241 +#define TK_IS 242 +#define TK_NK_LT 243 +#define TK_NK_GT 244 +#define TK_NK_LE 245 +#define TK_NK_GE 246 +#define TK_NK_NE 247 +#define TK_MATCH 248 +#define TK_NMATCH 249 +#define TK_CONTAINS 250 +#define TK_IN 251 +#define TK_JOIN 252 +#define TK_INNER 253 +#define TK_SELECT 254 +#define TK_DISTINCT 255 +#define TK_WHERE 256 +#define TK_PARTITION 257 +#define TK_BY 258 +#define TK_SESSION 259 +#define TK_STATE_WINDOW 260 +#define TK_EVENT_WINDOW 261 +#define TK_SLIDING 262 +#define TK_FILL 263 +#define TK_VALUE 264 +#define TK_VALUE_F 265 +#define TK_NONE 266 +#define TK_PREV 267 +#define TK_NULL_F 268 +#define TK_LINEAR 269 +#define TK_NEXT 270 +#define TK_HAVING 271 +#define TK_RANGE 272 +#define TK_EVERY 273 +#define TK_ORDER 274 +#define TK_SLIMIT 275 +#define TK_SOFFSET 276 +#define TK_LIMIT 277 +#define TK_OFFSET 278 +#define TK_ASC 279 +#define TK_NULLS 280 +#define TK_ABORT 281 +#define TK_AFTER 282 +#define TK_ATTACH 283 +#define TK_BEFORE 284 +#define TK_BEGIN 285 +#define TK_BITAND 286 +#define TK_BITNOT 287 +#define TK_BITOR 288 +#define TK_BLOCKS 289 +#define TK_CHANGE 290 +#define TK_COMMA 291 +#define TK_CONCAT 292 +#define TK_CONFLICT 293 +#define TK_COPY 294 +#define TK_DEFERRED 295 +#define TK_DELIMITERS 296 +#define TK_DETACH 297 +#define TK_DIVIDE 298 +#define TK_DOT 299 +#define TK_EACH 300 +#define TK_FAIL 301 +#define TK_FILE 302 +#define TK_FOR 303 +#define TK_GLOB 304 +#define TK_ID 305 +#define TK_IMMEDIATE 306 +#define TK_IMPORT 307 +#define TK_INITIALLY 308 +#define TK_INSTEAD 309 +#define TK_ISNULL 310 +#define TK_KEY 311 +#define TK_MODULES 312 +#define TK_NK_BITNOT 313 +#define TK_NK_SEMI 314 +#define TK_NOTNULL 315 +#define TK_OF 316 +#define TK_PLUS 317 +#define TK_PRIVILEGE 318 +#define TK_RAISE 319 +#define TK_RESTRICT 320 +#define TK_ROW 321 +#define TK_SEMI 322 +#define TK_STAR 323 +#define TK_STATEMENT 324 +#define TK_STRICT 325 +#define TK_STRING 326 +#define TK_TIMES 327 +#define TK_VALUES 328 +#define TK_VARIABLE 329 +#define TK_VIEW 330 +#define TK_WAL 331 + #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/function/function.h b/include/libs/function/function.h index aa5c78195a..85f7cf7e2c 100644 --- a/include/libs/function/function.h +++ b/include/libs/function/function.h @@ -99,11 +99,11 @@ typedef struct SSubsidiaryResInfo { } SSubsidiaryResInfo; typedef struct SResultDataInfo { - int16_t precision; - int16_t scale; - int16_t type; - int16_t bytes; - int32_t interBufSize; + int16_t precision; + int16_t scale; + int16_t type; + uint16_t bytes; + int32_t interBufSize; } SResultDataInfo; #define GET_RES_INFO(ctx) ((ctx)->resultInfo) diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 2323d044ec..f36792695f 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -350,6 +350,11 @@ typedef struct SDropComponentNodeStmt { int32_t dnodeId; } SDropComponentNodeStmt; +typedef struct SRestoreComponentNodeStmt { + ENodeType type; + int32_t dnodeId; +} SRestoreComponentNodeStmt; + typedef struct SCreateTopicStmt { ENodeType type; char topicName[TSDB_TABLE_NAME_LEN]; diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 3556a8ac95..a46d431d84 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -211,6 +211,10 @@ typedef enum ENodeType { QUERY_NODE_SHOW_DB_ALIVE_STMT, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT, QUERY_NODE_BALANCE_VGROUP_LEADER_STMT, + QUERY_NODE_RESTORE_DNODE_STMT, + QUERY_NODE_RESTORE_QNODE_STMT, + QUERY_NODE_RESTORE_MNODE_STMT, + QUERY_NODE_RESTORE_VNODE_STMT, // logic plan node QUERY_NODE_LOGIC_PLAN_SCAN = 1000, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index ad4b59714c..197a5ecaf9 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -185,6 +185,7 @@ typedef struct SMergeLogicNode { int32_t numOfChannels; int32_t srcGroupId; bool groupSort; + bool ignoreGroupId; } SMergeLogicNode; typedef enum EWindowType { @@ -444,6 +445,7 @@ typedef struct SMergePhysiNode { int32_t numOfChannels; int32_t srcGroupId; bool groupSort; + bool ignoreGroupId; } SMergePhysiNode; typedef struct SWinodwPhysiNode { diff --git a/include/libs/parser/parser.h b/include/libs/parser/parser.h index 558203052f..94fb6824d2 100644 --- a/include/libs/parser/parser.h +++ b/include/libs/parser/parser.h @@ -114,7 +114,7 @@ STableDataCxt* smlInitTableDataCtx(SQuery* query, STableMeta* pTableMeta); int32_t smlBindData(SQuery* handle, bool dataFormat, SArray* tags, SArray* colsSchema, SArray* cols, STableMeta* pTableMeta, char* tableName, const char* sTableName, int32_t sTableNameLen, int32_t ttl, - char* msgBuf, int16_t msgBufLen); + char* msgBuf, int32_t msgBufLen); int32_t smlBuildOutput(SQuery* handle, SHashObj* pVgHash); int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreateTbReq* pCreateTb, TAOS_FIELD *fields, int numFields, bool needChangeLength); diff --git a/include/libs/tfs/tfs.h b/include/libs/tfs/tfs.h index cbf1d60e35..622cd615b8 100644 --- a/include/libs/tfs/tfs.h +++ b/include/libs/tfs/tfs.h @@ -133,6 +133,16 @@ int32_t tfsMkdirAt(STfs *pTfs, const char *rname, SDiskID diskId); */ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId); +/** + * @brief check directories exist in tfs. + * + * @param pTfs The fs object. + * @param rname The rel name of directory. + * @param diskId The disk ID. + * @return true for exist, false for not exist. + */ +bool tfsDirExistAt(STfs *pTfs, const char *rname, SDiskID diskId); + /** * @brief Remove directory at all levels in tfs. * diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 5dd60d7c7b..c94d2b4094 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -406,6 +406,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_SNODE_NOT_DEPLOYED TAOS_DEF_ERROR_CODE(0, 0x0411) #define TSDB_CODE_MNODE_NOT_CATCH_UP TAOS_DEF_ERROR_CODE(0, 0x0412) // internal #define TSDB_CODE_MNODE_ALREADY_IS_VOTER TAOS_DEF_ERROR_CODE(0, 0x0413) // internal +#define TSDB_CODE_MNODE_ONLY_TWO_MNODE TAOS_DEF_ERROR_CODE(0, 0x0414) // internal // vnode // #define TSDB_CODE_VND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0500) // 2.x @@ -442,6 +443,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_VND_QUERY_BUSY TAOS_DEF_ERROR_CODE(0, 0x0531) #define TSDB_CODE_VND_NOT_CATCH_UP TAOS_DEF_ERROR_CODE(0, 0x0532) // internal #define TSDB_CODE_VND_ALREADY_IS_VOTER TAOS_DEF_ERROR_CODE(0, 0x0533) // internal +#define TSDB_CODE_VND_DIR_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0534) // tsdb #define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600) diff --git a/include/util/tdef.h b/include/util/tdef.h index 664f22eeed..71fb91dbcb 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -232,13 +232,7 @@ typedef enum ELogicConditionType { #define TSDB_QUERY_ID_LEN 26 #define TSDB_TRANS_OPER_LEN 16 -/** - * In some scenarios uint16_t (0~65535) is used to store the row len. - * - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header. - * - Secondly, if all cols are VarDataT type except primary key, we need 4 bits to store the offset, thus - * the final value is 65531-(4096-1)*4 = 49151. - */ -#define TSDB_MAX_BYTES_PER_ROW 49151 +#define TSDB_MAX_BYTES_PER_ROW 65531 // 49151:65531 #define TSDB_MAX_TAGS_LEN 16384 #define TSDB_MAX_TAGS 128 @@ -273,6 +267,9 @@ typedef enum ELogicConditionType { #define TSDB_DNODE_CONFIG_LEN 128 #define TSDB_DNODE_VALUE_LEN 256 +#define TSDB_ACTIVE_KEY_LEN 109 // history 109:? +#define TSDB_CONN_ACTIVE_KEY_LEN 257 // history 257:? + #define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE #define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE @@ -410,9 +407,9 @@ typedef enum ELogicConditionType { #define TSDB_EXPLAIN_RESULT_ROW_SIZE (16 * 1024) #define TSDB_EXPLAIN_RESULT_COLUMN_NAME "QUERY_PLAN" -#define TSDB_MAX_FIELD_LEN 16384 -#define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 -#define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 +#define TSDB_MAX_FIELD_LEN 65519 // 16384:65519 +#define TSDB_MAX_BINARY_LEN TSDB_MAX_FIELD_LEN // 16384-8:65519 +#define TSDB_MAX_NCHAR_LEN TSDB_MAX_FIELD_LEN // 16384-8:65519 #define PRIMARYKEY_TIMESTAMP_COL_ID 1 #define COL_REACH_END(colId, maxColId) ((colId) > (maxColId)) diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 8e20d7d275..ab8e20b85e 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -361,7 +361,7 @@ void stopAllRequests(SHashObj* pRequests); // conn level int hbRegisterConn(SAppHbMgr* pAppHbMgr, int64_t tscRefId, int64_t clusterId, int8_t connType); -void hbDeregisterConn(SAppHbMgr* pAppHbMgr, SClientHbKey connKey, void* param); +void hbDeregisterConn(STscObj* pTscObj, SClientHbKey connKey); typedef struct SSqlCallbackWrapper { SParseContext* pParseCtx; diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 07ca3d8909..c8f3feb2d4 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -244,7 +244,7 @@ void destroyTscObj(void *pObj) { tscTrace("begin to destroy tscObj %" PRIx64 " p:%p", tscId, pTscObj); SClientHbKey connKey = {.tscRid = pTscObj->id, .connType = pTscObj->connType}; - hbDeregisterConn(pTscObj->pAppInfo->pAppHbMgr, connKey, pTscObj->passInfo.fp); + hbDeregisterConn(pTscObj, connKey); destroyAllRequests(pTscObj->pRequests); taosHashCleanup(pTscObj->pRequests); diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 79435da89f..203aad8068 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -994,6 +994,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) { // init stat pAppHbMgr->startTime = taosGetTimestampMs(); pAppHbMgr->connKeyCnt = 0; + pAppHbMgr->passKeyCnt = 0; pAppHbMgr->reportCnt = 0; pAppHbMgr->reportBytes = 0; pAppHbMgr->key = taosStrdup(key); @@ -1154,7 +1155,8 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int64_t tscRefId, int64_t clusterId, in } } -void hbDeregisterConn(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, void *param) { +void hbDeregisterConn(STscObj *pTscObj, SClientHbKey connKey) { + SAppHbMgr *pAppHbMgr = pTscObj->pAppInfo->pAppHbMgr; SClientHbReq *pReq = taosHashAcquire(pAppHbMgr->activeInfo, &connKey, sizeof(SClientHbKey)); if (pReq) { tFreeClientHbReq(pReq); @@ -1167,7 +1169,10 @@ void hbDeregisterConn(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, void *param) { } atomic_sub_fetch_32(&pAppHbMgr->connKeyCnt, 1); - if (param) { + + taosThreadMutexLock(&pTscObj->mutex); + if (pTscObj->passInfo.fp) { atomic_sub_fetch_32(&pAppHbMgr->passKeyCnt, 1); } -} + taosThreadMutexUnlock(&pTscObj->mutex); +} \ No newline at end of file diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index aed11b4fb1..243a84ca93 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -134,11 +134,15 @@ int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type) switch (type) { case TAOS_NOTIFY_PASSVER: { + taosThreadMutexLock(&pObj->mutex); + if (fp && !pObj->passInfo.fp) { + atomic_add_fetch_32(&pObj->pAppInfo->pAppHbMgr->passKeyCnt, 1); + } else if (!fp && pObj->passInfo.fp) { + atomic_sub_fetch_32(&pObj->pAppInfo->pAppHbMgr->passKeyCnt, 1); + } pObj->passInfo.fp = fp; pObj->passInfo.param = param; - if (fp) { - atomic_add_fetch_32(&pObj->pAppInfo->pAppHbMgr->passKeyCnt, 1); - } + taosThreadMutexUnlock(&pObj->mutex); break; } default: { @@ -1338,6 +1342,8 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) { goto _return; } + pRequest->syncQuery = true; + STscObj *pTscObj = pRequest->pTscObj; code = transferTableNameList(tableNameList, pTscObj->acctId, pTscObj->db, &catalogReq.pTableMeta); if (code) { @@ -1364,7 +1370,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) { tsem_wait(&pParam->sem); _return: - taosArrayDestroy(catalogReq.pTableMeta); + taosArrayDestroyEx(catalogReq.pTableMeta, destoryTablesReq); destroyRequest(pRequest); return code; } diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 011a1b3111..d12e0b5c19 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -558,15 +558,21 @@ static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSm return 0; } +#define BOUNDARY 1024 static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) { int32_t result = 1; - while (result <= length) { - result *= 2; + if (length >= BOUNDARY){ + result = length; + }else{ + while (result <= length) { + result <<= 1; + } } + if (type == TSDB_DATA_TYPE_BINARY && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) { result = TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE; - } else if (type == TSDB_DATA_TYPE_NCHAR && result > (TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { - result = (TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE; + } else if (type == TSDB_DATA_TYPE_NCHAR && result > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { + result = (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE; } if (type == TSDB_DATA_TYPE_NCHAR) { @@ -649,6 +655,17 @@ static int32_t smlBuildFieldsList(SSmlHandle *info, SSchema *schemaField, SHashO field->bytes = getBytes(kv->type, kv->length); } } + + int32_t maxLen = isTag ? TSDB_MAX_TAGS_LEN : TSDB_MAX_BYTES_PER_ROW; + int32_t len = 0; + for (int j = 0; j < taosArrayGetSize(results); ++j) { + SField *field = taosArrayGet(results, j); + len += field->bytes; + } + if (len > maxLen) { + return isTag ? TSDB_CODE_PAR_INVALID_TAGS_LENGTH : TSDB_CODE_PAR_INVALID_ROW_LENGTH; + } + return TSDB_CODE_SUCCESS; } @@ -781,11 +798,15 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) { code = smlBuildFieldsList(info, NULL, NULL, sTableData->tags, pTags, 0, true); if (code != TSDB_CODE_SUCCESS) { uError("SML:0x%" PRIx64 " smlBuildFieldsList tag1 failed. %s", info->id, pName.tname); + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); goto end; } code = smlBuildFieldsList(info, NULL, NULL, sTableData->cols, pColumns, 0, false); if (code != TSDB_CODE_SUCCESS) { uError("SML:0x%" PRIx64 " smlBuildFieldsList col1 failed. %s", info->id, pName.tname); + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); goto end; } code = smlSendMetaMsg(info, &pName, pColumns, pTags, NULL, SCHEMA_ACTION_CREATE_STABLE); @@ -837,6 +858,23 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) { pTableMeta->tableInfo.numOfColumns, true); if (code != TSDB_CODE_SUCCESS) { uError("SML:0x%" PRIx64 " smlBuildFieldsList tag2 failed. %s", info->id, pName.tname); + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); + goto end; + } + + if (taosArrayGetSize(pTags) + pTableMeta->tableInfo.numOfColumns > TSDB_MAX_COLUMNS) { + uError("SML:0x%" PRIx64 " too many columns than 4096", info->id); + code = TSDB_CODE_PAR_TOO_MANY_COLUMNS; + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); + goto end; + } + if (taosArrayGetSize(pTags) > TSDB_MAX_TAGS) { + uError("SML:0x%" PRIx64 " too many tags than 128", info->id); + code = TSDB_CODE_PAR_INVALID_TAGS_NUM; + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); goto end; } @@ -891,6 +929,16 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) { pTableMeta->tableInfo.numOfColumns, false); if (code != TSDB_CODE_SUCCESS) { uError("SML:0x%" PRIx64 " smlBuildFieldsList col2 failed. %s", info->id, pName.tname); + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); + goto end; + } + + if (taosArrayGetSize(pColumns) + pTableMeta->tableInfo.numOfTags > TSDB_MAX_COLUMNS) { + uError("SML:0x%" PRIx64 " too many columns than 4096", info->id); + code = TSDB_CODE_PAR_TOO_MANY_COLUMNS; + taosArrayDestroy(pColumns); + taosArrayDestroy(pTags); goto end; } @@ -1171,6 +1219,7 @@ static int32_t smlPushCols(SArray *colsArray, SArray *cols) { SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, i); taosHashPut(kvHash, kv->key, kv->keyLen, &kv, POINTER_BYTES); if (terrno == TSDB_CODE_DUP_KEY) { + taosHashCleanup(kvHash); return terrno; } } @@ -1244,12 +1293,12 @@ static int32_t smlParseLineBottom(SSmlHandle *info) { uDebug("SML:0x%" PRIx64 " smlParseLineBottom add meta, format:%d, linenum:%d", info->id, info->dataFormat, info->lineNum); SSmlSTableMeta *meta = smlBuildSTableMeta(info->dataFormat); + taosHashPut(info->superTables, elements->measure, elements->measureLen, &meta, POINTER_BYTES); 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); } } uDebug("SML:0x%" PRIx64 " smlParseLineBottom end, format:%d, linenum:%d", info->id, info->dataFormat, info->lineNum); @@ -1498,8 +1547,11 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL do { code = smlModifyDBSchemas(info); - if (code == 0) break; - taosMsleep(500); + if (code == 0 || code == TSDB_CODE_SML_INVALID_DATA || code == TSDB_CODE_PAR_TOO_MANY_COLUMNS || + code == TSDB_CODE_PAR_INVALID_TAGS_NUM || code == TSDB_CODE_PAR_INVALID_ROW_LENGTH || + code == TSDB_CODE_PAR_INVALID_TAGS_LENGTH) + break; + taosMsleep(100); uInfo("SML:0x%" PRIx64 " smlModifyDBSchemas retry code:%s, times:%d", info->id, tstrerror(code), retryNum); } while (retryNum++ < taosHashGetSize(info->superTables) * MAX_RETRY_TIMES); diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c index 9fd98e33b7..b0ae316031 100644 --- a/source/client/src/clientSmlJson.c +++ b/source/client/src/clientSmlJson.c @@ -575,7 +575,7 @@ static int32_t smlConvertJSONString(SSmlKv *pVal, char *typeStr, cJSON *value) { uError("OTD:invalid type(%s) for JSON String", typeStr); return TSDB_CODE_TSC_INVALID_JSON_TYPE; } - pVal->length = (int16_t)strlen(value->valuestring); + pVal->length = strlen(value->valuestring); if (pVal->type == TSDB_DATA_TYPE_BINARY && pVal->length > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) { return TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN; diff --git a/source/client/src/clientSmlLine.c b/source/client/src/clientSmlLine.c index 335e3a1dc7..db2f2bd9fe 100644 --- a/source/client/src/clientSmlLine.c +++ b/source/client/src/clientSmlLine.c @@ -236,7 +236,7 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd, SSmlLin PROCESS_SLASH(value, valueLen) } - if (unlikely(valueLen > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)) { + if (unlikely(valueLen > (TSDB_MAX_TAGS_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)) { return TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN; } diff --git a/source/client/src/clientSmlTelnet.c b/source/client/src/clientSmlTelnet.c index 036442573d..3a9aad4e81 100644 --- a/source/client/src/clientSmlTelnet.c +++ b/source/client/src/clientSmlTelnet.c @@ -158,7 +158,7 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS return TSDB_CODE_TSC_INVALID_VALUE; } - if (unlikely(valueLen > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)) { + if (unlikely(valueLen > (TSDB_MAX_TAGS_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)) { return TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN; } diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 76fd1d84d0..b9d4e4edab 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -2517,6 +2517,31 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a *numOfAssignment = num; } + for (int32_t j = 0; j < (*numOfAssignment); ++j) { + tmq_topic_assignment* p = &(*assignment)[j]; + + for(int32_t i = 0; i < taosArrayGetSize(pTopic->vgs); ++i) { + SMqClientVg* pClientVg = taosArrayGet(pTopic->vgs, i); + if (pClientVg->vgId != p->vgId) { + continue; + } + + SVgOffsetInfo* pOffsetInfo = &pClientVg->offsetInfo; + + pOffsetInfo->currentOffset.type = TMQ_OFFSET__LOG; + + char offsetBuf[80] = {0}; + tFormatOffset(offsetBuf, tListLen(offsetBuf), &pOffsetInfo->currentOffset); + + tscDebug("vgId:%d offset is update to:%s", p->vgId, offsetBuf); + + pOffsetInfo->walVerBegin = p->begin; + pOffsetInfo->walVerEnd = p->end; + pOffsetInfo->currentOffset.version = p->currentOffset; + pOffsetInfo->committedOffset.version = p->currentOffset; + } + } + destroyCommonInfo(pCommon); return code; } else { @@ -2564,7 +2589,8 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_ } if (offset < pOffsetInfo->walVerBegin || offset > pOffsetInfo->walVerEnd) { - tscError("consumer:0x%" PRIx64 " invalid seek params, offset:%" PRId64, tmq->consumerId, offset); + tscError("consumer:0x%" PRIx64 " invalid seek params, offset:%" PRId64 ", valid range:[%" PRId64 ", %" PRId64 "]", + tmq->consumerId, offset, pOffsetInfo->walVerBegin, pOffsetInfo->walVerEnd); return TSDB_CODE_INVALID_PARA; } diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp index f15a93cb2c..f1d1ad0865 100644 --- a/source/client/test/clientTests.cpp +++ b/source/client/test/clientTests.cpp @@ -1122,6 +1122,8 @@ TEST(clientCase, sub_tb_test) { return; } + tmq_offset_seek(tmq, "topic_t1", pAssign[0].vgId, 0); + while (1) { TAOS_RES* pRes = tmq_consumer_poll(tmq, timeout); if (pRes != NULL) { diff --git a/source/common/src/systable.c b/source/common/src/systable.c index cd3dd63ef0..062bae68c8 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -35,6 +35,10 @@ static const SSysDbTableSchema dnodesSchema[] = { {.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}, +#ifdef TD_ENTERPRISE + {.name = "active_code", .bytes = TSDB_ACTIVE_KEY_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "c_active_code", .bytes = TSDB_CONN_ACTIVE_KEY_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +#endif }; static const SSysDbTableSchema mnodesSchema[] = { diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 796c5cf8ff..62f837f3b6 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -755,7 +755,7 @@ SColVal *tRowIterNext(SRowIter *pIter) { } if (pIter->pRow->flag == HAS_NULL) { - pIter->cv = COL_VAL_NULL(pTColumn->type, pTColumn->colId); + pIter->cv = COL_VAL_NULL(pTColumn->colId, pTColumn->type); goto _exit; } @@ -2439,7 +2439,7 @@ _exit: int32_t tColDataAddValueByDataBlock(SColData *pColData, int8_t type, int32_t bytes, int32_t nRows, char *lengthOrbitmap, char *data) { int32_t code = 0; - if(data == NULL){ + if (data == NULL) { for (int32_t i = 0; i < nRows; ++i) { code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_NONE](pColData, NULL, 0); } @@ -2453,8 +2453,9 @@ int32_t tColDataAddValueByDataBlock(SColData *pColData, int8_t type, int32_t byt code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_NULL](pColData, NULL, 0); if (code) goto _exit; } else { - if(ASSERT(varDataTLen(data + offset) <= bytes)){ - uError("var data length invalid, varDataTLen(data + offset):%d <= bytes:%d", (int)varDataTLen(data + offset), bytes); + if (ASSERT(varDataTLen(data + offset) <= bytes)) { + uError("var data length invalid, varDataTLen(data + offset):%d <= bytes:%d", (int)varDataTLen(data + offset), + bytes); code = TSDB_CODE_INVALID_PARA; goto _exit; } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 4139d6c7d4..9face5ee3f 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1720,6 +1720,33 @@ int32_t tDeserializeSDropDnodeReq(void *buf, int32_t bufLen, SDropDnodeReq *pReq return 0; } +int32_t tSerializeSRestoreDnodeReq(void *buf, int32_t bufLen, SRestoreDnodeReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + if (tEncodeI8(&encoder, pReq->restoreType) < 0) return -1; + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSRestoreDnodeReq(void *buf, int32_t bufLen, SRestoreDnodeReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + if (tDecodeI8(&decoder, &pReq->restoreType) < 0) return -1; + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + int32_t tSerializeSMCfgDnodeReq(void *buf, int32_t bufLen, SMCfgDnodeReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); @@ -7691,4 +7718,4 @@ void tDeleteMqSubTopicEp(SMqSubTopicEp *pSubTopicEp) { taosMemoryFreeClear(pSubTopicEp->schema.pSchema); pSubTopicEp->schema.nCols = 0; taosArrayDestroy(pSubTopicEp->vgs); -} \ No newline at end of file +} diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 76fe0ec2de..4bd3eaae84 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -174,6 +174,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_SERVER_VERSION, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_INDEX, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_INDEX, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_RESTORE_DNODE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 9dbc12cf62..05b649e16e 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -255,7 +255,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); if (pVnode != NULL) { - dInfo("vgId:%d, already exist", req.vgId); + dError("vgId:%d, already exist", req.vgId); tFreeSCreateVnodeReq(&req); vmReleaseVnode(pMgmt, pVnode); terrno = TSDB_CODE_VND_ALREADY_EXIST; @@ -264,7 +264,22 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, vnodeCfg.vgId); - if (vnodeCreate(path, &vnodeCfg, pMgmt->pTfs) < 0) { + + if (pMgmt->pTfs) { + if (tfsDirExistAt(pMgmt->pTfs, path, (SDiskID){0})) { + terrno = TSDB_CODE_VND_DIR_ALREADY_EXIST; + dError("vgId:%d, failed to restore vnode since %s", req.vgId, terrstr()); + return -1; + } + } else { + if (taosDirExist(path)) { + terrno = TSDB_CODE_VND_DIR_ALREADY_EXIST; + dError("vgId:%d, failed to restore vnode since %s", req.vgId, terrstr()); + return -1; + } + } + +if (vnodeCreate(path, &vnodeCfg, pMgmt->pTfs) < 0) { tFreeSCreateVnodeReq(&req); dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr()); code = terrno; @@ -344,6 +359,7 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { ESyncRole role = vnodeGetRole(pVnode->pImpl); dInfo("vgId:%d, checking node role:%d", req.vgId, role); if(role == TAOS_SYNC_ROLE_VOTER){ + dError("vgId:%d, failed to alter vnode type since node already is role:%d", req.vgId, role); terrno = TSDB_CODE_VND_ALREADY_IS_VOTER; vmReleaseVnode(pMgmt, pVnode); return -1; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index a7c4b2e70e..ef4a2b52bb 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -60,7 +60,7 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { if (IsReq(pMsg)) { if (code != 0) { if (terrno != 0) code = terrno; - dGError("msg:%p, failed to process since %s, type:%s", pMsg, terrstr(code), TMSG_INFO(pMsg->msgType)); + dGError("msg:%p, failed to process since %s, type:%s", pMsg, tstrerror(code), TMSG_INFO(pMsg->msgType)); } vmSendRsp(pMsg, code); } diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 3459af1a3a..56bff0c760 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -218,6 +218,7 @@ static int32_t dmProcessAlterNodeTypeReq(EDndNodeType ntype, SRpcMsg *pMsg) { ESyncRole role = (*pWrapper->func.nodeRoleFp)(pWrapper->pMgmt); dInfo("node:%s, checking node role:%d", pWrapper->name, role); if(role == TAOS_SYNC_ROLE_VOTER){ + dError("node:%s, failed to alter node type since node already is role:%d", pWrapper->name, role); terrno = TSDB_CODE_MNODE_ALREADY_IS_VOTER; return -1; } diff --git a/source/dnode/mnode/impl/CMakeLists.txt b/source/dnode/mnode/impl/CMakeLists.txt index b9aa8eb674..010067e99f 100644 --- a/source/dnode/mnode/impl/CMakeLists.txt +++ b/source/dnode/mnode/impl/CMakeLists.txt @@ -6,6 +6,7 @@ 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) LIST(APPEND MNODE_SRC ${TD_ENTERPRISE_DIR}/src/plugins/mnode/src/mndVgroup.c) + LIST(APPEND MNODE_SRC ${TD_ENTERPRISE_DIR}/src/plugins/mnode/src/mndDnode.c) ENDIF () add_library(mnode STATIC ${MNODE_SRC}) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index f547ce025d..8d1a811f14 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -118,7 +118,7 @@ typedef enum { } ETrnPolicy; typedef enum { - TRN_EXEC_PRARLLEL = 0, + TRN_EXEC_PARALLEL = 0, TRN_EXEC_SERIAL = 1, } ETrnExec; @@ -177,6 +177,7 @@ typedef struct { SArray* pRpcArray; SRWLatch lockRpcArray; int64_t mTraceId; + TdThreadMutex mutex; } STrans; typedef struct { @@ -205,6 +206,8 @@ typedef struct { uint16_t port; char fqdn[TSDB_FQDN_LEN]; char ep[TSDB_EP_LEN]; + char active[TSDB_ACTIVE_KEY_LEN]; + char connActive[TSDB_CONN_ACTIVE_KEY_LEN]; } SDnodeObj; typedef struct { diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index ebbabdfa33..83c2277612 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -29,7 +29,7 @@ void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode); SEpSet mndGetDnodeEpset(SDnodeObj *pDnode); int32_t mndGetDnodeSize(SMnode *pMnode); bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs); -void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps); +void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeInfo); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/inc/mndMnode.h b/source/dnode/mnode/impl/inc/mndMnode.h index 320d3651f0..44eddb0617 100644 --- a/source/dnode/mnode/impl/inc/mndMnode.h +++ b/source/dnode/mnode/impl/inc/mndMnode.h @@ -29,6 +29,10 @@ void mndReleaseMnode(SMnode *pMnode, SMnodeObj *pObj); bool mndIsMnode(SMnode *pMnode, int32_t dnodeId); void mndGetMnodeEpSet(SMnode *pMnode, SEpSet *pEpSet); int32_t mndSetDropMnodeInfoToTrans(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj, bool force); +int32_t mndSetRestoreCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj); +int32_t mndSetCreateMnodeCommitLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj); +int32_t mndSetRestoreAlterMnodeTypeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj); +int32_t mndSetRestoreCreateMnodeRedoLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/inc/mndQnode.h b/source/dnode/mnode/impl/inc/mndQnode.h index 36eebd3157..d4f364d821 100644 --- a/source/dnode/mnode/impl/inc/mndQnode.h +++ b/source/dnode/mnode/impl/inc/mndQnode.h @@ -30,6 +30,9 @@ SQnodeObj *mndAcquireQnode(SMnode *pMnode, int32_t qnodeId); void mndReleaseQnode(SMnode *pMnode, SQnodeObj *pObj); int32_t mndCreateQnodeList(SMnode *pMnode, SArray **pList, int32_t limit); int32_t mndSetDropQnodeInfoToTrans(SMnode *pMnode, STrans *pTrans, SQnodeObj *pObj, bool force); +bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId); +int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj); +int32_t mndSetCreateQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQnodeObj *pObj); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h index 057e3efbbc..03434573c4 100644 --- a/source/dnode/mnode/impl/inc/mndTrans.h +++ b/source/dnode/mnode/impl/inc/mndTrans.h @@ -76,6 +76,7 @@ void mndTransSetRpcRsp(STrans *pTrans, void *pCont, int32_t contLen); void mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, void *param, int32_t paramLen); void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname); void mndTransSetSerial(STrans *pTrans); +void mndTransSetParallel(STrans *pTrans); void mndTransSetOper(STrans *pTrans, EOperType oper); int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans); diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index 0229735952..2ece0da5eb 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -49,6 +49,11 @@ int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid); +bool mndVgroupInDnode(SVgObj *pVgroup, int32_t dnodeId); +int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, + SDnodeObj *pDnode); + +int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgroup); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 1f58ae97a3..002407ce8a 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -27,7 +27,7 @@ #include "tmisce.h" #include "mndCluster.h" -#define TSDB_DNODE_VER_NUMBER 1 +#define TSDB_DNODE_VER_NUMBER 2 #define TSDB_DNODE_RESERVE_SIZE 64 static const char *offlineReason[] = { @@ -58,6 +58,7 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq); static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq); static int32_t mndProcessConfigDnodeRsp(SRpcMsg *pRsp); static int32_t mndProcessStatusReq(SRpcMsg *pReq); +static int32_t mndProcessRestoreDnodeReq(SRpcMsg *pReq); static int32_t mndRetrieveConfigs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextConfig(SMnode *pMnode, void *pIter); @@ -83,6 +84,7 @@ int32_t mndInitDnode(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_MND_STATUS, mndProcessStatusReq); mndSetMsgHandle(pMnode, TDMT_MND_DNODE_LIST, mndProcessDnodeListReq); mndSetMsgHandle(pMnode, TDMT_MND_SHOW_VARIABLES, mndProcessShowVariablesReq); + mndSetMsgHandle(pMnode, TDMT_MND_RESTORE_DNODE, mndProcessRestoreDnodeReq); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_CONFIGS, mndRetrieveConfigs); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_CONFIGS, mndCancelGetNextConfig); @@ -139,6 +141,10 @@ static SSdbRaw *mndDnodeActionEncode(SDnodeObj *pDnode) { SDB_SET_INT16(pRaw, dataPos, pDnode->port, _OVER) SDB_SET_BINARY(pRaw, dataPos, pDnode->fqdn, TSDB_FQDN_LEN, _OVER) SDB_SET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) + SDB_SET_INT16(pRaw, dataPos, TSDB_ACTIVE_KEY_LEN, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pDnode->active, TSDB_ACTIVE_KEY_LEN, _OVER) + SDB_SET_INT16(pRaw, dataPos, TSDB_CONN_ACTIVE_KEY_LEN, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pDnode->connActive, TSDB_CONN_ACTIVE_KEY_LEN, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER); terrno = 0; @@ -161,7 +167,7 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) { int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; - if (sver != TSDB_DNODE_VER_NUMBER) { + if (sver < 1 || sver > TSDB_DNODE_VER_NUMBER) { terrno = TSDB_CODE_SDB_INVALID_DATA_VER; goto _OVER; } @@ -179,6 +185,13 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) { SDB_GET_INT16(pRaw, dataPos, &pDnode->port, _OVER) SDB_GET_BINARY(pRaw, dataPos, pDnode->fqdn, TSDB_FQDN_LEN, _OVER) SDB_GET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) + if (sver > 1) { + int16_t keyLen = 0; + SDB_GET_INT16(pRaw, dataPos, &keyLen, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pDnode->active, keyLen, _OVER) + SDB_GET_INT16(pRaw, dataPos, &keyLen, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pDnode->connActive, keyLen, _OVER) + } terrno = 0; if (tmsgUpdateDnodeInfo(&pDnode->id, NULL, pDnode->fqdn, &pDnode->port)) { @@ -294,6 +307,11 @@ int32_t mndGetDnodeSize(SMnode *pMnode) { return sdbGetSize(pSdb, SDB_DNODE); } +int32_t mndGetDbSize(SMnode *pMnode) { + SSdb *pSdb = pMnode->pSdb; + return sdbGetSize(pSdb, SDB_DB); +} + bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs) { int64_t interval = TABS(pDnode->lastAccessTime - curMs); if (interval > 5000 * (int64_t)tsStatusInterval) { @@ -305,7 +323,7 @@ bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs) { return true; } -void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps) { +static void mndGetDnodeEps(SMnode *pMnode, SArray *pDnodeEps) { SSdb *pSdb = pMnode->pSdb; int32_t numOfEps = 0; @@ -330,6 +348,34 @@ void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps) { } } +void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeInfo) { + SSdb *pSdb = pMnode->pSdb; + + int32_t numOfEps = 0; + void *pIter = NULL; + while (1) { + SDnodeObj *pDnode = NULL; + ESdbStatus objStatus = 0; + pIter = sdbFetchAll(pSdb, SDB_DNODE, pIter, (void **)&pDnode, &objStatus, true); + if (pIter == NULL) break; + + SDnodeInfo dInfo; + dInfo.id = pDnode->id; + dInfo.ep.port = pDnode->port; + tstrncpy(dInfo.ep.fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + tstrncpy(dInfo.active, pDnode->active, TSDB_ACTIVE_KEY_LEN); + tstrncpy(dInfo.connActive, pDnode->connActive, TSDB_CONN_ACTIVE_KEY_LEN); + sdbRelease(pSdb, pDnode); + if (mndIsMnode(pMnode, pDnode->id)) { + dInfo.isMnode = 1; + } else { + dInfo.isMnode = 0; + } + + taosArrayPush(pDnodeInfo, &dInfo); + } +} + static int32_t mndCheckClusterCfgPara(SMnode *pMnode, SDnodeObj *pDnode, const SClusterCfg *pCfg) { if (pCfg->statusInterval != tsStatusInterval) { mError("dnode:%d, statusInterval:%d inconsistent with cluster:%d", pDnode->id, pCfg->statusInterval, @@ -536,7 +582,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { goto _OVER; } - mndGetDnodeData(pMnode, statusRsp.pDnodeEps); + mndGetDnodeEps(pMnode, statusRsp.pDnodeEps); int32_t contLen = tSerializeSStatusRsp(NULL, 0, &statusRsp); void *pHead = rpcMallocCont(contLen); @@ -745,6 +791,18 @@ _OVER: return code; } +extern int32_t mndProcessRestoreDnodeReqImpl(SRpcMsg *pReq); + +int32_t mndProcessRestoreDnodeReq(SRpcMsg *pReq){ + return mndProcessRestoreDnodeReqImpl(pReq); +} + +#ifndef TD_ENTERPRISE +int32_t mndProcessRestoreDnodeReqImpl(SRpcMsg *pReq){ + return 0; +} +#endif + static int32_t mndDropDnode(SMnode *pMnode, SRpcMsg *pReq, SDnodeObj *pDnode, SMnodeObj *pMObj, SQnodeObj *pQObj, SSnodeObj *pSObj, int32_t numOfVnodes, bool force) { int32_t code = -1; @@ -1041,6 +1099,7 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ESdbStatus objStatus = 0; SDnodeObj *pDnode = NULL; int64_t curMs = taosGetTimestampMs(); + char buf[TSDB_CONN_ACTIVE_KEY_LEN + VARSTR_HEADER_SIZE]; // make sure TSDB_CONN_ACTIVE_KEY_LEN >= TSDB_EP_LEN while (numOfRows < rows) { pShow->pIter = sdbFetchAll(pSdb, SDB_DNODE, pShow->pIter, (void **)&pDnode, &objStatus, true); @@ -1052,7 +1111,6 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->id, false); - char buf[tListLen(pDnode->ep) + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(buf, pDnode->ep, pShow->pMeta->pSchemas[cols].bytes); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); @@ -1077,10 +1135,9 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB status = "offline"; } - char b1[16] = {0}; - STR_TO_VARSTR(b1, status); + STR_TO_VARSTR(buf, status); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, b1, false); + colDataSetVal(pColInfo, numOfRows, buf, false); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->createdTime, false); @@ -1095,6 +1152,16 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB colDataSetVal(pColInfo, numOfRows, b, false); taosMemoryFreeClear(b); +#ifdef TD_ENTERPRISE + STR_TO_VARSTR(buf, pDnode->active); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, buf, false); + + STR_TO_VARSTR(buf, pDnode->connActive); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, buf, false); +#endif + numOfRows++; sdbRelease(pSdb, pDnode); } diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c index 51a231daf4..af9bedd220 100644 --- a/source/dnode/mnode/impl/src/mndFunc.c +++ b/source/dnode/mnode/impl/src/mndFunc.c @@ -556,7 +556,7 @@ RETRIEVE_FUNC_OVER: return code; } -static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int16_t len) { +static void *mnodeGenTypeStr(char *buf, int32_t buflen, uint8_t type, int32_t len) { char *msg = "unknown"; if (type >= sizeof(tDataTypes) / sizeof(tDataTypes[0])) { return msg; diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 5e3476859a..19c3d59167 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -275,6 +275,14 @@ static int32_t mndSetCreateMnodeRedoLogs(SMnode *pMnode, STrans *pTrans, SMnodeO return 0; } +int32_t mndSetRestoreCreateMnodeRedoLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj) { + SSdbRaw *pRedoRaw = mndMnodeActionEncode(pObj); + if (pRedoRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; + if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_READY) != 0) return -1; + return 0; +} + static int32_t mndSetCreateMnodeUndoLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj) { SSdbRaw *pUndoRaw = mndMnodeActionEncode(pObj); if (pUndoRaw == NULL) return -1; @@ -283,7 +291,7 @@ static int32_t mndSetCreateMnodeUndoLogs(SMnode *pMnode, STrans *pTrans, SMnodeO return 0; } -static int32_t mndSetCreateMnodeCommitLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj) { +int32_t mndSetCreateMnodeCommitLogs(SMnode *pMnode, STrans *pTrans, SMnodeObj *pObj) { SSdbRaw *pCommitRaw = mndMnodeActionEncode(pObj); if (pCommitRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; @@ -421,6 +429,55 @@ static int32_t mndSetCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDno return 0; } +int32_t mndSetRestoreCreateMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj) { + SSdb *pSdb = pMnode->pSdb; + void *pIter = NULL; + SDCreateMnodeReq createReq = {0}; + SEpSet createEpset = {0}; + + while (1) { + SMnodeObj *pMObj = NULL; + pIter = sdbFetch(pSdb, SDB_MNODE, pIter, (void **)&pMObj); + if (pIter == NULL) break; + + if(pMObj->id == pDnode->id) { + sdbRelease(pSdb, pMObj); + continue; + } + + if(pMObj->role == TAOS_SYNC_ROLE_VOTER){ + createReq.replicas[createReq.replica].id = pMObj->id; + createReq.replicas[createReq.replica].port = pMObj->pDnode->port; + memcpy(createReq.replicas[createReq.replica].fqdn, pMObj->pDnode->fqdn, TSDB_FQDN_LEN); + createReq.replica++; + } + else{ + createReq.learnerReplicas[createReq.learnerReplica].id = pMObj->id; + createReq.learnerReplicas[createReq.learnerReplica].port = pMObj->pDnode->port; + memcpy(createReq.learnerReplicas[createReq.learnerReplica].fqdn, pMObj->pDnode->fqdn, TSDB_FQDN_LEN); + createReq.learnerReplica++; + } + + sdbRelease(pSdb, pMObj); + } + + createReq.learnerReplicas[createReq.learnerReplica].id = pDnode->id; + createReq.learnerReplicas[createReq.learnerReplica].port = pDnode->port; + memcpy(createReq.learnerReplicas[createReq.learnerReplica].fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + createReq.learnerReplica++; + + createReq.lastIndex = pObj->lastIndex; + + createEpset.inUse = 0; + createEpset.numOfEps = 1; + createEpset.eps[0].port = pDnode->port; + memcpy(createEpset.eps[0].fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + + if (mndBuildCreateMnodeRedoAction(pTrans, &createReq, &createEpset) != 0) return -1; + + return 0; +} + static int32_t mndSetAlterMnodeTypeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj) { SSdb *pSdb = pMnode->pSdb; void *pIter = NULL; @@ -465,6 +522,55 @@ static int32_t mndSetAlterMnodeTypeRedoActions(SMnode *pMnode, STrans *pTrans, S return 0; } +int32_t mndSetRestoreAlterMnodeTypeRedoActions(SMnode *pMnode, STrans *pTrans, SDnodeObj *pDnode, SMnodeObj *pObj) { + SSdb *pSdb = pMnode->pSdb; + void *pIter = NULL; + SDAlterMnodeTypeReq alterReq = {0}; + SEpSet createEpset = {0}; + + while (1) { + SMnodeObj *pMObj = NULL; + pIter = sdbFetch(pSdb, SDB_MNODE, pIter, (void **)&pMObj); + if (pIter == NULL) break; + + if(pMObj->id == pDnode->id) { + sdbRelease(pSdb, pMObj); + continue; + } + + if(pMObj->role == TAOS_SYNC_ROLE_VOTER){ + alterReq.replicas[alterReq.replica].id = pMObj->id; + alterReq.replicas[alterReq.replica].port = pMObj->pDnode->port; + memcpy(alterReq.replicas[alterReq.replica].fqdn, pMObj->pDnode->fqdn, TSDB_FQDN_LEN); + alterReq.replica++; + } + else{ + alterReq.learnerReplicas[alterReq.learnerReplica].id = pMObj->id; + alterReq.learnerReplicas[alterReq.learnerReplica].port = pMObj->pDnode->port; + memcpy(alterReq.learnerReplicas[alterReq.learnerReplica].fqdn, pMObj->pDnode->fqdn, TSDB_FQDN_LEN); + alterReq.learnerReplica++; + } + + sdbRelease(pSdb, pMObj); + } + + alterReq.replicas[alterReq.replica].id = pDnode->id; + alterReq.replicas[alterReq.replica].port = pDnode->port; + memcpy(alterReq.replicas[alterReq.replica].fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + alterReq.replica++; + + alterReq.lastIndex = pObj->lastIndex; + + createEpset.inUse = 0; + createEpset.numOfEps = 1; + createEpset.eps[0].port = pDnode->port; + memcpy(createEpset.eps[0].fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + + if (mndBuildAlterMnodeTypeRedoAction(pTrans, &alterReq, &createEpset) != 0) return -1; + + return 0; +} + static int32_t mndCreateMnode(SMnode *pMnode, SRpcMsg *pReq, SDnodeObj *pDnode, SMCreateMnodeReq *pCreate) { int32_t code = -1; diff --git a/source/dnode/mnode/impl/src/mndQnode.c b/source/dnode/mnode/impl/src/mndQnode.c index a8b2d5f4bb..b5c9ce1f65 100644 --- a/source/dnode/mnode/impl/src/mndQnode.c +++ b/source/dnode/mnode/impl/src/mndQnode.c @@ -180,7 +180,7 @@ static int32_t mndSetCreateQnodeUndoLogs(STrans *pTrans, SQnodeObj *pObj) { return 0; } -static int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj) { +int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj) { SSdbRaw *pCommitRaw = mndQnodeActionEncode(pObj); if (pCommitRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; @@ -188,7 +188,11 @@ static int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj) { return 0; } -static int32_t mndSetCreateQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQnodeObj *pObj) { +bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId) { + return pQnode->pDnode->id == dnodeId; +} + +int32_t mndSetCreateQnodeRedoActions(STrans *pTrans, SDnodeObj *pDnode, SQnodeObj *pObj) { SDCreateQnodeReq createReq = {0}; createReq.dnodeId = pDnode->id; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 106eea0313..cfb5bef9d0 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -546,6 +546,7 @@ static void mndTransDropData(STrans *pTrans) { pTrans->param = NULL; pTrans->paramLen = 0; } + (void)taosThreadMutexDestroy(&pTrans->mutex); } static int32_t mndTransActionDelete(SSdb *pSdb, STrans *pTrans, bool callFunc) { @@ -643,7 +644,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict, pTrans->stage = TRN_STAGE_PREPARE; pTrans->policy = policy; pTrans->conflict = conflict; - pTrans->exec = TRN_EXEC_PRARLLEL; + pTrans->exec = TRN_EXEC_PARALLEL; pTrans->createdTime = taosGetTimestampMs(); pTrans->redoActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction)); pTrans->undoActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction)); @@ -651,6 +652,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict, pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo)); pTrans->mTraceId = pReq ? TRACE_GET_ROOTID(&pReq->info.traceId) : 0; taosInitRWLatch(&pTrans->lockRpcArray); + taosThreadMutexInit(&pTrans->mutex, NULL); if (pTrans->redoActions == NULL || pTrans->undoActions == NULL || pTrans->commitActions == NULL || pTrans->pRpcArray == NULL) { @@ -793,6 +795,8 @@ void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname) void mndTransSetSerial(STrans *pTrans) { pTrans->exec = TRN_EXEC_SERIAL; } +void mndTransSetParallel(STrans *pTrans) { pTrans->exec = TRN_EXEC_PARALLEL; } + void mndTransSetOper(STrans *pTrans, EOperType oper) { pTrans->oper = oper; } static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) { @@ -1307,7 +1311,13 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) int32_t code = 0; int32_t numOfActions = taosArrayGetSize(pTrans->redoActions); if (numOfActions == 0) return code; - if (pTrans->redoActionPos >= numOfActions) return code; + + taosThreadMutexLock(&pTrans->mutex); + + if (pTrans->redoActionPos >= numOfActions) { + taosThreadMutexUnlock(&pTrans->mutex); + return code; + } mInfo("trans:%d, execute %d actions serial, current redoAction:%d", pTrans->id, numOfActions, pTrans->redoActionPos); @@ -1377,6 +1387,8 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) } } + taosThreadMutexUnlock(&pTrans->mutex); + return code; } diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index f0bece6e5e..2afae04551 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1155,6 +1155,28 @@ int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVg return 0; } +int32_t mndRestoreAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SDnodeObj *pDnode) { + STransAction action = {0}; + + action.epSet = mndGetDnodeEpset(pDnode); + + int32_t contLen = 0; + void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen); + if (pReq == NULL) return -1; + + action.pCont = pReq; + action.contLen = contLen; + action.msgType = TDMT_DND_CREATE_VNODE; + action.acceptableCode = TSDB_CODE_VND_ALREADY_EXIST; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + int32_t mndAddAlterVnodeConfirmAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup) { STransAction action = {0}; action.epSet = mndGetVgroupEpset(pMnode, pVgroup); @@ -1274,6 +1296,29 @@ int32_t mndAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, return 0; } +int32_t mndRestoreAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, + SDnodeObj *pDnode) { + STransAction action = {0}; + action.epSet = mndGetDnodeEpset(pDnode); + + int32_t contLen = 0; + void *pReq = mndBuildAlterVnodeReplicaReq(pMnode, pDb, pVgroup, pDnode->id, &contLen); + if (pReq == NULL) return -1; + + action.pCont = pReq; + action.contLen = contLen; + action.msgType = TDMT_DND_ALTER_VNODE_TYPE; + action.acceptableCode = TSDB_CODE_VND_ALREADY_IS_VOTER; + action.retryCode = TSDB_CODE_VND_NOT_CATCH_UP; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + static int32_t mndAddDisableVnodeWriteAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId) { SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); @@ -1917,7 +1962,7 @@ int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTra int32_t vgid = pVgroup->vgId; int8_t replica = pVgroup->replica; - if(pVgroup->replica <= 1) { + if(pVgroup->replica <= 1) { mInfo("trans:%d, vgid:%d no need to balance, replica:%d", pTrans->id, vgid, replica); return -1; } @@ -1951,6 +1996,19 @@ int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTra return -1; } + SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName); + if (pDb == NULL) { + mError("trans:%d, vgid:%d failed to be balanced to dnode:%d, because db not exist", pTrans->id, vgid, dnodeId); + return -1; + } + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) { + mError("trans:%d, vgid:%d failed to be balanced to dnode:%d", pTrans->id, vgid, dnodeId); + return -1; + } + + mndReleaseDb(pMnode, pDb); + SSdbRaw *pRaw = mndVgroupActionEncode(pVgroup); if (pRaw == NULL) { mError("trans:%d, vgid:%d failed to encode action to dnode:%d", pTrans->id, vgid, dnodeId); @@ -1965,7 +2023,8 @@ int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTra } else { - mInfo("trans:%d, vgid:%d cant be balanced to dnode:%d, exist:%d, online:%d", pTrans->id, vgid, dnodeId, exist, online); + mInfo("trans:%d, vgid:%d cant be balanced to dnode:%d, exist:%d, online:%d", + pTrans->id, vgid, dnodeId, exist, online); } return 0; @@ -2084,6 +2143,8 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb return -1; } + mndSortVnodeGid(&newVgroup); + { SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); if (pVgRaw == NULL) return -1; @@ -2097,11 +2158,72 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb return 0; } +int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, + SDnodeObj *pDnode) { + SVgObj newVgroup = {0}; + memcpy(&newVgroup, pVgroup, sizeof(SVgObj)); + + mInfo("db:%s, vgId:%d, restore vnodes, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, + pVgroup->vnodeGid[0].dnodeId); + + if(newVgroup.replica == 1){ + int selected = 0; + for(int i = 0; i < newVgroup.replica; i++){ + newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_VOTER; + if(newVgroup.vnodeGid[i].dnodeId == pDnode->id){ + selected = i; + } + } + if (mndAddCreateVnodeAction(pMnode, pTrans, db, &newVgroup, &newVgroup.vnodeGid[selected]) != 0) return -1; + } + else if(newVgroup.replica == 3){ + for(int i = 0; i < newVgroup.replica; i++){ + if(newVgroup.vnodeGid[i].dnodeId == pDnode->id){ + newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_LEARNER; + } + else{ + newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_VOTER; + } + } + if (mndRestoreAddCreateVnodeAction(pMnode, pTrans, db, &newVgroup, pDnode) != 0) return -1; + + for(int i = 0; i < newVgroup.replica; i++){ + newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_VOTER; + if(newVgroup.vnodeGid[i].dnodeId == pDnode->id){ + } + } + if (mndRestoreAddAlterVnodeTypeAction(pMnode, pTrans, db, &newVgroup, pDnode) != 0) + return -1; + } + + SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + if (pVgRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); + + return 0; +} + static int32_t mndAddAdjustVnodeHashRangeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup) { return 0; } -static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgroup) { +static int32_t mndTransCommitVgStatus(STrans *pTrans, SVgObj *pVg, ESdbStatus vgStatus) { + SSdbRaw *pRaw = mndVgroupActionEncode(pVg); + if (pRaw == NULL) goto _err; + if (mndTransAppendCommitlog(pTrans, pRaw) != 0) goto _err; + (void)sdbSetRawStatus(pRaw, vgStatus); + pRaw = NULL; + return 0; +_err: + sdbFreeRaw(pRaw); + return -1; +} + +int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgroup) { int32_t code = -1; STrans *pTrans = NULL; SSdbRaw *pRaw = NULL; @@ -2162,6 +2284,7 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj mInfo("vgId:%d, vnode:%d dnode:%d", newVg2.vgId, i, newVg2.vnodeGid[i].dnodeId); } + // alter vgId and hash range int32_t maxVgId = sdbGetMaxId(pMnode->pSdb, SDB_VGROUP); if (mndAddAlterVnodeHashRangeAction(pMnode, pTrans, &newVg1, maxVgId) != 0) goto _OVER; newVg1.vgId = maxVgId; @@ -2170,31 +2293,24 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj if (mndAddAlterVnodeHashRangeAction(pMnode, pTrans, &newVg2, maxVgId) != 0) goto _OVER; newVg2.vgId = maxVgId; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg2) != 0) goto _OVER; + // adjust vgroup replica if (pDb->cfg.replications != newVg1.replica) { if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray) != 0) goto _OVER; + } else { + if (mndTransCommitVgStatus(pTrans, &newVg1, SDB_STATUS_READY) < 0) goto _OVER; } + if (pDb->cfg.replications != newVg2.replica) { if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg2, pArray) != 0) goto _OVER; + } else { + if (mndTransCommitVgStatus(pTrans, &newVg2, SDB_STATUS_READY) < 0) goto _OVER; } - pRaw = mndVgroupActionEncode(&newVg1); - if (pRaw == NULL) goto _OVER; - if (mndTransAppendCommitlog(pTrans, pRaw) != 0) goto _OVER; - (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); - pRaw = NULL; - - pRaw = mndVgroupActionEncode(&newVg2); - if (pRaw == NULL) goto _OVER; - if (mndTransAppendCommitlog(pTrans, pRaw) != 0) goto _OVER; - (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); - pRaw = NULL; - - pRaw = mndVgroupActionEncode(pVgroup); - if (pRaw == NULL) goto _OVER; - if (mndTransAppendCommitlog(pTrans, pRaw) != 0) goto _OVER; - (void)sdbSetRawStatus(pRaw, SDB_STATUS_DROPPED); - pRaw = NULL; + if (mndTransCommitVgStatus(pTrans, pVgroup, SDB_STATUS_DROPPED) < 0) goto _OVER; memcpy(&dbObj, pDb, sizeof(SDbObj)); if (dbObj.cfg.pRetensions != NULL) { @@ -2221,37 +2337,13 @@ _OVER: return code; } -static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SVgObj *pVgroup = NULL; - SDbObj *pDb = NULL; +extern int32_t mndProcessSplitVgroupMsgImp(SRpcMsg *pReq); - SSplitVgroupReq req = {0}; - if (tDeserializeSSplitVgroupReq(pReq->pCont, pReq->contLen, &req) != 0) { - terrno = TSDB_CODE_INVALID_MSG; - goto _OVER; - } +static int32_t mndProcessSplitVgroupMsg(SRpcMsg *pReq) { return mndProcessSplitVgroupMsgImp(pReq); } - mInfo("vgId:%d, start to split", req.vgId); - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_SPLIT_VGROUP) != 0) { - goto _OVER; - } - - pVgroup = mndAcquireVgroup(pMnode, req.vgId); - if (pVgroup == NULL) goto _OVER; - - pDb = mndAcquireDb(pMnode, pVgroup->dbName); - if (pDb == NULL) goto _OVER; - - code = mndSplitVgroup(pMnode, pReq, pDb, pVgroup); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; - -_OVER: - mndReleaseVgroup(pMnode, pVgroup); - mndReleaseDb(pMnode, pDb); - return code; -} +#ifndef TD_ENTERPRISE +int32_t mndProcessSplitVgroupMsgImp(SRpcMsg *pReq) { return 0; } +#endif static int32_t mndSetBalanceVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SDnodeObj *pSrc, SDnodeObj *pDst) { @@ -2439,6 +2531,13 @@ _OVER: bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid) { return !pVgroup->isTsma && pVgroup->dbUid == dbUid; } +bool mndVgroupInDnode(SVgObj *pVgroup, int32_t dnodeId) { + for(int i = 0; i < pVgroup->replica; i++){ + if(pVgroup->vnodeGid[i].dnodeId == dnodeId) return true; + } + return false; +} + static void *mndBuildCompactVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen, int64_t compactTs, STimeWindow tw) { SCompactVnodeReq compactReq = {0}; diff --git a/source/dnode/vnode/CMakeLists.txt b/source/dnode/vnode/CMakeLists.txt index c713d1e247..8c0e5c35cd 100644 --- a/source/dnode/vnode/CMakeLists.txt +++ b/source/dnode/vnode/CMakeLists.txt @@ -84,6 +84,7 @@ target_include_directories( PUBLIC "inc" PUBLIC "src/inc" PUBLIC "${TD_SOURCE_DIR}/include/libs/scalar" + PUBLIC "${TD_SOURCE_DIR}/contrib/rocksdb/include" ) target_link_libraries( vnode @@ -100,6 +101,7 @@ target_link_libraries( # PUBLIC bdb # PUBLIC scalar + PUBLIC rocksdb PUBLIC transport PUBLIC stream PUBLIC index diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 828a173108..34536d453c 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -182,7 +182,7 @@ int32_t tsdbSetTableList(STsdbReader *pReader, const void *pTableList, int32_t n int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, void *pTableList, int32_t numOfTables, SSDataBlock *pResBlock, STsdbReader **ppReader, const char *idstr, bool countOnly); -void tsdbReaderSetId(STsdbReader* pReader, const char* idstr); +void tsdbReaderSetId(STsdbReader *pReader, const char *idstr); void tsdbReaderClose(STsdbReader *pReader); int32_t tsdbNextDataBlock(STsdbReader *pReader, bool *hasNext); int32_t tsdbRetrieveDatablockSMA(STsdbReader *pReader, SSDataBlock *pDataBlock, bool *allHave); @@ -196,8 +196,9 @@ void *tsdbGetIvtIdx(SMeta *pMeta); uint64_t getReaderMaxVersion(STsdbReader *pReader); int32_t tsdbCacherowsReaderOpen(void *pVnode, int32_t type, void *pTableIdList, int32_t numOfTables, int32_t numOfCols, - uint64_t suid, void **pReader, const char *idstr); -int32_t tsdbRetrieveCacheRows(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds, SArray *pTableUids); + SArray *pCidList, int32_t *pSlotIds, uint64_t suid, void **pReader, const char *idstr); +int32_t tsdbRetrieveCacheRows(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds, const int32_t *dstSlotIds, + SArray *pTableUids); void *tsdbCacherowsReaderClose(void *pReader); int32_t tsdbGetTableSchema(SVnode *pVnode, int64_t uid, STSchema **pSchema, int64_t *suid); @@ -343,6 +344,7 @@ struct SVnodeCfg { SVnodeStats vndStats; uint32_t hashBegin; uint32_t hashEnd; + bool hashChange; int16_t sttTrigger; int16_t hashPrefix; int16_t hashSuffix; diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 2a85b191a4..95bce32196 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -343,6 +343,16 @@ struct STsdbFS { SArray *aDFileSet; // SArray }; +typedef struct { + rocksdb_t *db; + rocksdb_options_t *options; + rocksdb_flushoptions_t *flushoptions; + rocksdb_writeoptions_t *writeoptions; + rocksdb_readoptions_t *readoptions; + rocksdb_writebatch_t *writebatch; + TdThreadMutex rMutex; +} SRocksCache; + struct STsdb { char *path; SVnode *pVnode; @@ -355,6 +365,7 @@ struct STsdb { TdThreadMutex lruMutex; SLRUCache *biCache; TdThreadMutex biMutex; + SRocksCache rCache; }; struct TSDBKEY { @@ -777,6 +788,8 @@ typedef struct SCacheRowsReader { uint64_t suid; char **transferBuf; // todo remove it soon int32_t numOfCols; + SArray *pCidList; + int32_t *pSlotIds; int32_t type; int32_t tableIndex; // currently returned result tables STableKeyInfo *pTableList; // table id list @@ -796,6 +809,10 @@ typedef struct { int32_t tsdbOpenCache(STsdb *pTsdb); void tsdbCloseCache(STsdb *pTsdb); +int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSDBROW *row); +int32_t tsdbCacheGet(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCacheRowsReader *pr, int32_t ltype); +int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKEY eKey); + int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, TSDBROW *row, STsdb *pTsdb); int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, TSDBROW *row, bool dup); int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader *pr, LRUHandle **h); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 70b997aba2..94e5f253bf 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -19,6 +19,7 @@ #include "executor.h" #include "filter.h" #include "qworker.h" +#include "rocksdb/c.h" #include "sync.h" #include "tRealloc.h" #include "tchecksum.h" @@ -177,6 +178,7 @@ int tsdbClose(STsdb** pTsdb); int32_t tsdbBegin(STsdb* pTsdb); int32_t tsdbPrepareCommit(STsdb* pTsdb); int32_t tsdbCommit(STsdb* pTsdb, SCommitInfo* pInfo); +int32_t tsdbCacheCommit(STsdb* pTsdb); int32_t tsdbCompact(STsdb* pTsdb, SCompactInfo* pInfo); int32_t tsdbFinishCommit(STsdb* pTsdb); int32_t tsdbRollbackCommit(STsdb* pTsdb); @@ -193,9 +195,9 @@ STQ* tqOpen(const char* path, SVnode* pVnode); void tqClose(STQ*); int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver); int tqRegisterPushHandle(STQ* pTq, void* pHandle, const SMqPollReq* pRequest, SRpcMsg* pRpcMsg, SMqDataRsp* pDataRsp, - int32_t type); + int32_t type); int tqUnregisterPushHandle(STQ* pTq, const char* pKey, int32_t keyLen, uint64_t consumerId, bool rspConsumer); -int tqStartStreamTasks(STQ* pTq); // restore all stream tasks after vnode launching completed. +int tqStartStreamTasks(STQ* pTq); // restore all stream tasks after vnode launching completed. int tqCommit(STQ*); int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd); diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 4a9bf07429..1000f82d8f 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -301,8 +301,12 @@ int32_t tqProcessSeekReq(STQ* pTq, int64_t sversion, char* msg, int32_t msgLen) } // save the new offset value - tqDebug("vgId:%d sub:%s seek to %" PRId64 " prev offset:%" PRId64, vgId, pOffset->subKey, pOffset->val.version, - pSavedOffset->val.version); + if (pSavedOffset != NULL) { + tqDebug("vgId:%d sub:%s seek to:%" PRId64 " prev offset:%" PRId64, vgId, pOffset->subKey, pOffset->val.version, + pSavedOffset->val.version); + } else { + tqDebug("vgId:%d sub:%s seek to:%"PRId64" not saved yet", vgId, pOffset->subKey, pOffset->val.version); + } if (tqOffsetWrite(pTq->pOffsetStore, pOffset) < 0) { tqError("failed to save offset, vgId:%d sub:%s seek to %" PRId64, vgId, pOffset->subKey, pOffset->val.version); diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 3c7edd931b..b3999caace 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -12,7 +12,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - #include "tsdb.h" static int32_t tsdbOpenBICache(STsdb *pTsdb) { @@ -47,6 +46,513 @@ static void tsdbCloseBICache(STsdb *pTsdb) { } } +#define ROCKS_KEY_LEN 64 + +static void tsdbGetRocksPath(STsdb *pTsdb, char *path) { + SVnode *pVnode = pTsdb->pVnode; + if (pVnode->pTfs) { + if (path) { + snprintf(path, TSDB_FILENAME_LEN, "%s%s%s%scache.rdb", tfsGetPrimaryPath(pTsdb->pVnode->pTfs), TD_DIRSEP, + pTsdb->path, TD_DIRSEP); + } + } else { + if (path) { + snprintf(path, TSDB_FILENAME_LEN, "%s%scache.rdb", pTsdb->path, TD_DIRSEP); + } + } +} + +static int32_t tsdbOpenRocksCache(STsdb *pTsdb) { + int32_t code = 0; + + rocksdb_options_t *options = rocksdb_options_create(); + if (NULL == options) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } + + rocksdb_options_set_create_if_missing(options, 1); + // rocksdb_options_set_inplace_update_support(options, 1); + // rocksdb_options_set_allow_concurrent_memtable_write(options, 0); + + rocksdb_writeoptions_t *writeoptions = rocksdb_writeoptions_create(); + if (NULL == writeoptions) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err2; + } + // rocksdb_writeoptions_disable_WAL(writeoptions, 1); + + rocksdb_readoptions_t *readoptions = rocksdb_readoptions_create(); + if (NULL == readoptions) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err2; + } + + char *err = NULL; + char cachePath[TSDB_FILENAME_LEN] = {0}; + tsdbGetRocksPath(pTsdb, cachePath); + + rocksdb_t *db = rocksdb_open(options, cachePath, &err); + if (NULL == db) { + code = -1; + goto _err3; + } + + rocksdb_flushoptions_t *flushoptions = rocksdb_flushoptions_create(); + if (NULL == flushoptions) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err4; + } + + rocksdb_writebatch_t *writebatch = rocksdb_writebatch_create(); + + pTsdb->rCache.writebatch = writebatch; + pTsdb->rCache.options = options; + pTsdb->rCache.writeoptions = writeoptions; + pTsdb->rCache.readoptions = readoptions; + pTsdb->rCache.flushoptions = flushoptions; + pTsdb->rCache.db = db; + + taosThreadMutexInit(&pTsdb->rCache.rMutex, NULL); + + return code; + +_err4: + rocksdb_readoptions_destroy(readoptions); +_err3: + rocksdb_writeoptions_destroy(writeoptions); +_err2: + rocksdb_options_destroy(options); +_err: + return code; +} + +static void tsdbCloseRocksCache(STsdb *pTsdb) { + rocksdb_close(pTsdb->rCache.db); + rocksdb_flushoptions_destroy(pTsdb->rCache.flushoptions); + rocksdb_writebatch_destroy(pTsdb->rCache.writebatch); + rocksdb_readoptions_destroy(pTsdb->rCache.readoptions); + rocksdb_writeoptions_destroy(pTsdb->rCache.writeoptions); + rocksdb_options_destroy(pTsdb->rCache.options); + taosThreadMutexDestroy(&pTsdb->rCache.rMutex); +} + +int32_t tsdbCacheCommit(STsdb *pTsdb) { + int32_t code = 0; + char *err = NULL; + + rocksdb_flush(pTsdb->rCache.db, pTsdb->rCache.flushoptions, &err); + if (NULL != err) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, err); + rocksdb_free(err); + code = -1; + } + + return code; +} + +SLastCol *tsdbCacheDeserialize(char const *value) { + if (!value) { + return NULL; + } + + SLastCol *pLastCol = (SLastCol *)value; + SColVal *pColVal = &pLastCol->colVal; + if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (pColVal->value.nData > 0) { + pColVal->value.pData = (char *)value + sizeof(*pLastCol); + } else { + pColVal->value.pData = NULL; + } + } + + return pLastCol; +} + +void tsdbCacheSerialize(SLastCol *pLastCol, char **value, size_t *size) { + SColVal *pColVal = &pLastCol->colVal; + size_t length = sizeof(*pLastCol); + if (IS_VAR_DATA_TYPE(pColVal->type)) { + length += pColVal->value.nData; + } + *value = taosMemoryMalloc(length); + + *(SLastCol *)(*value) = *pLastCol; + if (IS_VAR_DATA_TYPE(pColVal->type)) { + uint8_t *pVal = pColVal->value.pData; + SColVal *pDColVal = &((SLastCol *)(*value))->colVal; + pDColVal->value.pData = *value + sizeof(*pLastCol); + if (pColVal->value.nData > 0) { + memcpy(pDColVal->value.pData, pVal, pColVal->value.nData); + } else { + pDColVal->value.pData = NULL; + } + } + *size = length; +} + +static SLastCol *tsdbCacheLookup(STsdb *pTsdb, tb_uid_t uid, int16_t cid, char const *lstring) { + SLastCol *pLastCol = NULL; + + char *err = NULL; + size_t vlen = 0; + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":%s", uid, cid, lstring); + char *value = NULL; + value = rocksdb_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, key, klen, &vlen, &err); + if (NULL != err) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, err); + rocksdb_free(err); + } + + pLastCol = tsdbCacheDeserialize(value); + + return pLastCol; +} + +int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSDBROW *pRow) { + int32_t code = 0; + + // 1, fetch schema + STSchema *pTSchema = NULL; + int32_t sver = TSDBROW_SVERSION(pRow); + code = metaGetTbTSchemaEx(pTsdb->pVnode->pMeta, suid, uid, sver, &pTSchema); + if (code != TSDB_CODE_SUCCESS) { + terrno = code; + return -1; + } + + // 2, iterate col values into array + SArray *aColVal = taosArrayInit(32, sizeof(SColVal)); + + STSDBRowIter iter = {0}; + tsdbRowIterOpen(&iter, pRow, pTSchema); + + for (SColVal *pColVal = tsdbRowIterNext(&iter); pColVal; pColVal = tsdbRowIterNext(&iter)) { + /* + if (IS_VAR_DATA_TYPE(pColVal->type)) { + uint8_t *pVal = pColVal->value.pData; + + pColVal->value.pData = NULL; + code = tRealloc(&pColVal->value.pData, pColVal->value.nData); + if (code) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + + if (pColVal->value.nData) { + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } + } + */ + taosArrayPush(aColVal, pColVal); + } + + tsdbRowClose(&iter); + + // 3, build keys & multi get from rocks + int num_keys = TARRAY_SIZE(aColVal); + char **keys_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + size_t *keys_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); + for (int i = 0; i < num_keys; ++i) { + SColVal *pColVal = (SColVal *)taosArrayGet(aColVal, i); + int16_t cid = pColVal->cid; + + char *keys = taosMemoryCalloc(2, ROCKS_KEY_LEN); + int last_key_len = snprintf(keys, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last", uid, cid); + if (last_key_len >= ROCKS_KEY_LEN) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, tstrerror(code)); + } + int lr_key_len = snprintf(keys + ROCKS_KEY_LEN, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last_row", uid, cid); + if (lr_key_len >= ROCKS_KEY_LEN) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, tstrerror(code)); + } + keys_list[i] = keys; + keys_list[num_keys + i] = keys + ROCKS_KEY_LEN; + keys_list_sizes[i] = last_key_len; + keys_list_sizes[num_keys + i] = lr_key_len; + } + char **values_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + size_t *values_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); + char **errs = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + taosThreadMutexLock(&pTsdb->rCache.rMutex); + rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys * 2, (const char *const *)keys_list, + keys_list_sizes, values_list, values_list_sizes, errs); + for (int i = 0; i < num_keys; ++i) { + taosMemoryFree(keys_list[i]); + } + for (int i = 0; i < num_keys * 2; ++i) { + rocksdb_free(errs[i]); + } + taosMemoryFree(keys_list); + taosMemoryFree(keys_list_sizes); + taosMemoryFree(errs); + + TSKEY keyTs = TSDBROW_TS(pRow); + rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; + for (int i = 0; i < num_keys; ++i) { + SColVal *pColVal = (SColVal *)taosArrayGet(aColVal, i); + if (COL_VAL_IS_VALUE(pColVal)) { + SLastCol *pLastCol = tsdbCacheDeserialize(values_list[i]); + + if (NULL == pLastCol || pLastCol->ts <= keyTs) { + char *value = NULL; + size_t vlen = 0; + tsdbCacheSerialize(&(SLastCol){.ts = keyTs, .colVal = *pColVal}, &value, &vlen); + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last", uid, pColVal->cid); + rocksdb_writebatch_put(wb, key, klen, value, vlen); + taosMemoryFree(value); + } + } + + if (!COL_VAL_IS_NONE(pColVal)) { + SLastCol *pLastCol = tsdbCacheDeserialize(values_list[i + num_keys]); + + if (NULL == pLastCol || pLastCol->ts <= keyTs) { + char *value = NULL; + size_t vlen = 0; + tsdbCacheSerialize(&(SLastCol){.ts = keyTs, .colVal = *pColVal}, &value, &vlen); + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last_row", uid, pColVal->cid); + rocksdb_writebatch_put(wb, key, klen, value, vlen); + taosMemoryFree(value); + } + } + + rocksdb_free(values_list[i]); + rocksdb_free(values_list[i + num_keys]); + } + taosMemoryFree(values_list); + taosMemoryFree(values_list_sizes); + + char *err = NULL; + rocksdb_write(pTsdb->rCache.db, pTsdb->rCache.writeoptions, wb, &err); + if (NULL != err) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, err); + rocksdb_free(err); + } + taosThreadMutexUnlock(&pTsdb->rCache.rMutex); + rocksdb_writebatch_clear(wb); + +_exit: + taosArrayDestroy(aColVal); + taosMemoryFree(pTSchema); + return code; +} + +static void reallocVarData(SColVal *pColVal) { + if (IS_VAR_DATA_TYPE(pColVal->type)) { + uint8_t *pVal = pColVal->value.pData; + pColVal->value.pData = taosMemoryMalloc(pColVal->value.nData); + if (pColVal->value.nData) { + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } + } +} + +static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCacheRowsReader *pr, int16_t *aCols, + int nCols, int16_t *slotIds); + +static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCacheRowsReader *pr, int16_t *aCols, + int nCols, int16_t *slotIds); + +int32_t tsdbCacheGet(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCacheRowsReader *pr, int32_t ltype) { + static char const *alstring[2] = {"last_row", "last"}; + char const *lstring = alstring[ltype]; + rocksdb_writebatch_t *wb = NULL; + int32_t code = 0; + + SArray *pCidList = pr->pCidList; + int num_keys = TARRAY_SIZE(pCidList); + char **keys_list = taosMemoryCalloc(num_keys, sizeof(char *)); + size_t *keys_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t)); + for (int i = 0; i < num_keys; ++i) { + int16_t cid = *(int16_t *)taosArrayGet(pCidList, i); + + char *keys = taosMemoryCalloc(2, ROCKS_KEY_LEN); + int last_key_len = snprintf(keys, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":%s", uid, cid, lstring); + if (last_key_len >= ROCKS_KEY_LEN) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, tstrerror(code)); + } + + keys_list[i] = keys; + keys_list_sizes[i] = last_key_len; + } + char **values_list = taosMemoryCalloc(num_keys, sizeof(char *)); + size_t *values_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t)); + char **errs = taosMemoryCalloc(num_keys, sizeof(char *)); + rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys, (const char *const *)keys_list, + keys_list_sizes, values_list, values_list_sizes, errs); + for (int i = 0; i < num_keys; ++i) { + taosMemoryFree(keys_list[i]); + rocksdb_free(errs[i]); + } + taosMemoryFree(keys_list); + taosMemoryFree(keys_list_sizes); + taosMemoryFree(errs); + + for (int i = 0; i < num_keys; ++i) { + bool freeCol = true; + SArray *pTmpColArray = NULL; + SLastCol *pLastCol = tsdbCacheDeserialize(values_list[i]); + int16_t cid = *(int16_t *)taosArrayGet(pCidList, i); + SLastCol noneCol = {.ts = TSKEY_MIN, .colVal = COL_VAL_NONE(cid, pr->pSchema->columns[pr->pSlotIds[i]].type)}; + if (pLastCol) { + reallocVarData(&pLastCol->colVal); + } else { + taosThreadMutexLock(&pTsdb->rCache.rMutex); + + pLastCol = tsdbCacheLookup(pTsdb, uid, cid, lstring); + if (!pLastCol) { + // recalc: load from tsdb + int16_t aCols[1] = {cid}; + int16_t slotIds[1] = {pr->pSlotIds[i]}; + pTmpColArray = NULL; + + if (ltype) { + mergeLastCid(uid, pTsdb, &pTmpColArray, pr, aCols, 1, slotIds); + } else { + mergeLastRowCid(uid, pTsdb, &pTmpColArray, pr, aCols, 1, slotIds); + } + + if (pTmpColArray && TARRAY_SIZE(pTmpColArray) >= 1) { + pLastCol = taosArrayGet(pTmpColArray, 0); + freeCol = false; + } + + // still null, then make up a none col value + if (!pLastCol) { + pLastCol = &noneCol; + freeCol = false; + } + + // store result back to rocks cache + wb = pTsdb->rCache.writebatch; + char *value = NULL; + size_t vlen = 0; + tsdbCacheSerialize(pLastCol, &value, &vlen); + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":%s", uid, pLastCol->colVal.cid, lstring); + rocksdb_writebatch_put(wb, key, klen, value, vlen); + + taosMemoryFree(value); + } else { + reallocVarData(&pLastCol->colVal); + } + + if (wb) { + char *err = NULL; + rocksdb_write(pTsdb->rCache.db, pTsdb->rCache.writeoptions, wb, &err); + if (NULL != err) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, err); + rocksdb_free(err); + } + + rocksdb_writebatch_clear(wb); + } + + taosThreadMutexUnlock(&pTsdb->rCache.rMutex); + } + + taosArrayPush(pLastArray, pLastCol); + + taosArrayDestroy(pTmpColArray); + if (freeCol) { + taosMemoryFree(pLastCol); + } + } + taosMemoryFree(values_list); + taosMemoryFree(values_list_sizes); + + return code; +} + +int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKEY eKey) { + int32_t code = 0; + // 1, fetch schema + STSchema *pTSchema = NULL; + int32_t sver = -1; + code = metaGetTbTSchemaEx(pTsdb->pVnode->pMeta, suid, uid, sver, &pTSchema); + if (code != TSDB_CODE_SUCCESS) { + terrno = code; + return -1; + } + + // 3, build keys & multi get from rocks + int num_keys = pTSchema->numOfCols; + char **keys_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + size_t *keys_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); + for (int i = 0; i < num_keys; ++i) { + int16_t cid = pTSchema->columns[i].colId; + + char *keys = taosMemoryCalloc(2, ROCKS_KEY_LEN); + int last_key_len = snprintf(keys, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last", uid, cid); + if (last_key_len >= ROCKS_KEY_LEN) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, tstrerror(code)); + } + int lr_key_len = snprintf(keys + ROCKS_KEY_LEN, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last_row", uid, cid); + if (lr_key_len >= ROCKS_KEY_LEN) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, tstrerror(code)); + } + keys_list[i] = keys; + keys_list[num_keys + i] = keys + ROCKS_KEY_LEN; + keys_list_sizes[i] = last_key_len; + keys_list_sizes[num_keys + i] = lr_key_len; + } + char **values_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + size_t *values_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); + char **errs = taosMemoryCalloc(num_keys * 2, sizeof(char *)); + taosThreadMutexLock(&pTsdb->rCache.rMutex); + rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys * 2, (const char *const *)keys_list, + keys_list_sizes, values_list, values_list_sizes, errs); + for (int i = 0; i < num_keys; ++i) { + taosMemoryFree(keys_list[i]); + } + for (int i = 0; i < num_keys * 2; ++i) { + rocksdb_free(errs[i]); + } + taosMemoryFree(keys_list); + taosMemoryFree(keys_list_sizes); + taosMemoryFree(errs); + + rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; + for (int i = 0; i < num_keys; ++i) { + SLastCol *pLastCol = tsdbCacheDeserialize(values_list[i]); + if (NULL != pLastCol && (pLastCol->ts <= eKey && pLastCol->ts >= sKey)) { + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last", uid, pLastCol->colVal.cid); + rocksdb_writebatch_delete(wb, key, klen); + } + + pLastCol = tsdbCacheDeserialize(values_list[i + num_keys]); + if (NULL != pLastCol && (pLastCol->ts <= eKey && pLastCol->ts >= sKey)) { + char key[ROCKS_KEY_LEN]; + size_t klen = snprintf(key, ROCKS_KEY_LEN, "%" PRIi64 ":%" PRIi16 ":last_row", uid, pLastCol->colVal.cid); + rocksdb_writebatch_delete(wb, key, klen); + } + + rocksdb_free(values_list[i]); + rocksdb_free(values_list[i + num_keys]); + } + taosMemoryFree(values_list); + taosMemoryFree(values_list_sizes); + + char *err = NULL; + rocksdb_write(pTsdb->rCache.db, pTsdb->rCache.writeoptions, wb, &err); + if (NULL != err) { + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, err); + rocksdb_free(err); + } + taosThreadMutexUnlock(&pTsdb->rCache.rMutex); + rocksdb_writebatch_clear(wb); + +_exit: + taosMemoryFree(pTSchema); + + return code; +} + int32_t tsdbOpenCache(STsdb *pTsdb) { int32_t code = 0; SLRUCache *pCache = NULL; @@ -64,6 +570,12 @@ int32_t tsdbOpenCache(STsdb *pTsdb) { goto _err; } + code = tsdbOpenRocksCache(pTsdb); + if (code != TSDB_CODE_SUCCESS) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } + taosLRUCacheSetStrictCapacity(pCache, false); taosThreadMutexInit(&pTsdb->lruMutex, NULL); @@ -84,6 +596,7 @@ void tsdbCloseCache(STsdb *pTsdb) { } tsdbCloseBICache(pTsdb); + tsdbCloseRocksCache(pTsdb); } static void getTableCacheKey(tb_uid_t uid, int cacheType, char *key, int *len) { @@ -170,7 +683,7 @@ int32_t tsdbCacheDeleteLast(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { return code; } - +/* int32_t tsdbCacheDelete(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { int32_t code = 0; char key[32] = {0}; @@ -225,7 +738,7 @@ int32_t tsdbCacheDelete(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { return code; } - +*/ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, TSDBROW *row, bool dup) { int32_t code = 0; STSRow *cacheRow = NULL; @@ -879,7 +1392,12 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie *pIgnoreEarlierTs = false; tBlockDataReset(state->pBlockData); TABLEID tid = {.suid = state->suid, .uid = state->uid}; - code = tBlockDataInit(state->pBlockData, &tid, state->pTSchema, aCols, nCols); + int nTmpCols = nCols; + if (aCols[0] == PRIMARYKEY_TIMESTAMP_COL_ID && nCols == 1) { + nTmpCols = 0; + skipBlock = false; + } + code = tBlockDataInit(state->pBlockData, &tid, state->pTSchema, aCols, nTmpCols); if (code) goto _err; code = tsdbReadDataBlock(*state->pDataFReader, &block, state->pBlockData); @@ -1423,6 +1941,21 @@ static int32_t initLastColArray(STSchema *pTSchema, SArray **ppColArray) { return TSDB_CODE_SUCCESS; } +static int32_t initLastColArrayPartial(STSchema *pTSchema, SArray **ppColArray, int16_t *slotIds, int nCols) { + SArray *pColArray = taosArrayInit(nCols, sizeof(SLastCol)); + if (NULL == pColArray) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int32_t i = 0; i < nCols; ++i) { + int16_t slotId = slotIds[i]; + SLastCol col = {.ts = 0, .colVal = COL_VAL_NULL(pTSchema->columns[slotId].colId, pTSchema->columns[slotId].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); @@ -1761,6 +2294,342 @@ _err: return code; } +static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCacheRowsReader *pr, int16_t *aCols, + int nCols, int16_t *slotIds) { + STSchema *pTSchema = pr->pSchema; // metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1); + int16_t nLastCol = nCols; + int16_t noneCol = 0; + bool setNoneCol = false; + bool hasRow = false; + bool ignoreEarlierTs = false; + SArray *pColArray = NULL; + SColVal *pColVal = &(SColVal){0}; + + int32_t code = initLastColArrayPartial(pTSchema, &pColArray, slotIds, nCols); + if (TSDB_CODE_SUCCESS != code) { + return code; + } + SArray *aColArray = taosArrayInit(nCols, sizeof(int16_t)); + if (NULL == aColArray) { + taosArrayDestroy(pColArray); + + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int i = 0; i < nCols; ++i) { + taosArrayPush(aColArray, &aCols[i]); + } + + TSKEY lastRowTs = TSKEY_MAX; + + CacheNextRowIter iter = {0}; + nextRowIterOpen(&iter, uid, pTsdb, pTSchema, pr->suid, pr->pLoadInfo, pr->pReadSnap, &pr->pDataFReader, + &pr->pDataFReaderLast, pr->lastTs); + + do { + TSDBROW *pRow = NULL; + nextRowIterGet(&iter, &pRow, &ignoreEarlierTs, true, TARRAY_DATA(aColArray), TARRAY_SIZE(aColArray)); + + if (!pRow) { + break; + } + + hasRow = true; + + int32_t sversion = TSDBROW_SVERSION(pRow); + if (sversion != -1) { + code = updateTSchema(sversion, 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) { + lastRowTs = rowTs; + + for (int16_t iCol = noneCol; iCol < nCols; ++iCol) { + if (iCol >= nLastCol) { + break; + } + SLastCol *pCol = taosArrayGet(pColArray, iCol); + if (pCol->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) { + continue; + } + if (slotIds[iCol] == 0) { + STColumn *pTColumn = &pTSchema->columns[0]; + + *pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = rowTs}); + taosArraySet(pColArray, 0, &(SLastCol){.ts = rowTs, .colVal = *pColVal}); + continue; + } + tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); + + *pCol = (SLastCol){.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { + 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(pCol->colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + + if (!COL_VAL_IS_VALUE(pColVal)) { + if (!setNoneCol) { + noneCol = iCol; + setNoneCol = true; + } + } else { + int32_t aColIndex = taosArraySearchIdx(aColArray, &pColVal->cid, compareInt16Val, TD_EQ); + if (aColIndex >= 0) { + taosArrayRemove(aColArray, aColIndex); + } + } + } + if (!setNoneCol) { + // done, goto return pColArray + break; + } else { + continue; + } + } + + // merge into pColArray + setNoneCol = false; + for (int16_t iCol = noneCol; iCol < nCols; ++iCol) { + if (iCol >= nLastCol) { + break; + } + // high version's column value + SLastCol *lastColVal = (SLastCol *)taosArrayGet(pColArray, iCol); + if (lastColVal->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) { + continue; + } + SColVal *tColVal = &lastColVal->colVal; + + tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); + if (!COL_VAL_IS_VALUE(tColVal) && COL_VAL_IS_VALUE(pColVal)) { + SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.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); + } + + taosArraySet(pColArray, iCol, &lastCol); + int32_t aColIndex = taosArraySearchIdx(aColArray, &lastCol.colVal.cid, compareInt16Val, TD_EQ); + taosArrayRemove(aColArray, aColIndex); + } else if (!COL_VAL_IS_VALUE(tColVal) && !COL_VAL_IS_VALUE(pColVal) && !setNoneCol) { + noneCol = iCol; + setNoneCol = true; + } + } + } while (setNoneCol); + + if (!hasRow) { + if (ignoreEarlierTs) { + taosArrayDestroy(pColArray); + pColArray = NULL; + } else { + taosArrayClear(pColArray); + } + } + *ppLastArray = pColArray; + + nextRowIterClose(&iter); + taosArrayDestroy(aColArray); + + return code; + +_err: + nextRowIterClose(&iter); + // taosMemoryFreeClear(pTSchema); + *ppLastArray = NULL; + taosArrayDestroy(pColArray); + taosArrayDestroy(aColArray); + return code; +} + +static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCacheRowsReader *pr, int16_t *aCols, + int nCols, int16_t *slotIds) { + STSchema *pTSchema = pr->pSchema; // metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1); + int16_t nLastCol = nCols; + int16_t noneCol = 0; + bool setNoneCol = false; + bool hasRow = false; + bool ignoreEarlierTs = false; + SArray *pColArray = NULL; + SColVal *pColVal = &(SColVal){0}; + + int32_t code = initLastColArrayPartial(pTSchema, &pColArray, slotIds, nCols); + if (TSDB_CODE_SUCCESS != code) { + return code; + } + SArray *aColArray = taosArrayInit(nCols, sizeof(int16_t)); + if (NULL == aColArray) { + taosArrayDestroy(pColArray); + + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int i = 0; i < nCols; ++i) { + taosArrayPush(aColArray, &aCols[i]); + } + + TSKEY lastRowTs = TSKEY_MAX; + + CacheNextRowIter iter = {0}; + nextRowIterOpen(&iter, uid, pTsdb, pTSchema, pr->suid, pr->pLoadInfo, pr->pReadSnap, &pr->pDataFReader, + &pr->pDataFReaderLast, pr->lastTs); + + do { + TSDBROW *pRow = NULL; + nextRowIterGet(&iter, &pRow, &ignoreEarlierTs, true, TARRAY_DATA(aColArray), TARRAY_SIZE(aColArray)); + + if (!pRow) { + break; + } + + hasRow = true; + + int32_t sversion = TSDBROW_SVERSION(pRow); + if (sversion != -1) { + code = updateTSchema(sversion, 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) { + lastRowTs = rowTs; + + for (int16_t iCol = noneCol; iCol < nCols; ++iCol) { + if (iCol >= nLastCol) { + break; + } + SLastCol *pCol = taosArrayGet(pColArray, iCol); + if (pCol->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) { + continue; + } + if (slotIds[iCol] == 0) { + STColumn *pTColumn = &pTSchema->columns[0]; + + *pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = rowTs}); + taosArraySet(pColArray, 0, &(SLastCol){.ts = rowTs, .colVal = *pColVal}); + continue; + } + tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); + + *pCol = (SLastCol){.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { + 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(pCol->colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + + if (COL_VAL_IS_NONE(pColVal)) { + if (!setNoneCol) { + noneCol = iCol; + setNoneCol = true; + } + } else { + int32_t aColIndex = taosArraySearchIdx(aColArray, &pColVal->cid, compareInt16Val, TD_EQ); + if (aColIndex >= 0) { + taosArrayRemove(aColArray, aColIndex); + } + } + } + if (!setNoneCol) { + // done, goto return pColArray + break; + } else { + continue; + } + } + + // merge into pColArray + setNoneCol = false; + for (int16_t iCol = noneCol; iCol < nCols; ++iCol) { + if (iCol >= nLastCol) { + break; + } + // high version's column value + SLastCol *lastColVal = (SLastCol *)taosArrayGet(pColArray, iCol); + if (lastColVal->colVal.cid != pTSchema->columns[slotIds[iCol]].colId) { + continue; + } + SColVal *tColVal = &lastColVal->colVal; + + tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); + if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { + SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.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); + } + + taosArraySet(pColArray, iCol, &lastCol); + int32_t aColIndex = taosArraySearchIdx(aColArray, &lastCol.colVal.cid, compareInt16Val, TD_EQ); + taosArrayRemove(aColArray, aColIndex); + } else if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal) && !setNoneCol) { + noneCol = iCol; + setNoneCol = true; + } + } + } while (setNoneCol); + + if (!hasRow) { + if (ignoreEarlierTs) { + taosArrayDestroy(pColArray); + pColArray = NULL; + } else { + taosArrayClear(pColArray); + } + } + *ppLastArray = pColArray; + + nextRowIterClose(&iter); + taosArrayDestroy(aColArray); + + return code; + +_err: + nextRowIterClose(&iter); + + *ppLastArray = NULL; + taosArrayDestroy(pColArray); + taosArrayDestroy(aColArray); + return code; +} + int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader *pr, LRUHandle **handle) { int32_t code = 0; char key[32] = {0}; diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index d6e819d84a..0d47940582 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -21,47 +21,30 @@ #define HASTYPE(_type, _t) (((_type) & (_t)) == (_t)) static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds, - void** pRes, const char* idStr) { + const int32_t* dstSlotIds, void** pRes, const char* idStr) { int32_t numOfRows = pBlock->info.rows; + bool allNullRow = true; if (HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST)) { - bool allNullRow = true; - for (int32_t i = 0; i < pReader->numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, dstSlotIds[i]); SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[i]); + int32_t slotId = slotIds[i]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, i); - if (slotIds[i] == -1) { // the primary timestamp - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); - p->ts = pColVal->ts; - p->bytes = TSDB_KEYSIZE; - *(int64_t*)p->buf = pColVal->ts; - allNullRow = false; - } else { - int32_t slotId = slotIds[i]; - // add check for null value, caused by the modification of table schema (new column added). - if (slotId >= taosArrayGetSize(pRow)) { - p->ts = 0; - p->isNull = true; - colDataSetNULL(pColInfoData, numOfRows); - continue; - } + p->ts = pColVal->ts; + p->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); + allNullRow = p->isNull & allNullRow; - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); + if (!p->isNull) { + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + varDataSetLen(p->buf, pColVal->colVal.value.nData); - p->ts = pColVal->ts; - p->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); - allNullRow = p->isNull & allNullRow; - - if (!p->isNull) { - if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - varDataSetLen(p->buf, pColVal->colVal.value.nData); - memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); - p->bytes = pColVal->colVal.value.nData + VARSTR_HEADER_SIZE; // binary needs to plus the header size - } else { - memcpy(p->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); - p->bytes = pReader->pSchema->columns[slotId].bytes; - } + memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); + p->bytes = pColVal->colVal.value.nData + VARSTR_HEADER_SIZE; // binary needs to plus the header size + } else { + memcpy(p->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); + p->bytes = pReader->pSchema->columns[slotId].bytes; } } @@ -74,36 +57,31 @@ static int32_t saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* p pBlock->info.rows += allNullRow ? 0 : 1; } else if (HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST_ROW)) { for (int32_t i = 0; i < pReader->numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, dstSlotIds[i]); - if (slotIds[i] == -1) { - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); - colDataSetVal(pColInfoData, numOfRows, (const char*)&pColVal->ts, false); - } else { - int32_t slotId = slotIds[i]; - // add check for null value, caused by the modification of table schema (new column added). - if (slotId >= taosArrayGetSize(pRow)) { + int32_t slotId = slotIds[i]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, i); + SColVal* pVal = &pColVal->colVal; + + if (COL_VAL_IS_NONE(&pColVal->colVal)) { + continue; + } + allNullRow = false; + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { colDataSetNULL(pColInfoData, numOfRows); - continue; - } - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); - SColVal* pVal = &pColVal->colVal; - - if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { - colDataSetNULL(pColInfoData, numOfRows); - } else { - varDataSetLen(pReader->transferBuf[slotId], pVal->value.nData); - memcpy(varDataVal(pReader->transferBuf[slotId]), pVal->value.pData, pVal->value.nData); - colDataSetVal(pColInfoData, numOfRows, pReader->transferBuf[slotId], false); - } } else { - colDataSetVal(pColInfoData, numOfRows, (const char*)&pVal->value.val, !COL_VAL_IS_VALUE(pVal)); + varDataSetLen(pReader->transferBuf[slotId], pVal->value.nData); + + memcpy(varDataVal(pReader->transferBuf[slotId]), pVal->value.pData, pVal->value.nData); + colDataSetVal(pColInfoData, numOfRows, pReader->transferBuf[slotId], false); } + } else { + colDataSetVal(pColInfoData, numOfRows, (const char*)&pVal->value.val, !COL_VAL_IS_VALUE(pVal)); } } - pBlock->info.rows += 1; + pBlock->info.rows += allNullRow ? 0 : 1; } else { tsdbError("invalid retrieve type:%d, %s", pReader->type, idStr); return TSDB_CODE_INVALID_PARA; @@ -143,7 +121,7 @@ static int32_t setTableSchema(SCacheRowsReader* p, uint64_t suid, const char* id } int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList, int32_t numOfTables, int32_t numOfCols, - uint64_t suid, void** pReader, const char* idstr) { + SArray* pCidList, int32_t* pSlotIds, uint64_t suid, void** pReader, const char* idstr) { *pReader = NULL; SCacheRowsReader* p = taosMemoryCalloc(1, sizeof(SCacheRowsReader)); if (p == NULL) { @@ -155,6 +133,8 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList, p->pTsdb = p->pVnode->pTsdb; p->verRange = (SVersionRange){.minVer = 0, .maxVer = UINT64_MAX}; p->numOfCols = numOfCols; + p->pCidList = pCidList; + p->pSlotIds = pSlotIds; p->suid = suid; if (numOfTables == 0) { @@ -226,32 +206,9 @@ void* tsdbCacherowsReaderClose(void* pReader) { return NULL; } -static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint64_t uid, SArray** pRow, - LRUHandle** h) { - int32_t code = TSDB_CODE_SUCCESS; - *pRow = NULL; - - if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST_ROW)) { - code = tsdbCacheGetLastrowH(lruCache, uid, pr, h); - } else { - code = tsdbCacheGetLastH(lruCache, uid, pr, h); - } - - if (code != TSDB_CODE_SUCCESS) { - return code; - } - - // no data in the table of Uid - if (*h != NULL) { - *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); - } - - return code; -} - static void freeItem(void* pItem) { SLastCol* pCol = (SLastCol*)pItem; - if (IS_VAR_DATA_TYPE(pCol->colVal.type)) { + if (IS_VAR_DATA_TYPE(pCol->colVal.type) && pCol->colVal.value.pData) { taosMemoryFree(pCol->colVal.value.pData); } } @@ -277,19 +234,17 @@ static int32_t tsdbCacheQueryReseek(void* pQHandle) { } } -int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32_t* slotIds, SArray* pTableUidList) { +int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32_t* slotIds, const int32_t* dstSlotIds, + SArray* pTableUidList) { if (pReader == NULL || pResBlock == NULL) { return TSDB_CODE_INVALID_PARA; } SCacheRowsReader* pr = pReader; - - int32_t code = TSDB_CODE_SUCCESS; - SLRUCache* lruCache = pr->pVnode->pTsdb->lruCache; - LRUHandle* h = NULL; - SArray* pRow = NULL; - bool hasRes = false; - SArray* pLastCols = NULL; + int32_t code = TSDB_CODE_SUCCESS; + SArray* pRow = taosArrayInit(TARRAY_SIZE(pr->pCidList), sizeof(SLastCol)); + bool hasRes = false; + SArray* pLastCols = NULL; void** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); if (pRes == NULL) { @@ -298,20 +253,22 @@ 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[-1 == slotIds[j] ? 0 : 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; } - pLastCols = taosArrayInit(pr->pSchema->numOfCols, sizeof(SLastCol)); + pLastCols = taosArrayInit(pr->numOfCols, sizeof(SLastCol)); if (pLastCols == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _end; } - for (int32_t i = 0; i < pr->pSchema->numOfCols; ++i) { - struct STColumn* pCol = &pr->pSchema->columns[i]; + for (int32_t i = 0; i < pr->numOfCols; ++i) { + int32_t slotId = slotIds[i]; + struct STColumn* pCol = &pr->pSchema->columns[slotId]; SLastCol p = {.ts = INT64_MIN, .colVal.type = pCol->type, .colVal.flag = CV_FLAG_NULL}; if (IS_VAR_DATA_TYPE(pCol->type)) { @@ -328,6 +285,8 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 pr->pDataFReader = NULL; pr->pDataFReaderLast = NULL; + int32_t ltype = (pr->type & CACHESCAN_RETRIEVE_LAST) >> 3; + // retrieve the only one last row of all tables in the uid list. if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_SINGLE)) { int64_t st = taosGetTimestampUs(); @@ -335,16 +294,14 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 for (int32_t i = 0; i < pr->numOfTables; ++i) { STableKeyInfo* pKeyInfo = &pr->pTableList[i]; - code = doExtractCacheRow(pr, lruCache, pKeyInfo->uid, &pRow, &h); - if (code != TSDB_CODE_SUCCESS) { - goto _end; - } - - if (h == NULL) { + tsdbCacheGet(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype); + if (TARRAY_SIZE(pRow) <= 0) { + taosArrayClearEx(pRow, freeItem); continue; } - if (taosArrayGetSize(pRow) <= 0) { - tsdbCacheRelease(lruCache, h); + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); + if (COL_VAL_IS_NONE(&pColVal->colVal)) { + taosArrayClearEx(pRow, freeItem); continue; } @@ -352,47 +309,34 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 bool hasNotNullRow = true; int64_t singleTableLastTs = INT64_MAX; for (int32_t k = 0; k < pr->numOfCols; ++k) { - int32_t slotId = slotIds[k]; + SLastCol* p = taosArrayGet(pLastCols, k); + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, k); - if (slotId == -1) { // the primary timestamp - SLastCol* p = taosArrayGet(pLastCols, 0); - SLastCol* pCol = (SLastCol*)taosArrayGet(pRow, 0); - if (pCol->ts > p->ts) { - hasRes = true; - p->ts = pCol->ts; - p->colVal = pCol->colVal; - singleTableLastTs = pCol->ts; + if (pColVal->ts > p->ts) { + if (!COL_VAL_IS_VALUE(&pColVal->colVal) && HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST)) { + if (!COL_VAL_IS_VALUE(&p->colVal)) { + hasNotNullRow = false; + } + continue; } - } else { - SLastCol* p = taosArrayGet(pLastCols, slotId); - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); - if (pColVal->ts > p->ts) { - if (!COL_VAL_IS_VALUE(&pColVal->colVal) && HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST)) { - if (!COL_VAL_IS_VALUE(&p->colVal)) { - hasNotNullRow = false; - } - continue; + hasRes = true; + p->ts = pColVal->ts; + if (pColVal->ts < singleTableLastTs && HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST)) { + singleTableLastTs = pColVal->ts; + } + + if (!IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + p->colVal = pColVal->colVal; + } else { + if (COL_VAL_IS_VALUE(&pColVal->colVal)) { + memcpy(p->colVal.value.pData, pColVal->colVal.value.pData, pColVal->colVal.value.nData); } - hasRes = true; - p->ts = pColVal->ts; - if (pColVal->ts < singleTableLastTs && HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST)) { - singleTableLastTs = pColVal->ts; - } - - if (!IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - p->colVal = pColVal->colVal; - } else { - if (COL_VAL_IS_VALUE(&pColVal->colVal)) { - memcpy(p->colVal.value.pData, pColVal->colVal.value.pData, pColVal->colVal.value.nData); - } - - p->colVal.value.nData = pColVal->colVal.value.nData; - p->colVal.type = pColVal->colVal.type; - p->colVal.flag = pColVal->colVal.flag; - p->colVal.cid = pColVal->colVal.cid; - } + p->colVal.value.nData = pColVal->colVal.value.nData; + p->colVal.type = pColVal->colVal.type; + p->colVal.flag = pColVal->colVal.flag; + p->colVal.cid = pColVal->colVal.cid; } } } @@ -414,33 +358,31 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 taosArraySet(pTableUidList, 0, &pKeyInfo->uid); } - tsdbCacheRelease(lruCache, h); + taosArrayClearEx(pRow, freeItem); } if (hasRes) { - saveOneRow(pLastCols, pResBlock, pr, slotIds, pRes, pr->idstr); + saveOneRow(pLastCols, pResBlock, pr, slotIds, dstSlotIds, pRes, pr->idstr); } } else if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_ALL)) { for (int32_t i = pr->tableIndex; i < pr->numOfTables; ++i) { STableKeyInfo* pKeyInfo = &pr->pTableList[i]; - code = doExtractCacheRow(pr, lruCache, pKeyInfo->uid, &pRow, &h); - if (code != TSDB_CODE_SUCCESS) { - goto _end; - } - if (h == NULL) { + tsdbCacheGet(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype); + if (TARRAY_SIZE(pRow) <= 0) { + taosArrayClearEx(pRow, freeItem); continue; } - if (taosArrayGetSize(pRow) <= 0) { - tsdbCacheRelease(lruCache, h); + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); + if (COL_VAL_IS_NONE(&pColVal->colVal)) { + taosArrayClearEx(pRow, freeItem); continue; } - saveOneRow(pRow, pResBlock, pr, slotIds, pRes, pr->idstr); - // TODO reset the pRes + saveOneRow(pRow, pResBlock, pr, slotIds, dstSlotIds, pRes, pr->idstr); + taosArrayClearEx(pRow, freeItem); taosArrayPush(pTableUidList, &pKeyInfo->uid); - tsdbCacheRelease(lruCache, h); pr->tableIndex += 1; if (pResBlock->info.rows >= pResBlock->info.capacity) { @@ -466,6 +408,7 @@ _end: } taosMemoryFree(pRes); + taosArrayDestroyEx(pRow, freeItem); taosArrayDestroyEx(pLastCols, freeItem); return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index d0ff403bf7..b6141abcf9 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -140,7 +140,6 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid SMemTable *pMemTable = pTsdb->mem; STbData *pTbData = NULL; SVBufPool *pPool = pTsdb->pVnode->inUse; - TSDBKEY lastKey = {.version = version, .ts = eKey}; // check if table exists SMetaInfo info; @@ -181,7 +180,7 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid pMemTable->nDel++; pMemTable->minVer = TMIN(pMemTable->minVer, version); pMemTable->maxVer = TMIN(pMemTable->maxVer, version); - + /* if (TSDB_CACHE_LAST_ROW(pMemTable->pTsdb->pVnode->config) && tsdbKeyCmprFn(&lastKey, &pTbData->maxKey) >= 0) { tsdbCacheDeleteLastrow(pTsdb->lruCache, pTbData->uid, eKey); } @@ -189,6 +188,10 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid if (TSDB_CACHE_LAST(pMemTable->pTsdb->pVnode->config)) { tsdbCacheDeleteLast(pTsdb->lruCache, pTbData->uid, eKey); } + */ + if (eKey >= pTbData->maxKey && sKey <= pTbData->maxKey) { + tsdbCacheDel(pTsdb, suid, uid, sKey, eKey); + } tsdbTrace("vgId:%d, delete data from table suid:%" PRId64 " uid:%" PRId64 " skey:%" PRId64 " eKey:%" PRId64 " at version %" PRId64, @@ -284,8 +287,8 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) { int64_t tsdbCountTbDataRows(STbData *pTbData) { SMemSkipListNode *pNode = pTbData->sl.pHead; - int64_t rowsNum = 0; - + int64_t rowsNum = 0; + while (NULL != pNode) { pNode = SL_GET_NODE_FORWARD(pNode, 0); if (pNode == pTbData->sl.pTail) { @@ -298,17 +301,17 @@ int64_t tsdbCountTbDataRows(STbData *pTbData) { return rowsNum; } -void tsdbMemTableCountRows(SMemTable *pMemTable, SHashObj* pTableMap, int64_t *rowsNum) { +void tsdbMemTableCountRows(SMemTable *pMemTable, SHashObj *pTableMap, int64_t *rowsNum) { taosRLockLatch(&pMemTable->latch); for (int32_t i = 0; i < pMemTable->nBucket; ++i) { STbData *pTbData = pMemTable->aBucket[i]; while (pTbData) { - void* p = taosHashGet(pTableMap, &pTbData->uid, sizeof(pTbData->uid)); + void *p = taosHashGet(pTableMap, &pTbData->uid, sizeof(pTbData->uid)); if (p == NULL) { pTbData = pTbData->next; continue; } - + *rowsNum += tsdbCountTbDataRows(pTbData); pTbData = pTbData->next; } @@ -668,15 +671,8 @@ static int32_t tsdbInsertColDataToTable(SMemTable *pMemTable, STbData *pTbData, if (key.ts >= pTbData->maxKey) { pTbData->maxKey = key.ts; - - if (TSDB_CACHE_LAST_ROW(pMemTable->pTsdb->pVnode->config)) { - tsdbCacheInsertLastrow(pMemTable->pTsdb->lruCache, pMemTable->pTsdb, pTbData->uid, &lRow, true); - } - } - - if (TSDB_CACHE_LAST(pMemTable->pTsdb->pVnode->config)) { - tsdbCacheInsertLast(pMemTable->pTsdb->lruCache, pTbData->uid, &lRow, pMemTable->pTsdb); } + tsdbCacheUpdate(pMemTable->pTsdb, pTbData->suid, pTbData->uid, &lRow); // SMemTable pMemTable->minKey = TMIN(pMemTable->minKey, pTbData->minKey); @@ -736,15 +732,8 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData, if (key.ts >= pTbData->maxKey) { pTbData->maxKey = key.ts; - - if (TSDB_CACHE_LAST_ROW(pMemTable->pTsdb->pVnode->config)) { - tsdbCacheInsertLastrow(pMemTable->pTsdb->lruCache, pMemTable->pTsdb, pTbData->uid, &lRow, true); - } - } - - if (TSDB_CACHE_LAST(pMemTable->pTsdb->pVnode->config)) { - tsdbCacheInsertLast(pMemTable->pTsdb->lruCache, pTbData->uid, &lRow, pMemTable->pTsdb); } + tsdbCacheUpdate(pMemTable->pTsdb, pTbData->suid, pTbData->uid, &lRow); // SMemTable pMemTable->minKey = TMIN(pMemTable->minKey, pTbData->minKey); diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index 511ba9cc24..faa4d2fc57 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -134,6 +134,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { if (tjsonAddIntegerToObject(pJson, "sstTrigger", pCfg->sttTrigger) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashBegin", pCfg->hashBegin) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashEnd", pCfg->hashEnd) < 0) return -1; + if (tjsonAddIntegerToObject(pJson, "hashChange", pCfg->hashChange) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashMethod", pCfg->hashMethod) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashPrefix", pCfg->hashPrefix) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashSuffix", pCfg->hashSuffix) < 0) return -1; @@ -249,6 +250,8 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { if (code < 0) return -1; tjsonGetNumberValue(pJson, "hashEnd", pCfg->hashEnd, code); if (code < 0) return -1; + tjsonGetNumberValue(pJson, "hashChange", pCfg->hashChange, code); + if (code < 0) return -1; tjsonGetNumberValue(pJson, "hashMethod", pCfg->hashMethod, code); if (code < 0) return -1; tjsonGetNumberValue(pJson, "hashPrefix", pCfg->hashPrefix, code); diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 847125018c..74168591d2 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -144,8 +144,8 @@ _exit: } int vnodeShouldCommit(SVnode *pVnode, bool atExit) { - bool diskAvail = osDataSpaceAvailable(); - bool needCommit = false; + bool diskAvail = osDataSpaceAvailable(); + bool needCommit = false; taosThreadMutexLock(&pVnode->mutex); if (pVnode->inUse && diskAvail) { @@ -439,6 +439,9 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { code = tsdbCommit(pVnode->pTsdb, pInfo); TSDB_CHECK_CODE(code, lino, _exit); + code = tsdbCacheCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + if (VND_IS_RSMA(pVnode)) { code = smaCommit(pVnode->pSma, pInfo); TSDB_CHECK_CODE(code, lino, _exit); diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 7d41edfdd9..b5e7c6875b 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -198,6 +198,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod info.config.vgId = pReq->dstVgId; info.config.hashBegin = pReq->hashBegin; info.config.hashEnd = pReq->hashEnd; + info.config.hashChange = true; info.config.walCfg.vgId = pReq->dstVgId; SSyncCfg *pCfg = &info.config.syncCfg; @@ -235,8 +236,6 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod return -1; } - // todo vnode compact here - vInfo("vgId:%d, vnode hashrange is altered", info.config.vgId); return 0; } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index dd576392f0..a8511eedfd 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -425,7 +425,10 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp } } break; case TDMT_VND_ALTER_CONFIRM: - vnodeProcessAlterConfirmReq(pVnode, version, pReq, len, pRsp); + needCommit = pVnode->config.hashChange; + if (vnodeProcessAlterConfirmReq(pVnode, version, pReq, len, pRsp) < 0) { + goto _err; + } break; case TDMT_VND_ALTER_CONFIG: vnodeProcessAlterConfigReq(pVnode, version, pReq, len, pRsp); @@ -1453,15 +1456,39 @@ int32_t vnodeProcessCreateTSma(SVnode *pVnode, void *pCont, uint32_t contLen) { return vnodeProcessCreateTSmaReq(pVnode, 1, pCont, contLen, NULL); } +static int32_t vnodeConsolidateAlterHashRange(SVnode *pVnode, int64_t version) { + int32_t code = TSDB_CODE_SUCCESS; + + vInfo("vgId:%d, trim meta of tables per hash range [%" PRIu32 ", %" PRIu32 "]. apply-index:%" PRId64, TD_VID(pVnode), + pVnode->config.hashBegin, pVnode->config.hashEnd, version); + + // TODO: trim meta of tables from TDB per hash range [pVnode->config.hashBegin, pVnode->config.hashEnd] + + return code; +} + static int32_t vnodeProcessAlterConfirmReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) { - vInfo("vgId:%d, vnode management handle msgType:alter-confirm, alter replica confim msg is processed", - TD_VID(pVnode)); + vInfo("vgId:%d, vnode handle msgType:alter-confirm, alter confim msg is processed", TD_VID(pVnode)); + int32_t code = TSDB_CODE_SUCCESS; + if (!pVnode->config.hashChange) { + goto _exit; + } + + code = vnodeConsolidateAlterHashRange(pVnode, version); + if (code < 0) { + vError("vgId:%d, failed to consolidate alter hashrange since %s. version:%" PRId64, TD_VID(pVnode), terrstr(), + version); + goto _exit; + } + pVnode->config.hashChange = false; + +_exit: pRsp->msgType = TDMT_VND_ALTER_CONFIRM_RSP; - pRsp->code = TSDB_CODE_SUCCESS; + pRsp->code = code; pRsp->pCont = NULL; pRsp->contLen = 0; - return 0; + return code; } static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) { diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 4302302d7a..c5b9eb7475 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -1128,6 +1128,11 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i EXPLAIN_ROW_END(); QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_OUTPUT_FORMAT); + EXPLAIN_ROW_APPEND(EXPLAIN_IGNORE_GROUPID_FORMAT, pMergeNode->ignoreGroupId ? "true" : "false"); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_MERGE_KEYS_FORMAT); if (pMergeNode->groupSort) { EXPLAIN_ROW_APPEND(EXPLAIN_STRING_TYPE_FORMAT, "_group_id asc"); diff --git a/source/libs/executor/src/aggregateoperator.c b/source/libs/executor/src/aggregateoperator.c index ec8060348d..1f170552db 100644 --- a/source/libs/executor/src/aggregateoperator.c +++ b/source/libs/executor/src/aggregateoperator.c @@ -467,8 +467,8 @@ int32_t doInitAggInfoSup(SAggSupporter* pAggSup, SqlFunctionCtx* pCtx, int32_t n getBufferPgSize(pAggSup->resultRowSize, &defaultPgsz, &defaultBufsz); if (!osTempSpaceAvailable()) { - code = TSDB_CODE_NO_AVAIL_DISK; - qError("Init stream agg supporter failed since %s, %s", terrstr(code), pKey); + code = TSDB_CODE_NO_DISKSPACE; + qError("Init stream agg supporter failed since %s, key:%s, tempDir:%s", terrstr(code), pKey, tsTempDir); return code; } diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index 61f024ebb7..925e305450 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -31,18 +31,21 @@ typedef struct SCacheRowsScanInfo { void* pLastrowReader; SColMatchInfo matchInfo; int32_t* pSlotIds; + int32_t* pDstSlotIds; SExprSupp pseudoExprSup; int32_t retrieveType; int32_t currentGroupIndex; SSDataBlock* pBufferredRes; SArray* pUidList; + SArray* pCidList; int32_t indexOfBufferedRes; STableListInfo* pTableList; } SCacheRowsScanInfo; static SSDataBlock* doScanCache(SOperatorInfo* pOperator); static void destroyCacheScanOperator(void* param); -static int32_t extractCacheScanSlotId(const SArray* pColMatchInfo, SExecTaskInfo* pTaskInfo, int32_t** pSlotIds); +static int32_t extractCacheScanSlotId(const SArray* pColMatchInfo, SExecTaskInfo* pTaskInfo, int32_t** pSlotIds, + int32_t** pDstSlotIds); static int32_t removeRedundantTsCol(SLastRowScanPhysiNode* pScanNode, SColMatchInfo* pColMatchInfo); #define SCAN_ROW_TYPE(_t) ((_t) ? CACHESCAN_RETRIEVE_LAST : CACHESCAN_RETRIEVE_LAST_ROW) @@ -71,9 +74,16 @@ SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pScanNode, SRe goto _error; } + SArray* pCidList = taosArrayInit(numOfCols, sizeof(int16_t)); + for (int i = 0; i < TARRAY_SIZE(pInfo->matchInfo.pList); ++i) { + SColMatchItem* pColInfo = taosArrayGet(pInfo->matchInfo.pList, i); + taosArrayPush(pCidList, &pColInfo->colId); + } + pInfo->pCidList = pCidList; + removeRedundantTsCol(pScanNode, &pInfo->matchInfo); - code = extractCacheScanSlotId(pInfo->matchInfo.pList, pTaskInfo, &pInfo->pSlotIds); + code = extractCacheScanSlotId(pInfo->matchInfo.pList, pTaskInfo, &pInfo->pSlotIds, &pInfo->pDstSlotIds); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -91,8 +101,8 @@ SOperatorInfo* createCacherowsScanOperator(SLastRowScanPhysiNode* pScanNode, SRe uint64_t suid = tableListGetSuid(pTableListInfo); code = tsdbCacherowsReaderOpen(pInfo->readHandle.vnode, pInfo->retrieveType, pList, totalTables, - taosArrayGetSize(pInfo->matchInfo.pList), suid, &pInfo->pLastrowReader, - pTaskInfo->id.str); + taosArrayGetSize(pInfo->matchInfo.pList), pCidList, pInfo->pSlotIds, suid, + &pInfo->pLastrowReader, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -160,8 +170,8 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { blockDataCleanup(pInfo->pBufferredRes); taosArrayClear(pInfo->pUidList); - int32_t code = - tsdbRetrieveCacheRows(pInfo->pLastrowReader, pInfo->pBufferredRes, pInfo->pSlotIds, pInfo->pUidList); + int32_t code = tsdbRetrieveCacheRows(pInfo->pLastrowReader, pInfo->pBufferredRes, pInfo->pSlotIds, + pInfo->pDstSlotIds, pInfo->pUidList); if (code != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, code); } @@ -227,8 +237,8 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { } code = tsdbCacherowsReaderOpen(pInfo->readHandle.vnode, pInfo->retrieveType, pList, num, - taosArrayGetSize(pInfo->matchInfo.pList), suid, &pInfo->pLastrowReader, - pTaskInfo->id.str); + taosArrayGetSize(pInfo->matchInfo.pList), pInfo->pCidList, pInfo->pSlotIds, suid, + &pInfo->pLastrowReader, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { pInfo->currentGroupIndex += 1; taosArrayClear(pInfo->pUidList); @@ -237,7 +247,8 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { taosArrayClear(pInfo->pUidList); - code = tsdbRetrieveCacheRows(pInfo->pLastrowReader, pInfo->pRes, pInfo->pSlotIds, pInfo->pUidList); + code = tsdbRetrieveCacheRows(pInfo->pLastrowReader, pInfo->pRes, pInfo->pSlotIds, pInfo->pDstSlotIds, + pInfo->pUidList); if (code != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, code); } @@ -280,6 +291,8 @@ void destroyCacheScanOperator(void* param) { blockDataDestroy(pInfo->pRes); blockDataDestroy(pInfo->pBufferredRes); taosMemoryFree(pInfo->pSlotIds); + taosMemoryFree(pInfo->pDstSlotIds); + taosArrayDestroy(pInfo->pCidList); taosArrayDestroy(pInfo->pUidList); taosArrayDestroy(pInfo->matchInfo.pList); tableListDestroy(pInfo->pTableList); @@ -292,7 +305,8 @@ void destroyCacheScanOperator(void* param) { taosMemoryFreeClear(param); } -int32_t extractCacheScanSlotId(const SArray* pColMatchInfo, SExecTaskInfo* pTaskInfo, int32_t** pSlotIds) { +int32_t extractCacheScanSlotId(const SArray* pColMatchInfo, SExecTaskInfo* pTaskInfo, int32_t** pSlotIds, + int32_t** pDstSlotIds) { size_t numOfCols = taosArrayGetSize(pColMatchInfo); *pSlotIds = taosMemoryMalloc(numOfCols * sizeof(int32_t)); @@ -300,18 +314,25 @@ int32_t extractCacheScanSlotId(const SArray* pColMatchInfo, SExecTaskInfo* pTask return TSDB_CODE_OUT_OF_MEMORY; } + *pDstSlotIds = taosMemoryMalloc(numOfCols * sizeof(int32_t)); + if (*pDstSlotIds == NULL) { + taosMemoryFree(*pSlotIds); + return TSDB_CODE_OUT_OF_MEMORY; + } + SSchemaWrapper* pWrapper = pTaskInfo->schemaInfo.sw; for (int32_t i = 0; i < numOfCols; ++i) { SColMatchItem* pColMatch = taosArrayGet(pColMatchInfo, i); for (int32_t j = 0; j < pWrapper->nCols; ++j) { - if (pColMatch->colId == pWrapper->pSchema[j].colId && pColMatch->colId == PRIMARYKEY_TIMESTAMP_COL_ID) { + /* if (pColMatch->colId == pWrapper->pSchema[j].colId && pColMatch->colId == PRIMARYKEY_TIMESTAMP_COL_ID) { (*pSlotIds)[pColMatch->dstSlotId] = -1; break; - } + }*/ if (pColMatch->colId == pWrapper->pSchema[j].colId) { - (*pSlotIds)[pColMatch->dstSlotId] = j; + (*pSlotIds)[i] = j; + (*pDstSlotIds)[i] = pColMatch->dstSlotId; break; } } diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index cb0f1aa068..df62a7fa77 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -545,6 +545,7 @@ typedef struct SMultiwayMergeOperatorInfo { SSDataBlock* pIntermediateBlock; // to hold the intermediate result int64_t startTs; // sort start time bool groupSort; + bool ignoreGroupId; uint64_t groupId; STupleHandle* prefetchedTuple; } SMultiwayMergeOperatorInfo; @@ -694,7 +695,11 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData } pDataBlock->info.rows = p->info.rows; - pDataBlock->info.id.groupId = pInfo->groupId; + if (pInfo->ignoreGroupId) { + pDataBlock->info.id.groupId = 0; + } else { + pDataBlock->info.id.groupId = pInfo->groupId; + } pDataBlock->info.dataLoad = 1; } @@ -785,6 +790,7 @@ SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** downStreams, size blockDataEnsureCapacity(pInfo->binfo.pRes, pOperator->resultInfo.capacity); pInfo->groupSort = pMergePhyNode->groupSort; + pInfo->ignoreGroupId = pMergePhyNode->ignoreGroupId; pInfo->pSortInfo = createSortInfo(pMergePhyNode->pMergeKeys); pInfo->pInputBlock = pInputBlock; size_t numOfCols = taosArrayGetSize(pInfo->binfo.pRes->pDataBlock); diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index f0e25d8cc5..b7f7a44080 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -36,6 +36,11 @@ typedef struct STimeSliceOperatorInfo { SColumn tsCol; // primary timestamp column SExprSupp scalarSup; // scalar calculation struct SFillColInfo* pFillColInfo; // fill column info + int64_t prevTs; + bool prevTsSet; + uint64_t groupId; + SGroupKeys* pPrevGroupKey; + SSDataBlock* pNextGroupRes; } STimeSliceOperatorInfo; static void destroyTimeSliceOperatorInfo(void* param); @@ -166,18 +171,55 @@ static bool isIsfilledPseudoColumn(SExprInfo* pExprInfo) { return (IS_BOOLEAN_TYPE(pExprInfo->base.resSchema.type) && strcasecmp(name, "_isfilled") == 0); } +static bool checkDuplicateTimestamps(STimeSliceOperatorInfo* pSliceInfo, SColumnInfoData* pTsCol, + int32_t curIndex, int32_t rows) { + + + int64_t currentTs = *(int64_t*)colDataGetData(pTsCol, curIndex); + if (currentTs > pSliceInfo->win.ekey) { + return false; + } + + if ((pSliceInfo->prevTsSet == true) && (currentTs == pSliceInfo->prevTs)) { + return true; + } + + pSliceInfo->prevTsSet = true; + pSliceInfo->prevTs = currentTs; + + if (currentTs == pSliceInfo->win.ekey && curIndex < rows - 1) { + int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, curIndex + 1); + if (currentTs == nextTs) { + return true; + } + } + + return false; +} + +static bool isInterpFunc(SExprInfo* pExprInfo) { + int32_t functionType = pExprInfo->pExpr->_function.functionType; + return (functionType == FUNCTION_TYPE_INTERP); +} + +static bool isGroupKeyFunc(SExprInfo* pExprInfo) { + int32_t functionType = pExprInfo->pExpr->_function.functionType; + return (functionType == FUNCTION_TYPE_GROUP_KEY); +} + static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* pExprSup, SSDataBlock* pResBlock, - bool beforeTs) { + SSDataBlock* pSrcBlock, int32_t index, bool beforeTs) { int32_t rows = pResBlock->info.rows; timeSliceEnsureBlockCapacity(pSliceInfo, pResBlock); // todo set the correct primary timestamp column + // output the result bool hasInterp = true; for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; - int32_t dstSlot = pExprInfo->base.resSchema.slotId; + int32_t dstSlot = pExprInfo->base.resSchema.slotId; SColumnInfoData* pDst = taosArrayGet(pResBlock->pDataBlock, dstSlot); if (isIrowtsPseudoColumn(pExprInfo)) { @@ -187,6 +229,30 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp bool isFilled = true; colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false); continue; + } else if (!isInterpFunc(pExprInfo)) { + if (isGroupKeyFunc(pExprInfo)) { + if (pSrcBlock != NULL) { + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); + + if (colDataIsNull_s(pSrc, index)) { + colDataSetNULL(pDst, pResBlock->info.rows); + continue; + } + + char* v = colDataGetData(pSrc, index); + colDataSetVal(pDst, pResBlock->info.rows, v, false); + } else { + // use stored group key + SGroupKeys* pkey = pSliceInfo->pPrevGroupKey; + if (pkey->isNull == false) { + colDataSetVal(pDst, rows, pkey->pData, false); + } else { + colDataSetNULL(pDst, rows); + } + } + } + continue; } int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; @@ -312,7 +378,7 @@ static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* bool isFilled = false; colDataSetVal(pDst, pResBlock->info.rows, (char*)&isFilled, false); } else { - int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); if (colDataIsNull_s(pSrc, index)) { @@ -412,7 +478,31 @@ static int32_t initFillLinearInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pB return TSDB_CODE_SUCCESS; } -static int32_t initKeeperInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock) { +static int32_t initGroupKeyKeeper(STimeSliceOperatorInfo* pInfo, SExprSupp* pExprSup) { + if (pInfo->pPrevGroupKey != NULL) { + return TSDB_CODE_SUCCESS; + } + + pInfo->pPrevGroupKey = taosMemoryCalloc(1, sizeof(SGroupKeys)); + if (pInfo->pPrevGroupKey == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int32_t i = 0; i < pExprSup->numOfExprs; ++i) { + SExprInfo* pExprInfo = &pExprSup->pExprInfo[i]; + + if (isGroupKeyFunc(pExprInfo)) { + pInfo->pPrevGroupKey->bytes = pExprInfo->base.resSchema.bytes; + pInfo->pPrevGroupKey->type = pExprInfo->base.resSchema.type; + pInfo->pPrevGroupKey->isNull = false; + pInfo->pPrevGroupKey->pData = taosMemoryCalloc(1, pInfo->pPrevGroupKey->bytes); + } + } + + return TSDB_CODE_SUCCESS; +} + +static int32_t initKeeperInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock, SExprSupp* pExprSup) { int32_t code; code = initPrevRowsKeeper(pInfo, pBlock); if (code != TSDB_CODE_SUCCESS) { @@ -429,9 +519,202 @@ static int32_t initKeeperInfo(STimeSliceOperatorInfo* pInfo, SSDataBlock* pBlock return TSDB_CODE_FAILED; } + code = initGroupKeyKeeper(pInfo, pExprSup); + if (code != TSDB_CODE_SUCCESS) { + return TSDB_CODE_FAILED; + } + + return TSDB_CODE_SUCCESS; } +static int32_t resetPrevRowsKeeper(STimeSliceOperatorInfo* pInfo) { + if (pInfo->pPrevRow == NULL) { + return TSDB_CODE_SUCCESS; + } + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pLinearInfo); ++i) { + SGroupKeys *pKey = taosArrayGet(pInfo->pPrevRow, i); + pKey->isNull = false; + } + + pInfo->isPrevRowSet = false; + + return TSDB_CODE_SUCCESS; +} + +static int32_t resetNextRowsKeeper(STimeSliceOperatorInfo* pInfo) { + if (pInfo->pNextRow == NULL) { + return TSDB_CODE_SUCCESS; + } + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pLinearInfo); ++i) { + SGroupKeys *pKey = taosArrayGet(pInfo->pPrevRow, i); + pKey->isNull = false; + } + + pInfo->isNextRowSet = false; + + return TSDB_CODE_SUCCESS; +} + +static int32_t resetFillLinearInfo(STimeSliceOperatorInfo* pInfo) { + if (pInfo->pLinearInfo == NULL) { + return TSDB_CODE_SUCCESS; + } + + for (int32_t i = 0; i < taosArrayGetSize(pInfo->pLinearInfo); ++i) { + SFillLinearInfo *pLinearInfo = taosArrayGet(pInfo->pLinearInfo, i); + pLinearInfo->start.key = INT64_MIN; + pLinearInfo->end.key = INT64_MIN; + pLinearInfo->isStartSet = false; + pLinearInfo->isEndSet = false; + } + + return TSDB_CODE_SUCCESS; +} + +static int32_t resetKeeperInfo(STimeSliceOperatorInfo* pInfo) { + resetPrevRowsKeeper(pInfo); + resetNextRowsKeeper(pInfo); + resetFillLinearInfo(pInfo); + + return TSDB_CODE_SUCCESS; +} + +static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pSliceInfo, SSDataBlock* pBlock, + SExecTaskInfo* pTaskInfo) { + SSDataBlock* pResBlock = pSliceInfo->pRes; + SInterval* pInterval = &pSliceInfo->interval; + + SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); + for (int32_t i = 0; i < pBlock->info.rows; ++i) { + int64_t ts = *(int64_t*)colDataGetData(pTsCol, i); + + // check for duplicate timestamps + if (checkDuplicateTimestamps(pSliceInfo, pTsCol, i, pBlock->info.rows)) { + T_LONG_JMP(pTaskInfo->env, TSDB_CODE_FUNC_DUP_TIMESTAMP); + } + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + break; + } + + if (ts == pSliceInfo->current) { + addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); + + doKeepPrevRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + if (pSliceInfo->current > pSliceInfo->win.ekey) { + break; + } + } else if (ts < pSliceInfo->current) { + // in case of interpolation window starts and ends between two datapoints, fill(prev) need to interpolate + doKeepPrevRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + if (i < pBlock->info.rows - 1) { + // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate + doKeepNextRows(pSliceInfo, pBlock, i + 1); + int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, i + 1); + if (nextTs > pSliceInfo->current) { + while (pSliceInfo->current < nextTs && pSliceInfo->current <= pSliceInfo->win.ekey) { + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, false) && + pSliceInfo->fillType == TSDB_FILL_LINEAR) { + break; + } else { + pSliceInfo->current = taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, + pInterval->precision); + } + } + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + break; + } + } else { + // ignore current row, and do nothing + } + } else { // it is the last row of current block + doKeepPrevRows(pSliceInfo, pBlock, i); + } + } else { // ts > pSliceInfo->current + // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate + doKeepNextRows(pSliceInfo, pBlock, i); + doKeepLinearInfo(pSliceInfo, pBlock, i); + + while (pSliceInfo->current < ts && pSliceInfo->current <= pSliceInfo->win.ekey) { + if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i, true) && + pSliceInfo->fillType == TSDB_FILL_LINEAR) { + break; + } else { + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + } + + // add current row if timestamp match + if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) { + addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); + + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } + doKeepPrevRows(pSliceInfo, pBlock, i); + + if (pSliceInfo->current > pSliceInfo->win.ekey) { + break; + } + } + } +} + +static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperatorInfo* pOperator, int32_t index) { + SSDataBlock* pResBlock = pSliceInfo->pRes; + SInterval* pInterval = &pSliceInfo->interval; + + while (pSliceInfo->current <= pSliceInfo->win.ekey && pSliceInfo->fillType != TSDB_FILL_NEXT && + pSliceInfo->fillType != TSDB_FILL_LINEAR) { + genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, NULL, index, false); + pSliceInfo->current = + taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); + } +} + +static void copyPrevGroupKey(SExprSupp* pExprSup, SGroupKeys* pGroupKey, SSDataBlock* pSrcBlock) { + for (int32_t j = 0; j < pExprSup->numOfExprs; ++j) { + SExprInfo* pExprInfo = &pExprSup->pExprInfo[j]; + + if (isGroupKeyFunc(pExprInfo)) { + int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); + + if (colDataIsNull_s(pSrc, 0)) { + pGroupKey->isNull = true; + break; + } + + char* v = colDataGetData(pSrc, 0); + if (IS_VAR_DATA_TYPE(pGroupKey->type)) { + memcpy(pGroupKey->pData, v, varDataTLen(v)); + } else { + memcpy(pGroupKey->pData, v, pGroupKey->bytes); + } + + pGroupKey->isNull = false; + break; + } + } +} + +static void resetTimesliceInfo(STimeSliceOperatorInfo* pSliceInfo) { + pSliceInfo->current = pSliceInfo->win.skey; + pSliceInfo->prevTsSet = false; + resetKeeperInfo(pSliceInfo); +} + static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { if (pOperator->status == OP_EXEC_DONE) { return NULL; @@ -450,118 +733,62 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) { blockDataCleanup(pResBlock); while (1) { - SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); - if (pBlock == NULL) { - break; + if (pSliceInfo->pNextGroupRes != NULL) { + setInputDataBlock(pSup, pSliceInfo->pNextGroupRes, order, MAIN_SCAN, true); + doTimesliceImpl(pOperator, pSliceInfo, pSliceInfo->pNextGroupRes, pTaskInfo); + copyPrevGroupKey(&pOperator->exprSupp, pSliceInfo->pPrevGroupKey, pSliceInfo->pNextGroupRes); + pSliceInfo->pNextGroupRes = NULL; } - if (pSliceInfo->scalarSup.pExprInfo != NULL) { - SExprSupp* pExprSup = &pSliceInfo->scalarSup; - projectApplyFunctions(pExprSup->pExprInfo, pBlock, pBlock, pExprSup->pCtx, pExprSup->numOfExprs, NULL); - } - - int32_t code = initKeeperInfo(pSliceInfo, pBlock); - if (code != TSDB_CODE_SUCCESS) { - T_LONG_JMP(pTaskInfo->env, code); - } - - // the pDataBlock are always the same one, no need to call this again - setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true); - - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); - for (int32_t i = 0; i < pBlock->info.rows; ++i) { - int64_t ts = *(int64_t*)colDataGetData(pTsCol, i); - - if (pSliceInfo->current > pSliceInfo->win.ekey) { + while (1) { + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { setOperatorCompleted(pOperator); break; } - if (ts == pSliceInfo->current) { - addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); - - doKeepPrevRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - } else if (ts < pSliceInfo->current) { - // in case of interpolation window starts and ends between two datapoints, fill(prev) need to interpolate - doKeepPrevRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - if (i < pBlock->info.rows - 1) { - // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate - doKeepNextRows(pSliceInfo, pBlock, i + 1); - int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, i + 1); - if (nextTs > pSliceInfo->current) { - while (pSliceInfo->current < nextTs && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false) && - pSliceInfo->fillType == TSDB_FILL_LINEAR) { - break; - } else { - pSliceInfo->current = taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, - pInterval->precision); - } - } - - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); - break; - } - } else { - // ignore current row, and do nothing - } - } else { // it is the last row of current block - doKeepPrevRows(pSliceInfo, pBlock, i); - } - } else { // ts > pSliceInfo->current - // in case of interpolation window starts and ends between two datapoints, fill(next) need to interpolate - doKeepNextRows(pSliceInfo, pBlock, i); - doKeepLinearInfo(pSliceInfo, pBlock, i); - - while (pSliceInfo->current < ts && pSliceInfo->current <= pSliceInfo->win.ekey) { - if (!genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, true) && - pSliceInfo->fillType == TSDB_FILL_LINEAR) { - break; - } else { - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - } - - // add current row if timestamp match - if (ts == pSliceInfo->current && pSliceInfo->current <= pSliceInfo->win.ekey) { - addCurrentRowToResult(pSliceInfo, &pOperator->exprSupp, pResBlock, pBlock, i); - - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - doKeepPrevRows(pSliceInfo, pBlock, i); - - if (pSliceInfo->current > pSliceInfo->win.ekey) { - setOperatorCompleted(pOperator); + if (pSliceInfo->groupId == 0 && pBlock->info.id.groupId != 0) { + pSliceInfo->groupId = pBlock->info.id.groupId; + } else { + if (pSliceInfo->groupId != pBlock->info.id.groupId) { + pSliceInfo->groupId = pBlock->info.id.groupId; + pSliceInfo->pNextGroupRes = pBlock; break; } } + + if (pSliceInfo->scalarSup.pExprInfo != NULL) { + SExprSupp* pExprSup = &pSliceInfo->scalarSup; + projectApplyFunctions(pExprSup->pExprInfo, pBlock, pBlock, pExprSup->pCtx, pExprSup->numOfExprs, NULL); + } + + int32_t code = initKeeperInfo(pSliceInfo, pBlock, &pOperator->exprSupp); + if (code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, code); + } + + // the pDataBlock are always the same one, no need to call this again + setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true); + doTimesliceImpl(pOperator, pSliceInfo, pBlock, pTaskInfo); + copyPrevGroupKey(&pOperator->exprSupp, pSliceInfo->pPrevGroupKey, pBlock); + } + + // check if need to interpolate after last datablock + // except for fill(next), fill(linear) + genInterpAfterDataBlock(pSliceInfo, pOperator, 0); + + doFilter(pResBlock, pOperator->exprSupp.pFilterInfo, NULL); + if (pOperator->status == OP_EXEC_DONE) { + break; + } + + // restore initial value for next group + resetTimesliceInfo(pSliceInfo); + if (pResBlock->info.rows >= 4096) { + break; } } - // check if need to interpolate after last datablock - // except for fill(next), fill(linear) - while (pSliceInfo->current <= pSliceInfo->win.ekey && pSliceInfo->fillType != TSDB_FILL_NEXT && - pSliceInfo->fillType != TSDB_FILL_LINEAR) { - genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, false); - pSliceInfo->current = - taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); - } - - doFilter(pResBlock, pOperator->exprSupp.pFilterInfo, NULL); - // restore the value setTaskStatus(pOperator->pTaskInfo, TASK_COMPLETED); if (pResBlock->info.rows == 0) { @@ -612,6 +839,11 @@ SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode pInfo->win = pInterpPhyNode->timeRange; pInfo->interval.interval = pInterpPhyNode->interval; pInfo->current = pInfo->win.skey; + pInfo->prevTsSet = false; + pInfo->prevTs = 0; + pInfo->groupId = 0; + pInfo->pPrevGroupKey = NULL; + pInfo->pNextGroupRes = NULL; if (downstream->operatorType == QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN) { STableScanInfo* pScanInfo = (STableScanInfo*)downstream->info; @@ -659,6 +891,10 @@ void destroyTimeSliceOperatorInfo(void* param) { taosMemoryFree(pKey->end.val); } taosArrayDestroy(pInfo->pLinearInfo); + + taosMemoryFree(pInfo->pPrevGroupKey->pData); + taosMemoryFree(pInfo->pPrevGroupKey); + cleanupExprSupp(&pInfo->scalarSup); for (int32_t i = 0; i < pInfo->pFillColInfo->numOfFillExpr; ++i) { diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 7afda3f597..a9400e24ce 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1114,7 +1114,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI bool masterScan = true; int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - int16_t bytes = pStateColInfoData->info.bytes; + int32_t bytes = pStateColInfoData->info.bytes; SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); TSKEY* tsList = (TSKEY*)pColInfoData->pData; diff --git a/source/libs/function/inc/tpercentile.h b/source/libs/function/inc/tpercentile.h index 80159460f5..65b7b38a05 100644 --- a/source/libs/function/inc/tpercentile.h +++ b/source/libs/function/inc/tpercentile.h @@ -53,7 +53,7 @@ typedef int32_t (*__perc_hash_func_t)(struct tMemBucket *pBucket, const void *va typedef struct tMemBucket { int16_t numOfSlots; int16_t type; - int16_t bytes; + int32_t bytes; int32_t total; int32_t elemPerPage; // number of elements for each object int32_t maxCapacity; // maximum allowed number of elements that can be sort directly to get the result @@ -67,7 +67,7 @@ typedef struct tMemBucket { SHashObj *groupPagesMap; // disk page map for different groups; } tMemBucket; -tMemBucket *tMemBucketCreate(int16_t nElemSize, int16_t dataType, double minval, double maxval); +tMemBucket *tMemBucketCreate(int32_t nElemSize, int16_t dataType, double minval, double maxval); void tMemBucketDestroy(tMemBucket *pBucket); diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index ead53aade6..2b917389f9 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -196,11 +196,11 @@ typedef struct SMavgInfo { } SMavgInfo; typedef struct SSampleInfo { - int32_t samples; - int32_t totalPoints; - int32_t numSampled; - uint8_t colType; - int16_t colBytes; + int32_t samples; + int32_t totalPoints; + int32_t numSampled; + uint8_t colType; + uint16_t colBytes; STuplePos nullTuplePos; bool nullTupleSaved; @@ -220,7 +220,7 @@ typedef struct STailInfo { int32_t numAdded; int32_t offset; uint8_t colType; - int16_t colBytes; + uint16_t colBytes; STailItem** pItems; } STailInfo; @@ -233,7 +233,7 @@ typedef struct SUniqueItem { typedef struct SUniqueInfo { int32_t numOfPoints; uint8_t colType; - int16_t colBytes; + uint16_t colBytes; bool hasNull; // null is not hashable, handle separately SHashObj* pHash; char pItems[]; @@ -247,13 +247,13 @@ typedef struct SModeItem { typedef struct SModeInfo { uint8_t colType; - int16_t colBytes; + uint16_t colBytes; SHashObj* pHash; STuplePos nullTuplePos; bool nullTupleSaved; - char* buf; // serialize data buffer + char* buf; // serialize data buffer } SModeInfo; typedef struct SDerivInfo { diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 2edfb33e81..3ec802a7ce 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -236,7 +236,7 @@ static void resetSlotInfo(tMemBucket *pBucket) { } } -tMemBucket *tMemBucketCreate(int16_t nElemSize, int16_t dataType, double minval, double maxval) { +tMemBucket *tMemBucketCreate(int32_t nElemSize, int16_t dataType, double minval, double maxval) { tMemBucket *pBucket = (tMemBucket *)taosMemoryCalloc(1, sizeof(tMemBucket)); if (pBucket == NULL) { return NULL; diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index d9a4c5178f..0f4e7bde63 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -455,6 +455,7 @@ static int32_t logicMergeCopy(const SMergeLogicNode* pSrc, SMergeLogicNode* pDst COPY_SCALAR_FIELD(numOfChannels); COPY_SCALAR_FIELD(srcGroupId); COPY_SCALAR_FIELD(groupSort); + COPY_SCALAR_FIELD(ignoreGroupId); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 0aeb83ce08..9d2f27b9eb 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -257,6 +257,14 @@ const char* nodesNodeName(ENodeType type) { return "DeleteStmt"; case QUERY_NODE_INSERT_STMT: return "InsertStmt"; + case QUERY_NODE_RESTORE_DNODE_STMT: + return "RestoreDnodeStmt"; + case QUERY_NODE_RESTORE_QNODE_STMT: + return "RestoreQnodeStmt"; + case QUERY_NODE_RESTORE_MNODE_STMT: + return "RestoreMnodeStmt"; + case QUERY_NODE_RESTORE_VNODE_STMT: + return "RestoreVnodeStmt"; case QUERY_NODE_LOGIC_PLAN_SCAN: return "LogicScan"; case QUERY_NODE_LOGIC_PLAN_JOIN: @@ -2027,6 +2035,7 @@ static const char* jkMergePhysiPlanTargets = "Targets"; static const char* jkMergePhysiPlanNumOfChannels = "NumOfChannels"; static const char* jkMergePhysiPlanSrcGroupId = "SrcGroupId"; static const char* jkMergePhysiPlanGroupSort = "GroupSort"; +static const char* jkMergePhysiPlanIgnoreGroupID = "IgnoreGroupID"; static int32_t physiMergeNodeToJson(const void* pObj, SJson* pJson) { const SMergePhysiNode* pNode = (const SMergePhysiNode*)pObj; @@ -2047,6 +2056,9 @@ static int32_t physiMergeNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkMergePhysiPlanGroupSort, pNode->groupSort); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkMergePhysiPlanIgnoreGroupID, pNode->ignoreGroupId); + } return code; } @@ -2070,6 +2082,9 @@ static int32_t jsonToPhysiMergeNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBoolValue(pJson, jkMergePhysiPlanGroupSort, &pNode->groupSort); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkMergePhysiPlanIgnoreGroupID, &pNode->ignoreGroupId); + } return code; } @@ -5526,6 +5541,35 @@ static int32_t jsonToDropDnodeStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkRestoreComponentNodeStmtDnodeId = "DnodeId"; + +static int32_t restoreComponentNodeStmtToJson(const void* pObj, SJson* pJson) { + const SRestoreComponentNodeStmt* pNode = (const SRestoreComponentNodeStmt*)pObj; + return tjsonAddIntegerToObject(pJson, jkRestoreComponentNodeStmtDnodeId, pNode->dnodeId); +} + +static int32_t jsonToRestoreComponentNodeStmt(const SJson* pJson, void* pObj) { + SRestoreComponentNodeStmt* pNode = (SRestoreComponentNodeStmt*)pObj; + return tjsonGetIntValue(pJson, jkRestoreComponentNodeStmtDnodeId, &pNode->dnodeId); +} + +static int32_t jsonToRestoreDnodeStmt(const SJson* pJson, void* pObj) { + return jsonToRestoreComponentNodeStmt(pJson, pObj); +} +static int32_t jsonToRestoreQnodeStmt(const SJson* pJson, void* pObj) { + return jsonToRestoreComponentNodeStmt(pJson, pObj); +} +static int32_t jsonToRestoreMnodeStmt(const SJson* pJson, void* pObj) { + return jsonToRestoreComponentNodeStmt(pJson, pObj); +} +static int32_t jsonToRestoreVnodeStmt(const SJson* pJson, void* pObj) { + return jsonToRestoreComponentNodeStmt(pJson, pObj); +} + + + + + static const char* jkCreateTopicStmtTopicName = "TopicName"; static const char* jkCreateTopicStmtSubscribeDbName = "SubscribeDbName"; static const char* jkCreateTopicStmtIgnoreExists = "IgnoreExists"; @@ -6813,6 +6857,14 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToDeleteStmt(pJson, pObj); case QUERY_NODE_INSERT_STMT: return jsonToInsertStmt(pJson, pObj); + case QUERY_NODE_RESTORE_DNODE_STMT: + return jsonToRestoreDnodeStmt(pJson, pObj); + case QUERY_NODE_RESTORE_QNODE_STMT: + return jsonToRestoreQnodeStmt(pJson, pObj); + case QUERY_NODE_RESTORE_MNODE_STMT: + return jsonToRestoreMnodeStmt(pJson, pObj); + case QUERY_NODE_RESTORE_VNODE_STMT: + return jsonToRestoreVnodeStmt(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_SCAN: return jsonToLogicScanNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_JOIN: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index 6c6b6c0e81..c06eb62771 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -2512,7 +2512,8 @@ enum { PHY_MERGE_CODE_TARGETS, PHY_MERGE_CODE_NUM_OF_CHANNELS, PHY_MERGE_CODE_SRC_GROUP_ID, - PHY_MERGE_CODE_GROUP_SORT + PHY_MERGE_CODE_GROUP_SORT, + PHY_MERGE_CODE_IGNORE_GROUP_ID, }; static int32_t physiMergeNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { @@ -2534,6 +2535,9 @@ static int32_t physiMergeNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeBool(pEncoder, PHY_MERGE_CODE_GROUP_SORT, pNode->groupSort); } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeBool(pEncoder, PHY_MERGE_CODE_IGNORE_GROUP_ID, pNode->ignoreGroupId); + } return code; } @@ -2563,6 +2567,9 @@ static int32_t msgToPhysiMergeNode(STlvDecoder* pDecoder, void* pObj) { case PHY_MERGE_CODE_GROUP_SORT: code = tlvDecodeBool(pTlv, &pNode->groupSort); break; + case PHY_MERGE_CODE_IGNORE_GROUP_ID: + code = tlvDecodeBool(pTlv, &pNode->ignoreGroupId); + break; default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 3f571e22ae..5874093ea6 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -455,6 +455,11 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SInsertStmt)); case QUERY_NODE_QUERY: return makeNode(type, sizeof(SQuery)); + case QUERY_NODE_RESTORE_DNODE_STMT: + case QUERY_NODE_RESTORE_QNODE_STMT: + case QUERY_NODE_RESTORE_MNODE_STMT: + case QUERY_NODE_RESTORE_VNODE_STMT: + return makeNode(type, sizeof(SRestoreComponentNodeStmt)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); case QUERY_NODE_LOGIC_PLAN_JOIN: @@ -1046,6 +1051,11 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pQuery->pPrepareRoot); break; } + case QUERY_NODE_RESTORE_DNODE_STMT: // no pointer field + case QUERY_NODE_RESTORE_QNODE_STMT: // no pointer field + case QUERY_NODE_RESTORE_MNODE_STMT: // no pointer field + case QUERY_NODE_RESTORE_VNODE_STMT: // no pointer field + break; case QUERY_NODE_LOGIC_PLAN_SCAN: { SScanLogicNode* pLogicNode = (SScanLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index e08b77e681..698aa4fa6d 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -202,6 +202,7 @@ SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInt SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName); SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId); SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId); +SNode* createRestoreComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId); SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pQuery); SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SToken* pSubDbName, bool withMeta); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y old mode 100644 new mode 100755 index d7a6baaffe..d418415644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -123,7 +123,7 @@ priv_level(A) ::= topic_name(B). with_opt(A) ::= . { A = NULL; } with_opt(A) ::= WITH search_condition(B). { A = B; } -/************************************************ create/drop/alter dnode *********************************************/ +/************************************************ create/drop/alter/restore dnode *********************************************/ cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); } cmd ::= CREATE DNODE dnode_endpoint(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); } cmd ::= DROP DNODE NK_INTEGER(A) force_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, B); } @@ -132,6 +132,7 @@ cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B). cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B) NK_STRING(C). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, &C); } cmd ::= ALTER ALL DNODES NK_STRING(A). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, NULL); } cmd ::= ALTER ALL DNODES NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, &B); } +cmd ::= RESTORE DNODE NK_INTEGER(A). { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &A); } %type dnode_endpoint { SToken } %destructor dnode_endpoint { } @@ -148,9 +149,10 @@ force_opt(A) ::= FORCE. cmd ::= ALTER LOCAL NK_STRING(A). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, NULL); } cmd ::= ALTER LOCAL NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, &B); } -/************************************************ create/drop qnode ***************************************************/ +/************************************************ create/drop/restore qnode ***************************************************/ cmd ::= CREATE QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &A); } cmd ::= DROP QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &A); } +cmd ::= RESTORE QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &A); } /************************************************ create/drop bnode ***************************************************/ cmd ::= CREATE BNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &A); } @@ -160,9 +162,13 @@ cmd ::= DROP BNODE ON DNODE NK_INTEGER(A). cmd ::= CREATE SNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &A); } cmd ::= DROP SNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &A); } -/************************************************ create/drop mnode ***************************************************/ +/************************************************ create/drop/restore mnode ***************************************************/ cmd ::= CREATE MNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &A); } cmd ::= DROP MNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &A); } +cmd ::= RESTORE MNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &A); } + +/************************************************ restore vnode ***************************************************/ +cmd ::= RESTORE VNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &A); } /************************************************ create/drop/use database ********************************************/ cmd ::= CREATE DATABASE not_exists_opt(A) db_name(B) db_options(C). { pCxt->pRootNode = createCreateDatabaseStmt(pCxt, A, &B, C); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 2afe34c1f7..a0c17add27 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1208,7 +1208,7 @@ SDataType createDataType(uint8_t type) { } SDataType createVarLenDataType(uint8_t type, const SToken* pLen) { - SDataType dt = {.type = type, .precision = 0, .scale = 0, .bytes = taosStr2Int16(pLen->z, NULL, 10)}; + SDataType dt = {.type = type, .precision = 0, .scale = 0, .bytes = taosStr2Int32(pLen->z, NULL, 10)}; return dt; } @@ -1658,6 +1658,14 @@ SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, cons return (SNode*)pStmt; } +SNode* createRestoreComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId) { + CHECK_PARSER_STATUS(pCxt); + SRestoreComponentNodeStmt* pStmt = (SRestoreComponentNodeStmt*)nodesMakeNode(type); + CHECK_OUT_OF_MEM(pStmt); + pStmt->dnodeId = taosStr2Int32(pDnodeId->z, NULL, 10); + return (SNode*)pStmt; +} + SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pQuery) { CHECK_PARSER_STATUS(pCxt); if (!checkTopicName(pCxt, pTopicName)) { diff --git a/source/libs/parser/src/parInsertSml.c b/source/libs/parser/src/parInsertSml.c index 1c921b2d7c..dbf5931e8a 100644 --- a/source/libs/parser/src/parInsertSml.c +++ b/source/libs/parser/src/parInsertSml.c @@ -250,7 +250,7 @@ end: int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSchema, SArray* cols, STableMeta* pTableMeta, char* tableName, const char* sTableName, int32_t sTableNameLen, int32_t ttl, - char* msgBuf, int16_t msgBufLen) { + char* msgBuf, int32_t msgBufLen) { SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; SSchema* pTagsSchema = getTableTagSchema(pTableMeta); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 312584994f..57f77d42ad 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -181,6 +181,7 @@ static SKeyword keywordTable[] = { {"REPLACE", TK_REPLACE}, {"REPLICA", TK_REPLICA}, {"RESET", TK_RESET}, + {"RESTORE", TK_RESTORE}, {"RETENTIONS", TK_RETENTIONS}, {"REVOKE", TK_REVOKE}, {"ROLLUP", TK_ROLLUP}, @@ -252,6 +253,7 @@ static SKeyword keywordTable[] = { {"VERBOSE", TK_VERBOSE}, {"VGROUP", TK_VGROUP}, {"VGROUPS", TK_VGROUPS}, + {"VNODE", TK_VNODE}, {"VNODES", TK_VNODES}, {"WAL_FSYNC_PERIOD", TK_WAL_FSYNC_PERIOD}, {"WAL_LEVEL", TK_WAL_LEVEL}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 25e92a55ec..48fc8c6a9c 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1518,9 +1518,7 @@ static int32_t translateInterpFunc(STranslateContext* pCxt, SFunctionNode* pFunc SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; SNode* pTable = pSelect->pFromTable; - if ((NULL != pTable && (QUERY_NODE_REAL_TABLE != nodeType(pTable) || - (TSDB_CHILD_TABLE != ((SRealTableNode*)pTable)->pMeta->tableType && - TSDB_NORMAL_TABLE != ((SRealTableNode*)pTable)->pMeta->tableType)))) { + if ((NULL != pTable && QUERY_NODE_REAL_TABLE != nodeType(pTable))) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE, "%s is only supported in single table query", pFunc->functionName); } @@ -2289,6 +2287,25 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) return TSDB_CODE_SUCCESS; } +static int32_t checkHavingGroupBy(STranslateContext* pCxt, SSelectStmt* pSelect) { + int32_t code = TSDB_CODE_SUCCESS; + if (NULL == getGroupByList(pCxt) && NULL == pSelect->pPartitionByList && NULL == pSelect->pWindow) { + return code; + } + if (NULL != pSelect->pHaving) { + code = checkExprForGroupBy(pCxt, &pSelect->pHaving); + } +/* + if (TSDB_CODE_SUCCESS == code && NULL != pSelect->pProjectionList) { + code = checkExprListForGroupBy(pCxt, pSelect, pSelect->pProjectionList); + } + if (TSDB_CODE_SUCCESS == code && NULL != pSelect->pOrderByList) { + code = checkExprListForGroupBy(pCxt, pSelect, pSelect->pOrderByList); + } +*/ + return code; +} + static int32_t checkWindowFuncCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; @@ -3024,7 +3041,7 @@ static int32_t translateSelectList(STranslateContext* pCxt, SSelectStmt* pSelect } if (TSDB_CODE_SUCCESS == code) { code = checkExprListForGroupBy(pCxt, pSelect, pSelect->pProjectionList); - } + } if (TSDB_CODE_SUCCESS == code) { code = translateFillValues(pCxt, pSelect); } @@ -3041,9 +3058,6 @@ static int32_t translateHaving(STranslateContext* pCxt, SSelectStmt* pSelect) { } pCxt->currClause = SQL_CLAUSE_HAVING; int32_t code = translateExpr(pCxt, &pSelect->pHaving); - if (TSDB_CODE_SUCCESS == code && (NULL != pSelect->pGroupByList || NULL != pSelect->pWindow)) { - code = checkExprForGroupBy(pCxt, &pSelect->pHaving); - } return code; } @@ -3626,6 +3640,9 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { code = translateSelectList(pCxt, pSelect); } + if (TSDB_CODE_SUCCESS == code) { + code = checkHavingGroupBy(pCxt, pSelect); + } if (TSDB_CODE_SUCCESS == code) { code = translateOrderBy(pCxt, pSelect); } @@ -4498,8 +4515,8 @@ static int32_t checkTableTagsSchema(STranslateContext* pCxt, SHashObj* pHash, SN code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_ONE_JSON_TAG); } if (TSDB_CODE_SUCCESS == code) { - if ((TSDB_DATA_TYPE_VARCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_BINARY_LEN) || - (TSDB_DATA_TYPE_NCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_NCHAR_LEN)) { + if ((TSDB_DATA_TYPE_VARCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN) || + (TSDB_DATA_TYPE_NCHAR == pTag->dataType.type && calcTypeBytes(pTag->dataType) > TSDB_MAX_TAGS_LEN)) { code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN); } } @@ -5245,7 +5262,7 @@ static int32_t checkAlterSuperTableBySchema(STranslateContext* pCxt, SAlterTable } if (TSDB_ALTER_TABLE_UPDATE_TAG_BYTES == pStmt->alterType) { - if (calcTypeBytes(pStmt->dataType) > TSDB_MAX_FIELD_LEN) { + if (calcTypeBytes(pStmt->dataType) > TSDB_MAX_TAGS_LEN) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN); } @@ -5412,6 +5429,29 @@ static int32_t translateAlterDnode(STranslateContext* pCxt, SAlterDnodeStmt* pSt return buildCmdMsg(pCxt, TDMT_MND_CONFIG_DNODE, (FSerializeFunc)tSerializeSMCfgDnodeReq, &cfgReq); } +static int32_t translateRestoreDnode(STranslateContext* pCxt, SRestoreComponentNodeStmt* pStmt) { + SRestoreDnodeReq restoreReq = {0}; + restoreReq.dnodeId = pStmt->dnodeId; + switch (nodeType((SNode*)pStmt)) { + case QUERY_NODE_RESTORE_DNODE_STMT: + restoreReq.restoreType = RESTORE_TYPE__ALL; + break; + case QUERY_NODE_RESTORE_QNODE_STMT: + restoreReq.restoreType = RESTORE_TYPE__QNODE; + break; + case QUERY_NODE_RESTORE_MNODE_STMT: + restoreReq.restoreType = RESTORE_TYPE__MNODE; + break; + case QUERY_NODE_RESTORE_VNODE_STMT: + restoreReq.restoreType = RESTORE_TYPE__VNODE; + break; + default: + return -1; + } + return buildCmdMsg(pCxt, TDMT_MND_RESTORE_DNODE, (FSerializeFunc)tSerializeSRestoreDnodeReq, &restoreReq); +} + + static int32_t getSmaIndexDstVgId(STranslateContext* pCxt, const char* pDbName, const char* pTableName, int32_t* pVgId) { SVgroupInfo vg = {0}; @@ -6897,6 +6937,12 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_SHOW_CREATE_STABLE_STMT: code = translateShowCreateTable(pCxt, (SShowCreateTableStmt*)pNode); break; + case QUERY_NODE_RESTORE_DNODE_STMT: + case QUERY_NODE_RESTORE_QNODE_STMT: + case QUERY_NODE_RESTORE_MNODE_STMT: + case QUERY_NODE_RESTORE_VNODE_STMT: + code = translateRestoreDnode(pCxt, (SRestoreComponentNodeStmt*)pNode); + break; default: break; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a38e2368dd..592bad5dc2 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,27 +104,27 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 476 +#define YYNOCODE 478 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EFillMode yy46; - SAlterOption yy53; - SToken yy113; - EOperatorType yy156; - bool yy369; - SNodeList* yy432; - SNode* yy448; - int8_t yy551; - ENullOrder yy585; - EJoinType yy596; - EOrder yy666; - SDataType yy728; - STokenPair yy777; - int32_t yy788; - int64_t yy837; + SNode* yy184; + int8_t yy231; + SAlterOption yy361; + EFillMode yy362; + SDataType yy388; + STokenPair yy409; + EJoinType yy416; + EOperatorType yy424; + int32_t yy480; + SNodeList* yy532; + int64_t yy541; + ENullOrder yy617; + SToken yy649; + EOrder yy706; + bool yy829; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -140,17 +140,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 762 -#define YYNRULE 583 -#define YYNTOKEN 330 -#define YY_MAX_SHIFT 761 -#define YY_MIN_SHIFTREDUCE 1136 -#define YY_MAX_SHIFTREDUCE 1718 -#define YY_ERROR_ACTION 1719 -#define YY_ACCEPT_ACTION 1720 -#define YY_NO_ACTION 1721 -#define YY_MIN_REDUCE 1722 -#define YY_MAX_REDUCE 2304 +#define YYNSTATE 777 +#define YYNRULE 587 +#define YYNRULE_WITH_ACTION 587 +#define YYNTOKEN 332 +#define YY_MAX_SHIFT 776 +#define YY_MIN_SHIFTREDUCE 1151 +#define YY_MAX_SHIFTREDUCE 1737 +#define YY_ERROR_ACTION 1738 +#define YY_ACCEPT_ACTION 1739 +#define YY_NO_ACTION 1740 +#define YY_MIN_REDUCE 1741 +#define YY_MAX_REDUCE 2327 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -217,814 +218,881 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3030) +#define YY_ACTTAB_COUNT (3182) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2116, 209, 2010, 1881, 432, 502, 1883, 1765, 431, 2102, - /* 10 */ 670, 2010, 48, 46, 1646, 1722, 2098, 2008, 640, 2098, - /* 20 */ 393, 1522, 1495, 384, 41, 40, 2007, 640, 47, 45, - /* 30 */ 44, 43, 42, 1576, 1791, 1493, 2134, 180, 1520, 132, - /* 40 */ 131, 130, 129, 128, 127, 126, 125, 124, 2084, 1931, - /* 50 */ 669, 591, 2094, 2100, 2275, 2094, 2100, 388, 398, 1571, - /* 60 */ 30, 1937, 1939, 663, 499, 19, 663, 500, 1758, 2281, - /* 70 */ 184, 168, 1501, 1734, 2276, 617, 1520, 628, 140, 1869, - /* 80 */ 507, 2115, 107, 500, 1758, 2151, 38, 296, 169, 2117, - /* 90 */ 673, 2119, 2120, 668, 655, 663, 2176, 758, 141, 9, - /* 100 */ 15, 735, 734, 733, 732, 403, 1884, 731, 730, 144, - /* 110 */ 725, 724, 723, 722, 721, 720, 719, 157, 715, 714, - /* 120 */ 713, 402, 401, 710, 709, 708, 707, 706, 592, 2241, - /* 130 */ 62, 2219, 1320, 1938, 1939, 123, 1578, 1579, 122, 121, - /* 140 */ 120, 119, 118, 117, 116, 115, 114, 1311, 695, 694, - /* 150 */ 693, 1315, 692, 1317, 1318, 691, 688, 2216, 1326, 685, - /* 160 */ 1328, 1329, 682, 679, 504, 652, 1551, 1561, 2280, 277, - /* 170 */ 501, 2275, 1577, 1580, 1944, 653, 1892, 630, 182, 2212, - /* 180 */ 2213, 356, 138, 2217, 1409, 1410, 1496, 2279, 1494, 1942, - /* 190 */ 1720, 2276, 2278, 133, 287, 288, 1989, 41, 40, 286, - /* 200 */ 537, 47, 45, 44, 43, 42, 278, 52, 703, 155, - /* 210 */ 154, 700, 699, 698, 152, 1499, 1500, 1794, 1550, 1553, - /* 220 */ 1554, 1555, 1556, 1557, 1558, 1559, 1560, 665, 661, 1569, - /* 230 */ 1570, 1572, 1573, 1574, 1575, 2, 48, 46, 425, 1169, - /* 240 */ 192, 341, 62, 1518, 393, 51, 1495, 62, 87, 93, - /* 250 */ 469, 2116, 616, 483, 350, 2275, 482, 1576, 177, 1493, - /* 260 */ 406, 670, 427, 423, 405, 47, 45, 44, 43, 42, - /* 270 */ 615, 184, 452, 1888, 484, 2276, 617, 454, 1171, 1994, - /* 280 */ 1174, 1175, 187, 1571, 555, 554, 553, 2134, 1723, 19, - /* 290 */ 106, 545, 137, 549, 551, 550, 1501, 548, 1605, 2084, - /* 300 */ 103, 669, 547, 552, 366, 365, 1521, 591, 546, 123, - /* 310 */ 2275, 1639, 122, 121, 120, 119, 118, 117, 116, 115, - /* 320 */ 114, 758, 359, 101, 15, 2281, 184, 430, 2280, 429, - /* 330 */ 2276, 617, 2115, 1191, 442, 1190, 2151, 653, 1892, 110, - /* 340 */ 2117, 673, 2119, 2120, 668, 1522, 663, 1885, 226, 143, - /* 350 */ 438, 150, 2175, 2204, 1606, 133, 428, 387, 2200, 187, - /* 360 */ 1578, 1579, 542, 480, 652, 1192, 474, 473, 472, 471, - /* 370 */ 468, 467, 466, 465, 464, 460, 459, 458, 457, 340, - /* 380 */ 449, 448, 447, 177, 444, 443, 357, 653, 1892, 638, - /* 390 */ 1551, 1561, 2280, 338, 187, 2275, 1577, 1580, 165, 187, - /* 400 */ 555, 554, 553, 358, 1993, 189, 1895, 545, 137, 549, - /* 410 */ 1496, 2279, 1494, 548, 606, 2276, 2277, 2070, 547, 552, - /* 420 */ 366, 365, 1354, 1355, 546, 2279, 1708, 1264, 37, 391, - /* 430 */ 1600, 1601, 1602, 1603, 1604, 1608, 1609, 1610, 1611, 1499, - /* 440 */ 1500, 1974, 1550, 1553, 1554, 1555, 1556, 1557, 1558, 1559, - /* 450 */ 1560, 665, 661, 1569, 1570, 1572, 1573, 1574, 1575, 2, - /* 460 */ 12, 48, 46, 227, 1266, 1495, 413, 1521, 610, 393, - /* 470 */ 2116, 1495, 652, 196, 167, 1674, 516, 1520, 1493, 172, - /* 480 */ 631, 1833, 1576, 476, 1493, 533, 529, 525, 521, 224, - /* 490 */ 253, 41, 40, 277, 2134, 47, 45, 44, 43, 42, - /* 500 */ 612, 607, 600, 1523, 611, 66, 2134, 2103, 1571, 12, - /* 510 */ 1191, 10, 1190, 84, 19, 1501, 83, 2098, 2084, 639, - /* 520 */ 669, 1501, 603, 602, 1672, 1673, 1675, 1676, 1677, 88, - /* 530 */ 41, 40, 222, 91, 47, 45, 44, 43, 42, 1868, - /* 540 */ 758, 211, 1192, 200, 199, 502, 758, 1765, 609, 15, - /* 550 */ 1650, 2115, 51, 2094, 2100, 2151, 1520, 62, 110, 2117, - /* 560 */ 673, 2119, 2120, 668, 663, 663, 475, 2051, 166, 514, - /* 570 */ 181, 2003, 2204, 316, 41, 40, 387, 2200, 47, 45, - /* 580 */ 44, 43, 42, 1426, 1427, 1578, 1579, 314, 73, 186, - /* 590 */ 657, 72, 2176, 718, 560, 1854, 456, 2230, 1745, 221, - /* 600 */ 215, 62, 705, 705, 220, 455, 512, 14, 13, 570, - /* 610 */ 207, 495, 493, 490, 244, 1551, 1561, 396, 385, 1425, - /* 620 */ 1428, 1577, 1580, 240, 213, 162, 165, 653, 1892, 1496, - /* 630 */ 1177, 1494, 372, 1894, 1894, 1496, 1519, 1494, 616, 563, - /* 640 */ 1942, 2275, 653, 1892, 557, 57, 2084, 1519, 1944, 239, - /* 650 */ 62, 255, 44, 43, 42, 371, 615, 184, 1499, 1500, - /* 660 */ 436, 2276, 617, 1942, 1499, 1500, 1523, 1550, 1553, 1554, - /* 670 */ 1555, 1556, 1557, 1558, 1559, 1560, 665, 661, 1569, 1570, - /* 680 */ 1572, 1573, 1574, 1575, 2, 48, 46, 1581, 109, 70, - /* 690 */ 1944, 2116, 69, 393, 619, 1495, 1744, 381, 653, 1892, - /* 700 */ 1715, 631, 1552, 1221, 187, 1942, 1576, 1619, 1493, 187, - /* 710 */ 2219, 34, 729, 727, 628, 140, 437, 41, 40, 653, - /* 720 */ 1892, 47, 45, 44, 43, 42, 578, 2134, 81, 80, - /* 730 */ 435, 541, 1571, 191, 164, 540, 2215, 446, 639, 2084, - /* 740 */ 1222, 669, 41, 40, 2084, 1501, 47, 45, 44, 43, - /* 750 */ 42, 653, 1892, 187, 339, 142, 697, 421, 2175, 1935, - /* 760 */ 419, 415, 411, 408, 428, 12, 243, 653, 1892, 461, - /* 770 */ 758, 1501, 2115, 49, 653, 1892, 2151, 2116, 639, 110, - /* 780 */ 2117, 673, 2119, 2120, 668, 462, 663, 670, 637, 1767, - /* 790 */ 2003, 181, 515, 2204, 36, 396, 87, 387, 2200, 1714, - /* 800 */ 41, 40, 187, 165, 47, 45, 44, 43, 42, 1578, - /* 810 */ 1579, 1894, 360, 2134, 193, 275, 2212, 627, 2231, 134, - /* 820 */ 626, 1887, 2275, 628, 140, 2084, 696, 669, 648, 1944, - /* 830 */ 2003, 653, 1892, 1468, 1469, 1685, 386, 615, 184, 1551, - /* 840 */ 1561, 1989, 2276, 617, 1942, 1577, 1580, 41, 40, 1889, - /* 850 */ 717, 47, 45, 44, 43, 42, 1867, 590, 2115, 1496, - /* 860 */ 1275, 1494, 2151, 653, 1892, 110, 2117, 673, 2119, 2120, - /* 870 */ 668, 1944, 663, 1274, 242, 1944, 1989, 2295, 241, 2204, - /* 880 */ 363, 245, 397, 387, 2200, 194, 1943, 634, 1499, 1500, - /* 890 */ 1942, 1550, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, - /* 900 */ 665, 661, 1569, 1570, 1572, 1573, 1574, 1575, 2, 48, - /* 910 */ 46, 2116, 1743, 1174, 1175, 653, 1892, 393, 1742, 1495, - /* 920 */ 198, 670, 1877, 2238, 183, 2212, 2213, 2067, 138, 2217, - /* 930 */ 1576, 2116, 1493, 587, 591, 485, 1523, 2275, 90, 345, - /* 940 */ 1662, 667, 370, 1643, 571, 1741, 364, 2134, 362, 361, - /* 950 */ 1740, 539, 2281, 184, 1879, 569, 1571, 2276, 617, 2084, - /* 960 */ 2084, 669, 653, 1892, 653, 1892, 2084, 2134, 567, 1501, - /* 970 */ 565, 701, 541, 1875, 1935, 702, 540, 55, 1935, 2084, - /* 980 */ 632, 669, 636, 2219, 1896, 703, 155, 154, 700, 699, - /* 990 */ 698, 152, 2115, 2084, 758, 2077, 2151, 49, 2084, 110, - /* 1000 */ 2117, 673, 2119, 2120, 668, 2116, 663, 2078, 54, 2214, - /* 1010 */ 3, 2295, 2115, 2204, 1520, 670, 2151, 387, 2200, 332, - /* 1020 */ 2117, 673, 2119, 2120, 668, 666, 663, 654, 2169, 653, - /* 1030 */ 1892, 41, 40, 1578, 1579, 47, 45, 44, 43, 42, - /* 1040 */ 399, 2134, 591, 1739, 249, 2275, 1586, 291, 165, 653, - /* 1050 */ 1892, 153, 1520, 2084, 591, 669, 1894, 2275, 653, 1892, - /* 1060 */ 2281, 184, 1279, 1551, 1561, 2276, 617, 650, 1607, 1577, - /* 1070 */ 1580, 232, 2281, 184, 230, 1278, 651, 2276, 617, 2224, - /* 1080 */ 1639, 653, 1892, 1496, 254, 1494, 2115, 1738, 653, 1892, - /* 1090 */ 2151, 2084, 439, 170, 2117, 673, 2119, 2120, 668, 297, - /* 1100 */ 663, 576, 1737, 628, 140, 440, 400, 1736, 56, 146, - /* 1110 */ 1733, 135, 1499, 1500, 1732, 1550, 1553, 1554, 1555, 1556, - /* 1120 */ 1557, 1558, 1559, 1560, 665, 661, 1569, 1570, 1572, 1573, - /* 1130 */ 1574, 1575, 2, 48, 46, 2084, 420, 487, 1870, 1731, - /* 1140 */ 1730, 393, 35, 1495, 618, 2296, 1729, 2116, 591, 623, - /* 1150 */ 2084, 2275, 1612, 1728, 1576, 2084, 1493, 670, 2084, 2251, - /* 1160 */ 1552, 620, 2084, 1727, 1726, 1725, 2281, 184, 74, 543, - /* 1170 */ 310, 2276, 617, 1921, 2116, 234, 236, 1504, 233, 235, - /* 1180 */ 1571, 544, 148, 2134, 670, 1781, 598, 2084, 2084, 153, - /* 1190 */ 252, 1262, 1642, 1501, 2084, 2084, 238, 669, 1552, 237, - /* 1200 */ 573, 2084, 572, 1260, 185, 2212, 2213, 556, 138, 2217, - /* 1210 */ 2134, 2084, 2084, 2084, 153, 50, 50, 82, 758, 1774, - /* 1220 */ 259, 15, 2084, 1772, 669, 1717, 1718, 664, 2115, 1834, - /* 1230 */ 14, 13, 2151, 153, 2116, 110, 2117, 673, 2119, 2120, - /* 1240 */ 668, 558, 663, 1503, 670, 561, 1463, 2295, 50, 2204, - /* 1250 */ 2105, 284, 660, 387, 2200, 2115, 71, 1578, 1579, 2151, - /* 1260 */ 151, 153, 110, 2117, 673, 2119, 2120, 668, 2244, 663, - /* 1270 */ 2134, 1466, 1671, 1670, 2295, 64, 2204, 261, 50, 1735, - /* 1280 */ 387, 2200, 2084, 225, 669, 272, 604, 1551, 1561, 2135, - /* 1290 */ 635, 266, 404, 1577, 1580, 1998, 703, 155, 154, 700, - /* 1300 */ 699, 698, 152, 2107, 1759, 1423, 1932, 1496, 289, 1494, - /* 1310 */ 2234, 50, 711, 645, 677, 2115, 151, 293, 1305, 2151, - /* 1320 */ 1768, 153, 169, 2117, 673, 2119, 2120, 668, 1764, 663, - /* 1330 */ 1507, 629, 1613, 136, 1240, 1562, 1499, 1500, 151, 1550, - /* 1340 */ 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 665, 661, - /* 1350 */ 1569, 1570, 1572, 1573, 1574, 1575, 2, 274, 271, 390, - /* 1360 */ 389, 712, 1, 2242, 5, 407, 412, 2116, 309, 1509, - /* 1370 */ 753, 1332, 354, 1336, 1446, 304, 197, 670, 1343, 2269, - /* 1380 */ 1576, 624, 1502, 1238, 441, 1523, 1999, 445, 450, 478, - /* 1390 */ 1341, 621, 1518, 463, 1991, 156, 1506, 2116, 470, 477, - /* 1400 */ 479, 488, 1597, 2134, 489, 486, 1571, 670, 201, 2223, - /* 1410 */ 202, 491, 492, 1524, 497, 2084, 204, 669, 494, 1501, - /* 1420 */ 496, 4, 498, 505, 506, 1526, 508, 212, 1521, 509, - /* 1430 */ 214, 1525, 1527, 2134, 510, 513, 511, 217, 1194, 517, - /* 1440 */ 112, 534, 535, 219, 659, 2084, 85, 669, 2115, 86, - /* 1450 */ 223, 536, 2151, 538, 344, 110, 2117, 673, 2119, 2120, - /* 1460 */ 668, 575, 663, 2060, 89, 2116, 577, 2295, 305, 2204, - /* 1470 */ 1882, 229, 1878, 387, 2200, 670, 231, 158, 2115, 246, - /* 1480 */ 159, 1880, 2151, 1876, 160, 110, 2117, 673, 2119, 2120, - /* 1490 */ 668, 161, 663, 581, 2057, 580, 250, 2295, 1453, 2204, - /* 1500 */ 588, 2134, 605, 387, 2200, 2056, 585, 595, 643, 601, - /* 1510 */ 2250, 2235, 582, 2084, 2249, 669, 248, 149, 2245, 8, - /* 1520 */ 376, 257, 608, 614, 586, 260, 596, 594, 2226, 593, - /* 1530 */ 267, 265, 377, 1510, 625, 1505, 2298, 173, 622, 1639, - /* 1540 */ 268, 139, 1522, 633, 380, 279, 2115, 96, 1528, 2004, - /* 1550 */ 2151, 270, 646, 110, 2117, 673, 2119, 2120, 668, 306, - /* 1560 */ 663, 641, 1513, 1515, 2220, 2179, 647, 2204, 98, 642, - /* 1570 */ 307, 387, 2200, 2116, 2018, 661, 1569, 1570, 1572, 1573, - /* 1580 */ 1574, 1575, 1893, 670, 100, 61, 269, 2017, 2185, 102, - /* 1590 */ 2016, 383, 308, 2116, 675, 1936, 1855, 300, 311, 2274, - /* 1600 */ 754, 757, 273, 670, 755, 53, 335, 320, 346, 2134, - /* 1610 */ 347, 313, 315, 2076, 334, 324, 2075, 2074, 78, 2071, - /* 1620 */ 409, 2084, 410, 669, 1486, 1487, 190, 414, 2069, 2134, - /* 1630 */ 416, 417, 418, 2068, 355, 2066, 422, 2065, 2064, 426, - /* 1640 */ 424, 2084, 79, 669, 1449, 1448, 2030, 2029, 2028, 433, - /* 1650 */ 434, 2027, 2026, 1400, 2115, 1982, 1981, 1979, 2151, 1978, - /* 1660 */ 1977, 110, 2117, 673, 2119, 2120, 668, 145, 663, 1980, - /* 1670 */ 1976, 1975, 1973, 2177, 2115, 2204, 195, 2116, 2151, 387, - /* 1680 */ 2200, 110, 2117, 673, 2119, 2120, 668, 670, 663, 1972, - /* 1690 */ 1971, 1970, 453, 656, 1984, 2204, 451, 1969, 1968, 387, - /* 1700 */ 2200, 2116, 1967, 1966, 1965, 1964, 1963, 1962, 1961, 1960, - /* 1710 */ 1959, 670, 1958, 2134, 1957, 1956, 1955, 147, 1954, 1953, - /* 1720 */ 1952, 1983, 1951, 1950, 1949, 2084, 1948, 669, 1947, 1946, - /* 1730 */ 1945, 481, 342, 1402, 343, 1276, 1797, 2134, 203, 1280, - /* 1740 */ 1796, 205, 1795, 1793, 206, 1754, 2104, 179, 1176, 2084, - /* 1750 */ 218, 669, 1753, 2047, 2037, 2025, 2024, 2002, 2115, 1871, - /* 1760 */ 1272, 1214, 2151, 1792, 1790, 111, 2117, 673, 2119, 2120, - /* 1770 */ 668, 76, 663, 208, 503, 210, 77, 178, 2116, 2204, - /* 1780 */ 216, 518, 2115, 2203, 2200, 1788, 2151, 519, 670, 111, - /* 1790 */ 2117, 673, 2119, 2120, 668, 522, 663, 520, 523, 1786, - /* 1800 */ 524, 2116, 526, 2204, 528, 1784, 530, 658, 2200, 1771, - /* 1810 */ 1770, 670, 532, 1750, 2134, 527, 1873, 531, 1348, 1347, - /* 1820 */ 1872, 1263, 1261, 1259, 2116, 1258, 2084, 1257, 669, 1256, - /* 1830 */ 1255, 1252, 1782, 726, 670, 728, 1251, 2134, 1249, 1250, - /* 1840 */ 367, 1775, 1773, 368, 559, 369, 562, 2116, 63, 2084, - /* 1850 */ 1749, 669, 1748, 1747, 228, 568, 113, 670, 2046, 671, - /* 1860 */ 2134, 564, 566, 2151, 1473, 374, 111, 2117, 673, 2119, - /* 1870 */ 2120, 668, 2084, 663, 669, 1475, 1477, 29, 1472, 67, - /* 1880 */ 2204, 1459, 2115, 2134, 349, 2200, 2151, 1457, 375, 111, - /* 1890 */ 2117, 673, 2119, 2120, 668, 2084, 663, 669, 1455, 2036, - /* 1900 */ 583, 2023, 2021, 2204, 20, 2115, 2280, 31, 2201, 2151, - /* 1910 */ 2116, 599, 333, 2117, 673, 2119, 2120, 668, 251, 663, - /* 1920 */ 670, 17, 6, 1687, 256, 7, 589, 264, 2115, 597, - /* 1930 */ 58, 258, 2151, 163, 21, 333, 2117, 673, 2119, 2120, - /* 1940 */ 668, 22, 663, 2105, 584, 1669, 2134, 171, 373, 262, - /* 1950 */ 263, 32, 33, 65, 24, 1661, 92, 23, 2084, 1702, - /* 1960 */ 669, 1701, 1707, 1708, 378, 1706, 1705, 379, 276, 1636, - /* 1970 */ 1635, 60, 174, 2022, 2020, 2116, 2019, 2001, 95, 94, - /* 1980 */ 282, 25, 2000, 283, 285, 670, 1667, 290, 68, 99, - /* 1990 */ 644, 2115, 97, 295, 292, 2151, 2116, 13, 326, 2117, - /* 2000 */ 673, 2119, 2120, 668, 103, 663, 670, 26, 1511, 2116, - /* 2010 */ 1588, 2134, 1587, 1598, 175, 11, 2154, 188, 1566, 667, - /* 2020 */ 662, 1543, 39, 2084, 59, 669, 674, 676, 18, 1564, - /* 2030 */ 1338, 672, 2134, 395, 298, 1563, 16, 382, 27, 680, - /* 2040 */ 28, 613, 1535, 1333, 2084, 2134, 669, 678, 683, 1330, - /* 2050 */ 1327, 681, 684, 686, 689, 1321, 2115, 2084, 687, 669, - /* 2060 */ 2151, 1319, 690, 170, 2117, 673, 2119, 2120, 668, 104, - /* 2070 */ 663, 105, 1342, 1246, 704, 75, 1212, 2115, 1325, 1324, - /* 2080 */ 1245, 2151, 1244, 2116, 333, 2117, 673, 2119, 2120, 668, - /* 2090 */ 2115, 663, 1243, 670, 2151, 1242, 1241, 332, 2117, 673, - /* 2100 */ 2119, 2120, 668, 2116, 663, 1323, 2170, 1322, 1239, 1237, - /* 2110 */ 1236, 1235, 1270, 670, 299, 2297, 716, 1233, 1232, 2134, - /* 2120 */ 1231, 1230, 1229, 1228, 392, 1227, 1267, 1265, 1224, 1223, - /* 2130 */ 1220, 2084, 1219, 669, 1218, 1217, 1789, 736, 737, 2134, - /* 2140 */ 738, 1787, 740, 742, 394, 741, 1785, 745, 744, 746, - /* 2150 */ 1783, 2084, 748, 669, 749, 750, 1769, 752, 1166, 1746, - /* 2160 */ 302, 756, 1721, 759, 2115, 1497, 312, 760, 2151, 1721, - /* 2170 */ 1721, 333, 2117, 673, 2119, 2120, 668, 1721, 663, 1721, - /* 2180 */ 1721, 1721, 1721, 1721, 2115, 1721, 579, 1721, 2151, 1721, - /* 2190 */ 1721, 333, 2117, 673, 2119, 2120, 668, 1721, 663, 1721, - /* 2200 */ 2116, 1721, 1721, 1721, 761, 1721, 1721, 1721, 1721, 1721, - /* 2210 */ 670, 1721, 1721, 1721, 1721, 1721, 2116, 1721, 303, 1721, - /* 2220 */ 1721, 1721, 1721, 1721, 1721, 1721, 670, 1721, 1721, 1721, - /* 2230 */ 1721, 1721, 1721, 1721, 176, 1721, 2134, 1721, 1721, 1721, - /* 2240 */ 751, 747, 743, 739, 301, 1721, 2116, 1721, 2084, 1721, - /* 2250 */ 669, 1721, 2134, 1721, 1721, 1721, 670, 1721, 1721, 1721, - /* 2260 */ 1721, 1721, 1721, 1721, 2084, 1721, 669, 1721, 1721, 1721, - /* 2270 */ 1721, 1721, 1721, 1721, 1721, 1721, 2116, 1721, 1721, 1721, - /* 2280 */ 1721, 574, 2134, 1721, 108, 2151, 670, 294, 328, 2117, - /* 2290 */ 673, 2119, 2120, 668, 2084, 663, 669, 2115, 1721, 1721, - /* 2300 */ 1721, 2151, 1721, 1721, 317, 2117, 673, 2119, 2120, 668, - /* 2310 */ 1721, 663, 2134, 1721, 1721, 1721, 1721, 1721, 1721, 649, - /* 2320 */ 1721, 1721, 1721, 1721, 2084, 1721, 669, 2115, 1721, 1721, - /* 2330 */ 1721, 2151, 1721, 1721, 318, 2117, 673, 2119, 2120, 668, - /* 2340 */ 2116, 663, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2350 */ 670, 1721, 1721, 2116, 281, 1721, 1721, 2115, 1721, 280, - /* 2360 */ 1721, 2151, 1721, 670, 319, 2117, 673, 2119, 2120, 668, - /* 2370 */ 1721, 663, 1721, 1721, 1721, 1721, 2134, 1721, 1721, 247, - /* 2380 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 2084, 2134, - /* 2390 */ 669, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2400 */ 1721, 2084, 1721, 669, 2116, 1721, 1721, 1721, 1721, 1721, - /* 2410 */ 1721, 1721, 1721, 1721, 670, 1721, 1721, 2116, 1721, 1721, - /* 2420 */ 1721, 2115, 1721, 1721, 1721, 2151, 1721, 670, 325, 2117, - /* 2430 */ 673, 2119, 2120, 668, 2115, 663, 1721, 1721, 2151, 1721, - /* 2440 */ 2134, 329, 2117, 673, 2119, 2120, 668, 1721, 663, 1721, - /* 2450 */ 1721, 1721, 2084, 2134, 669, 1721, 1721, 1721, 1721, 1721, - /* 2460 */ 1721, 1721, 1721, 1721, 1721, 2084, 1721, 669, 1721, 1721, - /* 2470 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 2116, 1721, - /* 2480 */ 1721, 1721, 1721, 1721, 1721, 2115, 1721, 1721, 670, 2151, - /* 2490 */ 1721, 1721, 321, 2117, 673, 2119, 2120, 668, 2115, 663, - /* 2500 */ 1721, 1721, 2151, 1721, 1721, 330, 2117, 673, 2119, 2120, - /* 2510 */ 668, 1721, 663, 1721, 2134, 1721, 1721, 1721, 1721, 1721, - /* 2520 */ 1721, 1721, 1721, 1721, 1721, 1721, 2084, 1721, 669, 2116, - /* 2530 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 670, - /* 2540 */ 1721, 1721, 1721, 1721, 2116, 1721, 1721, 1721, 1721, 1721, - /* 2550 */ 1721, 1721, 1721, 1721, 670, 1721, 1721, 1721, 1721, 2115, - /* 2560 */ 1721, 1721, 1721, 2151, 1721, 2134, 322, 2117, 673, 2119, - /* 2570 */ 2120, 668, 1721, 663, 1721, 1721, 1721, 2084, 1721, 669, - /* 2580 */ 2134, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2590 */ 2116, 1721, 2084, 1721, 669, 1721, 1721, 1721, 1721, 1721, - /* 2600 */ 670, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2610 */ 2115, 1721, 1721, 1721, 2151, 1721, 1721, 331, 2117, 673, - /* 2620 */ 2119, 2120, 668, 1721, 663, 2115, 2134, 1721, 1721, 2151, - /* 2630 */ 1721, 1721, 323, 2117, 673, 2119, 2120, 668, 2084, 663, - /* 2640 */ 669, 2116, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2650 */ 1721, 670, 1721, 1721, 1721, 1721, 1721, 1721, 2116, 1721, - /* 2660 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 670, 1721, - /* 2670 */ 1721, 2115, 1721, 1721, 1721, 2151, 1721, 2134, 336, 2117, - /* 2680 */ 673, 2119, 2120, 668, 1721, 663, 1721, 2116, 1721, 2084, - /* 2690 */ 1721, 669, 1721, 1721, 2134, 1721, 1721, 670, 1721, 1721, - /* 2700 */ 1721, 1721, 1721, 1721, 1721, 1721, 2084, 1721, 669, 1721, - /* 2710 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2720 */ 1721, 1721, 2115, 2134, 1721, 1721, 2151, 1721, 1721, 337, - /* 2730 */ 2117, 673, 2119, 2120, 668, 2084, 663, 669, 1721, 2115, - /* 2740 */ 1721, 1721, 1721, 2151, 1721, 1721, 2128, 2117, 673, 2119, - /* 2750 */ 2120, 668, 1721, 663, 1721, 2116, 1721, 1721, 1721, 1721, - /* 2760 */ 1721, 1721, 1721, 1721, 1721, 670, 1721, 1721, 2115, 1721, - /* 2770 */ 1721, 1721, 2151, 1721, 2116, 2127, 2117, 673, 2119, 2120, - /* 2780 */ 668, 1721, 663, 1721, 670, 1721, 1721, 2116, 1721, 1721, - /* 2790 */ 1721, 2134, 1721, 1721, 1721, 1721, 1721, 670, 1721, 1721, - /* 2800 */ 1721, 1721, 1721, 2084, 1721, 669, 1721, 1721, 1721, 1721, - /* 2810 */ 2134, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2820 */ 1721, 1721, 2084, 2134, 669, 1721, 1721, 1721, 1721, 1721, - /* 2830 */ 1721, 1721, 1721, 1721, 1721, 2084, 2115, 669, 1721, 1721, - /* 2840 */ 2151, 1721, 1721, 2126, 2117, 673, 2119, 2120, 668, 1721, - /* 2850 */ 663, 1721, 1721, 1721, 1721, 2115, 1721, 1721, 1721, 2151, - /* 2860 */ 2116, 1721, 351, 2117, 673, 2119, 2120, 668, 2115, 663, - /* 2870 */ 670, 1721, 2151, 2116, 1721, 352, 2117, 673, 2119, 2120, - /* 2880 */ 668, 1721, 663, 670, 1721, 1721, 1721, 1721, 2116, 1721, - /* 2890 */ 1721, 1721, 1721, 1721, 1721, 1721, 2134, 1721, 670, 1721, - /* 2900 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 2084, 2134, - /* 2910 */ 669, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 2920 */ 1721, 2084, 1721, 669, 2134, 1721, 1721, 1721, 1721, 1721, - /* 2930 */ 1721, 1721, 1721, 1721, 2116, 1721, 2084, 1721, 669, 1721, - /* 2940 */ 1721, 2115, 1721, 1721, 670, 2151, 1721, 1721, 348, 2117, - /* 2950 */ 673, 2119, 2120, 668, 2115, 663, 1721, 1721, 2151, 1721, - /* 2960 */ 1721, 353, 2117, 673, 2119, 2120, 668, 1721, 663, 671, - /* 2970 */ 2134, 1721, 1721, 2151, 1721, 1721, 328, 2117, 673, 2119, - /* 2980 */ 2120, 668, 2084, 663, 669, 1721, 1721, 1721, 1721, 1721, - /* 2990 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 3000 */ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, - /* 3010 */ 1721, 1721, 1721, 1721, 1721, 2115, 1721, 1721, 1721, 2151, - /* 3020 */ 1721, 1721, 327, 2117, 673, 2119, 2120, 668, 1721, 663, + /* 0 */ 2139, 1764, 2303, 514, 167, 2298, 515, 1777, 38, 296, + /* 10 */ 682, 1856, 48, 46, 1665, 47, 45, 44, 43, 42, + /* 20 */ 394, 2302, 1514, 41, 40, 2299, 2301, 47, 45, 44, + /* 30 */ 43, 42, 519, 1595, 1814, 1512, 2157, 439, 516, 397, + /* 40 */ 1669, 522, 643, 140, 515, 1777, 1539, 162, 2107, 2107, + /* 50 */ 684, 625, 41, 40, 373, 1917, 47, 45, 44, 43, + /* 60 */ 42, 1590, 1965, 2033, 1542, 41, 40, 19, 1539, 47, + /* 70 */ 45, 44, 43, 42, 1520, 385, 667, 2157, 2030, 655, + /* 80 */ 338, 2138, 153, 668, 1915, 2174, 566, 565, 332, 2140, + /* 90 */ 688, 2142, 2143, 683, 681, 678, 669, 2192, 168, 773, + /* 100 */ 1753, 133, 15, 750, 749, 748, 747, 404, 552, 746, + /* 110 */ 745, 144, 740, 739, 738, 737, 736, 735, 734, 157, + /* 120 */ 730, 729, 728, 403, 402, 725, 724, 723, 722, 721, + /* 130 */ 2303, 624, 101, 2298, 668, 1915, 531, 1539, 1597, 1598, + /* 140 */ 1207, 56, 1206, 275, 2235, 642, 667, 134, 641, 2302, + /* 150 */ 2298, 180, 133, 2299, 2300, 226, 1908, 166, 51, 557, + /* 160 */ 1704, 1541, 316, 1954, 62, 630, 184, 1763, 1570, 1580, + /* 170 */ 2299, 632, 2303, 1208, 1596, 1599, 314, 73, 41, 40, + /* 180 */ 72, 1741, 47, 45, 44, 43, 42, 653, 1515, 1541, + /* 190 */ 1513, 339, 41, 40, 1571, 1734, 47, 45, 44, 43, + /* 200 */ 42, 207, 496, 494, 491, 132, 131, 130, 129, 128, + /* 210 */ 127, 126, 125, 124, 255, 2107, 621, 1518, 1519, 1817, + /* 220 */ 1569, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 680, + /* 230 */ 676, 1588, 1589, 1591, 1592, 1593, 1594, 2, 48, 46, + /* 240 */ 1514, 62, 1184, 342, 142, 1537, 394, 2198, 1514, 431, + /* 250 */ 626, 430, 470, 1512, 477, 484, 643, 140, 483, 1595, + /* 260 */ 123, 1512, 1967, 122, 121, 120, 119, 118, 117, 116, + /* 270 */ 115, 114, 1727, 1681, 453, 107, 485, 1966, 429, 109, + /* 280 */ 455, 1186, 1693, 1189, 1190, 1428, 1429, 1590, 570, 569, + /* 290 */ 568, 141, 1520, 19, 1733, 560, 137, 564, 1967, 1907, + /* 300 */ 1520, 563, 627, 622, 615, 372, 562, 567, 367, 366, + /* 310 */ 187, 277, 561, 1965, 200, 199, 187, 773, 720, 81, + /* 320 */ 80, 436, 1539, 196, 191, 773, 360, 2033, 15, 618, + /* 330 */ 617, 1691, 1692, 1694, 1695, 1696, 667, 476, 443, 277, + /* 340 */ 1961, 1962, 2031, 655, 66, 340, 744, 742, 422, 1540, + /* 350 */ 2125, 420, 416, 412, 409, 429, 645, 182, 2235, 2236, + /* 360 */ 2121, 138, 2240, 84, 1597, 1598, 83, 481, 278, 1538, + /* 370 */ 475, 474, 473, 472, 469, 468, 467, 466, 465, 461, + /* 380 */ 460, 459, 458, 341, 450, 449, 448, 87, 445, 444, + /* 390 */ 358, 1189, 1190, 187, 1570, 1580, 2117, 2123, 389, 1540, + /* 400 */ 1596, 1599, 631, 361, 62, 2298, 1515, 678, 1513, 62, + /* 410 */ 1539, 93, 1910, 242, 1515, 2128, 1513, 241, 51, 2242, + /* 420 */ 630, 184, 106, 41, 40, 2299, 632, 47, 45, 44, + /* 430 */ 43, 42, 103, 41, 40, 1518, 1519, 47, 45, 44, + /* 440 */ 43, 42, 62, 1518, 1519, 2239, 1569, 1572, 1573, 1574, + /* 450 */ 1575, 1576, 1577, 1578, 1579, 680, 676, 1588, 1589, 1591, + /* 460 */ 1592, 1593, 1594, 2, 12, 48, 46, 1373, 1374, 30, + /* 470 */ 2130, 654, 1997, 394, 1339, 1514, 399, 90, 346, 1960, + /* 480 */ 1962, 371, 351, 586, 1542, 1283, 1595, 177, 1512, 1330, + /* 490 */ 710, 709, 708, 1334, 707, 1336, 1337, 706, 703, 62, + /* 500 */ 1345, 700, 1347, 1348, 697, 694, 426, 359, 2016, 227, + /* 510 */ 668, 1915, 2139, 712, 1590, 1742, 1958, 1445, 1446, 654, + /* 520 */ 19, 529, 646, 2026, 1285, 172, 1624, 1520, 189, 177, + /* 530 */ 428, 424, 548, 544, 540, 536, 123, 224, 654, 122, + /* 540 */ 121, 120, 119, 118, 117, 116, 115, 114, 2157, 1906, + /* 550 */ 2017, 1605, 773, 1444, 1447, 15, 187, 1539, 1571, 2121, + /* 560 */ 2107, 187, 684, 52, 209, 570, 569, 568, 517, 652, + /* 570 */ 1784, 2026, 560, 137, 564, 211, 1762, 88, 563, 517, + /* 580 */ 222, 1784, 1625, 562, 567, 367, 366, 1892, 663, 561, + /* 590 */ 2026, 1597, 1598, 2138, 187, 2117, 2123, 2174, 668, 1915, + /* 600 */ 110, 2140, 688, 2142, 2143, 683, 678, 678, 1967, 386, + /* 610 */ 593, 1207, 181, 1206, 2227, 382, 57, 165, 388, 2223, + /* 620 */ 2242, 1570, 1580, 1965, 2107, 1917, 1739, 1596, 1599, 457, + /* 630 */ 1967, 186, 668, 1915, 193, 668, 1915, 357, 456, 2253, + /* 640 */ 1890, 1515, 12, 1513, 1208, 1965, 2238, 221, 215, 1761, + /* 650 */ 437, 187, 220, 438, 527, 2302, 37, 392, 1619, 1620, + /* 660 */ 1621, 1622, 1623, 1627, 1628, 1629, 1630, 44, 43, 42, + /* 670 */ 1518, 1519, 213, 1569, 1572, 1573, 1574, 1575, 1576, 1577, + /* 680 */ 1578, 1579, 680, 676, 1588, 1589, 1591, 1592, 1593, 1594, + /* 690 */ 2, 48, 46, 1600, 584, 1520, 407, 2107, 433, 394, + /* 700 */ 406, 1514, 432, 2126, 1760, 1571, 2139, 582, 631, 580, + /* 710 */ 1967, 2298, 1595, 2121, 1512, 187, 685, 387, 718, 155, + /* 720 */ 154, 715, 714, 713, 152, 1965, 630, 184, 1294, 41, + /* 730 */ 40, 2299, 632, 47, 45, 44, 43, 42, 1542, 397, + /* 740 */ 1590, 1293, 2157, 606, 1967, 606, 2298, 165, 2298, 2117, + /* 750 */ 2123, 398, 2107, 1520, 2107, 1917, 684, 1298, 1891, 1965, + /* 760 */ 678, 2304, 184, 2304, 184, 2012, 2299, 632, 2299, 632, + /* 770 */ 1297, 718, 155, 154, 715, 714, 713, 152, 773, 511, + /* 780 */ 12, 49, 10, 2139, 400, 649, 509, 2138, 711, 505, + /* 790 */ 501, 2174, 165, 685, 110, 2140, 688, 2142, 2143, 683, + /* 800 */ 1917, 678, 668, 1915, 143, 486, 150, 2198, 2227, 192, + /* 810 */ 1192, 153, 388, 2223, 243, 34, 1538, 1597, 1598, 2157, + /* 820 */ 447, 41, 40, 2242, 720, 47, 45, 44, 43, 42, + /* 830 */ 36, 2107, 606, 684, 488, 2298, 41, 40, 1759, 1758, + /* 840 */ 47, 45, 44, 43, 42, 643, 140, 1570, 1580, 2237, + /* 850 */ 2304, 184, 253, 1596, 1599, 2299, 632, 14, 13, 2090, + /* 860 */ 287, 288, 668, 1915, 2138, 286, 1662, 1515, 2174, 1513, + /* 870 */ 1482, 110, 2140, 688, 2142, 2143, 683, 670, 678, 2199, + /* 880 */ 462, 1487, 1488, 2202, 1757, 2227, 2107, 2107, 254, 388, + /* 890 */ 2223, 164, 2100, 1756, 732, 91, 1518, 1519, 1626, 1569, + /* 900 */ 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 680, 676, + /* 910 */ 1588, 1589, 1591, 1592, 1593, 1594, 2, 48, 46, 87, + /* 920 */ 575, 165, 672, 2101, 2199, 394, 634, 1514, 1755, 1918, + /* 930 */ 2012, 2012, 2107, 2139, 1904, 585, 668, 1915, 1595, 606, + /* 940 */ 1512, 2107, 2298, 646, 1911, 591, 183, 2235, 2236, 240, + /* 950 */ 138, 2240, 1900, 716, 463, 1752, 1958, 2304, 184, 1638, + /* 960 */ 2247, 1658, 2299, 632, 1751, 578, 1590, 668, 1915, 2157, + /* 970 */ 606, 572, 35, 2298, 194, 198, 2107, 239, 364, 1520, + /* 980 */ 2074, 2107, 1631, 684, 1750, 530, 643, 140, 2304, 184, + /* 990 */ 668, 1915, 606, 2299, 632, 2298, 718, 155, 154, 715, + /* 1000 */ 714, 713, 152, 2107, 773, 1749, 9, 49, 1912, 2139, + /* 1010 */ 2304, 184, 2107, 1748, 2138, 2299, 632, 70, 2174, 685, + /* 1020 */ 69, 110, 2140, 688, 2142, 2143, 683, 244, 678, 668, + /* 1030 */ 1915, 635, 2107, 181, 1747, 2227, 668, 1915, 717, 388, + /* 1040 */ 2223, 1958, 638, 1597, 1598, 2157, 365, 245, 363, 362, + /* 1050 */ 733, 554, 1877, 2107, 602, 1746, 54, 2107, 3, 684, + /* 1060 */ 2254, 2107, 1745, 668, 1915, 2093, 668, 1915, 668, 1915, + /* 1070 */ 421, 1744, 556, 1570, 1580, 310, 555, 1893, 1944, 1596, + /* 1080 */ 1599, 647, 2107, 146, 651, 135, 291, 185, 2235, 2236, + /* 1090 */ 2138, 138, 2240, 1515, 2174, 1513, 675, 110, 2140, 688, + /* 1100 */ 2142, 2143, 683, 2107, 678, 440, 668, 1915, 556, 2200, + /* 1110 */ 2107, 2227, 555, 74, 414, 388, 2223, 1661, 441, 2107, + /* 1120 */ 153, 148, 1518, 1519, 665, 1569, 1572, 1573, 1574, 1575, + /* 1130 */ 1576, 1577, 1578, 1579, 680, 676, 1588, 1589, 1591, 1592, + /* 1140 */ 1593, 1594, 2, 48, 46, 668, 1915, 668, 1915, 1523, + /* 1150 */ 50, 394, 232, 1514, 234, 230, 558, 233, 668, 1915, + /* 1160 */ 559, 1801, 82, 401, 1595, 666, 1512, 2139, 236, 238, + /* 1170 */ 50, 235, 237, 1793, 1791, 252, 297, 685, 1281, 1485, + /* 1180 */ 259, 1902, 1279, 571, 588, 605, 587, 1736, 1737, 1522, + /* 1190 */ 2139, 1898, 1590, 1240, 50, 573, 576, 14, 13, 726, + /* 1200 */ 685, 727, 1786, 2157, 1857, 1520, 153, 50, 375, 1690, + /* 1210 */ 1919, 249, 679, 284, 71, 2107, 1754, 684, 1787, 2267, + /* 1220 */ 1658, 1259, 272, 1257, 619, 151, 2157, 153, 64, 1689, + /* 1230 */ 773, 225, 1241, 15, 50, 692, 266, 2158, 2107, 261, + /* 1240 */ 684, 2139, 151, 153, 405, 2021, 1616, 1778, 2138, 1955, + /* 1250 */ 136, 685, 2174, 1581, 151, 333, 2140, 688, 2142, 2143, + /* 1260 */ 683, 2257, 678, 636, 1783, 650, 1442, 644, 768, 1597, + /* 1270 */ 1598, 2138, 289, 660, 274, 2174, 639, 2157, 110, 2140, + /* 1280 */ 688, 2142, 2143, 683, 293, 678, 1324, 1632, 271, 2107, + /* 1290 */ 2318, 684, 2227, 309, 1351, 1, 388, 2223, 5, 1570, + /* 1300 */ 1580, 1355, 1362, 408, 1526, 1596, 1599, 55, 413, 1360, + /* 1310 */ 355, 1465, 304, 156, 197, 442, 1542, 2022, 446, 1515, + /* 1320 */ 479, 1513, 2138, 451, 1537, 464, 2174, 2014, 471, 169, + /* 1330 */ 2140, 688, 2142, 2143, 683, 478, 678, 480, 489, 487, + /* 1340 */ 490, 201, 492, 202, 1525, 493, 204, 495, 1518, 1519, + /* 1350 */ 497, 1569, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, + /* 1360 */ 680, 676, 1588, 1589, 1591, 1592, 1593, 1594, 2, 2139, + /* 1370 */ 2265, 1543, 512, 4, 513, 520, 1545, 521, 212, 685, + /* 1380 */ 523, 2261, 1540, 214, 1544, 525, 524, 1546, 526, 217, + /* 1390 */ 528, 532, 219, 1210, 551, 85, 2139, 86, 553, 1905, + /* 1400 */ 549, 550, 223, 229, 345, 2157, 685, 2083, 2274, 590, + /* 1410 */ 112, 592, 89, 2080, 596, 305, 595, 2107, 149, 684, + /* 1420 */ 246, 597, 248, 250, 1901, 231, 158, 159, 1472, 1903, + /* 1430 */ 1899, 160, 2157, 601, 603, 161, 2273, 2272, 620, 658, + /* 1440 */ 629, 2249, 8, 2321, 2107, 611, 684, 173, 265, 267, + /* 1450 */ 2138, 2079, 610, 268, 2174, 640, 600, 110, 2140, 688, + /* 1460 */ 2142, 2143, 683, 616, 678, 2258, 609, 2268, 2139, 2318, + /* 1470 */ 377, 2227, 623, 257, 608, 388, 2223, 2138, 685, 260, + /* 1480 */ 613, 2174, 378, 2297, 110, 2140, 688, 2142, 2143, 683, + /* 1490 */ 637, 678, 273, 1658, 139, 1541, 2318, 270, 2227, 648, + /* 1500 */ 2139, 279, 388, 2223, 2157, 381, 2243, 96, 1547, 2027, + /* 1510 */ 685, 656, 2292, 306, 307, 657, 2107, 2041, 684, 661, + /* 1520 */ 61, 2040, 2039, 384, 662, 1916, 98, 308, 2139, 100, + /* 1530 */ 102, 2208, 769, 269, 335, 1959, 2157, 300, 685, 690, + /* 1540 */ 2246, 311, 772, 1878, 347, 770, 53, 348, 2107, 2138, + /* 1550 */ 684, 2099, 315, 2174, 320, 2098, 110, 2140, 688, 2142, + /* 1560 */ 2143, 683, 313, 678, 2157, 334, 324, 2097, 2318, 78, + /* 1570 */ 2227, 2094, 410, 1505, 388, 2223, 2107, 1506, 684, 411, + /* 1580 */ 190, 2138, 415, 2092, 417, 2174, 419, 418, 110, 2140, + /* 1590 */ 688, 2142, 2143, 683, 2091, 678, 356, 2089, 423, 2088, + /* 1600 */ 2318, 2087, 2227, 425, 391, 390, 388, 2223, 427, 2138, + /* 1610 */ 79, 1468, 1467, 2174, 1528, 2053, 110, 2140, 688, 2142, + /* 1620 */ 2143, 683, 594, 678, 2052, 1595, 2139, 1521, 2318, 2051, + /* 1630 */ 2227, 434, 435, 2050, 388, 2223, 685, 2049, 1419, 2005, + /* 1640 */ 776, 2004, 2002, 2001, 145, 2000, 2003, 1999, 1998, 1996, + /* 1650 */ 1995, 1994, 195, 1590, 303, 452, 1993, 454, 2007, 1992, + /* 1660 */ 1991, 1990, 2157, 482, 147, 1977, 1520, 1989, 1988, 1987, + /* 1670 */ 176, 1986, 1985, 1984, 2107, 1983, 684, 766, 762, 758, + /* 1680 */ 754, 1982, 301, 1981, 1980, 1979, 1978, 1976, 1975, 2006, + /* 1690 */ 1974, 674, 1421, 1972, 1971, 1970, 1969, 1968, 2139, 1973, + /* 1700 */ 1295, 343, 1299, 344, 1820, 203, 1819, 2138, 685, 1291, + /* 1710 */ 1818, 2174, 1816, 205, 110, 2140, 688, 2142, 2143, 683, + /* 1720 */ 1813, 678, 108, 206, 1812, 294, 671, 1805, 2227, 1795, + /* 1730 */ 500, 499, 388, 2223, 2157, 498, 502, 1773, 506, 1191, + /* 1740 */ 1772, 504, 510, 2070, 2060, 2048, 2107, 503, 684, 218, + /* 1750 */ 508, 208, 76, 2047, 507, 2127, 77, 664, 178, 210, + /* 1760 */ 216, 2025, 179, 518, 1894, 1815, 1811, 533, 1809, 535, + /* 1770 */ 537, 534, 538, 539, 1807, 543, 541, 542, 1804, 2138, + /* 1780 */ 1529, 545, 1524, 2174, 1790, 1789, 111, 2140, 688, 2142, + /* 1790 */ 2143, 683, 281, 678, 1233, 547, 2139, 280, 546, 1769, + /* 1800 */ 2227, 1366, 1367, 1895, 2226, 2223, 685, 1896, 1282, 1532, + /* 1810 */ 1534, 1280, 1278, 741, 743, 1277, 1276, 247, 1275, 1269, + /* 1820 */ 2139, 1274, 676, 1588, 1589, 1591, 1592, 1593, 1594, 63, + /* 1830 */ 685, 1271, 2157, 1270, 1802, 1268, 368, 1794, 369, 1792, + /* 1840 */ 228, 574, 370, 577, 2107, 1768, 684, 579, 1767, 1766, + /* 1850 */ 581, 583, 113, 1496, 1492, 2069, 2157, 1494, 1491, 29, + /* 1860 */ 67, 1478, 1474, 1476, 2059, 598, 2046, 163, 2107, 2044, + /* 1870 */ 684, 2303, 20, 31, 17, 1706, 23, 2138, 6, 7, + /* 1880 */ 21, 2174, 612, 65, 111, 2140, 688, 2142, 2143, 683, + /* 1890 */ 614, 678, 258, 256, 2139, 22, 1688, 171, 2227, 264, + /* 1900 */ 263, 686, 673, 2223, 685, 2174, 262, 32, 111, 2140, + /* 1910 */ 688, 2142, 2143, 683, 2139, 678, 604, 58, 599, 2128, + /* 1920 */ 1680, 24, 2227, 251, 685, 374, 350, 2223, 92, 1721, + /* 1930 */ 2157, 33, 1720, 379, 1725, 18, 1726, 276, 1727, 1724, + /* 1940 */ 380, 1655, 2107, 1654, 684, 60, 2045, 174, 2043, 2042, + /* 1950 */ 2157, 2024, 94, 95, 282, 25, 2023, 283, 97, 103, + /* 1960 */ 1686, 285, 2107, 290, 684, 68, 26, 659, 295, 99, + /* 1970 */ 1607, 1606, 11, 292, 13, 2138, 1530, 1617, 2177, 2174, + /* 1980 */ 175, 1585, 169, 2140, 688, 2142, 2143, 683, 677, 678, + /* 1990 */ 59, 1583, 1582, 39, 16, 2138, 1554, 27, 2139, 2174, + /* 2000 */ 188, 1562, 170, 2140, 688, 2142, 2143, 683, 685, 678, + /* 2010 */ 28, 691, 1352, 396, 693, 695, 689, 698, 701, 1349, + /* 2020 */ 696, 704, 607, 2264, 1361, 687, 1346, 2139, 699, 298, + /* 2030 */ 1340, 702, 1357, 1338, 2157, 1344, 705, 685, 104, 105, + /* 2040 */ 75, 1343, 1231, 1265, 1342, 1289, 2107, 1264, 684, 1341, + /* 2050 */ 1263, 719, 1262, 633, 2319, 1261, 1260, 1258, 1256, 1255, + /* 2060 */ 1254, 731, 299, 2157, 1252, 1251, 1250, 1249, 376, 1248, + /* 2070 */ 1247, 1246, 1286, 1284, 1243, 2107, 1242, 684, 1239, 2138, + /* 2080 */ 1237, 1238, 1236, 2174, 1810, 751, 111, 2140, 688, 2142, + /* 2090 */ 2143, 683, 753, 678, 1808, 755, 757, 752, 756, 1806, + /* 2100 */ 2227, 759, 761, 760, 1803, 2224, 763, 765, 2138, 1788, + /* 2110 */ 764, 767, 2174, 1181, 1765, 333, 2140, 688, 2142, 2143, + /* 2120 */ 683, 771, 678, 2139, 302, 1516, 1740, 312, 774, 1740, + /* 2130 */ 775, 1740, 1740, 685, 1740, 1740, 2139, 1740, 1740, 1740, + /* 2140 */ 1740, 1740, 1740, 1740, 1740, 1740, 685, 1740, 1740, 1740, + /* 2150 */ 1740, 1740, 1740, 2139, 1740, 1740, 1740, 1740, 1740, 2157, + /* 2160 */ 1740, 1740, 1740, 685, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2170 */ 1740, 2107, 2157, 684, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2180 */ 1740, 1740, 1740, 1740, 2107, 1740, 684, 1740, 1740, 2157, + /* 2190 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2200 */ 1740, 2107, 1740, 684, 2138, 1740, 1740, 1740, 2174, 1740, + /* 2210 */ 1740, 326, 2140, 688, 2142, 2143, 683, 2138, 678, 1740, + /* 2220 */ 2139, 2174, 1740, 1740, 170, 2140, 688, 2142, 2143, 683, + /* 2230 */ 685, 678, 1740, 1740, 589, 1740, 1740, 2139, 2174, 1740, + /* 2240 */ 1740, 328, 2140, 688, 2142, 2143, 683, 682, 678, 1740, + /* 2250 */ 2139, 1740, 1740, 1740, 628, 1740, 2157, 1740, 1740, 1740, + /* 2260 */ 685, 383, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 1740, + /* 2270 */ 684, 1740, 1740, 2157, 1740, 1740, 2320, 1740, 1740, 1740, + /* 2280 */ 1740, 1740, 1740, 1740, 1740, 2107, 2157, 684, 1740, 1740, + /* 2290 */ 1740, 393, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 1740, + /* 2300 */ 684, 2138, 1740, 1740, 1740, 2174, 1740, 1740, 333, 2140, + /* 2310 */ 688, 2142, 2143, 683, 1740, 678, 1740, 1740, 2138, 1740, + /* 2320 */ 1740, 1740, 2174, 2139, 1740, 332, 2140, 688, 2142, 2143, + /* 2330 */ 683, 2138, 678, 685, 2193, 2174, 1740, 1740, 333, 2140, + /* 2340 */ 688, 2142, 2143, 683, 2139, 678, 1740, 1740, 1740, 1740, + /* 2350 */ 1740, 1740, 1740, 1740, 685, 1740, 1740, 1740, 1740, 2157, + /* 2360 */ 1740, 1740, 1740, 1740, 395, 1740, 1740, 1740, 1740, 1740, + /* 2370 */ 1740, 2107, 1740, 684, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2380 */ 2157, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2390 */ 2139, 1740, 2107, 1740, 684, 1740, 1740, 1740, 1740, 1740, + /* 2400 */ 685, 1740, 1740, 1740, 2138, 1740, 1740, 1740, 2174, 1740, + /* 2410 */ 1740, 333, 2140, 688, 2142, 2143, 683, 1740, 678, 1740, + /* 2420 */ 1740, 1740, 1740, 1740, 1740, 2138, 2157, 1740, 1740, 2174, + /* 2430 */ 1740, 1740, 317, 2140, 688, 2142, 2143, 683, 2107, 678, + /* 2440 */ 684, 2139, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2450 */ 1740, 685, 1740, 1740, 2139, 1740, 1740, 1740, 1740, 1740, + /* 2460 */ 1740, 1740, 1740, 1740, 685, 1740, 1740, 1740, 1740, 1740, + /* 2470 */ 1740, 2138, 1740, 1740, 1740, 2174, 1740, 2157, 318, 2140, + /* 2480 */ 688, 2142, 2143, 683, 1740, 678, 1740, 1740, 1740, 2107, + /* 2490 */ 2157, 684, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2500 */ 1740, 1740, 2107, 1740, 684, 1740, 1740, 1740, 1740, 1740, + /* 2510 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2520 */ 1740, 1740, 2138, 1740, 1740, 1740, 2174, 1740, 1740, 319, + /* 2530 */ 2140, 688, 2142, 2143, 683, 2138, 678, 1740, 1740, 2174, + /* 2540 */ 2139, 1740, 325, 2140, 688, 2142, 2143, 683, 1740, 678, + /* 2550 */ 685, 1740, 1740, 2139, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2560 */ 1740, 1740, 1740, 685, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2570 */ 2139, 1740, 1740, 1740, 1740, 1740, 2157, 1740, 1740, 1740, + /* 2580 */ 685, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 2157, + /* 2590 */ 684, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2600 */ 1740, 2107, 1740, 684, 2139, 1740, 2157, 1740, 1740, 1740, + /* 2610 */ 1740, 1740, 1740, 1740, 685, 1740, 1740, 1740, 2107, 1740, + /* 2620 */ 684, 2138, 1740, 1740, 1740, 2174, 1740, 1740, 329, 2140, + /* 2630 */ 688, 2142, 2143, 683, 2138, 678, 1740, 1740, 2174, 1740, + /* 2640 */ 2157, 321, 2140, 688, 2142, 2143, 683, 1740, 678, 1740, + /* 2650 */ 1740, 2138, 2107, 1740, 684, 2174, 1740, 1740, 330, 2140, + /* 2660 */ 688, 2142, 2143, 683, 2139, 678, 1740, 1740, 1740, 1740, + /* 2670 */ 1740, 1740, 1740, 1740, 685, 1740, 1740, 2139, 1740, 1740, + /* 2680 */ 1740, 1740, 1740, 1740, 1740, 2138, 1740, 685, 1740, 2174, + /* 2690 */ 1740, 1740, 322, 2140, 688, 2142, 2143, 683, 1740, 678, + /* 2700 */ 2157, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2710 */ 1740, 1740, 2107, 2157, 684, 1740, 1740, 1740, 1740, 1740, + /* 2720 */ 1740, 1740, 1740, 1740, 1740, 2107, 1740, 684, 2139, 1740, + /* 2730 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 685, 1740, + /* 2740 */ 1740, 1740, 1740, 1740, 1740, 2138, 1740, 1740, 1740, 2174, + /* 2750 */ 2139, 1740, 331, 2140, 688, 2142, 2143, 683, 2138, 678, + /* 2760 */ 685, 1740, 2174, 1740, 2157, 323, 2140, 688, 2142, 2143, + /* 2770 */ 683, 1740, 678, 1740, 2139, 1740, 2107, 1740, 684, 1740, + /* 2780 */ 1740, 1740, 1740, 1740, 685, 1740, 2157, 1740, 1740, 1740, + /* 2790 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 1740, + /* 2800 */ 684, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2138, + /* 2810 */ 2157, 1740, 1740, 2174, 1740, 1740, 336, 2140, 688, 2142, + /* 2820 */ 2143, 683, 2107, 678, 684, 1740, 1740, 1740, 1740, 1740, + /* 2830 */ 1740, 2138, 1740, 1740, 1740, 2174, 1740, 1740, 337, 2140, + /* 2840 */ 688, 2142, 2143, 683, 1740, 678, 1740, 1740, 1740, 1740, + /* 2850 */ 1740, 1740, 1740, 1740, 1740, 2138, 1740, 1740, 2139, 2174, + /* 2860 */ 1740, 1740, 2151, 2140, 688, 2142, 2143, 683, 685, 678, + /* 2870 */ 1740, 2139, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2880 */ 1740, 685, 1740, 1740, 1740, 1740, 2139, 1740, 1740, 1740, + /* 2890 */ 1740, 1740, 1740, 1740, 2157, 1740, 685, 1740, 1740, 1740, + /* 2900 */ 1740, 1740, 1740, 1740, 1740, 1740, 2107, 2157, 684, 1740, + /* 2910 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2107, + /* 2920 */ 1740, 684, 2157, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 2930 */ 1740, 1740, 1740, 1740, 2107, 1740, 684, 1740, 1740, 2138, + /* 2940 */ 1740, 1740, 1740, 2174, 1740, 1740, 2150, 2140, 688, 2142, + /* 2950 */ 2143, 683, 2138, 678, 1740, 1740, 2174, 1740, 1740, 2149, + /* 2960 */ 2140, 688, 2142, 2143, 683, 1740, 678, 2138, 1740, 1740, + /* 2970 */ 2139, 2174, 1740, 1740, 352, 2140, 688, 2142, 2143, 683, + /* 2980 */ 685, 678, 1740, 1740, 1740, 1740, 1740, 2139, 1740, 1740, + /* 2990 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 685, 1740, 1740, + /* 3000 */ 2139, 1740, 1740, 1740, 1740, 1740, 2157, 1740, 1740, 1740, + /* 3010 */ 685, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 1740, + /* 3020 */ 684, 2139, 1740, 2157, 1740, 1740, 1740, 1740, 1740, 1740, + /* 3030 */ 1740, 685, 1740, 1740, 1740, 2107, 2157, 684, 1740, 1740, + /* 3040 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2107, 1740, + /* 3050 */ 684, 2138, 1740, 1740, 1740, 2174, 1740, 2157, 353, 2140, + /* 3060 */ 688, 2142, 2143, 683, 1740, 678, 1740, 1740, 2138, 2107, + /* 3070 */ 1740, 684, 2174, 1740, 1740, 349, 2140, 688, 2142, 2143, + /* 3080 */ 683, 2138, 678, 1740, 1740, 2174, 2139, 1740, 354, 2140, + /* 3090 */ 688, 2142, 2143, 683, 1740, 678, 685, 1740, 1740, 1740, + /* 3100 */ 1740, 1740, 686, 1740, 1740, 1740, 2174, 1740, 1740, 328, + /* 3110 */ 2140, 688, 2142, 2143, 683, 1740, 678, 1740, 1740, 1740, + /* 3120 */ 1740, 1740, 2157, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 3130 */ 1740, 1740, 1740, 1740, 2107, 1740, 684, 1740, 1740, 1740, + /* 3140 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 3150 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, + /* 3160 */ 1740, 1740, 1740, 1740, 1740, 1740, 1740, 2138, 1740, 1740, + /* 3170 */ 1740, 2174, 1740, 1740, 327, 2140, 688, 2142, 2143, 683, + /* 3180 */ 1740, 678, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 333, 338, 383, 370, 400, 342, 371, 344, 404, 371, - /* 10 */ 343, 383, 12, 13, 14, 0, 381, 398, 399, 381, - /* 20 */ 20, 20, 22, 395, 8, 9, 398, 399, 12, 13, - /* 30 */ 14, 15, 16, 33, 0, 35, 369, 368, 20, 24, - /* 40 */ 25, 26, 27, 28, 29, 30, 31, 32, 381, 380, - /* 50 */ 383, 447, 417, 418, 450, 417, 418, 419, 379, 59, - /* 60 */ 44, 382, 383, 428, 337, 65, 428, 340, 341, 465, - /* 70 */ 466, 332, 72, 334, 470, 471, 20, 342, 343, 0, - /* 80 */ 337, 414, 348, 340, 341, 418, 436, 437, 421, 422, - /* 90 */ 423, 424, 425, 426, 432, 428, 434, 97, 364, 39, - /* 100 */ 100, 67, 68, 69, 70, 71, 372, 73, 74, 75, + /* 0 */ 335, 335, 449, 339, 353, 452, 342, 343, 438, 439, + /* 10 */ 345, 360, 12, 13, 14, 12, 13, 14, 15, 16, + /* 20 */ 20, 468, 22, 8, 9, 472, 473, 12, 13, 14, + /* 30 */ 15, 16, 14, 33, 0, 35, 371, 344, 20, 363, + /* 40 */ 14, 339, 344, 345, 342, 343, 20, 371, 383, 383, + /* 50 */ 385, 345, 8, 9, 378, 379, 12, 13, 14, 15, + /* 60 */ 16, 61, 386, 385, 20, 8, 9, 67, 20, 12, + /* 70 */ 13, 14, 15, 16, 74, 397, 20, 371, 400, 401, + /* 80 */ 387, 416, 44, 344, 345, 420, 357, 358, 423, 424, + /* 90 */ 425, 426, 427, 428, 429, 430, 431, 432, 334, 99, + /* 100 */ 336, 362, 102, 69, 70, 71, 72, 73, 369, 75, /* 110 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - /* 120 */ 86, 87, 88, 89, 90, 91, 92, 93, 461, 462, - /* 130 */ 100, 420, 97, 382, 383, 21, 136, 137, 24, 25, - /* 140 */ 26, 27, 28, 29, 30, 31, 32, 112, 113, 114, - /* 150 */ 115, 116, 117, 118, 119, 120, 121, 446, 123, 124, - /* 160 */ 125, 126, 127, 128, 14, 20, 166, 167, 447, 168, - /* 170 */ 20, 450, 172, 173, 369, 342, 343, 442, 443, 444, - /* 180 */ 445, 376, 447, 448, 166, 167, 186, 466, 188, 384, - /* 190 */ 330, 470, 471, 360, 130, 131, 343, 8, 9, 135, - /* 200 */ 367, 12, 13, 14, 15, 16, 59, 100, 129, 130, - /* 210 */ 131, 132, 133, 134, 135, 215, 216, 0, 218, 219, + /* 120 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + /* 130 */ 449, 425, 350, 452, 344, 345, 66, 20, 138, 139, + /* 140 */ 20, 103, 22, 445, 446, 447, 20, 449, 450, 468, + /* 150 */ 452, 370, 362, 472, 473, 35, 374, 18, 102, 369, + /* 160 */ 103, 20, 23, 382, 102, 467, 468, 335, 168, 169, + /* 170 */ 472, 473, 3, 53, 174, 175, 37, 38, 8, 9, + /* 180 */ 41, 0, 12, 13, 14, 15, 16, 20, 188, 20, + /* 190 */ 190, 52, 8, 9, 168, 180, 12, 13, 14, 15, + /* 200 */ 16, 62, 63, 64, 65, 24, 25, 26, 27, 28, + /* 210 */ 29, 30, 31, 32, 170, 383, 173, 217, 218, 0, /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - /* 230 */ 230, 231, 232, 233, 234, 235, 12, 13, 181, 4, - /* 240 */ 387, 18, 100, 20, 20, 100, 22, 100, 350, 102, - /* 250 */ 27, 333, 447, 30, 65, 450, 33, 33, 369, 35, - /* 260 */ 400, 343, 205, 206, 404, 12, 13, 14, 15, 16, - /* 270 */ 465, 466, 49, 375, 51, 470, 471, 54, 43, 390, - /* 280 */ 45, 46, 252, 59, 67, 68, 69, 369, 0, 65, - /* 290 */ 100, 74, 75, 76, 355, 356, 72, 80, 109, 381, - /* 300 */ 110, 383, 85, 86, 87, 88, 20, 447, 91, 21, - /* 310 */ 450, 251, 24, 25, 26, 27, 28, 29, 30, 31, - /* 320 */ 32, 97, 99, 348, 100, 465, 466, 185, 3, 187, - /* 330 */ 470, 471, 414, 20, 111, 22, 418, 342, 343, 421, - /* 340 */ 422, 423, 424, 425, 426, 20, 428, 372, 35, 431, - /* 350 */ 342, 433, 434, 435, 165, 360, 214, 439, 440, 252, - /* 360 */ 136, 137, 367, 140, 20, 52, 143, 144, 145, 146, - /* 370 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - /* 380 */ 157, 158, 159, 369, 161, 162, 163, 342, 343, 20, - /* 390 */ 166, 167, 447, 385, 252, 450, 172, 173, 369, 252, - /* 400 */ 67, 68, 69, 389, 390, 360, 377, 74, 75, 76, - /* 410 */ 186, 466, 188, 80, 171, 470, 471, 0, 85, 86, - /* 420 */ 87, 88, 136, 137, 91, 3, 101, 35, 239, 240, - /* 430 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 215, - /* 440 */ 216, 0, 218, 219, 220, 221, 222, 223, 224, 225, - /* 450 */ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - /* 460 */ 236, 12, 13, 33, 72, 22, 49, 20, 343, 20, - /* 470 */ 333, 22, 20, 59, 351, 215, 64, 20, 35, 49, - /* 480 */ 343, 358, 33, 81, 35, 55, 56, 57, 58, 59, - /* 490 */ 59, 8, 9, 168, 369, 12, 13, 14, 15, 16, - /* 500 */ 257, 258, 259, 20, 20, 4, 369, 371, 59, 236, - /* 510 */ 20, 238, 22, 99, 65, 72, 102, 381, 381, 342, - /* 520 */ 383, 72, 262, 263, 264, 265, 266, 267, 268, 99, - /* 530 */ 8, 9, 102, 102, 12, 13, 14, 15, 16, 0, - /* 540 */ 97, 338, 52, 141, 142, 342, 97, 344, 423, 100, - /* 550 */ 14, 414, 100, 417, 418, 418, 20, 100, 421, 422, - /* 560 */ 423, 424, 425, 426, 428, 428, 164, 365, 18, 392, - /* 570 */ 433, 394, 435, 23, 8, 9, 439, 440, 12, 13, - /* 580 */ 14, 15, 16, 136, 137, 136, 137, 37, 38, 452, - /* 590 */ 432, 41, 434, 357, 4, 359, 155, 460, 333, 169, - /* 600 */ 170, 100, 64, 64, 174, 164, 176, 1, 2, 19, - /* 610 */ 60, 61, 62, 63, 412, 166, 167, 361, 361, 172, - /* 620 */ 173, 172, 173, 33, 194, 369, 369, 342, 343, 186, - /* 630 */ 14, 188, 376, 377, 377, 186, 20, 188, 447, 49, - /* 640 */ 384, 450, 342, 343, 54, 360, 381, 20, 369, 59, - /* 650 */ 100, 168, 14, 15, 16, 376, 465, 466, 215, 216, - /* 660 */ 360, 470, 471, 384, 215, 216, 20, 218, 219, 220, - /* 670 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - /* 680 */ 231, 232, 233, 234, 235, 12, 13, 14, 138, 99, - /* 690 */ 369, 333, 102, 20, 272, 22, 333, 376, 342, 343, - /* 700 */ 178, 343, 166, 35, 252, 384, 33, 101, 35, 252, - /* 710 */ 420, 2, 355, 356, 342, 343, 360, 8, 9, 342, - /* 720 */ 343, 12, 13, 14, 15, 16, 111, 369, 178, 179, - /* 730 */ 180, 129, 59, 183, 168, 133, 446, 360, 342, 381, - /* 740 */ 72, 383, 8, 9, 381, 72, 12, 13, 14, 15, - /* 750 */ 16, 342, 343, 252, 204, 431, 378, 207, 434, 381, - /* 760 */ 210, 211, 212, 213, 214, 236, 130, 342, 343, 360, - /* 770 */ 97, 72, 414, 100, 342, 343, 418, 333, 342, 421, - /* 780 */ 422, 423, 424, 425, 426, 360, 428, 343, 392, 345, - /* 790 */ 394, 433, 360, 435, 2, 361, 350, 439, 440, 277, - /* 800 */ 8, 9, 252, 369, 12, 13, 14, 15, 16, 136, - /* 810 */ 137, 377, 366, 369, 168, 443, 444, 445, 460, 447, - /* 820 */ 448, 375, 450, 342, 343, 381, 111, 383, 392, 369, - /* 830 */ 394, 342, 343, 197, 198, 101, 376, 465, 466, 166, - /* 840 */ 167, 343, 470, 471, 384, 172, 173, 8, 9, 360, - /* 850 */ 72, 12, 13, 14, 15, 16, 0, 48, 414, 186, - /* 860 */ 22, 188, 418, 342, 343, 421, 422, 423, 424, 425, - /* 870 */ 426, 369, 428, 35, 131, 369, 343, 433, 135, 435, - /* 880 */ 37, 360, 376, 439, 440, 387, 384, 400, 215, 216, - /* 890 */ 384, 218, 219, 220, 221, 222, 223, 224, 225, 226, - /* 900 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 12, - /* 910 */ 13, 333, 333, 45, 46, 342, 343, 20, 333, 22, - /* 920 */ 387, 343, 370, 345, 443, 444, 445, 0, 447, 448, - /* 930 */ 33, 333, 35, 360, 447, 97, 20, 450, 195, 196, - /* 940 */ 101, 343, 199, 4, 201, 333, 103, 369, 105, 106, - /* 950 */ 333, 108, 465, 466, 370, 21, 59, 470, 471, 381, - /* 960 */ 381, 383, 342, 343, 342, 343, 381, 369, 34, 72, - /* 970 */ 36, 378, 129, 370, 381, 378, 133, 168, 381, 381, - /* 980 */ 360, 383, 360, 420, 370, 129, 130, 131, 132, 133, - /* 990 */ 134, 135, 414, 381, 97, 400, 418, 100, 381, 421, - /* 1000 */ 422, 423, 424, 425, 426, 333, 428, 400, 42, 446, - /* 1010 */ 44, 433, 414, 435, 20, 343, 418, 439, 440, 421, - /* 1020 */ 422, 423, 424, 425, 426, 427, 428, 429, 430, 342, - /* 1030 */ 343, 8, 9, 136, 137, 12, 13, 14, 15, 16, - /* 1040 */ 361, 369, 447, 333, 370, 450, 14, 360, 369, 342, - /* 1050 */ 343, 44, 20, 381, 447, 383, 377, 450, 342, 343, - /* 1060 */ 465, 466, 22, 166, 167, 470, 471, 360, 165, 172, - /* 1070 */ 173, 104, 465, 466, 107, 35, 360, 470, 471, 250, - /* 1080 */ 251, 342, 343, 186, 168, 188, 414, 333, 342, 343, - /* 1090 */ 418, 381, 22, 421, 422, 423, 424, 425, 426, 360, - /* 1100 */ 428, 400, 333, 342, 343, 35, 360, 333, 101, 42, - /* 1110 */ 333, 44, 215, 216, 333, 218, 219, 220, 221, 222, - /* 1120 */ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - /* 1130 */ 233, 234, 235, 12, 13, 381, 209, 97, 0, 333, - /* 1140 */ 333, 20, 239, 22, 472, 473, 333, 333, 447, 44, - /* 1150 */ 381, 450, 249, 333, 33, 381, 35, 343, 381, 345, - /* 1160 */ 166, 44, 381, 333, 333, 333, 465, 466, 111, 13, - /* 1170 */ 362, 470, 471, 365, 333, 104, 104, 35, 107, 107, - /* 1180 */ 59, 13, 44, 369, 343, 0, 345, 381, 381, 44, - /* 1190 */ 405, 35, 253, 72, 381, 381, 104, 383, 166, 107, - /* 1200 */ 200, 381, 202, 35, 443, 444, 445, 22, 447, 448, - /* 1210 */ 369, 381, 381, 381, 44, 44, 44, 160, 97, 0, - /* 1220 */ 44, 100, 381, 0, 383, 136, 137, 370, 414, 358, - /* 1230 */ 1, 2, 418, 44, 333, 421, 422, 423, 424, 425, - /* 1240 */ 426, 22, 428, 35, 343, 22, 101, 433, 44, 435, - /* 1250 */ 47, 44, 65, 439, 440, 414, 44, 136, 137, 418, - /* 1260 */ 44, 44, 421, 422, 423, 424, 425, 426, 391, 428, - /* 1270 */ 369, 101, 101, 101, 433, 44, 435, 101, 44, 334, - /* 1280 */ 439, 440, 381, 346, 383, 474, 463, 166, 167, 369, - /* 1290 */ 101, 457, 346, 172, 173, 391, 129, 130, 131, 132, - /* 1300 */ 133, 134, 135, 100, 341, 101, 380, 186, 101, 188, - /* 1310 */ 391, 44, 13, 101, 44, 414, 44, 101, 101, 418, - /* 1320 */ 0, 44, 421, 422, 423, 424, 425, 426, 343, 428, - /* 1330 */ 188, 449, 101, 44, 35, 101, 215, 216, 44, 218, - /* 1340 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - /* 1350 */ 229, 230, 231, 232, 233, 234, 235, 467, 441, 12, - /* 1360 */ 13, 13, 451, 462, 254, 416, 49, 333, 101, 22, - /* 1370 */ 50, 101, 415, 101, 184, 402, 42, 343, 101, 345, - /* 1380 */ 33, 276, 35, 35, 388, 20, 391, 388, 386, 165, - /* 1390 */ 101, 274, 20, 342, 342, 101, 188, 333, 388, 386, - /* 1400 */ 386, 98, 215, 369, 354, 96, 59, 343, 353, 345, - /* 1410 */ 342, 95, 352, 20, 335, 381, 342, 383, 342, 72, - /* 1420 */ 342, 48, 339, 335, 339, 20, 409, 350, 20, 383, - /* 1430 */ 350, 20, 20, 369, 344, 344, 401, 350, 53, 342, - /* 1440 */ 342, 347, 347, 350, 97, 381, 350, 383, 414, 350, - /* 1450 */ 350, 335, 418, 369, 335, 421, 422, 423, 424, 425, - /* 1460 */ 426, 203, 428, 381, 100, 333, 413, 433, 409, 435, - /* 1470 */ 369, 369, 369, 439, 440, 343, 369, 369, 414, 348, - /* 1480 */ 369, 369, 418, 369, 369, 421, 422, 423, 424, 425, - /* 1490 */ 426, 369, 428, 192, 381, 191, 348, 433, 190, 435, - /* 1500 */ 342, 369, 261, 439, 440, 381, 383, 381, 260, 381, - /* 1510 */ 456, 391, 408, 381, 456, 383, 407, 411, 391, 269, - /* 1520 */ 381, 396, 381, 177, 406, 396, 271, 270, 459, 255, - /* 1530 */ 455, 458, 278, 186, 275, 188, 475, 456, 273, 251, - /* 1540 */ 454, 343, 20, 342, 344, 348, 414, 348, 20, 394, - /* 1550 */ 418, 416, 170, 421, 422, 423, 424, 425, 426, 396, - /* 1560 */ 428, 381, 215, 216, 420, 433, 393, 435, 348, 381, - /* 1570 */ 396, 439, 440, 333, 381, 228, 229, 230, 231, 232, - /* 1580 */ 233, 234, 343, 343, 348, 100, 453, 381, 438, 100, - /* 1590 */ 381, 381, 365, 333, 373, 381, 359, 348, 342, 469, - /* 1600 */ 36, 335, 468, 343, 336, 403, 410, 363, 397, 369, - /* 1610 */ 397, 349, 331, 0, 363, 363, 0, 0, 42, 0, - /* 1620 */ 35, 381, 208, 383, 35, 35, 35, 208, 0, 369, - /* 1630 */ 35, 35, 208, 0, 208, 0, 35, 0, 0, 35, - /* 1640 */ 22, 381, 195, 383, 188, 186, 0, 0, 0, 182, - /* 1650 */ 181, 0, 0, 47, 414, 0, 0, 0, 418, 0, - /* 1660 */ 0, 421, 422, 423, 424, 425, 426, 42, 428, 0, - /* 1670 */ 0, 0, 0, 433, 414, 435, 155, 333, 418, 439, - /* 1680 */ 440, 421, 422, 423, 424, 425, 426, 343, 428, 0, - /* 1690 */ 0, 0, 155, 433, 0, 435, 35, 0, 0, 439, - /* 1700 */ 440, 333, 0, 0, 0, 0, 0, 0, 0, 0, - /* 1710 */ 0, 343, 0, 369, 0, 0, 0, 42, 0, 0, - /* 1720 */ 0, 0, 0, 0, 0, 381, 0, 383, 0, 0, - /* 1730 */ 0, 139, 48, 22, 48, 22, 0, 369, 59, 22, - /* 1740 */ 0, 59, 0, 0, 59, 0, 47, 47, 14, 381, - /* 1750 */ 177, 383, 0, 0, 0, 0, 0, 0, 414, 0, - /* 1760 */ 35, 66, 418, 0, 0, 421, 422, 423, 424, 425, - /* 1770 */ 426, 39, 428, 42, 47, 40, 39, 44, 333, 435, - /* 1780 */ 39, 35, 414, 439, 440, 0, 418, 49, 343, 421, - /* 1790 */ 422, 423, 424, 425, 426, 35, 428, 39, 49, 0, - /* 1800 */ 39, 333, 35, 435, 39, 0, 35, 439, 440, 0, - /* 1810 */ 0, 343, 39, 0, 369, 49, 0, 49, 35, 22, - /* 1820 */ 0, 35, 35, 35, 333, 35, 381, 35, 383, 35, - /* 1830 */ 35, 35, 0, 44, 343, 44, 35, 369, 35, 22, - /* 1840 */ 22, 0, 0, 22, 51, 22, 35, 333, 109, 381, - /* 1850 */ 0, 383, 0, 0, 107, 22, 20, 343, 0, 414, - /* 1860 */ 369, 35, 35, 418, 35, 374, 421, 422, 423, 424, - /* 1870 */ 425, 426, 381, 428, 383, 35, 101, 100, 35, 100, - /* 1880 */ 435, 193, 414, 369, 439, 440, 418, 22, 374, 421, - /* 1890 */ 422, 423, 424, 425, 426, 381, 428, 383, 35, 0, - /* 1900 */ 22, 0, 0, 435, 44, 414, 3, 100, 440, 418, - /* 1910 */ 333, 96, 421, 422, 423, 424, 425, 426, 170, 428, - /* 1920 */ 343, 256, 48, 101, 100, 48, 175, 47, 414, 98, - /* 1930 */ 168, 101, 418, 189, 44, 421, 422, 423, 424, 425, - /* 1940 */ 426, 44, 428, 47, 168, 101, 369, 100, 168, 100, - /* 1950 */ 44, 100, 44, 3, 44, 101, 100, 256, 381, 35, - /* 1960 */ 383, 35, 101, 101, 35, 35, 35, 35, 47, 101, - /* 1970 */ 101, 44, 47, 0, 0, 333, 0, 0, 39, 100, - /* 1980 */ 47, 100, 0, 101, 100, 343, 101, 100, 100, 100, - /* 1990 */ 171, 414, 39, 47, 169, 418, 333, 2, 421, 422, - /* 2000 */ 423, 424, 425, 426, 110, 428, 343, 44, 22, 333, - /* 2010 */ 98, 369, 98, 215, 47, 237, 100, 47, 101, 343, - /* 2020 */ 100, 22, 100, 381, 250, 383, 111, 35, 256, 101, - /* 2030 */ 22, 217, 369, 35, 44, 101, 100, 374, 100, 35, - /* 2040 */ 100, 464, 101, 101, 381, 369, 383, 100, 35, 101, - /* 2050 */ 101, 100, 100, 35, 35, 101, 414, 381, 100, 383, - /* 2060 */ 418, 101, 100, 421, 422, 423, 424, 425, 426, 100, - /* 2070 */ 428, 100, 35, 35, 65, 100, 66, 414, 122, 122, - /* 2080 */ 35, 418, 35, 333, 421, 422, 423, 424, 425, 426, - /* 2090 */ 414, 428, 35, 343, 418, 35, 35, 421, 422, 423, - /* 2100 */ 424, 425, 426, 333, 428, 122, 430, 122, 35, 35, - /* 2110 */ 35, 35, 72, 343, 44, 473, 94, 35, 35, 369, - /* 2120 */ 35, 22, 35, 35, 374, 35, 72, 35, 35, 35, - /* 2130 */ 35, 381, 35, 383, 22, 35, 0, 35, 49, 369, - /* 2140 */ 39, 0, 35, 39, 374, 49, 0, 49, 35, 39, - /* 2150 */ 0, 381, 35, 383, 49, 39, 0, 35, 35, 0, - /* 2160 */ 22, 21, 476, 21, 414, 22, 22, 20, 418, 476, - /* 2170 */ 476, 421, 422, 423, 424, 425, 426, 476, 428, 476, - /* 2180 */ 476, 476, 476, 476, 414, 476, 1, 476, 418, 476, - /* 2190 */ 476, 421, 422, 423, 424, 425, 426, 476, 428, 476, - /* 2200 */ 333, 476, 476, 476, 19, 476, 476, 476, 476, 476, - /* 2210 */ 343, 476, 476, 476, 476, 476, 333, 476, 33, 476, - /* 2220 */ 476, 476, 476, 476, 476, 476, 343, 476, 476, 476, - /* 2230 */ 476, 476, 476, 476, 49, 476, 369, 476, 476, 476, - /* 2240 */ 55, 56, 57, 58, 59, 476, 333, 476, 381, 476, - /* 2250 */ 383, 476, 369, 476, 476, 476, 343, 476, 476, 476, - /* 2260 */ 476, 476, 476, 476, 381, 476, 383, 476, 476, 476, - /* 2270 */ 476, 476, 476, 476, 476, 476, 333, 476, 476, 476, - /* 2280 */ 476, 414, 369, 476, 99, 418, 343, 102, 421, 422, - /* 2290 */ 423, 424, 425, 426, 381, 428, 383, 414, 476, 476, - /* 2300 */ 476, 418, 476, 476, 421, 422, 423, 424, 425, 426, - /* 2310 */ 476, 428, 369, 476, 476, 476, 476, 476, 476, 134, - /* 2320 */ 476, 476, 476, 476, 381, 476, 383, 414, 476, 476, - /* 2330 */ 476, 418, 476, 476, 421, 422, 423, 424, 425, 426, - /* 2340 */ 333, 428, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2350 */ 343, 476, 476, 333, 169, 476, 476, 414, 476, 174, - /* 2360 */ 476, 418, 476, 343, 421, 422, 423, 424, 425, 426, - /* 2370 */ 476, 428, 476, 476, 476, 476, 369, 476, 476, 194, - /* 2380 */ 476, 476, 476, 476, 476, 476, 476, 476, 381, 369, - /* 2390 */ 383, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2400 */ 476, 381, 476, 383, 333, 476, 476, 476, 476, 476, - /* 2410 */ 476, 476, 476, 476, 343, 476, 476, 333, 476, 476, - /* 2420 */ 476, 414, 476, 476, 476, 418, 476, 343, 421, 422, - /* 2430 */ 423, 424, 425, 426, 414, 428, 476, 476, 418, 476, - /* 2440 */ 369, 421, 422, 423, 424, 425, 426, 476, 428, 476, - /* 2450 */ 476, 476, 381, 369, 383, 476, 476, 476, 476, 476, - /* 2460 */ 476, 476, 476, 476, 476, 381, 476, 383, 476, 476, - /* 2470 */ 476, 476, 476, 476, 476, 476, 476, 476, 333, 476, - /* 2480 */ 476, 476, 476, 476, 476, 414, 476, 476, 343, 418, - /* 2490 */ 476, 476, 421, 422, 423, 424, 425, 426, 414, 428, - /* 2500 */ 476, 476, 418, 476, 476, 421, 422, 423, 424, 425, - /* 2510 */ 426, 476, 428, 476, 369, 476, 476, 476, 476, 476, - /* 2520 */ 476, 476, 476, 476, 476, 476, 381, 476, 383, 333, - /* 2530 */ 476, 476, 476, 476, 476, 476, 476, 476, 476, 343, - /* 2540 */ 476, 476, 476, 476, 333, 476, 476, 476, 476, 476, - /* 2550 */ 476, 476, 476, 476, 343, 476, 476, 476, 476, 414, - /* 2560 */ 476, 476, 476, 418, 476, 369, 421, 422, 423, 424, - /* 2570 */ 425, 426, 476, 428, 476, 476, 476, 381, 476, 383, - /* 2580 */ 369, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2590 */ 333, 476, 381, 476, 383, 476, 476, 476, 476, 476, - /* 2600 */ 343, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2610 */ 414, 476, 476, 476, 418, 476, 476, 421, 422, 423, - /* 2620 */ 424, 425, 426, 476, 428, 414, 369, 476, 476, 418, - /* 2630 */ 476, 476, 421, 422, 423, 424, 425, 426, 381, 428, - /* 2640 */ 383, 333, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2650 */ 476, 343, 476, 476, 476, 476, 476, 476, 333, 476, - /* 2660 */ 476, 476, 476, 476, 476, 476, 476, 476, 343, 476, - /* 2670 */ 476, 414, 476, 476, 476, 418, 476, 369, 421, 422, - /* 2680 */ 423, 424, 425, 426, 476, 428, 476, 333, 476, 381, - /* 2690 */ 476, 383, 476, 476, 369, 476, 476, 343, 476, 476, - /* 2700 */ 476, 476, 476, 476, 476, 476, 381, 476, 383, 476, - /* 2710 */ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2720 */ 476, 476, 414, 369, 476, 476, 418, 476, 476, 421, - /* 2730 */ 422, 423, 424, 425, 426, 381, 428, 383, 476, 414, - /* 2740 */ 476, 476, 476, 418, 476, 476, 421, 422, 423, 424, - /* 2750 */ 425, 426, 476, 428, 476, 333, 476, 476, 476, 476, - /* 2760 */ 476, 476, 476, 476, 476, 343, 476, 476, 414, 476, - /* 2770 */ 476, 476, 418, 476, 333, 421, 422, 423, 424, 425, - /* 2780 */ 426, 476, 428, 476, 343, 476, 476, 333, 476, 476, - /* 2790 */ 476, 369, 476, 476, 476, 476, 476, 343, 476, 476, - /* 2800 */ 476, 476, 476, 381, 476, 383, 476, 476, 476, 476, - /* 2810 */ 369, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2820 */ 476, 476, 381, 369, 383, 476, 476, 476, 476, 476, - /* 2830 */ 476, 476, 476, 476, 476, 381, 414, 383, 476, 476, - /* 2840 */ 418, 476, 476, 421, 422, 423, 424, 425, 426, 476, - /* 2850 */ 428, 476, 476, 476, 476, 414, 476, 476, 476, 418, - /* 2860 */ 333, 476, 421, 422, 423, 424, 425, 426, 414, 428, - /* 2870 */ 343, 476, 418, 333, 476, 421, 422, 423, 424, 425, - /* 2880 */ 426, 476, 428, 343, 476, 476, 476, 476, 333, 476, - /* 2890 */ 476, 476, 476, 476, 476, 476, 369, 476, 343, 476, - /* 2900 */ 476, 476, 476, 476, 476, 476, 476, 476, 381, 369, - /* 2910 */ 383, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 2920 */ 476, 381, 476, 383, 369, 476, 476, 476, 476, 476, - /* 2930 */ 476, 476, 476, 476, 333, 476, 381, 476, 383, 476, - /* 2940 */ 476, 414, 476, 476, 343, 418, 476, 476, 421, 422, - /* 2950 */ 423, 424, 425, 426, 414, 428, 476, 476, 418, 476, - /* 2960 */ 476, 421, 422, 423, 424, 425, 426, 476, 428, 414, - /* 2970 */ 369, 476, 476, 418, 476, 476, 421, 422, 423, 424, - /* 2980 */ 425, 426, 381, 428, 383, 476, 476, 476, 476, 476, - /* 2990 */ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 3000 */ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - /* 3010 */ 476, 476, 476, 476, 476, 414, 476, 476, 476, 418, - /* 3020 */ 476, 476, 421, 422, 423, 424, 425, 426, 476, 428, + /* 230 */ 230, 231, 232, 233, 234, 235, 236, 237, 12, 13, + /* 240 */ 22, 102, 4, 18, 433, 20, 20, 436, 22, 187, + /* 250 */ 20, 189, 27, 35, 83, 30, 344, 345, 33, 33, + /* 260 */ 21, 35, 371, 24, 25, 26, 27, 28, 29, 30, + /* 270 */ 31, 32, 103, 103, 49, 350, 51, 386, 216, 140, + /* 280 */ 55, 43, 217, 45, 46, 168, 169, 61, 69, 70, + /* 290 */ 71, 366, 74, 67, 279, 76, 77, 78, 371, 374, + /* 300 */ 74, 82, 259, 260, 261, 378, 87, 88, 89, 90, + /* 310 */ 254, 170, 93, 386, 143, 144, 254, 99, 66, 180, + /* 320 */ 181, 182, 20, 61, 185, 99, 101, 385, 102, 264, + /* 330 */ 265, 266, 267, 268, 269, 270, 20, 166, 113, 170, + /* 340 */ 384, 385, 400, 401, 4, 206, 357, 358, 209, 20, + /* 350 */ 373, 212, 213, 214, 215, 216, 444, 445, 446, 447, + /* 360 */ 383, 449, 450, 101, 138, 139, 104, 142, 61, 20, + /* 370 */ 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + /* 380 */ 155, 156, 157, 158, 159, 160, 161, 352, 163, 164, + /* 390 */ 165, 45, 46, 254, 168, 169, 419, 420, 421, 20, + /* 400 */ 174, 175, 449, 368, 102, 452, 188, 430, 190, 102, + /* 410 */ 20, 104, 377, 133, 188, 47, 190, 137, 102, 422, + /* 420 */ 467, 468, 102, 8, 9, 472, 473, 12, 13, 14, + /* 430 */ 15, 16, 112, 8, 9, 217, 218, 12, 13, 14, + /* 440 */ 15, 16, 102, 217, 218, 448, 220, 221, 222, 223, + /* 450 */ 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + /* 460 */ 234, 235, 236, 237, 238, 12, 13, 138, 139, 44, + /* 470 */ 102, 344, 0, 20, 99, 22, 381, 197, 198, 384, + /* 480 */ 385, 201, 67, 203, 20, 35, 33, 371, 35, 114, + /* 490 */ 115, 116, 117, 118, 119, 120, 121, 122, 123, 102, + /* 500 */ 125, 126, 127, 128, 129, 130, 183, 391, 392, 33, + /* 510 */ 344, 345, 335, 380, 61, 0, 383, 138, 139, 344, + /* 520 */ 67, 394, 345, 396, 74, 49, 111, 74, 362, 371, + /* 530 */ 207, 208, 56, 57, 58, 59, 21, 61, 344, 24, + /* 540 */ 25, 26, 27, 28, 29, 30, 31, 32, 371, 373, + /* 550 */ 392, 14, 99, 174, 175, 102, 254, 20, 168, 383, + /* 560 */ 383, 254, 385, 102, 340, 69, 70, 71, 344, 394, + /* 570 */ 346, 396, 76, 77, 78, 340, 335, 101, 82, 344, + /* 580 */ 104, 346, 167, 87, 88, 89, 90, 0, 394, 93, + /* 590 */ 396, 138, 139, 416, 254, 419, 420, 420, 344, 345, + /* 600 */ 423, 424, 425, 426, 427, 428, 430, 430, 371, 363, + /* 610 */ 113, 20, 435, 22, 437, 378, 362, 371, 441, 442, + /* 620 */ 422, 168, 169, 386, 383, 379, 332, 174, 175, 157, + /* 630 */ 371, 454, 344, 345, 170, 344, 345, 378, 166, 462, + /* 640 */ 0, 188, 238, 190, 53, 386, 448, 171, 172, 335, + /* 650 */ 362, 254, 176, 362, 178, 3, 241, 242, 243, 244, + /* 660 */ 245, 246, 247, 248, 249, 250, 251, 14, 15, 16, + /* 670 */ 217, 218, 196, 220, 221, 222, 223, 224, 225, 226, + /* 680 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + /* 690 */ 237, 12, 13, 14, 21, 74, 402, 383, 402, 20, + /* 700 */ 406, 22, 406, 373, 335, 168, 335, 34, 449, 36, + /* 710 */ 371, 452, 33, 383, 35, 254, 345, 378, 131, 132, + /* 720 */ 133, 134, 135, 136, 137, 386, 467, 468, 22, 8, + /* 730 */ 9, 472, 473, 12, 13, 14, 15, 16, 20, 363, + /* 740 */ 61, 35, 371, 449, 371, 449, 452, 371, 452, 419, + /* 750 */ 420, 378, 383, 74, 383, 379, 385, 22, 0, 386, + /* 760 */ 430, 467, 468, 467, 468, 345, 472, 473, 472, 473, + /* 770 */ 35, 131, 132, 133, 134, 135, 136, 137, 99, 49, + /* 780 */ 238, 102, 240, 335, 363, 402, 56, 416, 113, 59, + /* 790 */ 60, 420, 371, 345, 423, 424, 425, 426, 427, 428, + /* 800 */ 379, 430, 344, 345, 433, 99, 435, 436, 437, 389, + /* 810 */ 14, 44, 441, 442, 132, 2, 20, 138, 139, 371, + /* 820 */ 362, 8, 9, 422, 66, 12, 13, 14, 15, 16, + /* 830 */ 2, 383, 449, 385, 99, 452, 8, 9, 335, 335, + /* 840 */ 12, 13, 14, 15, 16, 344, 345, 168, 169, 448, + /* 850 */ 467, 468, 61, 174, 175, 472, 473, 1, 2, 0, + /* 860 */ 132, 133, 344, 345, 416, 137, 4, 188, 420, 190, + /* 870 */ 103, 423, 424, 425, 426, 427, 428, 434, 430, 436, + /* 880 */ 362, 199, 200, 435, 335, 437, 383, 383, 170, 441, + /* 890 */ 442, 170, 402, 335, 74, 104, 217, 218, 167, 220, + /* 900 */ 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + /* 910 */ 231, 232, 233, 234, 235, 236, 237, 12, 13, 352, + /* 920 */ 4, 371, 434, 402, 436, 20, 274, 22, 335, 379, + /* 930 */ 345, 345, 383, 335, 372, 19, 344, 345, 33, 449, + /* 940 */ 35, 383, 452, 345, 377, 402, 445, 446, 447, 33, + /* 950 */ 449, 450, 372, 380, 362, 335, 383, 467, 468, 103, + /* 960 */ 252, 253, 472, 473, 335, 49, 61, 344, 345, 371, + /* 970 */ 449, 55, 241, 452, 389, 389, 383, 61, 37, 74, + /* 980 */ 367, 383, 251, 385, 335, 362, 344, 345, 467, 468, + /* 990 */ 344, 345, 449, 472, 473, 452, 131, 132, 133, 134, + /* 1000 */ 135, 136, 137, 383, 99, 335, 39, 102, 362, 335, + /* 1010 */ 467, 468, 383, 335, 416, 472, 473, 101, 420, 345, + /* 1020 */ 104, 423, 424, 425, 426, 427, 428, 414, 430, 344, + /* 1030 */ 345, 44, 383, 435, 335, 437, 344, 345, 380, 441, + /* 1040 */ 442, 383, 44, 138, 139, 371, 105, 362, 107, 108, + /* 1050 */ 359, 110, 361, 383, 362, 335, 42, 383, 44, 385, + /* 1060 */ 462, 383, 335, 344, 345, 0, 344, 345, 344, 345, + /* 1070 */ 211, 335, 131, 168, 169, 364, 135, 0, 367, 174, + /* 1080 */ 175, 362, 383, 42, 362, 44, 362, 445, 446, 447, + /* 1090 */ 416, 449, 450, 188, 420, 190, 67, 423, 424, 425, + /* 1100 */ 426, 427, 428, 383, 430, 22, 344, 345, 131, 435, + /* 1110 */ 383, 437, 135, 113, 49, 441, 442, 255, 35, 383, + /* 1120 */ 44, 44, 217, 218, 362, 220, 221, 222, 223, 224, + /* 1130 */ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + /* 1140 */ 235, 236, 237, 12, 13, 344, 345, 344, 345, 35, + /* 1150 */ 44, 20, 106, 22, 106, 109, 13, 109, 344, 345, + /* 1160 */ 13, 0, 162, 362, 33, 362, 35, 335, 106, 106, + /* 1170 */ 44, 109, 109, 0, 0, 407, 362, 345, 35, 103, + /* 1180 */ 44, 372, 35, 22, 202, 48, 204, 138, 139, 35, + /* 1190 */ 335, 372, 61, 35, 44, 22, 22, 1, 2, 13, + /* 1200 */ 345, 13, 347, 371, 360, 74, 44, 44, 376, 103, + /* 1210 */ 372, 372, 372, 44, 44, 383, 336, 385, 0, 393, + /* 1220 */ 253, 35, 476, 35, 465, 44, 371, 44, 44, 103, + /* 1230 */ 99, 348, 74, 102, 44, 44, 459, 371, 383, 103, + /* 1240 */ 385, 335, 44, 44, 348, 393, 217, 343, 416, 382, + /* 1250 */ 44, 345, 420, 103, 44, 423, 424, 425, 426, 427, + /* 1260 */ 428, 393, 430, 276, 345, 103, 103, 451, 50, 138, + /* 1270 */ 139, 416, 103, 103, 469, 420, 278, 371, 423, 424, + /* 1280 */ 425, 426, 427, 428, 103, 430, 103, 103, 443, 383, + /* 1290 */ 435, 385, 437, 103, 103, 453, 441, 442, 256, 168, + /* 1300 */ 169, 103, 103, 418, 190, 174, 175, 170, 49, 103, + /* 1310 */ 417, 186, 404, 103, 42, 390, 20, 393, 390, 188, + /* 1320 */ 167, 190, 416, 388, 20, 344, 420, 344, 390, 423, + /* 1330 */ 424, 425, 426, 427, 428, 388, 430, 388, 100, 98, + /* 1340 */ 356, 355, 97, 344, 190, 354, 344, 344, 217, 218, + /* 1350 */ 344, 220, 221, 222, 223, 224, 225, 226, 227, 228, + /* 1360 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 335, + /* 1370 */ 464, 20, 337, 48, 341, 337, 20, 341, 352, 345, + /* 1380 */ 411, 347, 20, 352, 20, 346, 385, 20, 403, 352, + /* 1390 */ 346, 344, 352, 54, 337, 352, 335, 352, 371, 371, + /* 1400 */ 349, 349, 352, 371, 337, 371, 345, 383, 347, 205, + /* 1410 */ 344, 415, 102, 383, 194, 411, 193, 383, 413, 385, + /* 1420 */ 350, 410, 409, 350, 371, 371, 371, 371, 192, 371, + /* 1430 */ 371, 371, 371, 408, 344, 371, 458, 458, 263, 262, + /* 1440 */ 179, 461, 271, 477, 383, 273, 385, 458, 460, 457, + /* 1450 */ 416, 383, 383, 456, 420, 277, 385, 423, 424, 425, + /* 1460 */ 426, 427, 428, 383, 430, 393, 272, 393, 335, 435, + /* 1470 */ 383, 437, 383, 398, 257, 441, 442, 416, 345, 398, + /* 1480 */ 347, 420, 280, 471, 423, 424, 425, 426, 427, 428, + /* 1490 */ 275, 430, 470, 253, 345, 20, 435, 418, 437, 344, + /* 1500 */ 335, 350, 441, 442, 371, 346, 422, 350, 20, 396, + /* 1510 */ 345, 383, 347, 398, 398, 383, 383, 383, 385, 172, + /* 1520 */ 102, 383, 383, 383, 395, 345, 350, 367, 335, 350, + /* 1530 */ 102, 440, 36, 455, 412, 383, 371, 350, 345, 375, + /* 1540 */ 347, 344, 337, 361, 399, 338, 405, 399, 383, 416, + /* 1550 */ 385, 0, 333, 420, 365, 0, 423, 424, 425, 426, + /* 1560 */ 427, 428, 351, 430, 371, 365, 365, 0, 435, 42, + /* 1570 */ 437, 0, 35, 35, 441, 442, 383, 35, 385, 210, + /* 1580 */ 35, 416, 210, 0, 35, 420, 210, 35, 423, 424, + /* 1590 */ 425, 426, 427, 428, 0, 430, 210, 0, 35, 0, + /* 1600 */ 435, 0, 437, 22, 12, 13, 441, 442, 35, 416, + /* 1610 */ 197, 190, 188, 420, 22, 0, 423, 424, 425, 426, + /* 1620 */ 427, 428, 1, 430, 0, 33, 335, 35, 435, 0, + /* 1630 */ 437, 184, 183, 0, 441, 442, 345, 0, 47, 0, + /* 1640 */ 19, 0, 0, 0, 42, 0, 0, 0, 0, 0, + /* 1650 */ 0, 0, 157, 61, 33, 35, 0, 157, 0, 0, + /* 1660 */ 0, 0, 371, 141, 42, 0, 74, 0, 0, 0, + /* 1670 */ 49, 0, 0, 0, 383, 0, 385, 56, 57, 58, + /* 1680 */ 59, 0, 61, 0, 0, 0, 0, 0, 0, 0, + /* 1690 */ 0, 99, 22, 0, 0, 0, 0, 0, 335, 0, + /* 1700 */ 22, 48, 22, 48, 0, 61, 0, 416, 345, 35, + /* 1710 */ 0, 420, 0, 61, 423, 424, 425, 426, 427, 428, + /* 1720 */ 0, 430, 101, 61, 0, 104, 435, 0, 437, 0, + /* 1730 */ 39, 49, 441, 442, 371, 35, 35, 0, 35, 14, + /* 1740 */ 0, 39, 35, 0, 0, 0, 383, 49, 385, 179, + /* 1750 */ 39, 42, 39, 0, 49, 47, 39, 136, 44, 40, + /* 1760 */ 39, 0, 47, 47, 0, 0, 0, 35, 0, 39, + /* 1770 */ 35, 49, 49, 39, 0, 39, 35, 49, 0, 416, + /* 1780 */ 188, 35, 190, 420, 0, 0, 423, 424, 425, 426, + /* 1790 */ 427, 428, 171, 430, 68, 39, 335, 176, 49, 0, + /* 1800 */ 437, 22, 35, 0, 441, 442, 345, 0, 35, 217, + /* 1810 */ 218, 35, 35, 44, 44, 35, 35, 196, 35, 22, + /* 1820 */ 335, 35, 230, 231, 232, 233, 234, 235, 236, 111, + /* 1830 */ 345, 35, 371, 35, 0, 35, 22, 0, 22, 0, + /* 1840 */ 109, 51, 22, 35, 383, 0, 385, 35, 0, 0, + /* 1850 */ 35, 22, 20, 103, 35, 0, 371, 35, 35, 102, + /* 1860 */ 102, 195, 35, 22, 0, 22, 0, 191, 383, 0, + /* 1870 */ 385, 3, 44, 102, 258, 103, 258, 416, 48, 48, + /* 1880 */ 44, 420, 100, 3, 423, 424, 425, 426, 427, 428, + /* 1890 */ 98, 430, 103, 102, 335, 44, 103, 102, 437, 47, + /* 1900 */ 44, 416, 441, 442, 345, 420, 102, 102, 423, 424, + /* 1910 */ 425, 426, 427, 428, 335, 430, 177, 170, 170, 47, + /* 1920 */ 103, 44, 437, 172, 345, 170, 441, 442, 102, 35, + /* 1930 */ 371, 44, 35, 35, 35, 258, 103, 47, 103, 35, + /* 1940 */ 35, 103, 383, 103, 385, 44, 0, 47, 0, 0, + /* 1950 */ 371, 0, 102, 39, 47, 102, 0, 103, 39, 112, + /* 1960 */ 103, 102, 383, 102, 385, 102, 44, 173, 47, 102, + /* 1970 */ 100, 100, 239, 171, 2, 416, 22, 217, 102, 420, + /* 1980 */ 47, 103, 423, 424, 425, 426, 427, 428, 102, 430, + /* 1990 */ 252, 103, 103, 102, 102, 416, 103, 102, 335, 420, + /* 2000 */ 47, 22, 423, 424, 425, 426, 427, 428, 345, 430, + /* 2010 */ 102, 35, 103, 35, 102, 35, 113, 35, 35, 103, + /* 2020 */ 102, 35, 463, 464, 35, 219, 103, 335, 102, 44, + /* 2030 */ 103, 102, 22, 103, 371, 124, 102, 345, 102, 102, + /* 2040 */ 102, 124, 68, 35, 124, 74, 383, 35, 385, 124, + /* 2050 */ 35, 67, 35, 474, 475, 35, 35, 35, 35, 35, + /* 2060 */ 35, 96, 44, 371, 35, 35, 35, 22, 376, 35, + /* 2070 */ 35, 35, 74, 35, 35, 383, 35, 385, 35, 416, + /* 2080 */ 22, 35, 35, 420, 0, 35, 423, 424, 425, 426, + /* 2090 */ 427, 428, 39, 430, 0, 35, 39, 49, 49, 0, + /* 2100 */ 437, 35, 39, 49, 0, 442, 35, 39, 416, 0, + /* 2110 */ 49, 35, 420, 35, 0, 423, 424, 425, 426, 427, + /* 2120 */ 428, 21, 430, 335, 22, 22, 478, 22, 21, 478, + /* 2130 */ 20, 478, 478, 345, 478, 478, 335, 478, 478, 478, + /* 2140 */ 478, 478, 478, 478, 478, 478, 345, 478, 478, 478, + /* 2150 */ 478, 478, 478, 335, 478, 478, 478, 478, 478, 371, + /* 2160 */ 478, 478, 478, 345, 478, 478, 478, 478, 478, 478, + /* 2170 */ 478, 383, 371, 385, 478, 478, 478, 478, 478, 478, + /* 2180 */ 478, 478, 478, 478, 383, 478, 385, 478, 478, 371, + /* 2190 */ 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2200 */ 478, 383, 478, 385, 416, 478, 478, 478, 420, 478, + /* 2210 */ 478, 423, 424, 425, 426, 427, 428, 416, 430, 478, + /* 2220 */ 335, 420, 478, 478, 423, 424, 425, 426, 427, 428, + /* 2230 */ 345, 430, 478, 478, 416, 478, 478, 335, 420, 478, + /* 2240 */ 478, 423, 424, 425, 426, 427, 428, 345, 430, 478, + /* 2250 */ 335, 478, 478, 478, 466, 478, 371, 478, 478, 478, + /* 2260 */ 345, 376, 478, 478, 478, 478, 478, 478, 383, 478, + /* 2270 */ 385, 478, 478, 371, 478, 478, 475, 478, 478, 478, + /* 2280 */ 478, 478, 478, 478, 478, 383, 371, 385, 478, 478, + /* 2290 */ 478, 376, 478, 478, 478, 478, 478, 478, 383, 478, + /* 2300 */ 385, 416, 478, 478, 478, 420, 478, 478, 423, 424, + /* 2310 */ 425, 426, 427, 428, 478, 430, 478, 478, 416, 478, + /* 2320 */ 478, 478, 420, 335, 478, 423, 424, 425, 426, 427, + /* 2330 */ 428, 416, 430, 345, 432, 420, 478, 478, 423, 424, + /* 2340 */ 425, 426, 427, 428, 335, 430, 478, 478, 478, 478, + /* 2350 */ 478, 478, 478, 478, 345, 478, 478, 478, 478, 371, + /* 2360 */ 478, 478, 478, 478, 376, 478, 478, 478, 478, 478, + /* 2370 */ 478, 383, 478, 385, 478, 478, 478, 478, 478, 478, + /* 2380 */ 371, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2390 */ 335, 478, 383, 478, 385, 478, 478, 478, 478, 478, + /* 2400 */ 345, 478, 478, 478, 416, 478, 478, 478, 420, 478, + /* 2410 */ 478, 423, 424, 425, 426, 427, 428, 478, 430, 478, + /* 2420 */ 478, 478, 478, 478, 478, 416, 371, 478, 478, 420, + /* 2430 */ 478, 478, 423, 424, 425, 426, 427, 428, 383, 430, + /* 2440 */ 385, 335, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2450 */ 478, 345, 478, 478, 335, 478, 478, 478, 478, 478, + /* 2460 */ 478, 478, 478, 478, 345, 478, 478, 478, 478, 478, + /* 2470 */ 478, 416, 478, 478, 478, 420, 478, 371, 423, 424, + /* 2480 */ 425, 426, 427, 428, 478, 430, 478, 478, 478, 383, + /* 2490 */ 371, 385, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2500 */ 478, 478, 383, 478, 385, 478, 478, 478, 478, 478, + /* 2510 */ 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2520 */ 478, 478, 416, 478, 478, 478, 420, 478, 478, 423, + /* 2530 */ 424, 425, 426, 427, 428, 416, 430, 478, 478, 420, + /* 2540 */ 335, 478, 423, 424, 425, 426, 427, 428, 478, 430, + /* 2550 */ 345, 478, 478, 335, 478, 478, 478, 478, 478, 478, + /* 2560 */ 478, 478, 478, 345, 478, 478, 478, 478, 478, 478, + /* 2570 */ 335, 478, 478, 478, 478, 478, 371, 478, 478, 478, + /* 2580 */ 345, 478, 478, 478, 478, 478, 478, 478, 383, 371, + /* 2590 */ 385, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2600 */ 478, 383, 478, 385, 335, 478, 371, 478, 478, 478, + /* 2610 */ 478, 478, 478, 478, 345, 478, 478, 478, 383, 478, + /* 2620 */ 385, 416, 478, 478, 478, 420, 478, 478, 423, 424, + /* 2630 */ 425, 426, 427, 428, 416, 430, 478, 478, 420, 478, + /* 2640 */ 371, 423, 424, 425, 426, 427, 428, 478, 430, 478, + /* 2650 */ 478, 416, 383, 478, 385, 420, 478, 478, 423, 424, + /* 2660 */ 425, 426, 427, 428, 335, 430, 478, 478, 478, 478, + /* 2670 */ 478, 478, 478, 478, 345, 478, 478, 335, 478, 478, + /* 2680 */ 478, 478, 478, 478, 478, 416, 478, 345, 478, 420, + /* 2690 */ 478, 478, 423, 424, 425, 426, 427, 428, 478, 430, + /* 2700 */ 371, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2710 */ 478, 478, 383, 371, 385, 478, 478, 478, 478, 478, + /* 2720 */ 478, 478, 478, 478, 478, 383, 478, 385, 335, 478, + /* 2730 */ 478, 478, 478, 478, 478, 478, 478, 478, 345, 478, + /* 2740 */ 478, 478, 478, 478, 478, 416, 478, 478, 478, 420, + /* 2750 */ 335, 478, 423, 424, 425, 426, 427, 428, 416, 430, + /* 2760 */ 345, 478, 420, 478, 371, 423, 424, 425, 426, 427, + /* 2770 */ 428, 478, 430, 478, 335, 478, 383, 478, 385, 478, + /* 2780 */ 478, 478, 478, 478, 345, 478, 371, 478, 478, 478, + /* 2790 */ 478, 478, 478, 478, 478, 478, 478, 478, 383, 478, + /* 2800 */ 385, 478, 478, 478, 478, 478, 478, 478, 478, 416, + /* 2810 */ 371, 478, 478, 420, 478, 478, 423, 424, 425, 426, + /* 2820 */ 427, 428, 383, 430, 385, 478, 478, 478, 478, 478, + /* 2830 */ 478, 416, 478, 478, 478, 420, 478, 478, 423, 424, + /* 2840 */ 425, 426, 427, 428, 478, 430, 478, 478, 478, 478, + /* 2850 */ 478, 478, 478, 478, 478, 416, 478, 478, 335, 420, + /* 2860 */ 478, 478, 423, 424, 425, 426, 427, 428, 345, 430, + /* 2870 */ 478, 335, 478, 478, 478, 478, 478, 478, 478, 478, + /* 2880 */ 478, 345, 478, 478, 478, 478, 335, 478, 478, 478, + /* 2890 */ 478, 478, 478, 478, 371, 478, 345, 478, 478, 478, + /* 2900 */ 478, 478, 478, 478, 478, 478, 383, 371, 385, 478, + /* 2910 */ 478, 478, 478, 478, 478, 478, 478, 478, 478, 383, + /* 2920 */ 478, 385, 371, 478, 478, 478, 478, 478, 478, 478, + /* 2930 */ 478, 478, 478, 478, 383, 478, 385, 478, 478, 416, + /* 2940 */ 478, 478, 478, 420, 478, 478, 423, 424, 425, 426, + /* 2950 */ 427, 428, 416, 430, 478, 478, 420, 478, 478, 423, + /* 2960 */ 424, 425, 426, 427, 428, 478, 430, 416, 478, 478, + /* 2970 */ 335, 420, 478, 478, 423, 424, 425, 426, 427, 428, + /* 2980 */ 345, 430, 478, 478, 478, 478, 478, 335, 478, 478, + /* 2990 */ 478, 478, 478, 478, 478, 478, 478, 345, 478, 478, + /* 3000 */ 335, 478, 478, 478, 478, 478, 371, 478, 478, 478, + /* 3010 */ 345, 478, 478, 478, 478, 478, 478, 478, 383, 478, + /* 3020 */ 385, 335, 478, 371, 478, 478, 478, 478, 478, 478, + /* 3030 */ 478, 345, 478, 478, 478, 383, 371, 385, 478, 478, + /* 3040 */ 478, 478, 478, 478, 478, 478, 478, 478, 383, 478, + /* 3050 */ 385, 416, 478, 478, 478, 420, 478, 371, 423, 424, + /* 3060 */ 425, 426, 427, 428, 478, 430, 478, 478, 416, 383, + /* 3070 */ 478, 385, 420, 478, 478, 423, 424, 425, 426, 427, + /* 3080 */ 428, 416, 430, 478, 478, 420, 335, 478, 423, 424, + /* 3090 */ 425, 426, 427, 428, 478, 430, 345, 478, 478, 478, + /* 3100 */ 478, 478, 416, 478, 478, 478, 420, 478, 478, 423, + /* 3110 */ 424, 425, 426, 427, 428, 478, 430, 478, 478, 478, + /* 3120 */ 478, 478, 371, 478, 478, 478, 478, 478, 478, 478, + /* 3130 */ 478, 478, 478, 478, 383, 478, 385, 478, 478, 478, + /* 3140 */ 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 3150 */ 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + /* 3160 */ 478, 478, 478, 478, 478, 478, 478, 416, 478, 478, + /* 3170 */ 478, 420, 478, 478, 423, 424, 425, 426, 427, 428, + /* 3180 */ 478, 430, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3190 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3200 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3210 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3220 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3230 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3240 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3250 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3260 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3270 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3280 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3290 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3300 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3310 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3320 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3330 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3340 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3350 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3360 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3370 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3380 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3390 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3400 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3410 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3420 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3430 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3440 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3450 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3460 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3470 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3480 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3490 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3500 */ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + /* 3510 */ 332, 332, 332, 332, }; -#define YY_SHIFT_COUNT (761) +#define YY_SHIFT_COUNT (776) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2185) +#define YY_SHIFT_MAX (2114) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 550, 0, 224, 0, 449, 449, 449, 449, 449, 449, - /* 10 */ 449, 449, 449, 449, 449, 449, 673, 897, 897, 1121, - /* 20 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, - /* 30 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, - /* 40 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, - /* 50 */ 897, 452, 457, 142, 145, 147, 30, 107, 30, 145, - /* 60 */ 145, 1347, 30, 1347, 1347, 501, 30, 56, 447, 344, - /* 70 */ 344, 447, 235, 235, 18, 286, 150, 150, 344, 344, - /* 80 */ 344, 344, 344, 344, 344, 369, 344, 344, 412, 56, - /* 90 */ 344, 344, 484, 344, 56, 344, 369, 344, 369, 56, - /* 100 */ 344, 344, 56, 344, 56, 56, 56, 344, 538, 223, - /* 110 */ 189, 189, 333, 114, 443, 443, 443, 443, 443, 443, - /* 120 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, - /* 130 */ 443, 443, 443, 843, 325, 18, 286, 392, 1, 1, - /* 140 */ 1, 539, 273, 273, 392, 627, 627, 627, 412, 615, - /* 150 */ 529, 56, 699, 56, 699, 699, 715, 778, 35, 35, - /* 160 */ 35, 35, 35, 35, 35, 35, 2185, 217, 288, 483, - /* 170 */ 522, 260, 313, 243, 536, 1032, 490, 646, 868, 616, - /* 180 */ 602, 916, 829, 60, 422, 829, 966, 939, 994, 1110, - /* 190 */ 1317, 1190, 1334, 1365, 1334, 1224, 1372, 1372, 1334, 1224, - /* 200 */ 1224, 1303, 1309, 1372, 1316, 1372, 1372, 1372, 1393, 1373, - /* 210 */ 1393, 1373, 1405, 412, 1408, 412, 1411, 1412, 412, 1411, - /* 220 */ 412, 412, 412, 1372, 412, 1385, 1385, 1393, 56, 56, - /* 230 */ 56, 56, 56, 56, 56, 56, 56, 56, 56, 1372, - /* 240 */ 1393, 699, 699, 699, 1258, 1364, 1405, 538, 1301, 1304, - /* 250 */ 1408, 538, 1308, 1372, 1365, 1365, 699, 1241, 1248, 699, - /* 260 */ 1241, 1248, 699, 699, 56, 1250, 1346, 1241, 1255, 1257, - /* 270 */ 1274, 1110, 1254, 1259, 1265, 1288, 627, 1522, 1372, 1411, - /* 280 */ 538, 538, 1528, 1248, 699, 699, 699, 699, 699, 1248, - /* 290 */ 699, 1382, 538, 715, 538, 627, 1485, 1489, 699, 778, - /* 300 */ 1372, 538, 1564, 1393, 3030, 3030, 3030, 3030, 3030, 3030, - /* 310 */ 3030, 3030, 3030, 34, 430, 15, 590, 734, 16, 839, - /* 320 */ 79, 709, 792, 566, 856, 1023, 1023, 1023, 1023, 1023, - /* 330 */ 1023, 1023, 1023, 1023, 1167, 743, 253, 253, 402, 57, - /* 340 */ 441, 414, 838, 1040, 934, 636, 64, 64, 638, 606, - /* 350 */ 903, 638, 638, 638, 417, 927, 1007, 1070, 1067, 1057, - /* 360 */ 1138, 967, 1071, 1072, 1092, 1156, 1168, 1185, 1219, 1223, - /* 370 */ 1000, 1145, 1170, 431, 1171, 1172, 1176, 1089, 1117, 1105, - /* 380 */ 809, 1189, 1204, 1207, 1212, 1216, 1217, 1229, 1231, 1142, - /* 390 */ 1208, 1187, 1234, 1203, 1267, 1270, 1272, 1277, 1289, 1294, - /* 400 */ 190, 1299, 1348, 668, 1320, 1613, 1616, 1617, 1576, 1619, - /* 410 */ 1585, 1414, 1589, 1590, 1591, 1419, 1628, 1595, 1596, 1424, - /* 420 */ 1633, 1426, 1635, 1601, 1637, 1618, 1638, 1604, 1447, 1456, - /* 430 */ 1459, 1646, 1647, 1648, 1467, 1469, 1651, 1652, 1606, 1655, - /* 440 */ 1656, 1657, 1625, 1659, 1660, 1669, 1670, 1671, 1672, 1689, - /* 450 */ 1690, 1521, 1661, 1691, 1537, 1694, 1697, 1698, 1702, 1703, - /* 460 */ 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1712, 1714, 1715, - /* 470 */ 1716, 1675, 1718, 1719, 1720, 1721, 1722, 1723, 1711, 1724, - /* 480 */ 1726, 1728, 1592, 1729, 1730, 1713, 1684, 1717, 1686, 1736, - /* 490 */ 1679, 1725, 1740, 1682, 1742, 1685, 1743, 1745, 1731, 1732, - /* 500 */ 1733, 1699, 1700, 1734, 1727, 1752, 1735, 1737, 1753, 1754, - /* 510 */ 1755, 1741, 1573, 1756, 1757, 1759, 1695, 1763, 1764, 1746, - /* 520 */ 1738, 1758, 1785, 1760, 1749, 1761, 1799, 1767, 1766, 1765, - /* 530 */ 1805, 1771, 1768, 1773, 1809, 1810, 1813, 1816, 1739, 1747, - /* 540 */ 1783, 1797, 1820, 1786, 1787, 1788, 1790, 1792, 1794, 1795, - /* 550 */ 1789, 1791, 1796, 1801, 1817, 1803, 1832, 1818, 1841, 1821, - /* 560 */ 1793, 1842, 1823, 1811, 1850, 1826, 1852, 1827, 1853, 1833, - /* 570 */ 1836, 1829, 1840, 1843, 1775, 1777, 1858, 1762, 1779, 1688, - /* 580 */ 1863, 1865, 1899, 1744, 1878, 1776, 1748, 1901, 1902, 1780, - /* 590 */ 1751, 1903, 1860, 1665, 1807, 1822, 1824, 1874, 1831, 1877, - /* 600 */ 1815, 1830, 1890, 1897, 1844, 1847, 1849, 1851, 1854, 1906, - /* 610 */ 1880, 1896, 1856, 1908, 1701, 1861, 1862, 1950, 1910, 1772, - /* 620 */ 1924, 1926, 1929, 1930, 1931, 1932, 1868, 1869, 1921, 1774, - /* 630 */ 1927, 1925, 1973, 1974, 1976, 1977, 1879, 1939, 1699, 1933, - /* 640 */ 1881, 1882, 1885, 1884, 1887, 1819, 1888, 1982, 1953, 1825, - /* 650 */ 1889, 1894, 1699, 1946, 1963, 1912, 1778, 1914, 1995, 1986, - /* 660 */ 1798, 1916, 1917, 1920, 1928, 1922, 1934, 1967, 1936, 1938, - /* 670 */ 1970, 1941, 1999, 1814, 1940, 1915, 1942, 1992, 1998, 1947, - /* 680 */ 1948, 2004, 1951, 1949, 2013, 1952, 1954, 2018, 1958, 1960, - /* 690 */ 2019, 1962, 1956, 1957, 1983, 1985, 1969, 1990, 1971, 2037, - /* 700 */ 1975, 1990, 1990, 2008, 2010, 2009, 2038, 2045, 2047, 2057, - /* 710 */ 2060, 2061, 2073, 2074, 2075, 2076, 2040, 2022, 2070, 2082, - /* 720 */ 2083, 2085, 2099, 2087, 2088, 2090, 2054, 1789, 2092, 1791, - /* 730 */ 2093, 2094, 2095, 2097, 2112, 2100, 2136, 2102, 2089, 2101, - /* 740 */ 2141, 2107, 2096, 2104, 2146, 2113, 2098, 2110, 2150, 2117, - /* 750 */ 2105, 2116, 2156, 2122, 2123, 2159, 2138, 2140, 2143, 2144, - /* 760 */ 2142, 2147, + /* 0 */ 139, 0, 226, 0, 453, 453, 453, 453, 453, 453, + /* 10 */ 453, 453, 453, 453, 453, 453, 679, 905, 905, 1131, + /* 20 */ 905, 905, 905, 905, 905, 905, 905, 905, 905, 905, + /* 30 */ 905, 905, 905, 905, 905, 905, 905, 905, 905, 905, + /* 40 */ 905, 905, 905, 905, 905, 905, 905, 905, 905, 905, + /* 50 */ 905, 56, 302, 62, 316, 307, 397, 461, 397, 316, + /* 60 */ 316, 1592, 397, 1592, 1592, 340, 397, 48, 379, 126, + /* 70 */ 126, 379, 238, 238, 117, 329, 18, 18, 126, 126, + /* 80 */ 126, 126, 126, 126, 126, 167, 126, 126, 70, 48, + /* 90 */ 126, 126, 230, 126, 48, 126, 167, 126, 167, 48, + /* 100 */ 126, 126, 48, 126, 48, 48, 48, 126, 252, 225, + /* 110 */ 415, 415, 496, 239, 218, 218, 218, 218, 218, 218, + /* 120 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 130 */ 218, 218, 218, 941, 169, 117, 329, 450, 141, 141, + /* 140 */ 141, 758, 542, 542, 450, 349, 349, 349, 70, 497, + /* 150 */ 404, 48, 621, 48, 621, 621, 675, 820, 375, 375, + /* 160 */ 375, 375, 375, 375, 375, 375, 1621, 219, 515, 44, + /* 170 */ 15, 65, 120, 43, 26, 537, 591, 464, 346, 796, + /* 180 */ 977, 718, 708, 967, 652, 708, 1014, 862, 390, 1042, + /* 190 */ 1259, 1125, 1272, 1296, 1272, 1153, 1304, 1304, 1272, 1153, + /* 200 */ 1153, 1238, 1241, 1304, 1245, 1304, 1304, 1304, 1351, 1325, + /* 210 */ 1351, 1325, 1356, 70, 1362, 70, 1364, 1367, 70, 1364, + /* 220 */ 70, 70, 70, 1304, 70, 1339, 1339, 1351, 48, 48, + /* 230 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 1304, + /* 240 */ 1351, 621, 621, 621, 1204, 1310, 1356, 252, 1220, 1223, + /* 250 */ 1362, 252, 1236, 1304, 1296, 1296, 621, 1175, 1177, 621, + /* 260 */ 1175, 1177, 621, 621, 48, 1171, 1261, 1175, 1172, 1194, + /* 270 */ 1217, 1042, 1202, 1178, 1215, 1240, 349, 1475, 1304, 1364, + /* 280 */ 252, 252, 1488, 1177, 621, 621, 621, 621, 621, 1177, + /* 290 */ 621, 1347, 252, 675, 252, 349, 1418, 1428, 621, 820, + /* 300 */ 1304, 252, 1496, 1351, 3182, 3182, 3182, 3182, 3182, 3182, + /* 310 */ 3182, 3182, 3182, 34, 476, 181, 916, 57, 425, 170, + /* 320 */ 587, 813, 828, 721, 640, 184, 184, 184, 184, 184, + /* 330 */ 184, 184, 184, 184, 865, 280, 3, 3, 171, 730, + /* 340 */ 323, 472, 262, 706, 735, 673, 682, 728, 728, 653, + /* 350 */ 856, 731, 653, 653, 653, 1065, 859, 38, 1083, 1041, + /* 360 */ 1000, 1077, 1046, 1048, 1062, 1063, 1143, 1147, 1161, 1173, + /* 370 */ 1174, 982, 767, 1076, 791, 1106, 1126, 1136, 1049, 987, + /* 380 */ 998, 1137, 1162, 1163, 1169, 1170, 1181, 1183, 1196, 1184, + /* 390 */ 1114, 1154, 1029, 1150, 368, 1190, 1191, 1198, 1199, 1206, + /* 400 */ 1210, 320, 1186, 1188, 1158, 1218, 1551, 1555, 1567, 1527, + /* 410 */ 1571, 1537, 1369, 1538, 1542, 1545, 1372, 1583, 1549, 1552, + /* 420 */ 1376, 1594, 1386, 1597, 1563, 1599, 1581, 1601, 1573, 1413, + /* 430 */ 1421, 1424, 1615, 1624, 1629, 1447, 1449, 1633, 1637, 1591, + /* 440 */ 1639, 1641, 1642, 1602, 1643, 1645, 1646, 1647, 1648, 1649, + /* 450 */ 1650, 1651, 1495, 1620, 1656, 1500, 1658, 1659, 1660, 1661, + /* 460 */ 1667, 1668, 1669, 1671, 1672, 1673, 1675, 1681, 1683, 1684, + /* 470 */ 1685, 1686, 1622, 1665, 1687, 1688, 1689, 1690, 1699, 1670, + /* 480 */ 1693, 1694, 1695, 1522, 1696, 1697, 1678, 1653, 1680, 1655, + /* 490 */ 1704, 1644, 1674, 1706, 1652, 1710, 1662, 1712, 1720, 1700, + /* 500 */ 1682, 1691, 1724, 1701, 1698, 1702, 1727, 1703, 1705, 1711, + /* 510 */ 1729, 1707, 1737, 1709, 1713, 1714, 1708, 1715, 1725, 1716, + /* 520 */ 1740, 1719, 1717, 1743, 1744, 1745, 1721, 1570, 1753, 1761, + /* 530 */ 1764, 1726, 1765, 1766, 1732, 1722, 1730, 1768, 1735, 1723, + /* 540 */ 1734, 1774, 1741, 1728, 1736, 1778, 1746, 1749, 1756, 1784, + /* 550 */ 1785, 1799, 1807, 1718, 1731, 1767, 1779, 1803, 1773, 1776, + /* 560 */ 1777, 1780, 1781, 1783, 1786, 1769, 1770, 1796, 1798, 1797, + /* 570 */ 1800, 1834, 1814, 1837, 1816, 1790, 1839, 1820, 1808, 1845, + /* 580 */ 1812, 1848, 1815, 1849, 1829, 1832, 1819, 1822, 1823, 1750, + /* 590 */ 1757, 1855, 1747, 1758, 1666, 1827, 1841, 1864, 1676, 1843, + /* 600 */ 1748, 1751, 1866, 1869, 1755, 1739, 1868, 1828, 1616, 1771, + /* 610 */ 1772, 1791, 1830, 1782, 1831, 1792, 1789, 1836, 1851, 1793, + /* 620 */ 1795, 1804, 1805, 1817, 1856, 1852, 1872, 1826, 1887, 1618, + /* 630 */ 1833, 1835, 1880, 1877, 1677, 1894, 1897, 1898, 1899, 1904, + /* 640 */ 1905, 1838, 1840, 1890, 1738, 1901, 1900, 1946, 1948, 1949, + /* 650 */ 1951, 1850, 1914, 1708, 1907, 1853, 1854, 1857, 1859, 1861, + /* 660 */ 1794, 1863, 1956, 1919, 1802, 1867, 1847, 1708, 1921, 1922, + /* 670 */ 1870, 1733, 1871, 1972, 1954, 1760, 1876, 1878, 1886, 1888, + /* 680 */ 1891, 1889, 1933, 1892, 1895, 1953, 1893, 1979, 1806, 1908, + /* 690 */ 1903, 1909, 1976, 1978, 1912, 1916, 1980, 1918, 1923, 1982, + /* 700 */ 1926, 1927, 1983, 1929, 1930, 1986, 1934, 1911, 1917, 1920, + /* 710 */ 1925, 1936, 1985, 1937, 1989, 1938, 1985, 1985, 2010, 1974, + /* 720 */ 1984, 2008, 2012, 2015, 2017, 2020, 2021, 2022, 2023, 2024, + /* 730 */ 2025, 1971, 1965, 2018, 2029, 2030, 2031, 2045, 2034, 2035, + /* 740 */ 2036, 1998, 1769, 2038, 1770, 2039, 2041, 2043, 2046, 2058, + /* 750 */ 2047, 2084, 2050, 2048, 2053, 2094, 2060, 2049, 2057, 2099, + /* 760 */ 2066, 2054, 2063, 2104, 2071, 2061, 2068, 2109, 2076, 2078, + /* 770 */ 2114, 2102, 2100, 2103, 2105, 2107, 2110, }; #define YY_REDUCE_COUNT (312) -#define YY_REDUCE_MIN (-396) -#define YY_REDUCE_MAX (2601) +#define YY_REDUCE_MIN (-447) +#define YY_REDUCE_MAX (2751) static const short yy_reduce_ofst[] = { - /* 0 */ -140, 137, -82, 358, 444, 578, 814, 841, 1034, 1064, - /* 10 */ 1132, 1240, 1260, 1344, 1368, 1445, 598, -333, 672, 1468, - /* 20 */ 901, 1491, 1514, 1577, 1642, 1663, 1676, 1750, 1770, 1867, - /* 30 */ 1883, 1913, 1943, 2007, 2020, 2071, 2084, 2145, 2196, 2211, - /* 40 */ 2257, 2308, 2325, 2354, 2422, 2441, 2454, 2527, 2540, 2555, - /* 50 */ 2601, 372, -195, -396, -265, 487, 595, 607, 701, 481, - /* 60 */ 761, -362, 191, -365, 136, -279, -55, 256, -372, -167, - /* 70 */ -5, -381, -273, -257, 14, -321, -337, 203, 45, 285, - /* 80 */ 300, 356, 377, 409, 425, 177, 432, 489, 446, 279, - /* 90 */ 521, 573, 125, 620, 321, 622, 396, 687, 436, 257, - /* 100 */ 707, 716, 460, 739, 434, 506, 679, 746, -266, 8, - /* 110 */ -350, -350, 123, -261, 265, 363, 579, 585, 612, 617, - /* 120 */ 710, 754, 769, 774, 777, 781, 806, 807, 813, 820, - /* 130 */ 830, 831, 832, -331, -289, -111, -249, -61, -289, 290, - /* 140 */ 563, -25, -338, 158, 357, -147, 498, 533, -102, 202, - /* 150 */ 324, 29, 378, 502, 593, 597, 808, 236, -367, 552, - /* 160 */ 584, 603, 614, 674, 857, 614, 785, 871, 945, 877, - /* 170 */ 811, 823, 937, 834, 920, 920, 946, 904, 963, 985, - /* 180 */ 926, 919, 882, 882, 890, 882, 917, 911, 920, 949, - /* 190 */ 957, 973, 996, 995, 999, 1002, 1051, 1052, 1010, 1013, - /* 200 */ 1014, 1050, 1055, 1068, 1060, 1074, 1076, 1078, 1079, 1083, - /* 210 */ 1088, 1085, 1017, 1077, 1046, 1080, 1090, 1035, 1087, 1091, - /* 220 */ 1093, 1096, 1099, 1097, 1100, 1094, 1095, 1116, 1084, 1101, - /* 230 */ 1102, 1103, 1107, 1108, 1111, 1112, 1114, 1115, 1122, 1098, - /* 240 */ 1119, 1082, 1113, 1124, 1053, 1106, 1059, 1131, 1104, 1109, - /* 250 */ 1123, 1148, 1118, 1158, 1120, 1127, 1126, 1054, 1125, 1128, - /* 260 */ 1058, 1129, 1139, 1141, 920, 1069, 1073, 1081, 1075, 1086, - /* 270 */ 1133, 1135, 1061, 1130, 1134, 882, 1198, 1144, 1201, 1200, - /* 280 */ 1197, 1199, 1155, 1163, 1180, 1188, 1193, 1206, 1209, 1174, - /* 290 */ 1210, 1173, 1220, 1227, 1236, 1239, 1150, 1221, 1214, 1237, - /* 300 */ 1256, 1249, 1268, 1266, 1202, 1196, 1211, 1213, 1244, 1251, - /* 310 */ 1252, 1262, 1281, + /* 0 */ 294, 177, 371, 598, 855, 1034, 1061, 1133, 1165, 1193, + /* 10 */ 448, 674, 1291, 1363, 1461, 1485, -335, 1559, 1579, 1663, + /* 20 */ 906, 832, 1692, 1788, 1801, 1885, 1902, 1915, 1988, 1818, + /* 30 */ 2009, 2055, 2106, 2119, 2205, 2218, 2235, 2269, 2329, 2342, + /* 40 */ 2393, 2415, 2439, 2523, 2536, 2551, 2635, 2652, 2665, 2686, + /* 50 */ 2751, -302, 259, 296, -88, 383, 490, 521, 543, 501, + /* 60 */ 642, -23, -47, 176, 330, -447, -319, -324, -322, -261, + /* 70 */ -210, -58, -336, -298, 116, 95, 224, 235, 166, 254, + /* 80 */ 288, 291, 458, 518, 592, 127, 623, 646, 35, -73, + /* 90 */ 685, 692, -294, 719, 237, 722, 175, 724, 194, 246, + /* 100 */ 762, 803, 339, 814, 376, 373, 421, 801, -75, -307, + /* 110 */ -430, -430, -349, -236, -334, -168, 241, 314, 369, 503, + /* 120 */ 504, 549, 558, 593, 620, 629, 649, 670, 678, 699, + /* 130 */ 720, 727, 736, -219, -3, 158, -44, -271, -3, 198, + /* 140 */ 401, -218, 443, 488, -11, 420, 585, 586, 567, 613, + /* 150 */ -189, 550, 133, -109, 573, 658, 711, 691, 562, 580, + /* 160 */ 809, 819, 838, 839, 840, 838, 768, 844, 880, 826, + /* 170 */ 746, 759, 883, 777, 866, 866, 896, 852, 904, 919, + /* 180 */ 867, 868, 816, 816, 805, 816, 845, 842, 866, 885, + /* 190 */ 893, 908, 925, 924, 928, 935, 981, 983, 938, 947, + /* 200 */ 949, 984, 986, 999, 991, 1002, 1003, 1006, 1035, 1033, + /* 210 */ 1038, 1036, 969, 1026, 1001, 1031, 1039, 985, 1037, 1044, + /* 220 */ 1040, 1043, 1045, 1047, 1050, 1051, 1052, 1057, 1027, 1028, + /* 230 */ 1032, 1053, 1054, 1055, 1056, 1058, 1059, 1060, 1064, 1066, + /* 240 */ 1067, 1024, 1030, 1068, 996, 1005, 1004, 1070, 1011, 1013, + /* 250 */ 1071, 1073, 1025, 1090, 1072, 1074, 1069, 978, 1075, 1080, + /* 260 */ 979, 1081, 1087, 1089, 866, 980, 988, 989, 992, 997, + /* 270 */ 1078, 1079, 966, 1012, 1022, 816, 1149, 1084, 1155, 1159, + /* 280 */ 1151, 1157, 1113, 1115, 1128, 1132, 1134, 1138, 1139, 1116, + /* 290 */ 1140, 1129, 1176, 1160, 1179, 1180, 1091, 1164, 1152, 1182, + /* 300 */ 1197, 1187, 1207, 1205, 1141, 1122, 1145, 1148, 1189, 1200, + /* 310 */ 1201, 1211, 1219, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 10 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 20 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 30 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 40 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 50 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 60 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 70 */ 1719, 1719, 1719, 1719, 1992, 1719, 1719, 1719, 1719, 1719, - /* 80 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1801, 1719, - /* 90 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 100 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1799, 1985, - /* 110 */ 2206, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 120 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 130 */ 1719, 1719, 1719, 1719, 2218, 1719, 1719, 1719, 2218, 2218, - /* 140 */ 2218, 1799, 2178, 2178, 1719, 1719, 1719, 1719, 1801, 2050, - /* 150 */ 1719, 1719, 1719, 1719, 1719, 1719, 1920, 1719, 1719, 1719, - /* 160 */ 1719, 1719, 1944, 1719, 1719, 1719, 2044, 1719, 1719, 2243, - /* 170 */ 2299, 1719, 1719, 2246, 1719, 1719, 1719, 1997, 1719, 1719, - /* 180 */ 1874, 2233, 2210, 2224, 2283, 2211, 2208, 2227, 1719, 2237, - /* 190 */ 1719, 2031, 1990, 1719, 1990, 1987, 1719, 1719, 1990, 1987, - /* 200 */ 1987, 1863, 1859, 1719, 1857, 1719, 1719, 1719, 1719, 1766, - /* 210 */ 1719, 1766, 1719, 1801, 1719, 1801, 1719, 1719, 1801, 1719, - /* 220 */ 1801, 1801, 1801, 1719, 1801, 1779, 1779, 1719, 1719, 1719, - /* 230 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 240 */ 1719, 1719, 1719, 1719, 2062, 2048, 1719, 1799, 2042, 2040, - /* 250 */ 1719, 1799, 2038, 1719, 1719, 1719, 1719, 2254, 2252, 1719, - /* 260 */ 2254, 2252, 1719, 1719, 1719, 2268, 2264, 2254, 2272, 2270, - /* 270 */ 2239, 2237, 2302, 2289, 2285, 2224, 1719, 1719, 1719, 1719, - /* 280 */ 1799, 1799, 1719, 2252, 1719, 1719, 1719, 1719, 1719, 2252, - /* 290 */ 1719, 1719, 1799, 1719, 1799, 1719, 1719, 1890, 1719, 1719, - /* 300 */ 1719, 1799, 1751, 1719, 2033, 2053, 2015, 2015, 1923, 1923, - /* 310 */ 1923, 1802, 1724, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 320 */ 1719, 1719, 1719, 1719, 1719, 2267, 2266, 2133, 1719, 2182, - /* 330 */ 2181, 2180, 2171, 2132, 1886, 1719, 2131, 2130, 1719, 1719, - /* 340 */ 1719, 1719, 1719, 1719, 1719, 1719, 2006, 2005, 2124, 1719, - /* 350 */ 1719, 2125, 2123, 2122, 1719, 1719, 1719, 1719, 1719, 1719, - /* 360 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 370 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 2286, 2290, - /* 380 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 2207, 1719, 1719, - /* 390 */ 1719, 1719, 1719, 2106, 1719, 1719, 1719, 1719, 1719, 1719, - /* 400 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 410 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 420 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 430 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 440 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 450 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 460 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 470 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 480 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 490 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 500 */ 1756, 2111, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 510 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 520 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 530 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 540 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 550 */ 1840, 1839, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 560 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 570 */ 1719, 1719, 1719, 1719, 2115, 1719, 1719, 1719, 1719, 1719, - /* 580 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 590 */ 1719, 2282, 2240, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 600 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 610 */ 1719, 2106, 1719, 2265, 1719, 1719, 2280, 1719, 2284, 1719, - /* 620 */ 1719, 1719, 1719, 1719, 1719, 1719, 2217, 2213, 1719, 1719, - /* 630 */ 2209, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 2114, 1719, - /* 640 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 650 */ 1719, 1719, 2105, 1719, 2168, 1719, 1719, 1719, 2202, 1719, - /* 660 */ 1719, 2153, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 670 */ 1719, 2115, 1719, 2118, 1719, 1719, 1719, 1719, 1719, 1917, - /* 680 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 690 */ 1719, 1719, 1902, 1900, 1899, 1898, 1719, 1930, 1719, 1719, - /* 700 */ 1719, 1926, 1925, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 710 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1820, 1719, - /* 720 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1812, 1719, 1811, - /* 730 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 740 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 750 */ 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, - /* 760 */ 1719, 1719, + /* 0 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 10 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 20 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 30 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 40 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 50 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 60 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 70 */ 1738, 1738, 1738, 1738, 2015, 1738, 1738, 1738, 1738, 1738, + /* 80 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1824, 1738, + /* 90 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 100 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1822, 2008, + /* 110 */ 2229, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 120 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 130 */ 1738, 1738, 1738, 1738, 2241, 1738, 1738, 1738, 2241, 2241, + /* 140 */ 2241, 1822, 2201, 2201, 1738, 1738, 1738, 1738, 1824, 2073, + /* 150 */ 1738, 1738, 1738, 1738, 1738, 1738, 1943, 1738, 1738, 1738, + /* 160 */ 1738, 1738, 1967, 1738, 1738, 1738, 2067, 1738, 1738, 2266, + /* 170 */ 2322, 1738, 1738, 2269, 1738, 1738, 1738, 2020, 1738, 1738, + /* 180 */ 1897, 2256, 2233, 2247, 2306, 2234, 2231, 2250, 1738, 2260, + /* 190 */ 1738, 2054, 2013, 1738, 2013, 2010, 1738, 1738, 2013, 2010, + /* 200 */ 2010, 1886, 1882, 1738, 1880, 1738, 1738, 1738, 1738, 1785, + /* 210 */ 1738, 1785, 1738, 1824, 1738, 1824, 1738, 1738, 1824, 1738, + /* 220 */ 1824, 1824, 1824, 1738, 1824, 1799, 1799, 1738, 1738, 1738, + /* 230 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 240 */ 1738, 1738, 1738, 1738, 2085, 2071, 1738, 1822, 2065, 2063, + /* 250 */ 1738, 1822, 2061, 1738, 1738, 1738, 1738, 2277, 2275, 1738, + /* 260 */ 2277, 2275, 1738, 1738, 1738, 2291, 2287, 2277, 2295, 2293, + /* 270 */ 2262, 2260, 2325, 2312, 2308, 2247, 1738, 1738, 1738, 1738, + /* 280 */ 1822, 1822, 1738, 2275, 1738, 1738, 1738, 1738, 1738, 2275, + /* 290 */ 1738, 1738, 1822, 1738, 1822, 1738, 1738, 1913, 1738, 1738, + /* 300 */ 1738, 1822, 1770, 1738, 2056, 2076, 2038, 2038, 1946, 1946, + /* 310 */ 1946, 1825, 1743, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 320 */ 1738, 1738, 1738, 1738, 1738, 2290, 2289, 2156, 1738, 2205, + /* 330 */ 2204, 2203, 2194, 2155, 1909, 1738, 2154, 2153, 1738, 1738, + /* 340 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 2029, 2028, 2147, + /* 350 */ 1738, 1738, 2148, 2146, 2145, 1738, 1738, 1738, 1738, 1738, + /* 360 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 370 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 2309, + /* 380 */ 2313, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 2230, 1738, + /* 390 */ 1738, 1738, 1738, 1738, 2129, 1738, 1738, 1738, 1738, 1738, + /* 400 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 410 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 420 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 430 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 440 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 450 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 460 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 470 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 480 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 490 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 500 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 510 */ 1738, 1738, 1738, 1738, 1738, 1775, 2134, 1738, 1738, 1738, + /* 520 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 530 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 540 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 550 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 560 */ 1738, 1738, 1738, 1738, 1738, 1863, 1862, 1738, 1738, 1738, + /* 570 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 580 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 2138, + /* 590 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 600 */ 1738, 1738, 1738, 1738, 1738, 1738, 2305, 2263, 1738, 1738, + /* 610 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 620 */ 1738, 1738, 1738, 1738, 1738, 1738, 2129, 1738, 2288, 1738, + /* 630 */ 1738, 2303, 1738, 2307, 1738, 1738, 1738, 1738, 1738, 1738, + /* 640 */ 1738, 2240, 2236, 1738, 1738, 2232, 1738, 1738, 1738, 1738, + /* 650 */ 1738, 1738, 1738, 2137, 1738, 1738, 1738, 1738, 1738, 1738, + /* 660 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 2128, 1738, 2191, + /* 670 */ 1738, 1738, 1738, 2225, 1738, 1738, 2176, 1738, 1738, 1738, + /* 680 */ 1738, 1738, 1738, 1738, 1738, 1738, 2138, 1738, 2141, 1738, + /* 690 */ 1738, 1738, 1738, 1738, 1940, 1738, 1738, 1738, 1738, 1738, + /* 700 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1925, 1923, 1922, + /* 710 */ 1921, 1738, 1953, 1738, 1738, 1738, 1949, 1948, 1738, 1738, + /* 720 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 730 */ 1738, 1738, 1738, 1843, 1738, 1738, 1738, 1738, 1738, 1738, + /* 740 */ 1738, 1738, 1835, 1738, 1834, 1738, 1738, 1738, 1738, 1738, + /* 750 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 760 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, + /* 770 */ 1738, 1738, 1738, 1738, 1738, 1738, 1738, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1096,6 +1164,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* DNODE => nothing */ 0, /* PORT => nothing */ 0, /* DNODES => nothing */ + 0, /* RESTORE => nothing */ 0, /* NK_IPTOKEN => nothing */ 0, /* FORCE => nothing */ 0, /* LOCAL => nothing */ @@ -1103,6 +1172,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BNODE => nothing */ 0, /* SNODE => nothing */ 0, /* MNODE => nothing */ + 0, /* VNODE => nothing */ 0, /* DATABASE => nothing */ 0, /* USE => nothing */ 0, /* FLUSH => nothing */ @@ -1142,7 +1212,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* MAX_SPEED => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 279, /* END => ABORT */ + 281, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1324,56 +1394,56 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 279, /* AFTER => ABORT */ - 279, /* ATTACH => ABORT */ - 279, /* BEFORE => ABORT */ - 279, /* BEGIN => ABORT */ - 279, /* BITAND => ABORT */ - 279, /* BITNOT => ABORT */ - 279, /* BITOR => ABORT */ - 279, /* BLOCKS => ABORT */ - 279, /* CHANGE => ABORT */ - 279, /* COMMA => ABORT */ - 279, /* CONCAT => ABORT */ - 279, /* CONFLICT => ABORT */ - 279, /* COPY => ABORT */ - 279, /* DEFERRED => ABORT */ - 279, /* DELIMITERS => ABORT */ - 279, /* DETACH => ABORT */ - 279, /* DIVIDE => ABORT */ - 279, /* DOT => ABORT */ - 279, /* EACH => ABORT */ - 279, /* FAIL => ABORT */ - 279, /* FILE => ABORT */ - 279, /* FOR => ABORT */ - 279, /* GLOB => ABORT */ - 279, /* ID => ABORT */ - 279, /* IMMEDIATE => ABORT */ - 279, /* IMPORT => ABORT */ - 279, /* INITIALLY => ABORT */ - 279, /* INSTEAD => ABORT */ - 279, /* ISNULL => ABORT */ - 279, /* KEY => ABORT */ - 279, /* MODULES => ABORT */ - 279, /* NK_BITNOT => ABORT */ - 279, /* NK_SEMI => ABORT */ - 279, /* NOTNULL => ABORT */ - 279, /* OF => ABORT */ - 279, /* PLUS => ABORT */ - 279, /* PRIVILEGE => ABORT */ - 279, /* RAISE => ABORT */ - 279, /* RESTRICT => ABORT */ - 279, /* ROW => ABORT */ - 279, /* SEMI => ABORT */ - 279, /* STAR => ABORT */ - 279, /* STATEMENT => ABORT */ - 279, /* STRICT => ABORT */ - 279, /* STRING => ABORT */ - 279, /* TIMES => ABORT */ - 279, /* VALUES => ABORT */ - 279, /* VARIABLE => ABORT */ - 279, /* VIEW => ABORT */ - 279, /* WAL => ABORT */ + 281, /* AFTER => ABORT */ + 281, /* ATTACH => ABORT */ + 281, /* BEFORE => ABORT */ + 281, /* BEGIN => ABORT */ + 281, /* BITAND => ABORT */ + 281, /* BITNOT => ABORT */ + 281, /* BITOR => ABORT */ + 281, /* BLOCKS => ABORT */ + 281, /* CHANGE => ABORT */ + 281, /* COMMA => ABORT */ + 281, /* CONCAT => ABORT */ + 281, /* CONFLICT => ABORT */ + 281, /* COPY => ABORT */ + 281, /* DEFERRED => ABORT */ + 281, /* DELIMITERS => ABORT */ + 281, /* DETACH => ABORT */ + 281, /* DIVIDE => ABORT */ + 281, /* DOT => ABORT */ + 281, /* EACH => ABORT */ + 281, /* FAIL => ABORT */ + 281, /* FILE => ABORT */ + 281, /* FOR => ABORT */ + 281, /* GLOB => ABORT */ + 281, /* ID => ABORT */ + 281, /* IMMEDIATE => ABORT */ + 281, /* IMPORT => ABORT */ + 281, /* INITIALLY => ABORT */ + 281, /* INSTEAD => ABORT */ + 281, /* ISNULL => ABORT */ + 281, /* KEY => ABORT */ + 281, /* MODULES => ABORT */ + 281, /* NK_BITNOT => ABORT */ + 281, /* NK_SEMI => ABORT */ + 281, /* NOTNULL => ABORT */ + 281, /* OF => ABORT */ + 281, /* PLUS => ABORT */ + 281, /* PRIVILEGE => ABORT */ + 281, /* RAISE => ABORT */ + 281, /* RESTRICT => ABORT */ + 281, /* ROW => ABORT */ + 281, /* SEMI => ABORT */ + 281, /* STAR => ABORT */ + 281, /* STATEMENT => ABORT */ + 281, /* STRICT => ABORT */ + 281, /* STRING => ABORT */ + 281, /* TIMES => ABORT */ + 281, /* VALUES => ABORT */ + 281, /* VARIABLE => ABORT */ + 281, /* VIEW => ABORT */ + 281, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1513,430 +1583,432 @@ static const char *const yyTokenName[] = { /* 49 */ "DNODE", /* 50 */ "PORT", /* 51 */ "DNODES", - /* 52 */ "NK_IPTOKEN", - /* 53 */ "FORCE", - /* 54 */ "LOCAL", - /* 55 */ "QNODE", - /* 56 */ "BNODE", - /* 57 */ "SNODE", - /* 58 */ "MNODE", - /* 59 */ "DATABASE", - /* 60 */ "USE", - /* 61 */ "FLUSH", - /* 62 */ "TRIM", - /* 63 */ "COMPACT", - /* 64 */ "IF", - /* 65 */ "NOT", - /* 66 */ "EXISTS", - /* 67 */ "BUFFER", - /* 68 */ "CACHEMODEL", - /* 69 */ "CACHESIZE", - /* 70 */ "COMP", - /* 71 */ "DURATION", - /* 72 */ "NK_VARIABLE", - /* 73 */ "MAXROWS", - /* 74 */ "MINROWS", - /* 75 */ "KEEP", - /* 76 */ "PAGES", - /* 77 */ "PAGESIZE", - /* 78 */ "TSDB_PAGESIZE", - /* 79 */ "PRECISION", - /* 80 */ "REPLICA", - /* 81 */ "VGROUPS", - /* 82 */ "SINGLE_STABLE", - /* 83 */ "RETENTIONS", - /* 84 */ "SCHEMALESS", - /* 85 */ "WAL_LEVEL", - /* 86 */ "WAL_FSYNC_PERIOD", - /* 87 */ "WAL_RETENTION_PERIOD", - /* 88 */ "WAL_RETENTION_SIZE", - /* 89 */ "WAL_ROLL_PERIOD", - /* 90 */ "WAL_SEGMENT_SIZE", - /* 91 */ "STT_TRIGGER", - /* 92 */ "TABLE_PREFIX", - /* 93 */ "TABLE_SUFFIX", - /* 94 */ "NK_COLON", - /* 95 */ "MAX_SPEED", - /* 96 */ "START", - /* 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 */ "BOOL", - /* 113 */ "TINYINT", - /* 114 */ "SMALLINT", - /* 115 */ "INT", - /* 116 */ "INTEGER", - /* 117 */ "BIGINT", - /* 118 */ "FLOAT", - /* 119 */ "DOUBLE", - /* 120 */ "BINARY", - /* 121 */ "NCHAR", - /* 122 */ "UNSIGNED", - /* 123 */ "JSON", - /* 124 */ "VARCHAR", - /* 125 */ "MEDIUMBLOB", - /* 126 */ "BLOB", - /* 127 */ "VARBINARY", - /* 128 */ "DECIMAL", - /* 129 */ "COMMENT", - /* 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 */ "REPLACE", - /* 194 */ "STREAM", - /* 195 */ "INTO", - /* 196 */ "TRIGGER", - /* 197 */ "AT_ONCE", - /* 198 */ "WINDOW_CLOSE", - /* 199 */ "IGNORE", - /* 200 */ "EXPIRED", - /* 201 */ "FILL_HISTORY", - /* 202 */ "UPDATE", - /* 203 */ "SUBTABLE", - /* 204 */ "KILL", - /* 205 */ "CONNECTION", - /* 206 */ "TRANSACTION", - /* 207 */ "BALANCE", - /* 208 */ "VGROUP", - /* 209 */ "LEADER", - /* 210 */ "MERGE", - /* 211 */ "REDISTRIBUTE", - /* 212 */ "SPLIT", - /* 213 */ "DELETE", - /* 214 */ "INSERT", - /* 215 */ "NULL", - /* 216 */ "NK_QUESTION", - /* 217 */ "NK_ARROW", - /* 218 */ "ROWTS", - /* 219 */ "QSTART", - /* 220 */ "QEND", - /* 221 */ "QDURATION", - /* 222 */ "WSTART", - /* 223 */ "WEND", - /* 224 */ "WDURATION", - /* 225 */ "IROWTS", - /* 226 */ "ISFILLED", - /* 227 */ "CAST", - /* 228 */ "NOW", - /* 229 */ "TODAY", - /* 230 */ "TIMEZONE", - /* 231 */ "CLIENT_VERSION", - /* 232 */ "SERVER_VERSION", - /* 233 */ "SERVER_STATUS", - /* 234 */ "CURRENT_USER", - /* 235 */ "CASE", - /* 236 */ "WHEN", - /* 237 */ "THEN", - /* 238 */ "ELSE", - /* 239 */ "BETWEEN", - /* 240 */ "IS", - /* 241 */ "NK_LT", - /* 242 */ "NK_GT", - /* 243 */ "NK_LE", - /* 244 */ "NK_GE", - /* 245 */ "NK_NE", - /* 246 */ "MATCH", - /* 247 */ "NMATCH", - /* 248 */ "CONTAINS", - /* 249 */ "IN", - /* 250 */ "JOIN", - /* 251 */ "INNER", - /* 252 */ "SELECT", - /* 253 */ "DISTINCT", - /* 254 */ "WHERE", - /* 255 */ "PARTITION", - /* 256 */ "BY", - /* 257 */ "SESSION", - /* 258 */ "STATE_WINDOW", - /* 259 */ "EVENT_WINDOW", - /* 260 */ "SLIDING", - /* 261 */ "FILL", - /* 262 */ "VALUE", - /* 263 */ "VALUE_F", - /* 264 */ "NONE", - /* 265 */ "PREV", - /* 266 */ "NULL_F", - /* 267 */ "LINEAR", - /* 268 */ "NEXT", - /* 269 */ "HAVING", - /* 270 */ "RANGE", - /* 271 */ "EVERY", - /* 272 */ "ORDER", - /* 273 */ "SLIMIT", - /* 274 */ "SOFFSET", - /* 275 */ "LIMIT", - /* 276 */ "OFFSET", - /* 277 */ "ASC", - /* 278 */ "NULLS", - /* 279 */ "ABORT", - /* 280 */ "AFTER", - /* 281 */ "ATTACH", - /* 282 */ "BEFORE", - /* 283 */ "BEGIN", - /* 284 */ "BITAND", - /* 285 */ "BITNOT", - /* 286 */ "BITOR", - /* 287 */ "BLOCKS", - /* 288 */ "CHANGE", - /* 289 */ "COMMA", - /* 290 */ "CONCAT", - /* 291 */ "CONFLICT", - /* 292 */ "COPY", - /* 293 */ "DEFERRED", - /* 294 */ "DELIMITERS", - /* 295 */ "DETACH", - /* 296 */ "DIVIDE", - /* 297 */ "DOT", - /* 298 */ "EACH", - /* 299 */ "FAIL", - /* 300 */ "FILE", - /* 301 */ "FOR", - /* 302 */ "GLOB", - /* 303 */ "ID", - /* 304 */ "IMMEDIATE", - /* 305 */ "IMPORT", - /* 306 */ "INITIALLY", - /* 307 */ "INSTEAD", - /* 308 */ "ISNULL", - /* 309 */ "KEY", - /* 310 */ "MODULES", - /* 311 */ "NK_BITNOT", - /* 312 */ "NK_SEMI", - /* 313 */ "NOTNULL", - /* 314 */ "OF", - /* 315 */ "PLUS", - /* 316 */ "PRIVILEGE", - /* 317 */ "RAISE", - /* 318 */ "RESTRICT", - /* 319 */ "ROW", - /* 320 */ "SEMI", - /* 321 */ "STAR", - /* 322 */ "STATEMENT", - /* 323 */ "STRICT", - /* 324 */ "STRING", - /* 325 */ "TIMES", - /* 326 */ "VALUES", - /* 327 */ "VARIABLE", - /* 328 */ "VIEW", - /* 329 */ "WAL", - /* 330 */ "cmd", - /* 331 */ "account_options", - /* 332 */ "alter_account_options", - /* 333 */ "literal", - /* 334 */ "alter_account_option", - /* 335 */ "user_name", - /* 336 */ "sysinfo_opt", - /* 337 */ "privileges", - /* 338 */ "priv_level", - /* 339 */ "with_opt", - /* 340 */ "priv_type_list", - /* 341 */ "priv_type", - /* 342 */ "db_name", - /* 343 */ "table_name", - /* 344 */ "topic_name", - /* 345 */ "search_condition", - /* 346 */ "dnode_endpoint", - /* 347 */ "force_opt", - /* 348 */ "not_exists_opt", - /* 349 */ "db_options", - /* 350 */ "exists_opt", - /* 351 */ "alter_db_options", - /* 352 */ "speed_opt", - /* 353 */ "start_opt", - /* 354 */ "end_opt", - /* 355 */ "integer_list", - /* 356 */ "variable_list", - /* 357 */ "retention_list", - /* 358 */ "alter_db_option", - /* 359 */ "retention", - /* 360 */ "full_table_name", - /* 361 */ "column_def_list", - /* 362 */ "tags_def_opt", - /* 363 */ "table_options", - /* 364 */ "multi_create_clause", - /* 365 */ "tags_def", - /* 366 */ "multi_drop_clause", - /* 367 */ "alter_table_clause", - /* 368 */ "alter_table_options", - /* 369 */ "column_name", - /* 370 */ "type_name", - /* 371 */ "signed_literal", - /* 372 */ "create_subtable_clause", - /* 373 */ "specific_cols_opt", - /* 374 */ "expression_list", - /* 375 */ "drop_table_clause", - /* 376 */ "col_name_list", - /* 377 */ "column_def", - /* 378 */ "duration_list", - /* 379 */ "rollup_func_list", - /* 380 */ "alter_table_option", - /* 381 */ "duration_literal", - /* 382 */ "rollup_func_name", - /* 383 */ "function_name", - /* 384 */ "col_name", - /* 385 */ "db_name_cond_opt", - /* 386 */ "like_pattern_opt", - /* 387 */ "table_name_cond", - /* 388 */ "from_db_opt", - /* 389 */ "tag_list_opt", - /* 390 */ "tag_item", - /* 391 */ "column_alias", - /* 392 */ "full_index_name", - /* 393 */ "index_options", - /* 394 */ "index_name", - /* 395 */ "func_list", - /* 396 */ "sliding_opt", - /* 397 */ "sma_stream_opt", - /* 398 */ "func", - /* 399 */ "sma_func_name", - /* 400 */ "query_or_subquery", - /* 401 */ "cgroup_name", - /* 402 */ "analyze_opt", - /* 403 */ "explain_options", - /* 404 */ "insert_query", - /* 405 */ "or_replace_opt", - /* 406 */ "agg_func_opt", - /* 407 */ "bufsize_opt", - /* 408 */ "language_opt", - /* 409 */ "stream_name", - /* 410 */ "stream_options", - /* 411 */ "col_list_opt", - /* 412 */ "tag_def_or_ref_opt", - /* 413 */ "subtable_opt", - /* 414 */ "expression", - /* 415 */ "dnode_list", - /* 416 */ "where_clause_opt", - /* 417 */ "signed", - /* 418 */ "literal_func", - /* 419 */ "literal_list", - /* 420 */ "table_alias", - /* 421 */ "expr_or_subquery", - /* 422 */ "pseudo_column", - /* 423 */ "column_reference", - /* 424 */ "function_expression", - /* 425 */ "case_when_expression", - /* 426 */ "star_func", - /* 427 */ "star_func_para_list", - /* 428 */ "noarg_func", - /* 429 */ "other_para_list", - /* 430 */ "star_func_para", - /* 431 */ "when_then_list", - /* 432 */ "case_when_else_opt", - /* 433 */ "common_expression", - /* 434 */ "when_then_expr", - /* 435 */ "predicate", - /* 436 */ "compare_op", - /* 437 */ "in_op", - /* 438 */ "in_predicate_value", - /* 439 */ "boolean_value_expression", - /* 440 */ "boolean_primary", - /* 441 */ "from_clause_opt", - /* 442 */ "table_reference_list", - /* 443 */ "table_reference", - /* 444 */ "table_primary", - /* 445 */ "joined_table", - /* 446 */ "alias_opt", - /* 447 */ "subquery", - /* 448 */ "parenthesized_joined_table", - /* 449 */ "join_type", - /* 450 */ "query_specification", - /* 451 */ "set_quantifier_opt", - /* 452 */ "select_list", - /* 453 */ "partition_by_clause_opt", - /* 454 */ "range_opt", - /* 455 */ "every_opt", - /* 456 */ "fill_opt", - /* 457 */ "twindow_clause_opt", - /* 458 */ "group_by_clause_opt", - /* 459 */ "having_clause_opt", - /* 460 */ "select_item", - /* 461 */ "partition_list", - /* 462 */ "partition_item", - /* 463 */ "fill_mode", - /* 464 */ "group_by_list", - /* 465 */ "query_expression", - /* 466 */ "query_simple", - /* 467 */ "order_by_clause_opt", - /* 468 */ "slimit_clause_opt", - /* 469 */ "limit_clause_opt", - /* 470 */ "union_query_expression", - /* 471 */ "query_simple_or_subquery", - /* 472 */ "sort_specification_list", - /* 473 */ "sort_specification", - /* 474 */ "ordering_specification_opt", - /* 475 */ "null_ordering_opt", + /* 52 */ "RESTORE", + /* 53 */ "NK_IPTOKEN", + /* 54 */ "FORCE", + /* 55 */ "LOCAL", + /* 56 */ "QNODE", + /* 57 */ "BNODE", + /* 58 */ "SNODE", + /* 59 */ "MNODE", + /* 60 */ "VNODE", + /* 61 */ "DATABASE", + /* 62 */ "USE", + /* 63 */ "FLUSH", + /* 64 */ "TRIM", + /* 65 */ "COMPACT", + /* 66 */ "IF", + /* 67 */ "NOT", + /* 68 */ "EXISTS", + /* 69 */ "BUFFER", + /* 70 */ "CACHEMODEL", + /* 71 */ "CACHESIZE", + /* 72 */ "COMP", + /* 73 */ "DURATION", + /* 74 */ "NK_VARIABLE", + /* 75 */ "MAXROWS", + /* 76 */ "MINROWS", + /* 77 */ "KEEP", + /* 78 */ "PAGES", + /* 79 */ "PAGESIZE", + /* 80 */ "TSDB_PAGESIZE", + /* 81 */ "PRECISION", + /* 82 */ "REPLICA", + /* 83 */ "VGROUPS", + /* 84 */ "SINGLE_STABLE", + /* 85 */ "RETENTIONS", + /* 86 */ "SCHEMALESS", + /* 87 */ "WAL_LEVEL", + /* 88 */ "WAL_FSYNC_PERIOD", + /* 89 */ "WAL_RETENTION_PERIOD", + /* 90 */ "WAL_RETENTION_SIZE", + /* 91 */ "WAL_ROLL_PERIOD", + /* 92 */ "WAL_SEGMENT_SIZE", + /* 93 */ "STT_TRIGGER", + /* 94 */ "TABLE_PREFIX", + /* 95 */ "TABLE_SUFFIX", + /* 96 */ "NK_COLON", + /* 97 */ "MAX_SPEED", + /* 98 */ "START", + /* 99 */ "TIMESTAMP", + /* 100 */ "END", + /* 101 */ "TABLE", + /* 102 */ "NK_LP", + /* 103 */ "NK_RP", + /* 104 */ "STABLE", + /* 105 */ "ADD", + /* 106 */ "COLUMN", + /* 107 */ "MODIFY", + /* 108 */ "RENAME", + /* 109 */ "TAG", + /* 110 */ "SET", + /* 111 */ "NK_EQ", + /* 112 */ "USING", + /* 113 */ "TAGS", + /* 114 */ "BOOL", + /* 115 */ "TINYINT", + /* 116 */ "SMALLINT", + /* 117 */ "INT", + /* 118 */ "INTEGER", + /* 119 */ "BIGINT", + /* 120 */ "FLOAT", + /* 121 */ "DOUBLE", + /* 122 */ "BINARY", + /* 123 */ "NCHAR", + /* 124 */ "UNSIGNED", + /* 125 */ "JSON", + /* 126 */ "VARCHAR", + /* 127 */ "MEDIUMBLOB", + /* 128 */ "BLOB", + /* 129 */ "VARBINARY", + /* 130 */ "DECIMAL", + /* 131 */ "COMMENT", + /* 132 */ "MAX_DELAY", + /* 133 */ "WATERMARK", + /* 134 */ "ROLLUP", + /* 135 */ "TTL", + /* 136 */ "SMA", + /* 137 */ "DELETE_MARK", + /* 138 */ "FIRST", + /* 139 */ "LAST", + /* 140 */ "SHOW", + /* 141 */ "PRIVILEGES", + /* 142 */ "DATABASES", + /* 143 */ "TABLES", + /* 144 */ "STABLES", + /* 145 */ "MNODES", + /* 146 */ "QNODES", + /* 147 */ "FUNCTIONS", + /* 148 */ "INDEXES", + /* 149 */ "ACCOUNTS", + /* 150 */ "APPS", + /* 151 */ "CONNECTIONS", + /* 152 */ "LICENCES", + /* 153 */ "GRANTS", + /* 154 */ "QUERIES", + /* 155 */ "SCORES", + /* 156 */ "TOPICS", + /* 157 */ "VARIABLES", + /* 158 */ "CLUSTER", + /* 159 */ "BNODES", + /* 160 */ "SNODES", + /* 161 */ "TRANSACTIONS", + /* 162 */ "DISTRIBUTED", + /* 163 */ "CONSUMERS", + /* 164 */ "SUBSCRIPTIONS", + /* 165 */ "VNODES", + /* 166 */ "ALIVE", + /* 167 */ "LIKE", + /* 168 */ "TBNAME", + /* 169 */ "QTAGS", + /* 170 */ "AS", + /* 171 */ "INDEX", + /* 172 */ "FUNCTION", + /* 173 */ "INTERVAL", + /* 174 */ "COUNT", + /* 175 */ "LAST_ROW", + /* 176 */ "TOPIC", + /* 177 */ "META", + /* 178 */ "CONSUMER", + /* 179 */ "GROUP", + /* 180 */ "DESC", + /* 181 */ "DESCRIBE", + /* 182 */ "RESET", + /* 183 */ "QUERY", + /* 184 */ "CACHE", + /* 185 */ "EXPLAIN", + /* 186 */ "ANALYZE", + /* 187 */ "VERBOSE", + /* 188 */ "NK_BOOL", + /* 189 */ "RATIO", + /* 190 */ "NK_FLOAT", + /* 191 */ "OUTPUTTYPE", + /* 192 */ "AGGREGATE", + /* 193 */ "BUFSIZE", + /* 194 */ "LANGUAGE", + /* 195 */ "REPLACE", + /* 196 */ "STREAM", + /* 197 */ "INTO", + /* 198 */ "TRIGGER", + /* 199 */ "AT_ONCE", + /* 200 */ "WINDOW_CLOSE", + /* 201 */ "IGNORE", + /* 202 */ "EXPIRED", + /* 203 */ "FILL_HISTORY", + /* 204 */ "UPDATE", + /* 205 */ "SUBTABLE", + /* 206 */ "KILL", + /* 207 */ "CONNECTION", + /* 208 */ "TRANSACTION", + /* 209 */ "BALANCE", + /* 210 */ "VGROUP", + /* 211 */ "LEADER", + /* 212 */ "MERGE", + /* 213 */ "REDISTRIBUTE", + /* 214 */ "SPLIT", + /* 215 */ "DELETE", + /* 216 */ "INSERT", + /* 217 */ "NULL", + /* 218 */ "NK_QUESTION", + /* 219 */ "NK_ARROW", + /* 220 */ "ROWTS", + /* 221 */ "QSTART", + /* 222 */ "QEND", + /* 223 */ "QDURATION", + /* 224 */ "WSTART", + /* 225 */ "WEND", + /* 226 */ "WDURATION", + /* 227 */ "IROWTS", + /* 228 */ "ISFILLED", + /* 229 */ "CAST", + /* 230 */ "NOW", + /* 231 */ "TODAY", + /* 232 */ "TIMEZONE", + /* 233 */ "CLIENT_VERSION", + /* 234 */ "SERVER_VERSION", + /* 235 */ "SERVER_STATUS", + /* 236 */ "CURRENT_USER", + /* 237 */ "CASE", + /* 238 */ "WHEN", + /* 239 */ "THEN", + /* 240 */ "ELSE", + /* 241 */ "BETWEEN", + /* 242 */ "IS", + /* 243 */ "NK_LT", + /* 244 */ "NK_GT", + /* 245 */ "NK_LE", + /* 246 */ "NK_GE", + /* 247 */ "NK_NE", + /* 248 */ "MATCH", + /* 249 */ "NMATCH", + /* 250 */ "CONTAINS", + /* 251 */ "IN", + /* 252 */ "JOIN", + /* 253 */ "INNER", + /* 254 */ "SELECT", + /* 255 */ "DISTINCT", + /* 256 */ "WHERE", + /* 257 */ "PARTITION", + /* 258 */ "BY", + /* 259 */ "SESSION", + /* 260 */ "STATE_WINDOW", + /* 261 */ "EVENT_WINDOW", + /* 262 */ "SLIDING", + /* 263 */ "FILL", + /* 264 */ "VALUE", + /* 265 */ "VALUE_F", + /* 266 */ "NONE", + /* 267 */ "PREV", + /* 268 */ "NULL_F", + /* 269 */ "LINEAR", + /* 270 */ "NEXT", + /* 271 */ "HAVING", + /* 272 */ "RANGE", + /* 273 */ "EVERY", + /* 274 */ "ORDER", + /* 275 */ "SLIMIT", + /* 276 */ "SOFFSET", + /* 277 */ "LIMIT", + /* 278 */ "OFFSET", + /* 279 */ "ASC", + /* 280 */ "NULLS", + /* 281 */ "ABORT", + /* 282 */ "AFTER", + /* 283 */ "ATTACH", + /* 284 */ "BEFORE", + /* 285 */ "BEGIN", + /* 286 */ "BITAND", + /* 287 */ "BITNOT", + /* 288 */ "BITOR", + /* 289 */ "BLOCKS", + /* 290 */ "CHANGE", + /* 291 */ "COMMA", + /* 292 */ "CONCAT", + /* 293 */ "CONFLICT", + /* 294 */ "COPY", + /* 295 */ "DEFERRED", + /* 296 */ "DELIMITERS", + /* 297 */ "DETACH", + /* 298 */ "DIVIDE", + /* 299 */ "DOT", + /* 300 */ "EACH", + /* 301 */ "FAIL", + /* 302 */ "FILE", + /* 303 */ "FOR", + /* 304 */ "GLOB", + /* 305 */ "ID", + /* 306 */ "IMMEDIATE", + /* 307 */ "IMPORT", + /* 308 */ "INITIALLY", + /* 309 */ "INSTEAD", + /* 310 */ "ISNULL", + /* 311 */ "KEY", + /* 312 */ "MODULES", + /* 313 */ "NK_BITNOT", + /* 314 */ "NK_SEMI", + /* 315 */ "NOTNULL", + /* 316 */ "OF", + /* 317 */ "PLUS", + /* 318 */ "PRIVILEGE", + /* 319 */ "RAISE", + /* 320 */ "RESTRICT", + /* 321 */ "ROW", + /* 322 */ "SEMI", + /* 323 */ "STAR", + /* 324 */ "STATEMENT", + /* 325 */ "STRICT", + /* 326 */ "STRING", + /* 327 */ "TIMES", + /* 328 */ "VALUES", + /* 329 */ "VARIABLE", + /* 330 */ "VIEW", + /* 331 */ "WAL", + /* 332 */ "cmd", + /* 333 */ "account_options", + /* 334 */ "alter_account_options", + /* 335 */ "literal", + /* 336 */ "alter_account_option", + /* 337 */ "user_name", + /* 338 */ "sysinfo_opt", + /* 339 */ "privileges", + /* 340 */ "priv_level", + /* 341 */ "with_opt", + /* 342 */ "priv_type_list", + /* 343 */ "priv_type", + /* 344 */ "db_name", + /* 345 */ "table_name", + /* 346 */ "topic_name", + /* 347 */ "search_condition", + /* 348 */ "dnode_endpoint", + /* 349 */ "force_opt", + /* 350 */ "not_exists_opt", + /* 351 */ "db_options", + /* 352 */ "exists_opt", + /* 353 */ "alter_db_options", + /* 354 */ "speed_opt", + /* 355 */ "start_opt", + /* 356 */ "end_opt", + /* 357 */ "integer_list", + /* 358 */ "variable_list", + /* 359 */ "retention_list", + /* 360 */ "alter_db_option", + /* 361 */ "retention", + /* 362 */ "full_table_name", + /* 363 */ "column_def_list", + /* 364 */ "tags_def_opt", + /* 365 */ "table_options", + /* 366 */ "multi_create_clause", + /* 367 */ "tags_def", + /* 368 */ "multi_drop_clause", + /* 369 */ "alter_table_clause", + /* 370 */ "alter_table_options", + /* 371 */ "column_name", + /* 372 */ "type_name", + /* 373 */ "signed_literal", + /* 374 */ "create_subtable_clause", + /* 375 */ "specific_cols_opt", + /* 376 */ "expression_list", + /* 377 */ "drop_table_clause", + /* 378 */ "col_name_list", + /* 379 */ "column_def", + /* 380 */ "duration_list", + /* 381 */ "rollup_func_list", + /* 382 */ "alter_table_option", + /* 383 */ "duration_literal", + /* 384 */ "rollup_func_name", + /* 385 */ "function_name", + /* 386 */ "col_name", + /* 387 */ "db_name_cond_opt", + /* 388 */ "like_pattern_opt", + /* 389 */ "table_name_cond", + /* 390 */ "from_db_opt", + /* 391 */ "tag_list_opt", + /* 392 */ "tag_item", + /* 393 */ "column_alias", + /* 394 */ "full_index_name", + /* 395 */ "index_options", + /* 396 */ "index_name", + /* 397 */ "func_list", + /* 398 */ "sliding_opt", + /* 399 */ "sma_stream_opt", + /* 400 */ "func", + /* 401 */ "sma_func_name", + /* 402 */ "query_or_subquery", + /* 403 */ "cgroup_name", + /* 404 */ "analyze_opt", + /* 405 */ "explain_options", + /* 406 */ "insert_query", + /* 407 */ "or_replace_opt", + /* 408 */ "agg_func_opt", + /* 409 */ "bufsize_opt", + /* 410 */ "language_opt", + /* 411 */ "stream_name", + /* 412 */ "stream_options", + /* 413 */ "col_list_opt", + /* 414 */ "tag_def_or_ref_opt", + /* 415 */ "subtable_opt", + /* 416 */ "expression", + /* 417 */ "dnode_list", + /* 418 */ "where_clause_opt", + /* 419 */ "signed", + /* 420 */ "literal_func", + /* 421 */ "literal_list", + /* 422 */ "table_alias", + /* 423 */ "expr_or_subquery", + /* 424 */ "pseudo_column", + /* 425 */ "column_reference", + /* 426 */ "function_expression", + /* 427 */ "case_when_expression", + /* 428 */ "star_func", + /* 429 */ "star_func_para_list", + /* 430 */ "noarg_func", + /* 431 */ "other_para_list", + /* 432 */ "star_func_para", + /* 433 */ "when_then_list", + /* 434 */ "case_when_else_opt", + /* 435 */ "common_expression", + /* 436 */ "when_then_expr", + /* 437 */ "predicate", + /* 438 */ "compare_op", + /* 439 */ "in_op", + /* 440 */ "in_predicate_value", + /* 441 */ "boolean_value_expression", + /* 442 */ "boolean_primary", + /* 443 */ "from_clause_opt", + /* 444 */ "table_reference_list", + /* 445 */ "table_reference", + /* 446 */ "table_primary", + /* 447 */ "joined_table", + /* 448 */ "alias_opt", + /* 449 */ "subquery", + /* 450 */ "parenthesized_joined_table", + /* 451 */ "join_type", + /* 452 */ "query_specification", + /* 453 */ "set_quantifier_opt", + /* 454 */ "select_list", + /* 455 */ "partition_by_clause_opt", + /* 456 */ "range_opt", + /* 457 */ "every_opt", + /* 458 */ "fill_opt", + /* 459 */ "twindow_clause_opt", + /* 460 */ "group_by_clause_opt", + /* 461 */ "having_clause_opt", + /* 462 */ "select_item", + /* 463 */ "partition_list", + /* 464 */ "partition_item", + /* 465 */ "fill_mode", + /* 466 */ "group_by_list", + /* 467 */ "query_expression", + /* 468 */ "query_simple", + /* 469 */ "order_by_clause_opt", + /* 470 */ "slimit_clause_opt", + /* 471 */ "limit_clause_opt", + /* 472 */ "union_query_expression", + /* 473 */ "query_simple_or_subquery", + /* 474 */ "sort_specification_list", + /* 475 */ "sort_specification", + /* 476 */ "ordering_specification_opt", + /* 477 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1998,535 +2070,539 @@ static const char *const yyRuleName[] = { /* 51 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", /* 52 */ "cmd ::= ALTER ALL DNODES NK_STRING", /* 53 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", - /* 54 */ "dnode_endpoint ::= NK_STRING", - /* 55 */ "dnode_endpoint ::= NK_ID", - /* 56 */ "dnode_endpoint ::= NK_IPTOKEN", - /* 57 */ "force_opt ::=", - /* 58 */ "force_opt ::= FORCE", - /* 59 */ "cmd ::= ALTER LOCAL NK_STRING", - /* 60 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", - /* 61 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 62 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", - /* 63 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", - /* 64 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", - /* 65 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", - /* 66 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", - /* 67 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", - /* 68 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", - /* 69 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 70 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 71 */ "cmd ::= USE db_name", - /* 72 */ "cmd ::= ALTER DATABASE db_name alter_db_options", - /* 73 */ "cmd ::= FLUSH DATABASE db_name", - /* 74 */ "cmd ::= TRIM DATABASE db_name speed_opt", - /* 75 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", - /* 76 */ "not_exists_opt ::= IF NOT EXISTS", - /* 77 */ "not_exists_opt ::=", - /* 78 */ "exists_opt ::= IF EXISTS", - /* 79 */ "exists_opt ::=", - /* 80 */ "db_options ::=", - /* 81 */ "db_options ::= db_options BUFFER NK_INTEGER", - /* 82 */ "db_options ::= db_options CACHEMODEL NK_STRING", - /* 83 */ "db_options ::= db_options CACHESIZE NK_INTEGER", - /* 84 */ "db_options ::= db_options COMP NK_INTEGER", - /* 85 */ "db_options ::= db_options DURATION NK_INTEGER", - /* 86 */ "db_options ::= db_options DURATION NK_VARIABLE", - /* 87 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 88 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 89 */ "db_options ::= db_options KEEP integer_list", - /* 90 */ "db_options ::= db_options KEEP variable_list", - /* 91 */ "db_options ::= db_options PAGES NK_INTEGER", - /* 92 */ "db_options ::= db_options PAGESIZE NK_INTEGER", - /* 93 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", - /* 94 */ "db_options ::= db_options PRECISION NK_STRING", - /* 95 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 96 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 97 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 98 */ "db_options ::= db_options RETENTIONS retention_list", - /* 99 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 100 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 101 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 102 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 103 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 104 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 105 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 106 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 107 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 108 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 109 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", - /* 110 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", - /* 111 */ "alter_db_options ::= alter_db_option", - /* 112 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 113 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 114 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 115 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 116 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 117 */ "alter_db_option ::= KEEP integer_list", - /* 118 */ "alter_db_option ::= KEEP variable_list", - /* 119 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 120 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 121 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 122 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 123 */ "alter_db_option ::= MINROWS NK_INTEGER", - /* 124 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", - /* 125 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 126 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", - /* 127 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 128 */ "integer_list ::= NK_INTEGER", - /* 129 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 130 */ "variable_list ::= NK_VARIABLE", - /* 131 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 132 */ "retention_list ::= retention", - /* 133 */ "retention_list ::= retention_list NK_COMMA retention", - /* 134 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 135 */ "speed_opt ::=", - /* 136 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 137 */ "start_opt ::=", - /* 138 */ "start_opt ::= START WITH NK_INTEGER", - /* 139 */ "start_opt ::= START WITH NK_STRING", - /* 140 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", - /* 141 */ "end_opt ::=", - /* 142 */ "end_opt ::= END WITH NK_INTEGER", - /* 143 */ "end_opt ::= END WITH NK_STRING", - /* 144 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", - /* 145 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 146 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 147 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 148 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 149 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 150 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 151 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 152 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 153 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 154 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 155 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 156 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 157 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 158 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 159 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 160 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 161 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 162 */ "multi_create_clause ::= create_subtable_clause", - /* 163 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 164 */ "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", - /* 165 */ "multi_drop_clause ::= drop_table_clause", - /* 166 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 167 */ "drop_table_clause ::= exists_opt full_table_name", - /* 168 */ "specific_cols_opt ::=", - /* 169 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 170 */ "full_table_name ::= table_name", - /* 171 */ "full_table_name ::= db_name NK_DOT table_name", - /* 172 */ "column_def_list ::= column_def", - /* 173 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 174 */ "column_def ::= column_name type_name", - /* 175 */ "type_name ::= BOOL", - /* 176 */ "type_name ::= TINYINT", - /* 177 */ "type_name ::= SMALLINT", - /* 178 */ "type_name ::= INT", - /* 179 */ "type_name ::= INTEGER", - /* 180 */ "type_name ::= BIGINT", - /* 181 */ "type_name ::= FLOAT", - /* 182 */ "type_name ::= DOUBLE", - /* 183 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 184 */ "type_name ::= TIMESTAMP", - /* 185 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 186 */ "type_name ::= TINYINT UNSIGNED", - /* 187 */ "type_name ::= SMALLINT UNSIGNED", - /* 188 */ "type_name ::= INT UNSIGNED", - /* 189 */ "type_name ::= BIGINT UNSIGNED", - /* 190 */ "type_name ::= JSON", - /* 191 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 192 */ "type_name ::= MEDIUMBLOB", - /* 193 */ "type_name ::= BLOB", - /* 194 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 195 */ "type_name ::= DECIMAL", - /* 196 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 197 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 198 */ "tags_def_opt ::=", - /* 199 */ "tags_def_opt ::= tags_def", - /* 200 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 201 */ "table_options ::=", - /* 202 */ "table_options ::= table_options COMMENT NK_STRING", - /* 203 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 204 */ "table_options ::= table_options WATERMARK duration_list", - /* 205 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 206 */ "table_options ::= table_options TTL NK_INTEGER", - /* 207 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 208 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 209 */ "alter_table_options ::= alter_table_option", - /* 210 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 211 */ "alter_table_option ::= COMMENT NK_STRING", - /* 212 */ "alter_table_option ::= TTL NK_INTEGER", - /* 213 */ "duration_list ::= duration_literal", - /* 214 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 215 */ "rollup_func_list ::= rollup_func_name", - /* 216 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 217 */ "rollup_func_name ::= function_name", - /* 218 */ "rollup_func_name ::= FIRST", - /* 219 */ "rollup_func_name ::= LAST", - /* 220 */ "col_name_list ::= col_name", - /* 221 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 222 */ "col_name ::= column_name", - /* 223 */ "cmd ::= SHOW DNODES", - /* 224 */ "cmd ::= SHOW USERS", - /* 225 */ "cmd ::= SHOW USER PRIVILEGES", - /* 226 */ "cmd ::= SHOW DATABASES", - /* 227 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 228 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 229 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 230 */ "cmd ::= SHOW MNODES", - /* 231 */ "cmd ::= SHOW QNODES", - /* 232 */ "cmd ::= SHOW FUNCTIONS", - /* 233 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 234 */ "cmd ::= SHOW STREAMS", - /* 235 */ "cmd ::= SHOW ACCOUNTS", - /* 236 */ "cmd ::= SHOW APPS", - /* 237 */ "cmd ::= SHOW CONNECTIONS", - /* 238 */ "cmd ::= SHOW LICENCES", - /* 239 */ "cmd ::= SHOW GRANTS", - /* 240 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 241 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 242 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 243 */ "cmd ::= SHOW QUERIES", - /* 244 */ "cmd ::= SHOW SCORES", - /* 245 */ "cmd ::= SHOW TOPICS", - /* 246 */ "cmd ::= SHOW VARIABLES", - /* 247 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 248 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 249 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 250 */ "cmd ::= SHOW BNODES", - /* 251 */ "cmd ::= SHOW SNODES", - /* 252 */ "cmd ::= SHOW CLUSTER", - /* 253 */ "cmd ::= SHOW TRANSACTIONS", - /* 254 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 255 */ "cmd ::= SHOW CONSUMERS", - /* 256 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 257 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 258 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 259 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 260 */ "cmd ::= SHOW VNODES NK_STRING", - /* 261 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 262 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 263 */ "db_name_cond_opt ::=", - /* 264 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 265 */ "like_pattern_opt ::=", - /* 266 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 267 */ "table_name_cond ::= table_name", - /* 268 */ "from_db_opt ::=", - /* 269 */ "from_db_opt ::= FROM db_name", - /* 270 */ "tag_list_opt ::=", - /* 271 */ "tag_list_opt ::= tag_item", - /* 272 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 273 */ "tag_item ::= TBNAME", - /* 274 */ "tag_item ::= QTAGS", - /* 275 */ "tag_item ::= column_name", - /* 276 */ "tag_item ::= column_name column_alias", - /* 277 */ "tag_item ::= column_name AS column_alias", - /* 278 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", - /* 279 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", - /* 280 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 281 */ "full_index_name ::= index_name", - /* 282 */ "full_index_name ::= db_name NK_DOT index_name", - /* 283 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 284 */ "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", - /* 285 */ "func_list ::= func", - /* 286 */ "func_list ::= func_list NK_COMMA func", - /* 287 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 288 */ "sma_func_name ::= function_name", - /* 289 */ "sma_func_name ::= COUNT", - /* 290 */ "sma_func_name ::= FIRST", - /* 291 */ "sma_func_name ::= LAST", - /* 292 */ "sma_func_name ::= LAST_ROW", - /* 293 */ "sma_stream_opt ::=", - /* 294 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 295 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 296 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 297 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 298 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 299 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 300 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 301 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 302 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 303 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 304 */ "cmd ::= DESC full_table_name", - /* 305 */ "cmd ::= DESCRIBE full_table_name", - /* 306 */ "cmd ::= RESET QUERY CACHE", - /* 307 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 308 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 309 */ "analyze_opt ::=", - /* 310 */ "analyze_opt ::= ANALYZE", - /* 311 */ "explain_options ::=", - /* 312 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 313 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 314 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 315 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 316 */ "agg_func_opt ::=", - /* 317 */ "agg_func_opt ::= AGGREGATE", - /* 318 */ "bufsize_opt ::=", - /* 319 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 320 */ "language_opt ::=", - /* 321 */ "language_opt ::= LANGUAGE NK_STRING", - /* 322 */ "or_replace_opt ::=", - /* 323 */ "or_replace_opt ::= OR REPLACE", - /* 324 */ "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", - /* 325 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 326 */ "col_list_opt ::=", - /* 327 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 328 */ "tag_def_or_ref_opt ::=", - /* 329 */ "tag_def_or_ref_opt ::= tags_def", - /* 330 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 331 */ "stream_options ::=", - /* 332 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 333 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 334 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 335 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 336 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 337 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 338 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 339 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 340 */ "subtable_opt ::=", - /* 341 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 342 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 343 */ "cmd ::= KILL QUERY NK_STRING", - /* 344 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 345 */ "cmd ::= BALANCE VGROUP", - /* 346 */ "cmd ::= BALANCE VGROUP LEADER", - /* 347 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 348 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 349 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 350 */ "dnode_list ::= DNODE NK_INTEGER", - /* 351 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 352 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 353 */ "cmd ::= query_or_subquery", - /* 354 */ "cmd ::= insert_query", - /* 355 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 356 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 357 */ "literal ::= NK_INTEGER", - /* 358 */ "literal ::= NK_FLOAT", - /* 359 */ "literal ::= NK_STRING", - /* 360 */ "literal ::= NK_BOOL", - /* 361 */ "literal ::= TIMESTAMP NK_STRING", - /* 362 */ "literal ::= duration_literal", - /* 363 */ "literal ::= NULL", - /* 364 */ "literal ::= NK_QUESTION", - /* 365 */ "duration_literal ::= NK_VARIABLE", - /* 366 */ "signed ::= NK_INTEGER", - /* 367 */ "signed ::= NK_PLUS NK_INTEGER", - /* 368 */ "signed ::= NK_MINUS NK_INTEGER", - /* 369 */ "signed ::= NK_FLOAT", - /* 370 */ "signed ::= NK_PLUS NK_FLOAT", - /* 371 */ "signed ::= NK_MINUS NK_FLOAT", - /* 372 */ "signed_literal ::= signed", - /* 373 */ "signed_literal ::= NK_STRING", - /* 374 */ "signed_literal ::= NK_BOOL", - /* 375 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 376 */ "signed_literal ::= duration_literal", - /* 377 */ "signed_literal ::= NULL", - /* 378 */ "signed_literal ::= literal_func", - /* 379 */ "signed_literal ::= NK_QUESTION", - /* 380 */ "literal_list ::= signed_literal", - /* 381 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 382 */ "db_name ::= NK_ID", - /* 383 */ "table_name ::= NK_ID", - /* 384 */ "column_name ::= NK_ID", - /* 385 */ "function_name ::= NK_ID", - /* 386 */ "table_alias ::= NK_ID", - /* 387 */ "column_alias ::= NK_ID", - /* 388 */ "user_name ::= NK_ID", - /* 389 */ "topic_name ::= NK_ID", - /* 390 */ "stream_name ::= NK_ID", - /* 391 */ "cgroup_name ::= NK_ID", - /* 392 */ "index_name ::= NK_ID", - /* 393 */ "expr_or_subquery ::= expression", - /* 394 */ "expression ::= literal", - /* 395 */ "expression ::= pseudo_column", - /* 396 */ "expression ::= column_reference", - /* 397 */ "expression ::= function_expression", - /* 398 */ "expression ::= case_when_expression", - /* 399 */ "expression ::= NK_LP expression NK_RP", - /* 400 */ "expression ::= NK_PLUS expr_or_subquery", - /* 401 */ "expression ::= NK_MINUS expr_or_subquery", - /* 402 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 403 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 404 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 405 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 406 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 407 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 408 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 409 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 410 */ "expression_list ::= expr_or_subquery", - /* 411 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 412 */ "column_reference ::= column_name", - /* 413 */ "column_reference ::= table_name NK_DOT column_name", - /* 414 */ "pseudo_column ::= ROWTS", - /* 415 */ "pseudo_column ::= TBNAME", - /* 416 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 417 */ "pseudo_column ::= QSTART", - /* 418 */ "pseudo_column ::= QEND", - /* 419 */ "pseudo_column ::= QDURATION", - /* 420 */ "pseudo_column ::= WSTART", - /* 421 */ "pseudo_column ::= WEND", - /* 422 */ "pseudo_column ::= WDURATION", - /* 423 */ "pseudo_column ::= IROWTS", - /* 424 */ "pseudo_column ::= ISFILLED", - /* 425 */ "pseudo_column ::= QTAGS", - /* 426 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 427 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 428 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 429 */ "function_expression ::= literal_func", - /* 430 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 431 */ "literal_func ::= NOW", - /* 432 */ "noarg_func ::= NOW", - /* 433 */ "noarg_func ::= TODAY", - /* 434 */ "noarg_func ::= TIMEZONE", - /* 435 */ "noarg_func ::= DATABASE", - /* 436 */ "noarg_func ::= CLIENT_VERSION", - /* 437 */ "noarg_func ::= SERVER_VERSION", - /* 438 */ "noarg_func ::= SERVER_STATUS", - /* 439 */ "noarg_func ::= CURRENT_USER", - /* 440 */ "noarg_func ::= USER", - /* 441 */ "star_func ::= COUNT", - /* 442 */ "star_func ::= FIRST", - /* 443 */ "star_func ::= LAST", - /* 444 */ "star_func ::= LAST_ROW", - /* 445 */ "star_func_para_list ::= NK_STAR", - /* 446 */ "star_func_para_list ::= other_para_list", - /* 447 */ "other_para_list ::= star_func_para", - /* 448 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 449 */ "star_func_para ::= expr_or_subquery", - /* 450 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 451 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 452 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 453 */ "when_then_list ::= when_then_expr", - /* 454 */ "when_then_list ::= when_then_list when_then_expr", - /* 455 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 456 */ "case_when_else_opt ::=", - /* 457 */ "case_when_else_opt ::= ELSE common_expression", - /* 458 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 459 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 460 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 461 */ "predicate ::= expr_or_subquery IS NULL", - /* 462 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 463 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 464 */ "compare_op ::= NK_LT", - /* 465 */ "compare_op ::= NK_GT", - /* 466 */ "compare_op ::= NK_LE", - /* 467 */ "compare_op ::= NK_GE", - /* 468 */ "compare_op ::= NK_NE", - /* 469 */ "compare_op ::= NK_EQ", - /* 470 */ "compare_op ::= LIKE", - /* 471 */ "compare_op ::= NOT LIKE", - /* 472 */ "compare_op ::= MATCH", - /* 473 */ "compare_op ::= NMATCH", - /* 474 */ "compare_op ::= CONTAINS", - /* 475 */ "in_op ::= IN", - /* 476 */ "in_op ::= NOT IN", - /* 477 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 478 */ "boolean_value_expression ::= boolean_primary", - /* 479 */ "boolean_value_expression ::= NOT boolean_primary", - /* 480 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 481 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 482 */ "boolean_primary ::= predicate", - /* 483 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 484 */ "common_expression ::= expr_or_subquery", - /* 485 */ "common_expression ::= boolean_value_expression", - /* 486 */ "from_clause_opt ::=", - /* 487 */ "from_clause_opt ::= FROM table_reference_list", - /* 488 */ "table_reference_list ::= table_reference", - /* 489 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 490 */ "table_reference ::= table_primary", - /* 491 */ "table_reference ::= joined_table", - /* 492 */ "table_primary ::= table_name alias_opt", - /* 493 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 494 */ "table_primary ::= subquery alias_opt", - /* 495 */ "table_primary ::= parenthesized_joined_table", - /* 496 */ "alias_opt ::=", - /* 497 */ "alias_opt ::= table_alias", - /* 498 */ "alias_opt ::= AS table_alias", - /* 499 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 500 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 501 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 502 */ "join_type ::=", - /* 503 */ "join_type ::= INNER", - /* 504 */ "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", - /* 505 */ "set_quantifier_opt ::=", - /* 506 */ "set_quantifier_opt ::= DISTINCT", - /* 507 */ "set_quantifier_opt ::= ALL", - /* 508 */ "select_list ::= select_item", - /* 509 */ "select_list ::= select_list NK_COMMA select_item", - /* 510 */ "select_item ::= NK_STAR", - /* 511 */ "select_item ::= common_expression", - /* 512 */ "select_item ::= common_expression column_alias", - /* 513 */ "select_item ::= common_expression AS column_alias", - /* 514 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 515 */ "where_clause_opt ::=", - /* 516 */ "where_clause_opt ::= WHERE search_condition", - /* 517 */ "partition_by_clause_opt ::=", - /* 518 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 519 */ "partition_list ::= partition_item", - /* 520 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 521 */ "partition_item ::= expr_or_subquery", - /* 522 */ "partition_item ::= expr_or_subquery column_alias", - /* 523 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 524 */ "twindow_clause_opt ::=", - /* 525 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 526 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 527 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 528 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 529 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 530 */ "sliding_opt ::=", - /* 531 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 532 */ "fill_opt ::=", - /* 533 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 534 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 535 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 536 */ "fill_mode ::= NONE", - /* 537 */ "fill_mode ::= PREV", - /* 538 */ "fill_mode ::= NULL", - /* 539 */ "fill_mode ::= NULL_F", - /* 540 */ "fill_mode ::= LINEAR", - /* 541 */ "fill_mode ::= NEXT", - /* 542 */ "group_by_clause_opt ::=", - /* 543 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 544 */ "group_by_list ::= expr_or_subquery", - /* 545 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 546 */ "having_clause_opt ::=", - /* 547 */ "having_clause_opt ::= HAVING search_condition", - /* 548 */ "range_opt ::=", - /* 549 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 550 */ "every_opt ::=", - /* 551 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 552 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 553 */ "query_simple ::= query_specification", - /* 554 */ "query_simple ::= union_query_expression", - /* 555 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 556 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 557 */ "query_simple_or_subquery ::= query_simple", - /* 558 */ "query_simple_or_subquery ::= subquery", - /* 559 */ "query_or_subquery ::= query_expression", - /* 560 */ "query_or_subquery ::= subquery", - /* 561 */ "order_by_clause_opt ::=", - /* 562 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 563 */ "slimit_clause_opt ::=", - /* 564 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 565 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 566 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 567 */ "limit_clause_opt ::=", - /* 568 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 569 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 570 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 571 */ "subquery ::= NK_LP query_expression NK_RP", - /* 572 */ "subquery ::= NK_LP subquery NK_RP", - /* 573 */ "search_condition ::= common_expression", - /* 574 */ "sort_specification_list ::= sort_specification", - /* 575 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 576 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 577 */ "ordering_specification_opt ::=", - /* 578 */ "ordering_specification_opt ::= ASC", - /* 579 */ "ordering_specification_opt ::= DESC", - /* 580 */ "null_ordering_opt ::=", - /* 581 */ "null_ordering_opt ::= NULLS FIRST", - /* 582 */ "null_ordering_opt ::= NULLS LAST", + /* 54 */ "cmd ::= RESTORE DNODE NK_INTEGER", + /* 55 */ "dnode_endpoint ::= NK_STRING", + /* 56 */ "dnode_endpoint ::= NK_ID", + /* 57 */ "dnode_endpoint ::= NK_IPTOKEN", + /* 58 */ "force_opt ::=", + /* 59 */ "force_opt ::= FORCE", + /* 60 */ "cmd ::= ALTER LOCAL NK_STRING", + /* 61 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", + /* 62 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", + /* 63 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 64 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", + /* 65 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", + /* 66 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", + /* 67 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", + /* 68 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", + /* 69 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", + /* 70 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", + /* 71 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", + /* 72 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", + /* 73 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 74 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 75 */ "cmd ::= USE db_name", + /* 76 */ "cmd ::= ALTER DATABASE db_name alter_db_options", + /* 77 */ "cmd ::= FLUSH DATABASE db_name", + /* 78 */ "cmd ::= TRIM DATABASE db_name speed_opt", + /* 79 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", + /* 80 */ "not_exists_opt ::= IF NOT EXISTS", + /* 81 */ "not_exists_opt ::=", + /* 82 */ "exists_opt ::= IF EXISTS", + /* 83 */ "exists_opt ::=", + /* 84 */ "db_options ::=", + /* 85 */ "db_options ::= db_options BUFFER NK_INTEGER", + /* 86 */ "db_options ::= db_options CACHEMODEL NK_STRING", + /* 87 */ "db_options ::= db_options CACHESIZE NK_INTEGER", + /* 88 */ "db_options ::= db_options COMP NK_INTEGER", + /* 89 */ "db_options ::= db_options DURATION NK_INTEGER", + /* 90 */ "db_options ::= db_options DURATION NK_VARIABLE", + /* 91 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 92 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 93 */ "db_options ::= db_options KEEP integer_list", + /* 94 */ "db_options ::= db_options KEEP variable_list", + /* 95 */ "db_options ::= db_options PAGES NK_INTEGER", + /* 96 */ "db_options ::= db_options PAGESIZE NK_INTEGER", + /* 97 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", + /* 98 */ "db_options ::= db_options PRECISION NK_STRING", + /* 99 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 100 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 101 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 102 */ "db_options ::= db_options RETENTIONS retention_list", + /* 103 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 104 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 105 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 106 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 107 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 108 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 109 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 110 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 111 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 112 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 113 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", + /* 114 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", + /* 115 */ "alter_db_options ::= alter_db_option", + /* 116 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 117 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 118 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 119 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 120 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 121 */ "alter_db_option ::= KEEP integer_list", + /* 122 */ "alter_db_option ::= KEEP variable_list", + /* 123 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 124 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 125 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 126 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 127 */ "alter_db_option ::= MINROWS NK_INTEGER", + /* 128 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", + /* 129 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 130 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", + /* 131 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 132 */ "integer_list ::= NK_INTEGER", + /* 133 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 134 */ "variable_list ::= NK_VARIABLE", + /* 135 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 136 */ "retention_list ::= retention", + /* 137 */ "retention_list ::= retention_list NK_COMMA retention", + /* 138 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 139 */ "speed_opt ::=", + /* 140 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 141 */ "start_opt ::=", + /* 142 */ "start_opt ::= START WITH NK_INTEGER", + /* 143 */ "start_opt ::= START WITH NK_STRING", + /* 144 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", + /* 145 */ "end_opt ::=", + /* 146 */ "end_opt ::= END WITH NK_INTEGER", + /* 147 */ "end_opt ::= END WITH NK_STRING", + /* 148 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", + /* 149 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 150 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 151 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 152 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 153 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 154 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 155 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 156 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 157 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 158 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 159 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 160 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 161 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 162 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 163 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 164 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 165 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 166 */ "multi_create_clause ::= create_subtable_clause", + /* 167 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 168 */ "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", + /* 169 */ "multi_drop_clause ::= drop_table_clause", + /* 170 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", + /* 171 */ "drop_table_clause ::= exists_opt full_table_name", + /* 172 */ "specific_cols_opt ::=", + /* 173 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 174 */ "full_table_name ::= table_name", + /* 175 */ "full_table_name ::= db_name NK_DOT table_name", + /* 176 */ "column_def_list ::= column_def", + /* 177 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 178 */ "column_def ::= column_name type_name", + /* 179 */ "type_name ::= BOOL", + /* 180 */ "type_name ::= TINYINT", + /* 181 */ "type_name ::= SMALLINT", + /* 182 */ "type_name ::= INT", + /* 183 */ "type_name ::= INTEGER", + /* 184 */ "type_name ::= BIGINT", + /* 185 */ "type_name ::= FLOAT", + /* 186 */ "type_name ::= DOUBLE", + /* 187 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 188 */ "type_name ::= TIMESTAMP", + /* 189 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 190 */ "type_name ::= TINYINT UNSIGNED", + /* 191 */ "type_name ::= SMALLINT UNSIGNED", + /* 192 */ "type_name ::= INT UNSIGNED", + /* 193 */ "type_name ::= BIGINT UNSIGNED", + /* 194 */ "type_name ::= JSON", + /* 195 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 196 */ "type_name ::= MEDIUMBLOB", + /* 197 */ "type_name ::= BLOB", + /* 198 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 199 */ "type_name ::= DECIMAL", + /* 200 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 201 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 202 */ "tags_def_opt ::=", + /* 203 */ "tags_def_opt ::= tags_def", + /* 204 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 205 */ "table_options ::=", + /* 206 */ "table_options ::= table_options COMMENT NK_STRING", + /* 207 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 208 */ "table_options ::= table_options WATERMARK duration_list", + /* 209 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 210 */ "table_options ::= table_options TTL NK_INTEGER", + /* 211 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 212 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 213 */ "alter_table_options ::= alter_table_option", + /* 214 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 215 */ "alter_table_option ::= COMMENT NK_STRING", + /* 216 */ "alter_table_option ::= TTL NK_INTEGER", + /* 217 */ "duration_list ::= duration_literal", + /* 218 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 219 */ "rollup_func_list ::= rollup_func_name", + /* 220 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 221 */ "rollup_func_name ::= function_name", + /* 222 */ "rollup_func_name ::= FIRST", + /* 223 */ "rollup_func_name ::= LAST", + /* 224 */ "col_name_list ::= col_name", + /* 225 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 226 */ "col_name ::= column_name", + /* 227 */ "cmd ::= SHOW DNODES", + /* 228 */ "cmd ::= SHOW USERS", + /* 229 */ "cmd ::= SHOW USER PRIVILEGES", + /* 230 */ "cmd ::= SHOW DATABASES", + /* 231 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 232 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 233 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 234 */ "cmd ::= SHOW MNODES", + /* 235 */ "cmd ::= SHOW QNODES", + /* 236 */ "cmd ::= SHOW FUNCTIONS", + /* 237 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 238 */ "cmd ::= SHOW STREAMS", + /* 239 */ "cmd ::= SHOW ACCOUNTS", + /* 240 */ "cmd ::= SHOW APPS", + /* 241 */ "cmd ::= SHOW CONNECTIONS", + /* 242 */ "cmd ::= SHOW LICENCES", + /* 243 */ "cmd ::= SHOW GRANTS", + /* 244 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 245 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 246 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 247 */ "cmd ::= SHOW QUERIES", + /* 248 */ "cmd ::= SHOW SCORES", + /* 249 */ "cmd ::= SHOW TOPICS", + /* 250 */ "cmd ::= SHOW VARIABLES", + /* 251 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 252 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 253 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 254 */ "cmd ::= SHOW BNODES", + /* 255 */ "cmd ::= SHOW SNODES", + /* 256 */ "cmd ::= SHOW CLUSTER", + /* 257 */ "cmd ::= SHOW TRANSACTIONS", + /* 258 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 259 */ "cmd ::= SHOW CONSUMERS", + /* 260 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 261 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 262 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 263 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 264 */ "cmd ::= SHOW VNODES NK_STRING", + /* 265 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 266 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 267 */ "db_name_cond_opt ::=", + /* 268 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 269 */ "like_pattern_opt ::=", + /* 270 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 271 */ "table_name_cond ::= table_name", + /* 272 */ "from_db_opt ::=", + /* 273 */ "from_db_opt ::= FROM db_name", + /* 274 */ "tag_list_opt ::=", + /* 275 */ "tag_list_opt ::= tag_item", + /* 276 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 277 */ "tag_item ::= TBNAME", + /* 278 */ "tag_item ::= QTAGS", + /* 279 */ "tag_item ::= column_name", + /* 280 */ "tag_item ::= column_name column_alias", + /* 281 */ "tag_item ::= column_name AS column_alias", + /* 282 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", + /* 283 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", + /* 284 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 285 */ "full_index_name ::= index_name", + /* 286 */ "full_index_name ::= db_name NK_DOT index_name", + /* 287 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 288 */ "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", + /* 289 */ "func_list ::= func", + /* 290 */ "func_list ::= func_list NK_COMMA func", + /* 291 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 292 */ "sma_func_name ::= function_name", + /* 293 */ "sma_func_name ::= COUNT", + /* 294 */ "sma_func_name ::= FIRST", + /* 295 */ "sma_func_name ::= LAST", + /* 296 */ "sma_func_name ::= LAST_ROW", + /* 297 */ "sma_stream_opt ::=", + /* 298 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 299 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 300 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 301 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 302 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 303 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 304 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 305 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 306 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 307 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 308 */ "cmd ::= DESC full_table_name", + /* 309 */ "cmd ::= DESCRIBE full_table_name", + /* 310 */ "cmd ::= RESET QUERY CACHE", + /* 311 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 312 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 313 */ "analyze_opt ::=", + /* 314 */ "analyze_opt ::= ANALYZE", + /* 315 */ "explain_options ::=", + /* 316 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 317 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 318 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 319 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 320 */ "agg_func_opt ::=", + /* 321 */ "agg_func_opt ::= AGGREGATE", + /* 322 */ "bufsize_opt ::=", + /* 323 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 324 */ "language_opt ::=", + /* 325 */ "language_opt ::= LANGUAGE NK_STRING", + /* 326 */ "or_replace_opt ::=", + /* 327 */ "or_replace_opt ::= OR REPLACE", + /* 328 */ "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 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 330 */ "col_list_opt ::=", + /* 331 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 332 */ "tag_def_or_ref_opt ::=", + /* 333 */ "tag_def_or_ref_opt ::= tags_def", + /* 334 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 335 */ "stream_options ::=", + /* 336 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 337 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 338 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 339 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 340 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 341 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 342 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 343 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 344 */ "subtable_opt ::=", + /* 345 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 346 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 347 */ "cmd ::= KILL QUERY NK_STRING", + /* 348 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 349 */ "cmd ::= BALANCE VGROUP", + /* 350 */ "cmd ::= BALANCE VGROUP LEADER", + /* 351 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 352 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 353 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 354 */ "dnode_list ::= DNODE NK_INTEGER", + /* 355 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 356 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 357 */ "cmd ::= query_or_subquery", + /* 358 */ "cmd ::= insert_query", + /* 359 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 360 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 361 */ "literal ::= NK_INTEGER", + /* 362 */ "literal ::= NK_FLOAT", + /* 363 */ "literal ::= NK_STRING", + /* 364 */ "literal ::= NK_BOOL", + /* 365 */ "literal ::= TIMESTAMP NK_STRING", + /* 366 */ "literal ::= duration_literal", + /* 367 */ "literal ::= NULL", + /* 368 */ "literal ::= NK_QUESTION", + /* 369 */ "duration_literal ::= NK_VARIABLE", + /* 370 */ "signed ::= NK_INTEGER", + /* 371 */ "signed ::= NK_PLUS NK_INTEGER", + /* 372 */ "signed ::= NK_MINUS NK_INTEGER", + /* 373 */ "signed ::= NK_FLOAT", + /* 374 */ "signed ::= NK_PLUS NK_FLOAT", + /* 375 */ "signed ::= NK_MINUS NK_FLOAT", + /* 376 */ "signed_literal ::= signed", + /* 377 */ "signed_literal ::= NK_STRING", + /* 378 */ "signed_literal ::= NK_BOOL", + /* 379 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 380 */ "signed_literal ::= duration_literal", + /* 381 */ "signed_literal ::= NULL", + /* 382 */ "signed_literal ::= literal_func", + /* 383 */ "signed_literal ::= NK_QUESTION", + /* 384 */ "literal_list ::= signed_literal", + /* 385 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 386 */ "db_name ::= NK_ID", + /* 387 */ "table_name ::= NK_ID", + /* 388 */ "column_name ::= NK_ID", + /* 389 */ "function_name ::= NK_ID", + /* 390 */ "table_alias ::= NK_ID", + /* 391 */ "column_alias ::= NK_ID", + /* 392 */ "user_name ::= NK_ID", + /* 393 */ "topic_name ::= NK_ID", + /* 394 */ "stream_name ::= NK_ID", + /* 395 */ "cgroup_name ::= NK_ID", + /* 396 */ "index_name ::= NK_ID", + /* 397 */ "expr_or_subquery ::= expression", + /* 398 */ "expression ::= literal", + /* 399 */ "expression ::= pseudo_column", + /* 400 */ "expression ::= column_reference", + /* 401 */ "expression ::= function_expression", + /* 402 */ "expression ::= case_when_expression", + /* 403 */ "expression ::= NK_LP expression NK_RP", + /* 404 */ "expression ::= NK_PLUS expr_or_subquery", + /* 405 */ "expression ::= NK_MINUS expr_or_subquery", + /* 406 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 407 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 408 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 409 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 410 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 411 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 412 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 413 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 414 */ "expression_list ::= expr_or_subquery", + /* 415 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 416 */ "column_reference ::= column_name", + /* 417 */ "column_reference ::= table_name NK_DOT column_name", + /* 418 */ "pseudo_column ::= ROWTS", + /* 419 */ "pseudo_column ::= TBNAME", + /* 420 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 421 */ "pseudo_column ::= QSTART", + /* 422 */ "pseudo_column ::= QEND", + /* 423 */ "pseudo_column ::= QDURATION", + /* 424 */ "pseudo_column ::= WSTART", + /* 425 */ "pseudo_column ::= WEND", + /* 426 */ "pseudo_column ::= WDURATION", + /* 427 */ "pseudo_column ::= IROWTS", + /* 428 */ "pseudo_column ::= ISFILLED", + /* 429 */ "pseudo_column ::= QTAGS", + /* 430 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 431 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 432 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 433 */ "function_expression ::= literal_func", + /* 434 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 435 */ "literal_func ::= NOW", + /* 436 */ "noarg_func ::= NOW", + /* 437 */ "noarg_func ::= TODAY", + /* 438 */ "noarg_func ::= TIMEZONE", + /* 439 */ "noarg_func ::= DATABASE", + /* 440 */ "noarg_func ::= CLIENT_VERSION", + /* 441 */ "noarg_func ::= SERVER_VERSION", + /* 442 */ "noarg_func ::= SERVER_STATUS", + /* 443 */ "noarg_func ::= CURRENT_USER", + /* 444 */ "noarg_func ::= USER", + /* 445 */ "star_func ::= COUNT", + /* 446 */ "star_func ::= FIRST", + /* 447 */ "star_func ::= LAST", + /* 448 */ "star_func ::= LAST_ROW", + /* 449 */ "star_func_para_list ::= NK_STAR", + /* 450 */ "star_func_para_list ::= other_para_list", + /* 451 */ "other_para_list ::= star_func_para", + /* 452 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 453 */ "star_func_para ::= expr_or_subquery", + /* 454 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 455 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 456 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 457 */ "when_then_list ::= when_then_expr", + /* 458 */ "when_then_list ::= when_then_list when_then_expr", + /* 459 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 460 */ "case_when_else_opt ::=", + /* 461 */ "case_when_else_opt ::= ELSE common_expression", + /* 462 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 463 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 464 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 465 */ "predicate ::= expr_or_subquery IS NULL", + /* 466 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 467 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 468 */ "compare_op ::= NK_LT", + /* 469 */ "compare_op ::= NK_GT", + /* 470 */ "compare_op ::= NK_LE", + /* 471 */ "compare_op ::= NK_GE", + /* 472 */ "compare_op ::= NK_NE", + /* 473 */ "compare_op ::= NK_EQ", + /* 474 */ "compare_op ::= LIKE", + /* 475 */ "compare_op ::= NOT LIKE", + /* 476 */ "compare_op ::= MATCH", + /* 477 */ "compare_op ::= NMATCH", + /* 478 */ "compare_op ::= CONTAINS", + /* 479 */ "in_op ::= IN", + /* 480 */ "in_op ::= NOT IN", + /* 481 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 482 */ "boolean_value_expression ::= boolean_primary", + /* 483 */ "boolean_value_expression ::= NOT boolean_primary", + /* 484 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 485 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 486 */ "boolean_primary ::= predicate", + /* 487 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 488 */ "common_expression ::= expr_or_subquery", + /* 489 */ "common_expression ::= boolean_value_expression", + /* 490 */ "from_clause_opt ::=", + /* 491 */ "from_clause_opt ::= FROM table_reference_list", + /* 492 */ "table_reference_list ::= table_reference", + /* 493 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 494 */ "table_reference ::= table_primary", + /* 495 */ "table_reference ::= joined_table", + /* 496 */ "table_primary ::= table_name alias_opt", + /* 497 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 498 */ "table_primary ::= subquery alias_opt", + /* 499 */ "table_primary ::= parenthesized_joined_table", + /* 500 */ "alias_opt ::=", + /* 501 */ "alias_opt ::= table_alias", + /* 502 */ "alias_opt ::= AS table_alias", + /* 503 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 504 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 505 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 506 */ "join_type ::=", + /* 507 */ "join_type ::= INNER", + /* 508 */ "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", + /* 509 */ "set_quantifier_opt ::=", + /* 510 */ "set_quantifier_opt ::= DISTINCT", + /* 511 */ "set_quantifier_opt ::= ALL", + /* 512 */ "select_list ::= select_item", + /* 513 */ "select_list ::= select_list NK_COMMA select_item", + /* 514 */ "select_item ::= NK_STAR", + /* 515 */ "select_item ::= common_expression", + /* 516 */ "select_item ::= common_expression column_alias", + /* 517 */ "select_item ::= common_expression AS column_alias", + /* 518 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 519 */ "where_clause_opt ::=", + /* 520 */ "where_clause_opt ::= WHERE search_condition", + /* 521 */ "partition_by_clause_opt ::=", + /* 522 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 523 */ "partition_list ::= partition_item", + /* 524 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 525 */ "partition_item ::= expr_or_subquery", + /* 526 */ "partition_item ::= expr_or_subquery column_alias", + /* 527 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 528 */ "twindow_clause_opt ::=", + /* 529 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 530 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 531 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 532 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 533 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 534 */ "sliding_opt ::=", + /* 535 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 536 */ "fill_opt ::=", + /* 537 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 538 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 539 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 540 */ "fill_mode ::= NONE", + /* 541 */ "fill_mode ::= PREV", + /* 542 */ "fill_mode ::= NULL", + /* 543 */ "fill_mode ::= NULL_F", + /* 544 */ "fill_mode ::= LINEAR", + /* 545 */ "fill_mode ::= NEXT", + /* 546 */ "group_by_clause_opt ::=", + /* 547 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 548 */ "group_by_list ::= expr_or_subquery", + /* 549 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 550 */ "having_clause_opt ::=", + /* 551 */ "having_clause_opt ::= HAVING search_condition", + /* 552 */ "range_opt ::=", + /* 553 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 554 */ "every_opt ::=", + /* 555 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 556 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 557 */ "query_simple ::= query_specification", + /* 558 */ "query_simple ::= union_query_expression", + /* 559 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 560 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 561 */ "query_simple_or_subquery ::= query_simple", + /* 562 */ "query_simple_or_subquery ::= subquery", + /* 563 */ "query_or_subquery ::= query_expression", + /* 564 */ "query_or_subquery ::= subquery", + /* 565 */ "order_by_clause_opt ::=", + /* 566 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 567 */ "slimit_clause_opt ::=", + /* 568 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 569 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 570 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 571 */ "limit_clause_opt ::=", + /* 572 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 573 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 574 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 575 */ "subquery ::= NK_LP query_expression NK_RP", + /* 576 */ "subquery ::= NK_LP subquery NK_RP", + /* 577 */ "search_condition ::= common_expression", + /* 578 */ "sort_specification_list ::= sort_specification", + /* 579 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 580 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 581 */ "ordering_specification_opt ::=", + /* 582 */ "ordering_specification_opt ::= ASC", + /* 583 */ "ordering_specification_opt ::= DESC", + /* 584 */ "null_ordering_opt ::=", + /* 585 */ "null_ordering_opt ::= NULLS FIRST", + /* 586 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2653,208 +2729,208 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 330: /* cmd */ - case 333: /* literal */ - case 339: /* with_opt */ - case 345: /* search_condition */ - case 349: /* db_options */ - case 351: /* alter_db_options */ - case 353: /* start_opt */ - case 354: /* end_opt */ - case 359: /* retention */ - case 360: /* full_table_name */ - case 363: /* table_options */ - case 367: /* alter_table_clause */ - case 368: /* alter_table_options */ - case 371: /* signed_literal */ - case 372: /* create_subtable_clause */ - case 375: /* drop_table_clause */ - case 377: /* column_def */ - case 381: /* duration_literal */ - case 382: /* rollup_func_name */ - case 384: /* col_name */ - case 385: /* db_name_cond_opt */ - case 386: /* like_pattern_opt */ - case 387: /* table_name_cond */ - case 388: /* from_db_opt */ - case 390: /* tag_item */ - case 392: /* full_index_name */ - case 393: /* index_options */ - case 396: /* sliding_opt */ - case 397: /* sma_stream_opt */ - case 398: /* func */ - case 400: /* query_or_subquery */ - case 403: /* explain_options */ - case 404: /* insert_query */ - case 410: /* stream_options */ - case 413: /* subtable_opt */ - case 414: /* expression */ - case 416: /* where_clause_opt */ - case 417: /* signed */ - case 418: /* literal_func */ - case 421: /* expr_or_subquery */ - case 422: /* pseudo_column */ - case 423: /* column_reference */ - case 424: /* function_expression */ - case 425: /* case_when_expression */ - case 430: /* star_func_para */ - case 432: /* case_when_else_opt */ - case 433: /* common_expression */ - case 434: /* when_then_expr */ - case 435: /* predicate */ - case 438: /* in_predicate_value */ - case 439: /* boolean_value_expression */ - case 440: /* boolean_primary */ - case 441: /* from_clause_opt */ - case 442: /* table_reference_list */ - case 443: /* table_reference */ - case 444: /* table_primary */ - case 445: /* joined_table */ - case 447: /* subquery */ - case 448: /* parenthesized_joined_table */ - case 450: /* query_specification */ - case 454: /* range_opt */ - case 455: /* every_opt */ - case 456: /* fill_opt */ - case 457: /* twindow_clause_opt */ - case 459: /* having_clause_opt */ - case 460: /* select_item */ - case 462: /* partition_item */ - case 465: /* query_expression */ - case 466: /* query_simple */ - case 468: /* slimit_clause_opt */ - case 469: /* limit_clause_opt */ - case 470: /* union_query_expression */ - case 471: /* query_simple_or_subquery */ - case 473: /* sort_specification */ + case 332: /* cmd */ + case 335: /* literal */ + case 341: /* with_opt */ + case 347: /* search_condition */ + case 351: /* db_options */ + case 353: /* alter_db_options */ + case 355: /* start_opt */ + case 356: /* end_opt */ + case 361: /* retention */ + case 362: /* full_table_name */ + case 365: /* table_options */ + case 369: /* alter_table_clause */ + case 370: /* alter_table_options */ + case 373: /* signed_literal */ + case 374: /* create_subtable_clause */ + case 377: /* drop_table_clause */ + case 379: /* column_def */ + case 383: /* duration_literal */ + case 384: /* rollup_func_name */ + case 386: /* col_name */ + case 387: /* db_name_cond_opt */ + case 388: /* like_pattern_opt */ + case 389: /* table_name_cond */ + case 390: /* from_db_opt */ + case 392: /* tag_item */ + case 394: /* full_index_name */ + case 395: /* index_options */ + case 398: /* sliding_opt */ + case 399: /* sma_stream_opt */ + case 400: /* func */ + case 402: /* query_or_subquery */ + case 405: /* explain_options */ + case 406: /* insert_query */ + case 412: /* stream_options */ + case 415: /* subtable_opt */ + case 416: /* expression */ + case 418: /* where_clause_opt */ + case 419: /* signed */ + case 420: /* literal_func */ + case 423: /* expr_or_subquery */ + case 424: /* pseudo_column */ + case 425: /* column_reference */ + case 426: /* function_expression */ + case 427: /* case_when_expression */ + case 432: /* star_func_para */ + case 434: /* case_when_else_opt */ + case 435: /* common_expression */ + case 436: /* when_then_expr */ + case 437: /* predicate */ + case 440: /* in_predicate_value */ + case 441: /* boolean_value_expression */ + case 442: /* boolean_primary */ + case 443: /* from_clause_opt */ + case 444: /* table_reference_list */ + case 445: /* table_reference */ + case 446: /* table_primary */ + case 447: /* joined_table */ + case 449: /* subquery */ + case 450: /* parenthesized_joined_table */ + case 452: /* query_specification */ + case 456: /* range_opt */ + case 457: /* every_opt */ + case 458: /* fill_opt */ + case 459: /* twindow_clause_opt */ + case 461: /* having_clause_opt */ + case 462: /* select_item */ + case 464: /* partition_item */ + case 467: /* query_expression */ + case 468: /* query_simple */ + case 470: /* slimit_clause_opt */ + case 471: /* limit_clause_opt */ + case 472: /* union_query_expression */ + case 473: /* query_simple_or_subquery */ + case 475: /* sort_specification */ { - nodesDestroyNode((yypminor->yy448)); + nodesDestroyNode((yypminor->yy184)); } break; - case 331: /* account_options */ - case 332: /* alter_account_options */ - case 334: /* alter_account_option */ - case 352: /* speed_opt */ - case 407: /* bufsize_opt */ + case 333: /* account_options */ + case 334: /* alter_account_options */ + case 336: /* alter_account_option */ + case 354: /* speed_opt */ + case 409: /* bufsize_opt */ { } break; - case 335: /* user_name */ - case 342: /* db_name */ - case 343: /* table_name */ - case 344: /* topic_name */ - case 346: /* dnode_endpoint */ - case 369: /* column_name */ - case 383: /* function_name */ - case 391: /* column_alias */ - case 394: /* index_name */ - case 399: /* sma_func_name */ - case 401: /* cgroup_name */ - case 408: /* language_opt */ - case 409: /* stream_name */ - case 420: /* table_alias */ - case 426: /* star_func */ - case 428: /* noarg_func */ - case 446: /* alias_opt */ + case 337: /* user_name */ + case 344: /* db_name */ + case 345: /* table_name */ + case 346: /* topic_name */ + case 348: /* dnode_endpoint */ + case 371: /* column_name */ + case 385: /* function_name */ + case 393: /* column_alias */ + case 396: /* index_name */ + case 401: /* sma_func_name */ + case 403: /* cgroup_name */ + case 410: /* language_opt */ + case 411: /* stream_name */ + case 422: /* table_alias */ + case 428: /* star_func */ + case 430: /* noarg_func */ + case 448: /* alias_opt */ { } break; - case 336: /* sysinfo_opt */ + case 338: /* sysinfo_opt */ { } break; - case 337: /* privileges */ - case 340: /* priv_type_list */ - case 341: /* priv_type */ + case 339: /* privileges */ + case 342: /* priv_type_list */ + case 343: /* priv_type */ { } break; - case 338: /* priv_level */ + case 340: /* priv_level */ { } break; - case 347: /* force_opt */ - case 348: /* not_exists_opt */ - case 350: /* exists_opt */ - case 402: /* analyze_opt */ - case 405: /* or_replace_opt */ - case 406: /* agg_func_opt */ - case 451: /* set_quantifier_opt */ + case 349: /* force_opt */ + case 350: /* not_exists_opt */ + case 352: /* exists_opt */ + case 404: /* analyze_opt */ + case 407: /* or_replace_opt */ + case 408: /* agg_func_opt */ + case 453: /* set_quantifier_opt */ { } break; - case 355: /* integer_list */ - case 356: /* variable_list */ - case 357: /* retention_list */ - case 361: /* column_def_list */ - case 362: /* tags_def_opt */ - case 364: /* multi_create_clause */ - case 365: /* tags_def */ - case 366: /* multi_drop_clause */ - case 373: /* specific_cols_opt */ - case 374: /* expression_list */ - case 376: /* col_name_list */ - case 378: /* duration_list */ - case 379: /* rollup_func_list */ - case 389: /* tag_list_opt */ - case 395: /* func_list */ - case 411: /* col_list_opt */ - case 412: /* tag_def_or_ref_opt */ - case 415: /* dnode_list */ - case 419: /* literal_list */ - case 427: /* star_func_para_list */ - case 429: /* other_para_list */ - case 431: /* when_then_list */ - case 452: /* select_list */ - case 453: /* partition_by_clause_opt */ - case 458: /* group_by_clause_opt */ - case 461: /* partition_list */ - case 464: /* group_by_list */ - case 467: /* order_by_clause_opt */ - case 472: /* sort_specification_list */ + case 357: /* integer_list */ + case 358: /* variable_list */ + case 359: /* retention_list */ + case 363: /* column_def_list */ + case 364: /* tags_def_opt */ + case 366: /* multi_create_clause */ + case 367: /* tags_def */ + case 368: /* multi_drop_clause */ + case 375: /* specific_cols_opt */ + case 376: /* expression_list */ + case 378: /* col_name_list */ + case 380: /* duration_list */ + case 381: /* rollup_func_list */ + case 391: /* tag_list_opt */ + case 397: /* func_list */ + case 413: /* col_list_opt */ + case 414: /* tag_def_or_ref_opt */ + case 417: /* dnode_list */ + case 421: /* literal_list */ + case 429: /* star_func_para_list */ + case 431: /* other_para_list */ + case 433: /* when_then_list */ + case 454: /* select_list */ + case 455: /* partition_by_clause_opt */ + case 460: /* group_by_clause_opt */ + case 463: /* partition_list */ + case 466: /* group_by_list */ + case 469: /* order_by_clause_opt */ + case 474: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy432)); + nodesDestroyList((yypminor->yy532)); } break; - case 358: /* alter_db_option */ - case 380: /* alter_table_option */ + case 360: /* alter_db_option */ + case 382: /* alter_table_option */ { } break; - case 370: /* type_name */ + case 372: /* type_name */ { } break; - case 436: /* compare_op */ - case 437: /* in_op */ + case 438: /* compare_op */ + case 439: /* in_op */ { } break; - case 449: /* join_type */ + case 451: /* join_type */ { } break; - case 463: /* fill_mode */ + case 465: /* fill_mode */ { } break; - case 474: /* ordering_specification_opt */ + case 476: /* ordering_specification_opt */ { } break; - case 475: /* null_ordering_opt */ + case 477: /* null_ordering_opt */ { } @@ -2982,15 +3058,18 @@ static YYACTIONTYPE yy_find_shift_action( do{ i = yy_shift_ofst[stateno]; assert( i>=0 ); - /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */ + assert( i<=YY_ACTTAB_COUNT ); + assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; - if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){ + assert( i<(int)YY_NLOOKAHEAD ); + if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", @@ -3005,16 +3084,8 @@ static YYACTIONTYPE yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ + assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); + if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -3028,6 +3099,7 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ + assert( i>=0 && iyytos; #ifndef NDEBUG if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; + yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyTracePrompt, - yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; @@ -3824,11 +4491,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,331,&yymsp[0].minor); + yy_destructor(yypParser,333,&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,332,&yymsp[0].minor); + yy_destructor(yypParser,334,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3842,20 +4509,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,331,&yymsp[-2].minor); +{ yy_destructor(yypParser,333,&yymsp[-2].minor); { } - yy_destructor(yypParser,333,&yymsp[0].minor); + yy_destructor(yypParser,335,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,334,&yymsp[0].minor); +{ yy_destructor(yypParser,336,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,332,&yymsp[-1].minor); +{ yy_destructor(yypParser,334,&yymsp[-1].minor); { } - yy_destructor(yypParser,334,&yymsp[0].minor); + yy_destructor(yypParser,336,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3869,107 +4536,107 @@ 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,333,&yymsp[0].minor); + yy_destructor(yypParser,335,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy113, &yymsp[-1].minor.yy0, yymsp[0].minor.yy551); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy649, &yymsp[-1].minor.yy0, yymsp[0].minor.yy231); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy113, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, 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.yy113, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, 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.yy113, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy649); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy551 = 1; } +{ yymsp[1].minor.yy231 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy551 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy231 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy837, &yymsp[-3].minor.yy777, &yymsp[0].minor.yy113, yymsp[-2].minor.yy448); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy541, &yymsp[-3].minor.yy409, &yymsp[0].minor.yy649, yymsp[-2].minor.yy184); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy837, &yymsp[-3].minor.yy777, &yymsp[0].minor.yy113, yymsp[-2].minor.yy448); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy541, &yymsp[-3].minor.yy409, &yymsp[0].minor.yy649, yymsp[-2].minor.yy184); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy837 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy541 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy837 = yymsp[0].minor.yy837; } - yymsp[0].minor.yy837 = yylhsminor.yy837; +{ yylhsminor.yy541 = yymsp[0].minor.yy541; } + yymsp[0].minor.yy541 = yylhsminor.yy541; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy837 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy541 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy837 = yymsp[-2].minor.yy837 | yymsp[0].minor.yy837; } - yymsp[-2].minor.yy837 = yylhsminor.yy837; +{ yylhsminor.yy541 = yymsp[-2].minor.yy541 | yymsp[0].minor.yy541; } + yymsp[-2].minor.yy541 = yylhsminor.yy541; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy837 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy541 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy837 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy541 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy777.first = yymsp[-2].minor.yy0; yylhsminor.yy777.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy409.first = yymsp[-2].minor.yy0; yylhsminor.yy409.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy409 = yylhsminor.yy409; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy777.first = yymsp[-2].minor.yy113; yylhsminor.yy777.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy409.first = yymsp[-2].minor.yy649; yylhsminor.yy409.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy409 = yylhsminor.yy409; break; case 42: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy777.first = yymsp[-2].minor.yy113; yylhsminor.yy777.second = yymsp[0].minor.yy113; } - yymsp[-2].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy409.first = yymsp[-2].minor.yy649; yylhsminor.yy409.second = yymsp[0].minor.yy649; } + yymsp[-2].minor.yy409 = yylhsminor.yy409; break; case 43: /* priv_level ::= topic_name */ -{ yylhsminor.yy777.first = yymsp[0].minor.yy113; yylhsminor.yy777.second = nil_token; } - yymsp[0].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy409.first = yymsp[0].minor.yy649; yylhsminor.yy409.second = nil_token; } + yymsp[0].minor.yy409 = yylhsminor.yy409; break; case 44: /* with_opt ::= */ - case 137: /* start_opt ::= */ yytestcase(yyruleno==137); - case 141: /* end_opt ::= */ yytestcase(yyruleno==141); - case 265: /* like_pattern_opt ::= */ yytestcase(yyruleno==265); - case 340: /* subtable_opt ::= */ yytestcase(yyruleno==340); - case 456: /* case_when_else_opt ::= */ yytestcase(yyruleno==456); - case 486: /* from_clause_opt ::= */ yytestcase(yyruleno==486); - case 515: /* where_clause_opt ::= */ yytestcase(yyruleno==515); - case 524: /* twindow_clause_opt ::= */ yytestcase(yyruleno==524); - case 530: /* sliding_opt ::= */ yytestcase(yyruleno==530); - case 532: /* fill_opt ::= */ yytestcase(yyruleno==532); - case 546: /* having_clause_opt ::= */ yytestcase(yyruleno==546); - case 548: /* range_opt ::= */ yytestcase(yyruleno==548); - case 550: /* every_opt ::= */ yytestcase(yyruleno==550); - case 563: /* slimit_clause_opt ::= */ yytestcase(yyruleno==563); - case 567: /* limit_clause_opt ::= */ yytestcase(yyruleno==567); -{ yymsp[1].minor.yy448 = NULL; } + case 141: /* start_opt ::= */ yytestcase(yyruleno==141); + case 145: /* end_opt ::= */ yytestcase(yyruleno==145); + case 269: /* like_pattern_opt ::= */ yytestcase(yyruleno==269); + case 344: /* subtable_opt ::= */ yytestcase(yyruleno==344); + case 460: /* case_when_else_opt ::= */ yytestcase(yyruleno==460); + case 490: /* from_clause_opt ::= */ yytestcase(yyruleno==490); + case 519: /* where_clause_opt ::= */ yytestcase(yyruleno==519); + case 528: /* twindow_clause_opt ::= */ yytestcase(yyruleno==528); + case 534: /* sliding_opt ::= */ yytestcase(yyruleno==534); + case 536: /* fill_opt ::= */ yytestcase(yyruleno==536); + case 550: /* having_clause_opt ::= */ yytestcase(yyruleno==550); + case 552: /* range_opt ::= */ yytestcase(yyruleno==552); + case 554: /* every_opt ::= */ yytestcase(yyruleno==554); + case 567: /* slimit_clause_opt ::= */ yytestcase(yyruleno==567); + case 571: /* limit_clause_opt ::= */ yytestcase(yyruleno==571); +{ yymsp[1].minor.yy184 = NULL; } break; case 45: /* with_opt ::= WITH search_condition */ - case 487: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==487); - case 516: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==516); - case 547: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==547); -{ yymsp[-1].minor.yy448 = yymsp[0].minor.yy448; } + case 491: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==491); + case 520: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==520); + case 551: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==551); +{ yymsp[-1].minor.yy184 = yymsp[0].minor.yy184; } break; case 46: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy113, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy649, NULL); } break; case 47: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0); } break; case 48: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy369); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy829); } break; case 49: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy369); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy829); } break; case 50: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3983,1494 +4650,1506 @@ static YYACTIONTYPE yy_reduce( case 53: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 54: /* dnode_endpoint ::= NK_STRING */ - case 55: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==55); - case 56: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==56); - case 289: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==289); - case 290: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==290); - case 291: /* sma_func_name ::= LAST */ yytestcase(yyruleno==291); - case 292: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==292); - case 382: /* db_name ::= NK_ID */ yytestcase(yyruleno==382); - case 383: /* table_name ::= NK_ID */ yytestcase(yyruleno==383); - case 384: /* column_name ::= NK_ID */ yytestcase(yyruleno==384); - case 385: /* function_name ::= NK_ID */ yytestcase(yyruleno==385); - case 386: /* table_alias ::= NK_ID */ yytestcase(yyruleno==386); - case 387: /* column_alias ::= NK_ID */ yytestcase(yyruleno==387); - case 388: /* user_name ::= NK_ID */ yytestcase(yyruleno==388); - case 389: /* topic_name ::= NK_ID */ yytestcase(yyruleno==389); - case 390: /* stream_name ::= NK_ID */ yytestcase(yyruleno==390); - case 391: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==391); - case 392: /* index_name ::= NK_ID */ yytestcase(yyruleno==392); - case 432: /* noarg_func ::= NOW */ yytestcase(yyruleno==432); - case 433: /* noarg_func ::= TODAY */ yytestcase(yyruleno==433); - case 434: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==434); - case 435: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==435); - case 436: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==436); - case 437: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==437); - case 438: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==438); - case 439: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==439); - case 440: /* noarg_func ::= USER */ yytestcase(yyruleno==440); - case 441: /* star_func ::= COUNT */ yytestcase(yyruleno==441); - case 442: /* star_func ::= FIRST */ yytestcase(yyruleno==442); - case 443: /* star_func ::= LAST */ yytestcase(yyruleno==443); - case 444: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==444); -{ yylhsminor.yy113 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy113 = yylhsminor.yy113; + case 54: /* cmd ::= RESTORE DNODE NK_INTEGER */ +{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } break; - case 57: /* force_opt ::= */ - case 77: /* not_exists_opt ::= */ yytestcase(yyruleno==77); - case 79: /* exists_opt ::= */ yytestcase(yyruleno==79); - case 309: /* analyze_opt ::= */ yytestcase(yyruleno==309); - case 316: /* agg_func_opt ::= */ yytestcase(yyruleno==316); - case 322: /* or_replace_opt ::= */ yytestcase(yyruleno==322); - case 505: /* set_quantifier_opt ::= */ yytestcase(yyruleno==505); -{ yymsp[1].minor.yy369 = false; } + case 55: /* dnode_endpoint ::= NK_STRING */ + case 56: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==56); + case 57: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==57); + case 293: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==293); + case 294: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==294); + case 295: /* sma_func_name ::= LAST */ yytestcase(yyruleno==295); + case 296: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==296); + case 386: /* db_name ::= NK_ID */ yytestcase(yyruleno==386); + case 387: /* table_name ::= NK_ID */ yytestcase(yyruleno==387); + case 388: /* column_name ::= NK_ID */ yytestcase(yyruleno==388); + case 389: /* function_name ::= NK_ID */ yytestcase(yyruleno==389); + case 390: /* table_alias ::= NK_ID */ yytestcase(yyruleno==390); + case 391: /* column_alias ::= NK_ID */ yytestcase(yyruleno==391); + case 392: /* user_name ::= NK_ID */ yytestcase(yyruleno==392); + case 393: /* topic_name ::= NK_ID */ yytestcase(yyruleno==393); + case 394: /* stream_name ::= NK_ID */ yytestcase(yyruleno==394); + case 395: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==395); + case 396: /* index_name ::= NK_ID */ yytestcase(yyruleno==396); + case 436: /* noarg_func ::= NOW */ yytestcase(yyruleno==436); + case 437: /* noarg_func ::= TODAY */ yytestcase(yyruleno==437); + case 438: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==438); + case 439: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==439); + case 440: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==440); + case 441: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==441); + case 442: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==442); + case 443: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==443); + case 444: /* noarg_func ::= USER */ yytestcase(yyruleno==444); + case 445: /* star_func ::= COUNT */ yytestcase(yyruleno==445); + case 446: /* star_func ::= FIRST */ yytestcase(yyruleno==446); + case 447: /* star_func ::= LAST */ yytestcase(yyruleno==447); + case 448: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==448); +{ yylhsminor.yy649 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy649 = yylhsminor.yy649; break; - case 58: /* force_opt ::= FORCE */ - case 310: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==310); - case 317: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==317); - case 506: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==506); -{ yymsp[0].minor.yy369 = true; } + case 58: /* force_opt ::= */ + case 81: /* not_exists_opt ::= */ yytestcase(yyruleno==81); + case 83: /* exists_opt ::= */ yytestcase(yyruleno==83); + case 313: /* analyze_opt ::= */ yytestcase(yyruleno==313); + case 320: /* agg_func_opt ::= */ yytestcase(yyruleno==320); + case 326: /* or_replace_opt ::= */ yytestcase(yyruleno==326); + case 509: /* set_quantifier_opt ::= */ yytestcase(yyruleno==509); +{ yymsp[1].minor.yy829 = false; } break; - case 59: /* cmd ::= ALTER LOCAL NK_STRING */ + case 59: /* force_opt ::= FORCE */ + case 314: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==314); + case 321: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==321); + case 510: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==510); +{ yymsp[0].minor.yy829 = true; } + break; + case 60: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 60: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + case 61: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 61: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + case 62: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 62: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + case 63: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 63: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + case 64: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ +{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 65: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 64: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + case 66: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 65: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + case 67: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 66: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + case 68: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 67: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + case 69: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 68: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + case 70: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 69: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy369, &yymsp[-1].minor.yy113, yymsp[0].minor.yy448); } + case 71: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ +{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 70: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy369, &yymsp[0].minor.yy113); } + case 72: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ +{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; - case 71: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy113); } + case 73: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy829, &yymsp[-1].minor.yy649, yymsp[0].minor.yy184); } break; - case 72: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy448); } + case 74: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy829, &yymsp[0].minor.yy649); } break; - case 73: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy113); } + case 75: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy649); } break; - case 74: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy788); } + case 76: /* cmd ::= ALTER DATABASE db_name alter_db_options */ +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy184); } break; - case 75: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy113, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 77: /* cmd ::= FLUSH DATABASE db_name */ +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy649); } break; - case 76: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy369 = true; } + case 78: /* cmd ::= TRIM DATABASE db_name speed_opt */ +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy480); } break; - case 78: /* exists_opt ::= IF EXISTS */ - case 323: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==323); -{ yymsp[-1].minor.yy369 = true; } + case 79: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy649, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 80: /* db_options ::= */ -{ yymsp[1].minor.yy448 = createDefaultDatabaseOptions(pCxt); } + case 80: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy829 = true; } break; - case 81: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 82: /* exists_opt ::= IF EXISTS */ + case 327: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==327); +{ yymsp[-1].minor.yy829 = true; } break; - case 82: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 84: /* db_options ::= */ +{ yymsp[1].minor.yy184 = createDefaultDatabaseOptions(pCxt); } break; - case 83: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 85: /* db_options ::= db_options BUFFER NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 84: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 86: /* db_options ::= db_options CACHEMODEL NK_STRING */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 85: /* db_options ::= db_options DURATION NK_INTEGER */ - case 86: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==86); -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 87: /* db_options ::= db_options CACHESIZE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 87: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 88: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 88: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 89: /* db_options ::= db_options DURATION NK_INTEGER */ + case 90: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==90); +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 89: /* db_options ::= db_options KEEP integer_list */ - case 90: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==90); -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_KEEP, yymsp[0].minor.yy432); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 91: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 91: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 92: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 92: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 93: /* db_options ::= db_options KEEP integer_list */ + case 94: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==94); +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_KEEP, yymsp[0].minor.yy532); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 93: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 95: /* db_options ::= db_options PAGES NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 94: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 96: /* db_options ::= db_options PAGESIZE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 95: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 97: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 96: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 98: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 97: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 99: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 98: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_RETENTIONS, yymsp[0].minor.yy432); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 100: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 99: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 101: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 100: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 102: /* db_options ::= db_options RETENTIONS retention_list */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_RETENTIONS, yymsp[0].minor.yy532); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 101: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 103: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 102: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 104: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 103: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 105: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; + break; + case 106: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; + break; + case 107: /* 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.yy448 = setDatabaseOption(pCxt, yymsp[-3].minor.yy448, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-3].minor.yy184, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 104: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 108: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 105: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 109: /* 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.yy448 = setDatabaseOption(pCxt, yymsp[-3].minor.yy448, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-3].minor.yy184, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 106: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 110: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 107: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 111: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 108: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 112: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 109: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 113: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 110: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy448 = setDatabaseOption(pCxt, yymsp[-2].minor.yy448, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 114: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 111: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy448 = createAlterDatabaseOptions(pCxt); yylhsminor.yy448 = setAlterDatabaseOption(pCxt, yylhsminor.yy448, &yymsp[0].minor.yy53); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 115: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy184 = createAlterDatabaseOptions(pCxt); yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yylhsminor.yy184, &yymsp[0].minor.yy361); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 112: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy448 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy448, &yymsp[0].minor.yy53); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 116: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy184, &yymsp[0].minor.yy361); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 113: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 117: /* alter_db_option ::= BUFFER NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 114: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 118: /* alter_db_option ::= CACHEMODEL NK_STRING */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 115: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 119: /* alter_db_option ::= CACHESIZE NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 116: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 120: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 117: /* alter_db_option ::= KEEP integer_list */ - case 118: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==118); -{ yymsp[-1].minor.yy53.type = DB_OPTION_KEEP; yymsp[-1].minor.yy53.pList = yymsp[0].minor.yy432; } + case 121: /* alter_db_option ::= KEEP integer_list */ + case 122: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==122); +{ yymsp[-1].minor.yy361.type = DB_OPTION_KEEP; yymsp[-1].minor.yy361.pList = yymsp[0].minor.yy532; } break; - case 119: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_PAGES; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 123: /* alter_db_option ::= PAGES NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_PAGES; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 120: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 124: /* alter_db_option ::= REPLICA NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 121: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_WAL; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 125: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_WAL; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 122: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 126: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 123: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 127: /* alter_db_option ::= MINROWS NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 124: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 128: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 125: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 129: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy53.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy53.val = t; + yymsp[-2].minor.yy361.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy361.val = t; } break; - case 126: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 130: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 127: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 131: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy53.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy53.val = t; + yymsp[-2].minor.yy361.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy361.val = t; } break; - case 128: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy432 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy432 = yylhsminor.yy432; - break; - case 129: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 351: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==351); -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-2].minor.yy432, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; - break; - case 130: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy432 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy432 = yylhsminor.yy432; - break; - case 131: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-2].minor.yy432, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; - break; - case 132: /* retention_list ::= retention */ - case 162: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==162); - case 165: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==165); - case 172: /* column_def_list ::= column_def */ yytestcase(yyruleno==172); - case 215: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==215); - case 220: /* col_name_list ::= col_name */ yytestcase(yyruleno==220); - case 271: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==271); - case 285: /* func_list ::= func */ yytestcase(yyruleno==285); - case 380: /* literal_list ::= signed_literal */ yytestcase(yyruleno==380); - case 447: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==447); - case 453: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==453); - case 508: /* select_list ::= select_item */ yytestcase(yyruleno==508); - case 519: /* partition_list ::= partition_item */ yytestcase(yyruleno==519); - case 574: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==574); -{ yylhsminor.yy432 = createNodeList(pCxt, yymsp[0].minor.yy448); } - yymsp[0].minor.yy432 = yylhsminor.yy432; - break; - case 133: /* retention_list ::= retention_list NK_COMMA retention */ - case 166: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==166); - case 173: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==173); - case 216: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==216); - case 221: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==221); - case 272: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==272); - case 286: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==286); - case 381: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==381); - case 448: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==448); - case 509: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==509); - case 520: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==520); - case 575: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==575); -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-2].minor.yy432, yymsp[0].minor.yy448); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; - break; - case 134: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy448 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; - break; - case 135: /* speed_opt ::= */ - case 318: /* bufsize_opt ::= */ yytestcase(yyruleno==318); -{ yymsp[1].minor.yy788 = 0; } - break; - case 136: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 319: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==319); -{ yymsp[-1].minor.yy788 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 138: /* start_opt ::= START WITH NK_INTEGER */ - case 142: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==142); -{ yymsp[-2].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 139: /* start_opt ::= START WITH NK_STRING */ - case 143: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==143); -{ yymsp[-2].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 140: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ - case 144: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==144); -{ yymsp[-3].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 145: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 147: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==147); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy369, yymsp[-5].minor.yy448, yymsp[-3].minor.yy432, yymsp[-1].minor.yy432, yymsp[0].minor.yy448); } - break; - case 146: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy432); } - break; - case 148: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy432); } - break; - case 149: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy369, yymsp[0].minor.yy448); } - break; - case 150: /* cmd ::= ALTER TABLE alter_table_clause */ - case 353: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==353); - case 354: /* cmd ::= insert_query */ yytestcase(yyruleno==354); -{ pCxt->pRootNode = yymsp[0].minor.yy448; } - break; - case 151: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy448); } - break; - case 152: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy448 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; - break; - case 153: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy448 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy113, yymsp[0].minor.yy728); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; - break; - case 154: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy448 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy448, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; - break; - case 155: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy448 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy113, yymsp[0].minor.yy728); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; - break; - case 156: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy448 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; - break; - case 157: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy448 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy113, yymsp[0].minor.yy728); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; - break; - case 158: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy448 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy448, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; - break; - case 159: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy448 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy113, yymsp[0].minor.yy728); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; - break; - case 160: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy448 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy448, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; + case 132: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy532 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy532 = yylhsminor.yy532; + break; + case 133: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 355: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==355); +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-2].minor.yy532, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy532 = yylhsminor.yy532; + break; + case 134: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy532 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy532 = yylhsminor.yy532; + break; + case 135: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-2].minor.yy532, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy532 = yylhsminor.yy532; + break; + case 136: /* retention_list ::= retention */ + case 166: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==166); + case 169: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==169); + case 176: /* column_def_list ::= column_def */ yytestcase(yyruleno==176); + case 219: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==219); + case 224: /* col_name_list ::= col_name */ yytestcase(yyruleno==224); + case 275: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==275); + case 289: /* func_list ::= func */ yytestcase(yyruleno==289); + case 384: /* literal_list ::= signed_literal */ yytestcase(yyruleno==384); + case 451: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==451); + case 457: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==457); + case 512: /* select_list ::= select_item */ yytestcase(yyruleno==512); + case 523: /* partition_list ::= partition_item */ yytestcase(yyruleno==523); + case 578: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==578); +{ yylhsminor.yy532 = createNodeList(pCxt, yymsp[0].minor.yy184); } + yymsp[0].minor.yy532 = yylhsminor.yy532; + break; + case 137: /* retention_list ::= retention_list NK_COMMA retention */ + case 170: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==170); + case 177: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==177); + case 220: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==220); + case 225: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==225); + case 276: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==276); + case 290: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==290); + case 385: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==385); + case 452: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==452); + case 513: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==513); + case 524: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==524); + case 579: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==579); +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-2].minor.yy532, yymsp[0].minor.yy184); } + yymsp[-2].minor.yy532 = yylhsminor.yy532; + break; + case 138: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ +{ yylhsminor.yy184 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; + break; + case 139: /* speed_opt ::= */ + case 322: /* bufsize_opt ::= */ yytestcase(yyruleno==322); +{ yymsp[1].minor.yy480 = 0; } + break; + case 140: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 323: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==323); +{ yymsp[-1].minor.yy480 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 142: /* start_opt ::= START WITH NK_INTEGER */ + case 146: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==146); +{ yymsp[-2].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 143: /* start_opt ::= START WITH NK_STRING */ + case 147: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==147); +{ yymsp[-2].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 144: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ + case 148: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==148); +{ yymsp[-3].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 149: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 151: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==151); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy829, yymsp[-5].minor.yy184, yymsp[-3].minor.yy532, yymsp[-1].minor.yy532, yymsp[0].minor.yy184); } + break; + case 150: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy532); } + break; + case 152: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy532); } + break; + case 153: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy829, yymsp[0].minor.yy184); } + break; + case 154: /* cmd ::= ALTER TABLE alter_table_clause */ + case 357: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==357); + case 358: /* cmd ::= insert_query */ yytestcase(yyruleno==358); +{ pCxt->pRootNode = yymsp[0].minor.yy184; } + break; + case 155: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy184); } + break; + case 156: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy184 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; + break; + case 157: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy649, yymsp[0].minor.yy388); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; + break; + case 158: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy649); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; + break; + case 159: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy649, yymsp[0].minor.yy388); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; + break; + case 160: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; + break; + case 161: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy649, yymsp[0].minor.yy388); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; + break; + case 162: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy649); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; + break; + case 163: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy649, yymsp[0].minor.yy388); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; + break; + case 164: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; - case 161: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy448 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy448, &yymsp[-2].minor.yy113, yymsp[0].minor.yy448); } - yymsp[-5].minor.yy448 = yylhsminor.yy448; + case 165: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ +{ yylhsminor.yy184 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy184, &yymsp[-2].minor.yy649, yymsp[0].minor.yy184); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; - case 163: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 454: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==454); -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-1].minor.yy432, yymsp[0].minor.yy448); } - yymsp[-1].minor.yy432 = yylhsminor.yy432; + case 167: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 458: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==458); +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-1].minor.yy532, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy532 = yylhsminor.yy532; break; - case 164: /* 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.yy448 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy369, yymsp[-8].minor.yy448, yymsp[-6].minor.yy448, yymsp[-5].minor.yy432, yymsp[-2].minor.yy432, yymsp[0].minor.yy448); } - yymsp[-9].minor.yy448 = yylhsminor.yy448; + case 168: /* 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.yy184 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy829, yymsp[-8].minor.yy184, yymsp[-6].minor.yy184, yymsp[-5].minor.yy532, yymsp[-2].minor.yy532, yymsp[0].minor.yy184); } + yymsp[-9].minor.yy184 = yylhsminor.yy184; break; - case 167: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy448 = createDropTableClause(pCxt, yymsp[-1].minor.yy369, yymsp[0].minor.yy448); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 171: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy184 = createDropTableClause(pCxt, yymsp[-1].minor.yy829, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 168: /* specific_cols_opt ::= */ - case 198: /* tags_def_opt ::= */ yytestcase(yyruleno==198); - case 270: /* tag_list_opt ::= */ yytestcase(yyruleno==270); - case 326: /* col_list_opt ::= */ yytestcase(yyruleno==326); - case 328: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==328); - case 517: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==517); - case 542: /* group_by_clause_opt ::= */ yytestcase(yyruleno==542); - case 561: /* order_by_clause_opt ::= */ yytestcase(yyruleno==561); -{ yymsp[1].minor.yy432 = NULL; } + case 172: /* specific_cols_opt ::= */ + case 202: /* tags_def_opt ::= */ yytestcase(yyruleno==202); + case 274: /* tag_list_opt ::= */ yytestcase(yyruleno==274); + case 330: /* col_list_opt ::= */ yytestcase(yyruleno==330); + case 332: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==332); + case 521: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==521); + case 546: /* group_by_clause_opt ::= */ yytestcase(yyruleno==546); + case 565: /* order_by_clause_opt ::= */ yytestcase(yyruleno==565); +{ yymsp[1].minor.yy532 = NULL; } break; - case 169: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 327: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==327); -{ yymsp[-2].minor.yy432 = yymsp[-1].minor.yy432; } + case 173: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 331: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==331); +{ yymsp[-2].minor.yy532 = yymsp[-1].minor.yy532; } break; - case 170: /* full_table_name ::= table_name */ -{ yylhsminor.yy448 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy113, NULL); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 174: /* full_table_name ::= table_name */ +{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy649, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 171: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy448 = createRealTableNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113, NULL); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 175: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 174: /* column_def ::= column_name type_name */ -{ yylhsminor.yy448 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy728, NULL); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 178: /* column_def ::= column_name type_name */ +{ yylhsminor.yy184 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy388, NULL); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 175: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 179: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 176: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 180: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 177: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 181: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 178: /* type_name ::= INT */ - case 179: /* type_name ::= INTEGER */ yytestcase(yyruleno==179); -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_INT); } + case 182: /* type_name ::= INT */ + case 183: /* type_name ::= INTEGER */ yytestcase(yyruleno==183); +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 180: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 184: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 181: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 185: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 182: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 186: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 183: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy728 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 187: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 184: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 188: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 185: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy728 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 189: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 186: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy728 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 190: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 187: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy728 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 191: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 188: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy728 = createDataType(TSDB_DATA_TYPE_UINT); } + case 192: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 189: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy728 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 193: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 190: /* type_name ::= JSON */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_JSON); } + case 194: /* type_name ::= JSON */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 191: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy728 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 195: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 192: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 196: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 193: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 197: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 194: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy728 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 198: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 195: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy728 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 199: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 196: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy728 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 200: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 197: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy728 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 201: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 199: /* tags_def_opt ::= tags_def */ - case 329: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==329); - case 446: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==446); -{ yylhsminor.yy432 = yymsp[0].minor.yy432; } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 203: /* tags_def_opt ::= tags_def */ + case 333: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==333); + case 450: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==450); +{ yylhsminor.yy532 = yymsp[0].minor.yy532; } + yymsp[0].minor.yy532 = yylhsminor.yy532; break; - case 200: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 330: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==330); -{ yymsp[-3].minor.yy432 = yymsp[-1].minor.yy432; } + case 204: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 334: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==334); +{ yymsp[-3].minor.yy532 = yymsp[-1].minor.yy532; } break; - case 201: /* table_options ::= */ -{ yymsp[1].minor.yy448 = createDefaultTableOptions(pCxt); } + case 205: /* table_options ::= */ +{ yymsp[1].minor.yy184 = createDefaultTableOptions(pCxt); } break; - case 202: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-2].minor.yy448, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 206: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 203: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-2].minor.yy448, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy432); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 207: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy532); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 204: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-2].minor.yy448, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy432); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 208: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy532); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 205: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-4].minor.yy448, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy432); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; + case 209: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy532); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; - case 206: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-2].minor.yy448, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 210: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 207: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-4].minor.yy448, TABLE_OPTION_SMA, yymsp[-1].minor.yy432); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; + case 211: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_SMA, yymsp[-1].minor.yy532); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; - case 208: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-2].minor.yy448, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy432); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 212: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy532); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 209: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy448 = createAlterTableOptions(pCxt); yylhsminor.yy448 = setTableOption(pCxt, yylhsminor.yy448, yymsp[0].minor.yy53.type, &yymsp[0].minor.yy53.val); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 213: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy184 = createAlterTableOptions(pCxt); yylhsminor.yy184 = setTableOption(pCxt, yylhsminor.yy184, yymsp[0].minor.yy361.type, &yymsp[0].minor.yy361.val); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 210: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy448 = setTableOption(pCxt, yymsp[-1].minor.yy448, yymsp[0].minor.yy53.type, &yymsp[0].minor.yy53.val); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 214: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy361.type, &yymsp[0].minor.yy361.val); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 211: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy53.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 215: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy361.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 212: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } + case 216: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy361.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy361.val = yymsp[0].minor.yy0; } break; - case 213: /* duration_list ::= duration_literal */ - case 410: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==410); -{ yylhsminor.yy432 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 217: /* duration_list ::= duration_literal */ + case 414: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==414); +{ yylhsminor.yy532 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[0].minor.yy532 = yylhsminor.yy532; break; - case 214: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 411: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==411); -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-2].minor.yy432, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + case 218: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 415: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==415); +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-2].minor.yy532, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[-2].minor.yy532 = yylhsminor.yy532; break; - case 217: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy448 = createFunctionNode(pCxt, &yymsp[0].minor.yy113, NULL); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 221: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy649, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 218: /* rollup_func_name ::= FIRST */ - case 219: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==219); - case 274: /* tag_item ::= QTAGS */ yytestcase(yyruleno==274); -{ yylhsminor.yy448 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 222: /* rollup_func_name ::= FIRST */ + case 223: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==223); + case 278: /* tag_item ::= QTAGS */ yytestcase(yyruleno==278); +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 222: /* col_name ::= column_name */ - case 275: /* tag_item ::= column_name */ yytestcase(yyruleno==275); -{ yylhsminor.yy448 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy113); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 226: /* col_name ::= column_name */ + case 279: /* tag_item ::= column_name */ yytestcase(yyruleno==279); +{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy649); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 223: /* cmd ::= SHOW DNODES */ + case 227: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 224: /* cmd ::= SHOW USERS */ + case 228: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 225: /* cmd ::= SHOW USER PRIVILEGES */ + case 229: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 226: /* cmd ::= SHOW DATABASES */ + case 230: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 227: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy448, yymsp[0].minor.yy448, OP_TYPE_LIKE); } + case 231: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } break; - case 228: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy448, yymsp[0].minor.yy448, OP_TYPE_LIKE); } + case 232: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } break; - case 229: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy448, NULL, OP_TYPE_LIKE); } + case 233: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy184, NULL, OP_TYPE_LIKE); } break; - case 230: /* cmd ::= SHOW MNODES */ + case 234: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 231: /* cmd ::= SHOW QNODES */ + case 235: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 232: /* cmd ::= SHOW FUNCTIONS */ + case 236: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 233: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy448, yymsp[-1].minor.yy448, OP_TYPE_EQUAL); } + case 237: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy184, yymsp[-1].minor.yy184, OP_TYPE_EQUAL); } break; - case 234: /* cmd ::= SHOW STREAMS */ + case 238: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 235: /* cmd ::= SHOW ACCOUNTS */ + case 239: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 236: /* cmd ::= SHOW APPS */ + case 240: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 237: /* cmd ::= SHOW CONNECTIONS */ + case 241: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 238: /* cmd ::= SHOW LICENCES */ - case 239: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==239); + case 242: /* cmd ::= SHOW LICENCES */ + case 243: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==243); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 240: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy113); } + case 244: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy649); } break; - case 241: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy448); } + case 245: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy184); } break; - case 242: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy448); } + case 246: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy184); } break; - case 243: /* cmd ::= SHOW QUERIES */ + case 247: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 244: /* cmd ::= SHOW SCORES */ + case 248: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 245: /* cmd ::= SHOW TOPICS */ + case 249: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 246: /* cmd ::= SHOW VARIABLES */ - case 247: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==247); + case 250: /* cmd ::= SHOW VARIABLES */ + case 251: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==251); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 248: /* cmd ::= SHOW LOCAL VARIABLES */ + case 252: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 249: /* 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.yy448); } + case 253: /* 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.yy184); } break; - case 250: /* cmd ::= SHOW BNODES */ + case 254: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 251: /* cmd ::= SHOW SNODES */ + case 255: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 252: /* cmd ::= SHOW CLUSTER */ + case 256: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 253: /* cmd ::= SHOW TRANSACTIONS */ + case 257: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 254: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy448); } + case 258: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy184); } break; - case 255: /* cmd ::= SHOW CONSUMERS */ + case 259: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 256: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 260: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 257: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy448, yymsp[-1].minor.yy448, OP_TYPE_EQUAL); } + case 261: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy184, yymsp[-1].minor.yy184, OP_TYPE_EQUAL); } break; - case 258: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy448, yymsp[0].minor.yy448, yymsp[-3].minor.yy432); } + case 262: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184, yymsp[-3].minor.yy532); } break; - case 259: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 263: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 260: /* cmd ::= SHOW VNODES NK_STRING */ + case 264: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 261: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy448, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 265: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy184, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 262: /* cmd ::= SHOW CLUSTER ALIVE */ + case 266: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 263: /* db_name_cond_opt ::= */ - case 268: /* from_db_opt ::= */ yytestcase(yyruleno==268); -{ yymsp[1].minor.yy448 = createDefaultDatabaseCondValue(pCxt); } + case 267: /* db_name_cond_opt ::= */ + case 272: /* from_db_opt ::= */ yytestcase(yyruleno==272); +{ yymsp[1].minor.yy184 = createDefaultDatabaseCondValue(pCxt); } break; - case 264: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy448 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy113); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 268: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy184 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy649); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 266: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 270: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 267: /* table_name_cond ::= table_name */ -{ yylhsminor.yy448 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy113); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 271: /* table_name_cond ::= table_name */ +{ yylhsminor.yy184 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 269: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy448 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy113); } + case 273: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy184 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649); } break; - case 273: /* tag_item ::= TBNAME */ -{ yylhsminor.yy448 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 277: /* tag_item ::= TBNAME */ +{ yylhsminor.yy184 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 276: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy448 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy113), &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 280: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy184 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy649), &yymsp[0].minor.yy649); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 277: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy448 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy113), &yymsp[0].minor.yy113); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 281: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy184 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy649), &yymsp[0].minor.yy649); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 278: /* 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.yy369, yymsp[-3].minor.yy448, yymsp[-1].minor.yy448, NULL, yymsp[0].minor.yy448); } + case 282: /* 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.yy829, yymsp[-3].minor.yy184, yymsp[-1].minor.yy184, NULL, yymsp[0].minor.yy184); } break; - case 279: /* 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.yy369, yymsp[-5].minor.yy448, yymsp[-3].minor.yy448, yymsp[-1].minor.yy432, NULL); } + case 283: /* 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.yy829, yymsp[-5].minor.yy184, yymsp[-3].minor.yy184, yymsp[-1].minor.yy532, NULL); } break; - case 280: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy369, yymsp[0].minor.yy448); } + case 284: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy829, yymsp[0].minor.yy184); } break; - case 281: /* full_index_name ::= index_name */ -{ yylhsminor.yy448 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy113); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 285: /* full_index_name ::= index_name */ +{ yylhsminor.yy184 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy649); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 282: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy448 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 286: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy184 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 283: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy448 = createIndexOption(pCxt, yymsp[-7].minor.yy432, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), NULL, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 287: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy184 = createIndexOption(pCxt, yymsp[-7].minor.yy532, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 284: /* 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.yy448 = createIndexOption(pCxt, yymsp[-9].minor.yy432, releaseRawExprNode(pCxt, yymsp[-5].minor.yy448), releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 288: /* 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.yy184 = createIndexOption(pCxt, yymsp[-9].minor.yy532, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 287: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy448 = createFunctionNode(pCxt, &yymsp[-3].minor.yy113, yymsp[-1].minor.yy432); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 291: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[-3].minor.yy649, yymsp[-1].minor.yy532); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 288: /* sma_func_name ::= function_name */ - case 497: /* alias_opt ::= table_alias */ yytestcase(yyruleno==497); -{ yylhsminor.yy113 = yymsp[0].minor.yy113; } - yymsp[0].minor.yy113 = yylhsminor.yy113; + case 292: /* sma_func_name ::= function_name */ + case 501: /* alias_opt ::= table_alias */ yytestcase(yyruleno==501); +{ yylhsminor.yy649 = yymsp[0].minor.yy649; } + yymsp[0].minor.yy649 = yylhsminor.yy649; break; - case 293: /* sma_stream_opt ::= */ - case 331: /* stream_options ::= */ yytestcase(yyruleno==331); -{ yymsp[1].minor.yy448 = createStreamOptions(pCxt); } + case 297: /* sma_stream_opt ::= */ + case 335: /* stream_options ::= */ yytestcase(yyruleno==335); +{ yymsp[1].minor.yy184 = createStreamOptions(pCxt); } break; - case 294: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy448)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy448); yylhsminor.yy448 = yymsp[-2].minor.yy448; } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 298: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 295: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy448)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy448); yylhsminor.yy448 = yymsp[-2].minor.yy448; } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 299: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 296: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy448)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy448); yylhsminor.yy448 = yymsp[-2].minor.yy448; } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 300: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 297: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy369, &yymsp[-2].minor.yy113, yymsp[0].minor.yy448); } + case 301: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy829, &yymsp[-2].minor.yy649, yymsp[0].minor.yy184); } break; - case 298: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy369, &yymsp[-3].minor.yy113, &yymsp[0].minor.yy113, false); } + case 302: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy829, &yymsp[-3].minor.yy649, &yymsp[0].minor.yy649, false); } break; - case 299: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy369, &yymsp[-5].minor.yy113, &yymsp[0].minor.yy113, true); } + case 303: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy829, &yymsp[-5].minor.yy649, &yymsp[0].minor.yy649, true); } break; - case 300: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy369, &yymsp[-3].minor.yy113, yymsp[0].minor.yy448, false); } + case 304: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy829, &yymsp[-3].minor.yy649, yymsp[0].minor.yy184, false); } break; - case 301: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy369, &yymsp[-5].minor.yy113, yymsp[0].minor.yy448, true); } + case 305: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy829, &yymsp[-5].minor.yy649, yymsp[0].minor.yy184, true); } break; - case 302: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy369, &yymsp[0].minor.yy113); } + case 306: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy829, &yymsp[0].minor.yy649); } break; - case 303: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy369, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } + case 307: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy829, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649); } break; - case 304: /* cmd ::= DESC full_table_name */ - case 305: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==305); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy448); } + case 308: /* cmd ::= DESC full_table_name */ + case 309: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==309); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy184); } break; - case 306: /* cmd ::= RESET QUERY CACHE */ + case 310: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 307: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 308: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==308); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy369, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 311: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 312: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==312); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy829, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 311: /* explain_options ::= */ -{ yymsp[1].minor.yy448 = createDefaultExplainOptions(pCxt); } + case 315: /* explain_options ::= */ +{ yymsp[1].minor.yy184 = createDefaultExplainOptions(pCxt); } break; - case 312: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy448 = setExplainVerbose(pCxt, yymsp[-2].minor.yy448, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 316: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy184 = setExplainVerbose(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 313: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy448 = setExplainRatio(pCxt, yymsp[-2].minor.yy448, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 317: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy184 = setExplainRatio(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 314: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy369, yymsp[-9].minor.yy369, &yymsp[-6].minor.yy113, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy728, yymsp[-1].minor.yy788, &yymsp[0].minor.yy113, yymsp[-10].minor.yy369); } + case 318: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy829, yymsp[-9].minor.yy829, &yymsp[-6].minor.yy649, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy388, yymsp[-1].minor.yy480, &yymsp[0].minor.yy649, yymsp[-10].minor.yy829); } break; - case 315: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy369, &yymsp[0].minor.yy113); } + case 319: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy829, &yymsp[0].minor.yy649); } break; - case 320: /* language_opt ::= */ -{ yymsp[1].minor.yy113 = nil_token; } + case 324: /* language_opt ::= */ +{ yymsp[1].minor.yy649 = nil_token; } break; - case 321: /* language_opt ::= LANGUAGE NK_STRING */ -{ yymsp[-1].minor.yy113 = yymsp[0].minor.yy0; } + case 325: /* language_opt ::= LANGUAGE NK_STRING */ +{ yymsp[-1].minor.yy649 = yymsp[0].minor.yy0; } break; - case 324: /* 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.yy369, &yymsp[-8].minor.yy113, yymsp[-5].minor.yy448, yymsp[-7].minor.yy448, yymsp[-3].minor.yy432, yymsp[-2].minor.yy448, yymsp[0].minor.yy448, yymsp[-4].minor.yy432); } + case 328: /* 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.yy829, &yymsp[-8].minor.yy649, yymsp[-5].minor.yy184, yymsp[-7].minor.yy184, yymsp[-3].minor.yy532, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, yymsp[-4].minor.yy532); } break; - case 325: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy369, &yymsp[0].minor.yy113); } + case 329: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy829, &yymsp[0].minor.yy649); } break; - case 332: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 333: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==333); -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-2].minor.yy448, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 336: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 337: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==337); +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-2].minor.yy184, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 334: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-3].minor.yy448, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 338: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-3].minor.yy184, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 335: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-2].minor.yy448, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 339: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-2].minor.yy184, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 336: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-3].minor.yy448, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 340: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-3].minor.yy184, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 337: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-2].minor.yy448, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 341: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-2].minor.yy184, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 338: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-2].minor.yy448, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 342: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-2].minor.yy184, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 339: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy448 = setStreamOptions(pCxt, yymsp[-3].minor.yy448, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 343: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy184 = setStreamOptions(pCxt, yymsp[-3].minor.yy184, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 341: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 531: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==531); - case 551: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==551); -{ yymsp[-3].minor.yy448 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy448); } + case 345: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 535: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==535); + case 555: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==555); +{ yymsp[-3].minor.yy184 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy184); } break; - case 342: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 346: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 343: /* cmd ::= KILL QUERY NK_STRING */ + case 347: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 344: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 348: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 345: /* cmd ::= BALANCE VGROUP */ + case 349: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 346: /* cmd ::= BALANCE VGROUP LEADER */ + case 350: /* cmd ::= BALANCE VGROUP LEADER */ { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); } break; - case 347: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 351: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 348: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy432); } + case 352: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy532); } break; - case 349: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 353: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 350: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy432 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 354: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy532 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 352: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 356: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 355: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy448 = createInsertStmt(pCxt, yymsp[-4].minor.yy448, yymsp[-2].minor.yy432, yymsp[0].minor.yy448); } + case 359: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy184 = createInsertStmt(pCxt, yymsp[-4].minor.yy184, yymsp[-2].minor.yy532, yymsp[0].minor.yy184); } break; - case 356: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy448 = createInsertStmt(pCxt, yymsp[-1].minor.yy448, NULL, yymsp[0].minor.yy448); } + case 360: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy184 = createInsertStmt(pCxt, yymsp[-1].minor.yy184, NULL, yymsp[0].minor.yy184); } break; - case 357: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 361: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 358: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 362: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 359: /* literal ::= NK_STRING */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 363: /* literal ::= NK_STRING */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 360: /* literal ::= NK_BOOL */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 364: /* literal ::= NK_BOOL */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 361: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 365: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 362: /* literal ::= duration_literal */ - case 372: /* signed_literal ::= signed */ yytestcase(yyruleno==372); - case 393: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==393); - case 394: /* expression ::= literal */ yytestcase(yyruleno==394); - case 395: /* expression ::= pseudo_column */ yytestcase(yyruleno==395); - case 396: /* expression ::= column_reference */ yytestcase(yyruleno==396); - case 397: /* expression ::= function_expression */ yytestcase(yyruleno==397); - case 398: /* expression ::= case_when_expression */ yytestcase(yyruleno==398); - case 429: /* function_expression ::= literal_func */ yytestcase(yyruleno==429); - case 478: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==478); - case 482: /* boolean_primary ::= predicate */ yytestcase(yyruleno==482); - case 484: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==484); - case 485: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==485); - case 488: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==488); - case 490: /* table_reference ::= table_primary */ yytestcase(yyruleno==490); - case 491: /* table_reference ::= joined_table */ yytestcase(yyruleno==491); - case 495: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==495); - case 553: /* query_simple ::= query_specification */ yytestcase(yyruleno==553); - case 554: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==554); - case 557: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==557); - case 559: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==559); -{ yylhsminor.yy448 = yymsp[0].minor.yy448; } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 366: /* literal ::= duration_literal */ + case 376: /* signed_literal ::= signed */ yytestcase(yyruleno==376); + case 397: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==397); + case 398: /* expression ::= literal */ yytestcase(yyruleno==398); + case 399: /* expression ::= pseudo_column */ yytestcase(yyruleno==399); + case 400: /* expression ::= column_reference */ yytestcase(yyruleno==400); + case 401: /* expression ::= function_expression */ yytestcase(yyruleno==401); + case 402: /* expression ::= case_when_expression */ yytestcase(yyruleno==402); + case 433: /* function_expression ::= literal_func */ yytestcase(yyruleno==433); + case 482: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==482); + case 486: /* boolean_primary ::= predicate */ yytestcase(yyruleno==486); + case 488: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==488); + case 489: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==489); + case 492: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==492); + case 494: /* table_reference ::= table_primary */ yytestcase(yyruleno==494); + case 495: /* table_reference ::= joined_table */ yytestcase(yyruleno==495); + case 499: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==499); + case 557: /* query_simple ::= query_specification */ yytestcase(yyruleno==557); + case 558: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==558); + case 561: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==561); + case 563: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==563); +{ yylhsminor.yy184 = yymsp[0].minor.yy184; } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 363: /* literal ::= NULL */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 367: /* literal ::= NULL */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 364: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 368: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 365: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 369: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 366: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 370: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 367: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 371: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 368: /* signed ::= NK_MINUS NK_INTEGER */ + case 372: /* 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.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 369: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 373: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 370: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 374: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 371: /* signed ::= NK_MINUS NK_FLOAT */ + case 375: /* 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.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 373: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 377: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 374: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 378: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 375: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 379: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 376: /* signed_literal ::= duration_literal */ - case 378: /* signed_literal ::= literal_func */ yytestcase(yyruleno==378); - case 449: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==449); - case 511: /* select_item ::= common_expression */ yytestcase(yyruleno==511); - case 521: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==521); - case 558: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==558); - case 560: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==560); - case 573: /* search_condition ::= common_expression */ yytestcase(yyruleno==573); -{ yylhsminor.yy448 = releaseRawExprNode(pCxt, yymsp[0].minor.yy448); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 380: /* signed_literal ::= duration_literal */ + case 382: /* signed_literal ::= literal_func */ yytestcase(yyruleno==382); + case 453: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==453); + case 515: /* select_item ::= common_expression */ yytestcase(yyruleno==515); + case 525: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==525); + case 562: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==562); + case 564: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==564); + case 577: /* search_condition ::= common_expression */ yytestcase(yyruleno==577); +{ yylhsminor.yy184 = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 377: /* signed_literal ::= NULL */ -{ yylhsminor.yy448 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 381: /* signed_literal ::= NULL */ +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 379: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy448 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 383: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy184 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 399: /* expression ::= NK_LP expression NK_RP */ - case 483: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==483); - case 572: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==572); -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy448)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 403: /* expression ::= NK_LP expression NK_RP */ + case 487: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==487); + case 576: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==576); +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 400: /* expression ::= NK_PLUS expr_or_subquery */ + case 404: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 401: /* expression ::= NK_MINUS expr_or_subquery */ + case 405: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy448), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 402: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 406: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 403: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 407: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 404: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 408: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 405: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 409: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 406: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 410: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 407: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 411: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 408: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 412: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 409: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 413: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 412: /* column_reference ::= column_name */ -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy113, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy113)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 416: /* column_reference ::= column_name */ +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy649, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy649)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 413: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113, createColumnNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 417: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649, createColumnNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 414: /* pseudo_column ::= ROWTS */ - case 415: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==415); - case 417: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==417); - case 418: /* pseudo_column ::= QEND */ yytestcase(yyruleno==418); - case 419: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==419); - case 420: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==420); - case 421: /* pseudo_column ::= WEND */ yytestcase(yyruleno==421); - case 422: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==422); - case 423: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==423); - case 424: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==424); - case 425: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==425); - case 431: /* literal_func ::= NOW */ yytestcase(yyruleno==431); -{ yylhsminor.yy448 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 418: /* pseudo_column ::= ROWTS */ + case 419: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==419); + case 421: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==421); + case 422: /* pseudo_column ::= QEND */ yytestcase(yyruleno==422); + case 423: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==423); + case 424: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==424); + case 425: /* pseudo_column ::= WEND */ yytestcase(yyruleno==425); + case 426: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==426); + case 427: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==427); + case 428: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==428); + case 429: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==429); + case 435: /* literal_func ::= NOW */ yytestcase(yyruleno==435); +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 416: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy113)))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 420: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy649)))); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 426: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 427: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==427); -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy113, yymsp[-1].minor.yy432)); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 430: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 431: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==431); +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy649, yymsp[-1].minor.yy532)); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 428: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), yymsp[-1].minor.yy728)); } - yymsp[-5].minor.yy448 = yylhsminor.yy448; + case 432: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy388)); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; - case 430: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy113, NULL)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 434: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy649, NULL)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 445: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy432 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 449: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy532 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy532 = yylhsminor.yy532; break; - case 450: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 514: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==514); -{ yylhsminor.yy448 = createColumnNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 454: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 518: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==518); +{ yylhsminor.yy184 = createColumnNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 451: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy432, yymsp[-1].minor.yy448)); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 455: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy532, yymsp[-1].minor.yy184)); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 452: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), yymsp[-2].minor.yy432, yymsp[-1].minor.yy448)); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; + case 456: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-2].minor.yy532, yymsp[-1].minor.yy184)); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; - case 455: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy448 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448)); } + case 459: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy184 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } break; - case 457: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy448 = releaseRawExprNode(pCxt, yymsp[0].minor.yy448); } + case 461: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy184 = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); } break; - case 458: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 463: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==463); + case 462: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 467: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==467); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy156, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy424, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 459: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 463: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy448), releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-4].minor.yy448 = yylhsminor.yy448; + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; - case 460: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 464: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy448), releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-5].minor.yy448 = yylhsminor.yy448; + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; - case 461: /* predicate ::= expr_or_subquery IS NULL */ + case 465: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), NULL)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 462: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 466: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL)); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 464: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy156 = OP_TYPE_LOWER_THAN; } + case 468: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy424 = OP_TYPE_LOWER_THAN; } break; - case 465: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy156 = OP_TYPE_GREATER_THAN; } + case 469: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy424 = OP_TYPE_GREATER_THAN; } break; - case 466: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy156 = OP_TYPE_LOWER_EQUAL; } + case 470: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy424 = OP_TYPE_LOWER_EQUAL; } break; - case 467: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy156 = OP_TYPE_GREATER_EQUAL; } + case 471: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy424 = OP_TYPE_GREATER_EQUAL; } break; - case 468: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy156 = OP_TYPE_NOT_EQUAL; } + case 472: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy424 = OP_TYPE_NOT_EQUAL; } break; - case 469: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy156 = OP_TYPE_EQUAL; } + case 473: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy424 = OP_TYPE_EQUAL; } break; - case 470: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy156 = OP_TYPE_LIKE; } + case 474: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy424 = OP_TYPE_LIKE; } break; - case 471: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy156 = OP_TYPE_NOT_LIKE; } + case 475: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy424 = OP_TYPE_NOT_LIKE; } break; - case 472: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy156 = OP_TYPE_MATCH; } + case 476: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy424 = OP_TYPE_MATCH; } break; - case 473: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy156 = OP_TYPE_NMATCH; } + case 477: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy424 = OP_TYPE_NMATCH; } break; - case 474: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy156 = OP_TYPE_JSON_CONTAINS; } + case 478: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy424 = OP_TYPE_JSON_CONTAINS; } break; - case 475: /* in_op ::= IN */ -{ yymsp[0].minor.yy156 = OP_TYPE_IN; } + case 479: /* in_op ::= IN */ +{ yymsp[0].minor.yy424 = OP_TYPE_IN; } break; - case 476: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy156 = OP_TYPE_NOT_IN; } + case 480: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy424 = OP_TYPE_NOT_IN; } break; - case 477: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy432)); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 481: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy532)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 479: /* boolean_value_expression ::= NOT boolean_primary */ + case 483: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy448), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 480: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 484: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 481: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 485: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy448); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy448); - yylhsminor.yy448 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 489: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy448 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy448, yymsp[0].minor.yy448, NULL); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 493: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy184 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 492: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy448 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 496: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 493: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy448 = createRealTableNode(pCxt, &yymsp[-3].minor.yy113, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 497: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-3].minor.yy649, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 494: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy448 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy448), &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 498: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy184 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy649); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 496: /* alias_opt ::= */ -{ yymsp[1].minor.yy113 = nil_token; } + case 500: /* alias_opt ::= */ +{ yymsp[1].minor.yy649 = nil_token; } break; - case 498: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy113 = yymsp[0].minor.yy113; } + case 502: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy649 = yymsp[0].minor.yy649; } break; - case 499: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 500: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==500); -{ yymsp[-2].minor.yy448 = yymsp[-1].minor.yy448; } + case 503: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 504: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==504); +{ yymsp[-2].minor.yy184 = yymsp[-1].minor.yy184; } break; - case 501: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy448 = createJoinTableNode(pCxt, yymsp[-4].minor.yy596, yymsp[-5].minor.yy448, yymsp[-2].minor.yy448, yymsp[0].minor.yy448); } - yymsp[-5].minor.yy448 = yylhsminor.yy448; + case 505: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy184 = createJoinTableNode(pCxt, yymsp[-4].minor.yy416, yymsp[-5].minor.yy184, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; - case 502: /* join_type ::= */ -{ yymsp[1].minor.yy596 = JOIN_TYPE_INNER; } + case 506: /* join_type ::= */ +{ yymsp[1].minor.yy416 = JOIN_TYPE_INNER; } break; - case 503: /* join_type ::= INNER */ -{ yymsp[0].minor.yy596 = JOIN_TYPE_INNER; } + case 507: /* join_type ::= INNER */ +{ yymsp[0].minor.yy416 = JOIN_TYPE_INNER; } break; - case 504: /* 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 508: /* 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.yy448 = createSelectStmt(pCxt, yymsp[-10].minor.yy369, yymsp[-9].minor.yy432, yymsp[-8].minor.yy448); - yymsp[-11].minor.yy448 = addWhereClause(pCxt, yymsp[-11].minor.yy448, yymsp[-7].minor.yy448); - yymsp[-11].minor.yy448 = addPartitionByClause(pCxt, yymsp[-11].minor.yy448, yymsp[-6].minor.yy432); - yymsp[-11].minor.yy448 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy448, yymsp[-2].minor.yy448); - yymsp[-11].minor.yy448 = addGroupByClause(pCxt, yymsp[-11].minor.yy448, yymsp[-1].minor.yy432); - yymsp[-11].minor.yy448 = addHavingClause(pCxt, yymsp[-11].minor.yy448, yymsp[0].minor.yy448); - yymsp[-11].minor.yy448 = addRangeClause(pCxt, yymsp[-11].minor.yy448, yymsp[-5].minor.yy448); - yymsp[-11].minor.yy448 = addEveryClause(pCxt, yymsp[-11].minor.yy448, yymsp[-4].minor.yy448); - yymsp[-11].minor.yy448 = addFillClause(pCxt, yymsp[-11].minor.yy448, yymsp[-3].minor.yy448); + yymsp[-11].minor.yy184 = createSelectStmt(pCxt, yymsp[-10].minor.yy829, yymsp[-9].minor.yy532, yymsp[-8].minor.yy184); + yymsp[-11].minor.yy184 = addWhereClause(pCxt, yymsp[-11].minor.yy184, yymsp[-7].minor.yy184); + yymsp[-11].minor.yy184 = addPartitionByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-6].minor.yy532); + yymsp[-11].minor.yy184 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy184, yymsp[-2].minor.yy184); + yymsp[-11].minor.yy184 = addGroupByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-1].minor.yy532); + yymsp[-11].minor.yy184 = addHavingClause(pCxt, yymsp[-11].minor.yy184, yymsp[0].minor.yy184); + yymsp[-11].minor.yy184 = addRangeClause(pCxt, yymsp[-11].minor.yy184, yymsp[-5].minor.yy184); + yymsp[-11].minor.yy184 = addEveryClause(pCxt, yymsp[-11].minor.yy184, yymsp[-4].minor.yy184); + yymsp[-11].minor.yy184 = addFillClause(pCxt, yymsp[-11].minor.yy184, yymsp[-3].minor.yy184); } break; - case 507: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy369 = false; } + case 511: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy829 = false; } break; - case 510: /* select_item ::= NK_STAR */ -{ yylhsminor.yy448 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy448 = yylhsminor.yy448; + case 514: /* select_item ::= NK_STAR */ +{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 512: /* select_item ::= common_expression column_alias */ - case 522: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==522); -{ yylhsminor.yy448 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy448), &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy448 = yylhsminor.yy448; + case 516: /* select_item ::= common_expression column_alias */ + case 526: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==526); +{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy649); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 513: /* select_item ::= common_expression AS column_alias */ - case 523: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==523); -{ yylhsminor.yy448 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), &yymsp[0].minor.yy113); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 517: /* select_item ::= common_expression AS column_alias */ + case 527: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==527); +{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), &yymsp[0].minor.yy649); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 518: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 543: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==543); - case 562: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==562); -{ yymsp[-2].minor.yy432 = yymsp[0].minor.yy432; } + case 522: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 547: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==547); + case 566: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==566); +{ yymsp[-2].minor.yy532 = yymsp[0].minor.yy532; } break; - case 525: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy448 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), releaseRawExprNode(pCxt, yymsp[-1].minor.yy448)); } + case 529: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy184 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 526: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy448 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy448)); } + case 530: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy184 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 527: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy448 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), NULL, yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 531: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 528: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy448 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy448), releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), yymsp[-1].minor.yy448, yymsp[0].minor.yy448); } + case 532: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 529: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy448 = createEventWindowNode(pCxt, yymsp[-3].minor.yy448, yymsp[0].minor.yy448); } + case 533: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy184 = createEventWindowNode(pCxt, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } break; - case 533: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy448 = createFillNode(pCxt, yymsp[-1].minor.yy46, NULL); } + case 537: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy184 = createFillNode(pCxt, yymsp[-1].minor.yy362, NULL); } break; - case 534: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy448 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy432)); } + case 538: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy184 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy532)); } break; - case 535: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy448 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy432)); } + case 539: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy184 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy532)); } break; - case 536: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy46 = FILL_MODE_NONE; } + case 540: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy362 = FILL_MODE_NONE; } break; - case 537: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy46 = FILL_MODE_PREV; } + case 541: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy362 = FILL_MODE_PREV; } break; - case 538: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy46 = FILL_MODE_NULL; } + case 542: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy362 = FILL_MODE_NULL; } break; - case 539: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy46 = FILL_MODE_NULL_F; } + case 543: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy362 = FILL_MODE_NULL_F; } break; - case 540: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy46 = FILL_MODE_LINEAR; } + case 544: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy362 = FILL_MODE_LINEAR; } break; - case 541: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy46 = FILL_MODE_NEXT; } + case 545: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy362 = FILL_MODE_NEXT; } break; - case 544: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy432 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 548: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy532 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } + yymsp[0].minor.yy532 = yylhsminor.yy532; break; - case 545: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy432 = addNodeToList(pCxt, yymsp[-2].minor.yy432, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy448))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + case 549: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy532 = addNodeToList(pCxt, yymsp[-2].minor.yy532, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } + yymsp[-2].minor.yy532 = yylhsminor.yy532; break; - case 549: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy448 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy448), releaseRawExprNode(pCxt, yymsp[-1].minor.yy448)); } + case 553: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy184 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 552: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 556: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy448 = addOrderByClause(pCxt, yymsp[-3].minor.yy448, yymsp[-2].minor.yy432); - yylhsminor.yy448 = addSlimitClause(pCxt, yylhsminor.yy448, yymsp[-1].minor.yy448); - yylhsminor.yy448 = addLimitClause(pCxt, yylhsminor.yy448, yymsp[0].minor.yy448); + yylhsminor.yy184 = addOrderByClause(pCxt, yymsp[-3].minor.yy184, yymsp[-2].minor.yy532); + yylhsminor.yy184 = addSlimitClause(pCxt, yylhsminor.yy184, yymsp[-1].minor.yy184); + yylhsminor.yy184 = addLimitClause(pCxt, yylhsminor.yy184, yymsp[0].minor.yy184); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 555: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy448 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy448, yymsp[0].minor.yy448); } - yymsp[-3].minor.yy448 = yylhsminor.yy448; + case 559: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 556: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy448 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy448, yymsp[0].minor.yy448); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 560: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 564: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 568: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==568); -{ yymsp[-1].minor.yy448 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 568: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 572: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==572); +{ yymsp[-1].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 565: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 569: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==569); -{ yymsp[-3].minor.yy448 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 569: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 573: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==573); +{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 566: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 570: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==570); -{ yymsp[-3].minor.yy448 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 570: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 574: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==574); +{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 571: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy448 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy448); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 575: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy184); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 576: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy448 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy448), yymsp[-1].minor.yy666, yymsp[0].minor.yy585); } - yymsp[-2].minor.yy448 = yylhsminor.yy448; + case 580: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy184 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), yymsp[-1].minor.yy706, yymsp[0].minor.yy617); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 577: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy666 = ORDER_ASC; } + case 581: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy706 = ORDER_ASC; } break; - case 578: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy666 = ORDER_ASC; } + case 582: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy706 = ORDER_ASC; } break; - case 579: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy666 = ORDER_DESC; } + case 583: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy706 = ORDER_DESC; } break; - case 580: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy585 = NULL_ORDER_DEFAULT; } + case 584: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy617 = NULL_ORDER_DEFAULT; } break; - case 581: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy585 = NULL_ORDER_FIRST; } + case 585: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy617 = NULL_ORDER_FIRST; } break; - case 582: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy585 = NULL_ORDER_LAST; } + case 586: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy617 = NULL_ORDER_LAST; } break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyrulenopRoot), expectNodeType); + ASSERT_EQ(pQuery->pCmdMsg->msgType, TDMT_MND_RESTORE_DNODE); + SRestoreDnodeReq req = {0}; + ASSERT_EQ(tDeserializeSRestoreDnodeReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req), TSDB_CODE_SUCCESS); + ASSERT_EQ(req.dnodeId, expect.dnodeId); + ASSERT_EQ(req.restoreType, expect.restoreType); + }); + + setRestoreDnodeReq(1, RESTORE_TYPE__ALL); + run("RESTORE DNODE 1"); + clearRestoreDnodeReq(); + + setRestoreDnodeReq(2, RESTORE_TYPE__MNODE); + run("RESTORE MNODE ON DNODE 2"); + clearRestoreDnodeReq(); + + setRestoreDnodeReq(1, RESTORE_TYPE__VNODE); + run("RESTORE VNODE ON DNODE 1"); + clearRestoreDnodeReq(); + + setRestoreDnodeReq(2, RESTORE_TYPE__QNODE); + run("RESTORE QNODE ON DNODE 2"); + clearRestoreDnodeReq(); +} + + + // todo reset query cache TEST_F(ParserExplainToSyncdbTest, revoke) { diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index ec6c69ea8d..2d8ce55b72 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -239,6 +239,19 @@ TEST_F(ParserSelectTest, groupBySemanticCheck) { run("SELECT COUNT(*) cnt, c2 FROM t1 WHERE c1 > 0 GROUP BY c1", TSDB_CODE_PAR_GROUPBY_LACK_EXPRESSION); } +TEST_F(ParserSelectTest, havingCheck) { + useDb("root", "test"); + + run("select tbname,count(*) from st1 partition by tbname having c1>0", TSDB_CODE_PAR_INVALID_OPTR_USAGE); + + run("select tbname,count(*) from st1 group by tbname having c1>0", TSDB_CODE_PAR_GROUPBY_LACK_EXPRESSION); + + run("select max(c1) from st1 group by tbname having c1>0"); + + run("select max(c1) from st1 partition by tbname having c1>0"); +} + + TEST_F(ParserSelectTest, orderBy) { useDb("root", "test"); diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index e2c2e4c655..be43bb008c 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1559,6 +1559,7 @@ static int32_t createMergePhysiNode(SPhysiPlanContext* pCxt, SMergeLogicNode* pM pMerge->numOfChannels = pMergeLogicNode->numOfChannels; pMerge->srcGroupId = pMergeLogicNode->srcGroupId; pMerge->groupSort = pMergeLogicNode->groupSort; + pMerge->ignoreGroupId = pMergeLogicNode->ignoreGroupId; int32_t code = addDataBlockSlots(pCxt, pMergeLogicNode->pInputs, pMerge->node.pOutputDataBlockDesc); diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index fd77261818..504db0d07b 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -532,6 +532,25 @@ static int32_t stbSplGetNumOfVgroups(SLogicNode* pNode) { return 0; } +static int32_t stbSplRewriteFromMergeNode(SMergeLogicNode* pMerge, SLogicNode* pNode) { + int32_t code = TSDB_CODE_SUCCESS; + + switch (nodeType(pNode)) { + case QUERY_NODE_LOGIC_PLAN_PROJECT: { + SProjectLogicNode *pLogicNode = (SProjectLogicNode*)pNode; + if (pLogicNode->ignoreGroupId && (pMerge->node.pLimit || pMerge->node.pSlimit)) { + pMerge->ignoreGroupId = true; + pLogicNode->ignoreGroupId = false; + } + break; + } + default: + break; + } + + return code; +} + static int32_t stbSplCreateMergeNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SLogicNode* pSplitNode, SNodeList* pMergeKeys, SLogicNode* pPartChild, bool groupSort) { SMergeLogicNode* pMerge = (SMergeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_MERGE); @@ -563,6 +582,9 @@ static int32_t stbSplCreateMergeNode(SSplitContext* pCxt, SLogicSubplan* pSubpla ((SLimitNode*)pSplitNode->pLimit)->limit += ((SLimitNode*)pSplitNode->pLimit)->offset; ((SLimitNode*)pSplitNode->pLimit)->offset = 0; } + if (TSDB_CODE_SUCCESS == code) { + code = stbSplRewriteFromMergeNode(pMerge, pSplitNode); + } if (TSDB_CODE_SUCCESS == code) { if (NULL == pSubplan) { code = nodesListMakeAppend(&pSplitNode->pChildren, (SNode*)pMerge); diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 835264eabe..563e7d76ab 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -12,7 +12,7 @@ typedef double (*_double_fn)(double); typedef double (*_double_fn_2)(double, double); typedef int (*_conv_fn)(int); typedef void (*_trim_fn)(char *, char *, int32_t, int32_t); -typedef int16_t (*_len_fn)(char *, int32_t); +typedef uint16_t (*_len_fn)(char *, int32_t); /** Math functions **/ static double tlog(double v) { return log(v); } @@ -286,9 +286,9 @@ static int32_t doScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarP } /** String functions **/ -static int16_t tlength(char *input, int32_t type) { return varDataLen(input); } +static VarDataLenT tlength(char *input, int32_t type) { return varDataLen(input); } -static int16_t tcharlength(char *input, int32_t type) { +static VarDataLenT tcharlength(char *input, int32_t type) { if (type == TSDB_DATA_TYPE_VARCHAR) { return varDataLen(input); } else { // NCHAR @@ -377,7 +377,7 @@ static int32_t doLengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarP return TSDB_CODE_SUCCESS; } -static int32_t concatCopyHelper(const char *input, char *output, bool hasNchar, int32_t type, int16_t *dataLen) { +static int32_t concatCopyHelper(const char *input, char *output, bool hasNchar, int32_t type, VarDataLenT *dataLen) { if (hasNchar && type == TSDB_DATA_TYPE_VARCHAR) { TdUcs4 *newBuf = taosMemoryCalloc((varDataLen(input) + 1) * TSDB_NCHAR_SIZE, 1); int32_t len = varDataLen(input); @@ -457,7 +457,7 @@ int32_t concatFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu continue; } - int16_t dataLen = 0; + VarDataLenT dataLen = 0; for (int32_t i = 0; i < inputNum; ++i) { int32_t rowIdx = (pInput[i].numOfRows == 1) ? 0 : k; input[i] = colDataGetData(pInputData[i], rowIdx); @@ -526,8 +526,8 @@ int32_t concatWsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p continue; } - int16_t dataLen = 0; - bool hasNull = false; + VarDataLenT dataLen = 0; + bool hasNull = false; for (int32_t i = 1; i < inputNum; ++i) { if (colDataIsNull_s(pInputData[i], k) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[i]))) { hasNull = true; @@ -695,7 +695,7 @@ int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu /** Conversion functions **/ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int16_t inputType = GET_PARAM_TYPE(&pInput[0]); - int16_t inputLen = GET_PARAM_BYTES(&pInput[0]); + int32_t inputLen = GET_PARAM_BYTES(&pInput[0]); int16_t outputType = GET_PARAM_TYPE(&pOutput[0]); int64_t outputLen = GET_PARAM_BYTES(&pOutput[0]); diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 6df2b40000..c49b5726b6 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -1814,6 +1814,11 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) { *ppVal = pVal; *vLen = cd.vLen; + } else { + if (TDB_CELLDECODER_FREE_VAL(&cd)) { + tdbTrace("tdb/btree-next2 decoder: %p pVal free: %p", &cd, cd.pVal); + tdbFree(cd.pVal); + } } ret = tdbBtcMoveToNext(pBtc); diff --git a/source/libs/tfs/src/tfs.c b/source/libs/tfs/src/tfs.c index 86b36b9b12..bedd14353f 100644 --- a/source/libs/tfs/src/tfs.c +++ b/source/libs/tfs/src/tfs.c @@ -283,6 +283,14 @@ int32_t tfsMkdir(STfs *pTfs, const char *rname) { return 0; } +bool tfsDirExistAt(STfs *pTfs, const char *rname, SDiskID diskId) { + STfsDisk *pDisk = TFS_DISK_AT(pTfs, diskId); + char aname[TMPNAME_LEN]; + + snprintf(aname, TMPNAME_LEN, "%s%s%s", pDisk->path, TD_DIRSEP, rname); + return taosDirExist(aname); +} + int32_t tfsRmdir(STfs *pTfs, const char *rname) { if (rname[0] == 0) { return 0; diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index f8f78ae6a5..be2ad730f7 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1241,7 +1241,7 @@ int32_t taosArrayCompareString(const void *a, const void *b) { int32_t comparestrPatternMatch(const void *pLeft, const void *pRight) { SPatternCompareInfo pInfo = PATTERN_COMPARE_INFO_INITIALIZER; - ASSERT(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN); + ASSERT(varDataTLen(pRight) <= TSDB_MAX_FIELD_LEN); size_t pLen = varDataLen(pRight); size_t sz = varDataLen(pLeft); diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 7b570df75a..2b54c41c3d 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -320,6 +320,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_QNODE_NOT_DEPLOYED, "Qnode not deployed") TAOS_DEFINE_ERROR(TSDB_CODE_SNODE_NOT_FOUND, "Snode not found") TAOS_DEFINE_ERROR(TSDB_CODE_SNODE_ALREADY_DEPLOYED, "Snode already deployed") TAOS_DEFINE_ERROR(TSDB_CODE_SNODE_NOT_DEPLOYED, "Snode not deployed") +TAOS_DEFINE_ERROR(TSDB_CODE_MNODE_NOT_CATCH_UP, "Mnode didn't catch the leader") +TAOS_DEFINE_ERROR(TSDB_CODE_MNODE_ALREADY_IS_VOTER, "Mnode already is a leader") +TAOS_DEFINE_ERROR(TSDB_CODE_MNODE_ONLY_TWO_MNODE, "Only two mnodes exist") // vnode TAOS_DEFINE_ERROR(TSDB_CODE_VND_INVALID_VGROUP_ID, "Vnode is closed or removed") @@ -335,6 +338,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_AVAIL_BUFPOOL, "No availabe buffer po TAOS_DEFINE_ERROR(TSDB_CODE_VND_STOPPED, "Vnode stopped") TAOS_DEFINE_ERROR(TSDB_CODE_VND_DUP_REQUEST, "Duplicate write request") TAOS_DEFINE_ERROR(TSDB_CODE_VND_QUERY_BUSY, "Query busy") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_NOT_CATCH_UP, "Vnode didn't catch up its leader") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_ALREADY_IS_VOTER, "Vnode already is a voter") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_DIR_ALREADY_EXIST, "Vnode directory already exist") // tsdb TAOS_DEFINE_ERROR(TSDB_CODE_TDB_INVALID_TABLE_ID, "Invalid table ID") diff --git a/tests/ci/Dockerfile b/tests/ci/Dockerfile index 594bcc902d..213570dfb2 100644 --- a/tests/ci/Dockerfile +++ b/tests/ci/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.8 RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple RUN pip3 install pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro RUN apt-get update -RUN apt-get install -y psmisc sudo tree libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind \ +RUN apt-get install -y psmisc sudo tree libgeos-dev libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind \ vim libjemalloc-dev openssh-server screen sshpass net-tools dirmngr gnupg apt-transport-https ca-certificates software-properties-common r-base iputils-ping RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' @@ -45,4 +45,4 @@ RUN pip3 uninstall -y taostest COPY repository/TDinternal /home/TDinternal COPY repository/taos-connector-python /home/taos-connector-python RUN sh -c "cd /home/taos-connector-python; pip3 install ." -COPY setup.sh /home/setup.sh \ No newline at end of file +COPY setup.sh /home/setup.sh diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 9f9679ae35..7b533f2cc4 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -134,7 +134,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py -,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py +#,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_stable.py @@ -338,6 +338,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_childtable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/delete_normaltable.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/keep_expired.py +,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/stmt_error.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/drop.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/drop.py -N 3 -M 3 -i False -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 80236cf604..0fc29c241b 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -68,7 +68,7 @@ docker run \ -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 \ - --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 -DJEMALLOC_ENABLED=true;make -j || exit 1" + --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 -DJEMALLOC_ENABLED=0;make -j || exit 1" # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ if [[ -d ${WORKDIR}/debugNoSan ]] ;then @@ -97,7 +97,7 @@ docker run \ -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 -DJEMALLOC_ENABLED=true;make -j || exit 1 " + --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 -DJEMALLOC_ENABLED=0;make -j || exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan diff --git a/tests/script/api/passwdTest.c b/tests/script/api/passwdTest.c index 8a2b0a0390..1bf4987689 100644 --- a/tests/script/api/passwdTest.c +++ b/tests/script/api/passwdTest.c @@ -33,8 +33,7 @@ #define nUser 10 #define USER_LEN 24 -void Test(TAOS *taos, char *qstr); -void createUers(TAOS *taos, const char *host, char *qstr); +void createUsers(TAOS *taos, const char *host, char *qstr); void passVerTestMulti(const char *host, char *qstr); int nPassVerNotified = 0; @@ -98,14 +97,14 @@ int main(int argc, char *argv[]) { printf("failed to connect to server, reason:%s\n", "null taos" /*taos_errstr(taos)*/); exit(1); } - createUers(taos, argv[1], qstr); + createUsers(taos, argv[1], qstr); passVerTestMulti(argv[1], qstr); taos_close(taos); taos_cleanup(); } -void createUers(TAOS *taos, const char *host, char *qstr) { +void createUsers(TAOS *taos, const char *host, char *qstr) { // users for (int i = 0; i < nUser; ++i) { sprintf(users[i], "user%d", i); diff --git a/tests/script/tsim/dnode/split_vgroup_replica1.sim b/tests/script/tsim/dnode/split_vgroup_replica1.sim index 51d63d25f4..135f7a579e 100644 --- a/tests/script/tsim/dnode/split_vgroup_replica1.sim +++ b/tests/script/tsim/dnode/split_vgroup_replica1.sim @@ -93,6 +93,19 @@ endi print =============== step4: split print split vgroup 2 sql split vgroup 2 +$wt = 0 + stepwt1: + $wt = $wt + 1 + sleep 1000 + if $wt == 200 then + print ====> split vgroup not completed! + return -1 + endi +sql show transactions +if $rows != 0 then + print wait 1 seconds to alter + goto stepwt1 +endi print =============== step5: check split result sql show d1.tables diff --git a/tests/script/tsim/query/partitionby.sim b/tests/script/tsim/query/partitionby.sim index 8babd1aa8d..4c221e02d3 100644 --- a/tests/script/tsim/query/partitionby.sim +++ b/tests/script/tsim/query/partitionby.sim @@ -36,4 +36,34 @@ if $rows != 0 then return -1 endi +sql insert into tb0 values (now, 0); +sql insert into tb1 values (now, 1); +sql insert into tb2 values (now, 2); +sql insert into tb3 values (now, 3); +sql insert into tb4 values (now, 4); +sql insert into tb5 values (now, 5); +sql insert into tb6 values (now, 6); +sql insert into tb7 values (now, 7); + +sql select * from (select 1 from $mt1 where ts is not null partition by tbname limit 1); +if $rows != 8 then + return -1 +endi + +sql select count(*) from (select ts from $mt1 where ts is not null partition by tbname slimit 2); +if $rows != 1 then + return -1 +endi +if $data00 != 2 then + return -1 +endi + +sql select count(*) from (select ts from $mt1 where ts is not null partition by tbname limit 2); +if $rows != 1 then + return -1 +endi +if $data00 != 8 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/system-test/1-insert/boundary.py b/tests/system-test/1-insert/boundary.py index d3742ef5f9..29dcbc7c46 100644 --- a/tests/system-test/1-insert/boundary.py +++ b/tests/system-test/1-insert/boundary.py @@ -166,6 +166,61 @@ class TDTestCase: else: tdLog.exit("error info is not true") tdSql.execute('drop database db') + + def row_col_tag_maxlen_check(self): + tdSql.prepare() + tdSql.execute('use db') + tdSql.execute('create table if not exists stb1 (ts timestamp, c1 int,c2 binary(1000)) tags (city binary(16382))') + tdSql.error('create table if not exists stb1 (ts timestamp, c1 int,c2 binary(1000)) tags (city binary(16383))') + tdSql.execute('create table if not exists stb2 (ts timestamp, c0 tinyint, c1 int, c2 nchar(16379)) tags (city binary(16382))') + tdSql.error('create table if not exists stb2 (ts timestamp, c0 smallint, c1 int, c2 nchar(16379)) tags (city binary(16382))') + tdSql.execute('create table if not exists stb3 (ts timestamp, c1 int, c2 binary(65517)) tags (city binary(16382))') + tdSql.error('create table if not exists stb3 (ts timestamp, c0 bool, c1 int, c2 binary(65517)) tags (city binary(16382))') + # prepare the column and tag data + char100='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0123456789' + tag_max_16382='' + binary_max_65517 = '' + nchar_max_16379='' + for num in range(163): + nchar_max_16379 += char100 + for num in range(4): + binary_max_65517 += char100 + + nchar_max_16379 += '0123456789012345678901234567890123456789012345678901234567890123456789012345678' + tag_max_16382 = nchar_max_16379 + tag_max_16382 += '9ab' + + for num in range(3): + binary_max_65517 += char100 + binary_max_65517 += '01234567890123456' + + # insert/query and check + tdSql.execute(f"create table ct1 using stb1 tags('{tag_max_16382}')") + tdSql.execute(f"create table ct2 using stb2 tags('{tag_max_16382}')") + tdSql.execute(f"create table ct3 using stb3 tags('{tag_max_16382}')") + tdSql.execute(f"insert into ct1 values (now,1,'nchar_max_16379')") + tdSql.execute(f"insert into ct2 values (now,1,1,'{nchar_max_16379}')") + tdSql.execute(f"insert into ct3 values (now,1,'{binary_max_65517}')") + + tdSql.query("select * from stb1") + tdSql.checkEqual(tdSql.queryResult[0][3],tag_max_16382) + + tdSql.query("select * from ct2") + tdSql.checkEqual(tdSql.queryResult[0][3],nchar_max_16379) + + tdSql.query("select * from stb2") + tdSql.checkEqual(tdSql.queryResult[0][3],nchar_max_16379) + tdSql.checkEqual(tdSql.queryResult[0][4],tag_max_16382) + + tdSql.query("select * from ct3") + tdSql.checkEqual(tdSql.queryResult[0][2],binary_max_65517) + + tdSql.query("select * from stb3") + tdSql.checkEqual(tdSql.queryResult[0][2],binary_max_65517) + tdSql.checkEqual(tdSql.queryResult[0][3],tag_max_16382) + + tdSql.execute('drop database db') + def run(self): self.dbname_length_check() self.tbname_length_check() @@ -174,6 +229,7 @@ class TDTestCase: self.username_length_check() self.password_length_check() self.sql_length_check() + self.row_col_tag_maxlen_check() def stop(self): tdSql.close() diff --git a/tests/system-test/1-insert/influxdb_line_taosc_insert.py b/tests/system-test/1-insert/influxdb_line_taosc_insert.py index 6372502484..3e9bad4efd 100644 --- a/tests/system-test/1-insert/influxdb_line_taosc_insert.py +++ b/tests/system-test/1-insert/influxdb_line_taosc_insert.py @@ -439,7 +439,7 @@ class TDTestCase: for input_sql in [self.genLongSql(127, 1)[0], self.genLongSql(1, 4093)[0]]: tdCom.cleanTb(dbname="test") self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - for input_sql in [self.genLongSql(129, 1)[0], self.genLongSql(1, 4095)[0]]: + for input_sql in [self.genLongSql(128, 1)[0], self.genLongSql(1, 4094)[0]]: tdCom.cleanTb(dbname="test") try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) @@ -578,10 +578,16 @@ class TDTestCase: # binary stb_name = tdCom.getLongName(7, "letters") - input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(16374, "letters")}" c0=f 1626006833639000000' + input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(4091, "letters")}" c0=f 1626006833639000000' self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(16375, "letters")}" c0=f 1626006833639000000' + input_sql = f'{stb_name},t0="a",t1="{tdCom.getLongName(4088, "letters")}" c0=f 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) + + input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(4092, "letters")}" c0=f 1626006833639000000' try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) except SchemalessError as err: @@ -590,10 +596,10 @@ class TDTestCase: # nchar # * legal nchar could not be larger than 16374/4 stb_name = tdCom.getLongName(7, "letters") - input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4093, "letters")}" c0=f 1626006833639000000' + input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4090, "letters")}" c0=f 1626006833639000000' self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4094, "letters")}" c0=f 1626006833639000000' + input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4091, "letters")}" c0=f 1626006833639000000' try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) except SchemalessError as err: @@ -672,28 +678,34 @@ class TDTestCase: except SchemalessError as err: tdSql.checkNotEqual(err.errno, 0) - # # # binary - # stb_name = tdCom.getLongName(7, "letters") - # input_sql = f'{stb_name},t0=t c0=f,c1="{tdCom.getLongName(16374, "letters")}" 1626006833639000000' - # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + # binary + stb_name = tdCom.getLongName(7, "letters") + input_sql = f'{stb_name},t0=t c0=1i32,c1="{tdCom.getLongName(65517, "letters")}" 1626006833639000000' + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - # input_sql = f'{stb_name},t0=t c0=f,c1="{tdCom.getLongName(16375, "letters")}" 1626006833639000000' - # try: - # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - # except SchemalessError as err: - # tdSql.checkNotEqual(err.errno, 0) + input_sql = f'{stb_name},t0=t c0=1i32,c1="{tdCom.getLongName(65517, "letters")},c2=f" 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) - # # nchar - # # * legal nchar could not be larger than 16374/4 - # stb_name = tdCom.getLongName(7, "letters") - # input_sql = f'{stb_name},t0=t c0=f,c1=L"{tdCom.getLongName(4093, "letters")}" 1626006833639000000' - # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + input_sql = f'{stb_name},t0=t c0=f,c1="{tdCom.getLongName(65518, "letters")}" 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) - # input_sql = f'{stb_name},t0=t c0=f,c1=L"{tdCom.getLongName(4094, "letters")}" 1626006833639000000' - # try: - # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - # except SchemalessError as err: - # tdSql.checkNotEqual(err.errno, 0) + # nchar + # * legal nchar could not be larger than 16374/4 + stb_name = tdCom.getLongName(7, "letters") + input_sql = f'{stb_name},t0=t c0=1i32,c1=L"{tdCom.getLongName(16379, "letters")}",c2=f 1626006833639000000' + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + + input_sql = f'{stb_name},t0=t c0=1i32,c1=L"{tdCom.getLongName(16380, "letters")}",c2=1i16 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) def tagColIllegalValueCheckCase(self): @@ -884,7 +896,7 @@ class TDTestCase: tdSql.checkRows(2) tdSql.checkNotEqual(tb_name1, tb_name3) - # * tag binary max is 16384, col+ts binary max 49151 + # * tag binary max is 16384-2, col+ts binary max 65531 def tagColBinaryMaxLengthCheckCase(self): """ every binary and nchar must be length+2 @@ -896,35 +908,59 @@ class TDTestCase: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) # * every binary and nchar must be length+2, so here is two tag, max length could not larger than 16384-2*2 - input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(16374, "letters")}",t2="{tdCom.getLongName(5, "letters")}" c0=f 1626006833639000000' + stb_name = tdCom.getLongName(8, "letters") + input_sql = f'{stb_name},t0=f,t1="{tdCom.getLongName(4091, "letters")}", c0=f 1626006833639000000' self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(2) - input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(16374, "letters")}",t2="{tdCom.getLongName(6, "letters")}" c0=f 1626006833639000000' + tdSql.checkRows(1) + + input_sql = f'{stb_name},t0=t,t1="{tdCom.getLongName(4092, "letters")}", c0=f 1626006833639000000' try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) raise Exception("should not reach here") except SchemalessError as err: tdSql.checkNotEqual(err.errno, 0) tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(2) + tdSql.checkRows(1) + + stb_name = tdCom.getLongName(9, "letters") # # * check col,col+ts max in describe ---> 16143 - input_sql = f'{stb_name},t0=t c0=f,c1="{tdCom.getLongName(16374, "letters")}",c2="{tdCom.getLongName(16374, "letters")}",c3="{tdCom.getLongName(16374, "letters")}",c4="{tdCom.getLongName(12, "letters")}" 1626006833639000000' + input_sql = f'{stb_name},t0=t c0=1i32,c1="{tdCom.getLongName(65517, "letters")}" 1626006833639000000' self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + input_sql = f'{stb_name},t0=t c0=1i32,c1="{tdCom.getLongName(65517, "letters")}",c2=f 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) + tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(3) + tdSql.checkRows(1) + + + stb_name = tdCom.getLongName(10, "letters") + input_sql = f'{stb_name},t0=t c0=1i16,c1="{tdCom.getLongName(49133, "letters")}",c2="{tdCom.getLongName(16384, "letters")}" 1626006833639000000' + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + + input_sql = f'{stb_name},t0=t c0=1i16,c1="{tdCom.getLongName(49133, "letters")}",c2="{tdCom.getLongName(16384, "letters")},c3=t" 1626006833639000000' + try: + self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + except SchemalessError as err: + tdSql.checkNotEqual(err.errno, 0) + + tdSql.query(f"select * from {stb_name}") + tdSql.checkRows(1) + input_sql = f'{stb_name},t0=t c0=f,c1="{tdCom.getLongName(16374, "letters")}",c2="{tdCom.getLongName(16374, "letters")}",c3="{tdCom.getLongName(16374, "letters")}",c4="{tdCom.getLongName(13, "letters")}" 1626006833639000000' try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) except SchemalessError as err: tdSql.checkNotEqual(err.errno, 0) - tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(3) - # * tag nchar max is 16374/4, col+ts nchar max 49151 + + # * tag nchar max is (16384-2)/4, col+ts nchar max 65531 def tagColNcharMaxLengthCheckCase(self): """ check nchar length limit @@ -935,30 +971,31 @@ class TDTestCase: input_sql = f'{stb_name},id="{tb_name}",t0=t c0=f 1626006833639000000' code = self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - # * legal nchar could not be larger than 16374/4 - input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4093, "letters")}",t2=L"{tdCom.getLongName(1, "letters")}" c0=f 1626006833639000000' - self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(2) - input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4093, "letters")}",t2=L"{tdCom.getLongName(2, "letters")}" c0=f 1626006833639000000' - try: - self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) - except SchemalessError as err: - tdSql.checkNotEqual(err.errno, 0) - tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(2) + # * legal tag nchar could not be larger than (16384-2)/4 + # input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4093, "letters")}",t2=L"{tdCom.getLongName(1, "letters")}" c0=f 1626006833639000000' + # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + # tdSql.query(f"select * from {stb_name}") + # tdSql.checkRows(2) + # input_sql = f'{stb_name},t0=t,t1=L"{tdCom.getLongName(4093, "letters")}",t2=L"{tdCom.getLongName(2, "letters")}" c0=f 1626006833639000000' + # try: + # self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) + # except SchemalessError as err: + # tdSql.checkNotEqual(err.errno, 0) + # tdSql.query(f"select * from {stb_name}") + # tdSql.checkRows(2) input_sql = f'{stb_name},t0=t c0=f,c1=L"{tdCom.getLongName(4093, "letters")}",c2=L"{tdCom.getLongName(4093, "letters")}",c3=L"{tdCom.getLongName(4093, "letters")}",c4=L"{tdCom.getLongName(4, "letters")}" 1626006833639000000' self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(3) + tdSql.checkRows(2) + input_sql = f'{stb_name},t0=t c0=f,c1=L"{tdCom.getLongName(4093, "letters")}",c2=L"{tdCom.getLongName(4093, "letters")}",c3=L"{tdCom.getLongName(4093, "letters")}",c4=L"{tdCom.getLongName(5, "letters")}" 1626006833639000000' try: self._conn.schemaless_insert([input_sql], TDSmlProtocolType.LINE.value, TDSmlTimestampType.NANO_SECOND.value) except SchemalessError as err: tdSql.checkNotEqual(err.errno, 0) tdSql.query(f"select * from {stb_name}") - tdSql.checkRows(3) + tdSql.checkRows(2) def batchInsertCheckCase(self): """ @@ -1274,13 +1311,13 @@ class TDTestCase: self.idSeqCheckCase() self.idUpperCheckCase() self.noIdCheckCase() - # self.maxColTagCheckCase() + self.maxColTagCheckCase() self.idIllegalNameCheckCase() self.idStartWithNumCheckCase() self.nowTsCheckCase() self.dateFormatTsCheckCase() self.illegalTsCheckCase() - # self.tagValueLengthCheckCase() + self.tagValueLengthCheckCase() self.colValueLengthCheckCase() self.tagColIllegalValueCheckCase() self.duplicateIdTagColInsertCheckCase() @@ -1290,8 +1327,8 @@ class TDTestCase: self.tagColAddDupIDCheckCase() self.tagColAddCheckCase() self.tagMd5Check() - # self.tagColBinaryMaxLengthCheckCase() - # self.tagColNcharMaxLengthCheckCase() + self.tagColBinaryMaxLengthCheckCase() + self.tagColNcharMaxLengthCheckCase() self.batchInsertCheckCase() self.multiInsertCheckCase(10) self.batchErrorInsertCheckCase() diff --git a/tests/system-test/1-insert/stmt_error.py b/tests/system-test/1-insert/stmt_error.py new file mode 100644 index 0000000000..c6d747c317 --- /dev/null +++ b/tests/system-test/1-insert/stmt_error.py @@ -0,0 +1,224 @@ +# encoding:UTF-8 +from taos import * + +from ctypes import * +from datetime import datetime +import taos + +import taos +import time + +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + +class TDTestCase: + def __init__(self): + self.err_case = 0 + self.curret_case = 0 + + def caseDescription(self): + + ''' + case1 : [TD-11899] : this is an test case for check stmt error use . + ''' + return + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def conn(self): + # type: () -> taos.TaosConnection + return connect() + + def test_stmt_insert(self,conn): + # type: (TaosConnection) -> None + + dbname = "pytest_taos_stmt" + try: + conn.execute("drop database if exists %s" % dbname) + conn.execute("create database if not exists %s" % dbname) + conn.select_db(dbname) + + conn.execute( + "create table if not exists log(ts timestamp, bo bool, nil tinyint, ti tinyint, si smallint, ii int,\ + bi bigint, tu tinyint unsigned, su smallint unsigned, iu int unsigned, bu bigint unsigned, \ + ff float, dd double, bb binary(65059), nn nchar(100), tt timestamp)", + ) + conn.load_table_info("log") + + + stmt = conn.statement("insert into log values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)") + params = new_bind_params(16) + params[0].timestamp(1626861392589, PrecisionEnum.Milliseconds) + params[1].bool(True) + params[2].tinyint(None) + params[3].tinyint(2) + params[4].smallint(3) + params[5].int(4) + params[6].bigint(5) + params[7].tinyint_unsigned(6) + params[8].smallint_unsigned(7) + params[9].int_unsigned(8) + params[10].bigint_unsigned(9) + params[11].float(10.1) + params[12].double(10.11) + binaryStr = '123456789' + for i in range(1301): + binaryStr += "1234567890abcdefghij1234567890abcdefghij12345hello" + params[13].binary(binaryStr) + params[14].nchar("stmt") + params[15].timestamp(1626861392589, PrecisionEnum.Milliseconds) + + stmt.bind_param(params) + stmt.execute() + + assert stmt.affected_rows == 1 + stmt.close() + + querystmt=conn.statement("select ?, bo, nil, ti, si, ii,bi, tu, su, iu, bu, ff, dd, bb, nn, tt from log") + queryparam=new_bind_params(1) + print(type(queryparam)) + queryparam[0].binary("ts") + querystmt.bind_param(queryparam) + querystmt.execute() + result=querystmt.use_result() + + row=result.fetch_all() + print(row) + + assert row[0][1] == True + assert row[0][2] == None + for i in range(3, 10): + assert row[0][i] == i - 1 + #float == may not work as expected + # assert row[0][11] == c_float(10.1) + assert row[0][12] == 10.11 + assert row[0][13][65054:] == "hello" + assert row[0][14] == "stmt" + + conn.execute("drop database if exists %s" % dbname) + conn.close() + + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + raise err + + def test_stmt_insert_error(self,conn): + # type: (TaosConnection) -> None + + dbname = "pytest_taos_stmt_error" + try: + conn.execute("drop database if exists %s" % dbname) + conn.execute("create database if not exists %s" % dbname) + conn.select_db(dbname) + + conn.execute( + "create table if not exists log(ts timestamp, bo bool, nil tinyint, ti tinyint, si smallint, ii int,\ + bi bigint, tu tinyint unsigned, su smallint unsigned, iu int unsigned, bu bigint unsigned, \ + ff float, dd double, bb binary(100), nn nchar(100), tt timestamp , error_data int )", + ) + conn.load_table_info("log") + + + stmt = conn.statement("insert into log values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1000)") + params = new_bind_params(16) + params[0].timestamp(1626861392589, PrecisionEnum.Milliseconds) + params[1].bool(True) + params[2].tinyint(None) + params[3].tinyint(2) + params[4].smallint(3) + params[5].int(4) + params[6].bigint(5) + params[7].tinyint_unsigned(6) + params[8].smallint_unsigned(7) + params[9].int_unsigned(8) + params[10].bigint_unsigned(9) + params[11].float(10.1) + params[12].double(10.11) + params[13].binary("hello") + params[14].nchar("stmt") + params[15].timestamp(1626861392589, PrecisionEnum.Milliseconds) + + stmt.bind_param(params) + stmt.execute() + + conn.close() + + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + raise err + + def test_stmt_insert_error_null_timestamp(self,conn): + + dbname = "pytest_taos_stmt_error_null_ts" + try: + conn.execute("drop database if exists %s" % dbname) + conn.execute("create database if not exists %s" % dbname) + conn.execute("alter database %s keep 36500" % dbname) + conn.select_db(dbname) + + conn.execute("create stable STB(ts timestamp, n int) tags(b int)") + + stmt = conn.statement("insert into ? using STB tags(?) values(?, ?)") + params = new_bind_params(1) + params[0].int(4); + stmt.set_tbname_tags("ct", params); + + multi_params = new_multi_binds(2); + multi_params[0].timestamp([9223372036854775808]) + multi_params[1].int([123]) + stmt.bind_param_batch(multi_params) + + stmt.execute() + result = stmt.use_result() + + result.close() + stmt.close() + + stmt = conn.statement("select * from STB") + stmt.execute() + result = stmt.use_result() + print(result.affected_rows) + row = result.next() + print(row) + + result.close() + stmt.close() + conn.close() + + except Exception as err: + conn.close() + raise err + + def run(self): + + self.test_stmt_insert(self.conn()) + try: + self.test_stmt_insert_error(self.conn()) + except Exception as error : + + if str(error)=='[0x0200]: no mix usage for ? and values': + tdLog.info('=========stmt error occured for bind part column ==============') + else: + tdLog.exit("expect error(%s) not occured" % str(error)) + + try: + self.test_stmt_insert_error_null_timestamp(self.conn()) + tdLog.exit("expect error not occured - 1") + except Exception as error : + if str(error)=='[0x060b]: Timestamp data out of range': + tdLog.info('=========stmt error occured for bind part column(NULL Timestamp) ==============') + else: + tdLog.exit("expect error(%s) not occured - 2" % str(error)) + def stop(self): + tdSql.close() + 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/2-query/interp.py b/tests/system-test/2-query/interp.py index ddf3f2534d..cdbfa0de84 100644 --- a/tests/system-test/2-query/interp.py +++ b/tests/system-test/2-query/interp.py @@ -23,6 +23,8 @@ class TDTestCase: stbname = "stb" ctbname1 = "ctb1" ctbname2 = "ctb2" + ctbname3 = "ctb3" + num_of_ctables = 3 tdSql.prepare() @@ -816,17 +818,26 @@ class TDTestCase: ) tdSql.execute( - f'''create table if not exists {dbname}.{ctbname2} using {dbname}.{stbname} tags(1) + f'''create table if not exists {dbname}.{ctbname2} using {dbname}.{stbname} tags(2) ''' ) - tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar')") - tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar')") - tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')") + tdSql.execute( + f'''create table if not exists {dbname}.{ctbname3} using {dbname}.{stbname} tags(3) + ''' + ) - tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-02 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar')") - tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-02 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar')") - tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-02 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:01', 1, 1, 1, 1, 1.0, 1.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:07', 7, 7, 7, 7, 7.0, 7.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:13', 13, 13, 13, 13, 13.0, 13.0, true, 'varchar', 'nchar')") + + tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-01 00:00:03', 3, 3, 3, 3, 3.0, 3.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-01 00:00:09', 9, 9, 9, 9, 9.0, 9.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname2} values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')") + + tdSql.execute(f"insert into {dbname}.{ctbname3} values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname3} values ('2020-02-01 00:00:11', 11, 11, 11, 11, 11.0, 11.0, true, 'varchar', 'nchar')") + tdSql.execute(f"insert into {dbname}.{ctbname3} values ('2020-02-01 00:00:17', 17, 17, 17, 17, 17.0, 17.0, true, 'varchar', 'nchar')") tdSql.execute(f"flush database {dbname}"); @@ -834,7 +845,7 @@ class TDTestCase: # test fill null ## | {. | | .} | - tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:05') every(1d) fill(null)") + tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:06') every(1d) fill(null)") tdSql.checkRows(11) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, None) @@ -881,7 +892,7 @@ class TDTestCase: # test fill value ## | {. | | .} | - tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:05') every(1d) fill(value, 1)") + tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:06') every(1d) fill(value, 1)") tdSql.checkRows(11) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, 1) @@ -895,7 +906,7 @@ class TDTestCase: tdSql.checkData(9, 0, 1) tdSql.checkData(10, 0, 15) - ## | . | {} | . | + # | . | {} | . | tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-03 00:00:05', '2020-02-07 00:00:05') every(1d) fill(value, 1)") tdSql.checkRows(5) tdSql.checkData(0, 0, 1) @@ -928,7 +939,7 @@ class TDTestCase: # test fill prev ## | {. | | .} | - tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:05') every(1d) fill(prev)") + tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:06') every(1d) fill(prev)") tdSql.checkRows(11) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, 5) @@ -973,7 +984,7 @@ class TDTestCase: # test fill next ## | {. | | .} | - tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:05') every(1d) fill(next)") + tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:06') every(1d) fill(next)") tdSql.checkRows(11) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, 15) @@ -1015,7 +1026,7 @@ class TDTestCase: # test fill linear ## | {. | | .} | - tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:05') every(1d) fill(linear)") + tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-11 00:00:06') every(1d) fill(linear)") tdSql.checkRows(11) tdSql.checkData(0, 0, 5) tdSql.checkData(1, 0, 6) @@ -2391,19 +2402,516 @@ class TDTestCase: - tdLog.printNoPrefix("==========step13:stable cases") + tdLog.printNoPrefix("==========step13:test stable cases") - tdSql.error(f"select interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)") - #tdSql.checkRows(13) + # select interp from supertable + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") + tdSql.checkRows(19) - #tdSql.query(f"select interp(c0) from {dbname}.{ctbname1} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)") - #tdSql.checkRows(13) + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 2, 1) + tdSql.checkData(2, 2, None) + tdSql.checkData(3, 2, 3) + tdSql.checkData(4, 2, None) + tdSql.checkData(5, 2, 5) + tdSql.checkData(6, 2, None) + tdSql.checkData(7, 2, 7) + tdSql.checkData(8, 2, None) + tdSql.checkData(9, 2, 9) + tdSql.checkData(10, 2, None) + tdSql.checkData(11, 2, 11) + tdSql.checkData(12, 2, None) + tdSql.checkData(13, 2, 13) + tdSql.checkData(14, 2, None) + tdSql.checkData(15, 2, 15) + tdSql.checkData(16, 2, None) + tdSql.checkData(17, 2, 17) + tdSql.checkData(18, 2, None) - tdSql.error(f"select interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1s) fill(null)") - #tdSql.checkRows(13) + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)") + tdSql.checkRows(19) + + tdSql.checkData(0, 2, 0) + tdSql.checkData(1, 2, 1) + tdSql.checkData(2, 2, 0) + tdSql.checkData(3, 2, 3) + tdSql.checkData(4, 2, 0) + tdSql.checkData(5, 2, 5) + tdSql.checkData(6, 2, 0) + tdSql.checkData(7, 2, 7) + tdSql.checkData(8, 2, 0) + tdSql.checkData(9, 2, 9) + tdSql.checkData(10, 2, 0) + tdSql.checkData(11, 2, 11) + tdSql.checkData(12, 2, 0) + tdSql.checkData(13, 2, 13) + tdSql.checkData(14, 2, 0) + tdSql.checkData(15, 2, 15) + tdSql.checkData(16, 2, 0) + tdSql.checkData(17, 2, 17) + tdSql.checkData(18, 2, 0) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)") + tdSql.checkRows(18) + + tdSql.checkData(0, 0, '2020-02-01 00:00:01.000') + tdSql.checkData(0, 1, False) + + tdSql.checkData(0, 2, 1) + tdSql.checkData(1, 2, 1) + tdSql.checkData(2, 2, 3) + tdSql.checkData(3, 2, 3) + tdSql.checkData(4, 2, 5) + tdSql.checkData(5, 2, 5) + tdSql.checkData(6, 2, 7) + tdSql.checkData(7, 2, 7) + tdSql.checkData(8, 2, 9) + tdSql.checkData(9, 2, 9) + tdSql.checkData(10, 2, 11) + tdSql.checkData(11, 2, 11) + tdSql.checkData(12, 2, 13) + tdSql.checkData(13, 2, 13) + tdSql.checkData(14, 2, 15) + tdSql.checkData(15, 2, 15) + tdSql.checkData(16, 2, 17) + tdSql.checkData(17, 2, 17) + + tdSql.checkData(17, 0, '2020-02-01 00:00:18.000') + tdSql.checkData(17, 1, True) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") + tdSql.checkRows(18) + + tdSql.checkData(0, 0, '2020-02-01 00:00:00.000') + tdSql.checkData(0, 1, True) + + tdSql.checkData(0, 2, 1) + tdSql.checkData(1, 2, 1) + tdSql.checkData(2, 2, 3) + tdSql.checkData(3, 2, 3) + tdSql.checkData(4, 2, 5) + tdSql.checkData(5, 2, 5) + tdSql.checkData(6, 2, 7) + tdSql.checkData(7, 2, 7) + tdSql.checkData(8, 2, 9) + tdSql.checkData(9, 2, 9) + tdSql.checkData(10, 2, 11) + tdSql.checkData(11, 2, 11) + tdSql.checkData(12, 2, 13) + tdSql.checkData(13, 2, 13) + tdSql.checkData(14, 2, 15) + tdSql.checkData(15, 2, 15) + tdSql.checkData(16, 2, 17) + tdSql.checkData(17, 2, 17) + + tdSql.checkData(17, 0, '2020-02-01 00:00:17.000') + tdSql.checkData(17, 1, False) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(17) + + tdSql.checkData(0, 2, 1) + tdSql.checkData(1, 2, 2) + tdSql.checkData(2, 2, 3) + tdSql.checkData(3, 2, 4) + tdSql.checkData(4, 2, 5) + tdSql.checkData(5, 2, 6) + tdSql.checkData(6, 2, 7) + tdSql.checkData(7, 2, 8) + tdSql.checkData(8, 2, 9) + tdSql.checkData(9, 2, 10) + tdSql.checkData(10, 2, 11) + tdSql.checkData(11, 2, 12) + tdSql.checkData(12, 2, 13) + tdSql.checkData(13, 2, 14) + tdSql.checkData(14, 2, 15) + tdSql.checkData(15, 2, 16) + tdSql.checkData(16, 2, 17) + + # select interp from supertable partition by tbname + + tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") + + point_idx = {1, 7, 13, 22, 28, 34, 43, 49, 55} + point_dict = {1:1, 7:7, 13:13, 22:3, 28:9, 34:15, 43:5, 49:11, 55:17} + rows_per_partition = 19 + tdSql.checkRows(rows_per_partition * num_of_ctables) + for i in range(num_of_ctables): + for j in range(rows_per_partition): + row = j + i * rows_per_partition + tdSql.checkData(row, 0, f'ctb{i + 1}') + tdSql.checkData(j, 1, f'2020-02-01 00:00:{j}.000') + if row in point_idx: + tdSql.checkData(row, 2, False) + else: + tdSql.checkData(row, 2, True) + + if row in point_idx: + tdSql.checkData(row, 3, point_dict[row]) + else: + tdSql.checkData(row, 3, None) + + tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)") + + point_idx = {1, 7, 13, 22, 28, 34, 43, 49, 55} + point_dict = {1:1, 7:7, 13:13, 22:3, 28:9, 34:15, 43:5, 49:11, 55:17} + rows_per_partition = 19 + tdSql.checkRows(rows_per_partition * num_of_ctables) + for i in range(num_of_ctables): + for j in range(rows_per_partition): + row = j + i * rows_per_partition + tdSql.checkData(row, 0, f'ctb{i + 1}') + tdSql.checkData(j, 1, f'2020-02-01 00:00:{j}.000') + if row in point_idx: + tdSql.checkData(row, 2, False) + else: + tdSql.checkData(row, 2, True) + + if row in point_idx: + tdSql.checkData(row, 3, point_dict[row]) + else: + tdSql.checkData(row, 3, 0) + + tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)") + + tdSql.checkRows(48) + for i in range(0, 18): + tdSql.checkData(i, 0, 'ctb1') + + for i in range(18, 34): + tdSql.checkData(i, 0, 'ctb2') + + for i in range(34, 48): + tdSql.checkData(i, 0, 'ctb3') + + tdSql.checkData(0, 1, '2020-02-01 00:00:01.000') + tdSql.checkData(17, 1, '2020-02-01 00:00:18.000') + + tdSql.checkData(18, 1, '2020-02-01 00:00:03.000') + tdSql.checkData(33, 1, '2020-02-01 00:00:18.000') + + tdSql.checkData(34, 1, '2020-02-01 00:00:05.000') + tdSql.checkData(47, 1, '2020-02-01 00:00:18.000') + + for i in range(0, 6): + tdSql.checkData(i, 3, 1) + + for i in range(6, 12): + tdSql.checkData(i, 3, 7) + + for i in range(12, 18): + tdSql.checkData(i, 3, 13) + + for i in range(18, 24): + tdSql.checkData(i, 3, 3) + + for i in range(24, 30): + tdSql.checkData(i, 3, 9) + + for i in range(30, 34): + tdSql.checkData(i, 3, 15) + + for i in range(34, 40): + tdSql.checkData(i, 3, 5) + + for i in range(40, 46): + tdSql.checkData(i, 3, 11) + + for i in range(46, 48): + tdSql.checkData(i, 3, 17) + + tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") + + tdSql.checkRows(48) + for i in range(0, 14): + tdSql.checkData(i, 0, 'ctb1') + + for i in range(14, 30): + tdSql.checkData(i, 0, 'ctb2') + + for i in range(30, 48): + tdSql.checkData(i, 0, 'ctb3') + + tdSql.checkData(0, 1, '2020-02-01 00:00:00.000') + tdSql.checkData(13, 1, '2020-02-01 00:00:13.000') + + tdSql.checkData(14, 1, '2020-02-01 00:00:00.000') + tdSql.checkData(29, 1, '2020-02-01 00:00:15.000') + + tdSql.checkData(30, 1, '2020-02-01 00:00:00.000') + tdSql.checkData(47, 1, '2020-02-01 00:00:17.000') + + for i in range(0, 2): + tdSql.checkData(i, 3, 1) + + for i in range(2, 8): + tdSql.checkData(i, 3, 7) + + for i in range(8, 14): + tdSql.checkData(i, 3, 13) + + for i in range(14, 18): + tdSql.checkData(i, 3, 3) + + for i in range(18, 24): + tdSql.checkData(i, 3, 9) + + for i in range(24, 30): + tdSql.checkData(i, 3, 15) + + for i in range(30, 36): + tdSql.checkData(i, 3, 5) + + for i in range(36, 42): + tdSql.checkData(i, 3, 11) + + for i in range(42, 48): + tdSql.checkData(i, 3, 17) + + tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + + tdSql.checkRows(39) + for i in range(0, 13): + tdSql.checkData(i, 0, 'ctb1') + + for i in range(13, 26): + tdSql.checkData(i, 0, 'ctb2') + + for i in range(26, 39): + tdSql.checkData(i, 0, 'ctb3') + + tdSql.checkData(0, 1, '2020-02-01 00:00:01.000') + tdSql.checkData(12, 1, '2020-02-01 00:00:13.000') + + tdSql.checkData(13, 1, '2020-02-01 00:00:03.000') + tdSql.checkData(25, 1, '2020-02-01 00:00:15.000') + + tdSql.checkData(26, 1, '2020-02-01 00:00:05.000') + tdSql.checkData(38, 1, '2020-02-01 00:00:17.000') + + for i in range(0, 13): + tdSql.checkData(i, 3, i + 1) + + for i in range(13, 26): + tdSql.checkData(i, 3, i - 10) + + for i in range(26, 39): + tdSql.checkData(i, 3, i - 21) + + # select interp from supertable partition by column + + tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") + tdSql.checkRows(171) + + tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)") + tdSql.checkRows(171) + + tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)") + tdSql.checkRows(90) + + tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") + tdSql.checkRows(90) + + tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(9) + + # select interp from supertable partition by tag + + tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") + tdSql.checkRows(57) + + tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)") + tdSql.checkRows(57) + + tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)") + tdSql.checkRows(48) + + tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)") + tdSql.checkRows(48) + + tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(39) + + # select interp from supertable filter + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where c0 <= 13 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where t1 = 1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where tbname = 'ctb1' range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(27) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where c0 <= 13 partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(27) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where t1 = 1 partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where tbname = 'ctb1' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + # select interp from supertable filter limit + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 13") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 20") + tdSql.checkRows(17) + + for i in range(17): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where c0 <= 13 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where t1 = 1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where tbname = 'ctb1' range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 13") + tdSql.checkRows(13) + + for i in range(13): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 40") + tdSql.checkRows(39) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where c0 <= 13 partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where t1 = 1 partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where tbname = 'ctb1' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10") + tdSql.checkRows(10) + + for i in range(10): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 1) + + # select interp from supertable with scalar expression + + tdSql.query(f"select _irowts, _isfilled, interp(1 + 1) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(17) + + for i in range(17): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, 2.0) + + tdSql.query(f"select _irowts, _isfilled, interp(c0 + 1) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(17) + + for i in range(17): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, i + 2) + + tdSql.query(f"select _irowts, _isfilled, interp(c0 * 2) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(17) + + for i in range(17): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, (i + 1) * 2) + + tdSql.query(f"select _irowts, _isfilled, interp(c0 + c1) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)") + tdSql.checkRows(17) + + for i in range(17): + tdSql.checkData(i, 0, f'2020-02-01 00:00:{i + 1}.000') + tdSql.checkData(i, 2, (i + 1) * 2) + + # check duplicate timestamp + + # add duplicate timestamp for different child tables + tdSql.execute(f"insert into {dbname}.{ctbname1} values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')") + + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:14') every(1s) fill(null)") + tdSql.error(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:15') every(1s) fill(null)") + tdSql.error(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") + tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)") - #tdSql.query(f"select _irowts,interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1h) fill(prev)") - #tdSql.query(f"select tbname,_irowts,interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1h) fill(prev)") tdLog.printNoPrefix("======step 14: test interp pseudo columns") tdSql.error(f"select _irowts, c6 from {dbname}.{tbname}") diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py index a05e057042..f7851ad04b 100644 --- a/tests/system-test/2-query/odbc.py +++ b/tests/system-test/2-query/odbc.py @@ -22,7 +22,8 @@ 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, 277) + # enterprise version: 285, community version: 277 + tdSql.checkData(0, 0, 285) tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") tdSql.checkRows(14) diff --git a/tests/system-test/runAllOne.sh b/tests/system-test/runAllOne.sh index 5a8d358d98..40addb0ca5 100644 --- a/tests/system-test/runAllOne.sh +++ b/tests/system-test/runAllOne.sh @@ -287,6 +287,7 @@ python3 ./test.py -f 1-insert/tb_100w_data_order.py -P python3 ./test.py -f 1-insert/delete_childtable.py -P python3 ./test.py -f 1-insert/delete_normaltable.py -P python3 ./test.py -f 1-insert/keep_expired.py -P +python3 ./test.py -f 1-insert/stmt_error.py -P python3 ./test.py -f 1-insert/drop.py -P python3 ./test.py -f 2-query/join2.py -P python3 ./test.py -f 2-query/union1.py -P diff --git a/tests/system-test/win-test-file b/tests/system-test/win-test-file index 7e68c40fd8..8b7b7d868d 100644 --- a/tests/system-test/win-test-file +++ b/tests/system-test/win-test-file @@ -218,6 +218,7 @@ python3 ./test.py -f 1-insert/delete_stable.py python3 ./test.py -f 1-insert/delete_childtable.py python3 ./test.py -f 1-insert/delete_normaltable.py python3 ./test.py -f 1-insert/keep_expired.py +python3 ./test.py -f 1-insert/stmt_error.py python3 ./test.py -f 1-insert/drop.py python3 ./test.py -f 1-insert/drop.py -N 3 -M 3 -i False -n 3 python3 ./test.py -f 2-query/join2.py diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 478801d3e7..0123472e3a 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -712,7 +712,7 @@ int32_t shellCalcColWidth(TAOS_FIELD *field, int32_t precision) { case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_JSON: { - int16_t bytes = field->bytes * TSDB_NCHAR_SIZE; + uint16_t bytes = field->bytes * TSDB_NCHAR_SIZE; if (bytes > shell.args.displayWidth) { return TMAX(shell.args.displayWidth, width); } else {